@graphrefly/graphrefly 0.44.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/README.md +21 -17
  2. package/dist/compat/index.cjs +20 -10
  3. package/dist/compat/index.cjs.map +1 -0
  4. package/dist/compat/index.d.cts +1 -22
  5. package/dist/compat/index.d.ts +1 -22
  6. package/dist/compat/index.js +3 -1
  7. package/dist/compat/index.js.map +1 -0
  8. package/dist/compat/jotai/index.cjs +21 -1
  9. package/dist/compat/jotai/index.cjs.map +1 -0
  10. package/dist/compat/jotai/index.d.cts +1 -2
  11. package/dist/compat/jotai/index.d.ts +1 -2
  12. package/dist/compat/jotai/index.js +3 -1
  13. package/dist/compat/jotai/index.js.map +1 -0
  14. package/dist/compat/nanostores/index.cjs +21 -1
  15. package/dist/compat/nanostores/index.cjs.map +1 -0
  16. package/dist/compat/nanostores/index.d.cts +1 -2
  17. package/dist/compat/nanostores/index.d.ts +1 -2
  18. package/dist/compat/nanostores/index.js +3 -1
  19. package/dist/compat/nanostores/index.js.map +1 -0
  20. package/dist/compat/nestjs/index.cjs +20 -10
  21. package/dist/compat/nestjs/index.cjs.map +1 -0
  22. package/dist/compat/nestjs/index.d.cts +1 -13
  23. package/dist/compat/nestjs/index.d.ts +1 -13
  24. package/dist/compat/nestjs/index.js +3 -1
  25. package/dist/compat/nestjs/index.js.map +1 -0
  26. package/dist/compat/react/index.cjs +21 -1
  27. package/dist/compat/react/index.cjs.map +1 -0
  28. package/dist/compat/react/index.d.cts +1 -2
  29. package/dist/compat/react/index.d.ts +1 -2
  30. package/dist/compat/react/index.js +3 -1
  31. package/dist/compat/react/index.js.map +1 -0
  32. package/dist/compat/solid/index.cjs +21 -1
  33. package/dist/compat/solid/index.cjs.map +1 -0
  34. package/dist/compat/solid/index.d.cts +1 -2
  35. package/dist/compat/solid/index.d.ts +1 -2
  36. package/dist/compat/solid/index.js +3 -1
  37. package/dist/compat/solid/index.js.map +1 -0
  38. package/dist/compat/svelte/index.cjs +21 -1
  39. package/dist/compat/svelte/index.cjs.map +1 -0
  40. package/dist/compat/svelte/index.d.cts +1 -2
  41. package/dist/compat/svelte/index.d.ts +1 -2
  42. package/dist/compat/svelte/index.js +3 -1
  43. package/dist/compat/svelte/index.js.map +1 -0
  44. package/dist/compat/vue/index.cjs +21 -1
  45. package/dist/compat/vue/index.cjs.map +1 -0
  46. package/dist/compat/vue/index.d.cts +1 -3
  47. package/dist/compat/vue/index.d.ts +1 -3
  48. package/dist/compat/vue/index.js +3 -1
  49. package/dist/compat/vue/index.js.map +1 -0
  50. package/dist/compat/zustand/index.cjs +21 -3
  51. package/dist/compat/zustand/index.cjs.map +1 -0
  52. package/dist/compat/zustand/index.d.cts +1 -6
  53. package/dist/compat/zustand/index.d.ts +1 -6
  54. package/dist/compat/zustand/index.js +3 -1
  55. package/dist/compat/zustand/index.js.map +1 -0
  56. package/dist/core/index.cjs +21 -1
  57. package/dist/core/index.cjs.map +1 -0
  58. package/dist/core/index.d.cts +1 -3
  59. package/dist/core/index.d.ts +1 -3
  60. package/dist/core/index.js +3 -1
  61. package/dist/core/index.js.map +1 -0
  62. package/dist/extra/browser.cjs +21 -1
  63. package/dist/extra/browser.cjs.map +1 -0
  64. package/dist/extra/browser.d.cts +1 -4
  65. package/dist/extra/browser.d.ts +1 -4
  66. package/dist/extra/browser.js +3 -1
  67. package/dist/extra/browser.js.map +1 -0
  68. package/dist/extra/index.cjs +20 -19
  69. package/dist/extra/index.cjs.map +1 -0
  70. package/dist/extra/index.d.cts +1 -17
  71. package/dist/extra/index.d.ts +1 -17
  72. package/dist/extra/index.js +3 -1
  73. package/dist/extra/index.js.map +1 -0
  74. package/dist/extra/node.cjs +21 -2
  75. package/dist/extra/node.cjs.map +1 -0
  76. package/dist/extra/node.d.cts +1 -187
  77. package/dist/extra/node.d.ts +1 -187
  78. package/dist/extra/node.js +3 -2
  79. package/dist/extra/node.js.map +1 -0
  80. package/dist/extra/operators.cjs +21 -1
  81. package/dist/extra/operators.cjs.map +1 -0
  82. package/dist/extra/operators.d.cts +1 -958
  83. package/dist/extra/operators.d.ts +1 -958
  84. package/dist/extra/operators.js +3 -1
  85. package/dist/extra/operators.js.map +1 -0
  86. package/dist/extra/reactive.cjs +21 -1
  87. package/dist/extra/reactive.cjs.map +1 -0
  88. package/dist/extra/reactive.d.cts +1 -353
  89. package/dist/extra/reactive.d.ts +1 -353
  90. package/dist/extra/reactive.js +3 -1
  91. package/dist/extra/reactive.js.map +1 -0
  92. package/dist/extra/render/index.cjs +21 -5
  93. package/dist/extra/render/index.cjs.map +1 -0
  94. package/dist/extra/render/index.d.cts +1 -183
  95. package/dist/extra/render/index.d.ts +1 -183
  96. package/dist/extra/render/index.js +3 -1
  97. package/dist/extra/render/index.js.map +1 -0
  98. package/dist/extra/sources.cjs +21 -3
  99. package/dist/extra/sources.cjs.map +1 -0
  100. package/dist/extra/sources.d.cts +1 -584
  101. package/dist/extra/sources.d.ts +1 -584
  102. package/dist/extra/sources.js +3 -1
  103. package/dist/extra/sources.js.map +1 -0
  104. package/dist/extra/storage-browser.cjs +21 -1
  105. package/dist/extra/storage-browser.cjs.map +1 -0
  106. package/dist/extra/storage-browser.d.cts +1 -37
  107. package/dist/extra/storage-browser.d.ts +1 -37
  108. package/dist/extra/storage-browser.js +3 -1
  109. package/dist/extra/storage-browser.js.map +1 -0
  110. package/dist/extra/storage-core.cjs +21 -1
  111. package/dist/extra/storage-core.cjs.map +1 -0
  112. package/dist/extra/storage-core.d.cts +1 -28
  113. package/dist/extra/storage-core.d.ts +1 -28
  114. package/dist/extra/storage-core.js +3 -1
  115. package/dist/extra/storage-core.js.map +1 -0
  116. package/dist/extra/storage-node.cjs +20 -0
  117. package/dist/extra/storage-node.cjs.map +1 -0
  118. package/dist/extra/storage-node.d.cts +1 -2
  119. package/dist/extra/storage-node.d.ts +1 -2
  120. package/dist/extra/storage-node.js +3 -0
  121. package/dist/extra/storage-node.js.map +1 -0
  122. package/dist/extra/storage-tiers-browser.cjs +21 -1
  123. package/dist/extra/storage-tiers-browser.cjs.map +1 -0
  124. package/dist/extra/storage-tiers-browser.d.cts +1 -120
  125. package/dist/extra/storage-tiers-browser.d.ts +1 -120
  126. package/dist/extra/storage-tiers-browser.js +3 -1
  127. package/dist/extra/storage-tiers-browser.js.map +1 -0
  128. package/dist/extra/storage-tiers-node.cjs +21 -1
  129. package/dist/extra/storage-tiers-node.cjs.map +1 -0
  130. package/dist/extra/storage-tiers-node.d.cts +1 -210
  131. package/dist/extra/storage-tiers-node.d.ts +1 -210
  132. package/dist/extra/storage-tiers-node.js +3 -1
  133. package/dist/extra/storage-tiers-node.js.map +1 -0
  134. package/dist/extra/storage-tiers.cjs +21 -1
  135. package/dist/extra/storage-tiers.cjs.map +1 -0
  136. package/dist/extra/storage-tiers.d.cts +1 -412
  137. package/dist/extra/storage-tiers.d.ts +1 -412
  138. package/dist/extra/storage-tiers.js +3 -1
  139. package/dist/extra/storage-tiers.js.map +1 -0
  140. package/dist/extra/storage-wal.cjs +21 -0
  141. package/dist/extra/storage-wal.cjs.map +1 -0
  142. package/dist/extra/storage-wal.d.cts +1 -0
  143. package/dist/extra/storage-wal.d.ts +1 -0
  144. package/dist/extra/storage-wal.js +3 -0
  145. package/dist/extra/storage-wal.js.map +1 -0
  146. package/dist/graph/index.cjs +21 -7
  147. package/dist/graph/index.cjs.map +1 -0
  148. package/dist/graph/index.d.cts +1 -7
  149. package/dist/graph/index.d.ts +1 -7
  150. package/dist/graph/index.js +3 -1
  151. package/dist/graph/index.js.map +1 -0
  152. package/dist/index.cjs +20 -227
  153. package/dist/index.cjs.map +1 -0
  154. package/dist/index.d.cts +45 -95
  155. package/dist/index.d.ts +45 -95
  156. package/dist/index.js +3 -1
  157. package/dist/index.js.map +1 -0
  158. package/dist/patterns/ai/browser.cjs +20 -7
  159. package/dist/patterns/ai/browser.cjs.map +1 -0
  160. package/dist/patterns/ai/browser.d.cts +1 -127
  161. package/dist/patterns/ai/browser.d.ts +1 -127
  162. package/dist/patterns/ai/browser.js +3 -3
  163. package/dist/patterns/ai/browser.js.map +1 -0
  164. package/dist/patterns/ai/index.cjs +20 -73
  165. package/dist/patterns/ai/index.cjs.map +1 -0
  166. package/dist/patterns/ai/index.d.cts +1 -20
  167. package/dist/patterns/ai/index.d.ts +1 -20
  168. package/dist/patterns/ai/index.js +3 -1
  169. package/dist/patterns/ai/index.js.map +1 -0
  170. package/dist/patterns/ai/node.cjs +21 -1
  171. package/dist/patterns/ai/node.cjs.map +1 -0
  172. package/dist/patterns/ai/node.d.cts +1 -59
  173. package/dist/patterns/ai/node.d.ts +1 -59
  174. package/dist/patterns/ai/node.js +3 -1
  175. package/dist/patterns/ai/node.js.map +1 -0
  176. package/dist/patterns/cqrs/index.cjs +21 -3
  177. package/dist/patterns/cqrs/index.cjs.map +1 -0
  178. package/dist/patterns/cqrs/index.d.cts +1 -8
  179. package/dist/patterns/cqrs/index.d.ts +1 -8
  180. package/dist/patterns/cqrs/index.js +3 -1
  181. package/dist/patterns/cqrs/index.js.map +1 -0
  182. package/dist/patterns/demo-shell/index.cjs +21 -5
  183. package/dist/patterns/demo-shell/index.cjs.map +1 -0
  184. package/dist/patterns/demo-shell/index.d.cts +1 -7
  185. package/dist/patterns/demo-shell/index.d.ts +1 -7
  186. package/dist/patterns/demo-shell/index.js +3 -1
  187. package/dist/patterns/demo-shell/index.js.map +1 -0
  188. package/dist/patterns/domain-templates/index.cjs +21 -3
  189. package/dist/patterns/domain-templates/index.cjs.map +1 -0
  190. package/dist/patterns/domain-templates/index.d.cts +1 -6
  191. package/dist/patterns/domain-templates/index.d.ts +1 -6
  192. package/dist/patterns/domain-templates/index.js +3 -1
  193. package/dist/patterns/domain-templates/index.js.map +1 -0
  194. package/dist/patterns/graphspec/index.cjs +21 -86
  195. package/dist/patterns/graphspec/index.cjs.map +1 -0
  196. package/dist/patterns/graphspec/index.d.cts +1 -8
  197. package/dist/patterns/graphspec/index.d.ts +1 -8
  198. package/dist/patterns/graphspec/index.js +3 -1
  199. package/dist/patterns/graphspec/index.js.map +1 -0
  200. package/dist/patterns/harness/index.cjs +21 -48
  201. package/dist/patterns/harness/index.cjs.map +1 -0
  202. package/dist/patterns/harness/index.d.cts +1 -13
  203. package/dist/patterns/harness/index.d.ts +1 -13
  204. package/dist/patterns/harness/index.js +3 -1
  205. package/dist/patterns/harness/index.js.map +1 -0
  206. package/dist/patterns/inspect/index.cjs +21 -3
  207. package/dist/patterns/inspect/index.cjs.map +1 -0
  208. package/dist/patterns/inspect/index.d.cts +1 -9
  209. package/dist/patterns/inspect/index.d.ts +1 -9
  210. package/dist/patterns/inspect/index.js +3 -1
  211. package/dist/patterns/inspect/index.js.map +1 -0
  212. package/dist/patterns/job-queue/index.cjs +21 -3
  213. package/dist/patterns/job-queue/index.cjs.map +1 -0
  214. package/dist/patterns/job-queue/index.d.cts +1 -9
  215. package/dist/patterns/job-queue/index.d.ts +1 -9
  216. package/dist/patterns/job-queue/index.js +3 -1
  217. package/dist/patterns/job-queue/index.js.map +1 -0
  218. package/dist/patterns/memory/index.cjs +21 -3
  219. package/dist/patterns/memory/index.cjs.map +1 -0
  220. package/dist/patterns/memory/index.d.cts +1 -8
  221. package/dist/patterns/memory/index.d.ts +1 -8
  222. package/dist/patterns/memory/index.js +3 -1
  223. package/dist/patterns/memory/index.js.map +1 -0
  224. package/dist/patterns/messaging/index.cjs +21 -3
  225. package/dist/patterns/messaging/index.cjs.map +1 -0
  226. package/dist/patterns/messaging/index.d.cts +1 -7
  227. package/dist/patterns/messaging/index.d.ts +1 -7
  228. package/dist/patterns/messaging/index.js +3 -1
  229. package/dist/patterns/messaging/index.js.map +1 -0
  230. package/dist/patterns/orchestration/index.cjs +21 -3
  231. package/dist/patterns/orchestration/index.cjs.map +1 -0
  232. package/dist/patterns/orchestration/index.d.cts +1 -8
  233. package/dist/patterns/orchestration/index.d.ts +1 -8
  234. package/dist/patterns/orchestration/index.js +3 -1
  235. package/dist/patterns/orchestration/index.js.map +1 -0
  236. package/dist/patterns/process/index.cjs +21 -3
  237. package/dist/patterns/process/index.cjs.map +1 -0
  238. package/dist/patterns/process/index.d.cts +1 -10
  239. package/dist/patterns/process/index.d.ts +1 -10
  240. package/dist/patterns/process/index.js +3 -1
  241. package/dist/patterns/process/index.js.map +1 -0
  242. package/dist/patterns/reactive-layout/index.cjs +21 -4
  243. package/dist/patterns/reactive-layout/index.cjs.map +1 -0
  244. package/dist/patterns/reactive-layout/index.d.cts +1 -7
  245. package/dist/patterns/reactive-layout/index.d.ts +1 -7
  246. package/dist/patterns/reactive-layout/index.js +3 -1
  247. package/dist/patterns/reactive-layout/index.js.map +1 -0
  248. package/dist/patterns/reduction/index.cjs +21 -3
  249. package/dist/patterns/reduction/index.cjs.map +1 -0
  250. package/dist/patterns/reduction/index.d.cts +1 -6
  251. package/dist/patterns/reduction/index.d.ts +1 -6
  252. package/dist/patterns/reduction/index.js +3 -1
  253. package/dist/patterns/reduction/index.js.map +1 -0
  254. package/dist/patterns/surface/index.cjs +21 -13
  255. package/dist/patterns/surface/index.cjs.map +1 -0
  256. package/dist/patterns/surface/index.d.cts +1 -9
  257. package/dist/patterns/surface/index.d.ts +1 -9
  258. package/dist/patterns/surface/index.js +3 -1
  259. package/dist/patterns/surface/index.js.map +1 -0
  260. package/dist/patterns/topology-view/index.cjs +21 -0
  261. package/dist/patterns/topology-view/index.cjs.map +1 -0
  262. package/dist/patterns/topology-view/index.d.cts +1 -0
  263. package/dist/patterns/topology-view/index.d.ts +1 -0
  264. package/dist/patterns/topology-view/index.js +3 -0
  265. package/dist/patterns/topology-view/index.js.map +1 -0
  266. package/dist/testing/index.cjs +21 -0
  267. package/dist/testing/index.cjs.map +1 -0
  268. package/dist/testing/index.d.cts +1 -0
  269. package/dist/testing/index.d.ts +1 -0
  270. package/dist/testing/index.js +3 -0
  271. package/dist/testing/index.js.map +1 -0
  272. package/package.json +608 -584
  273. package/dist/backoff-HPZMEZNF.js +0 -1
  274. package/dist/cascading-BglDkMdX.d.cts +0 -199
  275. package/dist/cascading-MFgxu7Yo.d.ts +0 -199
  276. package/dist/chunk-2T7U5EU6.js +0 -1
  277. package/dist/chunk-3G5U5QNE.js +0 -5
  278. package/dist/chunk-4VVTGLXJ.js +0 -1
  279. package/dist/chunk-5M4CCMMD.js +0 -45
  280. package/dist/chunk-5QDBSZBV.js +0 -1
  281. package/dist/chunk-5XJ6B66J.js +0 -1
  282. package/dist/chunk-6QZNQS5B.js +0 -1
  283. package/dist/chunk-6X7AFUJV.js +0 -9
  284. package/dist/chunk-7K6PWTDQ.js +0 -1
  285. package/dist/chunk-7LIAPXJB.js +0 -1
  286. package/dist/chunk-7WPU3UHQ.js +0 -1
  287. package/dist/chunk-A5WCQ5NO.js +0 -1
  288. package/dist/chunk-APPIWSGD.js +0 -84
  289. package/dist/chunk-BEZWM2SY.js +0 -1
  290. package/dist/chunk-C72GO4IZ.js +0 -1
  291. package/dist/chunk-CB676TKJ.js +0 -1
  292. package/dist/chunk-CE6TI2TL.js +0 -1
  293. package/dist/chunk-CE72X3WO.js +0 -1
  294. package/dist/chunk-CK2E7BTU.js +0 -1
  295. package/dist/chunk-CLVB32RD.js +0 -1
  296. package/dist/chunk-CRVT7D2P.js +0 -1
  297. package/dist/chunk-D5RFJOZ2.js +0 -1
  298. package/dist/chunk-D7GPHKFH.js +0 -1
  299. package/dist/chunk-DHRX7JX4.js +0 -2
  300. package/dist/chunk-ESMPEKEV.js +0 -1
  301. package/dist/chunk-F672GV32.js +0 -1
  302. package/dist/chunk-FZMYDOWV.js +0 -1
  303. package/dist/chunk-GHBWHMRZ.js +0 -1
  304. package/dist/chunk-GLERH466.js +0 -1
  305. package/dist/chunk-GPW2V3RE.js +0 -1
  306. package/dist/chunk-HIDYF36O.js +0 -1
  307. package/dist/chunk-HITNVN6B.js +0 -3
  308. package/dist/chunk-HY4DJBA7.js +0 -5
  309. package/dist/chunk-KZIEYVXN.js +0 -1
  310. package/dist/chunk-L6NSJVJZ.js +0 -1
  311. package/dist/chunk-N4MQX6JU.js +0 -18
  312. package/dist/chunk-N7FHEL4D.js +0 -1
  313. package/dist/chunk-NTEURFZH.js +0 -1
  314. package/dist/chunk-OIVP6KFV.js +0 -1
  315. package/dist/chunk-OPHBU3LG.js +0 -1
  316. package/dist/chunk-OYQOZP2F.js +0 -5
  317. package/dist/chunk-PTZK576G.js +0 -1
  318. package/dist/chunk-QYADASLV.js +0 -1
  319. package/dist/chunk-ST7UXLWR.js +0 -1
  320. package/dist/chunk-SVY7VUYU.js +0 -1
  321. package/dist/chunk-TK3NWWD4.js +0 -1
  322. package/dist/chunk-TSOYJ743.js +0 -1
  323. package/dist/chunk-UNGSTR4X.js +0 -61
  324. package/dist/chunk-VIMF6LGM.js +0 -1
  325. package/dist/chunk-VJLMUKOI.js +0 -1
  326. package/dist/chunk-VN6RDSK2.js +0 -1
  327. package/dist/chunk-VV4N5P64.js +0 -1
  328. package/dist/chunk-W3I423PS.js +0 -1
  329. package/dist/chunk-WJR24TAG.js +0 -1
  330. package/dist/chunk-XTGKMHSW.js +0 -1
  331. package/dist/chunk-YBB7ZGTY.js +0 -1
  332. package/dist/chunk-Z4NPUARF.js +0 -1
  333. package/dist/chunk-ZGNQRPDT.js +0 -1
  334. package/dist/chunk-ZKPSFFKU.js +0 -1
  335. package/dist/chunk-ZLV5SQSX.js +0 -1
  336. package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
  337. package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
  338. package/dist/decay-BvOWTZ00.d.ts +0 -112
  339. package/dist/decay-CFlLvXUT.d.cts +0 -112
  340. package/dist/fallback-74oxi34l.d.cts +0 -250
  341. package/dist/fallback-DUyyBTBK.d.ts +0 -250
  342. package/dist/graph-CWvEUQAq.d.cts +0 -1861
  343. package/dist/graph-D9LFnda9.d.ts +0 -1861
  344. package/dist/index-5k1T6jl0.d.cts +0 -121
  345. package/dist/index-9770hRuQ.d.cts +0 -779
  346. package/dist/index-B-_tFaqV.d.cts +0 -468
  347. package/dist/index-B17QddL1.d.cts +0 -374
  348. package/dist/index-B1F8Enjf.d.ts +0 -704
  349. package/dist/index-B5S8ULbU.d.ts +0 -515
  350. package/dist/index-B8YnZpIR.d.ts +0 -102
  351. package/dist/index-BHskSB8v.d.ts +0 -3413
  352. package/dist/index-BIYAkbAi.d.cts +0 -26
  353. package/dist/index-BQSKmbuG.d.cts +0 -127
  354. package/dist/index-BaQaY_IQ.d.cts +0 -231
  355. package/dist/index-BmZXHqkE.d.ts +0 -36
  356. package/dist/index-BoJ5JHxI.d.ts +0 -557
  357. package/dist/index-BocU7pqs.d.ts +0 -779
  358. package/dist/index-BrPrLl4e.d.cts +0 -86
  359. package/dist/index-BxNs2HB9.d.cts +0 -1858
  360. package/dist/index-Byu-OpX_.d.ts +0 -113
  361. package/dist/index-C1T3d7V-.d.cts +0 -704
  362. package/dist/index-C5ri2Axc.d.cts +0 -301
  363. package/dist/index-C5stwKcw.d.cts +0 -44
  364. package/dist/index-C9l6OEBL.d.ts +0 -26
  365. package/dist/index-CBBLl_rc.d.ts +0 -127
  366. package/dist/index-CBGUK09R.d.ts +0 -754
  367. package/dist/index-CC-AvFTy.d.cts +0 -557
  368. package/dist/index-CJF1URuX.d.ts +0 -121
  369. package/dist/index-CK29LV56.d.cts +0 -34
  370. package/dist/index-CMh5Rz1y.d.ts +0 -385
  371. package/dist/index-CPQlGA29.d.ts +0 -34
  372. package/dist/index-CR8QpwX8.d.ts +0 -2680
  373. package/dist/index-CS0LTlB8.d.cts +0 -385
  374. package/dist/index-CSOmP7xT.d.cts +0 -291
  375. package/dist/index-CYq8vAyV.d.ts +0 -291
  376. package/dist/index-CZ3r5Rxp.d.ts +0 -374
  377. package/dist/index-CasX6Pfq.d.cts +0 -358
  378. package/dist/index-CdAlHFEt.d.ts +0 -44
  379. package/dist/index-CdTelp1M.d.ts +0 -202
  380. package/dist/index-CeFiHtAg.d.ts +0 -468
  381. package/dist/index-Cj3WohTd.d.cts +0 -202
  382. package/dist/index-Climxqsu.d.cts +0 -754
  383. package/dist/index-Co7uli2l.d.cts +0 -3413
  384. package/dist/index-CviRnE4K.d.ts +0 -45
  385. package/dist/index-Cwv0KWcU.d.cts +0 -102
  386. package/dist/index-CzLVrjxn.d.ts +0 -231
  387. package/dist/index-D0aciIex.d.cts +0 -209
  388. package/dist/index-DHen9Klo.d.ts +0 -1858
  389. package/dist/index-DV_1YuVk.d.cts +0 -221
  390. package/dist/index-Dc4AYqrJ.d.cts +0 -515
  391. package/dist/index-Dgl1HpPn.d.ts +0 -86
  392. package/dist/index-DisjX8a-.d.ts +0 -221
  393. package/dist/index-UPSiS-X7.d.cts +0 -2680
  394. package/dist/index-Yq60JP3s.d.ts +0 -209
  395. package/dist/index-ZVQhLa2i.d.cts +0 -37
  396. package/dist/index-_6ODbuOu.d.cts +0 -45
  397. package/dist/index-hcDJ8PSI.d.cts +0 -36
  398. package/dist/index-nozs3fFC.d.ts +0 -301
  399. package/dist/index-p09KSrTN.d.ts +0 -358
  400. package/dist/index-sqkqlb1p.d.ts +0 -37
  401. package/dist/index-tRCxuAXF.d.cts +0 -113
  402. package/dist/node-kK3CvTrR.d.cts +0 -1347
  403. package/dist/node-kK3CvTrR.d.ts +0 -1347
  404. package/dist/observable-DWjNfLvC.d.ts +0 -36
  405. package/dist/observable-e3eiPPFy.d.cts +0 -36
  406. package/dist/pipeline-graph-CIKhynsF.d.cts +0 -142
  407. package/dist/pipeline-graph-Sgj0gCwn.d.ts +0 -142
  408. package/dist/reactive-layout-DOTs9P3X.d.ts +0 -183
  409. package/dist/reactive-layout-DgctbqZo.d.cts +0 -183
  410. package/dist/reactive-log-BKALbfal.d.ts +0 -223
  411. package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
  412. package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
  413. package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
  414. package/dist/resilience-6LYQJAC5.js +0 -1
  415. package/dist/sugar-DQjFmVqb.d.cts +0 -399
  416. package/dist/sugar-fhLIE7TT.d.ts +0 -399
  417. package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
  418. package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
  419. package/dist/types-C0_yquda.d.cts +0 -442
  420. package/dist/types-CWFysE9E.d.ts +0 -442
