@tangle-network/agent-runtime 0.301.0 → 0.306.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.
Files changed (85) hide show
  1. package/dist/{activation-V6aaOlZV.js → activation-C5wesfzd.js} +3 -3
  2. package/dist/{activation-V6aaOlZV.js.map → activation-C5wesfzd.js.map} +1 -1
  3. package/dist/{activation-CRgEJutr.d.ts → activation-wZ-8vOjV.d.ts} +88 -13
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +2 -2
  6. package/dist/{bundle-C9v5TH_H.js → bundle-C8EO05u3.js} +2 -2
  7. package/dist/{bundle-C9v5TH_H.js.map → bundle-C8EO05u3.js.map} +1 -1
  8. package/dist/candidate-execution/index.d.ts +3 -26
  9. package/dist/candidate-execution/index.js +6 -6
  10. package/dist/{coordination-driver-vNrdQBSH.js → coordination-driver-yj9HPXef.js} +9 -16
  11. package/dist/coordination-driver-yj9HPXef.js.map +1 -0
  12. package/dist/{delegate-B-jFJcbW.js → delegate-KtrL9HWq.js} +2 -2
  13. package/dist/{delegate-B-jFJcbW.js.map → delegate-KtrL9HWq.js.map} +1 -1
  14. package/dist/durable.d.ts +3 -15
  15. package/dist/durable.js +158 -124
  16. package/dist/durable.js.map +1 -1
  17. package/dist/{graph-Dwv_hQB_.js → graph-DcdyHbgf.js} +4 -5
  18. package/dist/graph-DcdyHbgf.js.map +1 -0
  19. package/dist/{improvement-cycle-Cf37Kexd.js → improvement-cycle-DsN-TVXR.js} +1129 -10
  20. package/dist/improvement-cycle-DsN-TVXR.js.map +1 -0
  21. package/dist/{index-CxBVmgqL.d.ts → index-DflDZq_I.d.ts} +50 -688
  22. package/dist/index.d.ts +378 -12
  23. package/dist/index.js +223 -320
  24. package/dist/index.js.map +1 -1
  25. package/dist/intelligence.d.ts +5 -5
  26. package/dist/intelligence.js +7 -8
  27. package/dist/intelligence.js.map +1 -1
  28. package/dist/kernel.d.ts +4 -4
  29. package/dist/kernel.js +9 -9
  30. package/dist/{loop-runner-bin-DiTNiJNs.d.ts → loop-runner-bin-DZfRUVWy.d.ts} +3 -3
  31. package/dist/{loop-runner-bin-C8MI8N1A.js → loop-runner-bin-rVrSX5l1.js} +3 -3
  32. package/dist/{loop-runner-bin-C8MI8N1A.js.map → loop-runner-bin-rVrSX5l1.js.map} +1 -1
  33. package/dist/loop-runner-bin.d.ts +1 -1
  34. package/dist/loop-runner-bin.js +1 -1
  35. package/dist/mcp/bin.js +3 -3
  36. package/dist/mcp/index.d.ts +6 -35
  37. package/dist/mcp/index.js +311 -364
  38. package/dist/mcp/index.js.map +1 -1
  39. package/dist/model-policy-DydyWTQg.js.map +1 -1
  40. package/dist/{openai-tools-BeogJ6V8.d.ts → openai-tools-YO30D2s3.d.ts} +2 -2
  41. package/dist/{prepare-CGVNMb1o.js → prepare--nWcazPr.js} +7 -13
  42. package/dist/prepare--nWcazPr.js.map +1 -0
  43. package/dist/{profile-BetOB4_Q.js → profile-h04LDjV6.js} +2 -2
  44. package/dist/{profile-BetOB4_Q.js.map → profile-h04LDjV6.js.map} +1 -1
  45. package/dist/profiles.d.ts +2 -94
  46. package/dist/profiles.js +2 -451
  47. package/dist/profiles.js.map +1 -1
  48. package/dist/{protected-model-port-CAa0t1MT.d.ts → protected-model-port-C9QtEf3y.d.ts} +2 -2
  49. package/dist/{protected-model-port-CuVHkhti.js → protected-model-port-wwalbyXM.js} +4 -4
  50. package/dist/{protected-model-port-CuVHkhti.js.map → protected-model-port-wwalbyXM.js.map} +1 -1
  51. package/dist/{provision-supervisor-CS0fBIhp.js → provision-supervisor-WxFEFQeJ.js} +4 -3
  52. package/dist/{provision-supervisor-CS0fBIhp.js.map → provision-supervisor-WxFEFQeJ.js.map} +1 -1
  53. package/dist/{runtime-6VPSJVeg.js → runtime-B9eBIyws.js} +67 -469
  54. package/dist/runtime-B9eBIyws.js.map +1 -0
  55. package/dist/{search-method-wTTS7mGG.js → search-executor-2tWr38Qw.js} +239 -1132
  56. package/dist/search-executor-2tWr38Qw.js.map +1 -0
  57. package/dist/{server-BfHD5iLD.js → server-CpKcrOPj.js} +5 -12
  58. package/dist/server-CpKcrOPj.js.map +1 -0
  59. package/dist/{stream-agent-turn-B1ipFtOc.d.ts → stream-agent-turn-B1giFgOg.d.ts} +2 -2
  60. package/dist/{substrate-DKBMd0Dl.d.ts → substrate-L_sC7jCD.d.ts} +2 -2
  61. package/dist/{supervise-BJrEC2Mh.js → supervise-DllOHM4M.js} +14 -24
  62. package/dist/supervise-DllOHM4M.js.map +1 -0
  63. package/dist/{supervisor-DA_nvF-h.js → supervisor-gCfG6K1-.js} +488 -1407
  64. package/dist/supervisor-gCfG6K1-.js.map +1 -0
  65. package/dist/testing.d.ts +2 -2
  66. package/dist/testing.js +14 -14
  67. package/dist/tui/index.d.ts +1 -1
  68. package/dist/tui/index.js +1 -1
  69. package/dist/{types-jD9mNnJM.d.ts → types-DeuEkBhI.d.ts} +114 -258
  70. package/dist/{workspace-archive-pz8YJ1fr.d.ts → workspace-streams-CpSmt3zx.d.ts} +67 -3
  71. package/dist/{workspace-streams-D5gHJdTb.js → workspace-streams-ILw0eWZ0.js} +694 -2
  72. package/dist/workspace-streams-ILw0eWZ0.js.map +1 -0
  73. package/package.json +8 -8
  74. package/skills/generate-eval/SKILL.md +1 -1
  75. package/skills/profile-authoring/SKILL.md +2 -2
  76. package/dist/coordination-driver-vNrdQBSH.js.map +0 -1
  77. package/dist/graph-Dwv_hQB_.js.map +0 -1
  78. package/dist/improvement-cycle-Cf37Kexd.js.map +0 -1
  79. package/dist/prepare-CGVNMb1o.js.map +0 -1
  80. package/dist/runtime-6VPSJVeg.js.map +0 -1
  81. package/dist/search-method-wTTS7mGG.js.map +0 -1
  82. package/dist/server-BfHD5iLD.js.map +0 -1
  83. package/dist/supervise-BJrEC2Mh.js.map +0 -1
  84. package/dist/supervisor-DA_nvF-h.js.map +0 -1
  85. package/dist/workspace-streams-D5gHJdTb.js.map +0 -1
