@tangle-network/agent-runtime 10.0.0 → 10.0.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 (73) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{activation-CEGkyzEG.js → activation-C_BenzIu.js} +2 -2
  3. package/dist/{activation-CEGkyzEG.js.map → activation-C_BenzIu.js.map} +1 -1
  4. package/dist/{activation-CDlOqX5a.d.ts → activation-s6dGGify.d.ts} +2 -2
  5. package/dist/agent.d.ts +1 -1
  6. package/dist/agent.js +3 -3
  7. package/dist/{delegate-V2Nz8GgO.js → delegate-BOren4c7.js} +2 -2
  8. package/dist/{delegate-V2Nz8GgO.js.map → delegate-BOren4c7.js.map} +1 -1
  9. package/dist/{driver-control-acknowledgers-CJDYLJmW.js → driver-control-acknowledgers-ByKwAgCI.js} +25 -5
  10. package/dist/driver-control-acknowledgers-ByKwAgCI.js.map +1 -0
  11. package/dist/durable.d.ts +1 -1
  12. package/dist/durable.js +9 -9
  13. package/dist/{failure-cause-BI7cfDWx.js → failure-cause-DoCCGLDH.js} +30 -18
  14. package/dist/{failure-cause-BI7cfDWx.js.map → failure-cause-DoCCGLDH.js.map} +1 -1
  15. package/dist/{graph-wJOMQ1kC.js → graph-BXONYT1o.js} +6 -6
  16. package/dist/{graph-wJOMQ1kC.js.map → graph-BXONYT1o.js.map} +1 -1
  17. package/dist/{improve-DOjywiPq.js → improve-CS2GIF5O.js} +5 -5
  18. package/dist/{improve-DOjywiPq.js.map → improve-CS2GIF5O.js.map} +1 -1
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +10 -10
  21. package/dist/intelligence.d.ts +2 -2
  22. package/dist/intelligence.js +4 -4
  23. package/dist/kernel.d.ts +2 -2
  24. package/dist/kernel.js +13 -13
  25. package/dist/{loop-runner-DwxZbYW5.d.ts → loop-runner-C0B3PexH.d.ts} +2 -2
  26. package/dist/loop-runner-bin.d.ts +1 -1
  27. package/dist/loop-runner-bin.js +1 -1
  28. package/dist/{loop-runner-CPTOzSol.js → loop-runner-ftyZP4st.js} +2 -2
  29. package/dist/{loop-runner-CPTOzSol.js.map → loop-runner-ftyZP4st.js.map} +1 -1
  30. package/dist/mcp/bin.js +3 -3
  31. package/dist/mcp/index.d.ts +1 -1
  32. package/dist/mcp/index.js +6 -6
  33. package/dist/mcp/memory-bin.js +1 -1
  34. package/dist/profiles.d.ts +1 -1
  35. package/dist/{provision-supervisor-B1_Kow9m.js → provision-supervisor-CauovUHn.js} +5 -5
  36. package/dist/{provision-supervisor-B1_Kow9m.js.map → provision-supervisor-CauovUHn.js.map} +1 -1
  37. package/dist/{run-cancellation-D5m6JHPH.js → run-cancellation-NMNVuYiO.js} +2 -2
  38. package/dist/{run-cancellation-D5m6JHPH.js.map → run-cancellation-NMNVuYiO.js.map} +1 -1
  39. package/dist/{run-state-DKOXe08H.js → run-state-COyIVOVb.js} +5 -5
  40. package/dist/{run-state-DKOXe08H.js.map → run-state-COyIVOVb.js.map} +1 -1
  41. package/dist/{runtime-C5cWSMqU.js → runtime-DYaRDLKn.js} +13 -13
  42. package/dist/{runtime-C5cWSMqU.js.map → runtime-DYaRDLKn.js.map} +1 -1
  43. package/dist/{search-executor-CA6fTYWz.js → search-executor-Drd_N9YO.js} +4 -4
  44. package/dist/{search-executor-CA6fTYWz.js.map → search-executor-Drd_N9YO.js.map} +1 -1
  45. package/dist/{server-C8Z3vYdI.js → server-Dk9B1WFf.js} +4 -4
  46. package/dist/{server-C8Z3vYdI.js.map → server-Dk9B1WFf.js.map} +1 -1
  47. package/dist/{settle-record-BDxPAO4m.js → settle-record-YdkkHzqw.js} +2 -2
  48. package/dist/{settle-record-BDxPAO4m.js.map → settle-record-YdkkHzqw.js.map} +1 -1
  49. package/dist/{structural-rollout-B0HPcP9G.js → structural-rollout-DbZAkHTq.js} +4 -4
  50. package/dist/{structural-rollout-B0HPcP9G.js.map → structural-rollout-DbZAkHTq.js.map} +1 -1
  51. package/dist/{supervise-Dvj-8S6D.js → supervise-B5hb0my3.js} +46 -14
  52. package/dist/supervise-B5hb0my3.js.map +1 -0
  53. package/dist/{supervision-discovery-CbrwcgJy.js → supervision-discovery-ChkTxilL.js} +3 -3
  54. package/dist/{supervision-discovery-CbrwcgJy.js.map → supervision-discovery-ChkTxilL.js.map} +1 -1
  55. package/dist/{supervisor-DwdeUC2l.js → supervisor-DpwcTrTh.js} +229 -38
  56. package/dist/supervisor-DpwcTrTh.js.map +1 -0
  57. package/dist/{supervisor-accounting-C48Yo9QC.js → supervisor-accounting-QiXnF-EW.js} +42 -11
  58. package/dist/supervisor-accounting-QiXnF-EW.js.map +1 -0
  59. package/dist/testing.d.ts +1 -1
  60. package/dist/testing.js +11 -11
  61. package/dist/{tool-server-DsCeBr-C.js → tool-server-DQCdu3am.js} +2 -2
  62. package/dist/{tool-server-DsCeBr-C.js.map → tool-server-DQCdu3am.js.map} +1 -1
  63. package/dist/{top-web-CTOq4psb.js → top-web-E85Fk8pH.js} +6 -6
  64. package/dist/{top-web-CTOq4psb.js.map → top-web-E85Fk8pH.js.map} +1 -1
  65. package/dist/tui/bin.js +3 -3
  66. package/dist/tui/index.d.ts +1 -1
  67. package/dist/tui/index.js +2 -2
  68. package/dist/{types-lnF0wIJW.d.ts → types-dv295cpm.d.ts} +5728 -5697
  69. package/package.json +5 -5
  70. package/dist/driver-control-acknowledgers-CJDYLJmW.js.map +0 -1
  71. package/dist/supervise-Dvj-8S6D.js.map +0 -1
  72. package/dist/supervisor-DwdeUC2l.js.map +0 -1
  73. package/dist/supervisor-accounting-C48Yo9QC.js.map +0 -1
