@tangle-network/agent-runtime 0.342.2 → 0.343.2

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 (86) hide show
  1. package/dist/{activation-DOH7Fnyp.js → activation-BMjalBNv.js} +4 -4
  2. package/dist/{activation-DOH7Fnyp.js.map → activation-BMjalBNv.js.map} +1 -1
  3. package/dist/{activation-CXqtijue.d.ts → activation-NJiV0MHb.d.ts} +2 -2
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +3 -3
  6. package/dist/{bundle-Cwpit6Tg.js → bundle-DKQtOO9d.js} +2 -2
  7. package/dist/{bundle-Cwpit6Tg.js.map → bundle-DKQtOO9d.js.map} +1 -1
  8. package/dist/candidate-execution/index.js +4 -4
  9. package/dist/{coordination-manager-HQE0bIav.js → coordination-manager-DIC19cgD.js} +22 -314
  10. package/dist/coordination-manager-DIC19cgD.js.map +1 -0
  11. package/dist/{delegate-DmShSdjy.js → delegate-BWXq1BeR.js} +2 -2
  12. package/dist/{delegate-DmShSdjy.js.map → delegate-BWXq1BeR.js.map} +1 -1
  13. package/dist/{durable-file-gNI9ILAn.js → durable-file-CA0kr1Pi.js} +8 -3
  14. package/dist/durable-file-CA0kr1Pi.js.map +1 -0
  15. package/dist/durable.d.ts +2 -2
  16. package/dist/durable.js +153 -16
  17. package/dist/durable.js.map +1 -1
  18. package/dist/{graph-BCghJFlS.js → graph-B89lApkU.js} +4 -4
  19. package/dist/{graph-BCghJFlS.js.map → graph-B89lApkU.js.map} +1 -1
  20. package/dist/{improve-Dga6OYt-.js → improve-CII-AhGN.js} +7 -8
  21. package/dist/{improve-Dga6OYt-.js.map → improve-CII-AhGN.js.map} +1 -1
  22. package/dist/index.d.ts +3 -3
  23. package/dist/index.js +9 -9
  24. package/dist/intelligence.d.ts +2 -2
  25. package/dist/intelligence.js +6 -6
  26. package/dist/kernel.d.ts +1 -1
  27. package/dist/kernel.js +10 -11
  28. package/dist/{loop-runner-CW87Vqoj.js → loop-runner-Bbk9It72.js} +2 -2
  29. package/dist/{loop-runner-CW87Vqoj.js.map → loop-runner-Bbk9It72.js.map} +1 -1
  30. package/dist/{loop-runner-CuhbgVGo.d.ts → loop-runner-D56Rpd2z.d.ts} +2 -2
  31. package/dist/loop-runner-bin.d.ts +1 -1
  32. package/dist/loop-runner-bin.js +1 -1
  33. package/dist/mcp/bin.js +3 -3
  34. package/dist/mcp/index.d.ts +1 -1
  35. package/dist/mcp/index.js +6 -6
  36. package/dist/mcp/index.js.map +1 -1
  37. package/dist/platform.js +1 -1
  38. package/dist/platform.js.map +1 -1
  39. package/dist/{prepare-C-cWCyt3.js → prepare-TEEHSJwq.js} +3 -3
  40. package/dist/{prepare-C-cWCyt3.js.map → prepare-TEEHSJwq.js.map} +1 -1
  41. package/dist/{profile-CbMw5hAn.js → profile-6OLpbjvV.js} +2 -2
  42. package/dist/{profile-CbMw5hAn.js.map → profile-6OLpbjvV.js.map} +1 -1
  43. package/dist/profiles.d.ts +1 -1
  44. package/dist/profiles.js +1 -1
  45. package/dist/profiles.js.map +1 -1
  46. package/dist/{provision-supervisor-BWR_TJFg.js → provision-supervisor-it-VCGyZ.js} +6 -6
  47. package/dist/{provision-supervisor-BWR_TJFg.js.map → provision-supervisor-it-VCGyZ.js.map} +1 -1
  48. package/dist/{run-cancellation-C9oL62sW.js → run-cancellation-DSpwvFmQ.js} +8 -4
  49. package/dist/{run-cancellation-C9oL62sW.js.map → run-cancellation-DSpwvFmQ.js.map} +1 -1
  50. package/dist/{runtime-CuRTZFe6.js → runtime-fKVK1rVb.js} +15 -17
  51. package/dist/{runtime-CuRTZFe6.js.map → runtime-fKVK1rVb.js.map} +1 -1
  52. package/dist/{sandbox-profile-compat-FN2kab2-.js → sandbox-profile-compat-_fEtHPCj.js} +2 -2
  53. package/dist/sandbox-profile-compat-_fEtHPCj.js.map +1 -0
  54. package/dist/{search-executor-0-SjHAao.js → search-executor-Ymr-tAKJ.js} +3 -3
  55. package/dist/{search-executor-0-SjHAao.js.map → search-executor-Ymr-tAKJ.js.map} +1 -1
  56. package/dist/{server-DTUK2wW1.js → server-BngfDubR.js} +4 -4
  57. package/dist/{server-DTUK2wW1.js.map → server-BngfDubR.js.map} +1 -1
  58. package/dist/{structural-rollout-kfaZgAkd.js → structural-rollout-BmKAIWWR.js} +3 -3
  59. package/dist/{structural-rollout-kfaZgAkd.js.map → structural-rollout-BmKAIWWR.js.map} +1 -1
  60. package/dist/{supervise-C_GAgiJU.js → supervise-DyCUu8Io.js} +415 -107
  61. package/dist/supervise-DyCUu8Io.js.map +1 -0
  62. package/dist/{supervisor-C_03z693.js → supervisor-gDn4C1o5.js} +627 -27
  63. package/dist/supervisor-gDn4C1o5.js.map +1 -0
  64. package/dist/testing.d.ts +1 -1
  65. package/dist/testing.js +13 -13
  66. package/dist/{top-snapshot-CbZE1JsU.js → top-snapshot-OjHdhai1.js} +2 -2
  67. package/dist/{top-snapshot-CbZE1JsU.js.map → top-snapshot-OjHdhai1.js.map} +1 -1
  68. package/dist/tui/bin.js +5 -3
  69. package/dist/tui/bin.js.map +1 -1
  70. package/dist/tui/index.d.ts +1 -1
  71. package/dist/tui/index.js +2 -2
  72. package/dist/{types-Cgs89PQd.d.ts → types-D0ZRqIJh.d.ts} +131 -17
  73. package/package.json +6 -6
  74. package/dist/content-digest-sBTLujlK.js +0 -9
  75. package/dist/content-digest-sBTLujlK.js.map +0 -1
  76. package/dist/coordination-manager-HQE0bIav.js.map +0 -1
  77. package/dist/durable-file-gNI9ILAn.js.map +0 -1
  78. package/dist/graph-registry-BnO64cn8.js +0 -197
  79. package/dist/graph-registry-BnO64cn8.js.map +0 -1
  80. package/dist/jsonl-file-C9Kde_0Z.js +0 -206
  81. package/dist/jsonl-file-C9Kde_0Z.js.map +0 -1
  82. package/dist/record-value-B6bwJxLa.js +0 -12
  83. package/dist/record-value-B6bwJxLa.js.map +0 -1
  84. package/dist/sandbox-profile-compat-FN2kab2-.js.map +0 -1
  85. package/dist/supervise-C_GAgiJU.js.map +0 -1
  86. package/dist/supervisor-C_03z693.js.map +0 -1
@@ -1,15 +1,13 @@
1
- import { i as publishExclusiveDurableFile, n as assertNoSymlinkDescendant } from "./durable-file-gNI9ILAn.js";
1
+ import { i as publishExclusiveDurableFile, n as assertNoSymlinkDescendant, s as sha256 } from "./durable-file-CA0kr1Pi.js";
2
2
  import { c as RetainedInteractiveAdmissionError, d as RetainedRunDispatchBindingError, f as RuntimeRunStateError, i as ConfigError, l as RetainedInteractiveBindingError, m as ValidationError$1, r as BackendTransportError, t as AgentEvalError$1, u as RetainedRunAdmissionError } from "./errors-DodWX-cb.js";
