@graphrefly/graphrefly 0.27.0 → 0.29.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 (428) hide show
  1. package/dist/backoff-HPZMEZNF.js +1 -0
  2. package/dist/cascading-Bp99ckMJ.d.ts +180 -0
  3. package/dist/cascading-CcAgRacD.d.cts +180 -0
  4. package/dist/chunk-22F4K3G7.js +1 -0
  5. package/dist/chunk-22SVXUPB.js +64 -0
  6. package/dist/chunk-2GQREQ6C.js +1 -0
  7. package/dist/chunk-3JXNEPCD.js +2 -0
  8. package/dist/chunk-4JJCCD5S.js +2 -0
  9. package/dist/chunk-4OFIQ66T.js +1 -0
  10. package/dist/chunk-4V4C7K56.js +1 -0
  11. package/dist/chunk-4VVTGLXJ.js +1 -0
  12. package/dist/chunk-567NWZ3T.js +1 -0
  13. package/dist/chunk-5JDE5JHE.js +1 -0
  14. package/dist/chunk-5QDBSZBV.js +1 -0
  15. package/dist/chunk-5Z4HDCO6.js +1 -0
  16. package/dist/chunk-63FFOHLA.js +1 -0
  17. package/dist/chunk-6QZNQS5B.js +1 -0
  18. package/dist/chunk-7JDLFI6N.js +1 -0
  19. package/dist/chunk-7TDOES3L.js +1 -0
  20. package/dist/chunk-A7IAQQ63.js +1 -0
  21. package/dist/chunk-AMG5VBHW.js +1 -0
  22. package/dist/chunk-AUY2YKCO.js +1 -0
  23. package/dist/chunk-AV3PIDFQ.js +1 -0
  24. package/dist/chunk-BA5URFYW.js +1 -0
  25. package/dist/chunk-BKPLTBL5.js +1 -0
  26. package/dist/chunk-BZP5T4X6.js +1 -0
  27. package/dist/chunk-CK2E7BTU.js +1 -0
  28. package/dist/chunk-CSJE2EKV.js +1 -0
  29. package/dist/chunk-E3AXATVZ.js +9 -0
  30. package/dist/chunk-ESMPEKEV.js +1 -0
  31. package/dist/chunk-GJR3P6JG.js +1 -0
  32. package/dist/chunk-GNCBXARM.js +1 -0
  33. package/dist/chunk-GPW2V3RE.js +1 -0
  34. package/dist/chunk-HSIEYSDY.js +1 -0
  35. package/dist/chunk-I6VIH3VA.js +1 -0
  36. package/dist/chunk-ISCENNXS.js +1 -0
  37. package/dist/chunk-JYOUF6UQ.js +1 -0
  38. package/dist/chunk-KASHOCF5.js +1 -0
  39. package/dist/chunk-LGSNR4LU.js +5 -0
  40. package/dist/chunk-LVGBLZM2.js +1 -0
  41. package/dist/chunk-MGKAO4EK.js +7 -0
  42. package/dist/chunk-NSG4C6BF.js +23 -0
  43. package/dist/chunk-OL33ZI6R.js +1 -0
  44. package/dist/chunk-PCZ35NXD.js +78 -0
  45. package/dist/chunk-PGMUCUHG.js +43 -0
  46. package/dist/chunk-QYADASLV.js +1 -0
  47. package/dist/chunk-RD52SNH2.js +1 -0
  48. package/dist/chunk-SLMYTGTU.js +1 -0
  49. package/dist/chunk-TWMEGG45.js +1 -0
  50. package/dist/chunk-UVJQ35G2.js +1 -0
  51. package/dist/chunk-VGTCGNRX.js +18 -0
  52. package/dist/chunk-VIMF6LGM.js +1 -0
  53. package/dist/chunk-VJLMUKOI.js +1 -0
  54. package/dist/chunk-VWPRPPKR.js +1 -0
  55. package/dist/chunk-W4TSQ6RJ.js +1 -0
  56. package/dist/chunk-WM7H7WTY.js +3 -0
  57. package/dist/chunk-Y32RJO24.js +1 -0
  58. package/dist/chunk-Y53B6NS4.js +1 -0
  59. package/dist/compat/index.cjs +15 -7656
  60. package/dist/compat/index.d.cts +15 -14
  61. package/dist/compat/index.d.ts +15 -14
  62. package/dist/compat/index.js +1 -50
  63. package/dist/compat/jotai/index.cjs +1 -2048
  64. package/dist/compat/jotai/index.d.cts +2 -2
  65. package/dist/compat/jotai/index.d.ts +2 -2
  66. package/dist/compat/jotai/index.js +1 -9
  67. package/dist/compat/nanostores/index.cjs +1 -2175
  68. package/dist/compat/nanostores/index.d.cts +2 -2
  69. package/dist/compat/nanostores/index.d.ts +2 -2
  70. package/dist/compat/nanostores/index.js +1 -23
  71. package/dist/compat/nestjs/index.cjs +15 -6782
  72. package/dist/compat/nestjs/index.d.cts +7 -6
  73. package/dist/compat/nestjs/index.d.ts +7 -6
  74. package/dist/compat/nestjs/index.js +1 -83
  75. package/dist/compat/react/index.cjs +1 -141
  76. package/dist/compat/react/index.d.cts +2 -2
  77. package/dist/compat/react/index.d.ts +2 -2
  78. package/dist/compat/react/index.js +1 -12
  79. package/dist/compat/solid/index.cjs +1 -128
  80. package/dist/compat/solid/index.d.cts +2 -2
  81. package/dist/compat/solid/index.d.ts +2 -2
  82. package/dist/compat/solid/index.js +1 -12
  83. package/dist/compat/svelte/index.cjs +1 -131
  84. package/dist/compat/svelte/index.d.cts +2 -2
  85. package/dist/compat/svelte/index.d.ts +2 -2
  86. package/dist/compat/svelte/index.js +1 -12
  87. package/dist/compat/vue/index.cjs +1 -146
  88. package/dist/compat/vue/index.d.cts +2 -2
  89. package/dist/compat/vue/index.d.ts +2 -2
  90. package/dist/compat/vue/index.js +1 -12
  91. package/dist/compat/zustand/index.cjs +7 -4931
  92. package/dist/compat/zustand/index.d.cts +5 -5
  93. package/dist/compat/zustand/index.d.ts +5 -5
  94. package/dist/compat/zustand/index.js +1 -12
  95. package/dist/composite-BL-llbnE.d.ts +69 -0
  96. package/dist/composite-Dze--DaA.d.cts +69 -0
  97. package/dist/core/index.cjs +1 -2271
  98. package/dist/core/index.d.cts +4 -4
  99. package/dist/core/index.d.ts +4 -4
  100. package/dist/core/index.js +1 -110
  101. package/dist/extra/browser.cjs +1 -0
  102. package/dist/extra/browser.d.cts +3 -0
  103. package/dist/extra/browser.d.ts +3 -0
  104. package/dist/extra/browser.js +1 -0
  105. package/dist/extra/index.cjs +24 -9971
  106. package/dist/extra/index.d.cts +13 -6
  107. package/dist/extra/index.d.ts +13 -6
  108. package/dist/extra/index.js +1 -381
  109. package/dist/extra/node.cjs +3 -0
  110. package/dist/extra/node.d.cts +81 -0
  111. package/dist/extra/node.d.ts +81 -0
  112. package/dist/extra/node.js +2 -0
  113. package/dist/extra/operators.cjs +1 -0
  114. package/dist/extra/operators.d.cts +910 -0
  115. package/dist/extra/operators.d.ts +910 -0
  116. package/dist/extra/operators.js +1 -0
  117. package/dist/extra/reactive.cjs +1 -0
  118. package/dist/extra/reactive.d.cts +352 -0
  119. package/dist/extra/reactive.d.ts +352 -0
  120. package/dist/extra/reactive.js +1 -0
  121. package/dist/extra/sources.cjs +1 -2486
  122. package/dist/extra/sources.d.cts +6 -2
  123. package/dist/extra/sources.d.ts +6 -2
  124. package/dist/extra/sources.js +1 -57
  125. package/dist/extra/storage-browser.cjs +1 -0
  126. package/dist/extra/storage-browser.d.cts +71 -0
  127. package/dist/extra/storage-browser.d.ts +71 -0
  128. package/dist/extra/storage-browser.js +1 -0
  129. package/dist/extra/storage-core.cjs +1 -0
  130. package/dist/extra/storage-core.d.cts +98 -0
  131. package/dist/extra/storage-core.d.ts +98 -0
  132. package/dist/extra/storage-core.js +1 -0
  133. package/dist/extra/storage-node.cjs +2 -0
  134. package/dist/extra/storage-node.d.cts +60 -0
  135. package/dist/extra/storage-node.d.ts +60 -0
  136. package/dist/extra/storage-node.js +1 -0
  137. package/dist/fallback-BaTS7vVY.d.cts +258 -0
  138. package/dist/fallback-eOm3LNxP.d.ts +258 -0
  139. package/dist/graph/index.cjs +7 -5030
  140. package/dist/graph/index.d.cts +6 -5
  141. package/dist/graph/index.d.ts +6 -5
  142. package/dist/graph/index.js +1 -50
  143. package/dist/{graph-DNCrvZSn.d.cts → graph-DgohqXK-.d.cts} +151 -32
  144. package/dist/{graph-CCwGKLCm.d.ts → graph-Qjg9gWHI.d.ts} +151 -32
  145. package/dist/{index-BwfLUNw4.d.ts → index-2BVuRCI4.d.ts} +173 -2040
  146. package/dist/{index-BPVt8kqc.d.ts → index-2NvguqQA.d.ts} +10 -195
  147. package/dist/index-A65LZhoM.d.ts +186 -0
  148. package/dist/{index-DlLp-2Xn.d.cts → index-B-8FCEua.d.cts} +10 -195
  149. package/dist/index-B-gqvYel.d.ts +135 -0
  150. package/dist/index-B2PRuolf.d.cts +86 -0
  151. package/dist/index-BJqt9EwW.d.ts +231 -0
  152. package/dist/{index-BHlKbUwO.d.cts → index-BKjT5DiZ.d.cts} +173 -2040
  153. package/dist/{index-C0svESO4.d.ts → index-BM8BU4q6.d.ts} +1 -1
  154. package/dist/{index-VdHQMPy1.d.ts → index-BQaEnxBf.d.ts} +1 -1
  155. package/dist/index-BSfwiy5B.d.ts +192 -0
  156. package/dist/index-BTSkeCZs.d.cts +291 -0
  157. package/dist/index-BUVtw1Ay.d.cts +186 -0
  158. package/dist/index-BUi57v_p.d.ts +163 -0
  159. package/dist/{messaging-Gt4LPbyA.d.cts → index-BanNUILp.d.cts} +31 -93
  160. package/dist/{audit-DRlSzBu9.d.ts → index-BayHDRx6.d.cts} +27 -21
  161. package/dist/{index-B6D3QNSA.d.ts → index-BiyjsZ0m.d.ts} +148 -20
  162. package/dist/index-BqZ6vB2A.d.ts +2057 -0
  163. package/dist/{memory-li6FL5RM.d.ts → index-BuVidq3D.d.cts} +26 -26
  164. package/dist/index-Byh-xTyp.d.ts +105 -0
  165. package/dist/index-C08QPDcV.d.cts +321 -0
  166. package/dist/{demo-shell-BDkOptd6.d.ts → index-C66RJiX8.d.ts} +14 -14
  167. package/dist/index-C8RfjffH.d.ts +291 -0
  168. package/dist/index-CA1Cu7Ud.d.ts +873 -0
  169. package/dist/{index-ByQxazQJ.d.cts → index-CABbltIu.d.cts} +1 -1
  170. package/dist/{index-VHqptjhu.d.cts → index-CHEBsnYv.d.cts} +1 -1
  171. package/dist/{index-BuEoe-Qu.d.ts → index-CI0yDnLp.d.ts} +9 -9
  172. package/dist/{index-B9B7_HEY.d.ts → index-CJ45TW-h.d.ts} +1 -1
  173. package/dist/{index-CO8uBlUh.d.cts → index-CJZKZoo4.d.cts} +148 -20
  174. package/dist/{index-wEn0eFe8.d.ts → index-CX2tFJL1.d.ts} +1 -1
  175. package/dist/{index-BaSM3aYt.d.ts → index-CcWOJ6F0.d.ts} +3 -3
  176. package/dist/{audit-ClmqGOCx.d.cts → index-CiaVoZGo.d.ts} +27 -21
  177. package/dist/{index-Dzk2hrlR.d.ts → index-Ct5CWc4E.d.ts} +1 -1
  178. package/dist/index-D38duMCv.d.cts +357 -0
  179. package/dist/{index-C8oil6M6.d.ts → index-D5XJ2tSx.d.ts} +30 -6
  180. package/dist/{index-DO_6JN9Z.d.cts → index-D80do5jX.d.cts} +1 -1
  181. package/dist/index-D9HKAH_-.d.cts +231 -0
  182. package/dist/index-DBe_8XW5.d.cts +143 -0
  183. package/dist/{memory-C6Z2tGpC.d.cts → index-DCeTyFlB.d.ts} +26 -26
  184. package/dist/index-DDy8eeXS.d.ts +321 -0
  185. package/dist/index-DJ5oNBc8.d.ts +143 -0
  186. package/dist/{index-CI3DprxP.d.cts → index-DP0_O3ls.d.cts} +30 -6
  187. package/dist/{demo-shell-Crid1WdR.d.cts → index-DX8xS-yB.d.cts} +14 -14
  188. package/dist/index-DiZejfCI.d.cts +2057 -0
  189. package/dist/index-DknyJ2Fu.d.cts +163 -0
  190. package/dist/index-DoWMs-Kk.d.cts +135 -0
  191. package/dist/{messaging-XDoYablx.d.ts → index-DuB5aO4-.d.ts} +31 -93
  192. package/dist/index-DwjJGKxV.d.ts +357 -0
  193. package/dist/{index-B6EhDnjH.d.cts → index-H_oxVec5.d.cts} +1 -1
  194. package/dist/{index-3lsddbbS.d.ts → index-IMAHq-ia.d.ts} +1 -1
  195. package/dist/{index-B1tloyhO.d.cts → index-U1nir7MX.d.cts} +1 -1
  196. package/dist/index-Vg7tORgk.d.ts +86 -0
  197. package/dist/index-dig-r2tQ.d.cts +873 -0
  198. package/dist/{index-CxFrXH4m.d.ts → index-gsT79Xu9.d.ts} +1 -1
  199. package/dist/{index-D8wS_PeY.d.cts → index-i99Ka8s7.d.cts} +9 -9
  200. package/dist/index-iKkyJosF.d.cts +105 -0
  201. package/dist/{index-Xi3u0HCQ.d.cts → index-jleeotBT.d.cts} +1 -1
  202. package/dist/{index-DVGiGFGT.d.cts → index-kykKWwV-.d.cts} +3 -3
  203. package/dist/index-vgcLF5TH.d.cts +192 -0
  204. package/dist/{index-DYme44FM.d.cts → index-y1RllPn4.d.cts} +1 -1
  205. package/dist/index.cjs +151 -24142
  206. package/dist/index.d.cts +69 -2099
  207. package/dist/index.d.ts +69 -2099
  208. package/dist/index.js +1 -3868
  209. package/dist/{meta-CbznRPYJ.d.ts → meta-CX7YsOzp.d.cts} +5 -5
  210. package/dist/{meta-BxCA7rcr.d.cts → meta-CckhhFRd.d.ts} +5 -5
  211. package/dist/{node-BmerH3kS.d.cts → node-Dd6wHSib.d.cts} +71 -11
  212. package/dist/{node-BmerH3kS.d.ts → node-Dd6wHSib.d.ts} +71 -11
  213. package/dist/{observable-BgGUwcqp.d.ts → observable-BZJgo616.d.ts} +1 -1
  214. package/dist/{observable-DJt_AxzQ.d.cts → observable-kwzpLvbi.d.cts} +1 -1
  215. package/dist/patterns/ai/browser.cjs +25 -0
  216. package/dist/patterns/ai/browser.d.cts +127 -0
  217. package/dist/patterns/ai/browser.d.ts +127 -0
  218. package/dist/patterns/ai/browser.js +3 -0
  219. package/dist/patterns/ai/index.cjs +92 -0
  220. package/dist/patterns/ai/index.d.cts +17 -0
  221. package/dist/patterns/ai/index.d.ts +17 -0
  222. package/dist/patterns/ai/index.js +1 -0
  223. package/dist/patterns/ai/node.cjs +2 -0
  224. package/dist/patterns/ai/node.d.cts +58 -0
  225. package/dist/patterns/ai/node.d.ts +58 -0
  226. package/dist/patterns/ai/node.js +1 -0
  227. package/dist/patterns/audit/index.cjs +7 -0
  228. package/dist/patterns/audit/index.d.cts +6 -0
  229. package/dist/patterns/audit/index.d.ts +6 -0
  230. package/dist/patterns/audit/index.js +1 -0
  231. package/dist/patterns/cqrs/index.cjs +7 -0
  232. package/dist/patterns/cqrs/index.d.cts +5 -0
  233. package/dist/patterns/cqrs/index.d.ts +5 -0
  234. package/dist/patterns/cqrs/index.js +1 -0
  235. package/dist/patterns/demo-shell/index.cjs +8 -0
  236. package/dist/patterns/demo-shell/index.d.cts +6 -0
  237. package/dist/patterns/demo-shell/index.d.ts +6 -0
  238. package/dist/patterns/demo-shell/index.js +1 -0
  239. package/dist/patterns/domain-templates/index.cjs +7 -0
  240. package/dist/patterns/domain-templates/index.d.cts +5 -0
  241. package/dist/patterns/domain-templates/index.d.ts +5 -0
  242. package/dist/patterns/domain-templates/index.js +1 -0
  243. package/dist/patterns/graphspec/index.cjs +84 -0
  244. package/dist/patterns/graphspec/index.d.cts +7 -0
  245. package/dist/patterns/graphspec/index.d.ts +7 -0
  246. package/dist/patterns/graphspec/index.js +1 -0
  247. package/dist/patterns/guarded-execution/index.cjs +7 -0
  248. package/dist/patterns/guarded-execution/index.d.cts +7 -0
  249. package/dist/patterns/guarded-execution/index.d.ts +7 -0
  250. package/dist/patterns/guarded-execution/index.js +1 -0
  251. package/dist/patterns/harness/index.cjs +49 -0
  252. package/dist/patterns/harness/index.d.cts +11 -0
  253. package/dist/patterns/harness/index.d.ts +11 -0
  254. package/dist/patterns/harness/index.js +1 -0
  255. package/dist/patterns/job-queue/index.cjs +7 -0
  256. package/dist/patterns/job-queue/index.d.cts +5 -0
  257. package/dist/patterns/job-queue/index.d.ts +5 -0
  258. package/dist/patterns/job-queue/index.js +1 -0
  259. package/dist/patterns/lens/index.cjs +7 -0
  260. package/dist/patterns/lens/index.d.cts +7 -0
  261. package/dist/patterns/lens/index.d.ts +7 -0
  262. package/dist/patterns/lens/index.js +1 -0
  263. package/dist/patterns/memory/index.cjs +7 -0
  264. package/dist/patterns/memory/index.d.cts +5 -0
  265. package/dist/patterns/memory/index.d.ts +5 -0
  266. package/dist/patterns/memory/index.js +1 -0
  267. package/dist/patterns/messaging/index.cjs +7 -0
  268. package/dist/patterns/messaging/index.d.cts +5 -0
  269. package/dist/patterns/messaging/index.d.ts +5 -0
  270. package/dist/patterns/messaging/index.js +1 -0
  271. package/dist/patterns/orchestration/index.cjs +7 -0
  272. package/dist/patterns/orchestration/index.d.cts +6 -0
  273. package/dist/patterns/orchestration/index.d.ts +6 -0
  274. package/dist/patterns/orchestration/index.js +1 -0
  275. package/dist/patterns/reactive-layout/index.cjs +8 -6444
  276. package/dist/patterns/reactive-layout/index.d.cts +6 -6
  277. package/dist/patterns/reactive-layout/index.d.ts +6 -6
  278. package/dist/patterns/reactive-layout/index.js +1 -56
  279. package/dist/patterns/reduction/index.cjs +7 -0
  280. package/dist/patterns/reduction/index.d.cts +5 -0
  281. package/dist/patterns/reduction/index.d.ts +5 -0
  282. package/dist/patterns/reduction/index.js +1 -0
  283. package/dist/patterns/refine-loop/index.cjs +9 -0
  284. package/dist/patterns/refine-loop/index.d.cts +7 -0
  285. package/dist/patterns/refine-loop/index.d.ts +7 -0
  286. package/dist/patterns/refine-loop/index.js +1 -0
  287. package/dist/patterns/resilient-pipeline/index.cjs +1 -0
  288. package/dist/patterns/resilient-pipeline/index.d.cts +7 -0
  289. package/dist/patterns/resilient-pipeline/index.d.ts +7 -0
  290. package/dist/patterns/resilient-pipeline/index.js +1 -0
  291. package/dist/patterns/surface/index.cjs +15 -0
  292. package/dist/patterns/surface/index.d.cts +8 -0
  293. package/dist/patterns/surface/index.d.ts +8 -0
  294. package/dist/patterns/surface/index.js +1 -0
  295. package/dist/{reactive-layout-u5Ulnqag.d.ts → reactive-layout-BkBwVvwm.d.ts} +2 -2
  296. package/dist/{reactive-layout-MQP--J3F.d.cts → reactive-layout-PiFwVaWS.d.cts} +2 -2
  297. package/dist/reactive-log-1QTyx10a.d.ts +190 -0
  298. package/dist/reactive-log-BiVoSxke.d.cts +190 -0
  299. package/dist/{composite-aUCvjZVR.d.ts → reactive-map-CwO_COHy.d.cts} +2 -67
  300. package/dist/{composite-C7PcQvcs.d.cts → reactive-map-FeuTVAJb.d.ts} +2 -67
  301. package/dist/resilience-CBfYJW5C.d.ts +493 -0
  302. package/dist/resilience-XRUF267O.js +1 -0
  303. package/dist/resilience-uBz4yvYB.d.cts +493 -0
  304. package/dist/{sugar-CCOxXK1e.d.ts → sugar-CY-MCfZ9.d.ts} +17 -15
  305. package/dist/{sugar-D02n5JjF.d.cts → sugar-DHttV0LX.d.cts} +17 -15
  306. package/dist/topology-tree-CVjt2gp7.d.cts +25 -0
  307. package/dist/topology-tree-one6oSKY.d.ts +25 -0
  308. package/dist/types-O3GzJY2U.d.cts +401 -0
  309. package/dist/types-u64Ose53.d.ts +401 -0
  310. package/package.json +252 -22
  311. package/dist/ai-CaR_912Q.d.cts +0 -1033
  312. package/dist/ai-WlRltJV7.d.ts +0 -1033
  313. package/dist/chunk-3ZWCKRHX.js +0 -117
  314. package/dist/chunk-3ZWCKRHX.js.map +0 -1
  315. package/dist/chunk-7TAQJHQV.js +0 -103
  316. package/dist/chunk-7TAQJHQV.js.map +0 -1
  317. package/dist/chunk-APFNLIRG.js +0 -62
  318. package/dist/chunk-APFNLIRG.js.map +0 -1
  319. package/dist/chunk-AT5LKYNL.js +0 -395
  320. package/dist/chunk-AT5LKYNL.js.map +0 -1
  321. package/dist/chunk-BQ6RQQFF.js +0 -5087
  322. package/dist/chunk-BQ6RQQFF.js.map +0 -1
  323. package/dist/chunk-BVZYTZ5H.js +0 -599
  324. package/dist/chunk-BVZYTZ5H.js.map +0 -1
  325. package/dist/chunk-DST5DKZS.js +0 -1371
  326. package/dist/chunk-DST5DKZS.js.map +0 -1
  327. package/dist/chunk-GTE6PWRZ.js +0 -866
  328. package/dist/chunk-GTE6PWRZ.js.map +0 -1
  329. package/dist/chunk-HXZEYDUR.js +0 -94
  330. package/dist/chunk-HXZEYDUR.js.map +0 -1
  331. package/dist/chunk-J22W6HV3.js +0 -107
  332. package/dist/chunk-J22W6HV3.js.map +0 -1
  333. package/dist/chunk-J2VBW3DZ.js +0 -302
  334. package/dist/chunk-J2VBW3DZ.js.map +0 -1
  335. package/dist/chunk-JSCT3CR4.js +0 -38
  336. package/dist/chunk-JSCT3CR4.js.map +0 -1
  337. package/dist/chunk-JWBCY4NC.js +0 -330
  338. package/dist/chunk-JWBCY4NC.js.map +0 -1
  339. package/dist/chunk-K2AUJHVP.js +0 -2251
  340. package/dist/chunk-K2AUJHVP.js.map +0 -1
  341. package/dist/chunk-MJ2NKQQL.js +0 -119
  342. package/dist/chunk-MJ2NKQQL.js.map +0 -1
  343. package/dist/chunk-N6UR7YVY.js +0 -198
  344. package/dist/chunk-N6UR7YVY.js.map +0 -1
  345. package/dist/chunk-NC6S43JJ.js +0 -456
  346. package/dist/chunk-NC6S43JJ.js.map +0 -1
  347. package/dist/chunk-OFVJBJXR.js +0 -98
  348. package/dist/chunk-OFVJBJXR.js.map +0 -1
  349. package/dist/chunk-OHISZPOJ.js +0 -97
  350. package/dist/chunk-OHISZPOJ.js.map +0 -1
  351. package/dist/chunk-OU5CQKNW.js +0 -102
  352. package/dist/chunk-OU5CQKNW.js.map +0 -1
  353. package/dist/chunk-PF7GRZMW.js +0 -2712
  354. package/dist/chunk-PF7GRZMW.js.map +0 -1
  355. package/dist/chunk-PHOUUNK7.js +0 -2291
  356. package/dist/chunk-PHOUUNK7.js.map +0 -1
  357. package/dist/chunk-RNHBMHKA.js +0 -1665
  358. package/dist/chunk-RNHBMHKA.js.map +0 -1
  359. package/dist/chunk-SX52TAR4.js +0 -110
  360. package/dist/chunk-SX52TAR4.js.map +0 -1
  361. package/dist/chunk-VYPWMZ6H.js +0 -98
  362. package/dist/chunk-VYPWMZ6H.js.map +0 -1
  363. package/dist/chunk-WBZOVTYK.js +0 -171
  364. package/dist/chunk-WBZOVTYK.js.map +0 -1
  365. package/dist/chunk-WKNUIZOY.js +0 -354
  366. package/dist/chunk-WKNUIZOY.js.map +0 -1
  367. package/dist/chunk-X3VMZYBT.js +0 -713
  368. package/dist/chunk-X3VMZYBT.js.map +0 -1
  369. package/dist/chunk-X5R3GL6H.js +0 -525
  370. package/dist/chunk-X5R3GL6H.js.map +0 -1
  371. package/dist/chunk-XGPU467M.js +0 -136
  372. package/dist/chunk-XGPU467M.js.map +0 -1
  373. package/dist/compat/index.cjs.map +0 -1
  374. package/dist/compat/index.js.map +0 -1
  375. package/dist/compat/jotai/index.cjs.map +0 -1
  376. package/dist/compat/jotai/index.js.map +0 -1
  377. package/dist/compat/nanostores/index.cjs.map +0 -1
  378. package/dist/compat/nanostores/index.js.map +0 -1
  379. package/dist/compat/nestjs/index.cjs.map +0 -1
  380. package/dist/compat/nestjs/index.js.map +0 -1
  381. package/dist/compat/react/index.cjs.map +0 -1
  382. package/dist/compat/react/index.js.map +0 -1
  383. package/dist/compat/solid/index.cjs.map +0 -1
  384. package/dist/compat/solid/index.js.map +0 -1
  385. package/dist/compat/svelte/index.cjs.map +0 -1
  386. package/dist/compat/svelte/index.js.map +0 -1
  387. package/dist/compat/vue/index.cjs.map +0 -1
  388. package/dist/compat/vue/index.js.map +0 -1
  389. package/dist/compat/zustand/index.cjs.map +0 -1
  390. package/dist/compat/zustand/index.js.map +0 -1
  391. package/dist/core/index.cjs.map +0 -1
  392. package/dist/core/index.js.map +0 -1
  393. package/dist/extra/index.cjs.map +0 -1
  394. package/dist/extra/index.js.map +0 -1
  395. package/dist/extra/sources.cjs.map +0 -1
  396. package/dist/extra/sources.js.map +0 -1
  397. package/dist/graph/index.cjs.map +0 -1
  398. package/dist/graph/index.js.map +0 -1
  399. package/dist/index.cjs.map +0 -1
  400. package/dist/index.js.map +0 -1
  401. package/dist/patterns/ai.cjs +0 -7930
  402. package/dist/patterns/ai.cjs.map +0 -1
  403. package/dist/patterns/ai.d.cts +0 -10
  404. package/dist/patterns/ai.d.ts +0 -10
  405. package/dist/patterns/ai.js +0 -71
  406. package/dist/patterns/ai.js.map +0 -1
  407. package/dist/patterns/audit.cjs +0 -5805
  408. package/dist/patterns/audit.cjs.map +0 -1
  409. package/dist/patterns/audit.d.cts +0 -6
  410. package/dist/patterns/audit.d.ts +0 -6
  411. package/dist/patterns/audit.js +0 -29
  412. package/dist/patterns/audit.js.map +0 -1
  413. package/dist/patterns/demo-shell.cjs +0 -5604
  414. package/dist/patterns/demo-shell.cjs.map +0 -1
  415. package/dist/patterns/demo-shell.d.cts +0 -6
  416. package/dist/patterns/demo-shell.d.ts +0 -6
  417. package/dist/patterns/demo-shell.js +0 -15
  418. package/dist/patterns/demo-shell.js.map +0 -1
  419. package/dist/patterns/memory.cjs +0 -5283
  420. package/dist/patterns/memory.cjs.map +0 -1
  421. package/dist/patterns/memory.d.cts +0 -5
  422. package/dist/patterns/memory.d.ts +0 -5
  423. package/dist/patterns/memory.js +0 -20
  424. package/dist/patterns/memory.js.map +0 -1
  425. package/dist/patterns/reactive-layout/index.cjs.map +0 -1
  426. package/dist/patterns/reactive-layout/index.js.map +0 -1
  427. package/dist/storage-CMjUUuxn.d.ts +0 -190
  428. package/dist/storage-DdWlZo6U.d.cts +0 -190
