@graphrefly/graphrefly 0.44.0 → 0.45.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 (420) hide show
  1. package/README.md +21 -17
  2. package/dist/compat/index.cjs +20 -10
  3. package/dist/compat/index.cjs.map +1 -0
  4. package/dist/compat/index.d.cts +1 -22
  5. package/dist/compat/index.d.ts +1 -22
  6. package/dist/compat/index.js +3 -1
  7. package/dist/compat/index.js.map +1 -0
  8. package/dist/compat/jotai/index.cjs +21 -1
  9. package/dist/compat/jotai/index.cjs.map +1 -0
  10. package/dist/compat/jotai/index.d.cts +1 -2
  11. package/dist/compat/jotai/index.d.ts +1 -2
  12. package/dist/compat/jotai/index.js +3 -1
  13. package/dist/compat/jotai/index.js.map +1 -0
  14. package/dist/compat/nanostores/index.cjs +21 -1
  15. package/dist/compat/nanostores/index.cjs.map +1 -0
  16. package/dist/compat/nanostores/index.d.cts +1 -2
  17. package/dist/compat/nanostores/index.d.ts +1 -2
  18. package/dist/compat/nanostores/index.js +3 -1
  19. package/dist/compat/nanostores/index.js.map +1 -0
  20. package/dist/compat/nestjs/index.cjs +20 -10
  21. package/dist/compat/nestjs/index.cjs.map +1 -0
  22. package/dist/compat/nestjs/index.d.cts +1 -13
  23. package/dist/compat/nestjs/index.d.ts +1 -13
  24. package/dist/compat/nestjs/index.js +3 -1
  25. package/dist/compat/nestjs/index.js.map +1 -0
  26. package/dist/compat/react/index.cjs +21 -1
  27. package/dist/compat/react/index.cjs.map +1 -0
  28. package/dist/compat/react/index.d.cts +1 -2
  29. package/dist/compat/react/index.d.ts +1 -2
  30. package/dist/compat/react/index.js +3 -1
  31. package/dist/compat/react/index.js.map +1 -0
  32. package/dist/compat/solid/index.cjs +21 -1
  33. package/dist/compat/solid/index.cjs.map +1 -0
  34. package/dist/compat/solid/index.d.cts +1 -2
  35. package/dist/compat/solid/index.d.ts +1 -2
  36. package/dist/compat/solid/index.js +3 -1
  37. package/dist/compat/solid/index.js.map +1 -0
  38. package/dist/compat/svelte/index.cjs +21 -1
  39. package/dist/compat/svelte/index.cjs.map +1 -0
  40. package/dist/compat/svelte/index.d.cts +1 -2
  41. package/dist/compat/svelte/index.d.ts +1 -2
  42. package/dist/compat/svelte/index.js +3 -1
  43. package/dist/compat/svelte/index.js.map +1 -0
  44. package/dist/compat/vue/index.cjs +21 -1
  45. package/dist/compat/vue/index.cjs.map +1 -0
  46. package/dist/compat/vue/index.d.cts +1 -3
  47. package/dist/compat/vue/index.d.ts +1 -3
  48. package/dist/compat/vue/index.js +3 -1
  49. package/dist/compat/vue/index.js.map +1 -0
  50. package/dist/compat/zustand/index.cjs +21 -3
  51. package/dist/compat/zustand/index.cjs.map +1 -0
  52. package/dist/compat/zustand/index.d.cts +1 -6
  53. package/dist/compat/zustand/index.d.ts +1 -6
  54. package/dist/compat/zustand/index.js +3 -1
  55. package/dist/compat/zustand/index.js.map +1 -0
  56. package/dist/core/index.cjs +21 -1
  57. package/dist/core/index.cjs.map +1 -0
  58. package/dist/core/index.d.cts +1 -3
  59. package/dist/core/index.d.ts +1 -3
  60. package/dist/core/index.js +3 -1
  61. package/dist/core/index.js.map +1 -0
  62. package/dist/extra/browser.cjs +21 -1
  63. package/dist/extra/browser.cjs.map +1 -0
  64. package/dist/extra/browser.d.cts +1 -4
  65. package/dist/extra/browser.d.ts +1 -4
  66. package/dist/extra/browser.js +3 -1
  67. package/dist/extra/browser.js.map +1 -0
  68. package/dist/extra/index.cjs +20 -19
  69. package/dist/extra/index.cjs.map +1 -0
  70. package/dist/extra/index.d.cts +1 -17
  71. package/dist/extra/index.d.ts +1 -17
  72. package/dist/extra/index.js +3 -1
  73. package/dist/extra/index.js.map +1 -0
  74. package/dist/extra/node.cjs +21 -2
  75. package/dist/extra/node.cjs.map +1 -0
  76. package/dist/extra/node.d.cts +1 -187
  77. package/dist/extra/node.d.ts +1 -187
  78. package/dist/extra/node.js +3 -2
  79. package/dist/extra/node.js.map +1 -0
  80. package/dist/extra/operators.cjs +21 -1
  81. package/dist/extra/operators.cjs.map +1 -0
  82. package/dist/extra/operators.d.cts +1 -958
  83. package/dist/extra/operators.d.ts +1 -958
  84. package/dist/extra/operators.js +3 -1
  85. package/dist/extra/operators.js.map +1 -0
  86. package/dist/extra/reactive.cjs +21 -1
  87. package/dist/extra/reactive.cjs.map +1 -0
  88. package/dist/extra/reactive.d.cts +1 -353
  89. package/dist/extra/reactive.d.ts +1 -353
  90. package/dist/extra/reactive.js +3 -1
  91. package/dist/extra/reactive.js.map +1 -0
  92. package/dist/extra/render/index.cjs +21 -5
  93. package/dist/extra/render/index.cjs.map +1 -0
  94. package/dist/extra/render/index.d.cts +1 -183
  95. package/dist/extra/render/index.d.ts +1 -183
  96. package/dist/extra/render/index.js +3 -1
  97. package/dist/extra/render/index.js.map +1 -0
  98. package/dist/extra/sources.cjs +21 -3
  99. package/dist/extra/sources.cjs.map +1 -0
  100. package/dist/extra/sources.d.cts +1 -584
  101. package/dist/extra/sources.d.ts +1 -584
  102. package/dist/extra/sources.js +3 -1
  103. package/dist/extra/sources.js.map +1 -0
  104. package/dist/extra/storage-browser.cjs +21 -1
  105. package/dist/extra/storage-browser.cjs.map +1 -0
  106. package/dist/extra/storage-browser.d.cts +1 -37
  107. package/dist/extra/storage-browser.d.ts +1 -37
  108. package/dist/extra/storage-browser.js +3 -1
  109. package/dist/extra/storage-browser.js.map +1 -0
  110. package/dist/extra/storage-core.cjs +21 -1
  111. package/dist/extra/storage-core.cjs.map +1 -0
  112. package/dist/extra/storage-core.d.cts +1 -28
  113. package/dist/extra/storage-core.d.ts +1 -28
  114. package/dist/extra/storage-core.js +3 -1
  115. package/dist/extra/storage-core.js.map +1 -0
  116. package/dist/extra/storage-node.cjs +20 -0
  117. package/dist/extra/storage-node.cjs.map +1 -0
  118. package/dist/extra/storage-node.d.cts +1 -2
  119. package/dist/extra/storage-node.d.ts +1 -2
  120. package/dist/extra/storage-node.js +3 -0
  121. package/dist/extra/storage-node.js.map +1 -0
  122. package/dist/extra/storage-tiers-browser.cjs +21 -1
  123. package/dist/extra/storage-tiers-browser.cjs.map +1 -0
  124. package/dist/extra/storage-tiers-browser.d.cts +1 -120
  125. package/dist/extra/storage-tiers-browser.d.ts +1 -120
  126. package/dist/extra/storage-tiers-browser.js +3 -1
  127. package/dist/extra/storage-tiers-browser.js.map +1 -0
  128. package/dist/extra/storage-tiers-node.cjs +21 -1
  129. package/dist/extra/storage-tiers-node.cjs.map +1 -0
  130. package/dist/extra/storage-tiers-node.d.cts +1 -210
  131. package/dist/extra/storage-tiers-node.d.ts +1 -210
  132. package/dist/extra/storage-tiers-node.js +3 -1
  133. package/dist/extra/storage-tiers-node.js.map +1 -0
  134. package/dist/extra/storage-tiers.cjs +21 -1
  135. package/dist/extra/storage-tiers.cjs.map +1 -0
  136. package/dist/extra/storage-tiers.d.cts +1 -412
  137. package/dist/extra/storage-tiers.d.ts +1 -412
  138. package/dist/extra/storage-tiers.js +3 -1
  139. package/dist/extra/storage-tiers.js.map +1 -0
  140. package/dist/extra/storage-wal.cjs +21 -0
  141. package/dist/extra/storage-wal.cjs.map +1 -0
  142. package/dist/extra/storage-wal.d.cts +1 -0
  143. package/dist/extra/storage-wal.d.ts +1 -0
  144. package/dist/extra/storage-wal.js +3 -0
  145. package/dist/extra/storage-wal.js.map +1 -0
  146. package/dist/graph/index.cjs +21 -7
  147. package/dist/graph/index.cjs.map +1 -0
  148. package/dist/graph/index.d.cts +1 -7
  149. package/dist/graph/index.d.ts +1 -7
  150. package/dist/graph/index.js +3 -1
  151. package/dist/graph/index.js.map +1 -0
  152. package/dist/index.cjs +20 -227
  153. package/dist/index.cjs.map +1 -0
  154. package/dist/index.d.cts +45 -95
  155. package/dist/index.d.ts +45 -95
  156. package/dist/index.js +3 -1
  157. package/dist/index.js.map +1 -0
  158. package/dist/patterns/ai/browser.cjs +20 -7
  159. package/dist/patterns/ai/browser.cjs.map +1 -0
  160. package/dist/patterns/ai/browser.d.cts +1 -127
  161. package/dist/patterns/ai/browser.d.ts +1 -127
  162. package/dist/patterns/ai/browser.js +3 -3
  163. package/dist/patterns/ai/browser.js.map +1 -0
  164. package/dist/patterns/ai/index.cjs +20 -73
  165. package/dist/patterns/ai/index.cjs.map +1 -0
  166. package/dist/patterns/ai/index.d.cts +1 -20
  167. package/dist/patterns/ai/index.d.ts +1 -20
  168. package/dist/patterns/ai/index.js +3 -1
  169. package/dist/patterns/ai/index.js.map +1 -0
  170. package/dist/patterns/ai/node.cjs +21 -1
  171. package/dist/patterns/ai/node.cjs.map +1 -0
  172. package/dist/patterns/ai/node.d.cts +1 -59
  173. package/dist/patterns/ai/node.d.ts +1 -59
  174. package/dist/patterns/ai/node.js +3 -1
  175. package/dist/patterns/ai/node.js.map +1 -0
  176. package/dist/patterns/cqrs/index.cjs +21 -3
  177. package/dist/patterns/cqrs/index.cjs.map +1 -0
  178. package/dist/patterns/cqrs/index.d.cts +1 -8
  179. package/dist/patterns/cqrs/index.d.ts +1 -8
  180. package/dist/patterns/cqrs/index.js +3 -1
  181. package/dist/patterns/cqrs/index.js.map +1 -0
  182. package/dist/patterns/demo-shell/index.cjs +21 -5
  183. package/dist/patterns/demo-shell/index.cjs.map +1 -0
  184. package/dist/patterns/demo-shell/index.d.cts +1 -7
  185. package/dist/patterns/demo-shell/index.d.ts +1 -7
  186. package/dist/patterns/demo-shell/index.js +3 -1
  187. package/dist/patterns/demo-shell/index.js.map +1 -0
  188. package/dist/patterns/domain-templates/index.cjs +21 -3
  189. package/dist/patterns/domain-templates/index.cjs.map +1 -0
  190. package/dist/patterns/domain-templates/index.d.cts +1 -6
  191. package/dist/patterns/domain-templates/index.d.ts +1 -6
  192. package/dist/patterns/domain-templates/index.js +3 -1
  193. package/dist/patterns/domain-templates/index.js.map +1 -0
  194. package/dist/patterns/graphspec/index.cjs +21 -86
  195. package/dist/patterns/graphspec/index.cjs.map +1 -0
  196. package/dist/patterns/graphspec/index.d.cts +1 -8
  197. package/dist/patterns/graphspec/index.d.ts +1 -8
  198. package/dist/patterns/graphspec/index.js +3 -1
  199. package/dist/patterns/graphspec/index.js.map +1 -0
  200. package/dist/patterns/harness/index.cjs +21 -48
  201. package/dist/patterns/harness/index.cjs.map +1 -0
  202. package/dist/patterns/harness/index.d.cts +1 -13
  203. package/dist/patterns/harness/index.d.ts +1 -13
  204. package/dist/patterns/harness/index.js +3 -1
  205. package/dist/patterns/harness/index.js.map +1 -0
  206. package/dist/patterns/inspect/index.cjs +21 -3
  207. package/dist/patterns/inspect/index.cjs.map +1 -0
  208. package/dist/patterns/inspect/index.d.cts +1 -9
  209. package/dist/patterns/inspect/index.d.ts +1 -9
  210. package/dist/patterns/inspect/index.js +3 -1
  211. package/dist/patterns/inspect/index.js.map +1 -0
  212. package/dist/patterns/job-queue/index.cjs +21 -3
  213. package/dist/patterns/job-queue/index.cjs.map +1 -0
  214. package/dist/patterns/job-queue/index.d.cts +1 -9
  215. package/dist/patterns/job-queue/index.d.ts +1 -9
  216. package/dist/patterns/job-queue/index.js +3 -1
  217. package/dist/patterns/job-queue/index.js.map +1 -0
  218. package/dist/patterns/memory/index.cjs +21 -3
  219. package/dist/patterns/memory/index.cjs.map +1 -0
  220. package/dist/patterns/memory/index.d.cts +1 -8
  221. package/dist/patterns/memory/index.d.ts +1 -8
  222. package/dist/patterns/memory/index.js +3 -1
  223. package/dist/patterns/memory/index.js.map +1 -0
  224. package/dist/patterns/messaging/index.cjs +21 -3
  225. package/dist/patterns/messaging/index.cjs.map +1 -0
  226. package/dist/patterns/messaging/index.d.cts +1 -7
  227. package/dist/patterns/messaging/index.d.ts +1 -7
  228. package/dist/patterns/messaging/index.js +3 -1
  229. package/dist/patterns/messaging/index.js.map +1 -0
  230. package/dist/patterns/orchestration/index.cjs +21 -3
  231. package/dist/patterns/orchestration/index.cjs.map +1 -0
  232. package/dist/patterns/orchestration/index.d.cts +1 -8
  233. package/dist/patterns/orchestration/index.d.ts +1 -8
  234. package/dist/patterns/orchestration/index.js +3 -1
  235. package/dist/patterns/orchestration/index.js.map +1 -0
  236. package/dist/patterns/process/index.cjs +21 -3
  237. package/dist/patterns/process/index.cjs.map +1 -0
  238. package/dist/patterns/process/index.d.cts +1 -10
  239. package/dist/patterns/process/index.d.ts +1 -10
  240. package/dist/patterns/process/index.js +3 -1
  241. package/dist/patterns/process/index.js.map +1 -0
  242. package/dist/patterns/reactive-layout/index.cjs +21 -4
  243. package/dist/patterns/reactive-layout/index.cjs.map +1 -0
  244. package/dist/patterns/reactive-layout/index.d.cts +1 -7
  245. package/dist/patterns/reactive-layout/index.d.ts +1 -7
  246. package/dist/patterns/reactive-layout/index.js +3 -1
  247. package/dist/patterns/reactive-layout/index.js.map +1 -0
  248. package/dist/patterns/reduction/index.cjs +21 -3
  249. package/dist/patterns/reduction/index.cjs.map +1 -0
  250. package/dist/patterns/reduction/index.d.cts +1 -6
  251. package/dist/patterns/reduction/index.d.ts +1 -6
  252. package/dist/patterns/reduction/index.js +3 -1
  253. package/dist/patterns/reduction/index.js.map +1 -0
  254. package/dist/patterns/surface/index.cjs +21 -13
  255. package/dist/patterns/surface/index.cjs.map +1 -0
  256. package/dist/patterns/surface/index.d.cts +1 -9
  257. package/dist/patterns/surface/index.d.ts +1 -9
  258. package/dist/patterns/surface/index.js +3 -1
  259. package/dist/patterns/surface/index.js.map +1 -0
  260. package/dist/patterns/topology-view/index.cjs +21 -0
  261. package/dist/patterns/topology-view/index.cjs.map +1 -0
  262. package/dist/patterns/topology-view/index.d.cts +1 -0
  263. package/dist/patterns/topology-view/index.d.ts +1 -0
  264. package/dist/patterns/topology-view/index.js +3 -0
  265. package/dist/patterns/topology-view/index.js.map +1 -0
  266. package/dist/testing/index.cjs +21 -0
  267. package/dist/testing/index.cjs.map +1 -0
  268. package/dist/testing/index.d.cts +1 -0
  269. package/dist/testing/index.d.ts +1 -0
  270. package/dist/testing/index.js +3 -0
  271. package/dist/testing/index.js.map +1 -0
  272. package/package.json +608 -584
  273. package/dist/backoff-HPZMEZNF.js +0 -1
  274. package/dist/cascading-BglDkMdX.d.cts +0 -199
  275. package/dist/cascading-MFgxu7Yo.d.ts +0 -199
  276. package/dist/chunk-2T7U5EU6.js +0 -1
  277. package/dist/chunk-3G5U5QNE.js +0 -5
  278. package/dist/chunk-4VVTGLXJ.js +0 -1
  279. package/dist/chunk-5M4CCMMD.js +0 -45
  280. package/dist/chunk-5QDBSZBV.js +0 -1
  281. package/dist/chunk-5XJ6B66J.js +0 -1
  282. package/dist/chunk-6QZNQS5B.js +0 -1
  283. package/dist/chunk-6X7AFUJV.js +0 -9
  284. package/dist/chunk-7K6PWTDQ.js +0 -1
  285. package/dist/chunk-7LIAPXJB.js +0 -1
  286. package/dist/chunk-7WPU3UHQ.js +0 -1
  287. package/dist/chunk-A5WCQ5NO.js +0 -1
  288. package/dist/chunk-APPIWSGD.js +0 -84
  289. package/dist/chunk-BEZWM2SY.js +0 -1
  290. package/dist/chunk-C72GO4IZ.js +0 -1
  291. package/dist/chunk-CB676TKJ.js +0 -1
  292. package/dist/chunk-CE6TI2TL.js +0 -1
  293. package/dist/chunk-CE72X3WO.js +0 -1
  294. package/dist/chunk-CK2E7BTU.js +0 -1
  295. package/dist/chunk-CLVB32RD.js +0 -1
  296. package/dist/chunk-CRVT7D2P.js +0 -1
  297. package/dist/chunk-D5RFJOZ2.js +0 -1
  298. package/dist/chunk-D7GPHKFH.js +0 -1
  299. package/dist/chunk-DHRX7JX4.js +0 -2
  300. package/dist/chunk-ESMPEKEV.js +0 -1
  301. package/dist/chunk-F672GV32.js +0 -1
  302. package/dist/chunk-FZMYDOWV.js +0 -1
  303. package/dist/chunk-GHBWHMRZ.js +0 -1
  304. package/dist/chunk-GLERH466.js +0 -1
  305. package/dist/chunk-GPW2V3RE.js +0 -1
  306. package/dist/chunk-HIDYF36O.js +0 -1
  307. package/dist/chunk-HITNVN6B.js +0 -3
  308. package/dist/chunk-HY4DJBA7.js +0 -5
  309. package/dist/chunk-KZIEYVXN.js +0 -1
  310. package/dist/chunk-L6NSJVJZ.js +0 -1
  311. package/dist/chunk-N4MQX6JU.js +0 -18
  312. package/dist/chunk-N7FHEL4D.js +0 -1
  313. package/dist/chunk-NTEURFZH.js +0 -1
  314. package/dist/chunk-OIVP6KFV.js +0 -1
  315. package/dist/chunk-OPHBU3LG.js +0 -1
  316. package/dist/chunk-OYQOZP2F.js +0 -5
  317. package/dist/chunk-PTZK576G.js +0 -1
  318. package/dist/chunk-QYADASLV.js +0 -1
  319. package/dist/chunk-ST7UXLWR.js +0 -1
  320. package/dist/chunk-SVY7VUYU.js +0 -1
  321. package/dist/chunk-TK3NWWD4.js +0 -1
  322. package/dist/chunk-TSOYJ743.js +0 -1
  323. package/dist/chunk-UNGSTR4X.js +0 -61
  324. package/dist/chunk-VIMF6LGM.js +0 -1
  325. package/dist/chunk-VJLMUKOI.js +0 -1
  326. package/dist/chunk-VN6RDSK2.js +0 -1
  327. package/dist/chunk-VV4N5P64.js +0 -1
  328. package/dist/chunk-W3I423PS.js +0 -1
  329. package/dist/chunk-WJR24TAG.js +0 -1
  330. package/dist/chunk-XTGKMHSW.js +0 -1
  331. package/dist/chunk-YBB7ZGTY.js +0 -1
  332. package/dist/chunk-Z4NPUARF.js +0 -1
  333. package/dist/chunk-ZGNQRPDT.js +0 -1
  334. package/dist/chunk-ZKPSFFKU.js +0 -1
  335. package/dist/chunk-ZLV5SQSX.js +0 -1
  336. package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
  337. package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
  338. package/dist/decay-BvOWTZ00.d.ts +0 -112
  339. package/dist/decay-CFlLvXUT.d.cts +0 -112
  340. package/dist/fallback-74oxi34l.d.cts +0 -250
  341. package/dist/fallback-DUyyBTBK.d.ts +0 -250
  342. package/dist/graph-CWvEUQAq.d.cts +0 -1861
  343. package/dist/graph-D9LFnda9.d.ts +0 -1861
  344. package/dist/index-5k1T6jl0.d.cts +0 -121
  345. package/dist/index-9770hRuQ.d.cts +0 -779
  346. package/dist/index-B-_tFaqV.d.cts +0 -468
  347. package/dist/index-B17QddL1.d.cts +0 -374
  348. package/dist/index-B1F8Enjf.d.ts +0 -704
  349. package/dist/index-B5S8ULbU.d.ts +0 -515
  350. package/dist/index-B8YnZpIR.d.ts +0 -102
  351. package/dist/index-BHskSB8v.d.ts +0 -3413
  352. package/dist/index-BIYAkbAi.d.cts +0 -26
  353. package/dist/index-BQSKmbuG.d.cts +0 -127
  354. package/dist/index-BaQaY_IQ.d.cts +0 -231
  355. package/dist/index-BmZXHqkE.d.ts +0 -36
  356. package/dist/index-BoJ5JHxI.d.ts +0 -557
  357. package/dist/index-BocU7pqs.d.ts +0 -779
  358. package/dist/index-BrPrLl4e.d.cts +0 -86
  359. package/dist/index-BxNs2HB9.d.cts +0 -1858
  360. package/dist/index-Byu-OpX_.d.ts +0 -113
  361. package/dist/index-C1T3d7V-.d.cts +0 -704
  362. package/dist/index-C5ri2Axc.d.cts +0 -301
  363. package/dist/index-C5stwKcw.d.cts +0 -44
  364. package/dist/index-C9l6OEBL.d.ts +0 -26
  365. package/dist/index-CBBLl_rc.d.ts +0 -127
  366. package/dist/index-CBGUK09R.d.ts +0 -754
  367. package/dist/index-CC-AvFTy.d.cts +0 -557
  368. package/dist/index-CJF1URuX.d.ts +0 -121
  369. package/dist/index-CK29LV56.d.cts +0 -34
  370. package/dist/index-CMh5Rz1y.d.ts +0 -385
  371. package/dist/index-CPQlGA29.d.ts +0 -34
  372. package/dist/index-CR8QpwX8.d.ts +0 -2680
  373. package/dist/index-CS0LTlB8.d.cts +0 -385
  374. package/dist/index-CSOmP7xT.d.cts +0 -291
  375. package/dist/index-CYq8vAyV.d.ts +0 -291
  376. package/dist/index-CZ3r5Rxp.d.ts +0 -374
  377. package/dist/index-CasX6Pfq.d.cts +0 -358
  378. package/dist/index-CdAlHFEt.d.ts +0 -44
  379. package/dist/index-CdTelp1M.d.ts +0 -202
  380. package/dist/index-CeFiHtAg.d.ts +0 -468
  381. package/dist/index-Cj3WohTd.d.cts +0 -202
  382. package/dist/index-Climxqsu.d.cts +0 -754
  383. package/dist/index-Co7uli2l.d.cts +0 -3413
  384. package/dist/index-CviRnE4K.d.ts +0 -45
  385. package/dist/index-Cwv0KWcU.d.cts +0 -102
  386. package/dist/index-CzLVrjxn.d.ts +0 -231
  387. package/dist/index-D0aciIex.d.cts +0 -209
  388. package/dist/index-DHen9Klo.d.ts +0 -1858
  389. package/dist/index-DV_1YuVk.d.cts +0 -221
  390. package/dist/index-Dc4AYqrJ.d.cts +0 -515
  391. package/dist/index-Dgl1HpPn.d.ts +0 -86
  392. package/dist/index-DisjX8a-.d.ts +0 -221
  393. package/dist/index-UPSiS-X7.d.cts +0 -2680
  394. package/dist/index-Yq60JP3s.d.ts +0 -209
  395. package/dist/index-ZVQhLa2i.d.cts +0 -37
  396. package/dist/index-_6ODbuOu.d.cts +0 -45
  397. package/dist/index-hcDJ8PSI.d.cts +0 -36
  398. package/dist/index-nozs3fFC.d.ts +0 -301
  399. package/dist/index-p09KSrTN.d.ts +0 -358
  400. package/dist/index-sqkqlb1p.d.ts +0 -37
  401. package/dist/index-tRCxuAXF.d.cts +0 -113
  402. package/dist/node-kK3CvTrR.d.cts +0 -1347
  403. package/dist/node-kK3CvTrR.d.ts +0 -1347
  404. package/dist/observable-DWjNfLvC.d.ts +0 -36
  405. package/dist/observable-e3eiPPFy.d.cts +0 -36
  406. package/dist/pipeline-graph-CIKhynsF.d.cts +0 -142
  407. package/dist/pipeline-graph-Sgj0gCwn.d.ts +0 -142
  408. package/dist/reactive-layout-DOTs9P3X.d.ts +0 -183
  409. package/dist/reactive-layout-DgctbqZo.d.cts +0 -183
  410. package/dist/reactive-log-BKALbfal.d.ts +0 -223
  411. package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
  412. package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
  413. package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
  414. package/dist/resilience-6LYQJAC5.js +0 -1
  415. package/dist/sugar-DQjFmVqb.d.cts +0 -399
  416. package/dist/sugar-fhLIE7TT.d.ts +0 -399
  417. package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
  418. package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
  419. package/dist/types-C0_yquda.d.cts +0 -442
  420. package/dist/types-CWFysE9E.d.ts +0 -442
