@tangle-network/agent-runtime 0.329.0 → 0.331.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-BfHpXIo0.js → activation-ATEMfvUx.js} +2 -2
- package/dist/{activation-BfHpXIo0.js.map → activation-ATEMfvUx.js.map} +1 -1
- package/dist/{activation-CQo8-ir9.d.ts → activation-Bmx0KfIu.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-DsxFmzhm.js → coordination-driver-mCy5c7AX.js} +30 -6
- package/dist/coordination-driver-mCy5c7AX.js.map +1 -0
- package/dist/{delegate-C-E2pUey.js → delegate-BNbNOeKh.js} +2 -2
- package/dist/{delegate-C-E2pUey.js.map → delegate-BNbNOeKh.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +3 -3
- package/dist/{graph-BamfOWzd.js → graph-BnwptT9N.js} +4 -4
- package/dist/{graph-BamfOWzd.js.map → graph-BnwptT9N.js.map} +1 -1
- package/dist/{improvement-cycle-BWcUsIgg.js → improvement-cycle-DxOwBXUG.js} +3 -3
- package/dist/{improvement-cycle-BWcUsIgg.js.map → improvement-cycle-DxOwBXUG.js.map} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +7 -7
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +2 -2
- package/dist/kernel.js +8 -8
- package/dist/{loop-runner-bin-CVZ5S19W.js → loop-runner-bin-BEF6YQ6n.js} +3 -3
- package/dist/{loop-runner-bin-CVZ5S19W.js.map → loop-runner-bin-BEF6YQ6n.js.map} +1 -1
- package/dist/{loop-runner-bin-U00bzVay.d.ts → loop-runner-bin-BsTGajz-.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-DnA8exP6.d.ts → openai-tools-CtZ43Ca8.d.ts} +2 -2
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-mpEy_KWu.js → provision-supervisor-BMpGPSeA.js} +3 -3
- package/dist/{provision-supervisor-mpEy_KWu.js.map → provision-supervisor-BMpGPSeA.js.map} +1 -1
- package/dist/{runtime-VteVmwAw.js → runtime-DAowMLVA.js} +20 -11
- package/dist/runtime-DAowMLVA.js.map +1 -0
- package/dist/{search-executor-eTeXrpkP.js → search-executor-Cpd86bKi.js} +2 -2
- package/dist/{search-executor-eTeXrpkP.js.map → search-executor-Cpd86bKi.js.map} +1 -1
- package/dist/{server-BGQv06nN.js → server-yYklYIOo.js} +3 -3
- package/dist/{server-BGQv06nN.js.map → server-yYklYIOo.js.map} +1 -1
- package/dist/{supervise-BIIbQhg7.js → supervise-BXSudcLe.js} +38 -6
- package/dist/supervise-BXSudcLe.js.map +1 -0
- package/dist/{supervisor-U76PdEPD.js → supervisor-DJXryb1R.js} +129 -38
- package/dist/supervisor-DJXryb1R.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-B6IAL5Q7.d.ts → types-ClvH_SR1.d.ts} +65 -2
- package/package.json +1 -1
- package/dist/coordination-driver-DsxFmzhm.js.map +0 -1
- package/dist/runtime-VteVmwAw.js.map +0 -1
- package/dist/supervise-BIIbQhg7.js.map +0 -1
- package/dist/supervisor-U76PdEPD.js.map +0 -1
|
@@ -1856,10 +1856,12 @@ const outsideKinds = /* @__PURE__ */ new Set([
|
|
|
1856
1856
|
"workspace-checkpoint-requested",
|
|
1857
1857
|
"workspace-checkpoint",
|
|
1858
1858
|
"workspace-checkpoint-fork-requested",
|
|
1859
|
+
"workspace-checkpoint-fork-ready",
|
|
1859
1860
|
"workspace-checkpoint-fork-teardown",
|
|
1860
1861
|
"workspace-checkpoint-capture",
|
|
1861
1862
|
"workspace-checkpoint-cleanup",
|
|
1862
1863
|
"workspace-restored",
|
|
1864
|
+
"workspace-capture-started",
|
|
1863
1865
|
"workspace-capture",
|
|
1864
1866
|
"trace-unpropagated",
|
|
1865
1867
|
"seat-segment",
|
|
@@ -1940,10 +1942,12 @@ async function replaySpawnTree(journal, blobs, root) {
|
|
|
1940
1942
|
if (ev.kind === "workspace-checkpoint-requested") continue;
|
|
1941
1943
|
if (ev.kind === "workspace-checkpoint") continue;
|
|
1942
1944
|
if (ev.kind === "workspace-checkpoint-fork-requested") continue;
|
|
1945
|
+
if (ev.kind === "workspace-checkpoint-fork-ready") continue;
|
|
1943
1946
|
if (ev.kind === "workspace-checkpoint-fork-teardown") continue;
|
|
1944
1947
|
if (ev.kind === "workspace-checkpoint-capture") continue;
|
|
1945
1948
|
if (ev.kind === "workspace-checkpoint-cleanup") continue;
|
|
1946
1949
|
if (ev.kind === "workspace-restored") continue;
|
|
1950
|
+
if (ev.kind === "workspace-capture-started") continue;
|
|
1947
1951
|
if (ev.kind === "workspace-capture") continue;
|
|
1948
1952
|
if (ev.kind === "trace-unpropagated") continue;
|
|
1949
1953
|
if (ev.kind === "seat-segment" || ev.kind === "seat-materialized" || ev.kind === "seat-paused") continue;
|
|
@@ -2361,7 +2365,7 @@ function assertRuntimeTimestamp(value, label) {
|
|
|
2361
2365
|
const harnessNativePayloadType = "raw";
|
|
2362
2366
|
/** Parse canonical payload fields without treating transport identity as event data. */
|
|
2363
2367
|
function parseCanonicalTransportEvent(type, data, normalized, source) {
|
|
2364
|
-
if (!isRecord$
|
|
2368
|
+
if (!isRecord$4(data)) throw new Error(`${source} emitted a canonical event without an object payload`);
|
|
2365
2369
|
const outerType = String(type ?? "");
|
|
2366
2370
|
const harnessNative = outerType === harnessNativePayloadType;
|
|
2367
2371
|
if (normalized !== void 0) {
|
|
@@ -2383,10 +2387,10 @@ function parseCanonicalTransportEvent(type, data, normalized, source) {
|
|
|
2383
2387
|
}
|
|
2384
2388
|
/** Extract shared event identity without privileging one provider wire shape. */
|
|
2385
2389
|
function extractTransportEventIdentity(event) {
|
|
2386
|
-
const record = isRecord$
|
|
2387
|
-
const data = isRecord$
|
|
2388
|
-
const providerEvent = isRecord$
|
|
2389
|
-
const providerData = isRecord$
|
|
2390
|
+
const record = isRecord$4(event) ? event : {};
|
|
2391
|
+
const data = isRecord$4(record.data) ? record.data : {};
|
|
2392
|
+
const providerEvent = isRecord$4(record.providerEvent) ? record.providerEvent : {};
|
|
2393
|
+
const providerData = isRecord$4(providerEvent.data) ? providerEvent.data : {};
|
|
2390
2394
|
const eventId = canonicalEventId(record, data, providerEvent, providerData);
|
|
2391
2395
|
const cursor = stableString(record.cursor ?? data.cursor ?? providerEvent.cursor ?? providerData.cursor);
|
|
2392
2396
|
const sequence = optionalSequence(record.sequence ?? data.sequence ?? providerEvent.sequence ?? providerData.sequence);
|
|
@@ -2434,7 +2438,7 @@ function optionalTimestamp(value) {
|
|
|
2434
2438
|
assertRuntimeTimestamp(value, "occurredAt");
|
|
2435
2439
|
return value;
|
|
2436
2440
|
}
|
|
2437
|
-
function isRecord$
|
|
2441
|
+
function isRecord$4(value) {
|
|
2438
2442
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2439
2443
|
}
|
|
2440
2444
|
//#endregion
|
|
@@ -3698,16 +3702,28 @@ function executorEvidenceWriter(args) {
|
|
|
3698
3702
|
});
|
|
3699
3703
|
};
|
|
3700
3704
|
}
|
|
3701
|
-
/** @internal The journal
|
|
3705
|
+
/** @internal The journal writers for `onWorkspaceCapture` and `onWorkspaceCaptureStarted`;
|
|
3706
|
+
* `nextSequence` is the node's own. */
|
|
3702
3707
|
function workspaceCaptureWriter(args) {
|
|
3703
|
-
return
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3708
|
+
return {
|
|
3709
|
+
onWorkspaceCapture: async (capture) => {
|
|
3710
|
+
await args.journal.appendEvent(args.rootId, {
|
|
3711
|
+
kind: "workspace-capture",
|
|
3712
|
+
id: args.nodeId,
|
|
3713
|
+
...detachedSnapshot(capture, "workspace capture timing"),
|
|
3714
|
+
seq: args.nextSequence(),
|
|
3715
|
+
at: new Date(args.now()).toISOString()
|
|
3716
|
+
});
|
|
3717
|
+
},
|
|
3718
|
+
onWorkspaceCaptureStarted: async (capture) => {
|
|
3719
|
+
await args.journal.appendEvent(args.rootId, {
|
|
3720
|
+
kind: "workspace-capture-started",
|
|
3721
|
+
id: args.nodeId,
|
|
3722
|
+
...detachedSnapshot(capture, "workspace capture start"),
|
|
3723
|
+
seq: args.nextSequence(),
|
|
3724
|
+
at: new Date(args.now()).toISOString()
|
|
3725
|
+
});
|
|
3726
|
+
}
|
|
3711
3727
|
};
|
|
3712
3728
|
}
|
|
3713
3729
|
function retainedExecutorContext(ctx) {
|
|
@@ -4183,9 +4199,9 @@ async function exactSessionResult(session) {
|
|
|
4183
4199
|
return session.result();
|
|
4184
4200
|
}
|
|
4185
4201
|
function assertEventBinding(source, controlRef) {
|
|
4186
|
-
const transport = isRecord$
|
|
4187
|
-
const payload = isRecord$
|
|
4188
|
-
const providerEvent = isRecord$
|
|
4202
|
+
const transport = isRecord$3(source) ? source : void 0;
|
|
4203
|
+
const payload = isRecord$3(source.data) ? source.data : void 0;
|
|
4204
|
+
const providerEvent = isRecord$3(source.providerEvent) ? source.providerEvent : void 0;
|
|
4189
4205
|
const bindings = [
|
|
4190
4206
|
{
|
|
4191
4207
|
value: transport,
|
|
@@ -4213,7 +4229,7 @@ function assertCanonicalEventBinding(controlRef, event) {
|
|
|
4213
4229
|
const binding = event.request.binding;
|
|
4214
4230
|
if (binding.runId !== controlRef.runId || binding.environmentId !== controlRef.environmentId || binding.sessionId !== controlRef.sessionId || binding.executionId !== controlRef.executionId || binding.interactionId !== event.request.id) throw new Error("provider returned an interaction for another retained execution");
|
|
4215
4231
|
}
|
|
4216
|
-
function isRecord$
|
|
4232
|
+
function isRecord$3(value) {
|
|
4217
4233
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4218
4234
|
}
|
|
4219
4235
|
function assertStableText(value, label) {
|
|
@@ -5931,13 +5947,13 @@ function normalizeCodexDebugPromptNewlines(value) {
|
|
|
5931
5947
|
function jsonTextContains(value, needle) {
|
|
5932
5948
|
if (typeof value === "string") return value.includes(needle);
|
|
5933
5949
|
if (Array.isArray(value)) return value.some((item) => jsonTextContains(item, needle));
|
|
5934
|
-
if (isRecord$
|
|
5950
|
+
if (isRecord$2(value)) return Object.values(value).some((item) => jsonTextContains(item, needle));
|
|
5935
5951
|
return false;
|
|
5936
5952
|
}
|
|
5937
5953
|
function redactJsonText(value, text) {
|
|
5938
5954
|
if (typeof value === "string") return value.replaceAll(text, "");
|
|
5939
5955
|
if (Array.isArray(value)) return value.map((item) => redactJsonText(item, text));
|
|
5940
|
-
if (isRecord$
|
|
5956
|
+
if (isRecord$2(value)) return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, redactJsonText(item, text)]));
|
|
5941
5957
|
return value;
|
|
5942
5958
|
}
|
|
5943
5959
|
const CODEX_AUTH_ENV = [
|
|
@@ -6284,11 +6300,11 @@ function parseCodexTokenUsage(stdout) {
|
|
|
6284
6300
|
} catch {
|
|
6285
6301
|
throw new ValidationError$1(`runLocalHarness: Codex JSONL line ${index + 1} is not valid JSON`);
|
|
6286
6302
|
}
|
|
6287
|
-
if (isRecord$
|
|
6303
|
+
if (isRecord$2(event) && event.type === "turn.completed") completed.push(event);
|
|
6288
6304
|
}
|
|
6289
6305
|
if (completed.length !== 1) throw new ValidationError$1(`runLocalHarness: expected exactly one Codex turn.completed usage event, received ${completed.length}`);
|
|
6290
6306
|
const event = completed[0];
|
|
6291
|
-
if (!isRecord$
|
|
6307
|
+
if (!isRecord$2(event) || !isRecord$2(event.usage)) throw new ValidationError$1("runLocalHarness: Codex turn.completed event is missing usage");
|
|
6292
6308
|
const record = parseCodexUsageRecord(event.usage, "runLocalHarness: Codex");
|
|
6293
6309
|
return {
|
|
6294
6310
|
inputTokens: record.inputTokens,
|
|
@@ -6298,7 +6314,7 @@ function parseCodexTokenUsage(stdout) {
|
|
|
6298
6314
|
...record.cacheWriteInputTokens === void 0 ? {} : { cacheWriteInputTokens: record.cacheWriteInputTokens }
|
|
6299
6315
|
};
|
|
6300
6316
|
}
|
|
6301
|
-
function isRecord$
|
|
6317
|
+
function isRecord$2(value) {
|
|
6302
6318
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6303
6319
|
}
|
|
6304
6320
|
//#endregion
|
|
@@ -12059,6 +12075,11 @@ function sandboxSessionTraceSource(box, sessionId, opts = {}) {
|
|
|
12059
12075
|
const WORKSPACE_CHECKPOINT_MARKER_PATH = ".agent-runtime-checkpoint";
|
|
12060
12076
|
/** Bound on one checkpoint: environment lookup, marker write, and the provider operation. */
|
|
12061
12077
|
const WORKSPACE_CHECKPOINT_TIMEOUT_MS = 12e4;
|
|
12078
|
+
/** Bound on the captures one checkpoint rotation runs, all of them together, forks included.
|
|
12079
|
+
* A turn's own workspace capture also cuts them short when it starts. A capture cut short keeps
|
|
12080
|
+
* its checkpoint, and the owner's release, bounded by `RELEASE_CHECKPOINT_CAPTURES_MS`, captures
|
|
12081
|
+
* it again. */
|
|
12082
|
+
const WORKSPACE_CHECKPOINT_ROTATION_CAPTURES_MS = 2 * 6e4;
|
|
12062
12083
|
/** Bound on creating and reconstructing the fork a checkpoint's capture reads: a Sandbox box
|
|
12063
12084
|
* created from a snapshot (measured 2026-09-24: 19 s). The capture itself is bounded by its port. */
|
|
12064
12085
|
const WORKSPACE_CHECKPOINT_FORK_TIMEOUT_MS = 10 * 6e4;
|
|
@@ -12383,9 +12404,14 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
12383
12404
|
const reportTiming = retention?.onWorkspaceCapture;
|
|
12384
12405
|
let timing;
|
|
12385
12406
|
const capturedExecutionId = workspaceExecutionId;
|
|
12407
|
+
const started = retention?.onWorkspaceCaptureStarted?.({
|
|
12408
|
+
executionId: capturedExecutionId,
|
|
12409
|
+
environmentId: next.id
|
|
12410
|
+
}).catch(() => void 0) ?? Promise.resolve();
|
|
12386
12411
|
workspaceCapturePromise = Promise.all([nativeInFlight, liveInFlight]).then(() => captureProviderWorkspaceSnapshot(workspaceRetention, captureContext, "environment", reportTiming === void 0 ? void 0 : (measured) => {
|
|
12387
12412
|
timing = measured;
|
|
12388
12413
|
})).finally(async () => {
|
|
12414
|
+
await started;
|
|
12389
12415
|
if (timing === void 0 || reportTiming === void 0) return;
|
|
12390
12416
|
await reportTiming({
|
|
12391
12417
|
executionId: capturedExecutionId,
|
|
@@ -14778,7 +14804,7 @@ function chatCompletionBody(cfg, messages, opts) {
|
|
|
14778
14804
|
const maxTokens = opts?.maxTokens ?? cfg.maxTokens;
|
|
14779
14805
|
const maxCompletionTokens = opts?.maxCompletionTokens ?? cfg.maxCompletionTokens;
|
|
14780
14806
|
return {
|
|
14781
|
-
...providerRequestExtras(opts?.extraBody, [
|
|
14807
|
+
...withRouting(providerRequestExtras(opts?.extraBody, [
|
|
14782
14808
|
"model",
|
|
14783
14809
|
"messages",
|
|
14784
14810
|
"temperature",
|
|
@@ -14788,7 +14814,7 @@ function chatCompletionBody(cfg, messages, opts) {
|
|
|
14788
14814
|
"reasoning_effort",
|
|
14789
14815
|
"stream",
|
|
14790
14816
|
"stream_options"
|
|
14791
|
-
]),
|
|
14817
|
+
]), cfg.routing),
|
|
14792
14818
|
model: cfg.model,
|
|
14793
14819
|
messages,
|
|
14794
14820
|
...temperature !== void 0 ? { temperature } : {},
|
|
@@ -14914,7 +14940,7 @@ async function routerChatWithTools(cfg, messages, tools, opts) {
|
|
|
14914
14940
|
function toolCompletionBody(cfg, messages, tools, opts) {
|
|
14915
14941
|
const maxCompletionTokens = opts?.maxCompletionTokens ?? cfg.maxCompletionTokens;
|
|
14916
14942
|
return {
|
|
14917
|
-
...providerRequestExtras(opts?.extraBody, [
|
|
14943
|
+
...withRouting(providerRequestExtras(opts?.extraBody, [
|
|
14918
14944
|
"model",
|
|
14919
14945
|
"messages",
|
|
14920
14946
|
"tools",
|
|
@@ -14926,7 +14952,7 @@ function toolCompletionBody(cfg, messages, tools, opts) {
|
|
|
14926
14952
|
"reasoning_effort",
|
|
14927
14953
|
"stream",
|
|
14928
14954
|
"stream_options"
|
|
14929
|
-
]),
|
|
14955
|
+
]), cfg.routing),
|
|
14930
14956
|
model: cfg.model,
|
|
14931
14957
|
messages,
|
|
14932
14958
|
...tools.length > 0 ? {
|
|
@@ -14943,6 +14969,29 @@ function toolCompletionBody(cfg, messages, tools, opts) {
|
|
|
14943
14969
|
...opts?.reasoningEffort ? { reasoning_effort: opts.reasoningEffort } : {}
|
|
14944
14970
|
};
|
|
14945
14971
|
}
|
|
14972
|
+
/** The request extras with the transport's provider routing merged into `providerOptions`. */
|
|
14973
|
+
function withRouting(extras, routing) {
|
|
14974
|
+
if (routing === void 0) return extras;
|
|
14975
|
+
const gateway = {
|
|
14976
|
+
...routing.only !== void 0 ? { only: [...routing.only] } : {},
|
|
14977
|
+
...routing.allowFallbacks !== void 0 ? { allowFallbacks: routing.allowFallbacks } : {}
|
|
14978
|
+
};
|
|
14979
|
+
const providerOptions = isRecord$1(extras.providerOptions) ? extras.providerOptions : {};
|
|
14980
|
+
return {
|
|
14981
|
+
...extras,
|
|
14982
|
+
...Object.keys(gateway).length === 0 ? {} : { providerOptions: {
|
|
14983
|
+
...providerOptions,
|
|
14984
|
+
gateway: {
|
|
14985
|
+
...isRecord$1(providerOptions.gateway) ? providerOptions.gateway : {},
|
|
14986
|
+
...gateway
|
|
14987
|
+
}
|
|
14988
|
+
} },
|
|
14989
|
+
...routing.requireModel !== void 0 ? { require_model: routing.requireModel } : {}
|
|
14990
|
+
};
|
|
14991
|
+
}
|
|
14992
|
+
function isRecord$1(value) {
|
|
14993
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14994
|
+
}
|
|
14946
14995
|
function providerRequestExtras(extraBody, reservedFields) {
|
|
14947
14996
|
if (!extraBody) return {};
|
|
14948
14997
|
const extras = { ...extraBody };
|
|
@@ -21040,6 +21089,7 @@ const routerInlineExecutor = (spec, ctx) => {
|
|
|
21040
21089
|
const r = await runRouterTransport("routerInlineExecutor", () => seam.tools ? (profileExecution.stream === true ? streamRouterChatWithTools : routerChatWithTools)({
|
|
21041
21090
|
routerBaseUrl: seam.routerBaseUrl,
|
|
21042
21091
|
routerKey: seam.routerKey,
|
|
21092
|
+
...seam.routing ? { routing: seam.routing } : {},
|
|
21043
21093
|
model,
|
|
21044
21094
|
...profileExecution.retry !== void 0 ? { retry: profileExecution.retry } : {},
|
|
21045
21095
|
...seam.complete ? { complete: seam.complete } : {}
|
|
@@ -21055,6 +21105,7 @@ const routerInlineExecutor = (spec, ctx) => {
|
|
|
21055
21105
|
}) : (profileExecution.stream === true ? streamRouterChatWithUsage : routerChatWithUsage)({
|
|
21056
21106
|
routerBaseUrl: seam.routerBaseUrl,
|
|
21057
21107
|
routerKey: seam.routerKey,
|
|
21108
|
+
...seam.routing ? { routing: seam.routing } : {},
|
|
21058
21109
|
model,
|
|
21059
21110
|
...profileExecution.retry !== void 0 ? { retry: profileExecution.retry } : {},
|
|
21060
21111
|
...seam.complete ? { complete: seam.complete } : {}
|
|
@@ -21227,6 +21278,7 @@ const routerToolsInlineExecutor = (spec, ctx) => {
|
|
|
21227
21278
|
const profileExecution = routerProfileExecution(spec.profile, {
|
|
21228
21279
|
routerBaseUrl: seam.routerBaseUrl,
|
|
21229
21280
|
routerKey: seam.routerKey,
|
|
21281
|
+
...seam.routing ? { routing: seam.routing } : {},
|
|
21230
21282
|
...seam.complete ? { complete: seam.complete } : {},
|
|
21231
21283
|
tools: seam.tools
|
|
21232
21284
|
}, { multiTurn: true });
|
|
@@ -21339,6 +21391,7 @@ const routerToolsInlineExecutor = (spec, ctx) => {
|
|
|
21339
21391
|
res = await (profileExecution.stream === true ? streamRouterChatWithTools : routerChatWithTools)({
|
|
21340
21392
|
routerBaseUrl: seam.routerBaseUrl,
|
|
21341
21393
|
routerKey: seam.routerKey,
|
|
21394
|
+
...seam.routing ? { routing: seam.routing } : {},
|
|
21342
21395
|
model,
|
|
21343
21396
|
...profileExecution.retry !== void 0 ? { retry: profileExecution.retry } : {},
|
|
21344
21397
|
...seam.complete ? { complete: seam.complete } : {}
|
|
@@ -25297,13 +25350,11 @@ function registerScopeRetainedOwner(scope, args) {
|
|
|
25297
25350
|
now: args.now,
|
|
25298
25351
|
traceRoots
|
|
25299
25352
|
}),
|
|
25300
|
-
onWorkspaceCapture:
|
|
25301
|
-
|
|
25302
|
-
|
|
25303
|
-
|
|
25304
|
-
|
|
25305
|
-
now: args.now
|
|
25306
|
-
}),
|
|
25353
|
+
onWorkspaceCapture: (capture) => ownerCaptureWriter(state).onWorkspaceCapture(capture),
|
|
25354
|
+
onWorkspaceCaptureStarted: (capture) => {
|
|
25355
|
+
state.rotationCaptures?.abort(/* @__PURE__ */ new Error("the turn's workspace capture started first; checkpoint kept"));
|
|
25356
|
+
return ownerCaptureWriter(state).onWorkspaceCaptureStarted(capture);
|
|
25357
|
+
},
|
|
25307
25358
|
onEndOfTurnWork: (work) => {
|
|
25308
25359
|
const prior = state.turnEnd;
|
|
25309
25360
|
const settled = work.catch(() => void 0);
|
|
@@ -25651,7 +25702,33 @@ async function checkpointOwnerWorkspace(scope, state) {
|
|
|
25651
25702
|
at
|
|
25652
25703
|
});
|
|
25653
25704
|
const events = await args.journal.loadTree(args.rootId) ?? [];
|
|
25654
|
-
|
|
25705
|
+
const owned = pendingCheckpoints(events, state).filter((event) => event.environmentId === environment.id && state.captureRefused?.has(event.checkpoint.checkpointId) !== true);
|
|
25706
|
+
const rotation = new AbortController();
|
|
25707
|
+
state.rotationCaptures = rotation;
|
|
25708
|
+
const timer = setTimeout(() => rotation.abort(/* @__PURE__ */ new Error(`the rotation's ${WORKSPACE_CHECKPOINT_ROTATION_CAPTURES_MS} ms for checkpoint captures ran out; checkpoint kept`)), WORKSPACE_CHECKPOINT_ROTATION_CAPTURES_MS);
|
|
25709
|
+
try {
|
|
25710
|
+
await cleanCheckpoints(state, branching, owned.slice(0, -2), events, AbortSignal.any([scope.signal, rotation.signal]));
|
|
25711
|
+
} finally {
|
|
25712
|
+
clearTimeout(timer);
|
|
25713
|
+
if (state.rotationCaptures === rotation) delete state.rotationCaptures;
|
|
25714
|
+
}
|
|
25715
|
+
}
|
|
25716
|
+
/**
|
|
25717
|
+
* The owner's workspace-capture journal writers. A turn's capture starting cuts short the
|
|
25718
|
+
* checkpoint rotation's captures: on Discovery canary test-acceptance-canary-20261019j (Runtime
|
|
25719
|
+
* 0.327.0) a rotation capture of an older checkpoint started 4 s before the root's final capture,
|
|
25720
|
+
* on the same evidence store, and the final capture spent 26.6 of its 32.6 minutes storing its
|
|
25721
|
+
* archive until the root's budget deadline aborted the rotation.
|
|
25722
|
+
*/
|
|
25723
|
+
function ownerCaptureWriter(state) {
|
|
25724
|
+
const { args } = state;
|
|
25725
|
+
return workspaceCaptureWriter({
|
|
25726
|
+
journal: args.journal,
|
|
25727
|
+
rootId: args.rootId,
|
|
25728
|
+
nodeId: args.nodeId,
|
|
25729
|
+
nextSequence: () => state.nextSequence(),
|
|
25730
|
+
now: args.now
|
|
25731
|
+
});
|
|
25655
25732
|
}
|
|
25656
25733
|
/** Reconstruct authority for this source only; a replacement cannot own its snapshots. */
|
|
25657
25734
|
async function checkpointHandle(state, sourceEnvironmentId, signal) {
|
|
@@ -25884,6 +25961,19 @@ async function captureBeforeCleanup(state, branching, event, events, parent) {
|
|
|
25884
25961
|
const environment = await runAbortable(() => get(forkId), forkSignal, "checkpoint fork lookup timed out");
|
|
25885
25962
|
if (environment === null || environment.id !== forkId || environment.provider !== provider.name) throw new Error(`fork ${forkId} could not be reconstructed`);
|
|
25886
25963
|
parent?.throwIfAborted();
|
|
25964
|
+
await args.journal.appendEvent(args.rootId, {
|
|
25965
|
+
kind: "workspace-checkpoint-fork-ready",
|
|
25966
|
+
id: args.nodeId,
|
|
25967
|
+
provider: event.provider,
|
|
25968
|
+
environmentId: event.environmentId,
|
|
25969
|
+
checkpointId,
|
|
25970
|
+
fork: {
|
|
25971
|
+
idempotencyKey: request.idempotencyKey,
|
|
25972
|
+
environmentId: forkId
|
|
25973
|
+
},
|
|
25974
|
+
seq: state.nextSequence(),
|
|
25975
|
+
at: new Date(args.now()).toISOString()
|
|
25976
|
+
});
|
|
25887
25977
|
return {
|
|
25888
25978
|
environment,
|
|
25889
25979
|
checkpoint: event.checkpoint,
|
|
@@ -27615,7 +27705,7 @@ function createScope(args) {
|
|
|
27615
27705
|
live.recoveryPending = false;
|
|
27616
27706
|
});
|
|
27617
27707
|
let captureSeq = 0;
|
|
27618
|
-
const onWorkspaceCapture = workspaceCaptureWriter({
|
|
27708
|
+
const { onWorkspaceCapture, onWorkspaceCaptureStarted } = workspaceCaptureWriter({
|
|
27619
27709
|
journal: args.journal,
|
|
27620
27710
|
rootId: args.root,
|
|
27621
27711
|
nodeId: id,
|
|
@@ -27652,6 +27742,7 @@ function createScope(args) {
|
|
|
27652
27742
|
}),
|
|
27653
27743
|
onPause,
|
|
27654
27744
|
onWorkspaceCapture,
|
|
27745
|
+
onWorkspaceCaptureStarted,
|
|
27655
27746
|
continueInvocation: async (nextTask) => {
|
|
27656
27747
|
controller.signal.throwIfAborted();
|
|
27657
27748
|
if (live.acceptedResult === void 0) throw new ValidationError$1("scope: a retained child continues only after its invocation committed a result");
|
|
@@ -31850,4 +31941,4 @@ function isNonEmptySpend(s) {
|
|
|
31850
31941
|
//#endregion
|
|
31851
31942
|
export { SPAWN_RESOURCE_PATH_MAX_BYTES as $, FileSpawnJournal as $i, persistHarnessTranscript as $n, renderProfileMaterializationIssues as $r, AUTHORITY_MARKERS as $t, restoreScopeOwnerAcceptedExecution as A, awaitAbortable$1 as Ai, providerAsExecutor as An, runWorktreeHarness as Ar, verdictFromJudgeScore as At, bindScopeRetainedOwnerProvider as B, canonicalStreamEventFromSandboxEvent as Bi, startRetainedRun as Bn, CodexExecutionDiagnosticError as Br, createSteerableSandboxSession as Bt, deriveNodeExecutionIdentity as C, spendFromUsageTotals as Ca, unknownExecutionBindingReceipt as Ci, captureBeforeDestroy as Cn, toOtelAttributes as Cr, bestComposite as Ct, recordScopeOwnerDriverAttempt as D, promptFromAgentTurnInput as Da, projectSandboxOutcome as Di, runBrainLoop as Dn, sanitizeKnowledgeReadinessReport as Dr, expandQuestions as Dt, noteScopeOwnerPlannedExecution as E, resolveRedactor as Ea, executableAgentSpecSnapshot as Ei, routerBrain as En, sanitizeAgentRuntimeEvent as Er, distillFindings as Et, authoredSeatStages as F, unavailablePauseMs as Fi, sandboxSessionTraceSource as Fn, LOCAL_HARNESSES as Fr, createExecutor as Ft, reconcileScopeRetainedOwnerEnvironment as G, mapSandboxEvent as Gi, createWorkerSlots as Gn, controlProfileMaterialization as Gr, workerTraceEnv as Gt, noteScopeRetainedOwnerCoordination as H, createSandboxUsageLedger as Hi, retainedCreateMaterial as Hn, AGENT_PROFILE_MATERIALIZATION_AXES as Hr, createInPlaceCliExecutor as Ht, seatExecutionProfile as I, unavailableSignalOfFailure as Ii, bridgeRuntimeAttachmentsKey as In, harnessInvocation as Ir, createExecutorRegistry as It, scopeRetainedOwnerPriorSpend as J, sandboxEventServedBackend as Ji, abortError as Jn, profileMaterializationAxes$1 as Jr, taskToPrompt as Jt, scopeRetainedOwnerContext as K, mapSandboxToolEvent as Ki, openSlotGroup as Kn, defineProfileMaterializationContract as Kr, workerTraceHeaders as Kt, abandonScopeRetainedOwnerInvocation as L, TRACE_ROOT_SCHEMA as Li, bridgeStopSignalKey as Ln, harnessSupportsReasoningEffort as Lr, snapshotExecutorConfig as Lt, settledToIteration as M, settlementFailureCause as Mi, resolveAgentEnvironmentProvider as Mn, createWorktree as Mr, captureReusableExecutorConfig as Mt, SeatChain as N, registerRetainedExecutorPreparation as Ni, createPushTraceSource as Nn, removeWorktree as Nr, cliInPlaceExecutor as Nt, recordScopeOwnerMaterialization as O, promptOptionsFromAgentTurnInput as Oa, readSandboxOutcome as Oi, LEAF_CONTINUATION_TASK as On, sanitizeRuntimeStreamEvent as Or, failedItems as Ot, SeatChainExhaustedError as P, retainedExecutorSeamKey as Pi, decodeToolPart as Pn, DEFAULT_LOCAL_HARNESS as Pr, cliWorktreeExecutor as Pt, scopeRetainedOwnerTurnEnded as Q, FileResultBlobStore as Qi, harnessTranscriptArtifact as Qn, promptResourceProfileMaterialization as Qr, createInbox as Qt, beginScopeRetainedOwnerDrive as R, TRACE_SUMMARY_SCHEMA as Ri, reconnectRetainedRun as Rn, localHarnessExecutable as Rr, createWorktreeCliExecutor as Rt, createScope as S, spendFromUsageEvents as Sa, runtimeOwnedScopeOwnerRuntime as Si, SandboxEvidenceRetentionError as Sn, padTraceId as Sr, admitFinding as St, meterRuntimeOwnedProviderAttempt as T, defaultRedactorIdentityMaterial as Ta, executableAgentProfileSnapshot as Ti, readPromptOptions as Tn, createRuntimeStreamEventCollector as Tr, createContinuationKeeper as Tt, prepareScopeRetainedOwnerSeatSwitch as U, extractLlmCallEvent as Ui, destroyInteractiveEnvironment as Un, assertProfileMaterialization as Ur, WORKER_TRACE_PROPAGATION as Ut, consumeScopeRetainedOwnerResult as V, createSandboxToolPartState as Vi, startRetainedRunInEnvironment as Vn, terminateProcessTreeAndConfirm as Vr, createRouterTranscript as Vt, prepareScopeRetainedOwnerTask as W, isSandboxTerminalEvent as Wi, environmentGone as Wn, assertProfileMaterializes as Wr, readWorkerTraceContext as Wt, scopeRetainedOwnerRestorePoint as X, sumSandboxUsage as Xi, runAbortable as Xn, promptModelProfileMaterialization as Xr, createActivityLog as Xt, scopeRetainedOwnerResourceReader as Y, sandboxProgressEvents as Yi, linkAbort as Yn, promptControlProfileMaterialization as Yr, DEFAULT_STALL_AFTER_MS as Yt, scopeRetainedOwnerResult as Z, decodeHarnessUsage as Zi, captureHarnessTranscript as Zn, promptOnlyProfileMaterialization as Zr, readWorkerProgress as Zt, isDriverSpec as _, ReservationWaitRefused as _a, runtimeOwnedDriveHarnessProviderEvidence as _i, defaultSelectWinner as _n, createOtelExporter as _r, mapExecutorResult as _t, collectDelivered as a, replaySpawnTree as aa, worktreeCliProfileMaterialization as ai, peerMailTools as an, runCodeMode as ar, providerVisibleProfile as at, assertRecursiveReservationPolicy as b, meterUsageEvent as ba, runtimeOwnedExecutorProviderEvidence as bi, createSandboxLineage as bn, loopEventToOtelSpan as br, CheckUnavailableError as bt, runTree as c, isTraceAnalysisStore as ca, authoredAgentIdentity as ci, isTerminalNodeStatus as cn, ROUTER_PRICE_SOURCE as cr, attachWorker as ct, classifyDriverFailure as d, contentAddress as da, inheritRuntimeOwnedExecutorAttestation as di, addHarnessUsage as dn, readTraceContextFromEnv as dr, recoverRetainedInteractiveRun as dt, InMemoryResultBlobStore as ea, renderUnsupported as ei, DEFAULT_PEER_MAIL_LIMITS as en, readHarnessTranscript as er, environmentReader as et, runDriverWithRetry as f, detachedFrozen as fa, knownExecutionBindingReceipt as fi, createCodexRolloutStoreReader as fn, traceContextToEnv as fr, startRetainedInteractiveRun as ft, driverExecutorFactory as g, BudgetReconcileFault as ga, recordRuntimeOwnedDriveHarnessProviderEvidence as gi, createSandboxForSpec as gn, createOpenInferenceFileExporter as gr, gateOnDeliverable as gt, driverChild as h, errMessage as ha, providerAttemptEvidence as hi, TERMINAL_DECISIONS as hn, buildRuntimeEventOtelSpans as hr, rollingDispatch as ht, bestDelivered as i, materializeTreeView as ia, validateProfileMaterialization as ii, isPeerMailEnvelope as in, describeCodeModeTools as ir, coordinationProfileToolPrefix as it, scopeOwnerExecutorNodeContext as j, runtimeFailureCause as ji, providerAsSandboxClient as jn, captureWorktreeDiff as jr, bindReusableExecutorExecutionId as jt, recordScopeOwnerPause as k, providerMessageText as ka, abortError$1 as ki, createAgentEnvironmentProviderRegistry as kn, runSettledCommand as kr, passedItems as kt, DriverAttemptsExhaustedError as l, parseWorkerToolTraceArtifact as la, authoredProfileDigest as li, bridgeAdmissionRefusal as ln, createPropagatingTraceEmitter as lr, readWorkerInteractiveBinding as lt, upstreamUnavailableSignal as m, executorFailure as ma, newExecutionAttemptId as mi, readCodexRolloutSession as mn, buildLoopSpanNodes as mr, queueOf as mt, createRootHandle as n, insideCursorNamespace as na, sandboxProfileMaterialization as ni, claimsAuthority as nn, retainHarnessTranscript as nr, resolveSpawnResourcePaths as nt, pickBestDelivered as o, WORKER_TOOL_TRACE_SCHEMA_VERSION as oa, attestRuntimeOwnedPendingExecutor as oi, peerMailVerbNames as on, priceTokens as or, runtimeGraphMetadataKey as ot, summarizeDriverAttempts as p, detachedSnapshot as pa, knownMaterializationReceipt as pi, harnessUsageIsEmpty as pn, buildLoopOtelSpans as pr, freeSlots as pt, scopeRetainedOwnerJournalRoot as q, notifySandboxEventObserver as qi, RunCancellationReason as qn, fullProfileMaterialization as qr, workerTraceSeamKey as qt, createSupervisor as r, loadSpawnForest as ra, unsupportedProfileDimensions as ri, createPeerMailbox as rn, createCodeModeTools as rr, coordinationMcpAlias as rt, runFinalizer as s, captureWorkerTraceEvidence as sa, attestRuntimeOwnedScopeOwner as si, isLiveNodeStatus as sn, routerTokenPrice as sr, interactiveAdmissionSeamKey as st, DEFAULT_MAX_DEPTH as t, InMemorySpawnJournal as ta, sandboxActProfileMaterialization as ti, PEER_MAIL_WIRE_KEY as tn, resolveHarnessTranscriptCapture as tr, hostDirectoryReader as tt, HarnessTurnFailedError as u, workerTraceAnalysisStore as ua, finalizeRuntimeOwnedPendingExecutor as ui, bridgeModelRouteRefusal as un, mergeTraceEnv as ur, reconnectRetainedInteractiveRun as ut, withDriverExecutor as v, assertValidBudget as va, runtimeOwnedExecutorExecutionBinding as vi, isTerminalDecision as vn, flatOtelSpan as vr, CONTINUATIONS_DIR as vt, meterRuntimeOwnedAccounting as w, defaultRedactor as wa, unknownMaterializationReceipt as wi, assertBoxlessPromptOptions as wn, createRuntimeEventCollector as wr, checkVerdictOf as wt, beginScopeOwnerAttempt as x, newUsageTotals as xa, runtimeOwnedPendingExecutorMaterialization as xi, acquireSandbox as xn, padSpanId as xr, admitContinuationPolicy as xt, SUBTREE_RESULT_LIMIT as y, createBudgetPool as ya, runtimeOwnedExecutorMaterialization as yi, runAgentRounds as yn, generateSpanId as yr, CONTINUATION_FACTS as yt, bindScopeRetainedOwnerEnvironmentId as z, assertSandboxServedModel as zi, recoverRetainedRun as zn, parseCodexTokenUsage as zr, DEFAULT_SANDBOX_STEERING_MAX_TURNS as zt };
|
|
31852
31943
|
|
|
31853
|
-
//# sourceMappingURL=supervisor-
|
|
31944
|
+
//# sourceMappingURL=supervisor-DJXryb1R.js.map
|