@tangle-network/agent-runtime 0.181.0 → 0.183.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 (79) hide show
  1. package/dist/{activation-DQeqgV8K.js → activation-n31Hpe4r.js} +2 -2
  2. package/dist/{activation-DQeqgV8K.js.map → activation-n31Hpe4r.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +3 -3
  5. package/dist/{analyst-loop-35qyyDqP.js → analyst-loop-DCTra9Qy.js} +2 -2
  6. package/dist/{analyst-loop-35qyyDqP.js.map → analyst-loop-DCTra9Qy.js.map} +1 -1
  7. package/dist/analyst-loop.js +1 -1
  8. package/dist/{authoring-DN4xp35f.js → authoring-B05VmJoe.js} +4 -4
  9. package/dist/authoring-B05VmJoe.js.map +1 -0
  10. package/dist/{conversation-Dj-W5J1A.js → conversation-BSgEebIo.js} +2 -2
  11. package/dist/{conversation-Dj-W5J1A.js.map → conversation-BSgEebIo.js.map} +1 -1
  12. package/dist/conversation.js +1 -1
  13. package/dist/{coordination-driver-B_mNdx1I.js → coordination-driver-DwwFgEKZ.js} +19 -11
  14. package/dist/coordination-driver-DwwFgEKZ.js.map +1 -0
  15. package/dist/durable.d.ts +1 -1
  16. package/dist/durable.js +1 -1
  17. package/dist/{environment-provider-B6HqC4mh.js → environment-provider-C4elwcpo.js} +2 -2
  18. package/dist/{environment-provider-B6HqC4mh.js.map → environment-provider-C4elwcpo.js.map} +1 -1
  19. package/dist/environment-provider.js +1 -1
  20. package/dist/{graph-Ca4JV-Q6.js → graph-CJOhaZ35.js} +5 -5
  21. package/dist/graph-CJOhaZ35.js.map +1 -0
  22. package/dist/graph.d.ts +2 -2
  23. package/dist/graph.js +3 -3
  24. package/dist/{improvement-cycle-BEKM4E0T.js → improvement-cycle-xqQfqSpf.js} +5 -5
  25. package/dist/{improvement-cycle-BEKM4E0T.js.map → improvement-cycle-xqQfqSpf.js.map} +1 -1
  26. package/dist/{index-DhI31ODk.d.ts → index-BhtdFMnG.d.ts} +61 -19
  27. package/dist/{index-C137-hlN.d.ts → index-Dg2UXocB.d.ts} +3 -3
  28. package/dist/index.d.ts +5 -5
  29. package/dist/index.js +9 -9
  30. package/dist/intelligence.d.ts +2 -2
  31. package/dist/intelligence.js +4 -4
  32. package/dist/kernel.d.ts +3 -3
  33. package/dist/kernel.js +12 -12
  34. package/dist/{knowledge-DR0ap2Q9.js → knowledge-CRoESDWq.js} +3 -3
  35. package/dist/{knowledge-DR0ap2Q9.js.map → knowledge-CRoESDWq.js.map} +1 -1
  36. package/dist/knowledge.d.ts +1 -1
  37. package/dist/knowledge.js +1 -1
  38. package/dist/{loop-runner-bin-DcGlGmdV.js → loop-runner-bin-DBMN5QXW.js} +4 -4
  39. package/dist/{loop-runner-bin-DcGlGmdV.js.map → loop-runner-bin-DBMN5QXW.js.map} +1 -1
  40. package/dist/{loop-runner-bin-C7RGEVw0.d.ts → loop-runner-bin-NanoP_bG.d.ts} +2 -2
  41. package/dist/loop-runner-bin.d.ts +1 -1
  42. package/dist/loop-runner-bin.js +1 -1
  43. package/dist/mcp/bin.js +3 -3
  44. package/dist/mcp/index.d.ts +31 -4
  45. package/dist/mcp/index.js +52 -6
  46. package/dist/mcp/index.js.map +1 -1
  47. package/dist/{openai-tools-CalMJdQb.js → openai-tools-DcBRPkrK.js} +2 -2
  48. package/dist/{openai-tools-CalMJdQb.js.map → openai-tools-DcBRPkrK.js.map} +1 -1
  49. package/dist/primeintellect/index.d.ts +1 -1
  50. package/dist/{provision-supervisor-CZ-V1h03.js → provision-supervisor-BOy-x5Rn.js} +5 -5
  51. package/dist/{provision-supervisor-CZ-V1h03.js.map → provision-supervisor-BOy-x5Rn.js.map} +1 -1
  52. package/dist/{redact-pDUP8izr.d.ts → redact-BYcuQ6R_.d.ts} +2 -2
  53. package/dist/{runtime-DawGtqdw.d.ts → runtime-B-DLSfE5.d.ts} +54 -6
  54. package/dist/{runtime-B4sDmaCx.js → runtime-CDnK6T-T.js} +12 -12
  55. package/dist/{runtime-B4sDmaCx.js.map → runtime-CDnK6T-T.js.map} +1 -1
  56. package/dist/{sandbox-events-B2cWfjwu.js → sandbox-events-DGXLxiuX.js} +197 -8
  57. package/dist/sandbox-events-DGXLxiuX.js.map +1 -0
  58. package/dist/{stream-agent-turn-D-GzjvCl.js → stream-agent-turn-B5Cmq-u3.js} +47 -22
  59. package/dist/stream-agent-turn-B5Cmq-u3.js.map +1 -0
  60. package/dist/{structural-rollout-BKt0UfUL.js → structural-rollout-Cv_aUlFY.js} +3 -3
  61. package/dist/{structural-rollout-BKt0UfUL.js.map → structural-rollout-Cv_aUlFY.js.map} +1 -1
  62. package/dist/{supervise-DUS8td9n.js → supervise-OiFWCM75.js} +9 -9
  63. package/dist/supervise-OiFWCM75.js.map +1 -0
  64. package/dist/{supervisor-CC3qqrVo.js → supervisor-DyRbmn1C.js} +100 -68
  65. package/dist/supervisor-DyRbmn1C.js.map +1 -0
  66. package/dist/testing.d.ts +2 -2
  67. package/dist/testing.js +12 -12
  68. package/dist/tui/index.d.ts +1 -1
  69. package/dist/tui/index.js +1 -1
  70. package/package.json +1 -1
  71. package/skills/codemode/SKILL.md +1 -1
  72. package/skills/supervise/SKILL.md +2 -2
  73. package/dist/authoring-DN4xp35f.js.map +0 -1
  74. package/dist/coordination-driver-B_mNdx1I.js.map +0 -1
  75. package/dist/graph-Ca4JV-Q6.js.map +0 -1
  76. package/dist/sandbox-events-B2cWfjwu.js.map +0 -1
  77. package/dist/stream-agent-turn-D-GzjvCl.js.map +0 -1
  78. package/dist/supervise-DUS8td9n.js.map +0 -1
  79. package/dist/supervisor-CC3qqrVo.js.map +0 -1
@@ -3,10 +3,10 @@ import { c as RetainedInteractiveAdmissionError, d as RetainedRunDispatchBinding
3
3
  import { n as detachedSnapshot } from "./snapshot-CTAf4uuA.js";
4
4
  import { _ as captureWorkerTraceEvidence, a as aggregateProviderModelEvidence, c as loadSpawnForest, d as replaySpawnTree, f as attestNestedDriverTreeOwner, h as runtimeOwnedNestedDriverTreeRoot, l as materializeTreeView, m as nestedDriverTreeRoot, n as FileSpawnJournal, o as closesCursorSlot, p as driverRuntime, u as pendingWaits, x as contentAddress } from "./spawn-journal--N8Ten1q.js";
5
5
  import { _ as unmeteredSpend, a as cloneTokenUsage, b as zeroTokenUsage, d as randomSuffix, f as randomUuid, g as throwIfAborted, h as throwAbort, l as mapWithConcurrency, m as stringifySafe, n as addTokenUsage, o as deleteBoxSafe, p as sleep, r as chargedTokens, s as hasCompleteCacheBreakdown, t as addSpend, u as promptCacheTokenClasses, v as withTimeout, y as zeroSpend } from "./util-D6ZEuBMi.js";
6
- import { c as notifySandboxEventObserver, i as extractLlmCallEvent, l as sandboxEventServedBackend, m as parseCanonicalTransportEvent, p as extractTransportEventIdentity, r as createSandboxToolPartState, s as mapSandboxToolEvent, t as assertSandboxServedModel, u as sandboxProgressEvents } from "./sandbox-events-B2cWfjwu.js";
6
+ import { _ as parseCodexUsageRecord, c as mapSandboxToolEvent, d as sandboxProgressEvents, h as parseCanonicalTransportEvent, i as createSandboxUsageLedger, l as notifySandboxEventObserver, m as extractTransportEventIdentity, r as createSandboxToolPartState, t as assertSandboxServedModel, u as sandboxEventServedBackend } from "./sandbox-events-DGXLxiuX.js";
7
7
  import { n as executableAgentSpecSnapshot, r as projectSandboxOutcome, t as executableAgentProfileSnapshot } from "./executable-spec-CkGvdPds.js";
8
8
  import { a as concreteProfileModel, c as profileModelExecutionSettings, d as agentHarness, o as enforceTokenLimits, s as profileBridgeWireModel, t as assertExecutableAgentProfile, u as resolveRouterRetryPolicy } from "./model-policy-Sw4ywhtL.js";
9
- import { c as linkAbort, i as resolveAgentEnvironmentProvider, l as runAbortable, n as providerAsExecutor, r as providerAsSandboxClient, s as abortError$1 } from "./environment-provider-B6HqC4mh.js";
9
+ import { c as linkAbort, i as resolveAgentEnvironmentProvider, l as runAbortable, n as providerAsExecutor, r as providerAsSandboxClient, s as abortError$1 } from "./environment-provider-C4elwcpo.js";
10
10
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
11
11
  import { n as assertNoSymlinkDescendant, r as publishExclusiveDurableFile } from "./durable-file-g3YdfEh4.js";
12
12
  import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentNativeContextContinuationResultSchema, AgentTurnInputSchema, AgentTurnResultSchema, ContextTransferRequestSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, REASONING_EFFORTS, RuntimeEventEnvelopeSchema, TerminalReplayWindowSchema, TerminalSessionRefSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, exactAgentInteractiveSessionStart, harnessTypeSchema, nativeContextContinuationTurnDigest, nativeReasoningControl, profileMaterializationAxes, profileMaterializationAxes as profileMaterializationAxes$1, renderInputPartsAsText, sha256DigestSchema } from "@tangle-network/agent-interface";
@@ -1548,7 +1548,13 @@ function processGroupExists(processGroupId) {
1548
1548
  return true;
1549
1549
  }
1550
1550
  }