@@ -1,385 +0,0 @@
1
- import { D as DescribeNodeOutput } from './sugar-DQjFmVqb.cjs';
2
- import { N as Node } from './node-kK3CvTrR.cjs';
3
- import { G as Graph, b as GraphDescribeOutput } from './graph-CWvEUQAq.cjs';
4
- import { L as LLMAdapter } from './types-C0_yquda.cjs';
5
-
6
- /**
7
- * LLM graph composition (roadmap §8.3).
8
- *
9
- * Declarative GraphSpec schema + compiler/decompiler for graph topology.
10
- * The LLM designs graphs as JSON; `compileSpec` instantiates them;
11
- * `decompileSpec` extracts them back. Templates support reusable subgraph
12
- * patterns. Feedback edges express bounded cycles via §8.1 feedback().
13
- *
14
- * **Tier 1.5.3 Phase 3 (2026-04-27):** `GraphSpec` is a structural alias of
15
- * {@link GraphDescribeOutput} with two LLM-author-friendly extras
16
- * (`templates?` / `feedback?`). Per-node factory references are encoded in
17
- * `meta.factory` + `meta.factoryArgs` (no more `fn` / `source` / `config` /
18
- * `initial` fields). State node initial values live in
19
- * `meta.factoryArgs.initial` (state self-tags with
20
- * `factoryTag("state", { initial })`).
21
- *
22
- * @module
23
- */
24
-
25
- /**
26
- * A single node declaration in a GraphSpec — structural alias of
27
- * {@link DescribeNodeOutput}.
28
- *
29
- * Per-node factory provenance lives in `meta.factory` + `meta.factoryArgs`
30
- * (use {@link factoryTag} to stamp them at construction time). State node
31
- * initial values come through `meta.factoryArgs.initial` for tagged states,
32
- * with fallback to `value` (since spec projection retains state values).
33
- */
34
- type GraphSpecNode = DescribeNodeOutput;
35
- /** Template instantiation node — expanded at compile time. */
36
- type GraphSpecTemplateRef = {
37
- type: "template";
38
- /** Name of the template to instantiate. */
39
- template: string;
40
- /** Parameter bindings: template param name → node name. */
41
- bind: Record<string, string>;
42
- };
43
- /** A reusable subgraph pattern with parameter substitution. */
44
- type GraphSpecTemplate = {
45
- /** Parameter names (prefixed with $ in node refs). */
46
- params: string[];
47
- /** Node declarations within the template. */
48
- nodes: Record<string, GraphSpecNode>;
49
- /** Which node's output is the template's output. */
50
- output: string;
51
- };
52
- /** A feedback edge: bounded cycle from condition to reentry. */
53
- type GraphSpecFeedbackEdge = {
54
- /** Node whose DATA triggers the feedback. */
55
- from: string;
56
- /** State node that receives the feedback value. */
57
- to: string;
58
- /** Max iterations before stopping (default: 10). */
59
- maxIterations?: number;
60
- };
61
- /**
62
- * Declarative graph topology for LLM composition (§8.3).
63
- *
64
- * Tier 1.5.3 Phase 3 (2026-04-27): structural alias of
65
- * {@link GraphDescribeOutput} extended with optional `templates` /
66
- * `feedback` fields for LLM-author convenience. Top-level `factory` /
67
- * `factoryArgs` (Phase 2.5 carry) ride along on every describe output.
68
- *
69
- * Round-trip property: `decompileSpec(g) === g.describe({ detail: "spec" })`
70
- * (modulo the small feedback-edge extraction sugar).
71
- */
72
- type GraphSpec = Omit<GraphDescribeOutput, "nodes" | "expand"> & {
73
- /** Node declarations (keyed by node name). Either a structural describe entry or a template ref. */
74
- nodes: Record<string, GraphSpecNode | GraphSpecTemplateRef>;
75
- /** Reusable subgraph templates (LLM-author extra; not present in `describe()` output). */
76
- templates?: Record<string, GraphSpecTemplate>;
77
- /** Feedback edges (bounded cycles, LLM-author extra). */
78
- feedback?: GraphSpecFeedbackEdge[];
79
- };
80
- /**
81
- * Factory for creating a derived/effect/operator node from catalog.
82
- * Receives resolved dep nodes and the config from the spec.
83
- */
84
- type FnFactory = (deps: Node<unknown>[], config: Record<string, unknown>) => Node<unknown>;
85
- /**
86
- * Factory for creating a producer node from catalog.
87
- * Receives the config from the spec.
88
- */
89
- type SourceFactory = (config: Record<string, unknown>) => Node<unknown>;
90
- /** Simple config field descriptor for LLM prompt generation and validation. */
91
- type ConfigFieldSchema = {
92
- /** Human-readable type: "string", "number", "boolean", "string[]", etc. */
93
- type: string;
94
- /** Whether this field is required (default: true). */
95
- required?: boolean;
96
- /** Allowed values (enum constraint). */
97
- enum?: readonly (string | number | boolean)[];
98
- /** Human-readable description for LLM context. */
99
- description?: string;
100
- /** Default value if omitted. */
101
- default?: unknown;
102
- };
103
- /**
104
- * Rich catalog entry: bundles a runtime factory with LLM-facing metadata.
105
- *
106
- * The metadata is used to:
107
- * 1. Auto-generate prompt text for {@link llmCompose} (replaces manual `catalogDescription`)
108
- * 2. Validate LLM output in {@link validateSpec} (catch wrong fn names, invalid config)
109
- * 3. Provide actionable error messages for {@link llmRefine} feedback loops
110
- *
111
- * Developers register ONE object; the library handles prompt generation and validation.
112
- */
113
- type CatalogFnEntry = {
114
- /** Runtime factory. */
115
- factory: FnFactory;
116
- /** One-line description for LLM prompt (what it does, not how). */
117
- description: string;
118
- /** Config field schemas. Keys are config field names. */
119
- configSchema?: Record<string, ConfigFieldSchema>;
120
- /** Example config objects (shown in prompt for complex fns). */
121
- examples?: Record<string, unknown>[];
122
- /** Category tags for grouping in prompt (e.g., "resilience", "reduction", "ai"). */
123
- tags?: string[];
124
- };
125
- /** Rich catalog entry for producer sources. */
126
- type CatalogSourceEntry = {
127
- /** Runtime factory. */
128
- factory: SourceFactory;
129
- /** One-line description for LLM prompt. */
130
- description: string;
131
- /** Config field schemas. */
132
- configSchema?: Record<string, ConfigFieldSchema>;
133
- /** Example config objects. */
134
- examples?: Record<string, unknown>[];
135
- /** Category tags. */
136
- tags?: string[];
137
- };
138
- /**
139
- * Top-level Graph factory — used when a spec was produced from a graph that
140
- * called `Graph.prototype.tagFactory(name, args)`. The catalog supplies a
141
- * function that takes the recorded `factoryArgs` (JSON-serializable subset)
142
- * and returns a fully-wired Graph. Runtime context (LLMAdapter instances,
143
- * callbacks, embedders) is captured by the closure — the args themselves are
144
- * a documentation fragment, not a complete construction recipe.
145
- *
146
- * Tier 1.5.3 Phase 2.5 (DG1=B, 2026-04-27).
147
- */
148
- type GraphFactory = (factoryArgs: unknown) => Graph;
149
- /**
150
- * Fn/source lookup table passed to compileSpec and llmCompose.
151
- *
152
- * Accepts both bare factories (backward-compatible) and rich {@link CatalogFnEntry}
153
- * / {@link CatalogSourceEntry} objects. When rich entries are provided, the library
154
- * auto-generates LLM prompts and validates LLM output against the catalog.
155
- *
156
- * `graphFactories` (Tier 1.5.3 Phase 2.5) handles top-level Graph-returning
157
- * factories — when `spec.factory` matches a key, `compileSpec` delegates the
158
- * entire reconstruction to that factory.
159
- */
160
- type GraphSpecCatalog = {
161
- fns?: Record<string, FnFactory | CatalogFnEntry>;
162
- sources?: Record<string, SourceFactory | CatalogSourceEntry>;
163
- graphFactories?: Record<string, GraphFactory>;
164
- };
165
- /** Type guard: is this a rich catalog fn entry (vs bare factory)? */
166
- declare function isRichFnEntry(entry: FnFactory | CatalogFnEntry): entry is CatalogFnEntry;
167
- /** Type guard: is this a rich catalog source entry (vs bare factory)? */
168
- declare function isRichSourceEntry(entry: SourceFactory | CatalogSourceEntry): entry is CatalogSourceEntry;
169
- /** Extract the runtime factory from a catalog entry (rich or bare). */
170
- declare function extractFnFactory(entry: FnFactory | CatalogFnEntry): FnFactory;
171
- /** Extract the runtime factory from a catalog source entry (rich or bare). */
172
- declare function extractSourceFactory(entry: SourceFactory | CatalogSourceEntry): SourceFactory;
173
- /**
174
- * Auto-generate catalog prompt text from rich catalog entries.
175
- *
176
- * Groups fns by tag, formats each as `- name: description. Config: { ... }`.
177
- * Falls back to listing names only for bare factories.
178
- */
179
- declare function generateCatalogPrompt(catalog: GraphSpecCatalog): string;
180
- /**
181
- * Validate a GraphSpec against a catalog.
182
- *
183
- * Checks that fn/source names reference actual catalog entries, and validates
184
- * config fields against configSchema when rich entries are available.
185
- * Returns additional errors beyond structural {@link validateSpec} checks.
186
- */
187
- declare function validateSpecAgainstCatalog(spec: GraphSpec, catalog: GraphSpecCatalog): GraphSpecValidation;
188
- /** Validation result from {@link validateSpec}. */
189
- type GraphSpecValidation = {
190
- valid: boolean;
191
- errors: string[];
192
- /**
193
- * Non-fatal advisories. Currently includes feedback edges whose `from`
194
- * refers to an `effect` node (effects produce no DATA — the feedback
195
- * counter will never advance). Always present (empty array when nothing
196
- * is flagged) — symmetry with `errors` so callers can read
197
- * `result.warnings.length` without a null check.
198
- */
199
- warnings: string[];
200
- };
201
- /**
202
- * Validate a GraphSpec JSON object.
203
- *
204
- * Checks structural validity: required fields, node types, dep references,
205
- * template references, feedback edge targets, self-cycles, and bind completeness.
206
- *
207
- * **Effect-node feedback advisory (C24-3).** When a feedback edge's `from`
208
- * refers to an `effect` node, the validator flags it via `warnings` (not
209
- * `errors`) — effect nodes produce no DATA emission, so a feedback counter
210
- * targeting one will never advance. The spec compiles either way; the
211
- * advisory exists because the misconfiguration is silent at runtime
212
- * (counter at 0 forever) without it.
213
- */
214
- declare function validateSpec(spec: unknown): GraphSpecValidation;
215
- /** Options for {@link compileSpec}. */
216
- type CompileSpecOptions = {
217
- /** Fn/source catalog for resolving named factories. */
218
- catalog?: GraphSpecCatalog;
219
- /**
220
- * How to handle nodes whose `fn` / `source` is missing from the catalog.
221
- * - `"placeholder"` (default): silently substitute identity passthroughs
222
- * (`producer(() => {})` / `derived(deps, vals => vals[0])`). Backward-
223
- * compatible — preserves the historical "soft compile" behavior.
224
- * - `"warn"`: substitute placeholders AND log each missing entry via
225
- * `console.warn`, or via the `onWarn` callback if supplied.
226
- * - `"error"`: collect every missing entry across the whole spec, then
227
- * throw an `Error` listing them all (no partial graph returned).
228
- */
229
- onMissing?: "error" | "warn" | "placeholder";
230
- /** Custom warning sink. Used only when `onMissing === "warn"`. Defaults to `console.warn`. */
231
- onWarn?: (message: string) => void;
232
- };
233
- /**
234
- * Instantiate a Graph from a GraphSpec.
235
- *
236
- * Handles template expansion (mounted subgraphs), feedback wiring via §8.1
237
- * feedback(), node factory lookup from the catalog, and topology validation.
238
- *
239
- * @param spec - Declarative graph topology.
240
- * @param opts - Catalog and compile options.
241
- * @returns A running Graph.
242
- * @throws On validation failure, missing catalog entries, or unresolvable deps.
243
- *
244
- * @category patterns
245
- */
246
- declare function compileSpec(spec: GraphSpec, opts?: CompileSpecOptions): Graph;
247
- /**
248
- * Extract a {@link GraphSpec} from a running graph.
249
- *
250
- * Tier 1.5.3 Phase 3 (2026-04-27): thin projection over
251
- * `graph.describe({ detail: "spec" })`. The describe-output already carries
252
- * structural fields (`type`, `deps`, optional `value`) plus per-node
253
- * `meta.factory` / `meta.factoryArgs` for tagged factories and top-level
254
- * `factory` / `factoryArgs` for graph-level tags. The only sugar this helper
255
- * adds is a feedback-edge recovery scan over `meta.feedbackFrom` /
256
- * `meta.feedbackTo` companion fields stamped by the §8.1 `feedback()`
257
- * primitive.
258
- *
259
- * **Removed in Phase 3:** template fingerprinting / `_templateName` /
260
- * `_templateBind` recovery. Mounted subgraphs surface as nested `subname::*`
261
- * paths in `desc.nodes`; if you need the template-instantiation form, build
262
- * the spec by hand or read the meta companions directly.
263
- *
264
- * @param graph - Running graph to decompile.
265
- * @returns A GraphSpec representation.
266
- *
267
- * @category patterns
268
- */
269
- declare function decompileSpec(graph: Graph): GraphSpec;
270
- /** A single change in a spec diff. */
271
- type SpecDiffEntry = {
272
- type: "added" | "removed" | "changed";
273
- path: string;
274
- detail?: string;
275
- };
276
- /** Structural diff between two GraphSpecs. */
277
- type SpecDiffResult = {
278
- entries: SpecDiffEntry[];
279
- summary: string;
280
- };
281
- /**
282
- * Compute a structural diff between two GraphSpecs.
283
- *
284
- * Template-aware: reports "changed template definition" vs "changed
285
- * instantiation bindings." No runtime needed — pure JSON comparison.
286
- *
287
- * @param specA - The "before" spec.
288
- * @param specB - The "after" spec.
289
- * @returns Diff entries and a human-readable summary.
290
- *
291
- * @category patterns
292
- */
293
- declare function specDiff(specA: GraphSpec, specB: GraphSpec): SpecDiffResult;
294
- /** Options for {@link llmCompose}. */
295
- type LLMComposeOptions = {
296
- model?: string;
297
- temperature?: number;
298
- maxTokens?: number;
299
- /** Extra instructions appended to the system prompt. */
300
- systemPromptExtra?: string;
301
- /**
302
- * Available fn/source catalog names for the LLM to reference.
303
- * When omitted and `catalog` contains rich {@link CatalogFnEntry} entries,
304
- * the prompt is auto-generated via {@link generateCatalogPrompt}.
305
- */
306
- catalogDescription?: string;
307
- /**
308
- * Catalog for auto-prompt generation and catalog-aware validation.
309
- * When rich entries are provided, the catalog prompt is auto-generated
310
- * and LLM output is validated against fn/source names and config schemas.
311
- */
312
- catalog?: GraphSpecCatalog;
313
- /**
314
- * Max auto-refine attempts when the LLM output fails catalog validation.
315
- * Each attempt feeds the validation errors back to the LLM via llmRefine.
316
- * Default: 0 (no auto-refine). Set to 2-3 for production use.
317
- */
318
- maxAutoRefine?: number;
319
- };
320
- /**
321
- * Ask an LLM to compose a GraphSpec from a natural-language problem description.
322
- *
323
- * The LLM generates a GraphSpec (with templates + feedback), validated before
324
- * returning. The spec is for human review before compilation via compileSpec().
325
- *
326
- * @param problem - Natural language problem description.
327
- * @param adapter - LLM adapter for the generation call.
328
- * @param opts - Model options and catalog description.
329
- * @returns A validated GraphSpec.
330
- * @throws On invalid LLM output or validation failure.
331
- *
332
- * @category patterns
333
- */
334
- declare function llmCompose(problem: string, adapter: LLMAdapter, opts?: LLMComposeOptions): Promise<GraphSpec>;
335
- /** Options for {@link llmRefine}. */
336
- type LLMRefineOptions = LLMComposeOptions;
337
- /**
338
- * Ask an LLM to modify an existing GraphSpec based on feedback or changed requirements.
339
- *
340
- * @param currentSpec - The current GraphSpec to modify.
341
- * @param feedback - Natural language feedback or changed requirements.
342
- * @param adapter - LLM adapter for the generation call.
343
- * @param opts - Model options.
344
- * @returns A new GraphSpec incorporating the feedback.
345
- * @throws On invalid LLM output or validation failure.
346
- *
347
- * @category patterns
348
- */
349
- declare function llmRefine(currentSpec: GraphSpec, feedback: string, adapter: LLMAdapter, opts?: LLMRefineOptions): Promise<GraphSpec>;
350
-
351
- type index_CatalogFnEntry = CatalogFnEntry;
352
- type index_CatalogSourceEntry = CatalogSourceEntry;
353
- type index_CompileSpecOptions = CompileSpecOptions;
354
- type index_ConfigFieldSchema = ConfigFieldSchema;
355
- type index_FnFactory = FnFactory;
356
- type index_GraphFactory = GraphFactory;
357
- type index_GraphSpec = GraphSpec;
358
- type index_GraphSpecCatalog = GraphSpecCatalog;
359
- type index_GraphSpecFeedbackEdge = GraphSpecFeedbackEdge;
360
- type index_GraphSpecNode = GraphSpecNode;
361
- type index_GraphSpecTemplate = GraphSpecTemplate;
362
- type index_GraphSpecTemplateRef = GraphSpecTemplateRef;
363
- type index_GraphSpecValidation = GraphSpecValidation;
364
- type index_LLMComposeOptions = LLMComposeOptions;
365
- type index_LLMRefineOptions = LLMRefineOptions;
366
- type index_SourceFactory = SourceFactory;
367
- type index_SpecDiffEntry = SpecDiffEntry;
368
- type index_SpecDiffResult = SpecDiffResult;
369
- declare const index_compileSpec: typeof compileSpec;
370
- declare const index_decompileSpec: typeof decompileSpec;
371
- declare const index_extractFnFactory: typeof extractFnFactory;
372
- declare const index_extractSourceFactory: typeof extractSourceFactory;
373
- declare const index_generateCatalogPrompt: typeof generateCatalogPrompt;
374
- declare const index_isRichFnEntry: typeof isRichFnEntry;
375
- declare const index_isRichSourceEntry: typeof isRichSourceEntry;
376
- declare const index_llmCompose: typeof llmCompose;
377
- declare const index_llmRefine: typeof llmRefine;
378
- declare const index_specDiff: typeof specDiff;
379
- declare const index_validateSpec: typeof validateSpec;
380
- declare const index_validateSpecAgainstCatalog: typeof validateSpecAgainstCatalog;
381
- declare namespace index {
382
- export { type index_CatalogFnEntry as CatalogFnEntry, type index_CatalogSourceEntry as CatalogSourceEntry, type index_CompileSpecOptions as CompileSpecOptions, type index_ConfigFieldSchema as ConfigFieldSchema, type index_FnFactory as FnFactory, type index_GraphFactory as GraphFactory, type index_GraphSpec as GraphSpec, type index_GraphSpecCatalog as GraphSpecCatalog, type index_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, type index_GraphSpecNode as GraphSpecNode, type index_GraphSpecTemplate as GraphSpecTemplate, type index_GraphSpecTemplateRef as GraphSpecTemplateRef, type index_GraphSpecValidation as GraphSpecValidation, type index_LLMComposeOptions as LLMComposeOptions, type index_LLMRefineOptions as LLMRefineOptions, type index_SourceFactory as SourceFactory, type index_SpecDiffEntry as SpecDiffEntry, type index_SpecDiffResult as SpecDiffResult, index_compileSpec as compileSpec, index_decompileSpec as decompileSpec, index_extractFnFactory as extractFnFactory, index_extractSourceFactory as extractSourceFactory, index_generateCatalogPrompt as generateCatalogPrompt, index_isRichFnEntry as isRichFnEntry, index_isRichSourceEntry as isRichSourceEntry, index_llmCompose as llmCompose, index_llmRefine as llmRefine, index_specDiff as specDiff, index_validateSpec as validateSpec, index_validateSpecAgainstCatalog as validateSpecAgainstCatalog };
383
- }
384
-
385
- export { type CatalogFnEntry as C, type FnFactory as F, type GraphSpec as G, type LLMComposeOptions as L, type SourceFactory as S, type CatalogSourceEntry as a, type ConfigFieldSchema as b, type GraphSpecCatalog as c, type GraphSpecFeedbackEdge as d, type GraphSpecNode as e, type GraphSpecTemplate as f, type GraphSpecTemplateRef as g, type GraphSpecValidation as h, index as i, type CompileSpecOptions as j, type GraphFactory as k, type LLMRefineOptions as l, type SpecDiffEntry as m, type SpecDiffResult as n, compileSpec as o, decompileSpec as p, extractFnFactory as q, extractSourceFactory as r, generateCatalogPrompt as s, isRichFnEntry as t, isRichSourceEntry as u, llmCompose as v, llmRefine as w, specDiff as x, validateSpec as y, validateSpecAgainstCatalog as z };
@@ -1,291 +0,0 @@
1
- import { j as CompileSpecOptions, G as GraphSpec, c as GraphSpecCatalog, C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory } from './index-CS0LTlB8.cjs';
2
- import { G as Graph, o as GraphNodeFactory, m as GraphDiffResult } from './graph-CWvEUQAq.cjs';
3
- import { KvStorageTier } from './extra/storage-tiers.cjs';
4
-
5
- /**
6
- * Surface: create a graph from a {@link GraphSpec} (§9.3-core).
7
- *
8
- * Thin wrapper over {@link compileSpec} that converts the two failure modes
9
- * ({@link validateSpec} structural errors, and catalog-aware validation
10
- * errors) into typed {@link SurfaceError} throws. Consumers are MCP/CLI
11
- * wrappers, not end-user graph code — those should import `compileSpec`
12
- * directly.
13
- *
14
- * @module
15
- */
16
-
17
- /** Options for {@link createGraph}. Same shape as {@link CompileSpecOptions}. */
18
- type CreateGraphOptions = CompileSpecOptions;
19
- /**
20
- * Build a {@link Graph} from a parsed {@link GraphSpec} with surface-layer
21
- * error typing.
22
- *
23
- * @throws {SurfaceError} `invalid-spec` for structural errors;
24
- * `catalog-error` when fn/source names or config don't match the catalog.
25
- */
26
- declare function createGraph(spec: GraphSpec, opts?: CreateGraphOptions): Graph;
27
-
28
- /**
29
- * Typed errors for the surface layer (§9.3-core).
30
- *
31
- * The surface layer is consumed by `@graphrefly/mcp-server` and
32
- * `@graphrefly/cli`. Both have native error channels (MCP's `isError` flag,
33
- * CLI's exit codes), so surface functions throw a {@link SurfaceError}
34
- * carrying a structured code + details payload that wrappers can map to
35
- * their native shape. No `Result` envelope — keep the callsite idiom
36
- * `try/catch` and let each wrapper surface the error its own way.
37
- *
38
- * @module
39
- */
40
- /** Structured error codes emitted by the surface layer. JSON-safe. */
41
- type SurfaceErrorCode = "invalid-spec" | "graph-not-found" | "graph-exists" | "snapshot-not-found" | "node-not-found" | "reduce-timeout" | "catalog-error" | "restore-failed" | "snapshot-failed" | "tier-no-list" | "compose-not-configured" | "compose-failed" | "internal-error";
42
- /** JSON-safe shape surfaces should echo back through the wrapper. */
43
- interface SurfaceErrorPayload {
44
- code: SurfaceErrorCode;
45
- message: string;
46
- /** Optional structured detail; must be JSON-safe. */
47
- details?: Readonly<Record<string, unknown>>;
48
- }
49
- /**
50
- * Thrown by surface layer functions on failure. `code` is the stable
51
- * machine-readable identifier; `details` carries structured context
52
- * (e.g. `validateSpec` errors, missing path name). Both fields round-trip
53
- * through `toJSON()` for wrappers that serialize errors over the wire.
54
- */
55
- declare class SurfaceError extends Error {
56
- readonly code: SurfaceErrorCode;
57
- readonly details?: Readonly<Record<string, unknown>>;
58
- constructor(code: SurfaceErrorCode, message: string, details?: Readonly<Record<string, unknown>>);
59
- /**
60
- * JSON-safe payload for wire serialization. Defensively validates
61
- * `details` — if it can't be round-tripped through `JSON.stringify`
62
- * (cyclic refs, `BigInt`, `Error` instance not pre-toJSON'd), the
63
- * payload falls back to `{code, message}` only rather than crashing
64
- * the MCP/CLI wrapper when it serializes this error onto the wire.
65
- */
66
- toJSON(): SurfaceErrorPayload;
67
- }
68
- /** Wrap any thrown value as a SurfaceError. Idempotent on existing SurfaceError. */
69
- declare function asSurfaceError(err: unknown, fallbackCode?: SurfaceErrorCode): SurfaceError;
70
-
71
- /**
72
- * Surface: one-shot `input → pipeline → output` (§9.3-core).
73
- *
74
- * `runReduction` compiles a {@link GraphSpec}, pushes an input value to a
75
- * named state node, awaits the first post-push DATA emission on a named
76
- * output, then disposes the graph. Stateless per call — no graphId, no
77
- * registry.
78
- *
79
- * Named `runReduction` (not `reduce`) to avoid collision with the
80
- * reactive {@link reduce} operator in `extra/operators.ts`. The MCP tool
81
- * name (`graphrefly_reduce`) and CLI subcommand (`graphrefly reduce`) use
82
- * the short form; the library export carries the verb.
83
- *
84
- * The subscribe-before-push ordering is deliberate. `graph.set` propagates
85
- * synchronously for sync derived/operator chains; for async sources
86
- * (`fromPromise`, `fromAsyncIter`, LLM adapters) the first post-push DATA
87
- * arrives on a later tick. Subscribing before the push catches both, and
88
- * skipping the priming push-on-subscribe emission avoids resolving with the
89
- * stale pre-push cache (spec §2.2).
90
- *
91
- * @module
92
- */
93
-
94
- /** Options for {@link reduce}. */
95
- interface ReduceOptions {
96
- /** Fn/source catalog for {@link createGraph}. */
97
- catalog?: GraphSpecCatalog;
98
- /** Path of the state node that receives the input. Default `"input"`. */
99
- inputPath?: string;
100
- /** Path of the node whose first post-push DATA is the result. Default `"output"`. */
101
- outputPath?: string;
102
- /** Hard deadline in milliseconds. Default `30_000`. */
103
- timeoutMs?: number;
104
- }
105
- /**
106
- * Run a spec as a one-shot reduction: `input → graph → output`.
107
- *
108
- * Resolves on the first `[DATA, v]` **or** `[RESOLVED]` emitted by
109
- * `outputPath` after the input push. The RESOLVED path handles spec
110
- * §1.3.3 equals-substitution (output recomputed to a value equal to its
111
- * cache, so the graph skips the DATA push) by returning `outputNode.cache`
112
- * — the caller always gets the settled value, never hangs on idempotent
113
- * inputs.
114
- *
115
- * @throws {SurfaceError} `invalid-spec` / `catalog-error` (propagated from
116
- * {@link createGraph}), `node-not-found` when `inputPath`/`outputPath`
117
- * can't be resolved, `reduce-timeout` when `timeoutMs` elapses without
118
- * a post-push emission, or the ERROR payload from the graph re-thrown
119
- * as `internal-error`.
120
- */
121
- declare function runReduction(spec: GraphSpec, input: unknown, opts?: ReduceOptions): Promise<unknown>;
122
-
123
- /**
124
- * Surface: snapshot save/restore/diff/list over {@link KvStorageTier} (§9.3-core).
125
- *
126
- * One-shot snapshot management for stateless callers (MCP tools, CLI
127
- * commands) layered on the existing multi-tier auto-checkpoint substrate.
128
- * A saved snapshot is a `mode: "full"` {@link GraphCheckpointRecord} with
129
- * `seq: 0` — byte-identical to the baseline anchor
130
- * {@link Graph.attachSnapshotStorage} writes on its first flush. An
131
- * auto-checkpointed graph can therefore be restored through this surface,
132
- * and a surface-saved snapshot can be picked up by `attachSnapshotStorage({
133
- * autoRestore: true })`.
134
- *
135
- * The wire envelope stays at {@link SNAPSHOT_WIRE_VERSION}; no new format.
136
- *
137
- * @module
138
- */
139
-
140
- /**
141
- * Current envelope version. Re-exported from `graph.ts` so the one-shot
142
- * surface path and `Graph.attachSnapshotStorage` write byte-identical
143
- * `format_version` fields — no silent wire drift.
144
- */
145
- declare const SNAPSHOT_WIRE_VERSION = 1;
146
- /** Shape returned by {@link saveSnapshot}. */
147
- interface SaveSnapshotResult {
148
- snapshotId: string;
149
- timestamp_ns: number;
150
- }
151
- /** Options for {@link restoreSnapshot}. */
152
- interface RestoreSnapshotOptions {
153
- /** Passthrough to `Graph.fromSnapshot`. First matching pattern wins. */
154
- factories?: Record<string, GraphNodeFactory>;
155
- }
156
- /**
157
- * Write a graph's current state as a one-shot `mode: "full"` record.
158
- *
159
- * Uses the same {@link GraphCheckpointRecord} envelope as
160
- * {@link Graph.attachSnapshotStorage} so the two persistence paths interoperate.
161
- *
162
- * @throws {SurfaceError} `snapshot-failed` when the tier's `save` throws.
163
- */
164
- declare function saveSnapshot(graph: Graph, snapshotId: string, tier: KvStorageTier): Promise<SaveSnapshotResult>;
165
- /**
166
- * Load a snapshot from a tier and materialize it as a new {@link Graph}.
167
- *
168
- * Uses {@link Graph.fromSnapshot} to reconstruct topology; pass
169
- * `factories` when the graph includes non-state nodes that the default
170
- * hydrator can't rebuild on its own.
171
- *
172
- * **Requires a `mode: "full"` record.** Surface-written snapshots from
173
- * {@link saveSnapshot} always qualify. Records written by
174
- * {@link Graph.attachSnapshotStorage} with `compactEvery > 1` may be
175
- * `mode: "diff"` between compacts — those throw `restore-failed` until
176
- * the tier's next compact flush (or until Phase 8.7 WAL replay lands).
177
- * If you need interop during development, either call
178
- * {@link saveSnapshot} explicitly (always full) or configure
179
- * `attachSnapshotStorage({compactEvery: 1})`.
180
- *
181
- * @throws {SurfaceError} `snapshot-not-found` on miss; `restore-failed`
182
- * when the payload shape doesn't match, when the record is
183
- * `mode: "diff"`, or when `Graph.fromSnapshot` rejects.
184
- */
185
- declare function restoreSnapshot(snapshotId: string, tier: KvStorageTier, opts?: RestoreSnapshotOptions): Promise<Graph>;
186
- /**
187
- * Load two snapshots and compute a {@link GraphDiffResult} via static
188
- * {@link Graph.diff}. Returns the audit shape (structural + value diff,
189
- * no payload); use {@link diffForWAL} directly for WAL-oriented diffs.
190
- *
191
- * @throws {SurfaceError} `snapshot-not-found` on either miss.
192
- */
193
- declare function diffSnapshots(snapshotIdA: string, snapshotIdB: string, tier: KvStorageTier): Promise<GraphDiffResult>;
194
- /**
195
- * Enumerate snapshot ids on a tier.
196
- *
197
- * Only keys written by {@link saveSnapshot} are returned. Surface-written
198
- * records are stored under the `"snapshot:"` key prefix and decoded back to
199
- * the caller-visible id before being returned — other keys on the same tier
200
- * (notably `attachSnapshotStorage` baseline/WAL keys written under `graph.name`) are
201
- * filtered out automatically. This lets a single tier back both the surface
202
- * and `attachSnapshotStorage` without leaking graph names through `listSnapshots`.
203
- *
204
- * @param tier — the storage tier to enumerate.
205
- * @param opts.includeUnprefixed — when `true`, also return keys that are
206
- * NOT under the namespacing prefix. Off by default; set this when reading
207
- * pre-namespacing snapshot sets.
208
- *
209
- * **Caveat:** when a tier is shared with {@link Graph.attachSnapshotStorage}, its
210
- * auto-checkpoint baseline + WAL keys (written under `graph.name`) are
211
- * unprefixed. Calling with `includeUnprefixed: true` returns those keys
212
- * alongside surface snapshots — and subsequent `restoreSnapshot` /
213
- * `deleteSnapshot` will operate on them via the fallback-lookup path,
214
- * potentially overwriting or deleting live auto-checkpoint state. Use
215
- * `includeUnprefixed` only against tiers you know are NOT shared with
216
- * `attachSnapshotStorage`, or follow up with a predicate filter to separate
217
- * ids you own from ones owned by other subsystems.
218
- *
219
- * @throws {SurfaceError} `tier-no-list` when the tier does not implement
220
- * the optional `list()` method. Check `typeof tier.list === "function"`
221
- * before calling if you want to branch on capability.
222
- */
223
- declare function listSnapshots(tier: KvStorageTier, opts?: {
224
- includeUnprefixed?: boolean;
225
- }): Promise<readonly string[]>;
226
- /**
227
- * Delete a snapshot from a tier.
228
- *
229
- * Silent on miss (clear semantics). `tier.clear` is optional — throws
230
- * `snapshot-failed` when the tier is append-only.
231
- *
232
- * @throws {SurfaceError} `snapshot-failed` when `clear` is unsupported
233
- * or throws.
234
- */
235
- declare function deleteSnapshot(snapshotId: string, tier: KvStorageTier): Promise<void>;
236
-
237
- /**
238
- * Surface layer (§9.3-core) — shared, JSON-safe operations consumed by
239
- * `@graphrefly/mcp-server` and `@graphrefly/cli`.
240
- *
241
- * The surface is a thin projection of existing Graph APIs (`describe`,
242
- * `observe`, `explain`, `snapshot`, `restore`, static `diff`), plus two
243
- * genuinely new operations:
244
- *
245
- * 1. {@link createGraph} — `compileSpec` wrapped with typed surface errors.
246
- * 2. {@link reduce} — one-shot `input → pipeline → output`.
247
- *
248
- * Snapshot persistence reuses the {@link KvStorageTier} substrate introduced
249
- * for `Graph.attachSnapshotStorage`, so one-shot snapshots and auto-checkpoints
250
- * share the {@link GraphCheckpointRecord} envelope. No new wire format.
251
- *
252
- * Errors throw as {@link SurfaceError} — wrappers map to their native
253
- * error channel (MCP `isError`, CLI exit code). No `Result<T, E>` wrapper.
254
- *
255
- * @module
256
- */
257
-
258
- declare const index_CatalogFnEntry: typeof CatalogFnEntry;
259
- declare const index_CatalogSourceEntry: typeof CatalogSourceEntry;
260
- declare const index_ConfigFieldSchema: typeof ConfigFieldSchema;
261
- type index_CreateGraphOptions = CreateGraphOptions;
262
- declare const index_FnFactory: typeof FnFactory;
263
- declare const index_GraphSpec: typeof GraphSpec;
264
- declare const index_GraphSpecCatalog: typeof GraphSpecCatalog;
265
- declare const index_GraphSpecFeedbackEdge: typeof GraphSpecFeedbackEdge;
266
- declare const index_GraphSpecNode: typeof GraphSpecNode;
267
- declare const index_GraphSpecTemplate: typeof GraphSpecTemplate;
268
- declare const index_GraphSpecTemplateRef: typeof GraphSpecTemplateRef;
269
- declare const index_GraphSpecValidation: typeof GraphSpecValidation;
270
- type index_ReduceOptions = ReduceOptions;
271
- type index_RestoreSnapshotOptions = RestoreSnapshotOptions;
272
- declare const index_SNAPSHOT_WIRE_VERSION: typeof SNAPSHOT_WIRE_VERSION;
273
- type index_SaveSnapshotResult = SaveSnapshotResult;
274
- declare const index_SourceFactory: typeof SourceFactory;
275
- type index_SurfaceError = SurfaceError;
276
- declare const index_SurfaceError: typeof SurfaceError;
277
- type index_SurfaceErrorCode = SurfaceErrorCode;
278
- type index_SurfaceErrorPayload = SurfaceErrorPayload;
279
- declare const index_asSurfaceError: typeof asSurfaceError;
280
- declare const index_createGraph: typeof createGraph;
281
- declare const index_deleteSnapshot: typeof deleteSnapshot;
282
- declare const index_diffSnapshots: typeof diffSnapshots;
283
- declare const index_listSnapshots: typeof listSnapshots;
284
- declare const index_restoreSnapshot: typeof restoreSnapshot;
285
- declare const index_runReduction: typeof runReduction;
286
- declare const index_saveSnapshot: typeof saveSnapshot;
287
- declare namespace index {
288
- export { index_CatalogFnEntry as CatalogFnEntry, index_CatalogSourceEntry as CatalogSourceEntry, index_ConfigFieldSchema as ConfigFieldSchema, type index_CreateGraphOptions as CreateGraphOptions, index_FnFactory as FnFactory, index_GraphSpec as GraphSpec, index_GraphSpecCatalog as GraphSpecCatalog, index_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, index_GraphSpecNode as GraphSpecNode, index_GraphSpecTemplate as GraphSpecTemplate, index_GraphSpecTemplateRef as GraphSpecTemplateRef, index_GraphSpecValidation as GraphSpecValidation, type index_ReduceOptions as ReduceOptions, type index_RestoreSnapshotOptions as RestoreSnapshotOptions, index_SNAPSHOT_WIRE_VERSION as SNAPSHOT_WIRE_VERSION, type index_SaveSnapshotResult as SaveSnapshotResult, index_SourceFactory as SourceFactory, index_SurfaceError as SurfaceError, type index_SurfaceErrorCode as SurfaceErrorCode, type index_SurfaceErrorPayload as SurfaceErrorPayload, index_asSurfaceError as asSurfaceError, index_createGraph as createGraph, index_deleteSnapshot as deleteSnapshot, index_diffSnapshots as diffSnapshots, index_listSnapshots as listSnapshots, index_restoreSnapshot as restoreSnapshot, index_runReduction as runReduction, index_saveSnapshot as saveSnapshot };
289
- }
290
-
291
- export { type CreateGraphOptions as C, type ReduceOptions as R, SNAPSHOT_WIRE_VERSION as S, type RestoreSnapshotOptions as a, type SaveSnapshotResult as b, SurfaceError as c, type SurfaceErrorCode as d, type SurfaceErrorPayload as e, asSurfaceError as f, createGraph as g, deleteSnapshot as h, diffSnapshots as i, runReduction as j, index as k, listSnapshots as l, restoreSnapshot as r, saveSnapshot as s };