@@ -1,5 +1,6 @@
1
- import { $n as parseWorkerToolTraceArtifact, Bn as InMemoryResultBlobStore, Ca as promptCacheTokenClasses, E as failedItems, M as withDriverExecutor, Ma as addResourceSpend, Mi as prepareJsonlAppend, Mr as contentAddress, Ni as readCommittedJsonLines, Nt as createExecutorRegistry, Pa as withBudgetResources, Pi as writeAllBytes, Rn as FileResultBlobStore, Rt as createRouterTranscript, Tn as runBrainLoop, Ui as providerAttemptEvidence, Vn as InMemorySpawnJournal, Yt as createInbox, _ as CheckUnavailableError, an as isTerminalNodeStatus, c as runTree, en as createPeerMailbox, er as workerTraceAnalysisStore, fr as errMessage, i as bestDelivered, in as isLiveNodeStatus, ir as assertValidBudget, ka as unmeteredSpend, mt as resolveSpawnResourcePaths, o as pickBestDelivered, s as runFinalizer, st as scopeRetainedOwnerResourceReader, ta as detachedFrozen, va as chargedTokens, x as checkVerdictOf, z as meterRuntimeOwnedProviderAttempt, zn as FileSpawnJournal, zr as resolveRedactor } from "./supervisor-DA_nvF-h.js";
1
+ import { Di as providerAttemptEvidence, Dn as FileSpawnJournal, Dr as resolveRedactor, Dt as createRouterTranscript, En as FileResultBlobStore, Fn as prepareJsonlAppend, Hn as workerTraceAnalysisStore, In as readCommittedJsonLines, Jt as isTerminalNodeStatus, Kn as assertValidBudget, Ln as writeAllBytes, On as InMemoryResultBlobStore, R as meterRuntimeOwnedProviderAttempt, Rt as createInbox, St as createExecutorRegistry, T as failedItems, Ut as createPeerMailbox, Vn as parseWorkerToolTraceArtifact, _ as CheckUnavailableError, br as contentAddress, c as runTree, er as errMessage, et as scopeRetainedOwnerResourceReader, i as bestDelivered, j as withDriverExecutor, kn as InMemorySpawnJournal, o as pickBestDelivered, pn as runBrainLoop, qt as isLiveNodeStatus, s as runFinalizer, st as resolveSpawnResourcePaths, x as checkVerdictOf, zi as detachedFrozen } from "./supervisor-gCfG6K1-.js";
2
2
  import { f as RuntimeRunStateError, m as ValidationError } from "./errors-DodWX-cb.js";
