Versions in this module Expand all Collapse all v1 v1.154.0 Oct 28, 2026 v1.153.0 Oct 27, 2026 Changes in this version + type Backend interface + AddMessage func(ctx context.Context, sessionID string, msg *session.Message) error + AddSummary func(ctx context.Context, sessionID string, item session.Item) error + CompactSession func(ctx context.Context, sessionID string) error + CreateSession func(ctx context.Context, sessTemplate *session.Session) (*session.Session, error) + DeleteRemoteSession func(ctx context.Context, sessionID string) error + ExecuteSessionMCPPrompt func(ctx context.Context, sessionID, promptName string, args map[string]string) (string, error) + FollowUpSession func(ctx context.Context, sessionID string, messages []api.Message) error + GetAgent func(ctx context.Context, id string) (*latest.Config, error) + GetAgentToolCount func(ctx context.Context, agentFilename, agentName string) (int, error) + GetAllSessions func(ctx context.Context) ([]session.Session, error) + GetAvailableModels func(ctx context.Context) ([]string, error) + GetSessionMCPPrompts func(ctx context.Context, sessionID string) (map[string]any, error) + GetSessionSkills func(ctx context.Context, sessionID string) (map[string]any, error) + GetSessionSnapshots func(ctx context.Context, sessionID string) ([]map[string]any, error) + GetSessionTools func(ctx context.Context, sessionID string) ([]tools.Tool, error) + GetSessionToolsets func(ctx context.Context, sessionID string) ([]map[string]any, error) + PauseSession func(ctx context.Context, sessionID string) error + ResetSession func(ctx context.Context, sessionID string) error + RestartSessionToolset func(ctx context.Context, sessionID, toolsetName string) error + ResumeElicitation func(ctx context.Context, sessionID string, action tools.ElicitationAction, ...) error + ResumeSession func(ctx context.Context, id, confirmation, reason, toolName string) error + RunAgent func(ctx context.Context, sessionID, agent string, messages []api.Message, ...) (<-chan agentruntime.Event, error) + RunAgentWithAgentName func(ctx context.Context, sessionID, agent, agentName string, ...) (<-chan agentruntime.Event, error) + SetSessionStarred func(ctx context.Context, sessionID string, starred bool) error + SteerSession func(ctx context.Context, sessionID string, messages []api.Message) error + StreamSessionEvents func(ctx context.Context, sessionID string) (<-chan agentruntime.Event, error) + UndoSession func(ctx context.Context, sessionID string) error + UpdateMessage func(ctx context.Context, sessionID, msgID string, msg *session.Message) error + UpdateSessionTitle func(ctx context.Context, sessionID, title string) error + UpdateSessionTokens func(ctx context.Context, sessionID string, inputTokens, outputTokens int64, ...) error + type Client struct + func NewClient(baseURL string, opts ...ClientOption) (*Client, error) + func (c *Client) AddMessage(ctx context.Context, sessionID string, msg *session.Message) error + func (c *Client) AddSummary(ctx context.Context, sessionID string, item session.Item) error + func (c *Client) BatchDeleteSessions(ctx context.Context, sessionIDs []string) (map[string]any, error) + func (c *Client) BatchExportSessions(ctx context.Context, sessionIDs []string, format string) (map[string]any, error) + func (c *Client) CompactSession(ctx context.Context, sessionID string) error + func (c *Client) CreateAgent(ctx context.Context, prompt string) (*api.CreateAgentResponse, error) + func (c *Client) CreateAgentConfig(ctx context.Context, filename, model, description, instruction string) (*api.CreateAgentConfigResponse, error) + func (c *Client) CreateSession(ctx context.Context, sessTemplate *session.Session) (*session.Session, error) + func (c *Client) DeleteAgent(ctx context.Context, filePath string) (*api.DeleteAgentResponse, error) + func (c *Client) DeleteRemoteSession(ctx context.Context, sessionID string) error + func (c *Client) DeleteSession(ctx context.Context, id string) error + func (c *Client) EditAgentConfig(ctx context.Context, filename string, config latest.Config) (*api.EditAgentConfigResponse, error) + func (c *Client) ExecuteSessionMCPPrompt(ctx context.Context, sessionID, promptName string, args map[string]string) (string, error) + func (c *Client) ExportAgents(ctx context.Context) (*api.ExportAgentsResponse, error) + func (c *Client) FollowUpSession(ctx context.Context, sessionID string, messages []api.Message) error + func (c *Client) GetAgent(ctx context.Context, id string) (*latest.Config, error) + func (c *Client) GetAgentToolCount(ctx context.Context, agentFilename, agentName string) (int, error) + func (c *Client) GetAgents(ctx context.Context) ([]api.Agent, error) + func (c *Client) GetAllSessions(ctx context.Context) ([]session.Session, error) + func (c *Client) GetAvailableModels(ctx context.Context) ([]string, error) + func (c *Client) GetDesktopToken(ctx context.Context) (*api.DesktopTokenResponse, error) + func (c *Client) GetSession(ctx context.Context, id string) (*api.SessionResponse, error) + func (c *Client) GetSessionMCPPrompts(ctx context.Context, sessionID string) (map[string]any, error) + func (c *Client) GetSessionQueueStatus(ctx context.Context, sessionID string) (*api.QueueDepthResponse, error) + func (c *Client) GetSessionRecoveryData(ctx context.Context, sessionID string) (map[string]any, error) + func (c *Client) GetSessionSkills(ctx context.Context, sessionID string) (map[string]any, error) + func (c *Client) GetSessionSnapshot(ctx context.Context, sessionID string) (*api.SessionSnapshotResponse, error) + func (c *Client) GetSessionSnapshots(ctx context.Context, sessionID string) ([]map[string]any, error) + func (c *Client) GetSessionTools(ctx context.Context, sessionID string) ([]tools.Tool, error) + func (c *Client) GetSessionToolsets(ctx context.Context, sessionID string) ([]map[string]any, error) + func (c *Client) GetSessions(ctx context.Context) ([]api.SessionsResponse, error) + func (c *Client) Health(ctx context.Context) error + func (c *Client) ImportAgent(ctx context.Context, filePath string) (*api.ImportAgentResponse, error) + func (c *Client) PauseSession(ctx context.Context, sessionID string) error + func (c *Client) PullAgent(ctx context.Context, name string) (*api.PullAgentResponse, error) + func (c *Client) PushAgent(ctx context.Context, filepath, tag string) (*api.PushAgentResponse, error) + func (c *Client) Ready(ctx context.Context) (*api.ReadyResponse, error) + func (c *Client) ResetSession(ctx context.Context, sessionID string) error + func (c *Client) RestartSessionToolset(ctx context.Context, sessionID, toolsetName string) error + func (c *Client) ResumeElicitation(ctx context.Context, sessionID string, action tools.ElicitationAction, ...) error + func (c *Client) ResumeSession(ctx context.Context, id, confirmation, reason, toolName string) error + func (c *Client) RunAgent(ctx context.Context, sessionID, agent string, messages []api.Message, ...) (<-chan agentruntime.Event, error) + func (c *Client) RunAgentWithAgentName(ctx context.Context, sessionID, agent, agentName string, ...) (<-chan agentruntime.Event, error) + func (c *Client) SetSessionStarred(ctx context.Context, sessionID string, starred bool) error + func (c *Client) SteerSession(ctx context.Context, sessionID string, messages []api.Message) error + func (c *Client) StreamSessionEvents(ctx context.Context, sessionID string) (<-chan agentruntime.Event, error) + func (c *Client) StreamSessionEventsSince(ctx context.Context, sessionID string, since uint64) (<-chan agentruntime.Event, error) + func (c *Client) UndoSession(ctx context.Context, sessionID string) error + func (c *Client) UpdateMessage(ctx context.Context, sessionID, msgID string, msg *session.Message) error + func (c *Client) UpdateSessionTitle(ctx context.Context, sessionID, title string) error + func (c *Client) UpdateSessionTokens(ctx context.Context, sessionID string, inputTokens, outputTokens int64, ...) error + type ClientOption func(*Client) + func WithAuthToken(token string) ClientOption + func WithHTTPClient(client *http.Client) ClientOption + func WithTimeout(timeout time.Duration) ClientOption + type ErrorResponse struct + Error string + type Option func(*Runtime) + func WithRemoteAgentFilename(filename string) Option + func WithRemoteCurrentAgent(agentName string) Option + type Runtime struct + func NewRuntime(client Backend, opts ...Option) (*Runtime, error) + func (r *Runtime) AddMessageToSession(ctx context.Context, msg *session.Message) error + func (r *Runtime) AddSessionSummary(ctx context.Context, item session.Item) error + func (r *Runtime) AvailableModels(ctx context.Context) []modelcatalog.ModelChoice + func (r *Runtime) Close() error + func (r *Runtime) CurrentAgentInfo(ctx context.Context) agentruntime.CurrentAgentInfo + func (r *Runtime) CurrentAgentName(ctx context.Context) string + func (r *Runtime) CurrentAgentSkillsToolset() *skills.ToolSet + func (r *Runtime) CurrentAgentTools(ctx context.Context) ([]tools.Tool, error) + func (r *Runtime) CurrentAgentToolsetStatuses() []tools.ToolsetStatus + func (r *Runtime) CurrentMCPPrompts(ctx context.Context) map[string]tools.PromptInfo + func (r *Runtime) CycleAgentThinkingLevel(context.Context, string) (effort.Level, error) + func (r *Runtime) EmitAgentInfo(ctx context.Context, events agentruntime.EventSink) + func (r *Runtime) EmitStartupInfo(ctx context.Context, _ *session.Session, events agentruntime.EventSink) + func (r *Runtime) ExecuteMCPPrompt(ctx context.Context, promptName string, args map[string]string) (string, error) + func (r *Runtime) FollowUp(ctx context.Context, msg agentruntime.QueuedMessage) error + func (r *Runtime) GetSnapshots(ctx context.Context) ([]map[string]any, error) + func (r *Runtime) OnBackgroundEvent(handler func(agentruntime.Event)) + func (r *Runtime) OnElicitationRequest(func(agentruntime.Event)) + func (r *Runtime) OnToolsChanged(func(agentruntime.Event)) + func (r *Runtime) PermissionsInfo() *agentruntime.PermissionsInfo + func (r *Runtime) QueueStatus() agentruntime.QueueStatus + func (r *Runtime) ReadSkillContent(context.Context, *session.Session, string) (string, error) + func (r *Runtime) Reset(ctx context.Context) error + func (r *Runtime) ResetStartupInfo() + func (r *Runtime) RestartToolset(ctx context.Context, toolsetName string) error + func (r *Runtime) Resume(ctx context.Context, req agentruntime.ResumeRequest) + func (r *Runtime) ResumeElicitation(ctx context.Context, action tools.ElicitationAction, content map[string]any, ...) error + func (r *Runtime) RetireBackgroundEvents() + func (r *Runtime) Run(ctx context.Context, sess *session.Session) ([]session.Message, error) + func (r *Runtime) RunSkillFork(context.Context, *session.Session, skills.RunSkillArgs, agentruntime.EventSink) (*tools.ToolCallResult, error) + func (r *Runtime) RunStream(ctx context.Context, sess *session.Session) <-chan agentruntime.Event + func (r *Runtime) SessionStore() session.Store + func (r *Runtime) SetAgentModel(_ context.Context, _, modelRef string) error + func (r *Runtime) SetAgentThinkingLevel(context.Context, string, effort.Level) (effort.Level, error) + func (r *Runtime) SetCurrentAgent(ctx context.Context, agentName string) error + func (r *Runtime) SetSessionStarred(ctx context.Context, starred bool) error + func (r *Runtime) Steer(ctx context.Context, msg agentruntime.QueuedMessage) error + func (r *Runtime) Summarize(ctx context.Context, sess *session.Session, _ string, ...) + func (r *Runtime) SupportsModelSwitching() bool + func (r *Runtime) TitleGenerator(context.Context) *sessiontitle.Generator + func (r *Runtime) TogglePause(ctx context.Context) (bool, error) + func (r *Runtime) Undo(ctx context.Context) error + func (r *Runtime) UpdateSessionMessage(ctx context.Context, msgID string, msg *session.Message) error + func (r *Runtime) UpdateSessionTitle(ctx context.Context, sess *session.Session, title string) error + func (r *Runtime) UpdateSessionTokens(ctx context.Context, inputTokens, outputTokens int64, cost float64) error + type SessionStore struct + func NewSessionStore(client Backend) *SessionStore + func (s *SessionStore) AddError(context.Context, string, *session.Error) error + func (s *SessionStore) AddEvaluation(context.Context, string, *session.Evaluation) error + func (s *SessionStore) AddMessage(context.Context, string, *session.Message) (int64, error) + func (s *SessionStore) AddRoutingDecision(context.Context, string, *session.RoutingDecision) error + func (s *SessionStore) AddSession(context.Context, *session.Session) error + func (s *SessionStore) AddSubSession(context.Context, string, *session.Session) error + func (s *SessionStore) AddSummary(context.Context, string, session.Item) error + func (s *SessionStore) Close() error + func (s *SessionStore) DeleteSession(ctx context.Context, id string) error + func (s *SessionStore) GetSession(context.Context, string) (*session.Session, error) + func (s *SessionStore) GetSessionByOrigin(context.Context, string, string) (*session.Session, error) + func (s *SessionStore) GetSessionSummaries(context.Context) ([]session.Summary, error) + func (s *SessionStore) GetSessions(ctx context.Context) ([]*session.Session, error) + func (s *SessionStore) PersistCompaction(context.Context, *session.Session, int64, int64, session.Item) error + func (s *SessionStore) SetSessionStarred(context.Context, string, bool) error + func (s *SessionStore) UpdateMessage(context.Context, string, int64, *session.Message) error + func (s *SessionStore) UpdateSession(context.Context, *session.Session) error + func (s *SessionStore) UpdateSessionTitle(context.Context, string, string) error + func (s *SessionStore) UpdateSessionTokens(context.Context, string, int64, int64, float64) error