@tangle-network/agent-runtime 0.174.1 → 0.177.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 (104) hide show
  1. package/README.md +4 -0
  2. package/dist/{activation-CsdJWRXX.js → activation-XVI_z1g3.js} +3 -3
  3. package/dist/{activation-CsdJWRXX.js.map → activation-XVI_z1g3.js.map} +1 -1
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{authoring-DsLNInAz.js → authoring-bXmPNfCI.js} +2 -2
  7. package/dist/{authoring-DsLNInAz.js.map → authoring-bXmPNfCI.js.map} +1 -1
  8. package/dist/candidate-execution/index.js +4 -4
  9. package/dist/{candidate-execution-BbMbyhgC.js → candidate-execution-fBNUyWyE.js} +10 -4
  10. package/dist/candidate-execution-fBNUyWyE.js.map +1 -0
  11. package/dist/{conversation-7XGKoDM6.js → conversation-BREx2hi-.js} +3 -3
  12. package/dist/{conversation-7XGKoDM6.js.map → conversation-BREx2hi-.js.map} +1 -1
  13. package/dist/conversation.d.ts +1 -1
  14. package/dist/conversation.js +1 -1
  15. package/dist/coordination-driver-xO1tkxy-.js +3063 -0
  16. package/dist/coordination-driver-xO1tkxy-.js.map +1 -0
  17. package/dist/durable-file-g3YdfEh4.js +131 -0
  18. package/dist/durable-file-g3YdfEh4.js.map +1 -0
  19. package/dist/durable.d.ts +2 -2
  20. package/dist/durable.js +1 -1
  21. package/dist/{environment-provider-DWjbGH8W.d.ts → environment-provider-5E82esWE.d.ts} +6 -3
  22. package/dist/{environment-provider-Bn3652YU.js → environment-provider-DKyMWQJd.js} +121 -17
  23. package/dist/environment-provider-DKyMWQJd.js.map +1 -0
  24. package/dist/environment-provider.d.ts +1 -1
  25. package/dist/environment-provider.js +1 -1
  26. package/dist/{graph-BbeHgLXH.js → graph-DwJXa1Ph.js} +3 -3
  27. package/dist/graph-DwJXa1Ph.js.map +1 -0
  28. package/dist/graph.d.ts +11 -3
  29. package/dist/graph.js +35 -4
  30. package/dist/graph.js.map +1 -1
  31. package/dist/{improvement-cycle-DKGDCukL.js → improvement-cycle-eiSv6aH4.js} +5 -5
  32. package/dist/{improvement-cycle-DKGDCukL.js.map → improvement-cycle-eiSv6aH4.js.map} +1 -1
  33. package/dist/{index-CIhkH7mq.d.ts → index-BnAiQVLD.d.ts} +290 -29
  34. package/dist/{index-CFMB9ux3.d.ts → index-Bs0uhf-y.d.ts} +2 -2
  35. package/dist/{index-Dk5X9eKg.d.ts → index-C9XTLVP1.d.ts} +4 -4
  36. package/dist/index.d.ts +7 -7
  37. package/dist/index.js +13 -13
  38. package/dist/intelligence.d.ts +4 -4
  39. package/dist/intelligence.js +6 -6
  40. package/dist/kernel.d.ts +6 -6
  41. package/dist/kernel.js +13 -11
  42. package/dist/{knowledge-BaAX0HVu.js → knowledge-Bmtj_7u7.js} +5 -5
  43. package/dist/{knowledge-BaAX0HVu.js.map → knowledge-Bmtj_7u7.js.map} +1 -1
  44. package/dist/knowledge.d.ts +1 -1
  45. package/dist/knowledge.js +1 -1
  46. package/dist/{loop-runner-bin-DRYApMiu.d.ts → loop-runner-bin-ChS5deJ0.d.ts} +3 -3
  47. package/dist/{loop-runner-bin-D63Tytdk.js → loop-runner-bin-GTN5wqCt.js} +3 -3
  48. package/dist/{loop-runner-bin-D63Tytdk.js.map → loop-runner-bin-GTN5wqCt.js.map} +1 -1
  49. package/dist/loop-runner-bin.d.ts +1 -1
  50. package/dist/loop-runner-bin.js +1 -1
  51. package/dist/{materialization-Ct3I4wu3.js → materialization-CekWK6OO.js} +5 -3
  52. package/dist/materialization-CekWK6OO.js.map +1 -0
  53. package/dist/mcp/bin.js +3 -3
  54. package/dist/mcp/index.d.ts +3 -3
  55. package/dist/mcp/index.js +5 -4
  56. package/dist/mcp/index.js.map +1 -1
  57. package/dist/{openai-tools-BBgjWYNw.js → openai-tools-BBj1QGJp.js} +2 -2
  58. package/dist/{openai-tools-BBgjWYNw.js.map → openai-tools-BBj1QGJp.js.map} +1 -1
  59. package/dist/{prepare-BAyaNoZu.js → prepare-Tip-2ZoZ.js} +2 -2
  60. package/dist/{prepare-BAyaNoZu.js.map → prepare-Tip-2ZoZ.js.map} +1 -1
  61. package/dist/primeintellect/index.d.ts +1 -1
  62. package/dist/{protected-model-port-T2UWrDNQ.js → protected-model-port-Dd3a1SRm.js} +2 -2
  63. package/dist/{protected-model-port-T2UWrDNQ.js.map → protected-model-port-Dd3a1SRm.js.map} +1 -1
  64. package/dist/provision-supervisor-zA__ayUX.js +1020 -0
  65. package/dist/provision-supervisor-zA__ayUX.js.map +1 -0
  66. package/dist/{redact-DvLf4x1m.d.ts → redact-DkRLcSiE.d.ts} +3 -3
  67. package/dist/run-layout-Cd_l2XWV.js +645 -0
  68. package/dist/run-layout-Cd_l2XWV.js.map +1 -0
  69. package/dist/{runtime-D5u1M6T5.d.ts → runtime-B2eZ76kG.d.ts} +3 -3
  70. package/dist/{runtime-CojgP-hr.js → runtime-CJNlF5wM.js} +16 -1095
  71. package/dist/runtime-CJNlF5wM.js.map +1 -0
  72. package/dist/{spawn-journal-Tgvp5VS5.js → spawn-journal--N8Ten1q.js} +3 -1
  73. package/dist/{spawn-journal-Tgvp5VS5.js.map → spawn-journal--N8Ten1q.js.map} +1 -1
  74. package/dist/{stream-agent-turn-DxQ3GOuR.d.ts → stream-agent-turn-ByY8po9W.d.ts} +2 -2
  75. package/dist/{stream-agent-turn-CKIpCbSq.js → stream-agent-turn-CPj9SqVm.js} +2 -2
  76. package/dist/{stream-agent-turn-CKIpCbSq.js.map → stream-agent-turn-CPj9SqVm.js.map} +1 -1
  77. package/dist/{structural-rollout-BUYA61iV.js → structural-rollout-BeAUK7Ta.js} +4 -4
  78. package/dist/{structural-rollout-BUYA61iV.js.map → structural-rollout-BeAUK7Ta.js.map} +1 -1
  79. package/dist/{supervise-Ci0RfWQF.js → supervise-HsRKOlKY.js} +405 -3374
  80. package/dist/supervise-HsRKOlKY.js.map +1 -0
  81. package/dist/{supervisor-Bt1XLCVq.js → supervisor-ChLgoYhG.js} +1620 -33
  82. package/dist/supervisor-ChLgoYhG.js.map +1 -0
  83. package/dist/testing.d.ts +2 -2
  84. package/dist/testing.js +13 -12
  85. package/dist/testing.js.map +1 -1
  86. package/dist/{top-app-3rYfFPTW.js → top-app-DIBApkt1.js} +25 -9
  87. package/dist/top-app-DIBApkt1.js.map +1 -0
  88. package/dist/tui/bin.js +1 -1
  89. package/dist/tui/index.d.ts +9 -1
  90. package/dist/tui/index.js +3 -2
  91. package/dist/{types-DjVO-p7R.d.ts → types-a2ZZUl80.d.ts} +25 -2
  92. package/dist/{workspace-archive-B0Hqp2eJ.js → workspace-archive-DOZAeeKU.js} +2 -2
  93. package/dist/{workspace-archive-B0Hqp2eJ.js.map → workspace-archive-DOZAeeKU.js.map} +1 -1
  94. package/package.json +5 -4
  95. package/dist/candidate-execution-BbMbyhgC.js.map +0 -1
  96. package/dist/environment-provider-Bn3652YU.js.map +0 -1
  97. package/dist/graph-BbeHgLXH.js.map +0 -1
  98. package/dist/materialization-Ct3I4wu3.js.map +0 -1
  99. package/dist/run-layout-C2jgwsCq.js +0 -393
  100. package/dist/run-layout-C2jgwsCq.js.map +0 -1
  101. package/dist/runtime-CojgP-hr.js.map +0 -1
  102. package/dist/supervise-Ci0RfWQF.js.map +0 -1
  103. package/dist/supervisor-Bt1XLCVq.js.map +0 -1
  104. package/dist/top-app-3rYfFPTW.js.map +0 -1
