@tangle-network/agent-runtime 0.229.0 → 0.231.1

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 (61) hide show
  1. package/dist/{activation-o9SrkJqs.js → activation-DVqSBfe1.js} +2 -2
  2. package/dist/{activation-o9SrkJqs.js.map → activation-DVqSBfe1.js.map} +1 -1
  3. package/dist/{activation-DFSQ90A8.d.ts → activation-Dltkq5S8.d.ts} +2 -2
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-C6rde-Rv.js → coordination-driver-CUdEC2Qh.js} +4 -3
  7. package/dist/{coordination-driver-C6rde-Rv.js.map → coordination-driver-CUdEC2Qh.js.map} +1 -1
  8. package/dist/{delegate-Cmd-qlWH.js → delegate-BN0cSSUT.js} +2 -2
  9. package/dist/{delegate-Cmd-qlWH.js.map → delegate-BN0cSSUT.js.map} +1 -1
  10. package/dist/durable.d.ts +2 -2
  11. package/dist/durable.js +2 -2
  12. package/dist/{graph-BK05MhFv.js → graph-D4wgK3ns.js} +3 -3
  13. package/dist/{graph-BK05MhFv.js.map → graph-D4wgK3ns.js.map} +1 -1
  14. package/dist/{improvement-cycle-DHl4SxbQ.js → improvement-cycle-CjIeWuyB.js} +3 -3
  15. package/dist/{improvement-cycle-DHl4SxbQ.js.map → improvement-cycle-CjIeWuyB.js.map} +1 -1
  16. package/dist/{index-B6xSpuPo.d.ts → index-BW6lJXnH.d.ts} +11 -6
  17. package/dist/index.d.ts +6 -6
  18. package/dist/index.js +7 -7
  19. package/dist/intelligence.d.ts +3 -3
  20. package/dist/intelligence.js +3 -3
  21. package/dist/kernel.d.ts +3 -3
  22. package/dist/kernel.js +8 -8
  23. package/dist/{loop-runner-bin-D5hutINM.d.ts → loop-runner-bin-BcqlGNW-.d.ts} +3 -3
  24. package/dist/{loop-runner-bin-CU2bdlr1.js → loop-runner-bin-BodmUPOf.js} +3 -3
  25. package/dist/{loop-runner-bin-CU2bdlr1.js.map → loop-runner-bin-BodmUPOf.js.map} +1 -1
  26. package/dist/loop-runner-bin.d.ts +1 -1
  27. package/dist/loop-runner-bin.js +1 -1
  28. package/dist/mcp/bin.js +3 -3
  29. package/dist/mcp/index.d.ts +5 -5
  30. package/dist/mcp/index.js +6 -6
  31. package/dist/mcp/memory-bin.js +1 -1
  32. package/dist/{memory-server-BR310Weg.js → memory-server-Cn8LbAxO.js} +2 -2
  33. package/dist/{memory-server-BR310Weg.js.map → memory-server-Cn8LbAxO.js.map} +1 -1
  34. package/dist/{openai-tools-HhRT1L1W.d.ts → openai-tools-avHT8eq3.d.ts} +2 -2
  35. package/dist/profiles.d.ts +2 -2
  36. package/dist/{provision-supervisor-C2rRWXG6.js → provision-supervisor-DyNDlA2I.js} +3 -3
  37. package/dist/{provision-supervisor-C2rRWXG6.js.map → provision-supervisor-DyNDlA2I.js.map} +1 -1
  38. package/dist/{runtime-BBcrtrkj.js → runtime-BxZHapmG.js} +8 -8
  39. package/dist/{runtime-BBcrtrkj.js.map → runtime-BxZHapmG.js.map} +1 -1
  40. package/dist/{server-CWIl-a3C.js → server-C9pa2tSq.js} +4 -4
  41. package/dist/{server-CWIl-a3C.js.map → server-C9pa2tSq.js.map} +1 -1
  42. package/dist/stream-agent-turn-hiU4vgGX.d.ts +2058 -0
  43. package/dist/{structural-rollout-zl02ztZ4.js → structural-rollout-DQoLyth9.js} +2 -2
  44. package/dist/{structural-rollout-zl02ztZ4.js.map → structural-rollout-DQoLyth9.js.map} +1 -1
  45. package/dist/{substrate-sWW5cDIe.d.ts → substrate-CBo6TWOl.d.ts} +2 -2
  46. package/dist/{supervise-DbNMYx7z.js → supervise-Cl_-IsVc.js} +134 -21
  47. package/dist/supervise-Cl_-IsVc.js.map +1 -0
  48. package/dist/{supervisor-DAHG98Rs.js → supervisor-DFsXULnE.js} +232 -96
  49. package/dist/supervisor-DFsXULnE.js.map +1 -0
  50. package/dist/testing.d.ts +2 -2
  51. package/dist/testing.js +12 -12
  52. package/dist/{tool-server-BJbCPhoW.js → tool-server-x9NEhvHZ.js} +2 -2
  53. package/dist/tool-server-x9NEhvHZ.js.map +1 -0
  54. package/dist/tui/index.d.ts +1 -1
  55. package/dist/tui/index.js +1 -1
  56. package/dist/{stream-agent-turn-jPdnzI_5.d.ts → types-DBovefLD.d.ts} +4015 -4770
  57. package/package.json +4 -4
  58. package/dist/supervise-DbNMYx7z.js.map +0 -1
  59. package/dist/supervisor-DAHG98Rs.js.map +0 -1
  60. package/dist/tool-server-BJbCPhoW.js.map +0 -1
  61. package/dist/types-Ba5mJkyd.d.ts +0 -1293