1551
- /** Parse and validate the one terminal usage event emitted by `codex exec --json`. */
1551
+ /**
1552
+ * Parse and validate the one terminal usage event emitted by `codex exec --json`.
1553
+ *
1554
+ * The JSONL framing is this surface's own; the usage RECORD is read by `parseCodexUsageRecord`,
1555
+ * the one codex usage reader the sandbox decoder also calls, so both surfaces hold the same field
1556
+ * policy and the same two cross-field invariants.
1557
+ */
1552
1558
  function parseCodexTokenUsage(stdout) {
1553
1559
  const completed = [];
1554
1560
  for (const [index, line] of stdout.split(/\r?\n/).entries()) {
@@ -1557,34 +1563,25 @@ function parseCodexTokenUsage(stdout) {
1557
1563
  try {
1558
1564
  event = JSON.parse(line);
1559
1565
  } catch {
1560
- throw new Error(`runLocalHarness: Codex JSONL line ${index + 1} is not valid JSON`);
1566
+ throw new ValidationError(`runLocalHarness: Codex JSONL line ${index + 1} is not valid JSON`);
1561
1567
  }
1562
1568
  if (isRecord(event) && event.type === "turn.completed") completed.push(event);
1563
1569
  }
1564
- if (completed.length !== 1) throw new Error(`runLocalHarness: expected exactly one Codex turn.completed usage event, received ${completed.length}`);
1570
+ if (completed.length !== 1) throw new ValidationError(`runLocalHarness: expected exactly one Codex turn.completed usage event, received ${completed.length}`);
1565
1571
  const event = completed[0];
1566
- if (!isRecord(event) || !isRecord(event.usage)) throw new Error("runLocalHarness: Codex turn.completed event is missing usage");
1567
- const usage = event.usage;
1568
- const inputTokens = naturalNumber(usage.input_tokens, "input_tokens");
1569
- const cachedInputTokens = naturalNumber(usage.cached_input_tokens, "cached_input_tokens");
1570
- const outputTokens = naturalNumber(usage.output_tokens, "output_tokens");
1571
- const reasoningOutputTokens = naturalNumber(usage.reasoning_output_tokens, "reasoning_output_tokens");
1572
- if (cachedInputTokens > inputTokens) throw new Error("runLocalHarness: Codex cached_input_tokens exceeds input_tokens");
1573
- if (reasoningOutputTokens > outputTokens) throw new Error("runLocalHarness: Codex reasoning_output_tokens exceeds output_tokens");
1572
+ if (!isRecord(event) || !isRecord(event.usage)) throw new ValidationError("runLocalHarness: Codex turn.completed event is missing usage");
1573
+ const record = parseCodexUsageRecord(event.usage, "runLocalHarness: Codex");
1574
1574
  return {
1575
- inputTokens,
1576
- cachedInputTokens,
1577
- outputTokens,
1578
- reasoningOutputTokens
1575
+ inputTokens: record.inputTokens,
1576
+ cachedInputTokens: record.cachedInputTokens,
1577
+ outputTokens: record.outputTokens,
1578
+ reasoningOutputTokens: record.reasoningOutputTokens,
1579
+ ...record.cacheWriteInputTokens === void 0 ? {} : { cacheWriteInputTokens: record.cacheWriteInputTokens }
1579
1580
  };
1580
1581
  }
1581
1582
  function isRecord(value) {
1582
1583
  return value !== null && typeof value === "object" && !Array.isArray(value);
1583
1584
  }
1584
- function naturalNumber(value, field) {
1585
- if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) throw new Error(`runLocalHarness: Codex usage.${field} must be a non-negative safe integer`);
1586
- return value;
1587
- }
1588
1585
  //#endregion
