@tangle-network/agent-runtime 0.153.2 → 0.156.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 (85) hide show
  1. package/dist/{activation-Bbic0THc.js → activation-B4fRz8QL.js} +3 -3
  2. package/dist/{activation-Bbic0THc.js.map → activation-B4fRz8QL.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{authoring-CcVhJ1lP.js → authoring-C4uCoDmO.js} +2 -2
  6. package/dist/{authoring-CcVhJ1lP.js.map → authoring-C4uCoDmO.js.map} +1 -1
  7. package/dist/candidate-execution/index.js +4 -4
  8. package/dist/{candidate-execution-DYOB1juU.js → candidate-execution-Ic92NMl9.js} +4 -4
  9. package/dist/{candidate-execution-DYOB1juU.js.map → candidate-execution-Ic92NMl9.js.map} +1 -1
  10. package/dist/{conversation-BHMwAiMo.js → conversation-DLYKdh6W.js} +4 -4
  11. package/dist/{conversation-BHMwAiMo.js.map → conversation-DLYKdh6W.js.map} +1 -1
  12. package/dist/conversation.d.ts +1 -1
  13. package/dist/conversation.js +1 -1
  14. package/dist/durable.d.ts +2 -2
  15. package/dist/durable.js +1 -1
  16. package/dist/{environment-provider-DJG0yIYl.d.ts → environment-provider-C_QI6VCG.d.ts} +2 -2
  17. package/dist/{environment-provider-3eCszBEm.js → environment-provider-Dz9JB-X_.js} +2 -2
  18. package/dist/{environment-provider-3eCszBEm.js.map → environment-provider-Dz9JB-X_.js.map} +1 -1
  19. package/dist/environment-provider.d.ts +1 -1
  20. package/dist/environment-provider.js +1 -1
  21. package/dist/{executable-spec-BUcUcEPk.js → executable-spec-7ovS7PBo.js} +2 -2
  22. package/dist/{executable-spec-BUcUcEPk.js.map → executable-spec-7ovS7PBo.js.map} +1 -1
  23. package/dist/{graph-CIh2HDmH.js → graph-BibNm6a-.js} +3 -3
  24. package/dist/{graph-CIh2HDmH.js.map → graph-BibNm6a-.js.map} +1 -1
  25. package/dist/{improvement-cycle-GCDSsTN6.js → improvement-cycle-g6RsxGbg.js} +6 -6
  26. package/dist/{improvement-cycle-GCDSsTN6.js.map → improvement-cycle-g6RsxGbg.js.map} +1 -1
  27. package/dist/{index-DLn9WI-f.d.ts → index-B2A_KtAZ.d.ts} +23 -9
  28. package/dist/{index-lMADJLfq.d.ts → index-BYGBIxtx.d.ts} +4 -4
  29. package/dist/{index-rxVSm9-z.d.ts → index-DPFUNEdU.d.ts} +2 -2
  30. package/dist/index.d.ts +7 -7
  31. package/dist/index.js +13 -13
  32. package/dist/intelligence.d.ts +4 -4
  33. package/dist/intelligence.js +6 -6
  34. package/dist/kernel.d.ts +5 -5
  35. package/dist/kernel.js +9 -9
  36. package/dist/{knowledge-CaY53BW2.js → knowledge-DeP-wG8l.js} +5 -5
  37. package/dist/{knowledge-CaY53BW2.js.map → knowledge-DeP-wG8l.js.map} +1 -1
  38. package/dist/knowledge.d.ts +1 -1
  39. package/dist/knowledge.js +1 -1
  40. package/dist/{loop-runner-bin-BwPqxKhR.d.ts → loop-runner-bin-9VUQihh7.d.ts} +3 -3
  41. package/dist/{loop-runner-bin-Dw43kB_-.js → loop-runner-bin-LvaprzUz.js} +3 -3
  42. package/dist/{loop-runner-bin-Dw43kB_-.js.map → loop-runner-bin-LvaprzUz.js.map} +1 -1
  43. package/dist/loop-runner-bin.d.ts +1 -1
  44. package/dist/loop-runner-bin.js +1 -1
  45. package/dist/{materialization-Dl9J8ek4.js → materialization-Ct3I4wu3.js} +22 -3
  46. package/dist/{materialization-Dl9J8ek4.js.map → materialization-Ct3I4wu3.js.map} +1 -1
  47. package/dist/mcp/bin.js +3 -3
  48. package/dist/mcp/index.d.ts +5 -5
  49. package/dist/mcp/index.js +5 -5
  50. package/dist/{openai-tools-C4XKuK4t.js → openai-tools-CkSQJppW.js} +2 -2
  51. package/dist/{openai-tools-C4XKuK4t.js.map → openai-tools-CkSQJppW.js.map} +1 -1
  52. package/dist/{prepare-C5tI-H4o.js → prepare-DcMjMdj-.js} +19 -14
  53. package/dist/prepare-DcMjMdj-.js.map +1 -0
  54. package/dist/primeintellect/index.d.ts +1 -1
  55. package/dist/{protected-model-port-DHDKNeY7.js → protected-model-port-BzUkspPP.js} +2 -2
  56. package/dist/{protected-model-port-DHDKNeY7.js.map → protected-model-port-BzUkspPP.js.map} +1 -1
  57. package/dist/{redact-NAptmqKw.d.ts → redact-BT7-mX8G.d.ts} +3 -3
  58. package/dist/{runtime--Jsq8JCC.js → runtime-D-NDRp4y.js} +24 -12
  59. package/dist/runtime-D-NDRp4y.js.map +1 -0
  60. package/dist/{runtime-B-5dp5Iz.d.ts → runtime-DuueBLeO.d.ts} +4 -4
  61. package/dist/{snapshot-cK9K420n.js → snapshot-CTAf4uuA.js} +8 -3
  62. package/dist/snapshot-CTAf4uuA.js.map +1 -0
  63. package/dist/{spawn-journal-BLnveCRS.js → spawn-journal-duo0EkOp.js} +2 -2
  64. package/dist/{spawn-journal-BLnveCRS.js.map → spawn-journal-duo0EkOp.js.map} +1 -1
  65. package/dist/{stream-agent-turn-BGyszuPH.d.ts → stream-agent-turn-BbcwWw_J.d.ts} +2 -2
  66. package/dist/{stream-agent-turn-DYi8ymsU.js → stream-agent-turn-FRZAuXAL.js} +3 -3
  67. package/dist/{stream-agent-turn-DYi8ymsU.js.map → stream-agent-turn-FRZAuXAL.js.map} +1 -1
  68. package/dist/{structural-rollout-D7V-HgXJ.js → structural-rollout-B1TocSdq.js} +5 -5
  69. package/dist/{structural-rollout-D7V-HgXJ.js.map → structural-rollout-B1TocSdq.js.map} +1 -1
  70. package/dist/{supervise-k_8VOASb.js → supervise-BVE0XAJa.js} +44 -64
  71. package/dist/supervise-BVE0XAJa.js.map +1 -0
  72. package/dist/{supervisor-CMZsJ7Wn.js → supervisor-BmXD0WCJ.js} +25 -28
  73. package/dist/supervisor-BmXD0WCJ.js.map +1 -0
  74. package/dist/testing.d.ts +2 -2
  75. package/dist/testing.js +12 -12
  76. package/dist/{types-BPQhQRrC.d.ts → types-Cz5mCGlY.d.ts} +4 -4
  77. package/dist/{workspace-archive-B9ui4rrR.js → workspace-archive-bugA3OwU.js} +2 -13
  78. package/dist/workspace-archive-bugA3OwU.js.map +1 -0
  79. package/package.json +1 -1
  80. package/dist/prepare-C5tI-H4o.js.map +0 -1
  81. package/dist/runtime--Jsq8JCC.js.map +0 -1
  82. package/dist/snapshot-cK9K420n.js.map +0 -1
  83. package/dist/supervise-k_8VOASb.js.map +0 -1
  84. package/dist/supervisor-CMZsJ7Wn.js.map +0 -1
  85. package/dist/workspace-archive-B9ui4rrR.js.map +0 -1
@@ -1,11 +1,11 @@
1
- import { S as runtimeOwnedScopeOwnerRuntime, _ as runtimeOwnedDriveHarnessProviderEvidence, b as runtimeOwnedExecutorProviderEvidence, d as recordRuntimeOwnedDriveHarnessProviderEvidence, i as attestRuntimeOwnedScopeOwner, s as inheritRuntimeOwnedExecutorAttestation, v as runtimeOwnedExecutorExecutionBinding, x as runtimeOwnedPendingExecutorMaterialization, y as runtimeOwnedExecutorMaterialization } from "./materialization-Dl9J8ek4.js";
1
+ import { C as runtimeOwnedScopeOwnerRuntime, S as runtimeOwnedPendingExecutorMaterialization, b as runtimeOwnedExecutorMaterialization, d as providerAttemptEvidence, f as recordRuntimeOwnedDriveHarnessProviderEvidence, i as attestRuntimeOwnedScopeOwner, s as inheritRuntimeOwnedExecutorAttestation, v as runtimeOwnedDriveHarnessProviderEvidence, x as runtimeOwnedExecutorProviderEvidence, y as runtimeOwnedExecutorExecutionBinding } from "./materialization-Ct3I4wu3.js";
2
2
  import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError, o as NotFoundError, r as BackendTransportError, t as AgentEvalError$1 } from "./errors-CDZ8XsVj.js";
