Help us shape the future of Go! Take the 2026 Go Developer Survey

remote

package
v1.154.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// GetAgent retrieves an agent configuration by ID
	GetAgent(ctx context.Context, id string) (*latest.Config, error)

	// CreateSession creates a new session
	CreateSession(ctx context.Context, sessTemplate *session.Session) (*session.Session, error)

	// ResumeSession resumes a paused session with optional rejection reason or tool name
	ResumeSession(ctx context.Context, id, confirmation, reason, toolName string) error

	// ResumeElicitation sends an elicitation response. elicitationID is
	// additive: pass "" to fall back to the sole-pending-request behavior.
	// Variadic for the same Go-API-compatibility reason as
	// [Runtime.ResumeElicitation]: at most one value is meaningful.
	ResumeElicitation(ctx context.Context, sessionID string, action tools.ElicitationAction, content map[string]any, elicitationID ...string) error

	// RunAgent executes an agent and returns a channel of streaming events.
	// model, when non-empty, is applied as a persistent override on the
	// session's current agent before the turn starts.
	RunAgent(ctx context.Context, sessionID, agent string, messages []api.Message, model string) (<-chan agentruntime.Event, error)

	// RunAgentWithAgentName executes an agent with a specific agent name. See RunAgent for the meaning of model.
	RunAgentWithAgentName(ctx context.Context, sessionID, agent, agentName string, messages []api.Message, model string) (<-chan agentruntime.Event, error)

	// SteerSession injects user messages into a running session mid-turn
	SteerSession(ctx context.Context, sessionID string, messages []api.Message) error

	// FollowUpSession queues messages for end-of-turn processing
	FollowUpSession(ctx context.Context, sessionID string, messages []api.Message) error

	// UpdateSessionTitle updates the title of a session
	UpdateSessionTitle(ctx context.Context, sessionID, title string) error

	// GetAgentToolCount returns the number of tools available for an agent
	GetAgentToolCount(ctx context.Context, agentFilename, agentName string) (int, error)

	// StreamSessionEvents streams runtime events for a session as they occur
	StreamSessionEvents(ctx context.Context, sessionID string) (<-chan agentruntime.Event, error)

	// GetAllSessions retrieves all sessions from the remote store
	GetAllSessions(ctx context.Context) ([]session.Session, error)

	// DeleteRemoteSession deletes a session from the remote store
	DeleteRemoteSession(ctx context.Context, sessionID string) error

	// GetSessionTools retrieves tools available in a session
	GetSessionTools(ctx context.Context, sessionID string) ([]tools.Tool, error)

	// GetAvailableModels returns available models for the agent
	GetAvailableModels(ctx context.Context) ([]string, error)

	// GetSessionMCPPrompts returns available MCP prompts for a session
	GetSessionMCPPrompts(ctx context.Context, sessionID string) (map[string]any, error)

	// ExecuteSessionMCPPrompt executes an MCP prompt in a session
	ExecuteSessionMCPPrompt(ctx context.Context, sessionID, promptName string, args map[string]string) (string, error)

	// GetSessionSkills returns available skills for a session
	GetSessionSkills(ctx context.Context, sessionID string) (map[string]any, error)

	// CompactSession triggers session compaction on the server
	CompactSession(ctx context.Context, sessionID string) error

	// GetSessionToolsets returns toolset statuses for a session
	GetSessionToolsets(ctx context.Context, sessionID string) ([]map[string]any, error)

	// RestartSessionToolset restarts a toolset in a session
	RestartSessionToolset(ctx context.Context, sessionID, toolsetName string) error

	// PauseSession pauses a session
	PauseSession(ctx context.Context, sessionID string) error

	// GetSessionSnapshots retrieves snapshots for a session
	GetSessionSnapshots(ctx context.Context, sessionID string) ([]map[string]any, error)

	// UndoSession reverts a session to the previous snapshot
	UndoSession(ctx context.Context, sessionID string) error

	// ResetSession resets a session to initial state
	ResetSession(ctx context.Context, sessionID string) error

	// AddMessage adds a message to a session
	AddMessage(ctx context.Context, sessionID string, msg *session.Message) error

	// UpdateMessage updates a message in a session
	UpdateMessage(ctx context.Context, sessionID, msgID string, msg *session.Message) error

	// AddSummary adds a summary item to a session
	AddSummary(ctx context.Context, sessionID string, item session.Item) error

	// UpdateSessionTokens updates token counts for a session
	UpdateSessionTokens(ctx context.Context, sessionID string, inputTokens, outputTokens int64, cost float64) error

	// SetSessionStarred sets the starred status for a session
	SetSessionStarred(ctx context.Context, sessionID string, starred bool) error
}

