Documentation
¶
Index ¶
- func ActivateCurrentSelection(cfg *config.Config, vendor, endpoint, model string) (*config.ResolvedEndpoint, provider.Provider, error)
- func AppendProjectionEvent(store *tunnel.ProjectionStore, msg tunnel.GatewayMessage) error
- func ApplyProjectMemoryToAgent(agentInst *agent.Agent, workingDir string) ([]string, error)
- func ApplyProviderToAgent(agentInst *agent.Agent, prov provider.Provider, ...)
- func ApplyResolvedLimitsToAgent(agentInst *agent.Agent, resolved *config.ResolvedEndpoint)
- func ApplyTunnelStateUpdate(broker *tunnel.Broker, update TunnelStateUpdate)
- func ApprovalDecisionFromTunnel(decision string) permission.Decision
- func AttachTunnelBroker(broker *tunnel.Broker, cfg TunnelAttachConfig)
- func BuildAskUserAnswer(question tool.AskUserQuestion, selectedIDs []string, freeform string) tool.AskUserAnswer
- func BuildAskUserResponseFromTunnel(req tool.AskUserRequest, status string, answers []tunnel.AskUserAnswer) tool.AskUserResponse
- func BuildInteractivePermissionPolicy(cfg *config.Config, workingDir string, bypass bool) permission.PermissionPolicy
- func BuildInteractiveSystemPrompt(cfg *config.Config, workingDir string, mode permission.PermissionMode, ...) string
- func BuildInteractiveSystemPromptWithPromptRefs(cfg *config.Config, workingDir string, mode permission.PermissionMode, ...) (string, []string)
- func BuildMCPSkillCommands(snapshots []tool.MCPServerSnapshot) []*commands.Command
- func BuildSkillsSystemPrompt(skills []*commands.Command) string
- func BuildSkillsSystemPromptWithPromptRefs(skills []*commands.Command) (string, []string)
- func BuildTunnelAskUserAnswers(resp tool.AskUserResponse) []tunnel.AskUserAnswer
- func BuildTunnelAskUserQuestions(req tool.AskUserRequest) []tunnel.AskUserQuestion
- func CancelledAskUserResponse(req toolpkg.AskUserRequest) toolpkg.AskUserResponse
- func HydrateProjectionReplayFromSessionLedger(store *tunnel.ProjectionStore, ses *session.Session, ...) ([]tunnel.GatewayMessage, error)
- func NewACPClientManager(workingDir string, policy permission.PermissionPolicy, ...) *acpclient.ClientManager
- func NewConfigAccess(cfg *config.Config, workingDir string) *configAccess
- func NewSkillTool(commandMgr *commands.Manager, mcpMgr *plugin.MCPManager, ...) tool.SkillTool
- func NewSubAgentManager(subCfg config.SubAgentConfig, registry *tool.Registry, prov provider.Provider, ...) *subagent.Manager
- func NewSwarmManager(cfg config.SwarmConfig, prov provider.Provider, registry *tool.Registry, ...) *swarm.Manager
- func PrepareProjectionReplay(store *tunnel.ProjectionStore, ses *session.Session) (uint64, []tunnel.GatewayMessage, error)
- func ProjectionAuthorityEpoch(store *tunnel.ProjectionStore, sessionID string) (uint64, error)
- func ProjectionReplay(store *tunnel.ProjectionStore, sessionID string) ([]tunnel.GatewayMessage, error)
- func PublishShareState(broker *tunnel.Broker, sessionID string, snapshot tunnel.BrokerSnapshot, ...) bool
- func PushTunnelApprovalRequest(broker *tunnel.Broker, requestID, toolName, input string, ...)
- func PushTunnelApprovalResult(broker *tunnel.Broker, requestID, decision string, update TunnelStateUpdate)
- func PushTunnelAskUserRequest(broker *tunnel.Broker, requestID string, req tool.AskUserRequest, ...)
- func PushTunnelAskUserResponse(broker *tunnel.Broker, requestID string, response tool.AskUserResponse, ...)
- func PushTunnelSubagentEvent(currentBroker func() *tunnel.Broker, markSpawned func(string) bool, ...)
- func PushTunnelSubagentReasoning(currentBroker func() *tunnel.Broker, agentID, text string)
- func PushTunnelSubagentText(currentBroker func() *tunnel.Broker, agentID, text string)
- func PushTunnelSubagentToolCall(currentBroker func() *tunnel.Broker, ...)
- func PushTunnelSubagentToolResult(currentBroker func() *tunnel.Broker, ...)
- func PushTunnelSwarmEvent(currentBroker func() *tunnel.Broker, mgr *swarm.Manager, ev swarm.Event, ...)
- func RegisterDelegateTool(registry *tool.Registry, mgr *acpclient.ClientManager, ...)
- func ResolveCurrentSelection(cfg *config.Config) (*config.ResolvedEndpoint, provider.Provider, error)
- func ResolveTunnelApproval(decision string, toolName string, setOverride func(string)) permission.Decision
- func RestoreSessionIntoAgent(agentInst *agent.Agent, ses *session.Session)
- func RouteTunnelCommand(cmd tunnel.GatewayMessage, hooks TunnelCommandHooks)
- func SaveAgentSessionSnapshot(store session.Store, ses *session.Session, agentInst *agent.Agent) error
- func SaveSessionMessages(store session.Store, ses *session.Session, messages []provider.Message) error
- func ShareSnapshotMatches(a, b tunnel.BrokerSnapshot) bool
- func StartAsyncRelayModelLimitRefresh(cfg *config.Config, resolved *config.ResolvedEndpoint, agentInst *agent.Agent, ...)
- func StopSharedTunnelGracefully(sess *tunnel.Session, broker *tunnel.Broker, timeout time.Duration)
- func TunnelDecisionFromApproval(decision permission.Decision) string
- func TunnelReasoningMsgID(messageID string) string
- func TunnelSubagentReasoningID(agentID string) string
- func TunnelSubagentTextID(agentID string) string
- type ApprovalRequest
- type AskUserRequest
- type DesktopEmitterCallbacks
- type DesktopMirrorCallbacks
- type DesktopStreamEmitter
- type DesktopStreamMirror
- type DesktopStreamSemantic
- type DesktopToolCallEvent
- type DesktopToolResultEvent
- type IMRoundState
- type InteractionBroker
- func (b *InteractionBroker) ApprovalCount() int
- func (b *InteractionBroker) AskUserCount() int
- func (b *InteractionBroker) AwaitApproval(ctx context.Context, req ApprovalRequest) permission.Decision
- func (b *InteractionBroker) AwaitAskUser(ctx context.Context, req AskUserRequest) (toolpkg.AskUserResponse, error)
- func (b *InteractionBroker) CancelAll() ([]ApprovalRequest, []AskUserRequest)
- func (b *InteractionBroker) FirstPendingApproval() (ApprovalRequest, bool)
- func (b *InteractionBroker) FirstPendingAskUser() (AskUserRequest, bool)
- func (b *InteractionBroker) PendingApproval(id string) (ApprovalRequest, bool)
- func (b *InteractionBroker) PendingAskUser(id string) (AskUserRequest, bool)
- func (b *InteractionBroker) ResolveApproval(id string, decision permission.Decision) (ApprovalRequest, bool)
- func (b *InteractionBroker) ResolveAskUser(id string, response toolpkg.AskUserResponse) (AskUserRequest, bool)
- type InteractiveRuntimeCore
- type PendingMessage
- type PendingQueue
- func (q *PendingQueue[T]) Clear()
- func (q *PendingQueue[T]) Consume() (PendingMessage[T], bool)
- func (q *PendingQueue[T]) ConsumePrefix(match func(PendingMessage[T]) bool) []PendingMessage[T]
- func (q *PendingQueue[T]) Count() int
- func (q *PendingQueue[T]) Enqueue(text string, hidden bool, meta T) int
- func (q *PendingQueue[T]) Snapshot() []PendingMessage[T]
- func (q *PendingQueue[T]) SnapshotTexts() []string
- type ProjectionBrokerState
- type SessionState
- type StartupAssets
- type TunnelAttachConfig
- type TunnelCommandHooks
- type TunnelHost
- func (h *TunnelHost) AttachOnlineBroker(broker *tunnel.Broker)
- func (h *TunnelHost) AuthorityEpoch() uint64
- func (h *TunnelHost) BindSession(ses *session.Session, store session.Store) ProjectionBrokerState
- func (h *TunnelHost) Close()
- func (h *TunnelHost) DetachOnlineBroker()
- func (h *TunnelHost) OnlineBroker() *tunnel.Broker
- func (h *TunnelHost) PrepareOnlineShare(broker *tunnel.Broker) []tunnel.GatewayMessage
- func (h *TunnelHost) ProjectionBroker() *tunnel.Broker
- func (h *TunnelHost) ProjectionStore() *tunnel.ProjectionStore
- func (h *TunnelHost) PushActivity(activity string)
- func (h *TunnelHost) PushStatus(status, message string)
- func (h *TunnelHost) PushStreamEvent(ev provider.StreamEvent)
- func (h *TunnelHost) PushUserMessage(text string)
- func (h *TunnelHost) PushUserMessageData(data tunnel.MessageData)
- func (h *TunnelHost) ResetStreamState()
- func (h *TunnelHost) TunnelEvents() []tunnel.GatewayMessage
- type TunnelMainStream
- type TunnelStateUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendProjectionEvent ¶
func AppendProjectionEvent(store *tunnel.ProjectionStore, msg tunnel.GatewayMessage) error
func ApplyProviderToAgent ¶
func ApplyResolvedLimitsToAgent ¶
func ApplyResolvedLimitsToAgent(agentInst *agent.Agent, resolved *config.ResolvedEndpoint)
func ApplyTunnelStateUpdate ¶
func ApplyTunnelStateUpdate(broker *tunnel.Broker, update TunnelStateUpdate)
func ApprovalDecisionFromTunnel ¶
func ApprovalDecisionFromTunnel(decision string) permission.Decision
func AttachTunnelBroker ¶
func AttachTunnelBroker(broker *tunnel.Broker, cfg TunnelAttachConfig)
func BuildAskUserAnswer ¶
func BuildAskUserAnswer(question tool.AskUserQuestion, selectedIDs []string, freeform string) tool.AskUserAnswer
func BuildAskUserResponseFromTunnel ¶
func BuildAskUserResponseFromTunnel(req tool.AskUserRequest, status string, answers []tunnel.AskUserAnswer) tool.AskUserResponse
func BuildInteractivePermissionPolicy ¶
func BuildInteractivePermissionPolicy(cfg *config.Config, workingDir string, bypass bool) permission.PermissionPolicy
func BuildInteractiveSystemPrompt ¶
func BuildInteractiveSystemPrompt( cfg *config.Config, workingDir string, mode permission.PermissionMode, registry *tool.Registry, commandMgr *commands.Manager, globalAutoMem *memory.AutoMemory, projectAutoMem *memory.AutoMemory, gitStatus string, ) string
func BuildInteractiveSystemPromptWithPromptRefs ¶
func BuildInteractiveSystemPromptWithPromptRefs( cfg *config.Config, workingDir string, mode permission.PermissionMode, registry *tool.Registry, commandMgr *commands.Manager, globalAutoMem *memory.AutoMemory, projectAutoMem *memory.AutoMemory, gitStatus string, ) (string, []string)
func BuildMCPSkillCommands ¶
func BuildMCPSkillCommands(snapshots []tool.MCPServerSnapshot) []*commands.Command
func BuildSkillsSystemPrompt ¶
func BuildTunnelAskUserAnswers ¶
func BuildTunnelAskUserAnswers(resp tool.AskUserResponse) []tunnel.AskUserAnswer
func BuildTunnelAskUserQuestions ¶
func BuildTunnelAskUserQuestions(req tool.AskUserRequest) []tunnel.AskUserQuestion
func CancelledAskUserResponse ¶
func CancelledAskUserResponse(req toolpkg.AskUserRequest) toolpkg.AskUserResponse
func HydrateProjectionReplayFromSessionLedger ¶
func HydrateProjectionReplayFromSessionLedger(store *tunnel.ProjectionStore, ses *session.Session, replay []tunnel.GatewayMessage) ([]tunnel.GatewayMessage, error)
func NewACPClientManager ¶
func NewACPClientManager( workingDir string, policy permission.PermissionPolicy, approvalHandler func(context.Context, string, string) permission.Decision, ) *acpclient.ClientManager
func NewConfigAccess ¶
NewConfigAccess creates a ConfigAccess backed by the given config.
func NewSkillTool ¶
func NewSubAgentManager ¶
func NewSwarmManager ¶
func PrepareProjectionReplay ¶
func PrepareProjectionReplay(store *tunnel.ProjectionStore, ses *session.Session) (uint64, []tunnel.GatewayMessage, error)
func ProjectionAuthorityEpoch ¶
func ProjectionAuthorityEpoch(store *tunnel.ProjectionStore, sessionID string) (uint64, error)
func ProjectionReplay ¶
func ProjectionReplay(store *tunnel.ProjectionStore, sessionID string) ([]tunnel.GatewayMessage, error)
func PublishShareState ¶
func PublishShareState(broker *tunnel.Broker, sessionID string, snapshot tunnel.BrokerSnapshot, replay []tunnel.GatewayMessage, reset bool) bool
func PushTunnelApprovalRequest ¶
func PushTunnelApprovalRequest(broker *tunnel.Broker, requestID, toolName, input string, update TunnelStateUpdate)
func PushTunnelApprovalResult ¶
func PushTunnelApprovalResult(broker *tunnel.Broker, requestID, decision string, update TunnelStateUpdate)
func PushTunnelAskUserRequest ¶
func PushTunnelAskUserRequest(broker *tunnel.Broker, requestID string, req tool.AskUserRequest, update TunnelStateUpdate)
func PushTunnelAskUserResponse ¶
func PushTunnelAskUserResponse(broker *tunnel.Broker, requestID string, response tool.AskUserResponse, update TunnelStateUpdate)
func PushTunnelSubagentEvent ¶
func PushTunnelSubagentText ¶
func PushTunnelSwarmEvent ¶
func RegisterDelegateTool ¶
func ResolveCurrentSelection ¶
func ResolveTunnelApproval ¶
func ResolveTunnelApproval(decision string, toolName string, setOverride func(string)) permission.Decision
func RestoreSessionIntoAgent ¶
func RouteTunnelCommand ¶
func RouteTunnelCommand(cmd tunnel.GatewayMessage, hooks TunnelCommandHooks)
func SaveSessionMessages ¶
func ShareSnapshotMatches ¶
func ShareSnapshotMatches(a, b tunnel.BrokerSnapshot) bool
func StartAsyncRelayModelLimitRefresh ¶
func StartAsyncRelayModelLimitRefresh(cfg *config.Config, resolved *config.ResolvedEndpoint, agentInst *agent.Agent, onApplied func(relaycatalog.ResolveResponse))
func TunnelDecisionFromApproval ¶
func TunnelDecisionFromApproval(decision permission.Decision) string
func TunnelReasoningMsgID ¶
func TunnelSubagentTextID ¶
Types ¶
type ApprovalRequest ¶
type AskUserRequest ¶
type AskUserRequest struct {
ID string
Request toolpkg.AskUserRequest
}
type DesktopEmitterCallbacks ¶
type DesktopMirrorCallbacks ¶
type DesktopStreamEmitter ¶
type DesktopStreamEmitter interface {
TriggerTyping()
EmitToolResult(toolName, rawArgs, result string, isError bool)
EmitRoundSummary(text string, toolCalls, toolSuccesses, toolFailures int)
}
func NewDesktopEmitterAdapter ¶
func NewDesktopEmitterAdapter(callbacks DesktopEmitterCallbacks) DesktopStreamEmitter
type DesktopStreamMirror ¶
type DesktopStreamMirror interface {
PushText(text string)
PushReasoning(chunk string)
PushToolCall(toolID, toolName, displayName, rawArgs, detail string)
PushToolResult(toolID, toolName, result string, isError bool)
Flush(rotate bool)
PushError(message string)
}
func NewDesktopMirrorAdapter ¶
func NewDesktopMirrorAdapter(callbacks DesktopMirrorCallbacks) DesktopStreamMirror
type DesktopStreamSemantic ¶
type DesktopStreamSemantic struct {
Type provider.StreamEventType
Text string
ToolCall *DesktopToolCallEvent
ToolResult *DesktopToolResultEvent
UsageData map[string]interface{}
ErrorText string
}
func HandleDesktopStreamEvent ¶
func HandleDesktopStreamEvent(ev provider.StreamEvent, round *IMRoundState, emitter DesktopStreamEmitter, mirror DesktopStreamMirror) (DesktopStreamSemantic, bool)
type DesktopToolCallEvent ¶
type DesktopToolResultEvent ¶
type IMRoundState ¶
type IMRoundState struct {
ToolCalls int
ToolSuccesses int
ToolFailures int
// contains filtered or unexported fields
}
IMRoundState tracks assistant text and tool counters for a single LLM turn. Filtering policy stays in the caller so different frontends can decide which tool events should count toward the round.
func (*IMRoundState) AppendText ¶
func (s *IMRoundState) AppendText(text string)
func (*IMRoundState) NoteToolCall ¶
func (s *IMRoundState) NoteToolCall()
func (*IMRoundState) NoteToolResult ¶
func (s *IMRoundState) NoteToolResult(isError bool)
func (*IMRoundState) Reset ¶
func (s *IMRoundState) Reset()
func (*IMRoundState) Text ¶
func (s *IMRoundState) Text() string
type InteractionBroker ¶
type InteractionBroker struct {
// contains filtered or unexported fields
}
func NewInteractionBroker ¶
func NewInteractionBroker() *InteractionBroker
func (*InteractionBroker) ApprovalCount ¶
func (b *InteractionBroker) ApprovalCount() int
func (*InteractionBroker) AskUserCount ¶
func (b *InteractionBroker) AskUserCount() int
func (*InteractionBroker) AwaitApproval ¶
func (b *InteractionBroker) AwaitApproval(ctx context.Context, req ApprovalRequest) permission.Decision
func (*InteractionBroker) AwaitAskUser ¶
func (b *InteractionBroker) AwaitAskUser(ctx context.Context, req AskUserRequest) (toolpkg.AskUserResponse, error)
func (*InteractionBroker) CancelAll ¶
func (b *InteractionBroker) CancelAll() ([]ApprovalRequest, []AskUserRequest)
func (*InteractionBroker) FirstPendingApproval ¶
func (b *InteractionBroker) FirstPendingApproval() (ApprovalRequest, bool)
func (*InteractionBroker) FirstPendingAskUser ¶
func (b *InteractionBroker) FirstPendingAskUser() (AskUserRequest, bool)
func (*InteractionBroker) PendingApproval ¶
func (b *InteractionBroker) PendingApproval(id string) (ApprovalRequest, bool)
func (*InteractionBroker) PendingAskUser ¶
func (b *InteractionBroker) PendingAskUser(id string) (AskUserRequest, bool)
func (*InteractionBroker) ResolveApproval ¶
func (b *InteractionBroker) ResolveApproval(id string, decision permission.Decision) (ApprovalRequest, bool)
func (*InteractionBroker) ResolveAskUser ¶
func (b *InteractionBroker) ResolveAskUser(id string, response toolpkg.AskUserResponse) (AskUserRequest, bool)
type InteractiveRuntimeCore ¶
type InteractiveRuntimeCore struct {
Registry *tool.Registry
MCPManager *plugin.MCPManager
PluginManager *plugin.Manager
AutoMemory *memory.AutoMemory
ProjectAutoMem *memory.AutoMemory
SaveMemoryTool *tool.SaveMemoryTool
StartupAssets StartupAssets
CommandManager *commands.Manager
Tunnel *TunnelHost // unified tunnel event management
// contains filtered or unexported fields
}
func BuildInteractiveRuntimeCore ¶
func BuildInteractiveRuntimeCore(cfg *config.Config, workingDir string, policy permission.PermissionPolicy) (*InteractiveRuntimeCore, error)
func (*InteractiveRuntimeCore) Close ¶
func (c *InteractiveRuntimeCore) Close()
Close stops all background services. Call on shutdown.
func (*InteractiveRuntimeCore) MCPManagerCancel ¶
func (c *InteractiveRuntimeCore) MCPManagerCancel() context.CancelFunc
MCPManagerCancel returns the MCP cancel function for callers that need cleanup on exit (e.g. TUI's defer chain).
func (*InteractiveRuntimeCore) SetConfigAgent ¶
func (c *InteractiveRuntimeCore) SetConfigAgent(ag *agent.Agent)
SetConfigAgent injects the agent into the config tool for provider hot-reload. Must be called after the agent is created. Without this, config changes to vendor/endpoint/model/api_key will persist to disk but won't take effect until the next session restart.
func (*InteractiveRuntimeCore) SetConfigUINotify ¶
func (c *InteractiveRuntimeCore) SetConfigUINotify(fn func())
SetConfigUINotify sets an optional callback for UI refresh after provider changes.
func (*InteractiveRuntimeCore) StartBackgroundServices ¶
func (c *InteractiveRuntimeCore) StartBackgroundServices()
StartBackgroundServices launches all background services: MCP connections, etc. Must be called after UI callbacks are set (SetConfigUINotify, MCP OnUpdate, etc.) so that status changes are forwarded to the UI layer.
type PendingMessage ¶
type PendingQueue ¶
type PendingQueue[T any] struct { // contains filtered or unexported fields }
func NewPendingQueue ¶
func NewPendingQueue[T any]() *PendingQueue[T]
func (*PendingQueue[T]) Clear ¶
func (q *PendingQueue[T]) Clear()
func (*PendingQueue[T]) Consume ¶
func (q *PendingQueue[T]) Consume() (PendingMessage[T], bool)
func (*PendingQueue[T]) ConsumePrefix ¶
func (q *PendingQueue[T]) ConsumePrefix(match func(PendingMessage[T]) bool) []PendingMessage[T]
func (*PendingQueue[T]) Count ¶
func (q *PendingQueue[T]) Count() int
func (*PendingQueue[T]) Enqueue ¶
func (q *PendingQueue[T]) Enqueue(text string, hidden bool, meta T) int
func (*PendingQueue[T]) Snapshot ¶
func (q *PendingQueue[T]) Snapshot() []PendingMessage[T]
func (*PendingQueue[T]) SnapshotTexts ¶
func (q *PendingQueue[T]) SnapshotTexts() []string
type ProjectionBrokerState ¶
type ProjectionBrokerState struct {
AuthorityEpoch uint64
Replay []tunnel.GatewayMessage
}
func PrepareProjectionBroker ¶
func PrepareProjectionBroker(broker *tunnel.Broker, store *tunnel.ProjectionStore, ses *session.Session, recorder func(tunnel.GatewayMessage)) (ProjectionBrokerState, error)
type SessionState ¶
func AdoptSession ¶
func AdoptSession(ses *session.Session) SessionState
func ClearSession ¶
func ClearSession() SessionState
func EnsureSession ¶
func LoadSession ¶
func LoadSession(store session.Store, id string) (SessionState, error)
type StartupAssets ¶
type StartupAssets struct {
AutoContent string
AutoFiles []string
ProjectAutoContent string
CommandManager *commands.Manager
}
func LoadInteractiveStartupAssets ¶
func LoadInteractiveStartupAssets( workingDir string, autoMem *memory.AutoMemory, projectAutoMem *memory.AutoMemory, ) StartupAssets
type TunnelAttachConfig ¶
type TunnelAttachConfig struct {
ReplayProvider func() []tunnel.GatewayMessage
SessionID string
AuthorityEpoch uint64
SessionInfo *tunnel.SessionInfoData
Status *tunnel.StatusData
Activity *string
}
type TunnelCommandHooks ¶
type TunnelCommandHooks struct {
OnUserMessage func(data tunnel.MessageData)
OnInterrupt func()
OnModeChange func(data tunnel.ModeChangeData)
OnApprovalResponse func(data tunnel.ApprovalResponseData)
OnAskUserResponse func(data tunnel.AskUserResponseData)
OnLanguageChange func(data tunnel.LanguageChangeData)
OnThemeChange func(data tunnel.ThemeChangeData)
OnServerAck func(messageID string)
}
type TunnelHost ¶
type TunnelHost struct {
// contains filtered or unexported fields
}
TunnelHost provides unified tunnel stream management for all frontends. It owns the projection broker (for recording and replay) and optionally forwards events to an online broker (when a mobile Share is active).
func NewTunnelHost ¶
func NewTunnelHost() *TunnelHost
NewTunnelHost creates a new TunnelHost with an offline projection broker.
func (*TunnelHost) AttachOnlineBroker ¶
func (h *TunnelHost) AttachOnlineBroker(broker *tunnel.Broker)
AttachOnlineBroker connects an online tunnel broker (from a Share session). Events recorded by the projection broker will be forwarded to this broker.
func (*TunnelHost) AuthorityEpoch ¶
func (h *TunnelHost) AuthorityEpoch() uint64
AuthorityEpoch returns the current projection authority epoch.
func (*TunnelHost) BindSession ¶
func (h *TunnelHost) BindSession(ses *session.Session, store session.Store) ProjectionBrokerState
BindSession binds the tunnel host to a session for event recording. Call this when the session changes or is first created. Returns the projection broker state with replay events and authority epoch.
func (*TunnelHost) Close ¶
func (h *TunnelHost) Close()
Close stops any active share gracefully and cleans up resources.
func (*TunnelHost) DetachOnlineBroker ¶
func (h *TunnelHost) DetachOnlineBroker()
DetachOnlineBroker disconnects the online broker (Share stopped).
func (*TunnelHost) OnlineBroker ¶
func (h *TunnelHost) OnlineBroker() *tunnel.Broker
OnlineBroker returns the current online broker, or nil.
func (*TunnelHost) PrepareOnlineShare ¶
func (h *TunnelHost) PrepareOnlineShare(broker *tunnel.Broker) []tunnel.GatewayMessage
PrepareOnlineShare configures an online broker for a fresh Share session. This must be called after AttachOnlineBroker. It performs all the negotiation steps that TUI's handleTunnelStartMsg does:
- SetEventRecorder(nil) — online broker should not record; projection broker does that
- SetReplayProvider — provides canonical replay events from projection store
- BindSession + SetAuthorityEpoch — binds online broker to current session
- AnnounceActiveSession — tells relay which session is active
Returns the replay events so the caller can also ReplayEvents() if needed.
func (*TunnelHost) ProjectionBroker ¶
func (h *TunnelHost) ProjectionBroker() *tunnel.Broker
ProjectionBroker returns the projection broker, or nil.
func (*TunnelHost) ProjectionStore ¶
func (h *TunnelHost) ProjectionStore() *tunnel.ProjectionStore
ProjectionStore returns the projection store, or nil.
func (*TunnelHost) PushActivity ¶
func (h *TunnelHost) PushActivity(activity string)
PushActivity pushes an activity update to the mobile client.
func (*TunnelHost) PushStatus ¶
func (h *TunnelHost) PushStatus(status, message string)
PushStatus pushes a status update to the mobile client.
func (*TunnelHost) PushStreamEvent ¶
func (h *TunnelHost) PushStreamEvent(ev provider.StreamEvent)
PushStreamEvent pushes a provider stream event through the tunnel. This is the main entry point called by the agent stream callback.
func (*TunnelHost) PushUserMessage ¶
func (h *TunnelHost) PushUserMessage(text string)
PushUserMessage pushes a user message to the tunnel.
func (*TunnelHost) PushUserMessageData ¶
func (h *TunnelHost) PushUserMessageData(data tunnel.MessageData)
PushUserMessageData pushes a user message with custom data to the tunnel.
func (*TunnelHost) ResetStreamState ¶
func (h *TunnelHost) ResetStreamState()
ResetStreamState resets the stream state for a new chat turn.
func (*TunnelHost) TunnelEvents ¶
func (h *TunnelHost) TunnelEvents() []tunnel.GatewayMessage
TunnelEvents returns the projection replay events for the current session.
type TunnelMainStream ¶
func EnsureTunnelMainStream ¶
func EnsureTunnelMainStream(state TunnelMainStream, broker *tunnel.Broker) TunnelMainStream
func FlushTunnelMainStream ¶
func FlushTunnelMainStream(state TunnelMainStream, broker *tunnel.Broker, force bool) TunnelMainStream
func MarkTunnelMainStreamActive ¶
func MarkTunnelMainStreamActive(state TunnelMainStream) TunnelMainStream
Source Files
¶
- config_access.go
- desktop_adapters.go
- desktop_stream.go
- im_round.go
- interactions.go
- interactive_core.go
- mobile_interactions.go
- model_limits.go
- model_switch.go
- pending.go
- policy.go
- project_memory.go
- projection.go
- prompt.go
- sessions.go
- share_actions.go
- startup_assets.go
- subagent_tunnel.go
- subsystems.go
- swarm_tunnel.go
- tunnel_attach.go
- tunnel_commands.go
- tunnel_host.go
- tunnel_interactions.go
- tunnel_main_stream.go
- types.go