@tangle-network/agent-runtime 0.325.2 → 0.325.5

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 (36) hide show
  1. package/dist/{activation-C1O2zCvn.js → activation-CHJAawWa.js} +2 -2
  2. package/dist/{activation-C1O2zCvn.js.map → activation-CHJAawWa.js.map} +1 -1
  3. package/dist/agent.js +2 -2
  4. package/dist/{coordination-driver-Bx7nXmOs.js → coordination-driver-B2XzW5aV.js} +3 -3
  5. package/dist/{coordination-driver-Bx7nXmOs.js.map → coordination-driver-B2XzW5aV.js.map} +1 -1
  6. package/dist/{delegate-BK-2bX4e.js → delegate-9kDSjqbX.js} +2 -2
  7. package/dist/{delegate-BK-2bX4e.js.map → delegate-9kDSjqbX.js.map} +1 -1
  8. package/dist/durable.js +3 -3
  9. package/dist/{graph-C8Ot8__B.js → graph-CASFQmWd.js} +4 -4
  10. package/dist/{graph-C8Ot8__B.js.map → graph-CASFQmWd.js.map} +1 -1
  11. package/dist/{improvement-cycle-IncBZK-W.js → improvement-cycle-VPes2yY3.js} +3 -3
  12. package/dist/{improvement-cycle-IncBZK-W.js.map → improvement-cycle-VPes2yY3.js.map} +1 -1
  13. package/dist/index.js +7 -7
  14. package/dist/intelligence.js +3 -3
  15. package/dist/kernel.js +8 -8
  16. package/dist/{loop-runner-bin-Ch9FgmrJ.js → loop-runner-bin-CdDJs_hF.js} +3 -3
  17. package/dist/{loop-runner-bin-Ch9FgmrJ.js.map → loop-runner-bin-CdDJs_hF.js.map} +1 -1
  18. package/dist/loop-runner-bin.js +1 -1
  19. package/dist/mcp/bin.js +3 -3
  20. package/dist/mcp/index.js +4 -4
  21. package/dist/{provision-supervisor-GqVnQ_oy.js → provision-supervisor-CN12VbBF.js} +3 -3
  22. package/dist/{provision-supervisor-GqVnQ_oy.js.map → provision-supervisor-CN12VbBF.js.map} +1 -1
  23. package/dist/{runtime-9ZwTmnhQ.js → runtime-B1dDO_VV.js} +8 -8
  24. package/dist/{runtime-9ZwTmnhQ.js.map → runtime-B1dDO_VV.js.map} +1 -1
  25. package/dist/{search-executor-CKIXXaiX.js → search-executor-CWFISUJm.js} +2 -2
  26. package/dist/{search-executor-CKIXXaiX.js.map → search-executor-CWFISUJm.js.map} +1 -1
  27. package/dist/{server-BSWvux-R.js → server-C91JYr7S.js} +3 -3
  28. package/dist/{server-BSWvux-R.js.map → server-C91JYr7S.js.map} +1 -1
  29. package/dist/{supervise-Dt_bZSVY.js → supervise-ttbcgYgS.js} +41 -8
  30. package/dist/{supervise-Dt_bZSVY.js.map → supervise-ttbcgYgS.js.map} +1 -1
  31. package/dist/{supervisor-CESg1FQx.js → supervisor-Crul0LFI.js} +25 -4
  32. package/dist/supervisor-Crul0LFI.js.map +1 -0
  33. package/dist/testing.js +12 -12
  34. package/dist/tui/index.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/supervisor-CESg1FQx.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { n as assertNoSymlinkDescendant } from "./durable-file-B_eJr6Mb.js";
