@tangle-network/agent-runtime 0.56.1 → 0.58.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.
Files changed (41) hide show
  1. package/dist/agent.d.ts +1 -1
  2. package/dist/agent.js +1 -1
  3. package/dist/analyst-loop.d.ts +1 -1
  4. package/dist/{chunk-EXIV2C72.js → chunk-E2L6PG5F.js} +59 -79
  5. package/dist/chunk-E2L6PG5F.js.map +1 -0
  6. package/dist/{chunk-G4NIVG34.js → chunk-ISVIQDIX.js} +4 -3
  7. package/dist/chunk-ISVIQDIX.js.map +1 -0
  8. package/dist/{chunk-4H2FML7G.js → chunk-MDFZSPHA.js} +950 -230
  9. package/dist/chunk-MDFZSPHA.js.map +1 -0
  10. package/dist/{chunk-F5XQA43K.js → chunk-VAGARXI5.js} +2 -2
  11. package/dist/{chunk-6XKXWA7H.js → chunk-ZGPQY6Z3.js} +2 -2
  12. package/dist/{coder-COuOK8h8.d.ts → coder-CybltHEm.d.ts} +1 -1
  13. package/dist/{coordination-DWNGqygr.d.ts → coordination-BydGBQCZ.d.ts} +164 -4
  14. package/dist/{delegates-D9o5_VFj.d.ts → delegates-C94qchkz.d.ts} +8 -2
  15. package/dist/index.d.ts +6 -6
  16. package/dist/index.js +4 -4
  17. package/dist/intelligence.d.ts +1 -1
  18. package/dist/{loop-runner-bin-CN2Se3jB.d.ts → loop-runner-bin-Noz7P-mS.d.ts} +3 -3
  19. package/dist/loop-runner-bin.d.ts +4 -4
  20. package/dist/loop-runner-bin.js +3 -3
  21. package/dist/loops.d.ts +7 -6
  22. package/dist/loops.js +31 -1
  23. package/dist/mcp/bin.js +3 -3
  24. package/dist/mcp/index.d.ts +20 -82
  25. package/dist/mcp/index.js +4 -4
  26. package/dist/{openai-tools-CoeLQ7Uo.d.ts → openai-tools-d4GKwgya.d.ts} +1 -1
  27. package/dist/profiles.d.ts +2 -2
  28. package/dist/{run-loop-DluzfJ2h.d.ts → run-loop-CcqfR_gy.d.ts} +1 -1
  29. package/dist/runtime.d.ts +336 -67
  30. package/dist/runtime.js +31 -1
  31. package/dist/{types-C8rNlxfV.d.ts → types-CUzjRFZ3.d.ts} +1 -1
  32. package/dist/workflow.d.ts +2 -2
  33. package/dist/workflow.js +1 -1
  34. package/package.json +2 -2
  35. package/skills/loop-writer/SKILL.md +1 -1
  36. package/skills/supervise/SKILL.md +1 -1
  37. package/dist/chunk-4H2FML7G.js.map +0 -1
  38. package/dist/chunk-EXIV2C72.js.map +0 -1
  39. package/dist/chunk-G4NIVG34.js.map +0 -1
  40. /package/dist/{chunk-F5XQA43K.js.map → chunk-VAGARXI5.js.map} +0 -0
  41. /package/dist/{chunk-6XKXWA7H.js.map → chunk-ZGPQY6Z3.js.map} +0 -0
package/dist/runtime.d.ts CHANGED
@@ -1,21 +1,22 @@
1
1
  import { AgentProfile, BackendType, CreateSandboxOptions, SandboxInstance, SandboxEvent } from '@tangle-network/sandbox';
