@agentproto/runtime 2.8.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -13,8 +13,8 @@ export { CostBudget, CostBudgetScope } from '@agentproto/auth';
13
13
  import { R as ResolvedContextContinuityPolicy } from './context-continuity-ib9_bVYM.js';
14
14
  import { SandboxMode } from '@agentproto/command-sandbox';
15
15
  import { AdapterHandle, SetupField, AdapterResolver, AdapterLister, HarnessCapabilities, AdapterEntry } from '@agentproto/provider-kit';
16
- import { R as ResolvedAuthSpec, D as DeclaredAdapterOption, A as AdapterAuthDescriptor } from './spawn-defaults-DVgmfxWo.js';
17
- export { a as AuthEcho, b as AuthResolutionError, C as CLAUDE_CODE_OAUTH_SOURCE, c as CredentialSource, d as DefaultsAdapterAuthConfig, e as DefaultsAdapterConfig, f as ResolveSubscriptionCredentialInput, g as ResolvedSpawnAuthMaterial, h as ResolvedSpawnDefaults, S as SpawnDefaultsConfig, i as SubscriptionCredentialResolution, j as SubscriptionSourceError, k as credentialFingerprint, n as normalizeSkillsOption, r as resolveAuthSpec, l as resolveSpawnDefaults, m as resolveSubscriptionCredential } from './spawn-defaults-DVgmfxWo.js';
16
+ import { R as ResolvedAuthSpec, D as DeclaredAdapterOption, A as AdapterAuthDescriptor } from './spawn-defaults-DUnTfwVK.js';
17
+ export { a as AuthEcho, b as AuthResolutionError, C as CLAUDE_CODE_OAUTH_SOURCE, c as CredentialSource, d as DefaultsAdapterAuthConfig, e as DefaultsAdapterConfig, f as ResolveSubscriptionCredentialInput, g as ResolvedSpawnAuthMaterial, h as ResolvedSpawnDefaults, S as SpawnDefaultsConfig, i as SubscriptionCredentialResolution, j as SubscriptionSourceError, k as credentialFingerprint, n as normalizeSkillsOption, r as resolveAuthSpec, l as resolveSpawnDefaults, m as resolveSubscriptionCredential } from './spawn-defaults-DUnTfwVK.js';
18
18
  import { CatalogModelsQuery, CatalogModelsResponse } from './catalog-models.js';
19
19
  export { CatalogAdapterInput, CatalogAdapterModelInput, CatalogPricing, CatalogProduct, CatalogRoute, CatalogRouteSummary, CatalogVendor, buildCatalogModels } from './catalog-models.js';
20
20
  import { FooterSession } from './pr-provenance.js';
@@ -1251,9 +1251,21 @@ interface PolicyRunState {
1251
1251
  retries: number;
1252
1252
  startedAt: string;
1253
1253
  endedAt?: string;
1254
+ /**
1255
+ * Result of the most recent gate run. `kind` distinguishes what produced
1256
+ * it — `stdout`/`stderr` (truncated) are only populated for a shell gate;
1257
+ * a judge gate only ever sets `exitCode`/`at` here (its actual verdict
1258
+ * lives in `verdict` below). Consulted by a SIBLING judge gate watching
1259
+ * an overlapping session set (see `findRecentMachineGateResult`) so it
1260
+ * cannot render a verdict blind to an already-known machine result —
1261
+ * see that function's doc for the incident this closes.
1262
+ */
1254
1263
  lastGate?: {
1255
1264
  exitCode: number;
1256
1265
  at: string;
1266
+ kind?: "shell" | "judge" | "cost";
1267
+ stdout?: string;
1268
+ stderr?: string;
1257
1269
  };
1258
1270
  /**
1259
1271
  * Structured judge-gate verdict (WP-D). Set when the gate is a judge gate
@@ -2046,6 +2058,17 @@ interface SessionModelChangedEvent {
2046
2058
  type: "session:model-changed";
2047
2059
  sessionId: string;
2048
2060
  model: string;
2061
+ /**
2062
+ * The model now believed to be ACTIVE — mirrors
2063
+ * `SessionDescriptor.activeModel`. Absent only for adapters/paths that
2064
+ * predate this field; once populated it's kept in lockstep with `model`
2065
+ * (equal when a switch went through this daemon, divergent when learned
2066
+ * from an adapter's own reply to a `/model` sent as an ordinary prompt).
2067
+ * REPORTED BY THE ADAPTER, NOT INDEPENDENTLY VERIFIED when it diverges
2068
+ * from `model` — see `SessionDescriptor.activeModel`'s doc. A display
2069
+ * hint, never a source of billing/cost truth.
2070
+ */
2071
+ activeModel?: string;
2049
2072
  label?: string;
2050
2073
  ts: string;
2051
2074
  }
@@ -3348,6 +3371,35 @@ declare function createActivityProjector(opts: {
3348
3371
  resolvePrState?: PrStateResolver;
3349
3372
  }): ActivityProjector;
3350
3373
 
3374
+ /**
3375
+ * Daemon-side AGENTS.md resolution + injection (WP-R2).
3376
+ *
3377
+ * The daemon historically had ZERO first-class handling of `AGENTS.md` — it
3378
+ * was read only when an adapter happened to do so natively (opencode by its
3379
+ * own convention, claude-code via `CLAUDE.md`, hermes not at all), and the
3380
+ * supervisor brief told a child to "go read AGENTS.md" by hand, which is a
3381
+ * loterie, not a guarantee. This module makes the daemon resolve and inject
3382
+ * it itself, adapter-agnostic, at spawn time — the same way it already
3383
+ * composes the role disposition (see `role.ts`'s `composeRoleContext`).
3384
+ *
3385
+ * Resolution runs once per spawn, from the session's resolved `cwd`:
3386
+ * - walk UP directory by directory, checking for an `AGENTS.md` at each
3387
+ * level; the FIRST one found (nearest to `cwd`) wins.
3388
+ * - the walk is bounded by the git toplevel of `cwd`'s own repo
3389
+ * (`git rev-parse --show-toplevel` from `cwd`) — it never walks past it
3390
+ * into an outer/parent repo. A nested repo has its own `.git`, so git's
3391
+ * toplevel resolves to the nested root and the walk stops exactly there.
3392
+ * - if `cwd` is not inside a git repo at all, only `cwd` itself is checked
3393
+ * (no walk), falling through to "absent" when nothing is there.
3394
+ *
3395
+ * Injection is a block in the child's single composed initial prompt (there
3396
+ * is no separate system-prompt channel — see `session-spawn.ts`'s
3397
+ * `effectivePrompt` construction): a full inline copy when the file is small
3398
+ * enough, a pointer to read it first when it's large, or nothing extra when
3399
+ * absent — plus a standing cd-contract sentence regardless of mode.
3400
+ */
3401
+ type AgentsMdMode = "inline" | "pointer" | "absent";
3402
+
3351
3403
  /**
3352
3404
  * Policy layer for `agent_start.worktree` — the config-driven decision of
3353
3405
  * WHETHER to isolate a spawn into its own git worktree, kept deliberately
@@ -3435,17 +3487,44 @@ type WorktreeProvisionOutcome = {
3435
3487
  * by the CLI (over `@agentproto/worktree`); absent on a bare runtime.
3436
3488
  */
3437
3489
  type WorktreeProvisioner = (req: WorktreeProvisionRequest) => Promise<WorktreeProvisionOutcome>;
