@tangle-network/agent-runtime 0.128.0 → 0.131.1

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 (139) hide show
  1. package/README.md +70 -20
  2. package/dist/{activation-DhWJ3p8N.js → activation-BCzMOTaV.js} +3 -3
  3. package/dist/{activation-DhWJ3p8N.js.map → activation-BCzMOTaV.js.map} +1 -1
  4. package/dist/agent.d.ts +2 -3
  5. package/dist/agent.js +4 -5
  6. package/dist/agent.js.map +1 -1
  7. package/dist/{analyst-loop-DvSciOfB.js → analyst-loop-BE8cDs5Q.js} +2 -2
  8. package/dist/{analyst-loop-DvSciOfB.js.map → analyst-loop-BE8cDs5Q.js.map} +1 -1
  9. package/dist/analyst-loop.d.ts +1 -1
  10. package/dist/analyst-loop.js +1 -1
  11. package/dist/authoring-Dv3t6SXe.js +163 -0
  12. package/dist/authoring-Dv3t6SXe.js.map +1 -0
  13. package/dist/candidate-execution/index.js +4 -4
  14. package/dist/{candidate-execution-BFpq-Xi6.js → candidate-execution-BNxKr-Bu.js} +5 -5
  15. package/dist/{candidate-execution-BFpq-Xi6.js.map → candidate-execution-BNxKr-Bu.js.map} +1 -1
  16. package/dist/{conversation-BpLQZGPH.js → conversation-DNtxaJ1Z.js} +113 -31
  17. package/dist/conversation-DNtxaJ1Z.js.map +1 -0
  18. package/dist/conversation.d.ts +2 -2
  19. package/dist/conversation.js +2 -2
  20. package/dist/environment-provider-CxvSd1W6.d.ts +86 -0
  21. package/dist/{environment-provider-DqFS6FSZ.js → environment-provider-Dyg8DtLK.js} +8 -4
  22. package/dist/environment-provider-Dyg8DtLK.js.map +1 -0
  23. package/dist/environment-provider.d.ts +1 -1
  24. package/dist/environment-provider.js +1 -1
  25. package/dist/graph-xWdv53Le.js +471 -0
  26. package/dist/graph-xWdv53Le.js.map +1 -0
  27. package/dist/{improvement-cycle-IJgCbKWQ.js → improvement-cycle-Csp38cWg.js} +133 -224
  28. package/dist/improvement-cycle-Csp38cWg.js.map +1 -0
  29. package/dist/{index-BhZhQw77.d.ts → index-CoO7atyo.d.ts} +556 -1278
  30. package/dist/{index-BhuzfG2r.d.ts → index-DwGtu9nc.d.ts} +7 -9
  31. package/dist/{index-Efjb3nrQ.d.ts → index-qYHpsmG2.d.ts} +36 -18
  32. package/dist/index.d.ts +353 -11
  33. package/dist/index.js +111 -354
  34. package/dist/index.js.map +1 -1
  35. package/dist/intelligence.d.ts +6 -6
  36. package/dist/intelligence.js +9 -8
  37. package/dist/intelligence.js.map +1 -1
  38. package/dist/kernel.d.ts +7 -5
  39. package/dist/kernel.js +13 -9
  40. package/dist/{knowledge-DF63xPr4.js → knowledge-DPEu4f-0.js} +19 -17
  41. package/dist/knowledge-DPEu4f-0.js.map +1 -0
  42. package/dist/knowledge.d.ts +1 -1
  43. package/dist/knowledge.js +1 -1
  44. package/dist/{loop-runner-bin-Ckp_9tmD.d.ts → loop-runner-bin-BwgZ8m_7.d.ts} +6 -3
  45. package/dist/{loop-runner-bin-CWqOpCEw.js → loop-runner-bin-dg6li2-b.js} +5 -27
  46. package/dist/loop-runner-bin-dg6li2-b.js.map +1 -0
  47. package/dist/loop-runner-bin.d.ts +1 -1
  48. package/dist/loop-runner-bin.js +1 -1
  49. package/dist/materialization-COJ1UYQ-.js +272 -0
  50. package/dist/materialization-COJ1UYQ-.js.map +1 -0
  51. package/dist/mcp/bin.js +39 -47
  52. package/dist/mcp/bin.js.map +1 -1
  53. package/dist/mcp/index.d.ts +24 -26
  54. package/dist/mcp/index.js +67 -84
  55. package/dist/mcp/index.js.map +1 -1
  56. package/dist/mcp/memory-bin.js +1 -1
  57. package/dist/{memory-server-DL6cE2Ag.js → memory-server-eD2baiRO.js} +3 -3
  58. package/dist/{memory-server-DL6cE2Ag.js.map → memory-server-eD2baiRO.js.map} +1 -1
  59. package/dist/model-policy-CqziaqS1.js +232 -0
  60. package/dist/model-policy-CqziaqS1.js.map +1 -0
  61. package/dist/{openai-tools-B68JaOCx.d.ts → openai-tools-D3oMyVGl.d.ts} +2 -2
  62. package/dist/{openai-tools-D3XfrrQ6.js → openai-tools-zRphjXS4.js} +2 -2
  63. package/dist/openai-tools-zRphjXS4.js.map +1 -0
  64. package/dist/{prepare--8EvLqCr.js → prepare-DYWjVcPx.js} +169 -153
  65. package/dist/prepare-DYWjVcPx.js.map +1 -0
  66. package/dist/primeintellect/index.d.ts +7 -6
  67. package/dist/primeintellect/index.js +9 -11
  68. package/dist/primeintellect/index.js.map +1 -1
  69. package/dist/profiles.d.ts +21 -174
  70. package/dist/profiles.js +67 -276
  71. package/dist/profiles.js.map +1 -1
  72. package/dist/{protected-model-port-CXVfOUu_.js → protected-model-port-48ALLGxT.js} +2 -2
  73. package/dist/{protected-model-port-CXVfOUu_.js.map → protected-model-port-48ALLGxT.js.map} +1 -1
  74. package/dist/{redact-PQzmE1Jn.d.ts → redact-9_Gf-8m3.d.ts} +58 -69
  75. package/dist/{researcher-CoVqNhfI.js → researcher-Skz5-Uc8.js} +50 -26
  76. package/dist/researcher-Skz5-Uc8.js.map +1 -0
  77. package/dist/{run-layout-C2FGmZ3v.js → run-layout-CeJsEAom.js} +2 -2
  78. package/dist/{run-layout-C2FGmZ3v.js.map → run-layout-CeJsEAom.js.map} +1 -1
  79. package/dist/runtime-D-QfLbSd.d.ts +893 -0
  80. package/dist/{runtime-5uDVVfER.js → runtime-cOzDOOHr.js} +315 -1191
  81. package/dist/runtime-cOzDOOHr.js.map +1 -0
  82. package/dist/{sandbox-events-Yhd1GYWl.js → sandbox-events-CRDwc5WN.js} +42 -5
  83. package/dist/sandbox-events-CRDwc5WN.js.map +1 -0
  84. package/dist/snapshot-CXiiuHhL.js +21 -0
  85. package/dist/snapshot-CXiiuHhL.js.map +1 -0
  86. package/dist/{spawn-journal-DsZKDqeh.js → spawn-journal-saHQzqYi.js} +15 -21
  87. package/dist/spawn-journal-saHQzqYi.js.map +1 -0
  88. package/dist/stream-agent-turn-C852AgMT.d.ts +128 -0
  89. package/dist/stream-agent-turn-rYgaOLO0.js +910 -0
  90. package/dist/stream-agent-turn-rYgaOLO0.js.map +1 -0
  91. package/dist/{structural-rollout-zY0oqQzO.js → structural-rollout-3uxVGcg2.js} +459 -235
  92. package/dist/structural-rollout-3uxVGcg2.js.map +1 -0
  93. package/dist/{supervise-CsTKbH9R.js → supervise-DHYX8gO2.js} +867 -4788
  94. package/dist/supervise-DHYX8gO2.js.map +1 -0
  95. package/dist/{supervisor-DpjO0Gmy.js → supervisor-CV6Jh28D.js} +7439 -2897
  96. package/dist/supervisor-CV6Jh28D.js.map +1 -0
  97. package/dist/testing.d.ts +3 -1
  98. package/dist/testing.js +271 -221
  99. package/dist/testing.js.map +1 -1
  100. package/dist/{tool-server-RcWgLIsL.js → tool-server-Gs3VvfSK.js} +22 -9
  101. package/dist/tool-server-Gs3VvfSK.js.map +1 -0
  102. package/dist/{top-app-5unxqovu.js → top-app-G4M18b6i.js} +3 -3
  103. package/dist/{top-app-5unxqovu.js.map → top-app-G4M18b6i.js.map} +1 -1
  104. package/dist/tui/bin.js +1 -1
  105. package/dist/tui/index.js +1 -1
  106. package/dist/{environment-provider-CUFsyymu.d.ts → types-C6Q-J0Dt.d.ts} +51 -114
  107. package/dist/{types-DnNGJ5Gz.d.ts → types-ebIY0dMG.d.ts} +556 -30
  108. package/dist/{util-MVgdwuIS.js → util-Bw6srryQ.js} +3 -2
  109. package/dist/{util-MVgdwuIS.js.map → util-Bw6srryQ.js.map} +1 -1
  110. package/dist/{workspace-archive-BQxvkypI.js → workspace-archive-aOfJ47ms.js} +3 -3
  111. package/dist/{workspace-archive-BQxvkypI.js.map → workspace-archive-aOfJ47ms.js.map} +1 -1
  112. package/package.json +13 -15
  113. package/skills/agent-graphs/IMPROVE.md +3 -3
  114. package/skills/agent-graphs/SKILL.md +4 -5
  115. package/skills/agent-graphs/cases/review-pipeline.json +1 -2
  116. package/skills/agent-graphs/cases/unmeasured-harness.json +2 -4
  117. package/dist/backends-CiOCyRHb.js +0 -743
  118. package/dist/backends-CiOCyRHb.js.map +0 -1
  119. package/dist/conversation-BpLQZGPH.js.map +0 -1
  120. package/dist/environment-provider-DqFS6FSZ.js.map +0 -1
  121. package/dist/improvement-cycle-IJgCbKWQ.js.map +0 -1
  122. package/dist/index-DLM0W1h1.d.ts +0 -545
  123. package/dist/knowledge-DF63xPr4.js.map +0 -1
  124. package/dist/local-harness-BIajef4A.d.ts +0 -465
  125. package/dist/loop-runner-bin-CWqOpCEw.js.map +0 -1
  126. package/dist/model-resolution-Btd9iIKV.js +0 -98
  127. package/dist/model-resolution-Btd9iIKV.js.map +0 -1
  128. package/dist/openai-tools-D3XfrrQ6.js.map +0 -1
  129. package/dist/prepare--8EvLqCr.js.map +0 -1
  130. package/dist/researcher-CoVqNhfI.js.map +0 -1
  131. package/dist/runtime-5uDVVfER.js.map +0 -1
  132. package/dist/sandbox-events-Yhd1GYWl.js.map +0 -1
  133. package/dist/spawn-journal-DsZKDqeh.js.map +0 -1
  134. package/dist/structural-rollout-zY0oqQzO.js.map +0 -1
  135. package/dist/supervise-CsTKbH9R.js.map +0 -1
  136. package/dist/supervisor-DpjO0Gmy.js.map +0 -1
  137. package/dist/tool-server-RcWgLIsL.js.map +0 -1
  138. package/dist/types-C9j4qg6l.d.ts +0 -500
  139. package/skills/agent-graphs/cases/floor-trap-pi.json +0 -11
@@ -1,14 +1,14 @@
1
- import { d as AgentTaskStatus, f as BackendErrorDetail, i as AgentExecutionBackend, x as RuntimeStreamEvent } from "./types-C9j4qg6l.js";
1
+ import { C as MountRecorder, D as SelectionReceipt, E as SandboxClient, a as Iteration, b as LoopTraceEvent, d as LoopLineageOptions, i as ExecCtx, it as RuntimeStreamEvent, k as Validator, m as LoopResult, r as Driver, t as AgentRunSpec, w as OutputAdapter, x as LoopWinner, y as LoopTraceEmitter } from "./types-ebIY0dMG.js";
2
2
  import { n as AnalystRegistryLike } from "./types-zWfqDjeL.js";
3
3
  import { l as RuntimeHooks } from "./runtime-hooks-sbRpjStq.js";
4
- import { C as MountRecorder, D as SelectionReceipt, E as SandboxClient, a as Iteration, b as LoopTraceEvent, d as LoopLineageOptions, i as ExecCtx, k as Validator, m as LoopResult, r as Driver, t as AgentRunSpec, w as OutputAdapter, x as LoopWinner, y as LoopTraceEmitter } from "./types-DnNGJ5Gz.js";
5
- import { B as DefaultVerdict, Cn as PendingWait, Ct as SupervisedResult, En as WaitProbeRegistry, Et as TreeView, Gn as ExecutorProgress, H as Executor, I as Agent, K as ExecutorFactory, L as AgentExecutionRef, Nt as WorkerTraceResolver, Ot as UsageEvent, R as AgentSpec, Rn as TraceSource, Rt as TraceContext, St as SteerableRootHandle, V as ExecutionBindingReceipt, Xt as OtelExportConfig, Y as ExecutorRegistry, Zt as OtelExporter, _t as SpawnJournal, at as ProfileMaterializationReceipt, ct as ResumedKeyState, gt as SpawnEvent, ht as Settled, i as AgentEnvironmentProvider, jt as WorkerTraceEvidence, mt as Scope, nt as NodeId, o as AgentEnvironmentProviderRegistry, pt as Runtime, qn as WorkerProgress, rt as NodeSnapshot, st as ResultBlobStore, tt as NodeExecutionIdentity, ut as RootHandle, vt as SpawnOpts, w as ProviderExecutorOptions, wt as Supervisor, xt as Spend, z as Budget } from "./environment-provider-CUFsyymu.js";
4
+ import { B as Spend, D as ResumedKeyState, E as ResultBlobStore, F as SpawnEvent, G as TreeView, Gt as WaitProbeRegistry, H as SupervisedResult, Ht as PendingWait, I as SpawnJournal, L as SpawnOpts, M as Runtime, N as Scope, P as Settled, Q as WorkerTraceResolver, S as NodeSnapshot, U as Supervisor, V as SteerableRootHandle, X as WorkerTraceEvidence, a as DefaultVerdict, b as NodeExecutionIdentity, d as ExecutorFactory, fn as WorkerProgress, gt as OtelExporter, h as ExecutorResult, ht as OtelExportConfig, i as Budget, k as RootHandle, m as ExecutorRegistry, n as AgentExecutionRef, o as ExecutionBindingReceipt, q as UsageEvent, r as AgentSpec, rn as TraceSource, rt as TraceContext, s as Executor, t as Agent, w as ProfileMaterializationReceipt, x as NodeId } from "./types-C6Q-J0Dt.js";
6
5
  import { o as UiLens, r as UiFinding, s as CoderTask } from "./substrate-BcnuSHXm.js";
7
- import { E as ToolLoopCompactionOptions, f as runLocalHarness, h as RouterConfig, n as CodexExecutionPolicy, o as LocalHarness, r as CodexTokenUsage, v as ToolSpec, w as ToolLoopChat } from "./local-harness-BIajef4A.js";
8
- import { AgentEvalError, AgentEvalError as AgentEvalError$1, AgentEvalErrorCode, AgentProfile, AnalystFinding, AnalystFinding as AnalystFinding$1, AnalystFinding as AnalystFinding$2, AnalystRunInputs, ChatClient, ConfigError, DetectorSignal, HarnessType, JudgeError, MaximumCharge, NotFoundError, ProposalFinding, RankTestMethod, RunRecord, StreamingDetector, ToolSpan, TraceAnalysisStore, ValidationError, buildTrajectory, computeFindingId as computeFindingId$1, makeFinding as makeFinding$1 } from "@tangle-network/agent-eval";
9
- import { DispatchFn, JudgeConfig, ProfileDispatchFn, RunProfileMatrixOptions, RunProfileMatrixResult, Scenario } from "@tangle-network/agent-eval/campaign";
10
- import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentProfile as AgentProfile$1, AgentProfile as AgentProfile$2, AgentProfile as AgentProfile$3, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePrompt, AgentProfileResources, AgentProfileSecurityPolicy, CanonicalAgentProfileMaterializationAxis, Sha256Digest, profileMaterializationAxes } from "@tangle-network/agent-interface";
11
- import { WorkspacePlanReceipt } from "@tangle-network/agent-profile-materialize";
6
+ import { B as GitRunner, C as WorktreeHarnessResult, I as runLocalHarness, K as RouterTransportConfig, Y as ToolLoopChat, Z as ToolLoopCompactionOptions, a as ExecutorConfig, c as RouterToolsSeam, q as ToolSpec, v as Inbox, x as WorktreeCheckRunner } from "./runtime-D-QfLbSd.js";
7
+ import "./environment-provider-CxvSd1W6.js";
8
+ import "./stream-agent-turn-C852AgMT.js";
9
+ import { AgentEvalError, AgentEvalError as AgentEvalError$1, AgentEvalErrorCode, AgentProfile, AnalystFinding, AnalystFinding as AnalystFinding$1, AnalystFinding as AnalystFinding$2, AnalystRunInputs, ChatClient, ConfigError, CustomTokenPricing, DetectorSignal, HarnessType, JudgeError, MaximumCharge, NotFoundError, ProposalFinding, RankTestMethod, RunRecord, StreamingDetector, ToolSpan, TraceAnalysisStore, ValidationError, buildTrajectory, computeFindingId as computeFindingId$1, makeFinding as makeFinding$1 } from "@tangle-network/agent-eval";
10
+ import { DispatchFn, ExternalOptimizerModelCall, JudgeConfig, ProfileDispatchFn, RunProfileMatrixOptions, RunProfileMatrixResult, Scenario } from "@tangle-network/agent-eval/campaign";
11
+ import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentProfile as AgentProfile$1, AgentProfile as AgentProfile$2, AgentProfile as AgentProfile$3, AgentProfileMcpServer, AgentProfilePrompt, AgentProfileSecurityPolicy, CanonicalAgentProfileMaterializationAxis, Sha256Digest, profileMaterializationAxes as profileMaterializationAxes$1 } from "@tangle-network/agent-interface";
12
12
  import { BackendType, CreateSandboxOptions, CreateSandboxOptions as CreateSandboxOptions$1, PromptOptions, SandboxEvent, SandboxEvent as SandboxEvent$1, SandboxInstance, SandboxInstance as SandboxInstance$1 } from "@tangle-network/sandbox";
13
13
  import { stuckLoopView, toolWasteView } from "@tangle-network/agent-eval/pipelines";
14
14
  //#region src/agent/profile-materialization.d.ts
@@ -73,10 +73,10 @@ declare const promptControlProfileMaterialization: ProfileMaterializationContrac
73
73
  * Materialization contract for `createSandboxAct`.
74
74
  *
75
75
  * `createSandboxAct` hands the whole `AgentProfile` to the sandbox as `backend.profile`, so every
76
- * profile leaf crosses the boundary. `buildBackendOptions` resolves the runner from an explicit
77
- * `sandboxOverrides.backend.type`, then `profile.metadata.backendType`, then `profile.harness`,
78
- * so a candidate that changes only `harness` runs on the harness it declares and one declaring
79
- * a harness the sandbox cannot run throws rather than running elsewhere and reporting success.
76
+ * profile leaf crosses the boundary. `buildBackendOptions` resolves the runner only from
77
+ * `profile.harness`; an explicit `sandboxOverrides.backend.type` may confirm that choice but cannot
78
+ * replace it. A candidate declaring a harness the sandbox cannot run throws rather than running
79
+ * elsewhere and reporting success.
80
80
  */
81
81
  declare const sandboxActProfileMaterialization: ProfileMaterializationContract;
82
82
  /** Materialization contract for a run path that only injects prompt text. */
