@tangle-network/agent-runtime 0.249.1 → 0.252.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.
- package/dist/{activation-CZz7kkgd.d.ts → activation-CVMjsBM2.d.ts} +2 -2
- package/dist/{activation-ygjQvYwG.js → activation-CXrrtB5m.js} +3 -3
- package/dist/{activation-ygjQvYwG.js.map → activation-CXrrtB5m.js.map} +1 -1
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/bundle-DXrBPEFw.js +17 -0
- package/dist/bundle-DXrBPEFw.js.map +1 -0
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{coordination-driver-B61Hh6B1.js → coordination-driver-D_LHrYiF.js} +21 -8
- package/dist/coordination-driver-D_LHrYiF.js.map +1 -0
- package/dist/{delegate-A6EYmMxy.js → delegate-C8qzIpfB.js} +2 -2
- package/dist/{delegate-A6EYmMxy.js.map → delegate-C8qzIpfB.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +2 -2
- package/dist/{graph-CXwmMtTx.js → graph-xWtpPhOj.js} +3 -3
- package/dist/{graph-CXwmMtTx.js.map → graph-xWtpPhOj.js.map} +1 -1
- package/dist/{improvement-cycle-B049YmQ8.js → improvement-cycle-blUuLwtN.js} +5 -5
- package/dist/{improvement-cycle-B049YmQ8.js.map → improvement-cycle-blUuLwtN.js.map} +1 -1
- package/dist/{index-BV5EmjCL.d.ts → index-BOyxiPdv.d.ts} +16 -8
- package/dist/index.d.ts +6 -6
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +3 -3
- package/dist/intelligence.js +6 -6
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +9 -9
- package/dist/{loop-runner-bin-q0akFXYX.d.ts → loop-runner-bin-CEjfP-9b.d.ts} +3 -3
- package/dist/{loop-runner-bin-C1O16oIq.js → loop-runner-bin-HOQO-Bc5.js} +3 -3
- package/dist/{loop-runner-bin-C1O16oIq.js.map → loop-runner-bin-HOQO-Bc5.js.map} +1 -1
- 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 +5 -5
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-zrajPyXe.d.ts → openai-tools-8E1xkqPd.d.ts} +2 -2
- package/dist/{prepare-CibQrhfi.js → prepare-RuaAclli.js} +8 -598
- package/dist/prepare-RuaAclli.js.map +1 -0
- package/dist/profiles.d.ts +2 -2
- package/dist/{protected-model-port-Dhdi5mDl.js → protected-model-port-BFhSgMAy.js} +3 -3
- package/dist/{protected-model-port-Dhdi5mDl.js.map → protected-model-port-BFhSgMAy.js.map} +1 -1
- package/dist/{protected-redaction-Fn1ETfJ-.js → protected-redaction--F3v1oo8.js} +3 -54
- package/dist/protected-redaction--F3v1oo8.js.map +1 -0
- package/dist/{provision-supervisor-D7gC-Veu.js → provision-supervisor-D72s82K_.js} +4 -4
- package/dist/{provision-supervisor-D7gC-Veu.js.map → provision-supervisor-D72s82K_.js.map} +1 -1
- package/dist/{run-layout-hKAJGF4g.js → run-layout-vwd4SwX_.js} +15 -9
- package/dist/run-layout-vwd4SwX_.js.map +1 -0
- package/dist/{runtime-BVZIbtyL.js → runtime-DuE9T9fQ.js} +11 -10
- package/dist/{runtime-BVZIbtyL.js.map → runtime-DuE9T9fQ.js.map} +1 -1
- package/dist/{server-DHS1Gxt2.js → server-BRcoetaI.js} +3 -3
- package/dist/{server-DHS1Gxt2.js.map → server-BRcoetaI.js.map} +1 -1
- package/dist/{stream-agent-turn-D9IbZMys.d.ts → stream-agent-turn-vHFw9Cjl.d.ts} +32 -5
- package/dist/{structural-rollout-z1A0okaB.js → structural-rollout-DwklJEOU.js} +2 -2
- package/dist/{structural-rollout-z1A0okaB.js.map → structural-rollout-DwklJEOU.js.map} +1 -1
- package/dist/{substrate-Ctmos75o.d.ts → substrate-Dtw3KmTi.d.ts} +2 -2
- package/dist/{supervise-CnFk7_wb.js → supervise-IBkXPk1z.js} +10 -6
- package/dist/supervise-IBkXPk1z.js.map +1 -0
- package/dist/{supervisor-BIBWUFUr.js → supervisor-BlDW3u0y.js} +460 -191
- package/dist/supervisor-BlDW3u0y.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +14 -14
- package/dist/{top-app-d-bmwO7O.js → top-app-VAOrBskv.js} +2 -2
- package/dist/{top-app-d-bmwO7O.js.map → top-app-VAOrBskv.js.map} +1 -1
- package/dist/tui/bin.js +1 -1
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-BmxS-W-f.d.ts → types-DKeaex8Q.d.ts} +5 -1
- package/dist/workspace-archive-DQGFwvM6.js +1209 -0
- package/dist/workspace-archive-DQGFwvM6.js.map +1 -0
- package/package.json +1 -1
- package/dist/coordination-driver-B61Hh6B1.js.map +0 -1
- package/dist/prepare-CibQrhfi.js.map +0 -1
- package/dist/protected-redaction-Fn1ETfJ-.js.map +0 -1
- package/dist/run-layout-hKAJGF4g.js.map +0 -1
- package/dist/supervise-CnFk7_wb.js.map +0 -1
- package/dist/supervisor-BIBWUFUr.js.map +0 -1
- package/dist/workspace-archive-DSRT4Tro.js +0 -572
- package/dist/workspace-archive-DSRT4Tro.js.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { c as RetainedInteractiveAdmissionError, d as RetainedRunDispatchBindingError, f as RuntimeRunStateError, i as ConfigError, l as RetainedInteractiveBindingError, m as ValidationError$1, r as BackendTransportError, t as AgentEvalError$1, u as RetainedRunAdmissionError } from "./errors-DodWX-cb.js";
|
|
2
2
|
import { a as concreteProfileModel, c as profileModelExecutionSettings, d as agentHarness, l as profileProviderModel, o as enforceTokenLimits, s as profileBridgeWireModel, t as assertExecutableAgentProfile, u as resolveRouterRetryPolicy } from "./model-policy-BbSCSak0.js";
|
|
3
|
+
import { b as verifyWorkspaceSnapshotArtifacts, i as verifyAgentCandidateWorkspaceArchive } from "./workspace-archive-DQGFwvM6.js";
|
|
3
4
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
|
|
4
5
|
import { n as assertNoSymlinkDescendant, r as publishExclusiveDurableFile } from "./durable-file-DWQA4ooo.js";
|
|
5
|
-
import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStartSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentNativeContextContinuationResultSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnInputSchema, AgentTurnResultSchema, CanonicalStreamEventSchema, ContextTransferRequestSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, REASONING_EFFORTS, RuntimeEventEnvelopeSchema, TerminalReplayWindowSchema, TerminalSessionRefSchema, WorkspaceRequestSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalWorkspaceCwd, exactAgentInteractiveSessionStart, harnessSystemPromptIntents, harnessTypeSchema, nativeContextContinuationTurnDigest, nativeReasoningControl, profileMaterializationAxes, profileMaterializationAxes as profileMaterializationAxes$1, renderInputPartsAsText, sha256DigestSchema, workspaceCwdPathForBase } from "@tangle-network/agent-interface";
|
|
6
|
+
import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStartSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentNativeContextContinuationResultSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnInputSchema, AgentTurnResultSchema, CanonicalStreamEventSchema, ContextTransferRequestSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, REASONING_EFFORTS, RuntimeEventEnvelopeSchema, TerminalReplayWindowSchema, TerminalSessionRefSchema, WorkspaceRequestSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalWorkspaceCwd, exactAgentInteractiveSessionStart, harnessSystemPromptIntents, harnessTypeSchema, nativeContextContinuationTurnDigest, nativeReasoningControl, profileMaterializationAxes, profileMaterializationAxes as profileMaterializationAxes$1, renderInputPartsAsText, sha256DigestSchema, workspaceCwdPathForBase } from "@tangle-network/agent-interface";
|
|
6
7
|
import { estimateCost, isModelPriced, isToolSpan, toolSpansToTraceAnalysisStore } from "@tangle-network/agent-eval";
|
|
7
8
|
import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
|
|
8
9
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -6289,6 +6290,184 @@ function resolveRedactor(redact) {
|
|
|
6289
6290
|
return (value) => defaultRedactor(redact(value));
|
|
6290
6291
|
}
|
|
6291
6292
|
//#endregion
|
|
6293
|
+
//#region src/runtime/supervise/abortable.ts
|
|
6294
|
+
/** Provenance of an explicit cancellation, preserved through every abort link. */
|
|
6295
|
+
var RunCancellationReason = class extends Error {
|
|
6296
|
+
source;
|
|
6297
|
+
operationId;
|
|
6298
|
+
constructor(source, reason, operationId) {
|
|
6299
|
+
super(reason);
|
|
6300
|
+
this.source = source;
|
|
6301
|
+
this.operationId = operationId;
|
|
6302
|
+
this.name = "RunCancellationReason";
|
|
6303
|
+
}
|
|
6304
|
+
toString() {
|
|
6305
|
+
return this.message;
|
|
6306
|
+
}
|
|
6307
|
+
};
|
|
6308
|
+
/**
|
|
6309
|
+
* One abort race, and one abort cascade, for the supervision tree.
|
|
6310
|
+
*
|
|
6311
|
+
* Every layer that can be cancelled needs the same three things: the reason a signal
|
|
6312
|
+
* carries, an `AbortError` built from it, and a settle-once race between the work and
|
|
6313
|
+
* the signal. Written per layer, each drifts — a listener stops being removed on one
|
|
6314
|
+
* path, a late resolution overwrites a cancellation that already won, or a cascade
|
|
6315
|
+
* forwards no reason and renames every downstream death to the layer's own fallback.
|
|
6316
|
+
*
|
|
6317
|
+
* The fallback message is the only thing a layer supplies, so the error still names
|
|
6318
|
+
* which layer cancelled.
|
|
6319
|
+
*/
|
|
6320
|
+
/**
|
|
6321
|
+
* The reason a signal carries, or `fallback` when it states none.
|
|
6322
|
+
*
|
|
6323
|
+
* A cascade that drops the upstream reason turns every downstream death into its own generic
|
|
6324
|
+
* message: the worker's `down` record then says nothing about WHY, which makes a whole class of
|
|
6325
|
+
* child mortality undiagnosable from the journal alone.
|
|
6326
|
+
*/
|
|
6327
|
+
function abortReason(signal, fallback) {
|
|
6328
|
+
const reason = signal.reason;
|
|
6329
|
+
if (reason instanceof RunCancellationReason) return reason;
|
|
6330
|
+
if (typeof reason === "string" && reason.length > 0) return reason;
|
|
6331
|
+
if (reason instanceof Error && reason.name !== "AbortError" && reason.message.length > 0) return reason.message;
|
|
6332
|
+
return fallback;
|
|
6333
|
+
}
|
|
6334
|
+
/** An `AbortError` carrying the signal's own string reason, or `fallback` when it states none. */
|
|
6335
|
+
function abortError(signal, fallback) {
|
|
6336
|
+
const reason = abortReason(signal, fallback);
|
|
6337
|
+
const error = new Error(reason instanceof Error ? reason.message : typeof reason === "string" && reason.length > 0 ? reason : fallback);
|
|
6338
|
+
error.name = "AbortError";
|
|
6339
|
+
return error;
|
|
6340
|
+
}
|
|
6341
|
+
/**
|
|
6342
|
+
* Cascade N abort signals into one downstream abort that fires when ANY of them does, carrying
|
|
6343
|
+
* that signal's own reason ({@link abortReason}). Node-portable: `AbortSignal.any` needs >=20.3
|
|
6344
|
+
* and the package floor is >=20, and it would drop the reason anyway.
|
|
6345
|
+
*
|
|
6346
|
+
* The one cascade every executor uses, so a reason forwarded here reaches every layer below.
|
|
6347
|
+
*/
|
|
6348
|
+
function linkAbort(...sources) {
|
|
6349
|
+
const controller = new AbortController();
|
|
6350
|
+
const listeners = [];
|
|
6351
|
+
const release = () => {
|
|
6352
|
+
for (const { source, onAbort } of listeners) source.removeEventListener("abort", onAbort);
|
|
6353
|
+
listeners.length = 0;
|
|
6354
|
+
};
|
|
6355
|
+
const abort = (reason) => {
|
|
6356
|
+
release();
|
|
6357
|
+
controller.abort(reason);
|
|
6358
|
+
};
|
|
6359
|
+
const alreadyAborted = sources.find((source) => source.aborted);
|
|
6360
|
+
if (alreadyAborted !== void 0) {
|
|
6361
|
+
controller.abort(abortReason(alreadyAborted, "aborted by parent scope"));
|
|
6362
|
+
return {
|
|
6363
|
+
signal: controller.signal,
|
|
6364
|
+
abort,
|
|
6365
|
+
release
|
|
6366
|
+
};
|
|
6367
|
+
}
|
|
6368
|
+
for (const source of sources) {
|
|
6369
|
+
const onAbort = () => abort(abortReason(source, "aborted by parent scope"));
|
|
6370
|
+
listeners.push({
|
|
6371
|
+
source,
|
|
6372
|
+
onAbort
|
|
6373
|
+
});
|
|
6374
|
+
source.addEventListener("abort", onAbort, { once: true });
|
|
6375
|
+
}
|
|
6376
|
+
return {
|
|
6377
|
+
signal: controller.signal,
|
|
6378
|
+
abort,
|
|
6379
|
+
release
|
|
6380
|
+
};
|
|
6381
|
+
}
|
|
6382
|
+
/**
|
|
6383
|
+
* Settle `act()` against `signal`. The first outcome wins and the listener is always
|
|
6384
|
+
* removed, so neither a late resolution nor a late abort can settle the promise twice.
|
|
6385
|
+
* The losing promise stays observed, so a late rejection cannot surface as an unhandled
|
|
6386
|
+
* process error.
|
|
6387
|
+
*
|
|
6388
|
+
* The abort rejection is deferred one microtask so a result the action had ALREADY
|
|
6389
|
+
* produced still wins. It does not hand the race to a listener the action registers
|
|
6390
|
+
* from inside `act()`: this function subscribes before it calls `act()`, so its own
|
|
6391
|
+
* abort handler runs first and settles the promise. A caller that must let the action
|
|
6392
|
+
* observe the abort itself has to hold a live promise and await that instead.
|
|
6393
|
+
*
|
|
6394
|
+
* A synchronous throw from `act()` propagates as the rejection, not as an abort.
|
|
6395
|
+
*/
|
|
6396
|
+
async function runAbortable(act, signal, fallback) {
|
|
6397
|
+
if (signal.aborted) throw abortError(signal, fallback);
|
|
6398
|
+
return await new Promise((resolve, reject) => {
|
|
6399
|
+
let settled = false;
|
|
6400
|
+
const cleanup = () => signal.removeEventListener("abort", onAbort);
|
|
6401
|
+
const onAbort = () => {
|
|
6402
|
+
queueMicrotask(() => {
|
|
6403
|
+
if (settled) return;
|
|
6404
|
+
settled = true;
|
|
6405
|
+
cleanup();
|
|
6406
|
+
reject(abortError(signal, fallback));
|
|
6407
|
+
});
|
|
6408
|
+
};
|
|
6409
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
6410
|
+
let work;
|
|
6411
|
+
try {
|
|
6412
|
+
work = Promise.resolve(act());
|
|
6413
|
+
} catch (error) {
|
|
6414
|
+
cleanup();
|
|
6415
|
+
reject(error);
|
|
6416
|
+
return;
|
|
6417
|
+
}
|
|
6418
|
+
work.then((value) => {
|
|
6419
|
+
if (settled) return;
|
|
6420
|
+
settled = true;
|
|
6421
|
+
cleanup();
|
|
6422
|
+
resolve(value);
|
|
6423
|
+
}, (error) => {
|
|
6424
|
+
if (settled) return;
|
|
6425
|
+
settled = true;
|
|
6426
|
+
cleanup();
|
|
6427
|
+
reject(error);
|
|
6428
|
+
});
|
|
6429
|
+
});
|
|
6430
|
+
}
|
|
6431
|
+
//#endregion
|
|
6432
|
+
//#region src/runtime/provider-workspace-retention.ts
|
|
6433
|
+
/** Validate the executable retention port at the create boundary. */
|
|
6434
|
+
function assertProviderWorkspaceRetentionPort(port, context) {
|
|
6435
|
+
if (!Number.isSafeInteger(port.timeoutMs) || port.timeoutMs <= 0) throw new ValidationError$1(`${context}: workspaceRetention.timeoutMs must be a positive safe integer`);
|
|
6436
|
+
if (port.artifacts === null || typeof port.artifacts?.read !== "function") throw new ValidationError$1(`${context}: workspaceRetention.artifacts.read is required`);
|
|
6437
|
+
if (typeof port.capture !== "function") throw new ValidationError$1(`${context}: workspaceRetention.capture is required`);
|
|
6438
|
+
}
|
|
6439
|
+
/** Capture, require durable refs, and verify every returned manifest/archive byte. */
|
|
6440
|
+
async function captureProviderWorkspaceSnapshot(port, context) {
|
|
6441
|
+
assertProviderWorkspaceRetentionPort(port, "provider workspace retention");
|
|
6442
|
+
const controller = new AbortController();
|
|
6443
|
+
const clearDeadline = armDeadlineTimer(port.timeoutMs, () => controller.abort(/* @__PURE__ */ new Error(`provider workspace retention timed out after ${port.timeoutMs}ms`)), true);
|
|
6444
|
+
try {
|
|
6445
|
+
return await runAbortable(async () => {
|
|
6446
|
+
const result = detachedSnapshot(await port.capture({
|
|
6447
|
+
...context,
|
|
6448
|
+
signal: controller.signal
|
|
6449
|
+
}), "provider workspace retention snapshot");
|
|
6450
|
+
requireDurableWorkspaceArtifacts(result);
|
|
6451
|
+
const { archive } = await verifyWorkspaceSnapshotArtifacts(result, port.artifacts);
|
|
6452
|
+
await verifyAgentCandidateWorkspaceArchive({
|
|
6453
|
+
role: "candidate",
|
|
6454
|
+
snapshot: result,
|
|
6455
|
+
archive
|
|
6456
|
+
});
|
|
6457
|
+
return result;
|
|
6458
|
+
}, controller.signal, `provider workspace retention timed out after ${port.timeoutMs}ms`);
|
|
6459
|
+
} finally {
|
|
6460
|
+
clearDeadline();
|
|
6461
|
+
}
|
|
6462
|
+
}
|
|
6463
|
+
/** Native checkpoints, embedded bytes, and digest-only values cannot outlive their source. */
|
|
6464
|
+
function requireDurableWorkspaceArtifacts(snapshot) {
|
|
6465
|
+
if (!isDurableArtifact(snapshot.manifest) || !isDurableArtifact(snapshot.archive)) throw new Error("provider workspace retention requires durable manifest and archive artifact references");
|
|
6466
|
+
}
|
|
6467
|
+
function isDurableArtifact(artifact) {
|
|
6468
|
+
return "locator" in artifact;
|
|
6469
|
+
}
|
|
6470
|
+
//#endregion
|
|
6292
6471
|
//#region src/runtime/interaction-capabilities.ts
|
|
6293
6472
|
/**
|
|
6294
6473
|
* Check one turn's interaction request before the provider can dispatch it.
|
|
@@ -7150,145 +7329,6 @@ function assertRetainedCapabilityRequirements(providerName, capabilities) {
|
|
|
7150
7329
|
if (retained?.exactRunIdentity !== true || retained.resultIdentity !== true || retained.eventIdentity !== true || retained.cancellationIdempotency !== true || !capabilities.streaming.detach || !capabilities.streaming.replay || !capabilities.streaming.turnIdempotency) throw new Error(`provider "${providerName}" cannot control a retry-safe retained run`);
|
|
7151
7330
|
}
|
|
7152
7331
|
//#endregion
|
|
7153
|
-
//#region src/runtime/supervise/abortable.ts
|
|
7154
|
-
/** Provenance of an explicit cancellation, preserved through every abort link. */
|
|
7155
|
-
var RunCancellationReason = class extends Error {
|
|
7156
|
-
source;
|
|
7157
|
-
operationId;
|
|
7158
|
-
constructor(source, reason, operationId) {
|
|
7159
|
-
super(reason);
|
|
7160
|
-
this.source = source;
|
|
7161
|
-
this.operationId = operationId;
|
|
7162
|
-
this.name = "RunCancellationReason";
|
|
7163
|
-
}
|
|
7164
|
-
toString() {
|
|
7165
|
-
return this.message;
|
|
7166
|
-
}
|
|
7167
|
-
};
|
|
7168
|
-
/**
|
|
7169
|
-
* One abort race, and one abort cascade, for the supervision tree.
|
|
7170
|
-
*
|
|
7171
|
-
* Every layer that can be cancelled needs the same three things: the reason a signal
|
|
7172
|
-
* carries, an `AbortError` built from it, and a settle-once race between the work and
|
|
7173
|
-
* the signal. Written per layer, each drifts — a listener stops being removed on one
|
|
7174
|
-
* path, a late resolution overwrites a cancellation that already won, or a cascade
|
|
7175
|
-
* forwards no reason and renames every downstream death to the layer's own fallback.
|
|
7176
|
-
*
|
|
7177
|
-
* The fallback message is the only thing a layer supplies, so the error still names
|
|
7178
|
-
* which layer cancelled.
|
|
7179
|
-
*/
|
|
7180
|
-
/**
|
|
7181
|
-
* The reason a signal carries, or `fallback` when it states none.
|
|
7182
|
-
*
|
|
7183
|
-
* A cascade that drops the upstream reason turns every downstream death into its own generic
|
|
7184
|
-
* message: the worker's `down` record then says nothing about WHY, which makes a whole class of
|
|
7185
|
-
* child mortality undiagnosable from the journal alone.
|
|
7186
|
-
*/
|
|
7187
|
-
function abortReason(signal, fallback) {
|
|
7188
|
-
const reason = signal.reason;
|
|
7189
|
-
if (reason instanceof RunCancellationReason) return reason;
|
|
7190
|
-
if (typeof reason === "string" && reason.length > 0) return reason;
|
|
7191
|
-
if (reason instanceof Error && reason.name !== "AbortError" && reason.message.length > 0) return reason.message;
|
|
7192
|
-
return fallback;
|
|
7193
|
-
}
|
|
7194
|
-
/** An `AbortError` carrying the signal's own string reason, or `fallback` when it states none. */
|
|
7195
|
-
function abortError(signal, fallback) {
|
|
7196
|
-
const reason = abortReason(signal, fallback);
|
|
7197
|
-
const error = new Error(reason instanceof Error ? reason.message : typeof reason === "string" && reason.length > 0 ? reason : fallback);
|
|
7198
|
-
error.name = "AbortError";
|
|
7199
|
-
return error;
|
|
7200
|
-
}
|
|
7201
|
-
/**
|
|
7202
|
-
* Cascade N abort signals into one downstream abort that fires when ANY of them does, carrying
|
|
7203
|
-
* that signal's own reason ({@link abortReason}). Node-portable: `AbortSignal.any` needs >=20.3
|
|
7204
|
-
* and the package floor is >=20, and it would drop the reason anyway.
|
|
7205
|
-
*
|
|
7206
|
-
* The one cascade every executor uses, so a reason forwarded here reaches every layer below.
|
|
7207
|
-
*/
|
|
7208
|
-
function linkAbort(...sources) {
|
|
7209
|
-
const controller = new AbortController();
|
|
7210
|
-
const listeners = [];
|
|
7211
|
-
const release = () => {
|
|
7212
|
-
for (const { source, onAbort } of listeners) source.removeEventListener("abort", onAbort);
|
|
7213
|
-
listeners.length = 0;
|
|
7214
|
-
};
|
|
7215
|
-
const abort = (reason) => {
|
|
7216
|
-
release();
|
|
7217
|
-
controller.abort(reason);
|
|
7218
|
-
};
|
|
7219
|
-
const alreadyAborted = sources.find((source) => source.aborted);
|
|
7220
|
-
if (alreadyAborted !== void 0) {
|
|
7221
|
-
controller.abort(abortReason(alreadyAborted, "aborted by parent scope"));
|
|
7222
|
-
return {
|
|
7223
|
-
signal: controller.signal,
|
|
7224
|
-
abort,
|
|
7225
|
-
release
|
|
7226
|
-
};
|
|
7227
|
-
}
|
|
7228
|
-
for (const source of sources) {
|
|
7229
|
-
const onAbort = () => abort(abortReason(source, "aborted by parent scope"));
|
|
7230
|
-
listeners.push({
|
|
7231
|
-
source,
|
|
7232
|
-
onAbort
|
|
7233
|
-
});
|
|
7234
|
-
source.addEventListener("abort", onAbort, { once: true });
|
|
7235
|
-
}
|
|
7236
|
-
return {
|
|
7237
|
-
signal: controller.signal,
|
|
7238
|
-
abort,
|
|
7239
|
-
release
|
|
7240
|
-
};
|
|
7241
|
-
}
|
|
7242
|
-
/**
|
|
7243
|
-
* Settle `act()` against `signal`. The first outcome wins and the listener is always
|
|
7244
|
-
* removed, so neither a late resolution nor a late abort can settle the promise twice.
|
|
7245
|
-
* The losing promise stays observed, so a late rejection cannot surface as an unhandled
|
|
7246
|
-
* process error.
|
|
7247
|
-
*
|
|
7248
|
-
* The abort rejection is deferred one microtask so a result the action had ALREADY
|
|
7249
|
-
* produced still wins. It does not hand the race to a listener the action registers
|
|
7250
|
-
* from inside `act()`: this function subscribes before it calls `act()`, so its own
|
|
7251
|
-
* abort handler runs first and settles the promise. A caller that must let the action
|
|
7252
|
-
* observe the abort itself has to hold a live promise and await that instead.
|
|
7253
|
-
*
|
|
7254
|
-
* A synchronous throw from `act()` propagates as the rejection, not as an abort.
|
|
7255
|
-
*/
|
|
7256
|
-
async function runAbortable(act, signal, fallback) {
|
|
7257
|
-
if (signal.aborted) throw abortError(signal, fallback);
|
|
7258
|
-
return await new Promise((resolve, reject) => {
|
|
7259
|
-
let settled = false;
|
|
7260
|
-
const cleanup = () => signal.removeEventListener("abort", onAbort);
|
|
7261
|
-
const onAbort = () => {
|
|
7262
|
-
queueMicrotask(() => {
|
|
7263
|
-
if (settled) return;
|
|
7264
|
-
settled = true;
|
|
7265
|
-
cleanup();
|
|
7266
|
-
reject(abortError(signal, fallback));
|
|
7267
|
-
});
|
|
7268
|
-
};
|
|
7269
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
7270
|
-
let work;
|
|
7271
|
-
try {
|
|
7272
|
-
work = Promise.resolve(act());
|
|
7273
|
-
} catch (error) {
|
|
7274
|
-
cleanup();
|
|
7275
|
-
reject(error);
|
|
7276
|
-
return;
|
|
7277
|
-
}
|
|
7278
|
-
work.then((value) => {
|
|
7279
|
-
if (settled) return;
|
|
7280
|
-
settled = true;
|
|
7281
|
-
cleanup();
|
|
7282
|
-
resolve(value);
|
|
7283
|
-
}, (error) => {
|
|
7284
|
-
if (settled) return;
|
|
7285
|
-
settled = true;
|
|
7286
|
-
cleanup();
|
|
7287
|
-
reject(error);
|
|
7288
|
-
});
|
|
7289
|
-
});
|
|
7290
|
-
}
|
|
7291
|
-
//#endregion
|
|
7292
7332
|
//#region src/runtime/supervise/cost-estimate.ts
|
|
7293
7333
|
/**
|
|
7294
7334
|
* Pricing for work that arrived without a provider receipt.
|
|
@@ -7886,6 +7926,7 @@ function providerAsExecutor(provider, options = {}) {
|
|
|
7886
7926
|
};
|
|
7887
7927
|
}
|
|
7888
7928
|
function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
7929
|
+
if (options.workspaceRetention !== void 0) assertProviderWorkspaceRetentionPort(options.workspaceRetention, `providerAsExecutor(${provider.name})`);
|
|
7889
7930
|
const controller = new AbortController();
|
|
7890
7931
|
const node = ctx.node === void 0 ? void 0 : detachedSnapshot(ctx.node, "provider executor node");
|
|
7891
7932
|
let environment;
|
|
@@ -7895,10 +7936,131 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
7895
7936
|
let harnessTranscript = harnessTranscriptUnavailable("execution-never-started");
|
|
7896
7937
|
const retention = retainedExecutorContext(ctx);
|
|
7897
7938
|
let destroyed = false;
|
|
7939
|
+
let workspaceEnvironmentId;
|
|
7940
|
+
let workspaceSnapshot;
|
|
7941
|
+
let workspacePublishedSnapshot;
|
|
7942
|
+
let workspaceCaptureFailure;
|
|
7943
|
+
let workspaceCapturePromise;
|
|
7944
|
+
let workspaceCleanupPromise;
|
|
7945
|
+
let retainedReleasePromise;
|
|
7946
|
+
let workspaceOutcome;
|
|
7947
|
+
let workspacePreservationRequired = false;
|
|
7948
|
+
let workspaceRunActive = false;
|
|
7898
7949
|
const runtime = options.runtime ?? provider.name;
|
|
7899
7950
|
const createProfile = options.profileForCreate?.(profile) ?? profile;
|
|
7900
7951
|
if (placement && canonicalAgentProfileDigest(createProfile) !== canonicalAgentProfileDigest(profile)) throw new ValidationError("provider placement: profileForCreate cannot change the selected profile");
|
|
7901
7952
|
const executionId = retention?.executionId ?? node?.nodeId ?? `provider-run-${randomUUID()}`;
|
|
7953
|
+
const resetWorkspaceState = (next) => {
|
|
7954
|
+
if (workspaceEnvironmentId === next.id) return;
|
|
7955
|
+
workspaceEnvironmentId = next.id;
|
|
7956
|
+
workspaceSnapshot = void 0;
|
|
7957
|
+
workspacePublishedSnapshot = void 0;
|
|
7958
|
+
workspaceCaptureFailure = void 0;
|
|
7959
|
+
workspaceCapturePromise = void 0;
|
|
7960
|
+
workspaceCleanupPromise = void 0;
|
|
7961
|
+
retainedReleasePromise = void 0;
|
|
7962
|
+
workspaceOutcome = void 0;
|
|
7963
|
+
workspacePreservationRequired = false;
|
|
7964
|
+
destroyed = false;
|
|
7965
|
+
};
|
|
7966
|
+
const beginWorkspaceExecution = () => {
|
|
7967
|
+
if (workspaceRunActive) throw new ValidationError(`providerAsExecutor(${provider.name}): executor is already running`);
|
|
7968
|
+
if (options.workspaceRetention !== void 0) {
|
|
7969
|
+
if (workspacePreservationRequired) throw new ValidationError(`providerAsExecutor(${provider.name}): a prior failed execution has no retrievable workspace receipt; source remains preserved and this executor cannot be reused`);
|
|
7970
|
+
if (environment !== void 0 && !destroyed) throw new ValidationError(`providerAsExecutor(${provider.name}): the prior workspace environment is still live; teardown must release it before this executor can be reused`);
|
|
7971
|
+
}
|
|
7972
|
+
if (runtimeOwnedExecutorMaterialization(executor) !== void 0) throw new ValidationError(`providerAsExecutor(${provider.name}): this executor has already materialized; create a new executor for another run`);
|
|
7973
|
+
if (environment !== void 0 && destroyed) {
|
|
7974
|
+
environment = void 0;
|
|
7975
|
+
workspaceEnvironmentId = void 0;
|
|
7976
|
+
}
|
|
7977
|
+
workspaceRunActive = true;
|
|
7978
|
+
workspaceSnapshot = void 0;
|
|
7979
|
+
workspacePublishedSnapshot = void 0;
|
|
7980
|
+
workspaceCaptureFailure = void 0;
|
|
7981
|
+
workspaceCapturePromise = void 0;
|
|
7982
|
+
workspaceCleanupPromise = void 0;
|
|
7983
|
+
retainedReleasePromise = void 0;
|
|
7984
|
+
workspaceOutcome = void 0;
|
|
7985
|
+
workspacePreservationRequired = false;
|
|
7986
|
+
destroyed = false;
|
|
7987
|
+
};
|
|
7988
|
+
const captureWorkspace = async (next, outcome) => {
|
|
7989
|
+
const workspaceRetention = options.workspaceRetention;
|
|
7990
|
+
if (workspaceRetention === void 0) return void 0;
|
|
7991
|
+
resetWorkspaceState(next);
|
|
7992
|
+
if (workspaceSnapshot !== void 0) return workspaceSnapshot;
|
|
7993
|
+
if (workspaceCapturePromise === void 0) {
|
|
7994
|
+
workspaceOutcome = outcome;
|
|
7995
|
+
workspaceCapturePromise = captureProviderWorkspaceSnapshot(workspaceRetention, {
|
|
7996
|
+
environment: next,
|
|
7997
|
+
executionId,
|
|
7998
|
+
profile: createProfile,
|
|
7999
|
+
...outcome === void 0 ? {} : { outcome }
|
|
8000
|
+
}).then((snapshot) => {
|
|
8001
|
+
workspaceSnapshot = snapshot;
|
|
8002
|
+
return snapshot;
|
|
8003
|
+
}).catch((error) => {
|
|
8004
|
+
workspaceCaptureFailure = error;
|
|
8005
|
+
throw error;
|
|
8006
|
+
});
|
|
8007
|
+
}
|
|
8008
|
+
return await workspaceCapturePromise;
|
|
8009
|
+
};
|
|
8010
|
+
const workspaceFailureDetail = () => {
|
|
8011
|
+
const reason = workspaceCaptureFailure instanceof Error ? workspaceCaptureFailure.message : String(workspaceCaptureFailure ?? "capture was not accepted");
|
|
8012
|
+
return `providerAsExecutor(${provider.name}): workspace retention failed — ${reason}; source environment preserved`;
|
|
8013
|
+
};
|
|
8014
|
+
const destroyEnvironment = async (cleanupSignal) => {
|
|
8015
|
+
if (workspaceCleanupPromise !== void 0) return await workspaceCleanupPromise;
|
|
8016
|
+
const cleanupPromise = (async () => {
|
|
8017
|
+
const target = environment;
|
|
8018
|
+
if (target === void 0) return { destroyed: true };
|
|
8019
|
+
if (workspacePreservationRequired) return {
|
|
8020
|
+
destroyed: false,
|
|
8021
|
+
detail: "provider workspace retention: source preserved because execution failed before a retrievable settled workspace receipt existed"
|
|
8022
|
+
};
|
|
8023
|
+
if (options.workspaceRetention !== void 0) try {
|
|
8024
|
+
const currentSnapshot = await captureWorkspace(target, workspaceOutcome);
|
|
8025
|
+
if (workspacePublishedSnapshot !== void 0 && currentSnapshot !== void 0 && currentSnapshot.digest !== workspacePublishedSnapshot.digest) {
|
|
8026
|
+
workspacePreservationRequired = true;
|
|
8027
|
+
return {
|
|
8028
|
+
destroyed: false,
|
|
8029
|
+
detail: "provider workspace retention: live workspace changed after the published receipt; source preserved"
|
|
8030
|
+
};
|
|
8031
|
+
}
|
|
8032
|
+
} catch {
|
|
8033
|
+
return {
|
|
8034
|
+
destroyed: false,
|
|
8035
|
+
detail: workspaceFailureDetail()
|
|
8036
|
+
};
|
|
8037
|
+
}
|
|
8038
|
+
if (destroyed) return { destroyed: true };
|
|
8039
|
+
try {
|
|
8040
|
+
await awaitAbortable$1(Promise.resolve(target.destroy?.()), cleanupSignal);
|
|
8041
|
+
destroyed = true;
|
|
8042
|
+
return { destroyed: true };
|
|
8043
|
+
} catch (error) {
|
|
8044
|
+
return {
|
|
8045
|
+
destroyed: false,
|
|
8046
|
+
detail: `providerAsExecutor(${provider.name}): environment.destroy() failed — ${error instanceof Error ? error.message : String(error)}`
|
|
8047
|
+
};
|
|
8048
|
+
}
|
|
8049
|
+
})();
|
|
8050
|
+
let cleanupReference;
|
|
8051
|
+
cleanupReference = cleanupPromise.then((result) => {
|
|
8052
|
+
if (!result.destroyed && workspaceCleanupPromise === cleanupReference && !workspacePreservationRequired && workspaceCaptureFailure === void 0) {
|
|
8053
|
+
if (options.workspaceRetention !== void 0) {
|
|
8054
|
+
workspaceSnapshot = void 0;
|
|
8055
|
+
workspaceCapturePromise = void 0;
|
|
8056
|
+
}
|
|
8057
|
+
workspaceCleanupPromise = void 0;
|
|
8058
|
+
}
|
|
8059
|
+
return result;
|
|
8060
|
+
});
|
|
8061
|
+
workspaceCleanupPromise = cleanupReference;
|
|
8062
|
+
return await cleanupReference;
|
|
8063
|
+
};
|
|
7902
8064
|
const attemptId = node?.attemptId ?? newExecutionAttemptId(executionId);
|
|
7903
8065
|
const trace = createPushTraceSource({ runId: executionId });
|
|
7904
8066
|
const providerModel = concreteProfileModel(createProfile);
|
|
@@ -7947,6 +8109,7 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
7947
8109
|
};
|
|
7948
8110
|
let executor;
|
|
7949
8111
|
const run = async function* (task, signal, recovering = false) {
|
|
8112
|
+
beginWorkspaceExecution();
|
|
7950
8113
|
const linked = linkAbort(ctx.signal, signal, controller.signal);
|
|
7951
8114
|
try {
|
|
7952
8115
|
yield* streamProviderExecutor({
|
|
@@ -7969,6 +8132,7 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
7969
8132
|
},
|
|
7970
8133
|
onEnvironment: (env) => {
|
|
7971
8134
|
environment = env;
|
|
8135
|
+
resetWorkspaceState(env);
|
|
7972
8136
|
if (harnessTranscript.status === "unavailable" && harnessTranscript.reason === "execution-never-started") harnessTranscript = harnessTranscriptUnavailable("capture-did-not-run");
|
|
7973
8137
|
finalizeRuntimeOwnedPendingExecutor(executor, {
|
|
7974
8138
|
...plannedDeclaration,
|
|
@@ -7984,12 +8148,18 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
7984
8148
|
onHarnessTranscript: (next) => {
|
|
7985
8149
|
harnessTranscript = next;
|
|
7986
8150
|
},
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
}
|
|
8151
|
+
onUnsettledFailure: () => {
|
|
8152
|
+
workspacePreservationRequired = true;
|
|
8153
|
+
},
|
|
8154
|
+
onPublishedSnapshot: (snapshot) => {
|
|
8155
|
+
workspacePublishedSnapshot = snapshot;
|
|
8156
|
+
},
|
|
8157
|
+
captureWorkspace,
|
|
8158
|
+
destroyEnvironment
|
|
7990
8159
|
});
|
|
7991
8160
|
} finally {
|
|
7992
8161
|
linked.release();
|
|
8162
|
+
workspaceRunActive = false;
|
|
7993
8163
|
}
|
|
7994
8164
|
};
|
|
7995
8165
|
executor = {
|
|
@@ -8024,21 +8194,15 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
8024
8194
|
},
|
|
8025
8195
|
async teardown(_grace) {
|
|
8026
8196
|
controller.abort();
|
|
8197
|
+
if (options.workspaceRetention !== void 0 && workspaceRunActive) return {
|
|
8198
|
+
destroyed: false,
|
|
8199
|
+
detail: "provider workspace retention: source preserved while the execution is still active"
|
|
8200
|
+
};
|
|
8027
8201
|
if (pending) return {
|
|
8028
8202
|
destroyed: false,
|
|
8029
8203
|
detail: "retained execution requires reconciliation"
|
|
8030
8204
|
};
|
|
8031
|
-
|
|
8032
|
-
try {
|
|
8033
|
-
await environment.destroy?.();
|
|
8034
|
-
destroyed = true;
|
|
8035
|
-
return { destroyed: true };
|
|
8036
|
-
} catch (error) {
|
|
8037
|
-
return {
|
|
8038
|
-
destroyed: false,
|
|
8039
|
-
detail: `providerAsExecutor(${provider.name}): environment.destroy() failed — ${error instanceof Error ? error.message : String(error)}`
|
|
8040
|
-
};
|
|
8041
|
-
}
|
|
8205
|
+
return await destroyEnvironment();
|
|
8042
8206
|
},
|
|
8043
8207
|
async releaseRetained(signal) {
|
|
8044
8208
|
controller.abort();
|
|
@@ -8051,19 +8215,37 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
8051
8215
|
destroyed,
|
|
8052
8216
|
...detail === void 0 ? {} : { detail }
|
|
8053
8217
|
});
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8218
|
+
if (options.workspaceRetention !== void 0 && workspaceRunActive) return [receipt(false, "provider workspace retention: source preserved while execution is still active")];
|
|
8219
|
+
if (retainedReleasePromise !== void 0) return await retainedReleasePromise;
|
|
8220
|
+
const releasePromise = (async () => {
|
|
8221
|
+
try {
|
|
8222
|
+
const target = environment ?? (provider.get === void 0 ? void 0 : await awaitAbortable$1(provider.get(environmentId), signal));
|
|
8223
|
+
if (target === void 0) return [receipt(false, `providerAsExecutor(${provider.name}): no environment handle and the provider exposes no get()`)];
|
|
8224
|
+
if (target === null) {
|
|
8225
|
+
pending = false;
|
|
8226
|
+
destroyed = true;
|
|
8227
|
+
return [receipt(true)];
|
|
8228
|
+
}
|
|
8058
8229
|
if (target.destroy === void 0) return [receipt(false, `providerAsExecutor(${provider.name}): environment exposes no destroy()`)];
|
|
8059
|
-
|
|
8230
|
+
if (environment === void 0) {
|
|
8231
|
+
environment = target;
|
|
8232
|
+
resetWorkspaceState(target);
|
|
8233
|
+
}
|
|
8234
|
+
const result = await destroyEnvironment(signal);
|
|
8235
|
+
if (!result.destroyed) return [receipt(false, result.detail)];
|
|
8236
|
+
pending = false;
|
|
8237
|
+
return [receipt(true)];
|
|
8238
|
+
} catch (error) {
|
|
8239
|
+
return [receipt(false, `providerAsExecutor(${provider.name}): environment.destroy() failed — ${error instanceof Error ? error.message : String(error)}`)];
|
|
8060
8240
|
}
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
return
|
|
8066
|
-
}
|
|
8241
|
+
})();
|
|
8242
|
+
let releaseReference;
|
|
8243
|
+
releaseReference = releasePromise.then((receipts) => {
|
|
8244
|
+
if (retainedReleasePromise === releaseReference && !receipts.every((receipt) => receipt.destroyed) && !workspacePreservationRequired && workspaceCaptureFailure === void 0) retainedReleasePromise = void 0;
|
|
8245
|
+
return receipts;
|
|
8246
|
+
});
|
|
8247
|
+
retainedReleasePromise = releaseReference;
|
|
8248
|
+
return await releaseReference;
|
|
8067
8249
|
},
|
|
8068
8250
|
resultArtifact() {
|
|
8069
8251
|
if (!artifact) throw new ValidationError(`providerAsExecutor(${provider.name}): resultArtifact() read before stream drained`);
|
|
@@ -8117,12 +8299,12 @@ async function* streamProviderExecutor(args) {
|
|
|
8117
8299
|
let usd = 0;
|
|
8118
8300
|
let text = "";
|
|
8119
8301
|
let terminal = false;
|
|
8302
|
+
const failures = createProviderFailureLedger();
|
|
8120
8303
|
let settled;
|
|
8121
8304
|
let failure;
|
|
8122
8305
|
let failed = false;
|
|
8123
8306
|
try {
|
|
8124
8307
|
const toolParts = createSandboxToolPartState();
|
|
8125
|
-
const failures = createProviderFailureLedger();
|
|
8126
8308
|
for await (const event of source.events) {
|
|
8127
8309
|
archive.append(event);
|
|
8128
8310
|
text += textFromEnvironmentEvent(event);
|
|
@@ -8189,14 +8371,20 @@ async function* streamProviderExecutor(args) {
|
|
|
8189
8371
|
box: environmentAsSandboxInstance(environment, { requireTerminalEvent: args.options.requireTerminalEvent ?? true }),
|
|
8190
8372
|
signal: linked
|
|
8191
8373
|
});
|
|
8374
|
+
const retainedWorkspace = await args.captureWorkspace(environment, outcome);
|
|
8375
|
+
args.onPublishedSnapshot(retainedWorkspace);
|
|
8376
|
+
const settledResult = {
|
|
8377
|
+
...result,
|
|
8378
|
+
...retainedWorkspace === void 0 ? {} : { workspaceSnapshot: retainedWorkspace }
|
|
8379
|
+
};
|
|
8192
8380
|
settled = {
|
|
8193
8381
|
...result.outcome?.status === "failed" ? { outcome: {
|
|
8194
8382
|
success: false,
|
|
8195
8383
|
...result.outcome.error ? { error: result.outcome.error } : {},
|
|
8196
8384
|
...result.outcome.errorCode ? { errorCode: result.outcome.errorCode } : {}
|
|
8197
8385
|
} } : {},
|
|
8198
|
-
outRef: contentRef$1(`provider:${args.provider.name}`,
|
|
8199
|
-
out:
|
|
8386
|
+
outRef: contentRef$1(`provider:${args.provider.name}`, settledResult),
|
|
8387
|
+
out: settledResult,
|
|
8200
8388
|
...verdict ? { verdict } : {},
|
|
8201
8389
|
spent
|
|
8202
8390
|
};
|
|
@@ -8206,24 +8394,37 @@ async function* streamProviderExecutor(args) {
|
|
|
8206
8394
|
} catch (error) {
|
|
8207
8395
|
failure = source.retained ? new RetainedExecutionPendingError(error) : error;
|
|
8208
8396
|
failed = true;
|
|
8397
|
+
if (args.options.workspaceRetention !== void 0) args.onUnsettledFailure();
|
|
8398
|
+
const failureOutcome = failures.finish() ?? {
|
|
8399
|
+
success: false,
|
|
8400
|
+
status: "failed",
|
|
8401
|
+
error: error instanceof Error ? error.message : String(error),
|
|
8402
|
+
...linked.aborted ? { errorCode: "cancelled" } : {}
|
|
8403
|
+
};
|
|
8404
|
+
try {
|
|
8405
|
+
await args.captureWorkspace(environment, failureOutcome);
|
|
8406
|
+
} catch (captureError) {
|
|
8407
|
+
failure = captureError instanceof Error ? Object.assign(captureError, { cause: captureError.cause ?? failure }) : captureError;
|
|
8408
|
+
}
|
|
8209
8409
|
args.onHarnessTranscript(await captureHarnessTranscript(environment, args.profile.harness, linked));
|
|
8210
8410
|
} finally {
|
|
8211
|
-
if ((!source.retained || settled !== void 0 && !failed) && !(source.retained && args.retention?.preserveEnvironment) && (args.options.destroyOnSettle ?? true))
|
|
8212
|
-
await
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8411
|
+
if ((!source.retained || settled !== void 0 && !failed) && !(source.retained && args.retention?.preserveEnvironment) && (args.options.destroyOnSettle ?? true)) {
|
|
8412
|
+
const cleanup = await args.destroyEnvironment();
|
|
8413
|
+
if (!cleanup.destroyed) {
|
|
8414
|
+
const error = new Error(cleanup.detail ?? "provider environment teardown was not confirmed");
|
|
8415
|
+
if (settled !== void 0) args.onArtifact({
|
|
8416
|
+
...settled,
|
|
8417
|
+
teardown: {
|
|
8418
|
+
failed: true,
|
|
8419
|
+
error: error.message,
|
|
8420
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
8421
|
+
}
|
|
8422
|
+
});
|
|
8423
|
+
else if (!failed) {
|
|
8424
|
+
failure = error;
|
|
8425
|
+
failed = true;
|
|
8426
|
+
} else failure = failure instanceof Error ? Object.assign(failure, { cause: failure.cause ?? error }) : failure;
|
|
8427
|
+
}
|
|
8227
8428
|
}
|
|
8228
8429
|
}
|
|
8229
8430
|
if (failed) throw failure;
|
|
@@ -18690,7 +18891,7 @@ function snapshotExecutorConfig(config) {
|
|
|
18690
18891
|
});
|
|
18691
18892
|
}
|
|
18692
18893
|
case "provider": {
|
|
18693
|
-
const { provider, registry, profileForCreate, taskToTurn, validator, ...decisionData } = config;
|
|
18894
|
+
const { provider, registry, profileForCreate, taskToTurn, validator, workspaceRetention, ...decisionData } = config;
|
|
18694
18895
|
const snapshot = detachedSnapshot(decisionData, "createExecutor provider config");
|
|
18695
18896
|
const resolvedProvider = resolveAgentEnvironmentProvider(provider, registry);
|
|
18696
18897
|
return Object.freeze({
|
|
@@ -18698,7 +18899,8 @@ function snapshotExecutorConfig(config) {
|
|
|
18698
18899
|
provider: resolvedProvider,
|
|
18699
18900
|
...profileForCreate === void 0 ? {} : { profileForCreate },
|
|
18700
18901
|
...taskToTurn === void 0 ? {} : { taskToTurn },
|
|
18701
|
-
...validator === void 0 ? {} : { validator }
|
|
18902
|
+
...validator === void 0 ? {} : { validator },
|
|
18903
|
+
...workspaceRetention === void 0 ? {} : { workspaceRetention }
|
|
18702
18904
|
});
|
|
18703
18905
|
}
|
|
18704
18906
|
case "sandbox": {
|
|
@@ -18831,6 +19033,7 @@ function createExecutor(config) {
|
|
|
18831
19033
|
const originalSeam = readSeam(seamed, providerSeamKey, "provider");
|
|
18832
19034
|
const selected = originalSeam.steering ? selectProviderPlacement(spec.profile, originalSeam) : void 0;
|
|
18833
19035
|
const providerSeam = selected?.options ?? originalSeam;
|
|
19036
|
+
if (providerSeam.steering && providerSeam.workspaceRetention !== void 0) throw new ValidationError$1("createExecutor(provider, steering): workspaceRetention cannot be used with steering because the session-owned environment has no single-shot preservation barrier");
|
|
18834
19037
|
const provider = resolveAgentEnvironmentProvider(providerSeam.provider, providerSeam.registry);
|
|
18835
19038
|
if (providerSeam.steering) {
|
|
18836
19039
|
if (providerSeam.taskToTurn) throw new ValidationError$1("createExecutor(provider, steering): taskToTurn is not representable by the text-only steerable session");
|
|
@@ -20929,6 +21132,8 @@ async function resolveSpawnResourcePaths(profile, source) {
|
|
|
20929
21132
|
//#endregion
|
|
20930
21133
|
//#region src/runtime/supervise/retained-scope-owner.ts
|
|
20931
21134
|
const owners = /* @__PURE__ */ new WeakMap();
|
|
21135
|
+
/** @internal Scope construction carries this private policy to every nested owner scope. */
|
|
21136
|
+
const retainedOwnerWorkspaceRetentionSeamKey = "runtime.retainedOwnerWorkspaceRetention";
|
|
20932
21137
|
/** The scope owns these writers; provider adapters receive only the restricted context. */
|
|
20933
21138
|
function registerScopeRetainedOwner(scope, args) {
|
|
20934
21139
|
const events = args.priorEvents.filter((event) => "id" in event && event.id === args.nodeId);
|
|
@@ -20946,6 +21151,7 @@ function registerScopeRetainedOwner(scope, args) {
|
|
|
20946
21151
|
const state = {
|
|
20947
21152
|
args,
|
|
20948
21153
|
admissions,
|
|
21154
|
+
workspaceRetention: false,
|
|
20949
21155
|
nextSequence: () => ++sequence,
|
|
20950
21156
|
...taskEvent?.kind === "execution-input" ? {
|
|
20951
21157
|
taskRef: taskEvent.taskRef,
|
|
@@ -21014,6 +21220,11 @@ function bindScopeRetainedOwnerProvider(scope, provider) {
|
|
|
21014
21220
|
const state = owners.get(scope);
|
|
21015
21221
|
if (state) state.provider = provider;
|
|
21016
21222
|
}
|
|
21223
|
+
/** Bind the owner cleanup policy selected by its provider executor. */
|
|
21224
|
+
function bindScopeRetainedOwnerWorkspaceRetention(scope, enabled) {
|
|
21225
|
+
const state = owners.get(scope);
|
|
21226
|
+
if (state) state.workspaceRetention = enabled;
|
|
21227
|
+
}
|
|
21017
21228
|
/**
|
|
21018
21229
|
* Bind where the owner's CURRENT environment id can be read from. The drive harness supplies a
|
|
21019
21230
|
* resolver over its active executor's materialization receipt, which every provider path
|
|
@@ -21100,12 +21311,16 @@ async function releaseScopeRetainedOwnerEnvironment(scope) {
|
|
|
21100
21311
|
const events = await args.journal.loadTree(args.rootId) ?? [];
|
|
21101
21312
|
const released = new Set(events.flatMap((event) => event.kind === "environment-teardown" && event.id === args.nodeId && event.provider === provider.name && event.destroyed ? [event.environmentId] : []));
|
|
21102
21313
|
const environments = new Set(events.flatMap((event) => event.id === args.nodeId && event.kind === "execution-admitted" && event.admission.phase === "environment" ? [event.admission.environmentId] : []));
|
|
21314
|
+
const retentionFailures = state.workspaceRetention || events.some((event) => event.kind === "execution-input" && event.id === args.nodeId && event.workspaceRetention === true) ? await ownerWorkspaceRetentionFailures(events, args.nodeId, args.blobs) : /* @__PURE__ */ new Set();
|
|
21103
21315
|
let unconfirmed = false;
|
|
21104
21316
|
for (const environmentId of environments) {
|
|
21105
21317
|
if (released.has(environmentId)) continue;
|
|
21106
21318
|
let destroyed = false;
|
|
21107
21319
|
let detail;
|
|
21108
|
-
|
|
21320
|
+
if (retentionFailures.has(environmentId)) {
|
|
21321
|
+
detail = "provider workspace retention: source preserved because the owner execution has no verified workspace receipt";
|
|
21322
|
+
unconfirmed = true;
|
|
21323
|
+
} else try {
|
|
21109
21324
|
await runAbortable(async () => {
|
|
21110
21325
|
if (!provider.get) throw new Error("provider cannot reconstruct the retained environment");
|
|
21111
21326
|
const environment = await provider.get(environmentId);
|
|
@@ -21137,6 +21352,57 @@ async function releaseScopeRetainedOwnerEnvironment(scope) {
|
|
|
21137
21352
|
status: "done"
|
|
21138
21353
|
}] : [];
|
|
21139
21354
|
}
|
|
21355
|
+
/** Group owner admissions by input and require a verified workspace receipt before deletion. */
|
|
21356
|
+
async function ownerWorkspaceRetentionFailures(events, nodeId, blobs) {
|
|
21357
|
+
const attempts = [];
|
|
21358
|
+
let current;
|
|
21359
|
+
const flush = () => {
|
|
21360
|
+
if (current !== void 0) attempts.push(current);
|
|
21361
|
+
current = void 0;
|
|
21362
|
+
};
|
|
21363
|
+
for (const event of events) {
|
|
21364
|
+
if (!("id" in event) || event.id !== nodeId) continue;
|
|
21365
|
+
if (event.kind === "execution-input") {
|
|
21366
|
+
flush();
|
|
21367
|
+
current = { environmentIds: /* @__PURE__ */ new Set() };
|
|
21368
|
+
} else if (event.kind === "execution-admitted" && event.admission.phase === "environment") {
|
|
21369
|
+
if (current?.result !== void 0) flush();
|
|
21370
|
+
current ??= { environmentIds: /* @__PURE__ */ new Set() };
|
|
21371
|
+
current.environmentIds.add(event.admission.environmentId);
|
|
21372
|
+
} else if (event.kind === "execution-result") {
|
|
21373
|
+
current ??= { environmentIds: /* @__PURE__ */ new Set() };
|
|
21374
|
+
current.result = event;
|
|
21375
|
+
}
|
|
21376
|
+
}
|
|
21377
|
+
flush();
|
|
21378
|
+
const failures = /* @__PURE__ */ new Set();
|
|
21379
|
+
for (const attempt of attempts) {
|
|
21380
|
+
if (attempt.environmentIds.size === 0) continue;
|
|
21381
|
+
if (attempt.environmentIds.size > 1) {
|
|
21382
|
+
for (const environmentId of attempt.environmentIds) failures.add(environmentId);
|
|
21383
|
+
continue;
|
|
21384
|
+
}
|
|
21385
|
+
const result = attempt.result;
|
|
21386
|
+
if (result === void 0) {
|
|
21387
|
+
for (const environmentId of attempt.environmentIds) failures.add(environmentId);
|
|
21388
|
+
continue;
|
|
21389
|
+
}
|
|
21390
|
+
let output;
|
|
21391
|
+
try {
|
|
21392
|
+
output = await blobs.get(result.outRef);
|
|
21393
|
+
if (output === void 0 || contentAddress(output) !== result.outRef) throw new Error();
|
|
21394
|
+
} catch {
|
|
21395
|
+
output = void 0;
|
|
21396
|
+
}
|
|
21397
|
+
if (!hasDurableWorkspaceSnapshot(output !== null && typeof output === "object" ? output.workspaceSnapshot : void 0)) for (const environmentId of attempt.environmentIds) failures.add(environmentId);
|
|
21398
|
+
}
|
|
21399
|
+
return failures;
|
|
21400
|
+
}
|
|
21401
|
+
/** A stored result is deletion authority only when it names the durable archive capture wrote. */
|
|
21402
|
+
function hasDurableWorkspaceSnapshot(value) {
|
|
21403
|
+
const parsed = agentCandidateWorkspaceSnapshotEvidenceSchema.safeParse(value);
|
|
21404
|
+
return parsed.success && "locator" in parsed.data.manifest && "locator" in parsed.data.archive;
|
|
21405
|
+
}
|
|
21140
21406
|
/** Resume the original backend prompt; rebuilt coordination observations cannot replace it. */
|
|
21141
21407
|
async function prepareScopeRetainedOwnerTask(scope, task) {
|
|
21142
21408
|
const state = owners.get(scope);
|
|
@@ -21178,6 +21444,7 @@ async function prepareScopeRetainedOwnerTask(scope, task) {
|
|
|
21178
21444
|
kind: "execution-input",
|
|
21179
21445
|
id: args.nodeId,
|
|
21180
21446
|
taskRef,
|
|
21447
|
+
...state.workspaceRetention ? { workspaceRetention: true } : {},
|
|
21181
21448
|
seq: inputSequence,
|
|
21182
21449
|
at: new Date(args.now()).toISOString()
|
|
21183
21450
|
});
|
|
@@ -22529,6 +22796,7 @@ function createScope(args) {
|
|
|
22529
22796
|
priorEvents: args.resumeFrom?.events ?? [],
|
|
22530
22797
|
now
|
|
22531
22798
|
});
|
|
22799
|
+
bindScopeRetainedOwnerWorkspaceRetention(scope, args.seams[retainedOwnerWorkspaceRetentionSeamKey] === true);
|
|
22532
22800
|
return scope;
|
|
22533
22801
|
}
|
|
22534
22802
|
/** @internal Meter one Runtime-owned provider attempt into the durable scope journal. */
|
|
@@ -24593,7 +24861,7 @@ function describeRejection(error) {
|
|
|
24593
24861
|
function createSupervisor() {
|
|
24594
24862
|
let attached;
|
|
24595
24863
|
async function run(root, task, opts) {
|
|
24596
|
-
const { budget, rootIdentity, rootMaterialization, runId, journal: journalStore, blobs: blobStore, executors: executorRegistry, recoverExecutor, probes, maxDepth, maxLiveWorkers, maxRestarts, withinMs, childSettleGraceMs, resume, retainedAtSettlement: requestedRetainedAtSettlement, now: suppliedNow, signal, hooks, workerTrace, workerTraceUnpropagated, interactiveBindingDir } = opts;
|
|
24864
|
+
const { budget, rootIdentity, rootMaterialization, runId, journal: journalStore, blobs: blobStore, executors: executorRegistry, recoverExecutor, probes, maxDepth, maxLiveWorkers, maxRestarts, withinMs, childSettleGraceMs, resume, retainedAtSettlement: requestedRetainedAtSettlement, ownerWorkspaceRetention, now: suppliedNow, signal, hooks, workerTrace, workerTraceUnpropagated, interactiveBindingDir } = opts;
|
|
24597
24865
|
const input = detachedSnapshot({
|
|
24598
24866
|
task,
|
|
24599
24867
|
options: {
|
|
@@ -24608,6 +24876,7 @@ function createSupervisor() {
|
|
|
24608
24876
|
...childSettleGraceMs === void 0 ? {} : { childSettleGraceMs },
|
|
24609
24877
|
...resume === void 0 ? {} : { resume },
|
|
24610
24878
|
...requestedRetainedAtSettlement === void 0 ? {} : { retainedAtSettlement: requestedRetainedAtSettlement },
|
|
24879
|
+
...ownerWorkspaceRetention === void 0 ? {} : { ownerWorkspaceRetention },
|
|
24611
24880
|
...interactiveBindingDir === void 0 ? {} : { interactiveBindingDir }
|
|
24612
24881
|
}
|
|
24613
24882
|
}, "supervisor.run");
|
|
@@ -24719,7 +24988,7 @@ function createSupervisor() {
|
|
|
24719
24988
|
journal,
|
|
24720
24989
|
blobs: opts.blobs,
|
|
24721
24990
|
executors: opts.executors,
|
|
24722
|
-
seams: {},
|
|
24991
|
+
seams: { [retainedOwnerWorkspaceRetentionSeamKey]: ownerWorkspaceRetention === true },
|
|
24723
24992
|
depth: 0,
|
|
24724
24993
|
maxDepth: opts.maxDepth ?? defaultMaxDepth,
|
|
24725
24994
|
...opts.maxLiveWorkers !== void 0 ? { maxLiveWorkers: opts.maxLiveWorkers } : {},
|
|
@@ -25222,6 +25491,6 @@ function isNonEmptySpend(s) {
|
|
|
25222
25491
|
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);
|
|
25223
25492
|
}
|
|
25224
25493
|
//#endregion
|
|
25225
|
-
export { startRetainedInteractiveRun as $, withBudgetResources as $i, contentAddress as $n, writeAllBytes as $r, isPeerMailEnvelope as $t, validateWaitSpec as A, mapSandboxEvent as Ai, providerAsSandboxClient as An, localHarnessExecutable as Ar, workerTraceAnalysisStore as At, SPAWN_RESOURCE_PATH_MAX_BYTES as B, hasCompleteCacheBreakdown as Bi,
|
|
25494
|
+
export { startRetainedInteractiveRun as $, withBudgetResources as $i, contentAddress as $n, writeAllBytes as $r, isPeerMailEnvelope as $t, validateWaitSpec as A, mapSandboxEvent as Ai, providerAsSandboxClient as An, localHarnessExecutable as Ar, workerTraceAnalysisStore as At, SPAWN_RESOURCE_PATH_MAX_BYTES as B, hasCompleteCacheBreakdown as Bi, startRetainedRun as Bn, promptControlProfileMaterialization as Br, workerTraceEnv as Bt, restoreScopeOwnerAcceptedExecution as C, readSandboxOutcome as Ci, routerBrain as Cn, runWorktreeHarness as Cr, materializeTreeView as Ct, isWaitOutcome as D, createSandboxUsageLedger as Di, DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS as Dn, DEFAULT_LOCAL_HARNESS as Dr, captureWorkerTraceEvidence as Dt, createWaitProbes as E, createSandboxToolPartState as Ei, observedModelMatchesDeclared as En, removeWorktree as Er, WORKER_TOOL_TRACE_SCHEMA_VERSION as Et, prepareScopeRetainedOwnerTask as F, sumSandboxUsage as Fi, sandboxSessionTraceSource as Fn, assertProfileMaterialization as Fr, newUsageTotals as Ft, readWorkerInteractiveAdmissions as G, stringifySafe as Gi, linkAbort as Gn, renderUnsupported as Gr, createActivityLog as Gt, hostDirectoryReader as H, promptCacheTokenClasses as Hi, retainedCreateMaterial as Hn, promptOnlyProfileMaterialization as Hr, workerTraceSeamKey as Ht, scopeRetainedOwnerContext as I, addSpend as Ii, registerRetainedExecutorPreparation as In, controlProfileMaterialization as Ir, spendFromUsageEvents as It, readWorkerInteractiveBinding as J, unmeteredSpend as Ji, defaultRedactorIdentityMaterial as Jn, validateProfileMaterialization as Jr, AUTHORITY_MARKERS as Jt, workerInteractiveAdmissionFile as K, throwAbort as Ki, runAbortable as Kn, sandboxActProfileMaterialization as Kr, readWorkerProgress as Kt, scopeRetainedOwnerPriorSpend as L, chargedTokens as Li, retainedExecutorSeamKey as Ln, defineProfileMaterializationContract as Lr, spendFromUsageTotals as Lt, bindScopeRetainedOwnerEnvironmentId as M, notifySandboxEventObserver as Mi, sandboxClientAsProvider as Mn, CodexExecutionDiagnosticError as Mr, assertValidBudget as Mt, bindScopeRetainedOwnerProvider as N, sandboxEventServedBackend as Ni, createPushTraceSource as Nn, terminateProcessTreeAndConfirm as Nr, createBudgetPool as Nt, pollFor as O, extractLlmCallEvent as Oi, createAgentEnvironmentProviderRegistry as On, LOCAL_HARNESSES as Or, isTraceAnalysisStore as Ot, consumeScopeRetainedOwnerResult as P, sandboxProgressEvents as Pi, decodeToolPart as Pn, AGENT_PROFILE_MATERIALIZATION_AXES as Pr, meterUsageEvent as Pt, recoverRetainedInteractiveRun as Q, resourceTelemetry as Qi, persistHarnessTranscript as Qn, readCommittedJsonLines as Qr, createPeerMailbox as Qt, scopeRetainedOwnerResourceReader as R, cloneSpend as Ri, reconnectRetainedRun as Rn, fullProfileMaterialization as Rr, WORKER_TRACE_PROPAGATION as Rt, recordScopeOwnerMaterialization as S, projectSandboxOutcome as Si, readPromptOptions as Sn, runSettledCommand as Sr, loadSpawnForest as St, settledToIteration as T, canonicalStreamEventFromSandboxEvent as Ti, canonicalObservedModelParts as Tn, createWorktree as Tr, replaySpawnTree as Tt, resolveSpawnResourcePaths as U, randomSuffix as Ui, RunCancellationReason as Un, promptResourceProfileMaterialization as Ur, taskToPrompt as Ut, environmentReader as V, isAbortError$2 as Vi, startRetainedRunInEnvironment as Vn, promptModelProfileMaterialization as Vr, workerTraceHeaders as Vt, interactiveAdmissionSeamKey as W, sleep as Wi, abortError as Wn, renderProfileMaterializationIssues as Wr, DEFAULT_STALL_AFTER_MS as Wt, workerInteractiveBindingsDir as X, zeroSpend as Xi, captureHarnessTranscript as Xn, isNoEntError as Xr, PEER_MAIL_WIRE_KEY as Xt, workerInteractiveBindingFile as Y, withTimeout as Yi, resolveRedactor as Yn, worktreeCliProfileMaterialization as Yr, DEFAULT_PEER_MAIL_LIMITS as Yt, reconnectRetainedInteractiveRun as Z, addResourceSpend as Zi, harnessTranscriptArtifact as Zn, prepareJsonlAppend as Zr, claimsAuthority as Zt, beginScopeOwnerAttempt as _, unknownMaterializationReceipt as _i, runAgentRounds as _n, createRuntimeEventCollector as _r, FileResultBlobStore as _t, pickBestDelivered as a, teardownExecutor as aa, knownExecutionBindingReceipt as ai, bridgeAdmissionRefusal as an, buildLoopOtelSpans as ar, rollingDispatch as at, meterRuntimeOwnedAccounting as b, detachedFrozen as bi, acquireSandbox as bn, sanitizeKnowledgeReadinessReport as br, InMemorySpawnJournal as bt, DriverAttemptsExhaustedError as c, providerMessageText as ca, providerAttemptEvidence as ci, createCodexRolloutStoreReader as cn, createOpenInferenceFileExporter as cr, cliInPlaceExecutor as ct, defaultUnmetContractSteer as d, runtimeOwnedExecutorExecutionBinding as di, bridgeRuntimeAttachmentsKey as dn, flatOtelSpan as dr, createExecutorRegistry as dt, decodeHarnessUsage as ea, attestRuntimeOwnedPendingExecutor as ei, peerMailTools as en, createPropagatingTraceEmitter as er, destroyInteractiveEnvironment as et, runDriverWithRetry as f, runtimeOwnedExecutorMaterialization as fi, bridgeStopSignalKey as fn, generateSpanId as fr, snapshotExecutorConfig as ft, withDriverExecutor as g, unknownExecutionBindingReceipt as gi, isTerminalDecision as gn, toOtelAttributes as gr, createInPlaceCliExecutor as gt, isDriverSpec as h, runtimeOwnedScopeOwnerRuntime as hi, defaultSelectWinner as hn, padTraceId as hr, createSteerableSandboxSession as ht, collectDelivered as i, armDeadlineTimer as ia, inheritRuntimeOwnedExecutorAttestation as ii, executorFailure as in, INTELLIGENCE_WIRE_VERSION as ir, queueOf as it, waitUntil as j, mapSandboxToolEvent as ji, resolveAgentEnvironmentProvider as jn, parseCodexTokenUsage as jr, BudgetReconcileFault as jt, timerAt as k, isSandboxTerminalEvent as ki, providerAsExecutor as kn, harnessSupportsReasoningEffort as kr, parseWorkerToolTraceArtifact as kt, HarnessTurnFailedError as l, recordRuntimeOwnedDriveHarnessProviderEvidence as li, harnessUsageIsEmpty as ln, createOtelExporter as lr, cliWorktreeExecutor as lt, driverExecutorFactory as m, runtimeOwnedPendingExecutorMaterialization as mi, createSandboxForSpec as mn, padSpanId as mr, DEFAULT_SANDBOX_STEERING_MAX_TURNS as mt, createSupervisor as n, awaitAbortable$1 as na, authoredProfileDigest as ni, isLiveNodeStatus as nn, readTraceContextFromEnv as nr, effectiveConcurrency as nt, runFinalizer as o, promptFromAgentTurnInput as oa, knownMaterializationReceipt as oi, bridgeModelRouteRefusal as on, buildLoopSpanNodes as or, bindReusableExecutorExecutionId as ot, driverChild as p, runtimeOwnedExecutorProviderEvidence as pi, TERMINAL_DECISIONS as pn, loopEventToOtelSpan as pr, createWorktreeCliExecutor as pt, attachWorker as q, throwIfAborted as qi, defaultRedactor as qn, unsupportedProfileDimensions as qr, createInbox as qt, bestDelivered as r, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as ra, finalizeRuntimeOwnedPendingExecutor as ri, isTerminalNodeStatus as rn, traceContextToEnv as rr, freeSlots as rt, runTree as s, promptOptionsFromAgentTurnInput as sa, newExecutionAttemptId as si, addHarnessUsage as sn, buildRuntimeEventOtelSpans as sr, captureReusableExecutorConfig as st, createRootHandle as t, abortError$2 as ta, attestRuntimeOwnedScopeOwner as ti, peerMailVerbNames as tn, mergeTraceEnv as tr, errMessage as tt, classifyDriverFailure as u, runtimeOwnedDriveHarnessProviderEvidence as ui, readCodexRolloutSession as un, exportEvalRuns as ur, createExecutor as ut, createScope as v, executableAgentProfileSnapshot as vi, createSandboxLineage as vn, createRuntimeStreamEventCollector as vr, FileSpawnJournal as vt, scopeOwnerExecutorNodeContext as w, assertSandboxServedModel as wi, runBrainLoop as wn, captureWorktreeDiff as wr, pendingWaits as wt, meterRuntimeOwnedProviderAttempt as x, detachedSnapshot as xi, assertBoxlessPromptOptions as xn, sanitizeRuntimeStreamEvent as xr, insideCursorNamespace as xt, deriveNodeExecutionIdentity as y, executableAgentSpecSnapshot as yi, probeSandboxCapabilities as yn, sanitizeAgentRuntimeEvent as yr, InMemoryResultBlobStore as yt, scopeRetainedOwnerResult as z, deleteBoxSafe as zi, recoverRetainedRun as zn, profileMaterializationAxes$1 as zr, readWorkerTraceContext as zt };
|
|
25226
25495
|
|
|
25227
|
-
//# sourceMappingURL=supervisor-
|
|
25496
|
+
//# sourceMappingURL=supervisor-BlDW3u0y.js.map
|