Backend is the interface that both HTTP and Connect-RPC clients implement for communicating with a remote docker agent server. It provides methods for creating sessions, running agents, and streaming events.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an HTTP client for the docker agent server API

func NewClient

func NewClient(baseURL string, opts ...ClientOption) (*Client, error)

NewClient creates a new HTTP client for the docker agent server

func (*Client) AddMessage

func (c *Client) AddMessage(ctx context.Context, sessionID string, msg *session.Message) error

AddMessage adds a message to a session.

func (*Client) AddSummary

func (c *Client) AddSummary(ctx context.Context, sessionID string, item session.Item) error

AddSummary adds a summary item to a session.

func (*Client) BatchDeleteSessions

func (c *Client) BatchDeleteSessions(ctx context.Context, sessionIDs []string) (map[string]any, error)

BatchDeleteSessions deletes multiple sessions in a single operation

func (*Client) BatchExportSessions

func (c *Client) BatchExportSessions(ctx context.Context, sessionIDs []string, format string) (map[string]any, error)

BatchExportSessions exports multiple sessions

func (*Client) CompactSession

func (c *Client) CompactSession(ctx context.Context, sessionID string) error

CompactSession triggers session compaction on the server.

func (*Client) CreateAgent

func (c *Client) CreateAgent(ctx context.Context, prompt string) (*api.CreateAgentResponse, error)

CreateAgent creates a new agent using a prompt

func (*Client) CreateAgentConfig

func (c *Client) CreateAgentConfig(ctx context.Context, filename, model, description, instruction string) (*api.CreateAgentConfigResponse, error)

CreateAgentConfig creates a new agent manually with YAML configuration

func (*Client) CreateSession

func (c *Client) CreateSession(ctx context.Context, sessTemplate *session.Session) (*session.Session, error)

CreateSession creates a new session

func (*Client) DeleteAgent

func (c *Client) DeleteAgent(ctx context.Context, filePath string) (*api.DeleteAgentResponse, error)

DeleteAgent deletes an agent by file path

func (*Client) DeleteRemoteSession

func (c *Client) DeleteRemoteSession(ctx context.Context, sessionID string) error

DeleteRemoteSession deletes a session from the remote store.

func (*Client) DeleteSession

func (c *Client) DeleteSession(ctx context.Context, id string) error

DeleteSession deletes a session by ID

func (*Client) EditAgentConfig

func (c *Client) EditAgentConfig(ctx context.Context, filename string, config latest.Config) (*api.EditAgentConfigResponse, error)

EditAgentConfig edits an agent configuration

func (*Client) ExecuteSessionMCPPrompt

func (c *Client) ExecuteSessionMCPPrompt(ctx context.Context, sessionID, promptName string, args map[string]string) (string, error)

ExecuteSessionMCPPrompt executes an MCP prompt in a session.

func (*Client) ExportAgents

func (c *Client) ExportAgents(ctx context.Context) (*api.ExportAgentsResponse, error)

ExportAgents exports multiple agents as a zip file

func (*Client) FollowUpSession

func (c *Client) FollowUpSession(ctx context.Context, sessionID string, messages []api.Message) error

FollowUpSession queues messages for end-of-turn processing.

func (*Client) GetAgent

func (c *Client) GetAgent(ctx context.Context, id string) (*latest.Config, error)

GetAgent retrieves an agent by ID

func (*Client) GetAgentToolCount

func (c *Client) GetAgentToolCount(ctx context.Context, agentFilename, agentName string) (int, error)

GetAgentToolCount returns the number of tools available for an agent.

