Versions in this module Expand all Collapse all v2 v2.7.0 Jul 20, 2026 Changes in this version + const AgentCardFileName + const AgentStateDeferred + const AgentStateIdle + const AgentStatePaused + const AgentStateRunning + const DefaultHeartbeatTTL + const EventAgent + const EventCapabilities + const EventInbox + const EventStatusUpdate + const EventTurnComplete + const EventTurnError + const EventUsageUpdate + const HeaderAttachToken + const InboxStateDequeued + const InboxStateQueued + const ProtocolVersion + const ToolSourceBuiltin + const ToolSourceMCP + const ToolSourceOther + const ToolSourceSkill + const TurnErrorAuth + const TurnErrorConfig + const TurnErrorCostCeiling + const TurnErrorModelNotFound + const TurnErrorRateLimited + const TurnErrorTransientNet + const TurnErrorUnknown + const TurnStateAwaitingElicit + const TurnStateAwaitingPermission + const TurnStateIdle + const TurnStateStreaming + var ErrAmbiguousSession = errors.New(...) + var ErrCapabilityNotRegistered = errors.New("attach: capability not registered on this OperatorView") + var ErrPeerEndpointRequired = errors.New("attach: peer Endpoint is required") + var ErrPeerNameRequired = errors.New("attach: peer Name is required") + var ErrPeerNotFound = errors.New("attach: peer registration not found") + var ErrPromptNotFound = errors.New("attach: prompt id not found (already responded, cancelled, or never issued)") + var ErrSessionACLNotFound = errors.New("attach: session ACL not found") + var ErrSessionExists = errors.New("attach: session already registered") + var ErrSessionNotFound = errors.New("attach: session not found") + var SupportedEventTypes = []string + func DecisionFromWire(s string) (permissions.Decision, bool) + func RenderUsage(info UsageInfo) string + type AgentCardConfig struct + Description string + DocumentationURL string + ExternalURL string + ExtraSkills []AgentCardSkill + Name string + Provider AgentCardProvider + Version string + func LoadAgentCardFile(path string) (AgentCardConfig, bool, error) + func (c AgentCardConfig) Enabled() bool + func (c AgentCardConfig) Validate() error + type AgentCardProvider struct + Organization string + URL string + type AgentCardSkill struct + Description string + Examples []string + ID string + Name string + Tags []string + type AgentInfo struct + ID string + LastReport string + Name string + ParentSessionID string + StartedAt time.Time + Status string + type AgentRegistrarAdapter struct + func NewAgentRegistrarAdapter(reg *SessionRegistry) *AgentRegistrarAdapter + func (a *AgentRegistrarAdapter) Register(ag any) (any, error) + func (a *AgentRegistrarAdapter) Unregister(appName, userID, sessionID string) + type AgentsProvider interface + AttachAgents func() []AgentInfo + type ApprovalInfo struct + At time.Time + Decision string + Key string + Tool string + type AuthConfig struct + BearerToken string + ClientCAFile string + ReadOnly bool + TLSCertFile string + TLSKeyFile string + func (a AuthConfig) LoadTLSConfig() (*tls.Config, error) + func (a AuthConfig) Middleware(next http.Handler) http.Handler + type Broadcaster struct + func NewBroadcaster(entry *Entry) (*Broadcaster, error) + func (b *Broadcaster) Close() + func (b *Broadcaster) Emit(eventType string, payload any) + func (b *Broadcaster) Subscribe(ctx context.Context, since int64) <-chan Frame + type BroadcasterPool struct + func NewBroadcasterPool() *BroadcasterPool + func (p *BroadcasterPool) Close() + func (p *BroadcasterPool) For(entry *Entry) (*Broadcaster, error) + func (p *BroadcasterPool) Remove(entry *Entry) *Broadcaster + type Capabilities struct + EventTypes []string + ProtocolVersion string + Server string + type CheckpointRequest struct + Note string + type CheckpointResponse struct + CheckpointEventID string + DurationMS int64 + Skipped bool + SummaryText string + TaskNote string + type CheckpointSlashProvider interface + AttachCheckpoint func(ctx context.Context, note string) (CheckpointResponse, error) + type CompactRequest struct + Focus string + type CompactResponse struct + DurationMS int64 + Skipped bool + SummaryEventID string + SummaryText string + type CompactSlashProvider interface + AttachCompact func(ctx context.Context, focus string) (CompactResponse, error) + type ContextInfo struct + Checkpoints int + Compactions int + DigestSavings *DigestSavingsInfo + LastTaskNote string + SubtaskCostUSD float64 + SubtaskInputTokens int64 + SubtaskOutputTokens int64 + SubtaskTurns int + TotalCharsSummarized int + type ContextProvider interface + AttachContext func() ContextInfo + type DescriptionProvider interface + Description func() string + type DigestMethodsInfo struct + BytesSaved map[string]int64 + Counts map[string]int64 + type DigestSavingsInfo struct + AgenticCalls int + AgenticSubagentCostUSD float64 + AgenticSubagentInTokens int64 + AgenticSubagentOutTokens int64 + AgenticTokensSaved int64 + PassthroughCalls int + StructuralCalls int + StructuralTokensSaved int64 + type EmitTarget interface + SetAttachEmitter func(func(eventType string, payload any)) + type Entry struct + ACL auth.SessionACL + Agent Registrant + AppName string + SessionID string + UserID string + func (e *Entry) LastTouchedAt() time.Time + type ErrNotRegistrant struct + Got any + func (e *ErrNotRegistrant) Error() string + type Frame struct + Event *session.Event + Seq int64 + Type string + TypedData any + type InboxEvent struct + PromptID string + QueuedAt time.Time + State string + type InterruptProvider interface + AttachInterrupt func() bool + type MCPInfo struct + Servers []MCPServerInfo + type MCPProvider interface + AttachMCP func() MCPInfo + type MCPServerInfo struct + Name string + Status string + Tools []MCPToolInfo + Transport string + type MCPToolInfo struct + Description string + Name string + type MemoryProvider interface + AttachMemory func() []MemorySource + type MemorySource struct + Path string + Scope string + Size int + type ModelPricing struct + CachedUSDPerMTok float64 + InputUSDPerMTok float64 + OutputUSDPerMTok float64 + UpdatedAt time.Time + type OperatorView struct + MCP func() MCPInfo + Memory func() []MemorySource + Pricing func() PricingInfo + RefreshPricing func(ctx context.Context) (PricingRefreshResponse, error) + Reload func(ctx context.Context) ReloadResponse + SetPricing func(req PricingSetRequest) error + Skills func() []SkillInfo + func (o *OperatorView) AttachMCP() MCPInfo + func (o *OperatorView) AttachMemory() []MemorySource + func (o *OperatorView) AttachPricing() PricingInfo + func (o *OperatorView) AttachRefreshPricing(ctx context.Context) (PricingRefreshResponse, error) + func (o *OperatorView) AttachReload(ctx context.Context) ReloadResponse + func (o *OperatorView) AttachSetManualPricing(req PricingSetRequest) error + func (o *OperatorView) AttachSkills() []SkillInfo + type Options struct + Addr string + AgentCard AgentCardConfig + AllowAnonymous bool + Auth AuthConfig + Authenticator auth.Authenticator + DefaultCaller auth.Caller + MultiSessionEnabled bool + PeerRegistry *PeerRegistry + ProxyHeader string + Registry *SessionRegistry + Resumer SessionResumer + SessionFactory SessionFactory + SessionIdleTimeout time.Duration + ShutdownTimeout time.Duration + UI fs.FS + UnixSocket string + type PatternsRequest struct + Patterns []string + type Peer struct + Endpoint string + Labels map[string]string + LastHeartbeat time.Time + LeaseExpiresAt time.Time + Name string + RegisteredAt time.Time + RegistrationID string + type PeerClient struct + func NewPeerClient(hubURL string, opts ...PeerClientOption) *PeerClient + func (c *PeerClient) Deregister(ctx context.Context, registrationID string) error + func (c *PeerClient) Heartbeat(ctx context.Context, registrationID string) (*Peer, error) + func (c *PeerClient) Register(ctx context.Context, req RegisterRequest) (*Peer, error) + func (c *PeerClient) RegisterAndHeartbeat(ctx context.Context, req RegisterRequest) (cancel func(), err error) + type PeerClientOption func(*PeerClient) + func WithPeerBearerToken(token string) PeerClientOption + func WithPeerHTTPClient(client *http.Client) PeerClientOption + type PeerRegistry struct + func NewPeerRegistry(opts ...PeerRegistryOption) *PeerRegistry + func (r *PeerRegistry) Close() error + func (r *PeerRegistry) Deregister(id string) + func (r *PeerRegistry) Heartbeat(id string) (*Peer, error) + func (r *PeerRegistry) Len() int + func (r *PeerRegistry) List(labelMatch map[string]string) []*Peer + func (r *PeerRegistry) Prune() int + func (r *PeerRegistry) Register(req RegisterRequest) (*Peer, error) + type PeerRegistryOption func(*PeerRegistry) + func WithMaxTTL(d time.Duration) PeerRegistryOption + type PermsController interface + AttachAddAllow func(patterns []string) error + AttachAddDeny func(patterns []string) error + type PermsInfo struct + Allow []string + Approvals []ApprovalInfo + Deny []string + Mode string + type PermsProvider interface + AttachPerms func() PermsInfo + type PricingController interface + AttachRefreshPricing func(ctx context.Context) (PricingRefreshResponse, error) + AttachSetManualPricing func(req PricingSetRequest) error + type PricingInfo struct + Current *ModelPricing + CurrentModel string + KnownModels int + LastRefresh time.Time + Source string + type PricingProvider interface + AttachPricing func() PricingInfo + type PricingRefreshResponse struct + Detail string + KnownModels int + LastRefresh time.Time + Updated bool + type PricingSetRequest struct + InputUSDPerMTok float64 + Model string + OutputUSDPerMTok float64 + type PromptBroker struct + func NewPromptBroker() *PromptBroker + func (b *PromptBroker) AskApproval(ctx context.Context, req permissions.PromptRequest) (permissions.Decision, error) + func (b *PromptBroker) Close() + func (b *PromptBroker) Pending() []PromptFrame + func (b *PromptBroker) Respond(id string, decision permissions.Decision) error + func (b *PromptBroker) Subscribe(ctx context.Context) (<-chan PromptFrame, func()) + type PromptBrokerProvider interface + AttachPromptBroker func() *PromptBroker + type PromptFrame struct + Access string + At time.Time + Detail string + ID string + Kind string + PersistKey string + PersistTool string + Source string + ToolName string + Verb string + type PromptResponse struct + Decision string + ID string + type RegisterRequest struct + Endpoint string + HeartbeatTTLSec int + Labels map[string]string + Name string + type Registrant interface + AppName func() string + EventLog func() *eventlog.Handle + Inject func(message string) error + InjectAs func(message string, caller auth.Caller) error + RequestWake func() + SessionID func() string + UserID func() string + type ReloadResponse struct + Errors []string + MCP bool + Memory bool + Skills bool + type Reloader interface + AttachReload func(ctx context.Context) ReloadResponse + type ReplanProvider interface + AttachReplan func(ctx context.Context, req ReplanRequest) (ReplanResponse, error) + type ReplanRequest struct + Reason string + type ReplanResponse struct + ArchivedPath string + Message string + PlanWasActive bool + type Server struct + func NewServer(opts Options) (*Server, error) + func (s *Server) Addr() string + func (s *Server) Bind() error + func (s *Server) Close() error + func (s *Server) ListenAndServe() error + func (s *Server) Serve() error + func (s *Server) TLSEnabled() bool + type SessionACLRow struct + AppName string + Contributors []string + CreatedAt time.Time + LastTouchedAt time.Time + Owner string + SessionID string + UserID string + Viewers []string + func (r SessionACLRow) ACL() auth.SessionACL + type SessionACLStore interface + Delete func(ctx context.Context, app, user, sid string) error + FindByAppSID func(ctx context.Context, app, sid string) (SessionACLRow, error) + Get func(ctx context.Context, app, user, sid string) (SessionACLRow, error) + ListByOwner func(ctx context.Context, owner string) ([]SessionACLRow, error) + ListVisibleTo func(ctx context.Context, caller auth.Caller) ([]SessionACLRow, error) + Put func(ctx context.Context, row SessionACLRow) error + Touch func(ctx context.Context, app, user, sid string, when time.Time) error + func NewSessionACLStore(ctx context.Context, db *gorm.DB) (SessionACLStore, error) + type SessionFactory func(ctx context.Context, caller auth.Caller) (Registrant, context.CancelFunc, error) + type SessionRegistry struct + func NewSessionRegistry() *SessionRegistry + func NewSessionRegistryWithStore(store SessionACLStore) *SessionRegistry + func (r *SessionRegistry) EvictBefore(cutoff time.Time) int + func (r *SessionRegistry) HardDelete(ctx context.Context, appName, userID, sessionID string) error + func (r *SessionRegistry) Len() int + func (r *SessionRegistry) List() []*Entry + func (r *SessionRegistry) ListAuthorized(c auth.Caller) []*Entry + func (r *SessionRegistry) Lookup(ctx context.Context, appName, sessionID string) (*Entry, error) + func (r *SessionRegistry) LookupSingle(ctx context.Context, sessionID string) (*Entry, error) + func (r *SessionRegistry) Register(ag Registrant) (*Entry, error) + func (r *SessionRegistry) RegisterOwned(ag Registrant, owner string) (*Entry, error) + func (r *SessionRegistry) RegisterOwnedWithCancel(ag Registrant, owner string, cancelOnEvict context.CancelFunc) (*Entry, error) + func (r *SessionRegistry) SweepIdle(ctx context.Context, idleAfter time.Duration) + func (r *SessionRegistry) TouchEntry(appName, sessionID string) + func (r *SessionRegistry) Unregister(appName, userID, sessionID string) + func (r *SessionRegistry) WithResumer(resumer SessionResumer) *SessionRegistry + type SessionResumer interface + Resume func(ctx context.Context, app, sid string) (Registrant, auth.SessionACL, context.CancelFunc, error) + type SideQueryProvider interface + AttachAskSideQuestion func(ctx context.Context, question string) (string, error) + type SideQueryRequest struct + Question string + type SideQueryResponse struct + Answer string + type SkillInfo struct + Description string + Name string + type SkillsProvider interface + AttachSkills func() []SkillInfo + type StatusInfo struct + CurrentTool string + ModelName string + NextWakeAt time.Time + State string + type StatusProvider interface + AttachStatus func() StatusInfo + type StatusUpdate struct + ContextPct *int + Model string + PermMode string + Provider string + TurnState string + type SubagentBudget struct + MaxCostUSD float64 + MaxTurns int + MaxWallClockS int + type SubagentSpawnResponse struct + Name string + StartedAt time.Time + type SubagentSpawner interface + AttachSpawnSubagent func(ctx context.Context, spec SubagentSpec) (SubagentSpawnResponse, error) + type SubagentSpec struct + Budgets SubagentBudget + Extras []string + Goal string + Name string + Scheduler string + SystemPrompt string + Tools []string + type ToolInfo struct + Description string + GateState string + Name string + Server string + Source string + type ToolsProvider interface + AttachTools func() []ToolInfo + type TurnComplete struct + CostUSD *float64 + LatencyMs int64 + Model string + PromptID string + TokensIn int + TokensOut int + type TurnError struct + Code string + Hint string + Kind string + Message string + Retryable bool + func ClassifyTurnError(err error) TurnError + type UsageByModel struct + CostUSD float64 + TokensIn int + TokensOut int + Turns int + type UsageInfo struct + DigestMethods *DigestMethodsInfo + Overall UsageTotals + PerModel map[string]UsageTotals + PerTurn []UsageTurn + type UsageLastTurn struct + CostUSD float64 + Model string + TokensIn int + TokensInCached int + TokensOut int + type UsageProvider interface + AttachUsage func() UsageInfo + type UsageTotals struct + CostUSD float64 + CostUSDUncachedReference float64 + InputTokens int64 + InputTokensCached int64 + InputTokensUncached int64 + OutputTokens int64 + ThoughtsTokens int64 + Turns int + type UsageTurn struct + At time.Time + CostUSD float64 + CostUSDUncachedReference float64 + InputTokens int64 + InputTokensCached int64 + InputTokensUncached int64 + Model string + OutputTokens int64 + ThoughtsTokens int64 + ToolUseTokens int64 + TotalTokens int64 + Turn int + type UsageUpdate struct + ByModel map[string]UsageByModel + CostUSDTotal float64 + LastTurn *UsageLastTurn + TokensInTotal int + TokensOutTotal int + TurnsTotal int v2.7.0-dev.5 Jul 20, 2026