@graphrefly/graphrefly 0.30.0 → 0.32.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 (253) hide show
  1. package/dist/{cascading-dNCtjW8j.d.cts → cascading-BfQmSmjU.d.cts} +21 -2
  2. package/dist/{cascading-BszPheHD.d.ts → cascading-D3sapjue.d.ts} +21 -2
  3. package/dist/chunk-2JNT5NDF.js +61 -0
  4. package/dist/{chunk-DDPYNMGG.js → chunk-2RH4QNDQ.js} +1 -1
  5. package/dist/chunk-4JBKKUCJ.js +7 -0
  6. package/dist/{chunk-SLMYTGTU.js → chunk-4UUDNFYG.js} +1 -1
  7. package/dist/chunk-4VXL3UZK.js +1 -0
  8. package/dist/{chunk-SHYH5SXV.js → chunk-4YGJ7KZ6.js} +1 -1
  9. package/dist/{chunk-GJR3P6JG.js → chunk-5PBXUVHI.js} +1 -1
  10. package/dist/{chunk-W4TSQ6RJ.js → chunk-7AJKUA36.js} +1 -1
  11. package/dist/{chunk-XQAXYVXX.js → chunk-7EMUF2RY.js} +1 -1
  12. package/dist/chunk-7JZ3YORY.js +80 -0
  13. package/dist/chunk-7QMVU3IX.js +1 -0
  14. package/dist/{chunk-WANIEEKV.js → chunk-7QS77X6G.js} +1 -1
  15. package/dist/{chunk-BA5URFYW.js → chunk-A4JT4SAD.js} +1 -1
  16. package/dist/{chunk-Y36UZ5VS.js → chunk-BU4SUZSA.js} +1 -1
  17. package/dist/{chunk-P7JXGKDO.js → chunk-CNXUW2CU.js} +1 -1
  18. package/dist/{chunk-Y32RJO24.js → chunk-CZVYLXFK.js} +1 -1
  19. package/dist/{chunk-567NWZ3T.js → chunk-DWIAG62L.js} +1 -1
  20. package/dist/chunk-EIFHFDFD.js +1 -0
  21. package/dist/chunk-FTA5TB2A.js +1 -0
  22. package/dist/{chunk-T5SHIKJD.js → chunk-JAHAJU4G.js} +1 -1
  23. package/dist/{chunk-AV3PIDFQ.js → chunk-JYMNVEH6.js} +1 -1
  24. package/dist/{chunk-5Z4HDCO6.js → chunk-K54OKWNY.js} +1 -1
  25. package/dist/chunk-KD3IYBTD.js +3 -0
  26. package/dist/{chunk-3NEPQO2E.js → chunk-LG73TUF4.js} +2 -2
  27. package/dist/chunk-LJGPOJHS.js +1 -0
  28. package/dist/chunk-LWGLBCMU.js +1 -0
  29. package/dist/{chunk-BKPLTBL5.js → chunk-M2VFLRPJ.js} +1 -1
  30. package/dist/{chunk-GNCBXARM.js → chunk-MFNOZ5E6.js} +1 -1
  31. package/dist/{chunk-TWMEGG45.js → chunk-N2KKISCE.js} +1 -1
  32. package/dist/chunk-PNTBXOQ6.js +5 -0
  33. package/dist/{chunk-73Z3W2RN.js → chunk-PWKLZ2XU.js} +1 -1
  34. package/dist/{chunk-7TDOES3L.js → chunk-Q2SY7M7K.js} +1 -1
  35. package/dist/{chunk-OL33ZI6R.js → chunk-RWGJQQLT.js} +1 -1
  36. package/dist/chunk-SGS4OJGS.js +1 -0
  37. package/dist/{chunk-4OFIQ66T.js → chunk-TOCCHQI6.js} +1 -1
  38. package/dist/chunk-UMH3HSP7.js +1 -0
  39. package/dist/{chunk-XHVB6G6M.js → chunk-UXEB35L4.js} +1 -1
  40. package/dist/{chunk-33FA6V4B.js → chunk-VXJX3ZZP.js} +1 -1
  41. package/dist/{chunk-BZP5T4X6.js → chunk-W6FQIFVE.js} +1 -1
  42. package/dist/{chunk-RD52SNH2.js → chunk-WE32AFFA.js} +1 -1
  43. package/dist/{chunk-KA6MMXIY.js → chunk-WF3V5X2L.js} +1 -1
  44. package/dist/chunk-WQ7I7JVU.js +1 -0
  45. package/dist/{chunk-4JJCCD5S.js → chunk-X4OOM6QU.js} +1 -1
  46. package/dist/{chunk-AUY2YKCO.js → chunk-XRSHMHEG.js} +1 -1
  47. package/dist/chunk-Y26UN6J5.js +18 -0
  48. package/dist/{chunk-VWPRPPKR.js → chunk-ZWETYYQG.js} +1 -1
  49. package/dist/compat/index.cjs +2 -2
  50. package/dist/compat/index.d.cts +5 -5
  51. package/dist/compat/index.d.ts +5 -5
  52. package/dist/compat/index.js +1 -1
  53. package/dist/compat/jotai/index.cjs +1 -1
  54. package/dist/compat/jotai/index.js +1 -1
  55. package/dist/compat/nanostores/index.cjs +1 -1
  56. package/dist/compat/nanostores/index.js +1 -1
  57. package/dist/compat/nestjs/index.cjs +5 -5
  58. package/dist/compat/nestjs/index.d.cts +3 -3
  59. package/dist/compat/nestjs/index.d.ts +3 -3
  60. package/dist/compat/nestjs/index.js +1 -1
  61. package/dist/compat/zustand/index.cjs +2 -2
  62. package/dist/compat/zustand/index.d.cts +2 -2
  63. package/dist/compat/zustand/index.d.ts +2 -2
  64. package/dist/compat/zustand/index.js +1 -1
  65. package/dist/{composite-DGspwCqk.d.ts → composite-BY9hMxN7.d.ts} +1 -1
  66. package/dist/{composite-nrRumJ7l.d.cts → composite-CH0S8DFn.d.cts} +1 -1
  67. package/dist/content-addressed-storage-BUiREIuj.d.ts +124 -0
  68. package/dist/content-addressed-storage-DqIWCmZG.d.cts +124 -0
  69. package/dist/core/index.cjs +1 -1
  70. package/dist/core/index.js +1 -1
  71. package/dist/extra/browser.cjs +1 -1
  72. package/dist/extra/browser.js +1 -1
  73. package/dist/extra/index.cjs +18 -18
  74. package/dist/extra/index.d.cts +7 -6
  75. package/dist/extra/index.d.ts +7 -6
  76. package/dist/extra/index.js +1 -1
  77. package/dist/extra/node.cjs +2 -2
  78. package/dist/extra/node.js +1 -1
  79. package/dist/extra/operators.cjs +1 -1
  80. package/dist/extra/operators.d.cts +41 -1
  81. package/dist/extra/operators.d.ts +41 -1
  82. package/dist/extra/operators.js +1 -1
  83. package/dist/extra/reactive.cjs +1 -1
  84. package/dist/extra/reactive.d.cts +1 -1
  85. package/dist/extra/reactive.d.ts +1 -1
  86. package/dist/extra/reactive.js +1 -1
  87. package/dist/extra/sources.cjs +1 -1
  88. package/dist/extra/sources.d.cts +62 -2
  89. package/dist/extra/sources.d.ts +62 -2
  90. package/dist/extra/sources.js +1 -1
  91. package/dist/extra/storage-browser.cjs +1 -1
  92. package/dist/extra/storage-browser.js +1 -1
  93. package/dist/{fallback-BaTS7vVY.d.cts → fallback-Cb3GH1O7.d.cts} +6 -14
  94. package/dist/{fallback-eOm3LNxP.d.ts → fallback-DRjJ_ZM8.d.ts} +6 -14
  95. package/dist/graph/index.cjs +4 -4
  96. package/dist/graph/index.d.cts +3 -3
  97. package/dist/graph/index.d.ts +3 -3
  98. package/dist/graph/index.js +1 -1
  99. package/dist/{graph-CWeI0aHd.d.ts → graph-BOhEGJ6E.d.ts} +10 -0
  100. package/dist/{graph-C4Uxwv0T.d.cts → graph-CdJeX7O7.d.cts} +10 -0
  101. package/dist/{index-B-z8WaSd.d.cts → index-BDLy6CQ9.d.cts} +1 -1
  102. package/dist/{index-iBp74eGU.d.cts → index-BJDXj9Wf.d.cts} +2 -2
  103. package/dist/{index-BBINVimG.d.ts → index-BUZPTPSQ.d.ts} +2 -2
  104. package/dist/{index-DnrZghBB.d.ts → index-BbcSZCAG.d.ts} +1 -1
  105. package/dist/{index-lKuLYmHO.d.cts → index-BiGeETJs.d.cts} +1 -1
  106. package/dist/{index-BHu_Wba0.d.cts → index-BmZb8fNF.d.cts} +3 -3
  107. package/dist/{index-Docdiu9a.d.ts → index-Bnmttu35.d.ts} +1 -1
  108. package/dist/{index-D6ajK8Mh.d.cts → index-BuN2wGJs.d.cts} +517 -134
  109. package/dist/{index-Cy7eFeIX.d.cts → index-BwdPDWI4.d.cts} +1 -1
  110. package/dist/{index-DylQCKEL.d.cts → index-BzxU4yhV.d.cts} +11 -2
  111. package/dist/{index-D9Y_u6BG.d.cts → index-C-Gsh-0a.d.cts} +2 -2
  112. package/dist/{index-ybtSyjWB.d.cts → index-C22aTC1X.d.cts} +5 -5
  113. package/dist/{index-yIdWFo2b.d.cts → index-C4QTaDli.d.cts} +2 -2
  114. package/dist/{index-BJHQUCZx.d.ts → index-C7RqYbOZ.d.ts} +82 -7
  115. package/dist/{index-C5Ghnp5B.d.ts → index-C9qCLIN4.d.ts} +2 -2
  116. package/dist/{index-DVNLe3pS.d.cts → index-CCdg0JLX.d.cts} +1 -1
  117. package/dist/{index-B5iVOD7w.d.ts → index-CEoU-r-g.d.ts} +2 -2
  118. package/dist/{index-CfFYyLR8.d.ts → index-CHfBm51k.d.ts} +11 -2
  119. package/dist/{index-Dljd76bC.d.ts → index-CNyiYQWF.d.ts} +5 -5
  120. package/dist/{index-C6NBfXj-.d.ts → index-CVevMZ0n.d.ts} +2 -2
  121. package/dist/{index-DGb1awva.d.ts → index-CZUzi6Dy.d.ts} +2 -2
  122. package/dist/{index-FrYrV-Vf.d.ts → index-Ckl03Q0s.d.ts} +1 -1
  123. package/dist/{index-Bvi5uJxX.d.ts → index-CmSjld-4.d.ts} +1 -1
  124. package/dist/{index-9iguV3bF.d.cts → index-CnjUhRbs.d.cts} +2 -2
  125. package/dist/{index-C98oJsEs.d.cts → index-D3HcdZ4d.d.cts} +1 -1
  126. package/dist/{index-IZ3l_vQ9.d.ts → index-DD1czHj3.d.ts} +1 -1
  127. package/dist/{index-BS220yqj.d.cts → index-DNhTQReY.d.cts} +82 -7
  128. package/dist/{index-UZO988ox.d.cts → index-DSawGt8n.d.cts} +2 -2
  129. package/dist/{index-CcpEvuPl.d.cts → index-DUkuH3jP.d.cts} +1 -1
  130. package/dist/{index-CRAkoq-y.d.cts → index-DY2QbdoP.d.cts} +1 -1
  131. package/dist/{index-CvS9IuTG.d.ts → index-Dbmj0iYR.d.ts} +1 -1
  132. package/dist/{index-ClgKmOHe.d.ts → index-DhlAMlm9.d.ts} +517 -134
  133. package/dist/{index-ClB7TCfL.d.cts → index-DlGaEBW5.d.cts} +2 -2
  134. package/dist/{index-CotRMjtJ.d.ts → index-Dp_pS7Bw.d.ts} +1 -1
  135. package/dist/{index-Cc8VQIgL.d.ts → index-Dxk-pUQI.d.ts} +2 -2
  136. package/dist/{index-DBQUKh59.d.cts → index-EGjF6iSY.d.cts} +3 -3
  137. package/dist/{index-D9HrBx2J.d.ts → index-LGzAYqdR.d.ts} +1 -1
  138. package/dist/{index-DR3gf_DG.d.cts → index-LzCJ0kMT.d.cts} +2 -2
  139. package/dist/{index-RQg6lTrN.d.ts → index-MV2yGIAq.d.ts} +2 -2
  140. package/dist/{index-Bs3-LC83.d.cts → index-_BXz9K7b.d.cts} +1 -1
  141. package/dist/{index-SSGqF8mI.d.cts → index-aBqZUx3B.d.cts} +1 -1
  142. package/dist/{index-CFW32Dy1.d.ts → index-eYHRkoK-.d.ts} +1 -1
  143. package/dist/{index-B2HBxvMb.d.ts → index-gXTVbSax.d.ts} +3 -3
  144. package/dist/{index-B8Aj_z8S.d.cts → index-j33Lfb1G.d.cts} +23 -2
  145. package/dist/{index-BEpRsvhg.d.ts → index-lpGUhTBn.d.ts} +3 -3
  146. package/dist/{index-BXbQUn4n.d.ts → index-zMQIQuDu.d.ts} +23 -2
  147. package/dist/index.cjs +106 -125
  148. package/dist/index.d.cts +34 -33
  149. package/dist/index.d.ts +34 -33
  150. package/dist/index.js +1 -1
  151. package/dist/patterns/ai/browser.cjs +5 -22
  152. package/dist/patterns/ai/browser.d.cts +3 -3
  153. package/dist/patterns/ai/browser.d.ts +3 -3
  154. package/dist/patterns/ai/browser.js +1 -1
  155. package/dist/patterns/ai/index.cjs +30 -44
  156. package/dist/patterns/ai/index.d.cts +13 -11
  157. package/dist/patterns/ai/index.d.ts +13 -11
  158. package/dist/patterns/ai/index.js +1 -1
  159. package/dist/patterns/ai/node.cjs +2 -2
  160. package/dist/patterns/ai/node.d.cts +5 -4
  161. package/dist/patterns/ai/node.d.ts +5 -4
  162. package/dist/patterns/ai/node.js +1 -1
  163. package/dist/patterns/audit/index.cjs +3 -3
  164. package/dist/patterns/audit/index.d.cts +3 -3
  165. package/dist/patterns/audit/index.d.ts +3 -3
  166. package/dist/patterns/audit/index.js +1 -1
  167. package/dist/patterns/cqrs/index.cjs +6 -6
  168. package/dist/patterns/cqrs/index.d.cts +2 -2
  169. package/dist/patterns/cqrs/index.d.ts +2 -2
  170. package/dist/patterns/cqrs/index.js +1 -1
  171. package/dist/patterns/demo-shell/index.cjs +2 -2
  172. package/dist/patterns/demo-shell/index.d.cts +3 -3
  173. package/dist/patterns/demo-shell/index.d.ts +3 -3
  174. package/dist/patterns/demo-shell/index.js +1 -1
  175. package/dist/patterns/domain-templates/index.cjs +6 -6
  176. package/dist/patterns/domain-templates/index.d.cts +2 -2
  177. package/dist/patterns/domain-templates/index.d.ts +2 -2
  178. package/dist/patterns/domain-templates/index.js +1 -1
  179. package/dist/patterns/graphspec/index.cjs +27 -25
  180. package/dist/patterns/graphspec/index.d.cts +3 -3
  181. package/dist/patterns/graphspec/index.d.ts +3 -3
  182. package/dist/patterns/graphspec/index.js +1 -1
  183. package/dist/patterns/guarded-execution/index.cjs +7 -7
  184. package/dist/patterns/guarded-execution/index.d.cts +4 -4
  185. package/dist/patterns/guarded-execution/index.d.ts +4 -4
  186. package/dist/patterns/guarded-execution/index.js +1 -1
  187. package/dist/patterns/harness/index.cjs +12 -11
  188. package/dist/patterns/harness/index.d.cts +6 -6
  189. package/dist/patterns/harness/index.d.ts +6 -6
  190. package/dist/patterns/harness/index.js +1 -1
  191. package/dist/patterns/job-queue/index.cjs +5 -5
  192. package/dist/patterns/job-queue/index.d.cts +2 -2
  193. package/dist/patterns/job-queue/index.d.ts +2 -2
  194. package/dist/patterns/job-queue/index.js +1 -1
  195. package/dist/patterns/lens/index.cjs +5 -5
  196. package/dist/patterns/lens/index.d.cts +4 -4
  197. package/dist/patterns/lens/index.d.ts +4 -4
  198. package/dist/patterns/lens/index.js +1 -1
  199. package/dist/patterns/memory/index.cjs +4 -4
  200. package/dist/patterns/memory/index.d.cts +2 -2
  201. package/dist/patterns/memory/index.d.ts +2 -2
  202. package/dist/patterns/memory/index.js +1 -1
  203. package/dist/patterns/messaging/index.cjs +5 -5
  204. package/dist/patterns/messaging/index.d.cts +2 -2
  205. package/dist/patterns/messaging/index.d.ts +2 -2
  206. package/dist/patterns/messaging/index.js +1 -1
  207. package/dist/patterns/orchestration/index.cjs +7 -7
  208. package/dist/patterns/orchestration/index.d.cts +2 -2
  209. package/dist/patterns/orchestration/index.d.ts +2 -2
  210. package/dist/patterns/orchestration/index.js +1 -1
  211. package/dist/patterns/reactive-layout/index.cjs +2 -2
  212. package/dist/patterns/reactive-layout/index.d.cts +3 -3
  213. package/dist/patterns/reactive-layout/index.d.ts +3 -3
  214. package/dist/patterns/reactive-layout/index.js +1 -1
  215. package/dist/patterns/reduction/index.cjs +5 -5
  216. package/dist/patterns/reduction/index.d.cts +2 -2
  217. package/dist/patterns/reduction/index.d.ts +2 -2
  218. package/dist/patterns/reduction/index.js +1 -1
  219. package/dist/patterns/refine-loop/index.cjs +8 -8
  220. package/dist/patterns/refine-loop/index.d.cts +3 -3
  221. package/dist/patterns/refine-loop/index.d.ts +3 -3
  222. package/dist/patterns/refine-loop/index.js +1 -1
  223. package/dist/patterns/resilient-pipeline/index.cjs +1 -1
  224. package/dist/patterns/resilient-pipeline/index.d.cts +3 -3
  225. package/dist/patterns/resilient-pipeline/index.d.ts +3 -3
  226. package/dist/patterns/resilient-pipeline/index.js +1 -1
  227. package/dist/patterns/surface/index.cjs +15 -13
  228. package/dist/patterns/surface/index.d.cts +4 -4
  229. package/dist/patterns/surface/index.d.ts +4 -4
  230. package/dist/patterns/surface/index.js +1 -1
  231. package/dist/{reactive-layout-BAr6-_o5.d.ts → reactive-layout-Bq0rA2Wb.d.ts} +1 -1
  232. package/dist/{reactive-layout-5oEn8lHM.d.cts → reactive-layout-Dhhe54Oj.d.cts} +1 -1
  233. package/dist/{reactive-map-BvDrRuwt.d.ts → reactive-map-CtRaCddO.d.ts} +59 -1
  234. package/dist/{reactive-map-CmlPPKHN.d.cts → reactive-map-IJIfZxoh.d.cts} +59 -1
  235. package/dist/{resilience-XRUF267O.js → resilience-IVNDYORD.js} +1 -1
  236. package/dist/{topology-tree-CVREibAc.d.cts → topology-tree-CpSjvIXp.d.cts} +1 -1
  237. package/dist/{topology-tree-CkjojcB6.d.ts → topology-tree-DAbCV2Yw.d.ts} +1 -1
  238. package/dist/{types-O3GzJY2U.d.cts → types-BgMqbc7N.d.cts} +41 -14
  239. package/dist/{types-u64Ose53.d.ts → types-CdfO2QTt.d.ts} +41 -14
  240. package/package.json +1 -1
  241. package/dist/chunk-2GQREQ6C.js +0 -1
  242. package/dist/chunk-4C2OR2GH.js +0 -18
  243. package/dist/chunk-5JDE5JHE.js +0 -1
  244. package/dist/chunk-7JDLFI6N.js +0 -1
  245. package/dist/chunk-AMBYCIOH.js +0 -3
  246. package/dist/chunk-GLSM33ZM.js +0 -78
  247. package/dist/chunk-ISCENNXS.js +0 -1
  248. package/dist/chunk-IUK4EFCE.js +0 -1
  249. package/dist/chunk-KASHOCF5.js +0 -1
  250. package/dist/chunk-LI3E75VE.js +0 -64
  251. package/dist/chunk-MGKAO4EK.js +0 -7
  252. package/dist/chunk-NSG4C6BF.js +0 -23
  253. package/dist/chunk-VIEUJSTT.js +0 -1