func (*Client) GetAgents

func (c *Client) GetAgents(ctx context.Context) ([]api.Agent, error)

GetAgents retrieves all available agents

func (*Client) GetAllSessions

func (c *Client) GetAllSessions(ctx context.Context) ([]session.Session, error)

GetAllSessions retrieves all sessions from the remote store.

func (*Client) GetAvailableModels

func (c *Client) GetAvailableModels(ctx context.Context) ([]string, error)

GetAvailableModels returns available models for the agent.

func (*Client) GetDesktopToken

func (c *Client) GetDesktopToken(ctx context.Context) (*api.DesktopTokenResponse, error)

GetDesktopToken retrieves a desktop authentication token

func (*Client) GetSession

func (c *Client) GetSession(ctx context.Context, id string) (*api.SessionResponse, error)

GetSession retrieves a session by ID

func (*Client) GetSessionMCPPrompts

func (c *Client) GetSessionMCPPrompts(ctx context.Context, sessionID string) (map[string]any, error)

GetSessionMCPPrompts returns available MCP prompts for a session.

func (*Client) GetSessionQueueStatus

func (c *Client) GetSessionQueueStatus(ctx context.Context, sessionID string) (*api.QueueDepthResponse, error)

GetSessionQueueStatus retrieves the queue depth and capacity for a session

func (*Client) GetSessionRecoveryData

func (c *Client) GetSessionRecoveryData(ctx context.Context, sessionID string) (map[string]any, error)

GetSessionRecoveryData retrieves recovery data for a session in case of store failure

func (*Client) GetSessionSkills

func (c *Client) GetSessionSkills(ctx context.Context, sessionID string) (map[string]any, error)

GetSessionSkills returns available skills for a session.

func (*Client) GetSessionSnapshot

func (c *Client) GetSessionSnapshot(ctx context.Context, sessionID string) (*api.SessionSnapshotResponse, error)

GetSessionSnapshot retrieves the recovery state and event-stream cursor.

func (*Client) GetSessionSnapshots

func (c *Client) GetSessionSnapshots(ctx context.Context, sessionID string) ([]map[string]any, error)

GetSessionSnapshots retrieves snapshots for a session.

func (*Client) GetSessionTools

func (c *Client) GetSessionTools(ctx context.Context, sessionID string) ([]tools.Tool, error)

GetSessionTools retrieves tools available in a session.

func (*Client) GetSessionToolsets

func (c *Client) GetSessionToolsets(ctx context.Context, sessionID string) ([]map[string]any, error)

GetSessionToolsets returns toolset statuses for a session.

func (*Client) GetSessions

func (c *Client) GetSessions(ctx context.Context) ([]api.SessionsResponse, error)

GetSessions retrieves all sessions

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

Health checks the health of the remote server.

func (*Client) ImportAgent

func (c *Client) ImportAgent(ctx context.Context, filePath string) (*api.ImportAgentResponse, error)

ImportAgent imports an agent from a file path

func (*Client) PauseSession

func (c *Client) PauseSession(ctx context.Context, sessionID string) error

PauseSession pauses a session.

func (*Client) PullAgent

func (c *Client) PullAgent(ctx context.Context, name string) (*api.PullAgentResponse, error)

PullAgent pulls an agent from a remote registry

func (*Client) PushAgent

func (c *Client) PushAgent(ctx context.Context, filepath, tag string) (*api.PushAgentResponse, error)

PushAgent pushes an agent to a remote registry

func (*Client) Ready

func (c *Client) Ready(ctx context.Context) (*api.ReadyResponse, error)

Ready checks if the remote server is ready to handle requests.

func (*Client) ResetSession

func (c *Client) ResetSession(ctx context.Context, sessionID string) error

ResetSession resets a session to initial state.

func (*Client) RestartSessionToolset

func (c *Client) RestartSessionToolset(ctx context.Context, sessionID, toolsetName string) error

RestartSessionToolset restarts a toolset in a session.

func (*Client) ResumeElicitation

func (c *Client) ResumeElicitation(ctx context.Context, sessionID string, action tools.ElicitationAction, content map[string]any, elicitationID ...string) error

