@tangle-network/agent-runtime 2.3.8 → 2.3.11
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-Cks1h3Nw.d.ts → activation-B8dLwJj6.d.ts} +2 -2
- package/dist/{activation-CDPbi8JA.js → activation-BzNeFJDB.js} +4 -4
- package/dist/{activation-CDPbi8JA.js.map → activation-BzNeFJDB.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{bundle-PDYNXIEf.js → bundle-DhV73H6U.js} +2 -2
- package/dist/{bundle-PDYNXIEf.js.map → bundle-DhV73H6U.js.map} +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{coordination-manager-DNrb7zMg.js → coordination-manager-BluavEgY.js} +42 -152
- package/dist/coordination-manager-BluavEgY.js.map +1 -0
- package/dist/{coordination-map-routing-CUvwHAtv.js → coordination-map-routing-BllzcZov.js} +5 -2
- package/dist/coordination-map-routing-BllzcZov.js.map +1 -0
- package/dist/{delegate-CHdWyLz9.js → delegate-CYWL0MrO.js} +2 -2
- package/dist/{delegate-CHdWyLz9.js.map → delegate-CYWL0MrO.js.map} +1 -1
- package/dist/durable-file-DstVeHcj.js.map +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +42 -202
- package/dist/durable.js.map +1 -1
- package/dist/{graph-oOdDpXFH.js → graph-ByNMeS0j.js} +8 -13
- package/dist/graph-ByNMeS0j.js.map +1 -0
- package/dist/{graph-registry-72DlMnUl.js → graph-registry-D6y6zffC.js} +2 -2
- package/dist/{graph-registry-72DlMnUl.js.map → graph-registry-D6y6zffC.js.map} +1 -1
- package/dist/{graph-registry-CAX15LO6.js → graph-registry-rV9mwxQO.js} +1 -1
- package/dist/{improve-BCjhWbVk.js → improve-D9A79N5a.js} +7 -7
- package/dist/{improve-BCjhWbVk.js.map → improve-D9A79N5a.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +7 -6
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +12 -12
- package/dist/{loop-runner-Bkvx4Saw.d.ts → loop-runner-D9fuOb69.d.ts} +2 -2
- package/dist/{loop-runner-Cy1K7f-A.js → loop-runner-DiMfhI_z.js} +2 -2
- package/dist/{loop-runner-Cy1K7f-A.js.map → loop-runner-DiMfhI_z.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 +1 -1
- package/dist/mcp/index.js +6 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/{prepare-Bv6X2Wnx.js → prepare-DrHOZFJy.js} +3 -4
- package/dist/{prepare-Bv6X2Wnx.js.map → prepare-DrHOZFJy.js.map} +1 -1
- package/dist/{profile-Dir2A1_2.js → profile-BzzmKuIX.js} +3 -2
- package/dist/{profile-Dir2A1_2.js.map → profile-BzzmKuIX.js.map} +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-Pd95wA1X.js → provision-supervisor-DP5U58V4.js} +13 -5
- package/dist/provision-supervisor-DP5U58V4.js.map +1 -0
- package/dist/{run-cancellation-CzQZUlHr.js → run-cancellation-BxoFCpJ_.js} +208 -5
- package/dist/run-cancellation-BxoFCpJ_.js.map +1 -0
- package/dist/{runtime-CWZ9q7lU.js → runtime-DS5AgACg.js} +15 -16
- package/dist/{runtime-CWZ9q7lU.js.map → runtime-DS5AgACg.js.map} +1 -1
- package/dist/sandbox-profile-compat-DxegoIK5.js +65 -0
- package/dist/sandbox-profile-compat-DxegoIK5.js.map +1 -0
- package/dist/scope-DRaBilEX.js +16734 -0
- package/dist/scope-DRaBilEX.js.map +1 -0
- package/dist/{search-executor-CMPbMvpr.js → search-executor-DLo_9jUv.js} +4 -5
- package/dist/{search-executor-CMPbMvpr.js.map → search-executor-DLo_9jUv.js.map} +1 -1
- package/dist/{server-DyTbsg7n.js → server-DfHV4ajw.js} +4 -4
- package/dist/{server-DyTbsg7n.js.map → server-DfHV4ajw.js.map} +1 -1
- package/dist/{structural-rollout-BUqZsIhX.js → structural-rollout-BIjjZ_XX.js} +4 -5
- package/dist/{structural-rollout-BUqZsIhX.js.map → structural-rollout-BIjjZ_XX.js.map} +1 -1
- package/dist/{supervise-D1eYde7p.js → supervise-6BCQ73Xa.js} +34 -136
- package/dist/supervise-6BCQ73Xa.js.map +1 -0
- package/dist/{supervision-discovery-DmDWHwLu.js → supervision-discovery-Da5zebY2.js} +130 -5
- package/dist/supervision-discovery-Da5zebY2.js.map +1 -0
- package/dist/{supervisor-B8beIEqH.js → supervisor-3JHXy3tz.js} +7336 -19680
- package/dist/supervisor-3JHXy3tz.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +13 -13
- package/dist/{top-web-CUDlOKu0.js → top-web-DK6lTMHG.js} +89 -64
- package/dist/top-web-DK6lTMHG.js.map +1 -0
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +14 -8
- package/dist/tui/index.js +2 -2
- package/dist/{types-DzS0kBeK.d.ts → types-S3RbyJ4x.d.ts} +51 -65
- package/dist/{sandbox-profile-compat-DRiz9kME.js → workspace-streams-Dep2L6XD.js} +617 -57
- package/dist/workspace-streams-Dep2L6XD.js.map +1 -0
- package/package.json +2 -2
- package/dist/coordination-manager-DNrb7zMg.js.map +0 -1
- package/dist/coordination-map-routing-CUvwHAtv.js.map +0 -1
- package/dist/graph-oOdDpXFH.js.map +0 -1
- package/dist/provision-supervisor-Pd95wA1X.js.map +0 -1
- package/dist/root-stream-Bsh5WFcg.js +0 -4252
- package/dist/root-stream-Bsh5WFcg.js.map +0 -1
- package/dist/run-cancellation-CzQZUlHr.js.map +0 -1
- package/dist/sandbox-profile-compat-DRiz9kME.js.map +0 -1
- package/dist/supervise-D1eYde7p.js.map +0 -1
- package/dist/supervision-discovery-DmDWHwLu.js.map +0 -1
- package/dist/supervisor-B8beIEqH.js.map +0 -1
- package/dist/top-web-CUDlOKu0.js.map +0 -1
- package/dist/util-BX20UJ9X.js +0 -624
- package/dist/util-BX20UJ9X.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as beginScopeOwnerAttempt, Bt as scopeRetainedOwnerJournalRoot, Ci as spendFromUsageTotals, Dr as recordRuntimeOwnedDriveHarnessProviderEvidence, Dt as scopeRetainedOwnerPriorSpend, Er as providerAttemptEvidence, Et as prepareScopeRetainedOwnerTask, Fn as WORKER_TRACE_PROPAGATION, Fr as runtimeOwnedExecutorProviderEvidence, G as scopeOwnerExecutorNodeContext, Gn as createOtelExporter, H as noteScopeOwnerPlannedExecution, Hr as isRuntimeFlowBrain, Ir as runtimeOwnedPendingExecutorMaterialization, It as bindScopeRetainedOwnerEnvironmentId, J as providerVisibleProfile, K as coordinationMcpAlias, Lr as runtimeOwnedScopeOwnerRuntime, Lt as bindScopeRetainedOwnerProvider, Mr as runtimeOwnedDriveHarnessProviderEvidence, Mt as reconcileScopeRetainedOwnerEnvironment, Nr as runtimeOwnedExecutorExecutionBinding, Nt as scopeRetainedOwnerRestorePoint, O as parseWorkerToolTraceArtifact, Ot as scopeRetainedOwnerResult, Pr as runtimeOwnedExecutorMaterialization, Pt as noteScopeRetainedOwnerCoordination, Q as assertRecursiveReservationPolicy, Qr as RetainedExecutionPendingError, Sn as readHarnessTranscript, Sr as inheritRuntimeOwnedExecutorAttestation, Tt as consumeScopeRetainedOwnerResult, U as recordScopeOwnerMaterialization, Ur as runtimeFlowAgent, W as restoreScopeOwnerAcceptedExecution, Wr as runtimeFlowBrain, Y as runtimeGraphMetadataKey, a as readRootStream, ai as cappedDoublingMs, ar as SeatChain, bi as meterUsageEvent, bt as prepareScopeRetainedOwnerSeatSwitch, ci as unavailableResumeAt, cr as seatExecutionProfile, ct as recordScopeOwnerBarrenPause, ei as registerRetainedExecutorPreparation, er as createActivityLog, fr as linkAbort, hi as executorFailure, ir as isTerminalNodeStatus, jt as scopeRetainedOwnerTurnEnded, kt as beginScopeRetainedOwnerDrive, lt as recordScopeOwnerDriverAttempt, n as ROOT_STREAM_FILE, ni as retainedExecutorSeamKey, oi as jitteredMs, or as SeatChainExhaustedError, ot as meterRuntimeOwnedAccounting, pi as contentAddress, pr as runAbortable, q as coordinationProfileToolPrefix, qn as generateSpanId, r as createRootStreamSink, rr as isLiveNodeStatus, si as unavailablePauseMs, sr as authoredSeatStages, st as meterRuntimeOwnedProviderAttempt, ur as RunCancellationReason, ut as recordScopeOwnerPause, vr as attestRuntimeOwnedScopeOwner, wi as assertValidBudget, wt as abandonScopeRetainedOwnerInvocation, xi as newUsageTotals, xn as persistHarnessTranscript, xt as scopeRetainedOwnerResourceReader, yr as authoredAgentIdentity, zt as scopeRetainedOwnerContext } from "./scope-DRaBilEX.js";
|
|
2
2
|
import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-AzSuGI23.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Ct as spendFromUsageTotals, W as RetainedExecutionPendingError, Y as registerRetainedExecutorPreparation, Z as retainedExecutorSeamKey, bt as meterUsageEvent, ft as executorFailure, i as readRootStream, it as unavailableResumeAt, n as createRootStreamSink, nt as jitteredMs, rt as unavailablePauseMs, t as ROOT_STREAM_FILE, tt as cappedDoublingMs, ut as contentAddress, wt as assertValidBudget, xt as newUsageTotals } from "./root-stream-Bsh5WFcg.js";
|
|
3
|
+
import { Dt as teardownSurfaces, Et as teardownExecutor, H as addSpend, J as errorMessage, Q as isAsyncIterable, W as chargedTokens, ct as unmeteredSpend, et as promptCacheTokenClasses, ft as addResourceSpend, ht as withBudgetResources, it as sleep, lt as withTimeout, mt as resourceTelemetry, ut as zeroSpend, wt as isDeadlineAbortReason, yt as DEFAULT_SUCCESSFUL_SHUTDOWN_MS } from "./workspace-streams-Dep2L6XD.js";
|
|
5
4
|
import { d as detachedSnapshot, m as errMessage } from "./jsonl-file-BBP9Dz9w.js";
|
|
5
|
+
import { B as createRouterTranscript, C as createExecutor, Ct as checkVerdictOf, Dt as bridgeAdmissionRefusal, F as codeModeArguments, I as codeModeModelOutput, It as bridgeRuntimeAttachmentsKey, Jt as fullProfileMaterialization, Kt as controlProfileMaterialization, L as createCodeModeTools, Lt as bridgeStopSignalKey, Ot as bridgeModelRouteRefusal, Qt as renderUnsupported, S as captureReusableExecutorConfig, St as bestComposite, U as resolveAgentEnvironmentProvider, V as routerBrain, Wt as assertProfileMaterialization, X as createInbox, Xt as promptControlProfileMaterialization, Y as INBOX_RECEIPT_KEY, Yt as profileMaterializationAxes$1, Zt as promptModelProfileMaterialization, a as assertRunParking, bt as CONTINUATIONS_DIR, c as sleepScopeWait, ct as HarnessTurnFailedError, d as runFinalizer, dt as classifyDriverFailure, en as sandboxProfileMaterialization, et as PEER_MAIL_WIRE_KEY, f as runTree, ft as summarizeDriverAttempts, g as isDriverSpec, gt as gateFactoryOnDeliverable, h as driverExecutorFactory, ht as CheckUnavailableError, i as RunParkedError, l as withRunParking, lt as abandonablePending, m as driverChild, mt as upstreamUnavailableSignal, n as createSupervisor, nn as worktreeCliProfileMaterialization, o as bindScopeParkingDrain, p as createRootHandle, pt as undispatchedCredentialExit, qt as defineProfileMaterializationContract, rt as isPeerMailEnvelope, st as DriverAttemptsExhaustedError, tn as unsupportedProfileDimensions, u as bestDelivered, ut as causedByPartialFailure, w as snapshotExecutorConfig, wt as createContinuationKeeper, x as bindReusableExecutorExecutionId, xt as admitContinuationPolicy, z as toolResultText } from "./supervisor-3JHXy3tz.js";
|
|
6
6
|
import { _ as agentHarness, a as concreteProfileModel, c as profileModelExecutionSettings, l as profileProviderModel, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-C-RGAUW4.js";
|
|
7
7
|
import { t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
|
|
8
|
-
import { c as
|
|
9
|
-
import { c as
|
|
10
|
-
import { o as safeJsonText } from "./coordination-map-routing-
|
|
8
|
+
import { _ as workerAssignmentNamespace, c as writeRunCancellation, d as coordinationEventId, f as externalExecutionId, g as supervisionRunNamespace, h as rootCoordinationOwner, i as readRunCancellation, l as canonicalExecution, m as freezeDetachedProfile, p as freezeDetached, r as readRunCancelRequest, s as watchRunCancellation, t as applyRunCancellation, u as childCoordinationOwner } from "./run-cancellation-BxoFCpJ_.js";
|
|
9
|
+
import { c as createSteerAcknowledger, d as coordinationVerbNames, f as createFileRunContext, l as budgetOverspendText, m as withRunContext, n as createCoordinationToolsForManager, p as createInMemoryRunContext, s as createCancelAcknowledger, t as createCoordinationTools, u as normalizeAnalyzeOnSettle } from "./coordination-manager-BluavEgY.js";
|
|
10
|
+
import { o as safeJsonText } from "./coordination-map-routing-BllzcZov.js";
|
|
11
11
|
import { n as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-CZWd_Opp.js";
|
|
12
|
-
import { a as graphRegistry, c as loadGraph } from "./graph-registry-
|
|
12
|
+
import { a as graphRegistry, c as loadGraph } from "./graph-registry-D6y6zffC.js";
|
|
13
13
|
import { ATTR, agentIdentityAttributes } from "@tangle-network/agent-trace-contract";
|
|
14
14
|
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
15
15
|
import { toolSpansToTraceAnalysisStore } from "@tangle-network/agent-eval";
|
|
@@ -20,95 +20,6 @@ import { isMaterializerHarness } from "@tangle-network/agent-profile-materialize
|
|
|
20
20
|
import { createServer } from "node:http";
|
|
21
21
|
import { msToUnixNano, toOtlpAttributes } from "@tangle-network/agent-trace-contract/otlp";
|
|
22
22
|
import { withProfileKb } from "@tangle-network/agent-interface/profile-kb";
|
|
23
|
-
// src/runtime/supervise/supervise-identity.ts
|
|
24
|
-
function externalExecutionId(kind, identity) {
|
|
25
|
-
return `${kind}-${canonicalCandidateDigest({
|
|
26
|
-
kind,
|
|
27
|
-
identity
|
|
28
|
-
}).slice(7)}`;
|
|
29
|
-
}
|
|
30
|
-
function freezeDetached(value) {
|
|
31
|
-
return detachedSnapshot(value, "supervise");
|
|
32
|
-
}
|
|
33
|
-
function freezeDetachedProfile(value) {
|
|
34
|
-
return freezeDetached(agentProfileSchema.parse(value));
|
|
35
|
-
}
|
|
36
|
-
function canonicalExecution(profile, task, rawExecution, context) {
|
|
37
|
-
const execution = rawExecution === void 0 ? void 0 : freezeDetached(rawExecution);
|
|
38
|
-
if (execution !== void 0) {
|
|
39
|
-
if (typeof execution !== "object" || execution === null || Array.isArray(execution)) throw new ValidationError(`${context}: execution must be an object`);
|
|
40
|
-
const unknown = Object.keys(execution).filter((key) => key !== "candidateDigest" && key !== "correlation");
|
|
41
|
-
if (unknown.length > 0) throw new ValidationError(`${context}: unknown execution fields: ${unknown.join(", ")}`);
|
|
42
|
-
}
|
|
43
|
-
const identity = deriveNodeExecutionIdentity({
|
|
44
|
-
profile,
|
|
45
|
-
execution
|
|
46
|
-
}, task);
|
|
47
|
-
if (!identity?.profileDigest || !identity.taskDigest) throw new ValidationError(`${context}: profile and task must be finite, acyclic canonical JSON for durable identity`);
|
|
48
|
-
const ref = identity.candidateDigest || identity.correlation ? Object.freeze({
|
|
49
|
-
...identity.candidateDigest ? { candidateDigest: identity.candidateDigest } : {},
|
|
50
|
-
...identity.correlation ? { correlation: identity.correlation } : {}
|
|
51
|
-
}) : void 0;
|
|
52
|
-
return {
|
|
53
|
-
identity,
|
|
54
|
-
...ref ? { ref } : {}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function rootCoordinationOwner(identity) {
|
|
58
|
-
return canonicalCandidateDigest({
|
|
59
|
-
kind: "supervisor-root",
|
|
60
|
-
identity
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function childCoordinationOwner(parentOwnerId, identity, context, depth) {
|
|
64
|
-
return canonicalCandidateDigest({
|
|
65
|
-
kind: "supervisor-child",
|
|
66
|
-
parentOwnerId,
|
|
67
|
-
identity,
|
|
68
|
-
assignment: {
|
|
69
|
-
id: context.assignmentId,
|
|
70
|
-
label: context.label,
|
|
71
|
-
key: context.key ?? null,
|
|
72
|
-
depth
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
function supervisionRunNamespace(runDir, runId) {
|
|
77
|
-
return canonicalCandidateDigest(runDir === void 0 ? {
|
|
78
|
-
kind: "supervise-ephemeral-run",
|
|
79
|
-
runId,
|
|
80
|
-
nonce: randomUUID()
|
|
81
|
-
} : {
|
|
82
|
-
kind: "supervise-durable-run",
|
|
83
|
-
runId,
|
|
84
|
-
runDir: resolve(runDir)
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function workerAssignmentNamespace(runNamespace, parentOwnerId, assignmentId) {
|
|
88
|
-
return canonicalCandidateDigest({
|
|
89
|
-
kind: "supervise-worker-assignment",
|
|
90
|
-
runNamespace,
|
|
91
|
-
parentOwnerId,
|
|
92
|
-
assignmentId
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
/** Hash only durable coordination meaning. Bus sequence/timestamp are delivery metadata and a
|
|
96
|
-
* resumed projection's marker describes the reader, not the original settlement. */
|
|
97
|
-
function coordinationEventId(context, event) {
|
|
98
|
-
const durableEvent = event.type === "settled" && event.worker.resumed === true ? (() => {
|
|
99
|
-
const { resumed: _resumed, ...worker } = event.worker;
|
|
100
|
-
return {
|
|
101
|
-
type: "settled",
|
|
102
|
-
worker
|
|
103
|
-
};
|
|
104
|
-
})() : event;
|
|
105
|
-
return canonicalCandidateDigest({
|
|
106
|
-
kind: "supervise-coordination-event",
|
|
107
|
-
runNamespace: context.runNamespace,
|
|
108
|
-
ownerId: context.ownerId,
|
|
109
|
-
event: detachedSnapshot(durableEvent, "supervise coordination event identity")
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
23
|
// src/runtime/supervise/supervise-option-capture.ts
|
|
113
24
|
const superviseOptionKeySet = /* @__PURE__ */ new Set([
|
|
114
25
|
"allowedModels",
|
|
@@ -2085,14 +1996,12 @@ function journaledGateDecider(decideGate, journal, runId) {
|
|
|
2085
1996
|
return decideGate(request);
|
|
2086
1997
|
};
|
|
2087
1998
|
}
|
|
2088
|
-
/** The entry task a maps item's flow graph replaces with the item value. */
|
|
2089
|
-
const isItemPlaceholder = (task) => typeof task === "object" && task !== null && Object.keys(task).length === 1 && task.item === true;
|
|
2090
1999
|
/** A subtask's flow: inside a maps item, every `{ item: true }` entry task becomes the item. */
|
|
2091
2000
|
function flowOfSubtask(flow, mapItem) {
|
|
2092
2001
|
if (mapItem === void 0) return flow;
|
|
2093
2002
|
return {
|
|
2094
2003
|
...flow,
|
|
2095
|
-
entries: flow.entries.map((entry) =>
|
|
2004
|
+
entries: flow.entries.map((entry) => isRecord(entry.task) && Object.keys(entry.task).length === 1 && entry.task.item === true ? {
|
|
2096
2005
|
...entry,
|
|
2097
2006
|
task: mapItem.item
|
|
2098
2007
|
} : entry)
|
|
@@ -2105,30 +2014,23 @@ function flowOfSubtask(flow, mapItem) {
|
|
|
2105
2014
|
* between a winner and `no-result-selected`. `conclude` names a stopped flow on its result;
|
|
2106
2015
|
* `failure` says why a flow run as a subtask ended without one.
|
|
2107
2016
|
*/
|
|
2108
|
-
function createFlowRun() {
|
|
2017
|
+
function createFlowRun(nodeOfWorker) {
|
|
2109
2018
|
const outputs = /* @__PURE__ */ new Map();
|
|
2110
|
-
const nodeOf = /* @__PURE__ */ new Map();
|
|
2111
2019
|
let settled = {};
|
|
2112
2020
|
let stopped;
|
|
2113
2021
|
let unrouted;
|
|
2114
2022
|
const observe = (event) => {
|
|
2115
2023
|
if (event.type !== "route") return;
|
|
2116
2024
|
const step = event.route;
|
|
2117
|
-
if (step.kind === "
|
|
2118
|
-
if (step.kind === "
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
} else if (step.kind === "
|
|
2122
|
-
...step.edge === void 0 ? {} : { edge: step.edge },
|
|
2123
|
-
at: step.at,
|
|
2124
|
-
workerId: step.workerId,
|
|
2125
|
-
reason: step.reason
|
|
2126
|
-
};
|
|
2127
|
-
else if (step.kind === "unrouted") unrouted ??= step;
|
|
2025
|
+
if (step.kind === "output") outputs.set(step.node, step.result);
|
|
2026
|
+
else if (step.kind === "stopped") {
|
|
2027
|
+
const { kind: _kind, ...detail } = step;
|
|
2028
|
+
stopped ??= detail;
|
|
2029
|
+
} else if (step.kind === "unrouted") unrouted ??= step;
|
|
2128
2030
|
};
|
|
2129
2031
|
const finalizer = ({ delivered }) => {
|
|
2130
2032
|
settled = Object.fromEntries(delivered.flatMap((worker) => {
|
|
2131
|
-
const node =
|
|
2033
|
+
const node = nodeOfWorker(worker.id);
|
|
2132
2034
|
return node === void 0 || !("out" in worker) ? [] : [[node, worker.out]];
|
|
2133
2035
|
}));
|
|
2134
2036
|
return stopped !== void 0 || unrouted !== void 0 || outputs.size === 0 ? void 0 : Object.fromEntries(outputs);
|
|
@@ -2142,7 +2044,7 @@ function createFlowRun() {
|
|
|
2142
2044
|
kind: "result",
|
|
2143
2045
|
result
|
|
2144
2046
|
};
|
|
2145
|
-
if (
|
|
2047
|
+
if (result.kind !== "no-winner" || result.reason !== "no-result-selected" && result.reason !== "all-children-down" && result.reason !== "no-children-spawned") return {
|
|
2146
2048
|
kind: "result",
|
|
2147
2049
|
result,
|
|
2148
2050
|
stopped
|
|
@@ -2151,35 +2053,30 @@ function createFlowRun() {
|
|
|
2151
2053
|
kind: "result",
|
|
2152
2054
|
result: {
|
|
2153
2055
|
...result,
|
|
2154
|
-
reason: stopped.edge === void 0 ? "all-children-down" : "stopped"
|
|
2056
|
+
reason: stopped.code === "budget-exhausted" ? "budget-exhausted" : result.reason === "no-children-spawned" ? result.reason : stopped.edge === void 0 ? "all-children-down" : "stopped"
|
|
2155
2057
|
},
|
|
2156
2058
|
stopped
|
|
2157
2059
|
};
|
|
2158
2060
|
};
|
|
2159
2061
|
const failure = () => unrouted !== void 0 ? `${unrouted.reason} at '${unrouted.node}': ${unrouted.detail}` : stopped !== void 0 ? `stopped at '${stopped.at}': ${stopped.reason}` : void 0;
|
|
2160
|
-
/**
|
|
2161
|
-
|
|
2062
|
+
/**
|
|
2063
|
+
* A stored route check may name any flow node: its conditions read each delivered node's latest
|
|
2064
|
+
* usable output under the terminal outputs, while the run's deliverable stays terminal-only.
|
|
2065
|
+
* Run 6f167e9e checked fetch-pr's merge_sha, false while only terminal outputs were in view.
|
|
2066
|
+
*/
|
|
2067
|
+
const routeCheck = (d) => d.checkRef !== "route" ? d : {
|
|
2068
|
+
...d,
|
|
2069
|
+
check: (out, context) => d.check(context === void 0 && isRecord(out) ? {
|
|
2070
|
+
...settled,
|
|
2071
|
+
...out
|
|
2072
|
+
} : out, context)
|
|
2073
|
+
};
|
|
2162
2074
|
return {
|
|
2163
2075
|
observe,
|
|
2164
2076
|
finalizer,
|
|
2165
2077
|
conclude,
|
|
2166
2078
|
failure,
|
|
2167
|
-
|
|
2168
|
-
};
|
|
2169
|
-
}
|
|
2170
|
-
/**
|
|
2171
|
-
* A stored route check may name any flow node, not only a terminal one: its conditions read each
|
|
2172
|
-
* delivered node's latest usable output, under the terminal outputs. The deliverable the run
|
|
2173
|
-
* returns stays `{ [terminal node]: result }`. Run 6f167e9e checked fetch-pr's merge_sha and
|
|
2174
|
-
* review-pr's approval; with only terminal outputs in view it was false whatever fetch-pr found.
|
|
2175
|
-
*/
|
|
2176
|
-
function flowRouteDeliverable(deliverable, flow) {
|
|
2177
|
-
return {
|
|
2178
|
-
...deliverable,
|
|
2179
|
-
check: ((out, context) => deliverable.check(context === void 0 && isRecord(out) ? {
|
|
2180
|
-
...flow.settledOutputs(),
|
|
2181
|
-
...out
|
|
2182
|
-
} : out, context))
|
|
2079
|
+
routeCheck
|
|
2183
2080
|
};
|
|
2184
2081
|
}
|
|
2185
2082
|
// src/runtime/supervise/graph-overlay.ts
|
|
@@ -2257,6 +2154,7 @@ function createGraphOverlay(validated, opts) {
|
|
|
2257
2154
|
};
|
|
2258
2155
|
productAuthorities.set(authorizeSpawn, opts.authorizeSpawn);
|
|
2259
2156
|
return {
|
|
2157
|
+
nodeOfWorker: (workerId) => ledger.nodeByWorkerId.get(workerId),
|
|
2260
2158
|
routes: analystRoutes(validated, registry),
|
|
2261
2159
|
maps: mapRoutes(validated),
|
|
2262
2160
|
continuityByProfile: continuityDefaults(validated),
|
|
@@ -7365,7 +7263,7 @@ function subtreeOf(env, seat, authorized, spawnContext) {
|
|
|
7365
7263
|
const own = subtask === void 0 ? void 0 : env.graphOverlayFor(subtask);
|
|
7366
7264
|
const ownGraph = own?.overlay;
|
|
7367
7265
|
const ownFlow = own?.validated.flow === void 0 ? void 0 : {
|
|
7368
|
-
run: createFlowRun(),
|
|
7266
|
+
run: createFlowRun(own.overlay.nodeOfWorker),
|
|
7369
7267
|
route: flowOfSubtask(routeFlowOf(own.validated), spawnContext.map === void 0 ? void 0 : { item: spawnContext.task })
|
|
7370
7268
|
};
|
|
7371
7269
|
return {
|
|
@@ -9457,6 +9355,6 @@ function superviseWithContext(profile, task, opts, brain) {
|
|
|
9457
9355
|
...signal === void 0 ? {} : { signal }
|
|
9458
9356
|
}, brain));
|
|
9459
9357
|
}
|
|
9460
|
-
export {
|
|
9358
|
+
export { analyzesFindingsReportPrompt as A, anyOf as B, flowRootProfile as C, defaultEdgeTraversalCap as D, validateFlowGraph as E, formatPromptHandle as F, bestSoFar as G, plateau as H, kernelPromptRegistry as I, createSupervisorSpanRecorder as J, plateauLength as K, naiveContinuationPrompt as L, delegatesWorkerBriefPrompt as M, dumbContinuationFailPrompt as N, graphRootProfile as O, dumbContinuationPassPrompt as P, promptHandle as R, createFlowRun as S, routeFlowOf as T, anytimeReport as U, noProgressFor as V, areaUnderCurve as W, coordinationControlToolNames as _, superviseRootProfile as a, createGraphOverlay as b, retryPreSpawnRefusals as c, supervisorAgent as d, supervisorAgentWithTestBrain as f, serveCoordinationMcp as g, composeReentryTask as h, profileGuidanceComposer as i, createPromptRegistry as j, validateGraphTopology as k, withWorkerSpawnRetry as l, UNPROVEN_CONTINUITY as m, superviseFleetCapabilities as n, isPreSpawnExecutorFailure as o, runToolSpans as p, renderAnytimeTable as q, superviseWithTestBrain as r, resolveWorkerSpawnRetry as s, supervise as t, workerFromBackend as u, driverAgent as v, journaledGateDecider as w, GraphRouteError as x, runBrainLoop as y, allWorkersStalled as z };
|
|
9461
9359
|
|
|
9462
|
-
//# sourceMappingURL=supervise-
|
|
9360
|
+
//# sourceMappingURL=supervise-6BCQ73Xa.js.map
|