@tangle-network/agent-runtime 0.126.0 → 0.131.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) 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-CvHwo1oW.js +163 -0
  12. package/dist/authoring-CvHwo1oW.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-BJTxGOFB.js +471 -0
  26. package/dist/graph-BJTxGOFB.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-EdjCQBV9.d.ts → index-CoO7atyo.d.ts} +640 -1184
  30. package/dist/{index-DIV33AF5.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-EnuEqm_Y.js → knowledge-ce0_uKCl.js} +19 -17
  41. package/dist/knowledge-ce0_uKCl.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-Bo29_fiD.d.ts → loop-runner-bin-BwgZ8m_7.d.ts} +6 -3
  45. package/dist/{loop-runner-bin-qwT_4F5I.js → loop-runner-bin-DSbuDDqM.js} +5 -27
  46. package/dist/loop-runner-bin-DSbuDDqM.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 -30
  54. package/dist/mcp/index.js +66 -83
  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-5HEJH672.js} +2 -2
  58. package/dist/{memory-server-DL6cE2Ag.js.map → memory-server-5HEJH672.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-Bp1KSkP6.js → openai-tools-ru75mLjq.js} +2 -2
  63. package/dist/openai-tools-ru75mLjq.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-BzXz7OjS.js → runtime-hiAABiTk.js} +329 -854
  81. package/dist/runtime-hiAABiTk.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-Ds8FtyI9.js → supervise-iPN27pO0.js} +932 -4771
  94. package/dist/supervise-iPN27pO0.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/{top-app-5unxqovu.js → top-app-G4M18b6i.js} +3 -3
  101. package/dist/{top-app-5unxqovu.js.map → top-app-G4M18b6i.js.map} +1 -1
  102. package/dist/tui/bin.js +1 -1
  103. package/dist/tui/index.js +1 -1
  104. package/dist/{environment-provider-PM9PeW_J.d.ts → types-C6Q-J0Dt.d.ts} +57 -114
  105. package/dist/{types-DnNGJ5Gz.d.ts → types-ebIY0dMG.d.ts} +556 -30
  106. package/dist/{util-MVgdwuIS.js → util-Bw6srryQ.js} +3 -2
  107. package/dist/{util-MVgdwuIS.js.map → util-Bw6srryQ.js.map} +1 -1
  108. package/dist/{workspace-archive-BQxvkypI.js → workspace-archive-aOfJ47ms.js} +3 -3
  109. package/dist/{workspace-archive-BQxvkypI.js.map → workspace-archive-aOfJ47ms.js.map} +1 -1
  110. package/package.json +12 -15
  111. package/skills/agent-graphs/IMPROVE.md +58 -0
  112. package/skills/agent-graphs/SKILL.md +139 -0
  113. package/skills/agent-graphs/cases/artifact-mission-release-notes.json +10 -0
  114. package/skills/agent-graphs/cases/audited-single-writer.json +9 -0
  115. package/skills/agent-graphs/cases/cap-as-stop-mistake.json +8 -0
  116. package/skills/agent-graphs/cases/mission-in-deliverable.json +8 -0
  117. package/skills/agent-graphs/cases/review-pipeline.json +13 -0
  118. package/skills/agent-graphs/cases/runtime-discovered-fanout.json +8 -0
  119. package/skills/agent-graphs/cases/single-agent-suffices.json +7 -0
  120. package/skills/agent-graphs/cases/steer-heavy-drafting.json +9 -0
  121. package/skills/agent-graphs/cases/unmeasured-harness.json +7 -0
  122. package/skills/agent-graphs/generations/gen1-baseline.json +248 -0
  123. package/skills/agent-graphs/generations/gen2.json +375 -0
  124. package/skills/agent-graphs/generations/gen3.json +702 -0
  125. package/skills/build-with-agent-runtime/SKILL.md +1 -0
  126. package/dist/backends-CiOCyRHb.js +0 -743
  127. package/dist/backends-CiOCyRHb.js.map +0 -1
  128. package/dist/conversation-BpLQZGPH.js.map +0 -1
  129. package/dist/environment-provider-DqFS6FSZ.js.map +0 -1
  130. package/dist/improvement-cycle-IJgCbKWQ.js.map +0 -1
  131. package/dist/index-D_M4d1_B.d.ts +0 -545
  132. package/dist/knowledge-EnuEqm_Y.js.map +0 -1
  133. package/dist/local-harness-BIajef4A.d.ts +0 -465
  134. package/dist/loop-runner-bin-qwT_4F5I.js.map +0 -1
  135. package/dist/model-resolution-Btd9iIKV.js +0 -98
  136. package/dist/model-resolution-Btd9iIKV.js.map +0 -1
  137. package/dist/openai-tools-Bp1KSkP6.js.map +0 -1
  138. package/dist/prepare--8EvLqCr.js.map +0 -1
  139. package/dist/researcher-CoVqNhfI.js.map +0 -1
  140. package/dist/runtime-BzXz7OjS.js.map +0 -1
  141. package/dist/sandbox-events-Yhd1GYWl.js.map +0 -1
  142. package/dist/spawn-journal-DsZKDqeh.js.map +0 -1
  143. package/dist/structural-rollout-zY0oqQzO.js.map +0 -1
  144. package/dist/supervise-Ds8FtyI9.js.map +0 -1
  145. package/dist/supervisor-DpjO0Gmy.js.map +0 -1
  146. package/dist/types-C9j4qg6l.d.ts +0 -500
@@ -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-PM9PeW_J.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,566 +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
- timeoutMs?: number;
2088
- /** Stable cli-bridge session id. Defaults to `bridge-worktree-${runId}`. */
2089
- sessionId?: string;
2090
- maxTurns?: number;
2091
- }
2092
- /**
2093
- * cli-bridge seam. A local OpenAI-compatible bridge that fronts harness CLIs
2094
- * (claude-code / opencode / kimi / pi) behind one HTTP surface; `model` doubles
2095
- * as the harness selector (e.g. `claude-code/sonnet`, `opencode/<provider>/<model>`).
2096
- * `agentProfile` is the bridge-dialect profile (metadata.disallowedTools, mcp)
2097
- * forwarded verbatim per request — how an arm disables native tools or injects
2098
- * a provider search MCP.
2099
- *
2100
- * The executor opens a resumable cli-bridge session. `sessionId` identifies the
2101
- * harness conversation across turns; each turn also receives its own durable run id.
2102
- * A dropped HTTP reader reattaches to that exact run and explicit cancel is the only
2103
- * operation allowed to stop it. Omit `sessionId` and the executor mints one per spawn.
2104
- *
2105
- * ── HOW TO CONTROL WHAT THE HARNESS LOADS (there is no argv field, by design) ──
2106
- *
2107
- * A worker often needs the harness started in a KNOWN state — no ambient extensions, skills,
2108
- * context files, or prompt templates — because ambient state is how a paired experiment silently
2109
- * loses its pairing: an installed extension that persists memory across runs carries arm A's state
2110
- * into arm B, and nothing reports it.
2111
- *
2112
- * That is what the `AgentProfile` on this seam (and on the spawn spec) is FOR. `agent_profile`
2113
- * rides every request verbatim, and cli-bridge maps it onto each harness's own native controls:
2114
- *
2115
- * - Materializing any profile at all already starts the harness isolated from ambient
2116
- * workspace state — for pi that is `--no-context-files --no-skills --no-prompt-templates`,
2117
- * applied to every request that carries an `agent_profile`.
2118
- * - `AgentProfile.extensions.<harness>` is the named, per-harness control channel. An explicit
2119
- * `extensions: { pi: { load: [] } }` disables ambient extension discovery outright
2120
- * (pi's `--no-extensions`); listing package names loads exactly those and nothing else.
2121
- * - `permissions` / `tools` / `mcp` map onto the harness's native tool and server controls.
2122
- *
2123
- * A caller therefore does NOT need to hand-roll an `Executor` to isolate a harness run, and the
2124
- * profile expressing it stays portable: the same declaration means the same thing on a different
2125
- * harness, whereas an argv string means nothing anywhere else.
2126
- *
2127
- * WHY NOT A GENERAL ARGV PASSTHROUGH. `bridgeUrl` addresses a process-spawning server. Forwarding
2128
- * an arbitrary argv array to it would let any caller holding a bearer token choose the flags of a
2129
- * process on the bridge host — which for real harness CLIs includes flags that load code from a
2130
- * path, read a file into the prompt, redirect the working directory, or turn off the isolation the
2131
- * bridge applies. cli-bridge deliberately confines workers (a filesystem jail and deny-by-default
2132
- * network egress), and every one of those confinements is expressed as spawn configuration, so an
2133
- * argv channel is a channel for unwinding them. It would also break this executor's own contract:
2134
- * the durable-run replay protocol, session pinning, and streaming mode are all argv the bridge
2135
- * owns, and a caller-supplied duplicate silently wins or corrupts the parse. The structured profile
2136
- * channel is validated, per-harness, portable, and refuses controls it does not understand — keep
2137
- * new harness capability there.
2138
- */
2139
- interface BridgeSeam {
2140
- bridgeUrl: string;
2141
- bridgeBearer: string;
2142
- /** Fallback bridge wire id. A spawned profile may select its own harness and model. */
2143
- model?: string;
2144
- /** Optional working directory forwarded to cli-bridge and persisted with the session. */
2145
- cwd?: string;
2146
- /** Canonical profile overlay merged over the spawned profile. */
2147
- agentProfile?: AgentProfile$1;
2148
- timeoutMs?: number;
2149
- /** Stable, caller-owned cli-bridge session id for harness-side resume. Defaults
2150
- * to a freshly minted per-spawn id so each worker is its own resumable session. */
2151
- sessionId?: string;
2152
- /** Per-resume-turn inference cap before the worker settles on its last output.
2153
- * Mirrors `routerToolsInlineExecutor.maxTurns`; default 200 (runaway backstop). */
2154
- maxTurns?: number;
2155
- /** Newest-last activity window `progress()` reports. Default 12 (matches `PiSeam`). */
2156
- activityWindow?: number;
2157
- }
2158
- /** Generic environment provider executor config. External packages implement
2159
- * `AgentEnvironmentProvider`; this built-in wrapper lets `createExecutor`
2160
- * consume them as backend data while preserving the existing usage channel. */
2161
- interface ProviderSeam extends ProviderExecutorOptions {
2162
- provider: AgentEnvironmentProvider | string;
2163
- registry?: AgentEnvironmentProviderRegistry;
2164
- /**
2165
- * Compose the provider through the existing steerable sandbox session.
2166
- * The exact profile must name its harness, and the provider must expose live
2167
- * continuation plus session controls. The provider still owns environment
2168
- * creation and session semantics.
2169
- */
2170
- steering?: SandboxSteeringOptions;
2171
- }
2172
- /**
2173
- * Router seam WITH tool use — the tool-using router backend. Same direct
2174
- * OpenAI-compatible endpoint as `RouterSeam`, but each turn passes `tools`; when
2175
- * the model emits tool_calls they run via `executeToolCall` ON THIS HOST and the
2176
- * results fold back as `tool` messages, repeating until the model answers without
2177
- * a tool or `maxTurns` is hit. A real agentic loop, OFF-BOX — no sandbox, so it
2178
- * is unaffected by a box's egress allowlist. One turn = one completion = the
2179
- * equal-compute unit. `executeToolCall` receives the task so per-task tool
2180
- * surfaces (e.g. a gym keyed by task) can dispatch correctly.
2181
- */
2182
- interface RouterToolsSeam {
2183
- routerBaseUrl: string;
2184
- routerKey: string;
2185
- model?: string;
2186
- tools: ReadonlyArray<ToolSpec>;
2187
- executeToolCall: (name: string, args: Record<string, unknown>, task: unknown) => Promise<string>;
2188
- /** Online observer of each tool step — the seam a `DetectorMonitor` taps to watch the live pipe
2189
- * (raise a `finding` when the worker loops/errors). Called after every tool call resolves, with
2190
- * real per-call wall-clock (`startedAt`/`endedAt`/`durationMs`) so a push `TraceSource` can carry
2191
- * non-zero span durations onto the unified timeline. */
2192
- onToolStep?: (step: {
2193
- toolName: string;
2194
- args: Record<string, unknown>;
2195
- status: 'ok' | 'error';
2196
- startedAt?: number;
2197
- endedAt?: number;
2198
- durationMs?: number;
2199
- }) => void;
2200
- /** Max inference turns. Default 200 (runaway backstop — set far above any
2201
- * legitimate workflow). For tighter per-workflow limits use a cost budget
2202
- * or wall-clock deadline at the call site. */
2203
- maxTurns?: number;
2204
- }
2205
- /**
2206
- * The leaf `createWorktreeCliExecutor` as a backend-as-data factory: a supervisor-authored
2207
- * `AgentProfile` driving claude / codex / opencode on its own worktree. `budgetExempt` like
2208
- * the other CLI leaves; the authored systemPrompt + model reach the harness via §1.5.
2209
- */
2210
- declare const cliWorktreeExecutor: ExecutorFactory<unknown>;
2211
- /**
2212
- * Config for {@link createExecutor}: the backend is DATA — the cost dial a profile,
2213
- * an experiment config, or a replay journal can name — not an import choice. Each
2214
- * variant carries its backend's seam (router/router-tools/bridge/cli/cli-worktree/sandbox).
2215
- */
2216
- type ExecutorConfig = ({
2217
- backend: 'router';
2218
- } & RouterSeam) | ({
2219
- backend: 'router-tools';
2220
- } & RouterToolsSeam) | ({
2221
- backend: 'bridge';
2222
- } & BridgeSeam) | ({
2223
- backend: 'cli';
2224
- } & CliSeam) | ({
2225
- backend: 'cli-worktree';
2226
- } & CliWorktreeSeam) | ({
2227
- backend: 'provider';
2228
- } & ProviderSeam) | ({
2229
- backend: 'sandbox';
2230
- harness?: BackendType;
2231
- } & SandboxSeam);
2232
- /**
2233
- * The single built-in executor factory. Picks a leaf backend by data (`config.backend`),
2234
- * injects the matching seam, and delegates to that backend's built-in implementation.
2235
- * The `Executor` port stays OPEN: bring-your-own agents implement `Executor` directly
2236
- * and never pass through here. Use this (or `createExecutorRegistry`) instead of a
2237
- * per-vendor adapter or a closed `inline|sandbox|cli` switch — those bypass the
2238
- * `UsageEvent` reporting channel.
2239
- */
2240
- declare function createExecutor(config: ExecutorConfig): ExecutorFactory<unknown>;
2241
- /**
2242
- * The open resolver/registry. Pre-registers the three built-ins under their
2243
- * runtime tags (`'router'`, `'sandbox'`, `'cli'`) and accepts `register(name,
2244
- * factory)` for any additional runtime — and a BYO `AgentSpec.executor` resolves
2245
- * without touching the registry at all. NOT a closed switch; registration + BYO
2246
- * ARE the extension points.
2247
- *
2248
- * `resolve` precedence (frozen in `ExecutorRegistry`): a BYO `spec.executorFactory` →
2249
- * `spec.executor` → `harness === null` → the `'router'` factory; else a registered factory for the
2250
- * harness-derived runtime (`'sandbox'` for any `BackendType`); else fail loud.
2251
- */
2252
- declare function createExecutorRegistry(): ExecutorRegistry;
2253
- //#endregion
2254
1707
  //#region src/mcp/tools/delegate.d.ts