package/dist/graph.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { m as ValidationError } from "./errors-CDZ8XsVj.js";
2
- import { d as replaySpawnTree, i as InMemorySpawnJournal, l as materializeTreeView, o as closesCursorSlot, r as InMemoryResultBlobStore, u as pendingWaits, x as contentAddress } from "./spawn-journal-Tgvp5VS5.js";
2
+ import { d as replaySpawnTree, i as InMemorySpawnJournal, l as materializeTreeView, o as closesCursorSlot, r as InMemoryResultBlobStore, u as pendingWaits, x as contentAddress } from "./spawn-journal--N8Ten1q.js";
3
3
  import { t as addSpend } from "./util-D6ZEuBMi.js";
4
- import { N as createBudgetPool, W as createExecutorRegistry, a as uncertainSpawnBudgets, i as sumMeasuredSpendFromEvents, l as runFinalizer, o as bestDelivered, p as createScope, r as maxSeqOf, s as collectDelivered } from "./supervisor-Bt1XLCVq.js";
5
- import { i as workerFromBackend, s as supervisorAgent } from "./supervise-Ci0RfWQF.js";
4
+ import { J as createBudgetPool, a as uncertainSpawnBudgets, at as createExecutorRegistry, i as sumMeasuredSpendFromEvents, l as runFinalizer, o as bestDelivered, p as createScope, r as maxSeqOf, s as collectDelivered } from "./supervisor-ChLgoYhG.js";
5
+ import { i as workerFromBackend, s as supervisorAgent } from "./supervise-HsRKOlKY.js";
6
6
  import { t as assertAuthoredCode } from "./authored-code-DzYtiflw.js";