3
- import { n as recordValue, t as isRecord } from "./record-value-B6bwJxLa.js";
4
- import { $ as isAbortError$1, B as sha256Bytes$1, Ct as armDeadlineTimer, Dt as singleFlightTeardown, Et as isDeadlineAbortReason, G as addTokenUsage, H as hasControlCharacter, I as deepFreezeCandidate, J as cloneTokenUsage, K as chargedTokens, M as verifyWorkspaceSnapshotArtifacts, Ot as teardownExecutor, Q as hasCompleteCacheBreakdown, St as ROOT_DEADLINE_REASON, Tt as checkInIdleMs, U as abortError, W as addSpend, X as errorMessage, Y as deleteBoxSafe, Z as fnv1a32Hex, _t as withBudgetResources, at as roundBoxMinutes, c as verifyAgentCandidateWorkspaceTree, ct as throwAbort, dt as withTimeout, et as isAsyncIterable, ft as zeroSpend, g as verifiedArtifactChunks, gt as resourceTelemetry, ht as assertResources, it as randomUuid, kt as teardownSurfaces, lt as throwIfAborted, mt as addResourceSpend, nt as promptCacheTokenClasses, o as readAgentCandidateWorkspaceArtifactFiles, ot as sleep, pt as zeroTokenUsage, q as cloneSpend, rt as randomSuffix, s as verifyAgentCandidateWorkspaceArtifacts, st as stringifySafe, t as assertSandboxProfileCompatibility, tt as mapWithConcurrency, ut as unmeteredSpend, v as verifyAgentCandidateWorkspaceArchive, vt as ACCEPTED_RESULT_GRACE_MS, wt as boundedChildDeadlineAt, yt as CHILD_DEADLINE_REASON } from "./sandbox-profile-compat-FN2kab2-.js";
3
+ import { $ as isAbortError$1, B as sha256Bytes$1, Ct as armDeadlineTimer, Dt as singleFlightTeardown, Et as isDeadlineAbortReason, G as addTokenUsage, H as hasControlCharacter, I as deepFreezeCandidate, J as cloneTokenUsage, K as chargedTokens, M as verifyWorkspaceSnapshotArtifacts, Ot as teardownExecutor, Q as hasCompleteCacheBreakdown, St as ROOT_DEADLINE_REASON, Tt as checkInIdleMs, U as abortError, W as addSpend, X as errorMessage, Y as deleteBoxSafe, Z as fnv1a32Hex, _t as withBudgetResources, at as roundBoxMinutes, c as verifyAgentCandidateWorkspaceTree, ct as throwAbort, dt as withTimeout, et as isAsyncIterable, ft as zeroSpend, g as verifiedArtifactChunks, gt as resourceTelemetry, ht as assertResources, it as randomUuid, kt as teardownSurfaces, lt as throwIfAborted, mt as addResourceSpend, nt as promptCacheTokenClasses, o as readAgentCandidateWorkspaceArtifactFiles, ot as sleep, pt as zeroTokenUsage, q as cloneSpend, rt as randomSuffix, s as verifyAgentCandidateWorkspaceArtifacts, st as stringifySafe, t as assertSandboxProfileCompatibility, tt as mapWithConcurrency, ut as unmeteredSpend, v as verifyAgentCandidateWorkspaceArchive, vt as ACCEPTED_RESULT_GRACE_MS, wt as boundedChildDeadlineAt, yt as CHILD_DEADLINE_REASON } from "./sandbox-profile-compat-_fEtHPCj.js";
5
4
  import { runTaskQueue } from "./task-queue.js";
6
5
  import { _ as agentHarness, a as concreteProfileModel, c as profileModelExecutionSettings, d as assertRouterAutoDeclaration, f as assertRouterAutoResponse, g as observedModelMatchesDeclared, h as observedModelHasSnapshot, l as profileProviderModel, m as mergeObservedModelIdentity, o as enforceTokenLimits, s as profileBridgeWireModel, t as assertExecutableAgentProfile, u as resolveRouterRetryPolicy } from "./model-policy-CyCUwHed.js";
7
- import { t as sha256 } from "./content-digest-sBTLujlK.js";
8
6
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
9
- import { a as readCommittedJsonLines, n as isNoEntError, t as appendCommittedJsonLine } from "./jsonl-file-C9Kde_0Z.js";
10
7
  import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentNativeContextContinuationResultSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnInputSchema, AgentTurnResultSchema, CanonicalStreamEventSchema, ContextTransferReceiptSchema, ContextTransferRequestSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, REASONING_EFFORTS, RuntimeEventEnvelopeSchema, TerminalReplayWindowSchema, TerminalSessionRefSchema, agentCandidateArtifactRefSchema, agentCandidateWorkspaceManifestMaterialSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, agentWorkspaceSnapshotRefDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalWorkspaceCwd, contextTransferReceiptMatches, exactAgentInteractiveSessionStart, harnessTypeSchema, nativeContextContinuationTurnDigest, nativeReasoningControl, profileMaterializationAxes, profileMaterializationAxes as profileMaterializationAxes$1, renderInputPartsAsText, sha256DigestSchema, workspaceCheckpointRequestDigest, workspaceCheckpointResultMatchesRequest, workspaceCleanupAcknowledgementMatches, workspaceCleanupRequestDigest, workspaceForkRequestDigest, workspaceForkResultMatchesRequest } from "@tangle-network/agent-interface";
11
8
  import { isToolSpan, toolSpansToTraceAnalysisStore } from "@tangle-network/agent-eval";
12
9
  import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
10
+ import { SDKError, generateIdempotencyKey, isRecord, withRetry } from "@tangle-network/agent-core";
13
11
  import { collectAgentFinalMessageText, collectAgentResponseText } from "@tangle-network/sandbox";
14
12
  import { REDACTION_VERSION as REDACTION_VERSION$1, redact } from "@tangle-network/agent-eval/traces";
15
13
  import { z } from "zod";
@@ -27,7 +25,6 @@ import { request as request$1 } from "node:https";
27
25
  import { Readable } from "node:stream";
28
26
  import { ATTR, deriveHexId, isW3CSpanId, isW3CTraceId } from "@tangle-network/agent-trace-contract";
29
27
  import { clearImmediate, setImmediate as setImmediate$1 } from "node:timers";
30
- import { SDKError, generateIdempotencyKey, withRetry } from "@tangle-network/agent-core";
31
28
  //#region src/runtime/turn-input.ts
32
29
  /**
33
30
  * Copy only fields that describe a new provider turn.
@@ -315,6 +312,11 @@ function delay(ms, signal) {
315
312
  });
316
313
  }
317
314
  //#endregion
315
+ //#region src/record-value.ts
316
+ function recordValue(value) {
317
+ return isRecord(value) ? value : void 0;
318
+ }
319
+ //#endregion
318
320
  //#region src/runtime/harness-usage.ts
319
321
  /**
320
322
  * Read and validate one codex `turn.completed` usage record.
@@ -330,7 +332,7 @@ function delay(ms, signal) {
330
332
  */
331
333
  function parseCodexUsageRecord(usage, label) {
332
334
  const record = recordValue(usage);
333
- if (record === void 0) throw new ValidationError$1(`${label}: usage must be an object, received ${describe(usage)}`);
335
+ if (record === void 0) throw new ValidationError$1(`${label}: usage must be an object, received ${describe$1(usage)}`);
334
336
  const inputTokens = naturalNumber$1(record.input_tokens, "input_tokens", label);
335
337
  const cachedInputTokens = naturalNumber$1(record.cached_input_tokens, "cached_input_tokens", label);
336
338
  const outputTokens = naturalNumber$1(record.output_tokens, "output_tokens", label);
@@ -433,10 +435,10 @@ function decodeHarnessUsage(event, harness) {
433
435
  }
434
436
  }
435
437
  function naturalNumber$1(value, field, label) {
436
- if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) throw new ValidationError$1(`${label}: usage.${field} must be a non-negative safe integer, received ${describe(value)}`);
438
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) throw new ValidationError$1(`${label}: usage.${field} must be a non-negative safe integer, received ${describe$1(value)}`);
437
439
  return value;
438
440
  }
