Documentation
¶
Index ¶
- Constants
- Variables
- func AssistantSystemPrompt(profile AssistantProfile) string
- func EstimateMessageTokens(messages []Message) int
- func EstimateTextTokens(text string) int
- func FormatShortNumber(value int) string
- type AcceptRunErrorResponse
- type AcceptRunResult
- type AdminRestartRequest
- type Approval
- type ApprovalResolveRequest
- type ApprovalResponse
- type ApprovalState
- type ApprovalStore
- type ApprovalsResponse
- type AssistantProfile
- type AttachmentData
- type AttachmentReader
- type BindingStore
- type ClientBinding
- type ClientBindingResponse
- type ClientDeliveriesResponse
- type ClientDelivery
- type ClientDeliveryFilter
- type ClientDeliveryStatus
- type ClientDeliveryTarget
- type ClientSnapshot
- type ClientSnapshotResponse
- 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) CancelRun(ctx context.Context, runID string) (Run, error)
- func (c *Core) ClientSnapshot(ctx context.Context, client string, externalKey string) (ClientSnapshot, error)
- func (c *Core) CompactSession(ctx context.Context, sessionID string) (CompactSessionResult, error)
- func (c *Core) CreateClientDelivery(ctx context.Context, delivery ClientDelivery) (ClientDelivery, 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) 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) ListApprovals(ctx context.Context, sessionID string, state ApprovalState) ([]Approval, error)
- func (c *Core) ListClientDeliveries(ctx context.Context, filter ClientDeliveryFilter) ([]ClientDelivery, 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) 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) ModelsForSession(ctx context.Context, sessionID string) (string, string, []string, 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) SessionContext(ctx context.Context, sessionID string) (ContextReport, error)
- func (c *Core) SessionProviderOptions() []SessionProviderOption
- func (c *Core) SetAssistantProfile(profile AssistantProfile)
- func (c *Core) SetSessionLLMs(registry SessionLLMRegistry)
- 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) 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) 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) WithSessionLLMs(registry SessionLLMRegistry) *Core
- func (c *Core) WithTools(toolExecutor ToolExecutor) *Core
- type CreateSessionInput
- type CreateSessionRequest
- type CreateSystemMessageRequest
- type DeliveryStore
- 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 Message
- type MessagePart
- type MessagePartKind
- type MessageResponse
- type MessageRole
- type MessageStore
- type MessagesResponse
- type OKResponse
- type PermissionMode
- type PermissionNotification
- type PermissionRequest
- type ProviderUsage
- type ReasoningPart
- type RenameSessionInput
- type RenameSessionRequest
- type Run
- type RunResponse
- type RunStarter
- type RunStatus
- type RunStore
- type RunTiming
- type ServerStatus
- type ServerStatusResponse
- type Session
- type SessionCompactResponse
- type SessionContextResponse
- type SessionKind
- type SessionLLMRegistry
- type SessionListFilter
- type SessionModelsResponse
- type SessionProviderOption
- type SessionProvidersResponse
- type SessionResponse
- type SessionRuntime
- type SessionStatus
- type SessionStore
- type SessionsResponse
- type Store
- type TextPart
- type ToolCallPart
- type ToolExecuteResponse
- type ToolExecutor
- type ToolLifecycleState
- type ToolResultPart
- type ToolUpdate
- type ToolsResponse
- type UpdateExternalAgentRequest
- type UpdateSessionLLMRequest
- type UpdateSessionPermissionModeInput
- type UpdateSessionPermissionModeRequest
- type UseBindingInput
Constants ¶
View Source
const ( ClientDeliveryTypeDaemonRestart = "daemon_restart" ClientDeliveryTypeAutomationRun = "automation_run" )
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrBindingNotFound = errors.New("binding not found") ErrSessionSelectionRequired = errors.New("session selection required") ErrInvalidInput = errors.New("invalid input") )
View Source
var ErrSessionRequired = errors.New("session_id is required")
Functions ¶
func AssistantSystemPrompt ¶
func AssistantSystemPrompt(profile AssistantProfile) string
func EstimateMessageTokens ¶
func EstimateTextTokens ¶
func FormatShortNumber ¶
Types ¶
type AcceptRunErrorResponse ¶
type AcceptRunResult ¶
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 ClientBinding ¶
type ClientBindingResponse ¶
type ClientBindingResponse struct {
Binding ClientBinding `json:"binding"`
}
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"`
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 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"`
Context *ContextReport `json:"context,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"`
}
type ClientSnapshotResponse ¶
type ClientSnapshotResponse struct {
Snapshot ClientSnapshot `json:"snapshot"`
}
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" 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) ClientSnapshot ¶
func (*Core) CompactSession ¶
func (*Core) CreateClientDelivery ¶
func (c *Core) CreateClientDelivery(ctx context.Context, delivery ClientDelivery) (ClientDelivery, error)
func (*Core) CreateSession ¶
func (*Core) CreateSystemMessage ¶
func (*Core) CurrentBinding ¶
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) ListApprovals ¶
func (*Core) ListClientDeliveries ¶
func (c *Core) ListClientDeliveries(ctx context.Context, filter ClientDeliveryFilter) ([]ClientDelivery, error)
func (*Core) ListMessages ¶
func (*Core) ListSessions ¶
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) ModelsForSession ¶
func (*Core) RenameSession ¶
func (*Core) ResolveApproval ¶
func (*Core) SessionContext ¶
func (*Core) SessionProviderOptions ¶
func (c *Core) SessionProviderOptions() []SessionProviderOption
func (*Core) SetAssistantProfile ¶
func (c *Core) SetAssistantProfile(profile AssistantProfile)
func (*Core) SetSessionLLMs ¶
func (c *Core) SetSessionLLMs(registry SessionLLMRegistry)
func (*Core) SubscribeEvents ¶
func (*Core) SubscribeEventsAfter ¶
func (*Core) UpdateSessionModel ¶
func (*Core) UpdateSessionPermissionMode ¶
func (*Core) UpdateSessionProvider ¶
func (*Core) UseBinding ¶
func (c *Core) UseBinding(ctx context.Context, input UseBindingInput) (ClientBinding, error)
func (*Core) WithAttachmentReader ¶
func (c *Core) WithAttachmentReader(reader AttachmentReader) *Core
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) WithSessionLLMs ¶
func (c *Core) WithSessionLLMs(registry SessionLLMRegistry) *Core
func (*Core) WithTools ¶
func (c *Core) WithTools(toolExecutor ToolExecutor) *Core
type CreateSessionInput ¶
type CreateSessionInput struct {
Title string
Kind SessionKind
RuntimeID SessionRuntime
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 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 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" EventToolUpdated EventType = "tool.updated" EventApprovalRequest EventType = "approval.requested" EventApprovalResult EventType = "approval.resolved" EventFileVersioned EventType = "file.versioned" )
type ExecuteToolInput ¶
type ExecuteToolInput struct {
SessionID string `json:"session_id"`
RunID string `json:"run_id,omitempty"`
ToolName string `json:"tool_name"`
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"`
}
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"`
SessionID string `json:"session_id"`
Text string `json:"text"`
Parts []MessagePart `json:"parts,omitempty"`
WorkingDir string `json:"working_dir"`
AllowAutoBindOne bool `json:"allow_auto_bind_one"`
}
type HandleTriggeredRunInput ¶
type HealthResponse ¶
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 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"`
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)
UpdateRun(ctx context.Context, run Run) error
CompleteRun(ctx context.Context, assistantMessage Message, run Run) error
AcceptMessage(ctx context.Context, message Message, run Run) 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"`
WorkingDir string `json:"working_dir,omitempty"`
ProviderID string `json:"provider_id,omitempty"`
ModelID string `json:"model_id,omitempty"`
PermissionMode PermissionMode `json:"permission_mode,omitempty"`
Status SessionStatus `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type SessionCompactResponse ¶
type SessionCompactResponse struct {
Compact CompactSessionResult `json:"compact"`
}
type SessionContextResponse ¶
type SessionContextResponse struct {
Context ContextReport `json:"context"`
}
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 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 SessionListFilter struct {
IncludeArchived bool
}
type SessionModelsResponse ¶
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 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 Store ¶
type Store interface {
SessionStore
BindingStore
DeliveryStore
MessageStore
RunStore
ApprovalStore
FileSnapshotStore
}
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 UpdateSessionLLMRequest ¶
type UpdateSessionPermissionModeInput ¶
type UpdateSessionPermissionModeInput struct {
SessionID string
PermissionMode PermissionMode
}
type UpdateSessionPermissionModeRequest ¶
type UpdateSessionPermissionModeRequest struct {
PermissionMode string `json:"permission_mode"`
}
type UseBindingInput ¶
Source Files
¶
- assistant_sanitize.go
- bindings.go
- context.go
- contracts.go
- core.go
- deliveries.go
- errors.go
- events.go
- execution.go
- execution_provider.go
- execution_status.go
- execution_turn.go
- external_agent_execution.go
- external_agents.go
- messages.go
- permissions.go
- ports.go
- run_cancel.go
- run_timing.go
- runs.go
- sessions.go
- snapshot.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.go
Click to show internal directories.
Click to hide internal directories.