func (*Client) ResumeSession

func (c *Client) ResumeSession(ctx context.Context, id, confirmation, reason, toolName string) error

ResumeSession resumes a session by ID with optional rejection reason or tool name

func (*Client) RunAgent

func (c *Client) RunAgent(ctx context.Context, sessionID, agent string, messages []api.Message, model string) (<-chan agentruntime.Event, error)

RunAgent executes an agent and returns a channel of streaming events. The optional model override is persisted on the session's current agent before the user messages are appended; pass an empty string to leave the existing override (if any) untouched. EOF without a root StreamStoppedEvent is reported as incomplete; a run is never automatically resubmitted.

func (*Client) RunAgentWithAgentName

func (c *Client) RunAgentWithAgentName(ctx context.Context, sessionID, agent, agentName string, messages []api.Message, model string) (<-chan agentruntime.Event, error)

RunAgentWithAgentName executes an agent with a specific agent name and returns a channel of streaming events. See Client.RunAgent for the semantics of model.

func (*Client) SetSessionStarred

func (c *Client) SetSessionStarred(ctx context.Context, sessionID string, starred bool) error

SetSessionStarred sets the starred status for a session.

func (*Client) SteerSession

func (c *Client) SteerSession(ctx context.Context, sessionID string, messages []api.Message) error

SteerSession injects user messages into a running session mid-turn.

func (*Client) StreamSessionEvents

func (c *Client) StreamSessionEvents(ctx context.Context, sessionID string) (<-chan agentruntime.Event, error)

StreamSessionEvents replays buffered events, then tails the session. Sequenced streams reconnect after transport drops. A gap produces an ErrorEvent and closes the channel: callers must reload a snapshot before subscribing again. Unsequenced legacy streams cannot safely reconnect and close at EOF.

func (*Client) StreamSessionEventsSince

func (c *Client) StreamSessionEventsSince(ctx context.Context, sessionID string, since uint64) (<-chan agentruntime.Event, error)

StreamSessionEventsSince tails events newer than a snapshot's LastEventSeq. It never replays older history; see StreamSessionEvents for gap handling.

func (*Client) UndoSession

func (c *Client) UndoSession(ctx context.Context, sessionID string) error

UndoSession reverts a session to the previous snapshot.

func (*Client) UpdateMessage

func (c *Client) UpdateMessage(ctx context.Context, sessionID, msgID string, msg *session.Message) error

UpdateMessage updates a message in a session.

func (*Client) UpdateSessionTitle

func (c *Client) UpdateSessionTitle(ctx context.Context, sessionID, title string) error

UpdateSessionTitle updates the title of a session

func (*Client) UpdateSessionTokens

func (c *Client) UpdateSessionTokens(ctx context.Context, sessionID string, inputTokens, outputTokens int64, cost float64) error

UpdateSessionTokens updates token counts for a session.

type ClientOption

type ClientOption func(*Client)

ClientOption is a function for configuring the Client

func WithAuthToken

func WithAuthToken(token string) ClientOption

WithAuthToken sets the bearer token for authentication

func WithHTTPClient

func WithHTTPClient(client *http.Client) ClientOption

WithHTTPClient sets a custom HTTP client

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout sets the non-streaming HTTP timeout (deprecated: prefer per-request timeouts).

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse represents an error response from the API

type Option

type Option func(*Runtime)

Option is a function for configuring the Runtime

func WithRemoteAgentFilename

func WithRemoteAgentFilename(filename string) Option

WithRemoteAgentFilename sets the agent filename to use with the remote API

func WithRemoteCurrentAgent

func WithRemoteCurrentAgent(agentName string) Option

WithRemoteCurrentAgent sets the current agent name

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime implements the Runtime interface using a remote client. It works with any client that implements the Backend interface, including both HTTP (Client) and Connect-RPC (ConnectRPCClient) clients.

func NewRuntime

func NewRuntime(client Backend, opts ...Option) (*Runtime, error)

NewRuntime creates a new remote runtime that implements the Runtime interface. It accepts any client that implements the Backend interface.