2
- import { $n as readHarnessTranscript, $r as renderUnsupported, A as scopeOwnerExecutorNodeContext, At as bindReusableExecutorExecutionId, B as consumeScopeRetainedOwnerResult, Bt as createRouterTranscript, C as deriveNodeExecutionIdentity, Ct as checkVerdictOf, D as recordScopeOwnerMaterialization, E as recordScopeOwnerDriverAttempt, F as seatExecutionProfile, Fn as bridgeRuntimeAttachmentsKey, G as scopeRetainedOwnerContext, Gr as defineProfileMaterializationContract, H as prepareScopeRetainedOwnerSeatSwitch, Hr as assertProfileMaterialization, Ht as WORKER_TRACE_PROPAGATION, I as abandonScopeRetainedOwnerInvocation, In as bridgeStopSignalKey, It as snapshotExecutorConfig, J as scopeRetainedOwnerResourceReader, Jn as linkAbort, Jr as promptControlProfileMaterialization, K as scopeRetainedOwnerJournalRoot, Kn as RunCancellationReason, Kr as fullProfileMaterialization, L as beginScopeRetainedOwnerDrive, M as SeatChain, Mi as registerRetainedExecutorPreparation, N as SeatChainExhaustedError, Ni as retainedExecutorSeamKey, O as recordScopeOwnerPause, P as authoredSeatStages, Pt as createExecutor, Qn as persistHarnessTranscript, R as bindScopeRetainedOwnerEnvironmentId, Sa as spendFromUsageTotals, Sr as toOtelAttributes, St as bestComposite, T as meterRuntimeOwnedProviderAttempt, Tn as routerBrain, U as prepareScopeRetainedOwnerTask, V as noteScopeRetainedOwnerCoordination, W as reconcileScopeRetainedOwnerEnvironment, Wr as controlProfileMaterialization, X as scopeRetainedOwnerResult, Y as scopeRetainedOwnerRestorePoint, Yn as runAbortable, Yr as promptModelProfileMaterialization, Yt as createActivityLog, Z as scopeRetainedOwnerTurnEnded, Zt as createInbox, _ as isDriverSpec, _a as assertValidBudget, _i as runtimeOwnedExecutorExecutionBinding, _t as CONTINUATIONS_DIR, at as runtimeGraphMetadataKey, b as assertRecursiveReservationPolicy, ba as newUsageTotals, bi as runtimeOwnedPendingExecutorMaterialization, bt as admitContinuationPolicy, c as runTree, ca as parseWorkerToolTraceArtifact, cn as bridgeAdmissionRefusal, en as PEER_MAIL_WIRE_KEY, f as runDriverWithRetry, fa as detachedSnapshot, g as driverExecutorFactory, gi as runtimeOwnedDriveHarnessProviderEvidence, gr as createOtelExporter, h as driverChild, hi as recordRuntimeOwnedDriveHarnessProviderEvidence, ht as gateOnDeliverable, i as bestDelivered, ii as worktreeCliProfileMaterialization, it as providerVisibleProfile, jn as resolveAgentEnvironmentProvider, jt as captureReusableExecutorConfig, k as restoreScopeOwnerAcceptedExecution, ln as bridgeModelRouteRefusal, ma as errMessage, mi as providerAttemptEvidence, n as createRootHandle, ni as unsupportedProfileDimensions, nt as coordinationMcpAlias, oi as attestRuntimeOwnedScopeOwner, on as isLiveNodeStatus, p as summarizeDriverAttempts, pa as executorFailure, q as scopeRetainedOwnerPriorSpend, qr as profileMaterializationAxes$1, r as createSupervisor, rn as isPeerMailEnvelope, rt as coordinationProfileToolPrefix, s as runFinalizer, si as authoredAgentIdentity, ti as sandboxProfileMaterialization, u as HarnessTurnFailedError, ua as contentAddress, ui as inheritRuntimeOwnedExecutorAttestation, vi as runtimeOwnedExecutorMaterialization, vr as generateSpanId, w as meterRuntimeOwnedAccounting, wt as createContinuationKeeper, x as beginScopeOwnerAttempt, xi as runtimeOwnedScopeOwnerRuntime, ya as meterUsageEvent, yi as runtimeOwnedExecutorProviderEvidence, yt as CheckUnavailableError, z as bindScopeRetainedOwnerProvider } from "./supervisor-CESg1FQx.js";
2
+ import { $n as readHarnessTranscript, $r as renderUnsupported, A as scopeOwnerExecutorNodeContext, At as bindReusableExecutorExecutionId, B as consumeScopeRetainedOwnerResult, Bt as createRouterTranscript, C as deriveNodeExecutionIdentity, Ct as checkVerdictOf, D as recordScopeOwnerMaterialization, E as recordScopeOwnerDriverAttempt, F as seatExecutionProfile, Fn as bridgeRuntimeAttachmentsKey, G as scopeRetainedOwnerContext, Gr as defineProfileMaterializationContract, H as prepareScopeRetainedOwnerSeatSwitch, Hr as assertProfileMaterialization, Ht as WORKER_TRACE_PROPAGATION, I as abandonScopeRetainedOwnerInvocation, In as bridgeStopSignalKey, It as snapshotExecutorConfig, J as scopeRetainedOwnerResourceReader, Jn as linkAbort, Jr as promptControlProfileMaterialization, K as scopeRetainedOwnerJournalRoot, Kn as RunCancellationReason, Kr as fullProfileMaterialization, L as beginScopeRetainedOwnerDrive, M as SeatChain, Mi as registerRetainedExecutorPreparation, N as SeatChainExhaustedError, Ni as retainedExecutorSeamKey, O as recordScopeOwnerPause, P as authoredSeatStages, Pt as createExecutor, Qn as persistHarnessTranscript, R as bindScopeRetainedOwnerEnvironmentId, Sa as spendFromUsageTotals, Sr as toOtelAttributes, St as bestComposite, T as meterRuntimeOwnedProviderAttempt, Tn as routerBrain, U as prepareScopeRetainedOwnerTask, V as noteScopeRetainedOwnerCoordination, W as reconcileScopeRetainedOwnerEnvironment, Wr as controlProfileMaterialization, X as scopeRetainedOwnerResult, Y as scopeRetainedOwnerRestorePoint, Yn as runAbortable, Yr as promptModelProfileMaterialization, Yt as createActivityLog, Z as scopeRetainedOwnerTurnEnded, Zt as createInbox, _ as isDriverSpec, _a as assertValidBudget, _i as runtimeOwnedExecutorExecutionBinding, _t as CONTINUATIONS_DIR, at as runtimeGraphMetadataKey, b as assertRecursiveReservationPolicy, ba as newUsageTotals, bi as runtimeOwnedPendingExecutorMaterialization, bt as admitContinuationPolicy, c as runTree, ca as parseWorkerToolTraceArtifact, cn as bridgeAdmissionRefusal, en as PEER_MAIL_WIRE_KEY, f as runDriverWithRetry, fa as detachedSnapshot, g as driverExecutorFactory, gi as runtimeOwnedDriveHarnessProviderEvidence, gr as createOtelExporter, h as driverChild, hi as recordRuntimeOwnedDriveHarnessProviderEvidence, ht as gateOnDeliverable, i as bestDelivered, ii as worktreeCliProfileMaterialization, it as providerVisibleProfile, jn as resolveAgentEnvironmentProvider, jt as captureReusableExecutorConfig, k as restoreScopeOwnerAcceptedExecution, ln as bridgeModelRouteRefusal, ma as errMessage, mi as providerAttemptEvidence, n as createRootHandle, ni as unsupportedProfileDimensions, nt as coordinationMcpAlias, oi as attestRuntimeOwnedScopeOwner, on as isLiveNodeStatus, p as summarizeDriverAttempts, pa as executorFailure, q as scopeRetainedOwnerPriorSpend, qr as profileMaterializationAxes$1, r as createSupervisor, rn as isPeerMailEnvelope, rt as coordinationProfileToolPrefix, s as runFinalizer, si as authoredAgentIdentity, ti as sandboxProfileMaterialization, u as HarnessTurnFailedError, ua as contentAddress, ui as inheritRuntimeOwnedExecutorAttestation, vi as runtimeOwnedExecutorMaterialization, vr as generateSpanId, w as meterRuntimeOwnedAccounting, wt as createContinuationKeeper, x as beginScopeOwnerAttempt, xi as runtimeOwnedScopeOwnerRuntime, ya as meterUsageEvent, yi as runtimeOwnedExecutorProviderEvidence, yt as CheckUnavailableError, z as bindScopeRetainedOwnerProvider } from "./supervisor-Crul0LFI.js";
3
3
  import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