@@ -157,6 +157,8 @@ interface SpawnForest {
157
157
  * In-memory `ResultBlobStore`. Content-addressed: `put` verifies the supplied
158
158
  * `outRef` matches the artifact's hash so a stale/forged ref fails loud rather than
159
159
  * silently rehydrating the wrong payload. Idempotent on an identical re-put.
160
+ *
161
+ * @stable
160
162
  */
161
163
  declare class InMemoryResultBlobStore implements ResultBlobStore {
162
164
  private readonly blobs;
@@ -167,6 +169,8 @@ declare class InMemoryResultBlobStore implements ResultBlobStore {
167
169
  * FS `ResultBlobStore`. One JSON file per artifact under `dir`, named by a
168
170
  * filesystem-safe encoding of the `outRef` (`sha256:<hex>` → `sha256-<hex>.json`).
169
171
  * `put` fsyncs so a crash between writes never loses an acknowledged blob.
172
+ *
173
+ * @stable
170
174
  */
171
175
  declare class FileResultBlobStore implements ResultBlobStore {
172
176
  private readonly dir;
@@ -181,6 +185,8 @@ declare class FileResultBlobStore implements ResultBlobStore {
181
185
  * - an event before `beginTree` is a corrupted tree (fail loud),
182
186
  * - a duplicate `seq` within a tree is a corrupted cursor (fail loud) — two
183
187
  * settlements cannot share the cursor position replay orders by.
188
+ *
189
+ * @stable
184
190
  */
185
191
  declare class InMemorySpawnJournal implements SpawnJournal {
186
192
  private readonly trees;
@@ -194,6 +200,8 @@ declare class InMemorySpawnJournal implements SpawnJournal {
194
200
  * filtering by `root`, and applies the same begin-precedes-events + unique-seq
195
201
  * corruption guards as the in-memory impl. Each append fsyncs so a crash between
196
202
  * writes never loses an acknowledged event.
203
+ *
204
+ * @stable
197
205
  */
198
206
  declare class FileSpawnJournal implements SpawnJournal {
199
207
  private readonly path;
@@ -234,6 +242,8 @@ declare function loadSpawnForest(journal: SpawnJournal, root: NodeId): Promise<S
234
242
  * resolves. `at` (wall-clock) is never a replay input. Fail loud on a tree that was
235
243
  * never begun, a settled-done event missing its `outRef`, or a blob the store can't
236
244
  * rehydrate — a silent gap would let `act` branch on the wrong evidence.
245
+ *
246
+ * @stable
237
247
  */
238
248
  declare function replaySpawnTree(journal: SpawnJournal, blobs: ResultBlobStore, root: NodeId): Promise<Settled<unknown>[]>;
239
249
  /**
@@ -270,6 +280,18 @@ interface DeliverableSpec<Out = unknown> {
270
280
  * executor has produced its output. The inner `score` is preserved; only `valid` is gated.
271
281
  */
272
282
  declare function gateOnDeliverable<Out>(inner: Executor<Out>, deliverable: DeliverableSpec<Out>): Executor<Out>;
283
+ interface ExecutorResultMapping<Out> {
284
+ outRef: string;
285
+ out: Out;
286
+ verdict?: DefaultVerdict;
287
+ }
288
+ /**
289
+ * Transform a Runtime executor's terminal artifact without losing its private
290
+ * profile-materialization attestation or altering its measured spend. This is
291
+ * the composition point for deterministic post-processing and grading; callers
292
+ * must not rebuild an Executor around a model transport merely to change `out`.
293
+ */
294
+ declare function mapExecutorResult<In, Out>(inner: Executor<In>, map: (result: ExecutorResult<In>, task: unknown) => ExecutorResultMapping<Out> | Promise<ExecutorResultMapping<Out>>): Executor<Out>;
273
295
  //#endregion
274
296
  //#region src/runtime/supervise/detector-monitor.d.ts
275
297
  interface WatchTraceOptions {
@@ -343,6 +365,9 @@ interface BusStats {
343
365
  /** Count published per event `type`. */
344
366
  readonly byKind: Readonly<Record<string, number>>;
345
367
  }
368
+ /** The child→parent coordination bus surface: publish, priority-ordered pull, pass-through subscribe, history, and stats.
369
+ * @experimental In-process only — the durable cross-process mailbox this interface is designed
370
+ * to admit is not implemented (docs/agent-managed-compute/README.md). */
346
371
  interface EventBus<E extends BusEvent> {
347
372
  /** Stamp the event, await every subscriber in order, then make it pull-visible. A subscriber
348
373
  * failure leaves the event invisible and retrying the SAME event object reuses the exact stamp.
@@ -361,7 +386,8 @@ interface EventBus<E extends BusEvent> {
361
386
  /** Throughput counters for observability dashboards. */
362
387
  stats(): BusStats;
363
388
  }
364
- /** Create the child→parent coordination bus: one typed pipe for settled outputs, questions, and analyst findings, with a priority-ordered pull queue and a pass-through subscribe lane. */
389
+ /** Create the child→parent coordination bus: one typed pipe for settled outputs, questions, and analyst findings, with a priority-ordered pull queue and a pass-through subscribe lane.
390
+ * @experimental In-process queue; durability is a transport swap that does not exist yet. */
365
391
  declare function createEventBus<E extends BusEvent>(now?: () => number): EventBus<E>;
366
392
  //#endregion
367
393
  //#region src/mcp/detached-coder.d.ts
@@ -445,7 +471,7 @@ declare class PlannerError extends AgentEvalError {
445
471
  }
446
472
  //#endregion
447
473
  //#region src/mcp/delegation-store.d.ts
448
- /** @experimental */
474
+ /** @stable */
449
475
  interface DelegationStore {
450
476
  /**
451
477
  * Read every persisted record. Called once, by
@@ -474,7 +500,7 @@ interface DelegationStore {
474
500
  * (the bin maps `AGENT_RUNTIME_DELEGATION_STATE_RECOVER=1` onto it),
475
501
  * which archives the corrupt file and starts fresh.
476
502
  *
477
- * @experimental
503
+ * @stable
478
504
  */
479
505
  declare class DelegationStateCorruptError extends AgentEvalError$1 {
480
506
  constructor(message: string, options?: {
@@ -487,14 +513,14 @@ declare class DelegationStateCorruptError extends AgentEvalError$1 {
487
513
  * accepting new submissions — accepting work it cannot journal would
488
514
  * silently demote durable mode to in-memory mode.
489
515
  *
490
- * @experimental
516
+ * @stable
491
517
  */
492
518
  declare class DelegationPersistenceError extends AgentEvalError$1 {
493
519
  constructor(message: string, options?: {
494
520
  cause?: unknown;
495
521
  });
496
522
  }
497
- /** In-memory `DelegationStore` — suitable for single-process use and tests. @experimental */
523
+ /** In-memory `DelegationStore` — suitable for single-process use and tests. @stable */
498
524
  declare class InMemoryDelegationStore implements DelegationStore {
499
525
  private readonly records;
500
526
  loadAll(): Promise<DelegationRecord[]>;
@@ -502,7 +528,7 @@ declare class InMemoryDelegationStore implements DelegationStore {
502
528
  lookupIdempotencyKey(key: string): Promise<string | undefined>;
503
529
  remove(taskIds: readonly string[]): Promise<void>;
504
530
  }
505
- /** @experimental */
531
+ /** @stable */
506
532
  interface FileDelegationStoreOptions {
507
533
  /** Absolute path of the JSON state file. Parent directories are created on first write. */
508
534
  filePath: string;
@@ -524,7 +550,7 @@ interface FileDelegationStoreOptions {
524
550
  * records): full-snapshot writes keep the format trivially inspectable
525
551
  * and corruption-detectable without a database dependency.
526
552
  *
527
- * @experimental
553
+ * @stable
528
554
  */
529
555
  declare class FileDelegationStore implements DelegationStore {
530
556
  private readonly filePath;
@@ -656,9 +682,8 @@ interface DelegateCodeArgs {
656
682
  /** Optional free-form context the agent surfaces in the prompt prelude. */
657
683
  contextHint?: string;
658
684
  /**
659
- * When > 1, dispatches `multiHarnessCoderFanout` across N harnesses
660
- * (claude-code, codex, opencode-glm) and picks the highest-scoring
661
- * passing patch. Default 1.
685
+ * When > 1, dispatches `multiHarnessCoderFanout` across the delegate's configured exact profiles
686
+ * and picks the highest-scoring passing patch. Default 1.
662
687
  */
663
688
  variants?: number;
664
689
  /** Validator + prompt overrides the agent knows for this repo. */
@@ -904,13 +929,13 @@ interface DelegationHistoryResult {
904
929
  }
905
930
  //#endregion
906
931
  //#region src/mcp/task-queue.d.ts
907
- /** Arguments accepted by the durable delegation queue. @experimental */
932
+ /** Arguments accepted by the durable delegation queue. @stable */
908
933
  type DelegationArgs = DelegateCodeArgs | DelegateResearchArgs | DelegateUiAuditArgs;
909
934
  /**
910
935
  * Must be JSON-safe end to end (`args`, `result`, `error`, `feedback`) —
911
936
  * persistent stores round-trip records through `JSON.stringify`.
912
937
  *
913
- * @experimental
938
+ * @stable
914
939
  */
915
940
  interface DelegationRecord {
916
941
  taskId: string;
@@ -954,7 +979,7 @@ interface DelegationRecord {
954
979
  /** Caller span that dispatched the delegation, when one was inherited. */
955
980
  parentSpanId?: string;
956
981
  }
957
- /** @experimental */
982
+ /** @stable */
958
983
  interface SubmitInput<Args extends DelegationArgs> {
959
984
  profile: DelegationProfile;
960
985
  args: Args;
@@ -975,7 +1000,7 @@ interface SubmitInput<Args extends DelegationArgs> {
975
1000
  */
976
1001
  run: (ctx: DelegationRunContext) => Promise<DelegationResultPayload['output']>;
977
1002
  }
978
- /** @experimental Context handed to a `SubmitInput.run` function. */
1003
+ /** @stable Context handed to a `SubmitInput.run` function. */
979
1004
  interface DelegationRunContext {
980
1005
  signal: AbortSignal;
981
1006
  report(progress: DelegationProgress): void;
@@ -1000,7 +1025,7 @@ interface DelegationRunContext {
1000
1025
  */
1001
1026
  traceEmitter?: LoopTraceEmitter;
1002
1027
  }
1003
- /** @experimental */
1028
+ /** @stable */
1004
1029
  interface SubmitOutput {
1005
1030
  taskId: string;
1006
1031
  /** True when a prior matching `idempotencyKey` returned an existing record. */
@@ -1012,7 +1037,7 @@ interface SubmitOutput {
1012
1037
  * completed | running | failed per pass). `running` schedules another tick
1013
1038
  * after `intervalMs`; `completed` / `failed` settle the record.
1014
1039
  *
1015
- * @experimental
1040
+ * @stable
1016
1041
  */
1017
1042
  type DelegationResumeTick = {
1018
1043
  state: 'running';
@@ -1024,7 +1049,7 @@ type DelegationResumeTick = {
1024
1049
  state: 'failed';
1025
1050
  error: DelegationError;
1026
1051
  };
1027
- /** @experimental */
1052
+ /** @stable */
1028
1053
  interface DelegationResumeContext {
1029
1054
  /** Fired by `cancel(taskId)`; the driver should stop the remote run when it can. */
1030
1055
  signal: AbortSignal;
@@ -1038,7 +1063,7 @@ interface DelegationResumeContext {
1038
1063
  * thrown error settles the record as failed; `failed` ticks are treated as
1039
1064
  * terminal and are not retried.
1040
1065
  *
1041
- * @experimental
1066
+ * @stable
1042
1067
  */
1043
1068
  interface DelegationResumeDriver {
1044
1069
  tick(task: {
@@ -1048,7 +1073,7 @@ interface DelegationResumeDriver {
1048
1073
  /** Delay between `running` ticks, in milliseconds. Default 5000. */
1049
1074
  intervalMs?: number;
1050
1075
  }
1051
- /** @experimental */
1076
+ /** @stable */
1052
1077
  interface DelegationTaskQueueOptions {
1053
1078
  /** ID generator override; default `randomTaskId`. */
1054
1079
  generateId?: () => string;
@@ -1086,7 +1111,7 @@ interface DelegationTaskQueueOptions {
1086
1111
  */
1087
1112
  traceContext?: TraceContext;
1088
1113
  }
1089
- /** In-process queue for async delegation tasks — submit, cancel, poll status, and read history. @experimental */
1114
+ /** In-process queue for async delegation tasks — submit, cancel, poll status, and read history. @stable */
1090
1115
  declare class DelegationTaskQueue {
1091
1116
  private readonly records;
1092
1117
  private readonly controllers;
@@ -1182,7 +1207,7 @@ declare class DelegationTaskQueue {
1182
1207
  * Best-effort stable hash for use as `idempotencyKey`. Not cryptographic;
1183
1208
  * collisions only affect dedupe, never correctness.
1184
1209
  *
1185
- * @experimental
1210
+ * @stable
1186
1211
  */
1187
1212
  declare function hashIdempotencyInput(value: unknown): string;
1188
1213
  //#endregion
@@ -1289,8 +1314,8 @@ interface RunDetachedTurnOptions {
1289
1314
  * `'detached-turn'`) so trace-context inheritance survives the detached
1290
1315
  * path — the same events the streaming `runAgentRounds` path would emit, minus
1291
1316
  * per-token telemetry: `driveTurn` yields one terminal payload, so token
1292
- * and cost figures are structurally unavailable and reported as 0 under
1293
- * this driver tag.
1317
+ * and cost figures are structurally unavailable; zero observed subtotals are
1318
+ * marked incomplete under this driver tag.
1294
1319
  */
1295
1320
  traceEmitter?: LoopTraceEmitter;
1296
1321
  /** Physical placement stamped on the synthesized dispatch event. Default `'sibling'`. */
@@ -1459,10 +1484,8 @@ interface DelegateRunCtx {
1459
1484
  type CoderDelegate = (args: DelegateCodeArgs, ctx: DelegateRunCtx) => Promise<CoderOutput>;
1460
1485
  /**
1461
1486
  * UI-auditor delegate — fully consumer-injected. agent-runtime ships no
1462
- * default factory because the inputs are workspace path + judge function
1463
- * + (optionally) a `SandboxClient`, and the judge is the consumer's
1464
- * model seam. See `createInProcessUiAuditClient` + `uiAuditorProfile` in
1465
- * `@tangle-network/agent-runtime/profiles` for the canonical wiring.
1487
+ * default factory because execution belongs to a caller-supplied exact
1488
+ * agent profile and Runtime executor.
1466
1489
  *
1467
1490
  * @experimental
1468
1491
  */
@@ -1513,27 +1536,13 @@ interface DetachedSessionDelegateOptions {
1513
1536
  */
1514
1537
  sandboxClient?: SandboxClient;
1515
1538
  /**
1516
- * The worker's authored `AgentProfile` (§1.5: the system authors profiles). Spread onto the
1517
- * sandbox-session run spec → `runAgentRounds` → the executor's `harnessInvocation`, so the harness runs
1518
- * under the caller's stance. Omit to use a minimal model-only default (no hardcoded skills/tools);
1519
- * `harness` / `model` / `systemPrompt` below are convenience overrides layered onto whichever
1520
- * profile is used.
1521
- */
1522
- workerProfile?: AgentProfile$1;
1523
- /** Backend harness for the single-coder path (sets `metadata.backendType`). Default `claude-code`. */
1524
- harness?: string;
1525
- /** Model override for the single-coder path. */
1526
- model?: string;
1527
- /**
1528
- * The worker's authored system prompt (§1.5). Flows onto the run spec's
1529
- * `profile.prompt.systemPrompt` → through `runAgentRounds` → the executor's `harnessInvocation`, so the
1530
- * harness runs under this stance. Omit to keep the profile's own prompt.
1539
+ * The worker's exact authored `AgentProfile` (§1.5: the system authors profiles). It is the sole
1540
+ * harness/provider/model/prompt authority for the single-coder path and the default identity for
1541
+ * repeated fanout shots.
1531
1542
  */
1532
- systemPrompt?: string;
1533
- /** Default `['claude-code', 'codex', 'opencode/zai-coding-plan/glm-5.1']` when variants > 1. */
1534
- fanoutHarnesses?: string[];
1535
- /** Optional per-harness model override for `variants > 1`. */
1536
- fanoutModels?: (string | undefined)[];
1543
+ workerProfile: AgentProfile$1;
1544
+ /** Optional exact identities for heterogeneous fanout. Omit to repeat `workerProfile`. */
1545
+ fanoutProfiles?: ReadonlyArray<AgentProfile$1>;
1537
1546
  /** Hard cap on the kernel's per-batch concurrency. Default 4. */
1538
1547
  maxConcurrency?: number;
1539
1548
  /**
@@ -1595,8 +1604,6 @@ interface SettleDetachedCoderTurnOptions {
1595
1604
  /** Session id of the detached turn — used as the synthesized event id. */
1596
1605
  sessionId: string;
1597
1606
  signal: AbortSignal;
1598
- harness?: string;
1599
- model?: string;
1600
1607
  /** Same gate as the streaming path: an unapproved candidate cannot win. */
1601
1608
  reviewer?: CoderReviewer;
1602
1609
  }
@@ -1618,7 +1625,7 @@ interface SettleDetachedCoderTurnOptions {
1618
1625
  declare function settleDetachedCoderTurn(turn: DetachedTurn, options: SettleDetachedCoderTurnOptions): Promise<CoderOutput>;
1619
1626
  //#endregion
1620
1627
  //#region src/mcp/feedback-store.d.ts
1621
- /** @experimental */
1628
+ /** @stable */
1622
1629
  interface FeedbackEvent {
1623
1630
  id: string;
1624
1631
  refersTo: DelegateFeedbackArgs['refersTo'];
@@ -1627,7 +1634,7 @@ interface FeedbackEvent {
1627
1634
  capturedAt: string;
1628
1635
  namespace?: string;
1629
1636
  }
1630
- /** @experimental */
1637
+ /** @stable */
1631
1638
  interface FeedbackStore {
1632
1639
  /** Append a new event. Never dedupes — every rating is its own event. */
1633
1640
  put(event: FeedbackEvent): Promise<void>;
@@ -1640,7 +1647,7 @@ interface FeedbackStore {
1640
1647
  refersToRef?: string;
1641
1648
  }): Promise<FeedbackEvent[]>;
1642
1649
  }
1643
- /** In-memory `FeedbackStore` — suitable for single-process use and tests. @experimental */
1650
+ /** In-memory `FeedbackStore` — suitable for single-process use and tests. @stable */
1644
1651
  declare class InMemoryFeedbackStore implements FeedbackStore {
1645
1652
  private readonly events;
1646
1653
  put(event: FeedbackEvent): Promise<void>;
@@ -1653,7 +1660,7 @@ declare class InMemoryFeedbackStore implements FeedbackStore {
1653
1660
  * Project a `FeedbackEvent` down to the snapshot shape carried on
1654
1661
  * `delegation_history` entries.
1655
1662
  *
1656
- * @experimental
1663
+ * @stable
1657
1664
  */
1658
1665
  declare function eventToSnapshot(event: FeedbackEvent): DelegationFeedbackSnapshot;
1659
1666
  //#endregion
@@ -1697,570 +1704,12 @@ interface JsonRpcResponse {
1697
1704
  };
1698
1705
  }
1699
1706
  //#endregion
1700
- //#region src/mcp/worktree.d.ts
1701
- /**
1702
- *
1703
- * Git worktree helpers for the in-process delegation executor. Each
1704
- * delegation runs in its own worktree so multiple parallel harness
1705
- * subprocesses (claude / codex / opencode in a 3-way fanout) don't clobber
1706
- * each other's edits on the shared workspace.
1707
- *
1708
- * Worktrees live under `<repoRoot>/.agent-worktrees/<runId>/`. After the
1709
- * harness exits + the diff is captured, the worktree is removed.
1710
- *
1711
- * All operations spawn `git` via `child_process.spawn` synchronously
1712
- * (via a `runGit` helper). Stays narrow on purpose: no commits, no rebases.
1713
- * Diff capture stages all changes (`git add -A`) into the ephemeral worktree's
1714
- * index so created (untracked) files appear in the `--cached` diff.
1715
- *
1716
- * @experimental
1717
- */
1718
- /** @experimental */
1719
- interface WorktreeHandle {
1720
- /** Absolute path to the worktree directory. */
1721
- path: string;
1722
- /** SHA the worktree was created at. */
1723
- baseSha: string;
1724
- /** Branch name created for this worktree (typically `delegate/<runId>`). */
1725
- branch: string;
1726
- }
1727
- /** @experimental */
1728
- interface CreateWorktreeOptions {
1729
- /** Absolute path to the main git checkout. */
1730
- repoRoot: string;
1731
- /** Unique id for the worktree path + branch. Use the delegation run id. */
1732
- runId: string;
1733
- /** Parent directory the worktree lives under. Defaults to `.agent-worktrees`. */
1734
- variantsDir?: string;
1735
- /** Override the base ref (default `HEAD`). */
1736
- baseRef?: string;
1737
- /** Test seam — inject a custom git runner. */
1738
- runGit?: GitRunner;
1739
- }
1740
- /** @experimental */
1741
- interface DiffOptions {
1742
- /** Worktree to diff. */
1743
- worktree: WorktreeHandle;
1744
- /** What to compare against. Default `worktree.baseSha`. */
1745
- baseRef?: string;
1746
- /**
1747
- * Repository-relative input paths to omit from the captured worker patch.
1748
- * Paths are passed to Git with literal exclusion magic, so profile-provided
1749
- * `*`, `?`, `[` and `:` characters can never expand into broader pathspecs.
1750
- */
1751
- excludePaths?: ReadonlyArray<string>;
1752
- /** Test seam. */
1753
- runGit?: GitRunner;
1754
- }
1755
- /** @experimental */
1756
- interface DiffResult {
1757
- patch: string;
1758
- stats: {
1759
- filesChanged: number;
1760
- insertions: number;
1761
- deletions: number;
1762
- };
1763
- }
1764
- /** @experimental */
1765
- interface RemoveWorktreeOptions {
1766
- worktree: WorktreeHandle;
1767
- repoRoot: string;
1768
- /** Force removal even if dirty (default true; the loser of a fanout has uncommitted changes). */
1769
- force?: boolean;
1770
- /** Test seam. */
1771
- runGit?: GitRunner;
1772
- }
1773
- /** Pluggable git runner (sync) — replaceable in tests. */
1774
- type GitRunner = (args: ReadonlyArray<string>, opts: {
1775
- cwd: string;
1776
- }) => {
1777
- stdout: string;
1778
- stderr: string;
1779
- exitCode: number;
1780
- };
1781
- /** Checkout a fresh git worktree for a delegation run on a new branch under `variantsDir`. @experimental */
1782
- declare function createWorktree(options: CreateWorktreeOptions): Promise<WorktreeHandle>;
1783
- /** Stage worker changes and return the diff + shortstat, excluding declared input paths. @experimental */
1784
- declare function captureWorktreeDiff(options: DiffOptions): Promise<DiffResult>;
1785
- /**
1786
- * Remove a git worktree and delete its branch. Already-removed paths are harmless; every other
1787
- * Git failure rejects so callers cannot report a worktree as destroyed when cleanup failed.
1788
- * @experimental
1789
- */
1790
- declare function removeWorktree(options: RemoveWorktreeOptions): Promise<void>;
1791
- //#endregion
1792
- //#region src/mcp/worktree-harness.d.ts
1793
- /** Outcome of one verification command run in the worktree (test or typecheck). */
1794
- interface WorktreeCommandResult {
1795
- /** The shell command line that was run. */
1796
- command: string;
1797
- /** Did the command exit 0? The PASS signal a deliverable gate / coder output reads. */
1798
- passed: boolean;
1799
- /** OS exit code, or `null` when killed before exit. */
1800
- exitCode: number | null;
1801
- /** Combined stdout+stderr (capped) — surfaced in traces for diagnosis. */
1802
- output: string;
1803
- }
1804
- /** Proof of the profile inputs delivered before the worker process started. */
1805
- interface WorktreeProfileMaterializationReceipt {
1806
- /** Digest of the exact materializer plan: files, modes, environment, flags, and unsupported rows. */
1807
- workspacePlanDigest: string;
1808
- /** Repository-relative profile input files written into the worker worktree. */
1809
- writtenPaths: string[];
1810
- /** Must be empty on a successful run because this path fails closed. */
1811
- unsupported: WorkspacePlanReceipt['unsupported'];
1812
- /** Environment variable names added to the worker process. Values remain out of telemetry. */
1813
- environmentNames: string[];
1814
- /** Exact additional CLI arguments emitted by the materializer. */
1815
- flags: string[];
1816
- /** `resources.instructions` bypasses native project files so reproducible Codex cannot drop it. */
1817
- resourceInstructions: {
1818
- delivery: 'none' | 'invocation-prompt';
1819
- sha256: string | null;
1820
- byteLength: number;
1821
- };
1822
- }
1823
- /** The canonical result of one worktree-harness run, projected by each port to its own shape. */
1824
- interface WorktreeHarnessResult {
1825
- /** The branch the worktree was cut on (`delegate/<runId>`). */
1826
- branch: string;
1827
- /** `git diff` of the worktree against its base — the unified patch the harness produced. */
1828
- patch: string;
1829
- /** Shortstat-derived change counts. */
1830
- stats: {
1831
- filesChanged: number;
1832
- insertions: number;
1833
- deletions: number;
1834
- };
1835
- /**
1836
- * Exact profile materialization applied before the harness launched.
1837
- * Absent on transports that cannot return a materializer receipt; never fabricated.
1838
- */
1839
- profileMaterialization?: WorktreeProfileMaterializationReceipt;
1840
- /** The harness subprocess outcome. */
1841
- harness: {
1842
- name: LocalHarness | 'bridge';
1843
- exitCode: number | null;
1844
- timedOut: boolean;
1845
- killedBySignal: NodeJS.Signals | null;
1846
- durationMs: number;
1847
- stdout: string;
1848
- stderr: string;
1849
- /** Exact Codex JSONL usage when reproducible mode is enabled. */
1850
- usage?: CodexTokenUsage;
1851
- /** Installed CLI version captured immediately before execution. */
1852
- cliVersion?: string;
1853
- /** SHA-256 of the native Codex executable staged read-only in the candidate worktree. */
1854
- executableSha256?: string;
1855
- /** SHA-256 of the exact composed prompt argument proved present in Codex's rendered prompt. */
1856
- requestedPromptSha256?: string;
1857
- /** SHA-256 of `codex debug prompt-input` output for the exact isolated prompt. */
1858
- effectivePromptSha256?: string;
1859
- /** SHA-256 of the exact executable + argv with prompt content replaced by `<PROMPT>`. */
1860
- nonPromptArgsSha256?: string;
1861
- /** SHA-256 of the isolated config that fixes permissions and shell environment. */
1862
- controlledConfigSha256?: string;
1863
- /** SHA-256 of the normalized caller-supplied host read-denial paths. */
1864
- readDeniedPathsSha256?: string;
1865
- /** Sorted normalized caller-supplied host read-denial paths. */
1866
- readDeniedPaths?: string[];
1867
- /** Number of normalized caller-supplied host read-denial paths. */
1868
- readDeniedPathCount?: number;
1869
- /** Explicit isolation claims checked before model execution. */
1870
- executionPolicy?: CodexExecutionPolicy;
1871
- };
1872
- /** Verification signals derived in the live worktree (present only when commands were given). */
1873
- checks?: {
1874
- tests?: WorktreeCommandResult;
1875
- typecheck?: WorktreeCommandResult;
1876
- };
1877
- }
1878
- /** The single shell-command-in-worktree runner seam (replaces the per-executor copies). */
1879
- type WorktreeCheckRunner = (opts: {
1880
- command: string;
1881
- cwd: string;
1882
- timeoutMs: number;
1883
- signal?: AbortSignal;
1884
- }) => Promise<{
1885
- exitCode: number | null;
1886
- output: string;
1887
- }>;
1888
- //#endregion
1889
- //#region src/runtime/supervise/inbox.d.ts
1890
- /**
1891
- *
1892
- * The worker-side receive end of the down-leg: a per-worker inbox an executor exposes as
1893
- * `Executor.deliver`. The driver's `steer_agent` / `answer_question` land here,
1894
- * and the worker's agent loop drains them at two points (Drew's two delivery modes):
1895
- *
1896
- * - QUEUED (default): the message accumulates and is FLUSHED at the next step boundary — folded
1897
- * into the conversation before the next think. A worker is also forced to flush BEFORE it may
1898
- * settle, so it can never finish while a steer/answer it never read is still pending.
1899
- * - FORCEFUL (`interrupt: true`): trips `freshInterrupt()`'s signal so the loop can abort its
1900
- * in-flight turn immediately, then re-plan with the message folded in — breaking the worker out
1901
- * of a wrong path mid-task instead of waiting for it to finish the step.
1902
- *
1903
- * `deliver` never throws — a malformed message is ignored and returns `false`, so no caller can
1904
- * report delivery for bytes this inbox discarded.
1905
- *
1906
- * @experimental
1907
- */
1908
- interface InboxMessage {
1909
- readonly kind: 'steer' | 'answer';
1910
- readonly text: string;
1911
- /** Forceful messages abort the in-flight turn; queued ones wait for the boundary flush. */
1912
- readonly interrupt: boolean;
1913
- /** Present for an `answer` — the question id it resolves. */
1914
- readonly questionId?: string;
1915
- }
1916
- interface Inbox {
1917
- /** The `Executor.deliver` implementation. Returns false when the raw message is malformed and
1918
- * therefore was not queued; callers must not acknowledge a message this inbox discarded. */
1919
- deliver(msg: unknown): boolean;
1920
- /** Remove and return all pending messages (the flush). */
1921
- drain(): InboxMessage[];
1922
- pending(): number;
1923
- /** Open a fresh per-turn interrupt signal; a later forceful `deliver` aborts it. The loop links
1924
- * this into the signal it passes to its inference call, then re-plans when it fires. */
1925
- freshInterrupt(): AbortSignal;
1926
- /** Render drained messages as ONE operator turn to fold into the worker's conversation. */
1927
- fold(messages: ReadonlyArray<InboxMessage>): string;
1928
- }
1929
- /** Create the worker-side inbox for the down-leg: the driver's `steer_agent` / `answer_question` messages queue here and the worker's loop drains them at step boundaries and before settle. */
1930
- declare function createInbox(): Inbox;
1931
- //#endregion
1932
- //#region src/runtime/supervise/sandbox-session.d.ts
1933
- /** Ceiling on continuation turns. Turn 0 is the task; every later turn is a folded steer, so
1934
- * this bounds how many times a supervisor may redirect ONE worker before it must respawn. */
1935
- declare const DEFAULT_SANDBOX_STEERING_MAX_TURNS = 24;
1936
- /** Opt-in configuration for the steerable sandbox worker (`SandboxSeam.steering`). Absent, the
1937
- * sandbox executor keeps its historical single-shot `runAgentRounds` composition verbatim. */
1938
- interface SandboxSteeringOptions {
1939
- /** Max turns for one worker (turn 0 + folded steers). Default {@link DEFAULT_SANDBOX_STEERING_MAX_TURNS}. */
1940
- readonly maxTurns?: number;
1941
- /** How many recent tool/turn notes `progress()` reports. Default 12. */
1942
- readonly activityWindow?: number;
1943
- /** Per-turn wall-clock ceiling; the turn's stream is aborted when it elapses. */
1944
- readonly turnTimeoutMs?: number;
1945
- }
1946
- /** What the steerable session exposes to its executor: the usage stream plus the live reads. */
1947
- interface SteerableSandboxSession {
1948
- /** Drive the worker to settlement. `signal` is the spawn-scoped abort handed to `execute`. */
1949
- stream(task: unknown, signal: AbortSignal): AsyncIterable<UsageEvent>;
1950
- progress(): ExecutorProgress;
1951
- traceSource(): TraceSource;
1952
- artifact(): {
1953
- outRef: string;
1954
- out: unknown;
1955
- spent: Spend;
1956
- } | undefined;
1957
- teardown(): Promise<void>;
1958
- }
1959
- interface SteerableSandboxArgs {
1960
- readonly controller: AbortController;
1961
- readonly profile: AgentProfile$1;
1962
- readonly harness: BackendType;
1963
- readonly sandboxClient: SandboxClient;
1964
- readonly inbox: Inbox;
1965
- readonly taskToPrompt: (task: unknown) => string;
1966
- readonly options?: SandboxSteeringOptions;
1967
- readonly loopCtx?: Partial<Omit<ExecCtx, 'sandboxClient' | 'signal'>>;
1968
- /**
1969
- * Inherited `TRACE_ID` / `PARENT_SPAN_ID` for the box, merged into `CreateSandboxOptions.env` so
1970
- * the remote worker's own spans join the supervisor's trace under the spawning node's span.
1971
- * Absent when the run records no spans — the create options are then untouched.
1972
- */
1973
- readonly traceEnv?: Record<string, string>;
1974
- readonly contentRef: (prefix: string, value: unknown) => string;
1975
- readonly now?: () => number;
1976
- }
1977
- /** One steerable sandbox worker. The returned session is inert until `stream()` is drained. */
1978
- declare function createSteerableSandboxSession(args: SteerableSandboxArgs): SteerableSandboxSession;
1979
- //#endregion
1980
- //#region src/runtime/supervise/runtime.d.ts
1981
- /**
1982
- * Router/inline connection seam. A direct OpenAI-compatible Router endpoint —
1983
- * the cheapest leaf, no box, no tools. `model` overrides the profile's model
1984
- * hint when present; otherwise the profile's `model.default` is required.
1985
- */
1986
- interface RouterSeam {
1987
- routerBaseUrl: string;
1988
- routerKey: string;
1989
- model?: string;
1990
- }
1991
- /**
1992
- * Sandbox executor seam. The `sandboxClient` the composed `runAgentRounds` creates
1993
- * boxes through, plus the optional trace/run/lineage wiring forwarded into the
1994
- * loop. `lineage` is opaque here (PR #150's `RunAgentRoundsOptions.lineage`): forwarded
1995
- * forward-compatibly, never inspected — this executor does NOT reinvent
1996
- * checkpoint/fork.
1997
- */
1998
- interface SandboxSeam {
1999
- sandboxClient: SandboxClient;
2000
- /** Forwarded into the composed `runAgentRounds`'s `ctx` (trace emitter, run handle, etc.). */
2001
- loopCtx?: Partial<Omit<ExecCtx, 'sandboxClient' | 'signal'>>;
2002
- /** PR #150 `RunAgentRoundsOptions.lineage` passthrough — opaque; forwarded, not parsed. */
2003
- lineage?: unknown;
2004
- /** Hard cap on the composed loop's iterations. The budget pool reserves against
2005
- * the spawn `Budget.maxIterations`; this is the leaf's own ceiling. Default 1. */
2006
- maxIterations?: number;
2007
- /**
2008
- * OPT-IN: run this worker as a multi-turn, STEERABLE session instead of the historical
2009
- * single-shot `runAgentRounds` composition. Setting it gives the sandbox worker an `Executor.deliver`
2010
- * inbox (so `Scope.send` / `steer_agent` actually reach it), a live tool-activity trace, and a
2011
- * `progress()` read — turning the default cloud worker from something a supervisor can only
2012
- * wait on into something it can watch and correct.
2013
- *
2014
- * Absent, nothing changes: the same `runAgentRounds` leaf, no inbox, `steer_agent` still reports
2015
- * `delivered:false`. Opt-in because a steerable worker holds ONE box across several turns,
2016
- * which is a different resource profile from a fire-and-forget shot.
2017
- */
2018
- steering?: SandboxSteeringOptions;
2019
- }
2020
- /**
2021
- * UNMETERED CLI subprocess seam. `bin` + `args` describe the process to spawn.
2022
- *
2023
- * READ THIS BEFORE CHOOSING `backend: 'cli'`. This backend pipes a prompt to a subprocess's stdin
2024
- * and reads its stdout. It has no usage receipt of any kind, so it reports its spend with
2025
- * `Spend.tokensKnown: false`: the work is recorded, its `{0,0}` tokens and `$0` are a FLOOR rather
2026
- * than a measurement, and a ceiling priced from either is a ceiling that cannot fire. The executor
2027
- * is also `budgetExempt: true`, which is why `driveHarnessFromBackend` refuses it outright rather
2028
- * than pretending to budget it.
2029
- *
2030
- * If you need a metered harness worker, use `backend: 'bridge'` (a cli-bridge session, which
2031
- * reports the harness's real per-turn tokens and cost) or `backend: 'cli-worktree'` with
2032
- * `codexReproducible`. Reach for this seam only when the subprocess genuinely is not an inference
2033
- * agent, or when you have accepted that its cost is invisible.
2034
- *
2035
- * `args` is argv for a LOCAL, in-process spawn under this process's own privileges. It is not a
2036
- * remote channel and nothing forwards it over a wire.
2037
- */
2038
- interface CliSeam {
2039
- bin: string;
2040
- args?: string[];
2041
- /** Extra environment for the subprocess (merged over `process.env`). */
2042
- env?: Record<string, string>;
2043
- /** Working directory for the subprocess. */
2044
- cwd?: string;
2045
- }
2046
- /**
2047
- * cli-worktree seam. A supervisor-authored `AgentProfile` driving a local coding-harness CLI
2048
- * (claude / codex / opencode) on its own git worktree — the leaf `createWorktreeCliExecutor`
2049
- * named as data. `harness` + `repoRoot` are required; the task comes from `Executor.execute`.
2050
- * `taskPrompt` remains an optional direct-call fallback for callers that execute with `undefined`.
2051
- * The authored
2052
- * `profile.prompt.systemPrompt` + `profile.model.default` reach the harness via the §1.5
2053
- * `harnessInvocation` mapper. Everything else mirrors `WorktreeCliExecutorOptions`.
2054
- */
2055
- interface CliWorktreeSeam {
2056
- repoRoot: string;
2057
- /** Local CLI harness transport. Omit when `bridge` is set. */
2058
- harness?: LocalHarness;
2059
- taskPrompt?: string;
2060
- runId?: string;
2061
- baseRef?: string;
2062
- harnessTimeoutMs?: number;
2063
- /** Isolated, network-off Codex execution with terminal JSONL usage capture. */
2064
- codexReproducible?: boolean;
2065
- /** Absolute host paths denied to reproducible Codex. */
2066
- codexReadDeniedPaths?: ReadonlyArray<string>;
2067
- testCmd?: string;
2068
- typecheckCmd?: string;
2069
- checkTimeoutMs?: number;
2070
- checkOutputCap?: number;
2071
- budgetExempt?: boolean;
2072
- /** Live cli-bridge transport inside the worktree. When set, the worktree leaf accepts
2073
- * `deliver()` messages and resumes the same bridge session in this worktree cwd. */
2074
- bridge?: CliWorktreeBridgeSeam;
2075
- /** Test seam — forwarded to worktree helpers. */
2076
- runGit?: GitRunner;
2077
- /** Test seam — forwarded to verification checks. */
2078
- runCommand?: WorktreeCheckRunner;
2079
- }
2080
- interface CliWorktreeBridgeSeam {
2081
- bridgeUrl: string;
2082
- bridgeBearer: string;
2083
- /** Bridge model/harness id. Defaults to the profile's model hint when omitted. */
2084
- model?: string;
2085
- /** Canonical profile overlay merged over the spawned profile. */
2086
- agentProfile?: AgentProfile$1;
2087
- /** Caller-owned deadline for each bridge turn. Runtime enforces it locally and sends the
2088
- * same value in `execution.timeoutMs` so cli-bridge cannot substitute its own cutoff. */
2089
- timeoutMs?: number;
2090
- /** Stable cli-bridge session id. Defaults to `bridge-worktree-${runId}`. */
2091
- sessionId?: string;
2092
- maxTurns?: number;
2093
- }
2094
- /**
2095
- * cli-bridge seam. A local OpenAI-compatible bridge that fronts harness CLIs
2096
- * (claude-code / opencode / kimi / pi) behind one HTTP surface; `model` doubles
2097
- * as the harness selector (e.g. `claude-code/sonnet`, `opencode/<provider>/<model>`).
2098
- * `agentProfile` is the bridge-dialect profile (metadata.disallowedTools, mcp)
2099
- * forwarded verbatim per request — how an arm disables native tools or injects
2100
- * a provider search MCP.
2101
- *
2102
- * The executor opens a resumable cli-bridge session. `sessionId` identifies the
2103
- * harness conversation across turns; each turn also receives its own durable run id.
2104
- * A dropped HTTP reader reattaches to that exact run and explicit cancel is the only
2105
- * operation allowed to stop it. Omit `sessionId` and the executor mints one per spawn.
2106
- *
2107
- * ── HOW TO CONTROL WHAT THE HARNESS LOADS (there is no argv field, by design) ──
2108
- *
2109
- * A worker often needs the harness started in a KNOWN state — no ambient extensions, skills,
2110
- * context files, or prompt templates — because ambient state is how a paired experiment silently
2111
- * loses its pairing: an installed extension that persists memory across runs carries arm A's state
2112
- * into arm B, and nothing reports it.
2113
- *
2114
- * That is what the `AgentProfile` on this seam (and on the spawn spec) is FOR. `agent_profile`
2115
- * rides every request verbatim, and cli-bridge maps it onto each harness's own native controls:
2116
- *
2117
- * - Materializing any profile at all already starts the harness isolated from ambient
2118
- * workspace state — for pi that is `--no-context-files --no-skills --no-prompt-templates`,
2119
- * applied to every request that carries an `agent_profile`.
2120
- * - `AgentProfile.extensions.<harness>` is the named, per-harness control channel. An explicit
2121
- * `extensions: { pi: { load: [] } }` disables ambient extension discovery outright
2122
- * (pi's `--no-extensions`); listing package names loads exactly those and nothing else.
2123
- * - `permissions` / `tools` / `mcp` map onto the harness's native tool and server controls.
2124
- *
2125
- * A caller therefore does NOT need to hand-roll an `Executor` to isolate a harness run, and the
2126
- * profile expressing it stays portable: the same declaration means the same thing on a different
2127
- * harness, whereas an argv string means nothing anywhere else.
2128
- *
2129
- * WHY NOT A GENERAL ARGV PASSTHROUGH. `bridgeUrl` addresses a process-spawning server. Forwarding
2130
- * an arbitrary argv array to it would let any caller holding a bearer token choose the flags of a
2131
- * process on the bridge host — which for real harness CLIs includes flags that load code from a
2132
- * path, read a file into the prompt, redirect the working directory, or turn off the isolation the
2133
- * bridge applies. cli-bridge deliberately confines workers (a filesystem jail and deny-by-default
2134
- * network egress), and every one of those confinements is expressed as spawn configuration, so an
2135
- * argv channel is a channel for unwinding them. It would also break this executor's own contract:
2136
- * the durable-run replay protocol, session pinning, and streaming mode are all argv the bridge
2137
- * owns, and a caller-supplied duplicate silently wins or corrupts the parse. The structured profile
2138
- * channel is validated, per-harness, portable, and refuses controls it does not understand — keep
2139
- * new harness capability there.
2140
- */
2141
- interface BridgeSeam {
2142
- bridgeUrl: string;
2143
- bridgeBearer: string;
2144
- /** Fallback bridge wire id. A spawned profile may select its own harness and model. */
2145
- model?: string;
2146
- /** Optional working directory forwarded to cli-bridge and persisted with the session. */
2147
- cwd?: string;
2148
- /** Canonical profile overlay merged over the spawned profile. */
2149
- agentProfile?: AgentProfile$1;
2150
- /** Caller-owned deadline for each bridge turn. Runtime enforces it locally and sends the
2151
- * same value in `execution.timeoutMs` so the bridge-owned process follows the same policy. */
2152
- timeoutMs?: number;
2153
- /** Stable, caller-owned cli-bridge session id for harness-side resume. Defaults
2154
- * to a freshly minted per-spawn id so each worker is its own resumable session. */
2155
- sessionId?: string;
2156
- /** Per-resume-turn inference cap before the worker settles on its last output.
2157
- * Mirrors `routerToolsInlineExecutor.maxTurns`; default 200 (runaway backstop). */
2158
- maxTurns?: number;
2159
- /** Newest-last activity window `progress()` reports. Default 12 (matches `PiSeam`). */
2160
- activityWindow?: number;
2161
- }
2162
- /** Generic environment provider executor config. External packages implement
2163
- * `AgentEnvironmentProvider`; this built-in wrapper lets `createExecutor`
2164
- * consume them as backend data while preserving the existing usage channel. */
2165
- interface ProviderSeam extends ProviderExecutorOptions {
2166
- provider: AgentEnvironmentProvider | string;
2167
- registry?: AgentEnvironmentProviderRegistry;
2168
- /**
2169
- * Compose the provider through the existing steerable sandbox session.
2170
- * The exact profile must name its harness, and the provider must expose live
2171
- * continuation plus session controls. The provider still owns environment
2172
- * creation and session semantics.
2173
- */
2174
- steering?: SandboxSteeringOptions;
2175
- }
2176
- /**
2177
- * Router seam WITH tool use — the tool-using router backend. Same direct
2178
- * OpenAI-compatible endpoint as `RouterSeam`, but each turn passes `tools`; when
2179
- * the model emits tool_calls they run via `executeToolCall` ON THIS HOST and the
2180
- * results fold back as `tool` messages, repeating until the model answers without
2181
- * a tool or `maxTurns` is hit. A real agentic loop, OFF-BOX — no sandbox, so it
2182
- * is unaffected by a box's egress allowlist. One turn = one completion = the
2183
- * equal-compute unit. `executeToolCall` receives the task so per-task tool
2184
- * surfaces (e.g. a gym keyed by task) can dispatch correctly.
2185
- */
2186
- interface RouterToolsSeam {
2187
- routerBaseUrl: string;
2188
- routerKey: string;
2189
- model?: string;
2190
- tools: ReadonlyArray<ToolSpec>;
2191
- executeToolCall: (name: string, args: Record<string, unknown>, task: unknown) => Promise<string>;
2192
- /** Online observer of each tool step — the seam a `DetectorMonitor` taps to watch the live pipe
2193
- * (raise a `finding` when the worker loops/errors). Called after every tool call resolves, with
2194
- * real per-call wall-clock (`startedAt`/`endedAt`/`durationMs`) so a push `TraceSource` can carry
2195
- * non-zero span durations onto the unified timeline. */
2196
- onToolStep?: (step: {
2197
- toolName: string;
2198
- args: Record<string, unknown>;
2199
- status: 'ok' | 'error';
2200
- startedAt?: number;
2201
- endedAt?: number;
2202
- durationMs?: number;
2203
- }) => void;
2204
- /** Max inference turns. Default 200 (runaway backstop — set far above any
2205
- * legitimate workflow). For tighter per-workflow limits use a cost budget
2206
- * or wall-clock deadline at the call site. */
2207
- maxTurns?: number;
2208
- }
2209
- /**
2210
- * The leaf `createWorktreeCliExecutor` as a backend-as-data factory: a supervisor-authored
2211
- * `AgentProfile` driving claude / codex / opencode on its own worktree. `budgetExempt` like
2212
- * the other CLI leaves; the authored systemPrompt + model reach the harness via §1.5.
2213
- */
2214
- declare const cliWorktreeExecutor: ExecutorFactory<unknown>;
2215
- /**
2216
- * Config for {@link createExecutor}: the backend is DATA — the cost dial a profile,
2217
- * an experiment config, or a replay journal can name — not an import choice. Each
2218
- * variant carries its backend's seam (router/router-tools/bridge/cli/cli-worktree/sandbox).
2219
- */
2220
- type ExecutorConfig = ({
2221
- backend: 'router';
2222
- } & RouterSeam) | ({
2223
- backend: 'router-tools';
2224
- } & RouterToolsSeam) | ({
2225
- backend: 'bridge';
2226
- } & BridgeSeam) | ({
2227
- backend: 'cli';
2228
- } & CliSeam) | ({
2229
- backend: 'cli-worktree';
2230
- } & CliWorktreeSeam) | ({
2231
- backend: 'provider';
2232
- } & ProviderSeam) | ({
2233
- backend: 'sandbox';
2234
- harness?: BackendType;
2235
- } & SandboxSeam);
2236
- /**
2237
- * The single built-in executor factory. Picks a leaf backend by data (`config.backend`),
2238
- * injects the matching seam, and delegates to that backend's built-in implementation.
2239
- * The `Executor` port stays OPEN: bring-your-own agents implement `Executor` directly
2240
- * and never pass through here. Use this (or `createExecutorRegistry`) instead of a
2241
- * per-vendor adapter or a closed `inline|sandbox|cli` switch — those bypass the
2242
- * `UsageEvent` reporting channel.
2243
- */
2244
- declare function createExecutor(config: ExecutorConfig): ExecutorFactory<unknown>;
2245
- /**
2246
- * The open resolver/registry. Pre-registers the three built-ins under their
2247
- * runtime tags (`'router'`, `'sandbox'`, `'cli'`) and accepts `register(name,
2248
- * factory)` for any additional runtime — and a BYO `AgentSpec.executor` resolves
2249
- * without touching the registry at all. NOT a closed switch; registration + BYO
2250
- * ARE the extension points.
2251
- *
2252
- * `resolve` precedence (frozen in `ExecutorRegistry`): a BYO `spec.executorFactory` →
2253
- * `spec.executor` → `harness === null` → the `'router'` factory; else a registered factory for the
2254
- * harness-derived runtime (`'sandbox'` for any `BackendType`); else fail loud.
2255
- */
2256
- declare function createExecutorRegistry(): ExecutorRegistry;
2257
- //#endregion
2258
1707
  //#region src/mcp/tools/delegate.d.ts
2259
- /** MCP tool name for the `delegate` generic-delegation tool. @experimental */
1708
+ /** MCP tool name for the `delegate` generic-delegation tool. @stable */
2260
1709
  declare const DELEGATE_TOOL_NAME = "delegate";
2261
- /** Human-readable description of the `delegate` MCP tool, injected into the tool manifest. @experimental */
1710
+ /** Human-readable description of the `delegate` MCP tool, injected into the tool manifest. @stable */
2262
1711
  declare const DELEGATE_DESCRIPTION: string;
2263
- /** JSON Schema for `delegate` tool arguments (`intent` + optional `model` and `runId`). @experimental */
1712
+ /** JSON Schema for `delegate` tool arguments (`intent` + optional trace id). @stable */
2264
1713
  declare const DELEGATE_INPUT_SCHEMA: {
2265
1714
  readonly type: "object";
2266
1715
  readonly properties: {
@@ -2268,10 +1717,6 @@ declare const DELEGATE_INPUT_SCHEMA: {
2268
1717
  readonly type: "string";
2269
1718
  readonly description: "What you want accomplished, as an outcome. The supervisor authors the worker.";
2270
1719
  };
2271
- readonly model: {
2272
- readonly type: "string";
2273
- readonly description: "Optional per-call override for the supervisor brain model.";
2274
- };
2275
1720
  readonly runId: {
2276
1721
  readonly type: "string";
2277
1722
  readonly description: "Optional trace-correlation id for this delegation.";
@@ -2283,10 +1728,9 @@ declare const DELEGATE_INPUT_SCHEMA: {
2283
1728
  /** Parsed `delegate` tool arguments. */
2284
1729
  interface DelegateArgs {
2285
1730
  intent: string;
2286
- model?: string;
2287
1731
  runId?: string;
2288
1732
  }
2289
- /** Parse and validate raw MCP tool input into typed `DelegateArgs`; throws `TypeError` on bad input. @experimental */
1733
+ /** Parse and validate raw MCP tool input into typed `DelegateArgs`; throws `TypeError` on bad input. @stable */
2290
1734
  declare function validateDelegateArgs(raw: unknown): DelegateArgs;
2291
1735
  /** The synchronous result the `delegate` tool returns to the calling agent: the delivered output (or
2292
1736
  * the no-winner reason) PLUS the conserved spend of the whole delegation. */
@@ -2308,16 +1752,16 @@ interface DelegateError {
2308
1752
  name: string;
2309
1753
  message: string;
2310
1754
  }
2311
- /** @experimental */
1755
+ /** @stable */
2312
1756
  interface DelegateHandlerOptions {
2313
1757
  /** The supervisor brain's router substrate (REQUIRED — the default supervisor is router-brained). */
2314
- router: RouterConfig;
1758
+ router: RouterTransportConfig;
1759
+ /** Exact executable supervisor identity selected by the trusted composition root. */
1760
+ supervisorProfile: AgentProfile$1;
2315
1761
  /** WHERE the authored workers run. Required for `supervise()` to spawn anything. */
2316
1762
  backend: ExecutorConfig;
2317
1763
  /** The completion oracle the authored workers settle against (settled ⟺ delivered). */
2318
1764
  deliverable?: DeliverableSpec;
2319
- /** Default supervisor brain model when a call omits `model`. */
2320
- model?: string;
2321
1765
  /** Restrict the run to this subset of models. */
2322
1766
  allowedModels?: readonly string[];
2323
1767
  }
@@ -2339,10 +1783,8 @@ interface McpServerOptions {
2339
1783
  */
2340
1784
  delegateSupervisor?: DelegateHandlerOptions;
2341
1785
  /**
2342
- * Required to enable delegate_ui_audit. Wire one that closes over your
2343
- * `runAgentRounds` + `uiAuditorProfile` + a `SandboxClient` (the
2344
- * canonical in-process choice is `createInProcessUiAuditClient` from
2345
- * `@tangle-network/agent-runtime/profiles`) + your vision judge.
1786
+ * Required to enable delegate_ui_audit. Wire one that executes an exact
1787
+ * agent profile through Runtime and returns the provider-neutral UI audit result.
2346
1788
  */
2347
1789
  uiAuditorDelegate?: UiAuditorDelegate;
2348
1790
  /** Override the default in-memory feedback store. */
@@ -2949,10 +2391,10 @@ interface AuditIntentInput {
2949
2391
  runId?: string;
2950
2392
  }
2951
2393
  interface AuditIntentOptions {
2952
- chat: ChatClient;
2953
- model?: string;
2954
- /** Override the auditor instruction (optimizable like any analyst prompt). */
2955
- auditorInstruction?: string;
2394
+ /** Exact auditor identity. */
2395
+ profile: AgentProfile$1;
2396
+ /** Execution substrate. All behavior comes from the profile. */
2397
+ executor: ExecutorConfig;
2956
2398
  /** Cap trace lines fed to the auditor. Default 80. */
2957
2399
  maxTraceLines?: number;
2958
2400
  signal?: AbortSignal;
@@ -3272,9 +2714,10 @@ interface LeaderboardSpec<TCase, TArtifact = string> {
3272
2714
  harnesses?: readonly HarnessType[];
3273
2715
  models?: readonly string[];
3274
2716
  };
3275
- /** Base profile the axes expand over (prompt/tools/skills held fixed).
3276
- * Default: a minimal `{ name, model: { default: <first model> } }`. */
3277
- baseProfile?: AgentProfile;
2717
+ /** Exact base profile the axes expand over (prompt/tools/skills held fixed).
2718
+ * Its provider remains authoritative while each axis cell replaces the
2719
+ * harness and concrete model. */
2720
+ baseProfile: AgentProfile;
3278
2721
  /**
3279
2722
  * Execution-backend registry: `--backend <name>` picks the factory that
3280
2723
  * yields the `SandboxClient` every cell runs on. Merged over the defaults:
@@ -3287,10 +2730,6 @@ interface LeaderboardSpec<TCase, TArtifact = string> {
3287
2730
  backends?: Record<string, (() => SandboxClient) | undefined>;
3288
2731
  /** Extra `--flag value` CLI args `run()` parses and surfaces via `ctx.args`. */
3289
2732
  flags?: Record<string, LeaderboardFlagSpec>;
3290
- /** Extra fields merged into each cell's `backend.model` create override —
3291
- * e.g. `{ provider: 'openai-compat', apiKey, baseUrl }` for a router-backed
3292
- * sandbox. The cell's bare model id is set by the facade from the axis. */
3293
- modelBackend?: Record<string, unknown>;
3294
2733
  /** Runs once before the matrix (fetch fixtures, warm caches). */
3295
2734
  setup?: (ctx: LeaderboardRunContext) => Promise<void> | void;
3296
2735
  /** Runs once after the matrix, even on failure (reap boxes, close handles). */
@@ -3308,13 +2747,10 @@ interface LeaderboardSpec<TCase, TArtifact = string> {
3308
2747
  * this (or a LEVEL-2 `dispatch`). */
3309
2748
  parseOutput?: (events: readonly SandboxEvent[], c: TCase) => TArtifact;
3310
2749
  /**
3311
- * Resolve the model the backend ACTUALLY served off a shot's raw events.
3312
- * Required for HARNESS_NATIVE_MODEL-snapped cells (a vendor-locked harness ×
3313
- * an out-of-family model expands to the `default` sentinel): the RunRecord
3314
- * must pin a real snapshot-bearing model id, which only the dispatch —
3315
- * reading the backend's usage/terminal events — can know. When this returns
3316
- * a value the default dispatch records it on the paid-call receipt;
3317
- * in-family cells (concrete declared model) never need it.
2750
+ * Resolve the model the backend actually served from a shot's raw events.
2751
+ * When this returns a value the default dispatch records it on the paid-call
2752
+ * receipt. It cannot complete an inexact planning profile: every expanded
2753
+ * cell must already declare a concrete model before backend work starts.
3318
2754
  */
3319
2755
  resolveModel?: (events: readonly SandboxEvent[]) => string | undefined;
3320
2756
  /** Result export. Default: write `matrix-result.json` under the run dir and
@@ -4089,9 +3525,10 @@ interface ObserveInput {
4089
3525
  runId?: string;
4090
3526
  }
4091
3527
  interface ObserveOptions {
4092
- /** The model-call seam (agent-eval `createChatClient`: router / cli-bridge / …). */
4093
- chat: ChatClient;
4094
- model?: string;
3528
+ /** Exact analyst identity. */
3529
+ profile: AgentProfile$1;
3530
+ /** Execution substrate. All behavior comes from the profile. */
3531
+ executor: ExecutorConfig;
4095
3532
  /** When set, learned facts are appended (idempotent) for the next run to read. */
4096
3533
  corpus?: Corpus;
4097
3534
  /** Tags written onto learned facts + used by the next run's corpus query. */
@@ -4099,12 +3536,6 @@ interface ObserveOptions {
4099
3536
  signal?: AbortSignal;
4100
3537
  /** Cap the trace lines fed to the observer (keeps the call cheap). Default 80. */
4101
3538
  maxTraceLines?: number;
4102
- /** Override the analyst's system instruction — the prompt that turns a trace into
4103
- * findings + recommended_actions. The analyst IS the steerer, so this is the knob a
4104
- * prompt optimizer (GEPA) tunes. Omitted ⇒ the default observer instruction. The
4105
- * firewall (trace-only, never the verdict) is structural (input has no score), so a
4106
- * custom instruction cannot break it. */
4107
- analystInstruction?: string;
4108
3539
  }
4109
3540
  /** The default observer instruction — exported so an optimizer can seed its population. */
4110
3541
  declare const defaultAnalystInstruction: string;
@@ -4114,6 +3545,12 @@ interface Observation {
4114
3545
  learned: CorpusRecord[];
4115
3546
  /** Operator-facing markdown: what the observer noticed + what to change. */
4116
3547
  report: string;
3548
+ /** Measured model usage for this analysis turn. */
3549
+ usage: {
3550
+ input: number;
3551
+ output: number;
3552
+ known: boolean;
3553
+ };
4117
3554
  }
4118
3555
  /** The third-person trace analyst: read a worker's trace and produce steer findings for the next attempt plus durable `learned` facts for the cross-run corpus. */
4119
3556
  declare function observe(input: ObserveInput, opts: ObserveOptions): Promise<Observation>;
@@ -4125,15 +3562,14 @@ declare function renderReport(findings: ReadonlyArray<AnalystFinding>): string;
4125
3562
  interface HarvestCorpusOptions {
4126
3563
  /** The completed runs to analyze — map your store's rows to `ObserveInput`. */
4127
3564
  runs: AsyncIterable<ObserveInput> | Iterable<ObserveInput>;
4128
- /** The model-call seam (agent-eval `createChatClient`). */
4129
- chat: ChatClient;
4130
- model?: string;
3565
+ /** Exact analyst identity. */
3566
+ profile: AgentProfile$1;
3567
+ /** Execution substrate. All behavior comes from the profile. */
3568
+ executor: ExecutorConfig;
4131
3569
  /** The durable corpus the facts accrete into. */
4132
3570
  corpus: Corpus;
4133
3571
  /** Tags written onto learned facts (the product/domain key the read side queries by). */
4134
3572
  tags?: ReadonlyArray<string>;
4135
- /** Override the analyst instruction (the GEPA-tunable knob). */
4136
- analystInstruction?: string;
4137
3573
  /** Runs analyzed in parallel. Default 4. */
4138
3574
  concurrency?: number;
4139
3575
  /** Hard cap on runs consumed from the stream (a cost guard for unbounded stores). */
@@ -4216,7 +3652,9 @@ declare function inProcessSandboxClient(options: InProcessSandboxClientOptions):
4216
3652
  * instantiated fresh per `streamPrompt` (mirrors the per-spawn executor lifecycle):
4217
3653
  * run once on the prompt, emit the terminal result event, tear down.
4218
3654
  */
4219
- declare function inlineSandboxClient(factory: ExecutorFactory<unknown>): SandboxClient;
3655
+ declare function inlineSandboxClient(factory: ExecutorFactory<unknown>, defaults?: {
3656
+ profile?: AgentProfile$1;
3657
+ }): SandboxClient;
4220
3658
  //#endregion
4221
3659
  //#region src/runtime/key-provider.d.ts
4222
3660
  /** Resolve named secrets. The ONE seam every secret store adapts to. */
@@ -4270,16 +3708,11 @@ declare function resolveMcpServerLaunch(server: AgentProfileMcpServer, keys: Key
4270
3708
  //#endregion
4271
3709
  //#region src/runtime/local-sandbox-client.d.ts
4272
3710
  interface LocalSandboxClientOptions {
4273
- /** The worker brain: router chat-completions with tool-calling. All three required. */
3711
+ /** Router endpoint/auth. The exact per-create profile owns model and loop behavior. */
4274
3712
  router: {
4275
3713
  baseUrl: string;
4276
3714
  key: string;
4277
- model: string;
4278
3715
  };
4279
- /** Tool-loop turns per prompt. Default 8. */
4280
- maxTurns?: number;
4281
- /** Brain sampling temperature. Default: `routerBrain`'s (0.4). */
4282
- temperature?: number;
4283
3716
  /** Fallback profile when `create(options)` carries none on `backend.profile`. */
4284
3717
  profile?: AgentProfile$1;
4285
3718
  /** Resolves profile-declared MCP secret names at child-process spawn time. */
@@ -4294,7 +3727,7 @@ interface LocalSandboxClientOptions {
4294
3727
  declare function localSandboxClient(opts: LocalSandboxClientOptions): SandboxClient;
4295
3728
  //#endregion
4296
3729
  //#region src/runtime/run-loop.d.ts
4297
- /** @experimental */
3730
+ /** @stable */
4298
3731
  interface RunAgentRoundsOptions<Task, Output, Decision> {
4299
3732
  driver: Driver<Task, Output, Decision>;
4300
3733
  /**
@@ -4370,7 +3803,7 @@ interface RunAgentRoundsOptions<Task, Output, Decision> {
4370
3803
  * folding the results back in until the model stops calling tools. No sandboxes, no
4371
3804
  * rounds, no winner selection.
4372
3805
  *
4373
- * @experimental
3806
+ * @stable
4374
3807
  */
4375
3808
  declare function runAgentRounds<Task, Output, Decision>(options: RunAgentRoundsOptions<Task, Output, Decision>): Promise<LoopResult<Task, Output, Decision>>;
4376
3809
  /**
@@ -4441,7 +3874,6 @@ declare function loopDispatch<Task, Output, Decision, TScenario extends Scenario
4441
3874
  //#region src/runtime/strategy.d.ts
4442
3875
  interface AgenticTask {
4443
3876
  readonly id: string;
4444
- readonly systemPrompt: string;
4445
3877
  readonly userPrompt: string;
4446
3878
  /** Opaque domain payload the surface reads (EOPS: servers/verifiers/tools). Drivers never read it. */
4447
3879
  readonly meta?: Record<string, unknown>;
@@ -4478,25 +3910,16 @@ interface AgenticSurface {
4478
3910
  interface AgenticOptions {
4479
3911
  routerBaseUrl: string;
4480
3912
  routerKey: string;
4481
- model: string;
3913
+ /** Exact worker identity. Model and standing instructions are read only from this profile. */
3914
+ workerProfile: AgentProfile$1;
4482
3915
  /** Optional completion transport (see `RouterConfig.complete`): when set, BOTH legs of an
4483
3916
  * offline run use it instead of `fetch`-ing the router — the worker's tool loop (threaded into
4484
3917
  * its `routerToolLoop` cfg) AND the analyst's critic (its `ChatClient` is bound to this same
4485
3918
  * transport). One injected responder serves both, as a localhost mock endpoint would. Absent ⇒
4486
3919
  * the live router fetch path (the default). */
4487
3920
  complete?: (body: Record<string, unknown>) => Promise<unknown>;
4488
- temperature?: number;
4489
- /** Completion cap per worker turn — REQUIRED for thinking models (they burn unbounded
4490
- * budgets on reasoning and return empty content without it). Omitted ⇒ provider default. */
4491
- maxTokens?: number;
4492
- /** Turns the agent may take within ONE shot before the driver intervenes. */
4493
- innerTurns?: number;
4494
- /** The depth STEERER's analyst instruction (observe()'s system prompt). The knob a
4495
- * prompt optimizer (GEPA) tunes — the analyst IS the steerer. Omitted ⇒ the default. */
4496
- analystInstruction?: string;
4497
- /** The critic's model — lets the analyst be a stronger (or cheaper) model than the
4498
- * worker. Omitted ⇒ the worker's `model`. */
4499
- analystModel?: string;
3921
+ /** Exact critic identity. Omitted means the exact worker profile also runs the critic. */
3922
+ analystProfile?: AgentProfile$1;
4500
3923
  /** Across-run learning: when set, the analyst's observe() pass appends trace-derived
4501
3924
  * facts here (the flywheel write side). Read-back is opt-in via `corpusReadback`
4502
3925
  * because unconditional priming can pollute context on some domains. */
@@ -4537,14 +3960,15 @@ interface AgenticRunResult {
4537
3960
  /** DEPTH: score after each shot — the progress-over-rounds curve. BREADTH: best-so-far per rollout. */
4538
3961
  progression: number[];
4539
3962
  shots: number;
4540
- /** The cost vector, stamped by `runAgentic` from the Supervisor's conserved pool: real
4541
- * router tokens, priced usd (0 when the model is unpriced — never fabricated), wall ms. */
3963
+ /** Observed billed subtotal. `usdKnown:false` means it is incomplete, never a measured zero. */
4542
3964
  usd: number;
3965
+ usdKnown: boolean;
4543
3966
  ms: number;
4544
3967
  tokens: {
4545
3968
  input: number;
4546
3969
  output: number;
4547
3970
  };
3971
+ tokensKnown: boolean;
4548
3972
  }
4549
3973
  /** DEPTH: one persistent artifact, carried across analyst-steered shots. */
4550
3974
  declare function depthStrategy(surface: AgenticSurface, task: AgenticTask, opts: AgenticOptions, cfg: {
@@ -4575,21 +3999,13 @@ interface Strategy<Result extends StrategyResult = StrategyResult> {
4575
3999
  declare const sample: Strategy;
4576
4000
  /** Built-in `Strategy`: attempt → `observe()` reads the trace → steer the next attempt → repeat (deepen one lineage). */
4577
4001
  declare const refine: Strategy;
4578
- /** A role for one shot — multi-agent loops (researcher + engineer, a panel of k
4579
- * researchers) give each shot its own system prompt and optionally its own model. */
4580
- interface ShotPersona {
4581
- /** Replaces the task's systemPrompt for a FRESH shot; on a carried conversation it is
4582
- * injected as a hand-off message (the transcript's earlier roles stay intact). */
4583
- systemPrompt?: string;
4584
- /** Per-shot model override (e.g. a stronger model for the engineer shot). */
4585
- model?: string;
4586
- }
4587
4002
  interface ShotSpec {
4588
4003
  /** present ⇒ continue this artifact (depth); absent ⇒ the shot opens a fresh one (sample/restart). */
4589
4004
  handle?: ArtifactHandle;
4590
4005
  messages?: StrategyMessage[];
4591
4006
  steer?: string;
4592
- persona?: ShotPersona;
4007
+ /** Exact profile for this shot. Omitted means `AgenticOptions.workerProfile`. */
4008
+ profile?: AgentProfile$1;
4593
4009
  /** Restrict THIS shot to a subset of the domain's tools (by name) — focus a shot on
4594
4010
  * the relevant capabilities. Restriction-only; unknown names throw. Omitted ⇒ all. */
4595
4011
  tools?: string[];
@@ -4724,11 +4140,13 @@ interface BenchmarkCell {
4724
4140
  /** The progress curve (refine: score per shot; sample: best-so-far per rollout). */
4725
4141
  progression: number[];
4726
4142
  usd: number;
4143
+ usdKnown: boolean;
4727
4144
  ms: number;
4728
4145
  tokens: {
4729
4146
  input: number;
4730
4147
  output: number;
4731
4148
  };
4149
+ tokensKnown: boolean;
4732
4150
  }
4733
4151
  interface BenchmarkTaskRow {
4734
4152
  taskId: string;
@@ -4748,6 +4166,8 @@ interface BenchmarkStrategySummary {
4748
4166
  resolved: number;
4749
4167
  /** Mean cost vector per task. */
4750
4168
  usd: number;
4169
+ /** Fraction of task cells whose billed-dollar total was complete. */
4170
+ usdKnownRate: number;
4751
4171
  ms: number;
4752
4172
  }
4753
4173
  /** Benchmark output: per-strategy means plus the full per-task × per-strategy losses table an optimizer mines. */
@@ -4897,6 +4317,8 @@ declare function selectValidWinner<D>(opts?: {
4897
4317
  * pool would not admit, or a stage whose `collect` chose to block) short-circuits — its blockers
4898
4318
  * ARE the pipeline's blockers, never coerced past a failed stage. The terminal stage's `done`
4899
4319
  * deliverable is the pipeline's deliverable.
4320
+ *
4321
+ * @stable
4900
4322
  */
4901
4323
  declare function pipeline<Task, D>(stages: ReadonlyArray<PipelineStage<Task, unknown, unknown>>): CombinatorShape<Task, D>;
4902
4324
  /**
@@ -4909,6 +4331,8 @@ declare function pipeline<Task, D>(stages: ReadonlyArray<PipelineStage<Task, unk
4909
4331
  * `opts.width` swaps the single round for `rollingDispatch`: at most `width` items live at once,
4910
4332
  * refilled the instant one settles. Selection, blockers, and the conserved pool are unchanged —
4911
4333
  * the refill behavior lives in the existing combinator rather than in a rival primitive.
4334
+ *
4335
+ * @stable
4912
4336
  */
4913
4337
  declare function fanout<Task, Item, D>(items: ReadonlyArray<Item>, opts: FanoutOptions<Item, D>): CombinatorShape<Task, D>;
4914
4338
  /**
@@ -4921,6 +4345,8 @@ declare function fanout<Task, Item, D>(items: ReadonlyArray<Item>, opts: FanoutO
4921
4345
  * `until` on the resulting trace-derived findings (the analyst spawns into THIS scope, so its
4922
4346
  * compute is conserved-pooled — equal-k holds by construction). Absent an analyst the findings
4923
4347
  * argument is the empty array — never a fabricated finding (fail-loud honesty over a silent default).
4348
+ *
4349
+ * @stable
4924
4350
  */
4925
4351
  declare function loopUntil<Task, State, D>(seed: State, spec: LoopUntilSpec<Task, State, D>): CombinatorShape<Task, D>;
4926
4352
  /**
@@ -4929,6 +4355,8 @@ declare function loopUntil<Task, State, D>(seed: State, spec: LoopUntilSpec<Task
4929
4355
  * reaches another judge's task; the merge never spawns or re-ranks). A `down` judge carries no
4930
4356
  * verdict and is excluded from the merge denominator. A panel that admitted no judge is a
4931
4357
  * concrete blocker before `merge` is consulted.
4358
+ *
4359
+ * @stable
4932
4360
  */
4933
4361
  declare function panel<Task, Artifact, D>(spec: PanelSpec<Artifact, D>): CombinatorShape<Task, D>;
4934
4362
  /**
@@ -4936,6 +4364,8 @@ declare function panel<Task, Artifact, D>(spec: PanelSpec<Artifact, D>): Combina
4936
4364
  * it; only a `valid` verifier verdict ships. Any other outcome (implement down, verifier down,
4937
4365
  * verifier verdict absent or not `valid`) is a concrete blocker carrying the failure verbatim —
4938
4366
  * never a coerced "done". The implement child does not grade itself.
4367
+ *
4368
+ * @stable
4939
4369
  */
4940
4370
  declare function verify<Task, Candidate, D>(spec: VerifySpec<Task, Candidate, D>): CombinatorShape<Task, D>;
4941
4371
  /**
@@ -4954,6 +4384,8 @@ declare function verify<Task, Candidate, D>(spec: VerifySpec<Task, Candidate, D>
4954
4384
  * the widen loop sees it. The shipped default (`flatWidenGate`) never widens, so no widen child is
4955
4385
  * ever live when the analyst runs and the wire is exact; a non-flat gate must drive the analyst on
4956
4386
  * a scope whose siblings are quiesced, or read findings without the shared-cursor drain.
4387
+ *
4388
+ * @stable
4957
4389
  */
4958
4390
  declare function widen<Task, Seed, D>(spec: WidenSpec<Seed, D>): CombinatorShape<Task, D>;
4959
4391
  /**
@@ -5019,6 +4451,8 @@ declare function renderCorpusToInstructions(opts: RenderCorpusToInstructionsOpti
5019
4451
  * Build a frozen `Persona`. Fails loud on the executors-supplied invariant: a persona with
5020
4452
  * neither a pre-built registry nor a seam bag cannot resolve its built-in runtimes, so it is
5021
4453
  * unrunnable — refuse it at definition time, not at the first spawn. Pure; no I/O.
4454
+ *
4455
+ * @stable
5022
4456
  */
5023
4457
  declare function definePersona<D = unknown>(input: DefinePersonaInput<D>): Persona<D>;
5024
4458
  /**
@@ -5027,6 +4461,8 @@ declare function definePersona<D = unknown>(input: DefinePersonaInput<D>): Perso
5027
4461
  * `ShapeContext`, and runs the resulting root `Agent` to a typed `SupervisedResult<Outcome>`.
5028
4462
  * Fail loud on an unknown shape name or an unresolvable persona registry — never a silent
5029
4463
  * default-shape fallback.
4464
+ *
4465
+ * @stable
5030
4466
  */
5031
4467
  declare function runPersonified<Task, D>(options: RunPersonifiedOptions<Task, D>): Promise<SupervisedResult<Outcome<D>>>;
5032
4468
  //#endregion
@@ -5061,6 +4497,36 @@ declare function trajectoryReport(journal: SpawnJournal, blobs: ResultBlobStore,
5061
4497
  */
5062
4498
  declare function equalKOnCost(arms: ReadonlyArray<EqualKArm>, options?: EqualKOnCostOptions): EqualKVerdict;
5063
4499
  //#endregion
4500
+ //#region src/runtime/supervise/model-policy.d.ts
4501
+ /**
4502
+ * Throw a `ConfigError` when `allowed` is set, `model` is defined, and `model` is not a
4503
+ * member of `allowed`. No-op when `allowed` is unset (the unrestricted default) or when
4504
+ * `model` is undefined (nothing was configured to check).
4505
+ */
4506
+ declare function assertModelAllowed(model: string | undefined, allowed: readonly string[] | undefined): void;
4507
+ /** Check every canonical model-bearing field in a complete profile, including the models a
4508
+ * backend may select for cheap work, named subagents, or modes. */
4509
+ declare function assertProfileModelsAllowed(profile: AgentProfile$1, allowed: readonly string[] | undefined): void;
4510
+ //#endregion
4511
+ //#region src/runtime/profile-chat-client.d.ts
4512
+ /** Profile-exact adapter for packages that consume agent-eval's ChatClient contract.
4513
+ * Every call still enters Runtime through createExecutor -> streamAgentTurn, and every
4514
+ * behavioral field is checked against the exact AgentProfile before any transport runs. */
4515
+ declare function profileChatClient(args: {
4516
+ profile: AgentProfile$1;
4517
+ executor: ExecutorConfig;
4518
+ context: string;
4519
+ }): ChatClient;
4520
+ /** Profile-exact adapter for agent-eval's external optimizer callback.
4521
+ * Eval validates and freezes the provider-neutral request; Runtime owns the exact
4522
+ * AgentProfile, execution route, retries, usage, and finite execution evidence. */
4523
+ declare function profileOptimizerModelCall(args: {
4524
+ profile: AgentProfile$1;
4525
+ executor: ExecutorConfig;
4526
+ context: string;
4527
+ pricing?: CustomTokenPricing;
4528
+ }): ExternalOptimizerModelCall;
4529
+ //#endregion
5064
4530
  //#region src/runtime/promotion-gate.d.ts
5065
4531
  interface PromotionGateOptions {
5066
4532
  /** The HOLDOUT report — must carry per-task cells for both strategy names. */
@@ -5128,21 +4594,18 @@ interface ResolveSandboxClientOptions {
5128
4594
  backend: 'sandbox' | 'bridge' | 'router' | 'local';
5129
4595
  /** `sandbox` backend: the caller's real Sandbox-backed client. Required for that backend. */
5130
4596
  sandboxClient?: SandboxClient;
5131
- /** `bridge` backend: local cli-bridge transport. `bearer` + `model` required. */
4597
+ /** `bridge` backend: local cli-bridge transport. The per-create profile owns the model. */
5132
4598
  bridge?: {
5133
4599
  /** cli-bridge base URL. Defaults to `http://127.0.0.1:3355`. */
5134
4600
  url?: string;
5135
4601
  bearer: string;
5136
- /** Bridge model id, doubling as the harness selector (e.g. `claude-code/sonnet`). */
5137
- model: string;
5138
4602
  /** Per-turn deadline (ms). */
5139
4603
  timeoutMs?: number;
5140
4604
  };
5141
- /** `router` backend: router chat-completion transport. All three fields required. */
4605
+ /** `router` backend: endpoint/auth only; the per-create profile owns behavior. */
5142
4606
  router?: {
5143
4607
  baseUrl: string;
5144
4608
  key: string;
5145
- model: string;
5146
4609
  };
5147
4610
  /** `local` backend: same-host pseudo-box — the router brain drives a tool loop
5148
4611
  * with the profile's stdio MCP servers spawned as local children. */
@@ -5247,7 +4710,10 @@ declare function extractLlmCallEvent(event: SandboxEvent, agentRunName: string):
5247
4710
  * receipt: (turn) => {
5248
4711
  * const u = sumSandboxUsage(turn.events)
5249
4712
  * return { model, inputTokens: u.input, outputTokens: u.output,
5250
- * ...(u.costUsd > 0 ? { actualCostUsd: u.costUsd } : {}) }
4713
+ * ...(u.tokensKnown === false ? { usageUnknown: true } : {}),
4714
+ * ...(u.usdKnown !== false && u.costUsd > 0 ? { actualCostUsd: u.costUsd } : {}),
4715
+ * ...(u.usdKnown === false ? { costUnknown: true } : {}),
4716
+ * ...(u.estimatedCostUsd !== undefined ? { estimatedCostUsd: u.estimatedCostUsd } : {}) }
5251
4717
  * }
5252
4718
  *
5253
4719
  * Without this a cell reads `{tokens:0, cost:0}` and the backend-integrity guard correctly aborts the
@@ -5257,6 +4723,9 @@ declare function sumSandboxUsage(events: readonly SandboxEvent[], agentRunName?:
5257
4723
  input: number;
5258
4724
  output: number;
5259
4725
  costUsd: number;
4726
+ tokensKnown?: false;
4727
+ usdKnown?: false;
4728
+ estimatedCostUsd?: number;
5260
4729
  };
5261
4730
  /**
5262
4731
  * Cross-event state for {@link mapSandboxToolEvent}. Sandbox backends emit a
@@ -5643,14 +5112,15 @@ declare function materializeLocalMcp(profile: AgentProfile$1, opts?: Materialize
5643
5112
  /** The compressed consumable a skill carries: everything an author needs to emit a loop. */
5644
5113
  declare const strategyAuthorContract = "\nYou author an OPTIMIZATION STRATEGY for an agentic loop system. A strategy decides how to\nspend a compute budget to beat a task's deployable check. You compose exactly two steps:\n\n shot(spec?: { handle?, messages?, steer?, persona?, tools? }): Promise<ShotResult | null>\n Runs ONE worker attempt (a bounded tool loop) over an artifact.\n - omit handle => the shot opens its OWN fresh artifact and closes it after (a sample).\n - pass handle => the shot CONTINUES that artifact (state accumulates across shots).\n - messages => the carried conversation (pass the previous ShotResult.messages to continue).\n - steer => a corrective instruction injected before the shot.\n - persona => { systemPrompt?, model? } — give THIS shot its own role and/or model\n (multi-agent strategies: a researcher shot then an engineer shot, a panel of k\n personas over one budget). On a fresh shot the systemPrompt replaces the task's; on\n a carried conversation it arrives as a hand-off message. Same conserved budget.\n - tools => string[] — restrict THIS shot to a subset of the task's tools by\n name (focus an explore shot on read-only tools, an execute shot on write tools).\n Restriction-only; unknown names make the shot fail. ALWAYS select from\n await listTools(handle) — never hardcode. Omitted => the shot sees every tool.\n ShotResult = { messages, score (0..1 on the task's check), passes, total, completions, toolErrors }\n Returns null if the attempt failed infra-wise.\n\n critique(messages): Promise<string | null>\n A firewalled trace-analyst reads the attempt's trajectory and returns ONE corrective\n instruction (or null when it judges the work complete). Costs ~1 completion.\n\n consult(messages, instruction): Promise<string | null>\n The RAW analyst channel: the same firewalled critic answers YOUR instruction over the\n trajectory verbatim (no reformatting) — use it when you need a specific reply format\n (a decision, a prediction). Costs ~1 completion.\n\n surface.open(task) / surface.close(handle)\n Open a persistent artifact you manage yourself (remember to close in a finally).\n close is idempotent — closing an already-closed handle is a safe no-op.\n\n listTools(handle): Promise<Array<{ name, description? }>>\n The tools THIS task actually offers. TOOL SETS VARY PER TASK — if you restrict a\n shot with `tools`, you MUST pick names from await listTools(handle); hardcoding\n names from an example kills your shots on every task whose tools differ.\n\nRules:\n- ALWAYS await every shot/critique/surface call — a floating promise that rejects\n crashes the whole benchmark run.\n- Stay within ~budget total shots; every shot/critique spends from a conserved pool.\n- For a FRESH attempt OMIT `messages` entirely (never pass `[]` — an empty array is a\n fresh conversation too, but be explicit). To CONTINUE, pass the previous\n ShotResult.messages unchanged.\n- Return { score, resolved, completions, progression, shots } — score = the BEST checkpoint\n you reached (keep-best, never final-state), progression = score after each shot.\n- The module must be EXACTLY this shape (no other imports, no commentary outside code):\n\nimport { defineStrategy } from '@tangle-network/agent-runtime/kernel'\nexport default defineStrategy('your-strategy-name', async ({ surface, task, budget, shot, critique, listTools }) => {\n // your composition (listTools comes from the destructured context — it is NOT a global)\n})\n";
5645
5114
  interface AuthorStrategyOptions {
5646
- /** The model-call seam (agent-eval `createChatClient`). */
5647
- chat: ChatClient;
5648
- model?: string;
5649
- /** A NAMED fallback author tried once when the primary call fails or returns no code
5115
+ /** Exact author identity. Runtime binds it to every authoring turn. */
5116
+ profile: AgentProfile$1;
5117
+ /** Execution substrate for the author. Behavioral settings are forbidden here. */
5118
+ executor: ExecutorConfig;
5119
+ /** An exact fallback author tried once when the primary call fails or returns no code
5650
5120
  * block (thinking models time out at the edge on long authoring prompts, or return
5651
5121
  * empty content without `maxTokens`). Opt-in — absent means the primary's failure
5652
5122
  * propagates. */
5653
- fallbackModel?: string;
5123
+ fallbackProfile?: AgentProfile$1;
5654
5124
  /** The contract text shown to the author. Default `strategyAuthorContract`. The
5655
5125
  * meta-optimization coordinate: a GEPA/skill loop can evolve this text and gate each
5656
5126
  * variant on the same frozen holdout as any strategy. */
@@ -5663,11 +5133,10 @@ interface AuthorStrategyOptions {
5663
5133
  budget: number;
5664
5134
  /** Where the authored module file is written (created if missing). */
5665
5135
  outDir: string;
5666
- temperature?: number;
5667
- /** Completion cap — required by thinking-model authors that stream reasoning first. */
5668
- maxTokens?: number;
5669
5136
  signal?: AbortSignal;
5670
5137
  }
5138
+ /** Standing behavior callers put in the strategy-author AgentProfile. */
5139
+ declare const strategyAuthorSystemPrompt: string;
5671
5140
  /** Static CONTRACT lint over an authored strategy module — the module-boundary
5672
5141
  * enforcement of the harness's two measurement invariants:
5673
5142
  * - author blindness: the only import allowed is the kernel surface. A body that could
@@ -5690,12 +5159,12 @@ declare function authorStrategy(opts: AuthorStrategyOptions): Promise<AuthoredSt
5690
5159
  //#endregion
5691
5160
  //#region src/runtime/strategy-evolution.d.ts
5692
5161
  interface EvolutionAuthor {
5693
- /** The model-call seam (agent-eval `createChatClient`). */
5694
- chat: ChatClient;
5695
- model?: string;
5696
- fallbackModel?: string;
5697
- temperature?: number;
5698
- maxTokens?: number;
5162
+ /** Exact author identity. */
5163
+ profile: AgentProfile$1;
5164
+ /** Execution substrate. All behavior comes from the profile. */
5165
+ executor: ExecutorConfig;
5166
+ /** Optional exact fallback identity. */
5167
+ fallbackProfile?: AgentProfile$1;
5699
5168
  }
5700
5169
  type ChampionPolicy = 'score' | 'costAware';
5701
5170
  interface StrategyEvolutionConfig {
@@ -5891,125 +5360,6 @@ declare function selectChampion(report: BenchmarkReport, fieldOrder: string[], p
5891
5360
  /** Multi-generation strategy search: author candidates from tournament losses, play them against the incumbent at equal budget, promote via `promotionGate` on an untouched holdout slice. */
5892
5361
  declare function runStrategyEvolution(cfg: StrategyEvolutionConfig): Promise<EvolutionReport>;
5893
5362
  //#endregion
5894
- //#region src/runtime/stream-agent-turn.d.ts
5895
- /**
5896
- * The execution substrate one turn runs on — a closed discriminated union over
5897
- * the three stream surfaces the runtime already owns.
5898
- *
5899
- * @experimental
5900
- */
5901
- type AgentTurnBackend = {
5902
- /** A live sandbox box: the turn is one `box.streamPrompt(prompt)` call. */
5903
- kind: 'box';
5904
- box: SandboxInstance;
5905
- /**
5906
- * Per-turn `PromptOptions` forwarded verbatim to `streamPrompt`
5907
- * (`sessionId`, `turnId`, `model`, `backend` profile, `timeoutMs`, …).
5908
- * The turn's derived abort signal (caller `signal` + `timeoutMs`
5909
- * deadline) is always installed as `signal` — pass cancellation through
5910
- * `StreamAgentTurnOptions`, not here.
5911
- */
5912
- options?: Omit<PromptOptions, 'signal'>;
5913
- /** Model label stamped on cost-only `llm_call` events. Default `'agent'`. */
5914
- agentRunName?: string;
5915
- } | {
5916
- /**
5917
- * A one-shot `Executor` (cli-bridge / router / BYO): the factory is
5918
- * instantiated fresh for the turn via `inlineSandboxClient`, run once on
5919
- * the prompt, and torn down — the same per-spawn lifecycle the supervise
5920
- * runtime gives it.
5921
- */
5922
- kind: 'executor';
5923
- factory: ExecutorFactory<unknown>;
5924
- /** Model label stamped on cost-only `llm_call` events. Default `'agent'`. */
5925
- agentRunName?: string;
5926
- } | {
5927
- /**
5928
- * An in-process `AgentExecutionBackend` (`resolveAgentBackend` output or
5929
- * any custom backend): the turn is one `backend.stream()` call.
5930
- */
5931
- kind: 'chat';
5932
- backend: AgentExecutionBackend;
5933
- };
5934
- /** @experimental */
5935
- interface StreamAgentTurnOptions {
5936
- /** Caller-initiated cancellation. Terminates the stream with `final.status: 'aborted'`. */
5937
- signal?: AbortSignal;
5938
- /**
5939
- * Wall-clock deadline for the whole turn in ms. An expired deadline aborts
5940
- * the backend and terminates the stream with `final.status: 'failed'`
5941
- * (a blown deadline is a turn failure, not a caller cancellation).
5942
- */
5943
- timeoutMs?: number;
5944
- /**
5945
- * Opt-in tool-part projection for box and executor backends: sandbox tool
5946
- * parts additionally surface in-stream as
5947
- * `tool_call` / `tool_result` events (`mapSandboxToolEvent`), so a consumer
5948
- * rendering tool activity needs no bespoke sandbox-event parser. Default
5949
- * off — the stream vocabulary existing consumers see is unchanged. No-op
5950
- * for the `chat` kind (its backend emits `RuntimeStreamEvent`s directly,
5951
- * tool events included when the backend produces them).
5952
- */
5953
- preserveToolParts?: boolean;
5954
- /**
5955
- * Raw-event tap for box-kind backends: called (and awaited) with every
5956
- * unmapped `SandboxEvent` BEFORE it is projected, so a consumer can read
5957
- * parts the chat-UX projection drops (part ids, step markers, custom
5958
- * backend events) without forking the mapper. Purely observational — it
5959
- * cannot alter the mapped stream. Never called for the `chat` kind, which
5960
- * has no sandbox events.
5961
- */
5962
- onRawEvent?: (event: SandboxEvent) => void | Promise<void>;
5963
- }
5964
- /**
5965
- * Metered usage of one turn, summed over every cost-bearing event the backend
5966
- * emitted. `input`/`output` are token counts (0 when the backend reported
5967
- * none — the honest sum, never a fabricated estimate). `costUsd`/`model` are
5968
- * present only when the backend actually reported them.
5969
- *
5970
- * @experimental
5971
- */
5972
- interface AgentTurnUsage {
5973
- input: number;
5974
- output: number;
5975
- costUsd?: number;
5976
- model?: string;
5977
- }
5978
- /**
5979
- * A drained turn: the terminal summary plus every event the stream yielded.
5980
- * `status`/`error` mirror the terminal `final` event so a failed or aborted
5981
- * turn stays inspectable without re-scanning `events`.
5982
- *
5983
- * @experimental
5984
- */
5985
- interface CollectedAgentTurn {
5986
- finalText: string;
5987
- usage: AgentTurnUsage;
5988
- events: RuntimeStreamEvent[];
5989
- status: AgentTaskStatus;
5990
- error?: BackendErrorDetail;
5991
- }
5992
- /**
5993
- * Run ONE agent turn on any backend kind and stream its events. Yields the
5994
- * `RuntimeStreamEvent` vocabulary incrementally and always ends with a `final`
5995
- * event carrying the turn's text and usage (`metadata.tokenUsage`,
5996
- * `metadata.costUsd?`, `metadata.model?`) — on success, failure, abort, and
5997
- * timeout alike. The generator never throws; failures surface in-band as
5998
- * `backend_error` + `final` with a typed `error` detail.
5999
- *
6000
- * @experimental
6001
- */
6002
- declare function streamAgentTurn(backend: AgentTurnBackend, prompt: string, opts?: StreamAgentTurnOptions): AsyncGenerator<RuntimeStreamEvent>;
6003
- /**
6004
- * Drain a `streamAgentTurn` stream (or any `RuntimeStreamEvent` stream that
6005
- * honors its terminal contract) into the turn summary plus the full event
6006
- * list. Fail-loud: throws when the stream ends without a terminal `final`
6007
- * event — a stream that violates the contract must not read as an empty turn.
6008
- *
6009
- * @experimental
6010
- */
6011
- declare function collectAgentTurn(stream: AsyncIterable<RuntimeStreamEvent>): Promise<CollectedAgentTurn>;
6012
- //#endregion
6013
5363
  //#region src/runtime/structural-rollout.d.ts
6014
5364
  /** Provider-neutral conversation records read by structural candidate extraction. */
6015
5365
  type StructuralRolloutMessage = Record<string, unknown>;
@@ -6027,8 +5377,6 @@ interface StructuralRolloutPolicy {
6027
5377
  /** Per-slot strategy-lens prefixes on the k samples (attacks the all-k-fail bucket).
6028
5378
  * Measured as a paired null (+0.6pp) — kept as an optional knob, off by default. */
6029
5379
  diverse?: boolean;
6030
- /** Sampling temperature for every shot of this strategy; omitted ⇒ the worker default. */
6031
- temperature?: number;
6032
5380
  }
6033
5381
  /** The measured default recipe: 5 samples, 2 guarded repair rounds, 6 authored checks. */
6034
5382
  declare const defaultStructuralRolloutPolicy: StructuralRolloutPolicy;
@@ -6199,22 +5547,6 @@ type AuthoredProfile = AgentProfile$1 & {
6199
5547
  /** Narrow an untyped `spawn_agent` profile argument to an `AuthoredProfile`, or null if the
6200
5548
  * supervisor failed to author one (empty/placeholder profile — a skill violation worth catching). */
6201
5549
  declare function asAuthoredProfile(raw: unknown): AuthoredProfile | null;
6202
- /**
6203
- * Lift a profile the supervisor AUTHORED into the canonical shape every executor reads.
6204
- *
6205
- * The skill asks for `systemPrompt` and `model` as flat fields — the vocabulary a model writes
6206
- * well — while `AgentProfile` carries them as `prompt.systemPrompt` and `model.default`. Nothing
6207
- * downstream reads the flat form: the router and cli-bridge leaves read `profile.prompt
6208
- * .systemPrompt`, and the sandbox leaf hands the profile to a strict schema that REJECTS the flat
6209
- * key outright (`Unrecognized key: "systemPrompt"`), which fails the worker's every round. Lift
6210
- * both here, once, so what the supervisor writes is what the worker runs.
6211
- *
6212
- * Purely additive: a profile already canonical is returned untouched, and a flat field is dropped
6213
- * only after its canonical slot is filled. Both spellings of the same standing instruction, set to
6214
- * DIFFERENT text, is a contradiction with no safe reading — it fails loud, matching
6215
- * `resolveSupervisorProfile`'s rule for the supervisor's own profile.
6216
- */
6217
- declare function canonicalizeAuthoredProfile(raw: unknown): AgentProfile$1;
6218
5550
  /** The supervisor SKILL — the how-to the supervisor reads (its system prompt). THE optimizable
6219
5551
  * surface: editing this changes how the supervisor designs every agent it spawns.
6220
5552
  *
@@ -6225,14 +5557,6 @@ declare function canonicalizeAuthoredProfile(raw: unknown): AgentProfile$1;
6225
5557
  declare function supervisorInstructions(opts?: {
6226
5558
  goal?: string;
6227
5559
  }): string;
6228
- /** Build a router-only worker from an authored profile. This helper executes the prompt/model axes;
6229
- * use `workerFromBackend` for full materialization of tools, MCP, resources, hooks, and subagents. */
6230
- declare function authoredWorker(profile: AuthoredProfile, opts: {
6231
- cfg: RouterConfig;
6232
- taskPrompt: string;
6233
- deliverable: DeliverableSpec;
6234
- temperature?: number;
6235
- }): Agent<unknown, unknown>;
6236
5560
  /** Thresholds below which a system prompt is treated as a thin stub. Tunable per call. */
6237
5561
  interface ProfileRichnessThresholds {
6238
5562
  /** A prompt shorter than this many characters is thin (default 600). */
@@ -6322,11 +5646,9 @@ type BudgetReadout = Readonly<{
6322
5646
  reservedTokens: number;
6323
5647
  }>;
6324
5648
  /** Why a reservation was refused. `budget-exhausted` means the pool ran out of a channel it
6325
- * budgets; `below-runtime-floor` means the request is under the amount that harness needs before
6326
- * it does any work at all, so it is unsatisfiable at that size and the fix is to RAISE it;
6327
- * `usd-unbudgeted` means the root declared no dollar ceiling, so a dollar request is
6328
- * unsatisfiable at any amount and the fix is to budget the root, not to ask for less. */
6329
- type ReservationRejection = 'budget-exhausted' | 'usd-unbudgeted' | 'below-runtime-floor';
5649
+ * budgets; `usd-unbudgeted` means the root declared no dollar ceiling, so a dollar request is
5650
+ * unsatisfiable at any amount and the fix is to budget the root, not to ask for less. */
5651
+ type ReservationRejection = 'budget-exhausted' | 'usd-unbudgeted';
6330
5652
  /** State recovered from a prior process before new work is admitted. `committed` is measured spend
6331
5653
  * already present in the durable journal. Each `uncertainReservation` is a child that was recorded
6332
5654
  * as started but never recorded as settled: its full declared ceiling is charged conservatively,
@@ -6392,123 +5714,49 @@ declare function spendFromUsageEvents(events: UsageEvent[]): Spend;
6392
5714
  declare function createBudgetPool(root: Budget, now?: () => number, restore?: BudgetPoolRestore): BudgetPool;
6393
5715
  //#endregion
6394
5716
  //#region src/runtime/supervise/chat-transport-executor.d.ts
6395
- /** One buffered chat-completions call: the OpenAI-shape request body in, the parsed completion
6396
- * JSON out. The ONE wire function of this module — the executor's default transport is built
6397
- * from it, and a harness that must prove two arms share a substrate (P1 parity) drives BOTH
6398
- * through the same instance. */
6399
- type ChatCompletionsTransport = (body: Record<string, unknown>, signal?: AbortSignal) => Promise<unknown>;
6400
- /** The default transport: POST `${url}/chat/completions` with an optional bearer. Fail-loud on
6401
- * any non-2xx — the status and body head become the settle reason. */
6402
- declare function chatCompletionsTransport(opts: {
6403
- url: string;
6404
- bearer?: string;
6405
- }): ChatCompletionsTransport;
6406
- /** Conversation history keyed by the settled worker id — the resume substrate. The kernel owns
6407
- * identity, ordering, ledger truth, and spend continuity; this store owns only the message
6408
- * lists a `'resume'` spawn continues (`WorkerSpawnContext.resume.ofWorker` is the load key).
6409
- * PROCESS-LOCAL by the same boundary the kernel documents for resume itself: a prior process's
6410
- * workers are not resume targets. */
5717
+ /** Buffered OpenAI-compatible completion port used only for offline execution. */
5718
+ type ChatCompletionsTransport = NonNullable<RouterToolsSeam['complete']>;
5719
+ /** Conversation history keyed by the settled Runtime worker id. */
6411
5720
  interface ChatSessionStore {
6412
- load(workerId: string): ReadonlyArray<Record<string, unknown>> | undefined;
6413
- save(workerId: string, messages: ReadonlyArray<Record<string, unknown>>): void;
5721
+ load(workerId: string): ReadonlyArray<Readonly<Record<string, unknown>>> | undefined;
5722
+ save(workerId: string, messages: ReadonlyArray<Readonly<Record<string, unknown>>>): void;
6414
5723
  }
6415
- /** In-memory `ChatSessionStore`. Entries are detached copies a caller mutating a saved array
6416
- * cannot corrupt a recorded session. */
5724
+ /** In-memory, process-local conversation store with detached reads and writes. */
6417
5725
  declare function createChatSessionStore(): ChatSessionStore;
6418
- /** One entry of the caller-provided tool table: the OpenAI function spec the model sees, and the
6419
- * host-side implementation run when the model calls it. */
5726
+ /** One profile-authorized function tool and its host implementation. */
6420
5727
  interface ChatTransportTool {
6421
5728
  readonly spec: ToolSpec;
6422
- /** Runs ON THIS HOST; the returned string folds back as the `tool` message. A throw is fed
6423
- * back as an error message for the model to correct — a bad tool call is a real outcome, not
6424
- * an infra fault. */
6425
5729
  readonly execute: (args: Record<string, unknown>, task: unknown) => Promise<string>;
6426
5730
  }
5731
+ /**
5732
+ * Transport and session data for one exact profile-driven conversation.
5733
+ * Behavioral controls belong only in `profile.model.metadata`.
5734
+ */
6427
5735
  interface ChatTransportExecutorOptions {
6428
- /** OpenAI-compatible base URL (with or without `/v1`); the executor POSTs to
6429
- * `${url}/chat/completions`. Ignored when `complete` is injected. */
6430
- url: string;
6431
- /** Bearer token for the default transport. Omit for an unauthenticated endpoint. */
6432
- bearer?: string;
6433
- /** The wire model id sent on every completion. */
6434
- model: string;
6435
- /** System prompt seeding a FRESH conversation. A resumed conversation keeps the system message
6436
- * it was recorded with — a session continues; it is not re-primed. */
6437
- system?: string;
6438
- /** Tool table. Omitted = a pure conversation (no `tools` field on the wire). */
6439
- tools?: ReadonlyArray<ChatTransportTool>;
6440
- temperature?: number;
6441
- /** Output-token ceiling for ONE completion, sent as `max_tokens` on every request when set.
6442
- * Omitted = no field on the wire, so the endpoint's own default governs. A harness pairing
6443
- * this executor against another sampling path (P1 parity) pins BOTH arms to one value. */
6444
- maxTokens?: number;
6445
- /** Inference-turn cap for ONE shot (one `execute`). Default 200 — a runaway backstop, not a
6446
- * workflow limit (mirrors `routerToolsInlineExecutor.maxTurns`). */
6447
- maxTurnsPerShot?: number;
6448
- /** Injected buffered transport — the offline seam (mirrors `RouterConfig.complete`). When set,
6449
- * `url`/`bearer` are unused and NO network is touched. */
6450
- complete?: ChatCompletionsTransport;
6451
- /** Session store backing continuity. Required to record this conversation (with `sessionKey`)
6452
- * or to continue a prior one (with `resume`). */
6453
- sessions?: ChatSessionStore;
6454
- /** The id this worker's conversation is recorded under at settle — the kernel node id when
6455
- * spawned through a scope, so a later `'resume'` spawn's `resume.ofWorker` finds it. */
6456
- sessionKey?: string;
6457
- /** The resume lineage from `WorkerSpawnContext.resume`: this shot continues `ofWorker`'s
6458
- * recorded message list. Requires `sessions` holding that conversation — fails loud before
6459
- * any spend when it does not. */
6460
- resume?: WorkerResumeContext;
6461
- /** Profile this executor materializes, for the kernel's materialization receipt. Omitted =
6462
- * the node's receipt reads `executor-did-not-report` (a direct, unsupervised use). */
6463
- profile?: AgentProfile$1;
6464
- /** Kernel-minted attempt id (`ExecutorNodeContext.attemptId`) binding the receipt to this
6465
- * exact spawn. */
6466
- attemptId?: string;
5736
+ readonly profile: AgentProfile$1;
5737
+ readonly url?: string;
5738
+ readonly bearer?: string;
5739
+ readonly tools?: ReadonlyArray<ChatTransportTool>;
5740
+ readonly complete?: ChatCompletionsTransport;
5741
+ readonly sessions?: ChatSessionStore;
5742
+ readonly sessionKey?: string;
5743
+ readonly resume?: WorkerResumeContext;
6467
5744
  }
6468
5745
  /**
6469
- * Build the chat-transport `Executor`: one `execute` = one conversation SHOT — seed (fresh system
6470
- * prompt, or the resumed session's recorded history) + the task as the next user message, then
6471
- * loop completion → host tool calls → tool messages until the model answers without a tool call
6472
- * (or the turn cap). Settles with the final assistant text as `out`.
6473
- *
6474
- * Fail-loud contract: transport failures (non-2xx, network faults, malformed completions) throw
6475
- * `ValidationError`, which the scope settles as an INFRA failure (`Settled.down.infra`) — never a
6476
- * fake success. The accumulated conversation is still recorded before the throw when a store is
6477
- * configured, because the inference HAPPENED and a resume may continue a failed session (the
6478
- * kernel deliberately allows resume-after-failure; the seam decides).
5746
+ * Build one exact profile-driven chat executor through `createExecutor`.
5747
+ * Prefer `chatWorkerSeam` for supervised work because it supplies trusted node identity.
6479
5748
  */
6480
5749
  declare function chatTransportExecutor(opts: ChatTransportExecutorOptions): Executor<string>;
5750
+ /** Transport/session configuration shared by every spawned exact profile. */
6481
5751
  interface ChatWorkerSeamOptions {
6482
- /** OpenAI-compatible base URL every spawned worker speaks. Unused when `complete` is set. */
6483
- url: string;
6484
- bearer?: string;
6485
- /** Fallback wire model when a spawned profile carries none (`profile.model.default` wins). */
6486
- model?: string;
6487
- tools?: ReadonlyArray<ChatTransportTool>;
6488
- temperature?: number;
6489
- /** Per-completion `max_tokens` for every spawned worker (see
6490
- * {@link ChatTransportExecutorOptions.maxTokens}). */
6491
- maxTokens?: number;
6492
- maxTurnsPerShot?: number;
6493
- /** Injected buffered transport — the offline seam; no network is touched when set. */
6494
- complete?: ChatCompletionsTransport;
6495
- /** Session store backing continuity. Default: one fresh in-memory store PER SEAM, matching the
6496
- * kernel's process-local resume boundary (one seam = one run's sessions). */
6497
- sessions?: ChatSessionStore;
6498
- /** The completion oracle: each worker settles `valid` ⟺ this check passes on its final
6499
- * assistant text (`gateOnDeliverable` — settled ⟺ DELIVERED, exactly how `workerFromBackend`
6500
- * composes it). Pass the graph's deliverable so a keep-best driver can pick a winner; omitted,
6501
- * workers settle unverdicted and only a driver `submit_result` can win. */
6502
- deliverable?: DeliverableSpec<unknown>;
5752
+ readonly url?: string;
5753
+ readonly bearer?: string;
5754
+ readonly tools?: ReadonlyArray<ChatTransportTool>;
5755
+ readonly complete?: ChatCompletionsTransport;
5756
+ readonly sessions?: ChatSessionStore;
5757
+ readonly deliverable?: DeliverableSpec<unknown>;
6503
5758
  }
6504
- /**
6505
- * The `makeWorkerAgent` seam over {@link chatTransportExecutor} — the continuity consumer
6506
- * `workerFromBackend` refuses to be. Every spawn becomes one conversation shot: the spawned
6507
- * profile's system prompt + instructions (which is where a graph's delegates directive lands)
6508
- * seed a fresh session, and a `'resume'` spawn re-attaches by loading `resume.ofWorker`'s
6509
- * recorded message list from the seam's session store. Conversations are recorded under the
6510
- * kernel node id, which is exactly what a later `resume.ofWorker` names.
6511
- */
5759
+ /** Session-owning worker factory for graph continuity. */
6512
5760
  declare function chatWorkerSeam(opts: ChatWorkerSeamOptions): MakeWorkerAgent;
6513
5761
  //#endregion
6514
5762
  //#region src/runtime/supervise/coordination-log.d.ts
@@ -6777,6 +6025,9 @@ interface DriverAgentOptions {
6777
6025
  * (the canonical `ToolLoopChat`): a scripted mock offline, the router's tool-calling in
6778
6026
  * production, or a sandboxed harness. The same seam every tool-loop uses; no bespoke shape. */
6779
6027
  readonly brain: ToolLoopChat;
6028
+ /** Profile-declared model for a production Router brain. When set, every turn must report this
6029
+ * exact provider-observed model before its output is accepted. Omitted by scripted test brains. */
6030
+ readonly expectedModel?: string;
6780
6031
  /** Shared blob store — `observe_agent` reads settled outputs through it. */
6781
6032
  readonly blobs: ResultBlobStore;
6782
6033
  /** Resolve a spawned `profile` to a worker LEAF or a driver child (the recursion seam). */
@@ -6971,13 +6222,278 @@ declare function serveCoordinationMcp(opts: {
6971
6222
  nodeTools?: ReadonlyArray<McpToolDescriptor$1>;
6972
6223
  }): Promise<CoordinationMcpHandle>;
6973
6224
  //#endregion
6225
+ //#region src/runtime/supervise/driver-retry.d.ts
6226
+ /** How hard the root driver is retried after a transient failure. The defaults retry; a caller
6227
+ * that wants the pre-#741 behavior sets `enabled: false` and owns the consequence. */
6228
+ interface DriverRetryPolicy {
6229
+ /** `false` restores the historical behavior: the first driver failure ends the run. */
6230
+ readonly enabled?: boolean;
6231
+ /** Consecutive failures that changed NOTHING (no metered spend, no settlement, no submission)
6232
+ * before the run gives up. Default 3. A failure that made progress resets the count. */
6233
+ readonly maxConsecutiveFailures?: number;
6234
+ /** Absolute ceiling on attempts, regardless of progress. Default 8. The barren counter alone
6235
+ * cannot bound a driver that crashes every turn AFTER metering a little: each attempt looks like
6236
+ * progress, so without this backstop such a run would retry until it had eaten the entire
6237
+ * envelope. A caller who wants budget-only bounding sets this high deliberately. */
6238
+ readonly maxAttempts?: number;
6239
+ /** Backoff before the first retry, doubling per consecutive failure. Default 2000ms. */
6240
+ readonly initialBackoffMs?: number;
6241
+ /** Ceiling on the doubling. Default 30000ms. */
6242
+ readonly maxBackoffMs?: number;
6243
+ }
6244
+ /** Why the retry loop stopped. `completed` is the only non-failure. */
6245
+ type DriverAttemptStop = 'completed' | 'terminal-error' | 'retry-disabled' | 'aborted' | 'budget-exhausted' | 'deadline' | 'no-progress' | 'max-attempts';
6246
+ /** One attempt's record — the legible failure the issue's third ask names. Emitted per attempt so
6247
+ * an operator sees `driver failed after N attempts` instead of one opaque `pi exit unknown`. */
6248
+ interface DriverAttemptRecord {
6249
+ /** 1-based. */
6250
+ readonly attempt: number;
6251
+ readonly durationMs: number;
6252
+ /** Absent when the attempt completed. */
6253
+ readonly error?: string;
6254
+ readonly classification?: 'transient' | 'terminal';
6255
+ /** Did anything change since the previous attempt (spend, settlement, submission)? */
6256
+ readonly madeProgress: boolean;
6257
+ /** Set when this attempt ended the loop. */
6258
+ readonly stop?: DriverAttemptStop;
6259
+ /** Set when another attempt follows. */
6260
+ readonly retryInMs?: number;
6261
+ }
6262
+ /** The comparable mark used to decide whether an attempt did anything at all. Any field moving
6263
+ * counts as progress — a driver that metered one turn before dying is not dead on arrival. */
6264
+ interface DriverProgressMark {
6265
+ /** Monotone total of POOL spend since the first reading, in tokens — the driver's own metered
6266
+ * turns AND any child settlement, because the conserved pool is shared. Deliberately not
6267
+ * driver-only: a child that settled during the attempt is progress by any reading, and the
6268
+ * coarser signal can only bias toward rescuing a run, never toward abandoning one. */
6269
+ readonly poolTokensSpent: number;
6270
+ /** Monotone count of settled children. */
6271
+ readonly settledCount: number;
6272
+ /** Whether an accepted deliverable exists. */
6273
+ readonly submitted: boolean;
6274
+ }
6275
+ /**
6276
+ * Classify one driver failure. Runtime's own typed refusals are decisions and stay terminal;
6277
+ * anything foreign is an accident and is retryable. A `BackendTransportError` is split by status
6278
+ * because the taxonomy already promises consumers may branch on it: a 5xx/429/408 is the upstream
6279
+ * having a bad moment, while a 401/404/422 is a request that will fail identically forever.
6280
+ */
6281
+ declare function classifyDriverFailure(error: unknown, signal?: AbortSignal): 'transient' | 'terminal';
6282
+ /** The error a give-up throws: the original cause, re-described with the attempt history so
6283
+ * `driver-failed` carries a diagnosable message instead of one backend's last words. */
6284
+ declare class DriverAttemptsExhaustedError extends RuntimeRunStateError {
6285
+ readonly attempts: readonly DriverAttemptRecord[];
6286
+ readonly stop: DriverAttemptStop;
6287
+ constructor(cause: unknown, attempts: readonly DriverAttemptRecord[], stop: DriverAttemptStop);
6288
+ }
6289
+ //#endregion
6290
+ //#region src/runtime/supervise/supervisor-agent.d.ts
6291
+ /** A supervisor is an exact canonical AgentProfile; no looser model/prompt shape exists. */
6292
+ type SupervisorProfile = AgentProfile$1;
6293
+ /** The exact profile fields consumed by supervisor materialization. */
6294
+ interface ResolvedSupervisorProfile {
6295
+ readonly name: string;
6296
+ readonly harness: string | null;
6297
+ readonly modelId: string;
6298
+ readonly systemPrompt?: string;
6299
+ }
6300
+ /**
6301
+ * Reduce one canonical executable profile to the scalars the two brain arms consume.
6302
+ */
6303
+ declare function resolveSupervisorProfile(profile: SupervisorProfile): ResolvedSupervisorProfile;
6304
+ /** Where the coordination MCP binds. Omit = an ephemeral port on `127.0.0.1` (the local-harness
6305
+ * default); set `host` when the root or the harness runs off-host. */
6306
+ interface CoordinationBinding {
6307
+ readonly host?: string;
6308
+ readonly port?: number;
6309
+ /** Explicit acknowledgment required to bind a NON-loopback host — see
6310
+ * {@link assertCoordinationBinding} for what is being accepted. */
6311
+ readonly allowUnauthenticatedRemote?: boolean;
6312
+ }
6313
+ /**
6314
+ * Fail closed on a non-loopback coordination bind. `serveCoordinationMcp` mounts spawn_agent /
6315
+ * steer_agent / stop with NO authentication of any kind (it is a bare JSON-RPC-over-HTTP handler),
6316
+ * so a non-loopback bind lets anyone who can reach the port spawn agents and spend the run's
6317
+ * conserved budget. There is no token to require yet, so the only honest options are loopback or an
6318
+ * explicit, recorded acknowledgment — never a silent bind.
6319
+ */
6320
+ declare function assertCoordinationBinding(binding: CoordinationBinding | undefined): void;
6321
+ /** Trusted run/node identity Runtime binds to one manager. Model-authored tool arguments cannot
6322
+ * provide or replace any of these fields. */
6323
+ interface SupervisorNodeContext {
6324
+ readonly runId: string;
6325
+ /** Stable across a durable restart; unique per in-memory invocation. */
6326
+ readonly runNamespace: string;
6327
+ /** Concrete Scope node that owns this manager's coordination stream. */
6328
+ readonly nodeId: string;
6329
+ /** Stable identity of this manager's coordination stream. */
6330
+ readonly ownerId: string;
6331
+ readonly depth: number;
6332
+ readonly identity: NodeExecutionIdentity;
6333
+ /** Assignment identity within the parent manager; absent only for the root. */
6334
+ readonly assignmentId?: string;
6335
+ readonly profile: SupervisorProfile;
6336
+ readonly task: unknown;
6337
+ }
6338
+ /** Context known before `Agent.act`; Runtime adds the concrete node, profile, and task. */
6339
+ type SupervisorNodeContextSeed = Omit<SupervisorNodeContext, 'nodeId' | 'profile' | 'task'>;
6340
+ /** Trusted context for one product-tool invocation. The node identity remains the same detached,
6341
+ * immutable snapshot supplied to the resolver; `signal` is the one live control reference Runtime
6342
+ * adds. It aborts when this manager's scope is cancelled by the caller, RootHandle, deadline,
6343
+ * breaker, or a recursive parent. */
6344
+ interface SupervisorToolInvocationContext extends SupervisorNodeContext {
6345
+ readonly signal: AbortSignal;
6346
+ }
6347
+ /** One product-owned tool. It reuses the canonical MCP descriptor fields while Runtime supplies
6348
+ * the trusted invocation context as a separate argument and binds the result for either
6349
+ * transport. Existing handlers remain compatible: the second argument only gains `signal`. */
6350
+ interface SupervisorToolDescriptor extends Omit<McpToolDescriptor$1, 'handler'> {
6351
+ readonly handler: (raw: unknown, context: SupervisorToolInvocationContext) => Promise<unknown>;
6352
+ }
6353
+ /** Product policy for the tools one exact supervisor node may call. Resolved once per node. */
6354
+ type ResolveSupervisorTools = (context: SupervisorNodeContext) => ReadonlyArray<SupervisorToolDescriptor> | Promise<ReadonlyArray<SupervisorToolDescriptor>>;
6355
+ /** Context-aware observer used internally to bind product transactions to the actual live node. */
6356
+ type ObserveSupervisorNodeEvent = (context: SupervisorNodeContext, event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
6357
+ /** How to run an external harness as the DRIVER, with the coordination verbs mounted — the substrate
6358
+ * seam the caller supplies (mirrors `makeWorkerAgent` for spawned children). It runs `profile` on
6359
+ * `task` in its backend (remote sandbox or local CLI bridge) with `coordinationMcpUrl` mounted as an MCP server,
6360
+ * so the harness calls spawn_agent / await_event / stop as native tools over the live scope. */
6361
+ interface DriveHarness {
6362
+ (args: {
6363
+ /** The caller's profile, EXACTLY as passed to `supervisorAgent` — never rewritten. A canonical
6364
+ * `AgentProfile` stays schema-valid here (the canonical schema rejects unknown top-level keys,
6365
+ * so hoisting a resolved prompt onto it would make a profile its own validator refuses). */
6366
+ readonly profile: SupervisorProfile;
6367
+ /** The standing instruction assembled from the profile: its system prompt in either spelling,
6368
+ * plus the `prompt.instructions` and `resources.instructions` lines. Absent when the profile
6369
+ * names none — the harness's own default then applies. This, not `profile.systemPrompt`, is
6370
+ * what the harness should run under. */
6371
+ readonly systemPrompt?: string;
6372
+ readonly task: unknown;
6373
+ readonly scope: Scope<unknown>;
6374
+ readonly coordinationMcpUrl: string;
6375
+ /** Data-only product tool surface mounted on the coordination MCP. Runtime-owned drivers include
6376
+ * this in their materialization evidence without persisting executable handlers. */
6377
+ readonly coordinationTools: ReadonlyArray<Omit<McpToolDescriptor$1, 'handler'>>;
6378
+ }): Promise<void>;
6379
+ /** Optional live inbox for the manager session this adapter currently drives. Return `false`
6380
+ * when no executor inbox is active instead of claiming a message was delivered. */
6381
+ deliver?(message: unknown): boolean;
6382
+ }
6383
+ /** Trusted manager identity available before its external harness starts. A product uses this to
6384
+ * return one independently steerable harness session per recursive manager. */
6385
+ type DriveHarnessOwnerContext = Omit<SupervisorNodeContext, 'nodeId'>;
6386
+ /** Resolve an external harness for one exact Runtime-owned manager identity. */
6387
+ type ResolveDriveHarness = (context: DriveHarnessOwnerContext) => DriveHarness;
6388
+ interface SupervisorAgentDeps {
6389
+ readonly blobs: ResultBlobStore;
6390
+ /** Resolve a spawned worker `profile` to a leaf agent — the recursion seam (same for both arms). */
6391
+ readonly makeWorkerAgent: MakeWorkerAgent;
6392
+ /** Product authorization for every down-leg continuation to a child. */
6393
+ readonly authorizeDownMessage?: AuthorizeDownMessage;
6394
+ /** Per-child budget reserved from the conserved pool on each spawn. */
6395
+ readonly perWorker: Budget;
6396
+ /** Independent completion check for direct driver work (`submit_result`). */
6397
+ readonly deliverable?: DeliverableSpec<unknown>;
6398
+ /** Hard cap on simultaneously-LIVE workers across both arms — `spawn_agent` fails closed once
6399
+ * this many are in flight (a concurrency fence on top of the conserved-pool fence; bounds live
6400
+ * boxes/sandboxes, not total work). Omit/`<= 0` = no cap. */
6401
+ readonly maxLiveWorkers?: number;
6402
+ /** Router substrate for a router-brained supervisor (`harness` omitted or `cli-base`). The
6403
+ * profile's model wins. */
6404
+ readonly router?: RouterTransportConfig;
6405
+ /** Required to run an external-harness supervisor: runs the harness as the driver. */
6406
+ readonly driveHarness?: DriveHarness;
6407
+ /** How hard a transiently-failed EXTERNAL driver is re-entered before the run ends
6408
+ * `driver-failed` (#741). Retries reuse the same scope, coordination server, and live children;
6409
+ * the bridge backend reattaches the harness session by its durable execution id. Omit = retry
6410
+ * under the defaults; `{ enabled: false }` = the historical first-failure-ends-the-run behavior.
6411
+ * The router arm is unaffected: its transport already retries. */
6412
+ readonly driverRetry?: DriverRetryPolicy;
6413
+ /** Per-attempt record for the external driver — how an operator sees "failed after N attempts"
6414
+ * instead of one backend's last words. */
6415
+ readonly onDriverAttempt?: (record: DriverAttemptRecord) => void | Promise<void>;
6416
+ /** Trusted identity for this manager. Required with node-scoped tools or observation. */
6417
+ readonly nodeContext?: SupervisorNodeContextSeed;
6418
+ /** Resolve product-owned tools for this exact manager. Static `extraTools` remain a router-only
6419
+ * compatibility seam and deliberately receive no new recursive authority. */
6420
+ readonly resolveSupervisorTools?: ResolveSupervisorTools;
6421
+ /** Awaited product observation, enriched with this manager's actual live node context. */
6422
+ readonly observeNodeEvent?: ObserveSupervisorNodeEvent;
6423
+ /** Replay resume-time settlements through `observeNodeEvent` before the manager starts. */
6424
+ readonly replaySettlements?: boolean;
6425
+ /** WORK tools the supervisor may call DIRECTLY (router arm) — so it can do simple work ITSELF and
6426
+ * only delegate when it needs parallelism. Pair with `executeExtraTool`. */
6427
+ readonly extraTools?: ReadonlyArray<{
6428
+ readonly name: string;
6429
+ readonly description?: string;
6430
+ readonly parameters: Record<string, unknown>;
6431
+ }>;
6432
+ /** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
6433
+ readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
6434
+ /** Analyst lenses available to the driver (both arms). Required for `analyzeOnSettle`. */
6435
+ readonly analysts?: AnalystRegistry;
6436
+ /** Analyst kinds run on each worker-settle → a `finding` the driver composes its next steer from
6437
+ * (the self-improving UP-leg). Unset/empty = status quo (no analyst feed). Requires `analysts`. */
6438
+ readonly analyzeOnSettle?: ReadonlyArray<string | AnalyzeOnSettleRoute>;
6439
+ /** Run the ONLINE detector panel over each worker's LIVE tool trace (both arms) so the driver
6440
+ * learns a worker is looping mid-run instead of at settle. Omit = no online watching. */
6441
+ readonly watchWorkers?: WorkerWatchOptions;
6442
+ /** Idle time after which `observe_agent` reports a worker as stalled. Omit = runtime default. */
6443
+ readonly stallAfterMs?: number;
6444
+ /** Default continuity per worker PROFILE NAME (both arms) — `'resume'` re-attaches spawns of
6445
+ * that name to the node's latest settled worker; `spawn_agent`'s per-call `continuity`
6446
+ * overrides. Omit = every spawn fresh (status quo). */
6447
+ readonly continuityByProfile?: Readonly<Record<string, ContinuityMode>>;
6448
+ /** PROGRESS-derived stop rule (router arm). Ends a run that has stopped learning BEFORE it
6449
+ * exhausts a ceiling; it can never keep a run alive past one. Build it with `plateau` /
6450
+ * `noProgressFor` / `allWorkersStalled` from `supervise/stop-rules` — the thresholds are the
6451
+ * caller's judgment. Omit = ceilings only. */
6452
+ readonly stopRule?: StopRule;
6453
+ /** One-shot notification of WHY a `stopRule` ended the run. */
6454
+ readonly onProgressStop?: (reason: string) => void;
6455
+ readonly maxTurns?: number;
6456
+ /** Give the supervisor brain a chapter-lifecycle on its OWN context window (router arm only) — it
6457
+ * distills its coordination transcript to a compact progress note once it exceeds the threshold,
6458
+ * instead of re-billing the whole thing every turn. See `DriverAgentOptions.compaction`. */
6459
+ readonly compaction?: ToolLoopCompactionOptions;
6460
+ /** Pass-through subscriber for every coordination bus event (both arms) — the seam a durable
6461
+ * caller hooks its coordination log onto. */
6462
+ readonly onEvent?: (event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
6463
+ /** Questions, findings, and authorized continuation receipts loaded from a prior process.
6464
+ * Router arm: questions seed the ledger and all evidence enters the resume brief. External arm:
6465
+ * questions seed the ledger; receipts remain durable evidence and are never auto-delivered. */
6466
+ readonly priorCoordination?: PriorCoordination;
6467
+ /** Deferred owner-scoped replay for a recursive supervisor. Its stable owner is known while the
6468
+ * parent authorizes the child, but loading remains asynchronous; Runtime calls this before the
6469
+ * nested brain can publish or act on coordination state. */
6470
+ readonly loadPriorCoordination?: () => Promise<PriorCoordination>;
6471
+ /** How the settled ledger becomes the run's output (both arms). Default `bestDelivered` — the
6472
+ * exact keep-best every existing caller had. Always runs under the delivered-only invariant. */
6473
+ readonly finalizer?: SupervisorFinalizer;
6474
+ /** Where the coordination MCP binds (external arm). Omit = an ephemeral loopback port, which is
6475
+ * unreachable from an off-host harness. A non-loopback host fails closed — see
6476
+ * {@link assertCoordinationBinding}. */
6477
+ readonly coordination?: CoordinationBinding;
6478
+ }
6479
+ /** Test-only dependency shape. It is exported only through the package's explicit `/testing`
6480
+ * entry; production supervisor surfaces cannot replace profile-derived model execution. */
6481
+ interface SupervisorAgentTestDeps extends SupervisorAgentDeps {
6482
+ readonly brain: ToolLoopChat;
6483
+ }
6484
+ /** Build a supervisor `Agent` from its profile: the brain resolves from `profile.harness`
6485
+ * (backend-as-data), the same resolution rule as every worker. */
6486
+ declare function supervisorAgent(profile: SupervisorProfile, deps: SupervisorAgentDeps): Agent<unknown, unknown>;
6487
+ /** Scripted-brain construction for deterministic tests. Not exported from Runtime's main entry. */
6488
+ declare function supervisorAgentWithTestBrain(profile: SupervisorProfile, deps: SupervisorAgentTestDeps): Agent<unknown, unknown>;
6489
+ //#endregion
6974
6490
  //#region src/runtime/supervise/delegate.d.ts
6975
6491
  /** The conserved pool a `delegate()` call applies when the caller does not pass its own `budget`.
6976
6492
  * A modest token ceiling + a small iteration ceiling — generous enough for a few-worker decompose,
6977
6493
  * bounded enough that an unsupervised intent cannot run away. Callers override via `opts.budget`. */
6978
6494
  declare const defaultDelegateBudget: Budget;
6979
6495
  /** Inputs to {@link delegate}. The intent is the first positional arg; everything here is optional
6980
- * with sensible defaults, so the common call is `delegate(intent, { backend, router })`. */
6496
+ * with explicit execution identity, so the common call names one exact supervisor profile. */
6981
6497
  interface DelegateOptions<Out = unknown> {
6982
6498
  /** The completion oracle (settled ⟺ delivered) the authored workers settle against. Strongly
6983
6499
  * recommended — without it the supervisor trusts a worker's self-report. For a code intent,
@@ -6989,21 +6505,10 @@ interface DelegateOptions<Out = unknown> {
6989
6505
  readonly backend?: ExecutorConfig;
6990
6506
  /** The conserved compute pool for the whole delegation. Defaults to {@link defaultDelegateBudget}. */
6991
6507
  readonly budget?: Budget;
6992
- /** The model the supervisor BRAIN runs on (the router model). The brain must tool-call
6993
- * (`spawn_agent` / `await_event`), so a delegator model, not a hidden-reasoning model. */
6994
- readonly model?: string;
6995
- /** The supervisor brain's router substrate. REQUIRED for the default router-brained supervisor
6996
- * (the brain is resolved from this), unless a test injects `brain` directly. `model` overrides
6997
- * `router.model`. (Design delta vs the bare `supervise()` profile: the brain needs a router.) */
6998
- readonly router?: RouterConfig;
6999
- /** Inject the supervisor brain directly (tests / advanced) instead of resolving it from `router`. */
7000
- readonly brain?: ToolLoopChat;
7001
- /** Override the default authoring-supervisor profile (name / extra system-prompt stance). The
7002
- * default already carries the authoring skill; override only to add a goal or rename. */
7003
- readonly supervisor?: {
7004
- readonly name?: string;
7005
- readonly systemPrompt?: string;
7006
- };
6508
+ /** Exact executable authoring supervisor. Model, prompt, harness, and provider live here. */
6509
+ readonly supervisorProfile: SupervisorProfile;
6510
+ /** Router endpoint/auth for a `cli-base` supervisor; contains no behavioral settings. */
6511
+ readonly router: RouterTransportConfig;
7007
6512
  /** Restrict the run to this subset of models (forwarded to `supervise()`). */
7008
6513
  readonly allowedModels?: readonly string[];
7009
6514
  readonly runId?: string;
@@ -7015,7 +6520,7 @@ interface DelegateOptions<Out = unknown> {
7015
6520
  * `result.spentTotal` reports what the whole delegation actually cost. A `winner` result carries the
7016
6521
  * authored worker's delivered output; a `no-winner` result names why (never a fabricated success).
7017
6522
  */
7018
- declare function delegate<Out = unknown>(intent: string, opts?: DelegateOptions<Out>): Promise<SupervisedResult<Out>>;
6523
+ declare function delegate<Out = unknown>(intent: string, opts: DelegateOptions<Out>): Promise<SupervisedResult<Out>>;
7019
6524
  //#endregion
7020
6525
  //#region src/runtime/supervise/dispatch.d.ts
7021
6526
  /** One unit of queued work: the agent to run, its task, and the spawn options (budget + label).
@@ -7270,252 +6775,6 @@ interface SupervisorSpanRecorder {
7270
6775
  */
7271
6776
  declare function createSupervisorSpanRecorder(opts: SupervisorSpanOptions): SupervisorSpanRecorder | undefined;
7272
6777
  //#endregion
7273
- //#region src/runtime/supervise/supervisor-agent.d.ts
7274
- /**
7275
- * The supervisor's profile — the subset of an `AgentProfile` that selects + shapes its brain.
7276
- * `harness` is the backend-as-data discriminant; `systemPrompt` is the standing instruction.
7277
- *
7278
- * A canonical `AgentProfile` from `@tangle-network/agent-interface` satisfies this interface
7279
- * structurally: its `model` is a hints OBJECT and its system prompt lives at `prompt.systemPrompt`,
7280
- * so both spellings are accepted here and reduced by {@link resolveSupervisorProfile}. Before that,
7281
- * a canonical profile's model object reached `RouterConfig.model` (a string) as an object and its
7282
- * `prompt.systemPrompt` was dropped — a request the provider rejects, and a supervisor running the
7283
- * default strategy while its profile named another.
7284
- *
7285
- * WHAT EACH ARM HONORS — the two brains read different amounts of a profile, so state it rather
7286
- * than let a caller infer that a field took effect:
7287
- *
7288
- * - ROUTER arm (`harness` null): only `name`, the resolved model id (`model`, or
7289
- * `model.default`), and the resolved system prompt (`prompt.systemPrompt`/`systemPrompt` plus
7290
- * `prompt.instructions` and `resources.instructions`) reach the brain. A full `AgentProfile`'s
7291
- * `tools`, `mcp`, `permissions`, `resources.skills`/`files`, `hooks`, `modes`, `subagents`,
7292
- * `model.provider`, `model.small` and `model.reasoningEffort` are NOT honored here: the router
7293
- * brain is one `ToolLoopChat` over the coordination verbs, and neither of its two tool-calling
7294
- * transports (`routerChatWithTools` buffered, `streamRouterChatWithTools` when
7295
- * `RouterConfig.stream` is set) has a parameter for any of them.
7296
- * - HARNESS arm (`harness` set): the WHOLE profile object is handed to `deps.driveHarness`
7297
- * untouched, plus the resolved system prompt as a separate argument. Everything the profile
7298
- * declares is the harness's to materialize; this module changes none of it.
7299
- */
7300
- interface SupervisorProfile {
7301
- readonly name?: string;
7302
- /** null/undefined/`cli-base` → router brain (in-process tool-loop); a coding-CLI harness → an
7303
- * external harness brain. */
7304
- readonly harness?: string | null;
7305
- /** The router model when the brain is router-driven: a model id, or a canonical profile's model
7306
- * hints whose `default` IS the id. Absent (including a hints object with no `default`) → the
7307
- * deps router config's model applies. Other hints (`small`, `provider`, `reasoningEffort`) are
7308
- * harness-arm material only. */
7309
- readonly model?: string | AgentProfileModelHints;
7310
- /** Canonical `AgentProfile` prompt shaping. `prompt.systemPrompt` and the top-level `systemPrompt`
7311
- * are the same standing instruction in two spellings; disagreeing values are a fault, not a pick.
7312
- * `prompt.instructions` lines are appended to the resolved prompt, one per line. */
7313
- readonly prompt?: AgentProfilePrompt;
7314
- /** Canonical `AgentProfile` resources. Only `instructions` shapes the brain here (appended to the
7315
- * resolved system prompt); every other resource is the harness's to materialize. */
7316
- readonly resources?: AgentProfileResources;
7317
- /** The standing instructions ("you delegate, you do not solve"). */
7318
- readonly systemPrompt?: string;
7319
- }
7320
- /** A `SupervisorProfile` reduced to the scalars the two brain arms consume. `modelId`/`systemPrompt`
7321
- * stay `undefined` when the profile named none — the caller's fallback (`deps.router.model`,
7322
- * the built-in default supervisor prompt) then applies, and this type cannot hide which happened.
7323
- *
7324
- * There is deliberately no `reasoningEffort` here: the router brain runs on `chatWithTools` (the
7325
- * buffered/streamed switch in the router client), and neither transport has a `reasoning_effort`
7326
- * parameter — only the chat-only `routerChatWithUsage` does — so a field carrying it would be a
7327
- * public promise nothing keeps. `model.reasoningEffort` still reaches the harness arm inside the
7328
- * profile. */
7329
- interface ResolvedSupervisorProfile {
7330
- readonly name: string;
7331
- readonly harness: string | null;
7332
- readonly modelId?: string;
7333
- readonly systemPrompt?: string;
7334
- }
7335
- /**
7336
- * Reduce either profile spelling — a hand-written `SupervisorProfile` or a canonical `AgentProfile`
7337
- * — to the scalars the brain arms consume:
7338
- *
7339
- * - `modelId`: a string `model` verbatim, else `model.default`. Absent or unresolvable → the
7340
- * router config's own model applies unchanged.
7341
- * - `systemPrompt`: the system prompt plus the `prompt.instructions` and `resources.instructions`
7342
- * lines, one per line.
7343
- *
7344
- * `supervisorAgent` resolves each piece only where it is consumed (the model id on the router arm
7345
- * only); this whole-profile reduction is the caller-facing view of the same rules.
7346
- */
7347
- declare function resolveSupervisorProfile(profile: SupervisorProfile): ResolvedSupervisorProfile;
7348
- /** Where the coordination MCP binds. Omit = an ephemeral port on `127.0.0.1` (the local-harness
7349
- * default); set `host` when the root or the harness runs off-host. */
7350
- interface CoordinationBinding {
7351
- readonly host?: string;
7352
- readonly port?: number;
7353
- /** Explicit acknowledgment required to bind a NON-loopback host — see
7354
- * {@link assertCoordinationBinding} for what is being accepted. */
7355
- readonly allowUnauthenticatedRemote?: boolean;
7356
- }
7357
- /**
7358
- * Fail closed on a non-loopback coordination bind. `serveCoordinationMcp` mounts spawn_agent /
7359
- * steer_agent / stop with NO authentication of any kind (it is a bare JSON-RPC-over-HTTP handler),
7360
- * so a non-loopback bind lets anyone who can reach the port spawn agents and spend the run's
7361
- * conserved budget. There is no token to require yet, so the only honest options are loopback or an
7362
- * explicit, recorded acknowledgment — never a silent bind.
7363
- */
7364
- declare function assertCoordinationBinding(binding: CoordinationBinding | undefined): void;
7365
- /** Trusted run/node identity Runtime binds to one manager. Model-authored tool arguments cannot
7366
- * provide or replace any of these fields. */
7367
- interface SupervisorNodeContext {
7368
- readonly runId: string;
7369
- /** Stable across a durable restart; unique per in-memory invocation. */
7370
- readonly runNamespace: string;
7371
- /** Concrete Scope node that owns this manager's coordination stream. */
7372
- readonly nodeId: string;
7373
- /** Stable identity of this manager's coordination stream. */
7374
- readonly ownerId: string;
7375
- readonly depth: number;
7376
- readonly identity: NodeExecutionIdentity;
7377
- /** Assignment identity within the parent manager; absent only for the root. */
7378
- readonly assignmentId?: string;
7379
- readonly profile: SupervisorProfile;
7380
- readonly task: unknown;
7381
- }
7382
- /** Context known before `Agent.act`; Runtime adds the concrete node, profile, and task. */
7383
- type SupervisorNodeContextSeed = Omit<SupervisorNodeContext, 'nodeId' | 'profile' | 'task'>;
7384
- /** Trusted context for one product-tool invocation. The node identity remains the same detached,
7385
- * immutable snapshot supplied to the resolver; `signal` is the one live control reference Runtime
7386
- * adds. It aborts when this manager's scope is cancelled by the caller, RootHandle, deadline,
7387
- * breaker, or a recursive parent. */
7388
- interface SupervisorToolInvocationContext extends SupervisorNodeContext {
7389
- readonly signal: AbortSignal;
7390
- }
7391
- /** One product-owned tool. It reuses the canonical MCP descriptor fields while Runtime supplies
7392
- * the trusted invocation context as a separate argument and binds the result for either
7393
- * transport. Existing handlers remain compatible: the second argument only gains `signal`. */
7394
- interface SupervisorToolDescriptor extends Omit<McpToolDescriptor$1, 'handler'> {
7395
- readonly handler: (raw: unknown, context: SupervisorToolInvocationContext) => Promise<unknown>;
7396
- }
7397
- /** Product policy for the tools one exact supervisor node may call. Resolved once per node. */
7398
- type ResolveSupervisorTools = (context: SupervisorNodeContext) => ReadonlyArray<SupervisorToolDescriptor> | Promise<ReadonlyArray<SupervisorToolDescriptor>>;
7399
- /** Context-aware observer used internally to bind product transactions to the actual live node. */
7400
- type ObserveSupervisorNodeEvent = (context: SupervisorNodeContext, event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
7401
- /** How to run an external harness as the DRIVER, with the coordination verbs mounted — the substrate
7402
- * seam the caller supplies (mirrors `makeWorkerAgent` for spawned children). It runs `profile` on
7403
- * `task` in its backend (remote sandbox or local CLI bridge) with `coordinationMcpUrl` mounted as an MCP server,
7404
- * so the harness calls spawn_agent / await_event / stop as native tools over the live scope. */
7405
- interface DriveHarness {
7406
- (args: {
7407
- /** The caller's profile, EXACTLY as passed to `supervisorAgent` — never rewritten. A canonical
7408
- * `AgentProfile` stays schema-valid here (the canonical schema rejects unknown top-level keys,
7409
- * so hoisting a resolved prompt onto it would make a profile its own validator refuses). */
7410
- readonly profile: SupervisorProfile;
7411
- /** The standing instruction assembled from the profile: its system prompt in either spelling,
7412
- * plus the `prompt.instructions` and `resources.instructions` lines. Absent when the profile
7413
- * names none — the harness's own default then applies. This, not `profile.systemPrompt`, is
7414
- * what the harness should run under. */
7415
- readonly systemPrompt?: string;
7416
- readonly task: unknown;
7417
- readonly scope: Scope<unknown>;
7418
- readonly coordinationMcpUrl: string;
7419
- /** Data-only product tool surface mounted on the coordination MCP. Runtime-owned drivers include
7420
- * this in their materialization evidence without persisting executable handlers. */
7421
- readonly coordinationTools: ReadonlyArray<Omit<McpToolDescriptor$1, 'handler'>>;
7422
- }): Promise<void>;
7423
- /** Optional live inbox for the manager session this adapter currently drives. Return `false`
7424
- * when no executor inbox is active instead of claiming a message was delivered. */
7425
- deliver?(message: unknown): boolean;
7426
- }
7427
- /** Trusted manager identity available before its external harness starts. A product uses this to
7428
- * return one independently steerable harness session per recursive manager. */
7429
- type DriveHarnessOwnerContext = Omit<SupervisorNodeContext, 'nodeId'>;
7430
- /** Resolve an external harness for one exact Runtime-owned manager identity. */
7431
- type ResolveDriveHarness = (context: DriveHarnessOwnerContext) => DriveHarness;
7432
- interface SupervisorAgentDeps {
7433
- readonly blobs: ResultBlobStore;
7434
- /** Resolve a spawned worker `profile` to a leaf agent — the recursion seam (same for both arms). */
7435
- readonly makeWorkerAgent: MakeWorkerAgent;
7436
- /** Product authorization for every down-leg continuation to a child. */
7437
- readonly authorizeDownMessage?: AuthorizeDownMessage;
7438
- /** Per-child budget reserved from the conserved pool on each spawn. */
7439
- readonly perWorker: Budget;
7440
- /** Independent completion check for direct driver work (`submit_result`). */
7441
- readonly deliverable?: DeliverableSpec<unknown>;
7442
- /** Hard cap on simultaneously-LIVE workers across both arms — `spawn_agent` fails closed once
7443
- * this many are in flight (a concurrency fence on top of the conserved-pool fence; bounds live
7444
- * boxes/sandboxes, not total work). Omit/`<= 0` = no cap. */
7445
- readonly maxLiveWorkers?: number;
7446
- /** Router substrate for a router-brained supervisor (`harness` omitted or `cli-base`). The
7447
- * profile's model wins. */
7448
- readonly router?: RouterConfig;
7449
- /** Inject the brain directly (tests / advanced) instead of resolving `routerBrain` from the profile. */
7450
- readonly brain?: ToolLoopChat;
7451
- /** Required to run an external-harness supervisor: runs the harness as the driver. */
7452
- readonly driveHarness?: DriveHarness;
7453
- /** Trusted identity for this manager. Required with node-scoped tools or observation. */
7454
- readonly nodeContext?: SupervisorNodeContextSeed;
7455
- /** Resolve product-owned tools for this exact manager. Static `extraTools` remain a router-only
7456
- * compatibility seam and deliberately receive no new recursive authority. */
7457
- readonly resolveSupervisorTools?: ResolveSupervisorTools;
7458
- /** Awaited product observation, enriched with this manager's actual live node context. */
7459
- readonly observeNodeEvent?: ObserveSupervisorNodeEvent;
7460
- /** Replay resume-time settlements through `observeNodeEvent` before the manager starts. */
7461
- readonly replaySettlements?: boolean;
7462
- /** WORK tools the supervisor may call DIRECTLY (router arm) — so it can do simple work ITSELF and
7463
- * only delegate when it needs parallelism. Pair with `executeExtraTool`. */
7464
- readonly extraTools?: ReadonlyArray<{
7465
- readonly name: string;
7466
- readonly description?: string;
7467
- readonly parameters: Record<string, unknown>;
7468
- }>;
7469
- /** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
7470
- readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
7471
- /** Analyst lenses available to the driver (both arms). Required for `analyzeOnSettle`. */
7472
- readonly analysts?: AnalystRegistry;
7473
- /** Analyst kinds run on each worker-settle → a `finding` the driver composes its next steer from
7474
- * (the self-improving UP-leg). Unset/empty = status quo (no analyst feed). Requires `analysts`. */
7475
- readonly analyzeOnSettle?: ReadonlyArray<string | AnalyzeOnSettleRoute>;
7476
- /** Run the ONLINE detector panel over each worker's LIVE tool trace (both arms) so the driver
7477
- * learns a worker is looping mid-run instead of at settle. Omit = no online watching. */
7478
- readonly watchWorkers?: WorkerWatchOptions;
7479
- /** Idle time after which `observe_agent` reports a worker as stalled. Omit = runtime default. */
7480
- readonly stallAfterMs?: number;
7481
- /** Default continuity per worker PROFILE NAME (both arms) — `'resume'` re-attaches spawns of
7482
- * that name to the node's latest settled worker; `spawn_agent`'s per-call `continuity`
7483
- * overrides. Omit = every spawn fresh (status quo). */
7484
- readonly continuityByProfile?: Readonly<Record<string, ContinuityMode>>;
7485
- /** PROGRESS-derived stop rule (router arm). Ends a run that has stopped learning BEFORE it
7486
- * exhausts a ceiling; it can never keep a run alive past one. Build it with `plateau` /
7487
- * `noProgressFor` / `allWorkersStalled` from `supervise/stop-rules` — the thresholds are the
7488
- * caller's judgment. Omit = ceilings only. */
7489
- readonly stopRule?: StopRule;
7490
- /** One-shot notification of WHY a `stopRule` ended the run. */
7491
- readonly onProgressStop?: (reason: string) => void;
7492
- readonly maxTurns?: number;
7493
- /** Give the supervisor brain a chapter-lifecycle on its OWN context window (router arm only) — it
7494
- * distills its coordination transcript to a compact progress note once it exceeds the threshold,
7495
- * instead of re-billing the whole thing every turn. See `DriverAgentOptions.compaction`. */
7496
- readonly compaction?: ToolLoopCompactionOptions;
7497
- /** Pass-through subscriber for every coordination bus event (both arms) — the seam a durable
7498
- * caller hooks its coordination log onto. */
7499
- readonly onEvent?: (event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
7500
- /** Questions, findings, and authorized continuation receipts loaded from a prior process.
7501
- * Router arm: questions seed the ledger and all evidence enters the resume brief. External arm:
7502
- * questions seed the ledger; receipts remain durable evidence and are never auto-delivered. */
7503
- readonly priorCoordination?: PriorCoordination;
7504
- /** Deferred owner-scoped replay for a recursive supervisor. Its stable owner is known while the
7505
- * parent authorizes the child, but loading remains asynchronous; Runtime calls this before the
7506
- * nested brain can publish or act on coordination state. */
7507
- readonly loadPriorCoordination?: () => Promise<PriorCoordination>;
7508
- /** How the settled ledger becomes the run's output (both arms). Default `bestDelivered` — the
7509
- * exact keep-best every existing caller had. Always runs under the delivered-only invariant. */
7510
- readonly finalizer?: SupervisorFinalizer;
7511
- /** Where the coordination MCP binds (external arm). Omit = an ephemeral loopback port, which is
7512
- * unreachable from an off-host harness. A non-loopback host fails closed — see
7513
- * {@link assertCoordinationBinding}. */
7514
- readonly coordination?: CoordinationBinding;
7515
- }
7516
- /** Build a supervisor `Agent` from its profile: the brain resolves from `profile.harness` (backend-as-data), the same resolution rule as every worker. */
7517
- declare function supervisorAgent(profile: SupervisorProfile, deps: SupervisorAgentDeps): Agent<unknown, unknown>;
7518
- //#endregion
7519
6778
  //#region src/runtime/supervise/supervise.d.ts
7520
6779
  /**
7521
6780
  * Build the worker seam from a backend (WHERE workers run) + an optional completion oracle (the
@@ -7631,12 +6890,35 @@ interface SuperviseOptions {
7631
6890
  readonly isDriverProfile?: (input: AuthorizedSpawnContext) => boolean;
7632
6891
  /** The supervisor's router substrate (`profile.harness` omitted or `cli-base`). The profile's
7633
6892
  * model wins. */
7634
- readonly router?: RouterConfig;
7635
- /** Inject the supervisor brain directly (tests / advanced). */
7636
- readonly brain?: ToolLoopChat;
6893
+ readonly router?: RouterTransportConfig;
7637
6894
  /** Run an external-harness supervisor explicitly. Required for a remote sandbox; optional as a
7638
6895
  * caller-owned override for a local bridge. */
7639
6896
  readonly driveHarness?: DriveHarness;
6897
+ /**
6898
+ * How hard a transiently-failed EXTERNAL driver is re-entered before the run ends
6899
+ * `driver-failed`. A harness process SIGKILLed at a bridge timeout, a stream cut mid-turn, or an
6900
+ * upstream 5xx used to end a run of arbitrary length while its budget and deadline sat almost
6901
+ * untouched (#741). A retry re-enters the driver over the SAME scope, coordination server, and
6902
+ * live children; the bridge backend reattaches the harness session by its durable execution id.
6903
+ *
6904
+ * Runtime's own refusals (a validation guard, an exhausted budget, an abort, a client-side
6905
+ * transport status) are never retried — they were decisions. Retries stop at the budget, the
6906
+ * deadline, an abort, or a run of attempts that changed nothing at all.
6907
+ *
6908
+ * Omit = retry under the defaults. `{ enabled: false }` = the historical behavior where the first
6909
+ * driver failure ends the run. Applies to the root manager and every recursive manager under it.
6910
+ */
6911
+ readonly driverRetry?: DriverRetryPolicy;
6912
+ /** Per-attempt record for every external driver in the tree — what makes "failed after N
6913
+ * attempts, last cause X" visible instead of one backend's last words. */
6914
+ readonly onDriverAttempt?: (record: DriverAttemptRecord) => void | Promise<void>;
6915
+ /**
6916
+ * How long live children may keep running after the ROOT DRIVER FAILED, before the join barrier
6917
+ * cascades the abort into them. A root that died did not make its children unhealthy: a child
6918
+ * mid-unit holds work already paid for, and an immediate cascade discards everything it has not
6919
+ * yet written. Bounded by the run's own deadline. Omit/`0` = immediate teardown.
6920
+ */
6921
+ readonly childSettleGraceMs?: number;
7640
6922
  /** Resolve one custom external-harness session per trusted manager identity. Use this instead of
7641
6923
  * `driveHarness` when recursive managers must be independently steerable. */
7642
6924
  readonly resolveDriveHarness?: ResolveDriveHarness;
@@ -7806,8 +7088,14 @@ interface AuthorizedSpawnContext {
7806
7088
  }
7807
7089
  /** Exact trusted context for selecting one backend-derived leaf's completion check. */
7808
7090
  type DeliverableResolutionInput = AuthorizedSpawnContext;
7809
- /** One-call supervisor: build + run a supervisor from its profile with sensible defaults; the raw `supervisorAgent` + `createSupervisor().run` seams stay available for power use. */
7091
+ /** Test-only one-call shape, exported only through the package's explicit `/testing` entry. */
7092
+ interface SuperviseTestOptions extends SuperviseOptions {
7093
+ readonly brain: ToolLoopChat;
7094
+ }
7095
+ /** One-call supervisor: build + run a supervisor from its exact profile. @stable */
7810
7096
  declare function supervise(profile: SupervisorProfile, task: unknown, opts: SuperviseOptions): Promise<SupervisedResult<unknown>>;
7097
+ /** Deterministic scripted-brain path for tests. Not exported from Runtime's main entry. */
7098
+ declare function superviseWithTestBrain(profile: SupervisorProfile, task: unknown, opts: SuperviseTestOptions): Promise<SupervisedResult<unknown>>;
7811
7099
  //#endregion
7812
7100
  //#region src/runtime/supervise/graph.d.ts
7813
7101
  /** A graph node: an id and a canonical `AgentProfile`. The profile is the ONLY way a node is
@@ -7909,13 +7197,11 @@ interface RunGraphOptions {
7909
7197
  * directive delivery, and the edge ledger AROUND this seam — only the leaf `act` is yours. */
7910
7198
  readonly makeWorkerAgent?: MakeWorkerAgent;
7911
7199
  /** The driver brain's router substrate (`profile.harness` omitted or `cli-base`). */
7912
- readonly router?: RouterConfig;
7200
+ readonly router?: RouterTransportConfig;
7913
7201
  /** Caller-side runtime hooks (telemetry, policy, product extensions). Composed AFTER the
7914
7202
  * graph's own spawn-binding hook on the SAME event stream — the graph never swallows the
7915
7203
  * seam supervise() exposes. */
7916
7204
  readonly hooks?: RuntimeHooks;
7917
- /** Inject the driver brain directly (offline tests / advanced). */
7918
- readonly brain?: ToolLoopChat;
7919
7205
  /** The analyst lens registry `analyzes` edges resolve against. ENVIRONMENT — needed only for
7920
7206
  * lens analysts; an analyzes edge naming a graph NODE as its analyst needs no registry. */
7921
7207
  readonly analysts?: AnalystRegistry;
@@ -7957,6 +7243,10 @@ interface GraphResult<Out = unknown> {
7957
7243
  readonly exhaustedEdges: ReadonlyArray<string>;
7958
7244
  readonly runId: string;
7959
7245
  }
7246
+ /** Test-only graph options, exported only through the package's explicit `/testing` entry. */
7247
+ interface RunGraphTestOptions extends RunGraphOptions {
7248
+ readonly brain: ToolLoopChat;
7249
+ }
7960
7250
  /**
7961
7251
  * Execute an {@link AgentGraph}. The root node becomes the supervisor (`supervise()` — the
7962
7252
  * execution core), each worker node is spawnable BY NODE ID (`spawn_agent` with
@@ -7966,17 +7256,8 @@ interface GraphResult<Out = unknown> {
7966
7256
  * traversal is ledgered and journaled.
7967
7257
  */
7968
7258
  declare function runGraph(graph: AgentGraph, opts: RunGraphOptions): Promise<GraphResult>;
7969
- //#endregion
7970
- //#region src/runtime/supervise/model-policy.d.ts
7971
- /**
7972
- * Throw a `ConfigError` when `allowed` is set, `model` is defined, and `model` is not a
7973
- * member of `allowed`. No-op when `allowed` is unset (the unrestricted default) or when
7974
- * `model` is undefined (nothing was configured to check).
7975
- */
7976
- declare function assertModelAllowed(model: string | undefined, allowed: readonly string[] | undefined): void;
7977
- /** Check every canonical model-bearing field in a complete profile, including the models a
7978
- * backend may select for cheap work, named subagents, or modes. */
7979
- declare function assertProfileModelsAllowed(profile: AgentProfile$1, allowed: readonly string[] | undefined): void;
7259
+ /** Deterministic scripted-brain path for graph tests. Not exported from Runtime's main entry. */
7260
+ declare function runGraphWithTestBrain(graph: AgentGraph, opts: RunGraphTestOptions): Promise<GraphResult>;
7980
7261
  //#endregion
7981
7262
  //#region src/runtime/supervise/patch-checks.d.ts
7982
7263
  /** @experimental The per-task constraints the mechanical gate enforces. */
@@ -8002,8 +7283,6 @@ interface WorktreeCliExecutorOptions {
8002
7283
  * cannot honor them. Harness-specific values the materializer cannot preserve also fail closed.
8003
7284
  */
8004
7285
  profile: AgentProfile$1;
8005
- /** Local CLI for this leaf. This explicit choice overrides `profile.harness`. */
8006
- harness: LocalHarness;
8007
7286
  /** Default instruction for direct `execute(undefined, signal)` calls. An execution-time task
8008
7287
  * is authoritative. Omit when the caller always supplies the task to `execute`. */
8009
7288
  taskPrompt?: string;
@@ -8014,7 +7293,7 @@ interface WorktreeCliExecutorOptions {
8014
7293
  /** Wall-clock cap per harness subprocess (ms). Default 5 min (the `runLocalHarness` default). */
8015
7294
  harnessTimeoutMs?: number;
8016
7295
  /** Run Codex with an ephemeral session, isolated config/instructions, network disabled, and
8017
- * JSONL usage capture. Requires `harness: 'codex'`; metered by default. */
7296
+ * JSONL usage capture. Requires `profile.harness: 'codex'`; metered by default. */
8018
7297
  codexReproducible?: boolean;
8019
7298
  /** Absolute host paths denied to reproducible Codex (for benchmark answer copies, credentials,
8020
7299
  * or other task-specific ambient state). */
@@ -8050,9 +7329,10 @@ interface WorktreeCliExecutorOptions {
8050
7329
  * Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each), so a
8051
7330
  * fanout of N profiles = N parallel worktrees that never clobber each other.
8052
7331
  *
8053
- * Fail-loud: an empty `repoRoot`/`harness` or an explicitly empty `taskPrompt` throws at
8054
- * construction. Calling `execute(undefined, signal)` without a configured prompt throws before a
8055
- * worktree is created. `resultArtifact()` before `execute()` resolves throws.
7332
+ * Fail-loud: an empty `repoRoot`, an incomplete/unsupported profile, a separate harness override,
7333
+ * or an explicitly empty `taskPrompt` throws at construction. Calling `execute(undefined, signal)`
7334
+ * without a configured prompt throws before a worktree is created. `resultArtifact()` before
7335
+ * `execute()` resolves throws.
8056
7336
  *
8057
7337
  * @experimental
8058
7338
  */
@@ -8527,15 +7807,13 @@ declare function settledWorkerOut(input: {
8527
7807
  declare function closingWorkerNote(stdout: string, stderr: string): string | undefined;
8528
7808
  //#endregion
8529
7809
  //#region src/runtime/supervise/worktree-fanout.d.ts
8530
- /** @experimental One authored harness profile in a worktree fanout: the §1.5 profile + which local
8531
- * harness CLI drives it. The supervisor authors `profile` per sub-task; `harness` chooses the leaf. */
7810
+ /** @experimental One authored profile in a worktree fanout. Its exact `harness` field chooses the
7811
+ * local CLI; the supervisor authors the complete profile per sub-task. */
8532
7812
  interface AuthoredHarness {
8533
7813
  /** A short label for the worktree branch + trace node. */
8534
7814
  name: string;
8535
7815
  /** The supervisor-authored `AgentProfile` (systemPrompt + model reach the harness via §1.5). */
8536
7816
  profile: AgentProfile$1;
8537
- /** Which local harness CLI drives this leaf. */
8538
- harness: LocalHarness;
8539
7817
  /** Require measured usage from this leaf. Budgeted supervision refuses the default unmetered
8540
7818
  * local-CLI mode; set false only when the selected runner actually returns token usage. */
8541
7819
  budgetExempt?: WorktreeCliExecutorOptions['budgetExempt'];
@@ -8603,8 +7881,9 @@ declare function failuresAnalyst(): AnalystRegistry;
8603
7881
  interface SurfaceWorkerConfig {
8604
7882
  readonly routerBaseUrl: string;
8605
7883
  readonly routerKey: string;
8606
- readonly model: string;
8607
- readonly maxTokens?: number;
7884
+ /** Exact worker behavior, tools, and model. */
7885
+ readonly profile: AgentProfile$1;
7886
+ readonly analystProfile?: AgentProfile$1;
8608
7887
  readonly innerTurns?: number;
8609
7888
  /** Refine-shot budget for ONE worker attempt (max steered shots). Default 1. */
8610
7889
  readonly budget?: number;
@@ -8617,9 +7896,8 @@ interface SuperviseSurfaceOptions {
8617
7896
  /** The conserved compute pool for the whole supervised run. Default: sized off the worker's inner-loop
8618
7897
  * bounds for a handful of worker spawns — raise it to let the driver try more. */
8619
7898
  readonly budget?: Budget;
8620
- /** The driver brain's router substrate (its own inference). Default: the worker's router + model the
8621
- * driver and workers share one router unless you separate them (e.g. a stronger driver model). */
8622
- readonly router?: RouterConfig;
7899
+ /** The driver brain's Router endpoint/auth. Model and behavior remain owned by `profile`. */
7900
+ readonly router?: RouterTransportConfig;
8623
7901
  /** The self-improvement lens fed to the driver on each settled worker. Default `failuresAnalyst()`
8624
7902
  * (target the still-failing tests). Pass a custom registry to change it, or `null` to turn the
8625
7903
  * within-run self-improvement OFF (the driver sees raw settled outputs). */
@@ -8659,5 +7937,5 @@ interface VerifierEnvironmentOptions {
8659
7937
  /** Any checkable task as an `Environment`, no tool surface required: the artifact is the worker's answer and the domain is one deployable `check` over it. */
8660
7938
  declare function createVerifierEnvironment(opts: VerifierEnvironmentOptions): Environment;
8661
7939
  //#endregion
8662
- export { legacySupervisorRunsRoot as $, BenchmarkTaskRow as $a, WaterfallReport as $c, capDelegationTrace as $d, assertProfileMaterialization as $f, ForkCapableBox as $i, SandboxSeam as $l, sampleFromSettled as $n, harvestCorpus as $o, compareCheckOutcomes as $r, RunPersonified as $s, SupervisorToolInvocationContext as $t, DriveTurnTick as $u, GitWorkspaceOptions as A, fanout as Aa, PairwiseVerdict as Ac, DelegationFeedbackSnapshot as Ad, FileSpawnJournal as Af, selectChampion as Ai, createCoordinationTools as Al, DelegateOptions as An, LoopOptionsForDispatch as Ao, AuthoredProfile as Ar, RenderCorpusToInstructionsOptions as As, defaultEdgeTraversalCap as At, InMemoryFeedbackStore as Au, analyzeTrace as B, assertTraceDerivedFindings as Ba, AuditIntentOptions as Bc, FeedbackRating as Bd, materializeTreeView as Bf, StdioMcpConnection as Bi, DelegateError as Bl, PlateauOptions as Bn, envKeyProvider as Bo, CheckExecChannel as Br, VerifySpec as Bs, workerFromBackend as Bt, coderTaskFromArgs as Bu, closingWorkerNote as C, createShapeRegistry as Ca, AxisScoresOf as Cc, DelegateResearchConfig as Cd, createEventBus as Cf, EvolutionGeneration as Ci, QuestionRecord as Cl, DispatchStopReason as Cn, depthStrategy as Co, BudgetPool as Cr, Panel as Cs, EdgeTraversal as Ct, removeWorktree as Cu, UntrackedCopyStats as D, FileCorpus as Da, LeaderboardOptions as Dc, DelegateUiAuditResult as Dd, DeliverableSpec as Df, discriminatingMeans as Di, WorkerSpawnContext as Dl, freeSlots as Dn, sampleThenRefine as Do, ReservationTicket as Dr, Pipeline as Ds, GraphResult as Dt, McpTransport as Du, CopyOptions as E, runPersonified as Ea, Leaderboard as Ec, DelegateUiAuditConfig as Ed, watchTrace as Ef, StrategyEvolutionConfig as Ei, WorkerResumeContext as El, effectiveConcurrency as En, sample as Eo, ReservationRejection as Er, PanelVerdict as Es, GraphNode as Et, McpToolDescriptor$1 as Eu, gitWorkspace as F, selectValidWinner as Fa, renderLeaderboardHtml as Fc, DelegationProgress as Fd, SpawnForestInDoubtNode as Ff, strategyAuthorContract as Fi, createMcpServer as Fl, DriverAgentOptions as Fn, runAgentRounds as Fo, authoredWorker as Fr, TrajectoryNode as Fs, DeliverableResolutionInput as Ft, DelegateRunCtx as Fu, workerTraceAnalysisStore as G, McpEnvironmentOptions as Ga, AnytimeStrategySummary as Gc, UiAuditorDelegationOutput as Gd, AgentProfileMaterializationAxis as Gf, OpenSandboxRunBeforeStartContext as Gi, BridgeSeam as Gl, StopDecision as Gn, inlineSandboxClient as Go, CheckSourceCtx as Gr, WinnerStrategy as Gs, ResolveDriveHarness as Gt, FleetWorkspaceExecutorOptions as Gu, WorkerToolTraceArtifact as H, createScopeAnalyst as Ha, auditIntent as Hc, ResearchOutputShape as Hd, replaySpawnTree as Hf, connectStdioMcp as Hi, DelegateResult as Hl, ProgressTracker as Hn, resolveMcpServerLaunch as Ho, CheckRunContext as Hr, WidenDecision as Hs, DriveHarness as Ht, settleDetachedCoderTurn as Hu, jjWorkspace as I, verify as Ia, renderLeaderboardMarkdown as Ic, DelegationResultPayload as Id, SpawnForestMissingTree as If, LocalMcpMaterialization as Ii, DELEGATE_DESCRIPTION as Il, driverAgent as In, LocalSandboxClientOptions as Io, canonicalizeAuthoredProfile as Ir, TrajectoryReport as Is, SuperviseOptions as It, DetachedSessionDelegateOptions as Iu, ScopeArgs as J, BenchmarkCell as Ja, areaUnderCurve as Jc, DELEGATION_TRACE_MAX_SPANS as Jd, DefineProfileMaterializationContractOptions as Jf, SandboxRun as Ji, CliWorktreeSeam as Jl, allWorkersStalled as Jn, InProcessSandboxClientOptions as Jo, StructuralRolloutMessage as Jr, LoopShape as Js, SupervisorAgentDeps as Jt, createSiblingSandboxExecutor as Ju, createRootHandle as K, createMcpEnvironment as Ka, AnytimeTaskCurve as Kc, CappedDelegationTrace as Kd, AssertProfileMaterializationOptions as Kf, OpenSandboxRunOptions as Ki, CliSeam as Kl, StopRule as Kn, InProcessOnPrompt as Ko, RepairStop as Kr, DefinePersona as Ks, ResolveSupervisorTools as Kt, SiblingSandboxExecutorOptions as Ku, localShell as L, widen as La, renderLeaderboardSvg as Lc, DelegationStatus as Ld, SpawnForestNode as Lf, MaterializeLocalMcpOptions as Li, DELEGATE_INPUT_SCHEMA as Ll, finalizeBestDelivered as Ln, localSandboxClient as Lo, defaultProfileRichnessThresholds as Lr, TrajectoryReportFn as Ls, SuperviseRegistry as Lt, DetachedWinnerSelection as Lu, Workspace as M, loopUntil as Ma, ScoreOf as Mc, DelegationHistoryEntry as Md, InMemorySpawnJournal as Mf, AuthoredStrategy as Mi, McpServer as Ml, delegate as Mn, loopDispatch as Mo, ProfileRichnessThresholds as Mr, ScopeAnalyzeInput as Ms, AuthorizedSpawn as Mt, CoderDelegate as Mu, WorkspaceCommit as N, panel as Na, leaderboard as Nc, DelegationHistoryResult as Nd, SpawnForest as Nf, assertStrategyContract as Ni, McpServerOptions as Nl, CoordinationMcpHandle as Nn, RunAgentRoundsOptions as No, asAuthoredProfile as Nr, ScopeWidenGate as Ns, AuthorizedSpawnContext as Nt, CoderReview as Nu, copyUntrackedIntoClone as O, InMemoryCorpus as Oa, LeaderboardRow as Oc, DelegateUiAuditRoute as Od, gateOnDeliverable as Of, pickChampion as Oi, WorkerWatchOptions as Ol, queueOf as On, LoopCampaignDispatchOptions as Oo, createBudgetPool as Or, PipelineStage as Os, RunGraphOptions as Ot, FeedbackEvent as Ou, WorkspaceRun as P, pipeline as Pa, pairwiseSignificance as Pc, DelegationProfile as Pd, SpawnForestEvent as Pf, authorStrategy as Pi, createInProcessTransport as Pl, serveCoordinationMcp as Pn, defaultSelectWinner as Po, assessAuthoredProfile as Pr, SteerContext as Ps, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as Pt, CoderReviewer as Pu, legacySupervisorRunDir as Q, BenchmarkStrategySummary as Qa, WaterfallCollector as Qc, buildDelegationTraceSpans as Qd, ValidateProfileMaterializationOptions as Qf, CheckpointCapableBox as Qi, RouterToolsSeam as Ql, plateau as Qn, HarvestReport as Qo, canDisplace as Qr, PersonaExecutors as Qs, SupervisorToolDescriptor as Qt, DriveTurnCapableBox as Qu, runInWorkspace as R, CreateScopeAnalystOptions as Ra, renderPairwiseMarkdown as Rc, DelegationStatusArgs as Rd, SpawnForestTree as Rf, McpSpawnFault as Ri, DELEGATE_TOOL_NAME as Rl, AllWorkersStalledOptions as Rn, KeyProvider as Ro, profileRichnessFinding as Rr, TrajectoryReportOptions as Rs, SuperviseRegistryTable as Rt, SettleDetachedCoderTurnOptions as Ru, WorkerEvidenceInput as S, builtinShapes as Sa, stopSentinel as Sc, DelegateResearchArgs as Sd, PublishOptions as Sf, EvolutionCandidate as Si, QuestionPolicy as Sl, DispatchReport as Sn, defineStrategy as So, createChatSessionStore as Sr, LoopUntilState as Ss, EdgeDeliveryOutcome as St, createWorktree as Su, settledWorkerOut as T, definePersona as Ta, Interval as Tc, DelegateUiAuditArgs as Td, defaultToolDetectors as Tf, ReproductionCheck as Ti, SettledWorker as Tl, RollingDispatchOptions as Tn, runAgentic as To, BudgetReadout as Tr, PanelSpec as Ts, GraphEdgeCapError as Tt, JsonRpcResponse as Tu, captureWorkerTraceEvidence as U, registryScopeAnalyst as Ua, defaultAuditorInstruction as Uc, ResearchSource as Ud, contentAddress as Uf, materializeLocalMcp as Ui, createDelegateHandler as Ul, ProgressTrackerOptions as Un, resolveSecretEnv as Uo, CheckRunner as Ur, WidenLineage as Us, DriveHarnessOwnerContext as Ut, DelegationExecutor as Uu, WORKER_TOOL_TRACE_SCHEMA_VERSION as V, buildSteerContext as Va, IntentAudit as Vc, FeedbackRefersTo as Vd, pendingWaits as Vf, StdioMcpServerSpec as Vi, DelegateHandlerOptions as Vl, ProgressSample as Vn, mcpSecretEnvMetadataKey as Vo, CheckOutcome as Vr, Widen as Vs, CoordinationBinding as Vt, detachedSessionDelegate as Vu, parseWorkerToolTraceArtifact as W, McpEndpoint as Wa, AnytimeReport as Wc, UiAuditLensFilter as Wd, AGENT_PROFILE_MATERIALIZATION_AXES as Wf, Deliverable as Wi, validateDelegateArgs as Wl, ProgressView as Wn, secretEnvOfMcpServer as Wo, CheckSource as Wr, WidenSpec as Ws, ObserveSupervisorNodeEvent as Wt, FleetHandle as Wu, settledToIteration as X, BenchmarkLift as Xa, plateauLength as Xc, DelegationTraceCollector as Xd, ProfileMaterializationContract as Xf, TurnResult as Xi, ProviderSeam as Xl, createProgressTracker as Xn, HarvestCorpusOptions as Xo, StructuralRolloutResult as Xr, Persona as Xs, SupervisorNodeContextSeed as Xt, DetachedTurn as Xu, createScope as Y, BenchmarkConfig as Ya, bestSoFar as Yc, DelegationTraceCaps as Yd, KnownAgentProfileMaterializationAxis as Yf, SandboxRunAbortError as Yi, ExecutorConfig as Yl, anyOf as Yn, inProcessSandboxClient as Yo, StructuralRolloutPolicy as Yr, Outcome as Ys, SupervisorNodeContext as Yt, DetachedSessionRefParts as Yu, WorkerSteerRequest as Z, BenchmarkReport as Za, renderAnytimeTable as Zc, DelegationTraceSpan as Zd, ProfileMaterializationIssue as Zf, openSandboxRun as Zi, RouterSeam as Zl, noProgressFor as Zn, HarvestFailure as Zo, VisibleCheck as Zr, PersonaContext as Zs, SupervisorProfile as Zt, DetachedTurnResumeDriverOptions as Zu, WorktreeFanoutOptions as _, PromotionGateOptions as _a, CompletionPolicy as _c, DelegateCodeArgs as _d, CoderOutput as _f, ChampionPick as _i, MakeWorkerAgent as _l, kernelPromptRegistry as _n, StrategyResult as _o, ChatTransportTool as _r, FanoutSynthesis as _s, WorktreePatchArtifact as _t, DiffResult as _u, SandboxInstance$1 as a, createSandboxToolPartState as aa, LeaderboardBenchScore as ac, runDetachedTurn as ad, FileDelegationStore as af, officialChecksFromMeta as ai, AuthorizeDownMessage as al, SupervisorSpanOutcome as an, AgenticSurface as ao, promptModelProfileMaterialization as ap, collectDelivered as ar, renderReport as as, workerControlLogFile as at, SteerableSandboxArgs as au, NOTE_MAX_CHARS as b, equalKOnCost as ba, deterministicCompletion as bc, DelegateFeedbackArgs as bd, BusStats as bf, EvolutionAuthor as bi, QuestionLevel as bl, supervisorPolicyPrompt as bn, adaptiveRefine as bo, chatTransportExecutor as br, LoopUntil as bs, assertProfileModelsAllowed as bt, WorktreeHandle as bu, VerifierEnvironmentOptions as c, mapSandboxToolEvent as ca, LeaderboardFlagSpec as cc, DelegationResumeContext as cd, AgentEvalError$1 as cf, selectBestIndex as ci, ContinuityMode as cl, PromptHandle as cn, ArtifactHandle as co, renderProfileMaterializationIssues as cp, runTree as cr, Corpus as cs, writeWorkerSteer as ct, Inbox as cu, SuperviseSurfaceResult as d, SandboxCapabilities as da, LeaderboardScenario as dc, DelegationRunContext as dd, ConfigError as df, AgentTurnBackend as di, CoordinationToolsOptions as dl, analyzesFindingsReportPrompt as dn, ShotPersona as do, worktreeCliProfileMaterialization as dp, CoordinationOwnerId as dr, EqualKArm as ds, RunContext as dt, WorktreeCheckRunner as du, SandboxLineage as ea, RunPersonifiedOptions as ec, RunDetachedTurnOptions as ed, composeLoopTraceEmitters as ef, composeCheckSources as ei, WaterfallSpan as el, assertCoordinationBinding as en, Environment as eo, controlProfileMaterialization as ep, DeliveredOutput as er, Observation as es, readWorkerSteerRequests as et, cliWorktreeExecutor as eu, SurfaceWorkerConfig as f, probeSandboxCapabilities as fa, LeaderboardScore as fc, DelegationTaskQueue as fd, JudgeError as ff, AgentTurnUsage as fi, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as fl, createPromptRegistry as fn, ShotSpec as fo, FileCoordinationLog as fr, EqualKOnCost as fs, createFileRunContext as ft, WorktreeCommandResult as fu, AuthoredHarness as g, resolveSandboxClient as ga, CompletionEvidence as gc, hashIdempotencyInput as gd, ValidationError as gf, streamAgentTurn as gi, DownMessageEvent as gl, formatPromptHandle as gn, StrategyMessage as go, ChatTransportExecutorOptions as gr, FanoutOptions as gs, WorktreeCliExecutorOptions as gt, DiffOptions as gu, superviseSurface as h, ResolveSandboxClientOptions as ha, CompletionAnalyst as hc, SubmitOutput as hd, RuntimeRunStateError as hf, collectAgentTurn as hi, DownMessageDeliveryOutcome as hl, dumbContinuationPassPrompt as hn, StrategyCtx as ho, ChatSessionStore as hr, Fanout as hs, patchDelivered as ht, CreateWorktreeOptions as hu, SandboxEvent$1 as i, SandboxToolPartState as ia, DefinedLeaderboard as ic, parseDetachedSessionRef as id, DelegationStore as if, modelAuthoredChecks as ii, AnalyzeOnSettleRoute as il, SupervisorSpanOptions as in, AgenticRunResult as io, promptControlProfileMaterialization as ip, bestDelivered as ir, observe as is, supervisorWorkersDir as it, SandboxSteeringOptions as iu, Shell as j, flatWidenGate as ja, ProfileKeyOf as jc, DelegationHistoryArgs as jd, InMemoryResultBlobStore as jf, AuthorStrategyOptions as ji, normalizeAnalyzeOnSettle as jl, defaultDelegateBudget as jn, loopCampaignDispatch as jo, ProfileRichness as jr, ScopeAnalyst as js, runGraph as jt, eventToSnapshot as ju, withUntrackedArtifacts as k, renderCorpusToInstructions as ka, PairwiseOptions as kc, DelegationError as kd, FileResultBlobStore as kf, runStrategyEvolution as ki, canonicalFindingEvent as kl, rollingDispatch as kn, LoopDispatchOptions as ko, spendFromUsageEvents as kr, RenderCorpusToInstructions as ks, TraversalContinuity as kt, FeedbackStore as ku, createVerifierEnvironment as l, sumSandboxUsage as la, LeaderboardIterationInfo as lc, DelegationResumeDriver as ld, AgentEvalErrorCode as lf, structuralRollout as li, CoordinationEvent as ll, PromptRegistry as ln, CorpusReadbackOptions as lo, sandboxActProfileMaterialization as lp, CoordinationDeliveryEvidence as lr, CorpusFilter as ls, InMemoryRunContext as lt, InboxMessage as lu, failuresAnalyst as m, acquireSandbox as ma, defineLeaderboard as mc, SubmitInput as md, PlannerError as mf, StreamAgentTurnOptions as mi, DownMessageDeliveryAttempt as ml, dumbContinuationFailPrompt as mn, StrategyArtifacts as mo, ChatCompletionsTransport as mr, EqualKVerdict as ms, PatchDeliverableOptions as mt, WorktreeProfileMaterializationReceipt as mu, AnalystFinding$1 as n, SessionCapableBox as na, ShapeContext as nc, detachedTurnEvents as nd, DelegationPersistenceError as nf, defaultStructuralRolloutPolicy as ni, AnalystFindingEvent as nl, supervisorAgent as nn, runBenchmark as no, fullProfileMaterialization as np, FinalizerSettled as nr, ObserveOptions as ns, supervisorRunDir as nt, createExecutorRegistry as nu, computeFindingId$1 as o, extractLlmCallEvent as oa, LeaderboardBenchTask as oc, DelegationArgs as od, FileDelegationStoreOptions as of, resolveEntrySymbol as oi, AuthorizedDownMessage as ol, SupervisorSpanRecorder as on, AgenticTask as oo, promptOnlyProfileMaterialization as op, pickBestDelivered as or, AssertTraceDerivedFindings as os, workerInboxFile as ot, SteerableSandboxSession as ou, SurfaceWorkerOut as p, AcquireOptions as pa, LeaderboardSpec as pc, DelegationTaskQueueOptions as pd, NotFoundError as pf, CollectedAgentTurn as pi, DownMessageAuthorizationInput as pl, delegatesWorkerBriefPrompt as pn, Strategy as po, PriorCoordination as pr, EqualKOnCostOptions as ps, createInMemoryRunContext as pt, WorktreeHarnessResult as pu, createSupervisor as q, sanitizeMcpToolSchema as qa, anytimeReport as qc, DELEGATION_TRACE_MAX_BYTES as qd, CanonicalAgentProfileMaterializationAxis as qf, OpenSandboxRunPromptOptions as qi, CliWorktreeBridgeSeam as ql, allOf as qn, InProcessPromptCtx as qo, StructuralRolloutConfig as qr, DefinePersonaInput as qs, ResolvedSupervisorProfile as qt, createFleetWorkspaceExecutor as qu, CreateSandboxOptions$1 as r, createSandboxLineage as ra, ShapeRegistry as rc, formatDetachedSessionRef as rd, DelegationStateCorruptError as rf, filterAuthoredAsserts as ri, AnalystRegistry as rl, SupervisorSpanAttributes as rn, AgenticOptions as ro, profileMaterializationAxes as rp, SupervisorFinalizer as rr, defaultAnalystInstruction as rs, supervisorRunsRoot as rt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as ru, makeFinding$1 as s, mapSandboxEvent as sa, LeaderboardBenchmarkAdapter as sc, DelegationRecord as sd, InMemoryDelegationStore as sf, sandboxCheckRunner as si, ContinuationInstruction as sl, createSupervisorSpanRecorder as sn, AgenticTool as so, promptResourceProfileMaterialization as sp, runFinalizer as sr, CombinatorShape as ss, workerInboxFileFromEventDir as st, createSteerableSandboxSession as su, AgentProfile$2 as t, SandboxLineageHandle as ta, ShapeBudget as tc, createDetachedTurnResumeDriver as td, createDelegationTraceCollector as tf, defaultExtractCandidate as ti, createWaterfallCollector as tl, resolveSupervisorProfile as tn, printBenchmarkReport as to, defineProfileMaterializationContract as tp, FinalizeContext as tr, ObserveInput as ts, safeWorkerFile as tt, createExecutor as tu, SuperviseSurfaceOptions as u, CriuCapableClient as ua, LeaderboardRunContext as uc, DelegationResumeTick as ud, BackendTransportError as uf, visibleCheckScore as ui, CoordinationTools as ul, RegisteredPrompt as un, RunAgenticOptions as uo, validateProfileMaterialization as up, CoordinationLog as ur, CorpusRecord as us, InMemoryRunContextOptions as ut, createInbox as uu, worktreeFanout as v, PromotionVerdict as va, CompletionVerdict as vc, DelegateCodeConfig as vd, BusEvent as vf, ChampionPolicy as vi, Question as vl, naiveContinuationPrompt as vn, StrategyShotResult as vo, ChatWorkerSeamOptions as vr, FanoutWinnerSelector as vs, createWorktreeCliExecutor as vt, GitRunner as vu, composeWorkerEvidence as w, registerShape as wa, GroupOf as wc, DelegateResearchResult as wd, WatchTraceOptions as wf, EvolutionReport as wi, QuestionUrgency as wl, DispatchUnit as wn, refine as wo, BudgetPoolRestore as wr, PanelJudge as ws, GraphEdge as wt, JsonRpcMessage as wu, VERIFY_TAIL_CHARS as x, trajectoryReport as xa, sentinelCompletion as xc, DelegateFeedbackResult as xd, EventBus as xf, EvolutionBandInfo as xi, QuestionOption as xl, ConcurrencyCaps as xn, breadthStrategy as xo, chatWorkerSeam as xr, LoopUntilSpec as xs, AgentGraph as xt, captureWorktreeDiff as xu, EVIDENCE_MAX_CHARS as y, promotionGate as ya, completionAuthorizes as yc, DelegateCodeResult as yd, BusRecord as yf, EvolutionArchiveNode as yi, QuestionDecision as yl, promptHandle as yn, SurfaceScore as yo, chatCompletionsTransport as yr, FlatWidenGate as ys, assertModelAllowed as yt, RemoveWorktreeOptions as yu, TrajectoryAnalysis as z, RegistryAnalyzeProjection as za, AuditIntentInput as zc, DelegationStatusResult as zd, loadSpawnForest as zf, McpToolDescriptor as zi, DelegateArgs as zl, NoProgressForOptions as zn, ResolvedMcpServerLaunch as zo, supervisorInstructions as zr, Verify as zs, supervise as zt, UiAuditorDelegate as zu };
8663
- //# sourceMappingURL=index-BhZhQw77.d.ts.map
7940
+ export { legacySupervisorRunsRoot as $, sanitizeMcpToolSchema as $a, areaUnderCurve as $c, DeliverableSpec as $d, openSandboxRun as $i, McpTransport as $l, ProgressTrackerOptions as $n, InProcessSandboxClientOptions as $o, RepairStop as $r, LoopShape as $s, delegatesWorkerBriefPrompt as $t, DelegateUiAuditResult as $u, GitWorkspaceOptions as A, registerShape as Aa, Interval as Ac, DelegationStore as Ad, fullProfileMaterialization as Af, runStrategyEvolution as Ai, SettledWorker as Al, SupervisorProfile as An, runAgentic as Ao, chatWorkerSeam as Ar, PanelSpec as As, runGraph as At, parseDetachedSessionRef as Au, analyzeTrace as B, pipeline as Ba, renderLeaderboardHtml as Bc, PlannerError as Bd, McpSpawnFault as Bi, createMcpServer as Bl, DriverProgressMark as Bn, runAgentRounds as Bo, ProfileRichness as Br, TrajectoryNode as Bs, supervise as Bt, SubmitInput as Bu, closingWorkerNote as C, profileOptimizerModelCall as Ca, CompletionVerdict as Cc, DelegationTraceSpan as Cd, KnownAgentProfileMaterializationAxis as Cf, EvolutionCandidate as Ci, Question as Cl, ResolveDriveHarness as Cn, StrategyShotResult as Co, PriorCoordination as Cr, FanoutWinnerSelector as Cs, GraphEdgeCapError as Ct, DetachedTurnResumeDriverOptions as Cu, UntrackedCopyStats as D, trajectoryReport as Da, stopSentinel as Dc, createDelegationTraceCollector as Dd, assertProfileMaterialization as Df, StrategyEvolutionConfig as Di, QuestionPolicy as Dl, SupervisorAgentTestDeps as Dn, defineStrategy as Do, ChatTransportTool as Dr, LoopUntilState as Ds, RunGraphTestOptions as Dt, createDetachedTurnResumeDriver as Du, CopyOptions as E, equalKOnCost as Ea, sentinelCompletion as Ec, composeLoopTraceEmitters as Ed, ValidateProfileMaterializationOptions as Ef, ReproductionCheck as Ei, QuestionOption as El, SupervisorAgentDeps as En, breadthStrategy as Eo, ChatTransportExecutorOptions as Er, LoopUntilSpec as Es, RunGraphOptions as Et, RunDetachedTurnOptions as Eu, gitWorkspace as F, renderCorpusToInstructions as Fa, PairwiseVerdict as Fc, AgentEvalErrorCode as Fd, promptResourceProfileMaterialization as Ff, authorStrategy as Fi, createCoordinationTools as Fl, supervisorAgent as Fn, LoopOptionsForDispatch as Fo, ReservationRejection as Fr, RenderCorpusToInstructionsOptions as Fs, DeliverableResolutionInput as Ft, DelegationResumeDriver as Fu, workerTraceAnalysisStore as G, RegistryAnalyzeProjection as Ga, AuditIntentOptions as Gc, BusRecord as Gd, materializeLocalMcp as Gi, DelegateError as Gl, DriverAgentOptions as Gn, envKeyProvider as Go, profileRichnessFinding as Gr, VerifySpec as Gs, SupervisorSpanOutcome as Gt, DelegateCodeResult as Gu, WorkerToolTraceArtifact as H, verify as Ha, renderLeaderboardSvg as Hc, ValidationError as Hd, StdioMcpConnection as Hi, DELEGATE_INPUT_SCHEMA as Hl, classifyDriverFailure as Hn, localSandboxClient as Ho, asAuthoredProfile as Hr, TrajectoryReportFn as Hs, workerFromBackend as Ht, hashIdempotencyInput as Hu, jjWorkspace as I, fanout as Ia, ProfileKeyOf as Ic, BackendTransportError as Id, renderProfileMaterializationIssues as If, strategyAuthorContract as Ii, normalizeAnalyzeOnSettle as Il, supervisorAgentWithTestBrain as In, loopCampaignDispatch as Io, ReservationTicket as Ir, ScopeAnalyst as Is, SuperviseOptions as It, DelegationResumeTick as Iu, ScopeArgs as J, createScopeAnalyst as Ja, defaultAuditorInstruction as Jc, PublishOptions as Jd, OpenSandboxRunOptions as Ji, createDelegateHandler as Jl, AllWorkersStalledOptions as Jn, resolveSecretEnv as Jo, CheckOutcome as Jr, WidenLineage as Js, PromptHandle as Jt, DelegateResearchArgs as Ju, createRootHandle as K, assertTraceDerivedFindings as Ka, IntentAudit as Kc, BusStats as Kd, Deliverable as Ki, DelegateHandlerOptions as Kl, driverAgent as Kn, mcpSecretEnvMetadataKey as Ko, supervisorInstructions as Kr, Widen as Ks, SupervisorSpanRecorder as Kt, DelegateFeedbackArgs as Ku, localShell as L, flatWidenGate as La, ScoreOf as Lc, ConfigError as Ld, sandboxActProfileMaterialization as Lf, strategyAuthorSystemPrompt as Li, McpServer as Ll, DriverAttemptRecord as Ln, loopDispatch as Lo, createBudgetPool as Lr, ScopeAnalyzeInput as Ls, SuperviseRegistry as Lt, DelegationRunContext as Lu, Workspace as M, runPersonified as Ma, LeaderboardOptions as Mc, FileDelegationStoreOptions as Md, promptControlProfileMaterialization as Mf, AuthorStrategyOptions as Mi, WorkerSpawnContext as Ml, SupervisorToolInvocationContext as Mn, sampleThenRefine as Mo, BudgetPool as Mr, Pipeline as Ms, AuthorizedSpawn as Mt, DelegationArgs as Mu, WorkspaceCommit as N, FileCorpus as Na, LeaderboardRow as Nc, InMemoryDelegationStore as Nd, promptModelProfileMaterialization as Nf, AuthoredStrategy as Ni, WorkerWatchOptions as Nl, assertCoordinationBinding as Nn, LoopCampaignDispatchOptions as No, BudgetPoolRestore as Nr, PipelineStage as Ns, AuthorizedSpawnContext as Nt, DelegationRecord as Nu, copyUntrackedIntoClone as O, builtinShapes as Oa, AxisScoresOf as Oc, DelegationPersistenceError as Od, controlProfileMaterialization as Of, discriminatingMeans as Oi, QuestionRecord as Ol, SupervisorNodeContext as On, depthStrategy as Oo, ChatWorkerSeamOptions as Or, Panel as Os, TraversalContinuity as Ot, detachedTurnEvents as Ou, WorkspaceRun as P, InMemoryCorpus as Pa, PairwiseOptions as Pc, AgentEvalError$1 as Pd, promptOnlyProfileMaterialization as Pf, assertStrategyContract as Pi, canonicalFindingEvent as Pl, resolveSupervisorProfile as Pn, LoopDispatchOptions as Po, BudgetReadout as Pr, RenderCorpusToInstructions as Ps, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as Pt, DelegationResumeContext as Pu, legacySupervisorRunDir as Q, createMcpEnvironment as Qa, anytimeReport as Qc, watchTrace as Qd, TurnResult as Qi, McpToolDescriptor$1 as Ql, ProgressTracker as Qn, InProcessPromptCtx as Qo, CheckSourceCtx as Qr, DefinePersonaInput as Qs, createPromptRegistry as Qt, DelegateUiAuditConfig as Qu, runInWorkspace as R, loopUntil as Ra, leaderboard as Rc, JudgeError as Rd, validateProfileMaterialization as Rf, LocalMcpMaterialization as Ri, McpServerOptions as Rl, DriverAttemptStop as Rn, RunAgentRoundsOptions as Ro, spendFromUsageEvents as Rr, ScopeWidenGate as Rs, SuperviseRegistryTable as Rt, DelegationTaskQueue as Ru, WorkerEvidenceInput as S, profileChatClient as Sa, CompletionPolicy as Sc, DelegationTraceCollector as Sd, DefineProfileMaterializationContractOptions as Sf, EvolutionBandInfo as Si, MakeWorkerAgent as Sl, ObserveSupervisorNodeEvent as Sn, StrategyResult as So, FileCoordinationLog as Sr, FanoutSynthesis as Ss, GraphEdge as St, DetachedTurn as Su, settledWorkerOut as T, assertProfileModelsAllowed as Ta, deterministicCompletion as Tc, capDelegationTrace as Td, ProfileMaterializationIssue as Tf, EvolutionReport as Ti, QuestionLevel as Tl, ResolvedSupervisorProfile as Tn, adaptiveRefine as To, ChatSessionStore as Tr, LoopUntil as Ts, GraphResult as Tt, DriveTurnTick as Tu, captureWorkerTraceEvidence as U, widen as Ua, renderPairwiseMarkdown as Uc, CoderOutput as Ud, StdioMcpServerSpec as Ui, DELEGATE_TOOL_NAME as Ul, CoordinationMcpHandle as Un, KeyProvider as Uo, assessAuthoredProfile as Ur, TrajectoryReportOptions as Us, SupervisorSpanAttributes as Ut, DelegateCodeArgs as Uu, WORKER_TOOL_TRACE_SCHEMA_VERSION as V, selectValidWinner as Va, renderLeaderboardMarkdown as Vc, RuntimeRunStateError as Vd, McpToolDescriptor as Vi, DELEGATE_DESCRIPTION as Vl, DriverRetryPolicy as Vn, LocalSandboxClientOptions as Vo, ProfileRichnessThresholds as Vr, TrajectoryReport as Vs, superviseWithTestBrain as Vt, SubmitOutput as Vu, parseWorkerToolTraceArtifact as W, CreateScopeAnalystOptions as Wa, AuditIntentInput as Wc, BusEvent as Wd, connectStdioMcp as Wi, DelegateArgs as Wl, serveCoordinationMcp as Wn, ResolvedMcpServerLaunch as Wo, defaultProfileRichnessThresholds as Wr, Verify as Ws, SupervisorSpanOptions as Wt, DelegateCodeConfig as Wu, settledToIteration as X, McpEndpoint as Xa, AnytimeStrategySummary as Xc, WatchTraceOptions as Xd, SandboxRun as Xi, JsonRpcMessage as Xl, PlateauOptions as Xn, inlineSandboxClient as Xo, CheckRunner as Xr, WinnerStrategy as Xs, RegisteredPrompt as Xt, DelegateResearchResult as Xu, createScope as Y, registryScopeAnalyst as Ya, AnytimeReport as Yc, createEventBus as Yd, OpenSandboxRunPromptOptions as Yi, validateDelegateArgs as Yl, NoProgressForOptions as Yn, secretEnvOfMcpServer as Yo, CheckRunContext as Yr, WidenSpec as Ys, PromptRegistry as Yt, DelegateResearchConfig as Yu, WorkerSteerRequest as Z, McpEnvironmentOptions as Za, AnytimeTaskCurve as Zc, defaultToolDetectors as Zd, SandboxRunAbortError as Zi, JsonRpcResponse as Zl, ProgressSample as Zn, InProcessOnPrompt as Zo, CheckSource as Zr, DefinePersona as Zs, analyzesFindingsReportPrompt as Zt, DelegateUiAuditArgs as Zu, WorktreeFanoutOptions as _, ResolveSandboxClientOptions as _a, LeaderboardScore as _c, UiAuditorDelegationOutput as _d, contentAddress as _f, visibleCheckScore as _i, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as _l, defaultDelegateBudget as _n, ShotSpec as _o, runFinalizer as _r, EqualKOnCost as _s, WorktreePatchArtifact as _t, FleetWorkspaceExecutorOptions as _u, SandboxInstance$1 as a, createSandboxLineage as aa, RunPersonifiedOptions as ac, DelegationHistoryResult as ad, InMemoryResultBlobStore as af, canDisplace as ai, WaterfallSpan as al, promptHandle as an, BenchmarkTaskRow as ao, anyOf as ar, Observation as as, workerControlLogFile as at, CoderReview as au, NOTE_MAX_CHARS as b, PromotionVerdict as ba, CompletionAnalyst as bc, DELEGATION_TRACE_MAX_SPANS as bd, AssertProfileMaterializationOptions as bf, EvolutionArchiveNode as bi, DownMessageDeliveryOutcome as bl, DriveHarness as bn, StrategyCtx as bo, CoordinationLog as br, Fanout as bs, EdgeDeliveryOutcome as bt, createSiblingSandboxExecutor as bu, VerifierEnvironmentOptions as c, extractLlmCallEvent as ca, ShapeRegistry as cc, DelegationResultPayload as cd, SpawnForestEvent as cf, defaultExtractCandidate as ci, AnalystRegistry as cl, DispatchReport as cn, runBenchmark as co, plateau as cr, defaultAnalystInstruction as cs, writeWorkerSteer as ct, DetachedSessionDelegateOptions as cu, SuperviseSurfaceResult as d, sumSandboxUsage as da, LeaderboardBenchTask as dc, DelegationStatusResult as dd, SpawnForestNode as df, modelAuthoredChecks as di, AuthorizedDownMessage as dl, RollingDispatchOptions as dn, AgenticSurface as do, FinalizeContext as dr, AssertTraceDerivedFindings as ds, RunContext as dt, UiAuditorDelegate as du, CheckpointCapableBox as ea, Outcome as ec, DelegateUiAuditRoute as ed, ExecutorResultMapping as ef, StructuralRolloutConfig as ei, bestSoFar as el, dumbContinuationFailPrompt as en, BenchmarkCell as eo, ProgressView as er, inProcessSandboxClient as es, readWorkerSteerRequests as et, FeedbackEvent as eu, SurfaceWorkerConfig as f, CriuCapableClient as fa, LeaderboardBenchmarkAdapter as fc, FeedbackRating as fd, SpawnForestTree as ff, officialChecksFromMeta as fi, ContinuationInstruction as fl, effectiveConcurrency as fn, AgenticTask as fo, FinalizerSettled as fr, CombinatorShape as fs, createFileRunContext as ft, coderTaskFromArgs as fu, AuthoredHarness as g, acquireSandbox as ga, LeaderboardScenario as gc, UiAuditLensFilter as gd, replaySpawnTree as gf, structuralRollout as gi, CoordinationToolsOptions as gl, DelegateOptions as gn, RunAgenticOptions as go, pickBestDelivered as gr, EqualKArm as gs, WorktreeCliExecutorOptions as gt, FleetHandle as gu, superviseSurface as h, AcquireOptions as ha, LeaderboardRunContext as hc, ResearchSource as hd, pendingWaits as hf, selectBestIndex as hi, CoordinationTools as hl, rollingDispatch as hn, CorpusReadbackOptions as ho, collectDelivered as hr, CorpusRecord as hs, patchDelivered as ht, DelegationExecutor as hu, SandboxEvent$1 as i, SessionCapableBox as ia, RunPersonified as ic, DelegationHistoryEntry as id, FileSpawnJournal as if, VisibleCheck as ii, WaterfallReport as il, naiveContinuationPrompt as in, BenchmarkStrategySummary as io, allWorkersStalled as ir, harvestCorpus as is, supervisorWorkersDir as it, CoderDelegate as iu, Shell as j, definePersona as ja, Leaderboard as jc, FileDelegationStore as jd, profileMaterializationAxes$1 as jf, selectChampion as ji, WorkerResumeContext as jl, SupervisorToolDescriptor as jn, sample as jo, createChatSessionStore as jr, PanelVerdict as js, runGraphWithTestBrain as jt, runDetachedTurn as ju, withUntrackedArtifacts as k, createShapeRegistry as ka, GroupOf as kc, DelegationStateCorruptError as kd, defineProfileMaterializationContract as kf, pickChampion as ki, QuestionUrgency as kl, SupervisorNodeContextSeed as kn, refine as ko, chatTransportExecutor as kr, PanelJudge as ks, defaultEdgeTraversalCap as kt, formatDetachedSessionRef as ku, createVerifierEnvironment as l, mapSandboxEvent as la, DefinedLeaderboard as lc, DelegationStatus as ld, SpawnForestInDoubtNode as lf, defaultStructuralRolloutPolicy as li, AnalyzeOnSettleRoute as ll, DispatchStopReason as ln, AgenticOptions as lo, sampleFromSettled as lr, observe as ls, InMemoryRunContext as lt, DetachedWinnerSelection as lu, failuresAnalyst as m, probeSandboxCapabilities as ma, LeaderboardIterationInfo as mc, ResearchOutputShape as md, materializeTreeView as mf, sandboxCheckRunner as mi, CoordinationEvent as ml, queueOf as mn, ArtifactHandle as mo, bestDelivered as mr, CorpusFilter as ms, PatchDeliverableOptions as mt, settleDetachedCoderTurn as mu, AnalystFinding$1 as n, SandboxLineage as na, PersonaContext as nc, DelegationFeedbackSnapshot as nd, mapExecutorResult as nf, StructuralRolloutPolicy as ni, renderAnytimeTable as nl, formatPromptHandle as nn, BenchmarkLift as no, StopRule as nr, HarvestFailure as ns, supervisorRunDir as nt, InMemoryFeedbackStore as nu, computeFindingId$1 as o, SandboxToolPartState as oa, ShapeBudget as oc, DelegationProfile as od, InMemorySpawnJournal as of, compareCheckOutcomes as oi, createWaterfallCollector as ol, supervisorPolicyPrompt as on, Environment as oo, createProgressTracker as or, ObserveInput as os, workerInboxFile as ot, CoderReviewer as ou, SurfaceWorkerOut as p, SandboxCapabilities as pa, LeaderboardFlagSpec as pc, FeedbackRefersTo as pd, loadSpawnForest as pf, resolveEntrySymbol as pi, ContinuityMode as pl, freeSlots as pn, AgenticTool as po, SupervisorFinalizer as pr, Corpus as ps, createInMemoryRunContext as pt, detachedSessionDelegate as pu, createSupervisor as q, buildSteerContext as qa, auditIntent as qc, EventBus as qd, OpenSandboxRunBeforeStartContext as qi, DelegateResult as ql, finalizeBestDelivered as qn, resolveMcpServerLaunch as qo, CheckExecChannel as qr, WidenDecision as qs, createSupervisorSpanRecorder as qt, DelegateFeedbackResult as qu, CreateSandboxOptions$1 as r, SandboxLineageHandle as ra, PersonaExecutors as rc, DelegationHistoryArgs as rd, FileResultBlobStore as rf, StructuralRolloutResult as ri, WaterfallCollector as rl, kernelPromptRegistry as rn, BenchmarkReport as ro, allOf as rr, HarvestReport as rs, supervisorRunsRoot as rt, eventToSnapshot as ru, makeFinding$1 as s, createSandboxToolPartState as sa, ShapeContext as sc, DelegationProgress as sd, SpawnForest as sf, composeCheckSources as si, AnalystFindingEvent as sl, ConcurrencyCaps as sn, printBenchmarkReport as so, noProgressFor as sr, ObserveOptions as ss, workerInboxFileFromEventDir as st, DelegateRunCtx as su, AgentProfile$2 as t, ForkCapableBox as ta, Persona as tc, DelegationError as td, gateOnDeliverable as tf, StructuralRolloutMessage as ti, plateauLength as tl, dumbContinuationPassPrompt as tn, BenchmarkConfig as to, StopDecision as tr, HarvestCorpusOptions as ts, safeWorkerFile as tt, FeedbackStore as tu, SuperviseSurfaceOptions as u, mapSandboxToolEvent as ua, LeaderboardBenchScore as uc, DelegationStatusArgs as ud, SpawnForestMissingTree as uf, filterAuthoredAsserts as ui, AuthorizeDownMessage as ul, DispatchUnit as un, AgenticRunResult as uo, DeliveredOutput as ur, renderReport as us, InMemoryRunContextOptions as ut, SettleDetachedCoderTurnOptions as uu, worktreeFanout as v, resolveSandboxClient as va, LeaderboardSpec as vc, CappedDelegationTrace as vd, AGENT_PROFILE_MATERIALIZATION_AXES as vf, ChampionPick as vi, DownMessageAuthorizationInput as vl, delegate as vn, Strategy as vo, runTree as vr, EqualKOnCostOptions as vs, createWorktreeCliExecutor as vt, SiblingSandboxExecutorOptions as vu, composeWorkerEvidence as w, assertModelAllowed as wa, completionAuthorizes as wc, buildDelegationTraceSpans as wd, ProfileMaterializationContract as wf, EvolutionGeneration as wi, QuestionDecision as wl, ResolveSupervisorTools as wn, SurfaceScore as wo, ChatCompletionsTransport as wr, FlatWidenGate as ws, GraphNode as wt, DriveTurnCapableBox as wu, VERIFY_TAIL_CHARS as x, promotionGate as xa, CompletionEvidence as xc, DelegationTraceCaps as xd, CanonicalAgentProfileMaterializationAxis as xf, EvolutionAuthor as xi, DownMessageEvent as xl, DriveHarnessOwnerContext as xn, StrategyMessage as xo, CoordinationOwnerId as xr, FanoutOptions as xs, EdgeTraversal as xt, DetachedSessionRefParts as xu, EVIDENCE_MAX_CHARS as y, PromotionGateOptions as ya, defineLeaderboard as yc, DELEGATION_TRACE_MAX_BYTES as yd, AgentProfileMaterializationAxis as yf, ChampionPolicy as yi, DownMessageDeliveryAttempt as yl, CoordinationBinding as yn, StrategyArtifacts as yo, CoordinationDeliveryEvidence as yr, EqualKVerdict as ys, AgentGraph as yt, createFleetWorkspaceExecutor as yu, TrajectoryAnalysis as z, panel as za, pairwiseSignificance as zc, NotFoundError as zd, worktreeCliProfileMaterialization as zf, MaterializeLocalMcpOptions as zi, createInProcessTransport as zl, DriverAttemptsExhaustedError as zn, defaultSelectWinner as zo, AuthoredProfile as zr, SteerContext as zs, SuperviseTestOptions as zt, DelegationTaskQueueOptions as zu };
7941
+ //# sourceMappingURL=index-CoO7atyo.d.ts.map