7
- import { t as GraphEdgeCapError } from "./graph-BbeHgLXH.js";
7
+ import { t as GraphEdgeCapError } from "./graph-DwJXa1Ph.js";
8
8
  //#region src/runtime/graph/condition.ts
9
9
  /**
10
10
  * The ONE predicate tree: every guard in a graph — an edge `guard`, a filter projection's
@@ -725,6 +725,8 @@ function applyGraphFoldEvent(state, ev, compiled) {
725
725
  return;
726
726
  }
727
727
  case "join-state": {
728
+ const released = instanceOf(state, ev.instance);
729
+ if (released) released.waveConsumed = true;
728
730
  for (const edgeId of ev.satisfiedBy) {
729
731
  const folded = state.edges.get(edgeId);
730
732
  if (!folded) continue;
@@ -1750,6 +1752,34 @@ async function runGraphLoop(engine, compiled, task, options, wakes, onWakeSignal
1750
1752
  });
1751
1753
  await spawnInstance(label);
1752
1754
  };
1755
+ /**
1756
+ * Journal the `join-state` a crashed release never wrote. The consuming set
1757
+ * is re-derived from the SAME decision the crashed process made: its gating
1758
+ * edges are still folded exactly as they were when it released (their
1759
+ * verdicts were journaled first), so `decideJoin` answers identically.
1760
+ */
1761
+ const consumeWaveAfterCrash = async (instance) => {
1762
+ const node = compiled.nodes.get(instance.node);
1763
+ if (!node) return;
1764
+ const gating = node.inbound.map((edge) => ({
1765
+ edge,
1766
+ folded: state.edges.get(edge.id)
1767
+ }));
1768
+ const decision = decideJoin(node.join, gating);
1769
+ if (!decision.release) return;
1770
+ const consumedPending = gating.filter((entry) => entry.folded?.state === "pending").map((entry) => entry.edge.id);
1771
+ await emit({
1772
+ kind: "join-state",
1773
+ id: instance.instance,
1774
+ node: instance.node,
1775
+ rule: node.join,
1776
+ satisfiedBy: decision.consuming.map(({ edge }) => edge.id),
1777
+ consumedPending,
1778
+ instance: instance.instance,
1779
+ seq: engineSeq++,
1780
+ at: stamp()
1781
+ });
1782
+ };
1753
1783
  const tryRelease = async (nodeId) => {
1754
1784
  const node = compiled.nodes.get(nodeId);
1755
1785
  const folded = state.nodes.get(nodeId);
@@ -1963,6 +1993,7 @@ async function runGraphLoop(engine, compiled, task, options, wakes, onWakeSignal
1963
1993
  async function reenterAfterCrash() {
1964
1994
  for (const instance of [...state.instances.values()]) {
1965
1995
  if (instance.status === "released") {
1996
+ if (instance.waveConsumed !== true) await consumeWaveAfterCrash(instance);
1966
1997
  await spawnInstance(instance.instance);
1967
1998
  continue;
1968
1999
  }