@tangle-network/agent-runtime 10.0.3 → 10.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/{activation-kitznAHo.js → activation-38MolXIP.js} +2 -2
- package/dist/{activation-kitznAHo.js.map → activation-38MolXIP.js.map} +1 -1
- package/dist/{activation-DbSxPRUW.d.ts → activation-Ckx0yHjT.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{continuation-BDeKJgV3.js → continuation-CL4B1Y4M.js} +3 -3
- package/dist/{continuation-BDeKJgV3.js.map → continuation-CL4B1Y4M.js.map} +1 -1
- package/dist/{delegate-D8yX_2K7.js → delegate-dhNeiaH_.js} +2 -2
- package/dist/{delegate-D8yX_2K7.js.map → delegate-dhNeiaH_.js.map} +1 -1
- package/dist/{driver-control-acknowledgers-BTSr3Znq.js → driver-control-acknowledgers-C6GaGBf_.js} +98 -57
- package/dist/{driver-control-acknowledgers-BTSr3Znq.js.map → driver-control-acknowledgers-C6GaGBf_.js.map} +1 -1
- package/dist/durable-file-DJ3JsA4B.js +1 -0
- package/dist/{durable-file-DUcTDWJD.js → durable-file-lXnojyij.js} +15 -4
- package/dist/{durable-file-DUcTDWJD.js.map → durable-file-lXnojyij.js.map} +1 -1
- package/dist/durable-writer-thread.js +5 -5
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +13 -13
- package/dist/{graph-4ep9laIH.js → graph-CwLg3LGC.js} +7 -7
- package/dist/{graph-4ep9laIH.js.map → graph-CwLg3LGC.js.map} +1 -1
- package/dist/{graph-registry-B-EGvJ-3.js → graph-registry-Bs6mGKou.js} +1 -1
- package/dist/{graph-registry-BxEBeihr.js → graph-registry-DtGd03zk.js} +4 -4
- package/dist/{graph-registry-BxEBeihr.js.map → graph-registry-DtGd03zk.js.map} +1 -1
- package/dist/{improve-CJf87tBs.js → improve-C_LKfgH9.js} +7 -7
- package/dist/{improve-CJf87tBs.js.map → improve-C_LKfgH9.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +4 -4
- package/dist/{jsonl-file-CVAWegN-.js → jsonl-file-DyzefaZ6.js} +3 -3
- package/dist/{jsonl-file-CVAWegN-.js.map → jsonl-file-DyzefaZ6.js.map} +1 -1
- package/dist/kernel.d.ts +2 -2
- package/dist/kernel.js +18 -18
- package/dist/{loop-runner-Ckj-Zz3-.js → loop-runner-BS3ru-yj.js} +2 -2
- package/dist/{loop-runner-Ckj-Zz3-.js.map → loop-runner-BS3ru-yj.js.map} +1 -1
- package/dist/{loop-runner-CayC8e9K.d.ts → loop-runner-LWqWf8FD.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +5 -5
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-NjROV7AQ.js → provision-supervisor-D8N0l2DM.js} +6 -6
- package/dist/{provision-supervisor-NjROV7AQ.js.map → provision-supervisor-D8N0l2DM.js.map} +1 -1
- package/dist/{result-blob-store-BR-BVZrg.js → result-blob-store-DfTcyQ05.js} +3 -3
- package/dist/{result-blob-store-BR-BVZrg.js.map → result-blob-store-DfTcyQ05.js.map} +1 -1
- package/dist/{run-cancellation-C9V1lYhq.js → run-cancellation-D3qc9wAD.js} +3 -3
- package/dist/{run-cancellation-C9V1lYhq.js.map → run-cancellation-D3qc9wAD.js.map} +1 -1
- package/dist/{run-lock-Y3u9kwM0.js → run-lock-D1xnb9ve.js} +3 -3
- package/dist/{run-lock-Y3u9kwM0.js.map → run-lock-D1xnb9ve.js.map} +1 -1
- package/dist/{run-reopen-CHYTHk7x.js → run-reopen-DVM5AEKV.js} +6 -6
- package/dist/{run-reopen-CHYTHk7x.js.map → run-reopen-DVM5AEKV.js.map} +1 -1
- package/dist/{run-state-DgKo8_tO.js → run-state-tgQ-S9Ln.js} +7 -7
- package/dist/{run-state-DgKo8_tO.js.map → run-state-tgQ-S9Ln.js.map} +1 -1
- package/dist/{runtime-CdthBQUs.js → runtime-BTECV05R.js} +20 -20
- package/dist/{runtime-CdthBQUs.js.map → runtime-BTECV05R.js.map} +1 -1
- package/dist/{search-executor-Bb0WuI_Z.js → search-executor-Uco2_KTB.js} +3 -3
- package/dist/{search-executor-Bb0WuI_Z.js.map → search-executor-Uco2_KTB.js.map} +1 -1
- package/dist/{server-BCtyL7jH.js → server-BMp24-xn.js} +3 -3
- package/dist/{server-BCtyL7jH.js.map → server-BMp24-xn.js.map} +1 -1
- package/dist/{settle-record-Beh-sXBW.js → settle-record-au3w7bQG.js} +4 -4
- package/dist/{settle-record-Beh-sXBW.js.map → settle-record-au3w7bQG.js.map} +1 -1
- package/dist/{structural-rollout-BRfSDPkv.js → structural-rollout-D8wufVJI.js} +3 -3
- package/dist/{structural-rollout-BRfSDPkv.js.map → structural-rollout-D8wufVJI.js.map} +1 -1
- package/dist/{supervise-DTUYxnoJ.js → supervise-DtVdvZpr.js} +9 -9
- package/dist/{supervise-DTUYxnoJ.js.map → supervise-DtVdvZpr.js.map} +1 -1
- package/dist/{supervise-identity-eMF-h1uP.js → supervise-identity-S5XwgaF3.js} +4 -4
- package/dist/{supervise-identity-eMF-h1uP.js.map → supervise-identity-S5XwgaF3.js.map} +1 -1
- package/dist/{supervision-discovery-CAUsSDno.js → supervision-discovery-Cqu4NxPV.js} +3 -3
- package/dist/{supervision-discovery-CAUsSDno.js.map → supervision-discovery-Cqu4NxPV.js.map} +1 -1
- package/dist/{supervisor-BtRRFbgF.js → supervisor-CHgCAMjm.js} +7 -7
- package/dist/{supervisor-BtRRFbgF.js.map → supervisor-CHgCAMjm.js.map} +1 -1
- package/dist/{supervisor-accounting-Cuehs4te.js → supervisor-accounting-CZ7i4cd5.js} +117 -46
- package/dist/{supervisor-accounting-Cuehs4te.js.map → supervisor-accounting-CZ7i4cd5.js.map} +1 -1
- package/dist/{supervisor-root-contract-CmFKzPps.js → supervisor-root-contract-D70KTGXF.js} +2 -2
- package/dist/{supervisor-root-contract-CmFKzPps.js.map → supervisor-root-contract-D70KTGXF.js.map} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/{top-web-D-wuEVdM.js → top-web-COrMqTRC.js} +7 -7
- package/dist/{top-web-D-wuEVdM.js.map → top-web-COrMqTRC.js.map} +1 -1
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-PBoTtcbX.d.ts → types-9xsn2GGY.d.ts} +9 -2
- package/package.json +1 -1
- package/dist/durable-file-XqOyDf7q.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as RetainedInteractiveAdmissionError, d as RetainedRunDispatchBindingError, f as RuntimeRunStateError, l as RetainedInteractiveBindingError, m as ValidationError, r as BackendTransportError, u as RetainedRunAdmissionError } from "./errors-DG8yufqX.js";
|
|
2
|
-
import { _ as runAbortable, c as withJsonlFileLock, d as journalFileStamp, f as sha256, h as deadlineSignal, l as appendCommittedJsonLine, o as readCommittedJsonLines, p as RunCancellationReason, r as prepareJsonlAppend, t as isNoEntError, v as signalAbortError } from "./jsonl-file-
|
|
2
|
+
import { _ as runAbortable, c as withJsonlFileLock, d as journalFileStamp, f as sha256, h as deadlineSignal, l as appendCommittedJsonLine, o as readCommittedJsonLines, p as RunCancellationReason, r as prepareJsonlAppend, t as isNoEntError, v as signalAbortError } from "./jsonl-file-DyzefaZ6.js";
|
|
3
3
|
import { c as checkInIdleMs, d as teardownExecutor, n as CHILD_DEADLINE_REASON, o as armDeadlineTimer, s as boundedChildDeadlineAt, u as singleFlightTeardown } from "./deadline-CySmJ_0S.js";
|
|
4
4
|
import { A as withBudgetResources, C as unreportedSpend, D as addResourceSpend, T as zeroSpend, a as cloneSpend, c as errorMessage, f as isAsyncIterable, i as chargedTokens, k as resourceTelemetry, n as addSpend, o as cloneTokenUsage, t as abortError, v as sleep } from "./util-qsH5cC9S.js";
|
|
5
5
|
import { $ as newUsageTotals, F as executorFailureInfra, G as BudgetReconcileFault, I as executorFailureReason, J as budgetRecoverySeeds, K as budgetLeaseUpdates, M as contentAddress, Ot as recordValue, P as executorFailure, Q as meterUsageEvent, X as createBudgetPool, Y as completedLeafBacking, Z as refreshBudgetLease, a as settlementFailureCause, d as executorEvidenceWriter, ft as extractTransportEventIdentity, h as prepareRetainedExecutor, j as traceRootWriter, l as RetainedExecutionPendingError, m as leafContinuationExecutionId, n as runtimeFailureCause, nt as assertValidBudget, o as BUDGET_CONTINUATION_TASK, pt as parseCanonicalTransportEvent, q as budgetLeases, rt as assertValidSpend, t as reportedFailureCause, tt as spendFromUsageTotals, v as retainedExecutorSeamKey } from "./failure-cause-DoCCGLDH.js";
|
|
6
6
|
import { a as errMessage, f as resolveRedactor, i as causeChain, l as errorText, n as detachedSnapshot, r as shareParsedStrings, u as defaultRedactor } from "./snapshot-BKI_w3JD.js";
|
|
7
7
|
import { p as canonicalObservedModelParts, t as assertExecutableAgentProfile } from "./model-policy-DZnL8Yj9.js";
|
|
8
8
|
import { b as verifiedArtifactChunks, g as workspaceLimits, h as safeArchivePath, i as readAgentCandidateWorkspaceArtifactFiles } from "./workspace-streams-C7PGLAUd.js";
|
|
9
|
-
import {
|
|
9
|
+
import { S as fenceRunWrite, b as runFencedAsync, c as publishExclusiveDurableFileAsync, d as writeAtomicDurableFile, f as writeAtomicDurableFileAsync, i as appendRunLinesAsync, n as appendDurableFile, o as assertNoSymlinkDescendant, r as appendRunLines, s as publishExclusiveDurableFile, x as captureRunWriteContext } from "./durable-file-lXnojyij.js";
|
|
10
10
|
import { b as sha256Bytes$1, g as deepFreezeCandidate } from "./output-artifacts-AqkZ8lO2.js";
|
|
11
11
|
import { a as withPursuitContext, i as notifyRuntimeHookEvent } from "./runtime-hooks-CsW2pfFk.js";
|
|
12
12
|
import * as traceContract from "@tangle-network/agent-trace-contract";
|
|
@@ -9490,6 +9490,19 @@ function readWorkerInteractiveBinding(eventDir, workerId) {
|
|
|
9490
9490
|
* @internal
|
|
9491
9491
|
*/
|
|
9492
9492
|
function writeWorkerInteractiveBinding(eventDir, workerId, label, journalRoot, session, now = Date.now) {
|
|
9493
|
+
const pending = prepareBinding(eventDir, workerId, label, journalRoot, session, now);
|
|
9494
|
+
if ("existing" in pending) return pending.existing;
|
|
9495
|
+
return settleBinding(eventDir, pending.binding, publishExclusiveDurableFile(pending.file, bindingText(pending.binding)));
|
|
9496
|
+
}
|
|
9497
|
+
/** `writeWorkerInteractiveBinding` without blocking the calling thread on the disk. @internal */
|
|
9498
|
+
async function writeWorkerInteractiveBindingAsync(eventDir, workerId, label, journalRoot, session, now = Date.now) {
|
|
9499
|
+
const pending = prepareBinding(eventDir, workerId, label, journalRoot, session, now);
|
|
9500
|
+
if ("existing" in pending) return pending.existing;
|
|
9501
|
+
return settleBinding(eventDir, pending.binding, await publishExclusiveDurableFileAsync(pending.file, bindingText(pending.binding)));
|
|
9502
|
+
}
|
|
9503
|
+
const bindingText = (binding) => `${JSON.stringify(binding, null, 2)}\n`;
|
|
9504
|
+
/** The binding to publish and its file, or the identical binding already published. */
|
|
9505
|
+
function prepareBinding(eventDir, workerId, label, journalRoot, session, now) {
|
|
9493
9506
|
const id = stableText$1(workerId, "worker id");
|
|
9494
9507
|
const workerLabel = stableText$1(label, "worker label");
|
|
9495
9508
|
const root = stableText$1(journalRoot, "journal root");
|
|
@@ -9521,10 +9534,17 @@ function writeWorkerInteractiveBinding(eventDir, workerId, label, journalRoot, s
|
|
|
9521
9534
|
const existing = readWorkerInteractiveBinding(eventDir, id);
|
|
9522
9535
|
if (existing !== void 0) {
|
|
9523
9536
|
assertSameBinding(existing, binding);
|
|
9524
|
-
return existing;
|
|
9537
|
+
return { existing };
|
|
9525
9538
|
}
|
|
9526
|
-
|
|
9527
|
-
|
|
9539
|
+
return {
|
|
9540
|
+
binding,
|
|
9541
|
+
file
|
|
9542
|
+
};
|
|
9543
|
+
}
|
|
9544
|
+
/** The published binding: this one, or the identical winner of a concurrent publication. */
|
|
9545
|
+
function settleBinding(eventDir, binding, published) {
|
|
9546
|
+
if (published) return binding;
|
|
9547
|
+
const winner = readWorkerInteractiveBinding(eventDir, binding.workerId);
|
|
9528
9548
|
if (winner === void 0) throw new Error(`worker interactive binding publication lost its winner`);
|
|
9529
9549
|
assertSameBinding(winner, binding);
|
|
9530
9550
|
return winner;
|
|
@@ -11568,6 +11588,38 @@ function workerSteerAcknowledgementFile(eventDir, operationId) {
|
|
|
11568
11588
|
* @stable
|
|
11569
11589
|
*/
|
|
11570
11590
|
function writeWorkerSteer(rootDir, supervisorId, worker, options) {
|
|
11591
|
+
const steer = prepareWorkerSteer(rootDir, supervisorId, worker, options);
|
|
11592
|
+
const admitted = admitSteerRequest(steer.file, steer.request);
|
|
11593
|
+
if (admitted.replayed) return replayedSteer(steer, admitted);
|
|
11594
|
+
for (const projection of steerProjections(steer)) try {
|
|
11595
|
+
appendRunLines(projection.file, projection.lines, projection.options);
|
|
11596
|
+
} catch {}
|
|
11597
|
+
return {
|
|
11598
|
+
worker: steer.workerId,
|
|
11599
|
+
file: steer.file,
|
|
11600
|
+
request: steer.request,
|
|
11601
|
+
replayed: false
|
|
11602
|
+
};
|
|
11603
|
+
}
|
|
11604
|
+
/**
|
|
11605
|
+
* Admit one steer like `writeWorkerSteer`, without blocking the calling thread on the disk.
|
|
11606
|
+
* The request file is published by the durable writer, so an event loop that admits steers keeps
|
|
11607
|
+
* running while the file and its directory reach disk. Same admission, replay and conflict rules.
|
|
11608
|
+
* @stable
|
|
11609
|
+
*/
|
|
11610
|
+
async function writeWorkerSteerAsync(rootDir, supervisorId, worker, options) {
|
|
11611
|
+
const steer = prepareWorkerSteer(rootDir, supervisorId, worker, options);
|
|
11612
|
+
const admitted = await admitSteerRequestAsync(steer.file, steer.request);
|
|
11613
|
+
if (admitted.replayed) return replayedSteer(steer, admitted);
|
|
11614
|
+
for (const projection of steerProjections(steer)) await appendRunLinesAsync(projection.file, projection.lines, projection.options).catch(() => {});
|
|
11615
|
+
return {
|
|
11616
|
+
worker: steer.workerId,
|
|
11617
|
+
file: steer.file,
|
|
11618
|
+
request: steer.request,
|
|
11619
|
+
replayed: false
|
|
11620
|
+
};
|
|
11621
|
+
}
|
|
11622
|
+
function prepareWorkerSteer(rootDir, supervisorId, worker, options) {
|
|
11571
11623
|
const workerId = worker.trim();
|
|
11572
11624
|
if (!workerId) throw new Error("writeWorkerSteer: worker id is empty");
|
|
11573
11625
|
const operationId = options.operationId.trim();
|
|
@@ -11578,17 +11630,16 @@ function writeWorkerSteer(rootDir, supervisorId, worker, options) {
|
|
|
11578
11630
|
const interrupt = options.interrupt === true;
|
|
11579
11631
|
if (options.eventDir !== void 0 && !options.eventDir.trim()) throw new Error("writeWorkerSteer: eventDir is empty");
|
|
11580
11632
|
const dir = options.eventDir === void 0 ? supervisorRunDir(rootDir, supervisorId) : resolve(options.eventDir);
|
|
11581
|
-
const requestDigest = workerSteerRequestDigest({
|
|
11582
|
-
operationId,
|
|
11583
|
-
worker: workerId,
|
|
11584
|
-
message: trimmed,
|
|
11585
|
-
source,
|
|
11586
|
-
interrupt
|
|
11587
|
-
});
|
|
11588
11633
|
const request = {
|
|
11589
11634
|
schemaVersion: 1,
|
|
11590
11635
|
operationId,
|
|
11591
|
-
requestDigest
|
|
11636
|
+
requestDigest: workerSteerRequestDigest({
|
|
11637
|
+
operationId,
|
|
11638
|
+
worker: workerId,
|
|
11639
|
+
message: trimmed,
|
|
11640
|
+
source,
|
|
11641
|
+
interrupt
|
|
11642
|
+
}),
|
|
11592
11643
|
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11593
11644
|
source,
|
|
11594
11645
|
worker: workerId,
|
|
@@ -11599,36 +11650,48 @@ function writeWorkerSteer(rootDir, supervisorId, worker, options) {
|
|
|
11599
11650
|
assertNoSymlinkDescendant(dir, file, "steer request");
|
|
11600
11651
|
mkdirSync(workerSteerRequestsDir(dir), { recursive: true });
|
|
11601
11652
|
assertNoSymlinkDescendant(dir, file, "steer request");
|
|
11602
|
-
|
|
11603
|
-
|
|
11653
|
+
return {
|
|
11654
|
+
dir,
|
|
11655
|
+
file,
|
|
11656
|
+
operationId,
|
|
11657
|
+
workerId,
|
|
11658
|
+
request
|
|
11659
|
+
};
|
|
11660
|
+
}
|
|
11661
|
+
function replayedSteer({ dir, file, operationId }, admitted) {
|
|
11662
|
+
const acknowledgement = readWorkerSteerAcknowledgement(dir, operationId);
|
|
11663
|
+
return {
|
|
11604
11664
|
worker: admitted.request.worker,
|
|
11605
11665
|
file,
|
|
11606
11666
|
request: admitted.request,
|
|
11607
|
-
...
|
|
11667
|
+
...acknowledgement === void 0 ? {} : { acknowledgement },
|
|
11608
11668
|
replayed: true
|
|
11609
11669
|
};
|
|
11670
|
+
}
|
|
11671
|
+
/** The readable projections the admission winner appends: the worker's inbox line and control event. */
|
|
11672
|
+
function steerProjections({ dir, operationId, workerId, request }) {
|
|
11610
11673
|
mkdirSync(supervisorWorkersDir(dir), { recursive: true });
|
|
11611
|
-
const
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
} catch {}
|
|
11615
|
-
appendWorkerControlEvent(dir, workerId, {
|
|
11674
|
+
const event = {
|
|
11675
|
+
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11676
|
+
label: workerId,
|
|
11616
11677
|
kind: "message",
|
|
11617
11678
|
direction: "down",
|
|
11618
|
-
source,
|
|
11679
|
+
source: request.source,
|
|
11619
11680
|
operationId,
|
|
11620
|
-
requestDigest,
|
|
11621
|
-
message:
|
|
11622
|
-
interrupt,
|
|
11681
|
+
requestDigest: request.requestDigest,
|
|
11682
|
+
message: request.message,
|
|
11683
|
+
interrupt: request.interrupt,
|
|
11623
11684
|
queued: true,
|
|
11624
11685
|
delivered: false
|
|
11625
|
-
});
|
|
11626
|
-
return {
|
|
11627
|
-
worker: workerId,
|
|
11628
|
-
file,
|
|
11629
|
-
request,
|
|
11630
|
-
replayed: false
|
|
11631
11686
|
};
|
|
11687
|
+
return [{
|
|
11688
|
+
file: workerInboxFileFromEventDir(dir, workerId),
|
|
11689
|
+
lines: [`${JSON.stringify(request)}\n`]
|
|
11690
|
+
}, {
|
|
11691
|
+
file: workerControlLogFile(dir, workerId),
|
|
11692
|
+
lines: [`${JSON.stringify(event)}\n`],
|
|
11693
|
+
options: { directory: supervisorWorkersDir(dir) }
|
|
11694
|
+
}];
|
|
11632
11695
|
}
|
|
11633
11696
|
/** Read every atomically admitted request for one exact worker id, in admission order. @stable */
|
|
11634
11697
|
function readWorkerSteerRequests(eventDir, worker) {
|
|
@@ -11670,7 +11733,7 @@ function readWorkerSteerAcknowledgement(eventDir, operationId) {
|
|
|
11670
11733
|
* Returns `true` only to the process that created the pre-delivery record.
|
|
11671
11734
|
* @internal
|
|
11672
11735
|
*/
|
|
11673
|
-
function claimWorkerSteerDelivery(eventDir, record) {
|
|
11736
|
+
async function claimWorkerSteerDelivery(eventDir, record) {
|
|
11674
11737
|
const exact = parseWorkerSteerAcknowledgement(record);
|
|
11675
11738
|
if (exact.effect !== "unknown") throw new Error("steer delivery claim must use effect unknown");
|
|
11676
11739
|
const request = readWorkerSteerRequest(eventDir, exact.operationId);
|
|
@@ -11680,13 +11743,13 @@ function claimWorkerSteerDelivery(eventDir, record) {
|
|
|
11680
11743
|
mkdirSync(dir, { recursive: true });
|
|
11681
11744
|
assertNoSymlinkDescendant(eventDir, dir, "steer acknowledgement");
|
|
11682
11745
|
const file = workerSteerAcknowledgementFile(eventDir, exact.operationId);
|
|
11683
|
-
if (
|
|
11746
|
+
if (await publishExclusiveDurableFileAsync(file, `${JSON.stringify(exact, null, 2)}\n`)) return true;
|
|
11684
11747
|
const winner = readWorkerSteerAcknowledgement(eventDir, exact.operationId);
|
|
11685
11748
|
if (winner === void 0 || winner.operationId !== exact.operationId || winner.requestDigest !== exact.requestDigest) throw new Error("steer delivery claim conflicts with another operation");
|
|
11686
11749
|
return false;
|
|
11687
11750
|
}
|
|
11688
11751
|
/** Atomically replace the runtime acknowledgement for one steer operation. @internal */
|
|
11689
|
-
function writeWorkerSteerAcknowledgement(eventDir, record) {
|
|
11752
|
+
async function writeWorkerSteerAcknowledgement(eventDir, record) {
|
|
11690
11753
|
const exact = parseWorkerSteerAcknowledgement(record);
|
|
11691
11754
|
const request = readWorkerSteerRequest(eventDir, exact.operationId);
|
|
11692
11755
|
if (request === void 0 || request.requestDigest !== exact.requestDigest) throw new Error("steer acknowledgement does not match an admitted request");
|
|
@@ -11697,7 +11760,7 @@ function writeWorkerSteerAcknowledgement(eventDir, record) {
|
|
|
11697
11760
|
const file = workerSteerAcknowledgementFile(eventDir, exact.operationId);
|
|
11698
11761
|
const prior = readWorkerSteerAcknowledgement(eventDir, exact.operationId);
|
|
11699
11762
|
if (prior !== void 0 && prior.effect !== "unknown" && canonicalCandidateDigest(prior) !== canonicalCandidateDigest(exact)) throw new Error(`steer operation '${exact.operationId}' already has a terminal acknowledgement`);
|
|
11700
|
-
|
|
11763
|
+
await writeAtomicDurableFileAsync(file, `${JSON.stringify(exact, null, 2)}\n`);
|
|
11701
11764
|
}
|
|
11702
11765
|
/** The directory holding every cancellation artifact of one run (request inbox + acknowledgements). */
|
|
11703
11766
|
function workerCancellationsDir(eventDir) {
|
|
@@ -11896,15 +11959,23 @@ function operationFileHash(operationId) {
|
|
|
11896
11959
|
return sha256(id);
|
|
11897
11960
|
}
|
|
11898
11961
|
function admitSteerRequest(file, request) {
|
|
11962
|
+
return replayedSteerRequest(file, request) ?? steerAdmission(file, request, publishExclusiveDurableFile(file, steerRequestText(request)));
|
|
11963
|
+
}
|
|
11964
|
+
async function admitSteerRequestAsync(file, request) {
|
|
11965
|
+
return replayedSteerRequest(file, request) ?? steerAdmission(file, request, await publishExclusiveDurableFileAsync(file, steerRequestText(request)));
|
|
11966
|
+
}
|
|
11967
|
+
const steerRequestText = (request) => `${JSON.stringify(request, null, 2)}\n`;
|
|
11968
|
+
function replayedSteerRequest(file, request) {
|
|
11899
11969
|
const existing = readWorkerSteerRequestFile(file);
|
|
11900
|
-
if (existing
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11970
|
+
if (existing === void 0) return void 0;
|
|
11971
|
+
assertSameSteerRequest(existing, request);
|
|
11972
|
+
return {
|
|
11973
|
+
request: existing,
|
|
11974
|
+
replayed: true
|
|
11975
|
+
};
|
|
11976
|
+
}
|
|
11977
|
+
function steerAdmission(file, request, published) {
|
|
11978
|
+
if (published) return {
|
|
11908
11979
|
request,
|
|
11909
11980
|
replayed: false
|
|
11910
11981
|
};
|
|
@@ -12561,7 +12632,7 @@ function bindInteractiveWorker(args, live, label, childRun, signal, spawnCommitt
|
|
|
12561
12632
|
if (ready === void 0 || notStarted(ready)) return;
|
|
12562
12633
|
session = ready;
|
|
12563
12634
|
}
|
|
12564
|
-
|
|
12635
|
+
await writeWorkerInteractiveBindingAsync(args.interactiveBindingDir, live.id, label, args.root, session, now);
|
|
12565
12636
|
});
|
|
12566
12637
|
}
|
|
12567
12638
|
/**
|
|
@@ -14123,6 +14194,6 @@ function unknownChannels(spend) {
|
|
|
14123
14194
|
function isNonEmptySpend(s) {
|
|
14124
14195
|
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);
|
|
14125
14196
|
}
|
|
14126
|
-
export {
|
|
14197
|
+
export { reenteredWorkers as $, loopEventToOtelSpan as $n, unknownExecutionBindingReceipt as $r, scopeRetainedOwnerRestorePoint as $t, writeWorkerCancellation as A, retainedCreateMaterial as An, attestRuntimeOwnedExecutor as Ar, abandonScopeRetainedOwnerInvocation as At, parseWorkerToolTraceArtifact as B, WORKER_TRACE_PROPAGATION as Bn, providerAttemptEvidence as Br, recordScopeOwnerMaterialization as Bt, safeWorkerFile as C, RetainedMaterializationTimeoutError as Cn, SEAT_RECHECK_MS as Cr, waitForScopeChildren as Ct, workerCancellationsDir as D, recoverRetainedRun as Dn, seatExecutionProfile as Dr, environmentReader as Dt, workerCancelRequestsFile as E, reconnectRetainedRun as En, authoredSeatStages as Er, scopeRetainedOwnerResourceReader as Et, openSlotGroup as F, createFileObserverHooks as Fn, finalizeRuntimeOwnedPendingExecutor as Fr, beginScopeOwnerAttempt as Ft, readWorkerInteractiveBinding as G, readTraceContextFromEnv as Gn, recordRuntimeOwnedProviderModel as Gr, coordinationProfileToolPrefix as Gt, nestedScopeSeamKey as H, workerTraceHeaders as Hn, recordRuntimeOwnedProviderAttemptStart as Hr, scopeOwnerExecutionObservation as Ht, resolveWorkerSlots as I, observerRecordDigest as In, inheritRuntimeOwnedExecutorAttestation as Ir, finalizeScopeOwnerMaterialization as It, startRetainedInteractiveRun as J, buildRuntimeEventOtelSpans as Jn, runtimeOwnedExecutorMaterialization as Jr, beginScopeRetainedOwnerDrive as Jt, reconnectRetainedInteractiveRun as K, buildLoopOtelSpans as Kn, runtimeOwnedDriveHarnessProviderEvidence as Kr, providerVisibleProfile as Kt, prepareScopeResume as L, verifyObserverRecords as Ln, knownExecutionBindingReceipt as Lr, holdScopeOwnerTranscript as Lt, writeWorkerSteerAcknowledgement as M, offerInteractiveControl as Mn, attestRuntimeOwnedScopeOwner as Mr, prepareScopeRetainedOwnerTask as Mt, writeWorkerSteerAsync as N, prepareInteractiveDelegation as Nn, authoredAgentIdentity as Nr, scopeRetainedOwnerPriorSpend as Nt, workerInboxFileFromEventDir as O, startRetainedRun as On, subscriptionUsageLimitSignal as Or, resolveSpawnResourcePaths as Ot, createWorkerSlots as P, FileObserverJournal as Pn, authoredProfileDigest as Pr, scopeRetainedOwnerResult as Pt, appendTeardownConfirmation as Q, generateSpanId as Qn, runtimeOwnedScopeOwnerRuntime as Qr, reconcileScopeRetainedOwnerEnvironment as Qt, replaySpawnTree as R, destroyInteractiveEnvironment as Rn, knownMaterializationReceipt as Rr, noteScopeOwnerPlannedExecution as Rt, readWorkerSteerRequests as S, verifyWorkspaceMarker as Sn, isTerminalNodeStatus as Sr, unconfirmedTeardowns as St, supervisorRunsRoot as T, mintRetainedIdentity as Tn, SeatPauseError as Tr, releaseScopeRetainedOwnerForSeatPause as Tt, interactiveAdmissionSeamKey as U, createPropagatingTraceEmitter as Un, recordRuntimeOwnedProviderDispatchNotStarted as Ur, scopeOwnerExecutorNodeContext as Ut, workerTraceAnalysisStore as V, workerTraceEnv as Vn, recordRuntimeOwnedDriveHarnessProviderEvidence as Vr, restoreScopeOwnerAcceptedExecution as Vt, attachWorker as W, mergeTraceEnv as Wn, recordRuntimeOwnedProviderIdentityConflict as Wr, coordinationMcpAlias as Wt, appendSpawnEvents as X, createOtelExporter as Xn, runtimeOwnedPendingExecutorMaterialization as Xr, scopeRetainedOwnerTurnEnded as Xt, FileSpawnJournal as Y, createOpenInferenceFileExporter as Yn, runtimeOwnedExecutorProviderEvidence as Yr, scopeRetainedOwnerSettled as Yt, spawnJournalRecordEvents as Z, flatOtelSpan as Zn, runtimeOwnedScopeOwnerControl as Zr, assertRetainedOwnerCoordinationRekey as Zt, legacySupervisorRunDir as _, executorObservationSeamKey as _n, DEFAULT_STALL_AFTER_MS as _r, releaseHeldEnvironments as _t, closeStreamFile as a, runtimeFlowAgent as ai, scopeOwnerLiabilities as an, captureBoundHarnessTranscript as ar, rollingDispatch as at, readWorkerCancellation as b, describeRetainedNativeStops as bn, readWorkerProgress as br, settleManagerWork as bt, openStreamFileFenced as c, assertEventBinding as ci, loadSpawnForest as cn, harnessTranscriptFromLines as cr, closeScopeAdmission as ct, syncStreamFileFenced as d, freezeControlRef as di, attestNestedDriverTreeOwner as dn, readHarnessTranscript as dr, meterRuntimeOwnedProviderAttempt as dt, unknownMaterializationReceipt as ei, noteScopeRetainedOwnerCoordination as en, createRuntimeEventCollector as er, settledToIteration as et, writeStreamLinesFenced as f, retainedSessionReplaced as fi, driverRuntime as fn, settleHarnessTranscript as fr, pauseScopeSeatAdmission as ft, fileEscalateQuestion as g, providerMessageText as gi, executorObservation as gn, retainHarnessTranscript as gr, registerNestedTeardownScope as gt, claimWorkerSteerDelivery as h, promptOptionsFromAgentTurnInput as hi, insideCursorNamespace as hn, resolveHarnessTranscriptCapture as hr, recordScopeOwnerPause as ht, ROOT_STREAM_FILE as i, runtimeCheckFactory as ii, owners as in, HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS as ir, queueOf as it, writeWorkerSteer as j, acceptedInteractiveControl as jn, attestRuntimeOwnedPendingExecutor as jr, consumeScopeRetainedOwnerResult as jt, workerSteerRequestsDir as k, startRetainedRunInEnvironment as kn, attestRuntimeOwnedDeferredExecutor as kr, RELEASE_DESTROY_MS as kt, readRootStream as l, awaitAbortable$1 as li, ownedTreeRootSpawn as ln, harnessTranscriptUnavailable as lr, hasRetriableTeardowns as lt, cancelWorker as m, promptFromAgentTurnInput as mi, SpawnEventIndex as mn, readBoundHarnessSessions$1 as mr, recordScopeOwnerDriverAttempt as mt, terminalAccounting as n, executableAgentSpecSnapshot as ni, bindScopeRetainedOwnerEnvironmentId as nn, sanitizeKnowledgeReadinessReport as nr, deriveNodeExecutionIdentity as nt, createRootStreamSink as o, runtimeFlowBrain as oi, scopeRetainedOwnerContext as on, captureHarnessTranscript as or, boundRetainedReleases as ot, appendWorkerControlEvent as p, sameControlCoordinates as pi, nestedDriverTreeRoot as pn, HARNESS_TRANSCRIPT_READ_LIMITS as pr, recordScopeOwnerBarrenPause as pt, recoverRetainedInteractiveRun as q, buildLoopSpanNodes as qn, runtimeOwnedExecutorExecutionBinding as qr, runtimeGraphMetadataKey as qt, createScope as r, isRuntimeFlowBrain as ri, bindScopeRetainedOwnerProvider as rn, sanitizeRuntimeStreamEvent as rr, freeSlots as rt, nodeStreamFile as s, RetainedRunProviderContractError as si, scopeRetainedOwnerJournalRoot as sn, harnessTranscriptArtifact as sr, closeRetainedSlots as st, isNonEmptySpend as t, executableAgentProfileSnapshot as ti, scopeRetainedOwnerCheckpointing as tn, createRuntimeStreamEventCollector as tr, assertRecursiveReservationPolicy as tt, readRootStreamReceipt as u, exactSession as ui, materializeTreeView as un, persistHarnessTranscript as ur, meterRuntimeOwnedAccounting as ut, legacySupervisorRunsRoot as v, observeModelRequest as vn, createActivityLog as vr, releaseRetainedEnvironments as vt, supervisorRunDir as w, assertRetainedRunReplayMaterial as wn, SeatChain as wr, prepareScopeRetainedOwnerSeatSwitch as wt, readWorkerSteerAcknowledgement as x, stopRetainedNativeExecution as xn, isLiveNodeStatus as xr, startScopeRecoveries as xt, readWorkerCancelRequests as y, NATIVE_STOP_UNCONFIRMED as yn, describeToolArgs as yr, retryUnconfirmedTeardowns as yt, isTraceAnalysisStore as z, environmentGone as zn, newExecutionAttemptId as zr, recordScopeOwnerHarnessTranscript as zt };
|
|
14127
14198
|
|
|
14128
|
-
//# sourceMappingURL=supervisor-accounting-
|
|
14199
|
+
//# sourceMappingURL=supervisor-accounting-CZ7i4cd5.js.map
|