@tangle-network/agent-runtime 0.266.0 → 0.271.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 (66) hide show
  1. package/dist/{activation-VpxSbDKJ.d.ts → activation-BrJmwTLB.d.ts} +4 -4
  2. package/dist/{activation-BERiJjx5.js → activation-DGbFPGR3.js} +2 -2
  3. package/dist/{activation-BERiJjx5.js.map → activation-DGbFPGR3.js.map} +1 -1
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-DdZ-nh_4.js → coordination-driver-iBGMKDvB.js} +20 -14
  7. package/dist/coordination-driver-iBGMKDvB.js.map +1 -0
  8. package/dist/{delegate-Ajx_PVyu.js → delegate-DOqUvaIz.js} +2 -2
  9. package/dist/{delegate-Ajx_PVyu.js.map → delegate-DOqUvaIz.js.map} +1 -1
  10. package/dist/durable.d.ts +5 -4
  11. package/dist/durable.js +3 -3
  12. package/dist/durable.js.map +1 -1
  13. package/dist/{graph-CK50N9vG.js → graph-DnMcepkN.js} +8 -5
  14. package/dist/graph-DnMcepkN.js.map +1 -0
  15. package/dist/{improvement-cycle-GRPoHLm1.js → improvement-cycle-1IyRJo5h.js} +9 -9
  16. package/dist/improvement-cycle-1IyRJo5h.js.map +1 -0
  17. package/dist/{index-CU2mlMfc.d.ts → index-CL1dduJd.d.ts} +70 -6
  18. package/dist/index.d.ts +7 -7
  19. package/dist/index.js +7 -7
  20. package/dist/intelligence.d.ts +9 -3
  21. package/dist/intelligence.js +11 -5
  22. package/dist/intelligence.js.map +1 -1
  23. package/dist/kernel.d.ts +4 -4
  24. package/dist/kernel.js +9 -9
  25. package/dist/{loop-runner-bin-cC16EPUq.js → loop-runner-bin-BPZ9tt1W.js} +3 -3
  26. package/dist/{loop-runner-bin-cC16EPUq.js.map → loop-runner-bin-BPZ9tt1W.js.map} +1 -1
  27. package/dist/{loop-runner-bin-XKZXM08Q.d.ts → loop-runner-bin-O_vM1w8Y.d.ts} +3 -3
  28. package/dist/loop-runner-bin.d.ts +1 -1
  29. package/dist/loop-runner-bin.js +1 -1
  30. package/dist/mcp/bin.js +3 -3
  31. package/dist/mcp/index.d.ts +12 -6
  32. package/dist/mcp/index.js +7 -7
  33. package/dist/mcp/memory-bin.js +1 -1
  34. package/dist/{memory-server-Cn8LbAxO.js → memory-server-DXQ8IxGR.js} +2 -2
  35. package/dist/{memory-server-Cn8LbAxO.js.map → memory-server-DXQ8IxGR.js.map} +1 -1
  36. package/dist/{openai-tools-D3ajI_D2.d.ts → openai-tools-DWHxpwx2.d.ts} +2 -2
  37. package/dist/profiles.d.ts +2 -2
  38. package/dist/{provision-supervisor-Bf_bPaCv.js → provision-supervisor-Cy8pqE95.js} +3 -3
  39. package/dist/{provision-supervisor-Bf_bPaCv.js.map → provision-supervisor-Cy8pqE95.js.map} +1 -1
  40. package/dist/{runtime-hOLlAc1i.js → runtime-DVjIH1eo.js} +233 -11
  41. package/dist/runtime-DVjIH1eo.js.map +1 -0
  42. package/dist/{server-DOb67ohd.js → server-CN9vzbSe.js} +4 -4
  43. package/dist/{server-DOb67ohd.js.map → server-CN9vzbSe.js.map} +1 -1
  44. package/dist/{stream-agent-turn-Gw9hLpBn.d.ts → stream-agent-turn-DbEsKgb_.d.ts} +21 -3
  45. package/dist/{structural-rollout-DV9YoQF6.js → structural-rollout-I92sIfNl.js} +2 -2
  46. package/dist/{structural-rollout-DV9YoQF6.js.map → structural-rollout-I92sIfNl.js.map} +1 -1
  47. package/dist/{substrate-CLt9S9ym.d.ts → substrate-CbC03Vzo.d.ts} +2 -2
  48. package/dist/{supervise--njTtSL3.js → supervise-DJ_1i9vj.js} +13 -8
  49. package/dist/{supervise--njTtSL3.js.map → supervise-DJ_1i9vj.js.map} +1 -1
  50. package/dist/{supervisor-B8UMAXya.js → supervisor-Cvd5mf7x.js} +285 -86
  51. package/dist/supervisor-Cvd5mf7x.js.map +1 -0
  52. package/dist/testing.d.ts +2 -2
  53. package/dist/testing.js +14 -14
  54. package/dist/testing.js.map +1 -1
  55. package/dist/{tool-server-x9NEhvHZ.js → tool-server-Dqer2M4_.js} +30 -12
  56. package/dist/tool-server-Dqer2M4_.js.map +1 -0
  57. package/dist/tui/index.d.ts +1 -1
  58. package/dist/tui/index.js +1 -1
  59. package/dist/{types-CrnwLVYQ.d.ts → types-Bo7z5aG5.d.ts} +109 -43
  60. package/package.json +2 -1
  61. package/dist/coordination-driver-DdZ-nh_4.js.map +0 -1
  62. package/dist/graph-CK50N9vG.js.map +0 -1
  63. package/dist/improvement-cycle-GRPoHLm1.js.map +0 -1
  64. package/dist/runtime-hOLlAc1i.js.map +0 -1
  65. package/dist/supervisor-B8UMAXya.js.map +0 -1
  66. package/dist/tool-server-x9NEhvHZ.js.map +0 -1