func (*Runtime) AddMessageToSession

func (r *Runtime) AddMessageToSession(ctx context.Context, msg *session.Message) error

AddMessageToSession adds a message to the current session on the remote server.

func (*Runtime) AddSessionSummary

func (r *Runtime) AddSessionSummary(ctx context.Context, item session.Item) error

AddSessionSummary adds a summary item to the current session on the remote server.

func (*Runtime) AvailableModels

func (r *Runtime) AvailableModels(ctx context.Context) []modelcatalog.ModelChoice

AvailableModels returns available models for the agent.

func (*Runtime) Close

func (r *Runtime) Close() error

Close stops the out-of-band session subscription.

func (*Runtime) CurrentAgentInfo

func (r *Runtime) CurrentAgentInfo(ctx context.Context) agentruntime.CurrentAgentInfo

func (*Runtime) CurrentAgentName

func (r *Runtime) CurrentAgentName(ctx context.Context) string

CurrentAgentName returns the name of the currently active agent. When no specific agent has been selected, it falls back to the first agent declared by the remote team config. The remote lookup happens at most once; the result is cached so subsequent calls are O(1).

func (*Runtime) CurrentAgentSkillsToolset

func (r *Runtime) CurrentAgentSkillsToolset() *skills.ToolSet

CurrentAgentSkillsToolset returns nil for remote runtimes since skills are managed server-side.

func (*Runtime) CurrentAgentTools

func (r *Runtime) CurrentAgentTools(ctx context.Context) ([]tools.Tool, error)

CurrentAgentTools returns the tools for the current agent from the session.

func (*Runtime) CurrentAgentToolsetStatuses

func (r *Runtime) CurrentAgentToolsetStatuses() []tools.ToolsetStatus

CurrentAgentToolsetStatuses is not implemented for remote runtimes; the remote server owns the toolset lifecycle. Returns an empty slice so callers (TUI) can show an explanatory empty state without erroring.

func (*Runtime) CurrentMCPPrompts

func (r *Runtime) CurrentMCPPrompts(ctx context.Context) map[string]tools.PromptInfo

CurrentMCPPrompts returns available MCP prompts from the server.

func (*Runtime) CycleAgentThinkingLevel

func (r *Runtime) CycleAgentThinkingLevel(context.Context, string) (effort.Level, error)

CycleAgentThinkingLevel is unsupported on remote runtimes; the server owns model configuration including thinking-effort selection.

func (*Runtime) EmitAgentInfo

func (r *Runtime) EmitAgentInfo(ctx context.Context, events agentruntime.EventSink)

EmitAgentInfo emits agent and team info without re-fetching tool counts.

func (*Runtime) EmitStartupInfo

func (r *Runtime) EmitStartupInfo(ctx context.Context, _ *session.Session, events agentruntime.EventSink)

EmitStartupInfo emits initial agent, team, and toolset information

func (*Runtime) ExecuteMCPPrompt

func (r *Runtime) ExecuteMCPPrompt(ctx context.Context, promptName string, args map[string]string) (string, error)

ExecuteMCPPrompt executes an MCP prompt on the server.

func (*Runtime) FollowUp

func (r *Runtime) FollowUp(ctx context.Context, msg agentruntime.QueuedMessage) error

FollowUp enqueues a message for end-of-turn processing on the remote server.

func (*Runtime) GetSnapshots

func (r *Runtime) GetSnapshots(ctx context.Context) ([]map[string]any, error)

GetSnapshots retrieves available snapshots for the current session.

func (*Runtime) OnBackgroundEvent

func (r *Runtime) OnBackgroundEvent(handler func(agentruntime.Event))

OnBackgroundEvent receives server-side recalls and out-of-band events. The subscription outlives individual turns and stops on Close or unregister.

func (*Runtime) OnElicitationRequest

func (r *Runtime) OnElicitationRequest(func(agentruntime.Event))

OnElicitationRequest is a no-op for remote runtimes; elicitation requests arrive on RunStream, or through OnBackgroundEvent when a cursor-based subscription is active, so there is no additional sink to register.

