Documentation
¶
Index ¶
- Constants
- Variables
- func AssistantSystemPrompt(profile AssistantProfile) string
- func ContextClearedMessageContent() string
- func CoreSessionIsExternalAgent(session Session) bool
- func DelegateTaskToolExecutor(app *Core) tools.Executor
- func EstimateMessageTokens(messages []Message) int
- func EstimateProviderRequestTokens(request providers.Request) int
- func EstimateTextTokens(text string) int
- func FormatShortNumber(value int) string
- func IsPlanRunPromptMessage(message Message) bool
- func IsProviderSupportedImageMIMEType(mimeType string) bool
- func ListSubagentsToolExecutor(app *Core) tools.Executor
- func MemoryToolExecutors(app *Core) []tools.Executor
- func PlanItemDepths(items []PlanItem) map[string]int
- func PlanToolExecutors(app *Core) []tools.Executor
- func ReadSubagentResultToolExecutor(app *Core) tools.Executor
- func SpawnSubagentToolExecutor(app *Core) tools.Executor
- func SubagentToolExecutors(app *Core) []tools.Executor
- type AcceptRunErrorResponse
- type AcceptRunResult
- type AcceptRunStatus
- type AddPlanItemRequest
- type AdminRestartRequest
- type Approval
- type ApprovalResolveRequest
- type ApprovalResponse
- type ApprovalState
- type ApprovalStore
- type ApprovalsResponse
- type AssistantProfile
- type AttachmentData
- type AttachmentReader
- type BindingStore
- type BusyInputMode
- type ClientBinding
- type ClientBindingResponse
- type ClientCapabilities
- type ClientDeliveriesResponse
- type ClientDelivery
- type ClientDeliveryFailRequest
- type ClientDeliveryFilter
- type ClientDeliveryStatus
- type ClientDeliveryTarget
- type ClientSnapshot
- type ClientSnapshotResponse
- type CommitRealtimeVoiceTurnInput
- type CommitRealtimeVoiceTurnResult
- type CompactSessionResult
- type ContextBlock
- type ContextBlockKind
- type ContextCompact
- type ContextReport
- type Core
- func (c *Core) AcceptRun(ctx context.Context, input HandleMessageInput) (AcceptRunResult, error)
- func (c *Core) AcceptTriggeredRun(ctx context.Context, input HandleTriggeredRunInput) (AcceptRunResult, error)
- func (c *Core) AcknowledgeClientDelivery(ctx context.Context, deliveryID string) error
- func (c *Core) AddPlanItem(ctx context.Context, sessionID string, text string, parentID string) (SessionPlan, error)
- func (c *Core) BindSessionPlanRunStep(ctx context.Context, sessionID string, runID string) error
- func (c *Core) CancelRun(ctx context.Context, runID string) (Run, error)
- func (c *Core) ClearSessionPlan(ctx context.Context, sessionID string) (SessionPlan, error)
- func (c *Core) ClientSnapshot(ctx context.Context, client string, externalKey string) (ClientSnapshot, error)
- func (c *Core) CommitRealtimeVoiceTurn(ctx context.Context, input CommitRealtimeVoiceTurnInput) (CommitRealtimeVoiceTurnResult, error)
- func (c *Core) CompactSession(ctx context.Context, sessionID string) (CompactSessionResult, error)
- func (c *Core) CompleteSessionPlanRunStep(ctx context.Context, run Run, assistantContent string) error
- func (c *Core) CreateClientDelivery(ctx context.Context, delivery ClientDelivery) (ClientDelivery, error)
- func (c *Core) CreateMemory(ctx context.Context, entry MemoryEntry) (MemoryEntry, error)
- func (c *Core) CreateSession(ctx context.Context, input CreateSessionInput) (Session, error)
- func (c *Core) CreateSystemMessage(ctx context.Context, sessionID string, content string) (Message, error)
- func (c *Core) CurrentBinding(ctx context.Context, client string, externalKey string) (ClientBinding, error)
- func (c *Core) DelegateTask(ctx context.Context, input DelegateTaskInput) (DelegateTaskResult, error)
- func (c *Core) DeleteMemory(ctx context.Context, id string) error
- func (c *Core) DeleteSession(ctx context.Context, sessionID string) error
- func (c *Core) ExecuteRun(ctx context.Context, runID string) error
- func (c *Core) ExecuteTool(ctx context.Context, input ExecuteToolInput) (ExecuteToolResult, error)
- func (c *Core) ExternalAgents(ctx context.Context) []ExternalAgentDescriptor
- func (c *Core) GetRun(ctx context.Context, runID string) (Run, error)
- func (c *Core) GetSession(ctx context.Context, sessionID string) (Session, error)
- func (c *Core) ListApprovals(ctx context.Context, sessionID string, state ApprovalState) ([]Approval, error)
- func (c *Core) ListClientDeliveries(ctx context.Context, filter ClientDeliveryFilter) ([]ClientDelivery, error)
- func (c *Core) ListMemories(ctx context.Context, filter MemoryFilter) ([]MemoryEntry, error)
- func (c *Core) ListMessages(ctx context.Context, sessionID string, limit int) ([]Message, error)
- func (c *Core) ListSessions(ctx context.Context, filter SessionListFilter) ([]Session, error)
- func (c *Core) ListSubagents(ctx context.Context, parentSessionID string, includeRecent bool, limit int) ([]SubagentTask, error)
- func (c *Core) ListToolSpecs() []tools.Spec
- func (c *Core) MarkClientDeliveryFailed(ctx context.Context, delivery ClientDelivery, deliveryErr error) error
- func (c *Core) MarkClientDeliveryReady(ctx context.Context, delivery ClientDelivery) error
- func (c *Core) MarkClientDeliverySent(ctx context.Context, delivery ClientDelivery) error
- func (c *Core) MemoryPromptContext(ctx context.Context, workingDir string) string
- func (c *Core) ModelsForSession(ctx context.Context, sessionID string) (string, string, []string, error)
- func (c *Core) ReadSubagentResult(ctx context.Context, parentSessionID string, taskID string, name string) (SubagentTask, string, error)
- func (c *Core) RecoverActiveRuns(ctx context.Context) error
- func (c *Core) RecoverSessionInputs(ctx context.Context) error
- func (c *Core) RecoverSubagentTasks(ctx context.Context) error
- func (c *Core) RenameSession(ctx context.Context, input RenameSessionInput) (Session, error)
- func (c *Core) ResolveApproval(ctx context.Context, approvalID string, approved bool) (Approval, error)
- func (c *Core) ResolveExternalAgentID(id string) (string, bool)
- func (c *Core) Search(ctx context.Context, filter SearchFilter) (SearchReport, error)
- func (c *Core) SessionContext(ctx context.Context, sessionID string) (ContextReport, error)
- func (c *Core) SessionPlan(ctx context.Context, sessionID string) (SessionPlan, error)
- func (c *Core) SessionPlanRun(ctx context.Context, sessionID string) (PlanRun, error)
- func (c *Core) SessionProviderOptions() []SessionProviderOption
- func (c *Core) SessionSearch(ctx context.Context, filter SearchFilter) (SessionSearchReport, error)
- func (c *Core) SetAssistantProfile(profile AssistantProfile)
- func (c *Core) SetSessionGoal(ctx context.Context, sessionID string, goal string) (SessionPlan, error)
- func (c *Core) SetSessionLLMs(registry SessionLLMRegistry)
- func (c *Core) SpawnSubagent(ctx context.Context, input SpawnSubagentInput) (SpawnSubagentResult, error)
- func (c *Core) StartSessionPlanRun(ctx context.Context, sessionID string, reset bool) (PlanRun, SessionPlan, error)
- func (c *Core) SubscribeEvents(ctx context.Context, sessionID string) <-chan Event
- func (c *Core) SubscribeEventsAfter(ctx context.Context, sessionID string, afterID uint64) <-chan Event
- func (c *Core) UpdateMemory(ctx context.Context, entry MemoryEntry) (MemoryEntry, error)
- func (c *Core) UpdatePlanItem(ctx context.Context, sessionID string, itemID string, status PlanItemStatus, ...) (SessionPlan, error)
- func (c *Core) UpdateSessionModel(ctx context.Context, sessionID string, modelID string) (Session, error)
- func (c *Core) UpdateSessionPermissionMode(ctx context.Context, input UpdateSessionPermissionModeInput) (Session, error)
- func (c *Core) UpdateSessionProvider(ctx context.Context, sessionID string, providerID string) (Session, error)
- func (c *Core) Usage(ctx context.Context, filter UsageFilter) (UsageReport, error)
- func (c *Core) UseBinding(ctx context.Context, input UseBindingInput) (ClientBinding, error)
- func (c *Core) WithAttachmentReader(reader AttachmentReader) *Core
- func (c *Core) WithClock(now func() time.Time) *Core
- func (c *Core) WithExternalAgents(registry *externalagents.Registry, store externalagents.AttachmentStore) *Core
- func (c *Core) WithHistoryLimit(limit int) *Core
- func (c *Core) WithIDGenerator(newID func(prefix string) string) *Core
- func (c *Core) WithRunStarter(starter RunStarter) *Core
- func (c *Core) WithRuntimeStatusContext(provider RuntimeStatusContextProvider) *Core
- func (c *Core) WithSessionLLMs(registry SessionLLMRegistry) *Core
- func (c *Core) WithSkillsContext(provider SkillsPromptContextProvider) *Core
- func (c *Core) WithTools(toolExecutor ToolExecutor) *Core
- func (c *Core) WithWorkStore(store work.Store) *Core
- type CreateSessionInput
- type CreateSessionRequest
- type CreateSystemMessageRequest
- type DelegateTaskInput
- type DelegateTaskResult
- type DeliveryStore
- type DocumentDeliveryPayload
- type ErrorResponse
- type Event
- type EventType
- type ExecuteToolInput
- type ExecuteToolResult
- type ExternalAgentDescriptor
- type ExternalAgentsResponse
- type FileSnapshot
- type FileSnapshotStore
- type FinishPart
- type HandleMessageInput
- type HandleTriggeredRunInput
- type HealthResponse
- type ImagePart
- type MemoryEntry
- type MemoryFilter
- type MemoryResponse
- type MemoryScope
- type MemoryStore
- type Message
- type MessagePart
- type MessagePartKind
- type MessageResponse
- type MessageRole
- type MessageStore
- type MessagesResponse
- type OKResponse
- type PermissionMode
- type PermissionNotification
- type PermissionRequest
- type PlanItem
- type PlanItemStatus
- type PlanRun
- type PlanRunBindRequest
- type PlanRunResponse
- type PlanRunStartRequest
- type PlanRunStatus
- type PlanStore
- type ProviderUsage
- type ReasoningPart
- type RenameSessionInput
- type RenameSessionRequest
- type Run
- type RunResponse
- type RunStarter
- type RunStatus
- type RunStore
- type RunTiming
- type RuntimeStatusContextProvider
- type RuntimeStatusContextRequest
- type SearchFilter
- type SearchReport
- type SearchResponse
- type SearchResult
- type SearchStore
- type ServerStatus
- type ServerStatusResponse
- type Session
- type SessionCapabilities
- type SessionCompactResponse
- type SessionContextResponse
- type SessionInput
- type SessionInputStatus
- type SessionInputStore
- type SessionKind
- type SessionLLMContextWindowRegistry
- type SessionLLMRegistry
- type SessionListFilter
- type SessionModelsResponse
- type SessionPlan
- type SessionPlanResponse
- type SessionProviderOption
- type SessionProvidersResponse
- type SessionResponse
- type SessionRuntime
- type SessionSearchReport
- type SessionSearchResult
- type SessionStatus
- type SessionStore
- type SessionsResponse
- type SkillsPromptContextProvider
- type SkillsPromptContextRequest
- type SkillsPromptMessage
- type SpawnSubagentInput
- type SpawnSubagentResult
- type Store
- type SubagentIsolation
- type SubagentRuntime
- type SubagentTask
- type SubagentTaskFilter
- type SubagentTaskMode
- type SubagentTaskStatus
- type SubagentTaskStore
- type TextPart
- type ToolCallPart
- type ToolExecuteResponse
- type ToolExecutor
- type ToolLifecycleState
- type ToolResultPart
- type ToolUpdate
- type ToolsResponse
- type UpdateExternalAgentRequest
- type UpdatePlanItemRequest
- type UpdateSessionLLMRequest
- type UpdateSessionPermissionModeInput
- type UpdateSessionPermissionModeRequest
- type UpdateSessionPlanRequest
- type UsageFilter
- type UsageRecord
- type UsageReport
- type UsageResponse
- type UsageStore
- type UsageSummary
- type UseBindingInput
Constants ¶
const ( ClientDeliveryTypeDaemonRestart = "daemon_restart" ClientDeliveryTypeRun = "run" ClientDeliveryTypeDocument = "document" )
const EstimatedImageTokens = 1_500
Variables ¶
var ( ErrNotFound = errors.New("not found") ErrBindingNotFound = errors.New("binding not found") ErrSessionSelectionRequired = errors.New("session selection required") ErrInvalidInput = errors.New("invalid input") )
ErrAttachmentUnavailable identifies an attachment that used to exist but can no longer be read, for example because a temporary upload expired. Provider conversation building can omit the binary data without failing the whole run.
var ErrSessionRequired = errors.New("session_id is required")
Functions ¶
func AssistantSystemPrompt ¶
func AssistantSystemPrompt(profile AssistantProfile) string
func ContextClearedMessageContent ¶ added in v0.1.13
func ContextClearedMessageContent() string
func CoreSessionIsExternalAgent ¶ added in v0.1.12
func DelegateTaskToolExecutor ¶ added in v0.1.12
func EstimateMessageTokens ¶
func EstimateProviderRequestTokens ¶ added in v0.1.10
func EstimateTextTokens ¶
func FormatShortNumber ¶
func IsPlanRunPromptMessage ¶ added in v0.1.7
IsPlanRunPromptMessage reports whether message is an internal plan runner prompt. These prompts are stored so clients can audit local actions, but provider context already receives the current plan through sessionPlanPrompt.
func IsProviderSupportedImageMIMEType ¶ added in v0.1.18
IsProviderSupportedImageMIMEType reports whether image data can be sent inline by every image-capable provider supported by Matrixclaw. Other image/* files, such as SVG, remain represented by their attachment reference but must not be sent as visual input.
func ListSubagentsToolExecutor ¶ added in v0.1.13
func MemoryToolExecutors ¶ added in v0.1.12
MemoryToolExecutors exposes session recall and persistent memory to models.
func PlanItemDepths ¶ added in v0.1.7
func PlanToolExecutors ¶ added in v0.1.7
PlanToolExecutors exposes session plan operations to models through the normal tool registry.
func ReadSubagentResultToolExecutor ¶ added in v0.1.13
func SpawnSubagentToolExecutor ¶ added in v0.1.13
func SubagentToolExecutors ¶ added in v0.1.13
Types ¶
type AcceptRunErrorResponse ¶
type AcceptRunResult ¶
type AcceptRunResult struct {
SessionID string `json:"session_id"`
Status AcceptRunStatus `json:"status,omitempty"`
UserMessage Message `json:"user_message"`
Run Run `json:"run"`
Input *SessionInput `json:"input,omitempty"`
}
type AcceptRunStatus ¶ added in v0.1.13
type AcceptRunStatus string
const ( AcceptRunStatusStarted AcceptRunStatus = "started" AcceptRunStatusQueued AcceptRunStatus = "queued" AcceptRunStatusSteered AcceptRunStatus = "steered" AcceptRunStatusInterrupting AcceptRunStatus = "interrupting" )
type AddPlanItemRequest ¶ added in v0.1.7
type AdminRestartRequest ¶
type AdminRestartRequest struct {
Notification *ClientDeliveryTarget `json:"notification,omitempty"`
}
type Approval ¶
type Approval struct {
ID string `json:"id"`
SessionID string `json:"session_id"`
RunID string `json:"run_id,omitempty"`
ToolCallRef string `json:"tool_call_id,omitempty"`
ToolName string `json:"tool_name,omitempty"`
Description string `json:"description,omitempty"`
Action string `json:"action,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Path string `json:"path,omitempty"`
State ApprovalState `json:"state"`
RequestedAt time.Time `json:"requested_at"`
DecidedAt *time.Time `json:"decided_at,omitempty"`
}
type ApprovalResolveRequest ¶
type ApprovalResolveRequest struct {
Approved bool `json:"approved"`
}
type ApprovalResponse ¶
type ApprovalResponse struct {
Approval Approval `json:"approval"`
}
type ApprovalState ¶
type ApprovalState string
const ( ApprovalStatePending ApprovalState = "pending" ApprovalStateApproved ApprovalState = "approved" ApprovalStateRejected ApprovalState = "rejected" )
type ApprovalStore ¶
type ApprovalStore interface {
CreateApproval(ctx context.Context, approval Approval) error
GetApproval(ctx context.Context, approvalID string) (Approval, error)
UpdateApproval(ctx context.Context, approval Approval) error
ListApprovals(ctx context.Context, sessionID string, state ApprovalState) ([]Approval, error)
}
type ApprovalsResponse ¶
type ApprovalsResponse struct {
Approvals []Approval `json:"approvals"`
}
type AssistantProfile ¶
type AttachmentData ¶
type AttachmentReader ¶
type BindingStore ¶
type BindingStore interface {
SaveBinding(ctx context.Context, binding ClientBinding) error
GetBinding(ctx context.Context, client string, externalKey string) (ClientBinding, error)
}
type BusyInputMode ¶ added in v0.1.13
type BusyInputMode string
const ( BusyInputModeQueue BusyInputMode = "queue" BusyInputModeSteer BusyInputMode = "steer" BusyInputModeInterrupt BusyInputMode = "interrupt" )
type ClientBinding ¶
type ClientBindingResponse ¶
type ClientBindingResponse struct {
Binding ClientBinding `json:"binding"`
}
type ClientCapabilities ¶ added in v0.1.17
type ClientDeliveriesResponse ¶
type ClientDeliveriesResponse struct {
Deliveries []ClientDelivery `json:"deliveries"`
}
type ClientDelivery ¶
type ClientDelivery struct {
ID string `json:"id"`
Type string `json:"type"`
Client string `json:"client"`
ExternalKey string `json:"external_key,omitempty"`
SessionID string `json:"session_id,omitempty"`
RunID string `json:"run_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
Summary string `json:"summary,omitempty"`
Address json.RawMessage `json:"address,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
Status ClientDeliveryStatus `json:"status"`
Error string `json:"error,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
type ClientDeliveryFailRequest ¶ added in v0.1.15
type ClientDeliveryFailRequest struct {
Error string `json:"error,omitempty"`
}
type ClientDeliveryFilter ¶
type ClientDeliveryStatus ¶
type ClientDeliveryStatus string
const ( ClientDeliveryStatusPending ClientDeliveryStatus = "pending" ClientDeliveryStatusReady ClientDeliveryStatus = "ready" ClientDeliveryStatusSent ClientDeliveryStatus = "sent" ClientDeliveryStatusFailed ClientDeliveryStatus = "failed" )
type ClientDeliveryTarget ¶
type ClientDeliveryTarget struct {
Client string `json:"client,omitempty"`
ExternalKey string `json:"external_key,omitempty"`
SessionID string `json:"session_id,omitempty"`
RunID string `json:"run_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
Summary string `json:"summary,omitempty"`
Address json.RawMessage `json:"address,omitempty"`
}
type ClientSnapshot ¶
type ClientSnapshot struct {
SessionID string `json:"session_id"`
Session *Session `json:"session,omitempty"`
Capabilities *SessionCapabilities `json:"capabilities,omitempty"`
Context *ContextReport `json:"context,omitempty"`
Plan *SessionPlan `json:"plan,omitempty"`
Messages []Message `json:"messages"`
Run *Run `json:"run,omitempty"`
Timing *RunTiming `json:"timing,omitempty"`
ToolUpdates []ToolUpdate `json:"tool_updates,omitempty"`
Approvals []Approval `json:"approvals,omitempty"`
ApprovalNotifications []PermissionNotification `json:"approval_notifications,omitempty"`
Files []FileSnapshot `json:"files,omitempty"`
Subagents []SubagentTask `json:"subagents,omitempty"`
PendingInputs []SessionInput `json:"pending_inputs,omitempty"`
}
type ClientSnapshotResponse ¶
type ClientSnapshotResponse struct {
Snapshot ClientSnapshot `json:"snapshot"`
}
type CommitRealtimeVoiceTurnInput ¶ added in v0.1.16
type CommitRealtimeVoiceTurnResult ¶ added in v0.1.16
type CompactSessionResult ¶
type CompactSessionResult struct {
Message Message `json:"message"`
Context ContextReport `json:"context"`
}
type ContextBlock ¶
type ContextBlockKind ¶
type ContextBlockKind string
const ( ContextBlockSystemPrompt ContextBlockKind = "system_prompt" ContextBlockCustomInstructions ContextBlockKind = "custom_instructions" ContextBlockCompactSummary ContextBlockKind = "compact_summary" ContextBlockClearMarker ContextBlockKind = "clear_marker" ContextBlockMessages ContextBlockKind = "messages" ContextBlockToolSchemas ContextBlockKind = "tool_schemas" )
type ContextCompact ¶
type ContextReport ¶
type ContextReport struct {
SessionID string `json:"session_id"`
Estimated bool `json:"estimated"`
TokenEstimate int `json:"token_estimate"`
WindowTokens int `json:"window_tokens,omitempty"`
MessageCount int `json:"message_count"`
Blocks []ContextBlock `json:"blocks"`
LastProviderUsage *ProviderUsage `json:"last_provider_usage,omitempty"`
Compact ContextCompact `json:"compact"`
}
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func (*Core) AcceptRun ¶
func (c *Core) AcceptRun(ctx context.Context, input HandleMessageInput) (AcceptRunResult, error)
func (*Core) AcceptTriggeredRun ¶
func (c *Core) AcceptTriggeredRun(ctx context.Context, input HandleTriggeredRunInput) (AcceptRunResult, error)
func (*Core) AcknowledgeClientDelivery ¶
func (*Core) AddPlanItem ¶ added in v0.1.7
func (*Core) BindSessionPlanRunStep ¶ added in v0.1.7
func (*Core) ClearSessionPlan ¶ added in v0.1.7
func (*Core) ClientSnapshot ¶
func (*Core) CommitRealtimeVoiceTurn ¶ added in v0.1.16
func (c *Core) CommitRealtimeVoiceTurn(ctx context.Context, input CommitRealtimeVoiceTurnInput) (CommitRealtimeVoiceTurnResult, error)
func (*Core) CompactSession ¶
func (*Core) CompleteSessionPlanRunStep ¶ added in v0.1.7
func (*Core) CreateClientDelivery ¶
func (c *Core) CreateClientDelivery(ctx context.Context, delivery ClientDelivery) (ClientDelivery, error)
func (*Core) CreateMemory ¶ added in v0.1.12
func (c *Core) CreateMemory(ctx context.Context, entry MemoryEntry) (MemoryEntry, error)
func (*Core) CreateSession ¶
func (*Core) CreateSystemMessage ¶
func (*Core) CurrentBinding ¶
func (*Core) DelegateTask ¶ added in v0.1.12
func (c *Core) DelegateTask(ctx context.Context, input DelegateTaskInput) (DelegateTaskResult, error)
func (*Core) DeleteMemory ¶ added in v0.1.12
func (*Core) DeleteSession ¶
func (*Core) ExecuteTool ¶
func (c *Core) ExecuteTool(ctx context.Context, input ExecuteToolInput) (ExecuteToolResult, error)
func (*Core) ExternalAgents ¶ added in v0.1.4
func (c *Core) ExternalAgents(ctx context.Context) []ExternalAgentDescriptor
func (*Core) GetSession ¶ added in v0.1.16
func (*Core) ListApprovals ¶
func (*Core) ListClientDeliveries ¶
func (c *Core) ListClientDeliveries(ctx context.Context, filter ClientDeliveryFilter) ([]ClientDelivery, error)
func (*Core) ListMemories ¶ added in v0.1.12
func (c *Core) ListMemories(ctx context.Context, filter MemoryFilter) ([]MemoryEntry, error)
func (*Core) ListMessages ¶
func (*Core) ListSessions ¶
func (*Core) ListSubagents ¶ added in v0.1.13
func (*Core) ListToolSpecs ¶
func (*Core) MarkClientDeliveryFailed ¶
func (*Core) MarkClientDeliveryReady ¶
func (c *Core) MarkClientDeliveryReady(ctx context.Context, delivery ClientDelivery) error
func (*Core) MarkClientDeliverySent ¶
func (c *Core) MarkClientDeliverySent(ctx context.Context, delivery ClientDelivery) error
func (*Core) MemoryPromptContext ¶ added in v0.1.12
func (*Core) ModelsForSession ¶
func (*Core) ReadSubagentResult ¶ added in v0.1.13
func (*Core) RecoverActiveRuns ¶ added in v0.1.15
func (*Core) RecoverSessionInputs ¶ added in v0.1.13
func (*Core) RecoverSubagentTasks ¶ added in v0.1.13
func (*Core) RenameSession ¶
func (*Core) ResolveApproval ¶
func (*Core) ResolveExternalAgentID ¶ added in v0.1.9
func (*Core) Search ¶ added in v0.1.7
func (c *Core) Search(ctx context.Context, filter SearchFilter) (SearchReport, error)
func (*Core) SessionContext ¶
func (*Core) SessionPlan ¶ added in v0.1.7
func (*Core) SessionPlanRun ¶ added in v0.1.7
func (*Core) SessionProviderOptions ¶
func (c *Core) SessionProviderOptions() []SessionProviderOption
func (*Core) SessionSearch ¶ added in v0.1.12
func (c *Core) SessionSearch(ctx context.Context, filter SearchFilter) (SessionSearchReport, error)
func (*Core) SetAssistantProfile ¶
func (c *Core) SetAssistantProfile(profile AssistantProfile)
func (*Core) SetSessionGoal ¶ added in v0.1.7
func (*Core) SetSessionLLMs ¶
func (c *Core) SetSessionLLMs(registry SessionLLMRegistry)
func (*Core) SpawnSubagent ¶ added in v0.1.13
func (c *Core) SpawnSubagent(ctx context.Context, input SpawnSubagentInput) (SpawnSubagentResult, error)
func (*Core) StartSessionPlanRun ¶ added in v0.1.7
func (*Core) SubscribeEvents ¶
func (*Core) SubscribeEventsAfter ¶
func (*Core) UpdateMemory ¶ added in v0.1.12
func (c *Core) UpdateMemory(ctx context.Context, entry MemoryEntry) (MemoryEntry, error)
func (*Core) UpdatePlanItem ¶ added in v0.1.7
func (c *Core) UpdatePlanItem(ctx context.Context, sessionID string, itemID string, status PlanItemStatus, text string) (SessionPlan, error)
func (*Core) UpdateSessionModel ¶
func (*Core) UpdateSessionPermissionMode ¶
func (*Core) UpdateSessionProvider ¶
func (*Core) Usage ¶ added in v0.1.7
func (c *Core) Usage(ctx context.Context, filter UsageFilter) (UsageReport, error)
func (*Core) UseBinding ¶
func (c *Core) UseBinding(ctx context.Context, input UseBindingInput) (ClientBinding, error)
func (*Core) WithAttachmentReader ¶
func (c *Core) WithAttachmentReader(reader AttachmentReader) *Core
The With* builder methods below configure a Core during single-threaded construction, before the daemon starts serving. Except for WithSessionLLMs, they mutate Core fields without holding c.mu and therefore MUST NOT be called after any run has started or after the Core is shared across goroutines — doing so races with the agent loop reading those fields. Post-construction mutation must go through the locked Set* methods (SetSessionLLMs, SetAssistantProfile).
func (*Core) WithExternalAgents ¶ added in v0.1.4
func (c *Core) WithExternalAgents(registry *externalagents.Registry, store externalagents.AttachmentStore) *Core
func (*Core) WithHistoryLimit ¶
func (*Core) WithIDGenerator ¶
func (*Core) WithRunStarter ¶ added in v0.1.2
func (c *Core) WithRunStarter(starter RunStarter) *Core
func (*Core) WithRuntimeStatusContext ¶ added in v0.1.15
func (c *Core) WithRuntimeStatusContext(provider RuntimeStatusContextProvider) *Core
func (*Core) WithSessionLLMs ¶
func (c *Core) WithSessionLLMs(registry SessionLLMRegistry) *Core
func (*Core) WithSkillsContext ¶ added in v0.1.11
func (c *Core) WithSkillsContext(provider SkillsPromptContextProvider) *Core
func (*Core) WithTools ¶
func (c *Core) WithTools(toolExecutor ToolExecutor) *Core
type CreateSessionInput ¶
type CreateSessionInput struct {
Title string
Kind SessionKind
RuntimeID SessionRuntime
ParentSessionID string
Hidden bool
WorkingDir string
ProviderID string
ModelID string
PermissionMode PermissionMode
ExternalAgentID string
}
type CreateSessionRequest ¶
type CreateSessionRequest struct {
Title string `json:"title"`
Kind string `json:"kind,omitempty"`
RuntimeID string `json:"runtime_id,omitempty"`
WorkingDir string `json:"working_dir"`
ProviderID string `json:"provider_id,omitempty"`
ModelID string `json:"model_id,omitempty"`
PermissionMode string `json:"permission_mode,omitempty"`
ExternalAgentID string `json:"external_agent_id,omitempty"`
}
type CreateSystemMessageRequest ¶
type CreateSystemMessageRequest struct {
Content string `json:"content"`
}
type DelegateTaskInput ¶ added in v0.1.12
type DelegateTaskResult ¶ added in v0.1.12
type DelegateTaskResult struct {
Task SubagentTask
Summary string
IsError bool
Approval *tools.ApprovalRequest
}
type DeliveryStore ¶
type DeliveryStore interface {
CreateClientDelivery(ctx context.Context, delivery ClientDelivery) error
ListClientDeliveries(ctx context.Context, filter ClientDeliveryFilter) ([]ClientDelivery, error)
UpdateClientDelivery(ctx context.Context, delivery ClientDelivery) error
}
type DocumentDeliveryPayload ¶ added in v0.1.15
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
type Event ¶
type Event struct {
ID uint64 `json:"id,omitempty"`
Type EventType `json:"type"`
SessionID string `json:"session_id"`
RunID string `json:"run_id,omitempty"`
Payload any `json:"payload,omitempty"`
At time.Time `json:"at"`
}
Event is the daemon-owned envelope for live fan-out.
type EventType ¶
type EventType string
const ( EventRunUpdated EventType = "run.updated" EventMessageCreated EventType = "message.created" EventMessageUpdated EventType = "message.updated" EventPlanUpdated EventType = "plan.updated" EventToolUpdated EventType = "tool.updated" EventApprovalRequest EventType = "approval.requested" EventApprovalResult EventType = "approval.resolved" EventFileVersioned EventType = "file.versioned" EventSubagentUpdated EventType = "subagent.updated" EventInputUpdated EventType = "input.updated" )
type ExecuteToolInput ¶
type ExecuteToolInput struct {
SessionID string `json:"session_id"`
RunID string `json:"run_id,omitempty"`
ToolName string `json:"tool_name"`
Client string `json:"client,omitempty"`
ExternalKey string `json:"external_key,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
Approved bool `json:"approved,omitempty"`
Args json.RawMessage `json:"args,omitempty"`
}
type ExecuteToolResult ¶
type ExternalAgentDescriptor ¶ added in v0.1.4
type ExternalAgentDescriptor struct {
ID string `json:"id"`
Aliases []string `json:"aliases,omitempty"`
DisplayName string `json:"display_name"`
Installed bool `json:"installed"`
Enabled bool `json:"enabled"`
AuthState string `json:"auth_state,omitempty"`
Mode string `json:"mode,omitempty"`
Path string `json:"path,omitempty"`
Version string `json:"version,omitempty"`
Detail string `json:"detail,omitempty"`
Capabilities externalagents.Capabilities `json:"capabilities,omitempty"`
}
type ExternalAgentsResponse ¶ added in v0.1.4
type ExternalAgentsResponse struct {
Agents []ExternalAgentDescriptor `json:"agents"`
}
type FileSnapshot ¶
type FileSnapshotStore ¶
type FileSnapshotStore interface {
CreateFileSnapshot(ctx context.Context, snapshot FileSnapshot) (FileSnapshot, error)
ListFileSnapshots(ctx context.Context, sessionID string) ([]FileSnapshot, error)
}
type FinishPart ¶
type FinishPart struct {
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
Details json.RawMessage `json:"details,omitempty"`
}
type HandleMessageInput ¶
type HandleMessageInput struct {
Client string `json:"client"`
ExternalKey string `json:"external_key"`
ClientCapabilities ClientCapabilities `json:"client_capabilities,omitempty"`
SessionID string `json:"session_id"`
Text string `json:"text"`
Parts []MessagePart `json:"parts,omitempty"`
BusyMode BusyInputMode `json:"busy_mode,omitempty"`
WorkingDir string `json:"working_dir"`
DeliveryAddress json.RawMessage `json:"delivery_address,omitempty"`
AllowAutoBindOne bool `json:"allow_auto_bind_one"`
}
type HandleTriggeredRunInput ¶
type HealthResponse ¶
type MemoryEntry ¶ added in v0.1.12
type MemoryFilter ¶ added in v0.1.12
type MemoryFilter struct {
Scope MemoryScope
WorkingDir string
Limit int
}
type MemoryResponse ¶ added in v0.1.12
type MemoryResponse struct {
Memories []MemoryEntry `json:"memories"`
}
type MemoryScope ¶ added in v0.1.12
type MemoryScope string
const ( MemoryScopeGlobal MemoryScope = "global" MemoryScopeUser MemoryScope = "user" MemoryScopeProject MemoryScope = "project" )
type MemoryStore ¶ added in v0.1.12
type MemoryStore interface {
CreateMemory(ctx context.Context, entry MemoryEntry) error
UpdateMemory(ctx context.Context, entry MemoryEntry) error
DeleteMemory(ctx context.Context, id string) error
GetMemory(ctx context.Context, id string) (MemoryEntry, error)
ListMemories(ctx context.Context, filter MemoryFilter) ([]MemoryEntry, error)
}
type Message ¶
type Message struct {
ID string `json:"id"`
SessionID string `json:"session_id"`
RunID string `json:"run_id"`
Role MessageRole `json:"role"`
Content string `json:"content"`
Parts []MessagePart `json:"parts,omitempty"`
Model string `json:"model,omitempty"`
Provider string `json:"provider,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type MessagePart ¶
type MessagePart struct {
Kind MessagePartKind `json:"kind"`
Text *TextPart `json:"text,omitempty"`
Image *ImagePart `json:"image,omitempty"`
Reasoning *ReasoningPart `json:"reasoning,omitempty"`
ToolCall *ToolCallPart `json:"tool_call,omitempty"`
ToolResult *ToolResultPart `json:"tool_result,omitempty"`
Finish *FinishPart `json:"finish,omitempty"`
}
func NormalizeMessageParts ¶
func NormalizeMessageParts(content string, parts []MessagePart) []MessagePart
type MessagePartKind ¶
type MessagePartKind string
const ( MessagePartKindText MessagePartKind = "text" MessagePartKindImage MessagePartKind = "image" MessagePartKindReasoning MessagePartKind = "reasoning" MessagePartKindToolCall MessagePartKind = "tool_call" MessagePartKindToolResult MessagePartKind = "tool_result" MessagePartKindFinish MessagePartKind = "finish" )
type MessageResponse ¶
type MessageResponse struct {
Message Message `json:"message"`
}
type MessageRole ¶
type MessageRole string
const ( MessageRoleUser MessageRole = "user" MessageRoleAssistant MessageRole = "assistant" MessageRoleSystem MessageRole = "system" MessageRoleTool MessageRole = "tool" )
type MessageStore ¶
type MessagesResponse ¶
type MessagesResponse struct {
Messages []Message `json:"messages"`
}
type OKResponse ¶
type OKResponse struct {
OK bool `json:"ok"`
}
type PermissionMode ¶
type PermissionMode string
const ( PermissionModeDefault PermissionMode = "default" PermissionModeAcceptEdits PermissionMode = "accept_edits" PermissionModeFullAuto PermissionMode = "full_auto" )
func NormalizePermissionMode ¶
func NormalizePermissionMode(mode string) PermissionMode
func PermissionModeForSessionApproval ¶
func PermissionModeForSessionApproval(toolName string) (PermissionMode, bool)
type PermissionNotification ¶
type PermissionRequest ¶
type PermissionRequest struct {
ID string `json:"id"`
SessionID string `json:"session_id"`
ToolCallID string `json:"tool_call_id"`
ToolName string `json:"tool_name"`
Description string `json:"description"`
Action string `json:"action"`
Params json.RawMessage `json:"params,omitempty"`
Path string `json:"path"`
}
type PlanItem ¶ added in v0.1.7
type PlanItem struct {
ID string `json:"id"`
SessionID string `json:"session_id"`
ParentID string `json:"parent_id,omitempty"`
Text string `json:"text"`
Status PlanItemStatus `json:"status"`
Position int `json:"position"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func NextExecutablePlanItem ¶ added in v0.1.7
func NextExecutablePlanItem(plan SessionPlan) (PlanItem, bool)
type PlanItemStatus ¶ added in v0.1.7
type PlanItemStatus string
const ( PlanItemPending PlanItemStatus = "pending" PlanItemActive PlanItemStatus = "active" PlanItemDone PlanItemStatus = "done" PlanItemSkipped PlanItemStatus = "skipped" )
type PlanRun ¶ added in v0.1.7
type PlanRun struct {
SessionID string `json:"session_id"`
Status PlanRunStatus `json:"status"`
CurrentItemID string `json:"current_item_id,omitempty"`
LastRunID string `json:"last_run_id,omitempty"`
LastError string `json:"last_error,omitempty"`
StepNo int `json:"step_no,omitempty"`
Attempt int `json:"attempt,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
type PlanRunBindRequest ¶ added in v0.1.7
type PlanRunBindRequest struct {
RunID string `json:"run_id"`
}
type PlanRunResponse ¶ added in v0.1.7
type PlanRunResponse struct {
PlanRun PlanRun `json:"plan_run"`
Plan SessionPlan `json:"plan"`
}
type PlanRunStartRequest ¶ added in v0.1.7
type PlanRunStartRequest struct {
Reset bool `json:"reset,omitempty"`
}
type PlanRunStatus ¶ added in v0.1.7
type PlanRunStatus string
const ( PlanRunIdle PlanRunStatus = "idle" PlanRunRunning PlanRunStatus = "running" PlanRunBlocked PlanRunStatus = "blocked" PlanRunFailed PlanRunStatus = "failed" PlanRunCompleted PlanRunStatus = "completed" PlanRunCanceled PlanRunStatus = "canceled" )
type PlanStore ¶ added in v0.1.7
type PlanStore interface {
GetSessionPlan(ctx context.Context, sessionID string) (SessionPlan, error)
SetSessionGoal(ctx context.Context, sessionID string, goal string, updatedAt time.Time) error
ClearSessionPlan(ctx context.Context, sessionID string) error
AddPlanItem(ctx context.Context, item PlanItem) error
UpdatePlanItem(ctx context.Context, item PlanItem) error
GetPlanItem(ctx context.Context, itemID string) (PlanItem, error)
NextPlanItemPosition(ctx context.Context, sessionID string, parentID string) (int, error)
GetPlanRun(ctx context.Context, sessionID string) (PlanRun, error)
SavePlanRun(ctx context.Context, run PlanRun) error
ClearPlanRun(ctx context.Context, sessionID string) error
}
type ProviderUsage ¶
type ProviderUsage struct {
InputTokens int64 `json:"input_tokens,omitempty"`
OutputTokens int64 `json:"output_tokens,omitempty"`
TotalTokens int64 `json:"total_tokens,omitempty"`
CachedTokens int64 `json:"cached_tokens,omitempty"`
ReasoningTokens int64 `json:"reasoning_tokens,omitempty"`
Estimated bool `json:"estimated,omitempty"`
ProviderRaw json.RawMessage `json:"provider_raw,omitempty"`
}
type ReasoningPart ¶
type RenameSessionInput ¶
type RenameSessionRequest ¶
type RenameSessionRequest struct {
Title string `json:"title"`
}
type Run ¶
type Run struct {
ID string `json:"id"`
SessionID string `json:"session_id"`
UserMessageID string `json:"user_message_id"`
Client string `json:"client,omitempty"`
ExternalKey string `json:"external_key,omitempty"`
ClientCapabilities ClientCapabilities `json:"client_capabilities,omitempty"`
Status RunStatus `json:"status"`
Error string `json:"error,omitempty"`
StartedAt time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
type RunResponse ¶
type RunResponse struct {
Run Run `json:"run"`
}
type RunStarter ¶ added in v0.1.2
type RunStore ¶
type RunStore interface {
CreateRun(ctx context.Context, run Run) error
GetRun(ctx context.Context, runID string) (Run, error)
GetActiveRunBySession(ctx context.Context, sessionID string) (Run, error)
ListActiveRuns(ctx context.Context) ([]Run, error)
UpdateRun(ctx context.Context, run Run) error
CompleteRun(ctx context.Context, assistantMessage Message, run Run) error
AcceptMessage(ctx context.Context, message Message, run Run, deliveries ...ClientDelivery) error
}
type RuntimeStatusContextProvider ¶ added in v0.1.15
type RuntimeStatusContextProvider interface {
RuntimeStatusPromptContext(context.Context, RuntimeStatusContextRequest) string
}
type RuntimeStatusContextRequest ¶ added in v0.1.15
type SearchFilter ¶ added in v0.1.7
type SearchReport ¶ added in v0.1.7
type SearchReport struct {
Query string `json:"query"`
Results []SearchResult `json:"results"`
}
type SearchResponse ¶ added in v0.1.7
type SearchResponse struct {
Search SearchReport `json:"search"`
}
type SearchResult ¶ added in v0.1.7
type SearchResult struct {
MessageID string `json:"message_id"`
SessionID string `json:"session_id"`
Role string `json:"role,omitempty"`
Snippet string `json:"snippet,omitempty"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
Rank float64 `json:"rank,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type SearchStore ¶ added in v0.1.7
type SearchStore interface {
SearchMessages(ctx context.Context, filter SearchFilter) ([]SearchResult, error)
}
type ServerStatus ¶
type ServerStatus struct {
StartedAt time.Time `json:"started_at"`
UptimeSeconds int64 `json:"uptime_seconds"`
GoAllocBytes uint64 `json:"go_alloc_bytes"`
GoSysBytes uint64 `json:"go_sys_bytes"`
ProcessRSSBytes uint64 `json:"process_rss_bytes"`
MemoryTotalBytes uint64 `json:"memory_total_bytes"`
MemoryAvailableBytes uint64 `json:"memory_available_bytes"`
MemoryUsedBytes uint64 `json:"memory_used_bytes"`
CPUUsedPercent float64 `json:"cpu_used_percent"`
CPUKnown bool `json:"cpu_known"`
}
type ServerStatusResponse ¶
type ServerStatusResponse struct {
Status ServerStatus `json:"status"`
}
type Session ¶
type Session struct {
ID string `json:"id"`
Title string `json:"title"`
Kind SessionKind `json:"kind"`
RuntimeID SessionRuntime `json:"runtime_id,omitempty"`
ParentSessionID string `json:"parent_session_id,omitempty"`
Hidden bool `json:"hidden,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
ProviderID string `json:"provider_id,omitempty"`
ModelID string `json:"model_id,omitempty"`
ExternalAgentID string `json:"external_agent_id,omitempty"`
ExternalAgentName string `json:"external_agent_name,omitempty"`
PermissionMode PermissionMode `json:"permission_mode,omitempty"`
Status SessionStatus `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type SessionCapabilities ¶ added in v0.1.8
type SessionCapabilities struct {
ProviderSelection bool `json:"provider_selection"`
PermissionMode bool `json:"permission_mode"`
PlanningMode bool `json:"planning_mode"`
NativeTools bool `json:"native_tools"`
ExternalAgent bool `json:"external_agent"`
}
func CapabilitiesForSession ¶ added in v0.1.8
func CapabilitiesForSession(session Session) SessionCapabilities
type SessionCompactResponse ¶
type SessionCompactResponse struct {
Compact CompactSessionResult `json:"compact"`
}
type SessionContextResponse ¶
type SessionContextResponse struct {
Context ContextReport `json:"context"`
}
type SessionInput ¶ added in v0.1.13
type SessionInput struct {
ID string `json:"id"`
SessionID string `json:"session_id"`
TargetRunID string `json:"target_run_id,omitempty"`
Mode BusyInputMode `json:"mode"`
Status SessionInputStatus `json:"status"`
Text string `json:"text"`
Parts []MessagePart `json:"parts,omitempty"`
Client string `json:"client,omitempty"`
ExternalKey string `json:"external_key,omitempty"`
ClientCapabilities ClientCapabilities `json:"client_capabilities,omitempty"`
DeliveryAddress json.RawMessage `json:"delivery_address,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
ConsumedRunID string `json:"consumed_run_id,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ConsumedAt *time.Time `json:"consumed_at,omitempty"`
}
type SessionInputStatus ¶ added in v0.1.13
type SessionInputStatus string
const ( SessionInputStatusPending SessionInputStatus = "pending" SessionInputStatusConsumed SessionInputStatus = "consumed" SessionInputStatusError SessionInputStatus = "error" )
type SessionInputStore ¶ added in v0.1.13
type SessionInputStore interface {
CreateSessionInput(ctx context.Context, input SessionInput) error
UpdateSessionInput(ctx context.Context, input SessionInput) error
ListPendingSessionInputs(ctx context.Context, sessionID string) ([]SessionInput, error)
NextPendingSessionInput(ctx context.Context, sessionID string) (SessionInput, error)
ListPendingSteerInputs(ctx context.Context, sessionID string, runID string) ([]SessionInput, error)
}
type SessionKind ¶ added in v0.1.4
type SessionKind string
const ( SessionKindAssistant SessionKind = "assistant" SessionKindExternalAgent SessionKind = "external_agent" )
func NormalizeSessionKind ¶ added in v0.1.4
func NormalizeSessionKind(kind SessionKind) SessionKind
type SessionLLMContextWindowRegistry ¶ added in v0.1.10
type SessionLLMRegistry ¶
type SessionLLMRegistry interface {
ActiveSelection() (providerID string, modelID string)
Providers() []SessionProviderOption
Normalize(providerID string, modelID string) (SessionProviderOption, string, error)
Models(ctx context.Context, providerID string) ([]string, error)
Resolve(ctx context.Context, providerID string, modelID string) (providers.Runtime, SessionProviderOption, string, error)
}
type SessionListFilter ¶
type SessionModelsResponse ¶
type SessionPlan ¶ added in v0.1.7
type SessionPlanResponse ¶ added in v0.1.7
type SessionPlanResponse struct {
Plan SessionPlan `json:"plan"`
}
type SessionProviderOption ¶
type SessionProvidersResponse ¶
type SessionProvidersResponse struct {
Providers []SessionProviderOption `json:"providers"`
}
type SessionResponse ¶
type SessionResponse struct {
Session Session `json:"session"`
}
type SessionRuntime ¶ added in v0.1.4
type SessionRuntime string
const ( SessionRuntimeMatrixClaw SessionRuntime = "matrixclaw" SessionRuntimeExternalAgent SessionRuntime = "external_agent" )
func NormalizeSessionRuntime ¶ added in v0.1.4
func NormalizeSessionRuntime(runtimeID SessionRuntime) SessionRuntime
type SessionSearchReport ¶ added in v0.1.12
type SessionSearchReport struct {
Query string `json:"query"`
Sessions []SessionSearchResult `json:"sessions"`
}
type SessionSearchResult ¶ added in v0.1.12
type SessionSearchResult struct {
Session Session `json:"session"`
Matches []SearchResult `json:"matches"`
}
type SessionStatus ¶
type SessionStatus string
const ( SessionStatusActive SessionStatus = "active" SessionStatusArchived SessionStatus = "archived" )
type SessionStore ¶
type SessionStore interface {
CreateSession(ctx context.Context, session Session) error
GetSession(ctx context.Context, sessionID string) (Session, error)
ListSessions(ctx context.Context, filter SessionListFilter) ([]Session, error)
UpdateSession(ctx context.Context, session Session) error
DeleteSession(ctx context.Context, sessionID string) error
}
type SessionsResponse ¶
type SessionsResponse struct {
Sessions []Session `json:"sessions"`
}
type SkillsPromptContextProvider ¶ added in v0.1.11
type SkillsPromptContextProvider interface {
SkillsPromptContext(context.Context, SkillsPromptContextRequest) string
}
type SkillsPromptContextRequest ¶ added in v0.1.11
type SkillsPromptContextRequest struct {
SessionID string
RunID string
WorkingDir string
Messages []SkillsPromptMessage
}
type SkillsPromptMessage ¶ added in v0.1.11
type SpawnSubagentInput ¶ added in v0.1.13
type SpawnSubagentResult ¶ added in v0.1.13
type SpawnSubagentResult struct {
Task SubagentTask `json:"task"`
Replayed bool `json:"replayed,omitempty"`
}
type SubagentIsolation ¶ added in v0.1.13
type SubagentIsolation string
const ( SubagentIsolationWorktree SubagentIsolation = "worktree" )
type SubagentRuntime ¶ added in v0.1.12
type SubagentRuntime string
const ( SubagentRuntimeMatrixClaw SubagentRuntime = "matrixclaw" SubagentRuntimeCodex SubagentRuntime = "codex" SubagentRuntimeClaude SubagentRuntime = "claude" SubagentRuntimeAuto SubagentRuntime = "auto" )
type SubagentTask ¶ added in v0.1.12
type SubagentTask struct {
ID string `json:"id"`
AgentName string `json:"agent_name,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Mode SubagentTaskMode `json:"mode"`
Isolation SubagentIsolation `json:"isolation"`
ParentSessionID string `json:"parent_session_id"`
ParentRunID string `json:"parent_run_id,omitempty"`
ParentToolCallID string `json:"parent_tool_call_id,omitempty"`
ChildSessionID string `json:"child_session_id,omitempty"`
ChildRunID string `json:"child_run_id,omitempty"`
Runtime string `json:"runtime"`
Goal string `json:"goal"`
Status SubagentTaskStatus `json:"status"`
Summary string `json:"summary,omitempty"`
Error string `json:"error,omitempty"`
ResultMessageID string `json:"result_message_id,omitempty"`
CompletionQueuedAt *time.Time `json:"completion_queued_at,omitempty"`
CompletionDeliveredAt *time.Time `json:"completion_delivered_at,omitempty"`
CompletionAutoResumeRunID string `json:"completion_auto_resume_run_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
type SubagentTaskFilter ¶ added in v0.1.13
type SubagentTaskFilter struct {
ParentSessionID string
Mode SubagentTaskMode
Statuses []SubagentTaskStatus
Limit int
}
type SubagentTaskMode ¶ added in v0.1.13
type SubagentTaskMode string
const ( SubagentTaskModeBlocking SubagentTaskMode = "blocking" SubagentTaskModeAsync SubagentTaskMode = "async" )
type SubagentTaskStatus ¶ added in v0.1.12
type SubagentTaskStatus string
const ( SubagentTaskStatusPending SubagentTaskStatus = "pending" SubagentTaskStatusRunning SubagentTaskStatus = "running" SubagentTaskStatusWaitingApproval SubagentTaskStatus = "waiting_approval" SubagentTaskStatusCompleted SubagentTaskStatus = "completed" SubagentTaskStatusFailed SubagentTaskStatus = "failed" SubagentTaskStatusCanceled SubagentTaskStatus = "canceled" )
type SubagentTaskStore ¶ added in v0.1.12
type SubagentTaskStore interface {
CreateSubagentTask(ctx context.Context, task SubagentTask) error
UpdateSubagentTask(ctx context.Context, task SubagentTask) error
GetSubagentTask(ctx context.Context, taskID string) (SubagentTask, error)
GetSubagentTaskByParentToolCall(ctx context.Context, parentSessionID string, parentRunID string, parentToolCallID string) (SubagentTask, error)
GetSubagentTaskByChildRun(ctx context.Context, childRunID string) (SubagentTask, error)
ListSubagentTasks(ctx context.Context, filter SubagentTaskFilter) ([]SubagentTask, error)
ListActiveSubagentTasksByParent(ctx context.Context, parentSessionID string) ([]SubagentTask, error)
ListPendingSubagentCompletionTasks(ctx context.Context, limit int) ([]SubagentTask, error)
}
type ToolCallPart ¶
type ToolExecuteResponse ¶
type ToolExecuteResponse struct {
Result ExecuteToolResult `json:"result"`
}
type ToolExecutor ¶
type ToolLifecycleState ¶
type ToolLifecycleState string
const ( ToolLifecycleRequested ToolLifecycleState = "requested" ToolLifecycleWaitingApproval ToolLifecycleState = "waiting_approval" ToolLifecycleCompleted ToolLifecycleState = "completed" ToolLifecycleFailed ToolLifecycleState = "failed" )
type ToolResultPart ¶
type ToolResultPart struct {
ToolCallID string `json:"tool_call_id"`
Name string `json:"name"`
Content string `json:"content"`
MIMEType string `json:"mime_type,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Status string `json:"status,omitempty"`
IsError bool `json:"is_error,omitempty"`
}
type ToolUpdate ¶
type ToolUpdate struct {
ToolCallID string `json:"tool_call_id"`
ToolName string `json:"tool_name"`
State ToolLifecycleState `json:"state"`
ResultStatus string `json:"result_status,omitempty"`
RunID string `json:"run_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
ApprovalID string `json:"approval_id,omitempty"`
ResultMessageID string `json:"result_message_id,omitempty"`
Error string `json:"error,omitempty"`
}
type ToolsResponse ¶
type UpdateExternalAgentRequest ¶ added in v0.1.6
type UpdatePlanItemRequest ¶ added in v0.1.7
type UpdateSessionLLMRequest ¶
type UpdateSessionPermissionModeInput ¶
type UpdateSessionPermissionModeInput struct {
SessionID string
PermissionMode PermissionMode
}
type UpdateSessionPermissionModeRequest ¶
type UpdateSessionPermissionModeRequest struct {
PermissionMode string `json:"permission_mode"`
}
type UpdateSessionPlanRequest ¶ added in v0.1.7
type UsageFilter ¶ added in v0.1.7
type UsageRecord ¶ added in v0.1.7
type UsageRecord struct {
ID string `json:"id"`
SessionID string `json:"session_id"`
RunID string `json:"run_id"`
MessageID string `json:"message_id,omitempty"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
InputTokens int64 `json:"input_tokens,omitempty"`
OutputTokens int64 `json:"output_tokens,omitempty"`
TotalTokens int64 `json:"total_tokens,omitempty"`
CachedTokens int64 `json:"cached_tokens,omitempty"`
ReasoningTokens int64 `json:"reasoning_tokens,omitempty"`
Estimated bool `json:"estimated,omitempty"`
ProviderRaw string `json:"provider_raw,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type UsageReport ¶ added in v0.1.7
type UsageReport struct {
Summary UsageSummary `json:"summary"`
Records []UsageRecord `json:"records,omitempty"`
}
type UsageResponse ¶ added in v0.1.7
type UsageResponse struct {
Usage UsageReport `json:"usage"`
}
type UsageStore ¶ added in v0.1.7
type UsageStore interface {
SaveUsageRecord(ctx context.Context, record UsageRecord) error
ListUsageRecords(ctx context.Context, filter UsageFilter) ([]UsageRecord, error)
}
type UsageSummary ¶ added in v0.1.7
type UsageSummary struct {
SessionID string `json:"session_id,omitempty"`
Runs int `json:"runs"`
InputTokens int64 `json:"input_tokens,omitempty"`
OutputTokens int64 `json:"output_tokens,omitempty"`
TotalTokens int64 `json:"total_tokens,omitempty"`
CachedTokens int64 `json:"cached_tokens,omitempty"`
ReasoningTokens int64 `json:"reasoning_tokens,omitempty"`
}
type UseBindingInput ¶
Source Files
¶
- assistant_sanitize.go
- bindings.go
- context.go
- context_compact.go
- context_errors.go
- context_markers.go
- context_report.go
- contracts.go
- core.go
- deliveries.go
- errors.go
- events.go
- execution.go
- execution_conversation.go
- execution_prompts.go
- execution_request.go
- execution_status.go
- execution_turn.go
- external_agent_execution.go
- external_agents.go
- memory.go
- memory_tools.go
- messages.go
- permissions.go
- plan.go
- plan_tools.go
- ports.go
- realtime_voice.go
- run_cancel.go
- run_timing.go
- runs.go
- search.go
- session_inputs.go
- session_titles.go
- sessions.go
- snapshot.go
- subagents.go
- subagents_async.go
- subagents_lifecycle.go
- subagents_persistence.go
- subagents_presentation.go
- subagents_runtime.go
- subagents_tools.go
- subagents_work.go
- subagents_worktree.go
- system_messages.go
- tool_approvals.go
- tool_call_approval.go
- tool_call_finish.go
- tool_call_prepare.go
- tool_call_run.go
- tool_helpers.go
- tool_permissions.go
- tool_specs.go
- tools.go
- types_approval.go
- types_delivery.go
- types_memory.go
- types_message.go
- types_plan.go
- types_run.go
- types_search.go
- types_server.go
- types_session.go
- types_subagent.go
- types_usage.go
- usage.go