@@ -1,25 +1,24 @@
1
- import { T as TokenUsage, L as LLMAdapter, P as PricingFn, C as ChatMessage, a as LLMInvokeOptions, d as ToolDefinition, b as LLMResponse, c as ToolCall, e as CapabilitiesRegistry, M as ModelCapabilities, f as ModelFeatures, g as ModelLimits, h as ModelPricing, i as PriceBreakdown, j as PricingRegistry, R as Rate, S as StreamDelta, k as TieredRate, l as composePricing, m as computePrice, n as createCapabilitiesRegistry, o as createPricingRegistry, r as registryPricing, z as zeroPrice } from './types-u64Ose53.js';
2
- import { a as CascadeExhaustionReport, A as AdapterProvider, b as AdapterTier, d as AllTiersExhaustedError, C as CascadingLlmAdapterOptions, e as CreateAdapterOptions, O as OpenAICompatAdapterOptions, f as OpenAICompatPreset, g as OpenAISdkLike, h as cascadingLlmAdapter, c as createAdapter, o as openAICompatAdapter } from './cascading-BszPheHD.js';
1
+ import { T as TokenUsage, L as LLMAdapter, P as PricingFn, C as ChatMessage, a as LLMInvokeOptions, d as ToolDefinition, b as LLMResponse, S as StreamDelta, c as ToolCall, e as CapabilitiesRegistry, M as ModelCapabilities, f as ModelFeatures, g as ModelLimits, h as ModelPricing, i as PriceBreakdown, j as PricingRegistry, R as Rate, k as TieredRate, l as composePricing, m as computePrice, n as createCapabilitiesRegistry, o as createPricingRegistry, p as pricingFor, r as registryPricing, z as zeroPrice } from './types-CdfO2QTt.js';
2
+ import { a as CascadeExhaustionReport, A as AdapterProvider, b as AdapterTier, d as AllTiersExhaustedError, C as CascadingLlmAdapterOptions, e as CreateAdapterOptions, O as OpenAICompatAdapterOptions, f as OpenAICompatPreset, g as OpenAISdkLike, h as cascadingLlmAdapter, c as createAdapter, o as openAICompatAdapter, t as tier } from './cascading-D3sapjue.js';
3
3
  import { a as Node, A as Actor } from './node-BVV7G1bq.js';
4
4
  import { R as ReactiveLogBundle } from './reactive-log-BOJDCI5x.js';
5
5
  import { a as CircuitBreakerOptions, e as CircuitBreaker, f as CircuitOpenError } from './resilience-CludlzcP.js';
6
6
  import { NodeInput } from './extra/sources.js';
7
- import { F as FallbackAdapterOptions, a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy, R as ReplayCacheKeyContext, d as ReplayCacheMissError, e as ReplayCacheMode, W as WithReplayCacheOptions, f as canonicalJson, g as fallbackAdapter, w as withReplayCache } from './fallback-eOm3LNxP.js';
8
- import { G as Graph, a as GraphOptions, h as GraphAttachStorageOptions } from './graph-CWeI0aHd.js';
9
- import { T as TopicGraph } from './index-CvS9IuTG.js';
10
- import { G as GateController, a as GateOptions } from './index-CFW32Dy1.js';
11
- import { D as DistillBundle, E as Extraction } from './composite-DGspwCqk.js';
12
- import { V as VectorSearchResult, L as LightCollectionBundle, a as VectorIndexBundle, K as KnowledgeGraphGraph } from './index-DnrZghBB.js';
7
+ import { W as WithReplayCacheOptions, F as FallbackAdapterOptions, a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy, R as ReplayCacheKeyContext, d as ReplayCacheMissError, e as ReplayCacheMode, f as canonicalJson, g as fallbackAdapter, w as withReplayCache } from './fallback-DRjJ_ZM8.js';
8
+ import { G as Graph, a as GraphOptions, h as GraphAttachStorageOptions } from './graph-BOhEGJ6E.js';
9
+ import { T as TopicGraph } from './index-Dbmj0iYR.js';
10
+ import { G as GateController, a as GateOptions } from './index-eYHRkoK-.js';
11
+ import { D as DistillBundle, E as Extraction } from './composite-BY9hMxN7.js';
12
+ import { V as VectorSearchResult, L as LightCollectionBundle, a as VectorIndexBundle, K as KnowledgeGraphGraph } from './index-BbcSZCAG.js';
13
13
  import { StorageHandle, StorageTier } from './extra/storage-core.js';
14
+ import { c as GraphSpecCatalog } from './index-zMQIQuDu.js';
14
15
 
15
16
  /**
16
17
  * Observable adapter wrapper — the "inverted statistics" surface.
17
18
  *
18
19
  * The library emits structured facts (token counts, latency, timestamps)
19
20
  * as reactive nodes. Users compose interpretation (pricing, dashboards,
20
- * telemetry, budget breakers) as derived layers on top. Rationale lives in
21
- * `archive/docs/SESSION-rigor-infrastructure-plan.md` §"v2: reactive LLM
22
- * statistics + pluggable pricing".
21
+ * telemetry, budget breakers) as derived layers on top.
23
22
  */
24
23
 
25
24
  /** One call's structured statistics — emitted after `invoke()` / `stream()` settles. */
@@ -58,20 +57,28 @@ interface AdapterStats {
58
57
  readonly totalOutputTokens: Node<number>;
59
58
  /** Reset all counters + clear the log. */
60
59
  reset(): void;
60
+ /**
61
+ * Release the internal keepalive subscriptions on the three counter
62
+ * derives (`totalCalls` / `totalInputTokens` / `totalOutputTokens`) so the
63
+ * bundle can be GC'd when the caller discards it. Idempotent. Long-lived
64
+ * adapter bundles (module-level singletons) can ignore; transient bundles
65
+ * (per-request / per-user) should call on teardown.
66
+ */
67
+ dispose(): void;
61
68
  }
62
69
  /**
63
70
  * Wrap any {@link LLMAdapter} with a reactive stats bundle.
64
71
  *
65
- * Implementation:
66
- * - `stats.lastCall` is a `state<CallStatsEvent | undefined>` exposed via a
67
- * null-filtering derived so consumers see a typed `Node<CallStatsEvent>`.
72
+ * Implementation (Unit 10 B):
73
+ * - `stats.lastCall` is a `state<CallStatsEvent | null>`.
68
74
  * - Counters (`totalCalls` / `totalInputTokens` / `totalOutputTokens`) are
69
- * plain state nodes updated via `.emit()`.
75
+ * **derived views** over `allCalls.entries` self-maintaining, no manual
76
+ * `.cache + 1 + emit` pattern, visible topology in `describe()`.
70
77
  * - `stats.allCalls` is a `reactiveLog<CallStatsEvent>` — bounded, supports
71
78
  * `tail(n)` / `slice(start, stop)` for dashboard views.
72
- * - The wrapped adapter passes DATA through via a `derived` tap that writes
73
- * to the stats nodes as a side-effect. No pricing — users compose pricing
74
- * as a derived on top of `stats.lastCall`.
79
+ * - The wrapped adapter passes DATA through via `adaptInvokeResult`, which
80
+ * uses `onFirstData` internally to guard against re-subscription double-fire
81
+ * and wires `.catch` for Promise-path error recording (Unit 10 A).
75
82
  */
