@tangle-network/agent-runtime 0.252.0 → 0.254.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{activation-BSLatbiJ.js → activation-Btw2npV2.js} +2 -2
- package/dist/{activation-BSLatbiJ.js.map → activation-Btw2npV2.js.map} +1 -1
- package/dist/{activation-BykUtuec.d.ts → activation-Cus2oZaT.d.ts} +2 -2
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-QxitIuva.js → coordination-driver-Ct2hwxe6.js} +6 -5
- package/dist/coordination-driver-Ct2hwxe6.js.map +1 -0
- package/dist/{delegate-BB90iDo7.js → delegate-DZZxeNKi.js} +2 -2
- package/dist/{delegate-BB90iDo7.js.map → delegate-DZZxeNKi.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +4 -2
- package/dist/durable.js.map +1 -1
- package/dist/{graph-yC6wqOIt.js → graph-CP0OGyFP.js} +11 -5
- package/dist/graph-CP0OGyFP.js.map +1 -0
- package/dist/{improvement-cycle-on_u94aK.js → improvement-cycle-D0Os0Hg_.js} +3 -3
- package/dist/{improvement-cycle-on_u94aK.js.map → improvement-cycle-D0Os0Hg_.js.map} +1 -1
- package/dist/{index-DGWG7wSS.d.ts → index-DC_zQGpn.d.ts} +47 -5
- package/dist/index.d.ts +6 -6
- package/dist/index.js +7 -7
- package/dist/intelligence.d.ts +3 -3
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +8 -8
- package/dist/{loop-runner-bin-PL0dItet.js → loop-runner-bin-BA7RtYGu.js} +3 -3
- package/dist/{loop-runner-bin-PL0dItet.js.map → loop-runner-bin-BA7RtYGu.js.map} +1 -1
- package/dist/{loop-runner-bin-CsVNUclF.d.ts → loop-runner-bin-BMcM1Nhf.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-zrajPyXe.d.ts → openai-tools-BsqD1_Zr.d.ts} +2 -2
- package/dist/profiles.d.ts +2 -2
- package/dist/{provision-supervisor-DsAhgOpn.js → provision-supervisor-4e3sTnHl.js} +24 -6
- package/dist/provision-supervisor-4e3sTnHl.js.map +1 -0
- package/dist/{runtime-CMNTa7Rw.js → runtime-CthBzf7g.js} +9 -8
- package/dist/runtime-CthBzf7g.js.map +1 -0
- package/dist/{server-2fL_QElQ.js → server-2qhN_mFT.js} +3 -3
- package/dist/{server-2fL_QElQ.js.map → server-2qhN_mFT.js.map} +1 -1
- package/dist/{stream-agent-turn-oeWkjxMi.d.ts → stream-agent-turn-DRTFLphI.d.ts} +2 -2
- package/dist/{structural-rollout-DRD-WnV-.js → structural-rollout-BIBxgW64.js} +4 -3
- package/dist/{structural-rollout-DRD-WnV-.js.map → structural-rollout-BIBxgW64.js.map} +1 -1
- package/dist/{substrate-Ctmos75o.d.ts → substrate-BToFBpfh.d.ts} +2 -2
- package/dist/{supervise-BXzkqfTE.js → supervise-ByEnDAOW.js} +57 -19
- package/dist/supervise-ByEnDAOW.js.map +1 -0
- package/dist/{supervisor-OJwKAnFd.js → supervisor-CJyzUjc7.js} +772 -168
- package/dist/supervisor-CJyzUjc7.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-BmxS-W-f.d.ts → types-ChewVlpE.d.ts} +124 -18
- package/package.json +5 -5
- package/dist/coordination-driver-QxitIuva.js.map +0 -1
- package/dist/graph-yC6wqOIt.js.map +0 -1
- package/dist/provision-supervisor-DsAhgOpn.js.map +0 -1
- package/dist/runtime-CMNTa7Rw.js.map +0 -1
- package/dist/supervise-BXzkqfTE.js.map +0 -1
- package/dist/supervisor-OJwKAnFd.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hr as AgentRunSpec, Wr as Driver, di as OutputAdapter, gi as Validator } from "./types-ChewVlpE.js";
|
|
2
2
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
3
3
|
//#region src/profiles/coder.d.ts
|
|
4
4
|
/**
|
|
@@ -281,4 +281,4 @@ interface UiFinding {
|
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
283
|
export { CoderTask as _, UiFindingSeverity as a, KnowledgeUpdate as c, ResearchSource as d, ResearchTask as f, researcherProfile as g, multiHarnessResearcherFanout as h, UiFindingScreenshot as i, MultiHarnessResearcherFanoutOptions as l, createResearcherValidator as m, UI_LENSES as n, UiLens as o, ResearcherProfileOptions as p, UiFinding as r, KnowledgeItem as s, UI_FINDING_SEVERITIES as t, ResearchOutput as u, coderTaskToPrompt as v };
|
|
284
|
-
//# sourceMappingURL=substrate-
|
|
284
|
+
//# sourceMappingURL=substrate-BToFBpfh.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $i as
|
|
1
|
+
import { $i as resourceTelemetry, $r as readCommittedJsonLines, An as resolveAgentEnvironmentProvider, Br as profileMaterializationAxes$1, C as restoreScopeOwnerAcceptedExecution, F as prepareScopeRetainedOwnerTask, Fn as registerRetainedExecutorPreparation, Gi as sleep, Hr as promptModelProfileMaterialization, I as scopeRetainedOwnerContext, In as retainedExecutorSeamKey, Ir as assertProfileMaterialization, It as spendFromUsageTotals, Jr as unsupportedProfileDimensions, Kn as linkAbort, Kr as renderUnsupported, Kt as createInbox, L as scopeRetainedOwnerPriorSpend, Li as addSpend, Lr as controlProfileMaterialization, Lt as WORKER_TRACE_PROPAGATION, M as bindScopeRetainedOwnerEnvironmentId, N as bindScopeRetainedOwnerProvider, Nt as meterUsageEvent, P as consumeScopeRetainedOwnerResult, Pt as newUsageTotals, Qi as addResourceSpend, Qr as prepareJsonlAppend, R as scopeRetainedOwnerResourceReader, Rr as defineProfileMaterializationContract, S as recordScopeOwnerMaterialization, Si as detachedSnapshot, Sn as routerBrain, Vr as promptControlProfileMaterialization, Wn as RunCancellationReason, Xi as withTimeout, Xr as worktreeCliProfileMaterialization, Yi as unmeteredSpend, Zi as zeroSpend, Zr as isNoEntError, _ as beginScopeOwnerAttempt, _r as toOtelAttributes, ai as inheritRuntimeOwnedExecutorAttestation, an as bridgeModelRouteRefusal, at as bindReusableExecutorExecutionId, b as meterRuntimeOwnedAccounting, d as defaultUnmetContractSteer, di as runtimeOwnedDriveHarnessProviderEvidence, dn as bridgeStopSignalKey, dt as snapshotExecutorConfig, ea as withBudgetResources, er as contentAddress, et as errMessage, f as runDriverWithRetry, fi as runtimeOwnedExecutorExecutionBinding, gi as runtimeOwnedScopeOwnerRuntime, h as isDriverSpec, hi as runtimeOwnedPendingExecutorMaterialization, ia as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, in as bridgeAdmissionRefusal, jt as assertValidBudget, l as HarnessTurnFailedError, li as providerAttemptEvidence, lt as createExecutor, m as driverExecutorFactory, mi as runtimeOwnedExecutorProviderEvidence, n as createSupervisor, ni as attestRuntimeOwnedScopeOwner, o as runFinalizer, oa as teardownExecutor, ot as captureReusableExecutorConfig, p as driverChild, pi as runtimeOwnedExecutorMaterialization, pr as generateSpanId, qn as runAbortable, r as bestDelivered, rn as executorFailure, s as runTree, sa as teardownSurfaces, t as createRootHandle, ui as recordRuntimeOwnedDriveHarnessProviderEvidence, un as bridgeRuntimeAttachmentsKey, ur as createOtelExporter, w as scopeOwnerExecutorNodeContext, x as meterRuntimeOwnedProviderAttempt, y as deriveNodeExecutionIdentity, z as scopeRetainedOwnerResult, zr as fullProfileMaterialization } from "./supervisor-CJyzUjc7.js";
|
|
2
2
|
import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
|
|
3
3
|
import { a as concreteProfileModel, c as profileModelExecutionSettings, d as agentHarness, f as harnessRunsAgent, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile } from "./model-policy-BbSCSak0.js";
|
|
4
4
|
import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
|
|
5
5
|
import { n as assertNoSymlinkDescendant } from "./durable-file-DWQA4ooo.js";
|
|
6
6
|
import { n as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-x9NEhvHZ.js";
|
|
7
|
-
import { D as coordinationVerbNames, S as watchRunCancellation, c as createProgressTracker, d as progressStop, k as createCoordinationToolsForManager, n as createSteerAcknowledger, r as driverAgent, t as createCancelAcknowledger, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-
|
|
7
|
+
import { D as coordinationVerbNames, S as watchRunCancellation, c as createProgressTracker, d as progressStop, k as createCoordinationToolsForManager, n as createSteerAcknowledger, r as driverAgent, t as createCancelAcknowledger, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-Ct2hwxe6.js";
|
|
8
8
|
import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-vwd4SwX_.js";
|
|
9
9
|
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
10
10
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -13,6 +13,7 @@ import { resolve } from "node:path";
|
|
|
13
13
|
import { mkdir } from "node:fs/promises";
|
|
14
14
|
import { isMaterializerHarness } from "@tangle-network/agent-profile-materialize";
|
|
15
15
|
import { createServer } from "node:http";
|
|
16
|
+
import { withProfileKb } from "@tangle-network/agent-interface/profile-kb";
|
|
16
17
|
//#region src/runtime/supervise/completion-gate.ts
|
|
17
18
|
/**
|
|
18
19
|
*
|
|
@@ -104,6 +105,7 @@ function gateOnDeliverable(inner, deliverable) {
|
|
|
104
105
|
})();
|
|
105
106
|
},
|
|
106
107
|
teardown: (grace) => inner.teardown(grace),
|
|
108
|
+
...teardownSurfaces(inner),
|
|
107
109
|
resultArtifact() {
|
|
108
110
|
const art = inner.resultArtifact();
|
|
109
111
|
return {
|
|
@@ -149,6 +151,7 @@ function mapExecutorResult(inner, map) {
|
|
|
149
151
|
return (async () => settle(await execution, task))();
|
|
150
152
|
},
|
|
151
153
|
teardown: (grace) => inner.teardown(grace),
|
|
154
|
+
...teardownSurfaces(inner),
|
|
152
155
|
resultArtifact() {
|
|
153
156
|
if (!mapped) throw new Error("mapExecutorResult: resultArtifact() read before execute()");
|
|
154
157
|
return mapped;
|
|
@@ -695,6 +698,7 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
|
|
|
695
698
|
...opts.priorAnalystDefinitions?.length ? { priorAnalystDefinitions: opts.priorAnalystDefinitions } : {},
|
|
696
699
|
...opts.preflightSpawn ? { preflightSpawn: opts.preflightSpawn } : {},
|
|
697
700
|
...opts.resolveSpawnProfile ? { resolveSpawnProfile: opts.resolveSpawnProfile } : {},
|
|
701
|
+
...opts.composeSpawnProfile ? { composeSpawnProfile: opts.composeSpawnProfile } : {},
|
|
698
702
|
...opts.spawnResourceRoot ? { spawnResourceRoot: opts.spawnResourceRoot } : {},
|
|
699
703
|
...ownerReader ? { spawnResourceReader: ownerReader } : {},
|
|
700
704
|
...opts.peerMail ? { peerMail: typeof opts.peerMail === "object" && opts.peerMail.limits ? { limits: opts.peerMail.limits } : {} } : {}
|
|
@@ -1378,8 +1382,8 @@ function errorMessage(error) {
|
|
|
1378
1382
|
/** Observe durable worker controls while the native harness owns the manager's turn loop. */
|
|
1379
1383
|
function observeWorkerControls(options) {
|
|
1380
1384
|
const { dir, coord, scope, signal, controlScope, onError } = options;
|
|
1385
|
+
const steerDir = options.steerDir ?? dir;
|
|
1381
1386
|
const deps = {
|
|
1382
|
-
dir,
|
|
1383
1387
|
coord,
|
|
1384
1388
|
scope,
|
|
1385
1389
|
signal,
|
|
@@ -1387,12 +1391,16 @@ function observeWorkerControls(options) {
|
|
|
1387
1391
|
ownerId: scope.view.root,
|
|
1388
1392
|
controlScope
|
|
1389
1393
|
};
|
|
1390
|
-
const steers = createSteerAcknowledger({
|
|
1394
|
+
const steers = steerDir === void 0 ? void 0 : createSteerAcknowledger({
|
|
1391
1395
|
...deps,
|
|
1396
|
+
dir: steerDir,
|
|
1392
1397
|
deliverRoot: options.deliverRoot,
|
|
1393
1398
|
deliverRootReady: options.deliverRootReady
|
|
1394
1399
|
});
|
|
1395
|
-
const cancellations = createCancelAcknowledger(
|
|
1400
|
+
const cancellations = dir === void 0 ? void 0 : createCancelAcknowledger({
|
|
1401
|
+
...deps,
|
|
1402
|
+
dir
|
|
1403
|
+
});
|
|
1396
1404
|
let active = true;
|
|
1397
1405
|
let timer;
|
|
1398
1406
|
let steering = false;
|
|
@@ -1412,8 +1420,8 @@ function observeWorkerControls(options) {
|
|
|
1412
1420
|
const poll = () => {
|
|
1413
1421
|
if (!active) return;
|
|
1414
1422
|
try {
|
|
1415
|
-
cancellations
|
|
1416
|
-
if (steering) return;
|
|
1423
|
+
cancellations?.pass("turn");
|
|
1424
|
+
if (steers === void 0 || steering) return;
|
|
1417
1425
|
steering = true;
|
|
1418
1426
|
inFlight = steers.pass("turn").catch(fail).finally(() => {
|
|
1419
1427
|
steering = false;
|
|
@@ -1433,10 +1441,10 @@ function observeWorkerControls(options) {
|
|
|
1433
1441
|
stop();
|
|
1434
1442
|
await inFlight;
|
|
1435
1443
|
try {
|
|
1436
|
-
await steers
|
|
1437
|
-
cancellations
|
|
1444
|
+
await steers?.pass("final");
|
|
1445
|
+
cancellations?.pass("final");
|
|
1438
1446
|
} finally {
|
|
1439
|
-
cancellations
|
|
1447
|
+
cancellations?.finish();
|
|
1440
1448
|
}
|
|
1441
1449
|
if (failure) throw failure.error;
|
|
1442
1450
|
};
|
|
@@ -1683,6 +1691,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
1683
1691
|
...deps.continuityByProfile ? { continuityByProfile: deps.continuityByProfile } : {},
|
|
1684
1692
|
...deps.preflightSpawn ? { preflightSpawn: deps.preflightSpawn } : {},
|
|
1685
1693
|
...deps.resolveSpawnProfile ? { resolveSpawnProfile: deps.resolveSpawnProfile } : {},
|
|
1694
|
+
...deps.composeSpawnProfile ? { composeSpawnProfile: deps.composeSpawnProfile } : {},
|
|
1686
1695
|
...deps.spawnResourceRoot ? { spawnResourceRoot: deps.spawnResourceRoot } : {},
|
|
1687
1696
|
...deps.spawnResourceReader ? { spawnResourceReader: deps.spawnResourceReader } : {},
|
|
1688
1697
|
...deps.stopRule ? { stopRule: deps.stopRule } : {},
|
|
@@ -1695,6 +1704,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
1695
1704
|
...deps.finalizer ? { finalizer: deps.finalizer } : {},
|
|
1696
1705
|
...slot ? { onCoordinationTools: (tools) => slot.bind(tools) } : {},
|
|
1697
1706
|
...deps.controlDir === void 0 ? {} : { controlDir: deps.controlDir },
|
|
1707
|
+
...deps.steerDir === void 0 ? {} : { steerDir: deps.steerDir },
|
|
1698
1708
|
...deps.controlScope === void 0 ? {} : { controlScope: deps.controlScope },
|
|
1699
1709
|
...deps.abortRun ? { abortRun: deps.abortRun } : {},
|
|
1700
1710
|
inbox
|
|
@@ -1781,6 +1791,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
1781
1791
|
...deps.replaySettlements ? { replaySettlements: true } : {},
|
|
1782
1792
|
...deps.preflightSpawn ? { preflightSpawn: deps.preflightSpawn } : {},
|
|
1783
1793
|
...deps.resolveSpawnProfile ? { resolveSpawnProfile: deps.resolveSpawnProfile } : {},
|
|
1794
|
+
...deps.composeSpawnProfile ? { composeSpawnProfile: deps.composeSpawnProfile } : {},
|
|
1784
1795
|
...deps.spawnResourceRoot ? { spawnResourceRoot: deps.spawnResourceRoot } : {},
|
|
1785
1796
|
...deps.spawnResourceReader ? { spawnResourceReader: deps.spawnResourceReader } : {},
|
|
1786
1797
|
...deps.peerMail ? { peerMail: deps.peerMail } : {},
|
|
@@ -1800,8 +1811,9 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
1800
1811
|
const providerProfile = detachedSnapshot(providerVisibleProfile(stableProfile), "supervisorAgent provider-visible profile");
|
|
1801
1812
|
let controlObserver;
|
|
1802
1813
|
try {
|
|
1803
|
-
if (deps.controlDir !== void 0) controlObserver = observeWorkerControls({
|
|
1804
|
-
dir: deps.controlDir,
|
|
1814
|
+
if (deps.controlDir !== void 0 || deps.steerDir !== void 0) controlObserver = observeWorkerControls({
|
|
1815
|
+
...deps.controlDir === void 0 ? {} : { dir: deps.controlDir },
|
|
1816
|
+
...deps.steerDir === void 0 ? {} : { steerDir: deps.steerDir },
|
|
1805
1817
|
coord: controls,
|
|
1806
1818
|
scope,
|
|
1807
1819
|
signal: coordinationLifetime.signal,
|
|
@@ -2143,6 +2155,7 @@ function retryPreSpawnRefusals(inner, policy, hooks = {}) {
|
|
|
2143
2155
|
return isAsyncIterable$1(first) ? retryStream(first, restart, signal) : retryOneShot(first, restart, signal);
|
|
2144
2156
|
},
|
|
2145
2157
|
teardown: (grace) => inner.teardown(grace),
|
|
2158
|
+
...teardownSurfaces(inner),
|
|
2146
2159
|
resultArtifact: () => inner.resultArtifact()
|
|
2147
2160
|
};
|
|
2148
2161
|
async function* retryStream(first, restart, signal) {
|
|
@@ -3006,6 +3019,7 @@ const superviseOptionKeySet = /* @__PURE__ */ new Set([
|
|
|
3006
3019
|
"blobs",
|
|
3007
3020
|
"budget",
|
|
3008
3021
|
"childSettleGraceMs",
|
|
3022
|
+
"teardownConfirmMs",
|
|
3009
3023
|
"retainedAtSettlement",
|
|
3010
3024
|
"compaction",
|
|
3011
3025
|
"continuityByProfile",
|
|
@@ -3035,6 +3049,7 @@ const superviseOptionKeySet = /* @__PURE__ */ new Set([
|
|
|
3035
3049
|
"peerMail",
|
|
3036
3050
|
"perWorker",
|
|
3037
3051
|
"probes",
|
|
3052
|
+
"profileGuidance",
|
|
3038
3053
|
"profileSecurity",
|
|
3039
3054
|
"registry",
|
|
3040
3055
|
"resolveDeliverable",
|
|
@@ -3048,6 +3063,7 @@ const superviseOptionKeySet = /* @__PURE__ */ new Set([
|
|
|
3048
3063
|
"runId",
|
|
3049
3064
|
"signal",
|
|
3050
3065
|
"stallAfterMs",
|
|
3066
|
+
"steerDir",
|
|
3051
3067
|
"stopRule",
|
|
3052
3068
|
"watchWorkers",
|
|
3053
3069
|
"repromptOnUnmet",
|
|
@@ -3259,7 +3275,7 @@ function recordRunCancellationOutcome(runDir, result, now) {
|
|
|
3259
3275
|
writeRunCancellation(dir, {
|
|
3260
3276
|
...base,
|
|
3261
3277
|
effect: "unknown",
|
|
3262
|
-
detail: `run aborted but teardown remains unconfirmed for: ${result.teardownUnconfirmed.map((node) => node.id).join(", ")}`
|
|
3278
|
+
detail: `run aborted but teardown remains unconfirmed for: ${result.teardownUnconfirmed.map((node) => node.environments?.length ? `${node.id} (${node.environments.map((environment) => `${environment.provider}:${environment.environmentId}`).join(", ")})` : node.id).join(", ")}`
|
|
3263
3279
|
});
|
|
3264
3280
|
return;
|
|
3265
3281
|
}
|
|
@@ -3395,12 +3411,28 @@ function superviseWithTestBrain(profile, task, opts) {
|
|
|
3395
3411
|
const { brain, ...runtimeOptions } = opts;
|
|
3396
3412
|
return superviseInternal(profile, task, runtimeOptions, brain);
|
|
3397
3413
|
}
|
|
3414
|
+
/**
|
|
3415
|
+
* The composer `profileGuidance` selects, or `undefined` when no guidance is selected. The result
|
|
3416
|
+
* is re-validated as an AgentProfile, and a composition that breaks the schema is refused as a
|
|
3417
|
+
* ValidationError. `supervise` applies it to the root and to authored spawns; `runGraph` applies
|
|
3418
|
+
* it to pinned node profiles.
|
|
3419
|
+
*/
|
|
3420
|
+
function profileGuidanceComposer(guidance) {
|
|
3421
|
+
if (guidance === void 0) return void 0;
|
|
3422
|
+
if (guidance !== "profile-kb") throw new ValidationError(`supervise: profileGuidance must be 'profile-kb' when set, got ${JSON.stringify(guidance)}`);
|
|
3423
|
+
return (profile) => {
|
|
3424
|
+
const composed = agentProfileSchema.safeParse(withProfileKb(profile));
|
|
3425
|
+
if (!composed.success) throw new ValidationError(`supervise: profile-kb guidance produced an invalid AgentProfile: ${composed.error.message}`);
|
|
3426
|
+
return composed.data;
|
|
3427
|
+
};
|
|
3428
|
+
}
|
|
3398
3429
|
function superviseInternal(profile, task, opts, testBrain) {
|
|
3399
3430
|
const options = captureSuperviseOptions(opts);
|
|
3400
3431
|
assertValidBudget(options.budget, "supervise budget");
|
|
3401
3432
|
const parsedProfile = agentProfileSchema.safeParse(profile);
|
|
3402
3433
|
if (!parsedProfile.success) throw new ValidationError(`supervise: invalid AgentProfile: ${parsedProfile.error.message}`);
|
|
3403
|
-
const
|
|
3434
|
+
const composeSpawnProfile = profileGuidanceComposer(options.profileGuidance);
|
|
3435
|
+
const canonicalProfile = freezeDetachedProfile(composeSpawnProfile ? composeSpawnProfile(parsedProfile.data) : parsedProfile.data);
|
|
3404
3436
|
assertExecutableAgentProfile(canonicalProfile, "supervise root");
|
|
3405
3437
|
const canonicalTask = freezeDetached(task);
|
|
3406
3438
|
if (options.makeWorkerAgent && options.authorizeSpawn) throw new ValidationError("supervise: authorizeSpawn cannot be combined with caller-owned makeWorkerAgent; use makeLeafAgent to override leaf execution inside the authorized path, or use backend-derived workers");
|
|
@@ -3602,6 +3634,7 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3602
3634
|
...options.continuityByProfile ? { continuityByProfile: options.continuityByProfile } : {},
|
|
3603
3635
|
...spawnPreflight ? { preflightSpawn: spawnPreflight } : {},
|
|
3604
3636
|
...options.resolveSpawnProfile ? { resolveSpawnProfile: options.resolveSpawnProfile } : {},
|
|
3637
|
+
...composeSpawnProfile ? { composeSpawnProfile } : {},
|
|
3605
3638
|
...options.peerMail ? { peerMail: options.peerMail } : {},
|
|
3606
3639
|
...options.stopRule ? { stopRule: options.stopRule } : {},
|
|
3607
3640
|
...options.onProgressStop ? { onProgressStop: options.onProgressStop } : {},
|
|
@@ -3622,9 +3655,10 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3622
3655
|
...finalizer ? { finalizer } : {},
|
|
3623
3656
|
...options.runDir === void 0 ? {} : {
|
|
3624
3657
|
controlDir: resolve(options.runDir),
|
|
3625
|
-
controlScope: "subtree",
|
|
3626
3658
|
abortRun: cancelDurableRun
|
|
3627
|
-
}
|
|
3659
|
+
},
|
|
3660
|
+
...options.steerDir === void 0 ? {} : { steerDir: resolve(options.steerDir) },
|
|
3661
|
+
...options.runDir === void 0 && options.steerDir === void 0 ? {} : { controlScope: "subtree" }
|
|
3628
3662
|
}), journal, childExecution.ref, () => acceptedSubmission, recoveryFactories.get(childFactory));
|
|
3629
3663
|
};
|
|
3630
3664
|
if (options.makeLeafAgent === void 0 && options.backend?.backend === "provider" && !options.backend.steering) {
|
|
@@ -3679,6 +3713,7 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3679
3713
|
...options.coordination && isExternalSupervisor(canonicalProfile) ? { coordination: options.coordination } : {},
|
|
3680
3714
|
...spawnPreflight ? { preflightSpawn: spawnPreflight } : {},
|
|
3681
3715
|
...options.resolveSpawnProfile ? { resolveSpawnProfile: options.resolveSpawnProfile } : {},
|
|
3716
|
+
...composeSpawnProfile ? { composeSpawnProfile } : {},
|
|
3682
3717
|
...spawnResourceRoot === void 0 ? {} : { spawnResourceRoot },
|
|
3683
3718
|
...options.peerMail ? { peerMail: options.peerMail } : {},
|
|
3684
3719
|
...options.maxLiveWorkers !== void 0 ? { maxLiveWorkers: options.maxLiveWorkers } : {},
|
|
@@ -3715,7 +3750,8 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3715
3750
|
...options.runDir === void 0 || runControl === void 0 ? {} : {
|
|
3716
3751
|
controlDir: resolve(options.runDir),
|
|
3717
3752
|
abortRun: cancelDurableRun
|
|
3718
|
-
}
|
|
3753
|
+
},
|
|
3754
|
+
...options.steerDir === void 0 ? {} : { steerDir: resolve(options.steerDir) }
|
|
3719
3755
|
};
|
|
3720
3756
|
const agent = testBrain === void 0 ? supervisorAgent(canonicalProfile, agentDeps) : supervisorAgentWithTestBrain(canonicalProfile, {
|
|
3721
3757
|
...agentDeps,
|
|
@@ -3752,7 +3788,9 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3752
3788
|
} },
|
|
3753
3789
|
maxDepth: options.maxDepth ?? 8,
|
|
3754
3790
|
...options.childSettleGraceMs !== void 0 ? { childSettleGraceMs: options.childSettleGraceMs } : {},
|
|
3791
|
+
...options.teardownConfirmMs !== void 0 ? { teardownConfirmMs: options.teardownConfirmMs } : {},
|
|
3755
3792
|
...options.retainedAtSettlement !== void 0 ? { retainedAtSettlement: options.retainedAtSettlement } : {},
|
|
3793
|
+
ownerWorkspaceRetention: managerBackend?.backend === "provider" && managerBackend.workspaceRetention !== void 0,
|
|
3756
3794
|
...options.maxLiveWorkers !== void 0 ? { maxLiveWorkers: options.maxLiveWorkers } : {},
|
|
3757
3795
|
...probes ? { probes } : {},
|
|
3758
3796
|
...ctx.resume === true ? { resume: true } : {},
|
|
@@ -3828,6 +3866,6 @@ function rootProviderModelEvidenceFromExecution(evidence) {
|
|
|
3828
3866
|
return evidence ?? rootProviderModelEvidence([]);
|
|
3829
3867
|
}
|
|
3830
3868
|
//#endregion
|
|
3831
|
-
export {
|
|
3869
|
+
export { readRootStreamReceipt as _, workerFromBackend as a, gateOnDeliverable as b, retryPreSpawnRefusals as c, coordinationProfileToolPrefix as d, resolveSupervisorProfile as f, readRootStream as g, ROOT_STREAM_FILE as h, superviseWithTestBrain as i, withWorkerSpawnRetry as l, supervisorAgentWithTestBrain as m, profileGuidanceComposer as n, isPreSpawnExecutorFailure as o, supervisorAgent as p, supervise as r, resolveWorkerSpawnRetry as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, assertCoordinationBinding as u, createSupervisorSpanRecorder as v, mapExecutorResult as x, serveCoordinationMcp as y };
|
|
3832
3870
|
|
|
3833
|
-
//# sourceMappingURL=supervise-
|
|
3871
|
+
//# sourceMappingURL=supervise-ByEnDAOW.js.map
|