3
- import { t as detachedSnapshot } from "./snapshot-cK9K420n.js";
4
- import { b as workerTraceAnalysisStore, i as InMemorySpawnJournal, n as FileSpawnJournal, r as InMemoryResultBlobStore, t as FileResultBlobStore, x as contentAddress, y as parseWorkerToolTraceArtifact } from "./spawn-journal-BLnveCRS.js";
3
+ import { n as detachedSnapshot, t as detachedFrozen } from "./snapshot-CTAf4uuA.js";
4
+ import { b as workerTraceAnalysisStore, i as InMemorySpawnJournal, n as FileSpawnJournal, r as InMemoryResultBlobStore, t as FileResultBlobStore, x as contentAddress, y as parseWorkerToolTraceArtifact } from "./spawn-journal-duo0EkOp.js";
5
5
  import { _ as unmeteredSpend, r as chargedTokens, u as promptCacheTokenClasses } from "./util-D6ZEuBMi.js";
6
6
  import { i as writeAllBytes, n as parseCommittedJsonLines, r as prepareJsonlAppend, t as isNoEntError } from "./jsonl-file-CDfsCI5s.js";
7
7
  import { a as concreteProfileModel, c as profileModelExecutionSettings, d as agentHarness, f as harnessRunsAgent, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile } from "./model-policy-Sw4ywhtL.js";