2
2
  export { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
3
- import { u as ResultBlobStore, v as SpawnJournal, N as NodeId, w as SpawnEvent, T as TreeView, x as Settled, y as AgentSpec, E as ExecutorRegistry, B as Budget, z as Agent, H as RootHandle, K as SupervisedResult, L as Spend, O as Scope, P as ExecutorFactory, U as Executor, V as UsageEvent, G as GitRunner, M as MakeWorkerAgent, X as Supervisor } from './coordination-DWNGqygr.js';
4
- export { Y as ExecutorContext, Z as ExecutorResult, _ as Handle, $ as NodeSnapshot, a0 as NodeStatus, a1 as Restart, a2 as RootSignal, a3 as Runtime, a4 as SpawnOpts, a5 as SupervisorOpts, a6 as WidenGate } from './coordination-DWNGqygr.js';
3
+ import { u as ResultBlobStore, v as SpawnJournal, N as NodeId, w as SpawnEvent, T as TreeView, x as Settled, y as AgentSpec, E as ExecutorRegistry, B as Budget, z as Agent, H as RootHandle, K as SupervisedResult, L as Spend, O as Scope, P as ExecutorFactory, U as Executor, V as UsageEvent, G as GitRunner, M as MakeWorkerAgent, a as CoordinationTools, A as AnalystRegistry, C as CoordinationEvent, l as QuestionPolicy, X as Supervisor } from './coordination-BydGBQCZ.js';
4
+ export { Y as BusEvent, Z as BusRecord, _ as BusStats, $ as EventBus, a0 as ExecutorContext, a1 as ExecutorResult, a2 as Handle, a3 as NodeSnapshot, a4 as NodeStatus, a5 as PublishOptions, a6 as Restart, a7 as RootSignal, a8 as Runtime, a9 as SpawnOpts, aa as SupervisorOpts, ab as WidenGate, ac as createEventBus } from './coordination-BydGBQCZ.js';
5
5
  import { R as RuntimeHooks } from './runtime-hooks-C7JwKb9E.js';
6
- import { ChatClient, AnalystFinding, DefaultVerdict, AgentProfile as AgentProfile$1, AnalystRunInputs } from '@tangle-network/agent-eval';
6
+ import { ChatClient, AnalystFinding, DefaultVerdict, AgentProfile as AgentProfile$1, AnalystRunInputs, ToolSpan, StreamingDetector, DetectorSignal, buildTrajectory } from '@tangle-network/agent-eval';
7
7
  export { DefaultVerdict } from '@tangle-network/agent-eval';
8
- import { I as Iteration, S as SandboxClient, b as LoopResult, d as LoopTokenUsage, R as RuntimeStreamEvent, A as AgentRunSpec, E as ExecCtx } from './types-C8rNlxfV.js';
9
- export { D as Driver, F as LoopDecisionPayload, G as LoopEndedPayload, H as LoopIterationDispatchPayload, J as LoopIterationEndedPayload, M as LoopIterationStartedPayload, a as LoopLineageOptions, N as LoopPlanDescription, P as LoopPlanPayload, f as LoopSandboxPlacement, Q as LoopStartedPayload, T as LoopTeardownFailedPayload, g as LoopTraceEmitter, e as LoopTraceEvent, L as LoopWinner, O as OutputAdapter, U as ValidationCtx, V as Validator } from './types-C8rNlxfV.js';
8
+ import { I as Iteration, S as SandboxClient, b as LoopResult, e as LoopTokenUsage, R as RuntimeStreamEvent, A as AgentRunSpec, E as ExecCtx } from './types-CUzjRFZ3.js';
9
+ export { D as Driver, F as LoopDecisionPayload, G as LoopEndedPayload, H as LoopIterationDispatchPayload, J as LoopIterationEndedPayload, M as LoopIterationStartedPayload, a as LoopLineageOptions, N as LoopPlanDescription, P as LoopPlanPayload, f as LoopSandboxPlacement, Q as LoopStartedPayload, T as LoopTeardownFailedPayload, g as LoopTraceEmitter, d as LoopTraceEvent, L as LoopWinner, O as OutputAdapter, U as ValidationCtx, V as Validator } from './types-CUzjRFZ3.js';
10
10
  import { Scenario, ProfileDispatchFn } from '@tangle-network/agent-eval/campaign';
11
- import { R as RunLoopOptions } from './run-loop-DluzfJ2h.js';
12
- export { c as createSandboxForSpec, d as defaultSelectWinner, r as runLoop } from './run-loop-DluzfJ2h.js';
11
+ import { R as RunLoopOptions } from './run-loop-CcqfR_gy.js';
12
+ export { c as createSandboxForSpec, d as defaultSelectWinner, r as runLoop } from './run-loop-CcqfR_gy.js';
13
13
  import { b as AnalystRegistryLike } from './types-p8dWBIXL.js';
14
14
  import { R as RouterConfig, T as ToolSpec } from './router-client-30Y_pca8.js';
15
15
  export { a as RouterChatResult, b as RouterChatToolsResult, c as RouterToolCall, d as RouterToolLoopResult, r as routerChatWithTools, e as routerChatWithUsage, f as routerToolLoop } from './router-client-30Y_pca8.js';
16
- import { a as CoderCheckConstraints } from './coder-COuOK8h8.js';
16
+ import { a as CoderCheckConstraints } from './coder-CybltHEm.js';
17
17
  import { L as LocalHarness, r as runLocalHarness } from './local-harness-BE_h8szs.js';
18
- import './delegates-D9o5_VFj.js';
18
+ import { stuckLoopView, toolWasteView } from '@tangle-network/agent-eval/pipelines';
19
+ import './delegates-C94qchkz.js';
19
20
  import './substrate-CUgk7F7s.js';
20
21
  import 'node:child_process';
21
22
 
@@ -115,7 +116,8 @@ declare class FileSpawnJournal implements SpawnJournal {
115
116
  declare function replaySpawnTree(journal: SpawnJournal, blobs: ResultBlobStore, root: NodeId): Promise<Settled<unknown>[]>;
116
117
  /**
117
118
  * Materialize the live tree (`TreeView`) from a journaled event list for resume. Folds
118
- * `spawned`/`settled`/`cancelled` into a per-node snapshot in `seq` order so the
119
+ * `spawned`/`settled`/`cancelled` into a per-node snapshot in `seq` order, then adds each
120
+ * `metered` event's driver-inference spend onto its node in a separate additive pass — so the
119
121
  * resumed view matches what `scope.view` showed at the recorded cursor position.
120
122
  */
121
123
  declare function materializeTreeView(events: SpawnEvent[]): TreeView;
@@ -2928,10 +2930,13 @@ interface ReservationTicket {
2928
2930
  }
2929
2931
  /** Post-reservation pool readout — the shape `Scope.budget` exposes. `tokensLeft`,
2930
2932
  * `usdLeft`, and `reservedTokens` reflect committed-but-unsettled reservations;
2931
- * `deadlineMs` is the ABSOLUTE wall-clock deadline (0 when the root set none). */
2933
+ * `deadlineMs` is the ABSOLUTE wall-clock deadline (0 when the root set none).
2934
+ * `usdCapped` distinguishes a real `usdLeft <= 0` exhaustion from an uncapped pool (which always
2935
+ * reads `usdLeft: 0`) — the in-loop guard needs it to bound a usd-capped driver. */
2932
2936
  type BudgetReadout = Readonly<{
2933
2937
  tokensLeft: number;
2934
2938
  usdLeft: number;
2939
+ usdCapped: boolean;
2935
2940
  deadlineMs: number;
2936
2941
  reservedTokens: number;
2937
2942
  }>;
@@ -2960,6 +2965,17 @@ interface BudgetPool {
2960
2965
  spendFrom(events: AsyncIterable<UsageEvent> | UsageEvent[]): Promise<Spend>;
2961
2966
  /** The current readout, reflecting all outstanding reservations. */
2962
2967
  readout(): BudgetReadout;
2968
+ /**
2969
+ * Record OBSERVED spend that did NOT go through reserve/reconcile — the driver's OWN inference
2970
+ * (its chat turns), which is real compute but not a spawned child. A direct `free → committed`
2971
+ * debit, so `total ≡ free + reserved + committed` is preserved: equal-k counts the driver's
2972
+ * tokens and the in-loop budget guard (`readout().tokensLeft`) sees them. `free` may go negative
2973
+ * when a run overspends — that is honest (the readout then signals exhaustion). It never throws:
2974
+ * the spend already happened, so accounting records reality; the in-loop guard prevents MORE.
2975
+ * The DURABLE record is the journal's `metered` event (written by `Scope.meter`); this debit
2976
+ * only makes the live `readout()` reflect driver inference for the in-loop guard.
2977
+ */
2978
+ observe(spend: Spend): void;
2963
2979
  /** Fail loud if any reservation is still open — the conserved-pool leak detector. Called at the
2964
2980
  * supervisor's join barrier: once every child has settled, no ticket may remain (a leaked
2965
2981
  * reservation would silently break `total ≡ free + reserved + committed`). */
@@ -2980,46 +2996,37 @@ declare function createBudgetPool(root: Budget, now?: () => number): BudgetPool;
2980
2996
  /**
2981
2997
  * @experimental
2982
2998
  *
2983
- * The worktree-CLI leaf executor — a supervisor-authored `AgentProfile` driving a local
2984
- * coding-harness CLI (claude / codex / opencode) on its OWN git worktree, surfaced as the
2985
- * open `Executor<Out>` port (`./types`). It is a LEAF executor, not a `DelegationExecutor`:
2986
- * it plugs straight into the `Scope`/`Supervisor` recursion and `gateOnDeliverable`, so it
2987
- * IS the canonical recursive path (no `runLoop`/virtual-SandboxInstance shim in between).
2988
- *
2989
- * The §1.5 payload reaches the harness: `harnessInvocation` (mcp/local-harness) maps the
2990
- * authored `profile.prompt.systemPrompt` into the prompt channel and `profile.model.default`
2991
- * into the harness's `-m` selector — the prompt-only `buildArgs(taskPrompt)` path dropped
2992
- * both. The subprocess runs through `runLocalHarness` (the stdin-CLOSED spawn shape — the
2993
- * #308 fix that keeps a non-TTY `opencode run` from blocking on input forever).
2999
+ * The ONE worktree-harness execution core. The physical act run a supervisor-authored
3000
+ * `AgentProfile` on a local coding-harness CLI (claude / codex / opencode) against a fresh git
3001
+ * worktree off `repoRoot`, capture the diff, derive the test/typecheck PASS signals, then clean
3002
+ * up lives here ONCE. Two executors adapt it to two ports without re-implementing it:
3003
+ * - `createWorktreeCliExecutor` the `Scope`/`Supervisor` leaf `Executor`.
3004
+ * - `createInProcessExecutor` — the `runLoop` `SandboxClient` / coder-delegate path.
2994
3005
  *
2995
- * Lifecycle per spawn (fresh executor one box/abort/teardown each):
2996
- * 1. `createWorktree` `git worktree add` off `repoRoot` at `baseRef`.
2997
- * 2. `runLocalHarness` spawn the harness, fed the profile-aware invocation.
2998
- * 3. `captureWorktreeDiff` — `git diff` the worktree → the patch artifact.
2999
- * 4. `removeWorktree` — on `teardown` (always; the loser of a fanout is dirty).
3006
+ * §1.5 by construction: the authored `profile.prompt.systemPrompt` + `profile.model.default`
3007
+ * reach the harness through `harnessInvocation` HERE, so neither port can drop them — the exact
3008
+ * bug that existed while the in-process path called `runLocalHarness` with only the task prompt.
3000
3009
  *
3001
- * Reuse, not duplication: `createWorktree` / `captureWorktreeDiff` / `removeWorktree` come
3002
- * straight from `mcp/worktree`; `runLocalHarness` + `LocalHarness` from `mcp/local-harness`.
3003
- * Nothing here reimplements a worktree, a spawn, or a diff.
3004
- *
3005
- * Token accounting: a harness CLI does not surface usage, so this executor is
3006
- * `budgetExempt: true` — its spend is NOT metered against the conserved pool and its
3007
- * iterations are EXCLUDED from the equal-k arms by construction (mirrors `cliExecutor`).
3010
+ * Lifecycle: `createWorktree` `harnessInvocation` + `runLocalHarness` → `captureWorktreeDiff`
3011
+ * (BEFORE checks, so the patch is the harness's output, not polluted by files a test run writes)
3012
+ * the configured test/typecheck commands in the live worktree return the result + a `cleanup`
3013
+ * the caller invokes at its own teardown point. A throw cleans up before propagating, so a failed
3014
+ * run never leaks a worktree.
3008
3015
  */
3009
3016
 
3010
3017
  /** Outcome of one verification command run in the worktree (test or typecheck). */
3011
3018
  interface WorktreeCommandResult {
3012
3019
  /** The shell command line that was run. */
3013
3020
  command: string;
3014
- /** Did the command exit 0? The PASS signal the coder deliverable gates on. */
3021
+ /** Did the command exit 0? The PASS signal a deliverable gate / coder output reads. */
3015
3022
  passed: boolean;
3016
3023
  /** OS exit code, or `null` when killed before exit. */
3017
3024
  exitCode: number | null;
3018
3025
  /** Combined stdout+stderr (capped) — surfaced in traces for diagnosis. */
3019
3026
  output: string;
3020
3027
  }
3021
- /** Terminal artifact of one worktree-CLI run: the captured diff + the harness's run record. */
3022
- interface WorktreePatchArtifact {
3028
+ /** The canonical result of one worktree-harness run, projected by each port to its own shape. */
3029
+ interface WorktreeHarnessResult {
3023
3030
  /** The branch the worktree was cut on (`delegate/<runId>`). */
3024
3031
  branch: string;
3025
3032
  /** `git diff` of the worktree against its base — the unified patch the harness produced. */
@@ -3030,7 +3037,7 @@ interface WorktreePatchArtifact {
3030
3037
  insertions: number;
3031
3038
  deletions: number;
3032
3039
  };
3033
- /** The harness subprocess outcome (exit code, captured streams, timing). */
3040
+ /** The harness subprocess outcome. */
3034
3041
  harness: {
3035
3042
  name: LocalHarness;
3036
3043
  exitCode: number | null;
@@ -3040,17 +3047,46 @@ interface WorktreePatchArtifact {
3040
3047
  stdout: string;
3041
3048
  stderr: string;
3042
3049
  };
3043
- /**
3044
- * Verification signals DERIVED in the live worktree, after the harness ran and before
3045
- * teardown — the PASS signals the old sandbox `CoderOutput` carried, re-derived here by
3046
- * running the configured commands. Present only when `testCmd`/`typecheckCmd` were supplied.
3047
- * The coder deliverable (`coderDeliverable`) reads these to gate the patch.
3048
- */
3050
+ /** Verification signals derived in the live worktree (present only when commands were given). */
3049
3051
  checks?: {
3050
3052
  tests?: WorktreeCommandResult;
3051
3053
  typecheck?: WorktreeCommandResult;
3052
3054
  };
3053
3055
  }
3056
+ /** The single shell-command-in-worktree runner seam (replaces the per-executor copies). */
3057
+ type WorktreeCheckRunner = (opts: {
3058
+ command: string;
3059
+ cwd: string;
3060
+ timeoutMs: number;
3061
+ signal?: AbortSignal;
3062
+ }) => Promise<{
3063
+ exitCode: number | null;
3064
+ output: string;
3065
+ }>;
3066
+
3067
+ /**
3068
+ * @experimental
3069
+ *
3070
+ * The worktree-CLI leaf executor — a supervisor-authored `AgentProfile` driving a local
3071
+ * coding-harness CLI (claude / codex / opencode) on its OWN git worktree, surfaced as the open
3072
+ * `Executor<Out>` port (`./types`). It is a LEAF executor: it plugs straight into the
3073
+ * `Scope`/`Supervisor` recursion and `gateOnDeliverable`, so it IS the canonical recursive path
3074
+ * (no `runLoop`/virtual-SandboxInstance shim in between).
3075
+ *
3076
+ * This is a THIN adapter: the physical act (worktree → profile-aware harness invocation → diff →
3077
+ * checks → cleanup) lives ONCE in `runWorktreeHarness` (`../../mcp/worktree-harness`), shared with
3078
+ * the `runLoop`/coder-delegate `createInProcessExecutor`. This executor only projects that core's
3079
+ * result onto the `Executor` port (artifact + spend) and owns the teardown point. The §1.5 payload
3080
+ * (authored systemPrompt + model) reaches the harness inside the core, not here.
3081
+ *
3082
+ * Token accounting: a harness CLI does not surface usage, so this executor is `budgetExempt: true`
3083
+ * — its spend is NOT metered against the conserved pool and its iterations are EXCLUDED from the
3084
+ * equal-k arms by construction (mirrors `cliExecutor`).
3085
+ */
3086
+
3087
+ /** Terminal artifact of one worktree-CLI run — the canonical worktree-harness result (the captured
3088
+ * diff + the harness's run record + the derived checks). */
3089
+ type WorktreePatchArtifact = WorktreeHarnessResult;
3054
3090
  /** @experimental */
3055
3091
  interface WorktreeCliExecutorOptions {
3056
3092
  /** Absolute path to the git checkout the worktree is cut from. */
@@ -3080,26 +3116,16 @@ interface WorktreeCliExecutorOptions {
3080
3116
  runGit?: GitRunner;
3081
3117
  /** Test seam — inject the harness runner so unit tests script a `LocalHarnessResult`. */
3082
3118
  runHarness?: typeof runLocalHarness;
3083
- /**
3084
- * Test seam inject the verification-command runner so unit tests script test/typecheck
3085
- * outcomes without spawning a real shell. Defaults to a `/bin/sh -c` spawn in the worktree.
3086
- */
3087
- runCommand?: (opts: {
3088
- command: string;
3089
- cwd: string;
3090
- timeoutMs: number;
3091
- signal?: AbortSignal;
3092
- }) => Promise<{
3093
- exitCode: number | null;
3094
- output: string;
3095
- }>;
3119
+ /** Test seam — inject the verification-command runner so unit tests script test/typecheck
3120
+ * outcomes without spawning a real shell. Defaults to a `/bin/sh -c` spawn in the worktree. */
3121
+ runCommand?: WorktreeCheckRunner;
3096
3122
  }
3097
3123
  /**
3098
- * Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each),
3099
- * so a fanout of N profiles = N parallel worktrees that never clobber each other.
3124
+ * Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each), so a
3125
+ * fanout of N profiles = N parallel worktrees that never clobber each other.
3100
3126
  *
3101
- * Fail-loud: an empty `repoRoot`/`harness`/`taskPrompt` throws at construction (no silent
3102
- * default for a required boundary). `resultArtifact()` before `execute()` resolves throws.
3127
+ * Fail-loud: an empty `repoRoot`/`harness`/`taskPrompt` throws at construction. `resultArtifact()`
3128
+ * before `execute()` resolves throws.
3103
3129
  *
3104
3130
  * @experimental
3105
3131
  */
@@ -3252,6 +3278,15 @@ interface DriverTurn {
3252
3278
  readonly toolCalls?: ReadonlyArray<DriverToolCall>;
3253
3279
  /** The driver's natural-language output — the answer when there are no tool calls. */
3254
3280
  readonly content?: string;
3281
+ /** The driver LLM's OWN token usage for THIS turn — metered against the conserved pool so the
3282
+ * driver's inference counts toward equal-k AND the in-loop budget guard. Omit for a scripted/
3283
+ * mock turn (no real inference); production `routerDriverChat` forwards it from the router. */
3284
+ readonly usage?: {
3285
+ readonly input: number;
3286
+ readonly output: number;
3287
+ };
3288
+ /** The turn's inference cost (usd), when the provider priced it. */
3289
+ readonly costUsd?: number;
3255
3290
  }
3256
3291
  /** The injected driver-LLM seam: one turn over the conversation + the coordination tool specs. */
3257
3292
  interface DriverChat {
@@ -3278,8 +3313,14 @@ interface CoordinationDriverOptions {
3278
3313
  /** The driver's stance — a string, or built from the task (the worker-driver prompt /
3279
3314
  * the generator). INJECTED so the prompt is a pluggable, optimizable role. */
3280
3315
  readonly systemPrompt: string | ((task: unknown) => string);
3281
- /** Max driver turns before the loop force-finalizes on the best settled child. Default 16. */
3316
+ /** Max driver turns before the loop force-finalizes on the best settled child. Default 16.
3317
+ * `0` lifts the turn-COUNT cap: the loop is bounded instead by the conserved budget pool,
3318
+ * an absolute deadline, the driver's own stop, and abort (checked in-loop). A finite
3319
+ * anti-runaway tripwire still guards a degenerate driver that loops on a no-spawn tool. */
3282
3320
  readonly maxTurns?: number;
3321
+ /** Injected clock for the in-loop absolute-deadline guard — keeps the deadline check
3322
+ * deterministic in tests. Defaults to `Date.now`. */
3323
+ readonly now?: () => number;
3283
3324
  }
3284
3325
  /**
3285
3326
  * Build the intelligent recursive driver. Its `act` is the LLM tool-loop; spawn it as a
@@ -3290,7 +3331,7 @@ declare function coordinationDriverAgent(opts: CoordinationDriverOptions): Agent
3290
3331
  /**
3291
3332
  * @experimental
3292
3333
  *
3293
- * Serve the coordination verbs (spawn_worker / await_next / observe_worker / steer_worker / stop)
3334
+ * Serve the coordination verbs (spawn_worker / await_event / observe_worker / steer_worker / stop)
3294
3335
  * as a real HTTP MCP server over a LIVE `Scope`. This is the keystone that lets a coding-harness
3295
3336
  * agent (opencode via the cli-bridge, claude-code, codex) BE the supervisor: it mounts this MCP
3296
3337
  * (`mcp.mcpServers.coordination`) and calls `spawn_worker` as a native tool, which lands on
@@ -3313,6 +3354,12 @@ interface CoordinationMcpHandle {
3313
3354
  outRef?: string;
3314
3355
  }>;
3315
3356
  isStopped(): boolean;
3357
+ /** The full ordered bus-event log — observability audit + replay trail. */
3358
+ history: CoordinationTools['history'];
3359
+ /** Bus throughput counters for live dashboards. */
3360
+ stats: CoordinationTools['stats'];
3361
+ /** Raise a `finding` on the bus from an online detector watching a worker's live pipe. */
3362
+ raiseFinding: CoordinationTools['raiseFinding'];
3316
3363
  close(): Promise<void>;
3317
3364
  }
3318
3365
  /** Stand up the coordination MCP over a live scope. The HOST address is `127.0.0.1` (the bridge runs
@@ -3324,8 +3371,150 @@ declare function serveCoordinationMcp(opts: {
3324
3371
  perWorker: Budget;
3325
3372
  port?: number;
3326
3373
  host?: string;
3374
+ /** Trace-analyst lenses the driver can run (`run_analyst`) or auto-fire on settle. */
3375
+ analysts?: AnalystRegistry;
3376
+ /** Analyst kinds to auto-run when a worker settles `done` — findings flow up the bus. */
3377
+ analyzeOnSettle?: ReadonlyArray<string>;
3378
+ /** Pass-through subscriber for every bus event (settled / question / finding). */
3379
+ onEvent?: (event: CoordinationEvent) => void | Promise<void>;
3380
+ questionPolicy?: QuestionPolicy;
3327
3381
  }): Promise<CoordinationMcpHandle>;
3328
3382
 
3383
+ /**
3384
+ * @experimental
3385
+ *
3386
+ * `TraceSource` — the ONE substrate-agnostic source of a worker's tool-call trace. The online
3387
+ * detectors and the settle-time analyzers consume agent-eval `ToolSpan`s from here, regardless of
3388
+ * whether the worker is:
3389
+ * - an OWNED tool loop (router-tools, cli-bridge tool dispatch) → push spans as we dispatch them;
3390
+ * - a SANDBOX / fleet box → read the harness's tool calls off the session (`streamPrompt` parts
3391
+ * live, `session.messages()` / `findCompletedTurn` at settle).
3392
+ *
3393
+ * The common currency is agent-eval's `ToolSpan` (so the same detectors + `buildTrajectory`/
3394
+ * `stuckLoopView`/`toolWasteView` run over any source). A source exposes two lanes:
3395
+ * - `onSpan` — live spans for ONLINE detection (best-effort; a black-box box may only collect).
3396
+ * - `collect` — the full span set at settle for the BATCH analyzers (always available).
3397
+ *
3398
+ * This module imports NO substrate SDK — it decodes generic message parts / OpenAI tool-call shapes.
3399
+ * The sandbox wiring (`sandboxSessionTraceSource`) is the thin adapter that feeds box session parts in.
3400
+ */
3401
+
3402
+ interface ToolStepInput {
3403
+ readonly toolName: string;
3404
+ readonly args: unknown;
3405
+ readonly status?: 'ok' | 'error';
3406
+ readonly result?: unknown;
3407
+ /** Stable id of the tool call — used to de-duplicate the repeated state transitions a harness
3408
+ * streams for one call (opencode emits pending→running→completed, plus a `raw`-wrapped copy). */
3409
+ readonly callId?: string;
3410
+ }
3411
+ interface TraceSource {
3412
+ /** Subscribe to tool spans as they are produced (ONLINE). Returns an unsubscribe. A source that
3413
+ * only exposes its trace at the end registers nothing and returns a no-op. */
3414
+ onSpan(handler: (span: ToolSpan) => void): () => void;
3415
+ /** The full set of tool spans for the run (SETTLE / batch). Always available. */
3416
+ collect(): Promise<ToolSpan[]>;
3417
+ }
3418
+ /** Project a normalized tool step into the canonical agent-eval `ToolSpan`. */
3419
+ declare function toToolSpan(input: ToolStepInput, runId: string, seq: number, at: number): ToolSpan;
3420
+ /** Decode one harness message part into a tool step, or `undefined` if it is not a (completed) tool
3421
+ * call. ONE adapter per harness family — each owns its real wire shape; the flow downstream is
3422
+ * identical. Add a harness = add a decoder + register it; no other code changes. */
3423
+ type ToolPartDecoder = (part: Record<string, unknown>) => ToolStepInput | undefined;
3424
+ /** opencode (VALIDATED LIVE): `{ type:'tool', tool:'<name>', callID, state:{ status, input } }`.
3425
+ * The same call streams pending→running→completed/error — only the terminal state decodes. */
3426
+ declare const decodeOpencodePart: ToolPartDecoder;
3427
+ /** Anthropic / claude-code (also kimi's tool_use variant): a `{ type:'tool_use', id|tool_use_id,
3428
+ * name|tool, input }` content block. CONFIRMED against the cli-bridge's authoritative parsers
3429
+ * (claude.ts reads `block.type==='tool_use', block.id, block.name, block.input`; kimi.ts adds the
3430
+ * `tool_use_id`/`tool` fallbacks) — the canonical readers of these harnesses' real native output. */
3431
+ declare const decodeAnthropicPart: ToolPartDecoder;
3432
+ /** OpenAI-compatible (router / kimi's top-level form / glm): `{ type:'function'|'tool_call', id,
3433
+ * function:{ name, arguments:<JSON string> } }`. CONFIRMED against the cli-bridge (kimi.ts surfaces
3434
+ * kimi's top-level `tool_calls:[{type:'function', id, function:{name,arguments}}]` exactly this way).
3435
+ * NOTE: codex does NOT emit structured tool calls (the bridge's codex.ts never yields `tool_calls` —
3436
+ * it runs shell internally and surfaces only text), so per-tool detection is unavailable for codex
3437
+ * from any path — a harness property, not a decoder gap. */
3438
+ declare const decodeOpenAiPart: ToolPartDecoder;
3439
+ /** The harness → decoder registry. Add a harness by adding one entry. */
3440
+ declare const toolPartDecoders: Record<string, ToolPartDecoder>;
3441
+ /** Decode a part with a specific harness's adapter when known, else try every registered adapter
3442
+ * (the composite — robust to mixed/unknown streams). Never throws. */
3443
+ declare function decodeToolPart(part: unknown, harness?: string): ToolStepInput | undefined;
3444
+ /** A push source for OWNED tool loops (router-tools / cli-bridge tool dispatch): the loop calls
3445
+ * `record(step)` for each tool call; it becomes a span, fan-out to live subscribers + buffered for
3446
+ * `collect`. */
3447
+ declare function createPushTraceSource(opts?: {
3448
+ runId?: string;
3449
+ now?: () => number;
3450
+ }): {
3451
+ source: TraceSource;
3452
+ record: (input: ToolStepInput) => ToolSpan;
3453
+ };
3454
+ /** A source backed by harness message PARTS (sandbox session, cli-bridge). `collect` reads the full
3455
+ * part list and decodes the tool calls; `subscribe`, when given, streams parts live for online
3456
+ * detection. The caller supplies how to get parts (e.g. `box.session(id).messages()` flat-mapped to
3457
+ * parts) — keeping this module free of any substrate SDK. */
3458
+ declare function createPartsTraceSource(opts: {
3459
+ collectParts: () => Promise<ReadonlyArray<unknown>>;
3460
+ subscribeParts?: (onPart: (part: unknown) => void) => () => void;
3461
+ /** The harness whose decoder to use (e.g. 'opencode'); omit to try every registered adapter. */
3462
+ harness?: string;
3463
+ runId?: string;
3464
+ now?: () => number;
3465
+ }): TraceSource;
3466
+ /** A harness session message carrying parts (the shape `box.messages()` returns). Structurally typed
3467
+ * so this works with the real `@tangle-network/sandbox` box AND a test double, no SDK import. */
3468
+ interface SessionMessageLike {
3469
+ readonly parts?: ReadonlyArray<unknown>;
3470
+ }
3471
+ /** The minimal box surface this needs: list a session's messages (incl. mid-turn partials). */
3472
+ interface SessionTraceBox {
3473
+ messages(opts: {
3474
+ sessionId: string;
3475
+ }): Promise<ReadonlyArray<SessionMessageLike>>;
3476
+ }
3477
+ /** The SANDBOX / fleet trace source: read a box session's message parts and decode the harness's tool
3478
+ * calls into spans. `collect` (settle) is the solid path — `box.messages({sessionId})` → parts → spans;
3479
+ * black-box harnesses aren't mid-step interruptible, so online steering is the owned-loop's job and a
3480
+ * live `subscribe` is opt-in (pass `subscribeParts` from `streamPrompt` when the harness streams parts). */
3481
+ declare function sandboxSessionTraceSource(box: SessionTraceBox, sessionId: string, opts?: {
3482
+ /** The box's harness (e.g. 'opencode', 'claude-code') → selects its decoder adapter. */
3483
+ harness?: string;
3484
+ subscribeParts?: (onPart: (part: unknown) => void) => () => void;
3485
+ runId?: string;
3486
+ now?: () => number;
3487
+ }): TraceSource;
3488
+
3489
+ /**
3490
+ * @experimental
3491
+ *
3492
+ * The ONLINE analyst: watch a `TraceSource` and fold each tool span through agent-eval's published
3493
+ * streaming detector kernel (`repeatedActionDetector`/`errorStreakDetector` — the SAME kernel the
3494
+ * control loop folds), firing `onSignal` the moment a worker loops or error-storms. Substrate-
3495
+ * agnostic: it consumes spans from any source (owned router/bridge loop OR a sandbox box session),
3496
+ * never the raw tool seam. Detection logic + the failure taxonomy live in agent-eval; not reimplemented.
3497
+ */
3498
+
3499
+ interface WatchTraceOptions {
3500
+ /** The detectors to run online. Defaults to a stuck-loop + error-streak panel. */
3501
+ readonly detectors?: ReadonlyArray<StreamingDetector>;
3502
+ /** Fired for each signal a detector raises — the seam that raises a `finding` on the bus. */
3503
+ readonly onSignal?: (signal: DetectorSignal, span: ToolSpan) => void | Promise<void>;
3504
+ }
3505
+ /** The default online panel for a tool-call pipe: a worker repeating the same call, or hammering
3506
+ * consecutive errors. (No-progress needs a domain progress-probe, so it is opt-in, not default.)
3507
+ *
3508
+ * Coverage note: `repeated-action` works for EVERY harness (it needs only tool name + args, which
3509
+ * every adapter provides). `error-streak` needs per-call status — opencode carries it inline
3510
+ * (`state.status`, VALIDATED live), but claude-code/codex tool-call parts do NOT (their errors live
3511
+ * in separate result blocks not yet decoded), so error-streak is silent for those until result-block
3512
+ * decoding is added + live-validated. It is in the panel because it is correct where status exists. */
3513
+ declare function defaultToolDetectors(): StreamingDetector[];
3514
+ /** Subscribe to a `TraceSource` and run the streaming detectors over its live spans. Returns an
3515
+ * unsubscribe. A defensive `argHash` failure (circular args) never throws out of the side-channel. */
3516
+ declare function watchTrace(source: TraceSource, opts?: WatchTraceOptions): () => void;
3517
+
3329
3518
  /**
3330
3519
  * @experimental
3331
3520
  *
@@ -3407,6 +3596,56 @@ declare const driverExecutorFactory: ExecutorFactory<unknown>;
3407
3596
  */
3408
3597
  declare function withDriverExecutor(base: ExecutorRegistry): ExecutorRegistry;
3409
3598
 
3599
+ /**
3600
+ * @experimental
3601
+ *
3602
+ * The worker-side receive end of the down-leg: a per-worker inbox an executor exposes as
3603
+ * `Executor.deliver`. The driver's `steer_worker` / `answer_question` land here,
3604
+ * and the worker's agent loop drains them at two points (Drew's two delivery modes):
3605
+ *
3606
+ * - QUEUED (default): the message accumulates and is FLUSHED at the next step boundary — folded
3607
+ * into the conversation before the next think. A worker is also forced to flush BEFORE it may
3608
+ * settle, so it can never finish while a steer/answer it never read is still pending.
3609
+ * - FORCEFUL (`interrupt: true`): trips `freshInterrupt()`'s signal so the loop can abort its
3610
+ * in-flight turn immediately, then re-plan with the message folded in — breaking the worker out
3611
+ * of a wrong path mid-task instead of waiting for it to finish the step.
3612
+ *
3613
+ * `deliver` never throws — a malformed message is ignored, per the `Executor.deliver` contract.
3614
+ */
3615
+ interface InboxMessage {
3616
+ readonly kind: 'steer' | 'answer';
3617
+ readonly text: string;
3618
+ /** Forceful messages abort the in-flight turn; queued ones wait for the boundary flush. */
3619
+ readonly interrupt: boolean;
3620
+ /** Present for an `answer` — the question id it resolves. */
3621
+ readonly questionId?: string;
3622
+ }
3623
+ interface Inbox {
3624
+ /** The `Executor.deliver` implementation — accept a raw down-message from `Scope.send`. */
3625
+ deliver(msg: unknown): void;
3626
+ /** Remove and return all pending messages (the flush). */
3627
+ drain(): InboxMessage[];
3628
+ pending(): number;
3629
+ /** Open a fresh per-turn interrupt signal; a later forceful `deliver` aborts it. The loop links
3630
+ * this into the signal it passes to its inference call, then re-plans when it fires. */
3631
+ freshInterrupt(): AbortSignal;
3632
+ /** Render drained messages as ONE operator turn to fold into the worker's conversation. */
3633
+ fold(messages: ReadonlyArray<InboxMessage>): string;
3634
+ }
3635
+ declare function createInbox(): Inbox;
3636
+
3637
+ /**
3638
+ * The router-backed driver-LLM seam: adapt the OpenAI-compatible router's tool-calling chat
3639
+ * to the `DriverChat` port a `coordinationDriverAgent` drives. Tests script a mock `DriverChat`;
3640
+ * production passes `routerDriverChat(cfg)` so the driver's spawn/observe/steer/await/stop turns
3641
+ * are real router tool-calls. This is the one turnkey piece a consumer needs to run an in-process
3642
+ * supervisor (the driver brain) — everything else is `createSupervisor().run(...)`.
3643
+ */
3644
+
3645
+ declare function routerDriverChat(c: RouterConfig, opts?: {
3646
+ temperature?: number;
3647
+ }): DriverChat;
3648
+
3410
3649
  /**
3411
3650
  * @experimental
3412
3651
  *
@@ -3514,6 +3753,13 @@ interface RouterToolsSeam {
3514
3753
  model?: string;
3515
3754
  tools: ReadonlyArray<ToolSpec>;
3516
3755
  executeToolCall: (name: string, args: Record<string, unknown>, task: unknown) => Promise<string>;
3756
+ /** Online observer of each tool step — the seam a `DetectorMonitor` taps to watch the live pipe
3757
+ * (raise a `finding` when the worker loops/errors). Called after every tool call resolves. */
3758
+ onToolStep?: (step: {
3759
+ toolName: string;
3760
+ args: Record<string, unknown>;
3761
+ status: 'ok' | 'error';
3762
+ }) => void;
3517
3763
  /** Max inference turns. Default 200 (runaway backstop — set far above any
3518
3764
  * legitimate workflow). For tighter per-workflow limits use a cost budget
3519
3765
  * or wall-clock deadline at the call site. */
@@ -3687,9 +3933,9 @@ declare function settledToIteration<Out>(settled: Settled<Out>): Iteration<unkno
3687
3933
  * no-winner; it does not restart anything.
3688
3934
  *
3689
3935
  * Selection lives in the driver, not here (selector≠judge): `act` returns the synthesized
3690
- * winner `Out`. The supervisor content-addresses that `Out` for its replay `outRef`,
3691
- * reads `spentTotal` off the conserved pool, and wraps it as a typed `winner` it does
3692
- * not re-rank children behind the driver's back.
3936
+ * winner `Out`. The supervisor content-addresses that `Out` for its replay `outRef`, reads
3937
+ * `spentTotal` off the journal (`settled` child work + `metered` driver inference), and wraps
3938
+ * it as a typed `winner` — it does not re-rank children behind the driver's back.
3693
3939
  */
3694
3940
 
3695
3941
  declare function createSupervisor<Task, Out>(): Supervisor<Task, Out>;
@@ -3702,6 +3948,29 @@ declare function createSupervisor<Task, Out>(): Supervisor<Task, Out>;
3702
3948
  */
3703
3949
  declare function createRootHandle<Out>(): RootHandle<Out>;
3704
3950
 
3951
+ /**
3952
+ * @experimental
3953
+ *
3954
+ * The SETTLE-time analyst: when a worker finishes, collect its tool spans from a `TraceSource` and run
3955
+ * agent-eval's PUBLISHED batch analyzers over them — `buildTrajectory` (structured run summary),
3956
+ * `stuckLoopView` (full-run repeated-call view, complementing the online consecutive detector), and
3957
+ * `toolWasteView`. Substrate-agnostic: the spans come from any source (an owned loop's buffer OR a
3958
+ * sandbox box session). No analysis reimplemented — this is the thin bridge into agent-eval's analyzers.
3959
+ */
3960
+
3961
+ interface TrajectoryAnalysis {
3962
+ /** Structured run summary (tool-call count, step order). Steps carry a single timestamp, so per-span
3963
+ * duration is 0; loop/waste detection keys on call PATTERNS + cross-span windows, not durations. */
3964
+ readonly trajectory: Awaited<ReturnType<typeof buildTrajectory>>;
3965
+ /** Full-run repeated-call view (total occurrences + window) — catches a loop the online consecutive
3966
+ * detector interleaves past. */
3967
+ readonly stuckLoop: Awaited<ReturnType<typeof stuckLoopView>>;
3968
+ /** Wasted-vs-total tool-call ratio for the run. */
3969
+ readonly toolWaste: Awaited<ReturnType<typeof toolWasteView>>;
3970
+ }
3971
+ /** Collect the source's spans and run the agent-eval batch analyzers over them under one `runId`. */
3972
+ declare function analyzeTrace(source: TraceSource, runId?: string): Promise<TrajectoryAnalysis>;
3973
+
3705
3974
  /**
3706
3975
  * createVerifierEnvironment — ANY checkable task as an `Environment`, no tool surface
3707
3976
  * required. The generalization piece: EOPS/commit0-style domains have tools that mutate
@@ -3797,4 +4066,4 @@ declare function runInWorkspace<T>(ws: Workspace, body: (cwd: string) => Promise
3797
4066
  commitOnInvalid?: boolean;
3798
4067
  }): Promise<WorkspaceRun<T>>;
3799
4068
 
3800
- export { Agent, AgentRunSpec, AgentSpec, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ArtifactHandle, type AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredCoderHarness, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, type BridgeSeam, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CliSeam, type CliWorktreeSeam, type CoderDeliverableOptions, type CoderWinnerStrategy, type CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type CoordinationDriverOptions, type CoordinationMcpHandle, type Corpus, type CorpusFilter, type CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, type DefinePersona, type DefinePersonaInput, type Deliverable, type DeliverableSpec, type DriverChat, type DriverMessage, type DriverToolCall, type DriverTurn, type Environment, type EqualKArm, type EqualKOnCost, type EqualKOnCostOptions, type EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, Executor, type ExecutorConfig, ExecutorFactory, ExecutorRegistry, type Fanout, type FanoutOptions, type FanoutSynthesis, type FanoutWinnerSelector, FileCorpus, FileResultBlobStore, FileSpawnJournal, type FlatWidenGate, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, type IntentAudit, Iteration, type LoopDispatchOptions, type LoopOptionsForDispatch, LoopResult, type LoopShape, LoopTokenUsage, type LoopUntil, type LoopUntilSpec, type LoopUntilState, type McpEndpoint, type McpEnvironmentOptions, type NestedScopeSeam, NodeId, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunOptions, type Outcome, type Panel, type PanelJudge, type PanelSpec, type PanelVerdict, type Persona, type PersonaContext, type PersonaExecutors, type Pipeline, type PipelineStage, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, type RenderCorpusToInstructions, type RenderCorpusToInstructionsOptions, type ReservationTicket, ResultBlobStore, RootHandle, RouterConfig, type RouterSeam, type RouterToolsSeam, type RunAgenticOptions, RunLoopOptions, type RunPersonified, type RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, type SandboxSeam, Scope, type ScopeAnalyst, type ScopeAnalyzeInput, type ScopeWidenGate, type SessionCapableBox, Settled, type ShapeBudget, type ShapeContext, type ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, SpawnEvent, SpawnJournal, Spend, type SteerContext, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, SupervisedResult, Supervisor, type SurfaceScore, ToolSpec, type TrajectoryNode, type TrajectoryReport, type TrajectoryReportFn, type TrajectoryReportOptions, TreeView, type TurnResult, UsageEvent, type UsageSink, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, type Widen, type WidenDecision, type WidenLineage, type WidenSpec, type Workspace, type WorkspaceCommit, type WorkspaceRun, type WorktreeCliExecutorOptions, type WorktreeCoderFanoutOptions, type WorktreeCommandResult, type WorktreePatchArtifact, acquireSandbox, adaptiveRefine, anytimeReport, asAuthoredProfile, assertStrategyContract, assertTraceDerivedFindings, auditIntent, authorStrategy, authoredWorker, breadthDriver, buildSteerContext, builtinShapes, cliWorktreeExecutor, coderDeliverable, completionAuthorizes, contentAddress, coordinationDriverAgent, createBudgetPool, createExecutor, createExecutorRegistry, createMcpEnvironment, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, createWorktreeCliExecutor, defaultAnalystInstruction, defaultAuditorInstruction, definePersona, defineStrategy, depthDriver, deterministicCompletion, discriminatingMeans, driverChild, driverExecutorFactory, driverRuntime, equalKOnCost, extractLlmCallEvent, fanout, flatWidenGate, gateOnDeliverable, gitWorkspace, harvestCorpus, inlineSandboxClient, isDriverSpec, jjWorkspace, localShell, loopDispatch, loopUntil, mapSandboxEvent, materializeTreeView, nestedScopeSeamKey, observe, openSandboxRun, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderReport, replaySpawnTree, reportLoopUsage, runAgentic, runBenchmark, runInWorkspace, runPersonified, runStrategyEvolution, sample, sampleThenRefine, selectChampion, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, supervisorSkill, trajectoryReport, verify, widen, withDriverExecutor, worktreeCoderFanout };
4069
+ export { Agent, AgentRunSpec, AgentSpec, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ArtifactHandle, type AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredCoderHarness, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, type BridgeSeam, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CliSeam, type CliWorktreeSeam, type CoderDeliverableOptions, type CoderWinnerStrategy, type CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, type CoordinationDriverOptions, type CoordinationMcpHandle, type Corpus, type CorpusFilter, type CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, type DefinePersona, type DefinePersonaInput, type Deliverable, type DeliverableSpec, type DriverChat, type DriverMessage, type DriverToolCall, type DriverTurn, type Environment, type EqualKArm, type EqualKOnCost, type EqualKOnCostOptions, type EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, Executor, type ExecutorConfig, ExecutorFactory, ExecutorRegistry, type Fanout, type FanoutOptions, type FanoutSynthesis, type FanoutWinnerSelector, FileCorpus, FileResultBlobStore, FileSpawnJournal, type FlatWidenGate, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, type Inbox, type InboxMessage, type IntentAudit, Iteration, type LoopDispatchOptions, type LoopOptionsForDispatch, LoopResult, type LoopShape, LoopTokenUsage, type LoopUntil, type LoopUntilSpec, type LoopUntilState, type McpEndpoint, type McpEnvironmentOptions, type NestedScopeSeam, NodeId, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunOptions, type Outcome, type Panel, type PanelJudge, type PanelSpec, type PanelVerdict, type Persona, type PersonaContext, type PersonaExecutors, type Pipeline, type PipelineStage, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, type RenderCorpusToInstructions, type RenderCorpusToInstructionsOptions, type ReservationTicket, ResultBlobStore, RootHandle, RouterConfig, type RouterSeam, type RouterToolsSeam, type RunAgenticOptions, RunLoopOptions, type RunPersonified, type RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, type SandboxSeam, Scope, type ScopeAnalyst, type ScopeAnalyzeInput, type ScopeWidenGate, type SessionCapableBox, type SessionMessageLike, type SessionTraceBox, Settled, type ShapeBudget, type ShapeContext, type ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, SpawnEvent, SpawnJournal, Spend, type SteerContext, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, SupervisedResult, Supervisor, type SurfaceScore, type ToolPartDecoder, ToolSpec, type ToolStepInput, type TraceSource, type TrajectoryAnalysis, type TrajectoryNode, type TrajectoryReport, type TrajectoryReportFn, type TrajectoryReportOptions, TreeView, type TurnResult, UsageEvent, type UsageSink, type VerifierEnvironmentOptions, type Verify, type VerifySpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, type Widen, type WidenDecision, type WidenLineage, type WidenSpec, type Workspace, type WorkspaceCommit, type WorkspaceRun, type WorktreeCliExecutorOptions, type WorktreeCoderFanoutOptions, type WorktreeCommandResult, type WorktreePatchArtifact, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertStrategyContract, assertTraceDerivedFindings, auditIntent, authorStrategy, authoredWorker, breadthDriver, buildSteerContext, builtinShapes, cliWorktreeExecutor, coderDeliverable, completionAuthorizes, contentAddress, coordinationDriverAgent, createBudgetPool, createExecutor, createExecutorRegistry, createInbox, createMcpEnvironment, createPartsTraceSource, createPushTraceSource, createRootHandle, createSandboxLineage, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, createWorktreeCliExecutor, decodeAnthropicPart, decodeOpenAiPart, decodeOpencodePart, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultToolDetectors, definePersona, defineStrategy, depthDriver, deterministicCompletion, discriminatingMeans, driverChild, driverExecutorFactory, driverRuntime, equalKOnCost, extractLlmCallEvent, fanout, flatWidenGate, gateOnDeliverable, gitWorkspace, harvestCorpus, inlineSandboxClient, isDriverSpec, jjWorkspace, localShell, loopDispatch, loopUntil, mapSandboxEvent, materializeTreeView, nestedScopeSeamKey, observe, openSandboxRun, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderReport, replaySpawnTree, reportLoopUsage, routerDriverChat, runAgentic, runBenchmark, runInWorkspace, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxSessionTraceSource, selectChampion, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, supervisorSkill, toToolSpan, toolPartDecoders, trajectoryReport, verify, watchTrace, widen, withDriverExecutor, worktreeCoderFanout };