@tangle-network/agent-runtime 0.252.1 → 0.255.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.
Files changed (59) hide show
  1. package/dist/{activation-CXrrtB5m.js → activation-Btw2npV2.js} +2 -2
  2. package/dist/{activation-CXrrtB5m.js.map → activation-Btw2npV2.js.map} +1 -1
  3. package/dist/{activation-CVMjsBM2.d.ts → activation-Cus2oZaT.d.ts} +2 -2
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-D_LHrYiF.js → coordination-driver-Ct2hwxe6.js} +6 -5
  7. package/dist/coordination-driver-Ct2hwxe6.js.map +1 -0
  8. package/dist/{delegate-C8qzIpfB.js → delegate-DZZxeNKi.js} +2 -2
  9. package/dist/{delegate-C8qzIpfB.js.map → delegate-DZZxeNKi.js.map} +1 -1
  10. package/dist/durable.d.ts +2 -2
  11. package/dist/durable.js +4 -2
  12. package/dist/durable.js.map +1 -1
  13. package/dist/{graph-xWtpPhOj.js → graph-CP0OGyFP.js} +11 -5
  14. package/dist/graph-CP0OGyFP.js.map +1 -0
  15. package/dist/{improvement-cycle-blUuLwtN.js → improvement-cycle-D0Os0Hg_.js} +3 -3
  16. package/dist/{improvement-cycle-blUuLwtN.js.map → improvement-cycle-D0Os0Hg_.js.map} +1 -1
  17. package/dist/{index-BOyxiPdv.d.ts → index-DC_zQGpn.d.ts} +47 -5
  18. package/dist/index.d.ts +6 -6
  19. package/dist/index.js +7 -7
  20. package/dist/intelligence.d.ts +3 -3
  21. package/dist/intelligence.js +3 -3
  22. package/dist/kernel.d.ts +4 -4
  23. package/dist/kernel.js +8 -8
  24. package/dist/{loop-runner-bin-HOQO-Bc5.js → loop-runner-bin-BA7RtYGu.js} +3 -3
  25. package/dist/{loop-runner-bin-HOQO-Bc5.js.map → loop-runner-bin-BA7RtYGu.js.map} +1 -1
  26. package/dist/{loop-runner-bin-CEjfP-9b.d.ts → loop-runner-bin-BMcM1Nhf.d.ts} +3 -3
  27. package/dist/loop-runner-bin.d.ts +1 -1
  28. package/dist/loop-runner-bin.js +1 -1
  29. package/dist/mcp/bin.js +3 -3
  30. package/dist/mcp/index.d.ts +5 -5
  31. package/dist/mcp/index.js +4 -4
  32. package/dist/{openai-tools-8E1xkqPd.d.ts → openai-tools-BsqD1_Zr.d.ts} +2 -2
  33. package/dist/profiles.d.ts +2 -2
  34. package/dist/{provision-supervisor-D72s82K_.js → provision-supervisor-4e3sTnHl.js} +24 -6
  35. package/dist/provision-supervisor-4e3sTnHl.js.map +1 -0
  36. package/dist/{runtime-DuE9T9fQ.js → runtime-CthBzf7g.js} +9 -8
  37. package/dist/runtime-CthBzf7g.js.map +1 -0
  38. package/dist/{server-BRcoetaI.js → server-2qhN_mFT.js} +3 -3
  39. package/dist/{server-BRcoetaI.js.map → server-2qhN_mFT.js.map} +1 -1
  40. package/dist/{stream-agent-turn-vHFw9Cjl.d.ts → stream-agent-turn-DRTFLphI.d.ts} +2 -2
  41. package/dist/{structural-rollout-DwklJEOU.js → structural-rollout-BIBxgW64.js} +4 -3
  42. package/dist/{structural-rollout-DwklJEOU.js.map → structural-rollout-BIBxgW64.js.map} +1 -1
  43. package/dist/{substrate-Dtw3KmTi.d.ts → substrate-BToFBpfh.d.ts} +2 -2
  44. package/dist/{supervise-IBkXPk1z.js → supervise-ByEnDAOW.js} +56 -19
  45. package/dist/supervise-ByEnDAOW.js.map +1 -0
  46. package/dist/{supervisor-BlDW3u0y.js → supervisor-CJyzUjc7.js} +705 -166
  47. package/dist/supervisor-CJyzUjc7.js.map +1 -0
  48. package/dist/testing.d.ts +2 -2
  49. package/dist/testing.js +12 -12
  50. package/dist/tui/index.d.ts +1 -1
  51. package/dist/tui/index.js +1 -1
  52. package/dist/{types-DKeaex8Q.d.ts → types-ChewVlpE.d.ts} +120 -18
  53. package/package.json +5 -5
  54. package/dist/coordination-driver-D_LHrYiF.js.map +0 -1
  55. package/dist/graph-xWtpPhOj.js.map +0 -1
  56. package/dist/provision-supervisor-D72s82K_.js.map +0 -1
  57. package/dist/runtime-DuE9T9fQ.js.map +0 -1
  58. package/dist/supervise-IBkXPk1z.js.map +0 -1
  59. package/dist/supervisor-BlDW3u0y.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { Ur as Driver, Vr as AgentRunSpec, hi as Validator, ui as OutputAdapter } from "./types-DKeaex8Q.js";
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-Dtw3KmTi.d.ts.map
284
+ //# sourceMappingURL=substrate-BToFBpfh.d.ts.map
@@ -1,10 +1,10 @@
1
- import { $i as withBudgetResources, $n as contentAddress, Br as promptControlProfileMaterialization, C as restoreScopeOwnerAcceptedExecution, Cn as routerBrain, F as prepareScopeRetainedOwnerTask, Fr as assertProfileMaterialization, Ft as newUsageTotals, Gn as linkAbort, Gr as renderUnsupported, I as scopeRetainedOwnerContext, Ii as addSpend, In as registerRetainedExecutorPreparation, Ir as controlProfileMaterialization, Ji as unmeteredSpend, Kn as runAbortable, L as scopeRetainedOwnerPriorSpend, Ln as retainedExecutorSeamKey, Lr as defineProfileMaterializationContract, Lt as spendFromUsageTotals, M as bindScopeRetainedOwnerEnvironmentId, Mt as assertValidBudget, N as bindScopeRetainedOwnerProvider, P as consumeScopeRetainedOwnerResult, Pt as meterUsageEvent, Qi as resourceTelemetry, Qr as readCommittedJsonLines, R as scopeRetainedOwnerResourceReader, Rr as fullProfileMaterialization, Rt as WORKER_TRACE_PROPAGATION, S as recordScopeOwnerMaterialization, Un as RunCancellationReason, Vr as promptModelProfileMaterialization, Wi as sleep, Xi as zeroSpend, Xr as isNoEntError, Yi as withTimeout, Yr as worktreeCliProfileMaterialization, Zi as addResourceSpend, Zr as prepareJsonlAppend, _ as beginScopeOwnerAttempt, aa as teardownExecutor, an as bridgeAdmissionRefusal, b as meterRuntimeOwnedAccounting, ci as providerAttemptEvidence, d as defaultUnmetContractSteer, di as runtimeOwnedExecutorExecutionBinding, dn as bridgeRuntimeAttachmentsKey, f as runDriverWithRetry, fi as runtimeOwnedExecutorMaterialization, fn as bridgeStopSignalKey, fr as generateSpanId, ft as snapshotExecutorConfig, gr as toOtelAttributes, h as isDriverSpec, hi as runtimeOwnedScopeOwnerRuntime, ii as inheritRuntimeOwnedExecutorAttestation, in as executorFailure, jn as resolveAgentEnvironmentProvider, l as HarnessTurnFailedError, li as recordRuntimeOwnedDriveHarnessProviderEvidence, lr as createOtelExporter, m as driverExecutorFactory, mi as runtimeOwnedPendingExecutorMaterialization, n as createSupervisor, o as runFinalizer, on as bridgeModelRouteRefusal, ot as bindReusableExecutorExecutionId, p as driverChild, pi as runtimeOwnedExecutorProviderEvidence, qr as unsupportedProfileDimensions, qt as createInbox, r as bestDelivered, ra as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, s as runTree, st as captureReusableExecutorConfig, t as createRootHandle, ti as attestRuntimeOwnedScopeOwner, tt as errMessage, ui as runtimeOwnedDriveHarnessProviderEvidence, ut as createExecutor, w as scopeOwnerExecutorNodeContext, x as meterRuntimeOwnedProviderAttempt, xi as detachedSnapshot, y as deriveNodeExecutionIdentity, z as scopeRetainedOwnerResult, zr as profileMaterializationAxes$1 } from "./supervisor-BlDW3u0y.js";
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-D_LHrYiF.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-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(deps);
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.pass("turn");
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.pass("final");
1437
- cancellations.pass("final");
1444
+ await steers?.pass("final");
1445
+ cancellations?.pass("final");
1438
1446
  } finally {
1439
- cancellations.finish();
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 canonicalProfile = freezeDetachedProfile(parsedProfile.data);
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,6 +3788,7 @@ 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 } : {},
3756
3793
  ownerWorkspaceRetention: managerBackend?.backend === "provider" && managerBackend.workspaceRetention !== void 0,
3757
3794
  ...options.maxLiveWorkers !== void 0 ? { maxLiveWorkers: options.maxLiveWorkers } : {},
@@ -3829,6 +3866,6 @@ function rootProviderModelEvidenceFromExecution(evidence) {
3829
3866
  return evidence ?? rootProviderModelEvidence([]);
3830
3867
  }
3831
3868
  //#endregion
3832
- export { createSupervisorSpanRecorder as _, isPreSpawnExecutorFailure as a, mapExecutorResult as b, withWorkerSpawnRetry as c, resolveSupervisorProfile as d, supervisorAgent as f, readRootStreamReceipt as g, readRootStream as h, workerFromBackend as i, assertCoordinationBinding as l, ROOT_STREAM_FILE as m, supervise as n, resolveWorkerSpawnRetry as o, supervisorAgentWithTestBrain as p, superviseWithTestBrain as r, retryPreSpawnRefusals as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, coordinationProfileToolPrefix as u, serveCoordinationMcp as v, gateOnDeliverable as y };
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 };
3833
3870
 
3834
- //# sourceMappingURL=supervise-IBkXPk1z.js.map
3871
+ //# sourceMappingURL=supervise-ByEnDAOW.js.map