@@ -2,7 +2,7 @@ import { c as RetainedInteractiveAdmissionError, d as RetainedRunDispatchBinding
2
2
  import { a as readCommittedJsonLines, c as appendCommittedJsonLine, f as deadlineSignal, h as signalAbortError, l as sha256, m as runAbortable, r as prepareJsonlAppend, s as withJsonlFileLock, t as isNoEntError, u as RunCancellationReason } from "./jsonl-file-BhuxeejY.js";
3
3
  import { c as checkInIdleMs, d as teardownExecutor, n as CHILD_DEADLINE_REASON, o as armDeadlineTimer, s as boundedChildDeadlineAt, u as singleFlightTeardown } from "./deadline-CySmJ_0S.js";
4
4
  import { A as withBudgetResources, C as unreportedSpend, D as addResourceSpend, T as zeroSpend, a as cloneSpend, c as errorMessage, f as isAsyncIterable, i as chargedTokens, k as resourceTelemetry, n as addSpend, o as cloneTokenUsage, t as abortError, v as sleep } from "./util-qsH5cC9S.js";
5
- import { Dt as recordValue, F as executorFailure, G as budgetLeaseUpdates, I as executorFailureInfra, J as completedLeafBacking, K as budgetLeases, L as executorFailureReason, M as traceRootWriter, N as contentAddress, Q as newUsageTotals, W as BudgetReconcileFault, X as refreshBudgetLease, Y as createBudgetPool, Z as meterUsageEvent, dt as extractTransportEventIdentity, et as spendFromUsageTotals, f as executorEvidenceWriter, ft as parseCanonicalTransportEvent, g as prepareRetainedExecutor, h as leafContinuationExecutionId, n as runtimeFailureCause, nt as assertValidSpend, o as settlementFailureCause, q as budgetRecoverySeeds, s as BUDGET_CONTINUATION_TASK, t as reportedFailureCause, tt as assertValidBudget, u as RetainedExecutionPendingError, y as retainedExecutorSeamKey } from "./failure-cause-BI7cfDWx.js";
5
+ import { $ as newUsageTotals, F as executorFailureInfra, G as BudgetReconcileFault, I as executorFailureReason, J as budgetRecoverySeeds, K as budgetLeaseUpdates, M as contentAddress, Ot as recordValue, P as executorFailure, Q as meterUsageEvent, X as createBudgetPool, Y as completedLeafBacking, Z as refreshBudgetLease, a as settlementFailureCause, d as executorEvidenceWriter, ft as extractTransportEventIdentity, h as prepareRetainedExecutor, j as traceRootWriter, l as RetainedExecutionPendingError, m as leafContinuationExecutionId, n as runtimeFailureCause, nt as assertValidBudget, o as BUDGET_CONTINUATION_TASK, pt as parseCanonicalTransportEvent, q as budgetLeases, rt as assertValidSpend, t as reportedFailureCause, tt as spendFromUsageTotals, v as retainedExecutorSeamKey } from "./failure-cause-DoCCGLDH.js";
6
6
  import { a as errMessage, f as resolveRedactor, i as causeChain, l as errorText, n as detachedSnapshot, r as shareParsedStrings, u as defaultRedactor } from "./snapshot-BKI_w3JD.js";
7
7
  import { p as canonicalObservedModelParts, t as assertExecutableAgentProfile } from "./model-policy-CqDuBTq-.js";
8
8
  import { b as verifiedArtifactChunks, g as workspaceLimits, h as safeArchivePath, i as readAgentCandidateWorkspaceArtifactFiles } from "./workspace-streams-C7PGLAUd.js";
@@ -11,7 +11,7 @@ import { b as sha256Bytes$1, g as deepFreezeCandidate } from "./output-artifacts
11
11
  import { a as withPursuitContext, i as notifyRuntimeHookEvent } from "./runtime-hooks-CsW2pfFk.js";
12
12
  import * as traceContract from "@tangle-network/agent-trace-contract";
13
13
  import { ATTR, OPERATION_NAME_ATTR, toW3CSpanId, toW3CTraceId } from "@tangle-network/agent-trace-contract";
14
- import { AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentNativeContextContinuationResultSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnInputSchema, AgentTurnResultSchema, ContextTransferReceiptSchema, ContextTransferRequestSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, RuntimeEventEnvelopeSchema, TerminalReplayWindowSchema, TerminalSessionRefSchema, agentCandidateArtifactRefSchema, agentCandidateWorkspaceManifestMaterialSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, agentWorkspaceSnapshotRefDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, contextTransferReceiptMatches, exactAgentInteractiveSessionStart, nativeContextContinuationTurnDigest, sha256DigestSchema, workspaceCheckpointRequestDigest, workspaceCheckpointResultMatchesRequest, workspaceCleanupAcknowledgementMatches, workspaceCleanupRequestDigest } from "@tangle-network/agent-interface";
14
+ import { AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentFileOutputPolicySchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentNativeContextContinuationResultSchema, AgentRetainedFilePublicationSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnInputSchema, AgentTurnResultSchema, ContextTransferReceiptSchema, ContextTransferRequestSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, RuntimeEventEnvelopeSchema, TerminalReplayWindowSchema, TerminalSessionRefSchema, agentCandidateArtifactRefSchema, agentCandidateWorkspaceManifestMaterialSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, agentWorkspaceSnapshotRefDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, contextTransferReceiptMatches, exactAgentInteractiveSessionStart, nativeContextContinuationTurnDigest, sha256DigestSchema, workspaceCheckpointRequestDigest, workspaceCheckpointResultMatchesRequest, workspaceCleanupAcknowledgementMatches, workspaceCleanupRequestDigest } from "@tangle-network/agent-interface";
15
15
  import { isToolSpan, toolSpansToTraceAnalysisStore } from "@tangle-network/agent-eval";
16
16
  import { isRecord } from "@tangle-network/agent-core";
17
17
  import { z } from "zod";
@@ -4045,6 +4045,14 @@ function createRetainedRunHandle(environment, session, initialControlRef, capabi
4045
4045
  get capabilities() {
4046
4046
  return structuredClone(measuredCapabilities);
4047
4047
  },
4048
+ ...environment.retainFileOutput && measuredCapabilities.workspace?.retainFileOutput === true ? { retainFileOutput: async (...args) => {
4049
+ control.sync();
4050
+ if (!sameControlCoordinates(control.current, args[0].controlRef)) return {
4051
+ status: "unavailable",
4052
+ reason: "original retained execution is no longer current"
4053
+ };
4054
+ return environment.retainFileOutput(...args);
4055
+ } } : {},
4048
4056
  status: (options) => retainedStatus(control, clock, options),
4049
4057
  events: (options) => {
4050
4058
  control.sync();
@@ -4253,6 +4261,10 @@ async function startRetainedRun(options) {
4253
4261
  if (options.intent === void 0) await admitDurably(onAdmission, intent);
4254
4262
  else assertExactRetainedRunIntent(options.intent, intent, () => retainedRunIntent(options, identity, contextTransfer, { providerOptions: options.turn.providerOptions }));
4255
4263
  const providerCapabilities = await assertRetainedCapabilities(options.provider);
4264
+ if (options.outputFile !== void 0) {
4265
+ AgentFileOutputPolicySchema.parse(options.outputFile);
4266
+ if (providerCapabilities.workspace.retainFileOutput !== true || !options.environment.retain?.paths.includes(options.outputFile.path)) throw new Error("retained file output requires declared provider support and retention of the output path");
4267
+ }
4256
4268
  if (transferReceipt !== void 0) assertRetainedContextTransferCapability(providerCapabilities);
4257
4269
  assertRequestedInteractionCapabilities(options.provider.name, options.turn.interactions, providerCapabilities);
4258
4270
  options.environment.signal?.throwIfAborted();
@@ -4280,6 +4292,7 @@ async function startRetainedRun(options) {
4280
4292
  try {
4281
4293
  capabilities = retainedCapabilitiesForEnvironment(options.provider.name, providerCapabilities, environment);
4282
4294
  if (transferReceipt !== void 0) assertRetainedContextTransferCapability(capabilities);
4295
+ if (options.outputFile !== void 0 && (capabilities.workspace.retainFileOutput !== true || !environment.retainFileOutput)) throw new Error("this environment cannot publish the declared retained file output");
4283
4296
  assertRequestedInteractionCapabilities(options.provider.name, options.turn.interactions, capabilities);
4284
4297
  if (!environment.dispatch || !environment.session) {
4285
4298
  teardownFailure = "retained run could not start and its unused environment could not be destroyed";
@@ -4591,11 +4604,13 @@ function retainedRunIntent(options, identity, contextTransfer, turnFields) {
4591
4604
  turnId: options.turn.turnId,
4592
4605
  sessionId: identity.sessionId,
4593
4606
  executionId: identity.executionId,
4594
- requestedProfileDigest
4607
+ requestedProfileDigest,
4608
+ ...options.outputFile === void 0 ? {} : { outputFilePolicyDigest: canonicalCandidateDigest(options.outputFile) }
4595
4609
  };
4596
4610
  const requestDigest = canonicalCandidateDigest({
4597
4611
  kind: turnFields === void 0 ? "retained-run-intent.v2" : "retained-run-intent.v1",
4598
4612
  ...material,
4613
+ ...options.outputFile === void 0 ? {} : { outputFile: options.outputFile },
4599
4614
  ...options.existingEnvironmentId === void 0 ? {} : { existingEnvironmentId: options.existingEnvironmentId },
4600
4615
  ...receipt === void 0 ? {} : { contextTransferReceiptDigest: canonicalCandidateDigest({
4601
4616
  ...receipt,
@@ -4632,6 +4647,7 @@ function parseRetainedRunIntent(value, expected) {
4632
4647
  for (const [key, value] of Object.entries(record)) if (key !== "phase" && (typeof value !== "string" || value.length === 0)) throw new Error(`retained run intent field "${key}" is invalid`);
4633
4648
  assertDigest$2(record.requestedProfileDigest, "retained run intent profile digest");
4634
4649
  assertDigest$2(record.requestDigest, "retained run intent request digest");
4650
+ if (record.outputFilePolicyDigest !== void 0) assertDigest$2(record.outputFilePolicyDigest, "retained run intent file policy digest");
4635
4651
  return stable;
4636
4652
  }
4637
4653
  function assertDigest$2(value, label) {
@@ -5901,8 +5917,10 @@ function ownerWorkspaceAttempts(events, nodeId) {
5901
5917
  } else if (event.kind === "execution-admitted" && event.admission.phase === "dispatched") {
5902
5918
  current?.admissions.push(event.admission);
5903
5919
  current?.controlByEnvironment.set(event.admission.controlRef.environmentId, event.admission.controlRef);
5904
- } else if (event.kind === "execution-admitted") current?.admissions.push(event.admission);
5905
- else if (event.kind === "execution-bound") {
5920
+ } else if (event.kind === "execution-admitted") {
5921
+ current?.admissions.push(event.admission);
5922
+ if (current && event.admission.phase === "intent" && event.admission.outputFilePolicyDigest) current.outputFilePolicyDigest = current.outputFilePolicyDigest === void 0 || current.outputFilePolicyDigest === event.admission.outputFilePolicyDigest ? event.admission.outputFilePolicyDigest : "conflicting-file-policies";
5923
+ } else if (event.kind === "execution-bound") {
5906
5924
  if (current !== void 0 && current.result === void 0) current.binding = event.binding;
5907
5925
  } else if (event.kind === "execution-result") {
5908
5926
  current ??= fresh();
@@ -5919,7 +5937,7 @@ async function ownerWorkspaceRetentionFailures(events, owner) {
5919
5937
  const failures = /* @__PURE__ */ new Map();
5920
5938
  for (const index of attempts.keys()) {
5921
5939
  const attempt = withLaterEvidence(attempts, index);
5922
- if (attempt.workspaceRetention !== true) continue;
5940
+ if (attempt.workspaceRetention !== true && attempt.outputFilePolicyDigest === void 0) continue;
5923
5941
  if (attempt.environmentIds.size === 0) continue;
5924
5942
  if (attempt.environmentIds.size > 1) {
5925
5943
  for (const environmentId of attempt.environmentIds) failures.set(environmentId, UNVERIFIED_SOURCE);
@@ -5947,6 +5965,13 @@ function withLaterEvidence(attempts, index) {
5947
5965
  /** Undefined when a receipt authorizes destroying the source. Otherwise why it stays. */
5948
5966
  async function ownerAttemptHasCapture(attempt, environmentId, blobs, owner, allowPartialProcessCapture = false) {
5949
5967
  const controlRef = attempt.controlByEnvironment.get(environmentId);
5968
+ if (attempt.outputFilePolicyDigest !== void 0) {
5969
+ const output = attempt.result === void 0 ? void 0 : recordValue(await storedOutput(blobs, attempt.result.outRef));
5970
+ const publication = AgentRetainedFilePublicationSchema.safeParse(output?.publication);
5971
+ const node = owner === void 0 ? void 0 : ownerCaptureIdentity(attempt, owner).node;
5972
+ if (!output || output.kind !== "retained-file-output" || output.version !== 1 || output.invocationId !== attempt.executionId || output.policyDigest !== attempt.outputFilePolicyDigest || !Object.hasOwn(output, "submission") || !recordValue(output.node) || output.submissionRef !== contentAddress(output.submission) || !node || contentAddress(output.node) !== contentAddress(node) || !publication.success || !controlRef || !sameControlCoordinates(publication.data.controlRef, controlRef) || canonicalCandidateDigest(publication.data.policy) !== attempt.outputFilePolicyDigest) return UNVERIFIED_SOURCE;
5973
+ if (attempt.workspaceRetention !== true) return void 0;
5974
+ }
5950
5975
  const receipts = [...attempt.result === void 0 || attempt.result.outputFormat === "json" ? [] : [attempt.result.outRef], ...attempt.evidence.map((event) => event.outRef)];
5951
5976
  const identity = owner === void 0 ? void 0 : ownerCaptureIdentity(attempt, owner);
5952
5977
  let verified = false;
@@ -5987,7 +6012,7 @@ function ownerCaptureIdentity(attempt, owner) {
5987
6012
  };
5988
6013
  }
5989
6014
  /** Recover evidence before reuse. Failed unverified turns keep their invocation; accepted turns owe evidence. */
5990
- async function reconcileOwnerWorkspaceBeforeReuse(state, signal) {
6015
+ async function reconcileOwnerWorkspaceBeforeReuse(state, signal, reconnecting = false) {
5991
6016
  const { args } = state;
5992
6017
  const indebted = /* @__PURE__ */ new Set();
5993
6018
  const events = await args.journal.loadTree(args.rootId) ?? [];
@@ -5998,10 +6023,13 @@ async function reconcileOwnerWorkspaceBeforeReuse(state, signal) {
5998
6023
  const reusing = new Set(latest.environmentIds);
5999
6024
  if (latest.result === void 0 && state.priorSession !== void 0) reusing.add(state.priorSession.environmentId);
6000
6025
  for (const attempt of attempts) {
6001
- if (attempt.workspaceRetention !== true || attempt.result === void 0) continue;
6026
+ if ((attempt.workspaceRetention !== true || attempt.result === void 0) && attempt.outputFilePolicyDigest === void 0) continue;
6027
+ if (reconnecting && attempt === latest && attempt.result === void 0) continue;
6002
6028
  for (const environmentId of attempt.environmentIds) {
6003
6029
  if (!reusing.has(environmentId) || unusable.has(environmentId)) continue;
6004
6030
  if (await ownerAttemptHasCapture(attempt, environmentId, args.blobs, args, true) === void 0) continue;
6031
+ if (attempt.outputFilePolicyDigest !== void 0) throw new RetainedExecutionPendingError(/* @__PURE__ */ new Error(UNVERIFIED_SOURCE), "unobservable");
6032
+ if (attempt.result === void 0) continue;
6005
6033
  signal.throwIfAborted();
6006
6034
  const failure = capturePendingMessage(attempt.executionId ?? args.nodeId, /* @__PURE__ */ new Error("client capture writers are retired; a persisted verified receipt is required"));
6007
6035
  if (executorFailureReason(attempt.result) === void 0) await owePendingEvidence(state, events, attempt, environmentId, failure);
@@ -6382,7 +6410,7 @@ const coordinationProfileToolPrefix = `${coordinationMcpAlias.replaceAll("-", "_
6382
6410
  const runtimeGraphMetadataKey = "agentRuntimeGraph";
6383
6411
  /** Remove Runtime-only grants, seat policy and graph topology from the provider-facing profile. */
6384
6412
  function providerVisibleProfile(profile) {
6385
- const { seats: _seats, ...withoutSeats } = profile;
6413
+ const { seats: _seats, outputFile: _outputFile, ...withoutSeats } = profile;
6386
6414
  const visible = withoutRuntimeGraph(withoutSeats);
6387
6415
  if (profile.tools === void 0) return visible;
6388
6416
  const providerTools = Object.fromEntries(Object.entries(profile.tools).filter(([name]) => !name.startsWith(coordinationProfileToolPrefix)));
@@ -7011,7 +7039,10 @@ async function prepareScopeRetainedOwnerTask(scope, task, session = "native") {
7011
7039
  const accepted = [...attempt].reverse().find((event) => event.kind === "execution-result");
7012
7040
  if (accepted?.kind === "execution-result") state.acceptedRef = accepted;
7013
7041
  }
7014
- if (state.taskRef !== void 0 && state.acceptedRef === void 0) await abandonInputAdmittedIntoDebt(state, await reconcileOwnerWorkspaceBeforeReuse(state, scope.signal));
7042
+ if (state.taskRef !== void 0 && state.acceptedRef === void 0) {
7043
+ const abandoned = latestInput?.kind === "execution-input" && owned.slice(owned.indexOf(latestInput)).some((event) => event.kind === "execution-abandoned");
7044
+ await abandonInputAdmittedIntoDebt(state, await reconcileOwnerWorkspaceBeforeReuse(state, scope.signal, session === "native" && !abandoned));
7045
+ }
7015
7046
  const unusable = unusableEnvironmentIds(owned);
7016
7047
  const currentEnvironment = state.admissions.find((admission) => admission.phase === "environment");
7017
7048
  if (state.acceptedRef === void 0 && currentEnvironment?.phase === "environment" && unusable.has(currentEnvironment.environmentId)) {
@@ -14147,4 +14178,4 @@ function isNonEmptySpend(s) {
14147
14178
  }
14148
14179
  export { queueOf as $, sanitizeKnowledgeReadinessReport as $n, executableAgentSpecSnapshot as $r, owners as $t, openSlotGroup as A, prepareInteractiveDelegation as An, authoredAgentIdentity as Ar, beginScopeOwnerAttempt as At, readWorkerInteractiveBinding as B, createPropagatingTraceEmitter as Bn, recordRuntimeOwnedProviderDispatchNotStarted as Br, coordinationProfileToolPrefix as Bt, workerCancellationsDir as C, reconnectRetainedRun as Cn, authoredSeatStages as Cr, resolveSpawnResourcePaths as Ct, writeWorkerSteer as D, retainedCreateMaterial as Dn, attestRuntimeOwnedExecutor as Dr, prepareScopeRetainedOwnerTask as Dt, writeWorkerCancellation as E, startRetainedRunInEnvironment as En, attestRuntimeOwnedDeferredExecutor as Er, consumeScopeRetainedOwnerResult as Et, parseWorkerToolTraceArtifact as F, destroyInteractiveEnvironment as Fn, knownMaterializationReceipt as Fr, recordScopeOwnerMaterialization as Ft, appendSpawnEvents as G, buildRuntimeEventOtelSpans as Gn, runtimeOwnedExecutorMaterialization as Gr, scopeRetainedOwnerTurnEnded as Gt, recoverRetainedInteractiveRun as H, readTraceContextFromEnv as Hn, recordRuntimeOwnedProviderModel as Hr, runtimeGraphMetadataKey as Ht, workerTraceAnalysisStore as I, environmentGone as In, newExecutionAttemptId as Ir, restoreScopeOwnerAcceptedExecution as It, reenteredWorkers as J, flatOtelSpan as Jn, runtimeOwnedScopeOwnerControl as Jr, scopeRetainedOwnerRestorePoint as Jt, spawnJournalRecordEvents as K, createOpenInferenceFileExporter as Kn, runtimeOwnedExecutorProviderEvidence as Kr, assertRetainedOwnerCoordinationRekey as Kt, nestedScopeSeamKey as L, WORKER_TRACE_PROPAGATION as Ln, providerAttemptEvidence as Lr, scopeOwnerExecutionObservation as Lt, prepareScopeResume as M, createFileObserverHooks as Mn, finalizeRuntimeOwnedPendingExecutor as Mr, holdScopeOwnerTranscript as Mt, replaySpawnTree as N, observerRecordDigest as Nn, inheritRuntimeOwnedExecutorAttestation as Nr, noteScopeOwnerPlannedExecution as Nt, writeWorkerSteerAcknowledgement as O, acceptedInteractiveControl as On, attestRuntimeOwnedPendingExecutor as Or, scopeRetainedOwnerPriorSpend as Ot, isTraceAnalysisStore as P, verifyObserverRecords as Pn, knownExecutionBindingReceipt as Pr, recordScopeOwnerHarnessTranscript as Pt, freeSlots as Q, createRuntimeStreamEventCollector as Qn, executableAgentProfileSnapshot as Qr, bindScopeRetainedOwnerProvider as Qt, interactiveAdmissionSeamKey as R, workerTraceEnv as Rn, recordRuntimeOwnedDriveHarnessProviderEvidence as Rr, scopeOwnerExecutorNodeContext as Rt, workerCancelRequestsFile as S, mintRetainedIdentity as Sn, SeatPauseError as Sr, environmentReader as St, workerSteerRequestsDir as T, startRetainedRun as Tn, subscriptionUsageLimitSignal as Tr, abandonScopeRetainedOwnerInvocation as Tt, startRetainedInteractiveRun as U, buildLoopOtelSpans as Un, runtimeOwnedDriveHarnessProviderEvidence as Ur, beginScopeRetainedOwnerDrive as Ut, reconnectRetainedInteractiveRun as V, mergeTraceEnv as Vn, recordRuntimeOwnedProviderIdentityConflict as Vr, providerVisibleProfile as Vt, FileSpawnJournal as W, buildLoopSpanNodes as Wn, runtimeOwnedExecutorExecutionBinding as Wr, scopeRetainedOwnerSettled as Wt, assertRecursiveReservationPolicy as X, loopEventToOtelSpan as Xn, unknownExecutionBindingReceipt as Xr, scopeRetainedOwnerCheckpointing as Xt, settledToIteration as Y, generateSpanId as Yn, runtimeOwnedScopeOwnerRuntime as Yr, noteScopeRetainedOwnerCoordination as Yt, deriveNodeExecutionIdentity as Z, createRuntimeEventCollector as Zn, unknownMaterializationReceipt as Zr, bindScopeRetainedOwnerEnvironmentId as Zt, readWorkerSteerAcknowledgement as _, describeRetainedNativeStops as _n, readWorkerProgress as _r, unconfirmedTeardowns as _t, createRootStreamSink as a, assertEventBinding as ai, materializeTreeView as an, harnessTranscriptFromLines as ar, meterRuntimeOwnedAccounting as at, supervisorRunDir as b, RetainedMaterializationTimeoutError as bn, SEAT_RECHECK_MS as br, releaseScopeRetainedOwnerForSeatPause as bt, readRootStreamReceipt as c, freezeControlRef as ci, nestedDriverTreeRoot as cn, readHarnessTranscript as cr, recordScopeOwnerBarrenPause as ct, claimWorkerSteerDelivery as d, promptFromAgentTurnInput as di, SpawnEventIndex as dn, readBoundHarnessSessions$1 as dr, registerNestedTeardownScope as dt, isRuntimeFlowBrain as ei, scopeOwnerLiabilities as en, sanitizeRuntimeStreamEvent as er, rollingDispatch as et, fileEscalateQuestion as f, promptOptionsFromAgentTurnInput as fi, insideCursorNamespace as fn, resolveHarnessTranscriptCapture as fr, releaseHeldEnvironments as ft, readWorkerCancellation as g, NATIVE_STOP_UNCONFIRMED as gn, describeToolArgs as gr, startScopeRecoveries as gt, readWorkerCancelRequests as h, observeModelRequest as hn, createActivityLog as hr, settleManagerWork as ht, ROOT_STREAM_FILE as i, RetainedRunProviderContractError as ii, ownedTreeRootSpawn as in, harnessTranscriptArtifact as ir, hasRetriableTeardowns as it, resolveWorkerSlots as j, FileObserverJournal as jn, authoredProfileDigest as jr, finalizeScopeOwnerMaterialization as jt, createWorkerSlots as k, offerInteractiveControl as kn, attestRuntimeOwnedScopeOwner as kr, scopeRetainedOwnerResult as kt, appendWorkerControlEvent as l, retainedSessionReplaced as li, FileResultBlobStore as ln, settleHarnessTranscript as lr, recordScopeOwnerDriverAttempt as lt, legacySupervisorRunsRoot as m, executorObservationSeamKey as mn, DEFAULT_STALL_AFTER_MS as mr, retryUnconfirmedTeardowns as mt, terminalAccounting as n, runtimeFlowAgent as ni, scopeRetainedOwnerJournalRoot as nn, captureBoundHarnessTranscript as nr, closeRetainedSlots as nt, nodeStreamFile as o, awaitAbortable$1 as oi, attestNestedDriverTreeOwner as on, harnessTranscriptUnavailable as or, meterRuntimeOwnedProviderAttempt as ot, legacySupervisorRunDir as p, providerMessageText as pi, executorObservation as pn, retainHarnessTranscript as pr, releaseRetainedEnvironments as pt, appendTeardownConfirmation as q, createOtelExporter as qn, runtimeOwnedPendingExecutorMaterialization as qr, reconcileScopeRetainedOwnerEnvironment as qt, createScope as r, runtimeFlowBrain as ri, loadSpawnForest as rn, captureHarnessTranscript as rr, closeScopeAdmission as rt, readRootStream as s, exactSession as si, driverRuntime as sn, persistHarnessTranscript as sr, pauseScopeSeatAdmission as st, isNonEmptySpend as t, runtimeCheckFactory as ti, scopeRetainedOwnerContext as tn, HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS as tr, boundRetainedReleases as tt, cancelWorker as u, sameControlCoordinates as ui, encodeResultBlob as un, HARNESS_TRANSCRIPT_READ_LIMITS as ur, recordScopeOwnerPause as ut, readWorkerSteerRequests as v, stopRetainedNativeExecution as vn, isLiveNodeStatus as vr, waitForScopeChildren as vt, workerInboxFileFromEventDir as w, recoverRetainedRun as wn, seatExecutionProfile as wr, RELEASE_DESTROY_MS as wt, supervisorRunsRoot as x, assertRetainedRunReplayMaterial as xn, SeatChain as xr, scopeRetainedOwnerResourceReader as xt, safeWorkerFile as y, verifyWorkspaceMarker as yn, isTerminalNodeStatus as yr, prepareScopeRetainedOwnerSeatSwitch as yt, attachWorker as z, workerTraceHeaders as zn, recordRuntimeOwnedProviderAttemptStart as zr, coordinationMcpAlias as zt };
14149
14180
 
14150
- //# sourceMappingURL=supervisor-accounting-C48Yo9QC.js.map
14181
+ //# sourceMappingURL=supervisor-accounting-QiXnF-EW.js.map