@@ -1,584 +1 @@
1
- import { a as NodeOptions, N as Node } from '../node-kK3CvTrR.js';
2
-
3
- /**
4
- * Core reactive sources, sinks, and utilities (roadmap §2.3).
5
- *
6
- * Each API returns a {@link Node} built with {@link node}, {@link producer},
7
- * {@link derived}, or {@link effect} — no second protocol.
8
- *
9
- * Protocol/system/ingest adapters (fromHTTP, fromWebSocket, fromKafka, etc.)
10
- * live in {@link ./adapters.ts}.
11
- */
12
-
13
- type ExtraOpts = Omit<NodeOptions<unknown>, "describeKind">;
14
- /** Options for {@link fromTimer} / {@link fromPromise} / {@link fromAsyncIter}. */
15
- type AsyncSourceOpts = ExtraOpts & {
16
- signal?: AbortSignal;
17
- };
18
- /**
19
- * Values accepted by {@link fromAny}.
20
- *
21
- * @category extra
22
- */
23
- type NodeInput<T> = Node<T> | PromiseLike<T> | AsyncIterable<T> | Iterable<T> | T;
24
- /** Options for {@link fromCron}. */
25
- type FromCronOptions = ExtraOpts & {
26
- /** Polling interval in ms. Default `60_000`. */
27
- tickMs?: number;
28
- /** Output format: `"timestamp_ns"` (default) emits wall-clock nanoseconds; `"date"` emits a `Date` object. */
29
- output?: "timestamp_ns" | "date";
30
- };
31
- /** DOM-style event target (browser or `node:events`). */
32
- type EventTargetLike = {
33
- addEventListener(type: string, listener: (ev: unknown) => void, options?: boolean | {
34
- capture?: boolean;
35
- passive?: boolean;
36
- once?: boolean;
37
- }): void;
38
- removeEventListener(type: string, listener: (ev: unknown) => void, options?: boolean | {
39
- capture?: boolean;
40
- passive?: boolean;
41
- once?: boolean;
42
- }): void;
43
- };
44
- /** @internal Shared with adapters.ts and sources-fs.ts for glob matching. */
45
- declare function escapeRegexChar(ch: string): string;
46
- /** @internal */
47
- declare function globToRegExp(glob: string): RegExp;
48
- /** @internal */
49
- declare function matchesAnyPattern(path: string, patterns: RegExp[]): boolean;
50
- /**
51
- * Builds a timer-driven source: one-shot (first tick then `COMPLETE`) or periodic (`0`, `1`, `2`, …).
52
- *
53
- * @param ms - Milliseconds before the first emission.
54
- * @param opts - Producer options plus optional `period` for repeating ticks and optional `signal` (`AbortSignal`) to cancel with `ERROR`.
55
- * @returns `Node<number>` — tick counter from `0`; teardown clears timers.
56
- *
57
- * @example
58
- * ```ts
59
- * import { fromTimer } from "@graphrefly/graphrefly-ts";
60
- *
61
- * fromTimer(250, { period: 1_000 });
62
- * ```
63
- *
64
- * @category extra
65
- */
66
- declare function fromTimer(ms: number, opts?: AsyncSourceOpts & {
67
- period?: number;
68
- }): Node<number>;
69
- /**
70
- * Animation-frame-driven source. Emits on every `requestAnimationFrame` tick,
71
- * yielding the frame timestamp (DOMHighResTimeStamp, ms since navigation).
72
- *
73
- * Use instead of `fromTimer({ period: 16 })` when animation smoothness matters.
74
- * In a real browser, `requestAnimationFrame` synchronizes with the display
75
- * refresh. The source keeps ticking even when the tab is hidden — it
76
- * transparently switches to `setTimeout` while the tab is backgrounded (so
77
- * downstream state updates continue) and returns to `requestAnimationFrame`
78
- * when the tab regains focus.
79
- *
80
- * When `requestAnimationFrame` is unavailable (Node test environments, SSR),
81
- * this falls back to `setTimeout(~16ms)` unconditionally. Abortable via
82
- * `signal` (emits `ERROR`).
83
- *
84
- * @example
85
- * ```ts
86
- * import { fromRaf, derived } from "@graphrefly/graphrefly-ts";
87
- *
88
- * const frame = fromRaf();
89
- * const bouncingX = derived([frame], ([t]) => 50 + 40 * Math.sin((t as number) * 0.001));
90
- * ```
91
- *
92
- * @category extra
93
- */
94
- declare function fromRaf(opts?: AsyncSourceOpts): Node<number>;
95
- /**
96
- * Polls on an interval; when the current minute matches a 5-field cron expression, emits once (see {@link parseCron}).
97
- *
98
- * @param expr - Cron string (`min hour dom month dow`).
99
- * @param opts - Producer options plus `tickMs` (default `60_000`) and `output` (`timestamp_ns` default, or `date` for `Date` values).
100
- * @returns `Node<number>` (nanosecond timestamp) or `Node<Date>` when `output: "date"`.
101
- *
102
- * @example
103
- * ```ts
104
- * import { fromCron } from "@graphrefly/graphrefly-ts";
105
- *
106
- * fromCron("0 9 * * 1");
107
- * ```
108
- *
109
- * @category extra
110
- */
111
- declare function fromCron(expr: string, opts?: FromCronOptions & {
112
- output: "date";
113
- }): Node<Date>;
114
- declare function fromCron(expr: string, opts?: FromCronOptions): Node<number>;
115
- /**
116
- * Wraps a DOM-style `addEventListener` target; each event becomes a `DATA` emission.
117
- *
118
- * @param target - Object with `addEventListener` / `removeEventListener`.
119
- * @param type - Event name (e.g. `"click"`).
120
- * @param opts - Producer options plus listener options (`capture`, `passive`, `once`).
121
- * @returns `Node<T>` — event payloads; teardown removes the listener.
122
- *
123
- * @example
124
- * ```ts
125
- * import { fromEvent } from "@graphrefly/graphrefly-ts";
126
- *
127
- * fromEvent(document.body, "click");
128
- * ```
129
- *
130
- * @category extra
131
- */
132
- declare function fromEvent<T = unknown>(target: EventTargetLike, type: string, opts?: ExtraOpts & {
133
- capture?: boolean;
134
- passive?: boolean;
135
- once?: boolean;
136
- }): Node<T>;
137
- /**
138
- * Drains a synchronous iterable; each item is `DATA`, then `COMPLETE`, or `ERROR` if iteration throws.
139
- *
140
- * @param iterable - Values to emit in order.
141
- * @param opts - Optional producer options.
142
- * @returns `Node<T>` — one emission per element.
143
- *
144
- * @example
145
- * ```ts
146
- * import { fromIter } from "@graphrefly/graphrefly-ts";
147
- *
148
- * fromIter([1, 2, 3]);
149
- * ```
150
- *
151
- * @category extra
152
- */
153
- declare function fromIter<T>(iterable: Iterable<T>, opts?: ExtraOpts): Node<T>;
154
- /**
155
- * Lifts a Promise (or thenable) to a single-value stream: one `DATA` then `COMPLETE`, or `ERROR` on rejection.
156
- *
157
- * @param p - Promise to await.
158
- * @param opts - Producer options plus optional `signal` for abort → `ERROR` with reason.
159
- * @returns `Node<T>` — settles once.
160
- *
161
- * @example
162
- * ```ts
163
- * import { fromPromise } from "@graphrefly/graphrefly-ts";
164
- *
165
- * fromPromise(Promise.resolve(42));
166
- * ```
167
- *
168
- * @category extra
169
- */
170
- declare function fromPromise<T>(p: Promise<T> | PromiseLike<T>, opts?: AsyncSourceOpts): Node<T>;
171
- /**
172
- * Reads an async iterable; each `next()` value becomes `DATA`; `COMPLETE` when done; `ERROR` on failure.
173
- *
174
- * @param iterable - Async source (`for await` shape).
175
- * @param opts - Producer options plus optional `signal` to abort the pump.
176
- * @returns `Node<T>` — async pull stream.
177
- *
178
- * @example
179
- * ```ts
180
- * import { fromAsyncIter } from "@graphrefly/graphrefly-ts";
181
- *
182
- * async function* gen() {
183
- * yield 1;
184
- * }
185
- * fromAsyncIter(gen());
186
- * ```
187
- *
188
- * @category extra
189
- */
190
- declare function fromAsyncIter<T>(iterable: AsyncIterable<T>, opts?: AsyncSourceOpts): Node<T>;
191
- /**
192
- * Coerces a value to a `Node` by shape: existing `Node` passthrough, thenable → {@link fromPromise},
193
- * async iterable → {@link fromAsyncIter}, sync iterable → {@link fromIter}, else scalar → {@link of}.
194
- *
195
- * @param input - Any value to wrap.
196
- * @param opts - Passed through when a Promise/async path is chosen.
197
- * @returns `Node` of the inferred element type.
198
- *
199
- * @example
200
- * ```ts
201
- * import { fromAny, state } from "@graphrefly/graphrefly-ts";
202
- *
203
- * fromAny(state(1));
204
- * fromAny(Promise.resolve(2));
205
- * ```
206
- *
207
- * @category extra
208
- */
209
- declare function fromAny<T>(input: NodeInput<T>, opts?: AsyncSourceOpts): Node<T>;
210
- /**
211
- * Emits each argument as `DATA` in order, then `COMPLETE` (implemented via {@link fromIter}).
212
- *
213
- * @param values - Values to emit.
214
- * @returns `Node<T>` — finite sequence.
215
- *
216
- * @example
217
- * ```ts
218
- * import { of } from "@graphrefly/graphrefly-ts";
219
- *
220
- * of(1, 2, 3);
221
- * ```
222
- *
223
- * @category extra
224
- */
225
- declare function of<T>(...values: T[]): Node<T>;
226
- /**
227
- * Completes immediately with no `DATA` (cold `EMPTY` analogue).
228
- *
229
- * @param opts - Optional producer options.
230
- * @returns `Node<T>` — terminal `COMPLETE` only.
231
- *
232
- * @example
233
- * ```ts
234
- * import { empty } from "@graphrefly/graphrefly-ts";
235
- *
236
- * empty();
237
- * ```
238
- *
239
- * @category extra
240
- */
241
- declare function empty<T = never>(opts?: ExtraOpts): Node<T>;
242
- /**
243
- * Never emits and never completes until teardown (cold `NEVER` analogue).
244
- *
245
- * @param opts - Optional producer options.
246
- * @returns `Node<T>` — silent until unsubscribed.
247
- *
248
- * @example
249
- * ```ts
250
- * import { never } from "@graphrefly/graphrefly-ts";
251
- *
252
- * never();
253
- * ```
254
- *
255
- * @category extra
256
- */
257
- declare function never<T = never>(opts?: ExtraOpts): Node<T>;
258
- /**
259
- * Emits `ERROR` as soon as the producer starts (cold error source).
260
- *
261
- * @param err - Error payload forwarded as `ERROR` data.
262
- * @param opts - Optional producer options.
263
- * @returns `Node<never>` — terminates with `ERROR`.
264
- *
265
- * @example
266
- * ```ts
267
- * import { throwError } from "@graphrefly/graphrefly-ts";
268
- *
269
- * throwError(new Error("fail"));
270
- * ```
271
- *
272
- * @category extra
273
- */
274
- declare function throwError(err: unknown, opts?: ExtraOpts): Node<never>;
275
- /**
276
- * Lazily constructs a {@link Node} from a thunk that runs at **activation
277
- * time** (first subscriber after a teardown to zero sinks), not factory time.
278
- *
279
- * **Resubscribable by default.** Diverges from `fromPromise` / `fromIter` /
280
- * `fromAsyncIter` (which are single-shot — second subscriber sees the cached
281
- * terminal value). `defer`'s contract matches RxJS `defer`: every fresh
282
- * activation cycle re-runs the thunk. To opt out and get one-shot semantics,
283
- * pass `{ resubscribable: false }`.
284
- *
285
- * **Sharing across overlapping subscribers.** The thunk only re-runs on a
286
- * fresh activation cycle (zero → one sink). Overlapping subscribers share
287
- * the single activation; the thunk does NOT re-run for each subscriber. If
288
- * the thunk returns an existing `Node`, that Node is shared across activations
289
- * — `defer` will subscribe to it on each activation but does not isolate state
290
- * across subscribers. For per-subscriber isolation, the thunk must construct
291
- * a fresh source (`state(...)`, `fromPromise(fetch(...))`, etc.) on each call.
292
- *
293
- * **Use cases:**
294
- * - Lazy upstream construction (avoid eager evaluation of expensive factories
295
- * at module load — the thunk runs only when something subscribes).
296
- * - Per-activation resource construction (open a connection / file handle on
297
- * subscribe, when paired with full teardown between sessions).
298
- * - Bridging non-Node inputs (Promise, AsyncIterable, Iterable, scalar) into
299
- * the graph behind a lazy boundary.
300
- *
301
- * The thunk's return value is bridged via {@link fromAny}. Errors thrown by
302
- * the thunk surface as a single `[[ERROR, err]]` on the output (with `err`
303
- * coerced to a non-`undefined` value to satisfy spec §1.3 — bare `throw` and
304
- * `throw undefined` are wrapped in a `defer: thunk threw undefined` Error).
305
- *
306
- * Upstream messages are forwarded transparently (DIRTY / DATA / RESOLVED /
307
- * COMPLETE / ERROR / INVALIDATE / PAUSE / RESUME / TEARDOWN), preserving
308
- * batch boundaries. The producer's own `START` handshake is delivered to
309
- * subscribers automatically; the upstream's `START` is filtered.
310
- *
311
- * @param thunk - Called on each activation; returns the upstream input.
312
- * @param opts - Forwarded to `fromAny` (e.g. `signal` for async inputs).
313
- * `signal` is only consumed by `fromAny` for async input shapes (Promise,
314
- * AsyncIterable); it does NOT abort a Node-input or scalar-input defer.
315
- * @returns `Node<T>` — lazy upstream-on-activation.
316
- *
317
- * @example
318
- * ```ts
319
- * import { defer } from "@graphrefly/graphrefly-ts";
320
- *
321
- * // Lazy fetch — runs on the first activation, NOT at factory time.
322
- * // Each fresh activation cycle (after teardown) re-runs the thunk →
323
- * // a new fetch. Overlapping subscribers share the single activation.
324
- * const live = defer(() => fetch("/api/feed").then((r) => r.json()));
325
- * ```
326
- *
327
- * @category extra
328
- */
329
- declare function defer<T>(thunk: () => NodeInput<T>, opts?: AsyncSourceOpts): Node<T>;
330
- /**
331
- * Subscribes immediately and runs `fn` for each upstream `DATA`; returns unsubscribe.
332
- *
333
- * @param source - Upstream node.
334
- * @param fn - Side effect per value.
335
- * @param opts - Effect node options.
336
- * @returns Unsubscribe function (idempotent).
337
- *
338
- * @example
339
- * ```ts
340
- * import { forEach, state } from "@graphrefly/graphrefly-ts";
341
- *
342
- * const u = forEach(state(1), (v) => console.log(v));
343
- * u();
344
- * ```
345
- *
346
- * @category extra
347
- */
348
- declare function forEach<T>(source: Node<T>, fn: (value: T) => void, opts?: ExtraOpts): () => void;
349
- /**
350
- * Buffers every `DATA`; on upstream `COMPLETE` emits one `DATA` with the full array then `COMPLETE`.
351
- *
352
- * @param source - Upstream node.
353
- * @param opts - Optional node options (derived describe kind).
354
- * @returns `Node<T[]>` — single array emission before completion.
355
- *
356
- * @example
357
- * ```ts
358
- * import { of, toArray } from "@graphrefly/graphrefly-ts";
359
- *
360
- * toArray(of(1, 2, 3));
361
- * ```
362
- *
363
- * @category extra
364
- */
365
- declare function toArray<T>(source: Node<T>, opts?: ExtraOpts): Node<T[]>;
366
- /**
367
- * Multicasts upstream: one subscription to `source` while this wrapper has subscribers (via {@link producer}).
368
- *
369
- * @param source - Upstream node to share.
370
- * @param opts - Producer options; `initial` seeds from `source.cache` when set by factory.
371
- * @returns `Node<T>` — hot ref-counted bridge.
372
- *
373
- * @example
374
- * ```ts
375
- * import { share, state } from "@graphrefly/graphrefly-ts";
376
- *
377
- * share(state(0));
378
- * ```
379
- *
380
- * @category extra
381
- */
382
- declare function share<T>(source: Node<T>, opts?: ExtraOpts): Node<T>;
383
- /**
384
- * Like {@link share} with a bounded replay buffer: new subscribers receive the last `bufferSize`
385
- * `DATA` payloads (as separate batches) before live updates.
386
- *
387
- * @param source - Upstream node.
388
- * @param bufferSize - Maximum past values to replay (≥ 1).
389
- * @param opts - Producer options.
390
- * @returns `Node<T>` — multicast with replay on subscribe.
391
- *
392
- * @example
393
- * ```ts
394
- * import { replay, state } from "@graphrefly/graphrefly-ts";
395
- *
396
- * replay(state(0), 3);
397
- * ```
398
- *
399
- * @category extra
400
- */
401
- declare function replay<T>(source: Node<T>, bufferSize: number, opts?: ExtraOpts): Node<T>;
402
- /**
403
- * {@link replay} with `bufferSize === 1` — replays the latest `DATA` to new subscribers.
404
- *
405
- * @param source - Upstream node.
406
- * @param opts - Producer options.
407
- * @returns `Node<T>` — share + last-value replay.
408
- *
409
- * @example
410
- * ```ts
411
- * import { cached, state } from "@graphrefly/graphrefly-ts";
412
- *
413
- * cached(state(0));
414
- * ```
415
- *
416
- * @category extra
417
- */
418
- declare function cached<T>(source: Node<T>, opts?: ExtraOpts): Node<T>;
419
- /**
420
- * Converts the first `DATA` on `source` into a Promise; rejects on `ERROR` or `COMPLETE` without data.
421
- *
422
- * **Important:** This subscribes and waits for a **future** emission. Data that
423
- * has already flowed is gone and will not be seen. Call this *before* the upstream
424
- * emits, or use `source.cache` / `source.status` for already-cached state.
425
- * See COMPOSITION-GUIDE §2 (subscription ordering).
426
- *
427
- * @param source - Node to read once.
428
- * @returns Promise of the first value.
429
- *
430
- * @example
431
- * ```ts
432
- * import { firstValueFrom, of } from "@graphrefly/graphrefly-ts";
433
- *
434
- * await firstValueFrom(of(42));
435
- * ```
436
- *
437
- * @category extra
438
- */
439
- declare function firstValueFrom<T>(source: Node<T>): Promise<T>;
440
- /**
441
- * Wait for the first DATA value from `source` that satisfies `predicate`.
442
- *
443
- * Subscribes directly and resolves on the first DATA value where
444
- * `predicate` returns true. Reactive, no polling. Use in tests and
445
- * bridging code where you need a single matching value as a Promise.
446
- *
447
- * **Important:** This only captures **future** emissions — data that has
448
- * already flowed through the node is gone. Call this *before* the upstream
449
- * emits. For already-cached values, use `source.cache` / `source.status`.
450
- * See COMPOSITION-GUIDE §2 (subscription ordering).
451
- *
452
- * ```ts
453
- * const val = await firstWhere(strategy.node, snap => snap.size > 0);
454
- * ```
455
- *
456
- * @param source - Upstream node to observe.
457
- * @param predicate - Returns `true` for the value to resolve on.
458
- * @param opts - `{ skipCurrent?: boolean }`. When `skipCurrent: true`, any DATA
459
- * delivered during the synchronous `subscribe()` call (push-on-subscribe §2.2
460
- * replay of the cached value) is ignored — the promise resolves only on the
461
- * next future emission. Useful when the caller wants to await the next
462
- * settlement event after an imperative action (e.g. `run()` minting a new
463
- * runVersion, where the currently-cached value belongs to the previous run).
464
- *
465
- * @category extra
466
- */
467
- declare function firstWhere<T>(source: Node<T>, predicate: (value: T) => boolean, opts?: {
468
- skipCurrent?: boolean;
469
- }): Promise<T>;
470
- declare function awaitSettled<T>(source: Node<T>, opts?: {
471
- predicate?: (value: T) => boolean;
472
- timeoutMs?: number;
473
- skipCurrent?: boolean;
474
- }): Promise<NonNullable<T>>;
475
- /**
476
- * Converts a reactive `Node<boolean>` into a browser-standard `AbortSignal`
477
- * that fires when the node settles on `true`. Useful for threading a reactive
478
- * "cancel" flag into any async boundary that accepts a signal (fetch, LLM SDK
479
- * calls, child-process APIs, timers).
480
- *
481
- * **Contract.**
482
- * - `signal.abort(reason)` fires exactly once, on the first DATA emission with
483
- * a truthy value. Subsequent emissions are ignored (AbortSignal is
484
- * single-shot).
485
- * - Null / `false` / sentinel values are ignored. Push-on-subscribe will
486
- * check the currently-cached value on subscribe and abort immediately if
487
- * it's already `true`.
488
- * - `reason` defaults to `"cancelled via nodeSignal"`; pass `opts.reason` to
489
- * override (`DOMException`, `Error`, or any value accepted by
490
- * `AbortController.abort`).
491
- *
492
- * **Lifecycle.**
493
- * - Returns a `{signal, dispose}` bundle. Call `dispose()` when you're done
494
- * with the signal (e.g. in a `finally` after the async operation completes).
495
- * `dispose()` unsubscribes from the node and is a no-op once the signal has
496
- * fired.
497
- * - **Memory note:** without `dispose()` the subscription keeps the reactive
498
- * node alive for the lifetime of the process. For bridge calls inside a
499
- * `switchMap` project fn, the switchMap supersede tears the inner subgraph
500
- * down, which is usually the right lifetime — but still call `dispose()`
501
- * from the caller's `finally` for clarity.
502
- *
503
- * @example
504
- * ```ts
505
- * const aborted = state(false);
506
- * const { signal, dispose } = nodeSignal(aborted);
507
- * try {
508
- * const resp = await adapter.invoke(msgs, { signal });
509
- * return resp;
510
- * } finally {
511
- * dispose();
512
- * }
513
- * ```
514
- *
515
- * @category extra
516
- */
517
- declare function nodeSignal(source: Node<boolean>, opts?: {
518
- reason?: unknown;
519
- }): {
520
- signal: AbortSignal;
521
- dispose: () => void;
522
- };
523
- /**
524
- * RxJS-named alias for {@link replay} — multicast with a replay buffer of size `bufferSize`.
525
- *
526
- * @param source - Upstream node.
527
- * @param bufferSize - Replay depth (≥ 1).
528
- * @param opts - Producer options.
529
- * @returns Same behavior as `replay`.
530
- *
531
- * @example
532
- * ```ts
533
- * import { shareReplay, state } from "@graphrefly/graphrefly-ts";
534
- *
535
- * shareReplay(state(0), 5);
536
- * ```
537
- *
538
- * @category extra
539
- */
540
- declare const shareReplay: typeof replay;
541
- /**
542
- * Activate a compute node's upstream wiring without a real sink.
543
- *
544
- * Derived/effect nodes are lazy — they don't compute until at least one
545
- * subscriber exists (COMPOSITION-GUIDE §5). `keepalive` subscribes with an
546
- * empty sink so the node stays wired for `.cache` and upstream propagation.
547
- *
548
- * Returns the unsubscribe handle. Common usage:
549
- * `graph.addDisposer(keepalive(node))`.
550
- *
551
- * @category extra
552
- */
553
- declare function keepalive(n: Node<unknown>): () => void;
554
- /** Bundle returned by {@link reactiveCounter}. */
555
- type ReactiveCounterBundle = {
556
- /** Reactive node holding the current count. */
557
- readonly node: Node<number>;
558
- /** Increment by 1. Returns `false` if cap would be exceeded. */
559
- increment(): boolean;
560
- /** Current count (synchronous read). */
561
- get(): number;
562
- /** Whether the counter has reached its cap. */
563
- atCap(): boolean;
564
- };
565
- /**
566
- * Reactive counter with a cap — the building block for circuit breakers.
567
- *
568
- * Wraps a `state(0)` node with `increment()` that respects a maximum.
569
- * The `node` is subscribable and composable like any reactive node. When
570
- * the cap is reached, `increment()` returns `false`.
571
- *
572
- * ```ts
573
- * const retries = reactiveCounter(10);
574
- * retries.increment(); // true — count is now 1
575
- * retries.node.subscribe(...); // reactive updates
576
- * retries.atCap(); // false
577
- * ```
578
- *
579
- * @param cap - Maximum value (inclusive). 0 = no increments allowed.
580
- * @category extra
581
- */
582
- declare function reactiveCounter(cap: number): ReactiveCounterBundle;
583
-
584
- export { type AsyncSourceOpts, type EventTargetLike, type FromCronOptions, type NodeInput, type ReactiveCounterBundle, awaitSettled, cached, defer, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, nodeSignal, of, reactiveCounter, replay, share, shareReplay, throwError, toArray };
1
+ export * from '@graphrefly/pure-ts/extra/sources';
@@ -1 +1,3 @@
1
- import{A as y,B as z,C as A,D as B,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"../chunk-CRVT7D2P.js";import"../chunk-NTEURFZH.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{x as awaitSettled,u as cached,p as defer,m as empty,a as escapeRegexChar,v as firstValueFrom,w as firstWhere,q as forEach,k as fromAny,j as fromAsyncIter,f as fromCron,g as fromEvent,h as fromIter,i as fromPromise,e as fromRaf,d as fromTimer,b as globToRegExp,A as keepalive,c as matchesAnyPattern,n as never,y as nodeSignal,l as of,B as reactiveCounter,t as replay,s as share,z as shareReplay,o as throwError,r as toArray};
1
+ // src/extra/sources.ts
2
+ export * from "@graphrefly/pure-ts/extra/sources";
3
+ //# sourceMappingURL=sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/extra/sources.ts"],"sourcesContent":["// Phase 13.9.A shim — re-export from pure-TS sibling until\n// @graphrefly/native (napi binding) and per-milestone swap-overs land.\nexport * from \"@graphrefly/pure-ts/extra/sources\";\n"],"mappings":";AAEA,cAAc;","names":[]}
@@ -1 +1,21 @@
1
- "use strict";var K=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Re=Object.prototype.hasOwnProperty;var Oe=(n,e)=>{for(var t in e)K(n,t,{get:e[t],enumerable:!0})},Se=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!Re.call(n,r)&&r!==t&&K(n,r,{get:()=>e[r],enumerable:!(s=Me(e,r))||s.enumerable});return n};var Ce=n=>Se(K({},"__esModule",{value:!0}),n);var Ke={};Oe(Ke,{fromIDBRequest:()=>qe,fromIDBTransaction:()=>Ye});module.exports=Ce(Ke);var G=Symbol.for("graphrefly/START"),g=Symbol.for("graphrefly/DATA"),A=Symbol.for("graphrefly/DIRTY"),E=Symbol.for("graphrefly/RESOLVED"),M=Symbol.for("graphrefly/INVALIDATE"),D=Symbol.for("graphrefly/PAUSE"),V=Symbol.for("graphrefly/RESUME"),N=Symbol.for("graphrefly/TEARDOWN"),v=Symbol.for("graphrefly/COMPLETE"),h=Symbol.for("graphrefly/ERROR"),R=Object.freeze([A]),J=Object.freeze([E]),Fe=Object.freeze([M]),X=Object.freeze([G]),Ie=Object.freeze([v]),Ge=Object.freeze([N]),Z=Object.freeze([R]),de=Object.freeze([J]),le=Object.freeze([Fe]),ce=Object.freeze([Ie]),Q=Object.freeze([Ge]);var Ve={name:"json",version:1,contentType:"application/json",encode(n){let e=JSON.stringify(n);return new TextEncoder().encode(e)},decode(n,e){let t=new TextDecoder().decode(n);return JSON.parse(t)}};function ue(n){n.registerCodec(Ve)}var He={type:"system",id:""};function U(n){if(n==null)return He;let{type:e,id:t,...s}=n;return{type:e??"system",id:t??"",...s}}var ee=0,Le=!1,he=[],fe=[],pe=[],Pe=[];function _e(){return ee>0||Le}function ge(){return ee>0}function ye(n){ee>0?Pe.push(n):n()}function B(n,e,t){if(e.length===0)return;if(e.length===1){let l=t(e[0][0]);if(l<3||!_e()){n(e);return}(l>=5?pe:l===4?fe:he).push(()=>n(e));return}let s=e.length,r=s,a=s,i=s,o=0;for(;o<s&&t(e[o][0])<3;)o++;for(r=o;o<s&&t(e[o][0])===3;)o++;for(a=o;o<s&&t(e[o][0])===4;)o++;i=o;let d=_e();if(r>0){let l=e.slice(0,r);n(l)}if(a>r){let l=e.slice(r,a);d?he.push(()=>n(l)):n(l)}if(i>a){let l=e.slice(a,i);d?fe.push(()=>n(l)):n(l)}if(s>i){let l=e.slice(i,s);d?pe.push(()=>n(l)):n(l)}}function be(){return Date.now()*1e6}var W=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let s=this._messageTypes.get(t);return s!=null?s.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}};function me(n){n.registerMessageType(G,{tier:0,wireCrossing:!1}),n.registerMessageType(A,{tier:1,wireCrossing:!1}),n.registerMessageType(M,{tier:1,wireCrossing:!1,metaPassthrough:!1}),n.registerMessageType(D,{tier:2,wireCrossing:!1}),n.registerMessageType(V,{tier:2,wireCrossing:!1}),n.registerMessageType(g,{tier:3,wireCrossing:!0}),n.registerMessageType(E,{tier:3,wireCrossing:!0}),n.registerMessageType(v,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(h,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(N,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var O=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}};function te(n){if(n===void 0)return null;if(typeof n=="number"){if(!Number.isFinite(n))throw new TypeError(`Cannot hash non-finite number: ${n}`);if(Number.isInteger(n)&&!Number.isSafeInteger(n))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${n}. Cross-language cid parity is not guaranteed for unsafe integers.`);return n}if(typeof n=="string"||typeof n=="boolean"||n===null)return n;if(Array.isArray(n))return n.map(te);if(typeof n=="object"&&n!==null){let e={};for(let t of Object.keys(n).sort())e[t]=te(n[t]);return e}return null}var Ue=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Be=new TextEncoder;function We(n){let e=Be.encode(n),t=e.length,s=t*8,r=t+9+63&-64,a=new Uint8Array(r);a.set(e),a[t]=128;let i=new DataView(a.buffer);i.setUint32(r-4,s>>>0,!1),i.setUint32(r-8,Math.floor(s/4294967296)>>>0,!1);let o=1779033703,d=3144134277,l=1013904242,c=2773480762,p=1359893119,_=2600822924,u=528734635,y=1541459225,k=new Uint32Array(64),m=(T,b)=>T>>>b|T<<32-b;for(let T=0;T<r;T+=64){for(let f=0;f<16;f++)k[f]=i.getUint32(T+f*4,!1);for(let f=16;f<64;f++){let F=k[f-15],I=k[f-2],P=m(F,7)^m(F,18)^F>>>3,Y=m(I,17)^m(I,19)^I>>>10;k[f]=k[f-16]+P+k[f-7]+Y>>>0}let b=o,S=d,C=l,$=c,x=p,H=_,L=u,q=y;for(let f=0;f<64;f++){let F=m(x,6)^m(x,11)^m(x,25),I=x&H^~x&L,P=q+F+I+Ue[f]+k[f]>>>0,Y=m(b,2)^m(b,13)^m(b,22),Ae=b&S^b&C^S&C,Ee=Y+Ae>>>0;q=L,L=H,H=x,x=$+P>>>0,$=C,C=S,S=b,b=P+Ee>>>0}o=o+b>>>0,d=d+S>>>0,l=l+C>>>0,c=c+$>>>0,p=p+x>>>0,_=_+H>>>0,u=u+L>>>0,y=y+q>>>0}let w=T=>T.toString(16).padStart(8,"0");return w(o)+w(d)+w(l)+w(c)+w(p)+w(_)+w(u)+w(y)}function ne(n){let e=te(n??null),t=JSON.stringify(e);return We(t).slice(0,16)}function je(){let n=globalThis.crypto;if(n?.randomUUID)return n.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function se(n,e,t){let s=t?.id??je();if(n===0)return{id:s,version:0};let a=(t?.hash??ne)(e);return{id:s,version:0,cid:a,prev:null}}function ve(n,e,t){n.version+=1,"cid"in n&&(n.prev=n.cid,n.cid=t(e))}var we=()=>{},Te=100;function xe(n){return{node:n,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function re(n){n.prevData=void 0,n.dirty=!1,n.involvedThisWave=!1,n.dataBatch.length=0,n.terminal=void 0}function j(n){return n.length===0?n:typeof n[0]=="symbol"?[n]:n}var ze=(n,e,t,s)=>{t.direction==="down-in"&&n._onDepMessage(t.depIndex,e)},$e=(n,e,t,s)=>{let r=n;if(r._status==="completed"||r._status==="errored")return;let a=r._cached,i=a===void 0?[X]:[X,[g,a]];r._status==="dirty"&&i.push(R),B(e,i,r._config.tierOf)},ie=new W({onMessage:ze,onSubscribe:$e});me(ie);ue(ie);var z=class n{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,t,s){this._config=s.config??ie,this._config.onMessage,this._optsName=s.name,this._describeKind=s.describeKind,this._equals=s.equals??Object.is,this._resubscribable=s.resubscribable??!1,this._resetOnTeardown=s.resetOnTeardown??!1,this._autoComplete=s.completeWhenDepsComplete??!0,this._autoError=s.errorWhenDepsError??!0,this._pausable=s.pausable??!0,this._guard=s.guard,this._fn=t,this._partial=s.partial??!1,this._cached=s.initial!==void 0?s.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=s.versioningHash??this._config.defaultHashFn??ne;let r=s.versioning??this._config.defaultVersioning;this._versioningLevel=r,this._versioning=r!=null?se(r,this._cached===void 0?void 0:this._cached,{id:s.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(xe);let a={};for(let[o,d]of Object.entries(s.meta??{})){let l={initial:d,name:`${s.name??"node"}:meta:${o}`,describeKind:"state",config:this._config};s.guard!=null&&(l.guard=s.guard),s.resubscribable===!0&&(l.resubscribable=!0),a[o]=new n([],void 0,l)}Object.freeze(a),this.meta=a,this._hasMeta=Object.keys(a).length>0;let i=this;this._actions={emit(o){i._emit([[g,o]])},down(o){i._emit(j(o))},up(o){i._emitUp(j(o))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,t){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let s=this._versioningLevel;if(s!=null&&e<=s)return;let r=t?.hash??this._hashFn;r!==this._hashFn&&(this._hashFn=r);let a=this._cached===void 0?void 0:this._cached,i=this._versioning,o=i?.id??t?.id,d=i?.version??0,l=se(e,a,{id:o,hash:r});l.version=d,this._versioning=l,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=U(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,s=e?.actor!=null;if(!t&&!s)return;let r=U(e?.actor),a=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,a))throw new O({actor:r,action:a,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(r,a))throw new O({actor:r,action:a,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:be()}}down(e,t){let s=j(e);s.length!==0&&(this._checkGuard(t),this._emit(s))}emit(e,t){this._checkGuard(t),this._emit([[g,e]])}up(e,t){if(this._deps.length===0)return;let s=j(e);if(s.length===0)return;this._checkGuard(t);let r=t??{internal:!0};this._validateUpTiers(s);for(let a of this._deps)a.node.up?.(s,r)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let s of e){let r=t(s[0]);if(r===3||r===4)throw new Error(`Node "${this.name}": tier-${r} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,t){if(t!=null&&this._guard!=null){let d=U(t);if(!this._guard(d,"observe"))throw new O({actor:d,action:"observe",nodeName:this.name})}let r=this._isTerminal&&this._resubscribable;if(r){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let d of this._deps)re(d);if(this._partial===!1){for(let d of this._deps)if(d.prevData!==void 0||d.dataBatch.length!==0||d.terminal!==void 0||d.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let a;try{a=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:r},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let i=this._isTerminal;if(this._sinkCount===1&&!i)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof a=="function")try{a()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let o=!1;return()=>{o||(o=!0,this._sinkCount-=1,this._removeSink(e),typeof a=="function"&&a(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[t]=this._sinks;this._sinks=t}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,t=0;try{for(let s=0;s<e;s++){let r=s,a=this._deps[s];a.unsub=we,a.unsub=a.node.subscribe(i=>{if(a.unsub===null)return;let o=this._config.tierOf,d=!1;for(let l of i)o(l[0])>=3&&(d=!0),this._config.onMessage(this,l,{direction:"down-in",depIndex:r},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(s){this._deps[t].unsub=null;for(let r=0;r<t;r++){let a=this._deps[r];if(a.unsub!=null){let i=a.unsub;a.unsub=null;try{i()}catch{}re(a)}}throw this._dirtyDepCount=0,s}}_addDep(e){for(let r=0;r<this._deps.length;r++)if(this._deps[r].node===e)return r;let t=this._deps.length,s=xe(e);if(this._deps.push(s),this._sinks==null)return t;s.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Z),s.unsub=we;try{s.unsub=e.subscribe(r=>{if(s.unsub===null)return;let a=this._config.tierOf,i=!1;for(let o of r)a(o[0])>=3&&(i=!0),this._config.onMessage(this,o,{direction:"down-in",depIndex:t},this._actions);i&&this._maybeRunFnOnSettlement()})}catch(r){throw s.unsub=null,this._deps.pop(),this._dirtyDepCount--,r}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(s){this._emit([[h,this._wrapFnError("cleanup threw",s)]])}else if(t!=null&&typeof t=="object"){let s=t.deactivate;if(typeof s=="function")try{s()}catch(r){this._emit([[h,this._wrapFnError("cleanup.deactivate threw",r)]])}}for(let s of this._deps){if(s.unsub!=null){let r=s.unsub;s.unsub=null;try{r()}catch{}}re(s)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,t){let s=this._deps[e],r=t[0];if(this._inspectorHooks!=null){let a={kind:"dep_message",depIndex:e,message:t};for(let i of this._inspectorHooks)i(a)}if(r!==G){if(r===A){this._depDirtied(s);return}if(r===M){if(this._depInvalidated(s),this._cached===void 0)return;this._emit(le);return}if(r===D||r===V){this._emit([t]);return}if(r===N){this._emit(Q);return}if(r===g)this._depSettledAsData(s,t[1]);else if(r===E)this._depSettledAsResolved(s);else if(r===v)this._depSettledAsTerminal(s,!0);else if(r===h)this._depSettledAsTerminal(s,t[1]);else{this._emit([t]);return}if(!this._fn){(r===g||r===E)&&this._emit([t]),(r===v||r===h)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Z))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(de),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[h,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(ce)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(i){this._emit([[h,this._wrapFnError("cleanup threw",i)]]);return}}else if(e!=null&&typeof e=="object"){let i=e.beforeRun;if(typeof i=="function"){e.beforeRun=void 0;try{i()}catch(o){this._emit([[h,this._wrapFnError("cleanup.beforeRun threw",o)]]);return}}}let t=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),s=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let o=t[i];o!=null&&o.length>0&&(this._deps[i].prevData=o[o.length-1])}let r=this._deps.map(i=>i.terminal),a={prevData:s,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:t,prevData:s};for(let o of this._inspectorHooks)o(i)}this._isExecutingFn=!0;try{let i=this._fn(t,this._actions,a);if(typeof i=="function")this._cleanup=i;else if(i!=null&&typeof i=="object"){let o=i;(typeof o.beforeRun=="function"||typeof o.deactivate=="function"||typeof o.invalidate=="function")&&(this._cleanup=i)}}catch(i){this._emit([[h,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Te?(this._rerunDepth=0,this._emit([[h,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Te} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,t){let s=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${s}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[R,e[0]]:e;let s=!0,r=!1,a=!1,i=-1;for(let d of e){let l=t(d[0]);l<i&&(s=!1),l===3&&(r=!0),d[0]===A&&(a=!0),i=l}let o=e;if(!s){let d=e.map((l,c)=>({m:l,i:c,tier:t(l[0])}));d.sort((l,c)=>l.tier-c.tier||l.i-c.i),o=d.map(l=>l.m)}if(r&&!a&&this._status!=="dirty"){let d=0;for(;d<o.length&&t(o[d][0])===0;)d++;return d===0?[R,...o]:[...o.slice(0,d),R,...o.slice(d)]}return o}_emit(e){if(e.length===0)return;for(let o=0;o<e.length;o++){let d=e[o];if(d[0]===h&&d[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let t=e;if(this._isTerminal&&!this._resubscribable){let o=e.filter(d=>d[0]===N||d[0]===M);if(o.length===0)return;t=o}t=this._frameBatch(t);let r=null;for(let o=0;o<t.length;o++){let d=t[o],l=d[0];if(l!==D&&l!==V){r?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${l===D?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let p=d[1];if(l===D)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(p),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(p))c=!1;else if(this._pauseLocks.delete(p),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let _=this._pauseBuffer;this._pauseBuffer=[],this._emit(_)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?r?.push(d):r==null&&(r=t.slice(0,o))}if(r!=null){if(r.length===0)return;t=r}if(this._hasMeta&&t.some(o=>o[0]===N))for(let o of Object.keys(this.meta))try{this.meta[o]._emit(Q)}catch{}let{finalMessages:a,equalsError:i}=this._updateState(t);if(a.length>0&&this._config.inspectorEnabled){let o=this._config.globalInspector;if(o!=null)try{o({kind:"emit",node:this,messages:a})}catch{}}if(a.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let o=this._config.tierOf,d=[];for(let l of a)o(l[0])===3?this._pauseBuffer.push(l):d.push(l);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(a);i!=null&&this._emit([[h,i]])}_updateState(e){let t=this._config.tierOf,s,r,a=-1,i=0;for(let c of e)t(c[0])===3&&i++;let o=i<=1,d=-1;if(this._versioning!=null&&i>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===g){d=c;break}}for(let c=0;c<e.length;c++){let p=e[c],_=p[0];if(_===g){if(p.length>=2){let u=!1;if(o&&this._cached!==void 0)try{u=this._equals(this._cached,p[1])}catch(y){r=this._wrapFnError("equals threw",y),a=c;break}if(u){s==null&&(s=e.slice(0,c)),s.push(J),this._status="resolved";continue}this._cached=p[1],this._versioning!=null&&(d<0||c===d)&&ve(this._versioning,p[1],this._hashFn)}this._status="settled",s?.push(p)}else if(s?.push(p),_===A)this._status="dirty";else if(_===E)this._status="resolved";else if(_===v){this._status="completed";{let u=this._config.rigorRecorder;if(u!=null)try{u.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===h){this._status="errored";{let u=this._config.rigorRecorder;if(u!=null)try{u.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===M){if(this._cached!==void 0){let y=this._config.rigorRecorder;if(y!=null)try{y.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let u=this._cleanup;if(typeof u=="function"){this._cleanup=void 0;try{u()}catch{}}else if(u!=null&&typeof u=="object"){let y=u.invalidate;if(typeof y=="function")try{y()}catch{}}}else _===N&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let l=a>=0?s??e.slice(0,a):s??e;return r!=null?{finalMessages:l,equalsError:r}:{finalMessages:l}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let s of t)s(e)};_dispatchOrAccumulate(e){if(ge()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ye(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}B(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);B(this._deliverToSinks,t,this._config.tierOf)}},Ne=n=>Array.isArray(n),oe=n=>typeof n=="object"&&n!=null&&!Array.isArray(n);function ke(n,e,t){let s=Ne(n)?n:[],r=typeof n=="function"?n:typeof e=="function"?e:void 0,a={};return Ne(n)?a=(oe(e)?e:t)??{}:oe(n)?a=n:a=(oe(e)?e:t)??{},new z(s,r,a)}function ae(n,e){return ke((s,r,a)=>n(r,a)??void 0,{describeKind:"producer",...e})}function qe(n){return ae(e=>{let t=!1,s=()=>{n.onsuccess=null,n.onerror=null};return n.onsuccess=()=>{t||(t=!0,s(),e.down([[g,n.result],[v]]))},n.onerror=()=>{t||(t=!0,s(),e.down([[h,n.error??new Error("IndexedDB request failed")]]))},()=>{t=!0,s()}})}function Ye(n){return ae(e=>{let t=!1,s=()=>{n.oncomplete=null,n.onerror=null,n.onabort=null};return n.oncomplete=()=>{t||(t=!0,s(),e.down([[g,void 0],[v]]))},n.onerror=()=>{t||(t=!0,s(),e.down([[h,n.error??new Error("IndexedDB transaction failed")]]))},n.onabort=()=>{t||(t=!0,s(),e.down([[h,n.error??new Error("IndexedDB transaction aborted")]]))},()=>{t=!0,s()}})}0&&(module.exports={fromIDBRequest,fromIDBTransaction});
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+
17
+ // src/extra/storage-browser.ts
18
+ var storage_browser_exports = {};
19
+ module.exports = __toCommonJS(storage_browser_exports);
20
+ __reExport(storage_browser_exports, require("@graphrefly/pure-ts/extra/storage-browser"), module.exports);
21
+ //# sourceMappingURL=storage-browser.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/extra/storage-browser.ts"],"sourcesContent":["// Phase 13.9.A shim — re-export from pure-TS sibling until\n// @graphrefly/native (napi binding) and per-milestone swap-overs land.\nexport * from \"@graphrefly/pure-ts/extra/storage-browser\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,oCAAc,sDAFd;","names":[]}