76
83
  declare function observableAdapter(inner: LLMAdapter, opts?: {
77
84
  logMax?: number;
@@ -115,6 +122,11 @@ declare function withBreaker(inner: LLMAdapter, opts?: WithBreakerOptions): {
115
122
  * throws `BudgetExhaustedError` without hitting the wrapped adapter. On
116
123
  * success, the call's usage is appended to the log AND debits the running
117
124
  * totals in a single synchronous update.
125
+ *
126
+ * Wave A Unit 11 Q4: rejected-Promise path now wires `.catch` (via
127
+ * `adaptInvokeResult.onError`) so failed invoke calls record a CallStatsEvent
128
+ * with `error` populated. Prior code silently dropped rejection from the
129
+ * `totals` / `log` surface.
118
130
  */
119
131
 
120
132
  declare class BudgetExhaustedError extends Error {
@@ -489,6 +501,14 @@ interface ResilientAdapterOptions {
489
501
  * is set. Threaded directly to the inner {@link cascadingLlmAdapter}.
490
502
  */
491
503
  onExhausted?: (report: CascadeExhaustionReport) => void;
504
+ /**
505
+ * Content-addressed replay cache wrapped OUTERMOST — a cache HIT short-
506
+ * circuits the entire stack (rate-limit / budget / breaker / retry /
507
+ * fallback), saving money and latency. Cache MISSes flow through the
508
+ * normal stack; the successful result is stored on success. See
509
+ * {@link withReplayCache}.
510
+ */
511
+ cache?: WithReplayCacheOptions;
492
512
  }
493
513
  /** Output bundle of {@link resilientAdapter}. */
494
514
  interface ResilientAdapterBundle {
@@ -767,23 +787,6 @@ interface GeminiUsage {
767
787
  }
768
788
  declare function googleAdapter(opts?: GoogleAdapterOptions): LLMAdapter;
769
789
 
770
- /**
771
- * Curated `cascadingLlmAdapter` presets — Node/browser-safe subset.
772
- *
773
- * Thin compositions over `cascadingLlmAdapter` + `createAdapter`. No new
774
- * logic — just convenient defaults. Users needing finer control call
775
- * `cascadingLlmAdapter` directly.
776
- *
777
- * Presets that depend on browser-only adapters (WebLLM, Chrome Nano) have
778
- * been split out to [`./browser-presets.ts`](./browser-presets.ts) and are
779
- * exported from the `@graphrefly/graphrefly/patterns/ai/browser`
780
- * subpath so they don't leak into Node bundles.
781
- *
782
- * @module
783
- */
784
-
785
- declare function dryRunPreset(): LLMAdapter;
786
-
787
790
  /**
788
791
  * `fromLLM` — reactive LLM invocation sugar.
789
792
  *
@@ -821,8 +824,12 @@ type FrozenContextOptions = {
821
824
  * increments via `setState(n + 1)`.
822
825
  *
823
826
  * When omitted, the frozen value is materialized exactly once (on first
824
- * subscribe) and never refreshes use this for session-start snapshots
825
- * that must stay stable for the lifetime of the activation.
827
+ * subscribe) and never refreshes for the lifetime of the activation —
828
+ * use this for session-start snapshots that must stay stable. The
829
+ * single-shot latch IS reset on `INVALIDATE` (graph-wide flush via
830
+ * `graph.signal([[INVALIDATE]])`), so callers who need an "evict and
831
+ * re-materialize" escape hatch get one through the standard graph
832
+ * lifecycle without having to wire a `refreshTrigger`.
826
833
  */
827
834
  refreshTrigger?: NodeInput<unknown>;
828
835
  name?: string;
@@ -859,6 +866,22 @@ declare function frozenContext<T>(source: NodeInput<T>, opts?: FrozenContextOpti
859
866
  /**
860
867
  * `promptNode` — universal LLM transform as a reactive derived node.
861
868
  *
869
+ * The shape: `deps → messagesNode (derived) → switchMap → call (producer) → output`.
870
+ * Each upstream wave is one LLM call; superseding waves cancel the in-flight
871
+ * call via the abort signal threaded through `nodeSignal(opts.abort)`.
872
+ *
873
+ * The producer-shape on the inner is load-bearing: it emits exactly one DATA
874
+ * + COMPLETE per wave, so the outer switchMap sees one DATA per wave (matches
875
+ * the `HarnessExecutor` contract). A `derived([call], parse)` would have its
876
+ * own first-run / push-on-subscribe semantics that can leak a transient null
877
+ * before the real response arrives — observed and reverted in an earlier
878
+ * attempt; see SESSION-ai-harness-module-review.md line 3654 for context.
879
+ *
880
+ * For retry / replay-cache semantics, wrap the adapter with `withRetry` /
881
+ * `withReplayCache` middleware (see `patterns/ai/adapters/middleware/`). The
882
+ * removed `retries` / `cache` options on `promptNode` duplicated middleware
883
+ * that already exists at the adapter layer.
884
+ *
862
885
  * @module
863
886
  */
864
887
 
@@ -869,18 +892,51 @@ type PromptNodeOptions = {
869
892
  maxTokens?: number;
870
893
  /** Output format — `"json"` attempts JSON.parse on the response. Default: `"text"`. */
871
894
  format?: "text" | "json";
872
- /** Number of retries on transient errors. Default: 0. */
873
- retries?: number;
874
- /** Cache LLM responses for identical inputs. Default: false. */
875
- cache?: boolean;
895
+ /**
896
+ * Optional system prompt. Forwarded via `opts.systemPrompt` to the adapter
897
+ * only never pushed as a `{role:"system"}` message (avoiding the
898
+ * double-send class of bug where adapters that normalize both shapes end
899
+ * up with two system entries).
900
+ */
876
901
  systemPrompt?: string;
902
+ /**
903
+ * Optional reactive abort signal. When the node emits `true`, the in-flight
904
+ * `adapter.invoke()` call is cancelled via `AbortController.abort()`.
905
+ * Threaded through `nodeSignal(abort)` — a one-shot bridge. Useful inside
906
+ * agent state machines where a separate `aborted` state should cancel the
907
+ * current LLM call without superseding via switchMap.
908
+ */
909
+ abort?: Node<boolean>;
877
910
  meta?: Record<string, unknown>;
878
911
  };
879
912
  /**
880
913
  * Universal LLM transform: wraps a prompt template + model adapter into a reactive derived node.
881
914
  * Re-invokes the LLM whenever any dep changes. Suitable for triage, QA, hypothesis, parity, etc.
882
915
  *
883
- * @param adapter - LLM adapter (provider-agnostic).
916
+ * **Topology** (visible in `describe()`):
917
+ * ```
918
+ * <deps...> → <name>::messages (derived, meta.ai = prompt_node)
919
+ * <name>::messages → <name>::output (switchMap product, meta.ai = prompt_node::output)
920
+ * per-wave inner: <name>::call (producer, meta.ai = prompt_node::call)
921
+ * ```
922
+ *
923
+ * **No-input semantics** (matches the codebase-wide SENTINEL convention):
924
+ * - **Initial no-input** (no real input has ever arrived) — emits nothing.
925
+ * Outer cache stays `undefined`; `subscribe` consumers see no DATA event.
926
+ * Use this to keep downstream gating clean: a `withLatestFrom`-paired
927
+ * trigger won't fire until the LLM has actually produced something.
928
+ * - **Mid-flow no-input** (input dropped to nullish after at least one
929
+ * real LLM call) — emits `null` as a domain "input went away" signal.
930
+ * Downstream consumers can distinguish "haven't started" from "input
931
+ * gone."
932
+ *
933
+ * **Retries / caching:** stack `withRetry` / `withReplayCache` middleware on the
934
+ * `adapter` argument — `promptNode` no longer ships its own duplicated retry /
935
+ * cache loops (pre-1.0 cleanup, see review session 1).
936
+ *
937
+ * @param adapter - LLM adapter (provider-agnostic). Wrap with `withRetry` /
938
+ * `withReplayCache` middleware for transient-error tolerance
939
+ * or replay caching.
884
940
  * @param deps - Input nodes whose values feed the prompt.
885
941
  * @param prompt - Static string or template function receiving dep values.
886
942
  * @param opts - Optional configuration.
@@ -889,34 +945,56 @@ type PromptNodeOptions = {
889
945
  declare function promptNode<T = string>(adapter: LLMAdapter, deps: readonly Node<unknown>[], prompt: string | ((...depValues: unknown[]) => string), opts?: PromptNodeOptions): Node<T | null>;
890
946
 
891
947
  /**
892
- * `streamingPromptNode` + `gatedStream` — streaming LLM transforms, plus the
893
- * shared `StreamChunk` shape.
948
+ * `streamingPromptNode` + `gatedStream` — streaming LLM transforms.
949
+ *
950
+ * **Wave A Unit 2 rewrite:**
951
+ * - `StreamChunk` retired. The live stream surface is now `deltaTopic:
952
+ * TopicGraph<StreamDelta & {seq, ts}>` — every adapter delta (token,
953
+ * thinking, tool-call, usage, finish) is published in order. The previous
954
+ * shape retained the accumulated text per-chunk, producing O(N²) memory;
955
+ * the new shape stores only per-delta payloads (O(N)).
956
+ * - New `accumulatedText: Node<string>` on the bundle — lazy-built via
957
+ * `ctx.store` over token-type deltas. Text-only extractors (`streamExtractor`,
958
+ * `keywordFlagExtractor`, `toolCallExtractor`) consume this node.
959
+ * - `retainedLimit?: number` option exposed for the delta topic (no default —
960
+ * session scale is domain-specific per Unit 2 Q2).
961
+ * - Unconditional `keepalive(output)` removed — callers subscribe as needed.
962
+ * - System-prompt double-send fixed (matches promptNode Unit 1 fix).
963
+ * - `format: "json"` throws on parse error with a content-preview diagnostic
964
+ * (parity with `promptNode`).
965
+ * - Shared body between `streamingPromptNode` and `gatedStream` extracted
966
+ * into `streamingInvoke` per Unit 2 locked scope.
894
967
  *
895
968
  * @module
896
969
  */
897
970
 
898
971
  /**
899
- * A single chunk from any streaming source (LLM tokens, WebSocket, SSE, file tail).
900
- * Generic enough for any streaming source, not just LLM.
972
+ * A single delta published to the `deltaTopic`. Every adapter emission is
973
+ * forwarded not just token deltas so consumers see the full event log
974
+ * (thinking, tool-call-delta, usage, finish).
901
975
  */
902
- type StreamChunk = {
903
- /** Identifier for the stream source (adapter name, URL, etc.). */
904
- readonly source: string;
905
- /** This chunk's content. */
906
- readonly token: string;
907
- /** Full accumulated text so far. */
908
- readonly accumulated: string;
909
- /** 0-based chunk counter. */
910
- readonly index: number;
976
+ type StampedDelta = StreamDelta & {
977
+ /** Monotonic per-stream counter starting at 0. */
978
+ readonly seq: number;
979
+ /** Wall-clock nanoseconds at publish time (spec §5.11 central timer). */
980
+ readonly ts: number;
911
981
  };
912
982
  type StreamingPromptNodeOptions = {
913
983
  name?: string;
914
984
  model?: string;
915
985
  temperature?: number;
916
986
  maxTokens?: number;
917
- /** Output format — `"json"` attempts JSON.parse on the final accumulated text. Default: `"text"`. */
987
+ /** Output format — `"json"` attempts JSON.parse on accumulated text. Throws on parse failure. Default: `"text"`. */
918
988
  format?: "text" | "json";
919
989
  systemPrompt?: string;
990
+ meta?: Record<string, unknown>;
991
+ /**
992
+ * Optional retention cap on the delta topic. Omit for unbounded retention
993
+ * (the topic grows until `dispose()`). Recommended values: `8_192` for
994
+ * single-shot 8K-token responses, `1_000_000` for persistent session
995
+ * topics, or explicit `dispose()` for worker-pool patterns.
996
+ */
997
+ retainedLimit?: number;
920
998
  };
921
999
  /**
922
1000
  * Bundle returned by {@link streamingPromptNode}.
@@ -924,9 +1002,15 @@ type StreamingPromptNodeOptions = {
924
1002
  type StreamingPromptNodeHandle<T> = {
925
1003
  /** Final parsed result (emits once per invocation, after stream completes). */
926
1004
  output: Node<T | null>;
927
- /** Live stream topic — subscribe to `stream.latest` or `stream.events` for chunks. */
928
- stream: TopicGraph<StreamChunk>;
929
- /** Tear down the keepalive subscription and release resources. */
1005
+ /** Live delta topic — every adapter delta in order, stamped with `seq` + `ts`. */
1006
+ deltaTopic: TopicGraph<StampedDelta>;
1007
+ /**
1008
+ * Reactive accumulated-text view — lazy-built over `deltaTopic.latest`
1009
+ * filtered on `type === "token"`. Text-only extractors compose on this.
1010
+ * Emits the empty string before any token arrives.
1011
+ */
1012
+ accumulatedText: Node<string>;
1013
+ /** Tear down the delta topic and release resources. */
930
1014
  dispose: () => void;
931
1015
  };
932
1016
  /**
@@ -934,12 +1018,12 @@ type StreamingPromptNodeHandle<T> = {
934
1018
  * streaming pipeline. Re-invokes the LLM whenever any dep changes; the
935
1019
  * previous in-flight stream is canceled automatically via `switchMap`.
936
1020
  *
937
- * Each token chunk is published to a {@link TopicGraph} as a {@link StreamChunk}.
938
- * Extractors can mount on the topic independently (see `streamExtractor`).
939
- * Zero overhead if nobody subscribes to the stream topic.
1021
+ * Every adapter delta is published to `deltaTopic` stamped with `seq` + `ts`.
1022
+ * Text consumers subscribe to `accumulatedText` (auto-maintained). Delta-
1023
+ * specific consumers (`costMeterExtractor` on `usage` deltas) subscribe to
1024
+ * `deltaTopic` directly and filter by `delta.type`.
940
1025
  *
941
- * The `output` node emits the final parsed result (like `promptNode`).
942
- * The async boundary is handled by `fromAny` (spec §5.10 compliant).
1026
+ * The async boundary is handled by `fromAny(asyncGenerator)` (spec §5.10).
943
1027
  */
944
1028
  declare function streamingPromptNode<T = string>(adapter: LLMAdapter, deps: readonly Node<unknown>[], prompt: string | ((...depValues: unknown[]) => string), opts?: StreamingPromptNodeOptions): StreamingPromptNodeHandle<T>;
945
1029
  type GatedStreamOptions = StreamingPromptNodeOptions & {
@@ -952,11 +1036,13 @@ type GatedStreamOptions = StreamingPromptNodeOptions & {
952
1036
  type GatedStreamHandle<T> = {
953
1037
  /** Final parsed result (after gate approval). */
954
1038
  output: Node<T | null>;
955
- /** Live stream topic — subscribe to `stream.latest` for chunks. */
956
- stream: TopicGraph<StreamChunk>;
1039
+ /** Live delta topic — every adapter delta in order, stamped with `seq` + `ts`. */
1040
+ deltaTopic: TopicGraph<StampedDelta>;
1041
+ /** Reactive accumulated-text view. */
1042
+ accumulatedText: Node<string>;
957
1043
  /** Gate controller — approve, reject (aborts in-flight stream), modify. */
958
1044
  gate: GateController<T | null>;
959
- /** Tear down everything. */
1045
+ /** Tear down the delta topic + gate keepalive. */
960
1046
  dispose: () => void;
961
1047
  };
962
1048
  /**
@@ -964,14 +1050,13 @@ type GatedStreamHandle<T> = {
964
1050
  *
965
1051
  * Composes {@link streamingPromptNode} with `gate` so that:
966
1052
  * - `gate.reject()` discards the pending value **and** aborts the in-flight
967
- * stream (cancels the `AbortController`).
1053
+ * stream (toggles an internal cancel signal → switchMap restart → abort).
968
1054
  * - `gate.modify()` transforms the pending value before forwarding downstream.
969
1055
  * - `gate.approve()` forwards the final result as normal.
970
1056
  *
971
- * The abort-on-reject works by toggling an internal cancel signal that causes
972
- * the `switchMap` inside `streamingPromptNode` to restart with an empty message
973
- * list, which triggers the `AbortController.abort()` in the async generator's
974
- * `finally` block.
1057
+ * Wave A Unit 2 defers full `gatedStream` review to Wave B Unit 17 (the
1058
+ * `gate()` primitive itself is reviewed there). This implementation retains
1059
+ * the existing gate API while adopting the Unit 2 delta-topic shape.
975
1060
  */
976
1061
  declare function gatedStream<T = string>(graph: Graph, name: string, adapter: LLMAdapter, deps: readonly Node<unknown>[], prompt: string | ((...depValues: unknown[]) => string), opts?: GatedStreamOptions): GatedStreamHandle<T>;
977
1062
 
@@ -994,7 +1079,15 @@ declare function systemPromptBuilder(sections: readonly NodeInput<string>[], opt
994
1079
  }): SystemPromptHandle;
995
1080
 
996
1081
  /**
997
- * Cost meter extractor — counts chunks, characters, and estimates token usage.
1082
+ * Cost meter extractor — derives live cost readings from the delta topic.
1083
+ *
1084
+ * **Wave A Unit 3 rewrite:** signature takes `deltaTopic: TopicGraph<StampedDelta>`
1085
+ * instead of the old `TopicGraph<StreamChunk>`. The meter prefers real
1086
+ * `usage` deltas from the adapter; when no `usage` has been seen yet it
1087
+ * falls back to a char-based estimate over token deltas and stamps
1088
+ * `estimated: true` on the reading. Chunk count is the count of
1089
+ * token-type deltas seen (was `chunk.index + 1`).
1090
+ *
998
1091
  * @module
999
1092
  */
1000
1093
 
@@ -1003,6 +1096,12 @@ type CostMeterReading = {
1003
1096
  readonly chunkCount: number;
1004
1097
  readonly charCount: number;
1005
1098
  readonly estimatedTokens: number;
1099
+ /**
1100
+ * `true` when no adapter `usage` delta has been observed yet —
1101
+ * `estimatedTokens` is a char-based heuristic and should be treated as an
1102
+ * approximation. Flips to `false` once a real `usage` delta arrives.
1103
+ */
1104
+ readonly estimated: boolean;
1006
1105
  };
1007
1106
  type CostMeterOptions = {
1008
1107
  /** Characters per token approximation. Default: 4 (GPT-family). */
@@ -1010,14 +1109,14 @@ type CostMeterOptions = {
1010
1109
  name?: string;
1011
1110
  };
1012
1111
  /**
1013
- * Mounts a cost meter on a streaming topic. Counts chunks, characters, and
1014
- * estimates token count. Compose with `budgetGate` for hard-stop when LLM
1015
- * output exceeds budget mid-generation.
1112
+ * Mounts a cost meter on the delta topic. Prefers real `usage` deltas from
1113
+ * the provider; falls back to char-based estimation on token deltas alone
1114
+ * (with `meta.estimated: true` on the reading).
1016
1115
  *
1017
1116
  * Default structural equals suppresses DATA emission when two consecutive
1018
- * readings are identical (same chunk count + char count + token estimate).
1117
+ * readings are identical.
1019
1118
  */
1020
- declare function costMeterExtractor(streamTopic: TopicGraph<StreamChunk>, opts?: CostMeterOptions): Node<CostMeterReading>;
1119
+ declare function costMeterExtractor(deltaTopic: TopicGraph<StampedDelta>, opts?: CostMeterOptions): Node<CostMeterReading>;
1021
1120
 
1022
1121
  /**
1023
1122
  * Keyword-flag extractor — scans accumulated stream text for configured patterns.
@@ -1045,38 +1144,52 @@ type KeywordFlagExtractorOptions = {
1045
1144
  maxPatternLength?: number;
1046
1145
  };
1047
1146
  /**
1048
- * Mounts a keyword-flag extractor on a streaming topic. Scans accumulated text
1049
- * for all configured patterns and emits an array of matches.
1147
+ * Mounts a keyword-flag extractor on accumulated text. Scans for all
1148
+ * configured patterns and emits an array of matches.
1149
+ *
1150
+ * **Wave A Unit 3 rewrite:** signature takes `accumulatedText: Node<string>`
1151
+ * instead of the old `TopicGraph<StreamChunk>`. Patterns are compiled once
1152
+ * at factory time (was per-chunk). `maxPatternLength` is validated at
1153
+ * factory time — any pattern whose source exceeds the window throws
1154
+ * immediately.
1050
1155
  *
1051
1156
  * Use cases: design invariant violations (`setTimeout`, `EventEmitter`), PII
1052
1157
  * detection (SSN, email, phone), toxicity keywords, off-track reasoning.
1053
1158
  *
1054
- * **Streaming optimization.** Maintains a cursor across chunks in `ctx.store`
1055
- * so each chunk scans only the delta region `accumulated.slice(scannedTo -
1056
- * maxPatternLength)` — not the full string. Default structural equals
1057
- * suppresses DATA emission when no new flags were found this chunk.
1159
+ * **Streaming optimization.** Maintains a cursor across waves in `ctx.store`
1160
+ * so each emission scans only the delta region `accumulated.slice(scannedTo -
1161
+ * maxPatternLength)` — not the full string. Reactivation clears `ctx.store`
1162
+ * and resumes from offset 0 (COMPOSITION-GUIDE §20 RAM semantics).
1163
+ *
1164
+ * Default structural equals suppresses DATA emission when no new flags were
1165
+ * found this wave.
1058
1166
  */
1059
- declare function keywordFlagExtractor(streamTopic: TopicGraph<StreamChunk>, opts: KeywordFlagExtractorOptions): Node<readonly KeywordFlag[]>;
1167
+ declare function keywordFlagExtractor(accumulatedText: Node<string>, opts: KeywordFlagExtractorOptions): Node<readonly KeywordFlag[]>;
1060
1168
 
1061
1169
  /**
1062
- * Generic stream extractor — mounts an extract function on a streaming topic.
1170
+ * Generic stream extractor — mounts an extract function on accumulated text.
1171
+ *
1172
+ * **Wave A Unit 3 rewrite:** signature changed from
1173
+ * `streamExtractor(topic: TopicGraph<StreamChunk>, fn)` to
1174
+ * `streamExtractor(accumulatedText: Node<string>, fn)`. The Unit 2 delta-
1175
+ * topic redesign removed the per-chunk `accumulated` field; callers pass
1176
+ * `streamingPromptNode(...).accumulatedText` (or any other `Node<string>`
1177
+ * source of accumulated text). Source-agnostic — the extractor doesn't care
1178
+ * whether the text came from an LLM, WebSocket, SSE tail, or file reader.
1179
+ *
1063
1180
  * @module
1064
1181
  */
1065
1182
 
1066
1183
  /**
1067
- * Mounts an extractor function on a streaming topic. Returns a derived node
1068
- * that emits extracted values as chunks arrive.
1184
+ * Mounts an extractor function on a reactive accumulated-text source. Returns
1185
+ * a derived node that emits extracted values as the text grows.
1069
1186
  *
1070
- * `extractFn` receives the accumulated text from the latest chunk and returns
1071
- * the extracted value, or `null` if nothing detected yet. This is the building
1072
- * block for keyword flags, tool call detection, cost metering, etc.
1073
- *
1074
- * @param streamTopic - The stream topic to extract from.
1187
+ * @param accumulatedText - Reactive `Node<string>` of accumulated text.
1075
1188
  * @param extractFn - `(accumulated: string) => T | null`.
1076
- * @param opts - Optional name.
1189
+ * @param opts - Optional name + structural equals.
1077
1190
  * @returns Derived node emitting extracted values.
1078
1191
  */
1079
- declare function streamExtractor<T>(streamTopic: TopicGraph<StreamChunk>, extractFn: (accumulated: string) => T | null, opts?: {
1192
+ declare function streamExtractor<T>(accumulatedText: Node<string>, extractFn: (accumulated: string) => T | null, opts?: {
1080
1193
  name?: string;
1081
1194
  /**
1082
1195
  * Optional structural equals for the extractor output. When two
@@ -1114,7 +1227,7 @@ type ExtractedToolCall = {
1114
1227
  * are not re-parsed. Default structural equals suppresses DATA emission when
1115
1228
  * no new tool call completed this chunk.
1116
1229
  */
1117
- declare function toolCallExtractor(streamTopic: TopicGraph<StreamChunk>, opts?: {
1230
+ declare function toolCallExtractor(accumulatedText: Node<string>, opts?: {
1118
1231
  name?: string;
1119
1232
  }): Node<readonly ExtractedToolCall[]>;
1120
1233
 
@@ -1139,23 +1252,31 @@ type ContentGateOptions = {
1139
1252
  * Derived node that classifies accumulated stream text as `"allow"`,
1140
1253
  * `"review"`, or `"block"` based on a classifier score.
1141
1254
  *
1142
- * Emits a three-way decision on every new chunk:
1255
+ * **Wave A Unit 3 rewrite:** signature now takes `accumulatedText: Node<string>`
1256
+ * instead of a `TopicGraph<StreamChunk>` (the `StreamChunk` shape was retired
1257
+ * when the delta topic replaced the per-chunk accumulated-text shape).
1258
+ *
1259
+ * Emits a three-way decision on every text change:
1143
1260
  * - `"allow"` — score below `threshold`
1144
1261
  * - `"review"` — score in `[threshold, threshold × hardMultiplier)`
1145
1262
  * - `"block"` — score at or above `threshold × hardMultiplier`
1146
1263
  *
1147
- * Wire the output into a `valve` (automatic) or `gate` (human approval).
1148
- * This node does not itself control flow — it just classifies.
1149
- *
1150
- * @param streamTopic - Streaming topic to classify.
1151
- * @param classifier - `(accumulated: string) => number` scoring function, or
1152
- * a `Node<number>` for live scores.
1153
- * @param threshold - Score at which output becomes "review" or "block".
1264
+ * @param accumulatedText - Reactive accumulated-text source
1265
+ * (`streamingPromptNode(...).accumulatedText`).
1266
+ * @param classifier - `(accumulated: string) => number` scoring function, or
1267
+ * a `Node<number>` for live scores.
1268
+ * @param threshold - Score at which output becomes `"review"` or `"block"`.
1154
1269
  */
1155
- declare function contentGate(streamTopic: TopicGraph<StreamChunk>, classifier: ((accumulated: string) => number) | Node<number>, threshold: number, opts?: ContentGateOptions): Node<ContentDecision>;
1270
+ declare function contentGate(accumulatedText: Node<string>, classifier: ((accumulated: string) => number) | Node<number>, threshold: number, opts?: ContentGateOptions): Node<ContentDecision>;
1156
1271
 
1157
1272
  /**
1158
1273
  * Redactor — stream extractor that replaces matched patterns in accumulated text.
1274
+ *
1275
+ * **Wave A Unit 3 rewrite:** signature now takes `accumulatedText: Node<string>`
1276
+ * instead of the retired `TopicGraph<StreamChunk>`. The output is a
1277
+ * `Node<string>` carrying the sanitized accumulated text — compose with
1278
+ * `contentGate` or downstream UI directly.
1279
+ *
1159
1280
  * @module
1160
1281
  */
1161
1282
 
@@ -1164,19 +1285,14 @@ type RedactorOptions = {
1164
1285
  name?: string;
1165
1286
  };
1166
1287
  /**
1167
- * Stream extractor that replaces matched patterns in the accumulated text.
1168
- *
1169
- * Returns a derived node emitting a sanitized `StreamChunk` on every chunk:
1170
- * `accumulated` and `token` have matched substrings replaced by `replaceFn`.
1171
- * The default `replaceFn` replaces with `"[REDACTED]"`.
1288
+ * Derived node that replaces matched patterns in accumulated text.
1172
1289
  *
1173
- * Compose with `contentGate` for in-flight safety pipelines.
1174
- *
1175
- * @param streamTopic - Streaming topic to monitor.
1176
- * @param patterns - Array of RegExps to match against accumulated text.
1177
- * @param replaceFn - Replacement producer (default: always `"[REDACTED]"`).
1290
+ * @param accumulatedText - Reactive accumulated-text source.
1291
+ * @param patterns - Array of RegExps to match against the text.
1292
+ * @param replaceFn - Replacement producer (default: always `"[REDACTED]"`).
1293
+ * @returns `Node<string>` emitting the sanitized accumulated text.
1178
1294
  */
1179
- declare function redactor(streamTopic: TopicGraph<StreamChunk>, patterns: RegExp[], replaceFn?: (match: string, pattern: RegExp) => string, opts?: RedactorOptions): Node<StreamChunk>;
1295
+ declare function redactor(accumulatedText: Node<string>, patterns: RegExp[], replaceFn?: (match: string, pattern: RegExp) => string, opts?: RedactorOptions): Node<string>;
1180
1296
 
1181
1297
  type ChatStreamOptions = {
1182
1298
  graph?: GraphOptions;
@@ -1198,13 +1314,47 @@ declare function chatStream(name: string, opts?: ChatStreamOptions): ChatStreamG
1198
1314
  type ToolRegistryOptions = {
1199
1315
  graph?: GraphOptions;
1200
1316
  };
1317
+ /**
1318
+ * `ToolRegistryGraph` — name-keyed registry of {@link ToolDefinition}s.
1319
+ *
1320
+ * **Wave A Unit 6 refactor:** internal storage migrated from `state<Map>`
1321
+ * (O(N) Map-copy per mutation) to `ReactiveMapBundle<string, ToolDefinition>`
1322
+ * (O(1) mutations + version counter). Public API unchanged for existing
1323
+ * consumers. Adds a new reactive `executeReactive(name, args): Node<unknown>`
1324
+ * alongside the imperative `execute(name, args): Promise<unknown>` so
1325
+ * composing factories (`toolExecution`, `agentLoop`) can consume the tool
1326
+ * handler as a reactive source without bridging through `firstDataFromNode`.
1327
+ */
1201
1328
  declare class ToolRegistryGraph extends Graph {
1202
1329
  readonly definitions: Node<ReadonlyMap<string, ToolDefinition>>;
1203
1330
  readonly schemas: Node<readonly ToolDefinition[]>;
1331
+ private readonly _bundle;
1204
1332
  constructor(name: string, opts?: ToolRegistryOptions);
1205
1333
  register(tool: ToolDefinition): void;
1206
1334
  unregister(name: string): void;
1335
+ /**
1336
+ * Imperative boundary: await the handler result as a Promise. Safe for
1337
+ * non-reactive callers; reactive consumers prefer {@link executeReactive}.
1338
+ */
1207
1339
  execute(name: string, args: Record<string, unknown>): Promise<unknown>;
1340
+ /**
1341
+ * Reactive execution — returns a `Node<unknown>` that emits the handler
1342
+ * result. Uses `fromAny` to bridge Promise / Node / AsyncIterable handler
1343
+ * return shapes uniformly. Composes cleanly inside `switchMap` /
1344
+ * `retrySource` / `rescue` chains where the legacy imperative `execute()`
1345
+ * would force a `firstDataFromNode` round-trip.
1346
+ *
1347
+ * The returned node is a one-shot: it emits the first DATA from the
1348
+ * handler result (or ERROR on handler throw) and then relies on the
1349
+ * caller's switchMap / subscription chain for teardown. For repeated
1350
+ * invocations, call `executeReactive` again — each call mints a fresh
1351
+ * node tied to a fresh `handler(args)` invocation.
1352
+ *
1353
+ * @throws `Error` synchronously when `name` is not registered (no node is
1354
+ * constructed — the caller gets a pre-wiring failure rather than a
1355
+ * silent ERROR wave on an empty graph).
1356
+ */
1357
+ executeReactive(name: string, args: Record<string, unknown>): Node<unknown>;
1208
1358
  getDefinition(name: string): ToolDefinition | undefined;
1209
1359
  }
1210
1360
  declare function toolRegistry(name: string, opts?: ToolRegistryOptions): ToolRegistryGraph;
@@ -1296,8 +1446,6 @@ declare class AgentLoopGraph extends Graph {
1296
1446
  readonly toolCalls: Node<readonly ToolCall[]>;
1297
1447
  /** Tool-result batch (one entry per call) after reactive execution. SENTINEL. */
1298
1448
  readonly toolResults: Node<readonly ToolResult[]>;
1299
- /** @deprecated Use `turn` instead. Pre-1.0 rename — this alias will be removed. */
1300
- readonly turnCount: Node<number>;
1301
1449
  private readonly _terminalResult;
1302
1450
  private readonly _disposeRunWiring;
1303
1451
  /**
@@ -1406,6 +1554,15 @@ type HandoffOptions = {
1406
1554
  * @returns Node emitting the specialist's output when the gate is open, or
1407
1555
  * `from`'s value when the gate is closed. Null when `from` is null.
1408
1556
  *
1557
+ * **Performance caveat (Wave A Unit 5):** the specialist is mounted per
1558
+ * source emission — each `v != null` DATA on `from` allocates a fresh
1559
+ * `state<T>(v)` + invokes `toFactory`, and switchMap cancels the prior
1560
+ * branch. For per-turn routing (≤1 emit/sec) this is negligible. For
1561
+ * high-frequency sources (per-token routing, tight event loops), batch
1562
+ * upstream (e.g. via `audit`, `throttle`, or `distinctUntilChanged`) before
1563
+ * handing off — each mount/unmount cycle spins up full subgraphs
1564
+ * (`messagesNode` + adapter bridge + output for a `promptNode` specialist).
1565
+ *
1409
1566
  * @category patterns.ai
1410
1567
  */
1411
1568
  declare function handoff<T>(from: NodeInput<T | null>, toFactory: (input: Node<T>) => Node<T | null>, opts?: HandoffOptions): Node<T | null>;
@@ -1447,6 +1604,29 @@ interface ToolSelectorOptions {
1447
1604
  */
1448
1605
  declare function toolSelector(allTools: NodeInput<readonly ToolDefinition[]>, constraints: readonly NodeInput<(tool: ToolDefinition) => boolean>[], opts?: ToolSelectorOptions): Node<readonly ToolDefinition[]>;
1449
1606
 
1607
+ /** Generic per-dimension thresholds. Any dim below its threshold → reject. */
1608
+ type AdmissionThresholds<Dims extends string> = Partial<Record<Dims, number>>;
1609
+ type AdmissionScoredOptions<Dims extends string, TRaw = unknown> = {
1610
+ /** Score function — must return a finite number for every dimension named in `thresholds`. */
1611
+ scoreFn: (raw: TRaw) => Readonly<Record<Dims, number>>;
1612
+ /** Per-dim minimums. Dims absent here are scored but not gated. */
1613
+ thresholds?: AdmissionThresholds<Dims>;
1614
+ };
1615
+ /**
1616
+ * Generic N-dimension admission filter. Rejects any input where one of the
1617
+ * configured threshold dimensions scores below its minimum. Missing scores
1618
+ * (`undefined` / `null`) AND non-finite values (`NaN`, `±Infinity`) are
1619
+ * treated as below all thresholds — reject by default rather than admit.
1620
+ *
1621
+ * @example
1622
+ * ```ts
1623
+ * const filter = admissionScored({
1624
+ * scoreFn: (raw: Note) => ({ relevance: scoreRelevance(raw), age: ageScore(raw) }),
1625
+ * thresholds: { relevance: 0.4 }, // age scored but ungated
1626
+ * });
1627
+ * ```
1628
+ */
1629
+ declare function admissionScored<Dims extends string, TRaw = unknown>(opts: AdmissionScoredOptions<Dims, TRaw>): (raw: TRaw) => boolean;
1450
1630
  /** Scores for the three admission dimensions. Each 0–1. */
1451
1631
  type AdmissionScores = {
1452
1632
  readonly persistence: number;
@@ -1454,8 +1634,8 @@ type AdmissionScores = {
1454
1634
  readonly personalValue: number;
1455
1635
  };
1456
1636
  type AdmissionScore3DOptions = {
1457
- /** Custom scoring function. Default: rule-based (all dimensions 0.5). */
1458
- scoreFn?: (raw: unknown) => AdmissionScores;
1637
+ /** Custom scoring function. Required the previous always-0.5 default was misleading. */
1638
+ scoreFn: (raw: unknown) => AdmissionScores;
1459
1639
  /** Minimum persistence score to admit (default 0.3). */
1460
1640
  persistenceThreshold?: number;
1461
1641
  /** Minimum personalValue score to admit (default 0.3). */
@@ -1464,11 +1644,19 @@ type AdmissionScore3DOptions = {
1464
1644
  requireStructured?: boolean;
1465
1645
  };
1466
1646
  /**
1467
- * Creates a 3D admission filter function compatible with `agentMemory`'s
1468
- * `admissionFilter` option. Scores each candidate on persistence, structure,
1469
- * and personalValue, then applies thresholds.
1647
+ * 3D admission sugar the persistence / structure / personalValue triple
1648
+ * commonly used in agent-memory literature. Composes `admissionScored`
1649
+ * with thresholds derived from the option fields. Use directly when those
1650
+ * three named dimensions match your domain, or use `admissionScored` with
1651
+ * an arbitrary dimension set instead.
1652
+ *
1653
+ * `requireStructured: true` rejects entries where `structure <= 0` (matches
1654
+ * the pre-Unit-8 `requireStructured && scores.structure <= 0` check).
1655
+ * Implemented as a final-step predicate around `admissionScored` rather
1656
+ * than a `Number.MIN_VALUE` threshold, which would have been a footgun for
1657
+ * future readers.
1470
1658
  */
1471
- declare function admissionFilter3D(opts?: AdmissionScore3DOptions): (raw: unknown) => boolean;
1659
+ declare function admissionFilter3D(opts: AdmissionScore3DOptions): (raw: unknown) => boolean;
1472
1660
 
1473
1661
  type RetrievalQuery = {
1474
1662
  readonly text?: string;
@@ -1687,6 +1875,20 @@ type LLMExtractorOptions = {
1687
1875
  model?: string;
1688
1876
  temperature?: number;
1689
1877
  maxTokens?: number;
1878
+ /**
1879
+ * Cap the dedup-hint slice of `existingKeys` passed to the LLM. Larger
1880
+ * stores ship more keys (better dedup recall) at the cost of prompt size.
1881
+ * Default 100. Set to `Infinity` to forward every key.
1882
+ */
1883
+ maxExistingKeys?: number;
1884
+ /**
1885
+ * Optional name forwarded to the underlying `promptNode` (used as the
1886
+ * `<name>::messages` / `<name>::call` / `<name>::output` path prefix).
1887
+ * Defaults differ per call site (`llmExtractor` / `llmConsolidator`) so
1888
+ * extractor + consolidator wired into the same graph don't collide on
1889
+ * `prompt_node::output`.
1890
+ */
1891
+ name?: string;
1690
1892
  };
1691
1893
  /**
1692
1894
  * Returns an `extractFn` callback for `distill()` that invokes an LLM to
@@ -1694,6 +1896,10 @@ type LLMExtractorOptions = {
1694
1896
  *
1695
1897
  * The system prompt should instruct the LLM to return JSON matching
1696
1898
  * `Extraction<TMem>` shape: `{ upsert: [{ key, value }], remove?: [key] }`.
1899
+ *
1900
+ * Built on `promptNode({format: "json"})` — inherits markdown-fence stripping
1901
+ * and content-preview parse errors. Stack `withRetry` on the adapter for
1902
+ * transient-error tolerance (see `patterns/ai/adapters/middleware/retry.ts`).
1697
1903
  */
1698
1904
  declare function llmExtractor<TRaw, TMem>(systemPrompt: string, opts: LLMExtractorOptions): (raw: TRaw, existing: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
1699
1905
  type LLMConsolidatorOptions = LLMExtractorOptions;
@@ -1703,6 +1909,111 @@ type LLMConsolidatorOptions = LLMExtractorOptions;
1703
1909
  */
1704
1910
  declare function llmConsolidator<TMem>(systemPrompt: string, opts: LLMConsolidatorOptions): (entries: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
1705
1911
 
1912
+ type MemoryWithVectorsOptions<TMem> = {
1913
+ /** Embedding dimension. Must match the `embedFn` output length. */
1914
+ dimension: number;
1915
+ /** Extract an embedding vector for a memory entry. */
1916
+ embedFn: (mem: TMem) => readonly number[] | undefined;
1917
+ };
1918
+ /**
1919
+ * Attach a vector index to a `DistillBundle`. Indexes every entry in the
1920
+ * store as it changes. Returns the `VectorIndexBundle` so retrieval can read
1921
+ * its `entries` and call `search()`.
1922
+ *
1923
+ * The indexer's keepalive is registered with `graph.addDisposer` so it tears
1924
+ * down on `graph.destroy()`. The returned `dispose()` is also available for
1925
+ * early release without destroying the parent graph.
1926
+ */
1927
+ declare function memoryWithVectors<TMem>(graph: Graph, store: DistillBundle<TMem>, opts: MemoryWithVectorsOptions<TMem>): {
1928
+ vectors: VectorIndexBundle<TMem>;
1929
+ dispose: () => void;
1930
+ };
1931
+ type MemoryWithKGOptions<TMem> = {
1932
+ /** Extract entities + relations for a memory entry. */
1933
+ entityFn: (key: string, mem: TMem) => {
1934
+ entities?: Array<{
1935
+ id: string;
1936
+ value: unknown;
1937
+ }>;
1938
+ relations?: Array<{
1939
+ from: string;
1940
+ to: string;
1941
+ relation: string;
1942
+ weight?: number;
1943
+ }>;
1944
+ } | undefined;
1945
+ };
1946
+ /**
1947
+ * Attach a knowledge graph alongside a `DistillBundle`. Mount path defaults
1948
+ * to the `name` arg so multiple `memoryWithKG` calls on the same graph don't
1949
+ * collide on a hardcoded `"kg"` mount.
1950
+ *
1951
+ * Indexer keepalive is registered with `graph.addDisposer`; explicit
1952
+ * `dispose()` is also available.
1953
+ */
1954
+ declare function memoryWithKG<TMem>(graph: Graph, store: DistillBundle<TMem>, name: string, opts: MemoryWithKGOptions<TMem>): {
1955
+ kg: KnowledgeGraphGraph<unknown, string>;
1956
+ dispose: () => void;
1957
+ };
1958
+ type MemoryWithTiersOptions<TMem> = MemoryTiersOptions<TMem> & {
1959
+ /** Score function — same signature as `agentMemory.score`. */
1960
+ score: (mem: TMem, context: unknown) => number;
1961
+ /** Optional reactive context node (passed to `score`). */
1962
+ context?: NodeInput<unknown>;
1963
+ };
1964
+ /**
1965
+ * Attach 3-tier storage (active / archived / permanent) to a `DistillBundle`.
1966
+ * Wires a `tierClassifier` effect that:
1967
+ * - Promotes entries matching `permanentFilter` into the permanent tier.
1968
+ * - Archives entries whose decayed score falls below `archiveThreshold`.
1969
+ * - Caps the active tier at `maxActive`, evicting lowest-scored on overflow.
1970
+ *
1971
+ * **Closure state caveat (Unit 7 Q3 deferred):** `permanentKeys` +
1972
+ * `entryCreatedAtNs` are still closure-held for now; promotion to reactive
1973
+ * nodes is tracked in `docs/optimizations.md`.
1974
+ */
1975
+ declare function memoryWithTiers<TMem>(graph: Graph, store: DistillBundle<TMem>, opts: MemoryWithTiersOptions<TMem>): {
1976
+ tiers: MemoryTiersBundle<TMem>;
1977
+ dispose: () => void;
1978
+ };
1979
+ type MemoryRetrievalOptions<TMem> = {
1980
+ /** Score function (same shape as `agentMemory.score`). */
1981
+ score: (mem: TMem, context: unknown) => number;
1982
+ /** Cost function for budget packing. */
1983
+ cost: (mem: TMem) => number;
1984
+ /** Token / cost budget. Default 2000. */
1985
+ budget?: number;
1986
+ /** Top-K vector candidates. Default 20. */
1987
+ topK?: number;
1988
+ /** KG expansion depth in hops. Default 1. */
1989
+ graphDepth?: number;
1990
+ /** Hierarchical-context boost weight. Default 0. */
1991
+ contextWeight?: number;
1992
+ /** Hierarchical-context accessor for entries. */
1993
+ contextOf?: (mem: TMem) => readonly string[] | undefined;
1994
+ /** Optional reactive context node (passed to `score`). */
1995
+ context?: NodeInput<unknown>;
1996
+ };
1997
+ type MemoryRetrievalBundle<TMem> = {
1998
+ /** State node mirroring the latest packed retrieval result. */
1999
+ readonly retrieval: Node<ReadonlyArray<RetrievalEntry<TMem>>>;
2000
+ /** State node mirroring the latest retrieval trace. */
2001
+ readonly retrievalTrace: Node<RetrievalTrace<TMem> | null>;
2002
+ /** Imperative consumer API — synchronous; reads cache at call time. */
2003
+ readonly retrieve: (query: RetrievalQuery) => ReadonlyArray<RetrievalEntry<TMem>>;
2004
+ /** Reactive sibling — chain into the graph. Mirrors observability state. */
2005
+ readonly retrieveReactive: (queryInput: NodeInput<RetrievalQuery | null>) => Node<ReadonlyArray<RetrievalEntry<TMem>>>;
2006
+ };
2007
+ /**
2008
+ * Build the retrieval pipeline (vector + KG + budget packing) over a
2009
+ * `DistillBundle` and optional `vectors` / `kg` bundles.
2010
+ *
2011
+ * Both consumer surfaces (`retrieve`, `retrieveReactive`) write to the same
2012
+ * `retrieval` + `retrievalTrace` state nodes — observers subscribed to those
2013
+ * see ALL queries regardless of which API issued them.
2014
+ */
2015
+ declare function memoryRetrieval<TMem>(graph: Graph, store: DistillBundle<TMem>, vectors: VectorIndexBundle<TMem> | null, kg: KnowledgeGraphGraph<unknown, string> | null, opts: MemoryRetrievalOptions<TMem>): MemoryRetrievalBundle<TMem>;
2016
+
1706
2017
  type GaugesAsContextOptions = {
1707
2018
  /** Group gauges by `meta.tags` (default true). */
1708
2019
  groupByTags?: boolean;
@@ -1739,24 +2050,58 @@ type GraphFromSpecOptions = {
1739
2050
  model?: string;
1740
2051
  temperature?: number;
1741
2052
  maxTokens?: number;
1742
- /** Callback to construct topology before values are applied (passed to `Graph.fromSnapshot`). */
1743
- build?: (g: Graph) => void;
2053
+ /** Fn/source catalog for resolving named node factories from the LLM-generated spec. */
2054
+ catalog?: GraphSpecCatalog;
1744
2055
  /** Extra instructions appended to the system prompt. */
1745
2056
  systemPromptExtra?: string;
2057
+ /**
2058
+ * Optional AbortSignal forwarded to `adapter.invoke({ signal })`. Lets
2059
+ * callers cancel the in-flight LLM call (e.g. when the reactive variant
2060
+ * supersedes mid-flight). When the signal aborts, the underlying call
2061
+ * propagates the abort and `graphFromSpec` rejects with the abort reason.
2062
+ */
2063
+ signal?: AbortSignal;
1746
2064
  };
1747
2065
  /**
1748
2066
  * Ask an LLM to compose a Graph from a natural-language description.
1749
2067
  *
1750
- * The LLM returns a JSON graph definition which is validated and then
1751
- * constructed via `Graph.fromSnapshot()`.
2068
+ * The LLM returns a JSON {@link GraphSpec} which is validated, catalog-expanded,
2069
+ * and instantiated via {@link compileSpec} (gains catalog validation, template
2070
+ * expansion, and feedback wiring that `Graph.fromSnapshot` bypasses).
1752
2071
  *
1753
2072
  * @param naturalLanguage - The problem/use-case description.
1754
2073
  * @param adapter - LLM adapter for the generation call.
1755
- * @param opts - Model options and optional `build` callback for node factories.
2074
+ * @param opts - Model options and optional catalog for named node factories.
1756
2075
  * @returns A constructed Graph.
1757
- * @throws On invalid LLM output or validation failure.
2076
+ * @throws On invalid LLM output, validation failure, or unresolvable deps.
1758
2077
  */
1759
2078
  declare function graphFromSpec(naturalLanguage: string, adapter: LLMAdapter, opts?: GraphFromSpecOptions): Promise<Graph>;
2079
+ /**
2080
+ * Reactive variant of {@link graphFromSpec}: re-invokes the LLM and
2081
+ * recompiles the graph whenever `input` emits a new natural-language
2082
+ * description. Useful inside the harness or refine loop when the spec text
2083
+ * itself is a reactive value (e.g. fed by a `state(...)` knob, a memory
2084
+ * snapshot, or an upstream `promptNode` output).
2085
+ *
2086
+ * **Supersede:** when the input changes mid-flight, switchMap tears the
2087
+ * inner producer down. The producer's cleanup aborts the in-flight LLM
2088
+ * call via an internal `AbortController` (threaded into `graphFromSpec`'s
2089
+ * new `signal` option) AND destroys any Graph that lands after cancel —
2090
+ * no token leak, no unreferenced compiled graphs. If the user's input
2091
+ * already changed by the time the LLM responds, the about-to-be-discarded
2092
+ * Graph is freed instead of orphaned.
2093
+ *
2094
+ * **Lifetime of the latest emitted Graph:** the caller owns each Graph
2095
+ * that actually reaches them. If you keep multiple historical values, call
2096
+ * `prev?.destroy()` before storing the new one.
2097
+ *
2098
+ * @param input - Reactive source of natural-language descriptions.
2099
+ * @param adapter - LLM adapter for the generation call.
2100
+ * @param opts - Model options and optional catalog for named node factories.
2101
+ * @returns `Node<Graph | null>` — emits the latest compiled graph, or `null`
2102
+ * while the input is empty / unsettled.
2103
+ */
2104
+ declare function graphFromSpecReactive(input: NodeInput<string>, adapter: LLMAdapter, opts?: GraphFromSpecOptions): Node<Graph | null>;
1760
2105
 
1761
2106
  /** OpenAI function-calling tool schema. */
1762
2107
  type OpenAIToolSchema = {
@@ -1836,6 +2181,13 @@ type SuggestStrategyOptions = {
1836
2181
  temperature?: number;
1837
2182
  maxTokens?: number;
1838
2183
  actor?: Actor;
2184
+ /**
2185
+ * Optional AbortSignal forwarded to `adapter.invoke({ signal })`. Lets
2186
+ * callers cancel the in-flight LLM call (e.g. when the reactive variant
2187
+ * supersedes mid-flight). When the signal aborts, the underlying call
2188
+ * propagates the abort and `suggestStrategy` rejects with the abort reason.
2189
+ */
2190
+ signal?: AbortSignal;
1839
2191
  };
1840
2192
  /**
1841
2193
  * Ask an LLM to analyze a graph and suggest topology/parameter changes
@@ -1852,6 +2204,22 @@ type SuggestStrategyOptions = {
1852
2204
  * @throws On invalid LLM output.
1853
2205
  */
1854
2206
  declare function suggestStrategy(graph: Graph, problem: string, adapter: LLMAdapter, opts?: SuggestStrategyOptions): Promise<StrategyPlan>;
2207
+ /**
2208
+ * Reactive variant of {@link suggestStrategy}: re-invokes the LLM whenever
2209
+ * the `problem` source emits, sampling the latest `graph` value (via
2210
+ * `withLatestFrom`) to describe. The graph is the *secondary* dep — only
2211
+ * problem changes re-trigger analysis. This breaks the feedback cycle that
2212
+ * would otherwise arise if downstream consumers wired `apply(plan)` back
2213
+ * into the same graph node (graph mutation must not auto-fire a re-analysis).
2214
+ *
2215
+ * @param graph - Reactive source of graphs to analyze.
2216
+ * @param problem - Reactive source of natural-language problem statements.
2217
+ * @param adapter - LLM adapter for the analysis call.
2218
+ * @param opts - Model and actor options.
2219
+ * @returns `Node<StrategyPlan | null>` — emits the latest plan, or `null`
2220
+ * while inputs are unsettled.
2221
+ */
2222
+ declare function suggestStrategyReactive(graph: Node<Graph | null>, problem: NodeInput<string>, adapter: LLMAdapter, opts?: SuggestStrategyOptions): Node<StrategyPlan | null>;
1855
2223
 
1856
2224
  /** Validation result from {@link validateGraphDef}. */
1857
2225
  type GraphDefValidation = {
@@ -1891,7 +2259,9 @@ declare const index_AdapterProvider: typeof AdapterProvider;
1891
2259
  type index_AdapterStats = AdapterStats;
1892
2260
  declare const index_AdapterTier: typeof AdapterTier;
1893
2261
  type index_AdmissionScore3DOptions = AdmissionScore3DOptions;
2262
+ type index_AdmissionScoredOptions<Dims extends string, TRaw = unknown> = AdmissionScoredOptions<Dims, TRaw>;
1894
2263
  type index_AdmissionScores = AdmissionScores;
2264
+ type index_AdmissionThresholds<Dims extends string> = AdmissionThresholds<Dims>;
1895
2265
  type index_AgentLoopGraph = AgentLoopGraph;
1896
2266
  declare const index_AgentLoopGraph: typeof AgentLoopGraph;
1897
2267
  type index_AgentLoopOptions = AgentLoopOptions;
@@ -1949,9 +2319,14 @@ declare const index_LLMResponse: typeof LLMResponse;
1949
2319
  type index_LLMTimeoutError = LLMTimeoutError;
1950
2320
  declare const index_LLMTimeoutError: typeof LLMTimeoutError;
1951
2321
  type index_McpToolSchema = McpToolSchema;
2322
+ type index_MemoryRetrievalBundle<TMem> = MemoryRetrievalBundle<TMem>;
2323
+ type index_MemoryRetrievalOptions<TMem> = MemoryRetrievalOptions<TMem>;
1952
2324
  type index_MemoryTier = MemoryTier;
1953
2325
  type index_MemoryTiersBundle<TMem> = MemoryTiersBundle<TMem>;
1954
2326
  type index_MemoryTiersOptions<TMem> = MemoryTiersOptions<TMem>;
2327
+ type index_MemoryWithKGOptions<TMem> = MemoryWithKGOptions<TMem>;
2328
+ type index_MemoryWithTiersOptions<TMem> = MemoryWithTiersOptions<TMem>;
2329
+ type index_MemoryWithVectorsOptions<TMem> = MemoryWithVectorsOptions<TMem>;
1955
2330
  declare const index_ModelCapabilities: typeof ModelCapabilities;
1956
2331
  declare const index_ModelFeatures: typeof ModelFeatures;
1957
2332
  declare const index_ModelLimits: typeof ModelLimits;
@@ -1975,9 +2350,9 @@ type index_RetrievalEntry<TMem> = RetrievalEntry<TMem>;
1975
2350
  type index_RetrievalPipelineOptions<TMem> = RetrievalPipelineOptions<TMem>;
1976
2351
  type index_RetrievalQuery = RetrievalQuery;
1977
2352
  type index_RetrievalTrace<TMem> = RetrievalTrace<TMem>;
2353
+ type index_StampedDelta = StampedDelta;
1978
2354
  type index_StrategyOperation = StrategyOperation;
1979
2355
  type index_StrategyPlan = StrategyPlan;
1980
- type index_StreamChunk = StreamChunk;
1981
2356
  declare const index_StreamDelta: typeof StreamDelta;
1982
2357
  type index_StreamingPromptNodeHandle<T> = StreamingPromptNodeHandle<T>;
1983
2358
  type index_StreamingPromptNodeOptions = StreamingPromptNodeOptions;
@@ -2000,6 +2375,7 @@ type index_WithRateLimiterOptions = WithRateLimiterOptions;
2000
2375
  declare const index_WithReplayCacheOptions: typeof WithReplayCacheOptions;
2001
2376
  type index_WithRetryOptions = WithRetryOptions;
2002
2377
  declare const index_admissionFilter3D: typeof admissionFilter3D;
2378
+ declare const index_admissionScored: typeof admissionScored;
2003
2379
  declare const index_agentLoop: typeof agentLoop;
2004
2380
  declare const index_agentMemory: typeof agentMemory;
2005
2381
  declare const index_anthropicAdapter: typeof anthropicAdapter;
@@ -2014,7 +2390,6 @@ declare const index_createAdapter: typeof createAdapter;
2014
2390
  declare const index_createCapabilitiesRegistry: typeof createCapabilitiesRegistry;
2015
2391
  declare const index_createPricingRegistry: typeof createPricingRegistry;
2016
2392
  declare const index_dryRunAdapter: typeof dryRunAdapter;
2017
- declare const index_dryRunPreset: typeof dryRunPreset;
2018
2393
  declare const index_fallbackAdapter: typeof fallbackAdapter;
2019
2394
  declare const index_fromLLM: typeof fromLLM;
2020
2395
  declare const index_frozenContext: typeof frozenContext;
@@ -2022,14 +2397,20 @@ declare const index_gatedStream: typeof gatedStream;
2022
2397
  declare const index_gaugesAsContext: typeof gaugesAsContext;
2023
2398
  declare const index_googleAdapter: typeof googleAdapter;
2024
2399
  declare const index_graphFromSpec: typeof graphFromSpec;
2400
+ declare const index_graphFromSpecReactive: typeof graphFromSpecReactive;
2025
2401
  declare const index_handoff: typeof handoff;
2026
2402
  declare const index_keywordFlagExtractor: typeof keywordFlagExtractor;
2027
2403
  declare const index_knobsAsTools: typeof knobsAsTools;
2028
2404
  declare const index_llmConsolidator: typeof llmConsolidator;
2029
2405
  declare const index_llmExtractor: typeof llmExtractor;
2406
+ declare const index_memoryRetrieval: typeof memoryRetrieval;
2407
+ declare const index_memoryWithKG: typeof memoryWithKG;
2408
+ declare const index_memoryWithTiers: typeof memoryWithTiers;
2409
+ declare const index_memoryWithVectors: typeof memoryWithVectors;
2030
2410
  declare const index_observableAdapter: typeof observableAdapter;
2031
2411
  declare const index_openAICompatAdapter: typeof openAICompatAdapter;
2032
2412
  declare const index_parseRateLimitFromError: typeof parseRateLimitFromError;
2413
+ declare const index_pricingFor: typeof pricingFor;
2033
2414
  declare const index_promptNode: typeof promptNode;
2034
2415
  declare const index_redactor: typeof redactor;
2035
2416
  declare const index_registryPricing: typeof registryPricing;
@@ -2037,7 +2418,9 @@ declare const index_resilientAdapter: typeof resilientAdapter;
2037
2418
  declare const index_streamExtractor: typeof streamExtractor;
2038
2419
  declare const index_streamingPromptNode: typeof streamingPromptNode;
2039
2420
  declare const index_suggestStrategy: typeof suggestStrategy;
2421
+ declare const index_suggestStrategyReactive: typeof suggestStrategyReactive;
2040
2422
  declare const index_systemPromptBuilder: typeof systemPromptBuilder;
2423
+ declare const index_tier: typeof tier;
2041
2424
  declare const index_toolCallExtractor: typeof toolCallExtractor;
2042
2425
  declare const index_toolRegistry: typeof toolRegistry;
2043
2426
  declare const index_toolSelector: typeof toolSelector;
@@ -2051,7 +2434,7 @@ declare const index_withRetry: typeof withRetry;
2051
2434
  declare const index_withTimeout: typeof withTimeout;
2052
2435
  declare const index_zeroPrice: typeof zeroPrice;
2053
2436
  declare namespace index {
2054
- export { index_AdapterProvider as AdapterProvider, type index_AdapterStats as AdapterStats, index_AdapterTier as AdapterTier, type index_AdmissionScore3DOptions as AdmissionScore3DOptions, type index_AdmissionScores as AdmissionScores, index_AgentLoopGraph as AgentLoopGraph, type index_AgentLoopOptions as AgentLoopOptions, type index_AgentLoopStatus as AgentLoopStatus, type index_AgentMemoryGraph as AgentMemoryGraph, type index_AgentMemoryOptions as AgentMemoryOptions, index_AllTiersExhaustedError as AllTiersExhaustedError, type index_AnthropicAdapterOptions as AnthropicAdapterOptions, type index_AnthropicSdkLike as AnthropicSdkLike, type index_BudgetCaps as BudgetCaps, index_BudgetExhaustedError as BudgetExhaustedError, type index_BudgetGateBundle as BudgetGateBundle, type index_BudgetTotals as BudgetTotals, type index_CallStatsEvent as CallStatsEvent, index_CapabilitiesRegistry as CapabilitiesRegistry, index_CascadeExhaustionReport as CascadeExhaustionReport, index_CascadingLlmAdapterOptions as CascadingLlmAdapterOptions, index_ChatMessage as ChatMessage, index_ChatStreamGraph as ChatStreamGraph, type index_ChatStreamOptions as ChatStreamOptions, index_CircuitOpenError as CircuitOpenError, type index_ContentDecision as ContentDecision, type index_ContentGateOptions as ContentGateOptions, type index_CostMeterOptions as CostMeterOptions, type index_CostMeterReading as CostMeterReading, index_CreateAdapterOptions as CreateAdapterOptions, index_DEFAULT_DECAY_RATE as DEFAULT_DECAY_RATE, type index_DryRunAdapterOptions as DryRunAdapterOptions, type index_ExtractedToolCall as ExtractedToolCall, index_FallbackAdapterOptions as FallbackAdapterOptions, index_FallbackFixture as FallbackFixture, index_FallbackMissError as FallbackMissError, index_FallbackMissPolicy as FallbackMissPolicy, type index_FromLLMOptions as FromLLMOptions, type index_FrozenContextOptions as FrozenContextOptions, type index_GatedStreamHandle as GatedStreamHandle, type index_GatedStreamOptions as GatedStreamOptions, type index_GaugesAsContextOptions as GaugesAsContextOptions, type index_GoogleAdapterOptions as GoogleAdapterOptions, type index_GoogleSdkLike as GoogleSdkLike, type index_GraphDefValidation as GraphDefValidation, type index_GraphFromSpecOptions as GraphFromSpecOptions, type index_HandoffOptions as HandoffOptions, type index_HttpErrorLike as HttpErrorLike, type index_KeywordFlag as KeywordFlag, type index_KeywordFlagExtractorOptions as KeywordFlagExtractorOptions, type index_KnobsAsToolsResult as KnobsAsToolsResult, index_LLMAdapter as LLMAdapter, type index_LLMConsolidatorOptions as LLMConsolidatorOptions, type index_LLMExtractorOptions as LLMExtractorOptions, index_LLMInvokeOptions as LLMInvokeOptions, index_LLMResponse as LLMResponse, index_LLMTimeoutError as LLMTimeoutError, type index_McpToolSchema as McpToolSchema, type index_MemoryTier as MemoryTier, type index_MemoryTiersBundle as MemoryTiersBundle, type index_MemoryTiersOptions as MemoryTiersOptions, index_ModelCapabilities as ModelCapabilities, index_ModelFeatures as ModelFeatures, index_ModelLimits as ModelLimits, index_ModelPricing as ModelPricing, index_OpenAICompatAdapterOptions as OpenAICompatAdapterOptions, index_OpenAICompatPreset as OpenAICompatPreset, index_OpenAISdkLike as OpenAISdkLike, type index_OpenAIToolSchema as OpenAIToolSchema, index_PriceBreakdown as PriceBreakdown, index_PricingFn as PricingFn, index_PricingRegistry as PricingRegistry, type index_PromptNodeOptions as PromptNodeOptions, index_Rate as Rate, type index_RedactorOptions as RedactorOptions, index_ReplayCacheKeyContext as ReplayCacheKeyContext, index_ReplayCacheMissError as ReplayCacheMissError, index_ReplayCacheMode as ReplayCacheMode, type index_ResilientAdapterBundle as ResilientAdapterBundle, type index_ResilientAdapterOptions as ResilientAdapterOptions, type index_RetrievalEntry as RetrievalEntry, type index_RetrievalPipelineOptions as RetrievalPipelineOptions, type index_RetrievalQuery as RetrievalQuery, type index_RetrievalTrace as RetrievalTrace, type index_StrategyOperation as StrategyOperation, type index_StrategyPlan as StrategyPlan, type index_StreamChunk as StreamChunk, index_StreamDelta as StreamDelta, type index_StreamingPromptNodeHandle as StreamingPromptNodeHandle, type index_StreamingPromptNodeOptions as StreamingPromptNodeOptions, type index_SuggestStrategyOptions as SuggestStrategyOptions, type index_SystemPromptHandle as SystemPromptHandle, index_TieredRate as TieredRate, index_TokenUsage as TokenUsage, index_ToolCall as ToolCall, index_ToolDefinition as ToolDefinition, index_ToolRegistryGraph as ToolRegistryGraph, type index_ToolRegistryOptions as ToolRegistryOptions, type index_ToolResult as ToolResult, type index_ToolSelectorOptions as ToolSelectorOptions, type index_WithBreakerOptions as WithBreakerOptions, type index_WithBudgetGateOptions as WithBudgetGateOptions, type index_WithDryRunBundle as WithDryRunBundle, type index_WithDryRunOptions as WithDryRunOptions, type index_WithRateLimiterOptions as WithRateLimiterOptions, index_WithReplayCacheOptions as WithReplayCacheOptions, type index_WithRetryOptions as WithRetryOptions, index_admissionFilter3D as admissionFilter3D, index_agentLoop as agentLoop, index_agentMemory as agentMemory, index_anthropicAdapter as anthropicAdapter, index_canonicalJson as canonicalJson, index_cascadingLlmAdapter as cascadingLlmAdapter, index_chatStream as chatStream, index_composePricing as composePricing, index_computePrice as computePrice, index_contentGate as contentGate, index_costMeterExtractor as costMeterExtractor, index_createAdapter as createAdapter, index_createCapabilitiesRegistry as createCapabilitiesRegistry, index_createPricingRegistry as createPricingRegistry, index_dryRunAdapter as dryRunAdapter, index_dryRunPreset as dryRunPreset, index_fallbackAdapter as fallbackAdapter, index_fromLLM as fromLLM, index_frozenContext as frozenContext, index_gatedStream as gatedStream, index_gaugesAsContext as gaugesAsContext, index_googleAdapter as googleAdapter, index_graphFromSpec as graphFromSpec, index_handoff as handoff, index_keywordFlagExtractor as keywordFlagExtractor, index_knobsAsTools as knobsAsTools, index_llmConsolidator as llmConsolidator, index_llmExtractor as llmExtractor, index_observableAdapter as observableAdapter, index_openAICompatAdapter as openAICompatAdapter, index_parseRateLimitFromError as parseRateLimitFromError, index_promptNode as promptNode, index_redactor as redactor, index_registryPricing as registryPricing, index_resilientAdapter as resilientAdapter, index_streamExtractor as streamExtractor, index_streamingPromptNode as streamingPromptNode, index_suggestStrategy as suggestStrategy, index_systemPromptBuilder as systemPromptBuilder, index_toolCallExtractor as toolCallExtractor, index_toolRegistry as toolRegistry, index_toolSelector as toolSelector, index_validateGraphDef as validateGraphDef, index_withBreaker as withBreaker, index_withBudgetGate as withBudgetGate, index_withDryRun as withDryRun, index_withRateLimiter as withRateLimiter, index_withReplayCache as withReplayCache, index_withRetry as withRetry, index_withTimeout as withTimeout, index_zeroPrice as zeroPrice };
2437
+ export { index_AdapterProvider as AdapterProvider, type index_AdapterStats as AdapterStats, index_AdapterTier as AdapterTier, type index_AdmissionScore3DOptions as AdmissionScore3DOptions, type index_AdmissionScoredOptions as AdmissionScoredOptions, type index_AdmissionScores as AdmissionScores, type index_AdmissionThresholds as AdmissionThresholds, index_AgentLoopGraph as AgentLoopGraph, type index_AgentLoopOptions as AgentLoopOptions, type index_AgentLoopStatus as AgentLoopStatus, type index_AgentMemoryGraph as AgentMemoryGraph, type index_AgentMemoryOptions as AgentMemoryOptions, index_AllTiersExhaustedError as AllTiersExhaustedError, type index_AnthropicAdapterOptions as AnthropicAdapterOptions, type index_AnthropicSdkLike as AnthropicSdkLike, type index_BudgetCaps as BudgetCaps, index_BudgetExhaustedError as BudgetExhaustedError, type index_BudgetGateBundle as BudgetGateBundle, type index_BudgetTotals as BudgetTotals, type index_CallStatsEvent as CallStatsEvent, index_CapabilitiesRegistry as CapabilitiesRegistry, index_CascadeExhaustionReport as CascadeExhaustionReport, index_CascadingLlmAdapterOptions as CascadingLlmAdapterOptions, index_ChatMessage as ChatMessage, index_ChatStreamGraph as ChatStreamGraph, type index_ChatStreamOptions as ChatStreamOptions, index_CircuitOpenError as CircuitOpenError, type index_ContentDecision as ContentDecision, type index_ContentGateOptions as ContentGateOptions, type index_CostMeterOptions as CostMeterOptions, type index_CostMeterReading as CostMeterReading, index_CreateAdapterOptions as CreateAdapterOptions, index_DEFAULT_DECAY_RATE as DEFAULT_DECAY_RATE, type index_DryRunAdapterOptions as DryRunAdapterOptions, type index_ExtractedToolCall as ExtractedToolCall, index_FallbackAdapterOptions as FallbackAdapterOptions, index_FallbackFixture as FallbackFixture, index_FallbackMissError as FallbackMissError, index_FallbackMissPolicy as FallbackMissPolicy, type index_FromLLMOptions as FromLLMOptions, type index_FrozenContextOptions as FrozenContextOptions, type index_GatedStreamHandle as GatedStreamHandle, type index_GatedStreamOptions as GatedStreamOptions, type index_GaugesAsContextOptions as GaugesAsContextOptions, type index_GoogleAdapterOptions as GoogleAdapterOptions, type index_GoogleSdkLike as GoogleSdkLike, type index_GraphDefValidation as GraphDefValidation, type index_GraphFromSpecOptions as GraphFromSpecOptions, type index_HandoffOptions as HandoffOptions, type index_HttpErrorLike as HttpErrorLike, type index_KeywordFlag as KeywordFlag, type index_KeywordFlagExtractorOptions as KeywordFlagExtractorOptions, type index_KnobsAsToolsResult as KnobsAsToolsResult, index_LLMAdapter as LLMAdapter, type index_LLMConsolidatorOptions as LLMConsolidatorOptions, type index_LLMExtractorOptions as LLMExtractorOptions, index_LLMInvokeOptions as LLMInvokeOptions, index_LLMResponse as LLMResponse, index_LLMTimeoutError as LLMTimeoutError, type index_McpToolSchema as McpToolSchema, type index_MemoryRetrievalBundle as MemoryRetrievalBundle, type index_MemoryRetrievalOptions as MemoryRetrievalOptions, type index_MemoryTier as MemoryTier, type index_MemoryTiersBundle as MemoryTiersBundle, type index_MemoryTiersOptions as MemoryTiersOptions, type index_MemoryWithKGOptions as MemoryWithKGOptions, type index_MemoryWithTiersOptions as MemoryWithTiersOptions, type index_MemoryWithVectorsOptions as MemoryWithVectorsOptions, index_ModelCapabilities as ModelCapabilities, index_ModelFeatures as ModelFeatures, index_ModelLimits as ModelLimits, index_ModelPricing as ModelPricing, index_OpenAICompatAdapterOptions as OpenAICompatAdapterOptions, index_OpenAICompatPreset as OpenAICompatPreset, index_OpenAISdkLike as OpenAISdkLike, type index_OpenAIToolSchema as OpenAIToolSchema, index_PriceBreakdown as PriceBreakdown, index_PricingFn as PricingFn, index_PricingRegistry as PricingRegistry, type index_PromptNodeOptions as PromptNodeOptions, index_Rate as Rate, type index_RedactorOptions as RedactorOptions, index_ReplayCacheKeyContext as ReplayCacheKeyContext, index_ReplayCacheMissError as ReplayCacheMissError, index_ReplayCacheMode as ReplayCacheMode, type index_ResilientAdapterBundle as ResilientAdapterBundle, type index_ResilientAdapterOptions as ResilientAdapterOptions, type index_RetrievalEntry as RetrievalEntry, type index_RetrievalPipelineOptions as RetrievalPipelineOptions, type index_RetrievalQuery as RetrievalQuery, type index_RetrievalTrace as RetrievalTrace, type index_StampedDelta as StampedDelta, type index_StrategyOperation as StrategyOperation, type index_StrategyPlan as StrategyPlan, index_StreamDelta as StreamDelta, type index_StreamingPromptNodeHandle as StreamingPromptNodeHandle, type index_StreamingPromptNodeOptions as StreamingPromptNodeOptions, type index_SuggestStrategyOptions as SuggestStrategyOptions, type index_SystemPromptHandle as SystemPromptHandle, index_TieredRate as TieredRate, index_TokenUsage as TokenUsage, index_ToolCall as ToolCall, index_ToolDefinition as ToolDefinition, index_ToolRegistryGraph as ToolRegistryGraph, type index_ToolRegistryOptions as ToolRegistryOptions, type index_ToolResult as ToolResult, type index_ToolSelectorOptions as ToolSelectorOptions, type index_WithBreakerOptions as WithBreakerOptions, type index_WithBudgetGateOptions as WithBudgetGateOptions, type index_WithDryRunBundle as WithDryRunBundle, type index_WithDryRunOptions as WithDryRunOptions, type index_WithRateLimiterOptions as WithRateLimiterOptions, index_WithReplayCacheOptions as WithReplayCacheOptions, type index_WithRetryOptions as WithRetryOptions, index_admissionFilter3D as admissionFilter3D, index_admissionScored as admissionScored, index_agentLoop as agentLoop, index_agentMemory as agentMemory, index_anthropicAdapter as anthropicAdapter, index_canonicalJson as canonicalJson, index_cascadingLlmAdapter as cascadingLlmAdapter, index_chatStream as chatStream, index_composePricing as composePricing, index_computePrice as computePrice, index_contentGate as contentGate, index_costMeterExtractor as costMeterExtractor, index_createAdapter as createAdapter, index_createCapabilitiesRegistry as createCapabilitiesRegistry, index_createPricingRegistry as createPricingRegistry, index_dryRunAdapter as dryRunAdapter, index_fallbackAdapter as fallbackAdapter, index_fromLLM as fromLLM, index_frozenContext as frozenContext, index_gatedStream as gatedStream, index_gaugesAsContext as gaugesAsContext, index_googleAdapter as googleAdapter, index_graphFromSpec as graphFromSpec, index_graphFromSpecReactive as graphFromSpecReactive, index_handoff as handoff, index_keywordFlagExtractor as keywordFlagExtractor, index_knobsAsTools as knobsAsTools, index_llmConsolidator as llmConsolidator, index_llmExtractor as llmExtractor, index_memoryRetrieval as memoryRetrieval, index_memoryWithKG as memoryWithKG, index_memoryWithTiers as memoryWithTiers, index_memoryWithVectors as memoryWithVectors, index_observableAdapter as observableAdapter, index_openAICompatAdapter as openAICompatAdapter, index_parseRateLimitFromError as parseRateLimitFromError, index_pricingFor as pricingFor, index_promptNode as promptNode, index_redactor as redactor, index_registryPricing as registryPricing, index_resilientAdapter as resilientAdapter, index_streamExtractor as streamExtractor, index_streamingPromptNode as streamingPromptNode, index_suggestStrategy as suggestStrategy, index_suggestStrategyReactive as suggestStrategyReactive, index_systemPromptBuilder as systemPromptBuilder, index_tier as tier, index_toolCallExtractor as toolCallExtractor, index_toolRegistry as toolRegistry, index_toolSelector as toolSelector, index_validateGraphDef as validateGraphDef, index_withBreaker as withBreaker, index_withBudgetGate as withBudgetGate, index_withDryRun as withDryRun, index_withRateLimiter as withRateLimiter, index_withReplayCache as withReplayCache, index_withRetry as withRetry, index_withTimeout as withTimeout, index_zeroPrice as zeroPrice };
2055
2438
  }
2056
2439
 
2057
- export { type RetrievalQuery as $, type AdapterStats as A, type BudgetCaps as B, type CallStatsEvent as C, DEFAULT_DECAY_RATE as D, type ExtractedToolCall as E, type FromLLMOptions as F, type GatedStreamHandle as G, type GraphFromSpecOptions as H, type HandoffOptions as I, type HttpErrorLike as J, type KeywordFlag as K, type KeywordFlagExtractorOptions as L, type KnobsAsToolsResult as M, type LLMConsolidatorOptions as N, type LLMExtractorOptions as O, LLMTimeoutError as P, type McpToolSchema as Q, type MemoryTier as R, type MemoryTiersBundle as S, type MemoryTiersOptions as T, type OpenAIToolSchema as U, type PromptNodeOptions as V, type RedactorOptions as W, type ResilientAdapterBundle as X, type ResilientAdapterOptions as Y, type RetrievalEntry as Z, type RetrievalPipelineOptions as _, type AdmissionScore3DOptions as a, type RetrievalTrace as a0, type StrategyOperation as a1, type StrategyPlan as a2, type StreamChunk as a3, type StreamingPromptNodeHandle as a4, type StreamingPromptNodeOptions as a5, type SuggestStrategyOptions as a6, type SystemPromptHandle as a7, ToolRegistryGraph as a8, type ToolRegistryOptions as a9, llmConsolidator as aA, llmExtractor as aB, observableAdapter as aC, parseRateLimitFromError as aD, promptNode as aE, redactor as aF, resilientAdapter as aG, streamExtractor as aH, streamingPromptNode as aI, suggestStrategy as aJ, systemPromptBuilder as aK, toolCallExtractor as aL, toolRegistry as aM, toolSelector as aN, validateGraphDef as aO, withBreaker as aP, withBudgetGate as aQ, withDryRun as aR, withRateLimiter as aS, withRetry as aT, withTimeout as aU, type ToolResult as aa, type ToolSelectorOptions as ab, type WithBreakerOptions as ac, type WithBudgetGateOptions as ad, type WithDryRunBundle as ae, type WithDryRunOptions as af, type WithRateLimiterOptions as ag, type WithRetryOptions as ah, admissionFilter3D as ai, agentLoop as aj, agentMemory as ak, anthropicAdapter as al, chatStream as am, contentGate as an, costMeterExtractor as ao, dryRunAdapter as ap, dryRunPreset as aq, fromLLM as ar, frozenContext as as, gatedStream as at, gaugesAsContext as au, googleAdapter as av, graphFromSpec as aw, handoff as ax, keywordFlagExtractor as ay, knobsAsTools as az, type AdmissionScores as b, AgentLoopGraph as c, type AgentLoopOptions as d, type AgentLoopStatus as e, type AgentMemoryGraph as f, type AgentMemoryOptions as g, type AnthropicAdapterOptions as h, index as i, type AnthropicSdkLike as j, BudgetExhaustedError as k, type BudgetGateBundle as l, type BudgetTotals as m, ChatStreamGraph as n, type ChatStreamOptions as o, type ContentDecision as p, type ContentGateOptions as q, type CostMeterOptions as r, type CostMeterReading as s, type DryRunAdapterOptions as t, type FrozenContextOptions as u, type GatedStreamOptions as v, type GaugesAsContextOptions as w, type GoogleAdapterOptions as x, type GoogleSdkLike as y, type GraphDefValidation as z };
2440
+ export { type OpenAIToolSchema as $, type AdapterStats as A, type BudgetCaps as B, type CallStatsEvent as C, DEFAULT_DECAY_RATE as D, type ExtractedToolCall as E, type FromLLMOptions as F, type GatedStreamHandle as G, type GoogleSdkLike as H, type GraphDefValidation as I, type GraphFromSpecOptions as J, type HandoffOptions as K, type HttpErrorLike as L, type KeywordFlag as M, type KeywordFlagExtractorOptions as N, type KnobsAsToolsResult as O, type LLMConsolidatorOptions as P, type LLMExtractorOptions as Q, LLMTimeoutError as R, type McpToolSchema as S, type MemoryRetrievalBundle as T, type MemoryRetrievalOptions as U, type MemoryTier as V, type MemoryTiersBundle as W, type MemoryTiersOptions as X, type MemoryWithKGOptions as Y, type MemoryWithTiersOptions as Z, type MemoryWithVectorsOptions as _, type AdmissionScore3DOptions as a, validateGraphDef as a$, type PromptNodeOptions as a0, type RedactorOptions as a1, type ResilientAdapterBundle as a2, type ResilientAdapterOptions as a3, type RetrievalEntry as a4, type RetrievalPipelineOptions as a5, type RetrievalQuery as a6, type RetrievalTrace as a7, type StampedDelta as a8, type StrategyOperation as a9, gatedStream as aA, gaugesAsContext as aB, googleAdapter as aC, graphFromSpec as aD, graphFromSpecReactive as aE, handoff as aF, keywordFlagExtractor as aG, knobsAsTools as aH, llmConsolidator as aI, llmExtractor as aJ, memoryRetrieval as aK, memoryWithKG as aL, memoryWithTiers as aM, memoryWithVectors as aN, observableAdapter as aO, parseRateLimitFromError as aP, promptNode as aQ, redactor as aR, resilientAdapter as aS, streamExtractor as aT, streamingPromptNode as aU, suggestStrategy as aV, suggestStrategyReactive as aW, systemPromptBuilder as aX, toolCallExtractor as aY, toolRegistry as aZ, toolSelector as a_, type StrategyPlan as aa, type StreamingPromptNodeHandle as ab, type StreamingPromptNodeOptions as ac, type SuggestStrategyOptions as ad, type SystemPromptHandle as ae, ToolRegistryGraph as af, type ToolRegistryOptions as ag, type ToolResult as ah, type ToolSelectorOptions as ai, type WithBreakerOptions as aj, type WithBudgetGateOptions as ak, type WithDryRunBundle as al, type WithDryRunOptions as am, type WithRateLimiterOptions as an, type WithRetryOptions as ao, admissionFilter3D as ap, admissionScored as aq, agentLoop as ar, agentMemory as as, anthropicAdapter as at, chatStream as au, contentGate as av, costMeterExtractor as aw, dryRunAdapter as ax, fromLLM as ay, frozenContext as az, type AdmissionScoredOptions as b, withBreaker as b0, withBudgetGate as b1, withDryRun as b2, withRateLimiter as b3, withRetry as b4, withTimeout as b5, type AdmissionScores as c, type AdmissionThresholds as d, AgentLoopGraph as e, type AgentLoopOptions as f, type AgentLoopStatus as g, type AgentMemoryGraph as h, index as i, type AgentMemoryOptions as j, type AnthropicAdapterOptions as k, type AnthropicSdkLike as l, BudgetExhaustedError as m, type BudgetGateBundle as n, type BudgetTotals as o, ChatStreamGraph as p, type ChatStreamOptions as q, type ContentDecision as r, type ContentGateOptions as s, type CostMeterOptions as t, type CostMeterReading as u, type DryRunAdapterOptions as v, type FrozenContextOptions as w, type GatedStreamOptions as x, type GaugesAsContextOptions as y, type GoogleAdapterOptions as z };