@@ -14,7 +14,7 @@ import { access, chmod, copyFile, mkdir, mkdtemp, open, readFile, readdir, realp
14
14
  import { applyWorkspacePlan, hashWorkspacePlan, materializeProfile, resolveAgentProfileResources } from "@tangle-network/agent-profile-materialize";
15
15
  import { homedir, hostname, tmpdir } from "node:os";
16
16
  import { stripVTControlCharacters } from "node:util";
17
- import { deriveHexId, isW3CSpanId, isW3CTraceId } from "@tangle-network/agent-trace-contract";
17
+ import { ATTR, deriveHexId, isW3CSpanId, isW3CTraceId } from "@tangle-network/agent-trace-contract";
18
18
  import { SDKError, generateIdempotencyKey, withRetry } from "@tangle-network/agent-core";
19
19
  import { collectAgentFinalMessageText, collectAgentResponseText } from "@tangle-network/sandbox";
20
20
  import { request } from "node:http";
@@ -5171,25 +5171,30 @@ const GEN_AI = {
5171
5171
  * useless for the runs you most want to look at.
5172
5172
  */
5173
5173
  function createOpenInferenceFileExporter(filePath) {
5174
- const lines = [];
5174
+ let written = 0;
5175
+ let dropped = 0;
5175
5176
  let failed;
5176
- const append = (line) => {
5177
- try {
5178
- appendFileSync(filePath, `${line}\n`, "utf8");
5179
- } catch (error) {
5180
- failed ??= error instanceof Error ? error : new Error(String(error));
5181
- }
5182
- };
5183
5177
  return {
5184
5178
  exportSpan(span) {
5185
- append(JSON.stringify(toOpenInferenceLine(span)));
5186
- lines.push("");
5179
+ try {
5180
+ appendFileSync(filePath, `${JSON.stringify(toOpenInferenceLine(span))}\n`, "utf8");
5181
+ written += 1;
5182
+ } catch (error) {
5183
+ dropped += 1;
5184
+ failed ??= error instanceof Error ? error : new Error(String(error));
5185
+ }
5187
5186
  },
5188
5187
  async flush() {
5189
- if (failed) throw new Error(`OpenInference file exporter failed writing ${filePath}: ${failed.message}`);
5188
+ if (failed) throw new Error(`OpenInference file exporter failed writing ${filePath} (${dropped} spans dropped): ${failed.message}`);
5190
5189
  },
5191
- async shutdown() {
5192
- lines.length = 0;
5190
+ async shutdown() {},
5191
+ stats() {
5192
+ return {
5193
+ written,
5194
+ dropped,
5195
+ pending: 0,
5196
+ ...failed ? { lastError: failed.message } : {}
5197
+ };
5193
5198
  }
5194
5199
  };
5195
5200
  }
@@ -5240,68 +5245,172 @@ function toOpenInferenceLine(span) {
5240
5245
  };
5241
5246
  }
5242
5247
  /**
5243
- * Create an OTEL exporter. Returns undefined when no endpoint is configured.
5248
+ * Create an OTLP/HTTP exporter. Returns undefined when no endpoint is configured.
5249
+ *
5250
+ * One batch is in flight at a time; spans that arrive meanwhile wait in a queue bounded by
5251
+ * `maxQueueSize`. Every span ends in exactly one of `written` or `dropped`: a non-2xx response, a
5252
+ * network error, a timeout, an OTLP `partialSuccess.rejectedSpans` count and a full queue each count
5253
+ * as drops and set `lastError`. Nothing here throws into the caller's run; `flush()` reports the
5254
+ * loss, the same rule {@link createOpenInferenceFileExporter} follows.
5244
5255
  */
5245
5256
  function createOtelExporter(config) {
5246
5257
  const resolvedEndpoint = config?.endpoint ?? (typeof process !== "undefined" ? process.env.OTEL_EXPORTER_OTLP_ENDPOINT : void 0);
5247
5258
  if (!resolvedEndpoint) return void 0;
5248
- const endpoint = resolvedEndpoint;
5259
+ const url = `${resolvedEndpoint.replace(/\/+$/, "")}/v1/traces`;
5249
5260
  const headers = config?.headers ?? parseHeadersFromEnv();
5250
- const batchSize = config?.batchSize ?? 64;
5261
+ const batchSize = positiveInteger(config?.batchSize, 64);
5251
5262
  const flushIntervalMs = config?.flushIntervalMs ?? 5e3;
5252
- const serviceName = config?.serviceName ?? "agent-runtime";
5253
- const resourceAttrs = config?.resourceAttributes ?? {};
5254
- const pending = [];
5255
- let timer;
5263
+ const maxQueueSize = Math.max(positiveInteger(config?.maxQueueSize, 2048), batchSize);
5264
+ const timeoutMs = positiveInteger(config?.timeoutMs, 1e4);
5265
+ const resource = { attributes: toOtelAttributes({
5266
+ "service.name": config?.serviceName ?? "agent-runtime",
5267
+ ...config?.resourceAttributes ?? {}
5268
+ }) };
5269
+ const queue = [];
5270
+ let inFlight = 0;
5271
+ let written = 0;
5272
+ let dropped = 0;
5273
+ let droppedAtLastFlush = 0;
5274
+ let lastError;
5275
+ let sending;
5256
5276
  let stopped = false;
5257
- const exporter = {
5258
- exportSpan(span) {
5259
- if (stopped) return;
5260
- pending.push(span);
5261
- if (pending.length >= batchSize) doFlush();
5262
- },
5263
- async flush() {
5264
- await doFlush();
5265
- },
5266
- async shutdown() {
5267
- stopped = true;
5268
- if (timer !== void 0) {
5269
- clearInterval(timer);
5270
- timer = void 0;
5271
- }
5272
- await doFlush();
5273
- }
5277
+ const drop = (count, reason) => {
5278
+ dropped += count;
5279
+ lastError = reason;
5274
5280
  };
5275
- timer = setInterval(() => {
5276
- if (pending.length > 0) doFlush();
5277
- }, flushIntervalMs);
5278
- if (typeof timer === "object" && "unref" in timer) timer.unref();
5279
- async function doFlush() {
5280
- if (pending.length === 0) return;
5281
- const batch = pending.splice(0);
5281
+ async function send(batch) {
5282
5282
  const body = { resourceSpans: [{
5283
- resource: { attributes: toOtelAttributes({
5284
- "service.name": serviceName,
5285
- ...resourceAttrs
5286
- }) },
5283
+ resource,
5287
5284
  scopeSpans: [{
5288
5285
  scope: SCOPE,
5289
5286
  spans: batch
5290
5287
  }]
5291
5288
  }] };
5292
- const url = `${endpoint.replace(/\/+$/, "")}/v1/traces`;
5293
5289
  try {
5294
- await fetch(url, {
5290
+ const response = await fetch(url, {
5295
5291
  method: "POST",
5296
5292
  headers: {
5297
5293
  "content-type": "application/json",
5298
5294
  ...headers
5299
5295
  },
5300
- body: JSON.stringify(body)
5296
+ body: JSON.stringify(body),
5297
+ signal: AbortSignal.timeout(timeoutMs)
5301
5298
  });
5302
- } catch {}
5299
+ const text = await response.text().catch(() => "");
5300
+ if (!response.ok) {
5301
+ const detail = text ? `: ${text.slice(0, 200)}` : "";
5302
+ drop(batch.length, `HTTP ${response.status} from ${url}${detail}`);
5303
+ return;
5304
+ }
5305
+ const rejected = rejectedSpans(text, batch.length);
5306
+ if (rejected.count > 0) drop(rejected.count, `collector rejected ${rejected.count} spans: ${rejected.message}`);
5307
+ written += batch.length - rejected.count;
5308
+ } catch (error) {
5309
+ drop(batch.length, `POST ${url} failed: ${describeFetchError(error)}`);
5310
+ }
5311
+ }
5312
+ /** The single sender: it drains the queue batch by batch until the queue is empty. */
5313
+ function drain() {
5314
+ sending ??= (async () => {
5315
+ try {
5316
+ while (queue.length > 0) {
5317
+ const batch = queue.splice(0, batchSize);
5318
+ inFlight = batch.length;
5319
+ await send(batch);
5320
+ inFlight = 0;
5321
+ }
5322
+ } finally {
5323
+ sending = void 0;
5324
+ }
5325
+ })();
5326
+ return sending;
5327
+ }
5328
+ const timer = setInterval(() => {
5329
+ if (queue.length > 0) drain();
5330
+ }, flushIntervalMs);
5331
+ if (typeof timer === "object" && "unref" in timer) timer.unref();
5332
+ return {
5333
+ exportSpan(span) {
5334
+ if (stopped) {
5335
+ drop(1, "span exported after the exporter stopped");
5336
+ return;
5337
+ }
5338
+ if (queue.length + inFlight >= maxQueueSize) {
5339
+ drop(1, `queue full: ${maxQueueSize} spans already waiting on ${url}`);
5340
+ return;
5341
+ }
5342
+ queue.push(span);
5343
+ if (queue.length >= batchSize) drain();
5344
+ },
5345
+ async flush() {
5346
+ await drain();
5347
+ const lost = dropped - droppedAtLastFlush;
5348
+ droppedAtLastFlush = dropped;
5349
+ if (lost > 0) throw new Error(`OTLP exporter dropped ${lost} spans since the last flush: ${lastError}`);
5350
+ },
5351
+ async shutdown() {
5352
+ stopped = true;
5353
+ clearInterval(timer);
5354
+ await drain();
5355
+ },
5356
+ stats() {
5357
+ return {
5358
+ written,
5359
+ dropped,
5360
+ pending: queue.length + inFlight,
5361
+ ...lastError !== void 0 ? { lastError } : {}
5362
+ };
5363
+ }
5364
+ };
5365
+ }
5366
+ /**
5367
+ * Spans a 2xx OTLP/HTTP response still refused. The spec lets a collector accept a request and
5368
+ * reject part of it through `partialSuccess.rejectedSpans`; reading only the status would count
5369
+ * those spans as delivered. An empty or non-JSON body is a full success.
5370
+ */
5371
+ function rejectedSpans(text, batchLength) {
5372
+ if (!text.trim()) return {
5373
+ count: 0,
5374
+ message: ""
5375
+ };
5376
+ let parsed;
5377
+ try {
5378
+ parsed = JSON.parse(text);
5379
+ } catch {
5380
+ return {
5381
+ count: 0,
5382
+ message: ""
5383
+ };
5303
5384
  }
5304
- return exporter;
5385
+ if (parsed === null || typeof parsed !== "object") return {
5386
+ count: 0,
5387
+ message: ""
5388
+ };
5389
+ const partial = parsed.partialSuccess;
5390
+ if (partial === null || typeof partial !== "object") return {
5391
+ count: 0,
5392
+ message: ""
5393
+ };
5394
+ const { rejectedSpans: raw, errorMessage } = partial;
5395
+ const count = typeof raw === "string" ? Number(raw) : typeof raw === "number" ? raw : 0;
5396
+ if (!Number.isSafeInteger(count) || count <= 0) return {
5397
+ count: 0,
5398
+ message: ""
5399
+ };
5400
+ return {
5401
+ count: Math.min(count, batchLength),
5402
+ message: typeof errorMessage === "string" && errorMessage ? errorMessage : "no message"
5403
+ };
5404
+ }
5405
+ /** Node's fetch reports every socket failure as "fetch failed"; the cause names which one. */
5406
+ function describeFetchError(error) {
5407
+ if (!(error instanceof Error)) return String(error);
5408
+ const cause = error.cause;
5409
+ const code = cause && typeof cause === "object" && "code" in cause && typeof cause.code === "string" ? cause.code : void 0;
5410
+ return code ? `${error.message} (${code})` : error.message;
5411
+ }
5412
+ function positiveInteger(value, fallback) {
5413
+ return value !== void 0 && Number.isSafeInteger(value) && value > 0 ? value : fallback;
5305
5414
  }
5306
5415
  /**
5307
5416
  * Convert a LoopTraceEvent into an OtelSpan for export.
@@ -5384,6 +5493,7 @@ function buildRuntimeEventOtelSpans(events, traceId, parentSpanId, options = {})
5384
5493
  let name = `tangle.runtime.${event.type}`;
5385
5494
  if (event.type === "tool_call" || event.type === "tool_result") {
5386
5495
  name = `agent.${event.type}`;
5496
+ attrs[ATTR.spanKind] = "TOOL";
5387
5497
  attrs["tool.name"] = event.toolName;
5388
5498
  if (event.toolCallId) attrs["tool.call_id"] = event.toolCallId;
5389
5499
  const mcp = mcpIdentity(event.toolName);
@@ -5393,6 +5503,7 @@ function buildRuntimeEventOtelSpans(events, traceId, parentSpanId, options = {})
5393
5503
  if (payload !== void 0) attrs[event.type === "tool_call" ? "tool.input" : "tool.output"] = serialized(payload);
5394
5504
  } else if (event.type === "llm_call") {
5395
5505
  name = "gen_ai.client.inference";
5506
+ attrs[ATTR.spanKind] = "LLM";
5396
5507
  attrs["gen_ai.request.model"] = event.model;
5397
5508
  if (event.tokensIn !== void 0) attrs["gen_ai.usage.input_tokens"] = event.tokensIn;
5398
5509
  if (event.tokensOut !== void 0) attrs["gen_ai.usage.output_tokens"] = event.tokensOut;
@@ -5446,11 +5557,24 @@ function buildLoopOtelSpans(events, traceId, rootParentSpanId) {
5446
5557
  kind: 1,
5447
5558
  startTimeUnixNano: msToNs(node.startMs),
5448
5559
  endTimeUnixNano: msToNs(node.endMs),
5449
- attributes: toOtelAttributes(node.attrs),
5560
+ attributes: toOtelAttributes({
5561
+ ...node.attrs,
5562
+ [ATTR.spanKind]: LOOP_SPAN_KIND[node.kind]
5563
+ }),
5450
5564
  status: { code: node.error ? 2 : 1 }
5451
5565
  }));
5452
5566
  }
5453
5567
  /**
5568
+ * The declared kind of each loop level. An iteration span carries its own token total, and an
5569
+ * undeclared span with tokens reads as an LLM call, so declaring AGENT keeps those tokens from
5570
+ * being counted a second time beside the model-call spans beneath it.
5571
+ */
5572
+ const LOOP_SPAN_KIND = {
5573
+ loop: "CHAIN",
5574
+ round: "CHAIN",
5575
+ branch: "AGENT"
5576
+ };
5577
+ /**
5454
5578
  * Sink-neutral core behind {@link buildLoopOtelSpans}: reconstruct the
5455
5579
  * loop → round → branch span tree from one run's ordered `LoopTraceEvent`
5456
5580
  * stream. Consumed by the OTEL mapper above and by the MCP delegation
@@ -7404,7 +7528,8 @@ function assertRetainedRunReplayMaterial(provider, replay, admission) {
7404
7528
  }, identity, retainedContextTransfer(replay.turn.contextTransfer)));
7405
7529
  }
7406
7530
  function retainedRunIntent(options, identity, contextTransfer) {
7407
- const requestedProfileDigest = canonicalCandidateDigest(options.environment.profile);
7531
+ const { profile } = options.environment;
7532
+ const requestedProfileDigest = typeof profile === "string" ? canonicalCandidateDigest(profile) : canonicalAgentProfileDigest(profile);
7408
7533
  const requestDigest = canonicalCandidateDigest({
7409
7534
  kind: "retained-run-intent.v1",
7410
7535
  provider: options.provider.name,
@@ -8263,6 +8388,7 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
8263
8388
  let workspaceCapturePromise;
8264
8389
  let workspaceCleanupPromise;
8265
8390
  let retainedReleasePromise;
8391
+ let releaseReadTried = false;
8266
8392
  let workspaceOutcome;
8267
8393
  let workspacePreservationRequired = false;
8268
8394
  let workspaceRunActive = false;
@@ -8615,6 +8741,11 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
8615
8741
  environment = target;
8616
8742
  resetWorkspaceState(target);
8617
8743
  }
8744
+ if (harnessTranscript.status !== "captured" && !releaseReadTried) {
8745
+ releaseReadTried = true;
8746
+ const capture = await captureHarnessTranscript(target, profile.harness, signal);
8747
+ if (capture.status === "captured") harnessTranscript = capture;
8748
+ }
8618
8749
  const result = await destroyEnvironment(signal);
8619
8750
  if (!result.destroyed) return [receipt(false, result.detail, result.permanent)];
8620
8751
  pending = false;
@@ -16636,6 +16767,7 @@ var FileResultBlobStore = class {
16636
16767
  return `${this.dir}/${outRef.replace(/:/g, "-")}.json`;
16637
16768
  }
16638
16769
  };
16770
+ /** @internal shared with the SQL-backed store. */
16639
16771
  function encodeResultBlob(outRef, artifact) {
16640
16772
  const detached = detachedSnapshot(artifact, "result blob");
16641
16773
  assertContentAddress(outRef, detached);
@@ -16648,6 +16780,7 @@ function encodeResultBlob(outRef, artifact) {
16648
16780
  text
16649
16781
  };
16650
16782
  }
16783
+ /** @internal shared with the SQL-backed store. */
16651
16784
  function assertContentAddress(outRef, artifact) {
16652
16785
  const expected = contentAddress(artifact);
16653
16786
  if (outRef !== expected) throw new Error(`blob outRef '${outRef}' does not match the artifact content hash '${expected}'; a content-addressed store refuses a mismatched ref (breaks the replay invariant)`);
@@ -17085,6 +17218,7 @@ function servedIdentityParts(model) {
17085
17218
  };
17086
17219
  }
17087
17220
  /** One validation implementation for memory, durable append, and cold replay. */
17221
+ /** @internal shared with the SQL-backed store. */
17088
17222
  var SpawnEventIndex = class {
17089
17223
  root;
17090
17224
  nodes = /* @__PURE__ */ new Map();
@@ -21025,14 +21159,15 @@ function settledNodeEvidence(subject, settlement, settledAt) {
21025
21159
  trace: detachedSnapshot(settlement.trace, "worker trace evidence")
21026
21160
  };
21027
21161
  }
21028
- /** The `agent.child` payload of the release: the settlement restated as released, `settledAt`
21029
- * kept at the settlement instant and `metered` omitted so the driver's inference is not summed
21030
- * twice. The sweep and the resume heal emit it from the same builder. */
21031
- function releasedChildPayload(subject, settlement, settledAt, releasedAt) {
21162
+ /** The `agent.child` payload of a closed retained slot: the settlement restated with the state
21163
+ * the slot closed in, `settledAt` kept at the settlement instant and `metered` omitted so the
21164
+ * driver's inference is not summed twice. The sweep, the final close and the resume heal emit
21165
+ * it from the same builder. */
21166
+ function releasedChildPayload(subject, settlement, settledAt, releasedAt, retainedExecution = "released") {
21032
21167
  return {
21033
21168
  childId: subject.id,
21034
21169
  status: "down",
21035
- retainedExecution: "released",
21170
+ retainedExecution,
21036
21171
  ...settlement.retainedPendingCause === void 0 ? {} : { retainedPendingCause: settlement.retainedPendingCause },
21037
21172
  releasedAt,
21038
21173
  ...settlement.outRef === void 0 ? {} : { outRef: settlement.outRef },
@@ -21273,7 +21408,11 @@ async function assertRecordedResult(node, result, events, opts) {
21273
21408
  * The keyed assignments a prior journal proves: every `spawned` event carrying a `key`, resolved
21274
21409
  * against the replayed settlements. A key spawned more than once (a retry chain) resolves to its
21275
21410
  * LATEST attempt — iterate in ordinal order so later spawns overwrite earlier ones. A spawned
21276
- * event with no matching settlement is `in-doubt`: the process died with it in flight.
21411
+ * event with no matching settlement is `in-doubt`: the process died with it in flight — UNLESS
21412
+ * the spawn's own runtime proves the execution cannot have outlived the process (`inline`, the
21413
+ * same predicate the budget layer charges no uncertain reservation for), in which case the resume
21414
+ * itself is the terminal evidence and the key resolves `down` with a derived reason, so a re-spawn
21415
+ * under the same key retries instead of wedging in-doubt.
21277
21416
  */
21278
21417
  function keyedAssignments(events, settled) {
21279
21418
  const byId = new Map(settled.map((s) => [s.handle.id, s]));
@@ -21283,7 +21422,13 @@ function keyedAssignments(events, settled) {
21283
21422
  if (ev.key === void 0) continue;
21284
21423
  if (ev.identity === void 0) throw new RuntimeRunStateError(`supervisor: keyed node '${ev.id}' has no durable execution identity`);
21285
21424
  const s = byId.get(ev.id);
21286
- keys.set(ev.key, s === void 0 ? {
21425
+ keys.set(ev.key, s === void 0 ? ev.runtime === "inline" ? {
21426
+ id: ev.id,
21427
+ label: ev.label,
21428
+ identity: ev.identity,
21429
+ state: "down",
21430
+ reason: `interrupted: the process died with '${ev.label}' in flight and its '${ev.runtime}' runtime cannot outlive that process, so the resume proves the attempt dead`
21431
+ } : {
21287
21432
  id: ev.id,
21288
21433
  label: ev.label,
21289
21434
  identity: ev.identity,
@@ -22620,6 +22765,7 @@ const runtimeOwnedProviderMeters = /* @__PURE__ */ new WeakMap();
22620
22765
  const pauseRecorders = /* @__PURE__ */ new WeakMap();
22621
22766
  const recoveryStarters = /* @__PURE__ */ new WeakMap();
22622
22767
  const retainedReleasers = /* @__PURE__ */ new WeakMap();
22768
+ const retainedSlotClosers = /* @__PURE__ */ new WeakMap();
22623
22769
  const teardownRetriers = /* @__PURE__ */ new WeakMap();
22624
22770
  const teardownRetriable = /* @__PURE__ */ new WeakMap();
22625
22771
  /** The retained owner environments a scope's last release could not confirm destroyed. */
@@ -22707,6 +22853,25 @@ async function releaseRetainedEnvironments(scope) {
22707
22853
  return unconfirmedTeardowns(scope);
22708
22854
  }
22709
22855
  /**
22856
+ * @internal Close the cursor slot of every retained child this scope and its nested scopes still
22857
+ * hold open, once the settlement is final and the release and its retries are done.
22858
+ *
22859
+ * The release sweep closes a slot only when it confirms the environment destroyed, and nothing
22860
+ * else ever closed the rest: a refused delete, a teardown probe that failed after a destroy, or an
22861
+ * admission that timed out before `create` named an environment. Measured on the Discovery fleet
22862
+ * of 2026-09-23/24 (Runtime 0.249.1 to 0.261.0): 338 of 1,620 agents never settled, so they had no
22863
+ * terminal record, no spend but the reservation ceiling, and no transcript receipt (#1301). A
22864
+ * settlement under `retainedAtSettlement: 'release'` is final, so no process will recover these
22865
+ * executions. Each slot closes with the settlement the driver already received, under the seq it
22866
+ * saw, marked `retainedExecution: 'release-unconfirmed'`. The environment it may still hold stays
22867
+ * named by its `teardown-unconfirmed` record for a sweeper. Never call this on a run a later
22868
+ * process may resume.
22869
+ */
22870
+ async function closeRetainedSlots(scope) {
22871
+ const close = retainedSlotClosers.get(scope);
22872
+ if (close) await close();
22873
+ }
22874
+ /**
22710
22875
  * @internal Everything this scope cannot prove destroyed: its settled children whose teardown is
22711
22876
  * unconfirmed and, after a release, the retained owner environment that release could not
22712
22877
  * confirm. Read live, so a later retry that confirms a node removes it.
@@ -22877,6 +23042,14 @@ function createScope(args) {
22877
23042
  identity: prior.identity,
22878
23043
  reason: prior.settled.reason
22879
23044
  });
23045
+ } else if (prior.state === "down" && prior.settled === void 0) {
23046
+ if (prior.identity === void 0) continue;
23047
+ keyed.set(key, {
23048
+ state: "down",
23049
+ id: prior.id,
23050
+ identity: prior.identity,
23051
+ reason: prior.reason ?? "interrupted: resume proved the prior attempt dead"
23052
+ });
22880
23053
  } else if (prior.identity !== void 0) keyed.set(key, {
22881
23054
  state: "in-doubt",
22882
23055
  id: prior.id,
@@ -23225,6 +23398,7 @@ function createScope(args) {
23225
23398
  askTeardown,
23226
23399
  ...executor.heldEnvironments ? { readHeldEnvironments: executor.heldEnvironments.bind(executor) } : {},
23227
23400
  ...nestedTeardownScopes.has(executor) ? { readNestedScope: nestedTeardownScopes.get(executor) } : {},
23401
+ ...executor.harnessTranscript ? { readTranscriptAtRelease: () => persistHarnessTranscript(readHarnessTranscript(executor), args.blobs) } : {},
23228
23402
  teardownAttempts: 0,
23229
23403
  abortChild: (reason) => controller.abort(reason)
23230
23404
  };
@@ -23916,24 +24090,44 @@ function createScope(args) {
23916
24090
  const prior = released.length > 0 ? await args.journal.loadTree(args.root) ?? [] : [];
23917
24091
  for (const { child, receipts } of released) {
23918
24092
  for (const receipt of receipts) await appendEnvironmentTeardown(args.journal, args.root, child.id, receipt, new Date(now()).toISOString());
23919
- if (child.cleanupConfirmed && child.recoveryPending === true && child.resolved?.kind === "down" && child.settledSeq !== void 0 && child.settledAt !== void 0 && !prior.some((event) => event.id === child.id && closesCursorSlot(event))) {
23920
- child.budgetViolation = child.retainedViolation;
23921
- const settledAt = child.settledAt;
23922
- await args.journal.appendEvent(args.root, terminalDownEvent(child, child.resolved, child.settledSeq, new Date(settledAt).toISOString(), "released"));
23923
- child.retainedExecution = "released";
23924
- const releasedAt = now();
23925
- notifyRuntimeHookEvent(args.hooks, {
23926
- id: `${child.id}:released`,
23927
- runId: args.root,
23928
- target: "agent.child",
23929
- phase: "after",
23930
- timestamp: releasedAt,
23931
- stepIndex: child.settledSeq,
23932
- parentId: args.parentId,
23933
- payload: releasedChildPayload(child, child.resolved, settledAt, releasedAt)
23934
- }, { signal: args.signal });
23935
- }
24093
+ if (child.cleanupConfirmed) await closeRetainedSlot(child, "released", prior);
24094
+ }
24095
+ });
24096
+ const closeRetainedSlot = async (child, state, prior) => {
24097
+ if (child.recoveryPending !== true || child.resolved?.kind !== "down" || child.settledSeq === void 0 || child.settledAt === void 0 || child.retainedExecution === "released" || child.retainedExecution === "release-unconfirmed" || prior.some((event) => event.id === child.id && closesCursorSlot(event))) return;
24098
+ child.budgetViolation = child.retainedViolation;
24099
+ const settledAt = child.settledAt;
24100
+ let settlement = child.resolved;
24101
+ if (settlement.harnessTranscript?.status !== "available" && child.readTranscriptAtRelease) {
24102
+ const atRelease = await child.readTranscriptAtRelease();
24103
+ if (atRelease.status === "available") settlement = {
24104
+ ...settlement,
24105
+ harnessTranscript: atRelease
24106
+ };
24107
+ }
24108
+ await args.journal.appendEvent(args.root, terminalDownEvent(child, settlement, child.settledSeq, new Date(settledAt).toISOString(), state));
24109
+ child.retainedExecution = state;
24110
+ const closedAt = now();
24111
+ notifyRuntimeHookEvent(args.hooks, {
24112
+ id: `${child.id}:${state}`,
24113
+ runId: args.root,
24114
+ target: "agent.child",
24115
+ phase: "after",
24116
+ timestamp: closedAt,
24117
+ stepIndex: child.settledSeq,
24118
+ parentId: args.parentId,
24119
+ payload: releasedChildPayload(child, settlement, settledAt, closedAt, state)
24120
+ }, { signal: args.signal });
24121
+ };
24122
+ retainedSlotClosers.set(scope, async () => {
24123
+ for (const child of children.values()) {
24124
+ const nested = child.readNestedScope?.();
24125
+ if (nested !== void 0) await closeRetainedSlots(nested);
23936
24126
  }
24127
+ const open = [...children.values()].filter((child) => child.recoveryPending === true && !child.cleanupConfirmed && isTerminalNodeStatus(child.status) && child.retainedExecution !== "released" && child.retainedExecution !== "release-unconfirmed");
24128
+ if (open.length === 0) return;
24129
+ const prior = await args.journal.loadTree(args.root) ?? [];
24130
+ for (const child of open) await closeRetainedSlot(child, "release-unconfirmed", prior);
23937
24131
  });
23938
24132
  registerScopeRetainedOwner(scope, {
23939
24133
  rootId: args.root,
@@ -26501,6 +26695,7 @@ function createSupervisor() {
26501
26695
  seq: teardownSeq++,
26502
26696
  at: new Date(now()).toISOString()
26503
26697
  });
26698
+ if (releasing) await closeRetainedSlots(openScope);
26504
26699
  } catch (error) {
26505
26700
  if (actOutcome?.ok !== false) actOutcome = {
26506
26701
  ok: false,
@@ -26917,13 +27112,16 @@ function fleetYieldFromForest(forest) {
26917
27112
  const spawned = /* @__PURE__ */ new Set();
26918
27113
  const terminal = /* @__PURE__ */ new Map();
26919
27114
  const released = /* @__PURE__ */ new Set();
27115
+ const unconfirmed = /* @__PURE__ */ new Set();
26920
27116
  for (const { event } of forest.events) if (event.kind === "spawned") {
26921
27117
  if (event.parent !== void 0) spawned.add(event.id);
26922
27118
  } else if (event.kind === "settled" || event.kind === "cancelled") {
26923
27119
  const bucket = event.kind === "cancelled" ? "cancelled" : event.status;
26924
27120
  terminal.set(event.id, bucket);
26925
- if (event.retainedExecution === "released" && bucket !== "done") released.add(event.id);
26926
- else released.delete(event.id);
27121
+ released.delete(event.id);
27122
+ unconfirmed.delete(event.id);
27123
+ if (bucket !== "done" && event.retainedExecution === "released") released.add(event.id);
27124
+ if (bucket !== "done" && event.retainedExecution === "release-unconfirmed") unconfirmed.add(event.id);
26927
27125
  }
26928
27126
  const count = (bucket) => [...terminal.values()].filter((value) => value === bucket).length;
26929
27127
  const fleetYield = {
@@ -26932,10 +27130,11 @@ function fleetYieldFromForest(forest) {
26932
27130
  down: count("down"),
26933
27131
  cancelled: count("cancelled"),
26934
27132
  neverSettled: forest.inDoubt.length,
26935
- releasedUnrecovered: released.size
27133
+ releasedUnrecovered: released.size,
27134
+ releaseUnconfirmed: unconfirmed.size
26936
27135
  };
26937
27136
  if (fleetYield.done + fleetYield.down + fleetYield.cancelled + fleetYield.neverSettled !== fleetYield.spawned) throw new RuntimeRunStateError(`supervisor: fleet yield does not partition the spawned children of '${forest.root}' (${JSON.stringify(fleetYield)})`);
26938
- if (fleetYield.releasedUnrecovered > fleetYield.down + fleetYield.cancelled) throw new RuntimeRunStateError(`supervisor: released children exceed down + cancelled for '${forest.root}' (${JSON.stringify(fleetYield)})`);
27137
+ if (fleetYield.releasedUnrecovered + fleetYield.releaseUnconfirmed > fleetYield.down + fleetYield.cancelled) throw new RuntimeRunStateError(`supervisor: released children exceed down + cancelled for '${forest.root}' (${JSON.stringify(fleetYield)})`);
26939
27138
  return fleetYield;
26940
27139
  }
26941
27140
  /** The journaled nodes whose usage accounting is incomplete — one `SpendGap` per node+kind,
@@ -27000,6 +27199,6 @@ function isNonEmptySpend(s) {
27000
27199
  return s.iterations > 0 || s.tokens.input > 0 || s.tokens.output > 0 || s.usd > 0 || s.ms > 0 || s.tokensKnown === false || s.usdKnown === false || Object.values(s.resources ?? {}).some((resource) => resource.amount > 0 || !resource.known);
27001
27200
  }
27002
27201
  //#endregion
27003
- export { interactiveAdmissionSeamKey as $, cloneSpend as $i, retainedCreateMaterial as $n, profileMaterializationAxes$1 as $r, readWorkerProgress as $t, restoreScopeOwnerAcceptedExecution as A, runtimeOwnedScopeOwnerRuntime as Ai, routerBrain as An, createRuntimeEventCollector as Ar, pendingWaits as At, bindScopeRetainedOwnerEnvironmentId as B, canonicalStreamEventFromSandboxEvent as Bi, sandboxClientAsProvider as Bn, DEFAULT_LOCAL_HARNESS as Br, createBudgetPool as Bt, beginScopeOwnerAttempt as C, promptOptionsFromAgentTurnInput as Ca, providerAttemptEvidence as Ci, isTerminalDecision as Cn, exportEvalRuns as Cr, FileResultBlobStore as Ct, meterRuntimeOwnedProviderAttempt as D, runtimeOwnedExecutorMaterialization as Di, acquireSandbox as Dn, padSpanId as Dr, insideCursorNamespace as Dt, meterRuntimeOwnedAccounting as E, runtimeOwnedExecutorExecutionBinding as Ei, probeSandboxCapabilities as En, loopEventToOtelSpan as Er, InMemorySpawnJournal as Et, isWaitOutcome as F, detachedFrozen as Fi, LEAF_CONTINUATION_TASK as Fn, runSettledCommand as Fr, parseWorkerToolTraceArtifact as Ft, scopeRetainedOwnerContext as G, mapSandboxEvent as Gi, sandboxSessionTraceSource as Gn, parseCodexTokenUsage as Gr, WORKER_TRACE_PROPAGATION as Gt, consumeScopeRetainedOwnerResult as H, createSandboxUsageLedger as Hi, unavailableSignalOfFailure as Hn, harnessInvocation as Hr, newUsageTotals as Ht, pollFor as I, detachedSnapshot as Ii, createAgentEnvironmentProviderRegistry as In, runWorktreeHarness as Ir, workerTraceAnalysisStore as It, scopeRetainedOwnerResult as J, sandboxEventServedBackend as Ji, errMessage as Jn, AGENT_PROFILE_MATERIALIZATION_AXES as Jr, workerTraceHeaders as Jt, scopeRetainedOwnerPriorSpend as K, mapSandboxToolEvent as Ki, registerRetainedExecutorPreparation as Kn, CodexExecutionDiagnosticError as Kr, readWorkerTraceContext as Kt, timerAt as L, projectSandboxOutcome as Li, providerAsExecutor as Ln, captureWorktreeDiff as Lr, BudgetReconcileFault as Lt, settledToIteration as M, unknownMaterializationReceipt as Mi, canonicalObservedModelParts as Mn, sanitizeAgentRuntimeEvent as Mr, WORKER_TOOL_TRACE_SCHEMA_VERSION as Mt, createWorkerSlots as N, executableAgentProfileSnapshot as Ni, observedModelMatchesDeclared as Nn, sanitizeKnowledgeReadinessReport as Nr, captureWorkerTraceEvidence as Nt, recordScopeOwnerMaterialization as O, runtimeOwnedExecutorProviderEvidence as Oi, assertBoxlessPromptOptions as On, padTraceId as Or, loadSpawnForest as Ot, createWaitProbes as P, executableAgentSpecSnapshot as Pi, DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS as Pn, sanitizeRuntimeStreamEvent as Pr, isTraceAnalysisStore as Pt, resolveSpawnResourcePaths as Q, chargedTokens as Qi, startRetainedRunInEnvironment as Qn, fullProfileMaterialization as Qr, createActivityLog as Qt, validateWaitSpec as R, readSandboxOutcome as Ri, providerAsSandboxClient as Rn, createWorktree as Rr, ReservationWaitRefused as Rt, assertRecursiveReservationPolicy as S, promptFromAgentTurnInput as Sa, newExecutionAttemptId as Si, defaultSelectWinner as Sn, createOtelExporter as Sr, createInPlaceCliExecutor as St, deriveNodeExecutionIdentity as T, runtimeOwnedDriveHarnessProviderEvidence as Ti, createSandboxLineage as Tn, generateSpanId as Tr, InMemoryResultBlobStore as Tt, prepareScopeRetainedOwnerTask as U, extractLlmCallEvent as Ui, createPushTraceSource as Un, harnessSupportsReasoningEffort as Ur, spendFromUsageEvents as Ut, bindScopeRetainedOwnerProvider as V, createSandboxToolPartState as Vi, unavailablePauseMs as Vn, LOCAL_HARNESSES as Vr, meterUsageEvent as Vt, reconcileScopeRetainedOwnerEnvironment as W, isSandboxTerminalEvent as Wi, decodeToolPart as Wn, localHarnessExecutable as Wr, spendFromUsageTotals as Wt, environmentReader as X, sumSandboxUsage as Xi, recoverRetainedRun as Xn, controlProfileMaterialization as Xr, taskToPrompt as Xt, SPAWN_RESOURCE_PATH_MAX_BYTES as Y, sandboxProgressEvents as Yi, reconnectRetainedRun as Yn, assertProfileMaterialization as Yr, workerTraceSeamKey as Yt, hostDirectoryReader as Z, addSpend as Zi, startRetainedRun as Zn, defineProfileMaterializationContract as Zr, DEFAULT_STALL_AFTER_MS as Zt, driverChild as _, awaitAbortable$1 as _a, authoredProfileDigest as _i, readCodexRolloutSession as _n, INTELLIGENCE_WIRE_VERSION as _r, createExecutorRegistry as _t, collectDelivered as a, sleep as aa, renderUnsupported as ai, createPeerMailbox as an, runAbortable as ar, workerInteractiveBindingsDir as at, withDriverExecutor as b, teardownExecutor as ba, knownExecutionBindingReceipt as bi, TERMINAL_DECISIONS as bn, buildRuntimeEventOtelSpans as br, DEFAULT_SANDBOX_STEERING_MAX_TURNS as bt, runTree as c, throwIfAborted as ca, validateProfileMaterialization as ci, peerMailVerbNames as cn, resolveRedactor as cr, startRetainedInteractiveRun as ct, HarnessTurnFailedError as d, zeroSpend as da, parseCommittedJsonLines as di, executorFailure as dn, persistHarnessTranscript as dr, rollingDispatch as dt, deleteBoxSafe as ea, promptControlProfileMaterialization as ei, createInbox as en, destroyInteractiveEnvironment as er, readWorkerInteractiveAdmissions as et, classifyDriverFailure as f, addResourceSpend as fa, prepareJsonlAppend as fi, bridgeAdmissionRefusal as fn, contentAddress as fr, bindReusableExecutorExecutionId as ft, upstreamUnavailableSignal as g, abortError$2 as ga, attestRuntimeOwnedScopeOwner as gi, harnessUsageIsEmpty as gn, traceContextToEnv as gr, createExecutor as gt, summarizeDriverAttempts as h, decodeHarnessUsage as ha, attestRuntimeOwnedPendingExecutor as hi, createCodexRolloutStoreReader as hn, readTraceContextFromEnv as hr, cliWorktreeExecutor as ht, bestDelivered as i, randomSuffix as ia, renderProfileMaterializationIssues as ii, claimsAuthority as in, linkAbort as ir, workerInteractiveBindingFile as it, scopeOwnerExecutorNodeContext as j, unknownExecutionBindingReceipt as ji, runBrainLoop as jn, createRuntimeStreamEventCollector as jr, replaySpawnTree as jt, recordScopeOwnerPause as k, runtimeOwnedPendingExecutorMaterialization as ki, readPromptOptions as kn, toOtelAttributes as kr, materializeTreeView as kt, DEFAULT_MAX_BARREN_REPROMPTS as l, unmeteredSpend as la, worktreeCliProfileMaterialization as li, isLiveNodeStatus as ln, captureHarnessTranscript as lr, freeSlots as lt, runDriverWithRetry as m, withBudgetResources as ma, writeAllBytes as mi, addHarnessUsage as mn, mergeTraceEnv as mr, cliInPlaceExecutor as mt, createRootHandle as n, isAbortError$2 as na, promptOnlyProfileMaterialization as ni, DEFAULT_PEER_MAIL_LIMITS as nn, RunCancellationReason as nr, attachWorker as nt, pickBestDelivered as o, stringifySafe as oa, sandboxActProfileMaterialization as oi, isPeerMailEnvelope as on, defaultRedactor as or, reconnectRetainedInteractiveRun as ot, defaultUnmetContractSteer as p, resourceTelemetry as pa, readCommittedJsonLines as pi, bridgeModelRouteRefusal as pn, createPropagatingTraceEmitter as pr, captureReusableExecutorConfig as pt, scopeRetainedOwnerResourceReader as q, notifySandboxEventObserver as qi, retainedExecutorSeamKey as qn, terminateProcessTreeAndConfirm as qr, workerTraceEnv as qt, createSupervisor as r, promptCacheTokenClasses as ra, promptResourceProfileMaterialization as ri, PEER_MAIL_WIRE_KEY as rn, abortError as rr, readWorkerInteractiveBinding as rt, runFinalizer as s, throwAbort as sa, unsupportedProfileDimensions as si, peerMailTools as sn, defaultRedactorIdentityMaterial as sr, recoverRetainedInteractiveRun as st, DEFAULT_MAX_DEPTH as t, hasCompleteCacheBreakdown as ta, promptModelProfileMaterialization as ti, AUTHORITY_MARKERS as tn, environmentGone as tr, workerInteractiveAdmissionFile as tt, DriverAttemptsExhaustedError as u, withTimeout as ua, isNoEntError as ui, isTerminalNodeStatus as un, harnessTranscriptArtifact as ur, queueOf as ut, driverExecutorFactory as v, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as va, finalizeRuntimeOwnedPendingExecutor as vi, bridgeRuntimeAttachmentsKey as vn, buildLoopOtelSpans as vr, snapshotExecutorConfig as vt, createScope as w, providerMessageText as wa, recordRuntimeOwnedDriveHarnessProviderEvidence as wi, runAgentRounds as wn, flatOtelSpan as wr, FileSpawnJournal as wt, SUBTREE_RESULT_LIMIT as x, teardownSurfaces as xa, knownMaterializationReceipt as xi, createSandboxForSpec as xn, createOpenInferenceFileExporter as xr, createSteerableSandboxSession as xt, isDriverSpec as y, armDeadlineTimer as ya, inheritRuntimeOwnedExecutorAttestation as yi, bridgeStopSignalKey as yn, buildLoopSpanNodes as yr, createWorktreeCliExecutor as yt, waitUntil as z, assertSandboxServedModel as zi, resolveAgentEnvironmentProvider as zn, removeWorktree as zr, assertValidBudget as zt };
27202
+ export { interactiveAdmissionSeamKey as $, sumSandboxUsage as $i, recoverRetainedRun as $n, controlProfileMaterialization as $r, taskToPrompt as $t, restoreScopeOwnerAcceptedExecution as A, runtimeOwnedExecutorMaterialization as Ai, acquireSandbox as An, padSpanId as Ar, insideCursorNamespace as At, bindScopeRetainedOwnerEnvironmentId as B, projectSandboxOutcome as Bi, providerAsExecutor as Bn, captureWorktreeDiff as Br, BudgetReconcileFault as Bt, beginScopeOwnerAttempt as C, teardownExecutor as Ca, knownExecutionBindingReceipt as Ci, TERMINAL_DECISIONS as Cn, buildRuntimeEventOtelSpans as Cr, FileResultBlobStore as Ct, meterRuntimeOwnedProviderAttempt as D, providerMessageText as Da, recordRuntimeOwnedDriveHarnessProviderEvidence as Di, runAgentRounds as Dn, flatOtelSpan as Dr, SpawnEventIndex as Dt, meterRuntimeOwnedAccounting as E, promptOptionsFromAgentTurnInput as Ea, providerAttemptEvidence as Ei, isTerminalDecision as En, exportEvalRuns as Er, InMemorySpawnJournal as Et, isWaitOutcome as F, unknownMaterializationReceipt as Fi, canonicalObservedModelParts as Fn, sanitizeAgentRuntimeEvent as Fr, WORKER_TOOL_TRACE_SCHEMA_VERSION as Ft, scopeRetainedOwnerContext as G, createSandboxUsageLedger as Gi, unavailableSignalOfFailure as Gn, harnessInvocation as Gr, newUsageTotals as Gt, consumeScopeRetainedOwnerResult as H, assertSandboxServedModel as Hi, resolveAgentEnvironmentProvider as Hn, removeWorktree as Hr, assertValidBudget as Ht, pollFor as I, executableAgentProfileSnapshot as Ii, observedModelMatchesDeclared as In, sanitizeKnowledgeReadinessReport as Ir, captureWorkerTraceEvidence as It, scopeRetainedOwnerResult as J, mapSandboxEvent as Ji, sandboxSessionTraceSource as Jn, parseCodexTokenUsage as Jr, WORKER_TRACE_PROPAGATION as Jt, scopeRetainedOwnerPriorSpend as K, extractLlmCallEvent as Ki, createPushTraceSource as Kn, harnessSupportsReasoningEffort as Kr, spendFromUsageEvents as Kt, timerAt as L, executableAgentSpecSnapshot as Li, DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS as Ln, sanitizeRuntimeStreamEvent as Lr, isTraceAnalysisStore as Lt, settledToIteration as M, runtimeOwnedPendingExecutorMaterialization as Mi, readPromptOptions as Mn, toOtelAttributes as Mr, materializeTreeView as Mt, createWorkerSlots as N, runtimeOwnedScopeOwnerRuntime as Ni, routerBrain as Nn, createRuntimeEventCollector as Nr, pendingWaits as Nt, recordScopeOwnerMaterialization as O, runtimeOwnedDriveHarnessProviderEvidence as Oi, createSandboxLineage as On, generateSpanId as Or, assertContentAddress as Ot, createWaitProbes as P, unknownExecutionBindingReceipt as Pi, runBrainLoop as Pn, createRuntimeStreamEventCollector as Pr, replaySpawnTree as Pt, resolveSpawnResourcePaths as Q, sandboxProgressEvents as Qi, reconnectRetainedRun as Qn, assertProfileMaterialization as Qr, workerTraceSeamKey as Qt, validateWaitSpec as R, detachedFrozen as Ri, LEAF_CONTINUATION_TASK as Rn, runSettledCommand as Rr, parseWorkerToolTraceArtifact as Rt, assertRecursiveReservationPolicy as S, armDeadlineTimer as Sa, inheritRuntimeOwnedExecutorAttestation as Si, bridgeStopSignalKey as Sn, buildLoopSpanNodes as Sr, createInPlaceCliExecutor as St, deriveNodeExecutionIdentity as T, promptFromAgentTurnInput as Ta, newExecutionAttemptId as Ti, defaultSelectWinner as Tn, createOtelExporter as Tr, InMemoryResultBlobStore as Tt, prepareScopeRetainedOwnerTask as U, canonicalStreamEventFromSandboxEvent as Ui, sandboxClientAsProvider as Un, DEFAULT_LOCAL_HARNESS as Ur, createBudgetPool as Ut, bindScopeRetainedOwnerProvider as V, readSandboxOutcome as Vi, providerAsSandboxClient as Vn, createWorktree as Vr, ReservationWaitRefused as Vt, reconcileScopeRetainedOwnerEnvironment as W, createSandboxToolPartState as Wi, unavailablePauseMs as Wn, LOCAL_HARNESSES as Wr, meterUsageEvent as Wt, environmentReader as X, notifySandboxEventObserver as Xi, retainedExecutorSeamKey as Xn, terminateProcessTreeAndConfirm as Xr, workerTraceEnv as Xt, SPAWN_RESOURCE_PATH_MAX_BYTES as Y, mapSandboxToolEvent as Yi, registerRetainedExecutorPreparation as Yn, CodexExecutionDiagnosticError as Yr, readWorkerTraceContext as Yt, hostDirectoryReader as Z, sandboxEventServedBackend as Zi, errMessage as Zn, AGENT_PROFILE_MATERIALIZATION_AXES as Zr, workerTraceHeaders as Zt, driverChild as _, withBudgetResources as _a, writeAllBytes as _i, addHarnessUsage as _n, mergeTraceEnv as _r, createExecutorRegistry as _t, collectDelivered as a, isAbortError$2 as aa, promptOnlyProfileMaterialization as ai, DEFAULT_PEER_MAIL_LIMITS as an, RunCancellationReason as ar, workerInteractiveBindingsDir as at, withDriverExecutor as b, awaitAbortable$1 as ba, authoredProfileDigest as bi, readCodexRolloutSession as bn, INTELLIGENCE_WIRE_VERSION as br, DEFAULT_SANDBOX_STEERING_MAX_TURNS as bt, runTree as c, sleep as ca, renderUnsupported as ci, createPeerMailbox as cn, runAbortable as cr, startRetainedInteractiveRun as ct, HarnessTurnFailedError as d, throwIfAborted as da, validateProfileMaterialization as di, peerMailVerbNames as dn, resolveRedactor as dr, rollingDispatch as dt, addSpend as ea, defineProfileMaterializationContract as ei, DEFAULT_STALL_AFTER_MS as en, startRetainedRun as er, readWorkerInteractiveAdmissions as et, classifyDriverFailure as f, unmeteredSpend as fa, worktreeCliProfileMaterialization as fi, isLiveNodeStatus as fn, captureHarnessTranscript as fr, bindReusableExecutorExecutionId as ft, upstreamUnavailableSignal as g, resourceTelemetry as ga, readCommittedJsonLines as gi, bridgeModelRouteRefusal as gn, createPropagatingTraceEmitter as gr, createExecutor as gt, summarizeDriverAttempts as h, addResourceSpend as ha, prepareJsonlAppend as hi, bridgeAdmissionRefusal as hn, contentAddress as hr, cliWorktreeExecutor as ht, bestDelivered as i, hasCompleteCacheBreakdown as ia, promptModelProfileMaterialization as ii, AUTHORITY_MARKERS as in, environmentGone as ir, workerInteractiveBindingFile as it, scopeOwnerExecutorNodeContext as j, runtimeOwnedExecutorProviderEvidence as ji, assertBoxlessPromptOptions as jn, padTraceId as jr, loadSpawnForest as jt, recordScopeOwnerPause as k, runtimeOwnedExecutorExecutionBinding as ki, probeSandboxCapabilities as kn, loopEventToOtelSpan as kr, encodeResultBlob as kt, DEFAULT_MAX_BARREN_REPROMPTS as l, stringifySafe as la, sandboxActProfileMaterialization as li, isPeerMailEnvelope as ln, defaultRedactor as lr, freeSlots as lt, runDriverWithRetry as m, zeroSpend as ma, parseCommittedJsonLines as mi, executorFailure as mn, persistHarnessTranscript as mr, cliInPlaceExecutor as mt, createRootHandle as n, cloneSpend as na, profileMaterializationAxes$1 as ni, readWorkerProgress as nn, retainedCreateMaterial as nr, attachWorker as nt, pickBestDelivered as o, promptCacheTokenClasses as oa, promptResourceProfileMaterialization as oi, PEER_MAIL_WIRE_KEY as on, abortError as or, reconnectRetainedInteractiveRun as ot, defaultUnmetContractSteer as p, withTimeout as pa, isNoEntError as pi, isTerminalNodeStatus as pn, harnessTranscriptArtifact as pr, captureReusableExecutorConfig as pt, scopeRetainedOwnerResourceReader as q, isSandboxTerminalEvent as qi, decodeToolPart as qn, localHarnessExecutable as qr, spendFromUsageTotals as qt, createSupervisor as r, deleteBoxSafe as ra, promptControlProfileMaterialization as ri, createInbox as rn, destroyInteractiveEnvironment as rr, readWorkerInteractiveBinding as rt, runFinalizer as s, randomSuffix as sa, renderProfileMaterializationIssues as si, claimsAuthority as sn, linkAbort as sr, recoverRetainedInteractiveRun as st, DEFAULT_MAX_DEPTH as t, chargedTokens as ta, fullProfileMaterialization as ti, createActivityLog as tn, startRetainedRunInEnvironment as tr, workerInteractiveAdmissionFile as tt, DriverAttemptsExhaustedError as u, throwAbort as ua, unsupportedProfileDimensions as ui, peerMailTools as un, defaultRedactorIdentityMaterial as ur, queueOf as ut, driverExecutorFactory as v, decodeHarnessUsage as va, attestRuntimeOwnedPendingExecutor as vi, createCodexRolloutStoreReader as vn, readTraceContextFromEnv as vr, snapshotExecutorConfig as vt, createScope as w, teardownSurfaces as wa, knownMaterializationReceipt as wi, createSandboxForSpec as wn, createOpenInferenceFileExporter as wr, FileSpawnJournal as wt, SUBTREE_RESULT_LIMIT as x, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as xa, finalizeRuntimeOwnedPendingExecutor as xi, bridgeRuntimeAttachmentsKey as xn, buildLoopOtelSpans as xr, createSteerableSandboxSession as xt, isDriverSpec as y, abortError$2 as ya, attestRuntimeOwnedScopeOwner as yi, harnessUsageIsEmpty as yn, traceContextToEnv as yr, createWorktreeCliExecutor as yt, waitUntil as z, detachedSnapshot as zi, createAgentEnvironmentProviderRegistry as zn, runWorktreeHarness as zr, workerTraceAnalysisStore as zt };
27004
27203
 
27005
- //# sourceMappingURL=supervisor-B8UMAXya.js.map
27204
+ //# sourceMappingURL=supervisor-Cvd5mf7x.js.map