@@ -1,8 +1,14 @@
1
- import { a as NodeOptions, N as Node, M as Message, s as Messages, a6 as VersioningLevel } from './node-BmerH3kS.cjs';
2
- import { AsyncSourceOpts, NodeInput, EventTargetLike, FromCronOptions, ReactiveCounterBundle, cached, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './extra/sources.cjs';
3
- import { S as StorageTier, I as IndexedDbStorageSpec, a as StorageHandle, d as dictStorage, f as fileStorage, b as fromIDBRequest, c as fromIDBTransaction, i as indexedDbStorage, m as memoryStorage, s as sqliteStorage } from './storage-DdWlZo6U.cjs';
4
- import { D as DistillBundle, a as DistillOptions, E as Extraction, M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, c as ReactiveMapOptions, V as VerifiableBundle, d as VerifiableOptions, e as VerifyValue, f as distill, r as reactiveMap, v as verifiable } from './composite-C7PcQvcs.cjs';
5
- import { T as ToObservableOptions, t as toObservable } from './observable-DJt_AxzQ.cjs';
1
+ import { N as NodeOptions, a as Node, M as Message, b as Messages } from './node-Dd6wHSib.cjs';
2
+ import { d as BackoffStrategy, B as BackoffPreset, v as retrySource, k as WithStatusBundle, e as CircuitBreaker, a as CircuitBreakerOptions, f as CircuitOpenError, C as CircuitState, E as ExponentialBackoffOptions, F as FallbackInput, J as JitterMode, N as NS_PER_MS, c as NS_PER_SEC, R as RateLimiterOptions, g as RateLimiterOverflowError, h as RateLimiterOverflowPolicy, b as RetryOptions, i as RetrySourceOptions, S as StatusValue, T as TimeoutError, j as TokenBucket, W as WithBreakerBundle, l as circuitBreaker, m as constant, n as decorrelatedJitter, o as exponential, p as fallback, q as fibonacci, r as linear, s as rateLimiter, t as resolveBackoffPreset, u as retry, w as timeout, x as tokenBucket, y as withBreaker, z as withMaxAttempts, A as withStatus } from './resilience-uBz4yvYB.cjs';
3
+ import { AsyncSourceOpts, NodeInput, EventTargetLike, FromCronOptions, ReactiveCounterBundle, awaitSettled, cached, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './extra/sources.cjs';
4
+ import { StorageTier, StorageHandle, dictStorage, memoryStorage, sortJsonValue, stableJsonString } from './extra/storage-core.cjs';
5
+ import { D as DistillBundle, a as DistillOptions, E as Extraction, V as VerifiableBundle, b as VerifiableOptions, c as VerifyValue, d as distill, v as verifiable } from './composite-Dze--DaA.cjs';
6
+ import { T as ToObservableOptions, t as toObservable } from './observable-kwzpLvbi.cjs';
7
+ import { MergeMapOptions, TapObserver, ThrottleOptions, audit, buffer, bufferCount, bufferTime, catchError, combine, combineLatest, concat, concatMap, debounce, debounceTime, delay, distinctUntilChanged, elementAt, exhaustMap, filter, find, first, flatMap, interval, last, map, merge, mergeMap, pairwise, pausable, race, reduce, repeat, rescue, sample, scan, skip, switchMap, take, takeUntil, takeWhile, tap, throttle, throttleTime, valve, window, windowCount, windowTime, withLatestFrom, zip } from './extra/operators.cjs';
8
+ import { IndexBackend, IndexRow, ListBackend, NativeIndexBackend, NativeListBackend, ReactiveIndexBundle, ReactiveIndexOptions, ReactiveListBundle, ReactiveListOptions, UpsertOptions, reactiveIndex, reactiveList } from './extra/reactive.cjs';
9
+ import { L as LogBackend, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, r as reactiveLog } from './reactive-log-BiVoSxke.cjs';
10
+ import { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, r as reactiveMap } from './reactive-map-CwO_COHy.cjs';
11
+ import { a as GraphOptions, G as Graph } from './graph-DgohqXK-.cjs';
6
12
 
7
13
  /**
8
14
  * External-register helpers — the common `register({emit, error, complete})`
@@ -23,7 +29,7 @@ import { T as ToObservableOptions, t as toObservable } from './observable-DJt_Ax
23
29
  * torn down.
24
30
  */
25
31
 
26
- type ExtraOpts$3 = Omit<NodeOptions<unknown>, "describeKind">;
32
+ type ExtraOpts$1 = Omit<NodeOptions<unknown>, "describeKind">;
27
33
  /**
28
34
  * Standard emit-triad passed to a single-channel external registrar.
29
35
  *
@@ -86,7 +92,7 @@ type ExternalRegister<H> = (handlers: H) => (() => void) | undefined;
86
92
  *
87
93
  * @category extra
88
94
  */
89
- declare function externalProducer<T = unknown>(register: ExternalRegister<EmitTriad<T>>, opts?: ExtraOpts$3): Node<T>;
95
+ declare function externalProducer<T = unknown>(register: ExternalRegister<EmitTriad<T>>, opts?: ExtraOpts$1): Node<T>;
90
96
  /**
91
97
  * Options for {@link externalBundle}.
92
98
  *
@@ -97,7 +103,7 @@ type ExternalBundleOptions<TChannels extends Record<string, unknown>> = {
97
103
  name?: string;
98
104
  /** Per-channel node options (equals, resubscribable, ...). */
99
105
  channelOpts?: {
100
- [K in keyof TChannels]?: ExtraOpts$3;
106
+ [K in keyof TChannels]?: ExtraOpts$1;
101
107
  };
102
108
  };
103
109
  /**
@@ -139,159 +145,6 @@ declare function externalBundle<TChannels extends Record<string, unknown>>(regis
139
145
  dispose(): void;
140
146
  };
141
147
 
142
- /**
143
- * Backoff strategies for {@link retry} (roadmap §3.1). Delays are in **nanoseconds**.
144
- *
145
- * Convention: all graphrefly-ts timestamps and durations use nanoseconds (`_ns` suffix).
146
- * 1 second = 1_000_000_000 ns, 1 ms = 1_000_000 ns.
147
- */
148
- declare const NS_PER_MS = 1000000;
149
- declare const NS_PER_SEC = 1000000000;
150
- type JitterMode = "none" | "full" | "equal";
151
- type BackoffPreset = "constant" | "linear" | "exponential" | "fibonacci" | "decorrelatedJitter";
152
- /** `(attempt, error?, previousDelayNs?) => delayNs | null` — `null` means zero delay. */
153
- type BackoffStrategy = (attempt: number, error?: unknown, prevDelayNs?: number | null) => number | null;
154
- /**
155
- * Builds a strategy that always returns the same delay in nanoseconds.
156
- *
157
- * @param delayNs - Non-negative delay in nanoseconds; values below zero are clamped to zero.
158
- * @returns `BackoffStrategy` for use with {@link retry} or custom timers.
159
- *
160
- * @example
161
- * ```ts
162
- * import { constant, retry, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
163
- *
164
- * const out = retry(source, { count: 3, backoff: constant(0.25 * NS_PER_SEC) });
165
- * ```
166
- *
167
- * @category extra
168
- */
169
- declare function constant(delayNs: number): BackoffStrategy;
170
- /**
171
- * Builds linear backoff: `baseNs + stepNs * attempt` (`stepNs` defaults to `baseNs`).
172
- *
173
- * @param baseNs - Base delay in nanoseconds (clamped non-negative).
174
- * @param stepNs - Added per retry attempt in nanoseconds (clamped non-negative).
175
- * @returns `BackoffStrategy` for {@link retry}.
176
- *
177
- * @example
178
- * ```ts
179
- * import { linear, retry, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
180
- *
181
- * // Attempt 0 → 1 s, attempt 1 → 2 s, attempt 2 → 3 s …
182
- * const out = retry(source, { count: 4, backoff: linear(NS_PER_SEC) });
183
- * ```
184
- *
185
- * @category extra
186
- */
187
- declare function linear(baseNs: number, stepNs?: number): BackoffStrategy;
188
- type ExponentialBackoffOptions = {
189
- baseNs?: number;
190
- factor?: number;
191
- maxDelayNs?: number;
192
- jitter?: JitterMode;
193
- };
194
- /**
195
- * Builds exponential backoff in nanoseconds, capped by `maxDelayNs`, with optional jitter.
196
- *
197
- * @param options - Base, factor, cap, and jitter mode.
198
- * @returns `BackoffStrategy` for {@link retry}.
199
- *
200
- * @remarks
201
- * **Jitter:** `"full"` spreads delay across `[0, delay]`; `"equal"` uses `[delay/2, delay]`.
202
- *
203
- * @example
204
- * ```ts
205
- * import { exponential, retry, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
206
- *
207
- * // 100 ms → 200 ms → 400 ms … capped at 30 s, with full jitter
208
- * const out = retry(source, {
209
- * count: 5,
210
- * backoff: exponential({ baseNs: 100 * NS_PER_SEC / 1000, jitter: "full" }),
211
- * });
212
- * ```
213
- *
214
- * @category extra
215
- */
216
- declare function exponential(options?: ExponentialBackoffOptions): BackoffStrategy;
217
- /**
218
- * Builds Fibonacci-scaled delays: `1, 2, 3, 5, … × baseNs`, capped at `maxDelayNs`.
219
- *
220
- * @param baseNs - Multiplier applied to the Fibonacci unit (default `100ms` in nanoseconds).
221
- * @param maxDelayNs - Upper bound in nanoseconds (default `30s`).
222
- * @returns `BackoffStrategy` for {@link retry}.
223
- *
224
- * @example
225
- * ```ts
226
- * import { fibonacci, retry, NS_PER_MS } from "@graphrefly/graphrefly-ts";
227
- *
228
- * // Delays: 100 ms, 200 ms, 300 ms, 500 ms, 800 ms … (× 100 ms base)
229
- * const out = retry(source, { count: 5, backoff: fibonacci(100 * NS_PER_MS) });
230
- * ```
231
- *
232
- * @category extra
233
- */
234
- declare function fibonacci(baseNs?: number, maxDelayNs?: number): BackoffStrategy;
235
- /**
236
- * Decorrelated jitter (AWS-recommended): `random(baseNs, min(maxNs, lastDelay * 3))`.
237
- *
238
- * Stateless — uses `prevDelayNs` (passed by the consumer) instead of closure state.
239
- * Safe to share across concurrent retry sequences.
240
- *
241
- * @param baseNs - Floor of the random range (default `100ms` in nanoseconds).
242
- * @param maxNs - Ceiling cap (default `30s` in nanoseconds).
243
- * @returns `BackoffStrategy` for {@link retry}.
244
- *
245
- * @example
246
- * ```ts
247
- * import { decorrelatedJitter, retry, NS_PER_MS, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
248
- *
249
- * const out = retry(source, {
250
- * count: 6,
251
- * backoff: decorrelatedJitter(100 * NS_PER_MS, 10 * NS_PER_SEC),
252
- * });
253
- * ```
254
- *
255
- * @category extra
256
- */
257
- declare function decorrelatedJitter(baseNs?: number, maxNs?: number): BackoffStrategy;
258
- /**
259
- * Decorator that caps any strategy at `maxAttempts`. Returns `null` (stop retrying) after the cap.
260
- *
261
- * @param strategy - Inner strategy to wrap.
262
- * @param maxAttempts - Maximum number of attempts (inclusive).
263
- * @returns Wrapped `BackoffStrategy`.
264
- *
265
- * @example
266
- * ```ts
267
- * import { withMaxAttempts, exponential } from "@graphrefly/graphrefly-ts";
268
- *
269
- * const capped = withMaxAttempts(exponential(), 3);
270
- * capped(3); // null — no more retries beyond attempt 3
271
- * ```
272
- *
273
- * @category extra
274
- */
275
- declare function withMaxAttempts(strategy: BackoffStrategy, maxAttempts: number): BackoffStrategy;
276
- /**
277
- * Maps a preset name to a concrete {@link BackoffStrategy} with library-default parameters.
278
- *
279
- * @param name - One of `constant`, `linear`, `exponential`, `fibonacci`, or `decorrelatedJitter`.
280
- * @returns Configured strategy with default parameters.
281
- * @throws Error when `name` is not a known preset.
282
- *
283
- * @example
284
- * ```ts
285
- * import { resolveBackoffPreset, retry } from "@graphrefly/graphrefly-ts";
286
- *
287
- * const out = retry(source, { count: 3, backoff: resolveBackoffPreset("exponential") });
288
- * // Equivalent to retry(source, { count: 3, backoff: exponential() })
289
- * ```
290
- *
291
- * @category extra
292
- */
293
- declare function resolveBackoffPreset(name: BackoffPreset): BackoffStrategy;
294
-
295
148
  /**
296
149
  * {@link reactiveSink} — canonical sink factory for Wave 5 adapters.
297
150
  *
@@ -473,335 +326,6 @@ type ReactiveSinkConfig<T, Ctx = unknown> = ReactiveSinkOptions<T> & {
473
326
  */
474
327
  declare function reactiveSink<T, Ctx = unknown>(source: Node<T>, config: ReactiveSinkConfig<T, Ctx>): ReactiveSinkHandle<T>;
475
328
 
476
- type RetryOptions = {
477
- /** Max retry attempts after each terminal `ERROR` (not counting the first failure). */
478
- count?: number;
479
- /** Delay between attempts; strategies use **nanoseconds**. */
480
- backoff?: BackoffStrategy | BackoffPreset;
481
- };
482
- /**
483
- * Resubscribes to the upstream node after each terminal `ERROR`, after an optional delay.
484
- *
485
- * @param source - Upstream node (should use `resubscribable: true`).
486
- * @param opts - `count` caps attempts; `backoff` supplies delay in **nanoseconds** (or a preset name).
487
- * @returns Node that retries on error.
488
- *
489
- * @remarks
490
- * **Resubscribable sources:** The upstream should use `resubscribable: true` if it must emit again after `ERROR`.
491
- * **Protocol:** Forwards unknown message tuples unchanged; handles `DIRTY`, `DATA`, `RESOLVED`, `COMPLETE`, `ERROR`.
492
- *
493
- * @example
494
- * ```ts
495
- * import { ERROR, NS_PER_SEC, pipe, producer, retry, constant } from "@graphrefly/graphrefly-ts";
496
- *
497
- * const src = producer(
498
- * (a) => {
499
- * a.down([[ERROR, new Error("x")]]);
500
- * },
501
- * { resubscribable: true },
502
- * );
503
- * const out = retry(src, { count: 2, backoff: constant(0.25 * NS_PER_SEC) });
504
- * ```
505
- *
506
- * @category extra
507
- */
508
- declare function retry<T>(source: Node<T>, opts?: RetryOptions): Node<T>;
509
- /**
510
- * Options for {@link retrySource}. Superset of {@link RetryOptions} with an
511
- * optional `initial` forwarded to the outer node cache.
512
- *
513
- * @category extra
514
- */
515
- type RetrySourceOptions<T> = RetryOptions & {
516
- /** Initial cache value for the outer node (forwarded to `NodeOptions.initial`). */
517
- initial?: T;
518
- };
519
- /**
520
- * Fresh-instance variant of {@link retry}: invokes the `factory` to build a
521
- * new `Node<T>` on every connect / reconnect. Unlike {@link retry}, which
522
- * re-subscribes to the same node (requiring `resubscribable: true`), this
523
- * creates a new source per attempt — ideal for producers that capture
524
- * per-attempt resources (sockets, clients, file handles) that become unusable
525
- * after an error.
526
- *
527
- * Synchronous exceptions thrown by `factory` are treated as terminal ERROR
528
- * and run through the same retry pipeline as inner-node ERROR.
529
- *
530
- * @param factory - Called to build a fresh source per attempt.
531
- * @param opts - `count` caps attempts; `backoff` supplies delay (ns) or preset.
532
- * @returns Node that retries by rebuilding the source.
533
- *
534
- * @example
535
- * ```ts
536
- * import { NS_PER_SEC, exponential, retrySource, fromWebSocket } from "@graphrefly/graphrefly-ts";
537
- *
538
- * // Each reconnect opens a fresh WebSocket:
539
- * const connected$ = retrySource(
540
- * () => fromWebSocket(new WebSocket("wss://example/stream")),
541
- * { count: 10, backoff: exponential({ baseNs: 1 * NS_PER_SEC }) },
542
- * );
543
- * ```
544
- *
545
- * @category extra
546
- */
547
- declare function retrySource<T>(factory: () => Node<T>, opts?: RetrySourceOptions<T>): Node<T>;
548
- type CircuitState = "closed" | "open" | "half-open";
549
- /**
550
- * Thrown when {@link withBreaker} is configured with `onOpen: "error"` and the breaker rejects work.
551
- *
552
- * @category extra
553
- */
554
- declare class CircuitOpenError extends Error {
555
- name: string;
556
- constructor();
557
- }
558
- interface CircuitBreakerOptions {
559
- /** Number of consecutive failures before opening. Default: 5. */
560
- failureThreshold?: number;
561
- /** Base cooldown in nanoseconds before transitioning to half-open. Default: 30s. */
562
- cooldownNs?: number;
563
- /** Backoff strategy for cooldown escalation across consecutive open cycles. Overrides `cooldownNs` when provided. */
564
- cooldown?: BackoffStrategy;
565
- /** Max trial requests allowed in half-open state. Default: 1. */
566
- halfOpenMax?: number;
567
- /** Clock function returning nanoseconds (for testability). Default: `monotonicNs`. */
568
- now?: () => number;
569
- }
570
- interface CircuitBreaker {
571
- /** Whether a request should be allowed through. Triggers open→half-open transition when cooldown expires. */
572
- canExecute(): boolean;
573
- /** Record a successful execution. Resets to closed. */
574
- recordSuccess(): void;
575
- /** Record a failed execution. May transition to open. */
576
- recordFailure(error?: unknown): void;
577
- /** Current circuit state (read-only, does not trigger transitions). */
578
- readonly state: CircuitState;
579
- /** Number of consecutive failures in the current closed period. */
580
- readonly failureCount: number;
581
- /** Manually reset to closed state, clearing all counters. */
582
- reset(): void;
583
- }
584
- /**
585
- * Factory for a synchronous circuit breaker with `closed`, `open`, and `half-open` states.
586
- *
587
- * Supports escalating cooldown via an optional {@link BackoffStrategy} — each consecutive
588
- * open→half-open→open cycle increments the backoff attempt.
589
- *
590
- * @param options - Threshold, cooldown, half-open limit, and optional clock override.
591
- * @returns {@link CircuitBreaker} instance.
592
- *
593
- * @remarks
594
- * **Timing:** Uses `monotonicNs()` by default (nanoseconds). Override `now` for tests.
595
- *
596
- * @example
597
- * ```ts
598
- * import { circuitBreaker, exponential, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
599
- *
600
- * const b = circuitBreaker({
601
- * failureThreshold: 3,
602
- * cooldown: exponential({ baseNs: 1 * NS_PER_SEC }),
603
- * });
604
- * ```
605
- *
606
- * @category extra
607
- */
608
- declare function circuitBreaker(options?: CircuitBreakerOptions): CircuitBreaker;
609
- type WithBreakerBundle<T> = {
610
- node: Node<T>;
611
- breakerState: Node<CircuitState>;
612
- };
613
- /**
614
- * Returns a unary wrapper that gates upstream `DATA` through a {@link CircuitBreaker}.
615
- *
616
- * @param breaker - Shared breaker instance (typically one per resource).
617
- * @param options - `onOpen: "skip"` emits `RESOLVED` when open; `"error"` emits {@link CircuitOpenError}.
618
- * @returns Function mapping `Node<T>` to `{ node, breakerState }` companion nodes.
619
- *
620
- * @remarks
621
- * **Success path:** `COMPLETE` calls {@link CircuitBreaker.recordSuccess}. **Failure path:** upstream `ERROR` calls {@link CircuitBreaker.recordFailure} and is forwarded.
622
- *
623
- * @example
624
- * ```ts
625
- * import { state, withBreaker, circuitBreaker } from "@graphrefly/graphrefly-ts";
626
- *
627
- * const b = circuitBreaker({ failureThreshold: 2 });
628
- * const s = state(1);
629
- * const { node, breakerState } = withBreaker(b)(s);
630
- * ```
631
- *
632
- * @category extra
633
- */
634
- declare function withBreaker<T>(breaker: CircuitBreaker, options?: {
635
- onOpen?: "skip" | "error";
636
- }): (source: Node<T>) => WithBreakerBundle<T>;
637
- interface TokenBucket {
638
- /** Number of tokens currently available (after refill). */
639
- available(): number;
640
- /** Try to consume `cost` tokens. Returns `true` if successful. */
641
- tryConsume(cost?: number): boolean;
642
- }
643
- /**
644
- * Token-bucket meter (capacity + refill rate per second). Use with {@link rateLimiter} or custom gates.
645
- *
646
- * @param capacity - Maximum tokens (must be positive).
647
- * @param refillPerSecond - Tokens added per elapsed second (non-negative).
648
- * @returns {@link TokenBucket} instance.
649
- *
650
- * @example
651
- * ```ts
652
- * import { tokenBucket } from "@graphrefly/graphrefly-ts";
653
- *
654
- * const bucket = tokenBucket(10, 2); // capacity 10, refill 2 tokens/sec
655
- * bucket.tryConsume(3); // true — 7 tokens remaining
656
- * bucket.available(); // ~7 (plus any elapsed refill)
657
- * ```
658
- *
659
- * @category extra
660
- */
661
- declare function tokenBucket(capacity: number, refillPerSecond: number): TokenBucket;
662
- type RateLimiterOverflowPolicy = "drop-oldest" | "drop-newest" | "error";
663
- type RateLimiterOptions = {
664
- /** Maximum `DATA` emissions per window (must be > 0). */
665
- maxEvents: number;
666
- /** Window length in nanoseconds (must be > 0). */
667
- windowNs: number;
668
- /** Cap on items queued while waiting for token refill (must be >= 1). Unbounded if omitted. */
669
- maxBuffer?: number;
670
- /** Overflow policy when `maxBuffer` is exceeded. Default: `"drop-newest"`. */
671
- onOverflow?: RateLimiterOverflowPolicy;
672
- };
673
- /**
674
- * Thrown by {@link rateLimiter} when `onOverflow: "error"` and the pending buffer is full.
675
- *
676
- * @category extra
677
- */
678
- declare class RateLimiterOverflowError extends Error {
679
- name: string;
680
- constructor(maxBuffer: number);
681
- }
682
- /**
683
- * Token-bucket rate limiter: at most `maxEvents` `DATA` values per `windowNs`.
684
- *
685
- * Uses {@link tokenBucket} internally (capacity = `maxEvents`, refill = `maxEvents / windowSeconds`).
686
- * Excess items are queued FIFO until a token is available. The queue may be bounded via
687
- * `maxBuffer` with a configurable overflow policy.
688
- *
689
- * @param source - Upstream node.
690
- * @param opts - Rate + optional bounded-buffer configuration.
691
- * @returns Node that emits DATA at most `maxEvents` per `windowNs`.
692
- *
693
- * @remarks
694
- * **Terminal:** `COMPLETE` / `ERROR` cancel the refill timer, drop the pending queue, and propagate.
695
- *
696
- * @example
697
- * ```ts
698
- * import { rateLimiter, state, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
699
- *
700
- * const src = state(0);
701
- * // Allow at most 5 DATA values per second; queue up to 100 excess items, drop newest beyond.
702
- * const limited = rateLimiter(src, { maxEvents: 5, windowNs: NS_PER_SEC, maxBuffer: 100 });
703
- * ```
704
- *
705
- * @category extra
706
- */
707
- declare function rateLimiter<T>(source: Node<T>, opts: RateLimiterOptions): Node<T>;
708
- type StatusValue = "pending" | "active" | "completed" | "errored";
709
- type WithStatusBundle<T> = {
710
- node: Node<T>;
711
- status: Node<StatusValue>;
712
- error: Node<unknown | null>;
713
- };
714
- /**
715
- * Wraps `src` with `status` and `error` {@link state} companions for UI or meta snapshots.
716
- *
717
- * @param src - Upstream node to mirror.
718
- * @param options - `initialStatus` defaults to `"pending"`.
719
- * @returns `{ node, status, error }` where `error` holds the last `ERROR` payload.
720
- *
721
- * @remarks
722
- * **Recovery:** After `errored`, the next `DATA` clears `error` and sets `active` inside {@link batch} (matches graphrefly-py).
723
- *
724
- * @example
725
- * ```ts
726
- * import { withStatus, state } from "@graphrefly/graphrefly-ts";
727
- *
728
- * const src = state<number>(0);
729
- * const { node, status, error } = withStatus(src);
730
- *
731
- * status.subscribe((msgs) => console.log("status:", msgs));
732
- * src.down([[DATA, 42]]); // status → "active"
733
- * ```
734
- *
735
- * @category extra
736
- */
737
- declare function withStatus<T>(src: Node<T>, options?: {
738
- initialStatus?: StatusValue;
739
- }): WithStatusBundle<T>;
740
- /**
741
- * Thrown by {@link timeout} when no `DATA` arrives within the deadline.
742
- *
743
- * @category extra
744
- */
745
- declare class TimeoutError extends Error {
746
- name: string;
747
- constructor(ns: number);
748
- }
749
- /** Inputs accepted by {@link fallback}. */
750
- type FallbackInput<T> = T | Node<T> | PromiseLike<T> | AsyncIterable<T>;
751
- /**
752
- * On upstream terminal `ERROR`, switch to a fallback source instead of propagating the error.
753
- *
754
- * Accepts any of:
755
- * - **scalar value** — emits `[[DATA, fb], [COMPLETE]]`
756
- * - **`Node<T>`** — subscribes and forwards all messages (push-on-subscribe delivers current cache)
757
- * - **`Promise<T>` / thenable** — resolves into a one-shot `DATA` then `COMPLETE` (via {@link fromAny})
758
- * - **`AsyncIterable<T>`** — streams each yielded value as `DATA`, then `COMPLETE` (via {@link fromAny})
759
- *
760
- * Non-`Node` inputs are routed through {@link fromAny} so the fallback participates in the
761
- * reactive protocol uniformly. Bare strings, arrays, and other synchronous scalars are treated
762
- * as single values (NOT split into characters / elements) to avoid the `fromAny`-on-string
763
- * iteration gotcha.
764
- *
765
- * Composes naturally with {@link retry}:
766
- * `pipe(source, retry({count:3}), fallback("default"))`.
767
- *
768
- * @param source - Upstream node.
769
- * @param fb - Fallback value, node, promise, or async iterable.
770
- * @returns Node that replaces errors with the fallback.
771
- *
772
- * @example
773
- * ```ts
774
- * import { fallback, throwError } from "@graphrefly/graphrefly-ts";
775
- *
776
- * const safe = fallback(throwError(new Error("boom")), "default");
777
- * safe.cache; // "default" after subscribe
778
- * ```
779
- *
780
- * @category extra
781
- */
782
- declare function fallback<T>(source: Node<T>, fb: FallbackInput<T>): Node<T>;
783
- /**
784
- * Emits `ERROR` with {@link TimeoutError} if no `DATA` arrives within the deadline.
785
- *
786
- * The timer starts on subscription and resets on each `DATA`. `DIRTY` does NOT reset
787
- * the timer. Terminal messages (`COMPLETE`/`ERROR`) cancel the timer.
788
- *
789
- * @param source - Upstream node.
790
- * @param timeoutNs - Deadline in nanoseconds.
791
- * @returns Node that errors on timeout.
792
- *
793
- * @example
794
- * ```ts
795
- * import { timeout, never, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
796
- *
797
- * const t = timeout(never(), 5 * NS_PER_SEC);
798
- * // After 5 seconds with no DATA: [[ERROR, TimeoutError]]
799
- * ```
800
- *
801
- * @category extra
802
- */
803
- declare function timeout<T>(source: Node<T>, timeoutNs: number): Node<T>;
804
-
805
329
  /**
806
330
  * Protocol, system, and ingest adapters (roadmap §5.2, §5.2c).
807
331
  *
@@ -826,7 +350,7 @@ type SinkHandle = {
826
350
  /** Manually drain the internal buffer (buffered sinks only). */
827
351
  flush?: () => Promise<void>;
828
352
  };
829
- type ExtraOpts$2 = Omit<NodeOptions, "describeKind">;
353
+ type ExtraOpts = Omit<NodeOptions, "describeKind">;
830
354
  /** WebSocket-like transport accepted by {@link fromWebSocket} / {@link toWebSocket}. */
831
355
  type WebSocketLike = {
832
356
  send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
@@ -846,11 +370,11 @@ type WebSocketRegister<T> = (emit: (payload: T) => void, error: (err: unknown) =
846
370
  *
847
371
  * @category extra
848
372
  */
849
- declare function fromWebSocket<T = unknown>(socket: WebSocketLike, opts?: ExtraOpts$2 & {
373
+ declare function fromWebSocket<T = unknown>(socket: WebSocketLike, opts?: ExtraOpts & {
850
374
  parse?: (payload: unknown, event: unknown) => T;
851
375
  closeOnTeardown?: boolean;
852
376
  }): Node<T>;
853
- declare function fromWebSocket<T = unknown>(register: WebSocketRegister<T>, opts?: ExtraOpts$2 & {
377
+ declare function fromWebSocket<T = unknown>(register: WebSocketRegister<T>, opts?: ExtraOpts & {
854
378
  parse?: (payload: unknown, event: unknown) => T;
855
379
  closeOnTeardown?: boolean;
856
380
  }): Node<T>;
@@ -916,7 +440,7 @@ type WebhookRegister<T> = ExternalRegister<EmitTriad<T>>;
916
440
  *
917
441
  * @category extra
918
442
  */
919
- declare function fromWebhook<T = unknown>(register: WebhookRegister<T>, opts?: ExtraOpts$2): Node<T>;
443
+ declare function fromWebhook<T = unknown>(register: WebhookRegister<T>, opts?: ExtraOpts): Node<T>;
920
444
  /**
921
445
  * Options for {@link fromHTTP}.
922
446
  *
@@ -973,7 +497,7 @@ type HTTPBundle<T> = WithStatusBundle<T> & {
973
497
  */
974
498
  declare function fromHTTP<T = any>(url: string, opts?: FromHTTPOptions): HTTPBundle<T>;
975
499
  /** Options for {@link toHTTP}. */
976
- type ToHTTPOptions<T> = ExtraOpts$2 & {
500
+ type ToHTTPOptions<T> = ExtraOpts & {
977
501
  /** HTTP method. Default: `"POST"`. */
978
502
  method?: string;
979
503
  /** Request headers applied to every call. Caller sets Content-Type. */
@@ -1064,7 +588,7 @@ type SSEEvent<T = string> = {
1064
588
  retry?: number;
1065
589
  };
1066
590
  /** Options for {@link fromSSE}. */
1067
- type FromSSEOptions<T = string> = ExtraOpts$2 & {
591
+ type FromSSEOptions<T = string> = ExtraOpts & {
1068
592
  /** Parse the raw `data:` payload. Default: identity (string). */
1069
593
  parse?: (raw: string) => T;
1070
594
  };
@@ -1079,7 +603,7 @@ type FromSSEOptions<T = string> = ExtraOpts$2 & {
1079
603
  */
1080
604
  declare function fromSSE<T = string>(source: ReadableStream<Uint8Array> | Response | AsyncIterable<Uint8Array>, opts?: FromSSEOptions<T>): Node<SSEEvent<T>>;
1081
605
  /** Options for {@link fromHTTPStream}. */
1082
- type FromHTTPStreamOptions = ExtraOpts$2 & {
606
+ type FromHTTPStreamOptions = ExtraOpts & {
1083
607
  method?: string;
1084
608
  headers?: Record<string, string>;
1085
609
  body?: unknown;
@@ -1148,7 +672,7 @@ type ToWebSocketOptions<T> = {
1148
672
  */
1149
673
  declare function toWebSocket<T>(source: Node<T>, socket: WebSocketLike, opts?: ToWebSocketOptions<T>): ReactiveSinkHandle<T>;
1150
674
  /** Options for {@link fromWebSocketReconnect}. */
1151
- type FromWebSocketReconnectOptions<T> = ExtraOpts$2 & {
675
+ type FromWebSocketReconnectOptions<T> = ExtraOpts & {
1152
676
  /** Optional parser applied to incoming messages. */
1153
677
  parse?: (payload: unknown, event: unknown) => T;
1154
678
  /** Max reconnect attempts. Default: `Infinity` (implied when `backoff` is set). */
@@ -1191,7 +715,7 @@ type MCPClientLike = {
1191
715
  setNotificationHandler(method: string, handler: (notification: unknown) => void): void;
1192
716
  };
1193
717
  /** Options for {@link fromMCP}. */
1194
- type FromMCPOptions = ExtraOpts$2 & {
718
+ type FromMCPOptions = ExtraOpts & {
1195
719
  /** MCP notification method to subscribe to. Default `"notifications/message"`. */
1196
720
  method?: string;
1197
721
  onDisconnect?: (cb: (err?: unknown) => void) => void;
@@ -1202,36 +726,6 @@ type FromMCPOptions = ExtraOpts$2 & {
1202
726
  * @category extra
1203
727
  */
1204
728
  declare function fromMCP<T = unknown>(client: MCPClientLike, opts?: FromMCPOptions): Node<T>;
1205
- /** Git hook type for {@link fromGitHook}. */
1206
- type GitHookType = "post-commit" | "post-merge" | "post-checkout" | "post-rewrite";
1207
- /** Structured git event emitted by {@link fromGitHook}. */
1208
- type GitEvent = {
1209
- hook: GitHookType;
1210
- commit: string;
1211
- files: string[];
1212
- message: string;
1213
- author: string;
1214
- timestamp_ns: number;
1215
- };
1216
- /** Options for {@link fromGitHook}. */
1217
- type FromGitHookOptions = ExtraOpts$2 & {
1218
- pollMs?: number;
1219
- include?: string[];
1220
- exclude?: string[];
1221
- /**
1222
- * Maximum consecutive poll errors before terminating the source. Prevents
1223
- * error storms when the repository is unavailable (e.g. deleted, corrupt,
1224
- * permissions lost). Default: `1` (terminate on first error — preserves pre-switchMap back-compat). Raise it (or set `Infinity`) to keep retrying
1225
- * indefinitely (legacy behavior).
1226
- */
1227
- maxConsecutiveErrors?: number;
1228
- };
1229
- /**
1230
- * Git change detection as a reactive source.
1231
- *
1232
- * @category extra
1233
- */
1234
- declare function fromGitHook(repoPath: string, opts?: FromGitHookOptions): Node<GitEvent>;
1235
729
  /** Standard handler triple for adapters that accept injected registrations. Alias of {@link EmitTriad}. */
1236
730
  type AdapterHandlers<T> = EmitTriad<T>;
1237
731
  /**
@@ -1329,7 +823,7 @@ type OTelRegister = (handlers: {
1329
823
  onError: (err: unknown) => void;
1330
824
  }) => (() => void) | undefined;
1331
825
  /** Options for {@link fromOTel}. */
1332
- type FromOTelOptions = ExtraOpts$2 & {};
826
+ type FromOTelOptions = ExtraOpts & {};
1333
827
  /** Bundle returned by {@link fromOTel}. */
1334
828
  type OTelBundle = {
1335
829
  traces: Node<OTelSpan>;
@@ -1383,7 +877,7 @@ type SyslogMessage = {
1383
877
  /** Registration callback for syslog receiver. Alias of {@link ExternalRegister} over {@link EmitTriad}. */
1384
878
  type SyslogRegister = ExternalRegister<EmitTriad<SyslogMessage>>;
1385
879
  /** Options for {@link fromSyslog}. */
1386
- type FromSyslogOptions = ExtraOpts$2 & {};
880
+ type FromSyslogOptions = ExtraOpts & {};
1387
881
  /**
1388
882
  * RFC 5424 syslog receiver as a reactive source.
1389
883
  *
@@ -1433,7 +927,7 @@ type StatsDMetric = {
1433
927
  /** Registration callback for StatsD receiver. Alias of {@link ExternalRegister} over {@link EmitTriad}. */
1434
928
  type StatsDRegister = ExternalRegister<EmitTriad<StatsDMetric>>;
1435
929
  /** Options for {@link fromStatsD}. */
1436
- type FromStatsDOptions = ExtraOpts$2 & {};
930
+ type FromStatsDOptions = ExtraOpts & {};
1437
931
  /**
1438
932
  * StatsD/DogStatsD UDP receiver as a reactive source.
1439
933
  *
@@ -1571,7 +1065,7 @@ type KafkaMessage<T = unknown> = {
1571
1065
  timestampNs: number;
1572
1066
  };
1573
1067
  /** Options for {@link fromKafka}. */
1574
- type FromKafkaOptions = ExtraOpts$2 & {
1068
+ type FromKafkaOptions = ExtraOpts & {
1575
1069
  /** Start from beginning of topic. Default: `false`. */
1576
1070
  fromBeginning?: boolean;
1577
1071
  /** Deserialize message value. Default: `JSON.parse(buffer.toString())`. */
@@ -1604,7 +1098,7 @@ type FromKafkaOptions = ExtraOpts$2 & {
1604
1098
  */
1605
1099
  declare function fromKafka<T = unknown>(consumer: KafkaConsumerLike, topic: string, opts?: FromKafkaOptions): Node<KafkaMessage<T>>;
1606
1100
  /** Options for {@link toKafka}. */
1607
- type ToKafkaOptions<T> = ExtraOpts$2 & {
1101
+ type ToKafkaOptions<T> = ExtraOpts & {
1608
1102
  /** Serialize value for Kafka. Default: `JSON.stringify`. */
1609
1103
  serialize?: (value: T) => string | Buffer;
1610
1104
  /** Extract message key from value. Default: `null` (no key). */
@@ -1638,7 +1132,7 @@ type RedisStreamEntry<T = unknown> = {
1638
1132
  timestampNs: number;
1639
1133
  };
1640
1134
  /** Options for {@link fromRedisStream}. */
1641
- type FromRedisStreamOptions = ExtraOpts$2 & {
1135
+ type FromRedisStreamOptions = ExtraOpts & {
1642
1136
  /** Block timeout in ms for XREAD. Default: `5000`. */
1643
1137
  blockMs?: number;
1644
1138
  /** Start ID. Default: `"$"` (new entries only). */
@@ -1670,7 +1164,7 @@ type FromRedisStreamOptions = ExtraOpts$2 & {
1670
1164
  */
1671
1165
  declare function fromRedisStream<T = unknown>(client: RedisClientLike, key: string, opts?: FromRedisStreamOptions): Node<RedisStreamEntry<T>>;
1672
1166
  /** Options for {@link toRedisStream}. */
1673
- type ToRedisStreamOptions<T> = ExtraOpts$2 & {
1167
+ type ToRedisStreamOptions<T> = ExtraOpts & {
1674
1168
  /** Serialize value to Redis hash fields. Default: `["data", JSON.stringify(value)]`. */
1675
1169
  serialize?: (value: T) => string[];
1676
1170
  /** Max stream length (MAXLEN ~). Default: no trimming. */
@@ -1693,7 +1187,7 @@ declare function toRedisStream<T>(source: Node<T>, client: RedisClientLike, key:
1693
1187
  /** Parsed CSV row. */
1694
1188
  type CSVRow = Record<string, string>;
1695
1189
  /** Options for {@link fromCSV}. */
1696
- type FromCSVOptions = ExtraOpts$2 & {
1190
+ type FromCSVOptions = ExtraOpts & {
1697
1191
  /** Column delimiter. Default: `","`. */
1698
1192
  delimiter?: string;
1699
1193
  /** Whether the first row is a header. Default: `true`. */
@@ -1750,9 +1244,9 @@ declare function csvRows(source: Node<string>, opts?: FromCSVOptions): Node<CSVR
1750
1244
  *
1751
1245
  * @category extra
1752
1246
  */
1753
- declare function ndjsonRows<T = unknown>(source: Node<string>, opts?: ExtraOpts$2): Node<T>;
1247
+ declare function ndjsonRows<T = unknown>(source: Node<string>, opts?: ExtraOpts): Node<T>;
1754
1248
  /** Options for {@link fromNDJSON}. */
1755
- type FromNDJSONOptions = ExtraOpts$2 & {};
1249
+ type FromNDJSONOptions = ExtraOpts & {};
1756
1250
  /**
1757
1251
  * Newline-delimited JSON stream ingest for batch replay.
1758
1252
  *
@@ -1858,7 +1352,7 @@ type PulsarMessage<T = unknown> = {
1858
1352
  timestampNs: number;
1859
1353
  };
1860
1354
  /** Options for {@link fromPulsar}. */
1861
- type FromPulsarOptions = ExtraOpts$2 & {
1355
+ type FromPulsarOptions = ExtraOpts & {
1862
1356
  /** Deserialize message data. Default: `JSON.parse(buffer.toString())`. */
1863
1357
  deserialize?: (data: Buffer) => unknown;
1864
1358
  /** Acknowledge messages automatically. Default: `true`. */
@@ -1905,7 +1399,7 @@ declare function fromPulsar<T = unknown>(consumer: PulsarConsumerLike, opts: Fro
1905
1399
  autoAck: false;
1906
1400
  }): Node<AckableMessage<PulsarMessage<T>>>;
1907
1401
  /** Options for {@link toPulsar}. */
1908
- type ToPulsarOptions<T> = ExtraOpts$2 & {
1402
+ type ToPulsarOptions<T> = ExtraOpts & {
1909
1403
  /** Serialize value for Pulsar. Default: `JSON.stringify` → Buffer. */
1910
1404
  serialize?: (value: T) => Buffer;
1911
1405
  /** Extract partition key from value. Default: none. */
@@ -1958,7 +1452,7 @@ type NATSMessage<T = unknown> = {
1958
1452
  timestampNs: number;
1959
1453
  };
1960
1454
  /** Options for {@link fromNATS}. */
1961
- type FromNATSOptions = ExtraOpts$2 & {
1455
+ type FromNATSOptions = ExtraOpts & {
1962
1456
  /** Queue group name for load balancing. */
1963
1457
  queue?: string;
1964
1458
  /** Deserialize message data. Default: `JSON.parse(textDecoder.decode(data))`. */
@@ -1992,7 +1486,7 @@ type FromNATSOptions = ExtraOpts$2 & {
1992
1486
  */
1993
1487
  declare function fromNATS<T = unknown>(client: NATSClientLike, subject: string, opts?: FromNATSOptions): Node<NATSMessage<T>>;
1994
1488
  /** Options for {@link toNATS}. */
1995
- type ToNATSOptions<T> = ExtraOpts$2 & {
1489
+ type ToNATSOptions<T> = ExtraOpts & {
1996
1490
  /** Serialize value for NATS. Default: `JSON.stringify` → Uint8Array. */
1997
1491
  serialize?: (value: T) => Uint8Array;
1998
1492
  /** Called on serialization failures. */
@@ -2043,7 +1537,7 @@ type RabbitMQMessage<T = unknown> = {
2043
1537
  timestampNs: number;
2044
1538
  };
2045
1539
  /** Options for {@link fromRabbitMQ}. */
2046
- type FromRabbitMQOptions = ExtraOpts$2 & {
1540
+ type FromRabbitMQOptions = ExtraOpts & {
2047
1541
  /** Deserialize message content. Default: `JSON.parse(buffer.toString())`. */
2048
1542
  deserialize?: (content: Buffer) => unknown;
2049
1543
  /** Auto-acknowledge messages. Default: `true`. */
@@ -2092,7 +1586,7 @@ declare function fromRabbitMQ<T = unknown>(channel: RabbitMQChannelLike, queue:
2092
1586
  autoAck: false;
2093
1587
  }): Node<AckableMessage<RabbitMQMessage<T>>>;
2094
1588
  /** Options for {@link toRabbitMQ}. */
2095
- type ToRabbitMQOptions<T> = ExtraOpts$2 & {
1589
+ type ToRabbitMQOptions<T> = ExtraOpts & {
2096
1590
  /** Serialize value for RabbitMQ. Default: `Buffer.from(JSON.stringify(value))`. */
2097
1591
  serialize?: (value: T) => Buffer;
2098
1592
  /** Extract routing key from value. Default: `""`. */
@@ -2123,7 +1617,7 @@ type FileWriterLike = {
2123
1617
  end(): void;
2124
1618
  };
2125
1619
  /** Options for {@link toFile}. */
2126
- type ToFileOptions<T> = ExtraOpts$2 & {
1620
+ type ToFileOptions<T> = ExtraOpts & {
2127
1621
  /** Serialize a value to a string line. Default: `JSON.stringify(v) + "\n"`. */
2128
1622
  serialize?: (value: T) => string;
2129
1623
  /** `"append"` (default) or `"overwrite"` — controls initial file behavior hint. */
@@ -2149,7 +1643,7 @@ type ToFileOptions<T> = ExtraOpts$2 & {
2149
1643
  */
2150
1644
  declare function toFile<T>(source: Node<T>, writer: FileWriterLike, opts?: ToFileOptions<T>): ReactiveSinkHandle<T>;
2151
1645
  /** Options for {@link toCSV}. */
2152
- type ToCSVOptions<T> = ExtraOpts$2 & {
1646
+ type ToCSVOptions<T> = ExtraOpts & {
2153
1647
  /** Column names. Required — determines header row and field order. */
2154
1648
  columns: string[];
2155
1649
  /** Column delimiter. Default: `","`. */
@@ -2184,7 +1678,7 @@ type ClickHouseInsertClientLike = {
2184
1678
  }): Promise<void>;
2185
1679
  };
2186
1680
  /** Options for {@link toClickHouse}. */
2187
- type ToClickHouseOptions<T> = ExtraOpts$2 & {
1681
+ type ToClickHouseOptions<T> = ExtraOpts & {
2188
1682
  /** Batch size before auto-flush. Default: `1000`. */
2189
1683
  batchSize?: number;
2190
1684
  /** Flush interval in ms. Default: `5000`. */
@@ -2219,7 +1713,7 @@ type S3ClientLike = {
2219
1713
  }): Promise<unknown>;
2220
1714
  };
2221
1715
  /** Options for {@link toS3}. */
2222
- type ToS3Options<T> = ExtraOpts$2 & {
1716
+ type ToS3Options<T> = ExtraOpts & {
2223
1717
  /** Output format. Default: `"ndjson"`. */
2224
1718
  format?: "ndjson" | "json";
2225
1719
  /** Generate the S3 key for each batch. Receives `(seq, wallClockNs)`. Default: ISO timestamp + sequence. */
@@ -2249,7 +1743,7 @@ type PostgresClientLike = {
2249
1743
  query(sql: string, params?: unknown[]): Promise<unknown>;
2250
1744
  };
2251
1745
  /** Options for {@link toPostgres}. */
2252
- type ToPostgresOptions<T> = ExtraOpts$2 & {
1746
+ type ToPostgresOptions<T> = ExtraOpts & {
2253
1747
  /** Build the SQL + params for an insert. Default: JSON insert into `table`. */
2254
1748
  toSQL?: (value: T, table: string) => {
2255
1749
  sql: string;
@@ -2274,7 +1768,7 @@ type MongoCollectionLike = {
2274
1768
  insertOne(doc: unknown): Promise<unknown>;
2275
1769
  };
2276
1770
  /** Options for {@link toMongo}. */
2277
- type ToMongoOptions<T> = ExtraOpts$2 & {
1771
+ type ToMongoOptions<T> = ExtraOpts & {
2278
1772
  /** Transform value to a MongoDB document. Default: identity. */
2279
1773
  toDocument?: (value: T) => unknown;
2280
1774
  onTransportError?: (err: SinkTransportError) => void;
@@ -2302,7 +1796,7 @@ type LokiClientLike = {
2302
1796
  }): Promise<unknown>;
2303
1797
  };
2304
1798
  /** Options for {@link toLoki}. */
2305
- type ToLokiOptions<T> = ExtraOpts$2 & {
1799
+ type ToLokiOptions<T> = ExtraOpts & {
2306
1800
  /** Static labels applied to every log entry. */
2307
1801
  labels?: Record<string, string>;
2308
1802
  /** Extract the log line from a value. Default: `JSON.stringify(v)`. */
@@ -2329,7 +1823,7 @@ type TempoClientLike = {
2329
1823
  }): Promise<unknown>;
2330
1824
  };
2331
1825
  /** Options for {@link toTempo}. */
2332
- type ToTempoOptions<T> = ExtraOpts$2 & {
1826
+ type ToTempoOptions<T> = ExtraOpts & {
2333
1827
  /** Transform a value into OTLP resourceSpans entries. */
2334
1828
  toResourceSpans?: (value: T) => unknown[];
2335
1829
  onTransportError?: (err: SinkTransportError) => void;
@@ -2422,7 +1916,7 @@ type SqliteDbLike = {
2422
1916
  query(sql: string, params?: unknown[]): unknown[];
2423
1917
  };
2424
1918
  /** Options for {@link fromSqlite}. */
2425
- type FromSqliteOptions<T> = ExtraOpts$2 & {
1919
+ type FromSqliteOptions<T> = ExtraOpts & {
2426
1920
  /** Map a raw row object to the desired type. Default: identity cast. */
2427
1921
  mapRow?: (row: unknown) => T;
2428
1922
  /** Bind parameters for the query. */
@@ -2474,7 +1968,7 @@ type SqliteIterableDbLike = {
2474
1968
  */
2475
1969
  declare function fromSqliteCursor<T = unknown>(db: SqliteIterableDbLike, query: string, opts?: FromSqliteOptions<T>): Node<T>;
2476
1970
  /** Options for {@link toSqlite}. */
2477
- type ToSqliteOptions<T> = ExtraOpts$2 & {
1971
+ type ToSqliteOptions<T> = ExtraOpts & {
2478
1972
  /** Build SQL + params for an insert. Default: JSON insert into `(data)` column. */
2479
1973
  toSQL?: (value: T, table: string) => {
2480
1974
  sql: string;
@@ -2530,7 +2024,7 @@ type PrismaModelLike<T = unknown> = {
2530
2024
  findMany(args?: unknown): Promise<T[]>;
2531
2025
  };
2532
2026
  /** Options for {@link fromPrisma}. */
2533
- type FromPrismaOptions<T, U = T> = ExtraOpts$2 & {
2027
+ type FromPrismaOptions<T, U = T> = ExtraOpts & {
2534
2028
  /** Prisma `findMany` args (where, orderBy, select, include, take, skip, etc.). */
2535
2029
  args?: unknown;
2536
2030
  /** Map each row to the desired shape. Default: identity cast. */
@@ -2571,7 +2065,7 @@ type DrizzleQueryLike<T = unknown> = {
2571
2065
  execute(): Promise<T[]>;
2572
2066
  };
2573
2067
  /** Options for {@link fromDrizzle}. */
2574
- type FromDrizzleOptions<T, U = T> = ExtraOpts$2 & {
2068
+ type FromDrizzleOptions<T, U = T> = ExtraOpts & {
2575
2069
  /** Map each row to the desired shape. Default: identity cast. */
2576
2070
  mapRow?: (row: T) => U;
2577
2071
  };
@@ -2607,7 +2101,7 @@ type KyselyQueryLike<T = unknown> = {
2607
2101
  execute(): Promise<T[]>;
2608
2102
  };
2609
2103
  /** Options for {@link fromKysely}. */
2610
- type FromKyselyOptions<T, U = T> = ExtraOpts$2 & {
2104
+ type FromKyselyOptions<T, U = T> = ExtraOpts & {
2611
2105
  /** Map each row to the desired shape. Default: identity cast. */
2612
2106
  mapRow?: (row: T) => U;
2613
2107
  };
@@ -2818,911 +2312,24 @@ declare function parseCron(expr: string): CronSchedule;
2818
2312
  declare function matchesCron(schedule: CronSchedule, date: Date): boolean;
2819
2313
 
2820
2314
  /**
2821
- * Tier 1 sync operators (roadmap §2.1) and Tier 2 async/dynamic operators (roadmap §2.2) —
2822
- * each returns a {@link Node} built with {@link node} (or {@link producer} for cold sources).
2315
+ * Lazy per-topic state hub (roadmap §3.2) lightweight last-value broadcasts.
2823
2316
  *
2824
- * v5 foundation redesign: all operators use `actions.emit()` for value emission,
2825
- * `ctx.store` for persistent state, `ctx.terminalDeps` for terminal handling,
2826
- * and `data[i]` batch shape for DATA vs RESOLVED discrimination. `onMessage`
2827
- * and `onResubscribe` are removed.
2317
+ * Each topic is a sentinel `node<unknown>()` with push-on-subscribe replay of
2318
+ * the most recent published value (no push until the first `publish`). For
2319
+ * Pulsar-inspired retained message logs,
2320
+ * cursor-based subscriptions, and job-queue semantics, use `messagingHub()` in
2321
+ * `patterns/messaging.ts` — built on `TopicGraph` / `SubscriptionGraph` with
2322
+ * retention policies, absolute cursor tracking, and per-subscriber state.
2323
+ *
2324
+ * **Wave 4 refactor (2026-04-15):** Introduces `PubSubBackend` (thin registry
2325
+ * with version counter). Converts class-based hub to closure factory for
2326
+ * consistency with other `extra/` factories. New bundle APIs: `has(name)`,
2327
+ * `size`, `topicNames()`, `publishMany(entries)`. `removeTopic` → `TEARDOWN`
2328
+ * semantics preserved.
2828
2329
  */
2829
2330
 
2830
- type ExtraOpts$1 = Omit<NodeOptions<unknown>, "describeKind">;
2831
2331
  /**
2832
- * Maps each settled value from `source` through `project`.
2833
- *
2834
- * @param source - Upstream node.
2835
- * @param project - Transform for each value.
2836
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
2837
- * @returns `Node<R>` - Derived node emitting mapped values.
2838
- *
2839
- * @example
2840
- * ```ts
2841
- * import { map, state } from "@graphrefly/graphrefly-ts";
2842
- *
2843
- * const n = map(state(2), (x) => x * 3);
2844
- * ```
2845
- *
2846
- * @category extra
2847
- */
2848
- declare function map<T, R>(source: Node<T>, project: (value: T) => R, opts?: ExtraOpts$1): Node<R>;
2849
- /**
2850
- * Forwards values that satisfy `predicate`; otherwise emits `RESOLVED` with no `DATA` (two-phase semantics).
2851
- *
2852
- * @param source - Upstream node.
2853
- * @param predicate - Inclusion test.
2854
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
2855
- * @returns `Node<T>` - Filtered node.
2856
- *
2857
- * @example
2858
- * ```ts
2859
- * import { filter, state } from "@graphrefly/graphrefly-ts";
2860
- *
2861
- * const n = filter(state(1), (x) => x > 0);
2862
- * ```
2863
- *
2864
- * @category extra
2865
- */
2866
- declare function filter<T>(source: Node<T>, predicate: (value: T) => boolean, opts?: ExtraOpts$1): Node<T>;
2867
- /**
2868
- * Folds each upstream value into an accumulator; emits the new accumulator every time.
2869
- *
2870
- * Unlike RxJS, `seed` is always required — there is no seedless mode where the first
2871
- * value silently becomes the accumulator.
2872
- *
2873
- * @param source - Upstream node.
2874
- * @param reducer - `(acc, value) => nextAcc`.
2875
- * @param seed - Initial accumulator (required).
2876
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
2877
- * @returns `Node<R>` - Scan node.
2878
- *
2879
- * @example
2880
- * ```ts
2881
- * import { scan, state } from "@graphrefly/graphrefly-ts";
2882
- *
2883
- * const n = scan(state(1), (a, x) => a + x, 0);
2884
- * ```
2885
- *
2886
- * @category extra
2887
- */
2888
- declare function scan<T, R>(source: Node<T>, reducer: (acc: R, value: T) => R, seed: R, opts?: ExtraOpts$1): Node<R>;
2889
- /**
2890
- * Reduces to one value emitted when `source` completes; if no `DATA` arrived, emits `seed`.
2891
- *
2892
- * Unlike RxJS, `seed` is always required. If the source completes without emitting
2893
- * DATA, the seed value is emitted (RxJS would throw without a seed).
2894
- *
2895
- * @param source - Upstream node.
2896
- * @param reducer - `(acc, value) => nextAcc`.
2897
- * @param seed - Empty-completion default and initial accumulator (required).
2898
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
2899
- * @returns `Node<R>` - Node that emits once on completion.
2900
- *
2901
- * @example
2902
- * ```ts
2903
- * import { reduce, state } from "@graphrefly/graphrefly-ts";
2904
- *
2905
- * const n = reduce(state(1), (a, x) => a + x, 0);
2906
- * ```
2907
- *
2908
- * @category extra
2909
- */
2910
- declare function reduce<T, R>(source: Node<T>, reducer: (acc: R, value: T) => R, seed: R, opts?: ExtraOpts$1): Node<R>;
2911
- /**
2912
- * Emits at most `count` **`DATA`** values, then **`COMPLETE`**. `RESOLVED` does not advance the counter.
2913
- *
2914
- * @param source - Upstream node.
2915
- * @param count - Maximum `DATA` emissions (≤0 completes immediately).
2916
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
2917
- * @returns `Node<T>` - Limited stream.
2918
- *
2919
- * @example
2920
- * ```ts
2921
- * import { take, state } from "@graphrefly/graphrefly-ts";
2922
- *
2923
- * const n = take(state(0), 3);
2924
- * ```
2925
- *
2926
- * @category extra
2927
- */
2928
- declare function take<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<T>;
2929
- /**
2930
- * Skips the first `count` **`DATA`** emissions. `RESOLVED` does not advance the counter.
2931
- *
2932
- * @param source - Upstream node.
2933
- * @param count - Number of `DATA` values to drop.
2934
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
2935
- * @returns `Node<T>` - Skipped stream.
2936
- *
2937
- * @example
2938
- * ```ts
2939
- * import { skip, state } from "@graphrefly/graphrefly-ts";
2940
- *
2941
- * const n = skip(state(0), 2);
2942
- * ```
2943
- *
2944
- * @category extra
2945
- */
2946
- declare function skip<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<T>;
2947
- /**
2948
- * Emits while `predicate` holds; on first false, sends **`COMPLETE`**.
2949
- *
2950
- * @param source - Upstream node.
2951
- * @param predicate - Continuation test.
2952
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
2953
- * @returns `Node<T>` - Truncated stream.
2954
- *
2955
- * @example
2956
- * ```ts
2957
- * import { takeWhile, state } from "@graphrefly/graphrefly-ts";
2958
- *
2959
- * const n = takeWhile(state(1), (x) => x < 10);
2960
- * ```
2961
- *
2962
- * @category extra
2963
- */
2964
- declare function takeWhile<T>(source: Node<T>, predicate: (value: T) => boolean, opts?: ExtraOpts$1): Node<T>;
2965
- /**
2966
- * Forwards `source` until `notifier` matches `predicate` (default: notifier **`DATA`**), then **`COMPLETE`**.
2967
- *
2968
- * @param source - Main upstream.
2969
- * @param notifier - Triggers completion when `predicate(msg)` is true.
2970
- * @param opts - Optional {@link NodeOptions}, plus `predicate` for custom notifier matching.
2971
- * @returns `Node<T>` - Truncated stream.
2972
- *
2973
- * @example
2974
- * ```ts
2975
- * import { producer, takeUntil, state } from "@graphrefly/graphrefly-ts";
2976
- *
2977
- * const src = state(1);
2978
- * const stop = producer((_d, a) => a.emit(undefined));
2979
- * const n = takeUntil(src, stop);
2980
- * ```
2981
- *
2982
- * @category extra
2983
- */
2984
- declare function takeUntil<T>(source: Node<T>, notifier: Node, opts?: ExtraOpts$1 & {
2985
- predicate?: (msg: Message) => boolean;
2986
- }): Node<T>;
2987
- /**
2988
- * Emits the first **`DATA`** then **`COMPLETE`** (same as `take(source, 1)`).
2989
- *
2990
- * @param source - Upstream node.
2991
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
2992
- * @returns `Node<T>` - Single-value stream.
2993
- *
2994
- * @example
2995
- * ```ts
2996
- * import { first, state } from "@graphrefly/graphrefly-ts";
2997
- *
2998
- * const n = first(state(42));
2999
- * ```
3000
- *
3001
- * @category extra
3002
- */
3003
- declare function first<T>(source: Node<T>, opts?: ExtraOpts$1): Node<T>;
3004
- /**
3005
- * Buffers values and emits the last **`DATA`** on **`COMPLETE`**; optional `defaultValue` if none arrived.
3006
- *
3007
- * @param source - Upstream node.
3008
- * @param options - Optional {@link NodeOptions} and `defaultValue` when empty.
3009
- * @returns `Node<T>` - Last-or-default node.
3010
- *
3011
- * @example
3012
- * ```ts
3013
- * import { last, state } from "@graphrefly/graphrefly-ts";
3014
- *
3015
- * const n = last(state(1), { defaultValue: 0 });
3016
- * ```
3017
- *
3018
- * @category extra
3019
- */
3020
- declare function last<T>(source: Node<T>, options?: ExtraOpts$1 & {
3021
- defaultValue?: T;
3022
- }): Node<T>;
3023
- /**
3024
- * Emits the first value matching `predicate`, then **`COMPLETE`**.
3025
- *
3026
- * @param source - Upstream node.
3027
- * @param predicate - Match test.
3028
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3029
- * @returns `Node<T>` - First-match stream.
3030
- *
3031
- * @example
3032
- * ```ts
3033
- * import { find, state } from "@graphrefly/graphrefly-ts";
3034
- *
3035
- * const n = find(state(1), (x) => x > 0);
3036
- * ```
3037
- *
3038
- * @category extra
3039
- */
3040
- declare function find<T>(source: Node<T>, predicate: (value: T) => boolean, opts?: ExtraOpts$1): Node<T>;
3041
- /**
3042
- * Emits the `index`th **`DATA`** (zero-based), then **`COMPLETE`**.
3043
- *
3044
- * @param source - Upstream node.
3045
- * @param index - Zero-based emission index.
3046
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3047
- * @returns `Node<T>` - Single indexed value.
3048
- *
3049
- * @example
3050
- * ```ts
3051
- * import { elementAt, state } from "@graphrefly/graphrefly-ts";
3052
- *
3053
- * const n = elementAt(state(0), 2);
3054
- * ```
3055
- *
3056
- * @category extra
3057
- */
3058
- declare function elementAt<T>(source: Node<T>, index: number, opts?: ExtraOpts$1): Node<T>;
3059
- /**
3060
- * Observer shape for {@link tap} — side effects for data, error, and/or complete.
3061
- */
3062
- type TapObserver<T> = {
3063
- data?: (value: T) => void;
3064
- error?: (err: unknown) => void;
3065
- complete?: () => void;
3066
- };
3067
- /**
3068
- * Invokes side effects; values pass through unchanged.
3069
- *
3070
- * Accepts either a function (called on each DATA) or an observer object
3071
- * `{ data?, error?, complete? }` for lifecycle-aware side effects.
3072
- *
3073
- * @param source - Upstream node.
3074
- * @param fnOrObserver - Side effect function or observer object.
3075
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3076
- * @returns `Node<T>` - Passthrough node.
3077
- *
3078
- * @example
3079
- * ```ts
3080
- * import { tap, state } from "@graphrefly/graphrefly-ts";
3081
- *
3082
- * // Function form (DATA only)
3083
- * tap(state(1), (x) => console.log(x));
3084
- *
3085
- * // Observer form (DATA + ERROR + COMPLETE)
3086
- * tap(state(1), { data: console.log, error: console.error, complete: () => console.log("done") });
3087
- * ```
3088
- *
3089
- * @category extra
3090
- */
3091
- declare function tap<T>(source: Node<T>, fnOrObserver: ((value: T) => void) | TapObserver<T>, opts?: ExtraOpts$1): Node<T>;
3092
- /**
3093
- * Suppresses adjacent duplicates using `equals` (default `Object.is`).
3094
- *
3095
- * @param source - Upstream node.
3096
- * @param equals - Optional equality for consecutive values.
3097
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3098
- * @returns `Node<T>` - Deduped stream.
3099
- *
3100
- * @example
3101
- * ```ts
3102
- * import { distinctUntilChanged, state } from "@graphrefly/graphrefly-ts";
3103
- *
3104
- * const n = distinctUntilChanged(state(1));
3105
- * ```
3106
- *
3107
- * @category extra
3108
- */
3109
- declare function distinctUntilChanged<T>(source: Node<T>, equals?: (a: T, b: T) => boolean, opts?: ExtraOpts$1): Node<T>;
3110
- /**
3111
- * Emits `[previous, current]` pairs starting after the second value (first pair uses `RESOLVED` only).
3112
- *
3113
- * @param source - Upstream node.
3114
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3115
- * @returns `Node<readonly [T, T]>` - Pair stream.
3116
- *
3117
- * @example
3118
- * ```ts
3119
- * import { pairwise, state } from "@graphrefly/graphrefly-ts";
3120
- *
3121
- * const n = pairwise(state(0));
3122
- * ```
3123
- *
3124
- * @category extra
3125
- */
3126
- declare function pairwise<T>(source: Node<T>, opts?: ExtraOpts$1): Node<readonly [T, T]>;
3127
- /**
3128
- * Combines the latest value from each dependency whenever any dep settles (combineLatest).
3129
- *
3130
- * @param sources - Nodes to combine (variadic).
3131
- * @returns `Node<T>` - Tuple of latest values.
3132
- *
3133
- * @example
3134
- * ```ts
3135
- * import { combine, state } from "@graphrefly/graphrefly-ts";
3136
- *
3137
- * const n = combine(state(1), state("a"));
3138
- * ```
3139
- *
3140
- * @remarks
3141
- * Unlike RxJS `combineLatest`, this is named `combine`. Use the {@link combineLatest} alias
3142
- * if you prefer the RxJS name. Seed is always required for `scan`/`reduce` (no seedless mode).
3143
- *
3144
- * @category extra
3145
- */
3146
- declare function combine<const T extends readonly unknown[]>(...sources: {
3147
- [K in keyof T]: Node<T[K]>;
3148
- }): Node<T>;
3149
- /**
3150
- * When `primary` settles, emits `[primary, latestSecondary]`. `secondary` alone updates cache only.
3151
- *
3152
- * @param primary - Main stream.
3153
- * @param secondary - Latest value is paired on each primary emission.
3154
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3155
- * @returns `Node<readonly [A, B]>` - Paired stream.
3156
- *
3157
- * @example
3158
- * ```ts
3159
- * import { state, withLatestFrom } from "@graphrefly/graphrefly-ts";
3160
- *
3161
- * const n = withLatestFrom(state(1), state("x"));
3162
- * ```
3163
- *
3164
- * @category extra
3165
- */
3166
- declare function withLatestFrom<A, B>(primary: Node<A>, secondary: Node<B>, opts?: ExtraOpts$1): Node<readonly [A, B]>;
3167
- /**
3168
- * Merges **`DATA`** from any source with correct two-phase dirty tracking. **`COMPLETE`** after **all** sources complete (spec §1.3.5).
3169
- *
3170
- * @param sources - Nodes to merge (variadic; empty completes immediately).
3171
- * @returns `Node<T>` - Merged stream.
3172
- *
3173
- * @remarks
3174
- * **Ordering:** DIRTY/RESOLVED rules follow multi-source semantics in `~/src/graphrefly/GRAPHREFLY-SPEC.md`.
3175
- *
3176
- * @example
3177
- * ```ts
3178
- * import { merge, state } from "@graphrefly/graphrefly-ts";
3179
- *
3180
- * const n = merge(state(1), state(2));
3181
- * ```
3182
- *
3183
- * @category extra
3184
- */
3185
- declare function merge<T>(...sources: readonly Node<T>[]): Node<T>;
3186
- /**
3187
- * Zips one **`DATA`** from each source per cycle into a tuple. Only **`DATA`** enqueues (spec §1.3.3).
3188
- *
3189
- * @param sources - Nodes to zip (variadic).
3190
- * @returns `Node<T>` - Zipped tuples.
3191
- *
3192
- * @example
3193
- * ```ts
3194
- * import { state, zip } from "@graphrefly/graphrefly-ts";
3195
- *
3196
- * const n = zip(state(1), state(2));
3197
- * ```
3198
- *
3199
- * @category extra
3200
- */
3201
- declare function zip<const T extends readonly unknown[]>(...sources: {
3202
- [K in keyof T]: Node<T[K]>;
3203
- }): Node<T>;
3204
- /**
3205
- * Plays all of `firstSrc`, then all of `secondSrc`. **`DATA`** from `secondSrc` during phase one is buffered until handoff.
3206
- *
3207
- * @param firstSrc - First segment.
3208
- * @param secondSrc - Second segment.
3209
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3210
- * @returns `Node<T>` - Concatenated stream.
3211
- *
3212
- * @example
3213
- * ```ts
3214
- * import { concat, state } from "@graphrefly/graphrefly-ts";
3215
- *
3216
- * const n = concat(state(1), state(2));
3217
- * ```
3218
- *
3219
- * @category extra
3220
- */
3221
- declare function concat<T>(firstSrc: Node<T>, secondSrc: Node<T>, opts?: ExtraOpts$1): Node<T>;
3222
- /**
3223
- * First source to emit **`DATA`** wins; later traffic follows only the winner (Rx-style `race`).
3224
- *
3225
- * @param sources - Contestants (variadic; empty completes immediately; one node is identity).
3226
- * @returns `Node<T>` - Winning stream.
3227
- *
3228
- * @example
3229
- * ```ts
3230
- * import { race, state } from "@graphrefly/graphrefly-ts";
3231
- *
3232
- * const n = race(state(1), state(2));
3233
- * ```
3234
- *
3235
- * @category extra
3236
- */
3237
- declare function race<T>(...sources: readonly Node<T>[]): Node<T>;
3238
- /**
3239
- * Maps each settled value to an inner node; unsubscribes the previous inner (Rx-style `switchMap`).
3240
- *
3241
- * @param source - Upstream node.
3242
- * @param project - Maps each outer value to an inner source shape (`Node`, scalar, `PromiseLike`, `Iterable`, or `AsyncIterable`) coerced via {@link fromAny}.
3243
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3244
- * @returns `Node<R>` - Emissions from the active inner subscription.
3245
- * @example
3246
- * ```ts
3247
- * import { switchMap, state } from "@graphrefly/graphrefly-ts";
3248
- *
3249
- * const src = state(0);
3250
- * switchMap(src, (n) => state((n as number) * 2));
3251
- * ```
3252
- *
3253
- * @category extra
3254
- */
3255
- declare function switchMap<T, R>(source: Node<T>, project: (value: T) => NodeInput<R>, opts?: ExtraOpts$1): Node<R>;
3256
- /**
3257
- * Like {@link switchMap}, but ignores outer `DATA` while an inner subscription is active (`exhaustMap`).
3258
- *
3259
- * @param source - Upstream node.
3260
- * @param project - Maps each outer value to an inner source shape (`Node`, scalar, `PromiseLike`, `Iterable`, or `AsyncIterable`) coerced via {@link fromAny}.
3261
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3262
- * @returns `Node<R>` - Emissions from the active inner while it runs.
3263
- * @example
3264
- * ```ts
3265
- * import { exhaustMap, state } from "@graphrefly/graphrefly-ts";
3266
- *
3267
- * exhaustMap(state(0), () => state(1));
3268
- * ```
3269
- *
3270
- * @category extra
3271
- */
3272
- declare function exhaustMap<T, R>(source: Node<T>, project: (value: T) => NodeInput<R>, opts?: ExtraOpts$1): Node<R>;
3273
- /**
3274
- * Enqueues each outer value and subscribes to inners one at a time (`concatMap`).
3275
- *
3276
- * @param source - Upstream node.
3277
- * @param project - Maps each outer value to an inner source shape (`Node`, scalar, `PromiseLike`, `Iterable`, or `AsyncIterable`) coerced via {@link fromAny}.
3278
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3279
- * @returns `Node<R>` - Sequential concatenation of inner streams.
3280
- * @example
3281
- * ```ts
3282
- * import { concatMap, state } from "@graphrefly/graphrefly-ts";
3283
- *
3284
- * concatMap(state(0), (n) => state((n as number) + 1));
3285
- * ```
3286
- *
3287
- * @category extra
3288
- */
3289
- declare function concatMap<T, R>(source: Node<T>, project: (value: T) => NodeInput<R>, opts?: ExtraOpts$1 & {
3290
- maxBuffer?: number;
3291
- }): Node<R>;
3292
- /** Options for {@link mergeMap}. */
3293
- type MergeMapOptions = ExtraOpts$1 & {
3294
- /** Maximum number of concurrent inner subscriptions. Default: `Infinity` (unbounded). */
3295
- concurrent?: number;
3296
- };
3297
- /**
3298
- * Subscribes to inner nodes in parallel (up to `concurrent`) and merges outputs (`mergeMap` / `flatMap`).
3299
- *
3300
- * @param source - Upstream node.
3301
- * @param project - Maps each outer value to an inner source shape (`Node`, scalar, `PromiseLike`, `Iterable`, or `AsyncIterable`) coerced via {@link fromAny}.
3302
- * @param opts - Optional options including `concurrent` limit.
3303
- * @returns `Node<R>` - Merged output of all active inners; completes when the outer and every inner complete.
3304
- *
3305
- * @remarks
3306
- * **ERROR handling:** An `ERROR` from the outer source cancels all active inner
3307
- * subscriptions and propagates the error downstream. An `ERROR` from an inner
3308
- * subscription propagates downstream immediately but does **not** cancel sibling
3309
- * inner subscriptions — other active inners continue until they complete or the
3310
- * outer errors/completes. This is intentional: for parallel work, isolating
3311
- * failures per-inner is more useful than Rx-style "first error cancels all."
3312
- *
3313
- * @example
3314
- * ```ts
3315
- * import { mergeMap, state } from "@graphrefly/graphrefly-ts";
3316
- *
3317
- * // Unbounded (default)
3318
- * mergeMap(state(0), (n) => state((n as number) + 1));
3319
- *
3320
- * // Limited concurrency
3321
- * mergeMap(state(0), (n) => state((n as number) + 1), { concurrent: 3 });
3322
- * ```
3323
- *
3324
- * @category extra
3325
- */
3326
- declare function mergeMap<T, R>(source: Node<T>, project: (value: T) => NodeInput<R>, opts?: MergeMapOptions): Node<R>;
3327
- /**
3328
- * RxJS-named alias for {@link mergeMap} — projects each `DATA` to an inner node and merges outputs.
3329
- *
3330
- * @param source - Upstream node.
3331
- * @param project - Returns an inner `Node<R>` per value.
3332
- * @param opts - Optional concurrency cap and node options (excluding `describeKind`).
3333
- * @returns Merged projection; behavior matches `mergeMap`.
3334
- *
3335
- * @example
3336
- * ```ts
3337
- * import { flatMap, state } from "@graphrefly/graphrefly-ts";
3338
- *
3339
- * flatMap(state(0), (n) => state(n));
3340
- * ```
3341
- *
3342
- * @category extra
3343
- */
3344
- declare const flatMap: typeof mergeMap;
3345
- /**
3346
- * Delays phase-2 emissions by `ms` (timers). `DIRTY` still forwards immediately.
3347
- *
3348
- * @param source - Upstream node.
3349
- * @param ms - Delay in milliseconds.
3350
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3351
- * @returns `Node<T>` - Same values, shifted in time.
3352
- * @example
3353
- * ```ts
3354
- * import { delay, state } from "@graphrefly/graphrefly-ts";
3355
- *
3356
- * delay(state(1), 100);
3357
- * ```
3358
- *
3359
- * @category extra
3360
- */
3361
- declare function delay<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<T>;
3362
- /**
3363
- * Emits the latest value only after `ms` quiet time since the last trigger (`debounce`).
3364
- *
3365
- * @param source - Upstream node.
3366
- * @param ms - Quiet window in milliseconds.
3367
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3368
- * @returns `Node<T>` - Debounced stream.
3369
- * @example
3370
- * ```ts
3371
- * import { debounce, state } from "@graphrefly/graphrefly-ts";
3372
- *
3373
- * debounce(state(0), 50);
3374
- * ```
3375
- *
3376
- * @category extra
3377
- */
3378
- declare function debounce<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<T>;
3379
- type ThrottleOptions = {
3380
- leading?: boolean;
3381
- trailing?: boolean;
3382
- };
3383
- /**
3384
- * Rate-limits emissions to at most once per `ms` window (`throttleTime`).
3385
- *
3386
- * @param source - Upstream node.
3387
- * @param ms - Minimum spacing in milliseconds.
3388
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`) plus `leading` / `trailing`.
3389
- * @returns `Node<T>` - Throttled stream.
3390
- * @example
3391
- * ```ts
3392
- * import { throttle, state } from "@graphrefly/graphrefly-ts";
3393
- *
3394
- * throttle(state(0), 1_000, { trailing: false });
3395
- * ```
3396
- *
3397
- * @category extra
3398
- */
3399
- declare function throttle<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1 & ThrottleOptions): Node<T>;
3400
- /**
3401
- * Emits the most recent source value whenever `notifier` emits `DATA` (`sample`).
3402
- *
3403
- * Source `COMPLETE` stops sampling (clears held value); notifier `COMPLETE` terminates the
3404
- * operator. `ERROR` from either dep terminates immediately. At most one terminal message is
3405
- * emitted downstream (latch). Supports `resubscribable` — `ctx.store` resets automatically.
3406
- *
3407
- * @param source - Node whose latest value is sampled.
3408
- * @param notifier - When this node emits `DATA`, a sample is taken.
3409
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3410
- * @returns `Node<T>` - Sampled snapshots of `source`.
3411
- * @example
3412
- * ```ts
3413
- * import { sample, state } from "@graphrefly/graphrefly-ts";
3414
- *
3415
- * sample(state(1), state(0));
3416
- * ```
3417
- *
3418
- * @category extra
3419
- */
3420
- declare function sample<T>(source: Node<T>, notifier: Node<unknown>, opts?: ExtraOpts$1): Node<T>;
3421
- /**
3422
- * After each source `DATA`, waits `ms` then emits the latest value if another `DATA` has not arrived (`auditTime` / trailing window).
3423
- *
3424
- * @param source - Upstream node.
3425
- * @param ms - Window in milliseconds after each `DATA`.
3426
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3427
- * @returns `Node<T>` - Trailing-edge sampled stream.
3428
- * @example
3429
- * ```ts
3430
- * import { audit, state } from "@graphrefly/graphrefly-ts";
3431
- *
3432
- * audit(state(0), 100);
3433
- * ```
3434
- *
3435
- * @category extra
3436
- */
3437
- declare function audit<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<T>;
3438
- /**
3439
- * Buffers source `DATA` values; flushes an array when `notifier` settles (`buffer`).
3440
- *
3441
- * @param source - Upstream node.
3442
- * @param notifier - Flush trigger on each settlement.
3443
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3444
- * @returns `Node<T[]>` - Emits buffered arrays (may be empty-handled via `RESOLVED` when nothing buffered).
3445
- * @example
3446
- * ```ts
3447
- * import { buffer, state } from "@graphrefly/graphrefly-ts";
3448
- *
3449
- * buffer(state(0), state(0));
3450
- * ```
3451
- *
3452
- * @category extra
3453
- */
3454
- declare function buffer<T>(source: Node<T>, notifier: Node<unknown>, opts?: ExtraOpts$1): Node<T[]>;
3455
- /**
3456
- * Batches consecutive `DATA` values into arrays of length `count` (`bufferCount` / `windowCount`).
3457
- *
3458
- * @param source - Upstream node.
3459
- * @param count - Buffer size before emit; must be > 0.
3460
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3461
- * @returns `Node<T[]>` - Emits fixed-size arrays; remainder flushes on `COMPLETE`.
3462
- * @example
3463
- * ```ts
3464
- * import { bufferCount, state } from "@graphrefly/graphrefly-ts";
3465
- *
3466
- * bufferCount(state(0), 3);
3467
- * ```
3468
- *
3469
- * @category extra
3470
- */
3471
- declare function bufferCount<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<T[]>;
3472
- /**
3473
- * Splits source `DATA` into sub-nodes of `count` values each. Each sub-node completes after `count` items or when source completes.
3474
- *
3475
- * @param source - Upstream node.
3476
- * @param count - Items per window.
3477
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3478
- * @returns `Node<Node<T>>` - Each emission is a sub-node carrying that window's values.
3479
- *
3480
- * @example
3481
- * ```ts
3482
- * import { windowCount, state } from "@graphrefly/graphrefly-ts";
3483
- *
3484
- * windowCount(state(0), 3);
3485
- * ```
3486
- *
3487
- * @category extra
3488
- */
3489
- declare function windowCount<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<Node<T>>;
3490
- /**
3491
- * Flushes buffered `DATA` values every `ms` (`bufferTime` / `windowTime`).
3492
- *
3493
- * @param source - Upstream node.
3494
- * @param ms - Flush interval in milliseconds.
3495
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3496
- * @returns `Node<T[]>` - Time-windowed batches.
3497
- * @example
3498
- * ```ts
3499
- * import { bufferTime, state } from "@graphrefly/graphrefly-ts";
3500
- *
3501
- * bufferTime(state(0), 250);
3502
- * ```
3503
- *
3504
- * @category extra
3505
- */
3506
- declare function bufferTime<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<T[]>;
3507
- /**
3508
- * Splits source `DATA` into time-windowed sub-nodes; each window lasts `ms`.
3509
- *
3510
- * @param source - Upstream node.
3511
- * @param ms - Window duration in milliseconds.
3512
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3513
- * @returns `Node<Node<T>>` - Each emission is a sub-node carrying that window's values.
3514
- *
3515
- * @example
3516
- * ```ts
3517
- * import { windowTime, state } from "@graphrefly/graphrefly-ts";
3518
- *
3519
- * windowTime(state(0), 500);
3520
- * ```
3521
- *
3522
- * @category extra
3523
- */
3524
- declare function windowTime<T>(source: Node<T>, ms: number, opts?: ExtraOpts$1): Node<Node<T>>;
3525
- /**
3526
- * Splits source `DATA` into sub-nodes, opening a new window each time `notifier` emits `DATA`.
3527
- *
3528
- * @param source - Upstream node.
3529
- * @param notifier - Each `DATA` from `notifier` closes the current window and opens a new one.
3530
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3531
- * @returns `Node<Node<T>>` - Each emission is a sub-node carrying that window's values.
3532
- *
3533
- * @example
3534
- * ```ts
3535
- * import { state, window } from "@graphrefly/graphrefly-ts";
3536
- *
3537
- * window(state(0), state(0));
3538
- * ```
3539
- *
3540
- * @category extra
3541
- */
3542
- declare function window<T>(source: Node<T>, notifier: Node<unknown>, opts?: ExtraOpts$1): Node<Node<T>>;
3543
- /**
3544
- * Increments on each tick (`interval`); uses `setInterval` via {@link producer}.
3545
- *
3546
- * @param periodMs - Time between ticks.
3547
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3548
- * @returns `Node<number>` - Emits `0`, `1`, `2`, … while subscribed.
3549
- * @example
3550
- * ```ts
3551
- * import { interval } from "@graphrefly/graphrefly-ts";
3552
- *
3553
- * interval(1_000);
3554
- * ```
3555
- *
3556
- * @category extra
3557
- */
3558
- declare function interval(periodMs: number, opts?: ExtraOpts$1): Node<number>;
3559
- /**
3560
- * Subscribes to `source` repeatedly (`count` times, sequentially). Best with a fresh or `resubscribable` source.
3561
- *
3562
- * @param source - Upstream node to replay.
3563
- * @param count - Number of subscription rounds.
3564
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3565
- * @returns `Node<T>` - Forwards each round then completes after the last inner `COMPLETE`.
3566
- * @example
3567
- * ```ts
3568
- * import { repeat, state } from "@graphrefly/graphrefly-ts";
3569
- *
3570
- * repeat(state(1, { resubscribable: true }), 2);
3571
- * ```
3572
- *
3573
- * @category extra
3574
- */
3575
- declare function repeat<T>(source: Node<T>, count: number, opts?: ExtraOpts$1): Node<T>;
3576
- /**
3577
- * Identity passthrough — `pausable()` has been promoted to default node behavior in v5 (§4).
3578
- *
3579
- * @deprecated Default node behavior now handles PAUSE/RESUME. This operator is a no-op
3580
- * identity passthrough kept only for migration compatibility.
3581
- *
3582
- * @param source - Upstream node.
3583
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3584
- * @returns `Node<T>` - Pass-through (identity).
3585
- * @example
3586
- * ```ts
3587
- * import { pausable, state } from "@graphrefly/graphrefly-ts";
3588
- *
3589
- * // No longer needed — default nodes handle PAUSE/RESUME.
3590
- * const s = state(0);
3591
- * pausable(s); // identity passthrough
3592
- * ```
3593
- *
3594
- * @category extra
3595
- */
3596
- declare function pausable<T>(source: Node<T>, opts?: ExtraOpts$1): Node<T>;
3597
- /**
3598
- * Replaces an upstream `ERROR` with a recovered value (`catchError`-style).
3599
- *
3600
- * @param source - Upstream node.
3601
- * @param recover - Maps the error payload to a replacement value; if it throws, `ERROR` is forwarded.
3602
- * @param opts - Optional {@link NodeOptions} (excluding `describeKind`).
3603
- * @returns `Node<T>` - Recovered stream.
3604
- * @example
3605
- * ```ts
3606
- * import { rescue, state } from "@graphrefly/graphrefly-ts";
3607
- *
3608
- * rescue(state(0), () => 0);
3609
- * ```
3610
- *
3611
- * @category extra
3612
- */
3613
- declare function rescue<T>(source: Node<T>, recover: (err: unknown) => T, opts?: ExtraOpts$1): Node<T>;
3614
- /**
3615
- * Forwards upstream `DATA` only while `control.get()` is truthy; when closed, emits `RESOLVED`
3616
- * instead of repeating the last value (value-level valve). For protocol pause/resume, use default
3617
- * node PAUSE/RESUME behavior.
3618
- *
3619
- * @param source - Upstream value node.
3620
- * @param control - Boolean node; when falsy, output stays "closed" for that tick.
3621
- * @param opts - Optional node options (excluding `describeKind`).
3622
- * @returns `Node<T>` gated by `control`.
3623
- *
3624
- * @example
3625
- * ```ts
3626
- * import { valve, state } from "@graphrefly/graphrefly-ts";
3627
- *
3628
- * const data = state(1);
3629
- * const open = state(true);
3630
- * valve(data, open);
3631
- * ```
3632
- *
3633
- * @category extra
3634
- */
3635
- declare function valve<T>(source: Node<T>, control: Node<boolean>, opts?: ExtraOpts$1): Node<T>;
3636
- /**
3637
- * RxJS-named alias for {@link combine} — emits when any dep updates with latest tuple of values.
3638
- *
3639
- * @param sources - Upstream nodes as separate arguments (same calling shape as `combine`).
3640
- * @returns Combined node; signature matches `combine`.
3641
- *
3642
- * @example
3643
- * ```ts
3644
- * import { combineLatest, state } from "@graphrefly/graphrefly-ts";
3645
- *
3646
- * const n = combineLatest(state(1), state("a"));
3647
- * ```
3648
- *
3649
- * @category extra
3650
- */
3651
- declare const combineLatest: typeof combine;
3652
- /**
3653
- * RxJS-named alias for {@link debounce} — drops rapid `DATA` until `ms` of quiet.
3654
- *
3655
- * @param source - Upstream node.
3656
- * @param ms - Quiet period in milliseconds.
3657
- * @param opts - Optional node options (excluding `describeKind`).
3658
- * @returns Debounced node; behavior matches `debounce`.
3659
- *
3660
- * @example
3661
- * ```ts
3662
- * import { debounceTime, state } from "@graphrefly/graphrefly-ts";
3663
- *
3664
- * debounceTime(state(0), 100);
3665
- * ```
3666
- *
3667
- * @category extra
3668
- */
3669
- declare const debounceTime: typeof debounce;
3670
- /**
3671
- * RxJS-named alias for {@link throttle} — emits on leading/trailing edges within `ms`.
3672
- *
3673
- * @param source - Upstream node.
3674
- * @param ms - Minimum spacing in milliseconds.
3675
- * @param opts - Optional throttle shape (`leading` / `trailing`) and node options.
3676
- * @returns Throttled node; behavior matches `throttle`.
3677
- *
3678
- * @example
3679
- * ```ts
3680
- * import { throttleTime, state } from "@graphrefly/graphrefly-ts";
3681
- *
3682
- * throttleTime(state(0), 100);
3683
- * ```
3684
- *
3685
- * @category extra
3686
- */
3687
- declare const throttleTime: typeof throttle;
3688
- /**
3689
- * RxJS-named alias for {@link rescue} — replaces upstream `ERROR` with a recovered value.
3690
- *
3691
- * @param source - Upstream node.
3692
- * @param recover - Maps error payload to replacement value.
3693
- * @param opts - Optional node options (excluding `describeKind`).
3694
- * @returns Recovered stream; behavior matches `rescue`.
3695
- *
3696
- * @example
3697
- * ```ts
3698
- * import { catchError, state } from "@graphrefly/graphrefly-ts";
3699
- *
3700
- * catchError(state(0), () => 0);
3701
- * ```
3702
- *
3703
- * @category extra
3704
- */
3705
- declare const catchError: typeof rescue;
3706
-
3707
- /**
3708
- * Lazy per-topic state hub (roadmap §3.2) — lightweight last-value broadcasts.
3709
- *
3710
- * Each topic is a sentinel `node<unknown>()` with push-on-subscribe replay of
3711
- * the most recent published value (no push until the first `publish`). For
3712
- * Pulsar-inspired retained message logs,
3713
- * cursor-based subscriptions, and job-queue semantics, use `messagingHub()` in
3714
- * `patterns/messaging.ts` — built on `TopicGraph` / `SubscriptionGraph` with
3715
- * retention policies, absolute cursor tracking, and per-subscriber state.
3716
- *
3717
- * **Wave 4 refactor (2026-04-15):** Introduces `PubSubBackend` (thin registry
3718
- * with version counter). Converts class-based hub to closure factory for
3719
- * consistency with other `extra/` factories. New bundle APIs: `has(name)`,
3720
- * `size`, `topicNames()`, `publishMany(entries)`. `removeTopic` → `TEARDOWN`
3721
- * semantics preserved.
3722
- */
3723
-
3724
- /**
3725
- * Storage contract for {@link pubsub} — registry only.
2332
+ * Storage contract for {@link pubsub} registry only.
3726
2333
  *
3727
2334
  * Tracks the set of topic names plus a monotonic `version` counter that
3728
2335
  * advances on topic create/remove. Does NOT own per-topic message storage —
@@ -3835,571 +2442,108 @@ interface PubSubHub {
3835
2442
  */
3836
2443
  declare function pubsub(options?: PubSubHubOptions): PubSubHub;
3837
2444
 
3838
- type IndexRow<K, V = unknown> = {
3839
- readonly primary: K;
3840
- readonly secondary: unknown;
3841
- readonly value: V;
3842
- };
3843
- type ReactiveIndexOptions<K, V = unknown> = {
3844
- /** Optional registry name for `describe()` / debugging. */
3845
- name?: string;
3846
- /**
3847
- * Storage backend. Defaults to `NativeIndexBackend` (flat array + parallel `Map<K,IndexRow>`).
3848
- * Users can plug in persistent / B-tree backends via the {@link IndexBackend} interface.
3849
- */
3850
- backend?: IndexBackend<K, V>;
3851
- /**
3852
- * Optional versioning level for the underlying `ordered` state node. Set at
3853
- * construction time; cannot be changed later. Pass `0` for V0 identity +
3854
- * monotonic version counter, or `1` for V1 + content-addressed cid.
3855
- * (The `byPrimary` derived node inherits through the dep graph.)
3856
- */
3857
- versioning?: VersioningLevel;
3858
- /**
3859
- * Default row-equality used to short-circuit idempotent upserts. When
3860
- * provided, every `upsert` / `upsertMany` that finds an existing primary
3861
- * compares the stored and candidate rows via `equals(existing, next)` —
3862
- * on `true` the call is a no-op (no version bump, no emission). Per-call
3863
- * `UpsertOptions.equals` overrides this default. Analogous to
3864
- * `NodeOptions.equals` on the core `node()` primitive.
3865
- */
3866
- equals?: (existing: IndexRow<K, V>, next: IndexRow<K, V>) => boolean;
3867
- };
3868
- type ReactiveIndexBundle<K, V = unknown> = {
3869
- /** Rows sorted by `(secondary, primary)`. */
3870
- readonly ordered: Node<readonly IndexRow<K, V>[]>;
3871
- /** Map from primary key to stored value. */
3872
- readonly byPrimary: Node<ReadonlyMap<K, V>>;
3873
- /** O(1) primary-key existence check. */
3874
- has: (primary: K) => boolean;
3875
- /** O(1) value lookup by primary key. */
3876
- get: (primary: K) => V | undefined;
3877
- /** Number of rows currently in the index (O(1)). */
3878
- readonly size: number;
3879
- /**
3880
- * Upserts a row. When `opts.equals(existing, next)` returns `true` for an
3881
- * existing primary key, the upsert is a no-op (no version bump, no emission).
3882
- * Useful for idempotent writes.
3883
- *
3884
- * @returns `true` if a new row was inserted (primary key was absent),
3885
- * `false` if the primary key was already present (updated in place OR
3886
- * skipped idempotently via `opts.equals`). D5(a).
3887
- */
3888
- upsert: (primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>) => boolean;
3889
- /**
3890
- * Bulk upsert — emits one snapshot for the whole batch. `opts.equals` applied
3891
- * per-row. No-op if empty or all rows skipped.
3892
- *
3893
- * **Iterable consumption:** Consumes `rows` once (single-pass).
3894
- */
3895
- upsertMany: (rows: Iterable<{
3896
- primary: K;
3897
- secondary: unknown;
3898
- value: V;
3899
- }>, opts?: UpsertOptions<K, V>) => void;
3900
- delete: (primary: K) => void;
3901
- /**
3902
- * Bulk delete — emits one snapshot for the whole batch. No-op if nothing was removed.
3903
- *
3904
- * **Iterable consumption:** Consumes `primaries` once (single-pass).
3905
- */
3906
- deleteMany: (primaries: Iterable<K>) => void;
3907
- clear: () => void;
3908
- /**
3909
- * Releases internal keepalive subscriptions (on `byPrimary`) so the bundle
3910
- * can be GC'd. Safe to call more than once (subsequent calls are no-ops).
3911
- * Subsequent mutations after `dispose()` still execute on the backend but
3912
- * `byPrimary` may stop updating if no external subscriber is attached.
3913
- * D6(a).
3914
- */
3915
- dispose: () => void;
3916
- };
3917
- /**
3918
- * Storage contract for {@link reactiveIndex}. Implementations own the mutable state and
3919
- * expose a monotonic `version` counter that increments on every structural change.
3920
- *
3921
- * The reactive layer reads `version` to decide when to emit; it does not inspect
3922
- * internal representation. Users can plug in B-tree / skip-list / persistent backends
3923
- * without touching the reactive emission logic.
3924
- *
3925
- * @remarks Post-1.0 op-log changesets will extend this interface with a
3926
- * `changesSince(version: number): Iterable<Change>` method. Current consumers
3927
- * should treat all methods here as stable.
3928
- *
3929
- * @category extra
3930
- */
3931
- /**
3932
- * Optional per-call options for {@link IndexBackend.upsert} and bulk upsert.
3933
- *
3934
- * @category extra
3935
- */
3936
- type UpsertOptions<K, V> = {
3937
- /**
3938
- * Skip the upsert if an existing row is considered equal to the proposed row.
3939
- * Default: no skip — every upsert advances `version`. Provide for idempotent
3940
- * keys (e.g., `(a, b) => a.secondary === b.secondary && a.value === b.value`).
3941
- */
3942
- equals?: (existing: IndexRow<K, V>, next: IndexRow<K, V>) => boolean;
3943
- };
3944
- interface IndexBackend<K, V = unknown> {
3945
- /** Monotonic mutation counter; increments on every upsert/delete/clear that changes state. */
3946
- readonly version: number;
3947
- /** Number of rows currently stored. */
3948
- readonly size: number;
3949
- /** O(1) primary-key existence check. */
3950
- has(primary: K): boolean;
3951
- /** Value lookup by primary key. */
3952
- get(primary: K): V | undefined;
3953
- /**
3954
- * Insert or replace a row. Returns `true` if a row was inserted (primary
3955
- * didn't exist), `false` otherwise (updated OR skipped via `opts.equals`).
3956
- *
3957
- * **Atomicity contract:** Either fully succeeds or throws before any state
3958
- * change; `version` advances only on state change.
3959
- */
3960
- upsert(primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>): boolean;
3961
- /**
3962
- * Atomic bulk upsert. Returns the number of rows that caused a state change
3963
- * (inserts + non-skipped updates). Advances `version` at most once.
3964
- * No-op if iterable is empty or all rows skipped by `opts.equals`.
3965
- *
3966
- * **Consumes `rows` once** — pass an array for multi-shot consumers.
3967
- */
3968
- upsertMany(rows: Iterable<{
3969
- primary: K;
3970
- secondary: unknown;
3971
- value: V;
3972
- }>, opts?: UpsertOptions<K, V>): number;
3973
- /** Remove a row by primary key. Returns `true` if the row existed. Advances `version` only if true. */
3974
- delete(primary: K): boolean;
3975
- /**
3976
- * Atomic bulk delete. Returns count removed. Advances `version` at most once.
3977
- * No-op if no keys were present. Consumes `primaries` once.
3978
- */
3979
- deleteMany(primaries: Iterable<K>): number;
3980
- /** Remove all rows. Returns the number removed. Advances `version` only if non-zero. */
3981
- clear(): number;
3982
- /** Rows in sorted `(secondary, primary)` order — fresh snapshot suitable for emission. */
3983
- toArray(): readonly IndexRow<K, V>[];
3984
- /** Primary-key → value map — fresh snapshot. */
3985
- toPrimaryMap(): ReadonlyMap<K, V>;
3986
- }
3987
- /**
3988
- * Default flat-array backend. Maintains `buf: IndexRow[]` sorted by `(secondary, primary)`
3989
- * and a parallel `Map<K, IndexRow>` for O(1) primary-key lookup.
3990
- *
3991
- * **Complexity:**
3992
- * - `has`, `get`: O(1)
3993
- * - `upsert`: up to 2× O(log n) bisect (locate old + locate new) + up to 2× O(n) splice (remove-old + insert-new) = O(n)
3994
- * - `upsertMany(k rows)`: O(k log n) bisect + O(k·n) splice worst case; single version bump
3995
- * - `delete`: O(log n) bisect + O(n) splice = O(n)
3996
- * - `deleteMany(k keys)`: O(k log n) + O(k·n) splice worst case; single version bump
3997
- * - `clear`: O(1)
3998
- * - `toArray`, `toPrimaryMap`: O(n)
3999
- *
4000
- * @category extra
4001
- */
4002
- declare class NativeIndexBackend<K, V = unknown> implements IndexBackend<K, V> {
4003
- private _version;
4004
- private readonly _buf;
4005
- private readonly _byPrimary;
4006
- get version(): number;
4007
- get size(): number;
4008
- has(primary: K): boolean;
4009
- get(primary: K): V | undefined;
4010
- upsert(primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>): boolean;
4011
- upsertMany(rows: Iterable<{
4012
- primary: K;
4013
- secondary: unknown;
4014
- value: V;
4015
- }>, opts?: UpsertOptions<K, V>): number;
4016
- delete(primary: K): boolean;
4017
- deleteMany(primaries: Iterable<K>): number;
4018
- clear(): number;
4019
- toArray(): readonly IndexRow<K, V>[];
4020
- toPrimaryMap(): ReadonlyMap<K, V>;
4021
- }
4022
2445
  /**
4023
- * Creates a reactive index: unique primary key per row, rows sorted by `(secondary, primary)` for ordered scans.
2446
+ * `singleFromAny` keyed promise/Node de-duplication ("singleflight").
4024
2447
  *
4025
- * @param options - Optional `name` for `describe()` / debugging, and optional `backend` (see {@link IndexBackend}).
4026
- * @returns Bundle with `ordered` (sorted rows), `byPrimary` (map), O(1) `has` / `get` / `size`,
4027
- * imperative `upsert` / `upsertMany` / `delete` / `deleteMany` / `clear`.
2448
+ * Given a `factory: (key) => NodeInput<T>`, returns a callable that dedupes
2449
+ * concurrent invocations sharing the same key all callers with the same
2450
+ * key while a request is in-flight receive the same `Promise<T>`. Once the
2451
+ * underlying source settles (DATA, ERROR, or COMPLETE), the cache entry is
2452
+ * cleared so the next call re-invokes the factory.
4028
2453
  *
4029
- * @remarks
4030
- * **Ordering:** `secondary` and `primary` are compared via a small total order: same primitive `typeof` uses
4031
- * numeric/string/boolean/bigint comparison; mixed or object keys fall back to `String(a).localeCompare(String(b))`
4032
- * (not identical to Python's rich comparison for exotic types).
2454
+ * This is the classic "singleflight" pattern from Go, generalised over the
2455
+ * library's `NodeInput<T>` bridge so callers can pass Promise-returning
2456
+ * factories, Node-returning factories, or plain value factories with
2457
+ * identical semantics.
4033
2458
  *
4034
- * **Backend:** The default {@link NativeIndexBackend} offers O(1) primary-key lookups and O(n) upserts.
4035
- * For scale beyond a few thousand rows, supply a user-pluggable persistent/B-tree backend via the
4036
- * `backend` option reactive emission semantics are unchanged.
2459
+ * Use cases:
2460
+ * - `withReplayCache` cache-miss thundering-herd dedup
2461
+ * - Shared HTTP fetches keyed by URL
2462
+ * - Expensive compute keyed by request fingerprint
4037
2463
  *
4038
2464
  * @example
4039
2465
  * ```ts
4040
- * import { reactiveIndex } from "@graphrefly/graphrefly-ts";
4041
- *
4042
- * const idx = reactiveIndex<string, string>();
4043
- * idx.upsert("id1", 10, "row-a");
4044
- * idx.upsert("id2", 5, "row-b");
2466
+ * const fetchUser = singleFromAny<string, User>((id) => fetch(`/users/${id}`).then(r => r.json()));
2467
+ * // Two concurrent callers with id="42" → one underlying fetch, two Promises resolving to the same User.
2468
+ * const [a, b] = await Promise.all([fetchUser("42"), fetchUser("42")]);
4045
2469
  * ```
4046
2470
  *
4047
2471
  * @category extra
4048
2472
  */
4049
- declare function reactiveIndex<K, V = unknown>(options?: ReactiveIndexOptions<K, V>): ReactiveIndexBundle<K, V>;
4050
2473
 
4051
- type ReactiveListOptions<T> = {
4052
- name?: string;
2474
+ interface SingleFromAnyOptions<K> {
4053
2475
  /**
4054
- * Storage backend. Defaults to `NativeListBackend` (flat mutable array).
4055
- * Users can plug in persistent / RRB-tree backends via the {@link ListBackend} interface.
2476
+ * Convert a typed key into a cache-string. Defaults to `String(key)`, which
2477
+ * works for primitive keys; callers with object keys should provide a
2478
+ * stable serializer (e.g., canonical JSON).
4056
2479
  */
4057
- backend?: ListBackend<T>;
4058
- /**
4059
- * Optional versioning level for the underlying `items` state node. Set at
4060
- * construction time; cannot be changed later. Pass `0` for V0 identity +
4061
- * monotonic version counter, or `1` for V1 + content-addressed cid.
4062
- */
4063
- versioning?: VersioningLevel;
4064
- };
4065
- type ReactiveListBundle<T> = {
4066
- /** Emits `readonly T[]` on each structural change (two-phase). */
4067
- readonly items: Node<readonly T[]>;
4068
- /** Current entry count (O(1)). */
4069
- readonly size: number;
4070
- /** Positional access (O(1)); supports negative indices (Python-style). Returns `undefined` on out-of-range. */
4071
- at: (index: number) => T | undefined;
4072
- append: (value: T) => void;
4073
- /** Push all values, emit one snapshot. No-op if `values` is empty. */
4074
- appendMany: (values: readonly T[]) => void;
4075
- /** Insert a value at `index`. Throws `RangeError` on out-of-range. */
4076
- insert: (index: number, value: T) => void;
4077
- /** Insert all values at `index` as one bulk op; emits one snapshot. No-op if `values` is empty. */
4078
- insertMany: (index: number, values: readonly T[]) => void;
4079
- /** Remove and return the value at `index` (default: last). Negative indices Python-style. Throws on empty / out-of-range. */
4080
- pop: (index?: number) => T;
4081
- clear: () => void;
4082
- /**
4083
- * Releases any internal keepalive subscriptions so the bundle can be
4084
- * GC'd. `reactiveList` currently holds none (no internal derived nodes),
4085
- * so `dispose()` is a no-op today — exposed for API parity with
4086
- * `reactiveIndex.dispose` / `reactiveMap.dispose` / `reactiveLog.dispose`.
4087
- * Idempotent. D6(a).
4088
- */
4089
- dispose: () => void;
4090
- };
4091
- /**
4092
- * Storage contract for {@link reactiveList}. Implementations own the mutable state
4093
- * and expose a monotonic `version` counter that increments on every structural change.
4094
- *
4095
- * The reactive layer reads `version` before and after each backend call; when it
4096
- * advances, a snapshot is emitted.
4097
- *
4098
- * @remarks Post-1.0 op-log changesets will extend this interface with a
4099
- * `changesSince(version: number): Iterable<Change>` method. Current consumers
4100
- * should treat all methods here as stable.
4101
- *
4102
- * @category extra
4103
- */
4104
- interface ListBackend<T> {
4105
- /** Monotonic mutation counter; increments on every structural change. */
4106
- readonly version: number;
4107
- /** Number of items currently stored. */
4108
- readonly size: number;
4109
- /** Positional access; `undefined` on out-of-range. */
4110
- at(index: number): T | undefined;
4111
- /** Append a single value. Advances `version`. */
4112
- append(value: T): void;
4113
- /** Append a batch. Advances `version` once. No-op if empty. */
4114
- appendMany(values: readonly T[]): void;
4115
- /** Insert at index; throws `RangeError` on out-of-range `0 <= index <= size`. Advances `version`. */
4116
- insert(index: number, value: T): void;
4117
- /** Bulk insert at index; throws on out-of-range. Advances `version` once. No-op if `values` empty. */
4118
- insertMany(index: number, values: readonly T[]): void;
4119
- /** Remove and return value at index; throws on empty / out-of-range. Advances `version`. */
4120
- pop(index: number): T;
4121
- /** Clear all entries. Returns count removed. Advances `version` only if non-zero. */
4122
- clear(): number;
4123
- /** Full snapshot as a fresh array. */
4124
- toArray(): readonly T[];
2480
+ keyFn?: (key: K) => string;
4125
2481
  }
4126
2482
  /**
4127
- * Default mutable-array backend.
2483
+ * Dedupe concurrent `factory(key)` invocations. Returns a bound callable.
4128
2484
  *
4129
- * **Complexity:**
4130
- * - `at`, `size`: O(1)
4131
- * - `append`: O(1) amortized
4132
- * - `appendMany(values)`, `insertMany(index, values)`: O(n + k) where k = values.length
4133
- * - `insert`, `pop` (middle): O(n) due to splice
4134
- * - `pop` (last): O(1)
4135
- * - `clear`: O(1)
4136
- * - `toArray`: O(n)
4137
- *
4138
- * @category extra
2485
+ * @param factory - Produces a `NodeInput<T>` for each unique key.
2486
+ * @param opts - Optional key-stringification.
2487
+ * @returns A function `(key: K) => Promise<T>` whose inflight results are shared per key.
4139
2488
  */
4140
- declare class NativeListBackend<T> implements ListBackend<T> {
4141
- private _version;
4142
- private readonly _buf;
4143
- constructor(initial?: readonly T[]);
4144
- get version(): number;
4145
- get size(): number;
4146
- at(index: number): T | undefined;
4147
- append(value: T): void;
4148
- appendMany(values: readonly T[]): void;
4149
- insert(index: number, value: T): void;
4150
- insertMany(index: number, values: readonly T[]): void;
4151
- pop(index: number): T;
4152
- clear(): number;
4153
- toArray(): readonly T[];
4154
- }
2489
+ declare function singleFromAny<K, T>(factory: (key: K) => NodeInput<T>, opts?: SingleFromAnyOptions<K>): (key: K) => Promise<T>;
4155
2490
  /**
4156
- * Creates a reactive list with immutable array snapshots.
4157
- *
4158
- * @param initial - Optional initial items (copied).
4159
- * @param options - Optional `name` for `describe()` / debugging, or pluggable `backend`.
4160
- * @returns Bundle with `items` (state node), `size` / `at`, `append` / `appendMany` / `insert` /
4161
- * `insertMany` / `pop` / `clear`.
4162
- *
4163
- * @remarks
4164
- * **No `maxSize`:** insert/pop-anywhere semantics make eviction-under-cap ambiguous.
4165
- * For bounded append-heavy workloads use `reactiveLog` (head-trim is well-defined for
4166
- * append-only).
2491
+ * Reactive variant: returns a bound callable that hands out `Node<T>` values.
2492
+ * All concurrent callers with the same key during an in-flight source share
2493
+ * the same Node. When the underlying source **terminally** settles (ERROR
2494
+ * or COMPLETE), the Node is removed from the cache so the next call
2495
+ * re-invokes `factory`. DATA is NOT terminal callers subscribing after
2496
+ * the first DATA still receive the shared Node (and push-on-subscribe per
2497
+ * the spec's cached-DATA contract).
4167
2498
  *
4168
- * **Backend:** Default {@link NativeListBackend}. For persistent / RRB-tree semantics
4169
- * supply a custom {@link ListBackend}. If you provide a `backend`, `initial` is ignored
4170
- * — seed the backend directly.
4171
- *
4172
- * @example
4173
- * ```ts
4174
- * import { reactiveList } from "@graphrefly/graphrefly-ts";
4175
- *
4176
- * const list = reactiveList<string>(["a"], { name: "queue" });
4177
- * list.append("b");
4178
- * list.insertMany(1, ["x", "y"]);
4179
- * ```
2499
+ * Use when downstream wants reactive subscription (not a one-shot Promise).
4180
2500
  *
4181
2501
  * @category extra
4182
2502
  */
4183
- declare function reactiveList<T>(initial?: readonly T[], options?: ReactiveListOptions<T>): ReactiveListBundle<T>;
2503
+ declare function singleNodeFromAny<K, T>(factory: (key: K) => NodeInput<T>, opts?: SingleFromAnyOptions<K>): (key: K) => Node<T>;
4184
2504
 
4185
- type ReactiveLogOptions<T> = {
4186
- name?: string;
4187
- maxSize?: number;
4188
- /**
4189
- * Optional versioning level for the underlying `entries` state node. Set
4190
- * at construction time; cannot be changed later. Pass `0` for V0 identity
4191
- * + monotonic version counter, or `1` for V1 + content-addressed cid.
4192
- */
4193
- versioning?: VersioningLevel;
4194
- /**
4195
- * Storage backend. Defaults to `NativeLogBackend` (ring buffer if `maxSize` is set,
4196
- * flat array otherwise). Users can plug in persistent / RRB-tree backends via
4197
- * the {@link LogBackend} interface.
4198
- */
4199
- backend?: LogBackend<T>;
4200
- };
4201
- type ReactiveLogBundle<T> = {
4202
- /** Emits `readonly T[]` on each append/clear/trim (two-phase). */
4203
- readonly entries: Node<readonly T[]>;
4204
- /** Current entry count (O(1)). */
4205
- readonly size: number;
4206
- /** Positional access (O(1)); returns `undefined` on out-of-range. Supports negative indices (Python-style). */
4207
- at: (index: number) => T | undefined;
4208
- append: (value: T) => void;
4209
- /**
4210
- * Push all values, emit one snapshot. No-op if `values` is empty.
4211
- * **Iterable consumption:** `values` is a `readonly T[]` — safe to pass arrays.
4212
- */
4213
- appendMany: (values: readonly T[]) => void;
4214
- clear: () => void;
4215
- /** Remove the first `n` entries (clamped to `size`). Throws on non-integer or negative `n`. */
4216
- trimHead: (n: number) => void;
4217
- /**
4218
- * Last `n` entries (or fewer) as a derived reactive view. Memoized with
4219
- * an LRU cache (default cap 64) — repeat calls with the same `n` return
4220
- * the same node. Throws on non-integer or negative `n`.
4221
- *
4222
- * **LRU eviction contract (D3(b)):** when a 65th distinct `n` is passed,
4223
- * the least-recently-used cached view is evicted and its keepalive is
4224
- * disposed. External holders of the evicted node will NOT receive further
4225
- * updates — re-call `tail(n)` for a fresh node, or dispose proactively
4226
- * via {@link disposeTail} / {@link disposeAllViews}. To avoid surprise:
4227
- * resolve `tail(n)` at the point of use rather than caching the returned
4228
- * node across many distinct `n`s.
4229
- */
4230
- tail: (n: number) => Node<readonly T[]>;
4231
- /**
4232
- * Reactive view of `entries.slice(start, stop)` — non-negative integer
4233
- * `start`, non-negative integer `stop` (exclusive) or `undefined` (to end).
4234
- * Memoized with an LRU cache (default cap 64) — repeat calls with the
4235
- * same `(start, stop)` return the same node.
4236
- *
4237
- * Throws on non-integer `start`, negative `start`, non-integer `stop`, or
4238
- * negative `stop` (P4 — the backend cannot cheaply honor JS-style
4239
- * negative `stop` without scanning length; disallowed for a consistent
4240
- * contract between backend, derived recomputation, and cached initial).
4241
- *
4242
- * **LRU eviction contract (D3(b)):** same as {@link tail} — past 64
4243
- * distinct `(start, stop)` pairs, the oldest cached view is evicted and
4244
- * its keepalive disposed. External holders stop receiving updates.
4245
- */
4246
- slice: (start: number, stop?: number) => Node<readonly T[]>;
4247
- /**
4248
- * Releases the cached `tail(n)` view if present (disposes its keepalive
4249
- * subscription). Subsequent `tail(n)` calls create a fresh node. No-op if
4250
- * `n` was not cached. Returns `true` if a view was disposed.
4251
- */
4252
- disposeTail: (n: number) => boolean;
4253
- /**
4254
- * Releases the cached `slice(start, stop?)` view if present. No-op if not cached.
4255
- */
4256
- disposeSlice: (start: number, stop?: number) => boolean;
4257
- /** Releases all cached tail/slice views and their keepalive subscriptions. */
4258
- disposeAllViews: () => void;
4259
- /**
4260
- * Releases all internal keepalive subscriptions so the bundle can be
4261
- * GC'd — currently equivalent to {@link disposeAllViews}, but exposed as
4262
- * a uniform API across all reactive data structures for lifecycle
4263
- * symmetry (mirrors `reactiveMap.dispose` / `reactiveList.dispose` /
4264
- * `reactiveIndex.dispose`). Idempotent. D6(a).
4265
- */
4266
- dispose: () => void;
4267
- };
4268
- /**
4269
- * Storage contract for {@link reactiveLog}. Implementations own the mutable state and
4270
- * expose a monotonic `version` counter that increments on every structural change.
4271
- *
4272
- * The reactive layer reads `version` to decide when to emit; it does not inspect
4273
- * internal representation. Users can plug in persistent / ring-buffer / skip-list
4274
- * backends without touching the reactive emission logic.
4275
- *
4276
- * @remarks Post-1.0 op-log changesets will extend this interface with a
4277
- * `changesSince(version: number): Iterable<Change>` method. Current consumers
4278
- * should treat all methods here as stable.
4279
- *
4280
- * @category extra
4281
- */
4282
- interface LogBackend<T> {
4283
- /** Monotonic mutation counter; increments on every append/trim/clear that changes state. */
4284
- readonly version: number;
4285
- /** Number of entries currently stored. */
4286
- readonly size: number;
4287
- /** O(1) positional access; returns `undefined` on out-of-range. */
4288
- at(index: number): T | undefined;
4289
- /** Append a value. Applies `maxSize` head-drop if configured. Advances `version`. */
4290
- append(value: T): void;
4291
- /** Append a batch; advances `version` once. No-op if `values.length === 0`. */
4292
- appendMany(values: readonly T[]): void;
4293
- /** Remove all entries. Returns count removed. Advances `version` only if non-zero. */
4294
- clear(): number;
4295
- /** Remove the first `n` entries (clamped). Returns count removed. Throws on negative `n`. */
4296
- trimHead(n: number): number;
4297
- /** Fresh snapshot array for `[start, stop)`. Throws on negative `start`. */
4298
- slice(start: number, stop?: number): readonly T[];
4299
- /** Last `n` entries as a fresh array. Throws on negative `n`. */
4300
- tail(n: number): readonly T[];
4301
- /** Full snapshot as a fresh array. */
4302
- toArray(): readonly T[];
4303
- }
4304
- /**
4305
- * Default append-only log backend.
4306
- *
4307
- * - When `maxSize` is set: uses a **ring buffer** with `_head` index and circular
4308
- * modular arithmetic. Append and trim become O(1); snapshot is O(size) unrolling.
4309
- * - When `maxSize` is unset: uses a flat array with standard push/splice.
4310
- *
4311
- * `appendMany` pre-trims oversize input: if `values.length > maxSize`, only the
4312
- * tail of `values` is pushed (the rest would be immediately evicted).
4313
- *
4314
- * @category extra
4315
- */
4316
- declare class NativeLogBackend<T> implements LogBackend<T> {
4317
- private _version;
4318
- private readonly _maxSize?;
4319
- private readonly _buf;
4320
- private _head;
4321
- private _size;
4322
- constructor(initial?: readonly T[], maxSize?: number);
4323
- get version(): number;
4324
- get size(): number;
4325
- at(index: number): T | undefined;
4326
- append(value: T): void;
4327
- appendMany(values: readonly T[]): void;
4328
- clear(): number;
4329
- trimHead(n: number): number;
4330
- slice(start: number, stop?: number): readonly T[];
4331
- tail(n: number): readonly T[];
4332
- toArray(): readonly T[];
4333
- /** Internal append without version bump — used by `appendMany`. */
4334
- private _rawAppend;
4335
- }
4336
2505
  /**
4337
- * Creates an append-only reactive log with immutable array snapshots.
2506
+ * stratify reactive branch routing over a classifier rule set.
4338
2507
  *
4339
- * @param initial - Optional seed entries (copied; pre-trimmed to `maxSize` if set).
4340
- * @param options - `name`, `maxSize`, and optional pluggable `backend`.
4341
- * @returns Bundle with `entries` (state node), `append`/`appendMany`/`clear`/`trimHead`,
4342
- * `size` / `at`, and memoized derived views `tail(n)` / `slice(start, stop?)`.
2508
+ * Protocol-level primitive (no domain assumptions) that routes a source value
2509
+ * to independent branch subgraphs. Rules are reactive update the `"rules"`
2510
+ * state node to rewrite classification at runtime. Rule updates affect
2511
+ * **future items only** (streaming semantics, not retroactive).
4343
2512
  *
4344
- * @remarks
4345
- * **Backend:** The default {@link NativeLogBackend} uses a ring buffer when `maxSize`
4346
- * is set (O(1) append + trim) and a flat array otherwise. For persistent/structural-
4347
- * sharing semantics plug in a custom {@link LogBackend}.
4348
- *
4349
- * **`initial` + custom `backend` (F5):** When you supply `options.backend`, the
4350
- * `initial` argument is IGNORED — seed the backend yourself before passing it in.
4351
- * The `initial` seed only applies to the default `NativeLogBackend`.
4352
- *
4353
- * **Memoized views:** {@link ReactiveLogBundle.tail} and {@link ReactiveLogBundle.slice}
4354
- * cache derived nodes per-argument. Repeat calls with the same `n` / `(start, stop)`
4355
- * return the same node, bounding keepalive-subscription count to one per unique argument.
4356
- *
4357
- * @example
4358
- * ```ts
4359
- * import { reactiveLog } from "@graphrefly/graphrefly-ts";
4360
- *
4361
- * const lg = reactiveLog<number>([1, 2], { name: "audit", maxSize: 100 });
4362
- * lg.append(3);
4363
- * lg.entries.subscribe((msgs) => console.log(msgs));
4364
- * const last5 = lg.tail(5); // derived node
4365
- * const window = lg.slice(10, 20); // derived node
4366
- * ```
4367
- *
4368
- * @category extra
4369
- */
4370
- declare function reactiveLog<T>(initial?: readonly T[], options?: ReactiveLogOptions<T>): ReactiveLogBundle<T>;
4371
-
4372
- /**
4373
- * Filesystem-watching source. Isolated from `./sources.ts` so bundlers
4374
- * targeting the browser can import browser-safe sources (`fromTimer`,
4375
- * `fromRaf`, etc.) without pulling in `node:fs`/`node:path`.
2513
+ * @module
4376
2514
  */
4377
2515
 
4378
- type ExtraOpts = Omit<NodeOptions<unknown>, "describeKind">;
4379
- type FSEventType = "change" | "rename" | "create" | "delete";
4380
- type FSEvent = {
4381
- type: FSEventType;
4382
- path: string;
4383
- root: string;
4384
- relative_path: string;
4385
- src_path?: string;
4386
- dest_path?: string;
4387
- timestamp_ns: number;
2516
+ /** A single routing rule for {@link stratify}. */
2517
+ type StratifyRule<T> = {
2518
+ /** Branch name (used as node name under `branch/<name>`). */
2519
+ name: string;
2520
+ /** Classifier: returns `true` if the value belongs to this branch. */
2521
+ classify: (value: T) => boolean;
2522
+ /** Optional operator chain applied to the branch after classification. */
2523
+ ops?: (n: Node<T>) => Node;
4388
2524
  };
4389
- type FromFSWatchOptions = ExtraOpts & {
4390
- recursive?: boolean;
4391
- debounce?: number;
4392
- include?: string[];
4393
- exclude?: string[];
2525
+ /** Options for {@link stratify}. */
2526
+ type StratifyOptions = GraphOptions & {
2527
+ meta?: Record<string, unknown>;
4394
2528
  };
4395
2529
  /**
4396
- * Watches filesystem paths and emits debounced change events.
2530
+ * Route input to different branches based on classifier functions.
2531
+ *
2532
+ * Each branch gets an independent operator chain. Branch nodes are structural —
2533
+ * created at construction time and persist for the graph's lifetime. If a rule
2534
+ * name is removed from the rules array, the corresponding branch silently
2535
+ * drops items (classifier not found). To tear down a dead branch, call
2536
+ * `graph.remove("branch/<name>")`.
4397
2537
  *
4398
- * Uses `fs.watch` only (no polling fallback). Teardown closes all watchers.
2538
+ * @param name - Graph name.
2539
+ * @param source - Input node (registered as `"source"`).
2540
+ * @param rules - Initial routing rules.
2541
+ * @param opts - Optional graph/meta options.
2542
+ * @returns Graph with `"source"`, `"rules"`, and `"branch/<name>"` nodes.
4399
2543
  *
4400
2544
  * @category extra
4401
2545
  */
4402
- declare function fromFSWatch(paths: string | string[], opts?: FromFSWatchOptions): Node<FSEvent>;
2546
+ declare function stratify<T>(name: string, source: Node<T>, rules: ReadonlyArray<StratifyRule<T>>, opts?: StratifyOptions): Graph;
4403
2547
 
4404
2548
  /**
4405
2549
  * Creates a resettable deadline timer for internal timeout, retry, and rate-limiting use.
@@ -4647,8 +2791,8 @@ declare function workerSelf<TImport extends readonly string[]>(target: unknown |
4647
2791
  type index_AckableMessage<T> = AckableMessage<T>;
4648
2792
  type index_AdapterHandlers<T> = AdapterHandlers<T>;
4649
2793
  declare const index_AsyncSourceOpts: typeof AsyncSourceOpts;
4650
- type index_BackoffPreset = BackoffPreset;
4651
- type index_BackoffStrategy = BackoffStrategy;
2794
+ declare const index_BackoffPreset: typeof BackoffPreset;
2795
+ declare const index_BackoffStrategy: typeof BackoffStrategy;
4652
2796
  type index_BatchMessage = BatchMessage;
4653
2797
  type index_BridgeMessage = BridgeMessage;
4654
2798
  type index_BufferedSinkHandle = BufferedSinkHandle;
@@ -4659,11 +2803,10 @@ type index_CascadingCache<V> = CascadingCache<V>;
4659
2803
  type index_CascadingCacheOptions = CascadingCacheOptions;
4660
2804
  type index_CheckpointToRedisOptions = CheckpointToRedisOptions;
4661
2805
  type index_CheckpointToS3Options = CheckpointToS3Options;
4662
- type index_CircuitBreaker = CircuitBreaker;
4663
- type index_CircuitBreakerOptions = CircuitBreakerOptions;
4664
- type index_CircuitOpenError = CircuitOpenError;
2806
+ declare const index_CircuitBreaker: typeof CircuitBreaker;
2807
+ declare const index_CircuitBreakerOptions: typeof CircuitBreakerOptions;
4665
2808
  declare const index_CircuitOpenError: typeof CircuitOpenError;
4666
- type index_CircuitState = CircuitState;
2809
+ declare const index_CircuitState: typeof CircuitState;
4667
2810
  type index_ClickHouseClientLike = ClickHouseClientLike;
4668
2811
  type index_ClickHouseInsertClientLike = ClickHouseInsertClientLike;
4669
2812
  type index_ClickHouseRow = ClickHouseRow;
@@ -4674,20 +2817,16 @@ type index_DrizzleQueryLike<T = unknown> = DrizzleQueryLike<T>;
4674
2817
  type index_EmitTriad<T> = EmitTriad<T>;
4675
2818
  type index_ErrorMessage = ErrorMessage;
4676
2819
  declare const index_EventTargetLike: typeof EventTargetLike;
4677
- type index_ExponentialBackoffOptions = ExponentialBackoffOptions;
2820
+ declare const index_ExponentialBackoffOptions: typeof ExponentialBackoffOptions;
4678
2821
  type index_ExternalBundleOptions<TChannels extends Record<string, unknown>> = ExternalBundleOptions<TChannels>;
4679
2822
  type index_ExternalRegister<H> = ExternalRegister<H>;
4680
2823
  declare const index_Extraction: typeof Extraction;
4681
- type index_FSEvent = FSEvent;
4682
- type index_FSEventType = FSEventType;
4683
- type index_FallbackInput<T> = FallbackInput<T>;
2824
+ declare const index_FallbackInput: typeof FallbackInput;
4684
2825
  type index_FileWriterLike = FileWriterLike;
4685
2826
  type index_FromCSVOptions = FromCSVOptions;
4686
2827
  type index_FromClickHouseWatchOptions = FromClickHouseWatchOptions;
4687
2828
  declare const index_FromCronOptions: typeof FromCronOptions;
4688
2829
  type index_FromDrizzleOptions<T, U = T> = FromDrizzleOptions<T, U>;
4689
- type index_FromFSWatchOptions = FromFSWatchOptions;
4690
- type index_FromGitHookOptions = FromGitHookOptions;
4691
2830
  type index_FromHTTPOptions = FromHTTPOptions;
4692
2831
  type index_FromHTTPPollOptions = FromHTTPPollOptions;
4693
2832
  type index_FromHTTPStreamOptions = FromHTTPStreamOptions;
@@ -4707,36 +2846,30 @@ type index_FromSqliteOptions<T> = FromSqliteOptions<T>;
4707
2846
  type index_FromStatsDOptions = FromStatsDOptions;
4708
2847
  type index_FromSyslogOptions = FromSyslogOptions;
4709
2848
  type index_FromWebSocketReconnectOptions<T> = FromWebSocketReconnectOptions<T>;
4710
- type index_GitEvent = GitEvent;
4711
- type index_GitHookType = GitHookType;
4712
2849
  type index_HTTPBundle<T> = HTTPBundle<T>;
4713
- type index_IndexBackend<K, V = unknown> = IndexBackend<K, V>;
4714
- type index_IndexRow<K, V = unknown> = IndexRow<K, V>;
4715
- declare const index_IndexedDbStorageSpec: typeof IndexedDbStorageSpec;
2850
+ declare const index_IndexBackend: typeof IndexBackend;
2851
+ declare const index_IndexRow: typeof IndexRow;
4716
2852
  type index_InitMessage = InitMessage;
4717
- type index_JitterMode = JitterMode;
2853
+ declare const index_JitterMode: typeof JitterMode;
4718
2854
  type index_KafkaConsumerLike = KafkaConsumerLike;
4719
2855
  type index_KafkaMessage<T = unknown> = KafkaMessage<T>;
4720
2856
  type index_KafkaProducerLike = KafkaProducerLike;
4721
2857
  type index_KyselyQueryLike<T = unknown> = KyselyQueryLike<T>;
4722
- type index_ListBackend<T> = ListBackend<T>;
4723
- type index_LogBackend<T> = LogBackend<T>;
2858
+ declare const index_ListBackend: typeof ListBackend;
2859
+ declare const index_LogBackend: typeof LogBackend;
4724
2860
  type index_LokiClientLike = LokiClientLike;
4725
2861
  type index_LokiStream = LokiStream;
4726
2862
  type index_MCPClientLike = MCPClientLike;
4727
2863
  declare const index_MapBackend: typeof MapBackend;
4728
- type index_MergeMapOptions = MergeMapOptions;
2864
+ declare const index_MergeMapOptions: typeof MergeMapOptions;
4729
2865
  type index_MongoCollectionLike = MongoCollectionLike;
4730
2866
  type index_NATSClientLike = NATSClientLike;
4731
2867
  type index_NATSMessage<T = unknown> = NATSMessage<T>;
4732
2868
  type index_NATSSubscriptionLike = NATSSubscriptionLike;
4733
2869
  declare const index_NS_PER_MS: typeof NS_PER_MS;
4734
2870
  declare const index_NS_PER_SEC: typeof NS_PER_SEC;
4735
- type index_NativeIndexBackend<K, V = unknown> = NativeIndexBackend<K, V>;
4736
2871
  declare const index_NativeIndexBackend: typeof NativeIndexBackend;
4737
- type index_NativeListBackend<T> = NativeListBackend<T>;
4738
2872
  declare const index_NativeListBackend: typeof NativeListBackend;
4739
- type index_NativeLogBackend<T> = NativeLogBackend<T>;
4740
2873
  declare const index_NativeLogBackend: typeof NativeLogBackend;
4741
2874
  declare const index_NativeMapBackend: typeof NativeMapBackend;
4742
2875
  declare const index_NativeMapBackendOptions: typeof NativeMapBackendOptions;
@@ -4759,17 +2892,16 @@ type index_PulsarMessage<T = unknown> = PulsarMessage<T>;
4759
2892
  type index_PulsarProducerLike = PulsarProducerLike;
4760
2893
  type index_RabbitMQChannelLike = RabbitMQChannelLike;
4761
2894
  type index_RabbitMQMessage<T = unknown> = RabbitMQMessage<T>;
4762
- type index_RateLimiterOptions = RateLimiterOptions;
4763
- type index_RateLimiterOverflowError = RateLimiterOverflowError;
2895
+ declare const index_RateLimiterOptions: typeof RateLimiterOptions;
4764
2896
  declare const index_RateLimiterOverflowError: typeof RateLimiterOverflowError;
4765
- type index_RateLimiterOverflowPolicy = RateLimiterOverflowPolicy;
2897
+ declare const index_RateLimiterOverflowPolicy: typeof RateLimiterOverflowPolicy;
4766
2898
  declare const index_ReactiveCounterBundle: typeof ReactiveCounterBundle;
4767
- type index_ReactiveIndexBundle<K, V = unknown> = ReactiveIndexBundle<K, V>;
4768
- type index_ReactiveIndexOptions<K, V = unknown> = ReactiveIndexOptions<K, V>;
4769
- type index_ReactiveListBundle<T> = ReactiveListBundle<T>;
4770
- type index_ReactiveListOptions<T> = ReactiveListOptions<T>;
4771
- type index_ReactiveLogBundle<T> = ReactiveLogBundle<T>;
4772
- type index_ReactiveLogOptions<T> = ReactiveLogOptions<T>;
2899
+ declare const index_ReactiveIndexBundle: typeof ReactiveIndexBundle;
2900
+ declare const index_ReactiveIndexOptions: typeof ReactiveIndexOptions;
2901
+ declare const index_ReactiveListBundle: typeof ReactiveListBundle;
2902
+ declare const index_ReactiveListOptions: typeof ReactiveListOptions;
2903
+ declare const index_ReactiveLogBundle: typeof ReactiveLogBundle;
2904
+ declare const index_ReactiveLogOptions: typeof ReactiveLogOptions;
4773
2905
  declare const index_ReactiveMapBundle: typeof ReactiveMapBundle;
4774
2906
  declare const index_ReactiveMapOptions: typeof ReactiveMapOptions;
4775
2907
  type index_ReactiveSinkBackpressureOptions = ReactiveSinkBackpressureOptions;
@@ -4783,11 +2915,12 @@ type index_RedisClientLike = RedisClientLike;
4783
2915
  type index_RedisStreamEntry<T = unknown> = RedisStreamEntry<T>;
4784
2916
  type index_ResettableTimer = ResettableTimer;
4785
2917
  declare const index_ResettableTimer: typeof ResettableTimer;
4786
- type index_RetryOptions = RetryOptions;
4787
- type index_RetrySourceOptions<T> = RetrySourceOptions<T>;
2918
+ declare const index_RetryOptions: typeof RetryOptions;
2919
+ declare const index_RetrySourceOptions: typeof RetrySourceOptions;
4788
2920
  type index_S3ClientLike = S3ClientLike;
4789
2921
  type index_SSEEvent<T = string> = SSEEvent<T>;
4790
2922
  type index_SignalMessage = SignalMessage;
2923
+ type index_SingleFromAnyOptions<K> = SingleFromAnyOptions<K>;
4791
2924
  type index_SinkFailure<T> = SinkFailure<T>;
4792
2925
  type index_SinkHandle = SinkHandle;
4793
2926
  type index_SinkTransportError = SinkTransportError;
@@ -4795,15 +2928,16 @@ type index_SqliteDbLike = SqliteDbLike;
4795
2928
  type index_SqliteIterableDbLike = SqliteIterableDbLike;
4796
2929
  type index_StatsDMetric = StatsDMetric;
4797
2930
  type index_StatsDRegister = StatsDRegister;
4798
- type index_StatusValue = StatusValue;
2931
+ declare const index_StatusValue: typeof StatusValue;
4799
2932
  declare const index_StorageHandle: typeof StorageHandle;
4800
2933
  declare const index_StorageTier: typeof StorageTier;
2934
+ type index_StratifyOptions = StratifyOptions;
2935
+ type index_StratifyRule<T> = StratifyRule<T>;
4801
2936
  type index_SyslogMessage = SyslogMessage;
4802
2937
  type index_SyslogRegister = SyslogRegister;
4803
- type index_TapObserver<T> = TapObserver<T>;
2938
+ declare const index_TapObserver: typeof TapObserver;
4804
2939
  type index_TempoClientLike = TempoClientLike;
4805
- type index_ThrottleOptions = ThrottleOptions;
4806
- type index_TimeoutError = TimeoutError;
2940
+ declare const index_ThrottleOptions: typeof ThrottleOptions;
4807
2941
  declare const index_TimeoutError: typeof TimeoutError;
4808
2942
  type index_ToCSVOptions<T> = ToCSVOptions<T>;
4809
2943
  type index_ToClickHouseOptions<T> = ToClickHouseOptions<T>;
@@ -4823,8 +2957,8 @@ type index_ToSSEOptions = ToSSEOptions;
4823
2957
  type index_ToSqliteOptions<T> = ToSqliteOptions<T>;
4824
2958
  type index_ToTempoOptions<T> = ToTempoOptions<T>;
4825
2959
  type index_ToWebSocketOptions<T> = ToWebSocketOptions<T>;
4826
- type index_TokenBucket = TokenBucket;
4827
- type index_UpsertOptions<K, V> = UpsertOptions<K, V>;
2960
+ declare const index_TokenBucket: typeof TokenBucket;
2961
+ declare const index_UpsertOptions: typeof UpsertOptions;
4828
2962
  type index_ValueMessage = ValueMessage;
4829
2963
  declare const index_VerifiableBundle: typeof VerifiableBundle;
4830
2964
  declare const index_VerifiableOptions: typeof VerifiableOptions;
@@ -4835,14 +2969,15 @@ type index_WebSocketLike = WebSocketLike;
4835
2969
  type index_WebSocketMessageEventLike = WebSocketMessageEventLike;
4836
2970
  type index_WebSocketRegister<T> = WebSocketRegister<T>;
4837
2971
  type index_WebhookRegister<T> = WebhookRegister<T>;
4838
- type index_WithBreakerBundle<T> = WithBreakerBundle<T>;
4839
- type index_WithStatusBundle<T> = WithStatusBundle<T>;
2972
+ declare const index_WithBreakerBundle: typeof WithBreakerBundle;
2973
+ declare const index_WithStatusBundle: typeof WithStatusBundle;
4840
2974
  type index_WorkerBridge<_TExpose extends Record<string, Node<any>>, TImport extends readonly string[]> = WorkerBridge<_TExpose, TImport>;
4841
2975
  type index_WorkerBridgeOptions<TExpose extends Record<string, Node<any>>, TImport extends readonly string[]> = WorkerBridgeOptions<TExpose, TImport>;
4842
2976
  type index_WorkerSelfHandle = WorkerSelfHandle;
4843
2977
  type index_WorkerSelfOptions<TImport extends readonly string[]> = WorkerSelfOptions<TImport>;
4844
2978
  type index_WorkerTransport = WorkerTransport;
4845
2979
  declare const index_audit: typeof audit;
2980
+ declare const index_awaitSettled: typeof awaitSettled;
4846
2981
  declare const index_buffer: typeof buffer;
4847
2982
  declare const index_bufferCount: typeof bufferCount;
4848
2983
  declare const index_bufferTime: typeof bufferTime;
@@ -4877,7 +3012,6 @@ declare const index_externalBundle: typeof externalBundle;
4877
3012
  declare const index_externalProducer: typeof externalProducer;
4878
3013
  declare const index_fallback: typeof fallback;
4879
3014
  declare const index_fibonacci: typeof fibonacci;
4880
- declare const index_fileStorage: typeof fileStorage;
4881
3015
  declare const index_filter: typeof filter;
4882
3016
  declare const index_find: typeof find;
4883
3017
  declare const index_first: typeof first;
@@ -4892,13 +3026,9 @@ declare const index_fromClickHouseWatch: typeof fromClickHouseWatch;
4892
3026
  declare const index_fromCron: typeof fromCron;
4893
3027
  declare const index_fromDrizzle: typeof fromDrizzle;
4894
3028
  declare const index_fromEvent: typeof fromEvent;
4895
- declare const index_fromFSWatch: typeof fromFSWatch;
4896
- declare const index_fromGitHook: typeof fromGitHook;
4897
3029
  declare const index_fromHTTP: typeof fromHTTP;
4898
3030
  declare const index_fromHTTPPoll: typeof fromHTTPPoll;
4899
3031
  declare const index_fromHTTPStream: typeof fromHTTPStream;
4900
- declare const index_fromIDBRequest: typeof fromIDBRequest;
4901
- declare const index_fromIDBTransaction: typeof fromIDBTransaction;
4902
3032
  declare const index_fromIter: typeof fromIter;
4903
3033
  declare const index_fromKafka: typeof fromKafka;
4904
3034
  declare const index_fromKysely: typeof fromKysely;
@@ -4923,7 +3053,6 @@ declare const index_fromWebSocket: typeof fromWebSocket;
4923
3053
  declare const index_fromWebSocketReconnect: typeof fromWebSocketReconnect;
4924
3054
  declare const index_fromWebhook: typeof fromWebhook;
4925
3055
  declare const index_globToRegExp: typeof globToRegExp;
4926
- declare const index_indexedDbStorage: typeof indexedDbStorage;
4927
3056
  declare const index_interval: typeof interval;
4928
3057
  declare const index_keepalive: typeof keepalive;
4929
3058
  declare const index_last: typeof last;
@@ -4967,8 +3096,12 @@ declare const index_serializeError: typeof serializeError;
4967
3096
  declare const index_share: typeof share;
4968
3097
  declare const index_shareReplay: typeof shareReplay;
4969
3098
  declare const index_signalToName: typeof signalToName;
3099
+ declare const index_singleFromAny: typeof singleFromAny;
3100
+ declare const index_singleNodeFromAny: typeof singleNodeFromAny;
4970
3101
  declare const index_skip: typeof skip;
4971
- declare const index_sqliteStorage: typeof sqliteStorage;
3102
+ declare const index_sortJsonValue: typeof sortJsonValue;
3103
+ declare const index_stableJsonString: typeof stableJsonString;
3104
+ declare const index_stratify: typeof stratify;
4972
3105
  declare const index_switchMap: typeof switchMap;
4973
3106
  declare const index_take: typeof take;
4974
3107
  declare const index_takeUntil: typeof takeUntil;
@@ -5013,7 +3146,7 @@ declare const index_workerBridge: typeof workerBridge;
5013
3146
  declare const index_workerSelf: typeof workerSelf;
5014
3147
  declare const index_zip: typeof zip;
5015
3148
  declare namespace index {
5016
- export { type index_AckableMessage as AckableMessage, type index_AdapterHandlers as AdapterHandlers, index_AsyncSourceOpts as AsyncSourceOpts, type index_BackoffPreset as BackoffPreset, type index_BackoffStrategy as BackoffStrategy, type index_BatchMessage as BatchMessage, type index_BridgeMessage as BridgeMessage, type index_BufferedSinkHandle as BufferedSinkHandle, type index_BundleTriad as BundleTriad, type index_CSVRow as CSVRow, type index_CacheEvictionPolicy as CacheEvictionPolicy, type index_CascadingCache as CascadingCache, type index_CascadingCacheOptions as CascadingCacheOptions, type index_CheckpointToRedisOptions as CheckpointToRedisOptions, type index_CheckpointToS3Options as CheckpointToS3Options, type index_CircuitBreaker as CircuitBreaker, type index_CircuitBreakerOptions as CircuitBreakerOptions, index_CircuitOpenError as CircuitOpenError, type index_CircuitState as CircuitState, type index_ClickHouseClientLike as ClickHouseClientLike, type index_ClickHouseInsertClientLike as ClickHouseInsertClientLike, type index_ClickHouseRow as ClickHouseRow, type index_CronSchedule as CronSchedule, index_DistillBundle as DistillBundle, index_DistillOptions as DistillOptions, type index_DrizzleQueryLike as DrizzleQueryLike, type index_EmitTriad as EmitTriad, type index_ErrorMessage as ErrorMessage, index_EventTargetLike as EventTargetLike, type index_ExponentialBackoffOptions as ExponentialBackoffOptions, type index_ExternalBundleOptions as ExternalBundleOptions, type index_ExternalRegister as ExternalRegister, index_Extraction as Extraction, type index_FSEvent as FSEvent, type index_FSEventType as FSEventType, type index_FallbackInput as FallbackInput, type index_FileWriterLike as FileWriterLike, type index_FromCSVOptions as FromCSVOptions, type index_FromClickHouseWatchOptions as FromClickHouseWatchOptions, index_FromCronOptions as FromCronOptions, type index_FromDrizzleOptions as FromDrizzleOptions, type index_FromFSWatchOptions as FromFSWatchOptions, type index_FromGitHookOptions as FromGitHookOptions, type index_FromHTTPOptions as FromHTTPOptions, type index_FromHTTPPollOptions as FromHTTPPollOptions, type index_FromHTTPStreamOptions as FromHTTPStreamOptions, type index_FromKafkaOptions as FromKafkaOptions, type index_FromKyselyOptions as FromKyselyOptions, type index_FromMCPOptions as FromMCPOptions, type index_FromNATSOptions as FromNATSOptions, type index_FromNDJSONOptions as FromNDJSONOptions, type index_FromOTelOptions as FromOTelOptions, type index_FromPrismaOptions as FromPrismaOptions, type index_FromPrometheusOptions as FromPrometheusOptions, type index_FromPulsarOptions as FromPulsarOptions, type index_FromRabbitMQOptions as FromRabbitMQOptions, type index_FromRedisStreamOptions as FromRedisStreamOptions, type index_FromSSEOptions as FromSSEOptions, type index_FromSqliteOptions as FromSqliteOptions, type index_FromStatsDOptions as FromStatsDOptions, type index_FromSyslogOptions as FromSyslogOptions, type index_FromWebSocketReconnectOptions as FromWebSocketReconnectOptions, type index_GitEvent as GitEvent, type index_GitHookType as GitHookType, type index_HTTPBundle as HTTPBundle, type index_IndexBackend as IndexBackend, type index_IndexRow as IndexRow, index_IndexedDbStorageSpec as IndexedDbStorageSpec, type index_InitMessage as InitMessage, type index_JitterMode as JitterMode, type index_KafkaConsumerLike as KafkaConsumerLike, type index_KafkaMessage as KafkaMessage, type index_KafkaProducerLike as KafkaProducerLike, type index_KyselyQueryLike as KyselyQueryLike, type index_ListBackend as ListBackend, type index_LogBackend as LogBackend, type index_LokiClientLike as LokiClientLike, type index_LokiStream as LokiStream, type index_MCPClientLike as MCPClientLike, index_MapBackend as MapBackend, type index_MergeMapOptions as MergeMapOptions, type index_MongoCollectionLike as MongoCollectionLike, type index_NATSClientLike as NATSClientLike, type index_NATSMessage as NATSMessage, type index_NATSSubscriptionLike as NATSSubscriptionLike, index_NS_PER_MS as NS_PER_MS, index_NS_PER_SEC as NS_PER_SEC, index_NativeIndexBackend as NativeIndexBackend, index_NativeListBackend as NativeListBackend, index_NativeLogBackend as NativeLogBackend, index_NativeMapBackend as NativeMapBackend, index_NativeMapBackendOptions as NativeMapBackendOptions, index_NativePubSubBackend as NativePubSubBackend, index_NodeInput as NodeInput, type index_OTelBundle as OTelBundle, type index_OTelLog as OTelLog, type index_OTelMetric as OTelMetric, type index_OTelRegister as OTelRegister, type index_OTelSpan as OTelSpan, type index_PostgresClientLike as PostgresClientLike, type index_PrismaModelLike as PrismaModelLike, type index_PrometheusMetric as PrometheusMetric, type index_PubSubBackend as PubSubBackend, type index_PubSubHub as PubSubHub, type index_PubSubHubOptions as PubSubHubOptions, type index_PulsarConsumerLike as PulsarConsumerLike, type index_PulsarMessage as PulsarMessage, type index_PulsarProducerLike as PulsarProducerLike, type index_RabbitMQChannelLike as RabbitMQChannelLike, type index_RabbitMQMessage as RabbitMQMessage, type index_RateLimiterOptions as RateLimiterOptions, index_RateLimiterOverflowError as RateLimiterOverflowError, type index_RateLimiterOverflowPolicy as RateLimiterOverflowPolicy, index_ReactiveCounterBundle as ReactiveCounterBundle, type index_ReactiveIndexBundle as ReactiveIndexBundle, type index_ReactiveIndexOptions as ReactiveIndexOptions, type index_ReactiveListBundle as ReactiveListBundle, type index_ReactiveListOptions as ReactiveListOptions, type index_ReactiveLogBundle as ReactiveLogBundle, type index_ReactiveLogOptions as ReactiveLogOptions, index_ReactiveMapBundle as ReactiveMapBundle, index_ReactiveMapOptions as ReactiveMapOptions, type index_ReactiveSinkBackpressureOptions as ReactiveSinkBackpressureOptions, type index_ReactiveSinkConfig as ReactiveSinkConfig, type index_ReactiveSinkHandle as ReactiveSinkHandle, type index_ReactiveSinkOptions as ReactiveSinkOptions, type index_ReactiveSinkRetryOptions as ReactiveSinkRetryOptions, type index_ReadyMessage as ReadyMessage, type index_RedisCheckpointClientLike as RedisCheckpointClientLike, type index_RedisClientLike as RedisClientLike, type index_RedisStreamEntry as RedisStreamEntry, index_ResettableTimer as ResettableTimer, type index_RetryOptions as RetryOptions, type index_RetrySourceOptions as RetrySourceOptions, type index_S3ClientLike as S3ClientLike, type index_SSEEvent as SSEEvent, type index_SignalMessage as SignalMessage, type index_SinkFailure as SinkFailure, type index_SinkHandle as SinkHandle, type index_SinkTransportError as SinkTransportError, type index_SqliteDbLike as SqliteDbLike, type index_SqliteIterableDbLike as SqliteIterableDbLike, type index_StatsDMetric as StatsDMetric, type index_StatsDRegister as StatsDRegister, type index_StatusValue as StatusValue, index_StorageHandle as StorageHandle, index_StorageTier as StorageTier, type index_SyslogMessage as SyslogMessage, type index_SyslogRegister as SyslogRegister, type index_TapObserver as TapObserver, type index_TempoClientLike as TempoClientLike, type index_ThrottleOptions as ThrottleOptions, index_TimeoutError as TimeoutError, type index_ToCSVOptions as ToCSVOptions, type index_ToClickHouseOptions as ToClickHouseOptions, type index_ToFileOptions as ToFileOptions, type index_ToHTTPOptions as ToHTTPOptions, type index_ToKafkaOptions as ToKafkaOptions, type index_ToLokiOptions as ToLokiOptions, type index_ToMongoOptions as ToMongoOptions, type index_ToNATSOptions as ToNATSOptions, index_ToObservableOptions as ToObservableOptions, type index_ToPostgresOptions as ToPostgresOptions, type index_ToPulsarOptions as ToPulsarOptions, type index_ToRabbitMQOptions as ToRabbitMQOptions, type index_ToRedisStreamOptions as ToRedisStreamOptions, type index_ToS3Options as ToS3Options, type index_ToSSEOptions as ToSSEOptions, type index_ToSqliteOptions as ToSqliteOptions, type index_ToTempoOptions as ToTempoOptions, type index_ToWebSocketOptions as ToWebSocketOptions, type index_TokenBucket as TokenBucket, type index_UpsertOptions as UpsertOptions, type index_ValueMessage as ValueMessage, index_VerifiableBundle as VerifiableBundle, index_VerifiableOptions as VerifiableOptions, index_VerifyValue as VerifyValue, type index_WatermarkController as WatermarkController, type index_WatermarkOptions as WatermarkOptions, type index_WebSocketLike as WebSocketLike, type index_WebSocketMessageEventLike as WebSocketMessageEventLike, type index_WebSocketRegister as WebSocketRegister, type index_WebhookRegister as WebhookRegister, type index_WithBreakerBundle as WithBreakerBundle, type index_WithStatusBundle as WithStatusBundle, type index_WorkerBridge as WorkerBridge, type index_WorkerBridgeOptions as WorkerBridgeOptions, type index_WorkerSelfHandle as WorkerSelfHandle, type index_WorkerSelfOptions as WorkerSelfOptions, type index_WorkerTransport as WorkerTransport, index_audit as audit, index_buffer as buffer, index_bufferCount as bufferCount, index_bufferTime as bufferTime, index_cached as cached, index_cascadingCache as cascadingCache, index_catchError as catchError, index_checkpointToRedis as checkpointToRedis, index_checkpointToS3 as checkpointToS3, index_circuitBreaker as circuitBreaker, index_combine as combine, index_combineLatest as combineLatest, index_concat as concat, index_concatMap as concatMap, index_constant as constant, index_createTransport as createTransport, index_createWatermarkController as createWatermarkController, index_csvRows as csvRows, index_debounce as debounce, index_debounceTime as debounceTime, index_decorrelatedJitter as decorrelatedJitter, index_delay as delay, index_deserializeError as deserializeError, index_dictStorage as dictStorage, index_distill as distill, index_distinctUntilChanged as distinctUntilChanged, index_elementAt as elementAt, index_empty as empty, index_escapeRegexChar as escapeRegexChar, index_exhaustMap as exhaustMap, index_exponential as exponential, index_externalBundle as externalBundle, index_externalProducer as externalProducer, index_fallback as fallback, index_fibonacci as fibonacci, index_fileStorage as fileStorage, index_filter as filter, index_find as find, index_first as first, index_firstValueFrom as firstValueFrom, index_firstWhere as firstWhere, index_flatMap as flatMap, index_forEach as forEach, index_fromAny as fromAny, index_fromAsyncIter as fromAsyncIter, index_fromCSV as fromCSV, index_fromClickHouseWatch as fromClickHouseWatch, index_fromCron as fromCron, index_fromDrizzle as fromDrizzle, index_fromEvent as fromEvent, index_fromFSWatch as fromFSWatch, index_fromGitHook as fromGitHook, index_fromHTTP as fromHTTP, index_fromHTTPPoll as fromHTTPPoll, index_fromHTTPStream as fromHTTPStream, index_fromIDBRequest as fromIDBRequest, index_fromIDBTransaction as fromIDBTransaction, index_fromIter as fromIter, index_fromKafka as fromKafka, index_fromKysely as fromKysely, index_fromMCP as fromMCP, index_fromNATS as fromNATS, index_fromNDJSON as fromNDJSON, index_fromOTel as fromOTel, index_fromPrisma as fromPrisma, index_fromPrometheus as fromPrometheus, index_fromPromise as fromPromise, index_fromPulsar as fromPulsar, index_fromRabbitMQ as fromRabbitMQ, index_fromRaf as fromRaf, index_fromRedisStream as fromRedisStream, index_fromSSE as fromSSE, index_fromSqlite as fromSqlite, index_fromSqliteCursor as fromSqliteCursor, index_fromStatsD as fromStatsD, index_fromSyslog as fromSyslog, index_fromTimer as fromTimer, index_fromWebSocket as fromWebSocket, index_fromWebSocketReconnect as fromWebSocketReconnect, index_fromWebhook as fromWebhook, index_globToRegExp as globToRegExp, index_indexedDbStorage as indexedDbStorage, index_interval as interval, index_keepalive as keepalive, index_last as last, index_linear as linear, index_lru as lru, index_map as map, index_matchesAnyPattern as matchesAnyPattern, index_matchesCron as matchesCron, index_memoryStorage as memoryStorage, index_merge as merge, index_mergeMap as mergeMap, index_nameToSignal as nameToSignal, index_ndjsonRows as ndjsonRows, index_never as never, index_of as of, index_pairwise as pairwise, index_parseCron as parseCron, index_parsePrometheusText as parsePrometheusText, index_parseStatsD as parseStatsD, index_parseSyslog as parseSyslog, index_pausable as pausable, index_pubsub as pubsub, index_race as race, index_rateLimiter as rateLimiter, index_reactiveCounter as reactiveCounter, index_reactiveIndex as reactiveIndex, index_reactiveList as reactiveList, index_reactiveLog as reactiveLog, index_reactiveMap as reactiveMap, index_reactiveSink as reactiveSink, index_reduce as reduce, index_repeat as repeat, index_replay as replay, index_rescue as rescue, index_resolveBackoffPreset as resolveBackoffPreset, index_retry as retry, index_retrySource as retrySource, index_sample as sample, index_scan as scan, index_serializeError as serializeError, index_share as share, index_shareReplay as shareReplay, index_signalToName as signalToName, index_skip as skip, index_sqliteStorage as sqliteStorage, index_switchMap as switchMap, index_take as take, index_takeUntil as takeUntil, index_takeWhile as takeWhile, index_tap as tap, index_throttle as throttle, index_throttleTime as throttleTime, index_throwError as throwError, index_timeout as timeout, index_toArray as toArray, index_toCSV as toCSV, index_toClickHouse as toClickHouse, index_toFile as toFile, index_toHTTP as toHTTP, index_toKafka as toKafka, index_toLoki as toLoki, index_toMongo as toMongo, index_toNATS as toNATS, index_toObservable as toObservable, index_toPostgres as toPostgres, index_toPulsar as toPulsar, index_toRabbitMQ as toRabbitMQ, index_toReadableStream as toReadableStream, index_toRedisStream as toRedisStream, index_toS3 as toS3, index_toSSE as toSSE, index_toSSEBytes as toSSEBytes, index_toSqlite as toSqlite, index_toTempo as toTempo, index_toWebSocket as toWebSocket, index_tokenBucket as tokenBucket, index_valve as valve, index_verifiable as verifiable, index_window as window, index_windowCount as windowCount, index_windowTime as windowTime, index_withBreaker as withBreaker, index_withLatestFrom as withLatestFrom, index_withMaxAttempts as withMaxAttempts, index_withStatus as withStatus, index_workerBridge as workerBridge, index_workerSelf as workerSelf, index_zip as zip };
3149
+ export { type index_AckableMessage as AckableMessage, type index_AdapterHandlers as AdapterHandlers, index_AsyncSourceOpts as AsyncSourceOpts, index_BackoffPreset as BackoffPreset, index_BackoffStrategy as BackoffStrategy, type index_BatchMessage as BatchMessage, type index_BridgeMessage as BridgeMessage, type index_BufferedSinkHandle as BufferedSinkHandle, type index_BundleTriad as BundleTriad, type index_CSVRow as CSVRow, type index_CacheEvictionPolicy as CacheEvictionPolicy, type index_CascadingCache as CascadingCache, type index_CascadingCacheOptions as CascadingCacheOptions, type index_CheckpointToRedisOptions as CheckpointToRedisOptions, type index_CheckpointToS3Options as CheckpointToS3Options, index_CircuitBreaker as CircuitBreaker, index_CircuitBreakerOptions as CircuitBreakerOptions, index_CircuitOpenError as CircuitOpenError, index_CircuitState as CircuitState, type index_ClickHouseClientLike as ClickHouseClientLike, type index_ClickHouseInsertClientLike as ClickHouseInsertClientLike, type index_ClickHouseRow as ClickHouseRow, type index_CronSchedule as CronSchedule, index_DistillBundle as DistillBundle, index_DistillOptions as DistillOptions, type index_DrizzleQueryLike as DrizzleQueryLike, type index_EmitTriad as EmitTriad, type index_ErrorMessage as ErrorMessage, index_EventTargetLike as EventTargetLike, index_ExponentialBackoffOptions as ExponentialBackoffOptions, type index_ExternalBundleOptions as ExternalBundleOptions, type index_ExternalRegister as ExternalRegister, index_Extraction as Extraction, index_FallbackInput as FallbackInput, type index_FileWriterLike as FileWriterLike, type index_FromCSVOptions as FromCSVOptions, type index_FromClickHouseWatchOptions as FromClickHouseWatchOptions, index_FromCronOptions as FromCronOptions, type index_FromDrizzleOptions as FromDrizzleOptions, type index_FromHTTPOptions as FromHTTPOptions, type index_FromHTTPPollOptions as FromHTTPPollOptions, type index_FromHTTPStreamOptions as FromHTTPStreamOptions, type index_FromKafkaOptions as FromKafkaOptions, type index_FromKyselyOptions as FromKyselyOptions, type index_FromMCPOptions as FromMCPOptions, type index_FromNATSOptions as FromNATSOptions, type index_FromNDJSONOptions as FromNDJSONOptions, type index_FromOTelOptions as FromOTelOptions, type index_FromPrismaOptions as FromPrismaOptions, type index_FromPrometheusOptions as FromPrometheusOptions, type index_FromPulsarOptions as FromPulsarOptions, type index_FromRabbitMQOptions as FromRabbitMQOptions, type index_FromRedisStreamOptions as FromRedisStreamOptions, type index_FromSSEOptions as FromSSEOptions, type index_FromSqliteOptions as FromSqliteOptions, type index_FromStatsDOptions as FromStatsDOptions, type index_FromSyslogOptions as FromSyslogOptions, type index_FromWebSocketReconnectOptions as FromWebSocketReconnectOptions, type index_HTTPBundle as HTTPBundle, index_IndexBackend as IndexBackend, index_IndexRow as IndexRow, type index_InitMessage as InitMessage, index_JitterMode as JitterMode, type index_KafkaConsumerLike as KafkaConsumerLike, type index_KafkaMessage as KafkaMessage, type index_KafkaProducerLike as KafkaProducerLike, type index_KyselyQueryLike as KyselyQueryLike, index_ListBackend as ListBackend, index_LogBackend as LogBackend, type index_LokiClientLike as LokiClientLike, type index_LokiStream as LokiStream, type index_MCPClientLike as MCPClientLike, index_MapBackend as MapBackend, index_MergeMapOptions as MergeMapOptions, type index_MongoCollectionLike as MongoCollectionLike, type index_NATSClientLike as NATSClientLike, type index_NATSMessage as NATSMessage, type index_NATSSubscriptionLike as NATSSubscriptionLike, index_NS_PER_MS as NS_PER_MS, index_NS_PER_SEC as NS_PER_SEC, index_NativeIndexBackend as NativeIndexBackend, index_NativeListBackend as NativeListBackend, index_NativeLogBackend as NativeLogBackend, index_NativeMapBackend as NativeMapBackend, index_NativeMapBackendOptions as NativeMapBackendOptions, index_NativePubSubBackend as NativePubSubBackend, index_NodeInput as NodeInput, type index_OTelBundle as OTelBundle, type index_OTelLog as OTelLog, type index_OTelMetric as OTelMetric, type index_OTelRegister as OTelRegister, type index_OTelSpan as OTelSpan, type index_PostgresClientLike as PostgresClientLike, type index_PrismaModelLike as PrismaModelLike, type index_PrometheusMetric as PrometheusMetric, type index_PubSubBackend as PubSubBackend, type index_PubSubHub as PubSubHub, type index_PubSubHubOptions as PubSubHubOptions, type index_PulsarConsumerLike as PulsarConsumerLike, type index_PulsarMessage as PulsarMessage, type index_PulsarProducerLike as PulsarProducerLike, type index_RabbitMQChannelLike as RabbitMQChannelLike, type index_RabbitMQMessage as RabbitMQMessage, index_RateLimiterOptions as RateLimiterOptions, index_RateLimiterOverflowError as RateLimiterOverflowError, index_RateLimiterOverflowPolicy as RateLimiterOverflowPolicy, index_ReactiveCounterBundle as ReactiveCounterBundle, index_ReactiveIndexBundle as ReactiveIndexBundle, index_ReactiveIndexOptions as ReactiveIndexOptions, index_ReactiveListBundle as ReactiveListBundle, index_ReactiveListOptions as ReactiveListOptions, index_ReactiveLogBundle as ReactiveLogBundle, index_ReactiveLogOptions as ReactiveLogOptions, index_ReactiveMapBundle as ReactiveMapBundle, index_ReactiveMapOptions as ReactiveMapOptions, type index_ReactiveSinkBackpressureOptions as ReactiveSinkBackpressureOptions, type index_ReactiveSinkConfig as ReactiveSinkConfig, type index_ReactiveSinkHandle as ReactiveSinkHandle, type index_ReactiveSinkOptions as ReactiveSinkOptions, type index_ReactiveSinkRetryOptions as ReactiveSinkRetryOptions, type index_ReadyMessage as ReadyMessage, type index_RedisCheckpointClientLike as RedisCheckpointClientLike, type index_RedisClientLike as RedisClientLike, type index_RedisStreamEntry as RedisStreamEntry, index_ResettableTimer as ResettableTimer, index_RetryOptions as RetryOptions, index_RetrySourceOptions as RetrySourceOptions, type index_S3ClientLike as S3ClientLike, type index_SSEEvent as SSEEvent, type index_SignalMessage as SignalMessage, type index_SingleFromAnyOptions as SingleFromAnyOptions, type index_SinkFailure as SinkFailure, type index_SinkHandle as SinkHandle, type index_SinkTransportError as SinkTransportError, type index_SqliteDbLike as SqliteDbLike, type index_SqliteIterableDbLike as SqliteIterableDbLike, type index_StatsDMetric as StatsDMetric, type index_StatsDRegister as StatsDRegister, index_StatusValue as StatusValue, index_StorageHandle as StorageHandle, index_StorageTier as StorageTier, type index_StratifyOptions as StratifyOptions, type index_StratifyRule as StratifyRule, type index_SyslogMessage as SyslogMessage, type index_SyslogRegister as SyslogRegister, index_TapObserver as TapObserver, type index_TempoClientLike as TempoClientLike, index_ThrottleOptions as ThrottleOptions, index_TimeoutError as TimeoutError, type index_ToCSVOptions as ToCSVOptions, type index_ToClickHouseOptions as ToClickHouseOptions, type index_ToFileOptions as ToFileOptions, type index_ToHTTPOptions as ToHTTPOptions, type index_ToKafkaOptions as ToKafkaOptions, type index_ToLokiOptions as ToLokiOptions, type index_ToMongoOptions as ToMongoOptions, type index_ToNATSOptions as ToNATSOptions, index_ToObservableOptions as ToObservableOptions, type index_ToPostgresOptions as ToPostgresOptions, type index_ToPulsarOptions as ToPulsarOptions, type index_ToRabbitMQOptions as ToRabbitMQOptions, type index_ToRedisStreamOptions as ToRedisStreamOptions, type index_ToS3Options as ToS3Options, type index_ToSSEOptions as ToSSEOptions, type index_ToSqliteOptions as ToSqliteOptions, type index_ToTempoOptions as ToTempoOptions, type index_ToWebSocketOptions as ToWebSocketOptions, index_TokenBucket as TokenBucket, index_UpsertOptions as UpsertOptions, type index_ValueMessage as ValueMessage, index_VerifiableBundle as VerifiableBundle, index_VerifiableOptions as VerifiableOptions, index_VerifyValue as VerifyValue, type index_WatermarkController as WatermarkController, type index_WatermarkOptions as WatermarkOptions, type index_WebSocketLike as WebSocketLike, type index_WebSocketMessageEventLike as WebSocketMessageEventLike, type index_WebSocketRegister as WebSocketRegister, type index_WebhookRegister as WebhookRegister, index_WithBreakerBundle as WithBreakerBundle, index_WithStatusBundle as WithStatusBundle, type index_WorkerBridge as WorkerBridge, type index_WorkerBridgeOptions as WorkerBridgeOptions, type index_WorkerSelfHandle as WorkerSelfHandle, type index_WorkerSelfOptions as WorkerSelfOptions, type index_WorkerTransport as WorkerTransport, index_audit as audit, index_awaitSettled as awaitSettled, index_buffer as buffer, index_bufferCount as bufferCount, index_bufferTime as bufferTime, index_cached as cached, index_cascadingCache as cascadingCache, index_catchError as catchError, index_checkpointToRedis as checkpointToRedis, index_checkpointToS3 as checkpointToS3, index_circuitBreaker as circuitBreaker, index_combine as combine, index_combineLatest as combineLatest, index_concat as concat, index_concatMap as concatMap, index_constant as constant, index_createTransport as createTransport, index_createWatermarkController as createWatermarkController, index_csvRows as csvRows, index_debounce as debounce, index_debounceTime as debounceTime, index_decorrelatedJitter as decorrelatedJitter, index_delay as delay, index_deserializeError as deserializeError, index_dictStorage as dictStorage, index_distill as distill, index_distinctUntilChanged as distinctUntilChanged, index_elementAt as elementAt, index_empty as empty, index_escapeRegexChar as escapeRegexChar, index_exhaustMap as exhaustMap, index_exponential as exponential, index_externalBundle as externalBundle, index_externalProducer as externalProducer, index_fallback as fallback, index_fibonacci as fibonacci, index_filter as filter, index_find as find, index_first as first, index_firstValueFrom as firstValueFrom, index_firstWhere as firstWhere, index_flatMap as flatMap, index_forEach as forEach, index_fromAny as fromAny, index_fromAsyncIter as fromAsyncIter, index_fromCSV as fromCSV, index_fromClickHouseWatch as fromClickHouseWatch, index_fromCron as fromCron, index_fromDrizzle as fromDrizzle, index_fromEvent as fromEvent, index_fromHTTP as fromHTTP, index_fromHTTPPoll as fromHTTPPoll, index_fromHTTPStream as fromHTTPStream, index_fromIter as fromIter, index_fromKafka as fromKafka, index_fromKysely as fromKysely, index_fromMCP as fromMCP, index_fromNATS as fromNATS, index_fromNDJSON as fromNDJSON, index_fromOTel as fromOTel, index_fromPrisma as fromPrisma, index_fromPrometheus as fromPrometheus, index_fromPromise as fromPromise, index_fromPulsar as fromPulsar, index_fromRabbitMQ as fromRabbitMQ, index_fromRaf as fromRaf, index_fromRedisStream as fromRedisStream, index_fromSSE as fromSSE, index_fromSqlite as fromSqlite, index_fromSqliteCursor as fromSqliteCursor, index_fromStatsD as fromStatsD, index_fromSyslog as fromSyslog, index_fromTimer as fromTimer, index_fromWebSocket as fromWebSocket, index_fromWebSocketReconnect as fromWebSocketReconnect, index_fromWebhook as fromWebhook, index_globToRegExp as globToRegExp, index_interval as interval, index_keepalive as keepalive, index_last as last, index_linear as linear, index_lru as lru, index_map as map, index_matchesAnyPattern as matchesAnyPattern, index_matchesCron as matchesCron, index_memoryStorage as memoryStorage, index_merge as merge, index_mergeMap as mergeMap, index_nameToSignal as nameToSignal, index_ndjsonRows as ndjsonRows, index_never as never, index_of as of, index_pairwise as pairwise, index_parseCron as parseCron, index_parsePrometheusText as parsePrometheusText, index_parseStatsD as parseStatsD, index_parseSyslog as parseSyslog, index_pausable as pausable, index_pubsub as pubsub, index_race as race, index_rateLimiter as rateLimiter, index_reactiveCounter as reactiveCounter, index_reactiveIndex as reactiveIndex, index_reactiveList as reactiveList, index_reactiveLog as reactiveLog, index_reactiveMap as reactiveMap, index_reactiveSink as reactiveSink, index_reduce as reduce, index_repeat as repeat, index_replay as replay, index_rescue as rescue, index_resolveBackoffPreset as resolveBackoffPreset, index_retry as retry, index_retrySource as retrySource, index_sample as sample, index_scan as scan, index_serializeError as serializeError, index_share as share, index_shareReplay as shareReplay, index_signalToName as signalToName, index_singleFromAny as singleFromAny, index_singleNodeFromAny as singleNodeFromAny, index_skip as skip, index_sortJsonValue as sortJsonValue, index_stableJsonString as stableJsonString, index_stratify as stratify, index_switchMap as switchMap, index_take as take, index_takeUntil as takeUntil, index_takeWhile as takeWhile, index_tap as tap, index_throttle as throttle, index_throttleTime as throttleTime, index_throwError as throwError, index_timeout as timeout, index_toArray as toArray, index_toCSV as toCSV, index_toClickHouse as toClickHouse, index_toFile as toFile, index_toHTTP as toHTTP, index_toKafka as toKafka, index_toLoki as toLoki, index_toMongo as toMongo, index_toNATS as toNATS, index_toObservable as toObservable, index_toPostgres as toPostgres, index_toPulsar as toPulsar, index_toRabbitMQ as toRabbitMQ, index_toReadableStream as toReadableStream, index_toRedisStream as toRedisStream, index_toS3 as toS3, index_toSSE as toSSE, index_toSSEBytes as toSSEBytes, index_toSqlite as toSqlite, index_toTempo as toTempo, index_toWebSocket as toWebSocket, index_tokenBucket as tokenBucket, index_valve as valve, index_verifiable as verifiable, index_window as window, index_windowCount as windowCount, index_windowTime as windowTime, index_withBreaker as withBreaker, index_withLatestFrom as withLatestFrom, index_withMaxAttempts as withMaxAttempts, index_withStatus as withStatus, index_workerBridge as workerBridge, index_workerSelf as workerSelf, index_zip as zip };
5017
3150
  }
5018
3151
 
5019
- export { type FromPulsarOptions as $, type AckableMessage as A, type BackoffPreset as B, type CircuitState as C, type DrizzleQueryLike as D, type EmitTriad as E, type FallbackInput as F, type FSEventType as G, type FileWriterLike as H, type FromCSVOptions as I, type FromClickHouseWatchOptions as J, type FromDrizzleOptions as K, type FromFSWatchOptions as L, type FromGitHookOptions as M, NS_PER_MS as N, type FromHTTPOptions as O, type FromHTTPPollOptions as P, type FromHTTPStreamOptions as Q, type RateLimiterOptions as R, type StatusValue as S, type FromKafkaOptions as T, type FromKyselyOptions as U, type FromMCPOptions as V, type FromNATSOptions as W, type FromNDJSONOptions as X, type FromOTelOptions as Y, type FromPrismaOptions as Z, type FromPrometheusOptions as _, type CircuitBreakerOptions as a, type RedisClientLike as a$, type FromRabbitMQOptions as a0, type FromRedisStreamOptions as a1, type FromSSEOptions as a2, type FromSqliteOptions as a3, type FromStatsDOptions as a4, type FromSyslogOptions as a5, type FromWebSocketReconnectOptions as a6, type GitEvent as a7, type GitHookType as a8, type HTTPBundle as a9, type OTelSpan as aA, type PostgresClientLike as aB, type PrismaModelLike as aC, type PrometheusMetric as aD, type PubSubBackend as aE, type PubSubHub as aF, type PubSubHubOptions as aG, type PulsarConsumerLike as aH, type PulsarMessage as aI, type PulsarProducerLike as aJ, type RabbitMQChannelLike as aK, type RabbitMQMessage as aL, RateLimiterOverflowError as aM, type RateLimiterOverflowPolicy as aN, type ReactiveIndexBundle as aO, type ReactiveIndexOptions as aP, type ReactiveListBundle as aQ, type ReactiveListOptions as aR, type ReactiveLogBundle as aS, type ReactiveLogOptions as aT, type ReactiveSinkBackpressureOptions as aU, type ReactiveSinkConfig as aV, type ReactiveSinkHandle as aW, type ReactiveSinkOptions as aX, type ReactiveSinkRetryOptions as aY, type ReadyMessage as aZ, type RedisCheckpointClientLike as a_, type IndexBackend as aa, type IndexRow as ab, type InitMessage as ac, type JitterMode as ad, type KafkaConsumerLike as ae, type KafkaMessage as af, type KafkaProducerLike as ag, type KyselyQueryLike as ah, type ListBackend as ai, type LogBackend as aj, type LokiClientLike as ak, type LokiStream as al, type MCPClientLike as am, type MergeMapOptions as an, type MongoCollectionLike as ao, type NATSClientLike as ap, type NATSMessage as aq, type NATSSubscriptionLike as ar, NativeIndexBackend as as, NativeListBackend as at, NativeLogBackend as au, NativePubSubBackend as av, type OTelBundle as aw, type OTelLog as ax, type OTelMetric as ay, type OTelRegister as az, type RetryOptions as b, concat as b$, type RedisStreamEntry as b0, ResettableTimer as b1, type RetrySourceOptions as b2, type S3ClientLike as b3, type SSEEvent as b4, type SignalMessage as b5, type SinkFailure as b6, type SinkHandle as b7, type SinkTransportError as b8, type SqliteDbLike as b9, type TokenBucket as bA, type UpsertOptions as bB, type ValueMessage as bC, type WatermarkController as bD, type WatermarkOptions as bE, type WebSocketLike as bF, type WebSocketMessageEventLike as bG, type WebSocketRegister as bH, type WebhookRegister as bI, type WithBreakerBundle as bJ, type WithStatusBundle as bK, type WorkerBridge as bL, type WorkerBridgeOptions as bM, type WorkerSelfHandle as bN, type WorkerSelfOptions as bO, type WorkerTransport as bP, audit as bQ, buffer as bR, bufferCount as bS, bufferTime as bT, cascadingCache as bU, catchError as bV, checkpointToRedis as bW, checkpointToS3 as bX, circuitBreaker as bY, combine as bZ, combineLatest as b_, type SqliteIterableDbLike as ba, type StatsDMetric as bb, type StatsDRegister as bc, type SyslogMessage as bd, type SyslogRegister as be, type TapObserver as bf, type TempoClientLike as bg, type ThrottleOptions as bh, TimeoutError as bi, type ToCSVOptions as bj, type ToClickHouseOptions as bk, type ToFileOptions as bl, type ToHTTPOptions as bm, type ToKafkaOptions as bn, type ToLokiOptions as bo, type ToMongoOptions as bp, type ToNATSOptions as bq, type ToPostgresOptions as br, type ToPulsarOptions as bs, type ToRabbitMQOptions as bt, type ToRedisStreamOptions as bu, type ToS3Options as bv, type ToSSEOptions as bw, type ToSqliteOptions as bx, type ToTempoOptions as by, type ToWebSocketOptions as bz, NS_PER_SEC as c, parseStatsD as c$, concatMap as c0, constant as c1, createTransport as c2, createWatermarkController as c3, csvRows as c4, debounce as c5, debounceTime as c6, decorrelatedJitter as c7, delay as c8, deserializeError as c9, fromOTel as cA, fromPrisma as cB, fromPrometheus as cC, fromPulsar as cD, fromRabbitMQ as cE, fromRedisStream as cF, fromSSE as cG, fromSqlite as cH, fromSqliteCursor as cI, fromStatsD as cJ, fromSyslog as cK, fromWebSocket as cL, fromWebSocketReconnect as cM, fromWebhook as cN, interval as cO, last as cP, linear as cQ, lru as cR, map as cS, matchesCron as cT, merge as cU, mergeMap as cV, nameToSignal as cW, ndjsonRows as cX, pairwise as cY, parseCron as cZ, parsePrometheusText as c_, distinctUntilChanged as ca, elementAt as cb, exhaustMap as cc, exponential as cd, externalBundle as ce, externalProducer as cf, index as cg, fallback as ch, fibonacci as ci, filter as cj, find as ck, first as cl, flatMap as cm, fromCSV as cn, fromClickHouseWatch as co, fromDrizzle as cp, fromFSWatch as cq, fromGitHook as cr, fromHTTP as cs, fromHTTPPoll as ct, fromHTTPStream as cu, fromKafka as cv, fromKysely as cw, fromMCP as cx, fromNATS as cy, fromNDJSON as cz, type AdapterHandlers as d, parseSyslog as d0, pausable as d1, pubsub as d2, race as d3, rateLimiter as d4, reactiveIndex as d5, reactiveList as d6, reactiveLog as d7, reactiveSink as d8, reduce as d9, toNATS as dA, toPostgres as dB, toPulsar as dC, toRabbitMQ as dD, toReadableStream as dE, toRedisStream as dF, toS3 as dG, toSSE as dH, toSSEBytes as dI, toSqlite as dJ, toTempo as dK, toWebSocket as dL, tokenBucket as dM, valve as dN, window as dO, windowCount as dP, windowTime as dQ, withBreaker as dR, withLatestFrom as dS, withMaxAttempts as dT, withStatus as dU, workerBridge as dV, workerSelf as dW, zip as dX, repeat as da, rescue as db, resolveBackoffPreset as dc, retry as dd, retrySource as de, sample as df, scan as dg, serializeError as dh, signalToName as di, skip as dj, switchMap as dk, take as dl, takeUntil as dm, takeWhile as dn, tap as dp, throttle as dq, throttleTime as dr, timeout as ds, toCSV as dt, toClickHouse as du, toFile as dv, toHTTP as dw, toKafka as dx, toLoki as dy, toMongo as dz, type BackoffStrategy as e, type BatchMessage as f, type BridgeMessage as g, type BufferedSinkHandle as h, type BundleTriad as i, type CSVRow as j, type CacheEvictionPolicy as k, type CascadingCache as l, type CascadingCacheOptions as m, type CheckpointToRedisOptions as n, type CheckpointToS3Options as o, type CircuitBreaker as p, CircuitOpenError as q, type ClickHouseClientLike as r, type ClickHouseInsertClientLike as s, type ClickHouseRow as t, type CronSchedule as u, type ErrorMessage as v, type ExponentialBackoffOptions as w, type ExternalBundleOptions as x, type ExternalRegister as y, type FSEvent as z };
3152
+ export { type MongoCollectionLike as $, type AckableMessage as A, type BatchMessage as B, type CSVRow as C, type DrizzleQueryLike as D, type EmitTriad as E, type FileWriterLike as F, type FromNDJSONOptions as G, type FromOTelOptions as H, type FromPrismaOptions as I, type FromPrometheusOptions as J, type FromPulsarOptions as K, type FromRabbitMQOptions as L, type FromRedisStreamOptions as M, type FromSSEOptions as N, type FromSqliteOptions as O, type FromStatsDOptions as P, type FromSyslogOptions as Q, type FromWebSocketReconnectOptions as R, type HTTPBundle as S, type InitMessage as T, type KafkaConsumerLike as U, type KafkaMessage as V, type KafkaProducerLike as W, type KyselyQueryLike as X, type LokiClientLike as Y, type LokiStream as Z, type MCPClientLike as _, type AdapterHandlers as a, type ValueMessage as a$, type NATSClientLike as a0, type NATSMessage as a1, type NATSSubscriptionLike as a2, NativePubSubBackend as a3, type OTelBundle as a4, type OTelLog as a5, type OTelMetric as a6, type OTelRegister as a7, type OTelSpan as a8, type PostgresClientLike as a9, type SinkTransportError as aA, type SqliteDbLike as aB, type SqliteIterableDbLike as aC, type StatsDMetric as aD, type StatsDRegister as aE, type StratifyOptions as aF, type StratifyRule as aG, type SyslogMessage as aH, type SyslogRegister as aI, type TempoClientLike as aJ, type ToCSVOptions as aK, type ToClickHouseOptions as aL, type ToFileOptions as aM, type ToHTTPOptions as aN, type ToKafkaOptions as aO, type ToLokiOptions as aP, type ToMongoOptions as aQ, type ToNATSOptions as aR, type ToPostgresOptions as aS, type ToPulsarOptions as aT, type ToRabbitMQOptions as aU, type ToRedisStreamOptions as aV, type ToS3Options as aW, type ToSSEOptions as aX, type ToSqliteOptions as aY, type ToTempoOptions as aZ, type ToWebSocketOptions as a_, type PrismaModelLike as aa, type PrometheusMetric as ab, type PubSubBackend as ac, type PubSubHub as ad, type PubSubHubOptions as ae, type PulsarConsumerLike as af, type PulsarMessage as ag, type PulsarProducerLike as ah, type RabbitMQChannelLike as ai, type RabbitMQMessage as aj, type ReactiveSinkBackpressureOptions as ak, type ReactiveSinkConfig as al, type ReactiveSinkHandle as am, type ReactiveSinkOptions as an, type ReactiveSinkRetryOptions as ao, type ReadyMessage as ap, type RedisCheckpointClientLike as aq, type RedisClientLike as ar, type RedisStreamEntry as as, ResettableTimer as at, type S3ClientLike as au, type SSEEvent as av, type SignalMessage as aw, type SingleFromAnyOptions as ax, type SinkFailure as ay, type SinkHandle as az, type BridgeMessage as b, toFile as b$, type WatermarkController as b0, type WatermarkOptions as b1, type WebSocketLike as b2, type WebSocketMessageEventLike as b3, type WebSocketRegister as b4, type WebhookRegister as b5, type WorkerBridge as b6, type WorkerBridgeOptions as b7, type WorkerSelfHandle as b8, type WorkerSelfOptions as b9, fromRabbitMQ as bA, fromRedisStream as bB, fromSSE as bC, fromSqlite as bD, fromSqliteCursor as bE, fromStatsD as bF, fromSyslog as bG, fromWebSocket as bH, fromWebSocketReconnect as bI, fromWebhook as bJ, lru as bK, matchesCron as bL, nameToSignal as bM, ndjsonRows as bN, parseCron as bO, parsePrometheusText as bP, parseStatsD as bQ, parseSyslog as bR, pubsub as bS, reactiveSink as bT, serializeError as bU, signalToName as bV, singleFromAny as bW, singleNodeFromAny as bX, stratify as bY, toCSV as bZ, toClickHouse as b_, type WorkerTransport as ba, cascadingCache as bb, checkpointToRedis as bc, checkpointToS3 as bd, createTransport as be, createWatermarkController as bf, csvRows as bg, deserializeError as bh, externalBundle as bi, externalProducer as bj, index as bk, fromCSV as bl, fromClickHouseWatch as bm, fromDrizzle as bn, fromHTTP as bo, fromHTTPPoll as bp, fromHTTPStream as bq, fromKafka as br, fromKysely as bs, fromMCP as bt, fromNATS as bu, fromNDJSON as bv, fromOTel as bw, fromPrisma as bx, fromPrometheus as by, fromPulsar as bz, type BufferedSinkHandle as c, toHTTP as c0, toKafka as c1, toLoki as c2, toMongo as c3, toNATS as c4, toPostgres as c5, toPulsar as c6, toRabbitMQ as c7, toReadableStream as c8, toRedisStream as c9, toS3 as ca, toSSE as cb, toSSEBytes as cc, toSqlite as cd, toTempo as ce, toWebSocket as cf, workerBridge as cg, workerSelf as ch, type BundleTriad as d, type CacheEvictionPolicy as e, type CascadingCache as f, type CascadingCacheOptions as g, type CheckpointToRedisOptions as h, type CheckpointToS3Options as i, type ClickHouseClientLike as j, type ClickHouseInsertClientLike as k, type ClickHouseRow as l, type CronSchedule as m, type ErrorMessage as n, type ExternalBundleOptions as o, type ExternalRegister as p, type FromCSVOptions as q, type FromClickHouseWatchOptions as r, type FromDrizzleOptions as s, type FromHTTPOptions as t, type FromHTTPPollOptions as u, type FromHTTPStreamOptions as v, type FromKafkaOptions as w, type FromKyselyOptions as x, type FromMCPOptions as y, type FromNATSOptions as z };