Skip to content

ServiceLocator

Category: Core

Source: service_locator.dart

Classes

ServiceLocator

Properties

PropertyTypeDescription
environmentEnvironment
configGlueConfig
agentAgentCore
managerAgentManager
llmFactoryLlmClientFactory
systemPromptString
trustedToolsSet<String>
sessionStoreSessionStore?Null on startup. SessionManager creates the concrete store lazily — either on resume, or when the user sends their first message.
executorCommandExecutor
workspaceWorkspaceFilesystem handle for file tools. Routes through dart:io for host/Docker (where the host filesystem is authoritative) and through the runtime's FS API for cloud runtimes.
runtimeSessionRuntimeSessionThe active runtime session. Surfaces call [RuntimeSession.close] on session shutdown so cloud sandboxes don't leak; the slash command + doctor read [RuntimeSession.sandboxId] / [RuntimeSession.bootstrapSha] for display.
jobManagerShellJobManager
obsObservability
debugControllerDebugController
skillRuntimeSkillRuntime
mcpPoolMcpClientPoolPool of connected MCP servers. Always present (empty when no servers are configured). App subscribes to [McpClientPool.events] for status messages; commands call into it for /mcp list etc.

Methods

`static Future<AppServices> create({
String? model,
bool debug = false,
Environment? environment,

})`

`const AppServices({
required this.environment,
required this.config,
required this.agent,
required this.manager,
required this.llmFactory,
required this.systemPrompt,
required this.trustedTools,
this.sessionStore,
required this.executor,
required this.workspace,
required this.runtimeSession,
required this.jobManager,
required this.obs,
required this.debugController,
required this.skillRuntime,
required this.mcpPool,

})`

AppServices

Harness-layer services constructed by [ServiceLocator].

Surface concerns (terminal, layout, line editor) are not bundled here — the surface (e.g. App.create) constructs those itself. Keeping [AppServices] surface-free is what lets core/ stay below surface/ in the layered architecture (see tool/check_layers.dart).

Constructor

dart
const AppServices({
    required this.environment,
    required this.config,
    required this.agent,
    required this.manager,
    required this.llmFactory,
    required this.systemPrompt,
    required this.trustedTools,
    this.sessionStore,
    required this.executor,
    required this.workspace,
    required this.runtimeSession,
    required this.jobManager,
    required this.obs,
    required this.debugController,
    required this.skillRuntime,
    required this.mcpPool,
  })

Properties

PropertyTypeDescription
environmentEnvironment
configGlueConfig
agentAgentCore
managerAgentManager
llmFactoryLlmClientFactory
systemPromptString
trustedToolsSet&lt;String&gt;
sessionStoreSessionStore?Null on startup. SessionManager creates the concrete store lazily — either on resume, or when the user sends their first message.
executorCommandExecutor
workspaceWorkspaceFilesystem handle for file tools. Routes through dart:io for host/Docker (where the host filesystem is authoritative) and through the runtime's FS API for cloud runtimes.
runtimeSessionRuntimeSessionThe active runtime session. Surfaces call [RuntimeSession.close] on session shutdown so cloud sandboxes don't leak; the slash command + doctor read [RuntimeSession.sandboxId] / [RuntimeSession.bootstrapSha] for display.
jobManagerShellJobManager
obsObservability
debugControllerDebugController
skillRuntimeSkillRuntime
mcpPoolMcpClientPoolPool of connected MCP servers. Always present (empty when no servers are configured). App subscribes to [McpClientPool.events] for status messages; commands call into it for /mcp list etc.

Released under the MIT License.