3490
+ /**
3491
+ * Injected port: best-effort attempt to reclaim ONE worktree by path, called
3492
+ * when its session reaches a terminal state (see
3493
+ * `SessionDescriptor.worktreeAutoProvisioned` and `createSessionsRegistry`'s
3494
+ * `runWorktreeAutoReclaim` option in `sessions.ts`). Deliberately scoped to
3495
+ * exactly the one path a session's own exit is allowed to touch — never a
3496
+ * repo-wide sweep. The implementation (wired by the CLI over
3497
+ * `@agentproto/worktree`'s `reclaimOneWorktree`) re-classifies fresh and only
3498
+ * ever removes the worktree when that comes back `reclaim` (merged-or-fresh,
3499
+ * clean, idle) — a dirty or held worktree is simply left alone. Must never
3500
+ * reject in a way the caller can't safely ignore; `sessions.ts` treats any
3501
+ * rejection as "couldn't reclaim this time, leave it for a manual or
3502
+ * scheduled `gc` sweep" and logs rather than lets it interrupt session
3503
+ * teardown. Absent on a bare runtime — auto-reclaim is simply skipped, and a
3504
+ * caller-explicit worktree request is never routed through this port at all
3505
+ * (see `WorktreeDecision.provision.implicit`).
3506
+ */
3507
+ type WorktreeAutoReclaimer = (worktreePath: string) => Promise<void>;
3438
3508
  /** The pure decision's three outcomes. `spawn-in-place` may carry a `warn`:
3439
3509
  * a non-fatal notice the caller should surface (the child is about to run in
3440
3510
  * a shared, dirty checkout it doesn't own). A `warn` never blocks the spawn —
3441
3511
  * it's the loud-but-legitimate middle ground between silently spawning into a
3442
- * shared tree and hard-rejecting an in-place spawn that's normal at depth. */
3512
+ * shared tree and hard-rejecting an in-place spawn that's normal at depth.
3513
+ * `provision.implicit` is `true` exactly when the caller made no explicit
3514
+ * `worktree` request and the `"always"` policy provisioned one anyway (the
3515
+ * worktree the caller never asked to keep) — `false` whenever the request
3516
+ * came from the caller itself (`on-request`'s only path here, or `"always"`
3517
+ * with an explicit field). This is the signal `session-spawn.ts` threads
3518
+ * onto the session descriptor so exit-time auto-reclaim (`sessions.ts`)
3519
+ * only ever touches a worktree the daemon minted on its own — a worktree a
3520
+ * caller explicitly asked to keep is never auto-removed. */
3443
3521
  type WorktreeDecision = {
3444
3522
  action: "spawn-in-place";
3445
3523
  warn?: string;
3446
3524
  } | {
3447
3525
  action: "provision";
3448
3526
  request: WorktreeRequest;
3527
+ implicit: boolean;
3449
3528
  } | {
3450
3529
  action: "reject";
3451
3530
  message: string;
@@ -3571,17 +3650,21 @@ declare function toWorktreeStatusView(entry: unknown): WorktreeStatusView;
3571
3650
  * Repo-root resolution is shared with the status surface via
3572
3651
  * `resolveWorktreeQueryRoot` in `worktree-status.ts`.
3573
3652
  */
3653
+
3574
3654
  /** `gc`'s three classes, mirrored runtime-local (matches `GcClass`). */
3575
3655
  type WorktreeGcClass = "reclaim" | "salvage" | "hold";
3576
3656
  /**
3577
- * `gc`'s one reclaim reason, mirrored runtime-local (matches `GcReclaimReason`).
3578
- * Set only on a `reclaim`-class entry/outcome that was promoted out of `hold`
3579
- * by the dep-bump exemption (`resolveGcClass` in `@agentproto/worktree`) —
3580
- * absent for an ordinary merged/fresh reclaim, so its presence alone is the
3581
- * "why does this line have unpushed commits and still leave" signal a human
3582
- * reading the plan/outcome table needs.
3657
+ * `gc`'s reclaim reasons, mirrored runtime-local (matches `GcReclaimReason`).
3658
+ * `dep-bump` is set on a `reclaim`-class entry/outcome that was promoted out
3659
+ * of `hold` by the dep-bump exemption (`resolveGcClass` in
3660
+ * `@agentproto/worktree`) — absent for an ordinary merged/fresh reclaim, so
3661
+ * its presence alone is the "why does this line have unpushed commits and
3662
+ * still leave" signal a human reading the plan/outcome table needs.
3663
+ * `orphan` is set on an entry/outcome the orphan scan found — a directory
3664
+ * physically present under the repo's worktree pool with no `git worktree
3665
+ * list` entry at all (see `WorktreeGcPlanEntryView.orphan`).
3583
3666
  */
3584
- type WorktreeGcReclaimReason = "dep-bump";
3667
+ type WorktreeGcReclaimReason = "dep-bump" | "orphan";
3585
3668
  /**
3586
3669
  * One entry of the dry-run plan — a runtime-local projection of a
3587
3670
  * `GcPlanEntry`. `tree` / `integration` / `liveness` are flattened to their
@@ -3593,8 +3676,17 @@ interface WorktreeGcPlanEntryView {
3593
3676
  branch: string | null;
3594
3677
  head: string;
3595
3678
  class: WorktreeGcClass;
3596
- /** Set only when `class === "reclaim"` via the dep-bump exemption. */
3679
+ /** Set only when `class === "reclaim"` via the dep-bump exemption or the orphan scan. */
3597
3680
  reclaimReason?: WorktreeGcReclaimReason;
3681
+ /**
3682
+ * `true` only for an orphan-scan entry: a directory physically present
3683
+ * under the repo's worktree pool with no `git worktree list` entry at all
3684
+ * (even after a prune). `tree`/`integration`/`liveness` carry no real axis
3685
+ * read for these — git itself can't answer those questions for a
3686
+ * directory it no longer recognizes as a worktree — so they're set to the
3687
+ * literal `"orphan"` placeholder below rather than a fabricated value.
3688
+ */
3689
+ orphan?: boolean;
3598
3690
  tree: string;
3599
3691
  integration: {
3600
3692
  state: string;
@@ -3646,6 +3738,17 @@ interface WorktreeGcRunInput {
3646
3738
  apply: boolean;
3647
3739
  salvageDirty: boolean;
3648
3740
  includeDetached: boolean;
3741
+ /**
3742
+ * Absolute cwds of every live session the daemon knows about right now —
3743
+ * see `livingSessionCwds` below. Threaded straight to the gc engine's own
3744
+ * `protectedPaths` (`@agentproto/worktree`'s `PlanGcInput`/`ApplyGcOptions`):
3745
+ * a worktree that IS or CONTAINS one of these paths is held, never
3746
+ * reclaimed/salvaged, regardless of what `classify`'s own (snapshot-based)
3747
+ * liveness axis concludes. Optional — a host that can't cheaply enumerate
3748
+ * its own live sessions (or has none, e.g. the bare CLI `worktree gc`
3749
+ * command) omits it and gets exactly today's behavior.
3750
+ */
3751
+ protectedPaths?: string[];
3649
3752
  }
3650
3753
  /**
3651
3754
  * Injected port: the runtime asks the host to plan (and, when `apply`, execute)
@@ -4219,6 +4322,22 @@ interface AgentStreamEvent {
4219
4322
  /** "permission-resolved" chosen option id, when the driver's offered
4220
4323
  * options included one (e.g. ACP's `allow_always`). */
4221
4324
  optionId?: string;
4325
+ /** "available-commands" full command list — see @agentproto/acp's
4326
+ * `StreamEvent`'s `available-commands` kind. REPLACES any previously
4327
+ * reported list wholesale; it is not a delta. */
4328
+ commands?: Array<{
4329
+ name: string;
4330
+ description?: string;
4331
+ input?: {
4332
+ hint?: string;
4333
+ } | null;
4334
+ _meta?: {
4335
+ scope?: string;
4336
+ path?: string;
4337
+ bareName?: string;
4338
+ qualifiedName?: string;
4339
+ };
4340
+ }>;
4222
4341
  }
4223
4342
  /**
4224
4343
  * Env vars the registry injects into every process it spawns on a session's
@@ -4329,8 +4448,29 @@ interface QueuedPrompt {
4329
4448
  /** ISO 8601 timestamp this item was queued. */
4330
4449
  queuedAt: string;
4331
4450
  /** Same as `enqueuePrompt`'s `opts.source` — carried through to the
4332
- * turn this item eventually becomes. */
4451
+ * turn this item eventually becomes (transcript provenance). */
4333
4452
  source?: string;
4453
+ /** Who/what queued this, for the AFTER-THE-FACT queue UI — DISTINCT
4454
+ * from `source` (transcript provenance). Set from `enqueuePrompt`'s
4455
+ * `opts.origin` at the enqueue site so a human session-operator, an
4456
+ * agent session (`agent_prompt`), and a child's report (`message_parent`)
4457
+ * are cleanly separable when someone inspects the queue later across a
4458
+ * daemon restart. Absent for legacy queued items — `promptOriginLabel`
4459
+ * falls back to `source`, then `"user"`. */
4460
+ origin?: string;
4461
+ }
4462
+ /** One entry in the after-the-fact queue listing (`listQueuedPrompts` /
4463
+ * `session_queue_list` / `GET /sessions/:id/queue`). `position` is the
4464
+ * array index (0 = next to dispatch). */
4465
+ interface QueuedPromptView {
4466
+ id: string;
4467
+ /** Human-readable origin — who queued this ("user", "agent <id>", "child <id>"). */
4468
+ origin: string;
4469
+ /** Short single-line text preview of the message. */
4470
+ preview: string;
4471
+ /** ISO 8601 timestamp the item was queued. */
4472
+ queuedAt: string;
4473
+ position: number;
4334
4474
  }