2255
- /** MCP tool name for the `delegate` generic-delegation tool. @experimental */
1708
+ /** MCP tool name for the `delegate` generic-delegation tool. @stable */
2256
1709
  declare const DELEGATE_TOOL_NAME = "delegate";
2257
- /** 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 */
2258
1711
  declare const DELEGATE_DESCRIPTION: string;
2259
- /** JSON Schema for `delegate` tool arguments (`intent` + optional `model` and `runId`). @experimental */
1712
+ /** JSON Schema for `delegate` tool arguments (`intent` + optional trace id). @stable */
2260
1713
  declare const DELEGATE_INPUT_SCHEMA: {
2261
1714
  readonly type: "object";
2262
1715
  readonly properties: {
@@ -2264,10 +1717,6 @@ declare const DELEGATE_INPUT_SCHEMA: {
2264
1717
  readonly type: "string";
2265
1718
  readonly description: "What you want accomplished, as an outcome. The supervisor authors the worker.";
2266
1719
  };
2267
- readonly model: {
2268
- readonly type: "string";
2269
- readonly description: "Optional per-call override for the supervisor brain model.";
2270
- };
2271
1720
  readonly runId: {
2272
1721
  readonly type: "string";
2273
1722
  readonly description: "Optional trace-correlation id for this delegation.";
@@ -2279,10 +1728,9 @@ declare const DELEGATE_INPUT_SCHEMA: {
2279
1728
  /** Parsed `delegate` tool arguments. */
2280
1729
  interface DelegateArgs {
2281
1730
  intent: string;
2282
- model?: string;
2283
1731
  runId?: string;
2284
1732
  }
2285
- /** 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 */
2286
1734
  declare function validateDelegateArgs(raw: unknown): DelegateArgs;
2287
1735
  /** The synchronous result the `delegate` tool returns to the calling agent: the delivered output (or
2288
1736
  * the no-winner reason) PLUS the conserved spend of the whole delegation. */
@@ -2304,16 +1752,16 @@ interface DelegateError {
2304
1752
  name: string;
2305
1753
  message: string;
2306
1754
  }
2307
- /** @experimental */
1755
+ /** @stable */
2308
1756
  interface DelegateHandlerOptions {
2309
1757
  /** The supervisor brain's router substrate (REQUIRED — the default supervisor is router-brained). */
2310
- router: RouterConfig;
1758
+ router: RouterTransportConfig;
1759
+ /** Exact executable supervisor identity selected by the trusted composition root. */
1760
+ supervisorProfile: AgentProfile$1;
2311
1761
  /** WHERE the authored workers run. Required for `supervise()` to spawn anything. */
2312
1762
  backend: ExecutorConfig;
2313
1763
  /** The completion oracle the authored workers settle against (settled ⟺ delivered). */
2314
1764
  deliverable?: DeliverableSpec;
2315
- /** Default supervisor brain model when a call omits `model`. */
2316
- model?: string;
2317
1765
  /** Restrict the run to this subset of models. */
2318
1766
  allowedModels?: readonly string[];
2319
1767
  }
@@ -2335,10 +1783,8 @@ interface McpServerOptions {
2335
1783
  */
2336
1784
  delegateSupervisor?: DelegateHandlerOptions;
2337
1785
  /**
2338
- * Required to enable delegate_ui_audit. Wire one that closes over your
2339
- * `runAgentRounds` + `uiAuditorProfile` + a `SandboxClient` (the
2340
- * canonical in-process choice is `createInProcessUiAuditClient` from
2341
- * `@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.
2342
1788
  */
2343
1789
  uiAuditorDelegate?: UiAuditorDelegate;
2344
1790
  /** Override the default in-memory feedback store. */
@@ -2528,6 +1974,23 @@ interface AnalyzeOnSettleRoute {
2528
1974
  }
2529
1975
  /** Normalize the two spellings of an analyst-on-settle entry to the route form. */
2530
1976
  declare function normalizeAnalyzeOnSettle(entry: string | AnalyzeOnSettleRoute): AnalyzeOnSettleRoute;
1977
+ /** How a spawn CONTINUES a node's prior work: `'fresh'` starts a brand-new session (the default,
1978
+ * and the only pre-continuity behavior); `'resume'` re-attaches to the node's most recent
1979
+ * SETTLED worker — a NEW live worker is spawned whose spawn context carries the prior worker's
1980
+ * identity ({@link WorkerResumeContext}), and the executor seam owns the actual session
1981
+ * re-attachment. */
1982
+ type ContinuityMode = 'fresh' | 'resume';
1983
+ /** The resume lineage a `'resume'` spawn hands the executor seam
1984
+ * ({@link WorkerSpawnContext.resume}). The kernel owns identity, ordering, ledger truth, and
1985
+ * spend continuity (the resumed worker reserves from the same conserved pool); the seam owns the
1986
+ * re-attachment itself — e.g. mapping `ofWorker` to a backend session id. */
1987
+ interface WorkerResumeContext {
1988
+ /** The prior SETTLED worker whose session the new worker continues. */
1989
+ readonly ofWorker: string;
1990
+ /** 1-based position of the NEW worker in the node's continuity chain: a node spawned once and
1991
+ * resumed once hands the resumed worker `sequence: 2`. */
1992
+ readonly sequence: number;
1993
+ }
2531
1994
  /** The exact result of one parent→child delivery attempt. */
2532
1995
  type DownMessageDeliveryOutcome = 'delivered' | 'unknown-worker' | 'already-settled' | 'runtime-has-no-inbox' | 'scope-stopped' | 'runtime-error';
2533
1996
  /** A durable marker written after authorization and immediately before Runtime calls `Scope.send`.
@@ -2635,6 +2098,13 @@ interface WorkerSpawnContext {
2635
2098
  * runtime, never accepted from a driver's tool arguments. A node-pinning `makeWorkerAgent`
2636
2099
  * reads it to admit the analyst node it would refuse as a driver-authored spawn. */
2637
2100
  readonly analyst?: string;
2101
+ /** The EFFECTIVE continuity mode of this spawn — the spawn tool's per-call argument when given,
2102
+ * else the profile name's declared default ({@link CoordinationToolsOptions.continuityByProfile}),
2103
+ * else `'fresh'`. Absent only from producers that predate continuity — read absence as
2104
+ * `'fresh'`. */
2105
+ readonly continuity?: ContinuityMode;
2106
+ /** Present iff `continuity === 'resume'`: the lineage the executor seam re-attaches with. */
2107
+ readonly resume?: WorkerResumeContext;
2638
2108
  }
2639
2109
  type MakeWorkerAgent = (profile: AgentProfile$1, context?: WorkerSpawnContext) => Agent<unknown, unknown>;
2640
2110
  interface CoordinationToolsOptions {
@@ -2713,6 +2183,17 @@ interface CoordinationToolsOptions {
2713
2183
  * Omit/empty = fresh ledger (every run that is not a resume).
2714
2184
  */
2715
2185
  readonly priorQuestions?: ReadonlyArray<QuestionRecord>;
2186
+ /**
2187
+ * Default continuity per PROFILE NAME (the stable node identity a graph pins). A name mapping
2188
+ * to `'resume'` makes its spawns re-attach to the node's most recent settled worker whenever
2189
+ * one exists — the node's FIRST spawn is effectively `'fresh'`, and a spawn while a prior
2190
+ * worker of the node is still LIVE fails closed (`resume-while-live`; steer is the live-worker
2191
+ * channel). The spawn tool's per-call `continuity` argument overrides the declared default in
2192
+ * either direction. Omit = every spawn is `'fresh'` (status quo). Resume lineage is
2193
+ * PROCESS-LOCAL (the same boundary as the analyst-run marker): workers settled by a prior
2194
+ * process of a durable run are not resume targets.
2195
+ */
2196
+ readonly continuityByProfile?: Readonly<Record<string, ContinuityMode>>;
2716
2197
  }
2717
2198
  /** Online-detector wiring for spawned workers (`CoordinationToolsOptions.watchWorkers`). */
2718
2199
  interface WorkerWatchOptions {
@@ -2910,10 +2391,10 @@ interface AuditIntentInput {
2910
2391
  runId?: string;
2911
2392
  }
2912
2393
  interface AuditIntentOptions {
2913
- chat: ChatClient;
2914
- model?: string;
2915
- /** Override the auditor instruction (optimizable like any analyst prompt). */
2916
- auditorInstruction?: string;
2394
+ /** Exact auditor identity. */
2395
+ profile: AgentProfile$1;
2396
+ /** Execution substrate. All behavior comes from the profile. */
2397
+ executor: ExecutorConfig;
2917
2398
  /** Cap trace lines fed to the auditor. Default 80. */
2918
2399
  maxTraceLines?: number;
2919
2400
  signal?: AbortSignal;
@@ -3233,9 +2714,10 @@ interface LeaderboardSpec<TCase, TArtifact = string> {
3233
2714
  harnesses?: readonly HarnessType[];
3234
2715
  models?: readonly string[];
3235
2716
  };
3236
- /** Base profile the axes expand over (prompt/tools/skills held fixed).
3237
- * Default: a minimal `{ name, model: { default: <first model> } }`. */
3238
- 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;
3239
2721
  /**
3240
2722
  * Execution-backend registry: `--backend <name>` picks the factory that
3241
2723
  * yields the `SandboxClient` every cell runs on. Merged over the defaults:
@@ -3248,10 +2730,6 @@ interface LeaderboardSpec<TCase, TArtifact = string> {
3248
2730
  backends?: Record<string, (() => SandboxClient) | undefined>;
3249
2731
  /** Extra `--flag value` CLI args `run()` parses and surfaces via `ctx.args`. */
3250
2732
  flags?: Record<string, LeaderboardFlagSpec>;
3251
- /** Extra fields merged into each cell's `backend.model` create override —
3252
- * e.g. `{ provider: 'openai-compat', apiKey, baseUrl }` for a router-backed
3253
- * sandbox. The cell's bare model id is set by the facade from the axis. */
3254
- modelBackend?: Record<string, unknown>;
3255
2733
  /** Runs once before the matrix (fetch fixtures, warm caches). */
3256
2734
  setup?: (ctx: LeaderboardRunContext) => Promise<void> | void;
3257
2735
  /** Runs once after the matrix, even on failure (reap boxes, close handles). */
@@ -3269,13 +2747,10 @@ interface LeaderboardSpec<TCase, TArtifact = string> {
3269
2747
  * this (or a LEVEL-2 `dispatch`). */
3270
2748
  parseOutput?: (events: readonly SandboxEvent[], c: TCase) => TArtifact;
3271
2749
  /**
3272
- * Resolve the model the backend ACTUALLY served off a shot's raw events.
3273
- * Required for HARNESS_NATIVE_MODEL-snapped cells (a vendor-locked harness ×
3274
- * an out-of-family model expands to the `default` sentinel): the RunRecord
3275
- * must pin a real snapshot-bearing model id, which only the dispatch —
3276
- * reading the backend's usage/terminal events — can know. When this returns
3277
- * a value the default dispatch records it on the paid-call receipt;
3278
- * 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.
3279
2754
  */
3280
2755
  resolveModel?: (events: readonly SandboxEvent[]) => string | undefined;
3281
2756
  /** Result export. Default: write `matrix-result.json` under the run dir and
@@ -4050,9 +3525,10 @@ interface ObserveInput {
4050
3525
  runId?: string;
4051
3526
  }
4052
3527
  interface ObserveOptions {
4053
- /** The model-call seam (agent-eval `createChatClient`: router / cli-bridge / …). */
4054
- chat: ChatClient;
4055
- model?: string;
3528
+ /** Exact analyst identity. */
3529
+ profile: AgentProfile$1;
3530
+ /** Execution substrate. All behavior comes from the profile. */
3531
+ executor: ExecutorConfig;
4056
3532
  /** When set, learned facts are appended (idempotent) for the next run to read. */
4057
3533
  corpus?: Corpus;
4058
3534
  /** Tags written onto learned facts + used by the next run's corpus query. */
@@ -4060,12 +3536,6 @@ interface ObserveOptions {
4060
3536
  signal?: AbortSignal;
4061
3537
  /** Cap the trace lines fed to the observer (keeps the call cheap). Default 80. */
4062
3538
  maxTraceLines?: number;
4063
- /** Override the analyst's system instruction — the prompt that turns a trace into
4064
- * findings + recommended_actions. The analyst IS the steerer, so this is the knob a
4065
- * prompt optimizer (GEPA) tunes. Omitted ⇒ the default observer instruction. The
4066
- * firewall (trace-only, never the verdict) is structural (input has no score), so a
4067
- * custom instruction cannot break it. */
4068
- analystInstruction?: string;
4069
3539
  }
4070
3540
  /** The default observer instruction — exported so an optimizer can seed its population. */
4071
3541
  declare const defaultAnalystInstruction: string;
@@ -4075,6 +3545,12 @@ interface Observation {
4075
3545
  learned: CorpusRecord[];
4076
3546
  /** Operator-facing markdown: what the observer noticed + what to change. */
4077
3547
  report: string;
3548
+ /** Measured model usage for this analysis turn. */
3549
+ usage: {
3550
+ input: number;
3551
+ output: number;
3552
+ known: boolean;
3553
+ };
4078
3554
  }
4079
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. */
4080
3556
  declare function observe(input: ObserveInput, opts: ObserveOptions): Promise<Observation>;
@@ -4086,15 +3562,14 @@ declare function renderReport(findings: ReadonlyArray<AnalystFinding>): string;
4086
3562
  interface HarvestCorpusOptions {
4087
3563
  /** The completed runs to analyze — map your store's rows to `ObserveInput`. */
4088
3564
  runs: AsyncIterable<ObserveInput> | Iterable<ObserveInput>;
4089
- /** The model-call seam (agent-eval `createChatClient`). */
4090
- chat: ChatClient;
4091
- model?: string;
3565
+ /** Exact analyst identity. */
3566
+ profile: AgentProfile$1;
3567
+ /** Execution substrate. All behavior comes from the profile. */
3568
+ executor: ExecutorConfig;
4092
3569
  /** The durable corpus the facts accrete into. */
4093
3570
  corpus: Corpus;
4094
3571
  /** Tags written onto learned facts (the product/domain key the read side queries by). */
4095
3572
  tags?: ReadonlyArray<string>;
4096
- /** Override the analyst instruction (the GEPA-tunable knob). */
4097
- analystInstruction?: string;
4098
3573
  /** Runs analyzed in parallel. Default 4. */
4099
3574
  concurrency?: number;
4100
3575
  /** Hard cap on runs consumed from the stream (a cost guard for unbounded stores). */
@@ -4177,7 +3652,9 @@ declare function inProcessSandboxClient(options: InProcessSandboxClientOptions):
4177
3652
  * instantiated fresh per `streamPrompt` (mirrors the per-spawn executor lifecycle):
4178
3653
  * run once on the prompt, emit the terminal result event, tear down.
4179
3654
  */
4180
- declare function inlineSandboxClient(factory: ExecutorFactory<unknown>): SandboxClient;
3655
+ declare function inlineSandboxClient(factory: ExecutorFactory<unknown>, defaults?: {
3656
+ profile?: AgentProfile$1;
3657
+ }): SandboxClient;
4181
3658
  //#endregion
4182
3659
  //#region src/runtime/key-provider.d.ts
4183
3660
  /** Resolve named secrets. The ONE seam every secret store adapts to. */
@@ -4231,16 +3708,11 @@ declare function resolveMcpServerLaunch(server: AgentProfileMcpServer, keys: Key
4231
3708
  //#endregion
4232
3709
  //#region src/runtime/local-sandbox-client.d.ts
4233
3710
  interface LocalSandboxClientOptions {
4234
- /** 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. */
4235
3712
  router: {
4236
3713
  baseUrl: string;
4237
3714
  key: string;
4238
- model: string;
4239
3715
  };
4240
- /** Tool-loop turns per prompt. Default 8. */
4241
- maxTurns?: number;
4242
- /** Brain sampling temperature. Default: `routerBrain`'s (0.4). */
4243
- temperature?: number;
4244
3716
  /** Fallback profile when `create(options)` carries none on `backend.profile`. */
4245
3717
  profile?: AgentProfile$1;
4246
3718
  /** Resolves profile-declared MCP secret names at child-process spawn time. */
@@ -4255,7 +3727,7 @@ interface LocalSandboxClientOptions {
4255
3727
  declare function localSandboxClient(opts: LocalSandboxClientOptions): SandboxClient;
4256
3728
  //#endregion
4257
3729
  //#region src/runtime/run-loop.d.ts
4258
- /** @experimental */
3730
+ /** @stable */
4259
3731
  interface RunAgentRoundsOptions<Task, Output, Decision> {
4260
3732
  driver: Driver<Task, Output, Decision>;
4261
3733
  /**
@@ -4331,26 +3803,9 @@ interface RunAgentRoundsOptions<Task, Output, Decision> {
4331
3803
  * folding the results back in until the model stops calling tools. No sandboxes, no
4332
3804
  * rounds, no winner selection.
4333
3805
  *
4334
- * @experimental
3806
+ * @stable
4335
3807
  */
4336
3808
  declare function runAgentRounds<Task, Output, Decision>(options: RunAgentRoundsOptions<Task, Output, Decision>): Promise<LoopResult<Task, Output, Decision>>;
4337
- /**
4338
- * Pre-rename name for {@link runAgentRounds}; identical function, kept so existing
4339
- * call sites keep working.
4340
- *
4341
- * @deprecated Use {@link runAgentRounds}. The clearer name says what it is: the
4342
- * multi-agent fanout/vote/refine kernel over sandboxes, NOT the one-turn tool loop
4343
- * (`runToolLoop` / `streamToolLoop`, `/tool-loop`). `runLoop` shipped on `/kernel`
4344
- * next to `routerToolLoop`, which made the two read as variants of one thing. The alias
4345
- * is removed in the next major.
4346
- */
4347
- declare const runLoop: typeof runAgentRounds;
4348
- /**
4349
- * Pre-rename name for {@link RunAgentRoundsOptions}.
4350
- *
4351
- * @deprecated Use {@link RunAgentRoundsOptions}. Removed in the next major.
4352
- */
4353
- type RunLoopOptions<Task, Output, Decision> = RunAgentRoundsOptions<Task, Output, Decision>;
4354
3809
  /**
4355
3810
  * The kernel's winner argmax — best-valid-score, ties broken by earliest index,
4356
3811
  * falling back to the best-scoring non-errored output when none is valid. Exported
@@ -4419,7 +3874,6 @@ declare function loopDispatch<Task, Output, Decision, TScenario extends Scenario
4419
3874
  //#region src/runtime/strategy.d.ts
4420
3875
  interface AgenticTask {
4421
3876
  readonly id: string;
4422
- readonly systemPrompt: string;
4423
3877
  readonly userPrompt: string;
4424
3878
  /** Opaque domain payload the surface reads (EOPS: servers/verifiers/tools). Drivers never read it. */
4425
3879
  readonly meta?: Record<string, unknown>;
@@ -4456,25 +3910,16 @@ interface AgenticSurface {
4456
3910
  interface AgenticOptions {
4457
3911
  routerBaseUrl: string;
4458
3912
  routerKey: string;
4459
- model: string;
3913
+ /** Exact worker identity. Model and standing instructions are read only from this profile. */
3914
+ workerProfile: AgentProfile$1;
4460
3915
  /** Optional completion transport (see `RouterConfig.complete`): when set, BOTH legs of an
4461
3916
  * offline run use it instead of `fetch`-ing the router — the worker's tool loop (threaded into
4462
3917
  * its `routerToolLoop` cfg) AND the analyst's critic (its `ChatClient` is bound to this same
4463
3918
  * transport). One injected responder serves both, as a localhost mock endpoint would. Absent ⇒
4464
3919
  * the live router fetch path (the default). */
4465
3920
  complete?: (body: Record<string, unknown>) => Promise<unknown>;
4466
- temperature?: number;
4467
- /** Completion cap per worker turn — REQUIRED for thinking models (they burn unbounded
4468
- * budgets on reasoning and return empty content without it). Omitted ⇒ provider default. */
4469
- maxTokens?: number;
4470
- /** Turns the agent may take within ONE shot before the driver intervenes. */
4471
- innerTurns?: number;
4472
- /** The depth STEERER's analyst instruction (observe()'s system prompt). The knob a
4473
- * prompt optimizer (GEPA) tunes — the analyst IS the steerer. Omitted ⇒ the default. */
4474
- analystInstruction?: string;
4475
- /** The critic's model — lets the analyst be a stronger (or cheaper) model than the
4476
- * worker. Omitted ⇒ the worker's `model`. */
4477
- analystModel?: string;
3921
+ /** Exact critic identity. Omitted means the exact worker profile also runs the critic. */
3922
+ analystProfile?: AgentProfile$1;
4478
3923
  /** Across-run learning: when set, the analyst's observe() pass appends trace-derived
4479
3924
  * facts here (the flywheel write side). Read-back is opt-in via `corpusReadback`
4480
3925
  * because unconditional priming can pollute context on some domains. */
@@ -4515,14 +3960,15 @@ interface AgenticRunResult {
4515
3960
  /** DEPTH: score after each shot — the progress-over-rounds curve. BREADTH: best-so-far per rollout. */
4516
3961
  progression: number[];
4517
3962
  shots: number;
4518
- /** The cost vector, stamped by `runAgentic` from the Supervisor's conserved pool: real
4519
- * 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. */
4520
3964
  usd: number;
3965
+ usdKnown: boolean;
4521
3966
  ms: number;
4522
3967
  tokens: {
4523
3968
  input: number;
4524
3969
  output: number;
4525
3970
  };
3971
+ tokensKnown: boolean;
4526
3972
  }
4527
3973
  /** DEPTH: one persistent artifact, carried across analyst-steered shots. */
4528
3974
  declare function depthStrategy(surface: AgenticSurface, task: AgenticTask, opts: AgenticOptions, cfg: {
@@ -4553,21 +3999,13 @@ interface Strategy<Result extends StrategyResult = StrategyResult> {
4553
3999
  declare const sample: Strategy;
4554
4000
  /** Built-in `Strategy`: attempt → `observe()` reads the trace → steer the next attempt → repeat (deepen one lineage). */
4555
4001
  declare const refine: Strategy;
4556
- /** A role for one shot — multi-agent loops (researcher + engineer, a panel of k
4557
- * researchers) give each shot its own system prompt and optionally its own model. */
4558
- interface ShotPersona {
4559
- /** Replaces the task's systemPrompt for a FRESH shot; on a carried conversation it is
4560
- * injected as a hand-off message (the transcript's earlier roles stay intact). */
4561
- systemPrompt?: string;
4562
- /** Per-shot model override (e.g. a stronger model for the engineer shot). */
4563
- model?: string;
4564
- }
4565
4002
  interface ShotSpec {
4566
4003
  /** present ⇒ continue this artifact (depth); absent ⇒ the shot opens a fresh one (sample/restart). */
4567
4004
  handle?: ArtifactHandle;
4568
4005
  messages?: StrategyMessage[];
4569
4006
  steer?: string;
4570
- persona?: ShotPersona;
4007
+ /** Exact profile for this shot. Omitted means `AgenticOptions.workerProfile`. */
4008
+ profile?: AgentProfile$1;
4571
4009
  /** Restrict THIS shot to a subset of the domain's tools (by name) — focus a shot on
4572
4010
  * the relevant capabilities. Restriction-only; unknown names throw. Omitted ⇒ all. */
4573
4011
  tools?: string[];
@@ -4702,11 +4140,13 @@ interface BenchmarkCell {
4702
4140
  /** The progress curve (refine: score per shot; sample: best-so-far per rollout). */
4703
4141
  progression: number[];
4704
4142
  usd: number;
4143
+ usdKnown: boolean;
4705
4144
  ms: number;
4706
4145
  tokens: {
4707
4146
  input: number;
4708
4147
  output: number;
4709
4148
  };
4149
+ tokensKnown: boolean;
4710
4150
  }
4711
4151
  interface BenchmarkTaskRow {
4712
4152
  taskId: string;
@@ -4726,6 +4166,8 @@ interface BenchmarkStrategySummary {
4726
4166
  resolved: number;
4727
4167
  /** Mean cost vector per task. */
4728
4168
  usd: number;
4169
+ /** Fraction of task cells whose billed-dollar total was complete. */
4170
+ usdKnownRate: number;
4729
4171
  ms: number;
4730
4172
  }
4731
4173
  /** Benchmark output: per-strategy means plus the full per-task × per-strategy losses table an optimizer mines. */
@@ -4875,6 +4317,8 @@ declare function selectValidWinner<D>(opts?: {
4875
4317
  * pool would not admit, or a stage whose `collect` chose to block) short-circuits — its blockers
4876
4318
  * ARE the pipeline's blockers, never coerced past a failed stage. The terminal stage's `done`
4877
4319
  * deliverable is the pipeline's deliverable.
4320
+ *
4321
+ * @stable
4878
4322
  */
4879
4323
  declare function pipeline<Task, D>(stages: ReadonlyArray<PipelineStage<Task, unknown, unknown>>): CombinatorShape<Task, D>;
4880
4324
  /**
@@ -4887,6 +4331,8 @@ declare function pipeline<Task, D>(stages: ReadonlyArray<PipelineStage<Task, unk
4887
4331
  * `opts.width` swaps the single round for `rollingDispatch`: at most `width` items live at once,
4888
4332
  * refilled the instant one settles. Selection, blockers, and the conserved pool are unchanged —
4889
4333
  * the refill behavior lives in the existing combinator rather than in a rival primitive.
4334
+ *
4335
+ * @stable
4890
4336
  */
4891
4337
  declare function fanout<Task, Item, D>(items: ReadonlyArray<Item>, opts: FanoutOptions<Item, D>): CombinatorShape<Task, D>;
4892
4338
  /**
@@ -4899,6 +4345,8 @@ declare function fanout<Task, Item, D>(items: ReadonlyArray<Item>, opts: FanoutO
4899
4345
  * `until` on the resulting trace-derived findings (the analyst spawns into THIS scope, so its
4900
4346
  * compute is conserved-pooled — equal-k holds by construction). Absent an analyst the findings
4901
4347
  * argument is the empty array — never a fabricated finding (fail-loud honesty over a silent default).
4348
+ *
4349
+ * @stable
4902
4350
  */
4903
4351
  declare function loopUntil<Task, State, D>(seed: State, spec: LoopUntilSpec<Task, State, D>): CombinatorShape<Task, D>;
4904
4352
  /**
@@ -4907,6 +4355,8 @@ declare function loopUntil<Task, State, D>(seed: State, spec: LoopUntilSpec<Task
4907
4355
  * reaches another judge's task; the merge never spawns or re-ranks). A `down` judge carries no
4908
4356
  * verdict and is excluded from the merge denominator. A panel that admitted no judge is a
4909
4357
  * concrete blocker before `merge` is consulted.
4358
+ *
4359
+ * @stable
4910
4360
  */
4911
4361
  declare function panel<Task, Artifact, D>(spec: PanelSpec<Artifact, D>): CombinatorShape<Task, D>;
4912
4362
  /**
@@ -4914,6 +4364,8 @@ declare function panel<Task, Artifact, D>(spec: PanelSpec<Artifact, D>): Combina
4914
4364
  * it; only a `valid` verifier verdict ships. Any other outcome (implement down, verifier down,
4915
4365
  * verifier verdict absent or not `valid`) is a concrete blocker carrying the failure verbatim —
4916
4366
  * never a coerced "done". The implement child does not grade itself.
4367
+ *
4368
+ * @stable
4917
4369
  */
4918
4370
  declare function verify<Task, Candidate, D>(spec: VerifySpec<Task, Candidate, D>): CombinatorShape<Task, D>;
4919
4371
  /**
@@ -4932,6 +4384,8 @@ declare function verify<Task, Candidate, D>(spec: VerifySpec<Task, Candidate, D>
4932
4384
  * the widen loop sees it. The shipped default (`flatWidenGate`) never widens, so no widen child is
4933
4385
  * ever live when the analyst runs and the wire is exact; a non-flat gate must drive the analyst on
4934
4386
  * a scope whose siblings are quiesced, or read findings without the shared-cursor drain.
4387
+ *
4388
+ * @stable
4935
4389
  */
4936
4390
  declare function widen<Task, Seed, D>(spec: WidenSpec<Seed, D>): CombinatorShape<Task, D>;
4937
4391
  /**
@@ -4997,6 +4451,8 @@ declare function renderCorpusToInstructions(opts: RenderCorpusToInstructionsOpti
4997
4451
  * Build a frozen `Persona`. Fails loud on the executors-supplied invariant: a persona with
4998
4452
  * neither a pre-built registry nor a seam bag cannot resolve its built-in runtimes, so it is
4999
4453
  * unrunnable — refuse it at definition time, not at the first spawn. Pure; no I/O.
4454
+ *
4455
+ * @stable
5000
4456
  */
5001
4457
  declare function definePersona<D = unknown>(input: DefinePersonaInput<D>): Persona<D>;
5002
4458
  /**
@@ -5005,6 +4461,8 @@ declare function definePersona<D = unknown>(input: DefinePersonaInput<D>): Perso
5005
4461
  * `ShapeContext`, and runs the resulting root `Agent` to a typed `SupervisedResult<Outcome>`.
5006
4462
  * Fail loud on an unknown shape name or an unresolvable persona registry — never a silent
5007
4463
  * default-shape fallback.
4464
+ *
4465
+ * @stable
5008
4466
  */
5009
4467
  declare function runPersonified<Task, D>(options: RunPersonifiedOptions<Task, D>): Promise<SupervisedResult<Outcome<D>>>;
5010
4468
  //#endregion
@@ -5039,6 +4497,36 @@ declare function trajectoryReport(journal: SpawnJournal, blobs: ResultBlobStore,
5039
4497
  */
5040
4498
  declare function equalKOnCost(arms: ReadonlyArray<EqualKArm>, options?: EqualKOnCostOptions): EqualKVerdict;
5041
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
5042
4530
  //#region src/runtime/promotion-gate.d.ts
5043
4531
  interface PromotionGateOptions {
5044
4532
  /** The HOLDOUT report — must carry per-task cells for both strategy names. */
@@ -5106,21 +4594,18 @@ interface ResolveSandboxClientOptions {
5106
4594
  backend: 'sandbox' | 'bridge' | 'router' | 'local';
5107
4595
  /** `sandbox` backend: the caller's real Sandbox-backed client. Required for that backend. */
5108
4596
  sandboxClient?: SandboxClient;
5109
- /** `bridge` backend: local cli-bridge transport. `bearer` + `model` required. */
4597
+ /** `bridge` backend: local cli-bridge transport. The per-create profile owns the model. */
5110
4598
  bridge?: {
5111
4599
  /** cli-bridge base URL. Defaults to `http://127.0.0.1:3355`. */
5112
4600
  url?: string;
5113
4601
  bearer: string;
5114
- /** Bridge model id, doubling as the harness selector (e.g. `claude-code/sonnet`). */
5115
- model: string;
5116
4602
  /** Per-turn deadline (ms). */
5117
4603
  timeoutMs?: number;
5118
4604
  };
5119
- /** `router` backend: router chat-completion transport. All three fields required. */
4605
+ /** `router` backend: endpoint/auth only; the per-create profile owns behavior. */
5120
4606
  router?: {
5121
4607
  baseUrl: string;
5122
4608
  key: string;
5123
- model: string;
5124
4609
  };
5125
4610
  /** `local` backend: same-host pseudo-box — the router brain drives a tool loop
5126
4611
  * with the profile's stdio MCP servers spawned as local children. */
@@ -5225,7 +4710,10 @@ declare function extractLlmCallEvent(event: SandboxEvent, agentRunName: string):
5225
4710
  * receipt: (turn) => {
5226
4711
  * const u = sumSandboxUsage(turn.events)
5227
4712
  * return { model, inputTokens: u.input, outputTokens: u.output,
5228
- * ...(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 } : {}) }
5229
4717
  * }
5230
4718
  *
5231
4719
  * Without this a cell reads `{tokens:0, cost:0}` and the backend-integrity guard correctly aborts the
@@ -5235,6 +4723,9 @@ declare function sumSandboxUsage(events: readonly SandboxEvent[], agentRunName?:
5235
4723
  input: number;
5236
4724
  output: number;
5237
4725
  costUsd: number;
4726
+ tokensKnown?: false;
4727
+ usdKnown?: false;
4728
+ estimatedCostUsd?: number;
5238
4729
  };
5239
4730
  /**
5240
4731
  * Cross-event state for {@link mapSandboxToolEvent}. Sandbox backends emit a
@@ -5621,14 +5112,15 @@ declare function materializeLocalMcp(profile: AgentProfile$1, opts?: Materialize
5621
5112
  /** The compressed consumable a skill carries: everything an author needs to emit a loop. */
5622
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";
5623
5114
  interface AuthorStrategyOptions {
5624
- /** The model-call seam (agent-eval `createChatClient`). */
5625
- chat: ChatClient;
5626
- model?: string;
5627
- /** 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
5628
5120
  * block (thinking models time out at the edge on long authoring prompts, or return
5629
5121
  * empty content without `maxTokens`). Opt-in — absent means the primary's failure
5630
5122
  * propagates. */
5631
- fallbackModel?: string;
5123
+ fallbackProfile?: AgentProfile$1;
5632
5124
  /** The contract text shown to the author. Default `strategyAuthorContract`. The
5633
5125
  * meta-optimization coordinate: a GEPA/skill loop can evolve this text and gate each
5634
5126
  * variant on the same frozen holdout as any strategy. */
@@ -5641,11 +5133,10 @@ interface AuthorStrategyOptions {
5641
5133
  budget: number;
5642
5134
  /** Where the authored module file is written (created if missing). */
5643
5135
  outDir: string;
5644
- temperature?: number;
5645
- /** Completion cap — required by thinking-model authors that stream reasoning first. */
5646
- maxTokens?: number;
5647
5136
  signal?: AbortSignal;
5648
5137
  }
5138
+ /** Standing behavior callers put in the strategy-author AgentProfile. */
5139
+ declare const strategyAuthorSystemPrompt: string;
5649
5140
  /** Static CONTRACT lint over an authored strategy module — the module-boundary
5650
5141
  * enforcement of the harness's two measurement invariants:
5651
5142
  * - author blindness: the only import allowed is the kernel surface. A body that could
@@ -5668,12 +5159,12 @@ declare function authorStrategy(opts: AuthorStrategyOptions): Promise<AuthoredSt
5668
5159
  //#endregion
5669
5160
  //#region src/runtime/strategy-evolution.d.ts
5670
5161
  interface EvolutionAuthor {
5671
- /** The model-call seam (agent-eval `createChatClient`). */
5672
- chat: ChatClient;
5673
- model?: string;
5674
- fallbackModel?: string;
5675
- temperature?: number;
5676
- 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;
5677
5168
  }
5678
5169
  type ChampionPolicy = 'score' | 'costAware';
5679
5170
  interface StrategyEvolutionConfig {
@@ -5869,125 +5360,6 @@ declare function selectChampion(report: BenchmarkReport, fieldOrder: string[], p
5869
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. */
5870
5361
  declare function runStrategyEvolution(cfg: StrategyEvolutionConfig): Promise<EvolutionReport>;
5871
5362
  //#endregion
5872
- //#region src/runtime/stream-agent-turn.d.ts
5873
- /**
5874
- * The execution substrate one turn runs on — a closed discriminated union over
5875
- * the three stream surfaces the runtime already owns.
5876
- *
5877
- * @experimental
5878
- */
5879
- type AgentTurnBackend = {
5880
- /** A live sandbox box: the turn is one `box.streamPrompt(prompt)` call. */
5881
- kind: 'box';
5882
- box: SandboxInstance;
5883
- /**
5884
- * Per-turn `PromptOptions` forwarded verbatim to `streamPrompt`
5885
- * (`sessionId`, `turnId`, `model`, `backend` profile, `timeoutMs`, …).
5886
- * The turn's derived abort signal (caller `signal` + `timeoutMs`
5887
- * deadline) is always installed as `signal` — pass cancellation through
5888
- * `StreamAgentTurnOptions`, not here.
5889
- */
5890
- options?: Omit<PromptOptions, 'signal'>;
5891
- /** Model label stamped on cost-only `llm_call` events. Default `'agent'`. */
5892
- agentRunName?: string;
5893
- } | {
5894
- /**
5895
- * A one-shot `Executor` (cli-bridge / router / BYO): the factory is
5896
- * instantiated fresh for the turn via `inlineSandboxClient`, run once on
5897
- * the prompt, and torn down — the same per-spawn lifecycle the supervise
5898
- * runtime gives it.
5899
- */
5900
- kind: 'executor';
5901
- factory: ExecutorFactory<unknown>;
5902
- /** Model label stamped on cost-only `llm_call` events. Default `'agent'`. */
5903
- agentRunName?: string;
5904
- } | {
5905
- /**
5906
- * An in-process `AgentExecutionBackend` (`resolveAgentBackend` output or
5907
- * any custom backend): the turn is one `backend.stream()` call.
5908
- */
5909
- kind: 'chat';
5910
- backend: AgentExecutionBackend;
5911
- };
5912
- /** @experimental */
5913
- interface StreamAgentTurnOptions {
5914
- /** Caller-initiated cancellation. Terminates the stream with `final.status: 'aborted'`. */
5915
- signal?: AbortSignal;
5916
- /**
5917
- * Wall-clock deadline for the whole turn in ms. An expired deadline aborts
5918
- * the backend and terminates the stream with `final.status: 'failed'`
5919
- * (a blown deadline is a turn failure, not a caller cancellation).
5920
- */
5921
- timeoutMs?: number;
5922
- /**
5923
- * Opt-in tool-part projection for box and executor backends: sandbox tool
5924
- * parts additionally surface in-stream as
5925
- * `tool_call` / `tool_result` events (`mapSandboxToolEvent`), so a consumer
5926
- * rendering tool activity needs no bespoke sandbox-event parser. Default
5927
- * off — the stream vocabulary existing consumers see is unchanged. No-op
5928
- * for the `chat` kind (its backend emits `RuntimeStreamEvent`s directly,
5929
- * tool events included when the backend produces them).
5930
- */
5931
- preserveToolParts?: boolean;
5932
- /**
5933
- * Raw-event tap for box-kind backends: called (and awaited) with every
5934
- * unmapped `SandboxEvent` BEFORE it is projected, so a consumer can read
5935
- * parts the chat-UX projection drops (part ids, step markers, custom
5936
- * backend events) without forking the mapper. Purely observational — it
5937
- * cannot alter the mapped stream. Never called for the `chat` kind, which
5938
- * has no sandbox events.
5939
- */
5940
- onRawEvent?: (event: SandboxEvent) => void | Promise<void>;
5941
- }
5942
- /**
5943
- * Metered usage of one turn, summed over every cost-bearing event the backend
5944
- * emitted. `input`/`output` are token counts (0 when the backend reported
5945
- * none — the honest sum, never a fabricated estimate). `costUsd`/`model` are
5946
- * present only when the backend actually reported them.
5947
- *
5948
- * @experimental
5949
- */
5950
- interface AgentTurnUsage {
5951
- input: number;
5952
- output: number;
5953
- costUsd?: number;
5954
- model?: string;
5955
- }
5956
- /**
5957
- * A drained turn: the terminal summary plus every event the stream yielded.
5958
- * `status`/`error` mirror the terminal `final` event so a failed or aborted
5959
- * turn stays inspectable without re-scanning `events`.
5960
- *
5961
- * @experimental
5962
- */
5963
- interface CollectedAgentTurn {
5964
- finalText: string;
5965
- usage: AgentTurnUsage;
5966
- events: RuntimeStreamEvent[];
5967
- status: AgentTaskStatus;
5968
- error?: BackendErrorDetail;
5969
- }
5970
- /**
5971
- * Run ONE agent turn on any backend kind and stream its events. Yields the
5972
- * `RuntimeStreamEvent` vocabulary incrementally and always ends with a `final`
5973
- * event carrying the turn's text and usage (`metadata.tokenUsage`,
5974
- * `metadata.costUsd?`, `metadata.model?`) — on success, failure, abort, and
5975
- * timeout alike. The generator never throws; failures surface in-band as
5976
- * `backend_error` + `final` with a typed `error` detail.
5977
- *
5978
- * @experimental
5979
- */
5980
- declare function streamAgentTurn(backend: AgentTurnBackend, prompt: string, opts?: StreamAgentTurnOptions): AsyncGenerator<RuntimeStreamEvent>;
5981
- /**
5982
- * Drain a `streamAgentTurn` stream (or any `RuntimeStreamEvent` stream that
5983
- * honors its terminal contract) into the turn summary plus the full event
5984
- * list. Fail-loud: throws when the stream ends without a terminal `final`
5985
- * event — a stream that violates the contract must not read as an empty turn.
5986
- *
5987
- * @experimental
5988
- */
5989
- declare function collectAgentTurn(stream: AsyncIterable<RuntimeStreamEvent>): Promise<CollectedAgentTurn>;
5990
- //#endregion
5991
5363
  //#region src/runtime/structural-rollout.d.ts
5992
5364
  /** Provider-neutral conversation records read by structural candidate extraction. */
5993
5365
  type StructuralRolloutMessage = Record<string, unknown>;
@@ -6005,8 +5377,6 @@ interface StructuralRolloutPolicy {
6005
5377
  /** Per-slot strategy-lens prefixes on the k samples (attacks the all-k-fail bucket).
6006
5378
  * Measured as a paired null (+0.6pp) — kept as an optional knob, off by default. */
6007
5379
  diverse?: boolean;
6008
- /** Sampling temperature for every shot of this strategy; omitted ⇒ the worker default. */
6009
- temperature?: number;
6010
5380
  }
6011
5381
  /** The measured default recipe: 5 samples, 2 guarded repair rounds, 6 authored checks. */
6012
5382
  declare const defaultStructuralRolloutPolicy: StructuralRolloutPolicy;
@@ -6177,22 +5547,6 @@ type AuthoredProfile = AgentProfile$1 & {
6177
5547
  /** Narrow an untyped `spawn_agent` profile argument to an `AuthoredProfile`, or null if the
6178
5548
  * supervisor failed to author one (empty/placeholder profile — a skill violation worth catching). */
6179
5549
  declare function asAuthoredProfile(raw: unknown): AuthoredProfile | null;
6180
- /**
6181
- * Lift a profile the supervisor AUTHORED into the canonical shape every executor reads.
6182
- *
6183
- * The skill asks for `systemPrompt` and `model` as flat fields — the vocabulary a model writes
6184
- * well — while `AgentProfile` carries them as `prompt.systemPrompt` and `model.default`. Nothing
6185
- * downstream reads the flat form: the router and cli-bridge leaves read `profile.prompt
6186
- * .systemPrompt`, and the sandbox leaf hands the profile to a strict schema that REJECTS the flat
6187
- * key outright (`Unrecognized key: "systemPrompt"`), which fails the worker's every round. Lift
6188
- * both here, once, so what the supervisor writes is what the worker runs.
6189
- *
6190
- * Purely additive: a profile already canonical is returned untouched, and a flat field is dropped
6191
- * only after its canonical slot is filled. Both spellings of the same standing instruction, set to
6192
- * DIFFERENT text, is a contradiction with no safe reading — it fails loud, matching
6193
- * `resolveSupervisorProfile`'s rule for the supervisor's own profile.
6194
- */
6195
- declare function canonicalizeAuthoredProfile(raw: unknown): AgentProfile$1;
6196
5550
  /** The supervisor SKILL — the how-to the supervisor reads (its system prompt). THE optimizable
6197
5551
  * surface: editing this changes how the supervisor designs every agent it spawns.
6198
5552
  *
@@ -6203,14 +5557,6 @@ declare function canonicalizeAuthoredProfile(raw: unknown): AgentProfile$1;
6203
5557
  declare function supervisorInstructions(opts?: {
6204
5558
  goal?: string;
6205
5559
  }): string;
6206
- /** Build a router-only worker from an authored profile. This helper executes the prompt/model axes;
6207
- * use `workerFromBackend` for full materialization of tools, MCP, resources, hooks, and subagents. */
6208
- declare function authoredWorker(profile: AuthoredProfile, opts: {
6209
- cfg: RouterConfig;
6210
- taskPrompt: string;
6211
- deliverable: DeliverableSpec;
6212
- temperature?: number;
6213
- }): Agent<unknown, unknown>;
6214
5560
  /** Thresholds below which a system prompt is treated as a thin stub. Tunable per call. */
6215
5561
  interface ProfileRichnessThresholds {
6216
5562
  /** A prompt shorter than this many characters is thin (default 600). */
@@ -6300,11 +5646,9 @@ type BudgetReadout = Readonly<{
6300
5646
  reservedTokens: number;
6301
5647
  }>;
6302
5648
  /** Why a reservation was refused. `budget-exhausted` means the pool ran out of a channel it
6303
- * budgets; `below-runtime-floor` means the request is under the amount that harness needs before
6304
- * it does any work at all, so it is unsatisfiable at that size and the fix is to RAISE it;
6305
- * `usd-unbudgeted` means the root declared no dollar ceiling, so a dollar request is
6306
- * unsatisfiable at any amount and the fix is to budget the root, not to ask for less. */
6307
- 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';
6308
5652
  /** State recovered from a prior process before new work is admitted. `committed` is measured spend
6309
5653
  * already present in the durable journal. Each `uncertainReservation` is a child that was recorded
6310
5654
  * as started but never recorded as settled: its full declared ceiling is charged conservatively,
@@ -6369,6 +5713,52 @@ declare function spendFromUsageEvents(events: UsageEvent[]): Spend;
6369
5713
  */
6370
5714
  declare function createBudgetPool(root: Budget, now?: () => number, restore?: BudgetPoolRestore): BudgetPool;
6371
5715
  //#endregion
5716
+ //#region src/runtime/supervise/chat-transport-executor.d.ts
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. */
5720
+ interface ChatSessionStore {
5721
+ load(workerId: string): ReadonlyArray<Readonly<Record<string, unknown>>> | undefined;
5722
+ save(workerId: string, messages: ReadonlyArray<Readonly<Record<string, unknown>>>): void;
5723
+ }
5724
+ /** In-memory, process-local conversation store with detached reads and writes. */
5725
+ declare function createChatSessionStore(): ChatSessionStore;
5726
+ /** One profile-authorized function tool and its host implementation. */
5727
+ interface ChatTransportTool {
5728
+ readonly spec: ToolSpec;
5729
+ readonly execute: (args: Record<string, unknown>, task: unknown) => Promise<string>;
5730
+ }
5731
+ /**
5732
+ * Transport and session data for one exact profile-driven conversation.
5733
+ * Behavioral controls belong only in `profile.model.metadata`.
5734
+ */
5735
+ interface ChatTransportExecutorOptions {
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;
5744
+ }
5745
+ /**
5746
+ * Build one exact profile-driven chat executor through `createExecutor`.
5747
+ * Prefer `chatWorkerSeam` for supervised work because it supplies trusted node identity.
5748
+ */
5749
+ declare function chatTransportExecutor(opts: ChatTransportExecutorOptions): Executor<string>;
5750
+ /** Transport/session configuration shared by every spawned exact profile. */
5751
+ interface ChatWorkerSeamOptions {
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>;
5758
+ }
5759
+ /** Session-owning worker factory for graph continuity. */
5760
+ declare function chatWorkerSeam(opts: ChatWorkerSeamOptions): MakeWorkerAgent;
5761
+ //#endregion
6372
5762
  //#region src/runtime/supervise/coordination-log.d.ts
6373
5763
  /** Stable identity of the supervisor that owns one coordination stream. High-level supervision
6374
5764
  * derives it from the exact root/child execution identity plus its parent assignment. */
@@ -6635,6 +6025,9 @@ interface DriverAgentOptions {
6635
6025
  * (the canonical `ToolLoopChat`): a scripted mock offline, the router's tool-calling in
6636
6026
  * production, or a sandboxed harness. The same seam every tool-loop uses; no bespoke shape. */
6637
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;
6638
6031
  /** Shared blob store — `observe_agent` reads settled outputs through it. */
6639
6032
  readonly blobs: ResultBlobStore;
6640
6033
  /** Resolve a spawned `profile` to a worker LEAF or a driver child (the recursion seam). */
@@ -6662,6 +6055,11 @@ interface DriverAgentOptions {
6662
6055
  /** Idle time after which `observe_agent` reports a worker as stalled (a derived read; nothing is
6663
6056
  * killed). Omit = the runtime default. */
6664
6057
  readonly stallAfterMs?: number;
6058
+ /** Default continuity per worker PROFILE NAME — `'resume'` makes spawns of that name re-attach
6059
+ * to the node's latest settled worker (see
6060
+ * `CoordinationToolsOptions.continuityByProfile`); `spawn_agent`'s per-call `continuity`
6061
+ * argument overrides. Omit = every spawn fresh (status quo). */
6062
+ readonly continuityByProfile?: Readonly<Record<string, ContinuityMode>>;
6665
6063
  /** The driver's stance — a string, or built from the task (the worker-driver prompt /
6666
6064
  * the generator). INJECTED so the prompt is a pluggable, optimizable role. */
6667
6065
  readonly systemPrompt: string | ((task: unknown) => string);
@@ -6808,6 +6206,9 @@ declare function serveCoordinationMcp(opts: {
6808
6206
  watchWorkers?: WorkerWatchOptions;
6809
6207
  /** Idle time after which `observe_agent` reports a worker as stalled. */
6810
6208
  stallAfterMs?: number;
6209
+ /** Default continuity per worker profile name — `'resume'` re-attaches spawns of that name to
6210
+ * the node's latest settled worker; the tool's per-call `continuity` overrides. */
6211
+ continuityByProfile?: Readonly<Record<string, ContinuityMode>>;
6811
6212
  /** Pass-through subscriber for every bus event, including pre-delivery instruction receipts and
6812
6213
  * steer/answer delivery outcomes. */
6813
6214
  onEvent?: (event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
@@ -6821,13 +6222,278 @@ declare function serveCoordinationMcp(opts: {
6821
6222
  nodeTools?: ReadonlyArray<McpToolDescriptor$1>;
6822
6223
  }): Promise<CoordinationMcpHandle>;
6823
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
6824
6490
  //#region src/runtime/supervise/delegate.d.ts
6825
6491
  /** The conserved pool a `delegate()` call applies when the caller does not pass its own `budget`.
6826
6492
  * A modest token ceiling + a small iteration ceiling — generous enough for a few-worker decompose,
6827
6493
  * bounded enough that an unsupervised intent cannot run away. Callers override via `opts.budget`. */
6828
6494
  declare const defaultDelegateBudget: Budget;
6829
6495
  /** Inputs to {@link delegate}. The intent is the first positional arg; everything here is optional
6830
- * 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. */
6831
6497
  interface DelegateOptions<Out = unknown> {
6832
6498
  /** The completion oracle (settled ⟺ delivered) the authored workers settle against. Strongly
6833
6499
  * recommended — without it the supervisor trusts a worker's self-report. For a code intent,
@@ -6839,21 +6505,10 @@ interface DelegateOptions<Out = unknown> {
6839
6505
  readonly backend?: ExecutorConfig;
6840
6506
  /** The conserved compute pool for the whole delegation. Defaults to {@link defaultDelegateBudget}. */
6841
6507
  readonly budget?: Budget;
6842
- /** The model the supervisor BRAIN runs on (the router model). The brain must tool-call
6843
- * (`spawn_agent` / `await_event`), so a delegator model, not a hidden-reasoning model. */
6844
- readonly model?: string;
6845
- /** The supervisor brain's router substrate. REQUIRED for the default router-brained supervisor
6846
- * (the brain is resolved from this), unless a test injects `brain` directly. `model` overrides
6847
- * `router.model`. (Design delta vs the bare `supervise()` profile: the brain needs a router.) */
6848
- readonly router?: RouterConfig;
6849
- /** Inject the supervisor brain directly (tests / advanced) instead of resolving it from `router`. */
6850
- readonly brain?: ToolLoopChat;
6851
- /** Override the default authoring-supervisor profile (name / extra system-prompt stance). The
6852
- * default already carries the authoring skill; override only to add a goal or rename. */
6853
- readonly supervisor?: {
6854
- readonly name?: string;
6855
- readonly systemPrompt?: string;
6856
- };
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;
6857
6512
  /** Restrict the run to this subset of models (forwarded to `supervise()`). */
6858
6513
  readonly allowedModels?: readonly string[];
6859
6514
  readonly runId?: string;
@@ -6865,7 +6520,7 @@ interface DelegateOptions<Out = unknown> {
6865
6520
  * `result.spentTotal` reports what the whole delegation actually cost. A `winner` result carries the
6866
6521
  * authored worker's delivered output; a `no-winner` result names why (never a fabricated success).
6867
6522
  */
6868
- 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>>;
6869
6524
  //#endregion
6870
6525
  //#region src/runtime/supervise/dispatch.d.ts
6871
6526
  /** One unit of queued work: the agent to run, its task, and the spawn options (budget + label).
@@ -7120,248 +6775,6 @@ interface SupervisorSpanRecorder {
7120
6775
  */
7121
6776
  declare function createSupervisorSpanRecorder(opts: SupervisorSpanOptions): SupervisorSpanRecorder | undefined;
7122
6777
  //#endregion
7123
- //#region src/runtime/supervise/supervisor-agent.d.ts
7124
- /**
7125
- * The supervisor's profile — the subset of an `AgentProfile` that selects + shapes its brain.
7126
- * `harness` is the backend-as-data discriminant; `systemPrompt` is the standing instruction.
7127
- *
7128
- * A canonical `AgentProfile` from `@tangle-network/agent-interface` satisfies this interface
7129
- * structurally: its `model` is a hints OBJECT and its system prompt lives at `prompt.systemPrompt`,
7130
- * so both spellings are accepted here and reduced by {@link resolveSupervisorProfile}. Before that,
7131
- * a canonical profile's model object reached `RouterConfig.model` (a string) as an object and its
7132
- * `prompt.systemPrompt` was dropped — a request the provider rejects, and a supervisor running the
7133
- * default strategy while its profile named another.
7134
- *
7135
- * WHAT EACH ARM HONORS — the two brains read different amounts of a profile, so state it rather
7136
- * than let a caller infer that a field took effect:
7137
- *
7138
- * - ROUTER arm (`harness` null): only `name`, the resolved model id (`model`, or
7139
- * `model.default`), and the resolved system prompt (`prompt.systemPrompt`/`systemPrompt` plus
7140
- * `prompt.instructions` and `resources.instructions`) reach the brain. A full `AgentProfile`'s
7141
- * `tools`, `mcp`, `permissions`, `resources.skills`/`files`, `hooks`, `modes`, `subagents`,
7142
- * `model.provider`, `model.small` and `model.reasoningEffort` are NOT honored here: the router
7143
- * brain is one `ToolLoopChat` over the coordination verbs, and neither of its two tool-calling
7144
- * transports (`routerChatWithTools` buffered, `streamRouterChatWithTools` when
7145
- * `RouterConfig.stream` is set) has a parameter for any of them.
7146
- * - HARNESS arm (`harness` set): the WHOLE profile object is handed to `deps.driveHarness`
7147
- * untouched, plus the resolved system prompt as a separate argument. Everything the profile
7148
- * declares is the harness's to materialize; this module changes none of it.
7149
- */
7150
- interface SupervisorProfile {
7151
- readonly name?: string;
7152
- /** null/undefined/`cli-base` → router brain (in-process tool-loop); a coding-CLI harness → an
7153
- * external harness brain. */
7154
- readonly harness?: string | null;
7155
- /** The router model when the brain is router-driven: a model id, or a canonical profile's model
7156
- * hints whose `default` IS the id. Absent (including a hints object with no `default`) → the
7157
- * deps router config's model applies. Other hints (`small`, `provider`, `reasoningEffort`) are
7158
- * harness-arm material only. */
7159
- readonly model?: string | AgentProfileModelHints;
7160
- /** Canonical `AgentProfile` prompt shaping. `prompt.systemPrompt` and the top-level `systemPrompt`
7161
- * are the same standing instruction in two spellings; disagreeing values are a fault, not a pick.
7162
- * `prompt.instructions` lines are appended to the resolved prompt, one per line. */
7163
- readonly prompt?: AgentProfilePrompt;
7164
- /** Canonical `AgentProfile` resources. Only `instructions` shapes the brain here (appended to the
7165
- * resolved system prompt); every other resource is the harness's to materialize. */
7166
- readonly resources?: AgentProfileResources;
7167
- /** The standing instructions ("you delegate, you do not solve"). */
7168
- readonly systemPrompt?: string;
7169
- }
7170
- /** A `SupervisorProfile` reduced to the scalars the two brain arms consume. `modelId`/`systemPrompt`
7171
- * stay `undefined` when the profile named none — the caller's fallback (`deps.router.model`,
7172
- * the built-in default supervisor prompt) then applies, and this type cannot hide which happened.
7173
- *
7174
- * There is deliberately no `reasoningEffort` here: the router brain runs on `chatWithTools` (the
7175
- * buffered/streamed switch in the router client), and neither transport has a `reasoning_effort`
7176
- * parameter — only the chat-only `routerChatWithUsage` does — so a field carrying it would be a
7177
- * public promise nothing keeps. `model.reasoningEffort` still reaches the harness arm inside the
7178
- * profile. */
7179
- interface ResolvedSupervisorProfile {
7180
- readonly name: string;
7181
- readonly harness: string | null;
7182
- readonly modelId?: string;
7183
- readonly systemPrompt?: string;
7184
- }
7185
- /**
7186
- * Reduce either profile spelling — a hand-written `SupervisorProfile` or a canonical `AgentProfile`
7187
- * — to the scalars the brain arms consume:
7188
- *
7189
- * - `modelId`: a string `model` verbatim, else `model.default`. Absent or unresolvable → the
7190
- * router config's own model applies unchanged.
7191
- * - `systemPrompt`: the system prompt plus the `prompt.instructions` and `resources.instructions`
7192
- * lines, one per line.
7193
- *
7194
- * `supervisorAgent` resolves each piece only where it is consumed (the model id on the router arm
7195
- * only); this whole-profile reduction is the caller-facing view of the same rules.
7196
- */
7197
- declare function resolveSupervisorProfile(profile: SupervisorProfile): ResolvedSupervisorProfile;
7198
- /** Where the coordination MCP binds. Omit = an ephemeral port on `127.0.0.1` (the local-harness
7199
- * default); set `host` when the root or the harness runs off-host. */
7200
- interface CoordinationBinding {
7201
- readonly host?: string;
7202
- readonly port?: number;
7203
- /** Explicit acknowledgment required to bind a NON-loopback host — see
7204
- * {@link assertCoordinationBinding} for what is being accepted. */
7205
- readonly allowUnauthenticatedRemote?: boolean;
7206
- }
7207
- /**
7208
- * Fail closed on a non-loopback coordination bind. `serveCoordinationMcp` mounts spawn_agent /
7209
- * steer_agent / stop with NO authentication of any kind (it is a bare JSON-RPC-over-HTTP handler),
7210
- * so a non-loopback bind lets anyone who can reach the port spawn agents and spend the run's
7211
- * conserved budget. There is no token to require yet, so the only honest options are loopback or an
7212
- * explicit, recorded acknowledgment — never a silent bind.
7213
- */
7214
- declare function assertCoordinationBinding(binding: CoordinationBinding | undefined): void;
7215
- /** Trusted run/node identity Runtime binds to one manager. Model-authored tool arguments cannot
7216
- * provide or replace any of these fields. */
7217
- interface SupervisorNodeContext {
7218
- readonly runId: string;
7219
- /** Stable across a durable restart; unique per in-memory invocation. */
7220
- readonly runNamespace: string;
7221
- /** Concrete Scope node that owns this manager's coordination stream. */
7222
- readonly nodeId: string;
7223
- /** Stable identity of this manager's coordination stream. */
7224
- readonly ownerId: string;
7225
- readonly depth: number;
7226
- readonly identity: NodeExecutionIdentity;
7227
- /** Assignment identity within the parent manager; absent only for the root. */
7228
- readonly assignmentId?: string;
7229
- readonly profile: SupervisorProfile;
7230
- readonly task: unknown;
7231
- }
7232
- /** Context known before `Agent.act`; Runtime adds the concrete node, profile, and task. */
7233
- type SupervisorNodeContextSeed = Omit<SupervisorNodeContext, 'nodeId' | 'profile' | 'task'>;
7234
- /** Trusted context for one product-tool invocation. The node identity remains the same detached,
7235
- * immutable snapshot supplied to the resolver; `signal` is the one live control reference Runtime
7236
- * adds. It aborts when this manager's scope is cancelled by the caller, RootHandle, deadline,
7237
- * breaker, or a recursive parent. */
7238
- interface SupervisorToolInvocationContext extends SupervisorNodeContext {
7239
- readonly signal: AbortSignal;
7240
- }
7241
- /** One product-owned tool. It reuses the canonical MCP descriptor fields while Runtime supplies
7242
- * the trusted invocation context as a separate argument and binds the result for either
7243
- * transport. Existing handlers remain compatible: the second argument only gains `signal`. */
7244
- interface SupervisorToolDescriptor extends Omit<McpToolDescriptor$1, 'handler'> {
7245
- readonly handler: (raw: unknown, context: SupervisorToolInvocationContext) => Promise<unknown>;
7246
- }
7247
- /** Product policy for the tools one exact supervisor node may call. Resolved once per node. */
7248
- type ResolveSupervisorTools = (context: SupervisorNodeContext) => ReadonlyArray<SupervisorToolDescriptor> | Promise<ReadonlyArray<SupervisorToolDescriptor>>;
7249
- /** Context-aware observer used internally to bind product transactions to the actual live node. */
7250
- type ObserveSupervisorNodeEvent = (context: SupervisorNodeContext, event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
7251
- /** How to run an external harness as the DRIVER, with the coordination verbs mounted — the substrate
7252
- * seam the caller supplies (mirrors `makeWorkerAgent` for spawned children). It runs `profile` on
7253
- * `task` in its backend (remote sandbox or local CLI bridge) with `coordinationMcpUrl` mounted as an MCP server,
7254
- * so the harness calls spawn_agent / await_event / stop as native tools over the live scope. */
7255
- interface DriveHarness {
7256
- (args: {
7257
- /** The caller's profile, EXACTLY as passed to `supervisorAgent` — never rewritten. A canonical
7258
- * `AgentProfile` stays schema-valid here (the canonical schema rejects unknown top-level keys,
7259
- * so hoisting a resolved prompt onto it would make a profile its own validator refuses). */
7260
- readonly profile: SupervisorProfile;
7261
- /** The standing instruction assembled from the profile: its system prompt in either spelling,
7262
- * plus the `prompt.instructions` and `resources.instructions` lines. Absent when the profile
7263
- * names none — the harness's own default then applies. This, not `profile.systemPrompt`, is
7264
- * what the harness should run under. */
7265
- readonly systemPrompt?: string;
7266
- readonly task: unknown;
7267
- readonly scope: Scope<unknown>;
7268
- readonly coordinationMcpUrl: string;
7269
- /** Data-only product tool surface mounted on the coordination MCP. Runtime-owned drivers include
7270
- * this in their materialization evidence without persisting executable handlers. */
7271
- readonly coordinationTools: ReadonlyArray<Omit<McpToolDescriptor$1, 'handler'>>;
7272
- }): Promise<void>;
7273
- /** Optional live inbox for the manager session this adapter currently drives. Return `false`
7274
- * when no executor inbox is active instead of claiming a message was delivered. */
7275
- deliver?(message: unknown): boolean;
7276
- }
7277
- /** Trusted manager identity available before its external harness starts. A product uses this to
7278
- * return one independently steerable harness session per recursive manager. */
7279
- type DriveHarnessOwnerContext = Omit<SupervisorNodeContext, 'nodeId'>;
7280
- /** Resolve an external harness for one exact Runtime-owned manager identity. */
7281
- type ResolveDriveHarness = (context: DriveHarnessOwnerContext) => DriveHarness;
7282
- interface SupervisorAgentDeps {
7283
- readonly blobs: ResultBlobStore;
7284
- /** Resolve a spawned worker `profile` to a leaf agent — the recursion seam (same for both arms). */
7285
- readonly makeWorkerAgent: MakeWorkerAgent;
7286
- /** Product authorization for every down-leg continuation to a child. */
7287
- readonly authorizeDownMessage?: AuthorizeDownMessage;
7288
- /** Per-child budget reserved from the conserved pool on each spawn. */
7289
- readonly perWorker: Budget;
7290
- /** Independent completion check for direct driver work (`submit_result`). */
7291
- readonly deliverable?: DeliverableSpec<unknown>;
7292
- /** Hard cap on simultaneously-LIVE workers across both arms — `spawn_agent` fails closed once
7293
- * this many are in flight (a concurrency fence on top of the conserved-pool fence; bounds live
7294
- * boxes/sandboxes, not total work). Omit/`<= 0` = no cap. */
7295
- readonly maxLiveWorkers?: number;
7296
- /** Router substrate for a router-brained supervisor (`harness` omitted or `cli-base`). The
7297
- * profile's model wins. */
7298
- readonly router?: RouterConfig;
7299
- /** Inject the brain directly (tests / advanced) instead of resolving `routerBrain` from the profile. */
7300
- readonly brain?: ToolLoopChat;
7301
- /** Required to run an external-harness supervisor: runs the harness as the driver. */
7302
- readonly driveHarness?: DriveHarness;
7303
- /** Trusted identity for this manager. Required with node-scoped tools or observation. */
7304
- readonly nodeContext?: SupervisorNodeContextSeed;
7305
- /** Resolve product-owned tools for this exact manager. Static `extraTools` remain a router-only
7306
- * compatibility seam and deliberately receive no new recursive authority. */
7307
- readonly resolveSupervisorTools?: ResolveSupervisorTools;
7308
- /** Awaited product observation, enriched with this manager's actual live node context. */
7309
- readonly observeNodeEvent?: ObserveSupervisorNodeEvent;
7310
- /** Replay resume-time settlements through `observeNodeEvent` before the manager starts. */
7311
- readonly replaySettlements?: boolean;
7312
- /** WORK tools the supervisor may call DIRECTLY (router arm) — so it can do simple work ITSELF and
7313
- * only delegate when it needs parallelism. Pair with `executeExtraTool`. */
7314
- readonly extraTools?: ReadonlyArray<{
7315
- readonly name: string;
7316
- readonly description?: string;
7317
- readonly parameters: Record<string, unknown>;
7318
- }>;
7319
- /** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
7320
- readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
7321
- /** Analyst lenses available to the driver (both arms). Required for `analyzeOnSettle`. */
7322
- readonly analysts?: AnalystRegistry;
7323
- /** Analyst kinds run on each worker-settle → a `finding` the driver composes its next steer from
7324
- * (the self-improving UP-leg). Unset/empty = status quo (no analyst feed). Requires `analysts`. */
7325
- readonly analyzeOnSettle?: ReadonlyArray<string | AnalyzeOnSettleRoute>;
7326
- /** Run the ONLINE detector panel over each worker's LIVE tool trace (both arms) so the driver
7327
- * learns a worker is looping mid-run instead of at settle. Omit = no online watching. */
7328
- readonly watchWorkers?: WorkerWatchOptions;
7329
- /** Idle time after which `observe_agent` reports a worker as stalled. Omit = runtime default. */
7330
- readonly stallAfterMs?: number;
7331
- /** PROGRESS-derived stop rule (router arm). Ends a run that has stopped learning BEFORE it
7332
- * exhausts a ceiling; it can never keep a run alive past one. Build it with `plateau` /
7333
- * `noProgressFor` / `allWorkersStalled` from `supervise/stop-rules` — the thresholds are the
7334
- * caller's judgment. Omit = ceilings only. */
7335
- readonly stopRule?: StopRule;
7336
- /** One-shot notification of WHY a `stopRule` ended the run. */
7337
- readonly onProgressStop?: (reason: string) => void;
7338
- readonly maxTurns?: number;
7339
- /** Give the supervisor brain a chapter-lifecycle on its OWN context window (router arm only) — it
7340
- * distills its coordination transcript to a compact progress note once it exceeds the threshold,
7341
- * instead of re-billing the whole thing every turn. See `DriverAgentOptions.compaction`. */
7342
- readonly compaction?: ToolLoopCompactionOptions;
7343
- /** Pass-through subscriber for every coordination bus event (both arms) — the seam a durable
7344
- * caller hooks its coordination log onto. */
7345
- readonly onEvent?: (event: CoordinationEvent, record: BusRecord<CoordinationEvent>) => void | Promise<void>;
7346
- /** Questions, findings, and authorized continuation receipts loaded from a prior process.
7347
- * Router arm: questions seed the ledger and all evidence enters the resume brief. External arm:
7348
- * questions seed the ledger; receipts remain durable evidence and are never auto-delivered. */
7349
- readonly priorCoordination?: PriorCoordination;
7350
- /** Deferred owner-scoped replay for a recursive supervisor. Its stable owner is known while the
7351
- * parent authorizes the child, but loading remains asynchronous; Runtime calls this before the
7352
- * nested brain can publish or act on coordination state. */
7353
- readonly loadPriorCoordination?: () => Promise<PriorCoordination>;
7354
- /** How the settled ledger becomes the run's output (both arms). Default `bestDelivered` — the
7355
- * exact keep-best every existing caller had. Always runs under the delivered-only invariant. */
7356
- readonly finalizer?: SupervisorFinalizer;
7357
- /** Where the coordination MCP binds (external arm). Omit = an ephemeral loopback port, which is
7358
- * unreachable from an off-host harness. A non-loopback host fails closed — see
7359
- * {@link assertCoordinationBinding}. */
7360
- readonly coordination?: CoordinationBinding;
7361
- }
7362
- /** Build a supervisor `Agent` from its profile: the brain resolves from `profile.harness` (backend-as-data), the same resolution rule as every worker. */
7363
- declare function supervisorAgent(profile: SupervisorProfile, deps: SupervisorAgentDeps): Agent<unknown, unknown>;
7364
- //#endregion
7365
6778
  //#region src/runtime/supervise/supervise.d.ts
7366
6779
  /**
7367
6780
  * Build the worker seam from a backend (WHERE workers run) + an optional completion oracle (the
@@ -7477,12 +6890,35 @@ interface SuperviseOptions {
7477
6890
  readonly isDriverProfile?: (input: AuthorizedSpawnContext) => boolean;
7478
6891
  /** The supervisor's router substrate (`profile.harness` omitted or `cli-base`). The profile's
7479
6892
  * model wins. */
7480
- readonly router?: RouterConfig;
7481
- /** Inject the supervisor brain directly (tests / advanced). */
7482
- readonly brain?: ToolLoopChat;
6893
+ readonly router?: RouterTransportConfig;
7483
6894
  /** Run an external-harness supervisor explicitly. Required for a remote sandbox; optional as a
7484
6895
  * caller-owned override for a local bridge. */
7485
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;
7486
6922
  /** Resolve one custom external-harness session per trusted manager identity. Use this instead of
7487
6923
  * `driveHarness` when recursive managers must be independently steerable. */
7488
6924
  readonly resolveDriveHarness?: ResolveDriveHarness;
@@ -7536,6 +6972,14 @@ interface SuperviseOptions {
7536
6972
  /** Idle time after which `observe_agent` reports a running worker as `stalled`. A derived read
7537
6973
  * at observation time — nothing is killed or retried. Omit = the runtime default. */
7538
6974
  readonly stallAfterMs?: number;
6975
+ /** Default continuity per worker PROFILE NAME: `'resume'` makes each spawn of that name after
6976
+ * the first re-attach to the node's most recent SETTLED worker — a NEW live worker whose spawn
6977
+ * context carries the prior worker's identity (`WorkerSpawnContext.resume`), which the executor
6978
+ * seam re-attaches with. `spawn_agent`'s per-call `continuity` argument overrides in either
6979
+ * direction; `runGraph` derives this from delegates-edge `continuity`. Omit = every spawn is
6980
+ * `'fresh'` (status quo). See `CoordinationToolsOptions.continuityByProfile` for the
6981
+ * refusal semantics (no-prior / while-live / with-key) and the process-local resume boundary. */
6982
+ readonly continuityByProfile?: Readonly<Record<string, ContinuityMode>>;
7539
6983
  /** Worker output store. Defaults to in-memory. */
7540
6984
  readonly blobs?: ResultBlobStore;
7541
6985
  /**
@@ -7644,8 +7088,14 @@ interface AuthorizedSpawnContext {
7644
7088
  }
7645
7089
  /** Exact trusted context for selecting one backend-derived leaf's completion check. */
7646
7090
  type DeliverableResolutionInput = AuthorizedSpawnContext;
7647
- /** 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 */
7648
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>>;
7649
7099
  //#endregion
7650
7100
  //#region src/runtime/supervise/graph.d.ts
7651
7101
  /** A graph node: an id and a canonical `AgentProfile`. The profile is the ONLY way a node is
@@ -7667,6 +7117,15 @@ type GraphEdge =
7667
7117
  /** Cyclic-graph backstop: traversals beyond this REFUSE (fail loud). Default
7668
7118
  * {@link defaultEdgeTraversalCap}. */
7669
7119
  readonly maxTraversals?: number;
7120
+ /** Default continuity for this edge's SPAWN traversals. `'resume'` makes every spawn after
7121
+ * the node's first re-attach to its most recent SETTLED worker: a NEW live worker whose
7122
+ * spawn context carries `resume: { ofWorker, sequence }` for the executor seam, spending
7123
+ * from the same conserved pool — the node's first spawn is effectively `'fresh'`, and a
7124
+ * spawn while a prior worker is still live refuses loudly (steer is the live channel).
7125
+ * The driver's per-call `spawn_agent` `continuity` argument overrides either way. Omit =
7126
+ * `'fresh'` (today's behavior, byte-identical). Caps count resumes exactly like fresh
7127
+ * spawns. */
7128
+ readonly continuity?: ContinuityMode;
7670
7129
  } |
7671
7130
  /** Findings flow anywhere: an analyst over N nodes' settled traces, delivered to ONE node.
7672
7131
  * With a LENS analyst the directive wraps the findings for the recipient; with a NODE analyst
@@ -7696,6 +7155,11 @@ interface AgentGraph {
7696
7155
  readonly budget: Budget;
7697
7156
  }
7698
7157
  type EdgeDeliveryOutcome = 'delivered' | 'stripped' | 'empty' | 'unpropagated';
7158
+ /** How one ledgered hop CONTINUED: a spawn traversal stamps its effective spawn mode
7159
+ * (`'fresh'` | `'resume'`), and every mid-run delivery into an already-live recipient — a
7160
+ * driver steer leg and every analyzes delivery (routed steer or driver-destined finding) —
7161
+ * stamps `'steer'`. Zero ambiguity: every row carries exactly one of the three. */
7162
+ type TraversalContinuity = ContinuityMode | 'steer';
7699
7163
  /** One recorded edge traversal — the in-memory row; the journal twin is the `edge` SpawnEvent. */
7700
7164
  interface EdgeTraversal {
7701
7165
  /** Stable edge id: `delegates:<from>-><to>` or `analyzes:<analyst>:<over…>-><to>`. */
@@ -7708,6 +7172,8 @@ interface EdgeTraversal {
7708
7172
  /** 1-based per-edge ordinal. */
7709
7173
  readonly traversal: number;
7710
7174
  readonly outcome: EdgeDeliveryOutcome;
7175
+ /** How this hop continued — see {@link TraversalContinuity}. */
7176
+ readonly continuity: TraversalContinuity;
7711
7177
  /** Bytes of directive + payload that actually crossed the edge. */
7712
7178
  readonly bytes: number;
7713
7179
  readonly reason?: string;
@@ -7731,13 +7197,11 @@ interface RunGraphOptions {
7731
7197
  * directive delivery, and the edge ledger AROUND this seam — only the leaf `act` is yours. */
7732
7198
  readonly makeWorkerAgent?: MakeWorkerAgent;
7733
7199
  /** The driver brain's router substrate (`profile.harness` omitted or `cli-base`). */
7734
- readonly router?: RouterConfig;
7200
+ readonly router?: RouterTransportConfig;
7735
7201
  /** Caller-side runtime hooks (telemetry, policy, product extensions). Composed AFTER the
7736
7202
  * graph's own spawn-binding hook on the SAME event stream — the graph never swallows the
7737
7203
  * seam supervise() exposes. */
7738
7204
  readonly hooks?: RuntimeHooks;
7739
- /** Inject the driver brain directly (offline tests / advanced). */
7740
- readonly brain?: ToolLoopChat;
7741
7205
  /** The analyst lens registry `analyzes` edges resolve against. ENVIRONMENT — needed only for
7742
7206
  * lens analysts; an analyzes edge naming a graph NODE as its analyst needs no registry. */
7743
7207
  readonly analysts?: AnalystRegistry;
@@ -7779,6 +7243,10 @@ interface GraphResult<Out = unknown> {
7779
7243
  readonly exhaustedEdges: ReadonlyArray<string>;
7780
7244
  readonly runId: string;
7781
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
+ }
7782
7250
  /**
7783
7251
  * Execute an {@link AgentGraph}. The root node becomes the supervisor (`supervise()` — the
7784
7252
  * execution core), each worker node is spawnable BY NODE ID (`spawn_agent` with
@@ -7788,17 +7256,8 @@ interface GraphResult<Out = unknown> {
7788
7256
  * traversal is ledgered and journaled.
7789
7257
  */
7790
7258
  declare function runGraph(graph: AgentGraph, opts: RunGraphOptions): Promise<GraphResult>;
7791
- //#endregion
7792
- //#region src/runtime/supervise/model-policy.d.ts
7793
- /**
7794
- * Throw a `ConfigError` when `allowed` is set, `model` is defined, and `model` is not a
7795
- * member of `allowed`. No-op when `allowed` is unset (the unrestricted default) or when
7796
- * `model` is undefined (nothing was configured to check).
7797
- */
7798
- declare function assertModelAllowed(model: string | undefined, allowed: readonly string[] | undefined): void;
7799
- /** Check every canonical model-bearing field in a complete profile, including the models a
7800
- * backend may select for cheap work, named subagents, or modes. */
7801
- 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>;
7802
7261
  //#endregion
7803
7262
  //#region src/runtime/supervise/patch-checks.d.ts
7804
7263
  /** @experimental The per-task constraints the mechanical gate enforces. */
@@ -7824,8 +7283,6 @@ interface WorktreeCliExecutorOptions {
7824
7283
  * cannot honor them. Harness-specific values the materializer cannot preserve also fail closed.
7825
7284
  */
7826
7285
  profile: AgentProfile$1;
7827
- /** Local CLI for this leaf. This explicit choice overrides `profile.harness`. */
7828
- harness: LocalHarness;
7829
7286
  /** Default instruction for direct `execute(undefined, signal)` calls. An execution-time task
7830
7287
  * is authoritative. Omit when the caller always supplies the task to `execute`. */
7831
7288
  taskPrompt?: string;
@@ -7836,7 +7293,7 @@ interface WorktreeCliExecutorOptions {
7836
7293
  /** Wall-clock cap per harness subprocess (ms). Default 5 min (the `runLocalHarness` default). */
7837
7294
  harnessTimeoutMs?: number;
7838
7295
  /** Run Codex with an ephemeral session, isolated config/instructions, network disabled, and
7839
- * JSONL usage capture. Requires `harness: 'codex'`; metered by default. */
7296
+ * JSONL usage capture. Requires `profile.harness: 'codex'`; metered by default. */
7840
7297
  codexReproducible?: boolean;
7841
7298
  /** Absolute host paths denied to reproducible Codex (for benchmark answer copies, credentials,
7842
7299
  * or other task-specific ambient state). */
@@ -7872,9 +7329,10 @@ interface WorktreeCliExecutorOptions {
7872
7329
  * Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each), so a
7873
7330
  * fanout of N profiles = N parallel worktrees that never clobber each other.
7874
7331
  *
7875
- * Fail-loud: an empty `repoRoot`/`harness` or an explicitly empty `taskPrompt` throws at
7876
- * construction. Calling `execute(undefined, signal)` without a configured prompt throws before a
7877
- * 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.
7878
7336
  *
7879
7337
  * @experimental
7880
7338
  */
@@ -8349,15 +7807,13 @@ declare function settledWorkerOut(input: {
8349
7807
  declare function closingWorkerNote(stdout: string, stderr: string): string | undefined;
8350
7808
  //#endregion
8351
7809
  //#region src/runtime/supervise/worktree-fanout.d.ts
8352
- /** @experimental One authored harness profile in a worktree fanout: the §1.5 profile + which local
8353
- * 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. */
8354
7812
  interface AuthoredHarness {
8355
7813
  /** A short label for the worktree branch + trace node. */
8356
7814
  name: string;
8357
7815
  /** The supervisor-authored `AgentProfile` (systemPrompt + model reach the harness via §1.5). */
8358
7816
  profile: AgentProfile$1;
8359
- /** Which local harness CLI drives this leaf. */
8360
- harness: LocalHarness;
8361
7817
  /** Require measured usage from this leaf. Budgeted supervision refuses the default unmetered
8362
7818
  * local-CLI mode; set false only when the selected runner actually returns token usage. */
8363
7819
  budgetExempt?: WorktreeCliExecutorOptions['budgetExempt'];
@@ -8425,8 +7881,9 @@ declare function failuresAnalyst(): AnalystRegistry;
8425
7881
  interface SurfaceWorkerConfig {
8426
7882
  readonly routerBaseUrl: string;
8427
7883
  readonly routerKey: string;
8428
- readonly model: string;
8429
- readonly maxTokens?: number;
7884
+ /** Exact worker behavior, tools, and model. */
7885
+ readonly profile: AgentProfile$1;
7886
+ readonly analystProfile?: AgentProfile$1;
8430
7887
  readonly innerTurns?: number;
8431
7888
  /** Refine-shot budget for ONE worker attempt (max steered shots). Default 1. */
8432
7889
  readonly budget?: number;
@@ -8439,9 +7896,8 @@ interface SuperviseSurfaceOptions {
8439
7896
  /** The conserved compute pool for the whole supervised run. Default: sized off the worker's inner-loop
8440
7897
  * bounds for a handful of worker spawns — raise it to let the driver try more. */
8441
7898
  readonly budget?: Budget;
8442
- /** The driver brain's router substrate (its own inference). Default: the worker's router + model the
8443
- * driver and workers share one router unless you separate them (e.g. a stronger driver model). */
8444
- readonly router?: RouterConfig;
7899
+ /** The driver brain's Router endpoint/auth. Model and behavior remain owned by `profile`. */
7900
+ readonly router?: RouterTransportConfig;
8445
7901
  /** The self-improvement lens fed to the driver on each settled worker. Default `failuresAnalyst()`
8446
7902
  * (target the still-failing tests). Pass a custom registry to change it, or `null` to turn the
8447
7903
  * within-run self-improvement OFF (the driver sees raw settled outputs). */
@@ -8481,5 +7937,5 @@ interface VerifierEnvironmentOptions {
8481
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. */
8482
7938
  declare function createVerifierEnvironment(opts: VerifierEnvironmentOptions): Environment;
8483
7939
  //#endregion
8484
- export { legacySupervisorRunsRoot as $, CorpusReadbackOptions as $a, ContinuationInstruction as $c, AgentEvalErrorCode as $d, sandboxActProfileMaterialization as $f, sumSandboxUsage as $i, InboxMessage as $l, DeliveredOutput as $n, CombinatorShape as $o, structuralRollout as $r, LeaderboardBenchmarkAdapter as $s, assertCoordinationBinding as $t, DelegationResumeDriver as $u, GitWorkspaceOptions as A, assertTraceDerivedFindings as Aa, renderPairwiseMarkdown as Ac, FeedbackRating as Ad, materializeTreeView as Af, StdioMcpConnection as Ai, DelegateError as Al, defaultDelegateBudget as An, KeyProvider as Ao, CheckExecChannel as Ar, TrajectoryReportOptions as As, runGraph as At, coderTaskFromArgs as Au, analyzeTrace as B, BenchmarkLift as Ba, areaUnderCurve as Bc, DelegationTraceCollector as Bd, ProfileMaterializationContract as Bf, TurnResult as Bi, ProviderSeam as Bl, ProgressSample as Bn, InProcessSandboxClientOptions as Bo, StructuralRolloutResult as Br, LoopShape as Bs, CoordinationBinding as Bt, DetachedTurn as Bu, closingWorkerNote as C, panel as Ca, ProfileKeyOf as Cc, DelegationHistoryResult as Cd, SpawnForest as Cf, assertStrategyContract as Ci, McpServerOptions as Cl, DispatchUnit as Cn, RunAgentRoundsOptions as Co, asAuthoredProfile as Cr, ScopeAnalyst as Cs, EdgeTraversal as Ct, CoderReview as Cu, UntrackedCopyStats as D, widen as Da, renderLeaderboardHtml as Dc, DelegationStatus as Dd, SpawnForestNode as Df, MaterializeLocalMcpOptions as Di, DELEGATE_INPUT_SCHEMA as Dl, queueOf as Dn, runLoop as Do, defaultProfileRichnessThresholds as Dr, TrajectoryNode as Ds, GraphResult as Dt, DetachedWinnerSelection as Du, CopyOptions as E, verify as Ea, pairwiseSignificance as Ec, DelegationResultPayload as Ed, SpawnForestMissingTree as Ef, LocalMcpMaterialization as Ei, DELEGATE_DESCRIPTION as El, freeSlots as En, runAgentRounds as Eo, canonicalizeAuthoredProfile as Er, SteerContext as Es, GraphNode as Et, DetachedSessionDelegateOptions as Eu, gitWorkspace as F, McpEnvironmentOptions as Fa, defaultAuditorInstruction as Fc, UiAuditorDelegationOutput as Fd, AgentProfileMaterializationAxis as Ff, OpenSandboxRunBeforeStartContext as Fi, BridgeSeam as Fl, driverAgent as Fn, resolveSecretEnv as Fo, CheckSourceCtx as Fr, WidenLineage as Fs, SuperviseOptions as Ft, FleetWorkspaceExecutorOptions as Fu, workerTraceAnalysisStore as G, printBenchmarkReport as Ga, WaterfallReport as Gc, createDelegationTraceCollector as Gd, defineProfileMaterializationContract as Gf, SandboxLineageHandle as Gi, createExecutor as Gl, StopRule as Gn, harvestCorpus as Go, defaultExtractCandidate as Gr, RunPersonified as Gs, ResolveSupervisorTools as Gt, createDetachedTurnResumeDriver as Gu, WorkerToolTraceArtifact as H, BenchmarkStrategySummary as Ha, plateauLength as Hc, buildDelegationTraceSpans as Hd, ValidateProfileMaterializationOptions as Hf, CheckpointCapableBox as Hi, RouterToolsSeam as Hl, ProgressTrackerOptions as Hn, HarvestCorpusOptions as Ho, canDisplace as Hr, Persona as Hs, DriveHarnessOwnerContext as Ht, DriveTurnCapableBox as Hu, jjWorkspace as I, createMcpEnvironment as Ia, AnytimeReport as Ic, CappedDelegationTrace as Id, AssertProfileMaterializationOptions as If, OpenSandboxRunOptions as Ii, CliSeam as Il, finalizeBestDelivered as In, secretEnvOfMcpServer as Io, RepairStop as Ir, WidenSpec as Is, SuperviseRegistry as It, SiblingSandboxExecutorOptions as Iu, ScopeArgs as J, AgenticRunResult as Ja, AnalystFindingEvent as Jc, DelegationStore as Jd, promptControlProfileMaterialization as Jf, SandboxToolPartState as Ji, SandboxSteeringOptions as Jl, anyOf as Jn, ObserveOptions as Jo, modelAuthoredChecks as Jr, ShapeContext as Js, SupervisorNodeContext as Jt, parseDetachedSessionRef as Ju, createRootHandle as K, runBenchmark as Ka, WaterfallSpan as Kc, DelegationPersistenceError as Kd, fullProfileMaterialization as Kf, SessionCapableBox as Ki, createExecutorRegistry as Kl, allOf as Kn, Observation as Ko, defaultStructuralRolloutPolicy as Kr, RunPersonifiedOptions as Ks, ResolvedSupervisorProfile as Kt, detachedTurnEvents as Ku, localShell as L, sanitizeMcpToolSchema as La, AnytimeStrategySummary as Lc, DELEGATION_TRACE_MAX_BYTES as Ld, CanonicalAgentProfileMaterializationAxis as Lf, OpenSandboxRunPromptOptions as Li, CliWorktreeBridgeSeam as Ll, AllWorkersStalledOptions as Ln, inlineSandboxClient as Lo, StructuralRolloutConfig as Lr, WinnerStrategy as Ls, SuperviseRegistryTable as Lt, createFleetWorkspaceExecutor as Lu, Workspace as M, createScopeAnalyst as Ma, AuditIntentOptions as Mc, ResearchOutputShape as Md, replaySpawnTree as Mf, connectStdioMcp as Mi, DelegateResult as Ml, CoordinationMcpHandle as Mn, envKeyProvider as Mo, CheckRunContext as Mr, VerifySpec as Ms, AuthorizedSpawnContext as Mt, settleDetachedCoderTurn as Mu, WorkspaceCommit as N, registryScopeAnalyst as Na, IntentAudit as Nc, ResearchSource as Nd, contentAddress as Nf, materializeLocalMcp as Ni, createDelegateHandler as Nl, serveCoordinationMcp as Nn, mcpSecretEnvMetadataKey as No, CheckRunner as Nr, Widen as Ns, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as Nt, DelegationExecutor as Nu, copyUntrackedIntoClone as O, CreateScopeAnalystOptions as Oa, renderLeaderboardMarkdown as Oc, DelegationStatusArgs as Od, SpawnForestTree as Of, McpSpawnFault as Oi, DELEGATE_TOOL_NAME as Ol, rollingDispatch as On, LocalSandboxClientOptions as Oo, profileRichnessFinding as Or, TrajectoryReport as Os, RunGraphOptions as Ot, SettleDetachedCoderTurnOptions as Ou, WorkspaceRun as P, McpEndpoint as Pa, auditIntent as Pc, UiAuditLensFilter as Pd, AGENT_PROFILE_MATERIALIZATION_AXES as Pf, Deliverable as Pi, validateDelegateArgs as Pl, DriverAgentOptions as Pn, resolveMcpServerLaunch as Po, CheckSource as Pr, WidenDecision as Ps, DeliverableResolutionInput as Pt, FleetHandle as Pu, legacySupervisorRunDir as Q, ArtifactHandle as Qa, AuthorizedDownMessage as Qc, AgentEvalError$1 as Qd, renderProfileMaterializationIssues as Qf, mapSandboxToolEvent as Qi, Inbox as Ql, sampleFromSettled as Qn, AssertTraceDerivedFindings as Qo, selectBestIndex as Qr, LeaderboardBenchTask as Qs, SupervisorToolInvocationContext as Qt, DelegationResumeContext as Qu, runInWorkspace as R, BenchmarkCell as Ra, AnytimeTaskCurve as Rc, DELEGATION_TRACE_MAX_SPANS as Rd, DefineProfileMaterializationContractOptions as Rf, SandboxRun as Ri, CliWorktreeSeam as Rl, NoProgressForOptions as Rn, InProcessOnPrompt as Ro, StructuralRolloutMessage as Rr, DefinePersona as Rs, supervise as Rt, createSiblingSandboxExecutor as Ru, WorkerEvidenceInput as S, loopUntil as Sa, PairwiseVerdict as Sc, DelegationHistoryEntry as Sd, InMemorySpawnJournal as Sf, AuthoredStrategy as Si, McpServer as Sl, DispatchStopReason as Sn, loopDispatch as So, ProfileRichnessThresholds as Sr, RenderCorpusToInstructionsOptions as Ss, EdgeDeliveryOutcome as St, CoderDelegate as Su, settledWorkerOut as T, selectValidWinner as Ta, leaderboard as Tc, DelegationProgress as Td, SpawnForestInDoubtNode as Tf, strategyAuthorContract as Ti, createMcpServer as Tl, effectiveConcurrency as Tn, defaultSelectWinner as To, authoredWorker as Tr, ScopeWidenGate as Ts, GraphEdgeCapError as Tt, DelegateRunCtx as Tu, captureWorkerTraceEvidence as U, BenchmarkTaskRow as Ua, renderAnytimeTable as Uc, capDelegationTrace as Ud, assertProfileMaterialization as Uf, ForkCapableBox as Ui, SandboxSeam as Ul, ProgressView as Un, HarvestFailure as Uo, compareCheckOutcomes as Ur, PersonaContext as Us, ObserveSupervisorNodeEvent as Ut, DriveTurnTick as Uu, WORKER_TOOL_TRACE_SCHEMA_VERSION as V, BenchmarkReport as Va, bestSoFar as Vc, DelegationTraceSpan as Vd, ProfileMaterializationIssue as Vf, openSandboxRun as Vi, RouterSeam as Vl, ProgressTracker as Vn, inProcessSandboxClient as Vo, VisibleCheck as Vr, Outcome as Vs, DriveHarness as Vt, DetachedTurnResumeDriverOptions as Vu, parseWorkerToolTraceArtifact as W, Environment as Wa, WaterfallCollector as Wc, composeLoopTraceEmitters as Wd, controlProfileMaterialization as Wf, SandboxLineage as Wi, cliWorktreeExecutor as Wl, StopDecision as Wn, HarvestReport as Wo, composeCheckSources as Wr, PersonaExecutors as Ws, ResolveDriveHarness as Wt, RunDetachedTurnOptions as Wu, settledToIteration as X, AgenticTask as Xa, AnalyzeOnSettleRoute as Xc, FileDelegationStoreOptions as Xd, promptOnlyProfileMaterialization as Xf, extractLlmCallEvent as Xi, SteerableSandboxSession as Xl, noProgressFor as Xn, observe as Xo, resolveEntrySymbol as Xr, DefinedLeaderboard as Xs, SupervisorProfile as Xt, DelegationArgs as Xu, createScope as Y, AgenticSurface as Ya, AnalystRegistry as Yc, FileDelegationStore as Yd, promptModelProfileMaterialization as Yf, createSandboxToolPartState as Yi, SteerableSandboxArgs as Yl, createProgressTracker as Yn, defaultAnalystInstruction as Yo, officialChecksFromMeta as Yr, ShapeRegistry as Ys, SupervisorNodeContextSeed as Yt, runDetachedTurn as Yu, WorkerSteerRequest as Z, AgenticTool as Za, AuthorizeDownMessage as Zc, InMemoryDelegationStore as Zd, promptResourceProfileMaterialization as Zf, mapSandboxEvent as Zi, createSteerableSandboxSession as Zl, plateau as Zn, renderReport as Zo, sandboxCheckRunner as Zr, LeaderboardBenchScore as Zs, SupervisorToolDescriptor as Zt, DelegationRecord as Zu, WorktreeFanoutOptions as _, FileCorpus as _a, Interval as _c, DelegateUiAuditResult as _d, DeliverableSpec as _f, discriminatingMeans as _i, WorkerSpawnContext as _l, naiveContinuationPrompt as _n, sampleThenRefine as _o, ReservationTicket as _r, PanelSpec as _s, WorktreePatchArtifact as _t, McpTransport as _u, SandboxInstance$1 as a, ResolveSandboxClientOptions as aa, LeaderboardSpec as ac, SubmitOutput as ad, RuntimeRunStateError as af, collectAgentTurn as ai, DownMessageDeliveryAttempt as al, SupervisorSpanRecorder as an, StrategyCtx as ao, pickBestDelivered as ar, EqualKOnCostOptions as as, workerControlLogFile as at, CreateWorktreeOptions as au, NOTE_MAX_CHARS as b, fanout as ba, LeaderboardRow as bc, DelegationFeedbackSnapshot as bd, FileSpawnJournal as bf, selectChampion as bi, createCoordinationTools as bl, ConcurrencyCaps as bn, LoopOptionsForDispatch as bo, AuthoredProfile as br, PipelineStage as bs, assertProfileModelsAllowed as bt, InMemoryFeedbackStore as bu, VerifierEnvironmentOptions as c, PromotionVerdict as ca, CompletionEvidence as cc, DelegateCodeConfig as cd, BusEvent as cf, ChampionPolicy as ci, MakeWorkerAgent as cl, PromptRegistry as cn, StrategyShotResult as co, CoordinationDeliveryEvidence as cr, FanoutOptions as cs, writeWorkerSteer as ct, GitRunner as cu, SuperviseSurfaceResult as d, trajectoryReport as da, completionAuthorizes as dc, DelegateFeedbackResult as dd, EventBus as df, EvolutionBandInfo as di, QuestionLevel as dl, createPromptRegistry as dn, breadthStrategy as do, FileCoordinationLog as dr, FlatWidenGate as ds, RunContext as dt, captureWorktreeDiff as du, CriuCapableClient as ea, LeaderboardFlagSpec as ec, DelegationResumeTick as ed, BackendTransportError as ef, visibleCheckScore as ei, CoordinationEvent as el, resolveSupervisorProfile as en, RunAgenticOptions as eo, validateProfileMaterialization as ep, FinalizeContext as er, Corpus as es, readWorkerSteerRequests as et, createInbox as eu, SurfaceWorkerConfig as f, builtinShapes as fa, deterministicCompletion as fc, DelegateResearchArgs as fd, PublishOptions as ff, EvolutionCandidate as fi, QuestionOption as fl, delegatesWorkerBriefPrompt as fn, defineStrategy as fo, PriorCoordination as fr, LoopUntil as fs, createFileRunContext as ft, createWorktree as fu, AuthoredHarness as g, runPersonified as ga, GroupOf as gc, DelegateUiAuditConfig as gd, watchTrace as gf, StrategyEvolutionConfig as gi, SettledWorker as gl, kernelPromptRegistry as gn, sample as go, ReservationRejection as gr, PanelJudge as gs, WorktreeCliExecutorOptions as gt, McpToolDescriptor$1 as gu, superviseSurface as h, definePersona as ha, AxisScoresOf as hc, DelegateUiAuditArgs as hd, defaultToolDetectors as hf, ReproductionCheck as hi, QuestionUrgency as hl, formatPromptHandle as hn, runAgentic as ho, BudgetReadout as hr, Panel as hs, patchDelivered as ht, JsonRpcResponse as hu, SandboxEvent$1 as i, acquireSandbox as ia, LeaderboardScore as ic, SubmitInput as id, PlannerError as if, StreamAgentTurnOptions as ii, DownMessageAuthorizationInput as il, SupervisorSpanOutcome as in, StrategyArtifacts as io, collectDelivered as ir, EqualKOnCost as is, supervisorWorkersDir as it, WorktreeProfileMaterializationReceipt as iu, Shell as j, buildSteerContext as ja, AuditIntentInput as jc, FeedbackRefersTo as jd, pendingWaits as jf, StdioMcpServerSpec as ji, DelegateHandlerOptions as jl, delegate as jn, ResolvedMcpServerLaunch as jo, CheckOutcome as jr, Verify as js, AuthorizedSpawn as jt, detachedSessionDelegate as ju, withUntrackedArtifacts as k, RegistryAnalyzeProjection as ka, renderLeaderboardSvg as kc, DelegationStatusResult as kd, loadSpawnForest as kf, McpToolDescriptor as ki, DelegateArgs as kl, DelegateOptions as kn, localSandboxClient as ko, supervisorInstructions as kr, TrajectoryReportFn as ks, defaultEdgeTraversalCap as kt, UiAuditorDelegate as ku, createVerifierEnvironment as l, promotionGate as la, CompletionPolicy as lc, DelegateCodeResult as ld, BusRecord as lf, EvolutionArchiveNode as li, Question as ll, RegisteredPrompt as ln, SurfaceScore as lo, CoordinationLog as lr, FanoutSynthesis as ls, InMemoryRunContext as lt, RemoveWorktreeOptions as lu, failuresAnalyst as m, registerShape as ma, stopSentinel as mc, DelegateResearchResult as md, WatchTraceOptions as mf, EvolutionReport as mi, QuestionRecord as ml, dumbContinuationPassPrompt as mn, refine as mo, BudgetPoolRestore as mr, LoopUntilState as ms, PatchDeliverableOptions as mt, JsonRpcMessage as mu, AnalystFinding$1 as n, probeSandboxCapabilities as na, LeaderboardRunContext as nc, DelegationTaskQueue as nd, JudgeError as nf, AgentTurnUsage as ni, CoordinationToolsOptions as nl, SupervisorSpanAttributes as nn, ShotSpec as no, SupervisorFinalizer as nr, CorpusRecord as ns, supervisorRunDir as nt, WorktreeCommandResult as nu, computeFindingId$1 as o, resolveSandboxClient as oa, defineLeaderboard as oc, hashIdempotencyInput as od, ValidationError as of, streamAgentTurn as oi, DownMessageDeliveryOutcome as ol, createSupervisorSpanRecorder as on, StrategyMessage as oo, runFinalizer as or, EqualKVerdict as os, workerInboxFile as ot, DiffOptions as ou, SurfaceWorkerOut as p, createShapeRegistry as pa, sentinelCompletion as pc, DelegateResearchConfig as pd, createEventBus as pf, EvolutionGeneration as pi, QuestionPolicy as pl, dumbContinuationFailPrompt as pn, depthStrategy as po, BudgetPool as pr, LoopUntilSpec as ps, createInMemoryRunContext as pt, removeWorktree as pu, createSupervisor as q, AgenticOptions as qa, createWaterfallCollector as qc, DelegationStateCorruptError as qd, profileMaterializationAxes as qf, createSandboxLineage as qi, DEFAULT_SANDBOX_STEERING_MAX_TURNS as ql, allWorkersStalled as qn, ObserveInput as qo, filterAuthoredAsserts as qr, ShapeBudget as qs, SupervisorAgentDeps as qt, formatDetachedSessionRef as qu, CreateSandboxOptions$1 as r, AcquireOptions as ra, LeaderboardScenario as rc, DelegationTaskQueueOptions as rd, NotFoundError as rf, CollectedAgentTurn as ri, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as rl, SupervisorSpanOptions as rn, Strategy as ro, bestDelivered as rr, EqualKArm as rs, supervisorRunsRoot as rt, WorktreeHarnessResult as ru, makeFinding$1 as s, PromotionGateOptions as sa, CompletionAnalyst as sc, DelegateCodeArgs as sd, CoderOutput as sf, ChampionPick as si, DownMessageEvent as sl, PromptHandle as sn, StrategyResult as so, runTree as sr, Fanout as ss, workerInboxFileFromEventDir as st, DiffResult as su, AgentProfile$2 as t, SandboxCapabilities as ta, LeaderboardIterationInfo as tc, DelegationRunContext as td, ConfigError as tf, AgentTurnBackend as ti, CoordinationTools as tl, supervisorAgent as tn, ShotPersona as to, worktreeCliProfileMaterialization as tp, FinalizerSettled as tr, CorpusFilter as ts, safeWorkerFile as tt, WorktreeCheckRunner as tu, SuperviseSurfaceOptions as u, equalKOnCost as ua, CompletionVerdict as uc, DelegateFeedbackArgs as ud, BusStats as uf, EvolutionAuthor as ui, QuestionDecision as ul, analyzesFindingsReportPrompt as un, adaptiveRefine as uo, CoordinationOwnerId as ur, FanoutWinnerSelector as us, InMemoryRunContextOptions as ut, WorktreeHandle as uu, worktreeFanout as v, InMemoryCorpus as va, Leaderboard as vc, DelegateUiAuditRoute as vd, gateOnDeliverable as vf, pickChampion as vi, WorkerWatchOptions as vl, promptHandle as vn, LoopCampaignDispatchOptions as vo, createBudgetPool as vr, PanelVerdict as vs, createWorktreeCliExecutor as vt, FeedbackEvent as vu, composeWorkerEvidence as w, pipeline as wa, ScoreOf as wc, DelegationProfile as wd, SpawnForestEvent as wf, authorStrategy as wi, createInProcessTransport as wl, RollingDispatchOptions as wn, RunLoopOptions as wo, assessAuthoredProfile as wr, ScopeAnalyzeInput as ws, GraphEdge as wt, CoderReviewer as wu, VERIFY_TAIL_CHARS as x, flatWidenGate as xa, PairwiseOptions as xc, DelegationHistoryArgs as xd, InMemoryResultBlobStore as xf, AuthorStrategyOptions as xi, normalizeAnalyzeOnSettle as xl, DispatchReport as xn, loopCampaignDispatch as xo, ProfileRichness as xr, RenderCorpusToInstructions as xs, AgentGraph as xt, eventToSnapshot as xu, EVIDENCE_MAX_CHARS as y, renderCorpusToInstructions as ya, LeaderboardOptions as yc, DelegationError as yd, FileResultBlobStore as yf, runStrategyEvolution as yi, canonicalFindingEvent as yl, supervisorPolicyPrompt as yn, LoopDispatchOptions as yo, spendFromUsageEvents as yr, Pipeline as ys, assertModelAllowed as yt, FeedbackStore as yu, TrajectoryAnalysis as z, BenchmarkConfig as za, anytimeReport as zc, DelegationTraceCaps as zd, KnownAgentProfileMaterializationAxis as zf, SandboxRunAbortError as zi, ExecutorConfig as zl, PlateauOptions as zn, InProcessPromptCtx as zo, StructuralRolloutPolicy as zr, DefinePersonaInput as zs, workerFromBackend as zt, DetachedSessionRefParts as zu };
8485
- //# sourceMappingURL=index-EdjCQBV9.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