Runtime deliberately does NOT implement LocalRuntime.MirrorsElicitationOnRunStream: embedders that forward RunStream events verbatim (e.g. pkg/app.App) rely on that capability check to forward RunStream elicitations when no background subscription is active.

func (*Runtime) OnToolsChanged

func (r *Runtime) OnToolsChanged(func(agentruntime.Event))

OnToolsChanged is a no-op for remote runtimes; tool-list changes are observed server-side and surface through the run-stream events rather than via an out-of-band callback.

func (*Runtime) PermissionsInfo

func (r *Runtime) PermissionsInfo() *agentruntime.PermissionsInfo

PermissionsInfo returns nil for remote runtime since permissions are handled server-side.

func (*Runtime) QueueStatus

func (r *Runtime) QueueStatus() agentruntime.QueueStatus

func (*Runtime) ReadSkillContent

func (r *Runtime) ReadSkillContent(context.Context, *session.Session, string) (string, error)

func (*Runtime) Reset

func (r *Runtime) Reset(ctx context.Context) error

Reset resets the session to its initial state on the remote server.

func (*Runtime) ResetStartupInfo

func (r *Runtime) ResetStartupInfo()

ResetStartupInfo is a no-op for remote runtime.

func (*Runtime) RestartToolset

func (r *Runtime) RestartToolset(ctx context.Context, toolsetName string) error

RestartToolset restarts a toolset on the remote server.

func (*Runtime) Resume

func (r *Runtime) Resume(ctx context.Context, req agentruntime.ResumeRequest)

Resume allows resuming execution after user confirmation

func (*Runtime) ResumeElicitation

func (r *Runtime) ResumeElicitation(ctx context.Context, action tools.ElicitationAction, content map[string]any, elicitationID ...string) error

ResumeElicitation answers a request, running OAuth only for its explicit ID.

func (*Runtime) RetireBackgroundEvents

func (r *Runtime) RetireBackgroundEvents()

RetireBackgroundEvents stops deliveries for a replaced conversation.

func (*Runtime) Run

func (r *Runtime) Run(ctx context.Context, sess *session.Session) ([]session.Message, error)

Run starts the agent's interaction loop and returns the final messages

func (*Runtime) RunSkillFork

RunSkillFork is unsupported on remote runtimes; the server owns skill execution.

func (*Runtime) RunStream

func (r *Runtime) RunStream(ctx context.Context, sess *session.Session) <-chan agentruntime.Event

RunStream starts the agent's interaction loop and returns a channel of events

func (*Runtime) SessionStore

func (r *Runtime) SessionStore() session.Store

SessionStore returns a SessionStore that wraps the remote client.

func (*Runtime) SetAgentModel

func (r *Runtime) SetAgentModel(_ context.Context, _, modelRef string) error

SetAgentModel queues modelRef as the override to apply on the session's current agent. The override is forwarded to the server on the next Runtime.RunStream call, where the server persists it as the per-agent model override (same effect as the historic dedicated endpoint, just without the extra round trip). A subsequent call before the next turn replaces the queued ref; an empty string clears it.

func (*Runtime) SetAgentThinkingLevel

func (r *Runtime) SetAgentThinkingLevel(context.Context, string, effort.Level) (effort.Level, error)

SetAgentThinkingLevel is unsupported on remote runtimes; the server owns model configuration including thinking-effort selection.

func (*Runtime) SetCurrentAgent

func (r *Runtime) SetCurrentAgent(ctx context.Context, agentName string) error

SetCurrentAgent sets the currently active agent for subsequent user messages. It validates the name against the remote team config; an unknown agent is rejected so callers see the same behaviour as LocalRuntime. A failure to fetch the team config (network error, auth failure, missing remote) is propagated rather than silently accepted — the whole point of this check is closing that silent-breakage gap.

func (*Runtime) SetSessionStarred

func (r *Runtime) SetSessionStarred(ctx context.Context, starred bool) error

SetSessionStarred sets the starred status for the current session on the remote server.

func (*Runtime) Steer

Steer enqueues a user message for mid-turn injection into the running agent loop on the remote server.

func (*Runtime) Summarize

