lab

package
v0.0.0-...-1d32ed5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ExportSchemaVersion = 1

Variables

This section is empty.

Functions

func WriteFakePi

func WriteFakePi(dir string) (string, error)

Types

type AnalysisReport

type AnalysisReport struct {
	SchemaVersion int    `json:"schemaVersion"`
	Provider      string `json:"provider"`
	Model         string `json:"model"`
	EventCount    int    `json:"eventCount"`
	ErrorCount    int    `json:"errorCount"`
	ToolCallCount int    `json:"toolCallCount"`
	QuestionCount int    `json:"questionCount"`
	TerminalCount int    `json:"terminalCount"`
	PlanCallCount int    `json:"planCallCount"`
}

func AnalyzeBundle

func AnalyzeBundle(bundle ExportBundle) (AnalysisReport, error)

type ExportBundle

type ExportBundle struct {
	SchemaVersion int            `json:"schemaVersion"`
	ExportedAt    string         `json:"exportedAt"`
	Config        SessionConfig  `json:"config"`
	Events        []SessionEvent `json:"events"`
}

type ExportOptions

type ExportOptions struct {
	IncludeSensitive bool `json:"includeSensitive"`
}

type LocalRelay

type LocalRelay struct {
	// contains filtered or unexported fields
}

func NewLocalRelay

func NewLocalRelay(opts LocalRelayOptions) *LocalRelay

func (*LocalRelay) HandleDaemonWS

func (r *LocalRelay) HandleDaemonWS(w http.ResponseWriter, req *http.Request)

func (*LocalRelay) HandleUIWS

func (r *LocalRelay) HandleUIWS(w http.ResponseWriter, req *http.Request)

func (*LocalRelay) SendRawToDaemon

func (r *LocalRelay) SendRawToDaemon(ctx context.Context, data []byte) error

func (*LocalRelay) SendToDaemon

func (r *LocalRelay) SendToDaemon(ctx context.Context, payload any) error

type LocalRelayOptions

type LocalRelayOptions struct {
	MachineID string
	AuthToken string
	Store     *SessionStore
}

type PreflightCheck

type PreflightCheck struct {
	Name    string `json:"name"`
	OK      bool   `json:"ok"`
	Message string `json:"message,omitempty"`
}

type PreflightOptions

type PreflightOptions struct {
	CWD           string
	Provider      string
	Model         string
	FakeMode      bool
	PiBinary      string
	ClaudeBinary  string
	ExtensionPath string
}

type PreflightResult

type PreflightResult struct {
	OK     bool             `json:"ok"`
	Checks []PreflightCheck `json:"checks"`
}

func RunPreflight

func RunPreflight(opts PreflightOptions) PreflightResult

type RedactEvent

type RedactEvent struct {
	Path   string `json:"path"`
	Reason string `json:"reason"`
	Hash   string `json:"hash"`
}

type Redactor

type Redactor struct{}

func DefaultRedactor

func DefaultRedactor() Redactor

func (Redactor) Redact

func (r Redactor) Redact(path string, value string) (string, []RedactEvent)

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(opts RunnerOptions) *Runner

func (*Runner) HomeDir

func (r *Runner) HomeDir() string

func (*Runner) Start

func (r *Runner) Start(ctx context.Context) error

func (*Runner) Wait

func (r *Runner) Wait() error

func (*Runner) WriteConfig

func (r *Runner) WriteConfig() error

type RunnerOptions

type RunnerOptions struct {
	BinaryPath    string
	SessionDir    string
	RelayURL      string
	MachineID     string
	AuthToken     string
	FakeMode      bool
	PiBinary      string
	WarmWorkers   *bool
	ExtensionPath string
}

type Scenario

type Scenario struct {
	ID     string `json:"id"`
	Label  string `json:"label"`
	Prompt string `json:"prompt"`
}

func BuiltInScenarios

func BuiltInScenarios() []Scenario

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts ServerOptions) *Server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ServerOptions

type ServerOptions struct {
	Store *SessionStore
	Relay *LocalRelay
	CWD   string
}

type SessionConfig

type SessionConfig struct {
	CWD            string `json:"cwd"`
	Provider       string `json:"provider"`
	Model          string `json:"model"`
	Effort         string `json:"effort"`
	PermissionMode string `json:"permissionMode"`
	FakeMode       bool   `json:"fakeMode"`
	PiBinary       string `json:"piBinary,omitempty"`
	WarmWorkers    *bool  `json:"warmWorkers,omitempty"`
}

type SessionEvent

type SessionEvent struct {
	Sequence  int64         `json:"sequence"`
	ID        string        `json:"id"`
	Kind      string        `json:"kind"`
	Timestamp string        `json:"timestamp"`
	Payload   any           `json:"payload,omitempty"`
	Redacted  []RedactEvent `json:"redacted,omitempty"`
}

type SessionStore

type SessionStore struct {
	// contains filtered or unexported fields
}

func NewSessionStore

func NewSessionStore(opts SessionStoreOptions) (*SessionStore, error)

func (*SessionStore) Append

func (s *SessionStore) Append(kind string, payload any) error

func (*SessionStore) Config

func (s *SessionStore) Config() SessionConfig

func (*SessionStore) Dir

func (s *SessionStore) Dir() string

func (*SessionStore) Export

func (s *SessionStore) Export(opts ExportOptions) (ExportBundle, error)

type SessionStoreOptions

type SessionStoreOptions struct {
	RootDir string
	Config  SessionConfig
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL