@tangle-network/agent-runtime 10.0.0 → 10.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/{activation-CEGkyzEG.js → activation-B0DHGRtB.js} +2 -2
- package/dist/{activation-CEGkyzEG.js.map → activation-B0DHGRtB.js.map} +1 -1
- package/dist/{activation-CDlOqX5a.d.ts → activation-D0Sp7wMc.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{delegate-V2Nz8GgO.js → delegate-Co5iUyS0.js} +2 -2
- package/dist/{delegate-V2Nz8GgO.js.map → delegate-Co5iUyS0.js.map} +1 -1
- package/dist/{driver-control-acknowledgers-CJDYLJmW.js → driver-control-acknowledgers-B1Qx2JUz.js} +68 -12
- package/dist/driver-control-acknowledgers-B1Qx2JUz.js.map +1 -0
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +9 -9
- package/dist/{failure-cause-BI7cfDWx.js → failure-cause-DoCCGLDH.js} +30 -18
- package/dist/{failure-cause-BI7cfDWx.js.map → failure-cause-DoCCGLDH.js.map} +1 -1
- package/dist/{graph-wJOMQ1kC.js → graph-uc4eT1wR.js} +7 -7
- package/dist/{graph-wJOMQ1kC.js.map → graph-uc4eT1wR.js.map} +1 -1
- package/dist/{improve-DOjywiPq.js → improve-BM0HlzMi.js} +6 -6
- package/dist/{improve-DOjywiPq.js.map → improve-BM0HlzMi.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -11
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +4 -4
- package/dist/kernel.d.ts +2 -2
- package/dist/kernel.js +15 -15
- package/dist/{loop-runner-CPTOzSol.js → loop-runner-CRC-RE4D.js} +2 -2
- package/dist/{loop-runner-CPTOzSol.js.map → loop-runner-CRC-RE4D.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/{loop-runner-DwxZbYW5.d.ts → loop-runner-npLkvCU5.d.ts} +2 -2
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +7 -7
- package/dist/mcp/memory-bin.js +1 -1
- package/dist/{model-policy-CqDuBTq-.js → model-policy-DZnL8Yj9.js} +13 -2
- package/dist/{model-policy-CqDuBTq-.js.map → model-policy-DZnL8Yj9.js.map} +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +1 -1
- package/dist/{provision-supervisor-B1_Kow9m.js → provision-supervisor-CJrMGyZW.js} +6 -6
- package/dist/{provision-supervisor-B1_Kow9m.js.map → provision-supervisor-CJrMGyZW.js.map} +1 -1
- package/dist/{run-cancellation-D5m6JHPH.js → run-cancellation-CBP3Bmad.js} +2 -2
- package/dist/{run-cancellation-D5m6JHPH.js.map → run-cancellation-CBP3Bmad.js.map} +1 -1
- package/dist/{run-state-DKOXe08H.js → run-state-BnhCVbTY.js} +5 -5
- package/dist/{run-state-DKOXe08H.js.map → run-state-BnhCVbTY.js.map} +1 -1
- package/dist/{runtime-C5cWSMqU.js → runtime-BqSaWTEY.js} +14 -14
- package/dist/{runtime-C5cWSMqU.js.map → runtime-BqSaWTEY.js.map} +1 -1
- package/dist/{search-executor-CA6fTYWz.js → search-executor-C9TN-KgI.js} +5 -5
- package/dist/{search-executor-CA6fTYWz.js.map → search-executor-C9TN-KgI.js.map} +1 -1
- package/dist/{server-C8Z3vYdI.js → server-CcMa8Lt9.js} +4 -4
- package/dist/{server-C8Z3vYdI.js.map → server-CcMa8Lt9.js.map} +1 -1
- package/dist/{settle-record-BDxPAO4m.js → settle-record-BtjYZabI.js} +2 -2
- package/dist/{settle-record-BDxPAO4m.js.map → settle-record-BtjYZabI.js.map} +1 -1
- package/dist/{structural-rollout-B0HPcP9G.js → structural-rollout-2oRJjwyM.js} +5 -5
- package/dist/{structural-rollout-B0HPcP9G.js.map → structural-rollout-2oRJjwyM.js.map} +1 -1
- package/dist/{supervise-Dvj-8S6D.js → supervise-BrgtzJf3.js} +47 -15
- package/dist/supervise-BrgtzJf3.js.map +1 -0
- package/dist/{supervision-discovery-CbrwcgJy.js → supervision-discovery-DLMm3UOr.js} +3 -3
- package/dist/{supervision-discovery-CbrwcgJy.js.map → supervision-discovery-DLMm3UOr.js.map} +1 -1
- package/dist/{supervisor-DwdeUC2l.js → supervisor-ACffs_W4.js} +248 -49
- package/dist/supervisor-ACffs_W4.js.map +1 -0
- package/dist/{supervisor-accounting-C48Yo9QC.js → supervisor-accounting-BlJqoP3k.js} +43 -12
- package/dist/supervisor-accounting-BlJqoP3k.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/{tool-server-DsCeBr-C.js → tool-server-DQCdu3am.js} +2 -2
- package/dist/{tool-server-DsCeBr-C.js.map → tool-server-DQCdu3am.js.map} +1 -1
- package/dist/{top-web-CTOq4psb.js → top-web-PYyzBMsK.js} +6 -6
- package/dist/{top-web-CTOq4psb.js.map → top-web-PYyzBMsK.js.map} +1 -1
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-lnF0wIJW.d.ts → types-DX1OGeHE.d.ts} +5736 -5692
- package/package.json +5 -5
- package/dist/driver-control-acknowledgers-CJDYLJmW.js.map +0 -1
- package/dist/supervise-Dvj-8S6D.js.map +0 -1
- package/dist/supervisor-DwdeUC2l.js.map +0 -1
- package/dist/supervisor-accounting-C48Yo9QC.js.map +0 -1
|
@@ -2,16 +2,16 @@ 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 {
|
|
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
|
-
import { p as canonicalObservedModelParts, t as assertExecutableAgentProfile } from "./model-policy-
|
|
7
|
+
import { p as canonicalObservedModelParts, t as assertExecutableAgentProfile } from "./model-policy-DZnL8Yj9.js";
|
|
8
8
|
import { b as verifiedArtifactChunks, g as workspaceLimits, h as safeArchivePath, i as readAgentCandidateWorkspaceArtifactFiles } from "./workspace-streams-C7PGLAUd.js";
|
|
9
9
|
import { a as writeAtomicDurableFile, n as assertNoSymlinkDescendant, o as captureRunWriteContext, r as publishExclusiveDurableFile, s as fenceRunWrite, t as appendDurableFile } from "./durable-file-DstVeHcj.js";
|
|
10
10
|
import { b as sha256Bytes$1, g as deepFreezeCandidate } from "./output-artifacts-AqkZ8lO2.js";
|
|
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")
|
|
5905
|
-
|
|
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)
|
|
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-
|
|
14181
|
+
//# sourceMappingURL=supervisor-accounting-BlJqoP3k.js.map
|