4
4
  import { $ as isAsyncIterable$1, Ot as teardownExecutor, U as addSpend, Y as errorMessage, at as sleep, dt as zeroSpend, gt as withBudgetResources, ht as resourceTelemetry, kt as teardownSurfaces, lt as unmeteredSpend, pt as addResourceSpend, ut as withTimeout, xt as DEFAULT_SUCCESSFUL_SHUTDOWN_MS } from "./sandbox-profile-compat-Dq7ujONv.js";
5
5
  import { a as readCommittedJsonLines, n as isNoEntError, r as prepareJsonlAppend } from "./jsonl-file-DBv31uPi.js";
6
6
  import { _ as agentHarness, a as concreteProfileModel, c as profileModelExecutionSettings, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-CyCUwHed.js";
7
7
  import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
8
- import { C as createFileRunContext, F as createCoordinationToolsForManager, N as coordinationVerbNames, O as applyRunCancellation, T as withRunContext, c as refreshedWake, g as progressStop, h as plateau, k as watchRunCancellation, l as resolveWakePolicy, n as createSteerAcknowledger, o as composeWakeInput, p as createProgressTracker, r as driverAgent, s as deadlineWarningAt, t as createCancelAcknowledger, w as createInMemoryRunContext } from "./coordination-driver-Bx7nXmOs.js";
8
+ import { C as createFileRunContext, F as createCoordinationToolsForManager, N as coordinationVerbNames, O as applyRunCancellation, T as withRunContext, c as refreshedWake, g as progressStop, h as plateau, k as watchRunCancellation, l as resolveWakePolicy, n as createSteerAcknowledger, o as composeWakeInput, p as createProgressTracker, r as driverAgent, s as deadlineWarningAt, t as createCancelAcknowledger, w as createInMemoryRunContext } from "./coordination-driver-B2XzW5aV.js";
9
9
  import { r as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-Dqer2M4_.js";
10
10
  import { c as loadGraph, i as graphRegistry } from "./graph-registry-DAI6KNXB.js";
11
11
  import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-Cu8H7aeh.js";
@@ -4830,7 +4830,6 @@ function recordRunCancellationOutcome(runDir, result, now) {
4830
4830
  detail: `run settled ${result.kind === "winner" ? "winner" : result.reason} despite the abort request; nothing was terminated`
4831
4831
  });
4832
4832
  }