func (r *Runtime) Summarize(ctx context.Context, sess *session.Session, _ string, sink agentruntime.EventSink)

Summarize generates a summary for the session by compacting it server-side.

func (*Runtime) SupportsModelSwitching

func (r *Runtime) SupportsModelSwitching() bool

SupportsModelSwitching returns true for remote runtimes (model switching is handled server-side).

func (*Runtime) TitleGenerator

func (r *Runtime) TitleGenerator(context.Context) *sessiontitle.Generator

TitleGenerator is not supported on remote runtimes (titles are generated server-side).

func (*Runtime) TogglePause

func (r *Runtime) TogglePause(ctx context.Context) (bool, error)

TogglePause pauses/resumes a session on the server.

func (*Runtime) Undo

func (r *Runtime) Undo(ctx context.Context) error

Undo reverts to the previous snapshot on the remote server.

func (*Runtime) UpdateSessionMessage

func (r *Runtime) UpdateSessionMessage(ctx context.Context, msgID string, msg *session.Message) error

UpdateSessionMessage updates a message in the current session on the remote server.

func (*Runtime) UpdateSessionTitle

func (r *Runtime) UpdateSessionTitle(ctx context.Context, sess *session.Session, title string) error

UpdateSessionTitle updates the title of the current session on the remote server.

func (*Runtime) UpdateSessionTokens

func (r *Runtime) UpdateSessionTokens(ctx context.Context, inputTokens, outputTokens int64, cost float64) error

UpdateSessionTokens updates token counts for the current session on the remote server.

type SessionStore

type SessionStore struct {
	// contains filtered or unexported fields
}

SessionStore wraps a Backend to implement the session.Store interface.

func NewSessionStore

func NewSessionStore(client Backend) *SessionStore

NewSessionStore creates a new SessionStore.

func (*SessionStore) AddError

func (*SessionStore) AddEvaluation

func (s *SessionStore) AddEvaluation(context.Context, string, *session.Evaluation) error

AddEvaluation is a no-op: the server persists runtime evaluation events.

func (*SessionStore) AddMessage

func (*SessionStore) AddRoutingDecision

func (s *SessionStore) AddRoutingDecision(context.Context, string, *session.RoutingDecision) error

AddRoutingDecision is a no-op: the server persists runtime routing events.

func (*SessionStore) AddSession

func (s *SessionStore) AddSession(context.Context, *session.Session) error

func (*SessionStore) AddSubSession

func (s *SessionStore) AddSubSession(context.Context, string, *session.Session) error

func (*SessionStore) AddSummary

func (s *SessionStore) AddSummary(context.Context, string, session.Item) error

func (*SessionStore) Close

func (s *SessionStore) Close() error

func (*SessionStore) DeleteSession

func (s *SessionStore) DeleteSession(ctx context.Context, id string) error

func (*SessionStore) GetSession

func (s *SessionStore) GetSession(context.Context, string) (*session.Session, error)

func (*SessionStore) GetSessionByOrigin

func (s *SessionStore) GetSessionByOrigin(context.Context, string, string) (*session.Session, error)

func (*SessionStore) GetSessionSummaries

func (s *SessionStore) GetSessionSummaries(context.Context) ([]session.Summary, error)

func (*SessionStore) GetSessions

func (s *SessionStore) GetSessions(ctx context.Context) ([]*session.Session, error)

func (*SessionStore) PersistCompaction

func (s *SessionStore) PersistCompaction(context.Context, *session.Session, int64, int64, session.Item) error

func (*SessionStore) SetSessionStarred

func (s *SessionStore) SetSessionStarred(context.Context, string, bool) error

func (*SessionStore) UpdateMessage

func (s *SessionStore) UpdateMessage(context.Context, string, int64, *session.Message) error

func (*SessionStore) UpdateSession

func (s *SessionStore) UpdateSession(context.Context, *session.Session) error

func (*SessionStore) UpdateSessionTitle

func (s *SessionStore) UpdateSessionTitle(context.Context, string, string) error

func (*SessionStore) UpdateSessionTokens

func (s *SessionStore) UpdateSessionTokens(context.Context, string, int64, int64, float64) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL