@tangle-network/agent-runtime 10.0.23 → 10.0.24
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 +12 -0
- package/dist/{activation-D_J9qCzU.js → activation-DLbBM2S0.js} +2 -2
- package/dist/{activation-D_J9qCzU.js.map → activation-DLbBM2S0.js.map} +1 -1
- package/dist/{activation-DOzkzTrl.d.ts → activation-DUYtmQH_.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{delegate-DCZPcYy8.js → delegate-Cz2GF_z7.js} +2 -2
- package/dist/{delegate-DCZPcYy8.js.map → delegate-Cz2GF_z7.js.map} +1 -1
- package/dist/{driver-control-acknowledgers-CgGt3NcX.js → driver-control-acknowledgers-pDEPMuML.js} +7 -7
- package/dist/{driver-control-acknowledgers-CgGt3NcX.js.map → driver-control-acknowledgers-pDEPMuML.js.map} +1 -1
- package/dist/durable-writer-thread.js +2 -2
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +14 -13
- package/dist/durable.js.map +1 -1
- package/dist/{graph-B3pBmvnf.js → graph-D-LVPqrm.js} +7 -6
- package/dist/{graph-B3pBmvnf.js.map → graph-D-LVPqrm.js.map} +1 -1
- package/dist/{improve-DhOOHHRz.js → improve-BJW9OcEn.js} +5 -5
- package/dist/{improve-DhOOHHRz.js.map → improve-BJW9OcEn.js.map} +1 -1
- package/dist/index.d.ts +41 -6
- package/dist/index.js +55 -21
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +4 -4
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +15 -15
- package/dist/{loop-runner-L594gDYR.js → loop-runner-BZWObfqa.js} +2 -2
- package/dist/{loop-runner-L594gDYR.js.map → loop-runner-BZWObfqa.js.map} +1 -1
- package/dist/{loop-runner-CcXKPnMR.d.ts → loop-runner-ClANio8o.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +6 -6
- package/dist/mcp/memory-bin.js +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-Be-6HBsX.js → provision-supervisor-ChGKJz8s.js} +5 -5
- package/dist/{provision-supervisor-Be-6HBsX.js.map → provision-supervisor-ChGKJz8s.js.map} +1 -1
- package/dist/{result-blob-store-CJjp44Mz.js → result-blob-store-BZwRmrFF.js} +2 -2
- package/dist/{result-blob-store-CJjp44Mz.js.map → result-blob-store-BZwRmrFF.js.map} +1 -1
- package/dist/{run-cancellation-BNBmsY3a.js → run-cancellation-uCwV2Ra7.js} +2 -2
- package/dist/{run-cancellation-BNBmsY3a.js.map → run-cancellation-uCwV2Ra7.js.map} +1 -1
- package/dist/{run-reopen-Cr2SHmYa.js → run-reopen-YJwUAmv6.js} +6 -6
- package/dist/{run-reopen-Cr2SHmYa.js.map → run-reopen-YJwUAmv6.js.map} +1 -1
- package/dist/{run-state-Bko0BF0_.js → run-state-6jJzk6gB.js} +5 -5
- package/dist/{run-state-Bko0BF0_.js.map → run-state-6jJzk6gB.js.map} +1 -1
- package/dist/{runtime-Dfwc9cjt.js → runtime-Ddkn1wRr.js} +15 -15
- package/dist/{runtime-Dfwc9cjt.js.map → runtime-Ddkn1wRr.js.map} +1 -1
- package/dist/{search-executor-DnWnh4kj.js → search-executor-D9E9q-Pv.js} +4 -4
- package/dist/{search-executor-DnWnh4kj.js.map → search-executor-D9E9q-Pv.js.map} +1 -1
- package/dist/{server-RCsa_gyH.js → server-BhXz3JyW.js} +4 -4
- package/dist/{server-RCsa_gyH.js.map → server-BhXz3JyW.js.map} +1 -1
- package/dist/{settle-record-BlIw2MU1.js → settle-record-DWae7fwV.js} +2 -2
- package/dist/{settle-record-BlIw2MU1.js.map → settle-record-DWae7fwV.js.map} +1 -1
- package/dist/{structural-rollout-BLflx9cs.js → structural-rollout-BL8KLLw8.js} +4 -4
- package/dist/{structural-rollout-BLflx9cs.js.map → structural-rollout-BL8KLLw8.js.map} +1 -1
- package/dist/{supervise-037R-zl1.js → supervise-C7mDlK7S.js} +10 -7
- package/dist/supervise-C7mDlK7S.js.map +1 -0
- package/dist/{supervise-identity-CtxWEk1I.js → supervise-identity-DLPzZTp3.js} +2 -2
- package/dist/{supervise-identity-CtxWEk1I.js.map → supervise-identity-DLPzZTp3.js.map} +1 -1
- package/dist/{supervision-discovery-DKxqbnHf.js → supervision-discovery-8XnVtdOD.js} +3 -3
- package/dist/{supervision-discovery-DKxqbnHf.js.map → supervision-discovery-8XnVtdOD.js.map} +1 -1
- package/dist/{supervisor-DL4hO7UW.js → supervisor-BQwg_3T0.js} +494 -28
- package/dist/supervisor-BQwg_3T0.js.map +1 -0
- package/dist/{supervisor-accounting-DlDUl58C.js → supervisor-accounting-B0ofgTZX.js} +91 -14
- package/dist/supervisor-accounting-B0ofgTZX.js.map +1 -0
- package/dist/{supervisor-root-contract-BCbu1A4n.js → supervisor-root-contract-N7rW4Ynu.js} +3 -3
- package/dist/{supervisor-root-contract-BCbu1A4n.js.map → supervisor-root-contract-N7rW4Ynu.js.map} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/{tool-server-n4XYpCok.js → tool-server-I63dnHZC.js} +39 -3
- package/dist/{tool-server-n4XYpCok.js.map → tool-server-I63dnHZC.js.map} +1 -1
- package/dist/{top-web-B-sHmI3g.js → top-web-BZM3es-m.js} +7 -7
- package/dist/{top-web-B-sHmI3g.js.map → top-web-BZM3es-m.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-Pi5uCS88.d.ts → types-CByvdC7k.d.ts} +54 -39
- package/package.json +1 -1
- package/dist/supervise-037R-zl1.js.map +0 -1
- package/dist/supervisor-DL4hO7UW.js.map +0 -1
- package/dist/supervisor-accounting-DlDUl58C.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { c as RetainedInteractiveAdmissionError, d as RetainedRunDispatchBinding
|
|
|
2
2
|
import { C as linkAbort, S as deadlineSignal, T as signalAbortError, b as RunCancellationReason, c as withJsonlFileLock, d as journalFileStamp, h as checkVerdictOf, l as appendCommittedJsonLine, o as readCommittedJsonLines, r as prepareJsonlAppend, t as isNoEntError, w as runAbortable, y as sha256 } from "./jsonl-file-B2ESMrTh.js";
|
|
3
3
|
import { c as checkInIdleMs, d as teardownExecutor, f as teardownSurfaces, 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 { $ as budgetLeases, A as printedStatus, B as executorFailure, E as UNAVAILABLE_STATUSES, G as turnFailureOf, H as executorFailureReason, K as turnFailurePolicy, L as traceRootWriter, P as unavailableSignalOfFailure, Pt as recordValue, Q as budgetLeaseUpdates, R as contentAddress, S as retainedExecutorSeamKey, T as UNAVAILABLE_CODES, V as executorFailureInfra, X as isCredentialRefusal, Y as credentialCommandExit, Z as BudgetReconcileFault, _ as leafContinuationExecutionId, at as newUsageTotals, c as BUDGET_CONTINUATION_TASK, ct as assertValidBudget, d as RetainedExecutionPendingError, et as budgetRecoverySeeds, f as TRANSPORT_ERROR_CODES, g as isSpentCreateKeyRefusal, h as isSchemaRejection, i as runtimeFailureCause, it as meterUsageEvent, l as DISPATCH_EXECUTION_CHANGED_CODE, lt as assertValidSpend, m as isProvisioningRefusal, nt as createBudgetPool, p as executorEvidenceWriter, r as reportedFailureCause, rt as refreshBudgetLease, s as settlementFailureCause, st as spendFromUsageTotals, t as PROTOCOL_VERSION, tt as completedLeafBacking, u as DISPATCH_NOT_ADMITTED_CODE, v as prepareRetainedExecutor, vt as extractTransportEventIdentity, x as retainedExecutorContext, y as refusedBeforeItRan, yt as parseCanonicalTransportEvent } from "./tool-server-
|
|
5
|
+
import { $ as budgetLeases, A as printedStatus, B as executorFailure, E as UNAVAILABLE_STATUSES, G as turnFailureOf, H as executorFailureReason, K as turnFailurePolicy, L as traceRootWriter, P as unavailableSignalOfFailure, Pt as recordValue, Q as budgetLeaseUpdates, R as contentAddress, S as retainedExecutorSeamKey, T as UNAVAILABLE_CODES, V as executorFailureInfra, X as isCredentialRefusal, Y as credentialCommandExit, Z as BudgetReconcileFault, _ as leafContinuationExecutionId, at as newUsageTotals, c as BUDGET_CONTINUATION_TASK, ct as assertValidBudget, d as RetainedExecutionPendingError, et as budgetRecoverySeeds, f as TRANSPORT_ERROR_CODES, g as isSpentCreateKeyRefusal, h as isSchemaRejection, i as runtimeFailureCause, it as meterUsageEvent, l as DISPATCH_EXECUTION_CHANGED_CODE, lt as assertValidSpend, m as isProvisioningRefusal, nt as createBudgetPool, p as executorEvidenceWriter, r as reportedFailureCause, rt as refreshBudgetLease, s as settlementFailureCause, st as spendFromUsageTotals, t as PROTOCOL_VERSION, tt as completedLeafBacking, u as DISPATCH_NOT_ADMITTED_CODE, v as prepareRetainedExecutor, vt as extractTransportEventIdentity, x as retainedExecutorContext, y as refusedBeforeItRan, yt as parseCanonicalTransportEvent } from "./tool-server-I63dnHZC.js";
|
|
6
6
|
import { a as errMessage, f as defaultRedactor, i as causeChain, l as errorText, m as resolveRedactor, n as detachedSnapshot, o as errorHttpStatus, r as shareParsedStrings, s as errorProperty } from "./snapshot-BKLziJ5K.js";
|
|
7
7
|
import { p as canonicalObservedModelParts, t as assertExecutableAgentProfile } from "./model-policy-DFuhCC0-.js";
|
|
8
8
|
import { b as verifiedArtifactChunks, g as workspaceLimits, h as safeArchivePath, i as readAgentCandidateWorkspaceArtifactFiles } from "./workspace-streams-C7PGLAUd.js";
|
|
@@ -6509,6 +6509,34 @@ function pendingCheckpoints(events, state) {
|
|
|
6509
6509
|
return events.filter((event) => event.kind === "workspace-checkpoint" && event.id === state.args.nodeId && event.provider === state.provider?.name && !confirmed.has(JSON.stringify([event.environmentId, event.checkpoint.checkpointId])));
|
|
6510
6510
|
}
|
|
6511
6511
|
// src/runtime/supervise/retained-owner-checkpoint-capture.ts
|
|
6512
|
+
/** The two cleanups that never reached the provider, so the checkpoint is as it was. */
|
|
6513
|
+
const CLEANUP_CANCELLED = "cancelled before checkpoint cleanup";
|
|
6514
|
+
const CLEANUP_UNREACHABLE = "source-scoped checkpoint handle unavailable";
|
|
6515
|
+
/**
|
|
6516
|
+
* Checkpoints oldest first by when each was asked for. Journal order is not age: a request lookup
|
|
6517
|
+
* journals a checkpoint it recovers after any taken since, so the newest is the last of these.
|
|
6518
|
+
*/
|
|
6519
|
+
function byTakenAt(events) {
|
|
6520
|
+
const taken = (at) => {
|
|
6521
|
+
const time = Date.parse(at);
|
|
6522
|
+
return Number.isFinite(time) ? time : Number.NEGATIVE_INFINITY;
|
|
6523
|
+
};
|
|
6524
|
+
return events.map((event, index) => ({
|
|
6525
|
+
event,
|
|
6526
|
+
index,
|
|
6527
|
+
at: taken(event.at)
|
|
6528
|
+
})).sort((a, b) => a.at === b.at ? a.index - b.index : a.at - b.at).map(({ event }) => event);
|
|
6529
|
+
}
|
|
6530
|
+
/**
|
|
6531
|
+
* The checkpoints whose delete reached the provider, confirmed or not. None is a restore source: a
|
|
6532
|
+
* provider can remove a checkpoint and still not confirm it (Sandbox answers a 200 it cannot
|
|
6533
|
+
* attest as `unknown`), and a create from a removed checkpoint is refused. On
|
|
6534
|
+
* real-work-benchmark-20261129b a reopen created from one and was refused with HTTP 404 "Snapshot
|
|
6535
|
+
* not found". Pass one node's events: checkpoint ids are the provider's, not the node's.
|
|
6536
|
+
*/
|
|
6537
|
+
function deleteSentCheckpointIds(events) {
|
|
6538
|
+
return new Set(events.flatMap((event) => event.kind === "workspace-checkpoint-cleanup" && (event.confirmed || event.refused !== CLEANUP_CANCELLED && event.refused !== CLEANUP_UNREACHABLE) ? [event.checkpointId] : []));
|
|
6539
|
+
}
|
|
6512
6540
|
/**
|
|
6513
6541
|
* Delete restore-point checkpoints. A checkpoint is a restore point for a live owner, never
|
|
6514
6542
|
* evidence: the turn's workspace capture and native session export are the evidence, and the
|
|
@@ -6531,8 +6559,8 @@ async function cleanCheckpoints(state, branching, checkpoints, parent) {
|
|
|
6531
6559
|
let reason;
|
|
6532
6560
|
const signal = deadlineSignal(parent, 3e4);
|
|
6533
6561
|
try {
|
|
6534
|
-
if (parent?.aborted) reason =
|
|
6535
|
-
else if (branching === void 0) throw new Error(
|
|
6562
|
+
if (parent?.aborted) reason = CLEANUP_CANCELLED;
|
|
6563
|
+
else if (branching === void 0) throw new Error(CLEANUP_UNREACHABLE);
|
|
6536
6564
|
else {
|
|
6537
6565
|
const acknowledgement = await runAbortable(() => branching.deleteCheckpoint(request, { signal }), signal, "retained owner checkpoint cleanup timed out");
|
|
6538
6566
|
confirmed = workspaceCleanupAcknowledgementMatches(request, acknowledgement) && (acknowledgement.status === "deleted" || acknowledgement.status === "already_absent");
|
|
@@ -6753,8 +6781,8 @@ async function deleteOldestCheckpoint(state, branching, environmentId, signal) {
|
|
|
6753
6781
|
// src/runtime/supervise/retained-owner-environment-recovery.ts
|
|
6754
6782
|
function restoreBefore(owned, inputIndex) {
|
|
6755
6783
|
const unusable = unusableEnvironmentIds(owned);
|
|
6756
|
-
const deleted =
|
|
6757
|
-
return owned.slice(0, inputIndex < 0 ? owned.length : inputIndex).filter((event) => event.kind === "workspace-checkpoint" && unusable.has(event.environmentId) && !deleted.has(event.checkpoint.checkpointId)).at(-1);
|
|
6784
|
+
const deleted = deleteSentCheckpointIds(owned);
|
|
6785
|
+
return byTakenAt(owned.slice(0, inputIndex < 0 ? owned.length : inputIndex).filter((event) => event.kind === "workspace-checkpoint" && unusable.has(event.environmentId) && !deleted.has(event.checkpoint.checkpointId))).at(-1);
|
|
6758
6786
|
}
|
|
6759
6787
|
async function restoreCapable(provider) {
|
|
6760
6788
|
if (provider === void 0) return false;
|
|
@@ -7775,6 +7803,18 @@ function consumeScopeRetainedOwnerResult(scope) {
|
|
|
7775
7803
|
function retainedOwnerReleaseRetriable(scope) {
|
|
7776
7804
|
return owners.get(scope)?.releaseRetriable ?? false;
|
|
7777
7805
|
}
|
|
7806
|
+
/**
|
|
7807
|
+
* @internal Make every later release of this scope's owner keep its restore point: the newest
|
|
7808
|
+
* workspace checkpoint not yet deleted, and the environment it was taken from. A reopened run's
|
|
7809
|
+
* owner continues in that environment, or, once the environment is gone, in a new one created
|
|
7810
|
+
* from that checkpoint (`restoreBefore`). The environment stays because deleting a checkpoint
|
|
7811
|
+
* needs its source, and only a live source is sure to restore it. Superseded checkpoints and
|
|
7812
|
+
* every other environment are still released.
|
|
7813
|
+
*/
|
|
7814
|
+
function keepScopeRetainedOwnerRestorePoint(scope) {
|
|
7815
|
+
const state = owners.get(scope);
|
|
7816
|
+
if (state !== void 0) state.keepRestorePoint = true;
|
|
7817
|
+
}
|
|
7778
7818
|
/** One budget for every checkpoint lookup, delete and fork cleanup this release starts. Work cut short keeps its checkpoint and source. */
|
|
7779
7819
|
const RELEASE_CHECKPOINT_CAPTURES_MS = 9e5;
|
|
7780
7820
|
/** A release's wait for its destroys; a delete grows with the retained workspace it seals (Sandbox
|
|
@@ -7818,13 +7858,22 @@ async function releaseOwnerEnvironment(state, provider, capturesMs, destroyMs) {
|
|
|
7818
7858
|
let lastDetail;
|
|
7819
7859
|
let retriable = false;
|
|
7820
7860
|
const checkpointFailures = [];
|
|
7861
|
+
let restorePoint;
|
|
7862
|
+
let reopenBoxes = /* @__PURE__ */ new Set();
|
|
7821
7863
|
try {
|
|
7822
7864
|
requestFailures = await reconcileCheckpointRequests(state, events, captures.signal);
|
|
7823
7865
|
for (const { event } of requestFailures) pendingSources.add(event.environmentId);
|
|
7824
|
-
const
|
|
7866
|
+
const owned = byTakenAt(pendingCheckpoints(events, state));
|
|
7867
|
+
if (state.keepRestorePoint === true) ({restorePoint, boxes: reopenBoxes} = reopenKeep(args.nodeId, events, owned, released));
|
|
7868
|
+
const pending = owned.filter((event) => event !== restorePoint && !retentionFailures.has(event.environmentId));
|
|
7825
7869
|
for (const sourceEnvironmentId of new Set(pending.map((event) => event.environmentId))) {
|
|
7826
7870
|
const branching = await checkpointHandle(state, sourceEnvironmentId, AbortSignal.any([captures.signal, AbortSignal.timeout(3e4)]));
|
|
7827
|
-
|
|
7871
|
+
const ofSource = pending.filter((event) => event.environmentId === sourceEnvironmentId);
|
|
7872
|
+
const newest = sourceEnvironmentId === restorePoint?.environmentId ? void 0 : ofSource.at(-1);
|
|
7873
|
+
const failed = await cleanCheckpoints(state, branching, newest === void 0 ? ofSource : ofSource.slice(0, -1), captures.signal);
|
|
7874
|
+
checkpointFailures.push(...failed);
|
|
7875
|
+
const standing = !released.has(sourceEnvironmentId) && (reopenBoxes.has(sourceEnvironmentId) || failed.length > 0 || pendingSources.has(sourceEnvironmentId) || state.held?.has(sourceEnvironmentId) === true);
|
|
7876
|
+
if (newest !== void 0 && !standing) checkpointFailures.push(...await cleanCheckpoints(state, branching, [newest], captures.signal));
|
|
7828
7877
|
}
|
|
7829
7878
|
} finally {
|
|
7830
7879
|
clearTimeout(capturesTimer);
|
|
@@ -7832,7 +7881,7 @@ async function releaseOwnerEnvironment(state, provider, capturesMs, destroyMs) {
|
|
|
7832
7881
|
const forksUnresolved = await settleCaptureForks(state, captures.signal);
|
|
7833
7882
|
for (const { event } of checkpointFailures) pendingSources.add(event.environmentId);
|
|
7834
7883
|
const held = state.held ??= /* @__PURE__ */ new Map();
|
|
7835
|
-
const asking = [...environments].filter((id) => !released.has(id) && !retentionFailures.has(id) && !pendingSources.has(id) && !held.has(id));
|
|
7884
|
+
const asking = [...environments].filter((id) => !released.has(id) && !retentionFailures.has(id) && !pendingSources.has(id) && !held.has(id) && !reopenBoxes.has(id));
|
|
7836
7885
|
const clock = state.releaseClock;
|
|
7837
7886
|
if (clock !== void 0 && asking.length > 0) {
|
|
7838
7887
|
clock.startedAt ??= Date.now();
|
|
@@ -7854,11 +7903,13 @@ async function releaseOwnerEnvironment(state, provider, capturesMs, destroyMs) {
|
|
|
7854
7903
|
const heldBefore = asked === void 0 ? held.get(environmentId) : void 0;
|
|
7855
7904
|
const retentionReason = retentionFailures.get(environmentId) ?? heldBefore;
|
|
7856
7905
|
const nativeHold = retentionReason?.startsWith("native session copy incomplete:") === true;
|
|
7906
|
+
const keptForReopen = reopenBoxes.has(environmentId) ? restorePoint : void 0;
|
|
7857
7907
|
if (retentionReason !== void 0 || pendingSources.has(environmentId)) {
|
|
7858
7908
|
detail = !nativeHold && pendingSources.has(environmentId) ? "checkpoint cleanup unresolved: source preserved for exact lookup and cleanup" : retentionReason;
|
|
7859
7909
|
preserved.push(environmentId);
|
|
7860
7910
|
lastDetail = detail;
|
|
7861
|
-
} else
|
|
7911
|
+
} else if (keptForReopen !== void 0) detail = `kept for reopen: restore point ${keptForReopen.checkpoint.checkpointId}`;
|
|
7912
|
+
else try {
|
|
7862
7913
|
await asked;
|
|
7863
7914
|
destroyed = true;
|
|
7864
7915
|
} catch (error) {
|
|
@@ -7886,6 +7937,7 @@ async function releaseOwnerEnvironment(state, provider, capturesMs, destroyMs) {
|
|
|
7886
7937
|
detail = `${detail}; ${describeRetainedNativeStops(stops)}`;
|
|
7887
7938
|
lastDetail = detail;
|
|
7888
7939
|
}
|
|
7940
|
+
if (keptForReopen !== void 0 && detail?.includes("it may still be running") === true) preserved.push(environmentId);
|
|
7889
7941
|
}
|
|
7890
7942
|
await args.journal.appendEvent(args.rootId, {
|
|
7891
7943
|
kind: "environment-teardown",
|
|
@@ -7939,6 +7991,30 @@ async function releaseOwnerEnvironment(state, provider, capturesMs, destroyMs) {
|
|
|
7939
7991
|
...lastDetail === void 0 ? {} : { detail: lastDetail }
|
|
7940
7992
|
}, ...checkpointTeardowns] : checkpointTeardowns;
|
|
7941
7993
|
}
|
|
7994
|
+
/**
|
|
7995
|
+
* Under `keepRestorePoint`, what a reopened owner continues from: the checkpoint `restoreBefore`
|
|
7996
|
+
* would restore, the newest whose delete was never sent (counting any a request lookup just
|
|
7997
|
+
* recovered), and the boxes that stay with it: its own, and the owner's latest usable box, whose
|
|
7998
|
+
* work may be newer than any checkpoint. A reopen continues in that box and restores the
|
|
7999
|
+
* checkpoint only once it is gone.
|
|
8000
|
+
*/
|
|
8001
|
+
function reopenKeep(nodeId, events, owned, released) {
|
|
8002
|
+
const own = events.filter((event) => event.id === nodeId);
|
|
8003
|
+
const sent = deleteSentCheckpointIds(own);
|
|
8004
|
+
const restorePoint = owned.filter((event) => !sent.has(event.checkpoint.checkpointId)).at(-1);
|
|
8005
|
+
const boxes = /* @__PURE__ */ new Set();
|
|
8006
|
+
if (restorePoint === void 0) return {
|
|
8007
|
+
restorePoint,
|
|
8008
|
+
boxes
|
|
8009
|
+
};
|
|
8010
|
+
if (!released.has(restorePoint.environmentId)) boxes.add(restorePoint.environmentId);
|
|
8011
|
+
const latest = own.flatMap((event) => event.kind === "execution-admitted" && event.admission.phase === "environment" ? [event.admission.environmentId] : []).at(-1);
|
|
8012
|
+
if (latest !== void 0 && !unusableEnvironmentIds(own).has(latest)) boxes.add(latest);
|
|
8013
|
+
return {
|
|
8014
|
+
restorePoint,
|
|
8015
|
+
boxes
|
|
8016
|
+
};
|
|
8017
|
+
}
|
|
7942
8018
|
var PermanentReleaseRefusal = class extends Error {};
|
|
7943
8019
|
const HELD_STOP = "stop not attempted: its provider holds the environment under a retention hold and a reconnect would wake it";
|
|
7944
8020
|
/**
|
|
@@ -8577,9 +8653,10 @@ async function settleManagerWork(scope) {
|
|
|
8577
8653
|
* admission that timed out before `create` named an environment. Measured on the Discovery fleet
|
|
8578
8654
|
* of 2026-09-23/24 (Runtime 0.249.1 to 0.261.0): 338 of 1,620 agents never settled, so they had no
|
|
8579
8655
|
* terminal record, no spend but the reservation ceiling, and no transcript receipt (#1301). A
|
|
8580
|
-
* settlement under `retainedAtSettlement: 'release'` is final
|
|
8581
|
-
*
|
|
8582
|
-
*
|
|
8656
|
+
* settlement under `retainedAtSettlement: 'release'` is final for them: a reopen
|
|
8657
|
+
* continues the root's owner alone, so no process will recover these executions. Each slot
|
|
8658
|
+
* closes with the settlement the driver already received, under the seq it saw, marked
|
|
8659
|
+
* `retainedExecution: 'release-unconfirmed'`. The environment it may still hold stays
|
|
8583
8660
|
* named by its `teardown-unconfirmed` record for a sweeper. Never call this on a run a later
|
|
8584
8661
|
* process may resume.
|
|
8585
8662
|
*/
|
|
@@ -14895,6 +14972,6 @@ function unknownChannels(spend) {
|
|
|
14895
14972
|
function isNonEmptySpend(s) {
|
|
14896
14973
|
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);
|
|
14897
14974
|
}
|
|
14898
|
-
export { appendTeardownConfirmation as $,
|
|
14975
|
+
export { appendTeardownConfirmation as $, flatOtelSpan as $n, inheritRuntimeOwnedExecutorAttestation as $r, assertRetainedOwnerCoordinationRekey as $t, workerSteerRequestsDir as A, sameControlCoordinates as Ai, startRetainedRun as An, summarizeDriverAttempts as Ar, RELEASE_DESTROY_MS as At, isTraceAnalysisStore as B, destroyInteractiveEnvironment as Bn, preflightPublicCoordination as Br, noteScopeOwnerPlannedExecution as Bt, readWorkerSteerRequests as C, runtimeFlowBrain as Ci, stopRetainedNativeExecution as Cn, isLiveNodeStatus as Cr, unconfirmedTeardowns as Ct, workerCancelRequestsFile as D, exactSession as Di, mintRetainedIdentity as Dn, abandonablePending as Dr, scopeRetainedOwnerResourceReader as Dt, supervisorRunsRoot as E, awaitAbortable$1 as Ei, assertRetainedRunReplayMaterial as En, HarnessTurnFailedError as Er, releaseScopeRetainedOwnerForSeatPause as Et, createWorkerSlots as F, prepareInteractiveDelegation as Fn, SeatChain as Fr, scopeRetainedOwnerPriorSpend as Ft, attachWorker as G, createPropagatingTraceEmitter as Gn, verdictFromJudgeScore as Gr, scopeOwnerExecutorNodeContext as Gt, workerTraceAnalysisStore as H, WORKER_TRACE_PROPAGATION as Hn, gateFactoryOnDeliverable as Hr, recordScopeOwnerMaterialization as Ht, openSlotGroup as I, FileObserverJournal as In, SeatPauseError as Ir, scopeRetainedOwnerResult as It, recoverRetainedInteractiveRun as J, buildLoopOtelSpans as Jn, attestRuntimeOwnedPendingExecutor as Jr, providerVisibleProfile as Jt, readWorkerInteractiveBinding as K, mergeTraceEnv as Kn, attestRuntimeOwnedDeferredExecutor as Kr, coordinationMcpAlias as Kt, resolveWorkerSlots as L, createFileObserverHooks as Ln, authoredSeatStages as Lr, beginScopeOwnerAttempt as Lt, writeWorkerSteer as M, promptOptionsFromAgentTurnInput as Mi, retainedCreateMaterial as Mn, undispatchedCredentialExit as Mr, abandonScopeRetainedOwnerInvocation as Mt, writeWorkerSteerAcknowledgement as N, providerMessageText as Ni, acceptedInteractiveControl as Nn, upstreamUnavailableSignal as Nr, consumeScopeRetainedOwnerResult as Nt, workerCancellationsDir as O, freezeControlRef as Oi, reconnectRetainedRun as On, classifyDriverFailure as Or, environmentReader as Ot, writeWorkerSteerAsync as P, offerInteractiveControl as Pn, SEAT_RECHECK_MS as Pr, prepareScopeRetainedOwnerTask as Pt, spawnJournalRecordEvents as Q, createOtelExporter as Qn, finalizeRuntimeOwnedPendingExecutor as Qr, scopeRetainedOwnerTurnEnded as Qt, prepareScopeResume as R, observerRecordDigest as Rn, seatExecutionProfile as Rr, finalizeScopeOwnerMaterialization as Rt, readWorkerSteerAcknowledgement as S, runtimeFlowAgent as Si, describeRetainedNativeStops as Sn, readWorkerProgress as Sr, startScopeRecoveries as St, supervisorRunDir as T, assertEventBinding as Ti, RetainedMaterializationTimeoutError as Tn, DriverAttemptsExhaustedError as Tr, prepareScopeRetainedOwnerSeatSwitch as Tt, nestedScopeSeamKey as U, workerTraceEnv as Un, gateOnDeliverable as Ur, restoreScopeOwnerAcceptedExecution as Ut, parseWorkerToolTraceArtifact as V, environmentGone as Vn, CheckUnavailableError as Vr, recordScopeOwnerHarnessTranscript as Vt, interactiveAdmissionSeamKey as W, workerTraceHeaders as Wn, mapExecutorResult as Wr, scopeOwnerExecutionObservation as Wt, FileSpawnJournal as X, buildRuntimeEventOtelSpans as Xn, authoredAgentIdentity as Xr, beginScopeRetainedOwnerDrive as Xt, startRetainedInteractiveRun as Y, buildLoopSpanNodes as Yn, attestRuntimeOwnedScopeOwner as Yr, runtimeGraphMetadataKey as Yt, appendSpawnEvents as Z, createOpenInferenceFileExporter as Zn, authoredProfileDigest as Zr, scopeRetainedOwnerSettled as Zt, fileEscalateQuestion as _, unknownMaterializationReceipt as _i, insideCursorNamespace as _n, resolveHarnessTranscriptCapture as _r, registerNestedTeardownScope as _t, closeStreamFile as a, recordRuntimeOwnedProviderAttemptStart as ai, bindScopeRetainedOwnerProvider as an, sanitizeRuntimeStreamEvent as ar, queueOf as at, readWorkerCancelRequests as b, isRuntimeFlowBrain as bi, observeModelRequest as bn, createActivityLog as br, retryUnconfirmedTeardowns as bt, openStreamFileFenced as c, recordRuntimeOwnedProviderModel as ci, scopeRetainedOwnerContext as cn, captureHarnessTranscript as cr, closeRetainedSlots as ct, syncStreamFileFenced as d, runtimeOwnedExecutorMaterialization as di, ownedTreeRootSpawn as dn, harnessTranscriptUnavailable as dr, meterRuntimeOwnedAccounting as dt, knownExecutionBindingReceipt as ei, reconcileScopeRetainedOwnerEnvironment as en, generateSpanId as er, reenteredWorkers as et, writeStreamLinesFenced as f, runtimeOwnedExecutorProviderEvidence as fi, materializeTreeView as fn, persistHarnessTranscript as fr, meterRuntimeOwnedProviderAttempt as ft, claimWorkerSteerDelivery as g, unknownExecutionBindingReceipt as gi, SpawnEventIndex as gn, readBoundHarnessSessions$1 as gr, recordScopeOwnerPause as gt, cancelWorker as h, runtimeOwnedScopeOwnerRuntime as hi, nestedDriverTreeRoot as hn, HARNESS_TRANSCRIPT_READ_LIMITS as hr, recordScopeOwnerDriverAttempt as ht, ROOT_STREAM_FILE as i, recordRuntimeOwnedDriveHarnessProviderEvidence as ii, bindScopeRetainedOwnerEnvironmentId as in, sanitizeKnowledgeReadinessReport as ir, freeSlots as it, writeWorkerCancellation as j, promptFromAgentTurnInput as ji, startRetainedRunInEnvironment as jn, transientFailureKind as jr, keepScopeRetainedOwnerRestorePoint as jt, workerInboxFileFromEventDir as k, retainedSessionReplaced as ki, recoverRetainedRun as kn, spentCreateKey as kr, resolveSpawnResourcePaths as kt, readRootStream as l, runtimeOwnedDriveHarnessProviderEvidence as li, scopeRetainedOwnerJournalRoot as ln, harnessTranscriptArtifact as lr, closeScopeAdmission as lt, appendWorkerControlEventAsync as m, runtimeOwnedScopeOwnerControl as mi, driverRuntime as mn, settleHarnessTranscript as mr, recordScopeOwnerBarrenPause as mt, terminalAccounting as n, newExecutionAttemptId as ni, noteScopeRetainedOwnerCoordination as nn, createRuntimeEventCollector as nr, assertRecursiveReservationPolicy as nt, createRootStreamSink as o, recordRuntimeOwnedProviderDispatchNotStarted as oi, owners as on, HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS as or, rollingDispatch as ot, appendWorkerControlEvent as p, runtimeOwnedPendingExecutorMaterialization as pi, attestNestedDriverTreeOwner as pn, readHarnessTranscript as pr, pauseScopeSeatAdmission as pt, reconnectRetainedInteractiveRun as q, readTraceContextFromEnv as qn, attestRuntimeOwnedExecutor as qr, coordinationProfileToolPrefix as qt, createScope as r, providerAttemptEvidence as ri, scopeRetainedOwnerCheckpointing as rn, createRuntimeStreamEventCollector as rr, deriveNodeExecutionIdentity as rt, nodeStreamFile as s, recordRuntimeOwnedProviderIdentityConflict as si, scopeOwnerLiabilities as sn, captureBoundHarnessTranscript as sr, boundRetainedReleases as st, isNonEmptySpend as t, knownMaterializationReceipt as ti, scopeRetainedOwnerRestorePoint as tn, loopEventToOtelSpan as tr, settledToIteration as tt, readRootStreamReceipt as u, runtimeOwnedExecutorExecutionBinding as ui, loadSpawnForest as un, harnessTranscriptFromLines as ur, hasRetriableTeardowns as ut, legacySupervisorRunDir as v, executableAgentProfileSnapshot as vi, executorObservation as vn, retainHarnessTranscript as vr, releaseHeldEnvironments as vt, safeWorkerFile as w, RetainedRunProviderContractError as wi, verifyWorkspaceMarker as wn, isTerminalNodeStatus as wr, waitForScopeChildren as wt, readWorkerCancellation as x, runtimeCheckFactory as xi, NATIVE_STOP_UNCONFIRMED as xn, describeToolArgs as xr, settleManagerWork as xt, legacySupervisorRunsRoot as y, executableAgentSpecSnapshot as yi, executorObservationSeamKey as yn, DEFAULT_STALL_AFTER_MS as yr, releaseRetainedEnvironments as yt, replaySpawnTree as z, verifyObserverRecords as zn, subscriptionUsageLimitSignal as zr, holdScopeOwnerTranscript as zt };
|
|
14899
14976
|
|
|
14900
|
-
//# sourceMappingURL=supervisor-accounting-
|
|
14977
|
+
//# sourceMappingURL=supervisor-accounting-B0ofgTZX.js.map
|