4833
- /** A quarter of token and optional dollar capacity per worker; nested managers partition again. */
4834
4833
  /** A per-child budget may not exceed the conserved pool it is reserved from. */
4835
4834
  function assertPerWorkerWithinPool(perWorker, pool) {
4836
4835
  const over = (child, total, field) => child > total ? `supervise perWorker.${field} (${child}) exceeds budget.${field} (${total})` : null;
@@ -4849,6 +4848,26 @@ function assertPerWorkerWithinPool(perWorker, pool) {
4849
4848
  ].filter((x) => x !== null);
4850
4849
  if (problems.length > 0) throw new ValidationError(`${problems.join("; ")} — a per-child ceiling cannot exceed the pool it draws from, and accepting it silently leaves the caller believing a knob is in effect when the reservation still clamps the child.`);
4851
4850
  }
4851
+ /** A caller's per-child budget must fit the part of the pool children may reserve: the pool less
4852
+ * the owner's kept share per channel (`reservationPolicy.ownerShare`, the floor scope admission
4853
+ * keeps). Larger, and not even one child is ever admitted. Without a kept share, a token or
4854
+ * iteration ceiling equal to the whole pool lets the first child take every unit, so the owner's
4855
+ * next turn is refused as budget-exhausted while the child still holds the rest. */
4856
+ function assertPerWorkerAdmittable(perWorker, pool, ownerShare) {
4857
+ const unreservable = (child, total, kept, field) => {
4858
+ if (ownerShare > 0) {
4859
+ const reservable = total - kept;
4860
+ return child > reservable ? `supervise perWorker.${field} (${child}) exceeds the reservable budget.${field} (${reservable}: ${total} less the owner's kept ${kept} at reservationPolicy.ownerShare ${ownerShare})` : null;
4861
+ }
4862
+ return child >= total ? `supervise perWorker.${field} (${child}) equals the whole budget.${field} (${total}), so the first child takes every unit and the owner has none left for its next turn` : null;
4863
+ };
4864
+ const unadmittable = [
4865
+ unreservable(perWorker.maxTokens, pool.maxTokens, Math.ceil(pool.maxTokens * ownerShare), "maxTokens"),
4866
+ unreservable(perWorker.maxIterations, pool.maxIterations, Math.ceil(pool.maxIterations * ownerShare), "maxIterations"),
4867
+ perWorker.maxUsd !== void 0 && pool.maxUsd !== void 0 && ownerShare > 0 ? unreservable(perWorker.maxUsd, pool.maxUsd, pool.maxUsd * ownerShare, "maxUsd") : null
4868
+ ].filter((x) => x !== null);
4869
+ if (unadmittable.length > 0) throw new ValidationError(`${unadmittable.join("; ")} — lower perWorker on that channel so a child fits beside the owner's own turns; otherwise children are refused or starve at spawn hours into the run.`);
4870
+ }
4852
4871
  /** The slice a child gets when its manager names none: a quarter of the part of the manager's
4853
4872
  * budget its children may reserve, so four default children fill that part and the manager's
4854
4873
  * own share stays free for its turns. Each nested manager divides its own slice the same way. */