@@ -6618,7 +6618,14 @@ async function startRetainedRun(options) {
6618
6618
  assertRequestedInteractionCapabilities(options.provider.name, options.turn.interactions, providerCapabilities);
6619
6619
  options.environment.signal?.throwIfAborted();
6620
6620
  options.turn.signal?.throwIfAborted();
6621
- const environment = await options.provider.create({
6621
+ let environment;
6622
+ if (options.existingEnvironmentId !== void 0) {
6623
+ assertStableText(options.existingEnvironmentId, "retained environment id");
6624
+ const existing = await options.provider.get(options.existingEnvironmentId);
6625
+ if (!existing || existing.id !== options.existingEnvironmentId || existing.provider !== options.provider.name) throw new Error("retained provider environment is unavailable or has another identity");
6626
+ await assertRetainedEnvironmentOwnership(options.provider, existing.id, options.environment.idempotencyKey);
6627
+ environment = existing;
6628
+ } else environment = await options.provider.create({
6622
6629
  ...options.environment,
6623
6630
  metadata: retainedEnvironmentMetadata(options.environment.metadata, options.environment.idempotencyKey)
6624
6631
  });
@@ -6627,6 +6634,7 @@ async function startRetainedRun(options) {
6627
6634
  capabilities = retainedCapabilitiesForEnvironment(options.provider.name, providerCapabilities, environment);
6628
6635
  assertRequestedInteractionCapabilities(options.provider.name, options.turn.interactions, capabilities);
6629
6636
  } catch (error) {
6637
+ if (options.existingEnvironmentId !== void 0) throw error;
6630
6638
  try {
6631
6639
  await environment.destroy?.();
6632
6640
  } catch (cleanupError) {
@@ -6635,6 +6643,7 @@ async function startRetainedRun(options) {
6635
6643
  throw error;
6636
6644
  }
6637
6645
  if (!environment.dispatch || !environment.session) {
6646
+ if (options.existingEnvironmentId !== void 0) throw new Error(`provider "${options.provider.name}" does not expose detached session control`);
6638
6647
  try {
6639
6648
  await environment.destroy?.();
6640
6649
  } catch (cleanupError) {
@@ -6652,7 +6661,8 @@ async function startRetainedRun(options) {
6652
6661
  identity,
6653
6662
  onAdmission: options.onAdmission,
6654
6663
  capabilities,
6655
- now: options.now
6664
+ now: options.now,
6665
+ preserveEnvironment: options.existingEnvironmentId !== void 0
6656
6666
  });
6657
6667
  }
6658
6668
  /**
@@ -6693,7 +6703,8 @@ async function startRetainedRunInEnvironment(options) {
6693
6703
  identity,
6694
6704
  onAdmission: options.onAdmission,
6695
6705
  capabilities,
6696
- now: options.now
6706
+ now: options.now,
6707
+ preserveEnvironment: true
6697
6708
  });
6698
6709
  }
6699
6710
  async function assertRetainedEnvironmentOwnership(provider, environmentId, idempotencyKey) {
@@ -6714,7 +6725,7 @@ async function dispatchRetainedRun(options) {
6714
6725
  executionId: identity.executionId
6715
6726
  });
6716
6727
  const destroyIfCreated = async (cause) => {
6717
- if (environment.creation !== "created") throw cause;
6728
+ if (options.preserveEnvironment || environment.creation !== "created") throw cause;
6718
6729
  try {
6719
6730
  await environment.destroy?.();
6720
6731
  } catch (cleanupError) {
@@ -6851,6 +6862,7 @@ function retainedRunIntent(options, identity, contextTransfer) {
6851
6862
  kind: "retained-run-intent.v1",
6852
6863
  provider: options.provider.name,
6853
6864
  idempotencyKey: options.environment.idempotencyKey,
6865
+ ...options.existingEnvironmentId === void 0 ? {} : { existingEnvironmentId: options.existingEnvironmentId },
6854
6866
  turnId: options.turn.turnId,
6855
6867
  sessionId: identity.sessionId,
6856
6868
  executionId: identity.executionId,
@@ -7545,7 +7557,8 @@ function providerAsExecutor(provider, options = {}) {
7545
7557
  };
7546
7558
  }
7547
7559
  function createProviderExecutor(provider, profile, ctx, options, placement) {
7548
- const controller = linkAbort(ctx.signal);
7560
+ const controller = new AbortController();
7561
+ const node = ctx.node === void 0 ? void 0 : detachedSnapshot(ctx.node, "provider executor node");
7549
7562
  let environment;
7550
7563
  let artifact;
7551
7564
  let retained;
@@ -7555,8 +7568,8 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
7555
7568
  const runtime = options.runtime ?? provider.name;
7556
7569
  const createProfile = options.profileForCreate?.(profile) ?? profile;
7557
7570
  if (placement && canonicalAgentProfileDigest(createProfile) !== canonicalAgentProfileDigest(profile)) throw new ValidationError("provider placement: profileForCreate cannot change the selected profile");
7558
- const executionId = retention?.executionId ?? ctx.node?.nodeId ?? `provider-run-${randomUUID()}`;
7559
- const attemptId = ctx.node?.attemptId ?? newExecutionAttemptId(executionId);
7571
+ const executionId = retention?.executionId ?? node?.nodeId ?? `provider-run-${randomUUID()}`;
7572
+ const attemptId = node?.attemptId ?? newExecutionAttemptId(executionId);
7560
7573
  const trace = createPushTraceSource({ runId: executionId });
7561
7574
  const providerModel = concreteProfileModel(createProfile);
7562
7575
  const tokenLimits = enforceTokenLimits(profileModelExecutionSettings(createProfile, `providerAsExecutor(${provider.name})`).tokenLimits, "provider", `providerAsExecutor(${provider.name})`);
@@ -7578,7 +7591,7 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
7578
7591
  plan: {
7579
7592
  kind: "agent-environment",
7580
7593
  provider: provider.name,
7581
- destroyOnSettle: options.destroyOnSettle ?? true,
7594
+ destroyOnSettle: retention?.preserveEnvironment ? false : options.destroyOnSettle ?? true,
7582
7595
  requireTerminalEvent: options.requireTerminalEvent ?? true,
7583
7596
  tokenLimits,
7584
7597
  ...placement ? { placement } : {}
@@ -7603,42 +7616,47 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
7603
7616
  }
7604
7617
  };
7605
7618
  let executor;
7606
- const run = (task, signal, recovering = false) => {
7607
- return streamProviderExecutor({
7608
- provider,
7609
- profile,
7610
- createProfile,
7611
- task,
7612
- signal,
7613
- controller,
7614
- options,
7615
- retention,
7616
- executionId,
7617
- trace,
7618
- recovering,
7619
- onRetained: (handle) => {
7620
- retained = handle;
7621
- },
7622
- onPending: (value) => {
7623
- pending = value;
7624
- },
7625
- onEnvironment: (env) => {
7626
- environment = env;
7627
- finalizeRuntimeOwnedPendingExecutor(executor, {
7628
- ...plannedDeclaration,
7629
- execution: {
7630
- kind: "environment",
7631
- id: env.id
7632
- }
7633
- }, plannedBinding);
7634
- },
7635
- onArtifact: (next) => {
7636
- artifact = next;
7637
- },
7638
- onDestroyed: () => {
7639
- destroyed = true;
7640
- }
7641
- });
7619
+ const run = async function* (task, signal, recovering = false) {
7620
+ const linked = linkAbort(ctx.signal, signal, controller.signal);
7621
+ try {
7622
+ yield* streamProviderExecutor({
7623
+ provider,
7624
+ profile,
7625
+ createProfile,
7626
+ task,
7627
+ signal: linked.signal,
7628
+ ...node === void 0 ? {} : { node },
7629
+ options,
7630
+ retention,
7631
+ executionId,
7632
+ trace,
7633
+ recovering,
7634
+ onRetained: (handle) => {
7635
+ retained = handle;
7636
+ },
7637
+ onPending: (value) => {
7638
+ pending = value;
7639
+ },
7640
+ onEnvironment: (env) => {
7641
+ environment = env;
7642
+ finalizeRuntimeOwnedPendingExecutor(executor, {
7643
+ ...plannedDeclaration,
7644
+ execution: {
7645
+ kind: "environment",
7646
+ id: env.id
7647
+ }
7648
+ }, plannedBinding);
7649
+ },
7650
+ onArtifact: (next) => {
7651
+ artifact = next;
7652
+ },
7653
+ onDestroyed: () => {
7654
+ destroyed = true;
7655
+ }
7656
+ });
7657
+ } finally {
7658
+ linked.release();
7659
+ }
7642
7660
  };
7643
7661
  executor = {
7644
7662
  runtime,
@@ -7730,7 +7748,7 @@ function admittedEnvironmentId(retention) {
7730
7748
  }
7731
7749
  async function* streamProviderExecutor(args) {
7732
7750
  const started = Date.now();
7733
- const linked = linkAbort(args.signal, args.controller.signal).signal;
7751
+ const linked = args.signal;
7734
7752
  const defaultTurn = taskToTurnInput(args.task, linked);
7735
7753
  let turn = providerTurnWithDefaults(providerTurnDefaults(args.options.promptOptions, `providerAsExecutor(${args.provider.name})`), args.options.taskToTurn?.(args.task, args.profile, defaultTurn) ?? defaultTurn, linked);
7736
7754
  if (args.options.defaults?.metadata?.runtimeProviderPlacement !== void 0) {
@@ -7832,6 +7850,7 @@ async function* streamProviderExecutor(args) {
7832
7850
  };
7833
7851
  const verdict = await args.options.validator?.validate(result, {
7834
7852
  iteration: 0,
7853
+ ...args.node === void 0 ? {} : { node: args.node },
7835
7854
  box: environmentAsSandboxInstance(environment, { requireTerminalEvent: args.options.requireTerminalEvent ?? true }),
7836
7855
  signal: linked
7837
7856
  });
@@ -7852,7 +7871,7 @@ async function* streamProviderExecutor(args) {
7852
7871
  failure = source.retained ? new RetainedExecutionPendingError(error) : error;
7853
7872
  failed = true;
7854
7873
  } finally {
7855
- if ((!source.retained || settled !== void 0 && !failed) && (args.options.destroyOnSettle ?? true)) try {
7874
+ if ((!source.retained || settled !== void 0 && !failed) && !(source.retained && args.retention?.preserveEnvironment) && (args.options.destroyOnSettle ?? true)) try {
7856
7875
  await environment.destroy?.();
7857
7876
  args.onDestroyed();
7858
7877
  } catch (error) {
@@ -7943,16 +7962,26 @@ async function providerExecutionSource(args, turn, signal) {
7943
7962
  admitted = true;
7944
7963
  args.onPending(true);
7945
7964
  };
7965
+ const priorSession = retention.priorSession;
7966
+ const environmentKey = priorSession?.idempotencyKey ?? `runtime:${args.executionId}`;
7967
+ const turnId = `${args.executionId}:turn:0`;
7946
7968
  const material = {
7947
7969
  environment: {
7948
7970
  ...args.options.defaults,
7949
7971
  profile: args.createProfile,
7950
- idempotencyKey: `runtime:${args.executionId}`,
7972
+ idempotencyKey: environmentKey,
7951
7973
  signal
7952
7974
  },
7953
7975
  turn: {
7954
7976
  ...turn,
7955
- turnId: `${args.executionId}:turn:0`
7977
+ turnId
7978
+ },
7979
+ ...priorSession === void 0 ? {} : {
7980
+ existingEnvironmentId: priorSession.environmentId,
7981
+ identity: {
7982
+ sessionId: priorSession.sessionId,
7983
+ executionId: mintRetainedIdentity(environmentKey, turnId).executionId
7984
+ }
7956
7985
  }
7957
7986
  };
7958
7987
  try {
@@ -7973,7 +8002,12 @@ async function providerExecutionSource(args, turn, signal) {
7973
8002
  if (!reconnected) throw new Error("retained provider environment is unavailable");
7974
8003
  handle = reconnected;
7975
8004
  } else if (args.recovering && environmentAdmission?.phase === "environment") {
7976
- let recovered = await recoverRetainedRun({
8005
+ let recovered = material.existingEnvironmentId !== void 0 && intent?.phase === "intent" ? await recoverRetainedRun({
8006
+ provider: args.provider,
8007
+ admission: intent,
8008
+ replay: material,
8009
+ onAdmission
8010
+ }) : await recoverRetainedRun({
7977
8011
  provider: args.provider,
7978
8012
  environmentId: environmentAdmission.environmentId,
7979
8013
  sessionId: environmentAdmission.sessionId,
@@ -8016,34 +8050,53 @@ async function providerExecutionSource(args, turn, signal) {
8016
8050
  if (!environment) throw new Error("retained provider environment is unavailable");
8017
8051
  const session = exactSession(environment, handle.controlRef).session;
8018
8052
  async function* events() {
8019
- let iterator;
8020
8053
  let observationFailure;
8021
- try {
8022
- iterator = session.events({
8023
- executionId: handle.controlRef.executionId,
8024
- signal
8025
- })[Symbol.asyncIterator]();
8026
- } catch (error) {
8027
- if (signal.aborted) throw error;
8028
- observationFailure = { error };
8029
- }
8030
- try {
8031
- while (iterator !== void 0) {
8032
- let next;
8033
- try {
8034
- next = await awaitAbortable$1(Promise.resolve().then(() => iterator.next()), signal);
8035
- } catch (error) {
8036
- if (signal.aborted) throw error;
8037
- observationFailure = { error };
8038
- break;
8054
+ let lastReplayPosition;
8055
+ let sawTerminal = false;
8056
+ const drain = async function* (open) {
8057
+ let iterator;
8058
+ let failed = false;
8059
+ try {
8060
+ iterator = open()[Symbol.asyncIterator]();
8061
+ } catch (error) {
8062
+ if (signal.aborted) throw error;
8063
+ observationFailure = { error };
8064
+ return false;
8065
+ }
8066
+ try {
8067
+ while (true) {
8068
+ let next;
8069
+ try {
8070
+ next = await awaitAbortable$1(Promise.resolve().then(() => iterator.next()), signal);
8071
+ } catch (error) {
8072
+ if (signal.aborted) throw error;
8073
+ observationFailure = { error };
8074
+ failed = true;
8075
+ break;
8076
+ }
8077
+ if (next.done) break;
8078
+ assertEventBinding(next.value, handle.controlRef);
8079
+ if (next.value.id !== void 0) lastReplayPosition = next.value.id;
8080
+ if (isTerminalEnvironmentEvent(next.value)) sawTerminal = true;
8081
+ yield next.value;
8039
8082
  }
8040
- if (next.done) break;
8041
- assertEventBinding(next.value, handle.controlRef);
8042
- yield next.value;
8083
+ } finally {
8084
+ if (signal.aborted || failed) Promise.resolve().then(() => iterator?.return?.()).catch(() => void 0);
8085
+ else await iterator?.return?.();
8043
8086
  }
8044
- } finally {
8045
- if (signal.aborted || observationFailure !== void 0) Promise.resolve().then(() => iterator?.return?.()).catch(() => void 0);
8046
- else await iterator?.return?.();
8087
+ return !failed;
8088
+ };
8089
+ if (!(yield* drain(() => session.events({
8090
+ executionId: handle.controlRef.executionId,
8091
+ signal
8092
+ }))) && !sawTerminal && lastReplayPosition !== void 0) {
8093
+ const firstFailure = observationFailure;
8094
+ observationFailure = void 0;
8095
+ if (!(yield* drain(() => session.events({
8096
+ executionId: handle.controlRef.executionId,
8097
+ since: lastReplayPosition,
8098
+ signal
8099
+ })))) observationFailure = firstFailure;
8047
8100
  }
8048
8101
  let result;
8049
8102
  try {
@@ -19874,8 +19927,13 @@ function registerScopeRetainedOwner(scope, args) {
19874
19927
  const taskEvent = [...events].reverse().find((event) => event.kind === "execution-input");
19875
19928
  const start = taskEvent === void 0 ? 0 : events.indexOf(taskEvent);
19876
19929
  const attempt = events.slice(start);
19930
+ const beforeInput = taskEvent === void 0 ? [] : events.slice(0, start);
19931
+ const priorInput = [...beforeInput].reverse().find((event) => event.kind === "execution-input");
19932
+ const priorAttempt = priorInput === void 0 ? [] : beforeInput.slice(beforeInput.indexOf(priorInput));
19877
19933
  const admissions = attempt.flatMap((event) => event.kind === "execution-admitted" ? [event.admission] : []);
19878
19934
  const acceptedRef = [...attempt].reverse().find((event) => event.kind === "execution-result");
19935
+ const priorResult = [...priorAttempt].reverse().find((event) => event.kind === "execution-result");
19936
+ const priorSession = priorResult?.kind === "execution-result" ? priorAttempt.slice(0, priorAttempt.indexOf(priorResult)).reverse().flatMap((event) => event.kind === "execution-admitted" && event.admission.phase === "environment" ? [event.admission] : [])[0] : void 0;
19879
19937
  let sequence = Math.max(0, ...events.map((event) => "seq" in event ? event.seq : 0));
19880
19938
  const state = {
19881
19939
  args,
@@ -19886,11 +19944,16 @@ function registerScopeRetainedOwner(scope, args) {
19886
19944
  inputSequence: taskEvent.seq
19887
19945
  } : {},
19888
19946
  ...acceptedRef?.kind === "execution-result" ? { acceptedRef } : {},
19947
+ ...priorSession ? { priorSession } : {},
19889
19948
  context: {
19890
19949
  get executionId() {
19891
19950
  if (state.inputSequence === void 0) throw new ValidationError$1("retained owner input was not committed");
19892
19951
  return `${args.nodeId}:input:${state.inputSequence}`;
19893
19952
  },
19953
+ get priorSession() {
19954
+ return state.priorSession;
19955
+ },
19956
+ preserveEnvironment: true,
19894
19957
  admissions,
19895
19958
  onAdmission: async (admission) => {
19896
19959
  scope.signal.throwIfAborted();
@@ -19938,6 +20001,56 @@ function registerScopeRetainedOwner(scope, args) {
19938
20001
  function scopeRetainedOwnerContext(scope) {
19939
20002
  return owners.get(scope)?.context;
19940
20003
  }
20004
+ /** Bind cleanup before replay can return an already accepted owner result. */
20005
+ function bindScopeRetainedOwnerProvider(scope, provider) {
20006
+ const state = owners.get(scope);
20007
+ if (state) state.provider = provider;
20008
+ }
20009
+ /** The existing scope settlement barrier releases the owner's environment after all its turns. */
20010
+ async function releaseScopeRetainedOwnerEnvironment(scope) {
20011
+ const state = owners.get(scope);
20012
+ if (!state?.provider) return [];
20013
+ const { provider, args } = state;
20014
+ const events = await args.journal.loadTree(args.rootId) ?? [];
20015
+ const released = new Set(events.flatMap((event) => event.kind === "environment-teardown" && event.id === args.nodeId && event.provider === provider.name && event.destroyed ? [event.environmentId] : []));
20016
+ const environments = new Set(events.flatMap((event) => event.id === args.nodeId && event.kind === "execution-admitted" && event.admission.phase === "environment" ? [event.admission.environmentId] : []));
20017
+ let unconfirmed = false;
20018
+ for (const environmentId of environments) {
20019
+ if (released.has(environmentId)) continue;
20020
+ let destroyed = false;
20021
+ let detail;
20022
+ try {
20023
+ await runAbortable(async () => {
20024
+ if (!provider.get) throw new Error("provider cannot reconstruct the retained environment");
20025
+ const environment = await provider.get(environmentId);
20026
+ if (environment === null) return;
20027
+ if (environment.id !== environmentId || environment.provider !== provider.name) throw new Error("provider returned another retained environment");
20028
+ if (!environment.destroy) throw new Error("provider cannot destroy the retained environment");
20029
+ await environment.destroy();
20030
+ }, AbortSignal.timeout(3e4), "retained owner cleanup timed out");
20031
+ destroyed = true;
20032
+ } catch {
20033
+ detail = "retained owner environment cleanup was not confirmed";
20034
+ unconfirmed = true;
20035
+ }
20036
+ await args.journal.appendEvent(args.rootId, {
20037
+ kind: "environment-teardown",
20038
+ id: args.nodeId,
20039
+ provider: provider.name,
20040
+ environmentId,
20041
+ destroyed,
20042
+ ...detail === void 0 ? {} : { detail },
20043
+ seq: state.nextSequence(),
20044
+ at: new Date(args.now()).toISOString()
20045
+ });
20046
+ }
20047
+ return unconfirmed ? [{
20048
+ id: args.nodeId,
20049
+ label: "scope owner",
20050
+ runtime: provider.name,
20051
+ status: "done"
20052
+ }] : [];
20053
+ }
19941
20054
  /** Resume the original backend prompt; rebuilt coordination observations cannot replace it. */
19942
20055
  async function prepareScopeRetainedOwnerTask(scope, task) {
19943
20056
  const state = owners.get(scope);
@@ -19955,6 +20068,8 @@ async function prepareScopeRetainedOwnerTask(scope, task) {
19955
20068
  if (accepted?.kind === "execution-result") state.acceptedRef = accepted;
19956
20069
  }
19957
20070
  if (state.prepared && state.acceptedRef && state.acceptedConsumed) {
20071
+ const currentEnvironment = [...state.admissions].reverse().find((admission) => admission.phase === "environment");
20072
+ if (currentEnvironment?.phase === "environment") state.priorSession = currentEnvironment;
19958
20073
  delete state.inputSequence;
19959
20074
  delete state.taskRef;
19960
20075
  delete state.acceptedRef;
@@ -20246,6 +20361,8 @@ async function startScopeRecoveries(scope) {
20246
20361
  async function releaseRetainedEnvironments(scope) {
20247
20362
  const release = retainedReleasers.get(scope);
20248
20363
  if (release) await release();
20364
+ const ownerUnconfirmed = await releaseScopeRetainedOwnerEnvironment(scope);
20365
+ return [...scope.workerCapacity.unconfirmed, ...ownerUnconfirmed];
20249
20366
  }
20250
20367
  /**
20251
20368
  * @internal Close this scope to NEW children. Idempotent, synchronous, and irreversible.
@@ -20549,6 +20666,7 @@ function createScope(args) {
20549
20666
  rootId: args.root,
20550
20667
  parentId: args.parentId,
20551
20668
  nodeId: id,
20669
+ depth: args.depth + 1,
20552
20670
  attemptId,
20553
20671
  ...identity ? { identity } : {}
20554
20672
  },
@@ -21221,6 +21339,7 @@ function createScope(args) {
21221
21339
  journal: args.journal,
21222
21340
  root: args.ownerMaterialization.journalRoot ?? args.root,
21223
21341
  nodeId: args.ownerMaterialization.nodeId ?? args.parentId,
21342
+ depth: args.depth,
21224
21343
  runtime: args.ownerMaterialization.runtime,
21225
21344
  attemptId: args.ownerMaterialization.attemptId,
21226
21345
  ...authoredProfile === void 0 ? {} : { authoredProfile },
@@ -21406,6 +21525,7 @@ function scopeOwnerExecutorNodeContext(scope) {
21406
21525
  rootId: state.root,
21407
21526
  parentId: state.nodeId,
21408
21527
  nodeId: state.nodeId,
21528
+ depth: state.depth,
21409
21529
  attemptId: state.attemptId
21410
21530
  });
21411
21531
  }
@@ -22534,8 +22654,7 @@ const driverExecutorFactory = (rawSpec, ctx) => {
22534
22654
  },
22535
22655
  async releaseRetained() {
22536
22656
  if (nestedScopeHeld === void 0) return [];
22537
- await releaseRetainedEnvironments(nestedScopeHeld);
22538
- unconfirmedDescendants = nestedScopeHeld.workerCapacity.unconfirmed.map((node) => node.id);
22657
+ unconfirmedDescendants = (await releaseRetainedEnvironments(nestedScopeHeld)).map((node) => node.id);
22539
22658
  return [];
22540
22659
  },
22541
22660
  resultArtifact() {
@@ -23075,29 +23194,49 @@ const collectDelivered = (ctx) => {
23075
23194
  * Run a finalizer over a settled-worker ledger under the delivered-only invariant: filter the
23076
23195
  * ledger to structurally delivered children, materialize their outputs, and hand the finalizer a
23077
23196
  * blob reader that throws on any ref outside that set. This is the one call site both driver arms
23078
- * (the in-process tool-loop and the MCP-mounted harness) finalize through.
23197
+ * (the in-process tool-loop and the MCP-mounted harness) finalize through. When a parent declares
23198
+ * a deliverable, its candidate must also pass that check: children may have narrower assignments.
23199
+ * The default selects the highest-scoring child that passes the parent's check; custom finalizers
23200
+ * assemble their candidate before the check. A rejection leaves the parent incomplete; a thrown
23201
+ * oracle surfaces a validation error. Neither changes child validity.
23079
23202
  */
23080
23203
  async function runFinalizer(finalizer, args) {
23081
23204
  const deliveredRows = args.settled.filter((w) => w.status === "done" && w.valid === true);
23082
23205
  const deliveredRefs = /* @__PURE__ */ new Set();
23083
23206
  for (const w of deliveredRows) if (w.outRef !== void 0) deliveredRefs.add(w.outRef);
23084
- return finalizer({
23085
- delivered: await Promise.all(deliveredRows.map(async (w) => ({
23086
- id: w.id,
23087
- ...w.score !== void 0 ? { score: w.score } : {},
23088
- ...w.outRef !== void 0 ? {
23089
- outRef: w.outRef,
23090
- out: await args.blobs.get(w.outRef)
23091
- } : {}
23092
- }))),
23207
+ const delivered = await Promise.all(deliveredRows.map(async (w) => ({
23208
+ id: w.id,
23209
+ ...w.score !== void 0 ? { score: w.score } : {},
23210
+ ...w.outRef !== void 0 ? {
23211
+ outRef: w.outRef,
23212
+ out: await args.blobs.get(w.outRef)
23213
+ } : {}
23214
+ })));
23215
+ const guardedBlobs = { get: (outRef) => {
23216
+ if (!deliveredRefs.has(outRef)) throw new ValidationError$1(`finalizer: outRef '${outRef}' is not a DELIVERED child's result — a finalizer may only operate on outputs that settled done and passed their completion oracle`);
23217
+ return args.blobs.get(outRef);
23218
+ } };
23219
+ const accepted = async (candidate) => {
23220
+ if (candidate === void 0) return false;
23221
+ if (args.deliverable === void 0) return true;
23222
+ try {
23223
+ return await args.deliverable.check(candidate) === true;
23224
+ } catch (error) {
23225
+ throw new ValidationError$1(`finalizer: parent completion check threw: ${error instanceof Error ? error.message : String(error)}`);
23226
+ }
23227
+ };
23228
+ if (finalizer === bestDelivered && args.deliverable !== void 0) {
23229
+ for (const output of [...delivered].sort((a, b) => (b.score ?? 0) - (a.score ?? 0))) if (await accepted(output.out)) return output.out;
23230
+ return;
23231
+ }
23232
+ const candidate = await finalizer({
23233
+ delivered,
23093
23234
  allSettled: args.settled,
23094
23235
  tree: args.tree,
23095
- blobs: { get: (outRef) => {
23096
- if (!deliveredRefs.has(outRef)) throw new ValidationError$1(`finalizer: outRef '${outRef}' is not a DELIVERED child's result — a finalizer may only operate on outputs that settled done and passed their completion oracle`);
23097
- return args.blobs.get(outRef);
23098
- } },
23236
+ blobs: guardedBlobs,
23099
23237
  budget: args.budget
23100
23238
  });
23239
+ return await accepted(candidate) ? candidate : void 0;
23101
23240
  }
23102
23241
  //#endregion
23103
23242
  //#region src/runtime/supervise/supervisor.ts
@@ -23455,10 +23594,7 @@ function createSupervisor() {
23455
23594
  const settleGraceMs = !controller.signal.aborted ? boundedSettleGrace(opts.childSettleGraceMs, rootDeadlineAtMs, now) : 0;
23456
23595
  try {
23457
23596
  teardownUnconfirmed = await drainLiveChildren(openScope, controller, settleGraceMs);
23458
- if (retainedAtSettlement === "release") {
23459
- await releaseRetainedEnvironments(openScope);
23460
- teardownUnconfirmed = openScope.workerCapacity.unconfirmed;
23461
- }
23597
+ if (retainedAtSettlement === "release") teardownUnconfirmed = await releaseRetainedEnvironments(openScope);
23462
23598
  for (const node of teardownUnconfirmed) await opts.journal.appendEvent(opts.runId, {
23463
23599
  kind: "teardown-unconfirmed",
23464
23600
  id: node.id,
@@ -23850,6 +23986,6 @@ function isNonEmptySpend(s) {
23850
23986
  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);
23851
23987
  }
23852
23988
  //#endregion
23853
- export { cliInPlaceExecutor as $, generateSpanId as $n, runtimeOwnedExecutorProviderEvidence as $r, createCodexRolloutStoreReader as $t, waitUntil as A, sleep as Ai, abortError as An, renderProfileMaterializationIssues as Ar, WORKER_TRACE_PROPAGATION as At, readWorkerInteractiveBinding as B, decodeHarnessUsage as Bi, resolveRedactor as Bn, attestRuntimeOwnedPendingExecutor as Br, AUTHORITY_MARKERS as Bt, scopeOwnerExecutorNodeContext as C, chargedTokens as Ci, sandboxClientAsProvider as Cn, defineProfileMaterializationContract as Cr, BudgetReconcileFault as Ct, pollFor as D, isAbortError$2 as Di, registerRetainedExecutorPreparation as Dn, promptModelProfileMaterialization as Dr, newUsageTotals as Dt, isWaitOutcome as E, hasCompleteCacheBreakdown as Ei, sandboxSessionTraceSource as En, promptControlProfileMaterialization as Er, meterUsageEvent as Et, scopeRetainedOwnerResult as F, withTimeout as Fi, startRetainedRun as Fn, worktreeCliProfileMaterialization as Fr, taskToPrompt as Ft, startRetainedInteractiveRun as G, teardownExecutor as Gi, INTELLIGENCE_WIRE_VERSION as Gn, knownExecutionBindingReceipt as Gr, isPeerMailEnvelope as Gt, workerInteractiveBindingsDir as H, awaitAbortable$1 as Hi, mergeTraceEnv as Hn, authoredProfileDigest as Hr, PEER_MAIL_WIRE_KEY as Ht, interactiveAdmissionSeamKey as I, zeroSpend as Ii, startRetainedRunInEnvironment as In, isNoEntError as Ir, DEFAULT_STALL_AFTER_MS as It, freeSlots as J, providerMessageText as Ji, buildRuntimeEventOtelSpans as Jn, providerAttemptEvidence as Jr, isLiveNodeStatus as Jt, destroyInteractiveEnvironment as K, promptFromAgentTurnInput as Ki, buildLoopOtelSpans as Kn, knownMaterializationReceipt as Kr, peerMailTools as Kt, readWorkerInteractiveAdmissions as L, addResourceSpend as Li, retainedCreateMaterial as Ln, parseCommittedJsonLines as Lr, createActivityLog as Lt, prepareScopeRetainedOwnerTask as M, throwAbort as Mi, runAbortable as Mn, sandboxActProfileMaterialization as Mr, workerTraceEnv as Mt, scopeRetainedOwnerContext as N, throwIfAborted as Ni, reconnectRetainedRun as Nn, unsupportedProfileDimensions as Nr, workerTraceHeaders as Nt, timerAt as O, promptCacheTokenClasses as Oi, retainedExecutorSeamKey as On, promptOnlyProfileMaterialization as Or, spendFromUsageEvents as Ot, scopeRetainedOwnerPriorSpend as P, unmeteredSpend as Pi, recoverRetainedRun as Pn, validateProfileMaterialization as Pr, workerTraceSeamKey as Pt, captureReusableExecutorConfig as Q, flatOtelSpan as Qn, runtimeOwnedExecutorMaterialization as Qr, addHarnessUsage as Qt, workerInteractiveAdmissionFile as R, resourceTelemetry as Ri, defaultRedactor as Rn, prepareJsonlAppend as Rr, readWorkerProgress as Rt, restoreScopeOwnerAcceptedExecution as S, addSpend as Si, resolveAgentEnvironmentProvider as Sn, controlProfileMaterialization as Sr, contentAddress as St, createWaitProbes as T, deleteBoxSafe as Ti, decodeToolPart as Tn, profileMaterializationAxes$1 as Tr, createBudgetPool as Tt, reconnectRetainedInteractiveRun as U, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as Ui, readTraceContextFromEnv as Un, finalizeRuntimeOwnedPendingExecutor as Ur, claimsAuthority as Ut, workerInteractiveBindingFile as V, abortError$2 as Vi, createPropagatingTraceEmitter as Vn, attestRuntimeOwnedScopeOwner as Vr, DEFAULT_PEER_MAIL_LIMITS as Vt, recoverRetainedInteractiveRun as W, armDeadlineTimer as Wi, traceContextToEnv as Wn, inheritRuntimeOwnedExecutorAttestation as Wr, createPeerMailbox as Wt, rollingDispatch as X, createOtelExporter as Xn, runtimeOwnedDriveHarnessProviderEvidence as Xr, bridgeAdmissionRefusal as Xt, queueOf as Y, createOpenInferenceFileExporter as Yn, recordRuntimeOwnedDriveHarnessProviderEvidence as Yr, isTerminalNodeStatus as Yt, bindReusableExecutorExecutionId as Z, exportEvalRuns as Zn, runtimeOwnedExecutorExecutionBinding as Zr, bridgeModelRouteRefusal as Zt, createScope as _, mapSandboxToolEvent as _i, observedModelMatchesDeclared as _n, localHarnessExecutable as _r, WORKER_TOOL_TRACE_SCHEMA_VERSION as _t, pickBestDelivered as a, executableAgentSpecSnapshot as ai, createSandboxForSpec as an, createRuntimeStreamEventCollector as ar, DEFAULT_SANDBOX_STEERING_MAX_TURNS as at, meterRuntimeOwnedProviderAttempt as b, sandboxProgressEvents as bi, providerAsExecutor as bn, AGENT_PROFILE_MATERIALIZATION_AXES as br, parseWorkerToolTraceArtifact as bt, DriverAttemptsExhaustedError as c, projectSandboxOutcome as ci, runAgentRounds as cn, sanitizeRuntimeStreamEvent as cr, FileResultBlobStore as ct, runDriverWithRetry as d, canonicalStreamEventFromSandboxEvent as di, acquireSandbox as dn, captureWorktreeDiff as dr, InMemorySpawnJournal as dt, runtimeOwnedPendingExecutorMaterialization as ei, harnessUsageIsEmpty as en, loopEventToOtelSpan as er, cliWorktreeExecutor as et, driverChild as f, createSandboxToolPartState as fi, assertBoxlessPromptOptions as fn, createWorktree as fr, insideCursorNamespace as ft, beginScopeOwnerAttempt as g, mapSandboxEvent as gi, canonicalObservedModelParts as gn, harnessSupportsReasoningEffort as gr, replaySpawnTree as gt, withDriverExecutor as h, isSandboxTerminalEvent as hi, runBrainLoop as hn, LOCAL_HARNESSES as hr, pendingWaits as ht, collectDelivered as i, executableAgentProfileSnapshot as ii, TERMINAL_DECISIONS as in, createRuntimeEventCollector as ir, createWorktreeCliExecutor as it, consumeScopeRetainedOwnerResult as j, stringifySafe as ji, linkAbort as jn, renderUnsupported as jr, readWorkerTraceContext as jt, validateWaitSpec as k, randomSuffix as ki, RunCancellationReason as kn, promptResourceProfileMaterialization as kr, spendFromUsageTotals as kt, classifyDriverFailure as l, readSandboxOutcome as li, createSandboxLineage as ln, runSettledCommand as lr, FileSpawnJournal as lt, isDriverSpec as m, extractLlmCallEvent as mi, routerBrain as mn, DEFAULT_LOCAL_HARNESS as mr, materializeTreeView as mt, createSupervisor as n, unknownExecutionBindingReceipt as ni, bridgeRuntimeAttachmentsKey as nn, padTraceId as nr, createExecutorRegistry as nt, runFinalizer as o, detachedFrozen as oi, defaultSelectWinner as on, sanitizeAgentRuntimeEvent as or, createSteerableSandboxSession as ot, driverExecutorFactory as p, createSandboxUsageLedger as pi, readPromptOptions as pn, removeWorktree as pr, loadSpawnForest as pt, effectiveConcurrency as q, promptOptionsFromAgentTurnInput as qi, buildLoopSpanNodes as qn, newExecutionAttemptId as qr, peerMailVerbNames as qt, bestDelivered as r, unknownMaterializationReceipt as ri, bridgeStopSignalKey as rn, toOtelAttributes as rr, snapshotExecutorConfig as rt, runTree as s, detachedSnapshot as si, isTerminalDecision as sn, sanitizeKnowledgeReadinessReport as sr, createInPlaceCliExecutor as st, createRootHandle as t, runtimeOwnedScopeOwnerRuntime as ti, readCodexRolloutSession as tn, padSpanId as tr, createExecutor as tt, defaultUnmetContractSteer as u, assertSandboxServedModel as ui, probeSandboxCapabilities as un, runWorktreeHarness as ur, InMemoryResultBlobStore as ut, deriveNodeExecutionIdentity as v, notifySandboxEventObserver as vi, DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS as vn, parseCodexTokenUsage as vr, captureWorkerTraceEvidence as vt, settledToIteration as w, cloneSpend as wi, createPushTraceSource as wn, fullProfileMaterialization as wr, assertValidBudget as wt, recordScopeOwnerMaterialization as x, sumSandboxUsage as xi, providerAsSandboxClient as xn, assertProfileMaterialization as xr, workerTraceAnalysisStore as xt, meterRuntimeOwnedAccounting as y, sandboxEventServedBackend as yi, createAgentEnvironmentProviderRegistry as yn, CodexExecutionDiagnosticError as yr, isTraceAnalysisStore as yt, attachWorker as z, withBudgetResources as zi, defaultRedactorIdentityMaterial as zn, writeAllBytes as zr, createInbox as zt };
23989
+ export { captureReusableExecutorConfig as $, flatOtelSpan as $n, runtimeOwnedExecutorMaterialization as $r, addHarnessUsage as $t, waitUntil as A, randomSuffix as Ai, RunCancellationReason as An, promptResourceProfileMaterialization as Ar, spendFromUsageTotals as At, attachWorker as B, withBudgetResources as Bi, defaultRedactorIdentityMaterial as Bn, writeAllBytes as Br, createInbox as Bt, scopeOwnerExecutorNodeContext as C, addSpend as Ci, resolveAgentEnvironmentProvider as Cn, controlProfileMaterialization as Cr, contentAddress as Ct, pollFor as D, hasCompleteCacheBreakdown as Di, sandboxSessionTraceSource as Dn, promptControlProfileMaterialization as Dr, meterUsageEvent as Dt, isWaitOutcome as E, deleteBoxSafe as Ei, decodeToolPart as En, profileMaterializationAxes$1 as Er, createBudgetPool as Et, scopeRetainedOwnerPriorSpend as F, unmeteredSpend as Fi, recoverRetainedRun as Fn, validateProfileMaterialization as Fr, workerTraceSeamKey as Ft, recoverRetainedInteractiveRun as G, armDeadlineTimer as Gi, traceContextToEnv as Gn, inheritRuntimeOwnedExecutorAttestation as Gr, createPeerMailbox as Gt, workerInteractiveBindingFile as H, abortError$2 as Hi, createPropagatingTraceEmitter as Hn, attestRuntimeOwnedScopeOwner as Hr, DEFAULT_PEER_MAIL_LIMITS as Ht, scopeRetainedOwnerResult as I, withTimeout as Ii, startRetainedRun as In, worktreeCliProfileMaterialization as Ir, taskToPrompt as It, effectiveConcurrency as J, promptOptionsFromAgentTurnInput as Ji, buildLoopSpanNodes as Jn, newExecutionAttemptId as Jr, peerMailVerbNames as Jt, startRetainedInteractiveRun as K, teardownExecutor as Ki, INTELLIGENCE_WIRE_VERSION as Kn, knownExecutionBindingReceipt as Kr, isPeerMailEnvelope as Kt, interactiveAdmissionSeamKey as L, zeroSpend as Li, startRetainedRunInEnvironment as Ln, isNoEntError as Lr, DEFAULT_STALL_AFTER_MS as Lt, consumeScopeRetainedOwnerResult as M, stringifySafe as Mi, linkAbort as Mn, renderUnsupported as Mr, readWorkerTraceContext as Mt, prepareScopeRetainedOwnerTask as N, throwAbort as Ni, runAbortable as Nn, sandboxActProfileMaterialization as Nr, workerTraceEnv as Nt, timerAt as O, isAbortError$2 as Oi, registerRetainedExecutorPreparation as On, promptModelProfileMaterialization as Or, newUsageTotals as Ot, scopeRetainedOwnerContext as P, throwIfAborted as Pi, reconnectRetainedRun as Pn, unsupportedProfileDimensions as Pr, workerTraceHeaders as Pt, bindReusableExecutorExecutionId as Q, exportEvalRuns as Qn, runtimeOwnedExecutorExecutionBinding as Qr, bridgeModelRouteRefusal as Qt, readWorkerInteractiveAdmissions as R, addResourceSpend as Ri, retainedCreateMaterial as Rn, parseCommittedJsonLines as Rr, createActivityLog as Rt, restoreScopeOwnerAcceptedExecution as S, sumSandboxUsage as Si, providerAsSandboxClient as Sn, assertProfileMaterialization as Sr, workerTraceAnalysisStore as St, createWaitProbes as T, cloneSpend as Ti, createPushTraceSource as Tn, fullProfileMaterialization as Tr, assertValidBudget as Tt, workerInteractiveBindingsDir as U, awaitAbortable$1 as Ui, mergeTraceEnv as Un, authoredProfileDigest as Ur, PEER_MAIL_WIRE_KEY as Ut, readWorkerInteractiveBinding as V, decodeHarnessUsage as Vi, resolveRedactor as Vn, attestRuntimeOwnedPendingExecutor as Vr, AUTHORITY_MARKERS as Vt, reconnectRetainedInteractiveRun as W, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as Wi, readTraceContextFromEnv as Wn, finalizeRuntimeOwnedPendingExecutor as Wr, claimsAuthority as Wt, queueOf as X, createOpenInferenceFileExporter as Xn, recordRuntimeOwnedDriveHarnessProviderEvidence as Xr, isTerminalNodeStatus as Xt, freeSlots as Y, providerMessageText as Yi, buildRuntimeEventOtelSpans as Yn, providerAttemptEvidence as Yr, isLiveNodeStatus as Yt, rollingDispatch as Z, createOtelExporter as Zn, runtimeOwnedDriveHarnessProviderEvidence as Zr, bridgeAdmissionRefusal as Zt, createScope as _, mapSandboxEvent as _i, canonicalObservedModelParts as _n, harnessSupportsReasoningEffort as _r, replaySpawnTree as _t, pickBestDelivered as a, executableAgentProfileSnapshot as ai, TERMINAL_DECISIONS as an, createRuntimeEventCollector as ar, createWorktreeCliExecutor as at, meterRuntimeOwnedProviderAttempt as b, sandboxEventServedBackend as bi, createAgentEnvironmentProviderRegistry as bn, CodexExecutionDiagnosticError as br, isTraceAnalysisStore as bt, DriverAttemptsExhaustedError as c, detachedSnapshot as ci, isTerminalDecision as cn, sanitizeKnowledgeReadinessReport as cr, createInPlaceCliExecutor as ct, runDriverWithRetry as d, assertSandboxServedModel as di, probeSandboxCapabilities as dn, runWorktreeHarness as dr, InMemoryResultBlobStore as dt, runtimeOwnedExecutorProviderEvidence as ei, createCodexRolloutStoreReader as en, generateSpanId as er, cliInPlaceExecutor as et, driverChild as f, canonicalStreamEventFromSandboxEvent as fi, acquireSandbox as fn, captureWorktreeDiff as fr, InMemorySpawnJournal as ft, beginScopeOwnerAttempt as g, isSandboxTerminalEvent as gi, runBrainLoop as gn, LOCAL_HARNESSES as gr, pendingWaits as gt, withDriverExecutor as h, extractLlmCallEvent as hi, routerBrain as hn, DEFAULT_LOCAL_HARNESS as hr, materializeTreeView as ht, collectDelivered as i, unknownMaterializationReceipt as ii, bridgeStopSignalKey as in, toOtelAttributes as ir, snapshotExecutorConfig as it, bindScopeRetainedOwnerProvider as j, sleep as ji, abortError as jn, renderProfileMaterializationIssues as jr, WORKER_TRACE_PROPAGATION as jt, validateWaitSpec as k, promptCacheTokenClasses as ki, retainedExecutorSeamKey as kn, promptOnlyProfileMaterialization as kr, spendFromUsageEvents as kt, classifyDriverFailure as l, projectSandboxOutcome as li, runAgentRounds as ln, sanitizeRuntimeStreamEvent as lr, FileResultBlobStore as lt, isDriverSpec as m, createSandboxUsageLedger as mi, readPromptOptions as mn, removeWorktree as mr, loadSpawnForest as mt, createSupervisor as n, runtimeOwnedScopeOwnerRuntime as ni, readCodexRolloutSession as nn, padSpanId as nr, createExecutor as nt, runFinalizer as o, executableAgentSpecSnapshot as oi, createSandboxForSpec as on, createRuntimeStreamEventCollector as or, DEFAULT_SANDBOX_STEERING_MAX_TURNS as ot, driverExecutorFactory as p, createSandboxToolPartState as pi, assertBoxlessPromptOptions as pn, createWorktree as pr, insideCursorNamespace as pt, destroyInteractiveEnvironment as q, promptFromAgentTurnInput as qi, buildLoopOtelSpans as qn, knownMaterializationReceipt as qr, peerMailTools as qt, bestDelivered as r, unknownExecutionBindingReceipt as ri, bridgeRuntimeAttachmentsKey as rn, padTraceId as rr, createExecutorRegistry as rt, runTree as s, detachedFrozen as si, defaultSelectWinner as sn, sanitizeAgentRuntimeEvent as sr, createSteerableSandboxSession as st, createRootHandle as t, runtimeOwnedPendingExecutorMaterialization as ti, harnessUsageIsEmpty as tn, loopEventToOtelSpan as tr, cliWorktreeExecutor as tt, defaultUnmetContractSteer as u, readSandboxOutcome as ui, createSandboxLineage as un, runSettledCommand as ur, FileSpawnJournal as ut, deriveNodeExecutionIdentity as v, mapSandboxToolEvent as vi, observedModelMatchesDeclared as vn, localHarnessExecutable as vr, WORKER_TOOL_TRACE_SCHEMA_VERSION as vt, settledToIteration as w, chargedTokens as wi, sandboxClientAsProvider as wn, defineProfileMaterializationContract as wr, BudgetReconcileFault as wt, recordScopeOwnerMaterialization as x, sandboxProgressEvents as xi, providerAsExecutor as xn, AGENT_PROFILE_MATERIALIZATION_AXES as xr, parseWorkerToolTraceArtifact as xt, meterRuntimeOwnedAccounting as y, notifySandboxEventObserver as yi, DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS as yn, parseCodexTokenUsage as yr, captureWorkerTraceEvidence as yt, workerInteractiveAdmissionFile as z, resourceTelemetry as zi, defaultRedactor as zn, prepareJsonlAppend as zr, readWorkerProgress as zt };
23854
23990
 
23855
- //# sourceMappingURL=supervisor-DAHG98Rs.js.map
23991
+ //# sourceMappingURL=supervisor-DFsXULnE.js.map