Documentation
¶
Index ¶
- Constants
- Variables
- func ExportSession(store *Store, id, outputPath string, opts ExportOptions) error
- func ValidateJSONRPCMessage(message json.RawMessage) error
- type ActionResult
- type ActionRunOptions
- type ActionRunner
- type AgentSpec
- type Archive
- type ArchiveHistoryEvent
- type ArchiveHistoryMode
- type ArchiveSession
- type Callbacks
- func (*Callbacks) CreateTerminal(context.Context, acpsdk.CreateTerminalRequest) (acpsdk.CreateTerminalResponse, error)
- func (c *Callbacks) Cwd() string
- func (c *Callbacks) EventSnapshot() []EventLogLine
- func (*Callbacks) KillTerminalCommand(context.Context, acpsdk.KillTerminalCommandRequest) (acpsdk.KillTerminalCommandResponse, error)
- func (c *Callbacks) ReadTextFile(_ context.Context, p acpsdk.ReadTextFileRequest) (acpsdk.ReadTextFileResponse, error)
- func (c *Callbacks) RecordEvent(direction EventDirection, message json.RawMessage) 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 CompareAgent
- type CompareOptions
- type CompareRow
- type CompareRun
- type CompareRunBundle
- type CompareRunStore
- type CompareRunner
- type DrainOptions
- type DrainPromptRunner
- type DrainResult
- type EventDirection
- type EventLogLine
- type EventLogMetadata
- type ExportOptions
- type FlowDefinition
- type FlowEdge
- type FlowNode
- type FlowPromptRunner
- type FlowReplayArtifactRef
- type FlowReplayProjections
- type FlowReplaySession
- type FlowReplayStep
- type FlowReplaySummary
- type FlowRunManifest
- type FlowRunOptions
- type FlowRunResult
- type FlowRunState
- type FlowRunStore
- func (s *FlowRunStore) AppendTraceEvent(event acpx.TraceEvent) (err error)
- func (s *FlowRunStore) Dir() string
- func (s *FlowRunStore) WriteACPXManifest(manifest acpx.Manifest) error
- func (s *FlowRunStore) WriteArtifact(kind string, data []byte) (FlowReplayArtifactRef, error)
- func (s *FlowRunStore) WriteDefinition(def FlowDefinition) error
- func (s *FlowRunStore) WriteInput(input any) error
- func (s *FlowRunStore) WriteManifest(manifest FlowRunManifest) error
- func (s *FlowRunStore) WriteProjection(name string, value any) error
- func (s *FlowRunStore) WriteState(state FlowRunState) error
- func (s *FlowRunStore) WriteStep(nodeID string, output json.RawMessage) error
- type FlowStepRecord
- type FlowSwitchEdge
- type FlowTraceEvent
- type ImportOptions
- type JSONRPCMessage
- type OwnerLock
- type PendingPrompt
- type Profile
- type ProfileStore
- type QueuedPrompt
- type Registry
- type Result
- type RunOptions
- type SessionRecord
- type SessionRunner
- type Store
- func (s *Store) AcquireOwner(owner OwnerLock) error
- func (s *Store) AppendEventLog(id string, events []EventLogLine) (err 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) CopyEventLog(id, outputPath string) (err error)
- func (s *Store) EventLogMetadata(id string) (EventLogMetadata, 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) ReadEventLog(id string) ([]EventLogLine, error)
- 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) WriteEventLog(id string, events []EventLogLine) error
- func (s *Store) WriteOwner(owner OwnerLock) error
- type TurnSummary
- type WatchCycle
- type WatchOptions
- type WatchResult
Constants ¶
View Source
const ( FlowNodeTypeACP = flowjson.NodeTypeACP FlowNodeTypeAction = flowjson.NodeTypeAction FlowNodeTypeCompute = flowjson.NodeTypeCompute FlowNodeTypeCheckpoint = flowjson.NodeTypeCheckpoint FlowRunStatusRunning = "running" FlowRunStatusCompleted = "completed" FlowRunStatusFailed = "failed" FlowStepStatusCompleted = "completed" FlowStepStatusFailed = "failed" )
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" )
View Source
const FlowReplayBundleSchema = acpx.SchemaFlowRunBundleV1
Variables ¶
View Source
var ( ErrSessionActive = errors.New("acp client session is active") ErrSessionArchiveCollision = errors.New("acp client archive destination session exists") ErrUnsupportedArchiveVersion = errors.New("unsupported acp client archive format version") ErrInvalidSessionArchive = errors.New("invalid acp client archive") )
View Source
var ( ErrPathOutsideCWD = errors.New("acp client path is outside cwd") ErrWritesDisabled = errors.New("acp client filesystem writes are disabled") )
View Source
var ( ErrInvalidJSONRPCMessage = errors.New("invalid acp json-rpc message") )
View Source
var ( ErrProfileNotFound = errors.New("acp client profile not found") ErrProfileShadowsBuiltin = errors.New("acp client profile shadows built-in agent") )
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")
View Source
var ErrInvalidFlowDefinition = flowjson.ErrInvalidDefinition
Functions ¶
func ExportSession ¶ added in v0.20.0
func ExportSession(store *Store, id, outputPath string, opts ExportOptions) error
func ValidateJSONRPCMessage ¶ added in v0.25.0
func ValidateJSONRPCMessage(message json.RawMessage) error
Types ¶
type ActionResult ¶ added in v0.23.0
type ActionRunOptions ¶ added in v0.23.0
type ActionRunner ¶ added in v0.23.0
type ActionRunner interface {
RunAction(context.Context, ActionRunOptions) (ActionResult, error)
}
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 Archive ¶ added in v0.20.0
type Archive struct {
FormatVersion int `json:"format_version"`
ExportedAt string `json:"exported_at"`
ExportedBy string `json:"exported_by"`
Session ArchiveSession `json:"session"`
History []ArchiveHistoryEvent `json:"history,omitempty"`
SummaryHistory []ArchiveHistoryEvent `json:"summary_history,omitempty"`
RawHistory []json.RawMessage `json:"-"`
}
func (*Archive) UnmarshalJSON ¶ added in v0.25.0
type ArchiveHistoryEvent ¶ added in v0.20.0
type ArchiveHistoryEvent struct {
Kind string `json:"kind"`
ID string `json:"id,omitempty"`
Prompt string `json:"prompt,omitempty"`
Response string `json:"response,omitempty"`
Status string `json:"status,omitempty"`
StopReason string `json:"stop_reason,omitempty"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
}
type ArchiveHistoryMode ¶ added in v0.25.0
type ArchiveHistoryMode string
const ( ArchiveHistoryModeSummary ArchiveHistoryMode = "summary" ArchiveHistoryModeRaw ArchiveHistoryMode = "raw" ArchiveHistoryModeBoth ArchiveHistoryMode = "both" )
type ArchiveSession ¶ added in v0.20.0
type ArchiveSession struct {
RecordID string `json:"record_id"`
Name *string `json:"name,omitempty"`
Agent string `json:"agent"`
AgentName string `json:"agent_name,omitempty"`
CWDRelative string `json:"cwd_relative"`
CWDOriginal string `json:"cwd_original"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
State SessionRecord `json:"state"`
}
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) EventSnapshot ¶ added in v0.25.0
func (c *Callbacks) EventSnapshot() []EventLogLine
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) RecordEvent ¶ added in v0.25.0
func (c *Callbacks) RecordEvent(direction EventDirection, message json.RawMessage) 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 CompareAgent ¶ added in v0.20.0
type CompareOptions ¶ added in v0.20.0
type CompareOptions struct {
Cwd string
Timeout time.Duration
Runner CompareRunner
}
type CompareRow ¶ added in v0.20.0
type CompareRow struct {
Agent string `json:"agent"`
Status string `json:"status"`
WallMS int64 `json:"wall_ms"`
StopReason string `json:"stop_reason,omitempty"`
Final string `json:"final,omitempty"`
Error string `json:"error,omitempty"`
Events []EventLogLine `json:"-"`
}
func Compare ¶ added in v0.20.0
func Compare(ctx context.Context, agents []CompareAgent, prompt string, opts CompareOptions) ([]CompareRow, error)
type CompareRun ¶ added in v0.25.0
type CompareRun struct {
RunID string `json:"run_id"`
RunDir string `json:"run_dir"`
Status string `json:"status"`
PromptDigest string `json:"prompt_digest,omitempty"`
StartedAt time.Time `json:"started_at,omitzero"`
FinishedAt time.Time `json:"finished_at,omitzero"`
Rows []CompareRow `json:"rows"`
}
type CompareRunBundle ¶ added in v0.25.0
type CompareRunBundle struct {
CompareRun
AgentDirs map[string]string `json:"-"`
}
type CompareRunStore ¶ added in v0.25.0
type CompareRunStore struct {
// contains filtered or unexported fields
}
func NewCompareRunStore ¶ added in v0.25.0
func NewCompareRunStore(root string) *CompareRunStore
func (*CompareRunStore) Save ¶ added in v0.25.0
func (s *CompareRunStore) Save(run CompareRun) (CompareRunBundle, error)
type CompareRunner ¶ added in v0.20.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 EventDirection ¶ added in v0.25.0
type EventDirection string
const ( EventDirectionOutbound EventDirection = "outbound" EventDirectionInbound EventDirection = "inbound" )
type EventLogLine ¶ added in v0.25.0
type EventLogLine struct {
Seq int `json:"seq"`
At time.Time `json:"at,omitzero"`
Direction EventDirection `json:"direction"`
Message json.RawMessage `json:"message"`
}
type EventLogMetadata ¶ added in v0.25.0
type ExportOptions ¶ added in v0.20.0
type ExportOptions struct {
HomeDir string
Now func() time.Time
HistoryMode ArchiveHistoryMode
}
type FlowDefinition ¶ added in v0.20.0
type FlowDefinition = flowjson.Definition
func LoadFlowDefinition ¶ added in v0.20.0
func LoadFlowDefinition(path string) (FlowDefinition, error)
type FlowPromptRunner ¶ added in v0.20.0
type FlowReplayArtifactRef ¶ added in v0.25.0
type FlowReplayProjections ¶ added in v0.25.0
type FlowReplaySession ¶ added in v0.25.0
type FlowReplayStep ¶ added in v0.25.0
type FlowReplayStep struct {
NodeID string `json:"node_id"`
Type string `json:"type"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
Output string `json:"output,omitempty"`
OutputArtifact FlowReplayArtifactRef `json:"output_artifact,omitzero"`
StdoutArtifact FlowReplayArtifactRef `json:"stdout_artifact,omitzero"`
StderrArtifact FlowReplayArtifactRef `json:"stderr_artifact,omitzero"`
PromptArtifact FlowReplayArtifactRef `json:"prompt_artifact,omitzero"`
}
type FlowReplaySummary ¶ added in v0.25.0
type FlowReplaySummary struct {
RunID string `json:"run_id"`
Status string `json:"status"`
ManifestPath string `json:"manifest_path"`
StepCount int `json:"step_count"`
TraceCount int `json:"trace_count"`
SessionCount int `json:"session_count"`
}
func LoadFlowReplaySummary ¶ added in v0.25.0
func LoadFlowReplaySummary(runDir string) (FlowReplaySummary, error)
type FlowRunManifest ¶ added in v0.25.0
type FlowRunManifest struct {
Schema string `json:"schema"`
RunID string `json:"run_id"`
Status string `json:"status"`
Definition string `json:"definition"`
Input string `json:"input"`
State string `json:"state"`
Trace string `json:"trace"`
Projections FlowReplayProjections `json:"projections"`
Steps []FlowReplayStep `json:"steps"`
Sessions []FlowReplaySession `json:"sessions,omitempty"`
Artifacts []FlowReplayArtifactRef `json:"artifacts,omitempty"`
}
type FlowRunOptions ¶ added in v0.20.0
type FlowRunOptions struct {
RunID string
RunRoot string
Cwd string
DefaultAgent string
DefaultCommand string
DefaultArgs []string
Registry Registry
AllowedPermissions []string
ActionOutputLimit int
ActionRunner ActionRunner
StartRunner func(context.Context, AgentSpec, RunOptions, string) (FlowPromptRunner, func() error, error)
}
type FlowRunResult ¶ added in v0.20.0
type FlowRunResult struct {
RunID string `json:"run_id"`
Status string `json:"status"`
RunDir string `json:"run_dir,omitempty"`
Outputs map[string]json.RawMessage `json:"outputs"`
Steps []FlowStepRecord `json:"steps"`
}
func RunFlow ¶ added in v0.20.0
func RunFlow(ctx context.Context, def FlowDefinition, input map[string]any, opts FlowRunOptions) (FlowRunResult, error)
type FlowRunState ¶ added in v0.20.0
type FlowRunState struct {
RunID string `json:"run_id"`
Status string `json:"status"`
Steps []FlowStepRecord `json:"steps"`
}
type FlowRunStore ¶ added in v0.20.0
type FlowRunStore struct {
// contains filtered or unexported fields
}
func NewFlowRunStore ¶ added in v0.20.0
func NewFlowRunStore(rootDir, runID string) (*FlowRunStore, error)
func (*FlowRunStore) AppendTraceEvent ¶ added in v0.25.0
func (s *FlowRunStore) AppendTraceEvent(event acpx.TraceEvent) (err error)
func (*FlowRunStore) Dir ¶ added in v0.20.0
func (s *FlowRunStore) Dir() string
func (*FlowRunStore) WriteACPXManifest ¶ added in v0.27.0
func (s *FlowRunStore) WriteACPXManifest(manifest acpx.Manifest) error
func (*FlowRunStore) WriteArtifact ¶ added in v0.25.0
func (s *FlowRunStore) WriteArtifact(kind string, data []byte) (FlowReplayArtifactRef, error)
func (*FlowRunStore) WriteDefinition ¶ added in v0.20.0
func (s *FlowRunStore) WriteDefinition(def FlowDefinition) error
func (*FlowRunStore) WriteInput ¶ added in v0.20.0
func (s *FlowRunStore) WriteInput(input any) error
func (*FlowRunStore) WriteManifest ¶ added in v0.25.0
func (s *FlowRunStore) WriteManifest(manifest FlowRunManifest) error
func (*FlowRunStore) WriteProjection ¶ added in v0.25.0
func (s *FlowRunStore) WriteProjection(name string, value any) error
func (*FlowRunStore) WriteState ¶ added in v0.20.0
func (s *FlowRunStore) WriteState(state FlowRunState) error
func (*FlowRunStore) WriteStep ¶ added in v0.20.0
func (s *FlowRunStore) WriteStep(nodeID string, output json.RawMessage) error
type FlowStepRecord ¶ added in v0.20.0
type FlowSwitchEdge ¶ added in v0.27.0
type FlowSwitchEdge = flowjson.SwitchEdge
type FlowTraceEvent ¶ added in v0.25.0
type FlowTraceEvent struct {
Seq int `json:"seq"`
At time.Time `json:"at"`
Kind string `json:"kind"`
NodeID string `json:"node_id"`
Type string `json:"type"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
Output string `json:"output,omitempty"`
Session string `json:"session,omitempty"`
Artifact string `json:"artifact,omitempty"`
}
type ImportOptions ¶ added in v0.20.0
type JSONRPCMessage ¶ added in v0.25.0
type JSONRPCMessage json.RawMessage
type PendingPrompt ¶
type Profile ¶ added in v0.24.0
type Profile struct {
Name string `json:"name"`
Spec AgentSpec `json:"spec"`
Cwd string `json:"cwd,omitempty"`
SourceKind string `json:"sourceKind,omitempty"`
SourceID string `json:"sourceId,omitempty"`
Hash string `json:"hash"`
Trusted bool `json:"trusted,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
PluginName string `json:"pluginName,omitempty"`
PluginVersion string `json:"pluginVersion,omitempty"`
}
func (Profile) DescriptorHash ¶ added in v0.24.0
type ProfileStore ¶ added in v0.24.0
type ProfileStore struct {
// contains filtered or unexported fields
}
func NewDefaultProfileStore ¶ added in v0.24.0
func NewDefaultProfileStore() (*ProfileStore, error)
func NewProfileStore ¶ added in v0.24.0
func NewProfileStore(path string) *ProfileStore
func (*ProfileStore) Add ¶ added in v0.24.0
func (s *ProfileStore) Add(profile Profile) error
func (*ProfileStore) Get ¶ added in v0.24.0
func (s *ProfileStore) Get(name string) (Profile, error)
func (*ProfileStore) List ¶ added in v0.24.0
func (s *ProfileStore) List() ([]Profile, error)
func (*ProfileStore) Path ¶ added in v0.24.0
func (s *ProfileStore) Path() string
func (*ProfileStore) Remove ¶ added in v0.24.0
func (s *ProfileStore) Remove(name string) error
func (*ProfileStore) Trust ¶ added in v0.24.0
func (s *ProfileStore) Trust(name string) error
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
Events []EventLogLine
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"`
}
func ImportSession ¶ added in v0.20.0
func ImportSession(store *Store, archivePath string, opts ImportOptions) (SessionRecord, error)
type SessionRunner ¶ added in v0.19.0
type SessionRunner struct {
// contains filtered or unexported fields
}
func (*SessionRunner) LastEvents ¶ added in v0.25.0
func (r *SessionRunner) LastEvents() []EventLogLine
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) AppendEventLog ¶ added in v0.25.0
func (s *Store) AppendEventLog(id string, events []EventLogLine) (err error)
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) CopyEventLog ¶ added in v0.25.0
func (*Store) EventLogMetadata ¶ added in v0.25.0
func (s *Store) EventLogMetadata(id string) (EventLogMetadata, error)
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) ReadEventLog ¶ added in v0.25.0
func (s *Store) ReadEventLog(id string) ([]EventLogLine, error)
func (*Store) RecoverStaleQueue ¶ added in v0.19.0
func (*Store) Upsert ¶
func (s *Store) Upsert(rec SessionRecord) error
func (*Store) WriteEventLog ¶ added in v0.25.0
func (s *Store) WriteEventLog(id string, events []EventLogLine) error
func (*Store) WriteOwner ¶
type TurnSummary ¶
type WatchCycle ¶ added in v0.23.0
type WatchOptions ¶ added in v0.23.0
type WatchResult ¶ added in v0.23.0
type WatchResult struct {
SessionID string
ACPSessionID string
Cycles int
Processed int
Completed int
Failed int
Canceled int
Remaining int
}
func WatchQueue ¶ added in v0.23.0
func WatchQueue(ctx context.Context, store *Store, spec AgentSpec, opts RunOptions, sessionID string, watchOpts WatchOptions, onCycle func(WatchCycle)) (WatchResult, error)
Click to show internal directories.
Click to hide internal directories.