439
- function describe(value) {
441
+ function describe$1(value) {
440
442
  if (value === null) return "null";
441
443
  if (typeof value === "number" || typeof value === "boolean") return String(value);
442
444
  if (typeof value === "string") return JSON.stringify(value);
@@ -6135,10 +6137,12 @@ async function resolveBridgeModelCredential(credential, context) {
6135
6137
  var RunCancellationReason = class extends Error {
6136
6138
  source;
6137
6139
  operationId;
6138
- constructor(source, reason, operationId) {
6140
+ operator;
6141
+ constructor(source, reason, operationId, operator) {
6139
6142
  super(reason);
6140
6143
  this.source = source;
6141
6144
  this.operationId = operationId;
6145
+ this.operator = operator;
6142
6146
  this.name = "RunCancellationReason";
6143
6147
  }
6144
6148
  toString() {
@@ -9604,7 +9608,7 @@ const USAGE_LIMIT_CODES = /* @__PURE__ */ new Set([
9604
9608
  /** Normalize a native harness refusal into a typed limit. A plain HTTP 429 is insufficient. */
9605
9609
  function subscriptionUsageLimitSignal(failure) {
9606
9610
  if (failure.errorCode && USAGE_LIMIT_CODES.has(failure.errorCode.toLowerCase())) return "subscription-usage-limit";
9607
- if (/\bYou've hit your (?:usage|weekly|session) limit\b/iu.test(failure.error)) return "subscription-usage-limit";
9611
+ if (/\bYou've hit your (?:usage|weekly|session|monthly spend) limit\b/iu.test(failure.error)) return "subscription-usage-limit";
9608
9612
  if (/\bUsage limit reached for \d+ hours?\b/iu.test(failure.error)) return "subscription-usage-limit";
9609
9613
  }
9610
9614
  /** An ineligible or misconfigured account must never turn an authored stage into another model. */
@@ -9778,15 +9782,20 @@ function isUpstreamUnavailable(error) {
9778
9782
  * consumers may branch on it: a 5xx/408 is the upstream having a bad moment, a 429/503/529 is the
9779
9783
  * upstream out of capacity, and a 401/404/422 is a request that will fail identically forever. The
9780
9784
  * bridge's own never-retry classes are terminal whether or not a status rides with them.
9785
+ *
9786
+ * An `AbortError` is the run's own only when `signal` (the run) or `stopSignal` (the manager's own
9787
+ * stop: an accepted result, `stop`, a stop rule) has fired. Any other is a lost stream and is
9788
+ * retried: on magnetar-rust-20261019b a 4.0 h root turn ended "bridgeExecutor: turn aborted" and,
9789
+ * classed terminal, settled the run after one attempt.
9781
9790
  */
9782
- function classifyDriverFailure(error, signal) {
9791
+ function classifyDriverFailure(error, signal, stopSignal) {
9783
9792
  if (signal?.aborted) return "terminal";
9784
9793
  if (error instanceof RetainedExecutionPendingError && error.pendingCause === "provider-contract") return "terminal";
9785
9794
  if (undispatchedCredentialExit(error) !== void 0) return "unavailable";
9786
9795
  const admission = retainedAdmissionCause(error);
9787
9796
  if (admission !== void 0 && isDispatchNotAdmitted(admission)) return "terminal";
9788
- if (admission !== void 0) return classifyDriverFailure(admission, signal);
9789
- if (error instanceof Error && errorProperty(error, "name") === "AbortError") return "terminal";
9797
+ if (admission !== void 0) return classifyDriverFailure(admission, signal, stopSignal);
9798
+ if (error instanceof Error && errorProperty(error, "name") === "AbortError") return stopSignal?.aborted === true ? "terminal" : "transient";
9790
9799
  if (error instanceof Error && isProviderSchemaRejection(error)) return "terminal";
9791
9800
  if (isCredentialRefusal(error)) return "terminal";
9792
9801
  if (causeChain(error).some(isProvisioningRefusal)) return "terminal";
@@ -9889,11 +9898,13 @@ function summarizeDriverAttempts(records) {
9889
9898
  for (const record of records) if (record.madeProgress) barren = 0;
9890
9899
  else if (record.beforeModelEvent !== true && record.error === void 0 && record.reentry !== void 0 && record.reentry !== "wake" && record.contract === "unmet") barren += 1;
9891
9900
  const last = records.at(-1);
9892
- const refused = records.filter((record) => record.classification === "unavailable");
9901
+ const stopPauses = records.filter((record) => record.replacesStop !== void 0);
9902
+ const refused = records.filter((record) => record.classification === "unavailable" && record.replacesStop === void 0);
9893
9903
  return {
9894
- attempts: records.length,
9904
+ attempts: new Set(records.map((record) => record.attempt)).size,
9895
9905
  reprompts: records.filter((record) => record.reprompted === true).length,
9896
- failureRetries: records.filter((record) => record.error !== void 0 && record.retryInMs !== void 0 && record.classification !== "unavailable").length,
9906
+ failureRetries: records.filter((record) => record.error !== void 0 && record.retryInMs !== void 0 && record.classification !== "unavailable" && record.replacesStop === void 0).length,
9907
+ stopPauses: stopPauses.length,
9897
9908
  unavailablePauses: refused.filter((record) => record.retryInMs !== void 0).length,
9898
9909
  unavailableMs: refused.reduce((sum, record) => sum + (record.madeProgress ? 0 : record.durationMs) + (record.retryInMs ?? 0), 0),
9899
9910
  barrenReentries: barren,
@@ -19192,6 +19203,7 @@ function withRouterRequestTimeout(callerSignal, timeoutMs) {
19192
19203
  }
19193
19204
  //#endregion
19194
19205
  //#region src/runtime/router-request-body.ts
19206
+ /** Canonical provider request lowering for buffered and streamed completions. */
19195
19207
  /** The OpenAI-shape request body both plain-chat transports send. One builder so the streamed
19196
19208
  * completion cannot drift from the buffered one on model, ceilings, seed, or reasoning effort. */
19197
19209
  function chatCompletionBody(cfg, messages, opts) {
@@ -23786,6 +23798,7 @@ const outsideKinds = /* @__PURE__ */ new Set([
23786
23798
  "seat-paused",
23787
23799
  "root-segment",
23788
23800
  "root-reentered",
23801
+ "reopened",
23789
23802
  "paused",
23790
23803
  "barren-pause",
23791
23804
  "driver-attempt",
@@ -23802,6 +23815,209 @@ function insideCursorNamespace(ev) {
23802
23815
  return !outsideKinds.has(ev.kind);
23803
23816
  }
23804
23817
  //#endregion
23818
+ //#region src/durable/jsonl-file.ts
23819
+ /** Read a fixed file prefix one record at a time, never allocating the whole journal as a string.
23820
+ * A reader cannot chase concurrent appends forever. Missing files are empty only when requested;
23821
+ * corruption, short reads, and other I/O errors remain failures. Closing the iterator closes the fd. */
23822
+ async function* readCommittedJsonLines(path, options = {}) {
23823
+ const fs = await import("node:fs/promises");
23824
+ let handle;
23825
+ try {
23826
+ handle = await fs.open(path, "r");
23827
+ } catch (error) {
23828
+ if (options.allowMissing && isNoEntError(error)) return;
23829
+ throw error;
23830
+ }
23831
+ try {
23832
+ const { size } = await handle.stat();
23833
+ if (size === 0) return;
23834
+ const { StringDecoder } = await import("node:string_decoder");
23835
+ const decoder = new StringDecoder("utf8");
23836
+ const stream = handle.createReadStream({
23837
+ autoClose: false,
23838
+ end: size - 1
23839
+ });
23840
+ const fragments = [];
23841
+ let lineNumber = 1;
23842
+ try {
23843
+ for await (const chunk of stream) {
23844
+ options.onBytes?.(chunk);
23845
+ const text = decoder.write(chunk);
23846
+ let start = 0;
23847
+ let end = text.indexOf("\n", start);
23848
+ while (end !== -1) {
23849
+ fragments.push(text.slice(start, end));
23850
+ const record = parseRecord(fragments.join(""), path, lineNumber++, true, options.allowWhitespaceLines);
23851
+ fragments.length = 0;
23852
+ if (record !== void 0) yield record.value;
23853
+ start = end + 1;
23854
+ end = text.indexOf("\n", start);
23855
+ }
23856
+ if (start < text.length) fragments.push(text.slice(start));
23857
+ }
23858
+ if (stream.bytesRead !== size) throw new Error(`${path}: journal changed while reading its committed prefix`);
23859
+ fragments.push(decoder.end());
23860
+ const record = parseRecord(fragments.join(""), path, lineNumber, false, options.allowWhitespaceLines);
23861
+ if (record !== void 0) yield record.value;
23862
+ } finally {
23863
+ stream.destroy();
23864
+ }
23865
+ } finally {
23866
+ await handle.close();
23867
+ }
23868
+ }
23869
+ /** An invalid unterminated tail may be a torn write; other parse failures are not evidence of one. */
23870
+ function parseRecord(line, source, lineNumber, terminated, allowWhitespaceLines = false) {
23871
+ if (line.length === 0 || allowWhitespaceLines && line.trim().length === 0) return void 0;
23872
+ try {
23873
+ return { value: JSON.parse(line) };
23874
+ } catch (cause) {
23875
+ if (!(cause instanceof SyntaxError)) throw cause;
23876
+ if (!terminated) return void 0;
23877
+ throw new Error(`${source}: malformed JSONL record at line ${lineNumber}`, { cause });
23878
+ }
23879
+ }
23880
+ async function appendCommittedJsonLine(path, record, acknowledge) {
23881
+ const fs = await import("node:fs/promises");
23882
+ const needsSeparator = await prepareJsonlAppend(path);
23883
+ const handle = await fs.open(path, "a");
23884
+ try {
23885
+ await writeAllBytes(handle, `${needsSeparator ? "\n" : ""}${JSON.stringify(record)}\n`);
23886
+ await handle.sync();
23887
+ return await acknowledge?.(handle);
23888
+ } finally {
23889
+ await handle.close();
23890
+ }
23891
+ }
23892
+ /** Serialize JSONL file updates across processes and aliases using Eval's existing file lock.
23893
+ * The caller owns validation and the record format. The lock path names the canonical file,
23894
+ * including its first write, so two directory aliases cannot acquire different write heads.
23895
+ * @internal
23896
+ */
23897
+ async function withJsonlFileLock(path, operation) {
23898
+ const fs = await import("node:fs/promises");
23899
+ const { dirname } = await import("node:path");
23900
+ const { tryAcquireAtomicFileLock } = await import("@tangle-network/agent-eval/ledger-core");
23901
+ await fs.mkdir(dirname(path), { recursive: true });
23902
+ await (await fs.open(path, "a")).close();
23903
+ const canonicalPath = await fs.realpath(path);
23904
+ const deadline = Date.now() + 5e3;
23905
+ for (;;) {
23906
+ const acquisition = tryAcquireAtomicFileLock({ lockPath: `${canonicalPath}.lock` });
23907
+ if (!acquisition.acquired) {
23908
+ if (Date.now() >= deadline) throw new Error(`journal file lock unavailable after 5000ms: ${canonicalPath}`);
23909
+ await new Promise((resolve) => setTimeout(resolve, 25));
23910
+ continue;
23911
+ }
23912
+ try {
23913
+ return await operation(canonicalPath);
23914
+ } finally {
23915
+ acquisition.lock.release();
23916
+ }
23917
+ }
23918
+ }
23919
+ /** Read one keyed registry snapshot without an extra whole-file text allocation.
23920
+ * Historical registry files allow whitespace-only separators; append journals remain strict.
23921
+ * @internal
23922
+ */
23923
+ async function readCommittedJsonFile(path) {
23924
+ const records = [];
23925
+ for await (const record of readCommittedJsonLines(path, {
23926
+ allowMissing: true,
23927
+ allowWhitespaceLines: true
23928
+ })) records.push(record);
23929
+ return records;
23930
+ }
23931
+ /** Replace one keyed row and publish one durable snapshot. The caller holds the file lock.
23932
+ * Keep unrelated rows in order and put the replacement last. No revision archive is retained.
23933
+ * @internal
23934
+ */
23935
+ async function upsertCommittedJsonLine(path, record, key) {
23936
+ const encoded = JSON.stringify(record);
23937
+ if (encoded === void 0) throw new Error("JSONL records must be JSON serializable");
23938
+ const snapshot = JSON.parse(encoded);
23939
+ const id = key(snapshot);
23940
+ const updated = [];
23941
+ for await (const prior of readCommittedJsonLines(path, {
23942
+ allowMissing: true,
23943
+ allowWhitespaceLines: true
23944
+ })) if (key(prior) !== id) updated.push(prior);
23945
+ updated.push(snapshot);
23946
+ const { writeAtomicDurableFile } = await import("./durable-file-CA0kr1Pi.js").then((n) => n.r);
23947
+ writeAtomicDurableFile(path, `${updated.map((row) => JSON.stringify(row)).join("\n")}\n`, { preserveMode: true });
23948
+ }
23949
+ /** FileHandle.write may legally make a short write. Loop until every byte is appended. */
23950
+ async function writeAllBytes(handle, value) {
23951
+ const bytes = typeof value === "string" ? Buffer.from(value) : Buffer.from(value);
23952
+ let offset = 0;
23953
+ while (offset < bytes.byteLength) {
23954
+ const { bytesWritten } = await handle.write(bytes, offset, bytes.byteLength - offset, null);
23955
+ if (bytesWritten <= 0) throw new Error(`append-only file write made no progress at byte ${offset}`);
23956
+ offset += bytesWritten;
23957
+ }
23958
+ }
23959
+ /** Prepare the tail under the journal owner's existing single-writer discipline.
23960
+ * Healthy appends read one byte, regardless of history size. Only recovery scans backward,
23961
+ * retaining a valid unterminated value or truncating an uncommitted torn tail. */
23962
+ async function prepareJsonlAppend(path) {
23963
+ const fs = await import("node:fs/promises");
23964
+ let handle;
23965
+ try {
23966
+ handle = await fs.open(path, "r+");
23967
+ } catch (error) {
23968
+ if (isNoEntError(error)) return false;
23969
+ throw error;
23970
+ }
23971
+ try {
23972
+ const size = (await handle.stat()).size;
23973
+ if (size === 0) return false;
23974
+ const lastByte = Buffer.allocUnsafe(1);
23975
+ await readAt(handle, lastByte, size - 1);
23976
+ if (lastByte[0] === 10) return false;
23977
+ const chunks = [];
23978
+ let end = size;
23979
+ let tailStart = 0;
23980
+ while (end > 0) {
23981
+ const start = Math.max(0, end - 65536);
23982
+ const chunk = Buffer.allocUnsafe(end - start);
23983
+ await readAt(handle, chunk, start);
23984
+ const newline = chunk.lastIndexOf(10);
23985
+ chunks.push(chunk.subarray(newline + 1));
23986
+ if (newline >= 0) {
23987
+ tailStart = start + newline + 1;
23988
+ break;
23989
+ }
23990
+ end = start;
23991
+ }
23992
+ const tail = Buffer.concat(chunks.reverse()).toString("utf8");
23993
+ try {
23994
+ JSON.parse(tail);
23995
+ return true;
23996
+ } catch (error) {
23997
+ if (!(error instanceof SyntaxError)) throw error;
23998
+ await handle.truncate(tailStart);
23999
+ await handle.sync();
24000
+ return false;
24001
+ }
24002
+ } finally {
24003
+ await handle.close();
24004
+ }
24005
+ }
24006
+ /** A short read is legal; an unexpected EOF means the owner's snapshot changed. */
24007
+ async function readAt(handle, buffer, position) {
24008
+ let offset = 0;
24009
+ while (offset < buffer.length) {
24010
+ const { bytesRead } = await handle.read(buffer, offset, buffer.length - offset, position + offset);
24011
+ if (bytesRead === 0) throw new Error("journal changed while preparing its append tail");
24012
+ offset += bytesRead;
24013
+ }
24014
+ }
24015
+ /** True for a filesystem error meaning "the file is not there yet" — the one condition an
24016
+ * append-only reader treats as an empty log rather than a fault. */
24017
+ function isNoEntError(error) {
24018
+ return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
24019
+ }
24020
+ //#endregion
23805
24021
  //#region src/durable/spawn-journal/result-blob-store.ts
23806
24022
  /**
23807
24023
  * FS `ResultBlobStore`. One JSON file per artifact under `dir`, named by a
@@ -25829,6 +26045,379 @@ function unsettledOwnerRuns(events, nodeId, environmentId) {
25829
26045
  return [...runs.values()];
25830
26046
  }
25831
26047
  //#endregion
26048
+ //#region src/mcp/tools/spawn-resource-paths.ts
26049
+ /**
26050
+ * Inline resources a manager hands a child by PATH instead of by content.
26051
+ *
26052
+ * The canonical profile schema knows two resource kinds, `inline` (a content string) and `github`.
26053
+ * A manager that wants a child to receive a data file therefore had one way to do it: emit the
26054
+ * bytes inside its own `spawn` tool call. That is a transcription by a language model, and it does
26055
+ * not survive size. Measured 2026-09-12 (discovery-lab `mech-interp-foundations-glm2-b-20260912b`):
26056
+ * a 29,144-character base64 payload on the manager's disk reached three children as 15,928
26057
+ * characters with 11 substitutions, and a fourth child received the literal placeholder the
26058
+ * manager meant to replace. Seven blind-check attempts across two runs delivered no data.
26059
+ *
26060
+ * `{ kind: 'inline', name, path }` lets the coordination server be the transport: it reads the
26061
+ * file from the manager's workspace, fills `content`, and the profile that reaches the schema,
26062
+ * the journal, and the provider is an ordinary inline resource. Nothing downstream changes; the
26063
+ * model's output stops carrying the bytes.
26064
+ *
26065
+ * Where the bytes come from is a {@link SpawnResourceReader}, and there are two:
26066
+ * - a HOST DIRECTORY, for a manager whose driver runs on this host (a loopback bridge with a
26067
+ * `cwd`), read through the descriptor-identity checks below;
26068
+ * - the manager's OWN EXECUTION ENVIRONMENT, for a manager inside a provider sandbox, read
26069
+ * through the environment's `read()`. The coordination server cannot see a sandbox filesystem,
26070
+ * but the provider that created the sandbox can, and it is already in hand.
26071
+ *
26072
+ * The second reader exists because the first one's absence was not a refusal a manager could
26073
+ * work around. Measured 2026-09-17 (discovery-lab `mech-interp-foundations-sandbox-a-20260917h`):
26074
+ * a sandbox-rooted director, refused by path, fell back to emitting its files as content and got
26075
+ * 5 characters wrong in 24,008, destroying 3 of 7 files including its instrument and both
26076
+ * drivers. At that rate 20 KB of mounts all arrive intact about 2% of the time, and gzip makes it
26077
+ * worse by turning one wrong character into total loss. Four consecutive runs in that lane lost
26078
+ * their research children to this. There is no encoding that fixes a transcription channel; the
26079
+ * only fix is a channel with no model in it.
26080
+ *
26081
+ * Fail-closed rules, each with the reason a manager needs to fix its call:
26082
+ * - no reader available → refused (neither a host directory nor an environment with `read`)
26083
+ * - absolute path or `..` escape → refused by both readers; a symlink that resolves outside the
26084
+ * root → refused by the host reader (the environment reader delegates containment to the
26085
+ * provider, which serves only the sandbox's own workspace)
26086
+ * - not a regular file → refused
26087
+ * - over {@link SPAWN_RESOURCE_PATH_MAX_BYTES} → refused naming the bound
26088
+ * - bytes that are not valid UTF-8 → refused; `content` is a string, so binary data is encoded
26089
+ * (base64) by the manager first, exactly as it would be for a content resource
26090
+ */
26091
+ const SPAWN_RESOURCE_PATH_MAX_BYTES = 4 * 1024 * 1024;
26092
+ /** The host-directory reader: a manager whose workspace is a directory this process can open. */
26093
+ function hostDirectoryReader(root) {
26094
+ return {
26095
+ describe: `workspace root ${root}`,
26096
+ read: (requested) => readUnderRoot(root, requested)
26097
+ };
26098
+ }
26099
+ /**
26100
+ * The environment reader: a manager running inside a provider environment whose `read()` serves
26101
+ * its own workspace. The provider owns containment — it will not serve a path outside the box —
26102
+ * but the relative-path and `..` rules are enforced here too, so the refusal names the rule the
26103
+ * manager broke rather than whatever the provider says about an escape it declined.
26104
+ *
26105
+ * `read()` returns a string, so an environment cannot hand back bytes that are not UTF-8; the
26106
+ * provider has already decoded. The size bound is checked on what arrives.
26107
+ */
26108
+ function environmentReader(environment) {
26109
+ return {
26110
+ describe: `environment ${environment.id}`,
26111
+ async read(requested) {
26112
+ if (requested.length === 0) return {
26113
+ ok: false,
26114
+ reason: "path is empty"
26115
+ };
26116
+ if (isAbsolute(requested)) return {
26117
+ ok: false,
26118
+ reason: `path must be relative to the manager's workspace, not absolute (${requested})`
26119
+ };
26120
+ if (requested.split(/[\\/]/u).includes("..")) return {
26121
+ ok: false,
26122
+ reason: `path ${requested} leaves the manager's workspace`
26123
+ };
26124
+ let content;
26125
+ try {
26126
+ content = await environment.read(requested);
26127
+ } catch (error) {
26128
+ return {
26129
+ ok: false,
26130
+ reason: `path ${requested}: ${describe(error)} (read from environment ${environment.id})`
26131
+ };
26132
+ }
26133
+ const bytes = Buffer.from(content, "utf8");
26134
+ if (bytes.length > 4194304) return {
26135
+ ok: false,
26136
+ reason: `path ${requested} is ${bytes.length} bytes; an inline resource is at most ${SPAWN_RESOURCE_PATH_MAX_BYTES} bytes`
26137
+ };
26138
+ return {
26139
+ ok: true,
26140
+ content,
26141
+ byteLength: bytes.length,
26142
+ sha256: createHash("sha256").update(bytes).digest("hex")
26143
+ };
26144
+ }
26145
+ };
26146
+ }
26147
+ /** An inline ref that names a path and carries no content. Anything else is left untouched so the
26148
+ * canonical schema keeps its verdict on it. */
26149
+ function pathInlineRef(value) {
26150
+ if (!isRecord(value)) return void 0;
26151
+ if (value.kind !== "inline" || value.content !== void 0) return void 0;
26152
+ if (typeof value.path !== "string" || typeof value.name !== "string") return void 0;
26153
+ return {
26154
+ kind: "inline",
26155
+ name: value.name,
26156
+ path: value.path
26157
+ };
26158
+ }
26159
+ async function readUnderRoot(root, requested) {
26160
+ if (requested.length === 0) return {
26161
+ ok: false,
26162
+ reason: "path is empty"
26163
+ };
26164
+ if (isAbsolute(requested)) return {
26165
+ ok: false,
26166
+ reason: `path must be relative to the workspace root, not absolute (${requested})`
26167
+ };
26168
+ const rootReal = await realpath(root).catch(() => void 0);
26169
+ if (rootReal === void 0) return {
26170
+ ok: false,
26171
+ reason: `workspace root ${root} does not exist`
26172
+ };
26173
+ const candidate = resolve(rootReal, requested);
26174
+ if (!inside(rootReal, candidate)) return {
26175
+ ok: false,
26176
+ reason: `path ${requested} leaves the workspace root`
26177
+ };
26178
+ let handle;
26179
+ try {
26180
+ handle = await open(candidate, "r");
26181
+ } catch (error) {
26182
+ return {
26183
+ ok: false,
26184
+ reason: `path ${requested}: ${describe(error)}`
26185
+ };
26186
+ }
26187
+ try {
26188
+ const info = await handle.stat();
26189
+ if (!info.isFile()) return {
26190
+ ok: false,
26191
+ reason: `path ${requested} is not a regular file`
26192
+ };
26193
+ const real = await realpath(candidate).catch(() => void 0);
26194
+ if (real === void 0 || !inside(rootReal, real)) return {
26195
+ ok: false,
26196
+ reason: `path ${requested} resolves outside the workspace root`
26197
+ };
26198
+ const named = await stat(real).catch(() => void 0);
26199
+ if (named === void 0 || named.dev !== info.dev || named.ino !== info.ino) return {
26200
+ ok: false,
26201
+ reason: `path ${requested} changed while it was being read; retry the spawn`
26202
+ };
26203
+ if (info.size > 4194304) return {
26204
+ ok: false,
26205
+ reason: `path ${requested} is ${info.size} bytes; an inline resource is at most ${SPAWN_RESOURCE_PATH_MAX_BYTES} bytes`
26206
+ };
26207
+ const bytes = await handle.readFile();
26208
+ if (bytes.length > 4194304) return {
26209
+ ok: false,
26210
+ reason: `path ${requested} is ${bytes.length} bytes; an inline resource is at most ${SPAWN_RESOURCE_PATH_MAX_BYTES} bytes`
26211
+ };
26212
+ const content = bytes.toString("utf8");
26213
+ if (!Buffer.from(content, "utf8").equals(bytes)) return {
26214
+ ok: false,
26215
+ reason: `path ${requested} is not valid UTF-8; encode binary data (base64) before handing it to a child`
26216
+ };
26217
+ return {
26218
+ ok: true,
26219
+ content,
26220
+ byteLength: bytes.length,
26221
+ sha256: createHash("sha256").update(bytes).digest("hex")
26222
+ };
26223
+ } catch (error) {
26224
+ return {
26225
+ ok: false,
26226
+ reason: `path ${requested}: ${describe(error)}`
26227
+ };
26228
+ } finally {
26229
+ await handle.close().catch(() => void 0);
26230
+ }
26231
+ }
26232
+ /** `target` is `rootReal` itself or strictly below it; both must already be absolute. */
26233
+ function inside(rootReal, target) {
26234
+ const rel = relative(rootReal, target);
26235
+ return rel !== "" && !rel.startsWith(`..${sep}`) && rel !== ".." && !isAbsolute(rel);
26236
+ }
26237
+ function describe(error) {
26238
+ const code = error?.code;
26239
+ if (code === "ENOENT") return "does not exist under the workspace root";
26240
+ if (code === "EACCES" || code === "EPERM") return "is not readable by the runtime process";
26241
+ if (code === "EISDIR") return "is not a regular file";
26242
+ return error instanceof Error ? error.message : String(error);
26243
+ }
26244
+ /**
26245
+ * Replace every `{ kind: 'inline', name, path }` under `profile.resources` with the inline
26246
+ * resource its bytes make. Returns the profile unchanged (same reference) when nothing names a
26247
+ * path, so callers pay nothing on the common case.
26248
+ *
26249
+ * `source` is a host directory (a string, kept for the existing call sites), a
26250
+ * {@link SpawnResourceReader}, or `undefined` when the manager has neither — in which case a path
26251
+ * is refused with the reason and what to do instead.
26252
+ */
26253
+ async function resolveSpawnResourcePaths(profile, source) {
26254
+ if (!isRecord(profile) || !isRecord(profile.resources)) return {
26255
+ ok: true,
26256
+ profile,
26257
+ resolved: []
26258
+ };
26259
+ const reader = typeof source === "string" ? hostDirectoryReader(source) : source;
26260
+ const resources = profile.resources;
26261
+ const resolved = [];
26262
+ let touched = false;
26263
+ const next = { ...resources };
26264
+ const substitute = async (at, ref) => {
26265
+ if (reader === void 0) return { error: "this manager has no workspace root the coordination server may read (no host directory and no environment with read), so a resource by path cannot be resolved; pass content, or a github resource" };
26266
+ const read = await reader.read(ref.path);
26267
+ if (!read.ok) return { error: read.reason };
26268
+ resolved.push({
26269
+ at,
26270
+ path: ref.path,
26271
+ byteLength: read.byteLength,
26272
+ sha256: read.sha256
26273
+ });
26274
+ touched = true;
26275
+ return {
26276
+ kind: "inline",
26277
+ name: ref.name,
26278
+ content: read.content
26279
+ };
26280
+ };
26281
+ for (const list of [
26282
+ "tools",
26283
+ "skills",
26284
+ "agents"
26285
+ ]) {
26286
+ const entries = resources[list];
26287
+ if (!Array.isArray(entries)) continue;
26288
+ const out = [];
26289
+ for (const [index, entry] of entries.entries()) {
26290
+ const ref = pathInlineRef(entry);
26291
+ if (ref === void 0) {
26292
+ out.push(entry);
26293
+ continue;
26294
+ }
26295
+ const at = `${list}[${index}]`;
26296
+ const replaced = await substitute(at, ref);
26297
+ if ("error" in replaced) return {
26298
+ ok: false,
26299
+ at,
26300
+ reason: replaced.error
26301
+ };
26302
+ out.push(replaced);
26303
+ }
26304
+ next[list] = out;
26305
+ }
26306
+ if (Array.isArray(resources.files)) {
26307
+ const out = [];
26308
+ for (const [index, mount] of resources.files.entries()) {
26309
+ const ref = isRecord(mount) ? pathInlineRef(mount.resource) : void 0;
26310
+ if (ref === void 0 || !isRecord(mount)) {
26311
+ out.push(mount);
26312
+ continue;
26313
+ }
26314
+ const at = `files[${index}].resource`;
26315
+ const replaced = await substitute(at, ref);
26316
+ if ("error" in replaced) return {
26317
+ ok: false,
26318
+ at,
26319
+ reason: replaced.error
26320
+ };
26321
+ out.push({
26322
+ ...mount,
26323
+ resource: replaced
26324
+ });
26325
+ }
26326
+ next.files = out;
26327
+ }
26328
+ const instructions = pathInlineRef(resources.instructions);
26329
+ if (instructions !== void 0) {
26330
+ const replaced = await substitute("instructions", instructions);
26331
+ if ("error" in replaced) return {
26332
+ ok: false,
26333
+ at: "instructions",
26334
+ reason: replaced.error
26335
+ };
26336
+ next.instructions = replaced;
26337
+ }
26338
+ if (!touched) return {
26339
+ ok: true,
26340
+ profile,
26341
+ resolved: []
26342
+ };
26343
+ return {
26344
+ ok: true,
26345
+ profile: {
26346
+ ...profile,
26347
+ resources: next
26348
+ },
26349
+ resolved
26350
+ };
26351
+ }
26352
+ //#endregion
26353
+ //#region src/runtime/supervise/retained-owner-resource-reader.ts
26354
+ /**
26355
+ * The owner's environment as a source of by-path spawn resources.
26356
+ *
26357
+ * Built once per scope, before the environment exists: the coordination tools are created ahead
26358
+ * of the owner's first turn, and the environment is admitted during it. So the reader resolves
26359
+ * its target on every read — the latest environment admission on this node, reconstructed through
26360
+ * the bound provider the same way cleanup reconstructs it, with the same identity check. A manager
26361
+ * that has not yet been admitted, or whose provider was never bound, gets a refusal that names the
26362
+ * missing piece rather than a read from nowhere.
26363
+ *
26364
+ * The environment's `read()` serves the sandbox's own workspace; containment against that
26365
+ * workspace is the provider's. The relative-path and `..` rules are the reader's, in
26366
+ * `environmentReader`, so a manager is refused for the rule it broke.
26367
+ */
26368
+ function scopeRetainedOwnerResourceReader(scope) {
26369
+ const state = owners.get(scope);
26370
+ if (state === void 0) return void 0;
26371
+ const latestEnvironmentId = () => state.liveEnvironmentId?.() ?? [...state.admissions].reverse().flatMap((admission) => admission.phase === "environment" ? [admission.environmentId] : [])[0];
26372
+ return {
26373
+ get describe() {
26374
+ return `environment ${latestEnvironmentId() ?? "<not yet admitted>"}`;
26375
+ },
26376
+ async read(path) {
26377
+ const provider = state.provider;
26378
+ if (provider === void 0) return {
26379
+ ok: false,
26380
+ reason: "the manager’s environment provider is not bound yet"
26381
+ };
26382
+ const environmentId = latestEnvironmentId();
26383
+ if (environmentId === void 0) return {
26384
+ ok: false,
26385
+ reason: "the manager’s environment has not been admitted yet"
26386
+ };
26387
+ if (!provider.get) return {
26388
+ ok: false,
26389
+ reason: `provider ${provider.name} cannot reconstruct the manager’s environment`
26390
+ };
26391
+ let environment;
26392
+ try {
26393
+ environment = await provider.get(environmentId);
26394
+ } catch (error) {
26395
+ return {
26396
+ ok: false,
26397
+ reason: `environment ${environmentId}: ${error instanceof Error ? error.message : String(error)}`
26398
+ };
26399
+ }
26400
+ if (environment === null) return {
26401
+ ok: false,
26402
+ reason: `environment ${environmentId} is gone`
26403
+ };
26404
+ if (environment.id !== environmentId || environment.provider !== provider.name) return {
26405
+ ok: false,
26406
+ reason: `provider returned another environment for ${environmentId}`
26407
+ };
26408
+ if (typeof environment.read !== "function") return {
26409
+ ok: false,
26410
+ reason: `environment ${environmentId} does not expose read; its provider cannot serve a resource by path`
26411
+ };
26412
+ const read = environment.read.bind(environment);
26413
+ return environmentReader({
26414
+ id: environment.id,
26415
+ read
26416
+ }).read(path);
26417
+ }
26418
+ };
26419
+ }
26420
+ //#endregion
25832
26421
  //#region src/runtime/supervise/retained-owner-seat-switch.ts
25833
26422
  /** A committed turn is the seat boundary. Keep its native home for a same-harness provider
25834
26423
  * continuation; only a provider/harness change needs a new environment. */
@@ -31997,14 +32586,10 @@ function deadlinePassed(pool, opts) {
31997
32586
  }
31998
32587
  //#endregion
31999
32588
  //#region src/runtime/supervise/supervisor-root-contract.ts
32000
- /** A resumed process may continue only the exact root contract first recorded for this run id. */
32589
+ /** A resumed process may continue only the exact root contract first recorded for this run id. Its
32590
+ * budget is the root's, or the one the run's last budget-carrying `reopened` row recorded. */
32001
32591
  function assertResumeContract(events, opts) {
32002
- const roots = events.filter((event) => event.kind === "spawned" && event.parent === void 0);
32003
- if (roots.length !== 1 || roots[0]?.id !== opts.runId) throw new RuntimeRunStateError(`supervisor: resumed run '${opts.runId}' must contain exactly one root identity event; found ${roots.length}`);
32004
- const recorded = roots[0];
32005
- if (contentAddress(recorded.budget) !== contentAddress(opts.budget)) throw new RuntimeRunStateError(`supervisor: resume budget mismatch for run '${opts.runId}'; use a new runId to change limits`);
32006
- const expectedAdmission = opts.reservationPolicy ? { policy: opts.reservationPolicy } : void 0;
32007
- if (contentAddress(recorded.recursiveAdmission ?? null) !== contentAddress(expectedAdmission ?? null)) throw new RuntimeRunStateError(`supervisor: resume reservation policy mismatch for run '${opts.runId}'; use a new runId`);
32592
+ const recorded = assertResumeLimits(events, opts);
32008
32593
  if (!sameOptionalIdentity(recorded.identity, opts.rootIdentity)) throw new RuntimeRunStateError(`supervisor: resume identity mismatch for run '${opts.runId}'; ${describeIdentityMismatch(recorded.identity, opts.rootIdentity)}`);
32009
32594
  const receipts = events.filter((event) => event.kind === "materialized" && event.id === opts.runId);
32010
32595
  const expectedReceipt = rootMaterializationReceipt(opts);
@@ -32013,6 +32598,20 @@ function assertResumeContract(events, opts) {
32013
32598
  } else if (receipts.length !== 1 || contentAddress(receipts[0]?.receipt) !== contentAddress(expectedReceipt)) throw new RuntimeRunStateError(`supervisor: resume materialization mismatch for run '${opts.runId}'; backend, model, execution identity, and plan must match`);
32014
32599
  return recorded;
32015
32600
  }
32601
+ /**
32602
+ * The limits half of the resume contract: one root identity event, the recorded budget and the
32603
+ * reservation policy. A reopen checks them before it archives anything (`durable/run-reopen.ts`);
32604
+ * `reopenBudget` is the budget that reopen is about to record, which then replaces the recorded one.
32605
+ */
32606
+ function assertResumeLimits(events, opts, reopenBudget) {
32607
+ const roots = events.filter((event) => event.kind === "spawned" && event.parent === void 0);
32608
+ if (roots.length !== 1 || roots[0]?.id !== opts.runId) throw new RuntimeRunStateError(`supervisor: resumed run '${opts.runId}' must contain exactly one root identity event; found ${roots.length}`);
32609
+ const recorded = roots[0];
32610
+ if (contentAddress(reopenBudget ?? events.filter((event) => event.kind === "reopened" && event.id === opts.runId && event.budget !== void 0).at(-1)?.budget ?? recorded.budget) !== contentAddress(opts.budget)) throw new RuntimeRunStateError(`supervisor: resume budget mismatch for run '${opts.runId}'; use a new runId to change limits`);
32611
+ const expectedAdmission = opts.reservationPolicy ? { policy: opts.reservationPolicy } : void 0;
32612
+ if (contentAddress(recorded.recursiveAdmission ?? null) !== contentAddress(expectedAdmission ?? null)) throw new RuntimeRunStateError(`supervisor: resume reservation policy mismatch for run '${opts.runId}'; use a new runId`);
32613
+ return recorded;
32614
+ }
32016
32615
  /** Mint root evidence at the trusted composition boundary. A generic in-process Agent root has no
32017
32616
  * executor declaration and remains explicitly unknown rather than inheriting fabricated details. */
32018
32617
  function rootMaterializationReceipt(opts) {
@@ -32696,7 +33295,8 @@ async function noWinner(settled, rejection) {
32696
33295
  reason: "cancelled",
32697
33296
  source: cancellation.source,
32698
33297
  cancellationReason: cancellation.message,
32699
- ...cancellation.operationId === void 0 ? {} : { operationId: cancellation.operationId }
33298
+ ...cancellation.operationId === void 0 ? {} : { operationId: cancellation.operationId },
33299
+ ...cancellation.operator === void 0 ? {} : { operator: cancellation.operator }
32700
33300
  };
32701
33301
  }
32702
33302
  if (lifecycle !== void 0) return {
@@ -32718,6 +33318,6 @@ async function noWinner(settled, rejection) {
32718
33318
  };
32719
33319
  }
32720
33320
  //#endregion
32721
- export { noteScopeRetainedOwnerCoordination as $, CONTINUATIONS_DIR as $n, runtimeOwnedExecutorProviderEvidence as $r, createWorktreeCliExecutor as $t, providerVisibleProfile as A, assertValidBudget as Ai, taskToPrompt$1 as An, fullProfileMaterialization as Ar, toolResultText as At, recordScopeOwnerBarrenPause as B, createSandboxUsageLedger as Bi, classifyDriverFailure as Bn, attestRuntimeOwnedScopeOwner as Br, startRetainedRun as Bt, beginScopeOwnerAttempt as C, executorFailure as Ci, DEFAULT_PEER_MAIL_LIMITS as Cn, LOCAL_HARNESSES as Cr, acquireSandbox as Ct, scopeOwnerExecutorNodeContext as D, newUsageTotals as Di, isPeerMailEnvelope as Dn, assertProfileMaterializes as Dr, codeModeModelOutput as Dt, restoreScopeOwnerAcceptedExecution as E, meterUsageEvent as Ei, createPeerMailbox as En, assertProfileMaterialization as Er, codeModeArguments as Et, freeSlots as F, mapSandboxEvent as Fi, isTerminalNodeStatus as Fn, sandboxActProfileMaterialization as Fr, providerAsExecutor as Ft, consumeScopeRetainedOwnerResult as G, awaitAbortable$1 as Gi, SeatChainExhaustedError as Gn, knownExecutionBindingReceipt as Gr, captureHarnessTranscript as Gt, recordScopeOwnerPause as H, notifySandboxEventObserver as Hi, undispatchedCredentialExit as Hn, authoredProfileDigest as Hr, retainedCreateMaterial as Ht, queueOf as I, mapSandboxToolEvent as Ii, DriverAttemptsExhaustedError as In, sandboxProfileMaterialization as Ir, LEAF_CONTINUATION_TASK as It, scopeRetainedOwnerResult as J, providerMessageText as Ji, subscriptionUsageLimitSignal as Jn, providerAttemptEvidence as Jr, readHarnessTranscript as Jt, prepareScopeRetainedOwnerTask as K, promptFromAgentTurnInput as Ki, authoredSeatStages as Kn, knownMaterializationReceipt as Kr, harnessTranscriptArtifact as Kt, rollingDispatch as L, terminalTextFromSandboxEvent as Li, HarnessTurnFailedError as Ln, unsupportedProfileDimensions as Lr, providerAsSandboxClient as Lt, settledToIteration as M, defaultRedactorIdentityMaterial as Mi, createActivityLog as Mn, promptControlProfileMaterialization as Mr, routerBrain as Mt, assertRecursiveReservationPolicy as N, resolveRedactor as Ni, readWorkerProgress as Nn, promptModelProfileMaterialization as Nr, createAgentEnvironmentProviderRegistry as Nt, coordinationMcpAlias as O, spendFromUsageEvents as Oi, peerMailTools as On, controlProfileMaterialization as Or, createCodeModeTools as Ot, deriveNodeExecutionIdentity as P, createSandboxToolPartState as Pi, isLiveNodeStatus as Pn, renderUnsupported as Pr, resolveAgentEnvironmentProvider as Pt, scopeRetainedOwnerRestorePoint as Q, verdictFromJudgeScore as Qn, runtimeOwnedExecutorMaterialization as Qr, openSlotGroup as Qt, meterRuntimeOwnedAccounting as R, canonicalStreamEventFromSandboxEvent as Ri, abandonablePending as Rn, worktreeCliProfileMaterialization as Rr, reconnectRetainedRun as Rt, FileSpawnJournal as S, contentAddress as Si, AUTHORITY_MARKERS as Sn, runWorktreeHarness as Sr, createSandboxLineage as St, recordScopeOwnerMaterialization as T, createBudgetPool as Ti, claimsAuthority as Tn, terminateProcessTreeAndConfirm as Tr, defaultSelectWinner as Tt, prepareScopeRetainedOwnerSeatSwitch as U, sumSandboxUsage as Ui, upstreamUnavailableSignal as Un, finalizeRuntimeOwnedPendingExecutor as Ur, destroyInteractiveEnvironment as Ut, recordScopeOwnerDriverAttempt as V, extractLlmCallEvent as Vi, summarizeDriverAttempts as Vn, authoredAgentIdentity as Vr, startRetainedRunInEnvironment as Vt, abandonScopeRetainedOwnerInvocation as W, decodeHarnessUsage as Wi, SeatChain as Wn, inheritRuntimeOwnedExecutorAttestation as Wr, environmentGone as Wt, scopeRetainedOwnerTurnEnded as X, gateOnDeliverable as Xn, runtimeOwnedDriveHarnessProviderEvidence as Xr, retainHarnessTranscript as Xt, beginScopeRetainedOwnerDrive as Y, CheckUnavailableError as Yn, recordRuntimeOwnedDriveHarnessProviderEvidence as Yr, resolveHarnessTranscriptCapture as Yt, reconcileScopeRetainedOwnerEnvironment as Z, mapExecutorResult as Zn, runtimeOwnedExecutorExecutionBinding as Zr, createWorkerSlots as Zt, attachWorker as _, unavailableSignalOfFailure as _i, sanitizeKnowledgeReadinessReport as _n, runAbortable as _r, createSteerableSandboxSession as _t, runTree as a, executableAgentSpecSnapshot as ai, buildLoopSpanNodes as an, isFiniteNumber as ar, loadSpawnForest as at, recoverRetainedInteractiveRun as b, detachedFrozen as bi, createInbox as bn, bridgeStopSignalKey as br, readPromptOptions as bt, driverExecutorFactory as c, runtimeFailureCause as ci, createOtelExporter as cn, priceTokens as cr, InMemorySpawnJournal as ct, createScope as d, registerRetainedExecutorPreparation as di, loopEventToOtelSpan as dn, createCodexRolloutStoreReader as dr, createExecutorRegistry as dt, runtimeOwnedPendingExecutorMaterialization as ei, createInPlaceCliExecutor as en, admitContinuationPolicy as er, bindScopeRetainedOwnerEnvironmentId as et, replaySpawnTree as f, retainedExecutorSeamKey as fi, padSpanId as fn, harnessUsageIsEmpty as fr, bindReusableExecutorExecutionId as ft, interactiveAdmissionSeamKey as g, unavailableResumeAt as gi, createRuntimeStreamEventCollector as gn, linkAbort as gr, DEFAULT_SANDBOX_STEERING_MAX_TURNS as gt, workerTraceAnalysisStore as h, unavailablePauseMs as hi, createRuntimeEventCollector as hn, RunCancellationReason as hr, snapshotExecutorConfig as ht, runFinalizer as i, executableAgentProfileSnapshot as ii, buildLoopOtelSpans as in, failedItems as ir, scopeRetainedOwnerJournalRoot as it, runtimeGraphMetadataKey as j, defaultRedactor as ji, DEFAULT_STALL_AFTER_MS as jn, profileMaterializationAxes$1 as jr, createRouterTranscript as jt, coordinationProfileToolPrefix as k, spendFromUsageTotals as ki, peerMailVerbNames as kn, defineProfileMaterializationContract as kr, runCodeMode as kt, isDriverSpec as l, settlementFailureCause as li, flatOtelSpan as ln, ROUTER_PRICE_SOURCE as lr, FileResultBlobStore as lt, parseWorkerToolTraceArtifact as m, jitteredMs as mi, toOtelAttributes as mn, createPushTraceSource as mr, createExecutor as mt, createSupervisor as n, unknownExecutionBindingReceipt as ni, createPropagatingTraceEmitter as nn, checkVerdictOf as nr, owners as nt, createRootHandle as o, projectSandboxOutcome as oi, buildRuntimeEventOtelSpans as on, bridgeAdmissionRefusal as or, materializeTreeView as ot, isTraceAnalysisStore as p, cappedDoublingMs as pi, padTraceId as pn, readCodexRolloutSession as pr, captureReusableExecutorConfig as pt, scopeRetainedOwnerPriorSpend as q, promptOptionsFromAgentTurnInput as qi, seatExecutionProfile as qn, newExecutionAttemptId as qr, persistHarnessTranscript as qt, bestDelivered as r, unknownMaterializationReceipt as ri, readTraceContextFromEnv as rn, createContinuationKeeper as rr, scopeRetainedOwnerContext as rt, driverChild as s, readSandboxOutcome as si, createOpenInferenceFileExporter as sn, bridgeModelRouteRefusal as sr, InMemoryResultBlobStore as st, DEFAULT_MAX_DEPTH as t, runtimeOwnedScopeOwnerRuntime as ti, WORKER_TRACE_PROPAGATION as tn, bestComposite as tr, bindScopeRetainedOwnerProvider as tt, withDriverExecutor as u, RetainedExecutionPendingError as ui, generateSpanId as un, addHarnessUsage as ur, insideCursorNamespace as ut, readWorkerInteractiveBinding as v, TRACE_ROOT_SCHEMA as vi, sanitizeRuntimeStreamEvent as vn, signalAbortError as vr, runAgentRounds as vt, noteScopeOwnerPlannedExecution as w, errMessage as wi, PEER_MAIL_WIRE_KEY as wn, harnessInvocation as wr, TERMINAL_DECISIONS as wt, startRetainedInteractiveRun as x, detachedSnapshot as xi, failPendingAfter as xn, runSettledCommand as xr, createSandboxForSpec as xt, reconnectRetainedInteractiveRun as y, TRACE_SUMMARY_SCHEMA as yi, INBOX_RECEIPT_KEY as yn, bridgeRuntimeAttachmentsKey as yr, assertBoxlessPromptOptions as yt, meterRuntimeOwnedProviderAttempt as z, createSandboxTurnEventCollector as zi, causedByPartialFailure as zn, attestRuntimeOwnedPendingExecutor as zr, recoverRetainedRun as zt };
33321
+ export { beginScopeRetainedOwnerDrive as $, sumSandboxUsage as $i, upstreamUnavailableSignal as $n, finalizeRuntimeOwnedPendingExecutor as $r, destroyInteractiveEnvironment as $t, coordinationProfileToolPrefix as A, detachedFrozen as Ai, createInbox as An, bridgeStopSignalKey as Ar, readPromptOptions as At, meterRuntimeOwnedProviderAttempt as B, assertValidBudget as Bi, taskToPrompt$1 as Bn, fullProfileMaterialization as Br, toolResultText as Bt, FileSpawnJournal as C, cappedDoublingMs as Ci, padTraceId as Cn, readCodexRolloutSession as Cr, captureReusableExecutorConfig as Ct, restoreScopeOwnerAcceptedExecution as D, unavailableSignalOfFailure as Di, sanitizeKnowledgeReadinessReport as Dn, runAbortable as Dr, createSteerableSandboxSession as Dt, recordScopeOwnerMaterialization as E, unavailableResumeAt as Ei, createRuntimeStreamEventCollector as En, linkAbort as Er, DEFAULT_SANDBOX_STEERING_MAX_TURNS as Et, deriveNodeExecutionIdentity as F, createBudgetPool as Fi, claimsAuthority as Fn, terminateProcessTreeAndConfirm as Fr, defaultSelectWinner as Ft, scopeRetainedOwnerResourceReader as G, mapSandboxEvent as Gi, isTerminalNodeStatus as Gn, sandboxActProfileMaterialization as Gr, providerAsExecutor as Gt, recordScopeOwnerDriverAttempt as H, defaultRedactorIdentityMaterial as Hi, createActivityLog as Hn, promptControlProfileMaterialization as Hr, routerBrain as Ht, freeSlots as I, meterUsageEvent as Ii, createPeerMailbox as In, assertProfileMaterialization as Ir, codeModeArguments as It, abandonScopeRetainedOwnerInvocation as J, canonicalStreamEventFromSandboxEvent as Ji, abandonablePending as Jn, worktreeCliProfileMaterialization as Jr, reconnectRetainedRun as Jt, environmentReader as K, mapSandboxToolEvent as Ki, DriverAttemptsExhaustedError as Kn, sandboxProfileMaterialization as Kr, LEAF_CONTINUATION_TASK as Kt, queueOf as L, newUsageTotals as Li, isPeerMailEnvelope as Ln, assertProfileMaterializes as Lr, codeModeModelOutput as Lt, runtimeGraphMetadataKey as M, contentAddress as Mi, AUTHORITY_MARKERS as Mn, runWorktreeHarness as Mr, createSandboxLineage as Mt, settledToIteration as N, executorFailure as Ni, DEFAULT_PEER_MAIL_LIMITS as Nn, LOCAL_HARNESSES as Nr, acquireSandbox as Nt, scopeOwnerExecutorNodeContext as O, TRACE_ROOT_SCHEMA as Oi, sanitizeRuntimeStreamEvent as On, signalAbortError as Or, runAgentRounds as Ot, assertRecursiveReservationPolicy as P, errMessage as Pi, PEER_MAIL_WIRE_KEY as Pn, harnessInvocation as Pr, TERMINAL_DECISIONS as Pt, scopeRetainedOwnerResult as Q, notifySandboxEventObserver as Qi, undispatchedCredentialExit as Qn, authoredProfileDigest as Qr, retainedCreateMaterial as Qt, rollingDispatch as R, spendFromUsageEvents as Ri, peerMailTools as Rn, controlProfileMaterialization as Rr, createCodeModeTools as Rt, startRetainedInteractiveRun as S, retainedExecutorSeamKey as Si, padSpanId as Sn, harnessUsageIsEmpty as Sr, bindReusableExecutorExecutionId as St, noteScopeOwnerPlannedExecution as T, unavailablePauseMs as Ti, createRuntimeEventCollector as Tn, RunCancellationReason as Tr, snapshotExecutorConfig as Tt, recordScopeOwnerPause as U, resolveRedactor as Ui, readWorkerProgress as Un, promptModelProfileMaterialization as Ur, createAgentEnvironmentProviderRegistry as Ut, recordScopeOwnerBarrenPause as V, defaultRedactor as Vi, DEFAULT_STALL_AFTER_MS as Vn, profileMaterializationAxes$1 as Vr, createRouterTranscript as Vt, prepareScopeRetainedOwnerSeatSwitch as W, createSandboxToolPartState as Wi, isLiveNodeStatus as Wn, renderUnsupported as Wr, resolveAgentEnvironmentProvider as Wt, prepareScopeRetainedOwnerTask as X, createSandboxUsageLedger as Xi, classifyDriverFailure as Xn, attestRuntimeOwnedScopeOwner as Xr, startRetainedRun as Xt, consumeScopeRetainedOwnerResult as Y, createSandboxTurnEventCollector as Yi, causedByPartialFailure as Yn, attestRuntimeOwnedPendingExecutor as Yr, recoverRetainedRun as Yt, scopeRetainedOwnerPriorSpend as Z, extractLlmCallEvent as Zi, summarizeDriverAttempts as Zn, authoredAgentIdentity as Zr, startRetainedRunInEnvironment as Zt, interactiveAdmissionSeamKey as _, readSandboxOutcome as _i, createOpenInferenceFileExporter as _n, bridgeModelRouteRefusal as _r, readCommittedJsonLines as _t, runFinalizer as a, recordRuntimeOwnedDriveHarnessProviderEvidence as ai, resolveHarnessTranscriptCapture as an, CheckUnavailableError as ar, bindScopeRetainedOwnerProvider as at, reconnectRetainedInteractiveRun as b, RetainedExecutionPendingError as bi, generateSpanId as bn, addHarnessUsage as br, insideCursorNamespace as bt, driverChild as c, runtimeOwnedExecutorMaterialization as ci, openSlotGroup as cn, verdictFromJudgeScore as cr, loadSpawnForest as ct, withDriverExecutor as d, runtimeOwnedScopeOwnerRuntime as di, WORKER_TRACE_PROPAGATION as dn, bestComposite as dr, InMemorySpawnJournal as dt, decodeHarnessUsage as ea, inheritRuntimeOwnedExecutorAttestation as ei, environmentGone as en, SeatChain as er, scopeRetainedOwnerTurnEnded as et, createScope as f, unknownExecutionBindingReceipt as fi, createPropagatingTraceEmitter as fn, checkVerdictOf as fr, FileResultBlobStore as ft, workerTraceAnalysisStore as g, projectSandboxOutcome as gi, buildRuntimeEventOtelSpans as gn, bridgeAdmissionRefusal as gr, readCommittedJsonFile as gt, parseWorkerToolTraceArtifact as h, executableAgentSpecSnapshot as hi, buildLoopSpanNodes as hn, isFiniteNumber as hr, prepareJsonlAppend as ht, bestDelivered as i, providerMessageText as ia, providerAttemptEvidence as ii, readHarnessTranscript as in, subscriptionUsageLimitSignal as ir, bindScopeRetainedOwnerEnvironmentId as it, providerVisibleProfile as j, detachedSnapshot as ji, failPendingAfter as jn, runSettledCommand as jr, createSandboxForSpec as jt, coordinationMcpAlias as k, TRACE_SUMMARY_SCHEMA as ki, INBOX_RECEIPT_KEY as kn, bridgeRuntimeAttachmentsKey as kr, assertBoxlessPromptOptions as kt, driverExecutorFactory as l, runtimeOwnedExecutorProviderEvidence as li, createWorktreeCliExecutor as ln, CONTINUATIONS_DIR as lr, materializeTreeView as lt, isTraceAnalysisStore as m, executableAgentProfileSnapshot as mi, buildLoopOtelSpans as mn, failedItems as mr, isNoEntError as mt, createSupervisor as n, promptFromAgentTurnInput as na, knownMaterializationReceipt as ni, harnessTranscriptArtifact as nn, authoredSeatStages as nr, scopeRetainedOwnerRestorePoint as nt, runTree as o, runtimeOwnedDriveHarnessProviderEvidence as oi, retainHarnessTranscript as on, gateOnDeliverable as or, scopeRetainedOwnerContext as ot, replaySpawnTree as p, unknownMaterializationReceipt as pi, readTraceContextFromEnv as pn, createContinuationKeeper as pr, appendCommittedJsonLine as pt, resolveSpawnResourcePaths as q, terminalTextFromSandboxEvent as qi, HarnessTurnFailedError as qn, unsupportedProfileDimensions as qr, providerAsSandboxClient as qt, assertResumeLimits as r, promptOptionsFromAgentTurnInput as ra, newExecutionAttemptId as ri, persistHarnessTranscript as rn, seatExecutionProfile as rr, noteScopeRetainedOwnerCoordination as rt, createRootHandle as s, runtimeOwnedExecutorExecutionBinding as si, createWorkerSlots as sn, mapExecutorResult as sr, scopeRetainedOwnerJournalRoot as st, DEFAULT_MAX_DEPTH as t, awaitAbortable$1 as ta, knownExecutionBindingReceipt as ti, captureHarnessTranscript as tn, SeatChainExhaustedError as tr, reconcileScopeRetainedOwnerEnvironment as tt, isDriverSpec as u, runtimeOwnedPendingExecutorMaterialization as ui, createInPlaceCliExecutor as un, admitContinuationPolicy as ur, InMemoryResultBlobStore as ut, attachWorker as v, runtimeFailureCause as vi, createOtelExporter as vn, priceTokens as vr, upsertCommittedJsonLine as vt, beginScopeOwnerAttempt as w, jitteredMs as wi, toOtelAttributes as wn, createPushTraceSource as wr, createExecutor as wt, recoverRetainedInteractiveRun as x, registerRetainedExecutorPreparation as xi, loopEventToOtelSpan as xn, createCodexRolloutStoreReader as xr, createExecutorRegistry as xt, readWorkerInteractiveBinding as y, settlementFailureCause as yi, flatOtelSpan as yn, ROUTER_PRICE_SOURCE as yr, withJsonlFileLock as yt, meterRuntimeOwnedAccounting as z, spendFromUsageTotals as zi, peerMailVerbNames as zn, defineProfileMaterializationContract as zr, runCodeMode as zt };
32722
33322
 
32723
- //# sourceMappingURL=supervisor-C_03z693.js.map
33323
+ //# sourceMappingURL=supervisor-gDn4C1o5.js.map