@tangle-network/agent-runtime 0.297.7 → 0.299.0
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-CDoUN2CT.js → activation-D0srpsxN.js} +2 -2
- package/dist/{activation-CDoUN2CT.js.map → activation-D0srpsxN.js.map} +1 -1
- package/dist/{activation-BplOD2nI.d.ts → activation-sYi0Wi1i.d.ts} +3 -3
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-CeuM6euv.js → coordination-driver-c2W1hvwL.js} +124 -19
- package/dist/coordination-driver-c2W1hvwL.js.map +1 -0
- package/dist/{delegate-DII77j2f.js → delegate-VSkeG-3S.js} +2 -2
- package/dist/{delegate-DII77j2f.js.map → delegate-VSkeG-3S.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +2 -2
- package/dist/{graph-C_krm_xZ.js → graph-DogfdeoC.js} +4 -4
- package/dist/{graph-C_krm_xZ.js.map → graph-DogfdeoC.js.map} +1 -1
- package/dist/{improvement-cycle-WcuRt1tq.js → improvement-cycle--dmMEqKn.js} +3 -3
- package/dist/{improvement-cycle-WcuRt1tq.js.map → improvement-cycle--dmMEqKn.js.map} +1 -1
- package/dist/{index-CK0uaklJ.d.ts → index-Ciie85Mi.d.ts} +52 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +7 -7
- package/dist/intelligence.d.ts +3 -3
- package/dist/intelligence.js +4 -4
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +8 -8
- package/dist/{loop-runner-bin-DdKZe6Tr.d.ts → loop-runner-bin-C1H-Ja0s.d.ts} +3 -3
- package/dist/{loop-runner-bin-QFNwSTIP.js → loop-runner-bin-CmedD2zB.js} +3 -3
- package/dist/{loop-runner-bin-QFNwSTIP.js.map → loop-runner-bin-CmedD2zB.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-CrfETZkV.d.ts → openai-tools-CPqecKak.d.ts} +2 -2
- package/dist/profiles.d.ts +2 -2
- package/dist/{provision-supervisor-B5V2xXrm.js → provision-supervisor-CsVvIDrv.js} +3 -3
- package/dist/{provision-supervisor-B5V2xXrm.js.map → provision-supervisor-CsVvIDrv.js.map} +1 -1
- package/dist/{runtime-DNjgEVSC.js → runtime-dpb0Pk4q.js} +43 -8
- package/dist/{runtime-DNjgEVSC.js.map → runtime-dpb0Pk4q.js.map} +1 -1
- package/dist/{search-method-D2CPPGVX.js → search-method-k_i6IkUT.js} +2 -2
- package/dist/{search-method-D2CPPGVX.js.map → search-method-k_i6IkUT.js.map} +1 -1
- package/dist/{server-ff1ZlYVW.js → server-BWfx2L5h.js} +3 -3
- package/dist/{server-ff1ZlYVW.js.map → server-BWfx2L5h.js.map} +1 -1
- package/dist/{stream-agent-turn-D-JUSWnD.d.ts → stream-agent-turn-ZL_mAEzE.d.ts} +2 -2
- package/dist/{substrate-Bd4FFbim.d.ts → substrate-B8IoIZwD.d.ts} +2 -2
- package/dist/{supervise-CPqRWClX.js → supervise-CFFzLFAC.js} +40 -8
- package/dist/supervise-CFFzLFAC.js.map +1 -0
- package/dist/{supervisor-Kn3lYWds.js → supervisor-CJPvBIMu.js} +139 -19
- package/dist/supervisor-CJPvBIMu.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-CwGpKzG1.d.ts → types-CqzsTCqn.d.ts} +27 -4
- package/package.json +1 -1
- package/dist/coordination-driver-CeuM6euv.js.map +0 -1
- package/dist/supervise-CPqRWClX.js.map +0 -1
- package/dist/supervisor-Kn3lYWds.js.map +0 -1
|
@@ -7284,16 +7284,28 @@ function normalizeWorkerSlotBound(value) {
|
|
|
7284
7284
|
if (!Number.isSafeInteger(value)) throw new ValidationError$1(`workerSlots must be a positive safe integer, or 0 or less for no bound, got ${String(value)}`);
|
|
7285
7285
|
return value;
|
|
7286
7286
|
}
|
|
7287
|
-
//#endregion
|
|
7288
|
-
//#region src/runtime/provider-workspace-retention.ts
|
|
7289
7287
|
/** Validate the executable retention port at the create boundary. */
|
|
7290
7288
|
function assertProviderWorkspaceRetentionPort(port, context) {
|
|
7291
7289
|
if (!Number.isSafeInteger(port.timeoutMs) || port.timeoutMs <= 0) throw new ValidationError$1(`${context}: workspaceRetention.timeoutMs must be a positive safe integer`);
|
|
7292
7290
|
if (port.maxConcurrentCaptures !== void 0 && (!Number.isSafeInteger(port.maxConcurrentCaptures) || port.maxConcurrentCaptures <= 0)) throw new ValidationError$1(`${context}: workspaceRetention.maxConcurrentCaptures must be a positive safe integer`);
|
|
7293
7291
|
if (port.artifacts === null || typeof port.artifacts?.read !== "function") throw new ValidationError$1(`${context}: workspaceRetention.artifacts.read is required`);
|
|
7294
7292
|
if (typeof port.capture !== "function") throw new ValidationError$1(`${context}: workspaceRetention.capture is required`);
|
|
7293
|
+
if (port.captureNative !== void 0 && typeof port.captureNative !== "function") throw new ValidationError$1(`${context}: workspaceRetention.captureNative must be a function`);
|
|
7294
|
+
for (const key of ["nativeIntervalMs", "nativeTimeoutMs"]) {
|
|
7295
|
+
const value = port[key];
|
|
7296
|
+
if (value !== void 0 && (!Number.isSafeInteger(value) || value <= 0)) throw new ValidationError$1(`${context}: workspaceRetention.${key} must be a positive safe integer`);
|
|
7297
|
+
}
|
|
7295
7298
|
}
|
|
7296
7299
|
const captureGroups = /* @__PURE__ */ new WeakMap();
|
|
7300
|
+
const nativeSlotKeys = /* @__PURE__ */ new WeakMap();
|
|
7301
|
+
function nativeSlots(port) {
|
|
7302
|
+
let key = nativeSlotKeys.get(port);
|
|
7303
|
+
if (key === void 0) {
|
|
7304
|
+
key = Object.freeze({ maxConcurrentCaptures: port.maxConcurrentCaptures });
|
|
7305
|
+
nativeSlotKeys.set(port, key);
|
|
7306
|
+
}
|
|
7307
|
+
return key;
|
|
7308
|
+
}
|
|
7297
7309
|
async function withCaptureSlot(port, signal, capture) {
|
|
7298
7310
|
if (port.maxConcurrentCaptures === void 0) return capture();
|
|
7299
7311
|
let group = captureGroups.get(port);
|
|
@@ -7310,20 +7322,28 @@ async function withCaptureSlot(port, signal, capture) {
|
|
|
7310
7322
|
permit.release();
|
|
7311
7323
|
}
|
|
7312
7324
|
}
|
|
7313
|
-
/**
|
|
7314
|
-
|
|
7325
|
+
/**
|
|
7326
|
+
* Capture, require durable refs, and verify every returned manifest/archive byte.
|
|
7327
|
+
* `native` calls {@link ProviderWorkspaceRetentionPort.captureNative} under its own queue and
|
|
7328
|
+
* bound, and judges coverage by the sessions alone.
|
|
7329
|
+
*/
|
|
7330
|
+
async function captureProviderWorkspaceSnapshot(port, context, scope = "environment") {
|
|
7315
7331
|
assertProviderWorkspaceRetentionPort(port, "provider workspace retention");
|
|
7332
|
+
const native = scope === "native";
|
|
7333
|
+
if (native && port.captureNative === void 0) throw new ValidationError$1("provider workspace retention: the port has no captureNative");
|
|
7334
|
+
const timeoutMs = native ? port.nativeTimeoutMs ?? 12e4 : port.timeoutMs;
|
|
7316
7335
|
const controlRef = context.controlRef === void 0 ? void 0 : AgentExactRunControlRefSchema.parse(context.controlRef);
|
|
7317
7336
|
if (controlRef !== void 0 && (controlRef.environmentId !== context.environment.id || controlRef.provider !== context.environment.provider || context.providerSessionId != null && controlRef.sessionId !== context.providerSessionId)) throw new Error("provider workspace retention control reference names another environment or session");
|
|
7318
7337
|
const controller = new AbortController();
|
|
7319
|
-
const clearDeadline = armDeadlineTimer(
|
|
7338
|
+
const clearDeadline = armDeadlineTimer(timeoutMs, () => controller.abort(/* @__PURE__ */ new Error(`provider workspace retention timed out after ${timeoutMs}ms`)), true);
|
|
7320
7339
|
try {
|
|
7321
|
-
return await runAbortable(() => withCaptureSlot(port, controller.signal, async () => {
|
|
7322
|
-
const
|
|
7340
|
+
return await runAbortable(() => withCaptureSlot(native ? nativeSlots(port) : port, controller.signal, async () => {
|
|
7341
|
+
const input = {
|
|
7323
7342
|
...context,
|
|
7324
7343
|
...controlRef === void 0 ? {} : { controlRef: Object.freeze({ ...controlRef }) },
|
|
7325
7344
|
signal: controller.signal
|
|
7326
|
-
}
|
|
7345
|
+
};
|
|
7346
|
+
const result = detachedSnapshot(native ? await port.captureNative(input) : await port.capture(input), "provider workspace retention snapshot");
|
|
7327
7347
|
const snapshot = "snapshot" in result ? result.snapshot : result;
|
|
7328
7348
|
const provenance = "snapshot" in result ? detachedSnapshot(result.provenance, "provider workspace retention provenance") : {
|
|
7329
7349
|
status: "unavailable",
|
|
@@ -7340,7 +7360,9 @@ async function captureProviderWorkspaceSnapshot(port, context) {
|
|
|
7340
7360
|
}
|
|
7341
7361
|
if (provenance.status !== "reported") coverageGaps.push("Coverage metadata unavailable");
|
|
7342
7362
|
if (provenance.executionId !== context.executionId) coverageGaps.push("Exact execution identity missing");
|
|
7343
|
-
if (
|
|
7363
|
+
if (native) {
|
|
7364
|
+
if (provenance.workspaceScope !== "none") coverageGaps.push("Native capture did not report a native-only scope");
|
|
7365
|
+
} else if (provenance.workspace?.complete !== true) coverageGaps.push("Workspace inventory incomplete");
|
|
7344
7366
|
if (provenance.sessions === void 0) coverageGaps.push("Session inventory missing");
|
|
7345
7367
|
if (context.providerSessionId != null && !provenance.sessions?.some((session) => session.id === context.providerSessionId && session.executionId === context.executionId)) coverageGaps.push(`Provider session ${context.providerSessionId} missing from capture`);
|
|
7346
7368
|
for (const session of provenance.sessions ?? []) {
|
|
@@ -7378,7 +7400,7 @@ async function captureProviderWorkspaceSnapshot(port, context) {
|
|
|
7378
7400
|
coverageComplete,
|
|
7379
7401
|
...coverageComplete ? {} : { incompleteReason: `provider workspace retention coverage incomplete: ${coverageGaps.join("; ")}` }
|
|
7380
7402
|
};
|
|
7381
|
-
}), controller.signal, `provider workspace retention timed out after ${
|
|
7403
|
+
}), controller.signal, `provider workspace retention timed out after ${timeoutMs}ms`);
|
|
7382
7404
|
} finally {
|
|
7383
7405
|
clearDeadline();
|
|
7384
7406
|
}
|
|
@@ -8113,7 +8135,7 @@ async function startRetainedRun(options) {
|
|
|
8113
8135
|
assertStableText(options.existingEnvironmentId, "retained environment id");
|
|
8114
8136
|
const existing = await options.provider.get(options.existingEnvironmentId);
|
|
8115
8137
|
if (!existing || existing.id !== options.existingEnvironmentId || existing.provider !== options.provider.name) throw new Error("retained provider environment is unavailable or has another identity");
|
|
8116
|
-
await assertRetainedEnvironmentOwnership(options.provider, existing
|
|
8138
|
+
await assertRetainedEnvironmentOwnership(options.provider, existing, options.environment.idempotencyKey);
|
|
8117
8139
|
environment = existing;
|
|
8118
8140
|
} else environment = await options.provider.create({
|
|
8119
8141
|
...options.environment,
|
|
@@ -8189,7 +8211,7 @@ async function startRetainedRunInEnvironment(options) {
|
|
|
8189
8211
|
const capabilities = retainedCapabilitiesForEnvironment(options.provider.name, providerCapabilities, environment);
|
|
8190
8212
|
assertRequestedInteractionCapabilities(options.provider.name, options.turn.interactions, capabilities);
|
|
8191
8213
|
if (!environment.dispatch || !environment.session) throw new Error(`provider "${options.provider.name}" does not expose detached session control`);
|
|
8192
|
-
await assertRetainedEnvironmentOwnership(options.provider, environment
|
|
8214
|
+
await assertRetainedEnvironmentOwnership(options.provider, environment, options.environment.idempotencyKey);
|
|
8193
8215
|
return dispatchRetainedRun({
|
|
8194
8216
|
provider: options.provider,
|
|
8195
8217
|
environment,
|
|
@@ -8203,10 +8225,26 @@ async function startRetainedRunInEnvironment(options) {
|
|
|
8203
8225
|
preserveEnvironment: true
|
|
8204
8226
|
});
|
|
8205
8227
|
}
|
|
8206
|
-
|
|
8228
|
+
/**
|
|
8229
|
+
* Bind an existing environment to the retained key it was created under.
|
|
8230
|
+
*
|
|
8231
|
+
* The record `provider.get` just returned carries that environment's metadata, and it is the
|
|
8232
|
+
* same record a metadata-filtered `list` would match. Reading it costs one request. Listing
|
|
8233
|
+
* costs a walk of the caller's whole inventory, and on Tangle Sandbox that walk cannot finish
|
|
8234
|
+
* past 2,000 sandboxes: the list route caps `offset` at 1,000 and answers 400. Measured
|
|
8235
|
+
* 2026-10-04: 17 of 20 archived Discovery runs hit that 400 (46 times), each on a later turn in
|
|
8236
|
+
* an environment that had already done work, and each attempt ended terminally. The listing remains for a provider whose
|
|
8237
|
+
* `get` returns no metadata.
|
|
8238
|
+
*/
|
|
8239
|
+
async function assertRetainedEnvironmentOwnership(provider, environment, idempotencyKey) {
|
|
8240
|
+
const unbound = () => /* @__PURE__ */ new Error(`provider "${provider.name}" could not bind environment "${environment.id}" to its retained idempotency key`);
|
|
8241
|
+
if (environment.metadata !== void 0) {
|
|
8242
|
+
if (environment.metadata.retainedIdempotencyKey !== idempotencyKey) throw unbound();
|
|
8243
|
+
return;
|
|
8244
|
+
}
|
|
8207
8245
|
if (!provider.list) throw new Error(`provider "${provider.name}" cannot prove retained environment ownership by metadata`);
|
|
8208
|
-
const matches = (await provider.list({ metadata: { retainedIdempotencyKey: idempotencyKey } })).filter((summary) => summary.id ===
|
|
8209
|
-
if (matches.length !== 1 || matches[0]?.metadata?.retainedIdempotencyKey !== idempotencyKey) throw
|
|
8246
|
+
const matches = (await provider.list({ metadata: { retainedIdempotencyKey: idempotencyKey } })).filter((summary) => summary.id === environment.id && summary.provider === provider.name);
|
|
8247
|
+
if (matches.length !== 1 || matches[0]?.metadata?.retainedIdempotencyKey !== idempotencyKey) throw unbound();
|
|
8210
8248
|
}
|
|
8211
8249
|
async function dispatchRetainedRun(options) {
|
|
8212
8250
|
const { environment, identity } = options;
|
|
@@ -11220,6 +11258,7 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
11220
11258
|
let workspaceCleanupPromise;
|
|
11221
11259
|
let retainedReleasePromise;
|
|
11222
11260
|
let releaseReadTried = false;
|
|
11261
|
+
let releaseNativeTried = false;
|
|
11223
11262
|
let workspaceOutcome;
|
|
11224
11263
|
let workspacePreservationRequired = false;
|
|
11225
11264
|
let workspaceRunActive = false;
|
|
@@ -11284,7 +11323,9 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
11284
11323
|
if (workspaceSnapshot !== void 0) return workspaceSnapshot;
|
|
11285
11324
|
if (workspaceCapturePromise === void 0) {
|
|
11286
11325
|
workspaceOutcome = outcome;
|
|
11287
|
-
|
|
11326
|
+
if (nativeTimer !== void 0) clearTimeout(nativeTimer);
|
|
11327
|
+
nativeTimer = void 0;
|
|
11328
|
+
const captureContext = {
|
|
11288
11329
|
environment: next,
|
|
11289
11330
|
executionId: workspaceExecutionId,
|
|
11290
11331
|
...workspaceControlRef === void 0 ? {} : { controlRef: workspaceControlRef },
|
|
@@ -11293,7 +11334,8 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
11293
11334
|
nativeSessionId: null,
|
|
11294
11335
|
profile: createProfile,
|
|
11295
11336
|
...outcome === void 0 ? {} : { outcome }
|
|
11296
|
-
}
|
|
11337
|
+
};
|
|
11338
|
+
workspaceCapturePromise = (nativeInFlight ?? Promise.resolve()).then(() => captureProviderWorkspaceSnapshot(workspaceRetention, captureContext)).then(({ snapshot, provenance, coverageComplete, incompleteReason }) => {
|
|
11297
11339
|
workspaceSnapshot = snapshot;
|
|
11298
11340
|
workspaceProvenance = provenance;
|
|
11299
11341
|
workspaceCoverageComplete = coverageComplete ?? false;
|
|
@@ -11310,8 +11352,9 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
11310
11352
|
incompleteReason
|
|
11311
11353
|
})
|
|
11312
11354
|
}, next, snapshot, providerSessionId), createProfile.harness);
|
|
11355
|
+
nativeHoldsTranscript = false;
|
|
11313
11356
|
} catch (error) {
|
|
11314
|
-
harnessTranscript = {
|
|
11357
|
+
if (!nativeHoldsTranscript) harnessTranscript = {
|
|
11315
11358
|
status: "unavailable",
|
|
11316
11359
|
reason: "retained-projection-failed",
|
|
11317
11360
|
skipped: [{
|
|
@@ -11333,6 +11376,74 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
11333
11376
|
const reason = workspaceCaptureFailure instanceof Error ? workspaceCaptureFailure.message : String(workspaceCaptureFailure ?? "capture was not accepted");
|
|
11334
11377
|
return `providerAsExecutor(${provider.name}): workspace retention failed — ${reason}; source environment preserved`;
|
|
11335
11378
|
};
|
|
11379
|
+
const nativePort = options.workspaceRetention?.captureNative === void 0 ? void 0 : options.workspaceRetention;
|
|
11380
|
+
let nativeInFlight;
|
|
11381
|
+
let nativeTimer;
|
|
11382
|
+
let nativeHoldsTranscript = false;
|
|
11383
|
+
const stopNativeMirror = async () => {
|
|
11384
|
+
if (nativeTimer !== void 0) clearTimeout(nativeTimer);
|
|
11385
|
+
nativeTimer = void 0;
|
|
11386
|
+
await nativeInFlight;
|
|
11387
|
+
};
|
|
11388
|
+
const captureNative = (next, phase, admitted) => {
|
|
11389
|
+
if (nativePort === void 0 || createProfile.harness === void 0) return Promise.resolve();
|
|
11390
|
+
const harness = createProfile.harness;
|
|
11391
|
+
const tracked = (nativeInFlight ?? Promise.resolve()).then(async () => {
|
|
11392
|
+
const controlRef = workspaceControlRef ?? admitted;
|
|
11393
|
+
const sessionId = providerSessionId ?? admitted?.sessionId ?? null;
|
|
11394
|
+
if (workspaceSnapshot !== void 0 && !nativeHoldsTranscript) return;
|
|
11395
|
+
const invocationId = workspaceExecutionId;
|
|
11396
|
+
try {
|
|
11397
|
+
const captured = await captureProviderWorkspaceSnapshot(nativePort, {
|
|
11398
|
+
environment: next,
|
|
11399
|
+
executionId: invocationId,
|
|
11400
|
+
...controlRef === void 0 ? {} : { controlRef },
|
|
11401
|
+
...node === void 0 ? {} : { node },
|
|
11402
|
+
providerSessionId: sessionId,
|
|
11403
|
+
nativeSessionId: null,
|
|
11404
|
+
profile: createProfile,
|
|
11405
|
+
phase
|
|
11406
|
+
}, "native");
|
|
11407
|
+
if (workspaceSnapshot !== void 0 && !nativeHoldsTranscript) return;
|
|
11408
|
+
const copy = retainHarnessTranscript(providerWorkspaceCaptureReceipt({
|
|
11409
|
+
executionId: invocationId,
|
|
11410
|
+
profile: createProfile,
|
|
11411
|
+
...node === void 0 ? {} : { node },
|
|
11412
|
+
workspaceControlRef: () => controlRef,
|
|
11413
|
+
workspaceProvenance: () => captured.provenance,
|
|
11414
|
+
workspaceCoverage: () => ({
|
|
11415
|
+
complete: captured.coverageComplete ?? false,
|
|
11416
|
+
incompleteReason: captured.incompleteReason
|
|
11417
|
+
})
|
|
11418
|
+
}, next, captured.snapshot, sessionId), harness);
|
|
11419
|
+
if (nativeHoldsTranscript && !(copy.status === "retained" && copy.fileCount > 0)) return;
|
|
11420
|
+
harnessTranscript = copy;
|
|
11421
|
+
nativeHoldsTranscript = true;
|
|
11422
|
+
} catch {}
|
|
11423
|
+
}).finally(() => {
|
|
11424
|
+
if (nativeInFlight === tracked) nativeInFlight = void 0;
|
|
11425
|
+
});
|
|
11426
|
+
nativeInFlight = tracked;
|
|
11427
|
+
return tracked;
|
|
11428
|
+
};
|
|
11429
|
+
const startNativeMirror = (next) => {
|
|
11430
|
+
if (nativePort === void 0) return;
|
|
11431
|
+
if (nativeTimer !== void 0) clearTimeout(nativeTimer);
|
|
11432
|
+
const interval = nativePort.nativeIntervalMs ?? 12e4;
|
|
11433
|
+
const schedule = () => {
|
|
11434
|
+
nativeTimer = setTimeout(() => {
|
|
11435
|
+
if (nativeInFlight === void 0) captureNative(next, "running");
|
|
11436
|
+
schedule();
|
|
11437
|
+
}, interval);
|
|
11438
|
+
nativeTimer.unref?.();
|
|
11439
|
+
};
|
|
11440
|
+
schedule();
|
|
11441
|
+
};
|
|
11442
|
+
const finishNativeMirror = async (next, phase) => {
|
|
11443
|
+
await stopNativeMirror();
|
|
11444
|
+
if (workspaceSnapshot !== void 0 && !nativeHoldsTranscript) return;
|
|
11445
|
+
await captureNative(next, phase);
|
|
11446
|
+
};
|
|
11336
11447
|
const destroyEnvironment = async (cleanupSignal) => {
|
|
11337
11448
|
if (workspaceCleanupPromise !== void 0) return await workspaceCleanupPromise;
|
|
11338
11449
|
const cleanupPromise = (async () => {
|
|
@@ -11561,6 +11672,8 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
11561
11672
|
if (continued && snapshot !== void 0 && (!options.workspaceRetention?.requireCompleteProvenance || workspaceCoverageComplete)) workspacePreservationRequired = false;
|
|
11562
11673
|
},
|
|
11563
11674
|
captureWorkspace,
|
|
11675
|
+
startNativeMirror,
|
|
11676
|
+
finishNativeMirror,
|
|
11564
11677
|
workspaceControlRef: () => workspaceControlRef,
|
|
11565
11678
|
workspaceProvenance: () => workspaceProvenance,
|
|
11566
11679
|
workspaceCoverage: () => ({
|
|
@@ -11687,6 +11800,11 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
11687
11800
|
const capture = await captureHarnessTranscript(target, profile.harness, signal);
|
|
11688
11801
|
if (capture.status === "captured") harnessTranscript = capture;
|
|
11689
11802
|
}
|
|
11803
|
+
if (nativePort !== void 0 && harnessTranscript.status !== "retained" && !releaseNativeTried) {
|
|
11804
|
+
releaseNativeTried = true;
|
|
11805
|
+
const admitted = retained?.controlRef ?? admittedControlRef(retention);
|
|
11806
|
+
await awaitAbortable$1(captureNative(target, "interrupted", admitted === void 0 ? void 0 : freezeControlRef(admitted)), signal).catch(() => void 0);
|
|
11807
|
+
}
|
|
11690
11808
|
const result = await destroyEnvironment(signal);
|
|
11691
11809
|
if (!result.destroyed) return [receipt(false, result.detail, result.permanent)];
|
|
11692
11810
|
pending = false;
|
|
@@ -11764,6 +11882,7 @@ async function* streamProviderExecutor(args) {
|
|
|
11764
11882
|
const source = await providerExecutionSource(args, turn, linked);
|
|
11765
11883
|
const environment = source.environment;
|
|
11766
11884
|
args.onEnvironment(environment);
|
|
11885
|
+
args.startNativeMirror(environment);
|
|
11767
11886
|
const archive = createTurnEventArchive();
|
|
11768
11887
|
const seenTraceCalls = /* @__PURE__ */ new Set();
|
|
11769
11888
|
let tokens = zeroTokenUsage();
|
|
@@ -11926,6 +12045,7 @@ async function* streamProviderExecutor(args) {
|
|
|
11926
12045
|
}
|
|
11927
12046
|
if (args.options.workspaceRetention === void 0) args.onHarnessTranscript(await captureHarnessTranscript(environment, args.profile.harness, linked));
|
|
11928
12047
|
} finally {
|
|
12048
|
+
await args.finishNativeMirror(environment, failed ? "failed" : settled !== void 0 ? "settled" : "interrupted");
|
|
11929
12049
|
if ((!source.retained || settled !== void 0 && !failed) && !(source.retained && args.retention?.preserveEnvironment) && !(unavailable !== void 0 && !failed) && (args.options.destroyOnSettle ?? true)) {
|
|
11930
12050
|
const cleanup = await args.destroyEnvironment();
|
|
11931
12051
|
if (!cleanup.destroyed) {
|
|
@@ -29064,4 +29184,4 @@ function isNonEmptySpend(s) {
|
|
|
29064
29184
|
//#endregion
|
|
29065
29185
|
export { bindScopeRetainedOwnerProvider as $, detachedFrozen as $i, parseWorkerToolTraceArtifact as $n, sanitizeRuntimeStreamEvent as $r, isPeerMailEnvelope as $t, driverExecutorFactory as A, addResourceSpend as Aa, prepareJsonlAppend as Ai, resolveAgentEnvironmentProvider as An, contentAddress as Ar, createExecutor as At, recordScopeOwnerDriverAttempt as B, promptFromAgentTurnInput as Ba, newExecutionAttemptId as Bi, InMemoryResultBlobStore as Bn, buildRuntimeEventOtelSpans as Br, workerTraceEnv as Bt, createContinuationKeeper as C, sleep as Ca, renderProfileMaterializationIssues as Ci, readPromptOptions as Cn, runAbortable as Cr, freeSlots as Ct, passedItems as D, unmeteredSpend as Da, validateProfileMaterialization as Di, createAgentEnvironmentProviderRegistry as Dn, readHarnessTranscript as Dr, captureReusableExecutorConfig as Dt, failedItems as E, throwIfAborted as Ea, unsupportedProfileDimensions as Ei, LEAF_CONTINUATION_TASK as En, persistHarnessTranscript as Er, bindReusableExecutorExecutionId as Et, beginScopeOwnerAttempt as F, awaitAbortable$1 as Fa, authoredProfileDigest as Fi, sandboxSessionTraceSource as Fn, defaultRedactor as Fr, createSteerableSandboxSession as Ft, settledToIteration as G, runtimeOwnedExecutorMaterialization as Gi, insideCursorNamespace as Gn, loopEventToOtelSpan as Gr, createActivityLog as Gt, recordScopeOwnerPause as H, providerMessageText as Ha, recordRuntimeOwnedDriveHarnessProviderEvidence as Hi, SpawnEventIndex as Hn, createOtelExporter as Hr, workerTraceSeamKey as Ht, createScope as I, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as Ia, finalizeRuntimeOwnedPendingExecutor as Ii, registerRetainedExecutorPreparation as In, defaultRedactorIdentityMaterial as Ir, createRouterTranscript as It, pollFor as J, runtimeOwnedScopeOwnerRuntime as Ji, pendingWaits as Jn, toOtelAttributes as Jr, AUTHORITY_MARKERS as Jt, createWaitProbes as K, runtimeOwnedExecutorProviderEvidence as Ki, loadSpawnForest as Kn, padSpanId as Kr, readWorkerProgress as Kt, deriveNodeExecutionIdentity as L, armDeadlineTimer as La, inheritRuntimeOwnedExecutorAttestation as Li, retainedExecutorSeamKey as Ln, resolveRedactor as Lr, createInPlaceCliExecutor as Lt, withDriverExecutor as M, withBudgetResources as Ma, writeAllBytes as Mi, unavailableSignalOfFailure as Mn, mergeTraceEnv as Mr, snapshotExecutorConfig as Mt, SUBTREE_RESULT_LIMIT as N, decodeHarnessUsage as Na, attestRuntimeOwnedPendingExecutor as Ni, createPushTraceSource as Nn, readTraceContextFromEnv as Nr, createWorktreeCliExecutor as Nt, verdictFromJudgeScore as O, withTimeout as Oa, worktreeCliProfileMaterialization as Oi, providerAsExecutor as On, resolveHarnessTranscriptCapture as Or, cliInPlaceExecutor as Ot, assertRecursiveReservationPolicy as P, abortError$2 as Pa, attestRuntimeOwnedScopeOwner as Pi, decodeToolPart as Pn, traceContextToEnv as Pr, DEFAULT_SANDBOX_STEERING_MAX_TURNS as Pt, bindScopeRetainedOwnerEnvironmentId as Q, executableAgentSpecSnapshot as Qi, isTraceAnalysisStore as Qn, sanitizeKnowledgeReadinessReport as Qr, createPeerMailbox as Qt, meterRuntimeOwnedAccounting as R, teardownExecutor as Ra, knownExecutionBindingReceipt as Ri, FileResultBlobStore as Rn, buildLoopOtelSpans as Rr, WORKER_TRACE_PROPAGATION as Rt, composeContinuationNote as S, randomSuffix as Sa, promptResourceProfileMaterialization as Si, assertBoxlessPromptOptions as Sn, linkAbort as Sr, startRetainedInteractiveRun as St, expandQuestions as T, throwAbort as Ta, sandboxActProfileMaterialization as Ti, runBrainLoop as Tn, harnessTranscriptArtifact as Tr, rollingDispatch as Tt, restoreScopeOwnerAcceptedExecution as U, runtimeOwnedDriveHarnessProviderEvidence as Ui, assertContentAddress as Un, flatOtelSpan as Ur, taskToPrompt as Ut, recordScopeOwnerMaterialization as V, promptOptionsFromAgentTurnInput as Va, providerAttemptEvidence as Vi, InMemorySpawnJournal as Vn, createOpenInferenceFileExporter as Vr, workerTraceHeaders as Vt, scopeOwnerExecutorNodeContext as W, runtimeOwnedExecutorExecutionBinding as Wi, encodeResultBlob as Wn, generateSpanId as Wr, DEFAULT_STALL_AFTER_MS as Wt, validateWaitSpec as X, unknownMaterializationReceipt as Xi, WORKER_TOOL_TRACE_SCHEMA_VERSION as Xn, createRuntimeStreamEventCollector as Xr, PEER_MAIL_WIRE_KEY as Xt, timerAt as Y, unknownExecutionBindingReceipt as Yi, replaySpawnTree as Yn, createRuntimeEventCollector as Yr, DEFAULT_PEER_MAIL_LIMITS as Yt, waitUntil as Z, executableAgentProfileSnapshot as Zi, captureWorkerTraceEvidence as Zn, sanitizeAgentRuntimeEvent as Zr, claimsAuthority as Zt, CheckUnavailableError as _, cloneSpend as _a, fullProfileMaterialization as _i, createSandboxLineage as _n, environmentGone as _r, readWorkerInteractiveBinding as _t, collectDelivered as a, createSandboxToolPartState as aa, DEFAULT_LOCAL_HARNESS as ai, bridgeModelRouteRefusal as an, createBudgetPool as ar, scopeRetainedOwnerPriorSpend as at, bestComposite as b, isAbortError$2 as ba, promptModelProfileMaterialization as bi, SandboxEvidenceRetentionError as bn, RunCancellationReason as br, reconnectRetainedInteractiveRun as bt, runTree as c, isSandboxTerminalEvent as ca, harnessSupportsReasoningEffort as ci, harnessUsageIsEmpty as cn, spendFromUsageEvents as cr, scopeRetainedOwnerResult as ct, classifyDriverFailure as d, notifySandboxEventObserver as da, CodexExecutionDiagnosticError as di, bridgeStopSignalKey as dn, reconnectRetainedRun as dr, hostDirectoryReader as dt, detachedSnapshot as ea, runSettledCommand as ei, peerMailTools as en, workerTraceAnalysisStore as er, consumeScopeRetainedOwnerResult as et, runDriverWithRetry as f, sandboxEventServedBackend as fa, terminateProcessTreeAndConfirm as fi, TERMINAL_DECISIONS as fn, recoverRetainedRun as fr, resolveSpawnResourcePaths as ft, CONTINUATION_FACTS as g, chargedTokens as ga, defineProfileMaterializationContract as gi, runAgentRounds as gn, destroyInteractiveEnvironment as gr, attachWorker as gt, CONTINUATIONS_DIR as h, addSpend as ha, controlProfileMaterialization as hi, isTerminalDecision as hn, retainedCreateMaterial as hr, workerInteractiveAdmissionFile as ht, bestDelivered as i, canonicalStreamEventFromSandboxEvent as ia, removeWorktree as ii, bridgeAdmissionRefusal as in, assertValidBudget as ir, scopeRetainedOwnerContext as it, isDriverSpec as j, resourceTelemetry as ja, readCommittedJsonLines as ji, unavailablePauseMs as jn, createPropagatingTraceEmitter as jr, createExecutorRegistry as jt, driverChild as k, zeroSpend as ka, isNoEntError as ki, providerAsSandboxClient as kn, retainHarnessTranscript as kr, cliWorktreeExecutor as kt, DriverAttemptsExhaustedError as l, mapSandboxEvent as la, localHarnessExecutable as li, readCodexRolloutSession as ln, spendFromUsageTotals as lr, SPAWN_RESOURCE_PATH_MAX_BYTES as lt, upstreamUnavailableSignal as m, sumSandboxUsage as ma, assertProfileMaterialization as mi, defaultSelectWinner as mn, startRetainedRunInEnvironment as mr, readWorkerInteractiveAdmissions as mt, createRootHandle as n, readSandboxOutcome as na, captureWorktreeDiff as ni, isLiveNodeStatus as nn, BudgetReconcileFault as nr, prepareScopeRetainedOwnerTask as nt, pickBestDelivered as o, createSandboxUsageLedger as oa, LOCAL_HARNESSES as oi, addHarnessUsage as on, meterUsageEvent as or, scopeRetainedOwnerResourceReader as ot, summarizeDriverAttempts as p, sandboxProgressEvents as pa, AGENT_PROFILE_MATERIALIZATION_AXES as pi, createSandboxForSpec as pn, startRetainedRun as pr, interactiveAdmissionSeamKey as pt, isWaitOutcome as q, runtimeOwnedPendingExecutorMaterialization as qi, materializeTreeView as qn, padTraceId as qr, createInbox as qt, createSupervisor as r, assertSandboxServedModel as ra, createWorktree as ri, isTerminalNodeStatus as rn, ReservationWaitRefused as rr, reconcileScopeRetainedOwnerEnvironment as rt, runFinalizer as s, extractLlmCallEvent as sa, harnessInvocation as si, createCodexRolloutStoreReader as sn, newUsageTotals as sr, scopeRetainedOwnerRestorePoint as st, DEFAULT_MAX_DEPTH as t, projectSandboxOutcome as ta, runWorktreeHarness as ti, peerMailVerbNames as tn, executorFailure as tr, noteScopeRetainedOwnerCoordination as tt, HarnessTurnFailedError as u, mapSandboxToolEvent as ua, parseCodexTokenUsage as ui, bridgeRuntimeAttachmentsKey as un, errMessage as ur, environmentReader as ut, admitContinuationPolicy as v, deleteBoxSafe as va, profileMaterializationAxes$1 as vi, probeSandboxCapabilities as vn, createWorkerSlots as vr, workerInteractiveBindingFile as vt, distillFindings as w, stringifySafe as wa, renderUnsupported as wi, routerBrain as wn, captureHarnessTranscript as wr, queueOf as wt, checkVerdictOf as x, promptCacheTokenClasses as xa, promptOnlyProfileMaterialization as xi, captureBeforeDestroy as xn, abortError as xr, recoverRetainedInteractiveRun as xt, admitFinding as y, hasCompleteCacheBreakdown as ya, promptControlProfileMaterialization as yi, acquireSandbox as yn, openSlotGroup as yr, workerInteractiveBindingsDir as yt, meterRuntimeOwnedProviderAttempt as z, teardownSurfaces as za, knownMaterializationReceipt as zi, FileSpawnJournal as zn, buildLoopSpanNodes as zr, readWorkerTraceContext as zt };
|
|
29066
29186
|
|
|
29067
|
-
//# sourceMappingURL=supervisor-
|
|
29187
|
+
//# sourceMappingURL=supervisor-CJPvBIMu.js.map
|