Documentation
¶
Index ¶
- Constants
- Variables
- type AgentSpec
- type Callbacks
- func (*Callbacks) CreateTerminal(context.Context, acpsdk.CreateTerminalRequest) (acpsdk.CreateTerminalResponse, error)
- func (c *Callbacks) Cwd() string
- func (*Callbacks) KillTerminalCommand(context.Context, acpsdk.KillTerminalCommandRequest) (acpsdk.KillTerminalCommandResponse, error)
- func (c *Callbacks) ReadTextFile(_ context.Context, p acpsdk.ReadTextFileRequest) (acpsdk.ReadTextFileResponse, error)
- func (*Callbacks) ReleaseTerminal(context.Context, acpsdk.ReleaseTerminalRequest) (acpsdk.ReleaseTerminalResponse, error)
- func (*Callbacks) RequestPermission(_ context.Context, p acpsdk.RequestPermissionRequest) (acpsdk.RequestPermissionResponse, error)
- func (c *Callbacks) Reset()
- func (c *Callbacks) SessionUpdate(ctx context.Context, n acpsdk.SessionNotification) error
- func (c *Callbacks) Snapshot() ([]acpsdk.SessionNotification, string)
- func (*Callbacks) TerminalOutput(context.Context, acpsdk.TerminalOutputRequest) (acpsdk.TerminalOutputResponse, error)
- func (c *Callbacks) UpdateCount() int
- func (*Callbacks) WaitForTerminalExit(context.Context, acpsdk.WaitForTerminalExitRequest) (acpsdk.WaitForTerminalExitResponse, error)
- func (c *Callbacks) WaitForUpdate(ctx context.Context, previous int)
- func (c *Callbacks) WriteTextFile(_ context.Context, p acpsdk.WriteTextFileRequest) (acpsdk.WriteTextFileResponse, error)
- type CancelRequest
- type Client
- type DrainOptions
- type DrainPromptRunner
- type DrainResult
- type OwnerLock
- type PendingPrompt
- type QueuedPrompt
- type Registry
- type Result
- type RunOptions
- type SessionRecord
- type SessionRunner
- type Store
- func (s *Store) AcquireOwner(owner OwnerLock) error
- func (s *Store) AppendQueuedPrompt(rec SessionRecord, prompt QueuedPrompt) (SessionRecord, error)
- func (s *Store) CancelPendingQueue(id string, when time.Time) (int, error)
- func (s *Store) CancelRequest(id string) (CancelRequest, error)
- func (s *Store) ClearOwner(id string) error
- func (s *Store) Get(id string) (SessionRecord, error)
- func (s *Store) List() ([]SessionRecord, error)
- func (s *Store) MarkPendingCanceled(id string, when time.Time) error
- func (s *Store) MarkQueueCompleted(id, queueID, response, stopReason string, when time.Time) error
- func (s *Store) MarkQueueFailed(id, queueID, message string, when time.Time) error
- func (s *Store) MarkQueueRunning(id, queueID string, when time.Time) error
- func (s *Store) NextQueuedPrompt(id string) (QueuedPrompt, bool, error)
- func (s *Store) Owner(id string) (OwnerLock, error)
- func (s *Store) Path() string
- func (s *Store) RecoverStaleQueue(id string, when time.Time) (int, error)
- func (s *Store) RequestCancel(id string, when time.Time) error
- func (s *Store) Upsert(rec SessionRecord) error
- func (s *Store) WriteOwner(owner OwnerLock) error
- type TurnSummary
Constants ¶
View Source
const ( SessionStatusQueued = "queued" SessionStatusRunning = "running" SessionStatusCompleted = "completed" SessionStatusCanceled = "canceled" SessionStatusCancelRequested = "cancel_requested" PendingPromptStatusPending = "pending" PendingPromptStatusCanceled = "canceled" QueuePromptStatusPending = "pending" QueuePromptStatusRunning = "running" QueuePromptStatusCompleted = "completed" QueuePromptStatusCanceled = "canceled" QueuePromptStatusFailed = "failed" )
Variables ¶
View Source
var ( ErrPathOutsideCWD = errors.New("acp client path is outside cwd") ErrWritesDisabled = errors.New("acp client filesystem writes are disabled") )
View Source
var ( ErrMissingCommand = errors.New("acp client command is required") ErrShellCommand = errors.New("acp client command must be an executable path/name, with args passed separately") ErrUnknownAgent = errors.New("unknown acp client agent") )
View Source
var ( ErrSessionNotFound = errors.New("acp client session not found") ErrQueuePromptNotFound = errors.New("acp client queue prompt not found") ErrInvalidOwnerLock = errors.New("acp client owner lock is invalid") )
View Source
var ErrDrainBusy = errors.New("acp client session is already being drained")
Functions ¶
This section is empty.
Types ¶
type AgentSpec ¶
type AgentSpec struct {
Name string `json:"name"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
EnvKeys []string `json:"envKeys,omitempty"`
}
func (AgentSpec) Fingerprint ¶
type Callbacks ¶
type Callbacks struct {
// contains filtered or unexported fields
}
func NewCallbacks ¶
func NewCallbacks(opts RunOptions) *Callbacks
func (*Callbacks) CreateTerminal ¶
func (*Callbacks) CreateTerminal(context.Context, acpsdk.CreateTerminalRequest) (acpsdk.CreateTerminalResponse, error)
func (*Callbacks) KillTerminalCommand ¶
func (*Callbacks) KillTerminalCommand(context.Context, acpsdk.KillTerminalCommandRequest) (acpsdk.KillTerminalCommandResponse, error)
func (*Callbacks) ReadTextFile ¶
func (c *Callbacks) ReadTextFile(_ context.Context, p acpsdk.ReadTextFileRequest) (acpsdk.ReadTextFileResponse, error)
func (*Callbacks) ReleaseTerminal ¶
func (*Callbacks) ReleaseTerminal(context.Context, acpsdk.ReleaseTerminalRequest) (acpsdk.ReleaseTerminalResponse, error)
func (*Callbacks) RequestPermission ¶
func (*Callbacks) RequestPermission(_ context.Context, p acpsdk.RequestPermissionRequest) (acpsdk.RequestPermissionResponse, error)
func (*Callbacks) SessionUpdate ¶
func (*Callbacks) TerminalOutput ¶
func (*Callbacks) TerminalOutput(context.Context, acpsdk.TerminalOutputRequest) (acpsdk.TerminalOutputResponse, error)
func (*Callbacks) UpdateCount ¶
func (*Callbacks) WaitForTerminalExit ¶
func (*Callbacks) WaitForTerminalExit(context.Context, acpsdk.WaitForTerminalExitRequest) (acpsdk.WaitForTerminalExitResponse, error)
func (*Callbacks) WaitForUpdate ¶
func (*Callbacks) WriteTextFile ¶
func (c *Callbacks) WriteTextFile(_ context.Context, p acpsdk.WriteTextFileRequest) (acpsdk.WriteTextFileResponse, error)
type CancelRequest ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewInProcessClient ¶
func (*Client) StartSession ¶ added in v0.19.0
type DrainOptions ¶ added in v0.19.0
type DrainPromptRunner ¶ added in v0.19.0
type DrainResult ¶ added in v0.19.0
type DrainResult struct {
SessionID string
ACPSessionID string
Processed int
Completed int
Failed int
Canceled int
Remaining int
}
func DrainQueue ¶ added in v0.19.0
func DrainQueue(ctx context.Context, store *Store, spec AgentSpec, opts RunOptions, sessionID string, drainOpts DrainOptions) (DrainResult, error)
type PendingPrompt ¶
type QueuedPrompt ¶ added in v0.19.0
type QueuedPrompt struct {
ID string `json:"id"`
Prompt string `json:"prompt"`
Status string `json:"status"`
CreatedAt time.Time `json:"createdAt"`
StartedAt *time.Time `json:"startedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
CanceledAt *time.Time `json:"canceledAt,omitempty"`
Response string `json:"response,omitempty"`
StopReason string `json:"stopReason,omitempty"`
Error string `json:"error,omitempty"`
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func DefaultRegistry ¶
func DefaultRegistry() Registry
func NewRegistry ¶
type Result ¶
type Result struct {
SessionID acpsdk.SessionId
StopReason acpsdk.StopReason
Updates []acpsdk.SessionNotification
Text string
Stderr string
Duration time.Duration
}
type RunOptions ¶
type SessionRecord ¶
type SessionRecord struct {
ID string `json:"id"`
ACPSessionID string `json:"acpSessionId,omitempty"`
Agent string `json:"agent"`
CommandFingerprint string `json:"commandFingerprint"`
Cwd string `json:"cwd"`
Status string `json:"status"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
LastStopReason string `json:"lastStopReason,omitempty"`
Summary string `json:"summary,omitempty"`
Turns []TurnSummary `json:"turns,omitempty"`
PendingPrompt *PendingPrompt `json:"pendingPrompt,omitempty"`
PromptQueue []QueuedPrompt `json:"promptQueue,omitempty"`
}
type SessionRunner ¶ added in v0.19.0
type SessionRunner struct {
// contains filtered or unexported fields
}
func (*SessionRunner) SessionID ¶ added in v0.19.0
func (r *SessionRunner) SessionID() acpsdk.SessionId
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewDefaultStore ¶
func (*Store) AcquireOwner ¶ added in v0.19.0
func (*Store) AppendQueuedPrompt ¶ added in v0.19.0
func (s *Store) AppendQueuedPrompt(rec SessionRecord, prompt QueuedPrompt) (SessionRecord, error)
func (*Store) CancelPendingQueue ¶ added in v0.19.0
func (*Store) CancelRequest ¶
func (s *Store) CancelRequest(id string) (CancelRequest, error)
func (*Store) ClearOwner ¶
func (*Store) List ¶
func (s *Store) List() ([]SessionRecord, error)
func (*Store) MarkPendingCanceled ¶
func (*Store) MarkQueueCompleted ¶ added in v0.19.0
func (*Store) MarkQueueFailed ¶ added in v0.19.0
func (*Store) MarkQueueRunning ¶ added in v0.19.0
func (*Store) NextQueuedPrompt ¶ added in v0.19.0
func (s *Store) NextQueuedPrompt(id string) (QueuedPrompt, bool, error)
func (*Store) RecoverStaleQueue ¶ added in v0.19.0
func (*Store) Upsert ¶
func (s *Store) Upsert(rec SessionRecord) error
func (*Store) WriteOwner ¶
Click to show internal directories.
Click to hide internal directories.