AgentCoreServices class final
The typed platform services a host supplies to wireAgentCore.
Nullable fields are the config/run-conditional ones: null means the
facility does not exist this run, which run-narrowing declares as an
honest off — the per-tool null gates inside the assembly then agree
with the plan by construction.
Constructors
-
AgentCoreServices({required ExecutionEnv baseEnv, FutureOr<
Map< sessionEnvVars()?, SandboxServices? sandbox, HashlineSnapshotStore? snapshots, WebSearchConfig? webSearch, SqliteEngine? sqlite, LspToolConfig? lsp, McpManager? mcp, ShellJobRegistry? shellJobsFactory(ExecutionEnv coreEnv)?, ConfigService? configServiceFactory(ExecutionEnv coreEnv)?, PasswordPromptCallback? onPasswordPrompt, MemoryController? memory, void onMemoryChanged()?, ScheduledMessageQueue? scheduledMessages, String? scheduleSenderMailbox()?, AskCallback? onAsk, RequestSecretCallback? onRequestSecret, bool isUnattended()?, ObligationClose? obligationsClose, InspectImageConfig? vision, TranscribeAudioConfig? transcribe, MediaToolServices? media, BrowserController? browserController, Future<String, String> >String> saveBrowserScreenshot(ExecutionEnv coreEnv, Uint8List png)?, List<HostExtension> extensions = const [], MessagingRepository? hubFabric, String? mainMailbox()?, SubagentServices? subagents, Object? extRuntimeFactory, String? sessionRoot, Object? dynamicMessageSink, Object? onDeviceProviderFactory, String? sessionCwd, RedactionConfig? redactionConfig, Set<String> approvedSecretLiterals()?, AgentTelemetrySink? telemetry, HostKeyResolver? keyResolver, void onKeySlotDrift(String message)?}) -
const
Properties
-
approvedSecretLiterals
→ Set<
String> Function()? -
Live snapshot of the values the host registered as secrets
(
request_secret, preconfig keys): those literals are EXEMPT from command rewriting so an approved value still materializes while the pipeline masks it in transcripts (review 5456649624).final - baseEnv → ExecutionEnv
-
The host's base environment (the CLI's
CwdOverrideEnv). Decorated by the builder: sandbox (when wired) → session vars (when provided).final - browserController → BrowserController?
-
final
- configServiceFactory → ConfigService? Function(ExecutionEnv coreEnv)?
-
Config tool service factory — same final-env shape.
final
- dynamicMessageSink → Object?
-
The JS-app host surface marker (the
dynamic_messagemachinery + the jsr app runtime, issue #102): the builder registers no tool for it — the host's extension carries the tool — but its presence keeps thejs_appscell honestly WIRED instead of run-narrowing off on hosts that have the surface (issue #1079 slice 5: the app passes itsDynamicMessagesService-equivalent;extRuntimeFactoryis the same kind of marker forjs_extensions).final -
extensions
→ List<
HostExtension> -
The host's declared extensions (issue #1079 slice 4 — the
HostExtensionApi): named tool contributions with an explicit per-profile matrix (E6). The builder gates them: tool-id collisions rejected at build time with both registrants named (E7), and a profile-off extension hides with its reason surfaced on WiredAgentCore.extensions (E8). See HostExtension.final - extRuntimeFactory → Object?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hubFabric → MessagingRepository?
-
The hub-transport messaging backend. The builder composes the
fabric's hub primary over it (slice 3: the fabric itself is
builder-owned); null drops the hub transport at run-narrowing, the
file layer keeps working.
final
- isUnattended → bool Function()?
-
Whether the session runs UNATTENDED (approval mode
unattended/autopilot — no user present). Consumed by therequest_secretdecline path (gh-1412): an unattended decline carries the credential-hunt nudge instead of reading as a dead end. Null = interactive (the default, unchanged decline text).final - keyResolver → HostKeyResolver?
-
Host-facing provider-key slot resolution (issue #1322 Gap 2). The
host injects its env/store readers; resolveKey then answers which
slot the request path WILL use. Null = the host resolves keys its
own way (and owns the canonical-vs-pinned drift risk).
final
- lsp → LspToolConfig?
-
final
- mainMailbox → String? Function()?
-
The host's MAIN inbox resolver for the hub primary's mail merge —
required whenever the hub transport wires (E1-loud otherwise). The
CLI resolves
() => _subagentManager.mailboxOf('main')lazily, so the manager may be constructed after the fabric.final - mcp → McpManager?
-
final
- media → MediaToolServices?
-
final
- memory → MemoryController?
-
Host-side tool families (the CLI's memory/fabric/ask surface). They
move INTO the builder's gated set in later slices; the builder
already places them in the canonical order.
final
- obligationsClose → ObligationClose?
-
The obligations-ledger close callback (
obligation_mark_done, issue #1380 lifecycle). Null = the host does not maintain the ledger: the tool still registers and answers gracefully in-tool — the same always-registered contract as onAsk.final - onAsk → AskCallback?
-
The
askhost prompt. Null = headless host: the tool still registers and fails gracefully in-tool (its documented null mode) — it is never dropped from the registry.final - onDeviceProviderFactory → Object?
-
The on-device inference bridges (webllm / gemma / transformers.js):
a presence marker like dynamicMessageSink — the stream functions
are per-connection host choices, the marker keeps the
on_device_providerscell honest on the hosts that ship the runtimes.final - onKeySlotDrift → void Function(String message)?
-
Fires when the run's model resolved to a PINNED key slot instead of
the canonical one — the same migration hint the CLI prints at boot.
Requires keyResolver; called once per WiredAgentCore.buildAgentStack.
final
- onMemoryChanged → void Function()?
-
final
- onPasswordPrompt → PasswordPromptCallback?
-
final
- onRequestSecret → RequestSecretCallback?
-
The
request_secrethost prompt. Null = headless host: same always-registered graceful-failure contract as onAsk.final -
providedServiceNames
→ Set<
String> -
The catalog service names this bundle provides — the run-narrowing
input. Names match CapabilitySpec.requiredServices keys exactly.
no setter
- redactionConfig → RedactionConfig?
-
The host's resolved redaction config for the bash shape interceptor
(issue #1408 AC3, review 5456649624): the same
redact:section steers command rewriting and result/job-log masking. Null = the default config (vendor shapes on).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sandbox → SandboxServices?
-
final
-
saveBrowserScreenshot
→ Future<
String> Function(ExecutionEnv coreEnv, Uint8List png)? -
The browser screenshot saver. The builder hands it the SAME
decorated env every fs-touching tool rides (base → sandbox →
session vars, review #1230): a screenshot save clamps through the
cube fs policy exactly like
generate_imagewrites to the same tree. One rule — hosts must not close over their raw base env.final - scheduledMessages → ScheduledMessageQueue?
-
final
- scheduleSenderMailbox → String? Function()?
-
final
- sessionCwd → String?
-
The host's session scope for the messaging root (issue #1079 slice
5): usually null — the fabric encodes ExecutionEnv.cwd. Hosts with
a mount concept (the app's project folders, where sessionCwd is the
mounted host path) name the scoped dir so mail is grouped by
workspace, matching the sessions root the host already computes.
final
-
sessionEnvVars
→ FutureOr<
Map< Function()?String, String> > -
The live session-var source for SessionVarsExecutionEnv. Null on
hosts without session variables.
final
- sessionRoot → String?
-
final
- shellJobsFactory → ShellJobRegistry? Function(ExecutionEnv coreEnv)?
-
Shell job board factory — receives the FINAL decorated env (the
jobs' processes must run through the same env the tools use).
final
- snapshots → HashlineSnapshotStore?
-
final
- sqlite → SqliteEngine?
-
final
- subagents → SubagentServices?
-
The subagent/task complex (slice 3). Null = the capability narrows
off this run with a named reason; the task/monitoring surface and
the fabric/manager/heartbeat never half-wire.
final
- telemetry → AgentTelemetrySink?
-
Lifecycle telemetry for in-process hosts (issue #1322 Gap 3). When
present,
buildAgentStackattaches the sink to the built agent and wraps the stream function — turn/tool/first-token/provider-status records flow with zero further host code. Null = silent (today's behavior). The interface is pure; the fa.log file sink comes frompackage:flutter_agent_harness/io.dart.final - transcribe → TranscribeAudioConfig?
-
final
- vision → InspectImageConfig?
-
final
- webSearch → WebSearchConfig?
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveKey(
{String? provider, required String baseUrl, String? model, List< String> envNames = const [], String? defaultBaseUrl, String? activeCustomKeyName}) → HostKeyResolution? -
The effective key-slot name (and drift hints) for
baseUrl— the host-facing ask the CLI kept internal (issue #1322 Gap 2). Null when no keyResolver was supplied. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited