@graphrefly/graphrefly 0.43.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 (422) 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 -4
  59. package/dist/core/index.d.ts +1 -4
  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 -950
  83. package/dist/extra/operators.d.ts +1 -950
  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 -96
  155. package/dist/index.d.ts +45 -96
  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 -21
  167. package/dist/patterns/ai/index.d.ts +1 -21
  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 -14
  203. package/dist/patterns/harness/index.d.ts +1 -14
  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 -9
  233. package/dist/patterns/orchestration/index.d.ts +1 -9
  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 -1
  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-CH-_VwG9.d.cts +0 -199
  275. package/dist/cascading-OgKQZjsa.d.ts +0 -199
  276. package/dist/chunk-35JTVPOX.js +0 -1
  277. package/dist/chunk-3G5U5QNE.js +0 -5
  278. package/dist/chunk-3XDYJRYU.js +0 -1
  279. package/dist/chunk-4I45FVQS.js +0 -1
  280. package/dist/chunk-4VVTGLXJ.js +0 -1
  281. package/dist/chunk-4YAN45KM.js +0 -1
  282. package/dist/chunk-5QDBSZBV.js +0 -1
  283. package/dist/chunk-626TESAC.js +0 -3
  284. package/dist/chunk-6HOSXQKF.js +0 -1
  285. package/dist/chunk-6QZNQS5B.js +0 -1
  286. package/dist/chunk-C72GO4IZ.js +0 -1
  287. package/dist/chunk-CE72X3WO.js +0 -1
  288. package/dist/chunk-CK2E7BTU.js +0 -1
  289. package/dist/chunk-CLD3F4R5.js +0 -1
  290. package/dist/chunk-CUNIRONA.js +0 -1
  291. package/dist/chunk-D27JNOLZ.js +0 -1
  292. package/dist/chunk-D5RFJOZ2.js +0 -1
  293. package/dist/chunk-EBW4V6JN.js +0 -1
  294. package/dist/chunk-ESMPEKEV.js +0 -1
  295. package/dist/chunk-F3IGTWCQ.js +0 -1
  296. package/dist/chunk-F672GV32.js +0 -1
  297. package/dist/chunk-FDQGFWLF.js +0 -1
  298. package/dist/chunk-FG4TKHMC.js +0 -1
  299. package/dist/chunk-GPW2V3RE.js +0 -1
  300. package/dist/chunk-I7IGYPSL.js +0 -1
  301. package/dist/chunk-INQD2KRQ.js +0 -1
  302. package/dist/chunk-JNWRYDJN.js +0 -1
  303. package/dist/chunk-JQFH2DV6.js +0 -1
  304. package/dist/chunk-K2Q24F5T.js +0 -1
  305. package/dist/chunk-KGKJCHEK.js +0 -1
  306. package/dist/chunk-KRH66M4O.js +0 -1
  307. package/dist/chunk-KVV66NN2.js +0 -1
  308. package/dist/chunk-L6NSJVJZ.js +0 -1
  309. package/dist/chunk-LYCLF26R.js +0 -1
  310. package/dist/chunk-NNKJUORL.js +0 -1
  311. package/dist/chunk-NON4NLIC.js +0 -45
  312. package/dist/chunk-O2BLLH7M.js +0 -18
  313. package/dist/chunk-OCKEEPRJ.js +0 -2
  314. package/dist/chunk-OFZG3TB3.js +0 -9
  315. package/dist/chunk-OYJKFY7V.js +0 -1
  316. package/dist/chunk-P6C4WHZO.js +0 -5
  317. package/dist/chunk-PT7W5FCD.js +0 -5
  318. package/dist/chunk-Q4U3A3L5.js +0 -1
  319. package/dist/chunk-QE4IGY7I.js +0 -61
  320. package/dist/chunk-QYADASLV.js +0 -1
  321. package/dist/chunk-QYVXF7GW.js +0 -1
  322. package/dist/chunk-S3EEIPO7.js +0 -1
  323. package/dist/chunk-SUWT3ZON.js +0 -1
  324. package/dist/chunk-TPKQW72B.js +0 -1
  325. package/dist/chunk-TSOYJ743.js +0 -1
  326. package/dist/chunk-TZQPPQEQ.js +0 -1
  327. package/dist/chunk-V5A7M7RJ.js +0 -1
  328. package/dist/chunk-VIMF6LGM.js +0 -1
  329. package/dist/chunk-VJLMUKOI.js +0 -1
  330. package/dist/chunk-VN6RDSK2.js +0 -1
  331. package/dist/chunk-VNC3TMVY.js +0 -1
  332. package/dist/chunk-VOPGGIL7.js +0 -1
  333. package/dist/chunk-VQ4A6T2A.js +0 -1
  334. package/dist/chunk-XG62INFA.js +0 -1
  335. package/dist/chunk-Y4NI3X7O.js +0 -84
  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-2ZukgQ4o.d.cts +0 -112
  339. package/dist/decay-CdEBmDIs.d.ts +0 -112
  340. package/dist/fallback-CqYVLL6X.d.ts +0 -250
  341. package/dist/fallback-Ctlj2tMY.d.cts +0 -250
  342. package/dist/graph-7VguS7a4.d.ts +0 -1668
  343. package/dist/graph-C4SHb3Ly.d.cts +0 -1668
  344. package/dist/index-0rKFCVFp.d.cts +0 -557
  345. package/dist/index-B-i4_g3k.d.ts +0 -651
  346. package/dist/index-B5iz82A3.d.cts +0 -2655
  347. package/dist/index-BAOD98JD.d.cts +0 -754
  348. package/dist/index-BG0BN3PB.d.ts +0 -44
  349. package/dist/index-BJX94aud.d.cts +0 -34
  350. package/dist/index-BP8a88zx.d.ts +0 -385
  351. package/dist/index-BTQtTb_H.d.cts +0 -301
  352. package/dist/index-BVpm6noz.d.cts +0 -36
  353. package/dist/index-Bc41FuHp.d.cts +0 -291
  354. package/dist/index-BdGtBX-X.d.cts +0 -515
  355. package/dist/index-Bf7eqeSF.d.ts +0 -113
  356. package/dist/index-BiX1Nkgx.d.cts +0 -1844
  357. package/dist/index-BoLv_OfD.d.cts +0 -651
  358. package/dist/index-BojK2fwH.d.cts +0 -299
  359. package/dist/index-BsT7F2et.d.ts +0 -291
  360. package/dist/index-BwLvVVsy.d.cts +0 -189
  361. package/dist/index-C59mYFKp.d.ts +0 -121
  362. package/dist/index-C7O6r5fV.d.ts +0 -37
  363. package/dist/index-C9kSENB4.d.cts +0 -127
  364. package/dist/index-C9pjcz3l.d.cts +0 -209
  365. package/dist/index-CAC_rNzm.d.ts +0 -189
  366. package/dist/index-CCq87F7t.d.ts +0 -127
  367. package/dist/index-CDXc9zKM.d.cts +0 -26
  368. package/dist/index-CJK1JkYy.d.ts +0 -36
  369. package/dist/index-CLon-IWF.d.cts +0 -374
  370. package/dist/index-COD1kVoS.d.cts +0 -468
  371. package/dist/index-CPT7C_f1.d.ts +0 -374
  372. package/dist/index-CQG3D1cp.d.ts +0 -468
  373. package/dist/index-CZQXo5tH.d.ts +0 -209
  374. package/dist/index-CZjOhcBy.d.cts +0 -113
  375. package/dist/index-ChOyVLKm.d.cts +0 -86
  376. package/dist/index-CvrqGfNS.d.ts +0 -34
  377. package/dist/index-D-AEQVLo.d.ts +0 -2655
  378. package/dist/index-D4Y1cMG0.d.ts +0 -26
  379. package/dist/index-DBHK8O6H.d.ts +0 -301
  380. package/dist/index-DBevwHj_.d.ts +0 -515
  381. package/dist/index-DIOoAZUX.d.ts +0 -45
  382. package/dist/index-DSZ3ZCHF.d.ts +0 -3402
  383. package/dist/index-Dgs8zcj7.d.ts +0 -102
  384. package/dist/index-Dh_HJ82K.d.ts +0 -299
  385. package/dist/index-Dhc7a7Xo.d.cts +0 -102
  386. package/dist/index-Dmqp7KjD.d.ts +0 -86
  387. package/dist/index-Dn-wI9g4.d.ts +0 -231
  388. package/dist/index-Du7u1lSf.d.cts +0 -385
  389. package/dist/index-DwigL4lY.d.ts +0 -1844
  390. package/dist/index-DyR7eU5S.d.cts +0 -779
  391. package/dist/index-JZUPJIJy.d.ts +0 -779
  392. package/dist/index-K0_0eR8g.d.ts +0 -557
  393. package/dist/index-O16yXPK4.d.cts +0 -3402
  394. package/dist/index-O7fucFrU.d.cts +0 -121
  395. package/dist/index-RV_yDjOX.d.cts +0 -198
  396. package/dist/index-cm1GNcWE.d.ts +0 -754
  397. package/dist/index-f5IivDUX.d.cts +0 -37
  398. package/dist/index-hHcaFlJX.d.cts +0 -45
  399. package/dist/index-tJoTcnHh.d.cts +0 -231
  400. package/dist/index-wAzD9yVj.d.ts +0 -198
  401. package/dist/index-z96luz5O.d.cts +0 -44
  402. package/dist/meta-BgVAsg9j.d.ts +0 -102
  403. package/dist/meta-vE8bxW1E.d.cts +0 -102
  404. package/dist/node-ClS5yC-B.d.cts +0 -1347
  405. package/dist/node-ClS5yC-B.d.ts +0 -1347
  406. package/dist/observable-BsBzUrcI.d.ts +0 -36
  407. package/dist/observable-DLGPPtb8.d.cts +0 -36
  408. package/dist/pipeline-graph-DPqKDk59.d.cts +0 -137
  409. package/dist/pipeline-graph-loP57TBA.d.ts +0 -137
  410. package/dist/reactive-layout-Dsvob4zD.d.cts +0 -183
  411. package/dist/reactive-layout-v7KPvxoc.d.ts +0 -183
  412. package/dist/reactive-log-B00laMSQ.d.cts +0 -223
  413. package/dist/reactive-log-BezYsbA_.d.ts +0 -223
  414. package/dist/reactive-map-48mnZ-nu.d.cts +0 -296
  415. package/dist/reactive-map-BVVPdvmi.d.ts +0 -296
  416. package/dist/resilience-YIWPK4YC.js +0 -1
  417. package/dist/sugar-DLwvMr3F.d.ts +0 -223
  418. package/dist/sugar-DyVGtczU.d.cts +0 -223
  419. package/dist/topology-tree-BNGvuG82.d.ts +0 -25
  420. package/dist/topology-tree-BSdfSwMi.d.cts +0 -25
  421. package/dist/types-B1jDWVsM.d.cts +0 -442
  422. package/dist/types-DkzUUs0H.d.ts +0 -442