8
- import { B as createExecutorRegistry, D as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, F as bridgeRuntimeAttachmentsKey, I as bridgeStopSignalKey, L as captureReusableExecutorConfig, Lt as generateSpanId, M as bindReusableExecutorExecutionId, N as bridgeAdmissionRead, O as teardownExecutor, P as bridgeModelRouteRefusal, Pt as createOtelExporter, St as runBrainLoop, U as WORKER_TRACE_PROPAGATION, V as snapshotExecutorConfig, Vt as toOtelAttributes, _n as unsupportedProfileDimensions, a as pickBestDelivered, an as assertProfileMaterialization, c as driverChild, cn as fullProfileMaterialization, d as deriveNodeExecutionIdentity, dn as promptModelProfileMaterialization, dt as isLiveNodeStatus, f as meterRuntimeOwnedAccounting, ft as isTerminalNodeStatus, h as scopeOwnerExecutorNodeContext, hn as renderUnsupported, j as spendFromUsageEvents, jt as buildLoopSpanNodes, k as assertValidBudget, l as withDriverExecutor, ln as profileMaterializationAxes$1, m as recordScopeOwnerMaterialization, n as createSupervisor, nt as createInbox, o as runFinalizer, on as controlProfileMaterialization, p as meterRuntimeOwnedProviderAttempt, r as bestDelivered, s as runTree, sn as defineProfileMaterializationContract, st as createPeerMailbox, t as createRootHandle, un as promptControlProfileMaterialization, w as freeSlots, xt as routerBrain, yn as worktreeCliProfileMaterialization, z as createExecutor } from "./supervisor-CMZsJ7Wn.js";
8
+ import { B as createExecutorRegistry, D as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, F as bridgeRuntimeAttachmentsKey, I as bridgeStopSignalKey, L as captureReusableExecutorConfig, Lt as generateSpanId, M as bindReusableExecutorExecutionId, N as bridgeAdmissionRead, O as teardownExecutor, P as bridgeModelRouteRefusal, Pt as createOtelExporter, St as runBrainLoop, U as WORKER_TRACE_PROPAGATION, V as snapshotExecutorConfig, Vt as toOtelAttributes, _n as unsupportedProfileDimensions, a as pickBestDelivered, an as assertProfileMaterialization, c as driverChild, cn as fullProfileMaterialization, d as deriveNodeExecutionIdentity, dn as promptModelProfileMaterialization, dt as isLiveNodeStatus, f as meterRuntimeOwnedAccounting, ft as isTerminalNodeStatus, h as scopeOwnerExecutorNodeContext, hn as renderUnsupported, j as spendFromUsageEvents, jt as buildLoopSpanNodes, k as assertValidBudget, l as withDriverExecutor, ln as profileMaterializationAxes$1, m as recordScopeOwnerMaterialization, n as createSupervisor, nt as createInbox, o as runFinalizer, on as controlProfileMaterialization, p as meterRuntimeOwnedProviderAttempt, r as bestDelivered, s as runTree, sn as defineProfileMaterializationContract, st as createPeerMailbox, t as createRootHandle, un as promptControlProfileMaterialization, w as freeSlots, xt as routerBrain, yn as worktreeCliProfileMaterialization, z as createExecutor } from "./supervisor-BmXD0WCJ.js";
9
9
  import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
10
10
  import { C as writeWorkerCancellation, S as writeRunCancellation, a as readRunCancelRequest, c as readWorkerCancellation, o as readRunCancellation, s as readWorkerCancelRequests } from "./run-layout-C2jgwsCq.js";
