AgentCli class

The CLI harness: agent + built-in tools + session persistence + compaction, driven by a CliIO.

Available extensions

Constructors

AgentCli({required AgentCliConfig config, required CliIO io, StreamFunction? streamFunction, String prompt = 'fa> ', bool useColor = false, bool useTui = false, String version = '0.0.0', Map<String, String> environment = const {}, MarkdownSurface? markdownSurface, DateTime waitingClock()?, Future<void> waitingSleep(Duration)?})
Creates an AgentCli. streamFunction overrides the provider adapter (used in tests); otherwise one is built from AgentCliConfig.providerKind and AgentCliConfig.apiKey.

Properties

agent → Agent
The underlying Agent driving the session.
no setter
approval → ApprovalManager
The approval gate attached to the agent: mode, per-tool overrides, and the session always-allow set (/approval, /allow).
no setter
busyPhasesForTest → List<String>
Test seam: every busy-row phase pushed, in order (issue #653 — the fold marker must never ride the busy row; see _pushBusyPhase in agent_cli_compaction.dart, the status row carries the badge).
final
checkpoints → CheckpointRewindController
The checkpoint/rewind controller: its checkpoint and rewind tools are registered on the agent, and it applies rewinds at turn end.
no setter
config → AgentCliConfig
The static configuration.
final
currentMode → AgentMode
The active mode.
no setter
environment → Map<String, String>
The host environment (bin/fah passes Platform.environment), read for NO_COLOR / TERM / COLORTERM theme-profile detection (issue #279).
final
globalTools → ToolsConfig?

Available on AgentCli, provided by the AgentCliTools extension

The live global tools: scope for the host's persistence; null before the first availability rebuild.
no setter
hashCode → int
The hash code for this object.
no setterinherited
inboxWakeStreakForTest ↔ int
Test seam: observe/reset the inbox-wake streak without driving ten real runs (the cap is exactly _maxInboxWakeStreak).
getter/setter pair
io → CliIO
Terminal IO.
final
isBusy → bool
Whether a run is currently in flight. True from the moment a run is STARTED (pre-flight compaction runs before the first streamed byte) — not only while the provider streams.
no setter
mcpManagerForTest → McpManager?

Available on AgentCli, provided by the SettingsFlow extension

The live MCP manager when one runs this session (the flow tests assert real reconnect behavior through it).
no setter
onCtrlCExitRequest ↔ void Function()?
The SIGINT-parity exit the TUI's ctrl+c press 2 triggers (issue #830): abort-if-running bounded, session resume hint, exit 130. bin/fah.dart installs the real routine; null leaves the legacy plain-quit fallback.
getter/setter pair
powerAssertionsForTesting → PowerAssertionController?

Available on AgentCli, provided by the SlashCommandDispatch extension

The session's sleep-prevention controller (issues #325/#326) — null when no runner was injected. Exposed so wiring tests can assert the acquire/release lifecycle without spawning a real helper.
no setter
prompt → String
The input prompt written when the agent is idle.
final
providerKind → String
The live provider adapter kind (see _providerKind).
no setter
runStalledForTest → bool

Available on AgentCli, provided by the AgentCliSteering extension

Test seam: the shared stall classifier state (issue #514 AC1) — true iff the watchdog currently pushes the run as stalled.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessionPickerItemsForTest ↔ List<MenuItem>?
The items the most recent sessions picker opened with (see openSessionsPickerForTest).
getter/setter pair
sigintPolicy → SigintPolicy
The process-wide double-press Ctrl+C window (issue #830): the SIGINT handler and the TUI's ctrl+c KeyMsg path resolve THIS instance, so the two input paths can never disagree (ACX.5).
final
subagentManager → SubagentManager
The session's retained-subagent registry (tests, the app settings Agents panel, hosts observing children).
no setter
subagentManagerForTest → SubagentManager
Test seam exposing the subagent registry — the heartbeat tests plant running children without driving a real spawn.
no setter
systemPrompt → String
The effective system prompt sent to the model.
no setter
taskConfig → TaskToolConfig
The session's task-tool wiring (job registry, subagent registry, child-session opener) — tests and hosts verifying the lifecycle wiring read it instead of reaching into private state.
no setter
ttsr → TtsrController?
The TTSR controller, when stream rules are configured (AgentCliConfig.ttsr).
no setter
tuiController → FaTuiController?
The active TUI controller for the SIGINT handler in bin/fah.dart: press 1 of the double-press contract (issue #830) reaches the model through it (composer clear + footer hint). Null in line mode.
no setter
waitingLostJobsForTest → int

Available on AgentCli, provided by the AgentCliWaitingSeams extension

Test seam: the current restart-honesty count.
no setter
waitingProcessTableForTest ← Future<({Set<int> pids, Map<int, String> starts})?> Function()?

Available on AgentCli, provided by the AgentCliWaitingSeams extension

Test seam: replaces the boot process probe (issue #478 reconcile). Null restores the real ps probe.
no getter

Methods

acquirePowerAssertions() → Future<void>

Available on AgentCli, provided by the SlashCommandDispatch extension

Session-open hook for the sleep-prevention assertion (#326): acquires only in the explicit power.hold: session mode — the DEFAULT is per-run (see runPowerAssertionsStarted), so an idle agent never pins the machine awake. No-op without an injected runner (tests, web).
addProviderExclusionsForTest() → Map<String, String>
The deliberate picker exclusions (provider name → reason) — with addProviderItemsForTest the test asserts the catalog is exactly presets ∪ exclusions.
addProviderHandlerKeysForTest() → Set<String>
The preset names with a routing handler — the test asserts presets == handlers (a preset row without a handler is a dead menu entry: the picker closes and nothing happens — the live Copilot bug).
addProviderItemsForTest() → List<MenuItem>
The rows of the "Add provider" preset picker — the test asserts every catalog provider with a typed /provider <name> flow is listed (Copilot shipped missing: the list is hand-maintained).
attachSpillWiring() → void

Available on AgentCli, provided by the AgentCliSpillWiring extension

Automatic tool-result spilling (issue #678): attached AFTER the redaction pipeline so the hook chain runs result → redact → size check → spill → preview. Null/inactive config = no attach, byte-identical legacy.
bootThemeForTest() → Future<void>

Available on AgentCli, provided by the ThemeCommands extension

Test seam: runs the async half of the boot theme application — the constructor fires _applyBootTheme unawaited; tests await this.
buildModelMenuForTest(String filter, {int width = 80}) → List<MenuItem>
Test seam driving the TUI model-menu builder in line mode: the same _buildModelMenu the TUI's model picker renders. width is the terminal width the table lays its columns out for (80 = the headless default).
checkPendingSteeringHealthForTest() → void

Available on AgentCli, provided by the AgentCliSteering extension

Test seam: the wedge watchdog (a pending steering panel flips to dead only when the run's heartbeat is stale) so tests don't wait for the 2s inbox tick (issue #437 E4).
crossProviderCandidatesForTest([String filter = '']) → List<(String, String)>
The deduped (provider, modelId) pair list the picker is built from. Exposed for tests so cross-provider invariants (catalog fallback chains, dedup with the saved entry's modelId) can be asserted without driving the TUI two-step picker.
deleteSessionIfEmpty() → Future<void>
Deletes the active session's file when nothing was ever said in it: opening the CLI and leaving (or only poking slash commands) must not litter the sessions list with empty files. Best-effort - exit and session switching never fail on it. A session that owns subagents is NOT empty: its subagent_registry record is real content. A session that already has persisted records (e.g. a user message saved before a run that was interrupted) is also kept.
discoverAgentsFromRoots(({List<AgentRoot> projectRoots, List<AgentRoot> userRoots}) roots, {Set<SkillSource>? allowedSources}) → Future<void>

Available on AgentCli, provided by the AgentCliAgentExt extension

Fire-and-forget discovery: scans project + user roots for agent .md files. allowedSources restricts which root sources are scanned (the third-party consent gate; null = all).
handleAgentsCommand(String rest) → Future<void>

Available on AgentCli, provided by the AgentCliAgentExt extension

/agents [types|<id>|open <id>] — the agents tree panel (Variant B):
handleLineForTest(String line) → Future<void>

Available on AgentCli, provided by the SlashCommandDispatch extension

Dispatches one input line through the normal pipeline. Editor-flow unit tests drive slash commands through this instead of spawning a full AgentCli.run loop.
handleMailCommand(String rest) → Future<void>

Available on AgentCli, provided by the AgentCliHubDriver extension

/mail - the deferred-panel history; /mail <id> - one panel in full with its reply prefill.
handleReplyCommand(String rest) → Future<void>

Available on AgentCli, provided by the AgentCliHubDriver extension

/reply <id|address> <text> - direct-send to a panel's reply mailbox (absolute addresses go cross-instance) or to a live sibling id.
heartbeatTickForTest() → void
Test seam firing one heartbeat tick (issue #383) — the same path the cadence timer drives, without waiting real minutes in tests.
hubActionForTest(String action, String? key) → Future<void>

Available on AgentCli, provided by the AgentCliHubDriver extension

Test seam: the overlay action router (enter / back / close) the TUI routes its hub keys onto.
hubMailCountsForTest() → Future<Map<String, int>>

Available on AgentCli, provided by the AgentCliHubDriver extension

Test seam: refreshes the pending-inbox counts (the async half of the mail:N markers) and returns the snapshot the tree rows render with.
hubTranscriptForTest(String id) → Future<(List<String>, bool)>

Available on AgentCli, provided by the AgentCliHubDriver extension

Test seam: the transcript push for id (the overlay's enter target).
hubTreeForTest() → (List<HubRow>, HubFooter)

Available on AgentCli, provided by the AgentCliHubDriver extension

Test seam: the live fleet snapshot + aggregates the tree overlay renders from (the same upsert + rows assembly as _pushHubTree).
initJsExtensions() → Future<void>

Available on AgentCli, provided by the AgentCliExt extension

Loads installed JS extensions in the background (fire-and-forget from the constructor, like MCP boot — never blocks the REPL): build the store + host, wire the sinks, loadAll, register the tool surface + prompt section, and attach the hooks.
listAgentTypes() → void

Available on AgentCli, provided by the AgentCliAgentExt extension

/agents: lists all available agent types (built-in + discovered).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAgentsHubOverlay() → Future<void>

Available on AgentCli, provided by the AgentCliHubDriver extension

Opens the hub overlay (/agents bare in the TUI). Line mode keeps the Variant-B picker (no full-screen surface to render into).
openSessionsPickerForTest() → Future<void>
Test seam: opens the sessions picker (building its rows) without a TUI; the built items land in sessionPickerItemsForTest.
pickAgentAction(String key) → Future<void>

Available on AgentCli, provided by the AgentCliAgentExt extension

Picker routing for the child action picker.
pickAgentFromTree(String key) → Future<void>

Available on AgentCli, provided by the AgentCliAgentExt extension

Picker routing for the agents tree (main → info, child → observe view, noop → nothing).
pickerHandlerKeysForTest() → Set<String>
Test seam: the picker-id → handler dispatch map's keys. A picker id opened by openPicker without an entry here is a dead menu entry (selection routes to null?.call() — the picker closes and nothing happens), so the dispatch test asserts the id set exactly.
pickSettingForTest(String key) → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

pushHubTreeForTest(FaTuiController controller) → void

Available on AgentCli, provided by the AgentCliHubDriver extension

Test seam: pushes the tree overlay into controller — the same _pushHubTree assembly the TUI-attached /agents runs — so driver tests can cover it without a PTY model loop.
rebuildToolAvailability() → Future<void>

Available on AgentCli, provided by the AgentCliTools extension

Re-reads every scope, resolves availability, and re-applies it to the live registry/prompt/executor: safe to call at any time (idempotent).
recordCustomModelForTest(String modelId) → void
Test seam for the private /model memory write path: records modelId into the active saved entry (no-op without one), the same thing a real /model switch does while a custom provider is active.
refilterMcpTools(ToolAvailabilityResolution resolution) → void

Available on AgentCli, provided by the AgentCliTools extension

Re-filters the dynamic MCP surface against resolution: disabled servers get their tools unregistered (and their names noted so the gate tombstones them), re-enabled servers get their tools registered straight from the manager — no server restart (AC13). Under a load preset (issue #680) an ENABLED-but-demoted family stays OUT of the schema until mounted: allowed to connect is not the same as loaded.
releasePowerAssertions() → Future<void>

Available on AgentCli, provided by the SlashCommandDispatch extension

Releases the sleep-prevention assertion (idempotent, warn-not-crash) — both modes: the per-run mode's safety net for an exit mid-run, the session mode's regular release.
removeProvider(CustomProviderEntry entry) → Future<void>
Removes a saved custom provider from the registry (the /provider picker's Delete action). Clears the active-entry marker when needed and notifies AgentCliConfig.onProviderChanged so the host persists the registry — deletion never switches the active model, so without the notification the deletion silently vanished on restart.
restartRunForTest() → void

Available on AgentCli, provided by the AgentCliSteering extension

Test seam: the /restart affordance so tests don't route through the slash-command parser.
resyncMcpAvailability() → void

Available on AgentCli, provided by the AgentCliTools extension

Re-applies availability to the fresh MCP surface after a server connect/fail/drop: the default mode re-filters through the standing resolution (cheap — byte-identical REG); under a load preset the late server must RE-RESOLVE (issue #680): the demotion covers the live server set, so the fresh family enters discoverableIds instead of leaking its schemas into every request.
run() → Future<void>
Runs the REPL until /exit or the input stream closes.
runHeadless(String prompt, {List<ImageContent> images = const [], HepWriter? hep, bool waitForJobs = false, StreamJsonWriter? streamJson}) → Future<int>
Runs a single non-interactive prompt (headless mode: fah "<prompt>") and returns the process exit code: 0 on success, 1 when the run ends with a provider error, 130 when aborted (Ctrl-C via CliIO.interrupts). Tool errors the agent recovers from still exit 0 — the exit code reflects the run's terminal state, like claude/pi.
runPowerAssertionsSettled() → Future<void>

Available on AgentCli, provided by the SlashCommandDispatch extension

Run-settle hook (#326): the per-run hold releases once the run has fully settled (post-run compaction included).
runPowerAssertionsStarted() → void

Available on AgentCli, provided by the SlashCommandDispatch extension

Run-start hook (#326): the per-run hold acquires here, fire-and- forget — sleep prevention must never delay the first streamed byte.
runProviderModelFlow({required String title, bool openAiCompatibleOnly = false, String? mediaSlot, required Future<void> apply(ProviderModelChoice choice)}) → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

The two-level "provider → model" pick: step 1 picks the provider (saved custom entries first, then the catalog), step 2 fetches that endpoint's /models (openai-like endpoints; manual entry otherwise or when the list is empty), then apply receives the choice. Cancelling any step aborts silently. openAiCompatibleOnly restricts the provider list to the wire format the media tools speak. mediaSlot opts the model-list fetch into catalog seeding — pass the slot name (e.g. imageGeneration) when the user is picking a media model so the remote catalog's per-slot ids show up in the result even when /v1/models returns an empty list.
sessionResumeHint() → Future<String?>
The fa --session … resume line, or null when nothing was persisted. Separate from printSessionResumeHint so non-REPL callers (the SIGINT exit path) can print it to the REAL stdout after the TUI is gone — routing through io there would write into a dead transcript.
settingsHubItems() → List<MenuItem>

Available on AgentCli, provided by the SettingsFlow extension

The settings-hub rows: one entry per configurable area, each launching the same interactive flow its dedicated slash command would. Pure builder so tests can assert the hub carries every area without a TUI controller.
settingsHubItemsForTest() → List<MenuItem>

Available on AgentCli, provided by the SettingsFlow extension

settingsPickerHandlerKeysForTest() → Set<String>
Test seam: the settings-hub item keys that have a dispatch target (a hub row without one closes silently on Enter).
settingsPickerHandlerKeysForTest() → Set<String>

Available on AgentCli, provided by the SettingsFlow extension

settleLeftoverSteeringForTest() → void

Available on AgentCli, provided by the AgentCliSteering extension

Test seam: the run-settle steering resolution (leftover run or loud drop) so driver tests can exercise both branches deterministically instead of racing the real settle window.
startAgentModelFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Agent models: pick the task role (Quick model / Subagents model), then provider → model through the shared two-level flow, and the role's chain is pinned — live on the resolver from the next spawn and persisted into the config's roles: section. A role can also be cleared back to the main model (the chain is dropped, the role inherits default).
startChatModelFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Chat model: provider → model, then switch the connection. Mirrors _switchToSavedProvider for saved entries (secure-store key resolution included) but applies the picked model instead of the entry's last-used one.
startCompactionEngineFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Compaction: pick the engine (classic | structured), pick the scope to persist in (session = live only), and apply. The yaml write is surgical (other sections survive byte-for-byte) and the edited file is validated with the REAL parser before it is written — the flow can never persist a file the next boot would reject. Cancelling either pick aborts silently.
startContextCapFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Context cap: the agent: section (contextWindowCap, issue #394) — set or clear the owner-side cap the compaction thresholds, the ctx meter and the loop's over-window guard clamp through. Writes go through the surgical validated-yaml upsert into the USER config (the machine-level file fa config set agent… also uses); the running session keeps its boot cap (honest note). Loops until the pick is cancelled or done.
startCubeSandboxFlow() → Future<void>

Available on AgentCli, provided by the CubeCommands extension

Settings → Cube sandbox: pick disabled, one of the project's .fah/cubes/*.yaml manifests, or a custom path. The pick applies live through the same helpers as /cube use//cube off and persists as the startup default (cube: section) in the user config.
startDapHubFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → DAP / Hub: view the live hub snapshot (url, agent name, connection state), set the hub url or the agent name (persisted through AgentCliConfig.onDapHubConfigChanged — the hub client's ~/.dap/config.json read-modify-write, so channels and invites survive), test the connection, or write the hub: false plugin opt-out into .fah/packages.yaml. Loops until the pick is cancelled or done.
startHarnessModeFlow() → Future<void>

Available on AgentCli, provided by the HarnessModeSettings extension

Settings → Harness mode: the agent.mode preset (issue #679, AC3's settings surface) — default or the pi benchmark shape (the 4-tool surface, the bare prompt). Writes go through the surgical validated-yaml upsert into the USER config (the same path fa config set agent.mode … uses); the running session keeps its boot mode — the pick lands at the next boot, where the flag > env > config ladder re-resolves it.
startImagesFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Images: the images: config section (issue #395) — the registry kill switch (images.registry: false reproduces today's request shape byte-for-byte) and the per-request unique-image cap. Writes go through the surgical validated-yaml upsert into the USER config (the file bin/fah.dart boots the registry from), and every successful write re-publishes the process-wide imageRegistryConfig from the saved file — the request build consults that global, so the change lands on the next request build without a restart (AC3/E3: what's live is what's on disk). Loops until cancelled or done.
startLoadModeFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

The load-mode flow (issue #680): pick default / pi / omp, which upserts agent.mode (validated by validateAgentSection — a bad value writes NOTHING) and applies LIVE: the pick re-assigns the CLI's live preset and rebuilds availability, so the next request's schema+prompt reflect it without a restart. The live session keeps its boot-time mode if the pick is cancelled.
startMcpServersFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → MCP servers (issue #396): manage the mcp: section live — per-server status (connecting/connected/failed) with view-tools / reconnect / edit / remove (confirm), plus an add wizard (stdio command/args/env or remote url/transport/headers). Every action re-reads the section (a concurrent edit survives — E3) and is validated with the real McpConfig parser BEFORE the surgical write into ~/.fah/config.yaml (AC2/AC4). With a live manager the same section diff applies through McpManager.applyConfig — only the touched servers reconnect; without one the note defers to the next boot (AC3). Loops until cancelled or done.
startMediaSlotFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Media models: pick the slot, then provider → model, then pin the slot override (same persistence as /models set).
startMemoryStoresFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Memory: edit the long-term memory store locations (memory.projectPath / memory.userPath). The project path belongs in the project config, the user path in the user config (the same files the boot loader reads); writes are surgical and validated with the real MemoryConfig parser first. Applies live — the memory controller re-reads the section before every memory operation.
startPowerFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Power: the power: config section (sleep prevention, issues #325/#326) — the sleepPrevention level and the hold lifecycle. Writes go through the surgical validated-yaml upsert into the USER config, and every successful write re-arms the session's assertion from the saved file (_reloadPowerAssertions — what's live is what's on disk). Loops until cancelled or done.
startProviderEditWizardForTest(CustomProviderEntry? entry) → void
Test seam driving the TUI picker's Edit action in line mode: opens the prefilled edit wizard for entry (or the active provider when null), the same _startProviderEditWizard the picker calls.
startRedactionFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Redaction: the redact: yaml section as an interactive flow (issue #391) — quick toggles, the entropy knobs, the allowlist and per-tool policy lists, per-layer toggles and a stats reset. Writes go through the surgical validated-yaml upsert into the USER config (the machine-level file fa config set redact… also uses); with a live pipeline the saved section is reloaded from disk and installed on the spot, without one the note honestly defers to the next boot. Loops until the pick is cancelled or done.
startResilienceFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Resilience: the providerTimeouts: watchdog knobs and the retry: backoff policy as an interactive flow (issue #393). Writes go through the surgical validated-yaml upsert into the USER config; the saved timeouts are re-published onto the process-wide override the watchdogs read on every request, and the saved retry policy is installed on the roles resolver when one runs. Loops until the pick is cancelled or done.
startToolsFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Tools: pick a tool, flip it, choose the scope to persist in (project default). Loops until cancelled or done.
startTtsrRulesFlow() → Future<void>

Available on AgentCli, provided by the SettingsFlow extension

Settings → Stream rules (TTSR): list the ttsr: section's rules (pattern, scope, enabled?) with per-rule enable/disable and delete, plus an add-rule prompt (name, pattern, body, scope). The section is read fresh for every action (a concurrent edit survives — E3) and written back surgically into ~/.fah/config.yaml — the boot-real home of the section (project .fah/rules.yaml is a separate file; a ttsr: block in the project config is never read for TTSR). Every write is validated with the real TtsrConfig parser first (AC4). When the session booted a live rule engine, the same rule diff is applied to the running manager (rules are consulted per stream — no restart); otherwise the flow says the change lands at next boot (AC3). Loops until cancelled or done.
statusLineForTest() → String

Available on AgentCli, provided by the ApprovalCommands extension

Test hook for the status row as the TUI renders it (issue #653 — the fold badge must clear at settle, error settles included).
statusProviderLabelForTest() → String

Available on AgentCli, provided by the ApprovalCommands extension

Test hook for _statusProviderLabel on the current model.
steerForTest(String text) → void

Available on AgentCli, provided by the AgentCliSteering extension

Test seam: queues a steer through the same _steerResolved path mid-run input takes (panel join + agent steer queue).
steerImagesForTest(String text, List<TuiImageAttachment> images) → void

Available on AgentCli, provided by the AgentCliSteering extension

Test seam: steers with clipboard chips through the same _steerResolved path a busy composer submit takes (issue #276).
syncDiscoverToolsTool() → void

Available on AgentCli, provided by the AgentCliTools extension

Registers or unregisters the discover_tools meta tool (issue #680) so the registry matches the LIVE load mode: present only in omp (discoveryEnabledByLoadMode — pi is pi-mono's exact benchmark shape, discovery off, issue #679; the default mode has no demotion and stays byte-identical). The tool carries no availability id, so it sits outside the gate's groups and no resolution can hide it. Called from rebuildToolAvailability, so a mid-session mode switch syncs it.
toolCapabilities() → Map<String, ToolCapability>

Available on AgentCli, provided by the AgentCliTools extension

The host wiring as capabilities: the hard floor below config.
toolGroups() → Map<String, List<AgentTool>>

Available on AgentCli, provided by the AgentCliTools extension

Groups the full static tool set by availability id, from the SAME instances the constructor registered. The boot hook stores this map in _toolGroupsById; the sqlite variant swap replaces the read entry in place so the gate always re-registers the current variant.
toString() → String
A string representation of this object.
inherited
tuiPickAddProviderForTest(String key) → Future<void>
Test seam routing an "Add provider" picker selection in line mode.
tuiPickSessionForTest(String key) → Future<void>
Test seam routing a sessions-picker selection in line mode.
tuiSelectModelForTest(String key) → Future<void>
Test seam for the TUI's model-menu selection: routes @<provider> (the two-step pick's provider row) and provider|model keys the same way the live picker does.
tuiSubmitForTest(String line, List<TuiImageAttachment> images) → Future<void>

Available on AgentCli, provided by the ComposerChipsSubmit extension

Test seam: builds the real TUI controller (the wiring under test: callbacks, clipboard reader, busy gate) without booting a terminal, and runs a composer submit through the full busy-gate → _handleLine → settle → queue-drain path (issue #276).
waitersSnapshotForTest() → Future<WaiterSnapshot>

Available on AgentCli, provided by the AgentCliWaitingSeams extension

Test seam: the current waiter aggregate — jobs, timers, lost jobs.
waitForIdle({Duration timeout = const Duration(seconds: 5)}) → Future<void>
Resolves when the in-flight run settles, bounded by timeout so an exit path (SIGINT) can never wedge on a stuck provider — a partial transcript is still persisted by the run's own error/abort handling.
waitingCaptureLostJobsForTest() → Future<void>

Available on AgentCli, provided by the AgentCliWaitingSeams extension

Test seam: re-runs the boot-time restart-honesty capture so tests can seed the cross-run manifest and observe the lost-jobs count.
waitingHeartbeatTickForTest() → void

Available on AgentCli, provided by the AgentCliWaitingSeams extension

Test seam: fires one waiting-heartbeat beat now (mirrors heartbeatTickForTest for #383).
waitingScheduleTimerForTest(String text, Duration delay) → Future<String>

Available on AgentCli, provided by the AgentCliWaitingSeams extension

Test seam: arms a real self-addressed timer so tests can drive the ceiling-wait loop through an actual wake source.
wireRunNoticesForTesting() → void

Available on AgentCli, provided by the AgentCliRunNotices extension

Test hook: wires the run notices without a full AgentCli.run (the size-gate split moved them beyond a plain unit test's reach).

Operators

operator ==(Object other) → bool
The equality operator.
inherited