container

package
v0.219.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RetryNotifier func(message string)

RetryNotifier, when set, receives a short human-readable notice for each SDK-internal HTTP retry (e.g. "⏳ HTTP 502 - retrying in 10s (attempt 2)"). The headless agent points it at its stdout notification stream so remote channels (Telegram) see progress during backoff. The chat TUI leaves it nil.

Functions

This section is empty.

Types

type ServiceContainer

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

ServiceContainer manages all application dependencies

func NewServiceContainer

func NewServiceContainer(cfg *config.Config) *ServiceContainer

NewServiceContainer creates a new service container with all dependencies

func (*ServiceContainer) BackgroundShellService added in v0.81.0

func (c *ServiceContainer) BackgroundShellService() *scheduler.BackgroundShellService

BackgroundShellService returns the background shell service

func (*ServiceContainer) GetAgentService added in v0.36.0

func (c *ServiceContainer) GetAgentService() agentdomain.AgentService

func (*ServiceContainer) GetAgentSupervisor added in v0.207.0

func (c *ServiceContainer) GetAgentSupervisor() a2adomain.AgentSupervisor

func (*ServiceContainer) GetApprovalCoordinator added in v0.112.3

func (c *ServiceContainer) GetApprovalCoordinator() tui.ApprovalCoordinator

GetApprovalCoordinator returns the plan-approval / computer-use pause-resume coordinator.

func (*ServiceContainer) GetBackgroundTaskRegistry added in v0.101.0

func (c *ServiceContainer) GetBackgroundTaskRegistry() scheddomain.BackgroundTaskRegistry

GetBackgroundTaskRegistry returns the unified background task registry (the single tracker that owns every background job). Callers that need only the narrower shell view can use the returned value as a scheddomain.ShellTracker.

func (*ServiceContainer) GetBackgroundTaskService added in v0.53.3

func (c *ServiceContainer) GetBackgroundTaskService() a2adomain.BackgroundTaskService

GetBackgroundTaskService returns the background task service (may be nil if A2A is not enabled)

func (*ServiceContainer) GetChatCompletionRunner added in v0.112.3

func (c *ServiceContainer) GetChatCompletionRunner() tui.ChatCompletionRunner

GetChatCompletionRunner returns the LLM streaming lifecycle runner.

func (*ServiceContainer) GetConversationOptimizer added in v0.68.1

func (c *ServiceContainer) GetConversationOptimizer() convdomain.ConversationOptimizer

func (*ServiceContainer) GetConversationRepository

func (c *ServiceContainer) GetConversationRepository() convdomain.ConversationRepository

func (*ServiceContainer) GetDirectExecutionService added in v0.112.3

func (c *ServiceContainer) GetDirectExecutionService() tui.DirectExecutionService

GetDirectExecutionService returns the user-typed !command / !!Tool(...) execution service. Also satisfies BashDetachChannelHolder.

func (*ServiceContainer) GetFileService

func (c *ServiceContainer) GetFileService() agentdomain.FileService

func (*ServiceContainer) GetGatewaySupervisor added in v0.207.0

func (c *ServiceContainer) GetGatewaySupervisor() *gateway.Supervisor

GetGatewaySupervisor returns the gateway manager

func (*ServiceContainer) GetGitHubIssueService added in v0.117.0

func (c *ServiceContainer) GetGitHubIssueService() agentdomain.GitHubIssueService

func (*ServiceContainer) GetGitHubSetupService added in v0.143.0

func (c *ServiceContainer) GetGitHubSetupService() agentdomain.GitHubSetupService

func (*ServiceContainer) GetImageService added in v0.57.0

func (c *ServiceContainer) GetImageService() agentdomain.ImageService

func (*ServiceContainer) GetInsightsGenerator added in v0.204.0

func (c *ServiceContainer) GetInsightsGenerator() *insights.Generator

GetInsightsGenerator returns the session analyzer behind `infer insights`. It reports itself unavailable when conversation storage is disabled.

func (*ServiceContainer) GetMCPSupervisor added in v0.207.0

func (c *ServiceContainer) GetMCPSupervisor() mcpdomain.Supervisor

GetMCPSupervisor returns the MCP supervisor (may be nil if MCP is not enabled)

func (*ServiceContainer) GetMemoryBackend added in v0.127.0

func (c *ServiceContainer) GetMemoryBackend() memory.MemoryBackend

GetMemoryBackend returns the shared memory sync backend (local no-op or git), used by the headless AgentSession to sync memory at run start/finish.

func (*ServiceContainer) GetMessageQueue added in v0.53.0

func (c *ServiceContainer) GetMessageQueue() convdomain.MessageQueue

func (*ServiceContainer) GetModelService

func (c *ServiceContainer) GetModelService() convdomain.ModelService