3
+ import { V as chargedTokens, Z as promptCacheTokenClasses, at as unmeteredSpend, ft as withBudgetResources, lt as addResourceSpend } from "./workspace-streams-ILw0eWZ0.js";
3
4
  import { A as writeWorkerCancellation, M as writeWorkerSteerAcknowledgement, b as workerCancellationsDir, c as readWorkerCancelRequests, d as readWorkerSteerRequests, k as writeRunCancellation, l as readWorkerCancellation, o as readRunCancelRequest, r as claimWorkerSteerDelivery, s as readRunCancellation, u as readWorkerSteerAcknowledgement } from "./run-layout-DSCWdbX2.js";
4
5
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest } from "@tangle-network/agent-interface";
5
6
  import { argHash, errorStreakDetector, observeAll, repeatedActionDetector } from "@tangle-network/agent-eval";
@@ -1878,7 +1879,7 @@ function createCoordinationToolsForManager(opts, lifetime) {
1878
1879
  const received = new Set(ledger.map((worker) => worker.id));
1879
1880
  const nodes = opts.scope.view?.nodes ?? [];
1880
1881
  return {
1881
- running: nodes.filter((node) => isLiveNodeStatus(node.status) && node.status !== "waiting"),
1882
+ running: nodes.filter((node) => isLiveNodeStatus(node.status)),
1882
1883
  unqueued: nodes.filter((node) => !isLiveNodeStatus(node.status) && !received.has(node.id) && !flushedAnalystRuns.has(node.id)),
1883
1884
  queued: bus.queued([
1884
1885
  "settled",
@@ -3720,7 +3721,7 @@ function renderAnytimeTable(report) {
3720
3721
  * A stop rule reads the run's own PROGRESS and decides. Three signals feed it:
3721
3722
  * - the objective curve over settled work (best-so-far, from `anytime.ts` — see below),
3722
3723
  * - the LIVE worker feed (`WorkerProgress`: `idleMs`, `stalled`, `turns`, `tokens`),
3723
- * - tree-level shape (how many are in flight, how many are waiting, when the last settle landed).
3724
+ * - tree-level shape (how many are in flight, when the last settle landed).
3724
3725
  *
3725
3726
  * ── Two boundaries this module holds deliberately ───────────────────────────────────────────────
3726
3727
  *
@@ -3778,7 +3779,6 @@ function createProgressTracker(opts = {}) {
3778
3779
  const workers = [];
3779
3780
  if (scope && treeView) for (const node of treeView.nodes) {
3780
3781
  if (isTerminalNodeStatus(node.status)) continue;
3781
- if (node.status === "waiting") continue;
3782
3782
  const p = scope.progress(node.id, viewOpts?.stallAfterMs !== void 0 ? {
3783
3783
  now: now(),
3784
3784
  stallAfterMs: viewOpts.stallAfterMs
@@ -3796,8 +3796,7 @@ function createProgressTracker(opts = {}) {
3796
3796
  lastImprovementAt,
3797
3797
  settlesSinceImprovement: lastImprovementIdx < 0 ? recorded.length : recorded.length - 1 - lastImprovementIdx,
3798
3798
  workers,
3799
- inFlight: treeView?.inFlight ?? 0,
3800
- waiting: treeView?.waiting ?? 0
3799
+ inFlight: treeView?.inFlight ?? 0
3801
3800
  };
3802
3801
  },
3803
3802
  evaluate(rule, scope, viewOpts) {
@@ -3839,7 +3838,7 @@ function noProgressFor(opts) {
3839
3838
  stop: true,
3840
3839
  reason: `no-progress: ${v.settlesSinceImprovement} settles with no improvement (limit ${opts.settles}), best=${v.best}`
3841
3840
  };
3842
- if (opts.ms !== void 0 && v.waiting === 0 && v.lastSettleAt > 0) {
3841
+ if (opts.ms !== void 0 && v.lastSettleAt > 0) {
3843
3842
  const idle = v.now - v.lastSettleAt;
3844
3843
  if (idle >= opts.ms) return {
3845
3844
  stop: true,
@@ -3881,7 +3880,6 @@ function plateau(opts) {
3881
3880
  function allWorkersStalled(opts = {}) {
3882
3881
  const minWorkers = opts.minWorkers ?? 1;
3883
3882
  return (v) => {
3884
- if (v.waiting > 0) return CONTINUE;
3885
3883
  if (v.workers.length < minWorkers) return CONTINUE;
3886
3884
  if (!v.workers.every((w) => w.stalled)) return CONTINUE;
3887
3885
  const worst = Math.max(...v.workers.map((w) => w.idleMs));
@@ -4047,7 +4045,7 @@ function formatOverspend(violation) {
4047
4045
  * overspend usd up to the turn tripwire). */
4048
4046
  function poolStarved(scope, perWorker, preserveOwnerTurns = false) {
4049
4047
  const b = scope.budget;
4050
- if (scope.view.inFlight > 0 || scope.view.waiting > 0) return false;
4048
+ if (scope.view.inFlight > 0) return false;
4051
4049
  const tokenStarved = preserveOwnerTurns ? b.tokensLeft <= 0 : b.tokensLeft < perWorker.maxTokens;
4052
4050
  const iterationStarved = b.iterationsLeft <= 0;
4053
4051
  const usdStarved = b.usdCapped && (b.usdLeft <= 0 || !preserveOwnerTurns && perWorker.maxUsd !== void 0 && b.usdLeft < perWorker.maxUsd);
@@ -4542,10 +4540,6 @@ function driverAgent(opts) {
4542
4540
  signal: scope.signal,
4543
4541
  ...opts.controlScope === "subtree" ? {} : { deliverRoot: inbox.deliver }
4544
4542
  });
4545
- for (const w of scope.resume?.waits ?? []) {
4546
- const rearmed = scope.wait(w.spec, { label: w.label });
4547
- if (!rearmed.ok) throw new RuntimeRunStateError(`driverAgent: cannot re-arm resumed wait '${w.label}' (${rearmed.reason})`);
4548
- }
4549
4543
  const byName = new Map(modelTools.map((tool) => [tool.name, tool]));
4550
4544
  const toolSpecs = selectedTools.map((selected) => selected.kind === "descriptor" ? {
4551
4545
  type: "function",
@@ -4819,7 +4813,6 @@ function resumeBrief(resume, current, prior) {
4819
4813
  if (recovered.length > 0) lines.push("", "Recovered keys are attached to this scope. Their results arrive when you are woken; coordinate with their original workers:", ...recovered.map(([key, value]) => `- ${key} → ${value.id} (${value.label})`));
4820
4814
  if (inDoubt.length > 0) lines.push("", "Keys IN DOUBT — a prior process recorded them as started but never recorded a terminal receipt. Do NOT spawn a replacement under these keys; inspect or recover each exact prior execution first:", ...inDoubt.map(([k, v]) => `- ${k} (prior attempt ${v.id}, ${v.label})`));
4821
4815
  if (failed.length > 0) lines.push("", "Keys whose prior attempt FAILED (settled down) — spawn_worker with the same key retries:", ...failed.map(([k, v]) => `- ${k} (prior attempt ${v.id}, ${v.label})`));
4822
- if (resume.waits.length > 0) lines.push("", "Pending waits RE-ARMED on their original deadlines (they settle into your next wake):", ...resume.waits.map((w) => `- ${w.label} (${w.spec.kind})`));
4823
4816
  appendPriorCoordination(lines, prior);
4824
4817
  const spent = resume.priorSpend;
4825
4818
  lines.push("", "Budget the run ALREADY spent before this process (it counts toward the run total):", `- child work: tokens charged=${chargedTokens(spent.childWork.tokens)} (in=${spent.childWork.tokens.input} out=${spent.childWork.tokens.output}), usd=${spent.childWork.usd}, iterations=${spent.childWork.iterations}`, `- driver inference: tokens charged=${chargedTokens(spent.driverInference.tokens)} (in=${spent.driverInference.tokens.input} out=${spent.driverInference.tokens.output}), usd=${spent.driverInference.usd}`);
@@ -4890,6 +4883,6 @@ function safeJson(v) {
4890
4883
  }
4891
4884
  }
4892
4885
  //#endregion
4893
- export { watchRunCancellation as A, questionEscalationTargets as B, renderAnytimeTable as C, FileCoordinationLog as D, withRunContext as E, createCoordinationTools as F, defaultToolDetectors as H, createCoordinationToolsForManager as I, downMessageRefusalReasons as L, analystToolGroupNames as M, canonicalFindingEvent as N, foldCoordinationRecords as O, coordinationVerbNames as P, normalizeAnalyzeOnSettle as R, plateauLength as S, createInMemoryRunContext as T, watchTrace as U, createEventBus as V, progressStop as _, DEFAULT_DEADLINE_WARNING_MS as a, areaUnderCurve as b, composeWakeInput as c, allOf as d, allWorkersStalled as f, plateau as g, noProgressFor as h, finalizeBestDelivered as i, ANALYST_DEFINITION_BOUNDS as j, applyRunCancellation as k, deadlineWarningAt as l, createProgressTracker as m, createSteerAcknowledger as n, DEFAULT_WAKE_DEBOUNCE_MS as o, anyOf as p, driverAgent as r, DEFAULT_WAKE_HEARTBEAT_MS as s, createCancelAcknowledger as t, resolveWakePolicy as u, sampleFromSettled as v, createFileRunContext as w, bestSoFar as x, anytimeReport as y, parseAuthoredAnalystDefinition as z };
4886
+ export { analystToolGroupNames as A, defaultToolDetectors as B, createInMemoryRunContext as C, applyRunCancellation as D, foldCoordinationRecords as E, downMessageRefusalReasons as F, normalizeAnalyzeOnSettle as I, parseAuthoredAnalystDefinition as L, coordinationVerbNames as M, createCoordinationTools as N, watchRunCancellation as O, createCoordinationToolsForManager as P, questionEscalationTargets as R, createFileRunContext as S, FileCoordinationLog as T, watchTrace as V, anytimeReport as _, DEFAULT_DEADLINE_WARNING_MS as a, plateauLength as b, resolveWakePolicy as c, anyOf as d, createProgressTracker as f, sampleFromSettled as g, progressStop as h, finalizeBestDelivered as i, canonicalFindingEvent as j, ANALYST_DEFINITION_BOUNDS as k, allOf as l, plateau as m, createSteerAcknowledger as n, composeWakeInput as o, noProgressFor as p, driverAgent as r, deadlineWarningAt as s, createCancelAcknowledger as t, allWorkersStalled as u, areaUnderCurve as v, withRunContext as w, renderAnytimeTable as x, bestSoFar as y, createEventBus as z };
4894
4887
 
4895
- //# sourceMappingURL=coordination-driver-vNrdQBSH.js.map
4888
+ //# sourceMappingURL=coordination-driver-yj9HPXef.js.map