11
11
  import { t as createStdioToolServer } from "./tool-server-DEmLr9YY.js";
@@ -143,6 +143,10 @@ function createEventBus(now = Date.now) {
143
143
  *
144
144
  * @experimental
145
145
  */
146
+ /** Where a question this driver cannot answer goes next. `answer_question` accepts these and
147
+ * nothing else, so the decision type states them and nothing else. */
148
+ const questionEscalationTargets = ["parent", "user"];
149
+ const isQuestionEscalationTarget = (value) => questionEscalationTargets.includes(value);
146
150
  /** Producer-side cleanliness for the `finding` event. The findings payload is arbitrary analyst
147
151
  * output, the digest a subscriber computes (RFC 8785) throws on ANY `undefined` value — nested
148
152
  * included — and a throwing subscriber leaves the event invisible to EVERY subscriber. The
@@ -380,7 +384,7 @@ let spawnProfileArgCache;
380
384
  * keeps the conversion total: the canonical schema contains transforms with no JSON Schema form,
381
385
  * and zod's default is to throw on them, which would leave the tool with no published shape. */
382
386
  function spawnProfileArg() {
383
- if (!spawnProfileArgCache) spawnProfileArgCache = deepFreeze(deriveSpawnProfileArg(agentProfileSchema.toJSONSchema({
387
+ if (!spawnProfileArgCache) spawnProfileArgCache = detachedFrozen(deriveSpawnProfileArg(agentProfileSchema.toJSONSchema({
384
388
  io: "input",
385
389
  target: "draft-07",
386
390
  unrepresentable: "any"
@@ -432,7 +436,7 @@ function createCoordinationTools(opts) {
432
436
  trace,
433
437
  ...resumed ? { resumed: true } : {}
434
438
  };
435
- return deepFreezeDetached(settled.kind === "done" ? {
439
+ return detachedFrozen(settled.kind === "done" ? {
436
440
  ...common,
437
441
  status: "done",
438
442
  spent: settled.spent,
@@ -457,7 +461,7 @@ function createCoordinationTools(opts) {
457
461
  const cb = opts.onEvent;
458
462
  bus.subscribe((rec) => cb(rec.event, rec));
459
463
  }
460
- const resumeEvents = opts.replaySettlements ? resumedWorkers.map((worker) => deepFreezeDetached({
464
+ const resumeEvents = opts.replaySettlements ? resumedWorkers.map((worker) => detachedFrozen({
461
465
  type: "settled",
462
466
  worker
463
467
  })) : [];
@@ -528,7 +532,7 @@ function createCoordinationTools(opts) {
528
532
  let analystRunOrdinal = 0;
529
533
  /** The `finding` event an analyst-agent settlement becomes: its settle OUTPUT is the findings
530
534
  * (a failed run publishes the failure as findings — degraded beats vanished). */
531
- const analystRunFinding = (run, settled) => deepFreezeDetached({
535
+ const analystRunFinding = (run, settled) => detachedFrozen({
532
536
  type: "finding",
533
537
  finding: canonicalFindingEvent({
534
538
  fromWorker: run.sourceWorker,
@@ -690,7 +694,7 @@ function createCoordinationTools(opts) {
690
694
  if (targetId === void 0) {
691
695
  await bus.publish({
692
696
  type: "steer",
693
- down: deepFreezeDetached({
697
+ down: detachedFrozen({
694
698
  receiptId: randomUUID(),
695
699
  toWorker: destination,
696
700
  instruction: text,
@@ -708,7 +712,7 @@ function createCoordinationTools(opts) {
708
712
  await recordInstruction(instruction);
709
713
  } catch (cause) {
710
714
  try {
711
- await sendDown("steer", deepFreezeDetached({
715
+ await sendDown("steer", detachedFrozen({
712
716
  receiptId: randomUUID(),
713
717
  toWorker: targetId,
714
718
  instruction: text,
@@ -784,7 +788,7 @@ function createCoordinationTools(opts) {
784
788
  } : {
785
789
  settled,
786
790
  worker,
787
- event: deepFreezeDetached({
791
+ event: detachedFrozen({
788
792
  type: "settled",
789
793
  worker
790
794
  }),
@@ -810,7 +814,7 @@ function createCoordinationTools(opts) {
810
814
  } : {
811
815
  settled,
812
816
  worker,
813
- event: deepFreezeDetached({
817
+ event: detachedFrozen({
814
818
  type: "settled",
815
819
  worker
816
820
  }),
@@ -840,7 +844,7 @@ function createCoordinationTools(opts) {
840
844
  let authorizedInstruction = instruction;
841
845
  if (opts.authorizeDownMessage) {
842
846
  if (workerIdentity === void 0) throw new Error(`coordination tools: cannot authorize ${kind} for worker ${JSON.stringify(workerId)} without durable identity`);
843
- const decision = deepFreezeDetached(opts.authorizeDownMessage(deepFreezeDetached({
847
+ const decision = detachedFrozen(opts.authorizeDownMessage(detachedFrozen({
844
848
  kind,
845
849
  workerId,
846
850
  workerIdentity,
@@ -851,7 +855,7 @@ function createCoordinationTools(opts) {
851
855
  if (typeof decision !== "object" || decision === null || Array.isArray(decision) || typeof decision.instruction !== "string" || decision.instruction.length === 0) throw new Error("coordination tools: authorizeDownMessage must return an instruction");
852
856
  authorizedInstruction = decision.instruction;
853
857
  }
854
- return deepFreezeDetached({
858
+ return detachedFrozen({
855
859
  receiptId: randomUUID(),
856
860
  kind,
857
861
  toWorker: workerId,
@@ -873,7 +877,7 @@ function createCoordinationTools(opts) {
873
877
  /** Commit delivery intent after the authorization receipt and before `Scope.send`. An attempt with
874
878
  * no matching outcome after a crash is explicitly unknown and must never be replayed. */
875
879
  const recordDeliveryAttempt = async (instruction) => {
876
- const attempt = deepFreezeDetached({
880
+ const attempt = detachedFrozen({
877
881
  receiptId: instruction.receiptId,
878
882
  kind: instruction.kind,
879
883
  toWorker: instruction.toWorker,
@@ -907,7 +911,7 @@ function createCoordinationTools(opts) {
907
911
  outcome = "runtime-error";
908
912
  error = cause instanceof Error ? cause.message : String(cause);
909
913
  }
910
- const down = deepFreezeDetached({
914
+ const down = detachedFrozen({
911
915
  receiptId: instruction.receiptId,
912
916
  toWorker: instruction.toWorker,
913
917
  instruction: instruction.instruction,
@@ -1207,7 +1211,7 @@ function createCoordinationTools(opts) {
1207
1211
  message: issue.message
1208
1212
  }))
1209
1213
  });
1210
- const profile = deepFreezeDetached(parsedProfile.data);
1214
+ const profile = detachedFrozen(parsedProfile.data);
1211
1215
  const continuity = resolveContinuity(parseContinuity(a.continuity), profile.name, key);
1212
1216
  if ("error" in continuity) return Promise.resolve({
1213
1217
  error: continuity.error,
@@ -1215,7 +1219,7 @@ function createCoordinationTools(opts) {
1215
1219
  live: liveWorkerCount(),
1216
1220
  freeSlots: freeWorkerSlots()
1217
1221
  });
1218
- const task = deepFreezeDetached(a.task);
1222
+ const task = detachedFrozen(a.task);
1219
1223
  const label = typeof a.label === "string" ? a.label : "worker";
1220
1224
  if (opts.preflightSpawn) {
1221
1225
  const refusal = await opts.preflightSpawn(profile, {
@@ -1433,7 +1437,7 @@ function createCoordinationTools(opts) {
1433
1437
  deferReason: { type: "string" },
1434
1438
  escalateTo: {
1435
1439
  type: "string",
1436
- enum: ["parent", "user"]
1440
+ enum: questionEscalationTargets
1437
1441
  },
1438
1442
  escalateReason: { type: "string" }
1439
1443
  },
@@ -1468,7 +1472,8 @@ function createCoordinationTools(opts) {
1468
1472
  kind: "defer",
1469
1473
  reason: a.deferReason
1470
1474
  }) });
1471
- if (a.escalateTo === "parent" || a.escalateTo === "user") {
1475
+ if (typeof a.escalateTo === "string" && a.escalateTo.length > 0) {
1476
+ if (!isQuestionEscalationTarget(a.escalateTo)) throw new Error(`answer_question: escalateTo must be one of ${questionEscalationTargets.join(", ")}; received ${JSON.stringify(a.escalateTo)}`);
1472
1477
  const escalateReason = typeof a.escalateReason === "string" && a.escalateReason.length > 0 ? a.escalateReason : "driver escalated";
1473
1478
  return Promise.resolve({ question: decideQuestion(questionId, {
1474
1479
  kind: "escalate",
@@ -1699,9 +1704,6 @@ function nextUnkeyedAssignmentOrdinal(scope) {
1699
1704
  if (!Number.isSafeInteger(next)) throw new Error("coordination: durable assignment ordinal space is exhausted");
1700
1705
  return next;
1701
1706
  }
1702
- function deepFreezeDetached(value) {
1703
- return deepFreeze(structuredClone(value));
1704
- }
1705
1707
  /** Stringify a findings payload for a routed delivery; never throws (a cyclic payload degrades to
1706
1708
  * its String form rather than killing the settle path). */
1707
1709
  function safeJsonText(value) {
@@ -1712,12 +1714,6 @@ function safeJsonText(value) {
1712
1714
  return String(value);
1713
1715
  }
1714
1716
  }
1715
- function deepFreeze(value, seen = /* @__PURE__ */ new Set()) {
1716
- if (value === null || typeof value !== "object" || seen.has(value)) return value;
1717
- seen.add(value);
1718
- for (const child of Object.values(value)) deepFreeze(child, seen);
1719
- return Object.freeze(value);
1720
- }
1721
1717
  //#endregion
1722
1718
  //#region src/runtime/supervise/completion-gate.ts
1723
1719
  /**
@@ -2805,20 +2801,6 @@ function deadlinePassed(scope, now) {
2805
2801
  const b = scope.budget;
2806
2802
  return b.deadlineMs > 0 && now() >= b.deadlineMs;
2807
2803
  }
2808
- function providerAttemptEvidence$1(model) {
2809
- const attempts = Object.freeze([Object.freeze({ observations: Object.freeze(model === void 0 ? [] : [model]) })]);
2810
- const models = Object.freeze(model === void 0 ? [] : [model]);
2811
- return Object.freeze(model === void 0 ? {
2812
- status: "unknown",
2813
- attempts,
2814
- models,
2815
- reason: "provider-model-missing"
2816
- } : {
2817
- status: "known",
2818
- attempts,
2819
- models
2820
- });
2821
- }
2822
2804
  /** The USD-denominated members of {@link PromptCacheUsage} — the schema, not a guess. Every
2823
2805
  * other known member (`readTokens`, `writeTokens`, `missTokens`) is a token COUNT. */
2824
2806
  const PROMPT_CACHE_USD_FIELDS = /* @__PURE__ */ new Set(["readSavingsUsd"]);
@@ -3214,7 +3196,7 @@ function driverAgent(opts) {
3214
3196
  res = await opts.brain(messages, tools, callContext);
3215
3197
  } catch (error) {
3216
3198
  opts.onProviderModel?.(void 0);
3217
- await meterRuntimeOwnedProviderAttempt(scope, unmeteredSpend(0), providerAttemptEvidence$1(void 0), {
3199
+ await meterRuntimeOwnedProviderAttempt(scope, unmeteredSpend(0), providerAttemptEvidence(void 0), {
3218
3200
  driver: opts.name,
3219
3201
  inferenceFailed: true,
3220
3202
  call,
@@ -3245,7 +3227,7 @@ function driverAgent(opts) {
3245
3227
  usd: trustedCost ? res.costUsd ?? 0 : 0,
3246
3228
  ...trustedCost && res.costUsd !== void 0 ? {} : { usdKnown: false },
3247
3229
  ms: 0
3248
- }, providerAttemptEvidence$1(res.model), {
3230
+ }, providerAttemptEvidence(res.model), {
3249
3231
  driver: opts.name,
3250
3232
  call,
3251
3233
  callId: callContext.callId,
@@ -4869,6 +4851,18 @@ function defaultEstimate(args) {
4869
4851
  return PER_LENS_PER_ROUTE_ESTIMATE_MS * lenses * routes;
4870
4852
  }
4871
4853
  //#endregion
4854
+ //#region src/mcp/types.ts
4855
+ /**
4856
+ * Every delegation profile a queued record can carry. One owner: the tool schemas and validators
4857
+ * that filter on a profile read this list, so a profile added here cannot be one a tool refuses.
4858
+ * @experimental
4859
+ */
4860
+ const delegationProfiles = [
4861
+ "coder",
4862
+ "researcher",
4863
+ "ui-auditor"
4864
+ ];
4865
+ //#endregion
4872
4866
  //#region src/mcp/tools/delegation-history.ts
4873
4867
  /** MCP tool name for the `delegation_history` read-past-delegations tool. @stable */
4874
4868
  const DELEGATION_HISTORY_TOOL_NAME = "delegation_history";
@@ -4888,7 +4882,7 @@ const DELEGATION_HISTORY_DESCRIPTION = [
4888
4882
  "Each entry carries `hasTrace` — when true, the full loop-trace span tree",
4889
4883
  "is retrievable via delegation_status { taskId, includeTrace: true }.",
4890
4884
  "",
4891
- "Filters: `namespace` (multi-tenant scope), `profile` (\"coder\" | \"researcher\"),",
4885
+ `Filters: \`namespace\` (multi-tenant scope), \`profile\` (${delegationProfiles.map((profile) => `"${profile}"`).join(" | ")}),`,
4892
4886
  "`since` (ISO date — only delegations started at-or-after). `limit` defaults",
4893
4887
  "to 50, capped at 500."
4894
4888
  ].join("\n");
@@ -4899,7 +4893,7 @@ const DELEGATION_HISTORY_INPUT_SCHEMA = {
4899
4893
  namespace: { type: "string" },
4900
4894
  profile: {
4901
4895
  type: "string",
4902
- enum: ["coder", "researcher"]
4896
+ enum: delegationProfiles
4903
4897
  },
4904
4898
  since: {
4905
4899
  type: "string",
@@ -4924,7 +4918,7 @@ function validateDelegationHistoryArgs(raw) {
4924
4918
  out.namespace = value.namespace;
4925
4919
  }
4926
4920
  if (value.profile !== void 0) {
4927
- if (value.profile !== "coder" && value.profile !== "researcher") throw new TypeError("delegation_history: `profile` must be \"coder\" or \"researcher\"");
4921
+ if (!delegationProfiles.includes(value.profile)) throw new TypeError(`delegation_history: \`profile\` must be one of ${delegationProfiles.join(", ")}`);
4928
4922
  out.profile = value.profile;
4929
4923
  }
4930
4924
  if (value.since !== void 0) {
@@ -6604,20 +6598,6 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns)
6604
6598
  function isAsyncIterable(value) {
6605
6599
  return value !== null && typeof value === "object" && Symbol.asyncIterator in value && typeof value[Symbol.asyncIterator] === "function";
6606
6600
  }
6607
- function providerAttemptEvidence(model) {
6608
- const attempts = Object.freeze([Object.freeze({ observations: Object.freeze(model === void 0 ? [] : [model]) })]);
6609
- const models = Object.freeze(model === void 0 ? [] : [model]);
6610
- return Object.freeze(model === void 0 ? {
6611
- status: "unknown",
6612
- attempts,
6613
- models,
6614
- reason: "provider-model-missing"
6615
- } : {
6616
- status: "known",
6617
- attempts,
6618
- models
6619
- });
6620
- }
6621
6601
  /** Resolve one option that may be given as a value OR as a name into `opts.registry`. Both failure
6622
6602
  * modes name the option, the requested name, and the table it was looked up in — a typo must not
6623
6603
  * degrade into a silently unconfigured run (which for `deliverable` means "no run can ever
@@ -7207,6 +7187,6 @@ function rootProviderModelEvidenceFromExecution(evidence) {
7207
7187
  return evidence ?? rootProviderModelEvidence([]);
7208
7188
  }
7209
7189
  //#endregion
7210
- export { DELEGATION_TRACE_MAX_BYTES as $, DELEGATION_HISTORY_INPUT_SCHEMA as A, mapExecutorResult as At, DELEGATE_FEEDBACK_INPUT_SCHEMA as B, createMcpServer as C, plateauLength as Ct, createDelegationStatusHandler as D, FileCoordinationLog as Dt, DELEGATION_STATUS_TOOL_NAME as E, createInMemoryRunContext as Et, DELEGATE_UI_AUDIT_INPUT_SCHEMA as F, createEventBus as Ft, DELEGATE_INPUT_SCHEMA as G, createDelegateFeedbackHandler as H, DELEGATE_UI_AUDIT_TOOL_NAME as I, defaultToolDetectors as It, validateDelegateArgs as J, DELEGATE_TOOL_NAME as K, createDelegateUiAuditHandler as L, watchTrace as Lt, createDelegationHistoryHandler as M, canonicalFindingEvent as Mt, validateDelegationHistoryArgs as N, createCoordinationTools as Nt, validateDelegationStatusArgs as O, createSupervisorSpanRecorder as Ot, DELEGATE_UI_AUDIT_DESCRIPTION as P, normalizeAnalyzeOnSettle as Pt, hashIdempotencyInput as Q, validateDelegateUiAuditArgs as R, createInProcessTransport as S, bestSoFar as St, DELEGATION_STATUS_INPUT_SCHEMA as T, createFileRunContext as Tt, validateDelegateFeedbackArgs as U, DELEGATE_FEEDBACK_TOOL_NAME as V, DELEGATE_DESCRIPTION as W, delegate as X, defaultDelegateBudget as Y, DelegationTaskQueue as Z, promptHandle as _, noProgressFor as _t, assertCoordinationBinding as a, DelegationPersistenceError as at, classifyDriverFailure as b, anytimeReport as bt, supervisorAgentWithTestBrain as c, InMemoryDelegationStore as ct, delegatesWorkerBriefPrompt as d, driverAgent as dt, DELEGATION_TRACE_MAX_SPANS as et, dumbContinuationFailPrompt as f, finalizeBestDelivered as ft, naiveContinuationPrompt as g, createProgressTracker as gt, kernelPromptRegistry as h, anyOf as ht, workerFromBackend as i, createDelegationTraceCollector as it, DELEGATION_HISTORY_TOOL_NAME as j, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as jt, DELEGATION_HISTORY_DESCRIPTION as k, gateOnDeliverable as kt, analyzesFindingsReportPrompt as l, InMemoryFeedbackStore as lt, formatPromptHandle as m, allWorkersStalled as mt, supervise as n, capDelegationTrace as nt, resolveSupervisorProfile as o, DelegationStateCorruptError as ot, dumbContinuationPassPrompt as p, allOf as pt, createDelegateHandler as q, superviseWithTestBrain as r, composeLoopTraceEmitters as rt, supervisorAgent as s, FileDelegationStore as st, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, buildDelegationTraceSpans as tt, createPromptRegistry as u, eventToSnapshot as ut, supervisorPolicyPrompt as v, plateau as vt, DELEGATION_STATUS_DESCRIPTION as w, renderAnytimeTable as wt, serveCoordinationMcp as x, areaUnderCurve as xt, DriverAttemptsExhaustedError as y, sampleFromSettled as yt, DELEGATE_FEEDBACK_DESCRIPTION as z };
7190
+ export { hashIdempotencyInput as $, DELEGATION_HISTORY_INPUT_SCHEMA as A, gateOnDeliverable as At, DELEGATE_FEEDBACK_DESCRIPTION as B, createMcpServer as C, bestSoFar as Ct, createDelegationStatusHandler as D, createInMemoryRunContext as Dt, DELEGATION_STATUS_TOOL_NAME as E, createFileRunContext as Et, DELEGATE_UI_AUDIT_DESCRIPTION as F, normalizeAnalyzeOnSettle as Ft, DELEGATE_DESCRIPTION as G, DELEGATE_FEEDBACK_TOOL_NAME as H, DELEGATE_UI_AUDIT_INPUT_SCHEMA as I, questionEscalationTargets as It, createDelegateHandler as J, DELEGATE_INPUT_SCHEMA as K, DELEGATE_UI_AUDIT_TOOL_NAME as L, createEventBus as Lt, createDelegationHistoryHandler as M, DEFAULT_AWAIT_EVENT_TIMEOUT_MS as Mt, validateDelegationHistoryArgs as N, canonicalFindingEvent as Nt, validateDelegationStatusArgs as O, FileCoordinationLog as Ot, delegationProfiles as P, createCoordinationTools as Pt, DelegationTaskQueue as Q, createDelegateUiAuditHandler as R, defaultToolDetectors as Rt, createInProcessTransport as S, areaUnderCurve as St, DELEGATION_STATUS_INPUT_SCHEMA as T, renderAnytimeTable as Tt, createDelegateFeedbackHandler as U, DELEGATE_FEEDBACK_INPUT_SCHEMA as V, validateDelegateFeedbackArgs as W, defaultDelegateBudget as X, validateDelegateArgs as Y, delegate as Z, promptHandle as _, createProgressTracker as _t, assertCoordinationBinding as a, createDelegationTraceCollector as at, classifyDriverFailure as b, sampleFromSettled as bt, supervisorAgentWithTestBrain as c, FileDelegationStore as ct, delegatesWorkerBriefPrompt as d, eventToSnapshot as dt, DELEGATION_TRACE_MAX_BYTES as et, dumbContinuationFailPrompt as f, driverAgent as ft, naiveContinuationPrompt as g, anyOf as gt, kernelPromptRegistry as h, allWorkersStalled as ht, workerFromBackend as i, composeLoopTraceEmitters as it, DELEGATION_HISTORY_TOOL_NAME as j, mapExecutorResult as jt, DELEGATION_HISTORY_DESCRIPTION as k, createSupervisorSpanRecorder as kt, analyzesFindingsReportPrompt as l, InMemoryDelegationStore as lt, formatPromptHandle as m, allOf as mt, supervise as n, buildDelegationTraceSpans as nt, resolveSupervisorProfile as o, DelegationPersistenceError as ot, dumbContinuationPassPrompt as p, finalizeBestDelivered as pt, DELEGATE_TOOL_NAME as q, superviseWithTestBrain as r, capDelegationTrace as rt, supervisorAgent as s, DelegationStateCorruptError as st, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, DELEGATION_TRACE_MAX_SPANS as tt, createPromptRegistry as u, InMemoryFeedbackStore as ut, supervisorPolicyPrompt as v, noProgressFor as vt, DELEGATION_STATUS_DESCRIPTION as w, plateauLength as wt, serveCoordinationMcp as x, anytimeReport as xt, DriverAttemptsExhaustedError as y, plateau as yt, validateDelegateUiAuditArgs as z, watchTrace as zt };
7211
7191
 
7212
- //# sourceMappingURL=supervise-k_8VOASb.js.map
7192
+ //# sourceMappingURL=supervise-BVE0XAJa.js.map