4335
4475
  interface SessionDescriptor {
4336
4476
  id: string;
@@ -4438,6 +4578,14 @@ interface SessionDescriptor {
4438
4578
  * busy descendants. NOTE: in-process subagents a harness runs itself are
4439
4579
  * invisible to the daemon between turns, so they don't count here. */
4440
4580
  childrenBusy?: number;
4581
+ /** Count of prompts currently sitting in this session's
4582
+ * {@link promptQueue} — a cheap, always-present badge signal for
4583
+ * list/table/panel rendering ("N queued"), derived at read time from
4584
+ * the live queue. Ephemeral, never persisted (the queue itself is).
4585
+ * 0/absent ⇒ nothing waiting. The full per-item detail (origin,
4586
+ * preview, queuedAt, position) lives behind the `session_queue_list`
4587
+ * verb / `GET /sessions/:id/queue` — this is just the scalar badge. */
4588
+ queuedPrompts?: number;
4441
4589
  /** Short human-readable string describing the most recent automatic
4442
4590
  * failure — currently only stamped by `markCrashed` (e.g. "adapter
4443
4591
  * process gone (pid 1234) — session crashed"). Not a stack trace or raw
@@ -4497,6 +4645,24 @@ interface SessionDescriptor {
4497
4645
  * the moment a LATER turn completes without one (same reset shape as
4498
4646
  * `resumeAttempts`/`restartAttempts`). Detection + signal only. */
4499
4647
  lastTurnErroredAt?: string;
4648
+ /** True when the LAST completed turn produced zero assistant output and
4649
+ * zero tool calls (mirrors `SessionTurnEndEvent.empty` — see that
4650
+ * field's doc). Persisted so `monitorSessionWait`'s synchronous
4651
+ * already-in-target-state fast-path (which has only the descriptor to
4652
+ * read, not the triggering bus event) can surface the same "green
4653
+ * turn-end but nothing actually happened" signal the bus/ring branches
4654
+ * get from the event itself. Stamped every `turnCompleted` turn end
4655
+ * (absent, not `false`, on a productive turn) — never set by the
4656
+ * abnormal (error/abort) turn-end path, matching the bus event. */
4657
+ lastTurnEmpty?: boolean;
4658
+ /** The LAST completed turn's `SessionTurnEndEvent.reason` (e.g.
4659
+ * `"completed"`, `"error"`, `"aborted"`), when the adapter/daemon
4660
+ * reported one. Twin of `lastTurnEmpty` — same reason for existing:
4661
+ * the sync fast-path branch of `monitorSessionWait` has no event
4662
+ * object to read `.reason` off, only this descriptor. Stamped at every
4663
+ * turn end (normal or abnormal); absent when the turn ended with no
4664
+ * reason to report. */
4665
+ lastTurnReason?: string;
4500
4666
  /** DERIVED, read-time only (never persisted — stripped by `snapshotRows`,
4501
4667
  * stamped by `stampInterrupted` in list()/get()/findByIdOrName). True when
4502
4668
  * this session died with a turn in flight under a daemon restart —
@@ -4668,6 +4834,42 @@ interface SessionDescriptor {
4668
4834
  * `worktreePath` without an id identifies a PATH, which a later worktree
4669
4835
  * may reuse; the pair identifies one specific worktree. */
4670
4836
  worktreeId?: string;
4837
+ /** `true` only when `worktreePath` was provisioned by the `worktrees.isolation`
4838
+ * policy WITHOUT an explicit `worktree` request from the caller (see
4839
+ * `decideWorktreeIsolation`'s `WorktreeDecision.provision.implicit` in
4840
+ * `worktree-isolation.ts`) — a worktree the caller never asked to keep.
4841
+ * Gates exit-time auto-reclaim (`emitExited` below, via the injected
4842
+ * `WorktreeAutoReclaimer` port): only an implicit worktree is ever a
4843
+ * candidate for automatic removal on session exit. Absent (never `true`)
4844
+ * for a worktree the caller explicitly requested (`worktree: {...}` on
4845
+ * the spawn), which keeps today's manual-cleanup-only behavior unchanged,
4846
+ * and absent for every session persisted before this field existed. */
4847
+ worktreeAutoProvisioned?: boolean;
4848
+ /** Absolute path of the AGENTS.md the daemon resolved for this session's
4849
+ * spawn `cwd` (walking up, bounded by the repo's git toplevel — see
4850
+ * `agents-md.ts`), whose content or pointer was injected into the initial
4851
+ * prompt. Absent when `agentsMdMode` is `"absent"` and for a session
4852
+ * persisted before this field existed. */
4853
+ agentsMd?: string;
4854
+ /** How the resolved AGENTS.md was injected at spawn: `"inline"` (full
4855
+ * content), `"pointer"` (read-it-first instruction), or `"absent"` (the
4856
+ * walk found none — a real, reported state, a consumer distinguishes it
4857
+ * from the field being missing in an old descriptor shape by checking
4858
+ * `=== "absent"`). The daemon's spawn path (`session-spawn.ts`) ALWAYS
4859
+ * stamps this once resolution ran — it is optional on the type only so
4860
+ * legacy persisted descriptors (pre-WP-R2) and non-AGENTS.md-aware
4861
+ * constructor paths don't have to fabricate a value; a freshly-spawned
4862
+ * session always carries it. */
4863
+ agentsMdMode?: AgentsMdMode;
4864
+ /** Absolute path of the per-workspace `RULES.md` the daemon resolved for
4865
+ * this session's spawn workspace (see `workspace-rules.ts`) — read from
4866
+ * the workspace's state bucket (`~/.agentproto/workspaces/<slug>/
4867
+ * RULES.md`) and injected into the initial prompt of EVERY spawn in the
4868
+ * workspace (root and nested, no depth gate). Present only when a rules
4869
+ * file was actually found and injected; `undefined` means absent (there
4870
+ * is no separate inline/pointer/absent tri-state — the field itself being
4871
+ * undefined already means absent). */
4872
+ rulesMd?: string;
4671
4873
  /** Pull requests opened while this session was acting on a code host.
4672
4874
  *
4673
4875
  * This is deliberately session provenance rather than workspace state: a
@@ -4736,6 +4938,24 @@ interface SessionDescriptor {
4736
4938
  mode?: string;
4737
4939
  /** The model the session was requested to run (echoed back at spawn). */
4738
4940
  model?: string;
4941
+ /**
4942
+ * The model believed to be ACTIVE right now, when it may differ from
4943
+ * `model` above (the requested/spawn-time value). Populated by a
4944
+ * successful live `setModel` (mirrors `model` — the switch went through
4945
+ * this daemon, so both facts agree) or, more importantly, by picking a
4946
+ * model-switch acknowledgement out of an ORDINARY prompt turn whose text
4947
+ * opened with `/model <id>` (`@agentproto/driver-agent-cli`'s
4948
+ * `isModelSwitchAcknowledgement`/`parseModelSwitchCommand` —
4949
+ * `applyModelCommand`'s dedicated control turn never runs for that case,
4950
+ * since the switch never went through `agent_set_model`).
4951
+ *
4952
+ * That second source is REPORTED BY THE ADAPTER'S OWN REPLY TEXT, NOT
4953
+ * INDEPENDENTLY VERIFIED — a deliberately lax match good enough as a
4954
+ * display hint for a UI chip, NEVER a source of billing/cost truth. Never
4955
+ * overwrites `model`: losing the spawn-time request would lose the very
4956
+ * thing that lets a client show the two facts diverging.
4957
+ */
4958
+ activeModel?: string;
4739
4959
  /** Reasoning / compute budget the session resolved to (SPEC §3.1 axis 2).
4740
4960
  * A LIVE-switchable axis; echoed here so the effort chip re-opens on it. */
4741
4961
  effort?: EffortLevel;
@@ -4790,6 +5010,24 @@ interface SessionDescriptor {
4790
5010
  * `"no-pricing"` (tokens present but the model isn't in the catalog — cost
4791
5011
  * deliberately left undefined), or `"none"`. Stamped at each turn-end. */
4792
5012
  usageSource?: UsageSource;
5013
+ /** Latest known `available_commands_update` payload (see @agentproto/acp's
5014
+ * `StreamEvent`'s `available-commands` kind) — the slash-commands/skills
5015
+ * the agent currently supports. Each notification REPLACES the previous
5016
+ * list wholesale, so this always mirrors the most recent one, not a
5017
+ * merge across notifications. */
5018
+ availableCommands?: Array<{
5019
+ name: string;
5020
+ description?: string;
5021
+ input?: {
5022
+ hint?: string;
5023
+ } | null;
5024
+ _meta?: {
5025
+ scope?: string;
5026
+ path?: string;
5027
+ bareName?: string;
5028
+ qualifiedName?: string;
5029
+ };
5030
+ }>;
4793
5031
  /** ACP-level session id (the adapter's own handle — claude-code's
4794
5032
  * conversation id, hermes' chat id, …). Set at spawnAgent time
4795
5033
  * from `agentSession.sessionId`. Survives across daemon restarts
@@ -4826,6 +5064,19 @@ interface SessionDescriptor {
4826
5064
  * Keys are adapter-specific so future adapters can add their own
4827
5065
  * ("hermesResumeId", etc.) without changing this type. */
4828
5066
  resumeMetadata?: Record<string, string>;
5067
+ /** Extra env this PTY (`kind: "terminal"`) session was spawned with, on
5068
+ * top of `process.env` — e.g. `{ CLAUDE_CONFIG_DIR: "..." }` for a
5069
+ * `pty-native` restart of a claude-code session (see
5070
+ * `ResumeStrategy.configDirEnvVar`, resume-strategies.ts). Once a
5071
+ * restart lands on a bare PTY row, `adapterSlug`/`adapterConfigDir` are
5072
+ * gone (undefined for pty/command kinds, by design — see those fields'
5073
+ * docs), so this is the ONLY way a LATER `pty-plain` restart-of-a-
5074
+ * restart can still know what env the provider's native resume needs —
5075
+ * `session_restart`'s pty-plain branch replays it verbatim, the same way
5076
+ * it already replays `argv`. Absent when the PTY was spawned with no
5077
+ * extra env (a plain `agentproto sessions terminal`, or a `pty-plain`
5078
+ * restart of one). */
5079
+ ptyResumeEnv?: Record<string, string>;
4829
5080
  /** Set by the orchestration layer when the agent emits an
4830
5081
  * "awaiting-input" turn-end. Cleared on the next turn start.
4831
5082
  * Used by `session_monitor` to fast-return without subscribing. */
@@ -5071,6 +5322,8 @@ interface SessionSummary {
5071
5322
  /** Busy-descendant count (#session-visibility, subtree rollup) — see
5072
5323
  * `SessionDescriptor.childrenBusy`. Drives the "delegating" row state. */
5073
5324
  childrenBusy?: number;
5325
+ /** Prompt-queue badge count — see `SessionDescriptor.queuedPrompts`. */
5326
+ queuedPrompts?: number;
5074
5327
  label?: string;
5075
5328
  title?: string;
5076
5329
  renamedByUser?: boolean;
@@ -5084,6 +5337,12 @@ interface SessionSummary {
5084
5337
  cwd?: string;
5085
5338
  worktreePath?: string;
5086
5339
  worktreeId?: string;
5340
+ /** Resolved AGENTS.md path — see `SessionDescriptor.agentsMd`. */
5341
+ agentsMd?: string;
5342
+ /** Injection mode — see `SessionDescriptor.agentsMdMode`. */
5343
+ agentsMdMode?: AgentsMdMode;
5344
+ /** Resolved workspace RULES.md path — see `SessionDescriptor.rulesMd`. */
5345
+ rulesMd?: string;
5087
5346
  adapterSlug?: string;
5088
5347
  mode?: string;
5089
5348
  model?: string;
@@ -5382,6 +5641,7 @@ interface SessionsRegistry {
5382
5641
  sendPrompt(id: string, message: unknown, opts?: {
5383
5642
  interrupt?: boolean;
5384
5643
  source?: string;
5644
+ system?: string;
5385
5645
  }): Promise<void>;
5386
5646
  /** Fire-and-forget variant of `sendPrompt` for the TURN ITSELF only.
5387
5647
  * Admission (resume attempt + the missing/wrong-kind/dead/busy
@@ -5425,6 +5685,11 @@ interface SessionsRegistry {
5425
5685
  enqueuePrompt(id: string, message: unknown, opts?: {
5426
5686
  interrupt?: boolean;
5427
5687
  source?: string;
5688
+ /** Display origin for the after-the-fact queue UI ("user" for a
5689
+ * human operator, agent/child when another session injected this).
5690
+ * Sets `QueuedPrompt.origin` — see that field; does NOT influence
5691
+ * transcript provenance (`source` does that). */
5692
+ origin?: string;
5428
5693
  queue?: boolean;
5429
5694
  force?: boolean;
5430
5695
  queueId?: string;
@@ -5438,6 +5703,43 @@ interface SessionsRegistry {
5438
5703
  removeQueuedPrompt(id: string, queueId: string): {
5439
5704
  removed: boolean;
5440
5705
  };
5706
+ /** Snapshot a session's prompt queue for inspection — the after-the-fact
5707
+ * view of what's sitting in `SessionDescriptor.promptQueue` right now.
5708
+ * Runs the shared preview + origin-label derivation so every consumer
5709
+ * (the `session_queue_list` MCP tool, `GET /sessions/:id/queue`, the CLI,
5710
+ * the VS Code panel) sees identical text. `position` is the array index
5711
+ * (0 = next to dispatch), not stored — derived per call. Returns `null`
5712
+ * when the session is unknown (the caller surfaces 404). */
5713
+ listQueuedPrompts(id: string): QueuedPromptView[] | null;
5714
+ /** Reorder-only force: move an already-queued item to the FRONT of the
5715
+ * queue (position 0) WITHOUT touching any turn currently in flight — it
5716
+ * becomes next-to-dispatch once the current turn (if any) ends. The
5717
+ * queue-reordering counterpart to `deliverQueuedPrompt`'s interrupt-and-
5718
+ * dispatch; the two are deliberately distinct operations. Returns
5719
+ * position after promotion (0 when promoted, -1 when the item/session
5720
+ * isn't found). Never mutates the array in place (the webview diff rules
5721
+ * on `!==` per field). */
5722
+ promoteQueuedPrompt(id: string, queueId: string): {
5723
+ promoted: boolean;
5724
+ position: number;
5725
+ };
5726
+ /** Deliver-now: interrupt whatever's mid-flight (same effect + shared
5727
+ * helper as `enqueuePrompt`'s `interrupt` arm) and immediately dispatch
5728
+ * THIS specific queued item as the new turn, removing it from the queue.
5729
+ * The "I need this NOW" op — distinct from `promoteQueuedPrompt` (which
5730
+ * only reorders; deliver-now cannot wait for the current turn to end).
5731
+ *
5732
+ * Implemented as promote-to-front + interrupt: the cancelled turn's
5733
+ * own `dispatchQueuedPrompt` (in its finally) then drains the promoted
5734
+ * item into a fresh turn. On an idle session (nothing to interrupt) the
5735
+ * promoted item is dispatched directly. Returns:
5736
+ * `{ delivered: false, reason }` — `"no-session"` / `"not-in-queue"`;
5737
+ * `{ delivered: true, interrupted: boolean }` otherwise. */
5738
+ deliverQueuedPrompt(id: string, queueId: string): Promise<{
5739
+ delivered: boolean;
5740
+ reason?: string;
5741
+ interrupted?: boolean;
5742
+ }>;
5441
5743
  /** Eagerly resume ONE dead-but-resumable agent-cli session IN PLACE,
5442
5744
  * WITHOUT a prompt — the boot-time counterpart to the lazy resume that
5443
5745
  * `sendPrompt`/`enqueuePrompt` trigger on the first prompt after a restart
@@ -5943,6 +6245,15 @@ interface SpawnAgentInput {
5943
6245
  * runs in the background, projecting events into the ring
5944
6246
  * buffer. Skip to spawn idle. */
5945
6247
  initialPrompt?: string;
6248
+ /** The daemon-composed SYSTEM slice of {@link initialPrompt} — the part
6249
+ * it synthesized ahead of the CALLER's ask (role disposition, lineage
6250
+ * line, AGENTS.md, posture preamble). The adapter still receives the
6251
+ * single concatenated `initialPrompt` unchanged; this metadata lets the
6252
+ * daemon's OWN event stream record that slice as a `system-prompt` turn
6253
+ * (ahead of the `user-prompt`) so UIs can fold it instead of rendering
6254
+ * it as a user bubble. Absent ⇒ the whole `initialPrompt` is treated as
6255
+ * user text (no synthesized preamble, e.g. a human reprompt). */
6256
+ initialPromptSystem?: string;
5946
6257
  label?: string;
5947
6258
  /** Title to stamp on the descriptor up-front, BEFORE the `initialPrompt`
5948
6259
  * turn runs. Set by the spawn path from the CALLER's ask (`input.prompt`),
@@ -6054,6 +6365,10 @@ interface SpawnAgentInput {
6054
6365
  * idle-reaper.ts) regardless of how long it sits idle — stamped straight
6055
6366
  * onto `SessionDescriptor.keepAlive`. Default false. */
6056
6367
  keepAlive?: boolean;
6368
+ /** Recorded verbatim onto {@link SessionDescriptor.worktreeAutoProvisioned}
6369
+ * — see that field's doc. Set by `session-spawn.ts` from
6370
+ * `WorktreeDecision.provision.implicit`. Default false. */
6371
+ worktreeAutoProvisioned?: boolean;
6057
6372
  }
6058
6373
  /** `SpawnAgentInput` minus the fields that only exist once the driver's
6059
6374
  * `startSession` has actually run — see `spawnAgentPending`'s doc for why
@@ -6078,6 +6393,10 @@ type PendingAgentOutcome = {
6078
6393
  /** Dispatched now that the tree + driver session both exist — never
6079
6394
  * passed to `spawnAgentPending`, which would race the tree. */
6080
6395
  initialPrompt?: string;
6396
+ /** The daemon-composed SYSTEM slice of `initialPrompt` (see
6397
+ * `SpawnAgentInput.initialPromptSystem`) — threaded through the
6398
+ * placeholder so the deferred dispatch records it as a system turn. */
6399
+ initialPromptSystem?: string;
6081
6400
  } | {
6082
6401
  ok: false;
6083
6402
  /** Short, readable — stamped verbatim onto `SessionDescriptor.lastError`. */
@@ -6120,6 +6439,17 @@ interface SpawnPtyInput {
6120
6439
  * the factory layer (node-pty.spawn options); don't try to clear
6121
6440
  * them here. */
6122
6441
  env?: Record<string, string>;
6442
+ /** Env vars to strip from the inherited `process.env` before spawning —
6443
+ * same scrub semantics as `ResolvedAuthSpec.unsetEnv` (define-agent-cli.ts's
6444
+ * driver applies this by deleting from its own composed env; `spawnPty` has
6445
+ * no such composition step of its own, so `session_restart`'s pty-native
6446
+ * branch passes it here). Without this, a PTY resume that re-resolves the
6447
+ * session's own billing auth still leaks whatever conflicting credential
6448
+ * (e.g. an ambient `ANTHROPIC_API_KEY`) happens to be in the daemon's own
6449
+ * `process.env` — `env` alone can only ADD/override keys, never remove
6450
+ * one inherited from process.env. Applied AFTER `env` overrides so an
6451
+ * explicit override always wins over a scrub of the same key. */
6452
+ unsetEnv?: string[];
6123
6453
  /** User-friendly slug. Used by `findByIdOrName(query)`. Must not
6124
6454
  * collide with an existing session's name. */
6125
6455
  name?: string;
@@ -6856,6 +7186,11 @@ interface CatalogProviderModel {
6856
7186
  /** Per-1M-token pricing for LLM models; `null` for the media kinds, whose
6857
7187
  * pricing is per-image/second/character rather than per token. */
6858
7188
  pricing: CatalogProviderPricing | null;
7189
+ /** ISO date (`YYYY-MM-DD`) this model first appeared in the catalog, when
7190
+ * known — see `LLMPricing.addedAt` (`model-catalog/src/llm/catalog.ts`)
7191
+ * for the convention. `null` for media kinds and for LLM entries the sync
7192
+ * never stamped (hand-maintained rows). Lets a picker show a "new" badge. */
7193
+ addedAt: string | null;
6859
7194
  }
6860
7195
  interface CatalogProviderModelsResponse {
6861
7196
  /** The provider key that was enumerated (echoed back, trimmed). */
@@ -8234,6 +8569,19 @@ interface SessionWaitResult {
8234
8569
  * dropped work that was NOT re-run — the in-place resume never auto-retries.
8235
8570
  * Absent (not `false`) when the session was not interrupted. */
8236
8571
  interrupted?: boolean;
8572
+ /** True when the matched turn-end produced ZERO assistant output and
8573
+ * zero tool calls — a silent no-op (see `SessionTurnEndEvent.empty`'s
8574
+ * doc). Surfaced on `event: "turn-end"` matches across all three
8575
+ * branches (ring-replay, sync fast-path via
8576
+ * `SessionDescriptor.lastTurnEmpty`, bus long-poll) so a caller doesn't
8577
+ * mistake a green turn-end for real progress. Absent (not `false`) on a
8578
+ * normal, productive turn. */
8579
+ empty?: boolean;
8580
+ /** The matched turn-end's `SessionTurnEndEvent.reason` (e.g.
8581
+ * `"completed"`, `"error"`, `"aborted"`), when the adapter/daemon
8582
+ * reported one. `"error"` means the adapter reported a failed turn.
8583
+ * Same three-branch coverage as `empty`. */
8584
+ reason?: string;
8237
8585
  }
8238
8586
  /**
8239
8587
  * Block until one of the listed sessions fires a matching lifecycle event
@@ -8248,6 +8596,15 @@ interface SessionWaitResult {
8248
8596
  * `since` is an EventRing cursor: when provided, already-emitted matching
8249
8597
  * events for the watched sessions that occurred after that cursor are
8250
8598
  * returned immediately (race-free replay) before subscribing to the bus.
8599
+ *
8600
+ * The synchronous already-in-target-state check for `turn-end` ALSO
8601
+ * requires `since` to be present (even `since: 0`) — `turnsCompleted > 0`
8602
+ * never resets, so without a cursor to anchor "since when", it can't tell
8603
+ * a turn this call should wait for apart from any turn the session ever
8604
+ * completed, including ones from long before this call started. A
8605
+ * `since`-less `turn-end` wait (e.g. a fresh `agentproto sessions wait`
8606
+ * process, which has no persisted cursor) always falls through to the real
8607
+ * bus-subscribe long-poll instead.
8251
8608
  */
8252
8609
  declare function monitorSessionWait(opts: {
8253
8610
  registry: SessionsRegistry;
@@ -8574,6 +8931,17 @@ interface CreateGatewayOptions {
8574
8931
  * `worktree_gc` returns a clear "not enabled" error.
8575
8932
  */
8576
8933
  runWorktreeGc?: WorktreeGcRunner;
8934
+ /**
8935
+ * Optional best-effort exit-time reclaim of ONE policy-provisioned
8936
+ * (implicit) session's own worktree — powers `SessionDescriptor.
8937
+ * worktreeAutoProvisioned` (see that field's doc in `sessions.ts`).
8938
+ * Injected for the same reason as `runWorktreeGc`: the classify/remove
8939
+ * logic runs over `@agentproto/worktree`, a dependency the runtime
8940
+ * deliberately does NOT take. The CLI wires it (over `reclaimOneWorktree`).
8941
+ * Omitted → exit-time auto-reclaim is simply skipped; an implicit
8942
+ * worktree is still reclaimable manually or via a scheduled `gc` sweep.
8943
+ */
8944
+ runWorktreeAutoReclaim?: WorktreeAutoReclaimer;
8577
8945
  /**
8578
8946
  * Optional resolver: given a session's cwd, return the OPEN PR for that
8579
8947
  * cwd's git branch (or null). Powers the daemon PR-provenance reconciler,
@@ -8669,4 +9037,4 @@ interface GatewayHandle {
8669
9037
  */
8670
9038
  declare function createGateway(opts: CreateGatewayOptions): Promise<GatewayHandle>;
8671
9039
 
8672
- export { type ActivityKind, type ActivityListFilter, type ActivityPolicyLister, type ActivityProjector, type ActivityProjectorRegistry, type ActivityProjectorSession, type ActivityRecord, type ActivitySource, type ActivityState, type ActivityWaitingOn, type ActivityWorkflowLister, AdapterAuthDescriptor, type AdapterCapabilitiesLister, type AdapterInstallResult, type AdapterListEntry, type AgentAdapterInstaller, type AgentAdapterLister, type AgentAdapterResolver, type AgentSessionLike, type AgentStreamEvent, type AnthropicReaderConfig, AnthropicRemainingQuotaReader, type AttachPolicyInput, type AttachSandboxOpts, type AttachSandboxResult, AuthMethod, BUCKETS_ROOT, type BrowserAdapterHandle, type BrowserAdapterInfo, type BrowserAdapterLister, type BrowserAdapterResolver, BuildHeartbeatAgent, CanonicalPosture, type CatalogModelsLister, CatalogModelsQuery, CatalogModelsResponse, type CatalogProviderModel, type CatalogProviderModelsQuery, type CatalogProviderModelsResponse, type CatalogProviderPricing, type ClaudeNativeRef, type CommitSpec, type CompletionPolicySupervisor, ContextProfile, type ConversationIndexRecord, type ConversationNativeRef, type CostBudgetDecision, type CrashDetectSummary, type CrashReaperRegistry, type CreateGatewayOptions, type CreateOfferInput, type CreatedOffer, DEFAULT_BUCKET, DEFAULT_ORCHESTRATOR_TOOLS, DEFAULT_WORKTREE_ISOLATION, DeclaredAdapterOption, type DeclaredAdapterPreset, type EagerResumeFailReason, type EagerResumeOutcome, type EagerResumeSkipReason, type EagerResumeSummary, EffortLevel, type GateSpec, type GatewayHandle, type HarnessPreset, type HarnessPresetValidationDeps, HarnessPresetValidationError, type HarnessPresetsFile, type HermesNativeRef, INBOUND_PROVIDERS, type IdleReapSummary, type IdleReaperRegistry, type InboundEndpoint, type InboundEndpointStore, type InboundEndpointStoreOptions, type InboundEnqueuePrompt, type InboundIsSessionAlive, type InboundMessage, type InboundProvider, type InboundRestartSession, type InboundRouteMode, type InboundRouterDeps, type InboundRouterLog, type InboundSpawnForContact, type InboundWatcher, type JudgeGateSpec, LEGACY_SESSIONS_FILE, type LocatedConversation, type LocatedConversationByPath, type McpCredentialDeps, type MigrationMarker, type NormalizeInboundResult, type OnFailSpec, type OpenPrResolver, type OrchestratorGatewayDeps, type OrchestratorInjection, type OrchestratorInjector, type OrchestratorInjectorDeps, type OrchestratorMcpServerFactory, type OrchestratorScope, type OrphanReaperRegistry, PAIRINGS_VERSION, POSTURE_NATIVE_ALIASES, POSTURE_PREAMBLES, type PairingChannelContext, type PairingChannelHandle, type PairingChannelMode, type PairingRecord, type PairingRegistry, type PairingRegistryDeps, type PendingPermission, type PermissionRespondInput, type PermissionRespondResult, type PolicyRunState, type PolicyRunStatus, Posture, type PostureResolution, type PrResolvedState, type PrStateResolver, type PresetInfo, type PricingResolver, type QuotaReadableProfile, type QuotaStoreFile, type QuotaStoreOptions, type ReconnectLogGate, type RegisterBrainToolsOptions, type RegisterBrowserInput, type RegisterPairingToolsOptions, type RegisterSessionInput, type RemainingQuota, type RemainingQuotaReader, type ResolveNativeLinkInput, ResolvedAuthSpec, ResumeDisabledError, type RouteAwareLaunchConfig, type RouteAwareLaunchConfigInput, RouteSpec, type RuntimeMeta, SESSION_ID_ENV, type SandboxAdapterInfo, type SandboxConnectionDescriptor, type SandboxProviderCapabilities, type SandboxProviderHandle, type SandboxProviderLister, type SandboxProviderResolver, type ScopeTokenRegistry, SessionConfig, type SessionCurrentPhase, type SessionDescriptor, type SessionKind, type SessionObserver, type SessionSnapshots, type SessionStatus, type SessionUsage, type SessionWaitEvent, type SessionWaitResult, type SessionsRegistry, type ShellGateSpec, type SpawnAgentInput, type SpawnSessionInput, type StallWatchdogRegistry, type StallWatchdogSummary, type StoredProfileQuota, TASK_STATUSES, type TaskCaller, type TaskChangedEvent, type TaskClaimInput, type TaskCreateInput, type TaskGateOutcome, type TaskGateRunner, type TaskLedger, type TaskLedgerRegistry, type TaskLedgerSessionSlice, type TaskListFilter, type TaskRecord, type TaskStatus, type TaskUpdateInput, type TaskVerification, type TaskVerifySupervisor, type TaskWriteResult, type TokenPricing, type TransmitterBinding, type TransmitterBindingStore, type TunnelDescriptor, type TunnelProvider, type TunnelStatus, type UsageBucket, type UsageComputeInput, type UsageRollup, type UsageSnapshotRecord, type UsageSource, WORKSPACE_SLUG_ENV, WORKTREE_ISOLATION_ENV, type WatcherDescriptor, type WatcherStartInput, type WorkspaceBrainSubscriber, type WorkspaceBrainSubscriberOptions, type WorkspaceBrains, WorkspaceFs, type WorktreeDecision, type WorktreeField, type WorktreeGcClass, type WorktreeGcOutcomeView, type WorktreeGcPlanEntryView, type WorktreeGcReclaimReason, type WorktreeGcResult, type WorktreeGcRunInput, type WorktreeGcRunner, WorktreeIsolationMode, type WorktreeProvisionOutcome, type WorktreeProvisionRequest, type WorktreeProvisioner, type WorktreeRequest, type WorktreeStatusLister, type WorktreeStatusView, activityCounts, addHarnessPreset, appendConversationRecord, attachSandbox, bucketDir, bucketSessionsFile, bucketTranscriptDir, buildCatalogProviderModels, buildMcpConfigSnippet, buildRouteAwareLaunchConfig, canonicalForModeId, claudeProjectSlug, composeSessionObservers, conversationIndexPath, createActivityProjector, createFileStepCache, createGateway, createInboundEndpointStore, createOrchestratorInjector, createOrchestratorMcpServerFactory, createPairingRegistry, createPrProvenanceReconciler, createReconnectLogGate, createScopeTokenRegistry, createSupervisorTaskGateRunner, createTaskLedger, createWorkspaceBrainSubscriber, createWorkspaceBrains, daemonRegistryDir, decideWorktreeIsolation, declaredPresetToProviderPreset, deriveSessionUsage, enrichRollupWithProviderQuota, enrichWithRemainingQuota, evaluateCostBudget, filterActivities, findConversationRecord, findNativeMode, formatToolCall, formatToolResult, getDefaultHarnessPreset, getHarnessPreset, getMcpCredentialDeps, harnessPresetsPath, isAgentCliAuthConfigured, isClosedTaskStatus, isSafeBucketSlug, isTerminalActivityState, listBuckets, listHarnessPresets, listPresets, loadHarnessPresets, loadQuotaStore, loadWorktreeIsolation, locateConversationByNativePath, locateConversationBySessionId, makeBrowserAdapterLister, migrateLegacySessionsFile, migrationMarkerPath, monitorPolicyWait, monitorSessionWait, narrowOrchestratorTools, normalizeInbound, normalizeModeId, normalizeWorktreeField, parseAnthropicRateLimitHeaders, parseTaskStatus, parseWindow, parseWorktreeIsolationMode, policyToActivities, policyWatchesSession, prToActivities, projectSessionUsage, readConversationIndex, readDaemonRegistry, readProfileQuota, readRegisteredSlugs, readRuntimeMeta, readSessionForBrain, readUsageSnapshots, reapOrphanedDescendants, recordProfileQuota, registerBrainTools, registerBuiltinRoutes, registerPairingTools, registerSandboxAttachTool, removeHarnessPreset, resolveBucketSlug, resolveNativeLink, resolvePosture, rollupUsage, runCrashDetectPass, runEagerResumePass, runIdleReapPass, runStallWatchdogPass, setDefaultPreset, setMcpCredentialDeps, sweepStaleDaemonRegistry, sweepStaleRuntimeMetas, toWorktreeStatusView, turnToActivities, unlinkDaemonRegistryEntry, unlinkRuntimeMeta, updateHarnessPreset, verifyInboundSignature, workflowToActivities, writeDaemonRegistryEntry };
9040
+ export { type ActivityKind, type ActivityListFilter, type ActivityPolicyLister, type ActivityProjector, type ActivityProjectorRegistry, type ActivityProjectorSession, type ActivityRecord, type ActivitySource, type ActivityState, type ActivityWaitingOn, type ActivityWorkflowLister, AdapterAuthDescriptor, type AdapterCapabilitiesLister, type AdapterInstallResult, type AdapterListEntry, type AgentAdapterInstaller, type AgentAdapterLister, type AgentAdapterResolver, type AgentSessionLike, type AgentStreamEvent, type AnthropicReaderConfig, AnthropicRemainingQuotaReader, type AttachPolicyInput, type AttachSandboxOpts, type AttachSandboxResult, AuthMethod, BUCKETS_ROOT, type BrowserAdapterHandle, type BrowserAdapterInfo, type BrowserAdapterLister, type BrowserAdapterResolver, BuildHeartbeatAgent, CanonicalPosture, type CatalogModelsLister, CatalogModelsQuery, CatalogModelsResponse, type CatalogProviderModel, type CatalogProviderModelsQuery, type CatalogProviderModelsResponse, type CatalogProviderPricing, type ClaudeNativeRef, type CommitSpec, type CompletionPolicySupervisor, ContextProfile, type ConversationIndexRecord, type ConversationNativeRef, type CostBudgetDecision, type CrashDetectSummary, type CrashReaperRegistry, type CreateGatewayOptions, type CreateOfferInput, type CreatedOffer, DEFAULT_BUCKET, DEFAULT_ORCHESTRATOR_TOOLS, DEFAULT_WORKTREE_ISOLATION, DeclaredAdapterOption, type DeclaredAdapterPreset, type EagerResumeFailReason, type EagerResumeOutcome, type EagerResumeSkipReason, type EagerResumeSummary, EffortLevel, type GateSpec, type GatewayHandle, type HarnessPreset, type HarnessPresetValidationDeps, HarnessPresetValidationError, type HarnessPresetsFile, type HermesNativeRef, INBOUND_PROVIDERS, type IdleReapSummary, type IdleReaperRegistry, type InboundEndpoint, type InboundEndpointStore, type InboundEndpointStoreOptions, type InboundEnqueuePrompt, type InboundIsSessionAlive, type InboundMessage, type InboundProvider, type InboundRestartSession, type InboundRouteMode, type InboundRouterDeps, type InboundRouterLog, type InboundSpawnForContact, type InboundWatcher, type JudgeGateSpec, LEGACY_SESSIONS_FILE, type LocatedConversation, type LocatedConversationByPath, type McpCredentialDeps, type MigrationMarker, type NormalizeInboundResult, type OnFailSpec, type OpenPrResolver, type OrchestratorGatewayDeps, type OrchestratorInjection, type OrchestratorInjector, type OrchestratorInjectorDeps, type OrchestratorMcpServerFactory, type OrchestratorScope, type OrphanReaperRegistry, PAIRINGS_VERSION, POSTURE_NATIVE_ALIASES, POSTURE_PREAMBLES, type PairingChannelContext, type PairingChannelHandle, type PairingChannelMode, type PairingRecord, type PairingRegistry, type PairingRegistryDeps, type PendingPermission, type PermissionRespondInput, type PermissionRespondResult, type PolicyRunState, type PolicyRunStatus, Posture, type PostureResolution, type PrResolvedState, type PrStateResolver, type PresetInfo, type PricingResolver, type QuotaReadableProfile, type QuotaStoreFile, type QuotaStoreOptions, type ReconnectLogGate, type RegisterBrainToolsOptions, type RegisterBrowserInput, type RegisterPairingToolsOptions, type RegisterSessionInput, type RemainingQuota, type RemainingQuotaReader, type ResolveNativeLinkInput, ResolvedAuthSpec, ResumeDisabledError, type RouteAwareLaunchConfig, type RouteAwareLaunchConfigInput, RouteSpec, type RuntimeMeta, SESSION_ID_ENV, type SandboxAdapterInfo, type SandboxConnectionDescriptor, type SandboxProviderCapabilities, type SandboxProviderHandle, type SandboxProviderLister, type SandboxProviderResolver, type ScopeTokenRegistry, SessionConfig, type SessionCurrentPhase, type SessionDescriptor, type SessionKind, type SessionObserver, type SessionSnapshots, type SessionStatus, type SessionUsage, type SessionWaitEvent, type SessionWaitResult, type SessionsRegistry, type ShellGateSpec, type SpawnAgentInput, type SpawnSessionInput, type StallWatchdogRegistry, type StallWatchdogSummary, type StoredProfileQuota, TASK_STATUSES, type TaskCaller, type TaskChangedEvent, type TaskClaimInput, type TaskCreateInput, type TaskGateOutcome, type TaskGateRunner, type TaskLedger, type TaskLedgerRegistry, type TaskLedgerSessionSlice, type TaskListFilter, type TaskRecord, type TaskStatus, type TaskUpdateInput, type TaskVerification, type TaskVerifySupervisor, type TaskWriteResult, type TokenPricing, type TransmitterBinding, type TransmitterBindingStore, type TunnelDescriptor, type TunnelProvider, type TunnelStatus, type UsageBucket, type UsageComputeInput, type UsageRollup, type UsageSnapshotRecord, type UsageSource, WORKSPACE_SLUG_ENV, WORKTREE_ISOLATION_ENV, type WatcherDescriptor, type WatcherStartInput, type WorkspaceBrainSubscriber, type WorkspaceBrainSubscriberOptions, type WorkspaceBrains, WorkspaceFs, type WorktreeAutoReclaimer, type WorktreeDecision, type WorktreeField, type WorktreeGcClass, type WorktreeGcOutcomeView, type WorktreeGcPlanEntryView, type WorktreeGcReclaimReason, type WorktreeGcResult, type WorktreeGcRunInput, type WorktreeGcRunner, WorktreeIsolationMode, type WorktreeProvisionOutcome, type WorktreeProvisionRequest, type WorktreeProvisioner, type WorktreeRequest, type WorktreeStatusLister, type WorktreeStatusView, activityCounts, addHarnessPreset, appendConversationRecord, attachSandbox, bucketDir, bucketSessionsFile, bucketTranscriptDir, buildCatalogProviderModels, buildMcpConfigSnippet, buildRouteAwareLaunchConfig, canonicalForModeId, claudeProjectSlug, composeSessionObservers, conversationIndexPath, createActivityProjector, createFileStepCache, createGateway, createInboundEndpointStore, createOrchestratorInjector, createOrchestratorMcpServerFactory, createPairingRegistry, createPrProvenanceReconciler, createReconnectLogGate, createScopeTokenRegistry, createSupervisorTaskGateRunner, createTaskLedger, createWorkspaceBrainSubscriber, createWorkspaceBrains, daemonRegistryDir, decideWorktreeIsolation, declaredPresetToProviderPreset, deriveSessionUsage, enrichRollupWithProviderQuota, enrichWithRemainingQuota, evaluateCostBudget, filterActivities, findConversationRecord, findNativeMode, formatToolCall, formatToolResult, getDefaultHarnessPreset, getHarnessPreset, getMcpCredentialDeps, harnessPresetsPath, isAgentCliAuthConfigured, isClosedTaskStatus, isSafeBucketSlug, isTerminalActivityState, listBuckets, listHarnessPresets, listPresets, loadHarnessPresets, loadQuotaStore, loadWorktreeIsolation, locateConversationByNativePath, locateConversationBySessionId, makeBrowserAdapterLister, migrateLegacySessionsFile, migrationMarkerPath, monitorPolicyWait, monitorSessionWait, narrowOrchestratorTools, normalizeInbound, normalizeModeId, normalizeWorktreeField, parseAnthropicRateLimitHeaders, parseTaskStatus, parseWindow, parseWorktreeIsolationMode, policyToActivities, policyWatchesSession, prToActivities, projectSessionUsage, readConversationIndex, readDaemonRegistry, readProfileQuota, readRegisteredSlugs, readRuntimeMeta, readSessionForBrain, readUsageSnapshots, reapOrphanedDescendants, recordProfileQuota, registerBrainTools, registerBuiltinRoutes, registerPairingTools, registerSandboxAttachTool, removeHarnessPreset, resolveBucketSlug, resolveNativeLink, resolvePosture, rollupUsage, runCrashDetectPass, runEagerResumePass, runIdleReapPass, runStallWatchdogPass, setDefaultPreset, setMcpCredentialDeps, sweepStaleDaemonRegistry, sweepStaleRuntimeMetas, toWorktreeStatusView, turnToActivities, unlinkDaemonRegistryEntry, unlinkRuntimeMeta, updateHarnessPreset, verifyInboundSignature, workflowToActivities, writeDaemonRegistryEntry };