@@ -1,301 +0,0 @@
1
- import { N as Node } from './node-ClS5yC-B.cjs';
2
- import { G as Graph, a as GraphOptions } from './graph-C4SHb3Ly.cjs';
3
- import { a as ReactiveLogBundle } from './reactive-log-B00laMSQ.cjs';
4
- import { AppendLogStorageTier } from './extra/storage-tiers.cjs';
5
-
6
- type TopicOptions = {
7
- graph?: GraphOptions;
8
- /** Bounded retention; default 1024 per cross-cutting policy (Audit 2/4). */
9
- retainedLimit?: number;
10
- };
11
- declare class TopicGraph<T> extends Graph {
12
- private readonly _log;
13
- private readonly _publishImpl;
14
- readonly events: Node<readonly T[]>;
15
- /**
16
- * Most recently published value, or `null` when the topic has no entries
17
- * yet. Spec §5.12 reserves `undefined` as the protocol-internal "never
18
- * sent DATA" sentinel — `null` is the idiomatic "empty / no value" signal
19
- * for domain nodes. F7.
20
- *
21
- * **Caveat when `T` itself includes `null`** (e.g., `topic<number | null>`):
22
- * `latest === null` is ambiguous — it could mean "no publish yet" OR "a
23
- * `null` value was published". Use {@link hasLatest} to disambiguate, or
24
- * observe {@link events} directly and track length yourself.
25
- */
26
- readonly latest: Node<T | null>;
27
- /**
28
- * Reactive `true` once the topic has at least one published entry.
29
- * Disambiguates "`null` never published" from "`null` was published" when
30
- * `T` includes `null`.
31
- */
32
- readonly hasLatest: Node<boolean>;
33
- constructor(name: string, opts?: TopicOptions);
34
- publish(value: T): void;
35
- /**
36
- * Wire one or more append-log storage tiers (Audit 4). Each tier receives
37
- * appended events per wave; rollback honors the wave-as-transaction model.
38
- *
39
- * Named `attachEventStorage` (not `attachStorage`) to avoid colliding with
40
- * the inherited {@link Graph.attachSnapshotStorage} which takes the
41
- * snapshot-based `StorageTier[]` shape.
42
- *
43
- * @returns Disposer.
44
- */
45
- attachEventStorage(tiers: readonly AppendLogStorageTier<T>[]): () => void;
46
- retained(): readonly T[];
47
- /** Internal log bundle — used by TopicBridgeGraph for `attach`. */
48
- get _logBundle(): ReactiveLogBundle<T>;
49
- }
50
- type SubscriptionOptions = {
51
- graph?: GraphOptions;
52
- /**
53
- * Starting cursor position.
54
- * @deprecated Use `from` instead.
55
- */
56
- cursor?: number;
57
- /**
58
- * Starting position for the subscription.
59
- * - `"retained"` (default) — cursor starts at 0; consumer sees all retained history.
60
- * - `"now"` — cursor starts at current topic length; consumer ignores history.
61
- * - `number` — explicit cursor position.
62
- */
63
- from?: "now" | "retained" | number;
64
- /**
65
- * When this signal node emits DATA, the subscription auto-advances cursor
66
- * to current `available.length`. Useful for "ack everything when X happens"
67
- * patterns. The reactive edge `advanceOn → cursor` is visible in `explain()`.
68
- */
69
- advanceOn?: Node<unknown>;
70
- };
71
- /** Result of {@link SubscriptionGraph.pullAndAck}. */
72
- type PullAndAckResult<T> = {
73
- items: readonly T[];
74
- cursor: number;
75
- };
76
- declare class SubscriptionGraph<T> extends Graph {
77
- readonly cursor: Node<number>;
78
- readonly available: Node<readonly T[]>;
79
- /**
80
- * Reference to the upstream topic graph. Intentionally NOT mounted
81
- * under this subscription: a subscription is a VIEW over an
82
- * externally-owned topic. Double-mounting (e.g. hub-owned topic +
83
- * sub-mount here) would make either-side teardown leave the other
84
- * holding a dead reference. Node-level `derived([topicEvents], …)`
85
- * still wires the data dependency across graph boundaries. D1(e).
86
- */
87
- readonly topic: TopicGraph<T>;
88
- private _disposed;
89
- private readonly _ackImpl;
90
- private readonly _pullAndAckImpl;
91
- constructor(name: string, topicGraph: TopicGraph<T>, opts?: SubscriptionOptions);
92
- ack(count?: number): number;
93
- pull(limit?: number): readonly T[];
94
- /**
95
- * Atomic pull-and-acknowledge. Returns `{ items, cursor }` where `cursor`
96
- * is the new cursor position after advancing. Under single-threaded JS the
97
- * snapshot and advance are atomic; PY callers use a per-subscription Lock.
98
- *
99
- * Replaces `pull(limit, { ack: true })`.
100
- */
101
- pullAndAck(limit?: number): PullAndAckResult<T>;
102
- /**
103
- * Release internal subscriptions and mark the subscription torn-down.
104
- * Subsequent `pull`, `pullAndAck`, `ack` return empty / current cursor.
105
- * Emits COMPLETE on `cursor` so derived consumers (e.g. `available`) see
106
- * the termination signal. Also drains `addDisposer` callbacks (including
107
- * the `keepalive(advancePump)` subscription) so no keepalive leak occurs.
108
- */
109
- dispose(): void;
110
- }
111
- type TopicBridgeOptions<TIn, TOut> = {
112
- graph?: GraphOptions;
113
- cursor?: number;
114
- maxPerPump?: number;
115
- /**
116
- * Optional transform/filter applied to each item before republishing.
117
- *
118
- * **At-most-once with silent drop:** when `map` returns `undefined`, the
119
- * input is consumed from the source cursor but NOT republished. Filtered
120
- * items are not retained for retry. If you need filter-with-retry
121
- * semantics, do the filtering in a downstream subscription on the bridged
122
- * output rather than in the `map` function.
123
- */
124
- map?: (value: TIn) => TOut | undefined;
125
- };
126
- declare class TopicBridgeGraph<TIn, TOut = TIn> extends Graph {
127
- private readonly _sourceSub;
128
- readonly bridgedCount: Node<number>;
129
- /**
130
- * Emits each mapped batch as DATA — gives downstream observers a reactive
131
- * stream of bridged values. Also the link target for `target._log.attach`.
132
- */
133
- readonly output: Node<readonly TOut[]>;
134
- constructor(name: string, sourceTopic: TopicGraph<TIn>, targetTopic: TopicGraph<TOut>, opts?: TopicBridgeOptions<TIn, TOut>);
135
- }
136
- /**
137
- * Private pure data structure managing a named set of {@link TopicGraph}
138
- * instances. Extracted from {@link MessagingHubGraph} for separation of
139
- * concerns (B.2 Unit 14 lock: D — split into TopicRegistry + facade).
140
- *
141
- * Reusable if other domain consumers (e.g. cqrs.eventLogs) want a shared
142
- * topic registry later.
143
- *
144
- * @internal
145
- */
146
- declare class TopicRegistry {
147
- private readonly _map;
148
- /** Reactive monotonic version counter. Advances on topic create/remove. */
149
- readonly version: Node<number>;
150
- constructor(versionNode: Node<number>);
151
- get size(): number;
152
- has(name: string): boolean;
153
- get<T>(name: string): TopicGraph<T> | undefined;
154
- set<T>(name: string, t: TopicGraph<T>): void;
155
- delete(name: string): boolean;
156
- keys(): IterableIterator<string>;
157
- }
158
- type MessagingHubOptions = {
159
- graph?: GraphOptions;
160
- /**
161
- * Default `TopicOptions` applied to every topic created via `topic(name)`
162
- * without explicit options. Per-call opts override. Default: `{}`
163
- * (unbounded retention per topic unless `retainedLimit` is set per call).
164
- */
165
- defaultTopicOptions?: TopicOptions;
166
- };
167
- /**
168
- * Lazy Pulsar-inspired topic registry. Manages a named set of {@link TopicGraph}
169
- * instances with retention + cursor semantics. Topics are created on first
170
- * access; `removeTopic(name)` unmounts and tears down via {@link Graph.remove}.
171
- *
172
- * Internally delegates to {@link TopicRegistry} for topic map management
173
- * (B.2 Unit 14 lock: D facade split).
174
- *
175
- * **Relationship to `pubsub()` in `src/extra/pubsub.ts`:** `pubsub` is a
176
- * lightweight last-value state hub (no retention, no cursors). `MessagingHubGraph`
177
- * is the full messaging hub — retained message logs, cursor-based subscriptions,
178
- * and pattern-layer lifecycle management.
179
- *
180
- * @category patterns
181
- */
182
- declare class MessagingHubGraph extends Graph {
183
- private readonly _registry;
184
- /** Reactive monotonic version counter — advances on topic create/remove. */
185
- readonly version: Node<number>;
186
- private readonly _defaultTopicOptions;
187
- private readonly _removeTopicImpl;
188
- constructor(name: string, opts?: MessagingHubOptions);
189
- /** Number of topics currently in the hub. */
190
- get size(): number;
191
- /** Checks topic existence without creating. */
192
- has(name: string): boolean;
193
- /** Iterator over topic names. */
194
- topicNames(): IterableIterator<string>;
195
- /**
196
- * Returns the {@link TopicGraph} for `name`, creating lazily on first call.
197
- * Subsequent calls with the same name return the same instance (options on
198
- * repeat calls are ignored — the topic is already configured).
199
- */
200
- topic<T = unknown>(name: string, opts?: TopicOptions): TopicGraph<T>;
201
- /**
202
- * Publishes a value to the topic, lazily creating it on first publish.
203
- *
204
- * **Late-subscriber caveat:** the topic is created lazily, so subscribers
205
- * that attach AFTER a publish only see the retained window (governed by
206
- * `retainedLimit` on `TopicOptions` / `defaultTopicOptions`). If
207
- * `retainedLimit === 0` is set explicitly, early publishes are
208
- * effectively dropped — prefer an unset `retainedLimit` (unbounded
209
- * retention) or subscribe before publishing when late-subscribers matter.
210
- */
211
- publish<T = unknown>(name: string, value: T): void;
212
- /**
213
- * Bulk publish — issues all publishes inside one outer batch. New topics
214
- * are created on demand. No-op if `entries` yields nothing.
215
- *
216
- * **Iterable consumption (F6):** `entries` is consumed once (single-pass)
217
- * INSIDE the batch frame. If the iterator throws mid-way, the batch is
218
- * discarded and NO publishes are visible to subscribers (all-or-nothing).
219
- * Pass an array or `Set` for multi-shot callers.
220
- */
221
- publishMany(entries: Iterable<[string, unknown]>): void;
222
- /**
223
- * Creates a {@link SubscriptionGraph} over a named topic. The topic is
224
- * lazily created if missing. Subscription lifecycle is owned by the caller —
225
- * the hub does NOT mount the subscription.
226
- *
227
- * @param subName - Local name for the subscription graph.
228
- * @param topicName - Hub topic to subscribe to.
229
- * @param opts - `SubscriptionOptions` (initial cursor, etc.).
230
- */
231
- subscribe<T = unknown>(subName: string, topicName: string, opts?: SubscriptionOptions): SubscriptionGraph<T>;
232
- /**
233
- * Unmounts and tears down the topic's graph. Returns `true` if the topic
234
- * existed. Subscribers receive `TEARDOWN` via {@link Graph.remove}.
235
- *
236
- * **Closure-state caveat:** the registry mutation (`_registry.delete`) and
237
- * version bump happen in a `try/finally`, so registry/version converge to
238
- * a consistent state even when {@link Graph.remove} throws. `lightMutation`
239
- * does not roll back this mutation on throw — `Map.delete` on closure
240
- * state is invisible to any batch frame. The pre-existing try/finally is
241
- * load-bearing for that invariant.
242
- */
243
- removeTopic(name: string): boolean;
244
- }
245
- /**
246
- * Creates a Pulsar-inspired topic graph (append-only retained stream + latest value).
247
- */
248
- declare function topic<T>(name: string, opts?: TopicOptions): TopicGraph<T>;
249
- /**
250
- * Creates a lazy Pulsar-inspired messaging hub. Topics are created on first access
251
- * via `hub.topic(name)`; `hub.publish(name, value)` shortcuts through the registry.
252
- *
253
- * @example
254
- * ```ts
255
- * import { messagingHub } from "@graphrefly/graphrefly/patterns/messaging";
256
- *
257
- * const hub = messagingHub("main", { defaultTopicOptions: { retainedLimit: 256 } });
258
- * hub.publish("orders", { id: 1 });
259
- * hub.publishMany([["shipments", { id: 1 }], ["orders", { id: 2 }]]);
260
- * const sub = hub.subscribe("orders-worker", "orders", { cursor: 0 });
261
- * ```
262
- */
263
- declare function messagingHub(name: string, opts?: MessagingHubOptions): MessagingHubGraph;
264
- /**
265
- * Creates a cursor-based subscription graph over a topic.
266
- */
267
- declare function subscription<T>(name: string, topicGraph: TopicGraph<T>, opts?: SubscriptionOptions): SubscriptionGraph<T>;
268
- /**
269
- * Creates an autonomous cursor-based topic relay graph.
270
- *
271
- * When `opts.map` is provided, items where `map` returns `undefined` are
272
- * consumed from the source cursor but NOT republished (at-most-once with
273
- * silent drop). For filter-with-retry semantics, apply the filter in a
274
- * downstream subscription on the bridge's `output` node instead.
275
- */
276
- declare function topicBridge<TIn, TOut = TIn>(name: string, sourceTopic: TopicGraph<TIn>, targetTopic: TopicGraph<TOut>, opts?: TopicBridgeOptions<TIn, TOut>): TopicBridgeGraph<TIn, TOut>;
277
-
278
- type index_MessagingHubGraph = MessagingHubGraph;
279
- declare const index_MessagingHubGraph: typeof MessagingHubGraph;
280
- type index_MessagingHubOptions = MessagingHubOptions;
281
- type index_PullAndAckResult<T> = PullAndAckResult<T>;
282
- type index_SubscriptionGraph<T> = SubscriptionGraph<T>;
283
- declare const index_SubscriptionGraph: typeof SubscriptionGraph;
284
- type index_SubscriptionOptions = SubscriptionOptions;
285
- type index_TopicBridgeGraph<TIn, TOut = TIn> = TopicBridgeGraph<TIn, TOut>;
286
- declare const index_TopicBridgeGraph: typeof TopicBridgeGraph;
287
- type index_TopicBridgeOptions<TIn, TOut> = TopicBridgeOptions<TIn, TOut>;
288
- type index_TopicGraph<T> = TopicGraph<T>;
289
- declare const index_TopicGraph: typeof TopicGraph;
290
- type index_TopicOptions = TopicOptions;
291
- type index_TopicRegistry = TopicRegistry;
292
- declare const index_TopicRegistry: typeof TopicRegistry;
293
- declare const index_messagingHub: typeof messagingHub;
294
- declare const index_subscription: typeof subscription;
295
- declare const index_topic: typeof topic;
296
- declare const index_topicBridge: typeof topicBridge;
297
- declare namespace index {
298
- export { index_MessagingHubGraph as MessagingHubGraph, type index_MessagingHubOptions as MessagingHubOptions, type index_PullAndAckResult as PullAndAckResult, index_SubscriptionGraph as SubscriptionGraph, type index_SubscriptionOptions as SubscriptionOptions, index_TopicBridgeGraph as TopicBridgeGraph, type index_TopicBridgeOptions as TopicBridgeOptions, index_TopicGraph as TopicGraph, type index_TopicOptions as TopicOptions, index_TopicRegistry as TopicRegistry, index_messagingHub as messagingHub, index_subscription as subscription, index_topic as topic, index_topicBridge as topicBridge };
299
- }
300
-
301
- export { MessagingHubGraph as M, type PullAndAckResult as P, SubscriptionGraph as S, TopicGraph as T, type MessagingHubOptions as a, type SubscriptionOptions as b, TopicBridgeGraph as c, type TopicBridgeOptions as d, type TopicOptions as e, TopicRegistry as f, topicBridge as g, index as i, messagingHub as m, subscription as s, topic as t };
@@ -1,36 +0,0 @@
1
- import { N as Node } from './node-ClS5yC-B.cjs';
2
-
3
- /** Solid accessor function — returns current value when called. */
4
- type Accessor<T> = () => T;
5
- /**
6
- * Subscribe to a `Node<T>` as a Solid signal. Auto-cleans up with the owning scope.
7
- * Subscription lifecycle is tied to Solid scope cleanup (not node terminal messages).
8
- */
9
- declare function useSubscribe<T>(node: Node<T>): Accessor<T | undefined | null>;
10
- /**
11
- * Bind a writable `Node<T>` as a Solid resource tuple `[accessor, setter]`.
12
- * Setter always forwards `[[DIRTY], [DATA, value]]`, including `value === undefined`.
13
- * Subscription lifecycle is tied to Solid scope cleanup (not node terminal messages).
14
- */
15
- declare function useStore<T>(node: Node<T>): [Accessor<T | undefined | null>, (v: T) => void];
16
- /** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */
17
- type NodeFactory<K, R extends Record<string, any>> = (key: K) => {
18
- [P in keyof R]: Node<R[P]>;
19
- };
20
- /**
21
- * Subscribe to a dynamic set of keyed node records as a Solid accessor.
22
- * Re-subscribes all per-key fields whenever `keys` changes.
23
- * Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.
24
- */
25
- declare function useSubscribeRecord<K extends string, R extends Record<string, any>>(keysNode: Node<K[]>, factory: NodeFactory<K, R>): Accessor<Record<K, R>>;
26
-
27
- type index_Accessor<T> = Accessor<T>;
28
- type index_NodeFactory<K, R extends Record<string, any>> = NodeFactory<K, R>;
29
- declare const index_useStore: typeof useStore;
30
- declare const index_useSubscribe: typeof useSubscribe;
31
- declare const index_useSubscribeRecord: typeof useSubscribeRecord;
32
- declare namespace index {
33
- export { type index_Accessor as Accessor, type index_NodeFactory as NodeFactory, index_useStore as useStore, index_useSubscribe as useSubscribe, index_useSubscribeRecord as useSubscribeRecord };
34
- }
35
-
36
- export { type Accessor as A, type NodeFactory as N, useSubscribe as a, useSubscribeRecord as b, index as i, useStore as u };
@@ -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-Du7u1lSf.cjs';
2
- import { G as Graph, o as GraphNodeFactory, m as GraphDiffResult } from './graph-C4SHb3Ly.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 };