@@ -4973,6 +4992,17 @@ async function storedGraphTopology(dir, digest) {
4973
4992
  });
4974
4993
  }
4975
4994
  /**
4995
+ * The completion check of a managed node inside a `run_graph` subtask: its submission is accepted
4996
+ * and settles it. Under the run's own check, a node's narrower result is refused for as long as
4997
+ * the run's is: on 2026-10-17 every node of test-canary-graph-tools-20261017a was refused at
4998
+ * submit_result and sent back to the run's commission until the run's deadline, so the graph never
4999
+ * settled and its caller was never woken with it.
5000
+ */
5001
+ const graphNodeDeliverable = Object.freeze({
5002
+ describe: "the result your task asks for; the graph hands it to the manager that ran the graph, and the run's own check judges that manager's result",
5003
+ check: () => true
5004
+ });
5005
+ /**
4976
5006
  * What a `run_graph` subtask settles with once its root manager returned and its subtree closed:
4977
5007
  * the root's result and the graph's edge ledger. A delegates cap that refused work while the root
4978
5008
  * delivered nothing ended the graph, not the task, so that fails loud with the cap named, as
@@ -5145,6 +5175,7 @@ function superviseInternal(profile, task, opts, testBrain) {
5145
5175
  const perWorker = options.perWorker ?? defaultPerWorker(options.budget, ownerShare);
5146
5176
  assertValidBudget(perWorker, "supervise perWorker");
5147
5177
  assertPerWorkerWithinPool(perWorker, options.budget);
5178
+ if (options.perWorker !== void 0) assertPerWorkerAdmittable(perWorker, options.budget, ownerShare);
5148
5179
  const journal = options.journal ?? ctx.journal;
5149
5180
  const runId = options.runId ?? ctx.runId ?? "supervise";
5150
5181
  const runNamespace = ctx.namespace ?? supervisionRunNamespace(options.runDir, runId);
@@ -5355,6 +5386,8 @@ function superviseInternal(profile, task, opts, testBrain) {
5355
5386
  if (subtask !== void 0 && graph !== void 0) throw new ValidationError("supervise: a node of a graph cannot start another graph; add the work as nodes");
5356
5387
  const ownGraph = subtask === void 0 ? void 0 : graphOverlayFor(subtask);
5357
5388
  const subtreeGraph = ownGraph ?? graph;
5389
+ const graphNode = subtreeGraph !== void 0 && selectedDeliverable === void 0;
5390
+ const managerDeliverable = graphNode ? graphNodeDeliverable : childDeliverable;
5358
5391
  const nestedDriveHarness = isExternalSupervisor(authorized) ? driveHarnessForOwner(freezeDetached({
5359
5392
  runId,
5360
5393
  runNamespace,
@@ -5437,11 +5470,11 @@ function superviseInternal(profile, task, opts, testBrain) {
5437
5470
  ...options.compaction ? { compaction: options.compaction } : {},
5438
5471
  ...options.driverRetry ? { driverRetry: options.driverRetry } : {},
5439
5472
  ...options.onDriverAttempt ? { onDriverAttempt: options.onDriverAttempt } : {},
5440
- ...childDeliverable && !seatManagedLeaf ? { deliverable: childDeliverable } : {},
5441
- ...childDeliverable && !seatManagedLeaf ? { onAcceptedSubmission: () => {
5473
+ ...managerDeliverable && !seatManagedLeaf ? { deliverable: managerDeliverable } : {},
5474
+ ...managerDeliverable && !seatManagedLeaf ? { onAcceptedSubmission: () => {
5442
5475
  acceptedSubmission = true;
5443
5476
  } } : {},
5444
- ...childDeliverable && !seatManagedLeaf && options.continuation && isExternalSupervisor(authorized) ? {
5477
+ ...managerDeliverable && !graphNode && !seatManagedLeaf && options.continuation && isExternalSupervisor(authorized) ? {
5445
5478
  continuation: options.continuation,
5446
5479
  ...options.runDir === void 0 ? {} : { continuationDir: resolve(options.runDir, CONTINUATIONS_DIR, "managers", encodeURIComponent(ownerId)) }
5447
5480
  } : {},
@@ -5456,7 +5489,7 @@ function superviseInternal(profile, task, opts, testBrain) {
5456
5489
  },
5457
5490
  ...options.steerDir === void 0 ? {} : { steerDir: resolve(options.steerDir) },
5458
5491
  ...options.runDir === void 0 && options.steerDir === void 0 ? {} : { controlScope: "subtree" }
5459
- }), journal, childExecution.ref, () => acceptedSubmission, recoveryFactories.get(childFactory), () => unassessedOutput, seatManagedLeaf ? childDeliverable : void 0, ownGraph ? (out) => graphSubtaskOutput(ownGraph, out) : void 0);
5492
+ }), journal, childExecution.ref, () => acceptedSubmission, recoveryFactories.get(childFactory), () => unassessedOutput, seatManagedLeaf ? managerDeliverable : void 0, ownGraph ? (out) => graphSubtaskOutput(ownGraph, out) : void 0);
5460
5493
  };
5461
5494
  if (options.makeLeafAgent === void 0 && options.backend?.backend === "provider" && !options.backend.steering) {
5462
5495
  const factory = registerRetainedExecutorPreparation(createExecutor(options.backend), ({ spawned, profile, task }) => {
@@ -5717,4 +5750,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
5717
5750
  //#endregion
5718
5751
  export { dumbContinuationPassPrompt as A, defaultEdgeTraversalCap as C, createPromptRegistry as D, analyzesFindingsReportPrompt as E, serveCoordinationMcp as F, kernelPromptRegistry as M, naiveContinuationPrompt as N, delegatesWorkerBriefPrompt as O, promptHandle as P, createGraphOverlay as S, validateGraphTopology as T, readRootStream as _, superviseRootProfile as a, composeReentryTask as b, isPreSpawnExecutorFailure as c, withWorkerSpawnRetry as d, assertCoordinationBinding as f, ROOT_STREAM_FILE as g, supervisorAgentWithTestBrain as h, superviseFleetCapabilities as i, formatPromptHandle as j, dumbContinuationFailPrompt as k, resolveWorkerSpawnRetry as l, supervisorAgent as m, profileGuidanceComposer as n, superviseWithTestBrain as o, resolveSupervisorProfile as p, supervise as r, workerFromBackend as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, retryPreSpawnRefusals as u, readRootStreamReceipt as v, graphRootProfile as w, createSupervisorSpanRecorder as x, UNPROVEN_CONTINUITY as y };
5719
5752
 
5720
- //# sourceMappingURL=supervise-Dt_bZSVY.js.map
5753
+ //# sourceMappingURL=supervise-ttbcgYgS.js.map