func (*ServiceContainer) GetPricingService added in v0.86.0

func (c *ServiceContainer) GetPricingService() convdomain.PricingService

func (*ServiceContainer) GetSessionRollover added in v0.207.0

func (c *ServiceContainer) GetSessionRollover() convdomain.SessionRollover

GetSessionRollover returns nil (not a typed nil) when rollover is off, so callers can nil-check the interface.

func (*ServiceContainer) GetShellHistoryStorage added in v0.148.0

func (c *ServiceContainer) GetShellHistoryStorage() storage.ShellHistoryStorage

GetShellHistoryStorage returns the shell-history store, or nil when storage failed to initialize (callers fall back to the file-based history).

func (*ServiceContainer) GetShortcutRegistry added in v0.42.0

func (c *ServiceContainer) GetShortcutRegistry() *shortcuts.Registry

func (*ServiceContainer) GetSkillsService added in v0.117.0

func (c *ServiceContainer) GetSkillsService() agentdomain.SkillsService

func (*ServiceContainer) GetStateStore added in v0.207.0

func (c *ServiceContainer) GetStateStore() *statemanager.Store

func (*ServiceContainer) GetStorage added in v0.46.0

GetStorage returns the conversation storage

func (*ServiceContainer) GetTaskRetentionService added in v0.53.3

func (c *ServiceContainer) GetTaskRetentionService() a2adomain.TaskRetentionService

GetTaskRetentionService returns the task retention service (may be nil if A2A is not enabled)

func (*ServiceContainer) GetTelemetryRecorder added in v0.145.0

func (c *ServiceContainer) GetTelemetryRecorder() *telemetry.Recorder

GetTelemetryRecorder returns the telemetry recorder, or nil when telemetry is disabled. The returned *Recorder is nil-safe, so the chat/headless session-lifecycle taps can call its methods directly without a nil check.

func (*ServiceContainer) GetThemeService added in v0.47.0

func (c *ServiceContainer) GetThemeService() tui.ThemeService

func (*ServiceContainer) GetTitleBackfill added in v0.207.0

func (c *ServiceContainer) GetTitleBackfill() *scheduler.TitleBackfill

GetTitleBackfill returns the background job manager

func (*ServiceContainer) GetTokenEstimator added in v0.207.0

func (c *ServiceContainer) GetTokenEstimator() convdomain.TokenEstimator

GetTokenEstimator returns the shared tokenizer.

func (*ServiceContainer) GetToolExecutionCoordinator added in v0.112.3

func (c *ServiceContainer) GetToolExecutionCoordinator() tui.ToolExecutionCoordinator

GetToolExecutionCoordinator returns the tool round-trip coordinator (tool approval, streaming-status, execution progress, active-tool tracking).

func (*ServiceContainer) GetToolRegistry added in v0.14.1

func (c *ServiceContainer) GetToolRegistry() *tools.Registry

func (*ServiceContainer) GetToolService

func (c *ServiceContainer) GetToolService() agentdomain.ToolService

func (*ServiceContainer) NewPanel added in v0.219.0

func (c *ServiceContainer) NewPanel(out io.Writer) *headless.Panel

NewPanel builds the panel a headless serve worker answers its panel frames with, over the worker's own conversation, skills, tools, models and modes.

func (*ServiceContainer) PricingService added in v0.86.0

func (c *ServiceContainer) PricingService() convdomain.PricingService

func (*ServiceContainer) RouteBrowserRequests added in v0.219.0

func (c *ServiceContainer) RouteBrowserRequests(request func(ctx context.Context, id string, frame json.RawMessage) (json.RawMessage, error))

RouteBrowserRequests rebuilds the extension browser tools over request instead of the extension client's socket, so a headless serve worker relays browser frames through its host and binds no port. Call it before the first run. No-op unless the extension backend is selected.

func (*ServiceContainer) SetUINotifier added in v0.126.0

func (c *ServiceContainer) SetUINotifier(n agentdomain.UINotifier)

SetUINotifier swaps in the real (program-backed) UI notifier. cmd/chat.go calls it once, after tea.NewProgram and before program.Run, so every background producer that captured the holder at construction begins pushing into the live Bubble Tea loop. Safe to call from any goroutine. Before it runs, producers push to the no-op default.

func (*ServiceContainer) Shutdown added in v0.54.0

func (c *ServiceContainer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the service container and its resources

func (*ServiceContainer) StartScreenshotServer added in v0.207.0

func (c *ServiceContainer) StartScreenshotServer(sessionID string) *computerinfra.ScreenshotServer

StartScreenshotServer starts the computer-use screenshot streaming server for sessionID and registers it as the "screen" frame source, so GetLatestFrame works in chat and headless alike. Returns nil when streaming is disabled or the server fails to start.

Jump to

Keyboard shortcuts

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