1589
1586
  //#region src/mcp/worktree.ts
1590
1587
  /**
@@ -4960,6 +4957,25 @@ async function executeIteration(args) {
4960
4957
  });
4961
4958
  let box;
4962
4959
  let lineageOwned = false;
4960
+ let sawLlmCall = false;
4961
+ const usageLedger = createSandboxUsageLedger(spec.profile.harness);
4962
+ const creditLlmCall = (llmCall) => {
4963
+ sawLlmCall = true;
4964
+ slot.costUsd += llmCall.costUsd ?? 0;
4965
+ if (llmCall.usdKnown === false) slot.costUsdKnown = false;
4966
+ if (llmCall.estimatedCostUsd !== void 0) slot.estimatedCostUsd = (slot.estimatedCostUsd ?? 0) + llmCall.estimatedCostUsd;
4967
+ if (llmCall.promptCache) {
4968
+ slot.promptCache ??= {};
4969
+ mergeUsageMetadata(slot.promptCache, llmCall.promptCache);
4970
+ }
4971
+ addTokenUsage(slot.tokenUsage, {
4972
+ input: llmCall.tokensIn,
4973
+ output: llmCall.tokensOut,
4974
+ ...llmCall.tokensKnown === false ? { tokensKnown: false } : {},
4975
+ ...promptCacheTokenClasses(llmCall.tokensIn, llmCall.promptCache)
4976
+ });
4977
+ args.ctx.runHandle?.observe(llmCall);
4978
+ };
4963
4979
  try {
4964
4980
  let stream;
4965
4981
  const source = args.lineagePlan?.[args.item.index - args.baseIndex];
@@ -5001,7 +5017,6 @@ async function executeIteration(args) {
5001
5017
  ...spec.profile.model?.provider !== void 0 ? { provider: spec.profile.model.provider } : {},
5002
5018
  ...requestedModel !== void 0 ? { model: requestedModel } : {}
5003
5019
  };
5004
- let sawLlmCall = false;
5005
5020
  const outcomeTracker = createAgentRunOutcomeTracker();
5006
5021
  for await (const event of stream) {
5007
5022
  events.push(event);
@@ -5010,26 +5025,12 @@ async function executeIteration(args) {
5010
5025
  iterationIndex: args.item.index,
5011
5026
  agentRunName: slot.agentRunName
5012
5027
  });
5013
- const llmCall = extractLlmCallEvent(event, slot.agentRunName);
5014
- if (llmCall) {
5015
- sawLlmCall = true;
5016
- slot.costUsd += llmCall.costUsd ?? 0;
5017
- if (llmCall.usdKnown === false) slot.costUsdKnown = false;
5018
- if (llmCall.estimatedCostUsd !== void 0) slot.estimatedCostUsd = (slot.estimatedCostUsd ?? 0) + llmCall.estimatedCostUsd;
5019
- if (llmCall.promptCache) {
5020
- slot.promptCache ??= {};
5021
- mergeUsageMetadata(slot.promptCache, llmCall.promptCache);
5022
- }
5023
- addTokenUsage(slot.tokenUsage, {
5024
- input: llmCall.tokensIn,
5025
- output: llmCall.tokensOut,
5026
- ...llmCall.tokensKnown === false ? { tokensKnown: false } : {},
5027
- ...promptCacheTokenClasses(llmCall.tokensIn, llmCall.promptCache)
5028
- });
5029
- args.ctx.runHandle?.observe(llmCall);
5030
- }
5028
+ const llmCall = usageLedger.observe(event, slot.agentRunName);
5029
+ if (llmCall) creditLlmCall(llmCall);
5031
5030
  assertSandboxServedModel(event, requested);
5032
5031
  }
5032
+ const harnessCall = usageLedger.settleTurn(slot.agentRunName);
5033
+ if (harnessCall) creditLlmCall(harnessCall);
5033
5034
  const outcome = outcomeTracker.finish();
5034
5035
  slot.sandboxOutcome = outcome;
5035
5036
  if (!sawLlmCall) {
@@ -5048,6 +5049,8 @@ async function executeIteration(args) {
5048
5049
  else if (projection.status !== "completed") slot.verdict = projection.verdict;
5049
5050
  } catch (err) {
5050
5051
  slot.error = err instanceof Error ? err : new Error(String(err));
5052
+ const abortedCall = usageLedger.settleTurn(slot.agentRunName);
5053
+ if (abortedCall) creditLlmCall(abortedCall);
5051
5054
  } finally {
5052
5055
  slot.endedAt = args.now();
5053
5056
  await emitTrace(args.ctx.traceEmitter, {
@@ -6536,6 +6539,50 @@ function createSteerableSandboxSession(args) {
6536
6539
  let handle;
6537
6540
  state.session = () => handle;
6538
6541
  let nextPrompt = args.taskToPrompt(task);
6542
+ const usageLedger = createSandboxUsageLedger(args.harness);
6543
+ let usageFailure;
6544
+ const readUsage = (read) => {
6545
+ try {
6546
+ return read();
6547
+ } catch (err) {
6548
+ tokensKnown = false;
6549
+ const message = err instanceof Error ? err.message : String(err);
6550
+ usageFailure ??= message;
6551
+ activity.push({
6552
+ at: now(),
6553
+ kind: "note",
6554
+ label: "usage-unreadable",
6555
+ detail: message
6556
+ });
6557
+ return;
6558
+ }
6559
+ };
6560
+ function* creditCall(call) {
6561
+ const callTokensKnown = call.tokensKnown !== false && typeof call.tokensIn === "number" && typeof call.tokensOut === "number";
6562
+ if (!callTokensKnown) tokensKnown = false;
6563
+ const input = call.tokensIn ?? 0;
6564
+ const output = call.tokensOut ?? 0;
6565
+ if (input || output || !callTokensKnown) {
6566
+ const usage = {
6567
+ kind: "tokens",
6568
+ input,
6569
+ output,
6570
+ ...callTokensKnown ? {} : { tokensKnown: false },
6571
+ ...promptCacheTokenClasses(call.tokensIn, call.promptCache)
6572
+ };
6573
+ addTokenUsage(tokens, usage);
6574
+ yield usage;
6575
+ }
6576
+ if (typeof call.costUsd === "number" && call.costUsd > 0) {
6577
+ usd += call.costUsd;
6578
+ yield {
6579
+ kind: "cost",
6580
+ usd: call.costUsd,
6581
+ usdKnown: false,
6582
+ provenance: "uncaptured"
6583
+ };
6584
+ }
6585
+ }
6539
6586
  try {
6540
6587
  for (let turn = 0; maxTurns === 0 || turn < maxTurns; turn += 1) {
6541
6588
  const pending = args.inbox.drain();
@@ -6584,39 +6631,23 @@ function createSteerableSandboxSession(args) {
6584
6631
  kind: "progress",
6585
6632
  progress
6586
6633
  };
6587
- const call = extractLlmCallEvent(event, spec.name ?? String(args.harness));
6634
+ const call = readUsage(() => usageLedger.observe(event, spec.name ?? String(args.harness)));
6588
6635
  if (call) {
6589
6636
  sawLlmCall = true;
6590
- const callTokensKnown = call.tokensKnown !== false && typeof call.tokensIn === "number" && typeof call.tokensOut === "number";
6591
- if (!callTokensKnown) tokensKnown = false;
6592
- const input = call.tokensIn ?? 0;
6593
- const output = call.tokensOut ?? 0;
6594
- if (input || output || !callTokensKnown) {
6595
- const usage = {
6596
- kind: "tokens",
6597
- input,
6598
- output,
6599
- ...callTokensKnown ? {} : { tokensKnown: false },
6600
- ...promptCacheTokenClasses(call.tokensIn, call.promptCache)
6601
- };
6602
- addTokenUsage(tokens, usage);
6603
- yield usage;
6604
- }
6605
- if (typeof call.costUsd === "number" && call.costUsd > 0) {
6606
- usd += call.costUsd;
6607
- yield {
6608
- kind: "cost",
6609
- usd: call.costUsd,
6610
- usdKnown: false,
6611
- provenance: "uncaptured"
6612
- };
6613
- }
6637
+ yield* creditCall(call);
6614
6638
  }
6615
6639
  assertSandboxServedModel(event, requested);
6616
6640
  }
6641
+ const harnessCall = readUsage(() => usageLedger.settleTurn(spec.name ?? String(args.harness)));
6642
+ if (harnessCall) {
6643
+ sawLlmCall = true;
6644
+ yield* creditCall(harnessCall);
6645
+ }
6617
6646
  state.latestOutcome = outcomeTracker.finish();
6618
6647
  } catch (e) {
6619
6648
  cleanup();
6649
+ const abortedCall = readUsage(() => usageLedger.settleTurn(spec.name ?? String(args.harness)));
6650
+ if (abortedCall) yield* creditCall(abortedCall);
6620
6651
  if (isInterruptAbort(e, interruptSig, signal, args.controller.signal)) {
6621
6652
  activity.push({
6622
6653
  at: now(),
@@ -6672,7 +6703,8 @@ function createSteerableSandboxSession(args) {
6672
6703
  ...state.servedBackend === void 0 ? {} : { servedBackend: state.servedBackend },
6673
6704
  turns: state.turns,
6674
6705
  toolCalls: state.toolCalls,
6675
- ...state.latestOutcome ? { outcome: state.latestOutcome } : {}
6706
+ ...state.latestOutcome ? { outcome: state.latestOutcome } : {},
6707
+ ...usageFailure === void 0 ? {} : { tokensUnknownReason: usageFailure }
6676
6708
  };
6677
6709
  const verdict = state.latestOutcome ? projectSandboxOutcome(state.latestOutcome).verdict : void 0;
6678
6710
  state.artifact = {
@@ -10735,7 +10767,7 @@ async function teardownExecutor(executor, grace, deadlineAtMs, now) {
10735
10767
  *
10736
10768
  * 1. `SuperviseOptions.maxLiveWorkers` (`src/runtime/supervise/supervise.ts`) — supervised-tree
10737
10769
  * level. One shared Scope counter bounds every spawned manager and leaf in the recursive tree;
10738
- * `spawn_agent` fails closed with `error: 'max-live-workers'` past it. Unset ⇒ NO tree cap.
10770
+ * `spawn_worker` fails closed with `error: 'max-live-workers'` past it. Unset ⇒ NO tree cap.
10739
10771
  * `CoordinationToolsOptions.maxLiveWorkers` remains the local form for a toolbox mounted on a
10740
10772
  * caller-owned Scope that has no tree limit.
10741
10773
  * 2. `SandboxLineage`'s `maxConcurrency` / `DEFAULT_FORK_CONCURRENCY = 4`
@@ -15506,4 +15538,4 @@ function isNonEmptySpend(s) {
15506
15538
  //#endregion
15507
15539
  export { bridgeModelRouteRefusal as $, INTELLIGENCE_WIRE_VERSION as $t, readWorkerInteractiveBinding as A, controlProfileMaterialization as An, peerMailVerbNames as At, retainedCreateMaterial as B, sandboxActProfileMaterialization as Bn, createSandboxLineage as Bt, timerAt as C, LOCAL_HARNESSES as Cn, AUTHORITY_MARKERS as Ct, readWorkerInteractiveAdmissions as D, CodexExecutionDiagnosticError as Dn, createPeerMailbox as Dt, interactiveAdmissionSeamKey as E, parseCodexTokenUsage as En, claimsAuthority as Et, startRetainedInteractiveRun as F, promptModelProfileMaterialization as Fn, TERMINAL_DECISIONS as Ft, rollingDispatch as G, routerBrain as Gt, effectiveConcurrency as H, validateProfileMaterialization as Hn, acquireSandbox as Ht, reconnectRetainedRun as I, promptOnlyProfileMaterialization as In, createSandboxForSpec as It, assertValidBudget as J, observedModelMatchesDeclared as Jt, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as K, runBrainLoop as Kt, recoverRetainedRun as L, promptResourceProfileMaterialization as Ln, defaultSelectWinner as Lt, workerInteractiveBindingsDir as M, fullProfileMaterialization as Mn, isTerminalNodeStatus as Mt, reconnectRetainedInteractiveRun as N, profileMaterializationAxes$1 as Nn, createInPlaceCliExecutor as Nt, workerInteractiveAdmissionFile as O, AGENT_PROFILE_MATERIALIZATION_AXES as On, isPeerMailEnvelope as Ot, recoverRetainedInteractiveRun as P, promptControlProfileMaterialization as Pn, taskToPrompt as Pt, bridgeAdmissionRead as Q, traceContextToEnv as Qt, startRetainedRun as R, renderProfileMaterializationIssues as Rn, isTerminalDecision as Rt, pollFor as S, DEFAULT_LOCAL_HARNESS as Sn, createInbox as St, waitUntil as T, localHarnessExecutable as Tn, PEER_MAIL_WIRE_KEY as Tt, freeSlots as U, worktreeCliProfileMaterialization as Un, assertBoxlessPromptOptions as Ut, destroyInteractiveEnvironment as V, unsupportedProfileDimensions as Vn, probeSandboxCapabilities as Vt, queueOf as W, readPromptOptions as Wt, spendFromUsageEvents as X, mergeTraceEnv as Xt, createBudgetPool as Y, createPropagatingTraceEmitter as Yt, bindReusableExecutorExecutionId as Z, readTraceContextFromEnv as Zt, recordScopeOwnerMaterialization as _, runSettledCommand as _n, decodeToolPart as _t, uncertainSpawnBudgets as a, exportEvalRuns as an, createExecutor as at, createWaitProbes as b, createWorktree as bn, createActivityLog as bt, pickBestDelivered as c, loopEventToOtelSpan as cn, createWorktreeCliExecutor as ct, driverChild as d, toOtelAttributes as dn, workerTraceEnv as dt, buildLoopOtelSpans as en, bridgeRuntimeAttachmentsKey as et, withDriverExecutor as f, createRuntimeEventCollector as fn, workerTraceHeaders as ft, meterRuntimeOwnedProviderAttempt as g, sanitizeRuntimeStreamEvent as gn, createPushTraceSource as gt, meterRuntimeOwnedAccounting as h, sanitizeKnowledgeReadinessReport as hn, createSteerableSandboxSession as ht, sumMeasuredSpendFromEvents as i, createOtelExporter as in, cliWorktreeExecutor as it, workerInteractiveBindingFile as j, defineProfileMaterializationContract as jn, isLiveNodeStatus as jt, attachWorker as k, assertProfileMaterialization as kn, peerMailTools as kt, runFinalizer as l, padSpanId as ln, WORKER_TRACE_PROPAGATION as lt, deriveNodeExecutionIdentity as m, sanitizeAgentRuntimeEvent as mn, DEFAULT_SANDBOX_STEERING_MAX_TURNS as mt, createSupervisor as n, buildRuntimeEventOtelSpans as nn, captureReusableExecutorConfig as nt, bestDelivered as o, flatOtelSpan as on, createExecutorRegistry as ot, createScope as p, createRuntimeStreamEventCollector as pn, workerTraceSeamKey as pt, teardownExecutor as q, canonicalObservedModel as qt, maxSeqOf as r, createOpenInferenceFileExporter as rn, cliInPlaceExecutor as rt, collectDelivered as s, generateSpanId as sn, snapshotExecutorConfig as st, createRootHandle as t, buildLoopSpanNodes as tn, bridgeStopSignalKey as tt, runTree as u, padTraceId as un, readWorkerTraceContext as ut, scopeOwnerExecutorNodeContext as v, runWorktreeHarness as vn, sandboxSessionTraceSource as vt, validateWaitSpec as w, harnessSupportsReasoningEffort as wn, DEFAULT_PEER_MAIL_LIMITS as wt, isWaitOutcome as x, removeWorktree as xn, readWorkerProgress as xt, settledToIteration as y, captureWorktreeDiff as yn, DEFAULT_STALL_AFTER_MS as yt, startRetainedRunInEnvironment as z, renderUnsupported as zn, runAgentRounds as zt };
15508
15540
 
15509
- //# sourceMappingURL=supervisor-CC3qqrVo.js.map
15541
+ //# sourceMappingURL=supervisor-DyRbmn1C.js.map