ServiceLocator
Category: Core
Source: service_locator.dart
Classes
ServiceLocator
Properties
| Property | Type | Description |
|---|---|---|
environment | Environment | |
config | GlueConfig | |
agent | AgentCore | |
manager | AgentManager | |
llmFactory | LlmClientFactory | |
systemPrompt | String | |
trustedTools | Set<String> | |
sessionStore | SessionStore? | Null on startup. SessionManager creates the concrete store lazily — either on resume, or when the user sends their first message. |
executor | CommandExecutor | |
workspace | Workspace | Filesystem 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. |
runtimeSession | RuntimeSession | The 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. |
jobManager | ShellJobManager | |
obs | Observability | |
debugController | DebugController | |
skillRuntime | SkillRuntime | |
mcpPool | McpClientPool | Pool 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
| Property | Type | Description |
|---|---|---|
environment | Environment | |
config | GlueConfig | |
agent | AgentCore | |
manager | AgentManager | |
llmFactory | LlmClientFactory | |
systemPrompt | String | |
trustedTools | Set<String> | |
sessionStore | SessionStore? | Null on startup. SessionManager creates the concrete store lazily — either on resume, or when the user sends their first message. |
executor | CommandExecutor | |
workspace | Workspace | Filesystem 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. |
runtimeSession | RuntimeSession | The 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. |
jobManager | ShellJobManager | |
obs | Observability | |
debugController | DebugController | |
skillRuntime | SkillRuntime | |
mcpPool | McpClientPool | Pool 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. |