@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.
- package/dist/backoff-HPZMEZNF.js +1 -0
- package/dist/cascading-Bp99ckMJ.d.ts +180 -0
- package/dist/cascading-CcAgRacD.d.cts +180 -0
- package/dist/chunk-22F4K3G7.js +1 -0
- package/dist/chunk-22SVXUPB.js +64 -0
- package/dist/chunk-2GQREQ6C.js +1 -0
- package/dist/chunk-3JXNEPCD.js +2 -0
- package/dist/chunk-4JJCCD5S.js +2 -0
- package/dist/chunk-4OFIQ66T.js +1 -0
- package/dist/chunk-4V4C7K56.js +1 -0
- package/dist/chunk-4VVTGLXJ.js +1 -0
- package/dist/chunk-567NWZ3T.js +1 -0
- package/dist/chunk-5JDE5JHE.js +1 -0
- package/dist/chunk-5QDBSZBV.js +1 -0
- package/dist/chunk-5Z4HDCO6.js +1 -0
- package/dist/chunk-63FFOHLA.js +1 -0
- package/dist/chunk-6QZNQS5B.js +1 -0
- package/dist/chunk-7JDLFI6N.js +1 -0
- package/dist/chunk-7TDOES3L.js +1 -0
- package/dist/chunk-A7IAQQ63.js +1 -0
- package/dist/chunk-AMG5VBHW.js +1 -0
- package/dist/chunk-AUY2YKCO.js +1 -0
- package/dist/chunk-AV3PIDFQ.js +1 -0
- package/dist/chunk-BA5URFYW.js +1 -0
- package/dist/chunk-BKPLTBL5.js +1 -0
- package/dist/chunk-BZP5T4X6.js +1 -0
- package/dist/chunk-CK2E7BTU.js +1 -0
- package/dist/chunk-CSJE2EKV.js +1 -0
- package/dist/chunk-E3AXATVZ.js +9 -0
- package/dist/chunk-ESMPEKEV.js +1 -0
- package/dist/chunk-GJR3P6JG.js +1 -0
- package/dist/chunk-GNCBXARM.js +1 -0
- package/dist/chunk-GPW2V3RE.js +1 -0
- package/dist/chunk-HSIEYSDY.js +1 -0
- package/dist/chunk-I6VIH3VA.js +1 -0
- package/dist/chunk-ISCENNXS.js +1 -0
- package/dist/chunk-JYOUF6UQ.js +1 -0
- package/dist/chunk-KASHOCF5.js +1 -0
- package/dist/chunk-LGSNR4LU.js +5 -0
- package/dist/chunk-LVGBLZM2.js +1 -0
- package/dist/chunk-MGKAO4EK.js +7 -0
- package/dist/chunk-NSG4C6BF.js +23 -0
- package/dist/chunk-OL33ZI6R.js +1 -0
- package/dist/chunk-PCZ35NXD.js +78 -0
- package/dist/chunk-PGMUCUHG.js +43 -0
- package/dist/chunk-QYADASLV.js +1 -0
- package/dist/chunk-RD52SNH2.js +1 -0
- package/dist/chunk-SLMYTGTU.js +1 -0
- package/dist/chunk-TWMEGG45.js +1 -0
- package/dist/chunk-UVJQ35G2.js +1 -0
- package/dist/chunk-VGTCGNRX.js +18 -0
- package/dist/chunk-VIMF6LGM.js +1 -0
- package/dist/chunk-VJLMUKOI.js +1 -0
- package/dist/chunk-VWPRPPKR.js +1 -0
- package/dist/chunk-W4TSQ6RJ.js +1 -0
- package/dist/chunk-WM7H7WTY.js +3 -0
- package/dist/chunk-Y32RJO24.js +1 -0
- package/dist/chunk-Y53B6NS4.js +1 -0
- package/dist/compat/index.cjs +15 -7656
- package/dist/compat/index.d.cts +15 -14
- package/dist/compat/index.d.ts +15 -14
- package/dist/compat/index.js +1 -50
- package/dist/compat/jotai/index.cjs +1 -2048
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +1 -9
- package/dist/compat/nanostores/index.cjs +1 -2175
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +1 -23
- package/dist/compat/nestjs/index.cjs +15 -6782
- package/dist/compat/nestjs/index.d.cts +7 -6
- package/dist/compat/nestjs/index.d.ts +7 -6
- package/dist/compat/nestjs/index.js +1 -83
- package/dist/compat/react/index.cjs +1 -141
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/react/index.js +1 -12
- package/dist/compat/solid/index.cjs +1 -128
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/solid/index.js +1 -12
- package/dist/compat/svelte/index.cjs +1 -131
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/svelte/index.js +1 -12
- package/dist/compat/vue/index.cjs +1 -146
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/vue/index.js +1 -12
- package/dist/compat/zustand/index.cjs +7 -4931
- package/dist/compat/zustand/index.d.cts +5 -5
- package/dist/compat/zustand/index.d.ts +5 -5
- package/dist/compat/zustand/index.js +1 -12
- package/dist/composite-BL-llbnE.d.ts +69 -0
- package/dist/composite-Dze--DaA.d.cts +69 -0
- package/dist/core/index.cjs +1 -2271
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +1 -110
- package/dist/extra/browser.cjs +1 -0
- package/dist/extra/browser.d.cts +3 -0
- package/dist/extra/browser.d.ts +3 -0
- package/dist/extra/browser.js +1 -0
- package/dist/extra/index.cjs +24 -9971
- package/dist/extra/index.d.cts +13 -6
- package/dist/extra/index.d.ts +13 -6
- package/dist/extra/index.js +1 -381
- package/dist/extra/node.cjs +3 -0
- package/dist/extra/node.d.cts +81 -0
- package/dist/extra/node.d.ts +81 -0
- package/dist/extra/node.js +2 -0
- package/dist/extra/operators.cjs +1 -0
- package/dist/extra/operators.d.cts +910 -0
- package/dist/extra/operators.d.ts +910 -0
- package/dist/extra/operators.js +1 -0
- package/dist/extra/reactive.cjs +1 -0
- package/dist/extra/reactive.d.cts +352 -0
- package/dist/extra/reactive.d.ts +352 -0
- package/dist/extra/reactive.js +1 -0
- package/dist/extra/sources.cjs +1 -2486
- package/dist/extra/sources.d.cts +6 -2
- package/dist/extra/sources.d.ts +6 -2
- package/dist/extra/sources.js +1 -57
- package/dist/extra/storage-browser.cjs +1 -0
- package/dist/extra/storage-browser.d.cts +71 -0
- package/dist/extra/storage-browser.d.ts +71 -0
- package/dist/extra/storage-browser.js +1 -0
- package/dist/extra/storage-core.cjs +1 -0
- package/dist/extra/storage-core.d.cts +98 -0
- package/dist/extra/storage-core.d.ts +98 -0
- package/dist/extra/storage-core.js +1 -0
- package/dist/extra/storage-node.cjs +2 -0
- package/dist/extra/storage-node.d.cts +60 -0
- package/dist/extra/storage-node.d.ts +60 -0
- package/dist/extra/storage-node.js +1 -0
- package/dist/fallback-BaTS7vVY.d.cts +258 -0
- package/dist/fallback-eOm3LNxP.d.ts +258 -0
- package/dist/graph/index.cjs +7 -5030
- package/dist/graph/index.d.cts +6 -5
- package/dist/graph/index.d.ts +6 -5
- package/dist/graph/index.js +1 -50
- package/dist/{graph-DNCrvZSn.d.cts → graph-DgohqXK-.d.cts} +151 -32
- package/dist/{graph-CCwGKLCm.d.ts → graph-Qjg9gWHI.d.ts} +151 -32
- package/dist/{index-BwfLUNw4.d.ts → index-2BVuRCI4.d.ts} +173 -2040
- package/dist/{index-BPVt8kqc.d.ts → index-2NvguqQA.d.ts} +10 -195
- package/dist/index-A65LZhoM.d.ts +186 -0
- package/dist/{index-DlLp-2Xn.d.cts → index-B-8FCEua.d.cts} +10 -195
- package/dist/index-B-gqvYel.d.ts +135 -0
- package/dist/index-B2PRuolf.d.cts +86 -0
- package/dist/index-BJqt9EwW.d.ts +231 -0
- package/dist/{index-BHlKbUwO.d.cts → index-BKjT5DiZ.d.cts} +173 -2040
- package/dist/{index-C0svESO4.d.ts → index-BM8BU4q6.d.ts} +1 -1
- package/dist/{index-VdHQMPy1.d.ts → index-BQaEnxBf.d.ts} +1 -1
- package/dist/index-BSfwiy5B.d.ts +192 -0
- package/dist/index-BTSkeCZs.d.cts +291 -0
- package/dist/index-BUVtw1Ay.d.cts +186 -0
- package/dist/index-BUi57v_p.d.ts +163 -0
- package/dist/{messaging-Gt4LPbyA.d.cts → index-BanNUILp.d.cts} +31 -93
- package/dist/{audit-DRlSzBu9.d.ts → index-BayHDRx6.d.cts} +27 -21
- package/dist/{index-B6D3QNSA.d.ts → index-BiyjsZ0m.d.ts} +148 -20
- package/dist/index-BqZ6vB2A.d.ts +2057 -0
- package/dist/{memory-li6FL5RM.d.ts → index-BuVidq3D.d.cts} +26 -26
- package/dist/index-Byh-xTyp.d.ts +105 -0
- package/dist/index-C08QPDcV.d.cts +321 -0
- package/dist/{demo-shell-BDkOptd6.d.ts → index-C66RJiX8.d.ts} +14 -14
- package/dist/index-C8RfjffH.d.ts +291 -0
- package/dist/index-CA1Cu7Ud.d.ts +873 -0
- package/dist/{index-ByQxazQJ.d.cts → index-CABbltIu.d.cts} +1 -1
- package/dist/{index-VHqptjhu.d.cts → index-CHEBsnYv.d.cts} +1 -1
- package/dist/{index-BuEoe-Qu.d.ts → index-CI0yDnLp.d.ts} +9 -9
- package/dist/{index-B9B7_HEY.d.ts → index-CJ45TW-h.d.ts} +1 -1
- package/dist/{index-CO8uBlUh.d.cts → index-CJZKZoo4.d.cts} +148 -20
- package/dist/{index-wEn0eFe8.d.ts → index-CX2tFJL1.d.ts} +1 -1
- package/dist/{index-BaSM3aYt.d.ts → index-CcWOJ6F0.d.ts} +3 -3
- package/dist/{audit-ClmqGOCx.d.cts → index-CiaVoZGo.d.ts} +27 -21
- package/dist/{index-Dzk2hrlR.d.ts → index-Ct5CWc4E.d.ts} +1 -1
- package/dist/index-D38duMCv.d.cts +357 -0
- package/dist/{index-C8oil6M6.d.ts → index-D5XJ2tSx.d.ts} +30 -6
- package/dist/{index-DO_6JN9Z.d.cts → index-D80do5jX.d.cts} +1 -1
- package/dist/index-D9HKAH_-.d.cts +231 -0
- package/dist/index-DBe_8XW5.d.cts +143 -0
- package/dist/{memory-C6Z2tGpC.d.cts → index-DCeTyFlB.d.ts} +26 -26
- package/dist/index-DDy8eeXS.d.ts +321 -0
- package/dist/index-DJ5oNBc8.d.ts +143 -0
- package/dist/{index-CI3DprxP.d.cts → index-DP0_O3ls.d.cts} +30 -6
- package/dist/{demo-shell-Crid1WdR.d.cts → index-DX8xS-yB.d.cts} +14 -14
- package/dist/index-DiZejfCI.d.cts +2057 -0
- package/dist/index-DknyJ2Fu.d.cts +163 -0
- package/dist/index-DoWMs-Kk.d.cts +135 -0
- package/dist/{messaging-XDoYablx.d.ts → index-DuB5aO4-.d.ts} +31 -93
- package/dist/index-DwjJGKxV.d.ts +357 -0
- package/dist/{index-B6EhDnjH.d.cts → index-H_oxVec5.d.cts} +1 -1
- package/dist/{index-3lsddbbS.d.ts → index-IMAHq-ia.d.ts} +1 -1
- package/dist/{index-B1tloyhO.d.cts → index-U1nir7MX.d.cts} +1 -1
- package/dist/index-Vg7tORgk.d.ts +86 -0
- package/dist/index-dig-r2tQ.d.cts +873 -0
- package/dist/{index-CxFrXH4m.d.ts → index-gsT79Xu9.d.ts} +1 -1
- package/dist/{index-D8wS_PeY.d.cts → index-i99Ka8s7.d.cts} +9 -9
- package/dist/index-iKkyJosF.d.cts +105 -0
- package/dist/{index-Xi3u0HCQ.d.cts → index-jleeotBT.d.cts} +1 -1
- package/dist/{index-DVGiGFGT.d.cts → index-kykKWwV-.d.cts} +3 -3
- package/dist/index-vgcLF5TH.d.cts +192 -0
- package/dist/{index-DYme44FM.d.cts → index-y1RllPn4.d.cts} +1 -1
- package/dist/index.cjs +151 -24142
- package/dist/index.d.cts +69 -2099
- package/dist/index.d.ts +69 -2099
- package/dist/index.js +1 -3868
- package/dist/{meta-CbznRPYJ.d.ts → meta-CX7YsOzp.d.cts} +5 -5
- package/dist/{meta-BxCA7rcr.d.cts → meta-CckhhFRd.d.ts} +5 -5
- package/dist/{node-BmerH3kS.d.cts → node-Dd6wHSib.d.cts} +71 -11
- package/dist/{node-BmerH3kS.d.ts → node-Dd6wHSib.d.ts} +71 -11
- package/dist/{observable-BgGUwcqp.d.ts → observable-BZJgo616.d.ts} +1 -1
- package/dist/{observable-DJt_AxzQ.d.cts → observable-kwzpLvbi.d.cts} +1 -1
- package/dist/patterns/ai/browser.cjs +25 -0
- package/dist/patterns/ai/browser.d.cts +127 -0
- package/dist/patterns/ai/browser.d.ts +127 -0
- package/dist/patterns/ai/browser.js +3 -0
- package/dist/patterns/ai/index.cjs +92 -0
- package/dist/patterns/ai/index.d.cts +17 -0
- package/dist/patterns/ai/index.d.ts +17 -0
- package/dist/patterns/ai/index.js +1 -0
- package/dist/patterns/ai/node.cjs +2 -0
- package/dist/patterns/ai/node.d.cts +58 -0
- package/dist/patterns/ai/node.d.ts +58 -0
- package/dist/patterns/ai/node.js +1 -0
- package/dist/patterns/audit/index.cjs +7 -0
- package/dist/patterns/audit/index.d.cts +6 -0
- package/dist/patterns/audit/index.d.ts +6 -0
- package/dist/patterns/audit/index.js +1 -0
- package/dist/patterns/cqrs/index.cjs +7 -0
- package/dist/patterns/cqrs/index.d.cts +5 -0
- package/dist/patterns/cqrs/index.d.ts +5 -0
- package/dist/patterns/cqrs/index.js +1 -0
- package/dist/patterns/demo-shell/index.cjs +8 -0
- package/dist/patterns/demo-shell/index.d.cts +6 -0
- package/dist/patterns/demo-shell/index.d.ts +6 -0
- package/dist/patterns/demo-shell/index.js +1 -0
- package/dist/patterns/domain-templates/index.cjs +7 -0
- package/dist/patterns/domain-templates/index.d.cts +5 -0
- package/dist/patterns/domain-templates/index.d.ts +5 -0
- package/dist/patterns/domain-templates/index.js +1 -0
- package/dist/patterns/graphspec/index.cjs +84 -0
- package/dist/patterns/graphspec/index.d.cts +7 -0
- package/dist/patterns/graphspec/index.d.ts +7 -0
- package/dist/patterns/graphspec/index.js +1 -0
- package/dist/patterns/guarded-execution/index.cjs +7 -0
- package/dist/patterns/guarded-execution/index.d.cts +7 -0
- package/dist/patterns/guarded-execution/index.d.ts +7 -0
- package/dist/patterns/guarded-execution/index.js +1 -0
- package/dist/patterns/harness/index.cjs +49 -0
- package/dist/patterns/harness/index.d.cts +11 -0
- package/dist/patterns/harness/index.d.ts +11 -0
- package/dist/patterns/harness/index.js +1 -0
- package/dist/patterns/job-queue/index.cjs +7 -0
- package/dist/patterns/job-queue/index.d.cts +5 -0
- package/dist/patterns/job-queue/index.d.ts +5 -0
- package/dist/patterns/job-queue/index.js +1 -0
- package/dist/patterns/lens/index.cjs +7 -0
- package/dist/patterns/lens/index.d.cts +7 -0
- package/dist/patterns/lens/index.d.ts +7 -0
- package/dist/patterns/lens/index.js +1 -0
- package/dist/patterns/memory/index.cjs +7 -0
- package/dist/patterns/memory/index.d.cts +5 -0
- package/dist/patterns/memory/index.d.ts +5 -0
- package/dist/patterns/memory/index.js +1 -0
- package/dist/patterns/messaging/index.cjs +7 -0
- package/dist/patterns/messaging/index.d.cts +5 -0
- package/dist/patterns/messaging/index.d.ts +5 -0
- package/dist/patterns/messaging/index.js +1 -0
- package/dist/patterns/orchestration/index.cjs +7 -0
- package/dist/patterns/orchestration/index.d.cts +6 -0
- package/dist/patterns/orchestration/index.d.ts +6 -0
- package/dist/patterns/orchestration/index.js +1 -0
- package/dist/patterns/reactive-layout/index.cjs +8 -6444
- package/dist/patterns/reactive-layout/index.d.cts +6 -6
- package/dist/patterns/reactive-layout/index.d.ts +6 -6
- package/dist/patterns/reactive-layout/index.js +1 -56
- package/dist/patterns/reduction/index.cjs +7 -0
- package/dist/patterns/reduction/index.d.cts +5 -0
- package/dist/patterns/reduction/index.d.ts +5 -0
- package/dist/patterns/reduction/index.js +1 -0
- package/dist/patterns/refine-loop/index.cjs +9 -0
- package/dist/patterns/refine-loop/index.d.cts +7 -0
- package/dist/patterns/refine-loop/index.d.ts +7 -0
- package/dist/patterns/refine-loop/index.js +1 -0
- package/dist/patterns/resilient-pipeline/index.cjs +1 -0
- package/dist/patterns/resilient-pipeline/index.d.cts +7 -0
- package/dist/patterns/resilient-pipeline/index.d.ts +7 -0
- package/dist/patterns/resilient-pipeline/index.js +1 -0
- package/dist/patterns/surface/index.cjs +15 -0
- package/dist/patterns/surface/index.d.cts +8 -0
- package/dist/patterns/surface/index.d.ts +8 -0
- package/dist/patterns/surface/index.js +1 -0
- package/dist/{reactive-layout-u5Ulnqag.d.ts → reactive-layout-BkBwVvwm.d.ts} +2 -2
- package/dist/{reactive-layout-MQP--J3F.d.cts → reactive-layout-PiFwVaWS.d.cts} +2 -2
- package/dist/reactive-log-1QTyx10a.d.ts +190 -0
- package/dist/reactive-log-BiVoSxke.d.cts +190 -0
- package/dist/{composite-aUCvjZVR.d.ts → reactive-map-CwO_COHy.d.cts} +2 -67
- package/dist/{composite-C7PcQvcs.d.cts → reactive-map-FeuTVAJb.d.ts} +2 -67
- package/dist/resilience-CBfYJW5C.d.ts +493 -0
- package/dist/resilience-XRUF267O.js +1 -0
- package/dist/resilience-uBz4yvYB.d.cts +493 -0
- package/dist/{sugar-CCOxXK1e.d.ts → sugar-CY-MCfZ9.d.ts} +17 -15
- package/dist/{sugar-D02n5JjF.d.cts → sugar-DHttV0LX.d.cts} +17 -15
- package/dist/topology-tree-CVjt2gp7.d.cts +25 -0
- package/dist/topology-tree-one6oSKY.d.ts +25 -0
- package/dist/types-O3GzJY2U.d.cts +401 -0
- package/dist/types-u64Ose53.d.ts +401 -0
- package/package.json +252 -22
- package/dist/ai-CaR_912Q.d.cts +0 -1033
- package/dist/ai-WlRltJV7.d.ts +0 -1033
- package/dist/chunk-3ZWCKRHX.js +0 -117
- package/dist/chunk-3ZWCKRHX.js.map +0 -1
- package/dist/chunk-7TAQJHQV.js +0 -103
- package/dist/chunk-7TAQJHQV.js.map +0 -1
- package/dist/chunk-APFNLIRG.js +0 -62
- package/dist/chunk-APFNLIRG.js.map +0 -1
- package/dist/chunk-AT5LKYNL.js +0 -395
- package/dist/chunk-AT5LKYNL.js.map +0 -1
- package/dist/chunk-BQ6RQQFF.js +0 -5087
- package/dist/chunk-BQ6RQQFF.js.map +0 -1
- package/dist/chunk-BVZYTZ5H.js +0 -599
- package/dist/chunk-BVZYTZ5H.js.map +0 -1
- package/dist/chunk-DST5DKZS.js +0 -1371
- package/dist/chunk-DST5DKZS.js.map +0 -1
- package/dist/chunk-GTE6PWRZ.js +0 -866
- package/dist/chunk-GTE6PWRZ.js.map +0 -1
- package/dist/chunk-HXZEYDUR.js +0 -94
- package/dist/chunk-HXZEYDUR.js.map +0 -1
- package/dist/chunk-J22W6HV3.js +0 -107
- package/dist/chunk-J22W6HV3.js.map +0 -1
- package/dist/chunk-J2VBW3DZ.js +0 -302
- package/dist/chunk-J2VBW3DZ.js.map +0 -1
- package/dist/chunk-JSCT3CR4.js +0 -38
- package/dist/chunk-JSCT3CR4.js.map +0 -1
- package/dist/chunk-JWBCY4NC.js +0 -330
- package/dist/chunk-JWBCY4NC.js.map +0 -1
- package/dist/chunk-K2AUJHVP.js +0 -2251
- package/dist/chunk-K2AUJHVP.js.map +0 -1
- package/dist/chunk-MJ2NKQQL.js +0 -119
- package/dist/chunk-MJ2NKQQL.js.map +0 -1
- package/dist/chunk-N6UR7YVY.js +0 -198
- package/dist/chunk-N6UR7YVY.js.map +0 -1
- package/dist/chunk-NC6S43JJ.js +0 -456
- package/dist/chunk-NC6S43JJ.js.map +0 -1
- package/dist/chunk-OFVJBJXR.js +0 -98
- package/dist/chunk-OFVJBJXR.js.map +0 -1
- package/dist/chunk-OHISZPOJ.js +0 -97
- package/dist/chunk-OHISZPOJ.js.map +0 -1
- package/dist/chunk-OU5CQKNW.js +0 -102
- package/dist/chunk-OU5CQKNW.js.map +0 -1
- package/dist/chunk-PF7GRZMW.js +0 -2712
- package/dist/chunk-PF7GRZMW.js.map +0 -1
- package/dist/chunk-PHOUUNK7.js +0 -2291
- package/dist/chunk-PHOUUNK7.js.map +0 -1
- package/dist/chunk-RNHBMHKA.js +0 -1665
- package/dist/chunk-RNHBMHKA.js.map +0 -1
- package/dist/chunk-SX52TAR4.js +0 -110
- package/dist/chunk-SX52TAR4.js.map +0 -1
- package/dist/chunk-VYPWMZ6H.js +0 -98
- package/dist/chunk-VYPWMZ6H.js.map +0 -1
- package/dist/chunk-WBZOVTYK.js +0 -171
- package/dist/chunk-WBZOVTYK.js.map +0 -1
- package/dist/chunk-WKNUIZOY.js +0 -354
- package/dist/chunk-WKNUIZOY.js.map +0 -1
- package/dist/chunk-X3VMZYBT.js +0 -713
- package/dist/chunk-X3VMZYBT.js.map +0 -1
- package/dist/chunk-X5R3GL6H.js +0 -525
- package/dist/chunk-X5R3GL6H.js.map +0 -1
- package/dist/chunk-XGPU467M.js +0 -136
- package/dist/chunk-XGPU467M.js.map +0 -1
- package/dist/compat/index.cjs.map +0 -1
- package/dist/compat/index.js.map +0 -1
- package/dist/compat/jotai/index.cjs.map +0 -1
- package/dist/compat/jotai/index.js.map +0 -1
- package/dist/compat/nanostores/index.cjs.map +0 -1
- package/dist/compat/nanostores/index.js.map +0 -1
- package/dist/compat/nestjs/index.cjs.map +0 -1
- package/dist/compat/nestjs/index.js.map +0 -1
- package/dist/compat/react/index.cjs.map +0 -1
- package/dist/compat/react/index.js.map +0 -1
- package/dist/compat/solid/index.cjs.map +0 -1
- package/dist/compat/solid/index.js.map +0 -1
- package/dist/compat/svelte/index.cjs.map +0 -1
- package/dist/compat/svelte/index.js.map +0 -1
- package/dist/compat/vue/index.cjs.map +0 -1
- package/dist/compat/vue/index.js.map +0 -1
- package/dist/compat/zustand/index.cjs.map +0 -1
- package/dist/compat/zustand/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/extra/index.cjs.map +0 -1
- package/dist/extra/index.js.map +0 -1
- package/dist/extra/sources.cjs.map +0 -1
- package/dist/extra/sources.js.map +0 -1
- package/dist/graph/index.cjs.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/patterns/ai.cjs +0 -7930
- package/dist/patterns/ai.cjs.map +0 -1
- package/dist/patterns/ai.d.cts +0 -10
- package/dist/patterns/ai.d.ts +0 -10
- package/dist/patterns/ai.js +0 -71
- package/dist/patterns/ai.js.map +0 -1
- package/dist/patterns/audit.cjs +0 -5805
- package/dist/patterns/audit.cjs.map +0 -1
- package/dist/patterns/audit.d.cts +0 -6
- package/dist/patterns/audit.d.ts +0 -6
- package/dist/patterns/audit.js +0 -29
- package/dist/patterns/audit.js.map +0 -1
- package/dist/patterns/demo-shell.cjs +0 -5604
- package/dist/patterns/demo-shell.cjs.map +0 -1
- package/dist/patterns/demo-shell.d.cts +0 -6
- package/dist/patterns/demo-shell.d.ts +0 -6
- package/dist/patterns/demo-shell.js +0 -15
- package/dist/patterns/demo-shell.js.map +0 -1
- package/dist/patterns/memory.cjs +0 -5283
- package/dist/patterns/memory.cjs.map +0 -1
- package/dist/patterns/memory.d.cts +0 -5
- package/dist/patterns/memory.d.ts +0 -5
- package/dist/patterns/memory.js +0 -20
- package/dist/patterns/memory.js.map +0 -1
- package/dist/patterns/reactive-layout/index.cjs.map +0 -1
- package/dist/patterns/reactive-layout/index.js.map +0 -1
- package/dist/storage-CMjUUuxn.d.ts +0 -190
- package/dist/storage-DdWlZo6U.d.cts +0 -190
package/dist/extra/sources.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as NodeOptions, a as Node } from '../node-Dd6wHSib.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Core reactive sources, sinks, and utilities (roadmap §2.3).
|
|
@@ -401,6 +401,10 @@ declare function firstValueFrom<T>(source: Node<T>): Promise<T>;
|
|
|
401
401
|
* @category extra
|
|
402
402
|
*/
|
|
403
403
|
declare function firstWhere<T>(source: Node<T>, predicate: (value: T) => boolean): Promise<T>;
|
|
404
|
+
declare function awaitSettled<T>(source: Node<T>, opts?: {
|
|
405
|
+
predicate?: (value: T) => boolean;
|
|
406
|
+
timeoutMs?: number;
|
|
407
|
+
}): Promise<NonNullable<T>>;
|
|
404
408
|
/**
|
|
405
409
|
* RxJS-named alias for {@link replay} — multicast with a replay buffer of size `bufferSize`.
|
|
406
410
|
*
|
|
@@ -462,4 +466,4 @@ type ReactiveCounterBundle = {
|
|
|
462
466
|
*/
|
|
463
467
|
declare function reactiveCounter(cap: number): ReactiveCounterBundle;
|
|
464
468
|
|
|
465
|
-
export { type AsyncSourceOpts, type EventTargetLike, type FromCronOptions, type NodeInput, type 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 };
|
|
469
|
+
export { type AsyncSourceOpts, type EventTargetLike, type FromCronOptions, type NodeInput, type 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 };
|
package/dist/extra/sources.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as NodeOptions, a as Node } from '../node-Dd6wHSib.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Core reactive sources, sinks, and utilities (roadmap §2.3).
|
|
@@ -401,6 +401,10 @@ declare function firstValueFrom<T>(source: Node<T>): Promise<T>;
|
|
|
401
401
|
* @category extra
|
|
402
402
|
*/
|
|
403
403
|
declare function firstWhere<T>(source: Node<T>, predicate: (value: T) => boolean): Promise<T>;
|
|
404
|
+
declare function awaitSettled<T>(source: Node<T>, opts?: {
|
|
405
|
+
predicate?: (value: T) => boolean;
|
|
406
|
+
timeoutMs?: number;
|
|
407
|
+
}): Promise<NonNullable<T>>;
|
|
404
408
|
/**
|
|
405
409
|
* RxJS-named alias for {@link replay} — multicast with a replay buffer of size `bufferSize`.
|
|
406
410
|
*
|
|
@@ -462,4 +466,4 @@ type ReactiveCounterBundle = {
|
|
|
462
466
|
*/
|
|
463
467
|
declare function reactiveCounter(cap: number): ReactiveCounterBundle;
|
|
464
468
|
|
|
465
|
-
export { type AsyncSourceOpts, type EventTargetLike, type FromCronOptions, type NodeInput, type 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 };
|
|
469
|
+
export { type AsyncSourceOpts, type EventTargetLike, type FromCronOptions, type NodeInput, type 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 };
|
package/dist/extra/sources.js
CHANGED
|
@@ -1,57 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cached,
|
|
3
|
-
empty,
|
|
4
|
-
escapeRegexChar,
|
|
5
|
-
firstValueFrom,
|
|
6
|
-
firstWhere,
|
|
7
|
-
forEach,
|
|
8
|
-
fromAny,
|
|
9
|
-
fromAsyncIter,
|
|
10
|
-
fromCron,
|
|
11
|
-
fromEvent,
|
|
12
|
-
fromIter,
|
|
13
|
-
fromPromise,
|
|
14
|
-
fromRaf,
|
|
15
|
-
fromTimer,
|
|
16
|
-
globToRegExp,
|
|
17
|
-
keepalive,
|
|
18
|
-
matchesAnyPattern,
|
|
19
|
-
never,
|
|
20
|
-
of,
|
|
21
|
-
reactiveCounter,
|
|
22
|
-
replay,
|
|
23
|
-
share,
|
|
24
|
-
shareReplay,
|
|
25
|
-
throwError,
|
|
26
|
-
toArray
|
|
27
|
-
} from "../chunk-BVZYTZ5H.js";
|
|
28
|
-
import "../chunk-PHOUUNK7.js";
|
|
29
|
-
import "../chunk-SX52TAR4.js";
|
|
30
|
-
export {
|
|
31
|
-
cached,
|
|
32
|
-
empty,
|
|
33
|
-
escapeRegexChar,
|
|
34
|
-
firstValueFrom,
|
|
35
|
-
firstWhere,
|
|
36
|
-
forEach,
|
|
37
|
-
fromAny,
|
|
38
|
-
fromAsyncIter,
|
|
39
|
-
fromCron,
|
|
40
|
-
fromEvent,
|
|
41
|
-
fromIter,
|
|
42
|
-
fromPromise,
|
|
43
|
-
fromRaf,
|
|
44
|
-
fromTimer,
|
|
45
|
-
globToRegExp,
|
|
46
|
-
keepalive,
|
|
47
|
-
matchesAnyPattern,
|
|
48
|
-
never,
|
|
49
|
-
of,
|
|
50
|
-
reactiveCounter,
|
|
51
|
-
replay,
|
|
52
|
-
share,
|
|
53
|
-
shareReplay,
|
|
54
|
-
throwError,
|
|
55
|
-
toArray
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=sources.js.map
|
|
1
|
+
import{A as y,B as z,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-KASHOCF5.js";import"../chunk-W4TSQ6RJ.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{w as awaitSettled,t as cached,m as empty,a as escapeRegexChar,u as firstValueFrom,v as firstWhere,p 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,y as keepalive,c as matchesAnyPattern,n as never,l as of,z as reactiveCounter,s as replay,r as share,x as shareReplay,o as throwError,q as toArray};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var K=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Oe=Object.prototype.hasOwnProperty;var Re=(n,e)=>{for(var t in e)K(n,t,{get:e[t],enumerable:!0})},Ce=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!Oe.call(n,r)&&r!==t&&K(n,r,{get:()=>e[r],enumerable:!(s=Se(e,r))||s.enumerable});return n};var Ie=n=>Ce(K({},"__esModule",{value:!0}),n);var Ze={};Re(Ze,{fromIDBRequest:()=>Ye,fromIDBTransaction:()=>Ke,indexedDbStorage:()=>Xe});module.exports=Ie(Ze);var G=Symbol.for("graphrefly/START"),_=Symbol.for("graphrefly/DATA"),k=Symbol.for("graphrefly/DIRTY"),E=Symbol.for("graphrefly/RESOLVED"),M=Symbol.for("graphrefly/INVALIDATE"),S=Symbol.for("graphrefly/PAUSE"),H=Symbol.for("graphrefly/RESUME"),N=Symbol.for("graphrefly/TEARDOWN"),v=Symbol.for("graphrefly/COMPLETE"),f=Symbol.for("graphrefly/ERROR"),D=Object.freeze([k]),J=Object.freeze([E]),Fe=Object.freeze([M]),X=Object.freeze([G]),Ge=Object.freeze([v]),He=Object.freeze([N]),Z=Object.freeze([D]),le=Object.freeze([J]),ce=Object.freeze([Fe]),ue=Object.freeze([Ge]),Q=Object.freeze([He]);var Le={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 fe(n){n.registerCodec(Le)}var Ve={type:"system",id:""};function B(n){if(n==null)return Ve;let{type:e,id:t,...s}=n;return{type:e??"system",id:t??"",...s}}var ee=0,Pe=!1,he=[],pe=[],ge=[],Be=[];function _e(){return ee>0||Pe}function ye(){return ee>0}function be(n){ee>0?Be.push(n):n()}function U(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?ge:l===4?pe:he).push(()=>n(e));return}let s=e.length,r=s,i=s,a=s,o=0;for(;o<s&&t(e[o][0])<3;)o++;for(r=o;o<s&&t(e[o][0])===3;)o++;for(i=o;o<s&&t(e[o][0])===4;)o++;a=o;let d=_e();if(r>0){let l=e.slice(0,r);n(l)}if(i>r){let l=e.slice(r,i);d?he.push(()=>n(l)):n(l)}if(a>i){let l=e.slice(i,a);d?pe.push(()=>n(l)):n(l)}if(s>a){let l=e.slice(a,s);d?ge.push(()=>n(l)):n(l)}}function me(){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;_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}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 ve(n){n.registerMessageType(G,{tier:0,wireCrossing:!1}),n.registerMessageType(k,{tier:1,wireCrossing:!1}),n.registerMessageType(M,{tier:1,wireCrossing:!1,metaPassthrough:!1}),n.registerMessageType(S,{tier:2,wireCrossing:!1}),n.registerMessageType(H,{tier:2,wireCrossing:!1}),n.registerMessageType(_,{tier:3,wireCrossing:!0}),n.registerMessageType(E,{tier:3,wireCrossing:!0}),n.registerMessageType(v,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(f,{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]),We=new TextEncoder;function je(n){let e=We.encode(n),t=e.length,s=t*8,r=t+9+63&-64,i=new Uint8Array(r);i.set(e),i[t]=128;let a=new DataView(i.buffer);a.setUint32(r-4,s>>>0,!1),a.setUint32(r-8,Math.floor(s/4294967296)>>>0,!1);let o=1779033703,d=3144134277,l=1013904242,c=2773480762,u=1359893119,h=2600822924,g=528734635,y=1541459225,A=new Uint32Array(64),m=(x,b)=>x>>>b|x<<32-b;for(let x=0;x<r;x+=64){for(let p=0;p<16;p++)A[p]=a.getUint32(x+p*4,!1);for(let p=16;p<64;p++){let I=A[p-15],F=A[p-2],P=m(I,7)^m(I,18)^I>>>3,Y=m(F,17)^m(F,19)^F>>>10;A[p]=A[p-16]+P+A[p-7]+Y>>>0}let b=o,R=d,C=l,$=c,T=u,L=h,V=g,q=y;for(let p=0;p<64;p++){let I=m(T,6)^m(T,11)^m(T,25),F=T&L^~T&V,P=q+I+F+Ue[p]+A[p]>>>0,Y=m(b,2)^m(b,13)^m(b,22),Ee=b&R^b&C^R&C,Me=Y+Ee>>>0;q=V,V=L,L=T,T=$+P>>>0,$=C,C=R,R=b,b=P+Me>>>0}o=o+b>>>0,d=d+R>>>0,l=l+C>>>0,c=c+$>>>0,u=u+T>>>0,h=h+L>>>0,g=g+V>>>0,y=y+q>>>0}let w=x=>x.toString(16).padStart(8,"0");return w(o)+w(d)+w(l)+w(c)+w(u)+w(h)+w(g)+w(y)}function ne(n){let e=te(n??null),t=JSON.stringify(e);return je(t).slice(0,16)}function ze(){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??ze();if(n===0)return{id:s,version:0};let i=(t?.hash??ne)(e);return{id:s,version:0,cid:i,prev:null}}function we(n,e,t){n.version+=1,"cid"in n&&(n.prev=n.cid,n.cid=t(e))}var xe=()=>{},Te=100;function Ne(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 $e=(n,e,t,s)=>{t.direction==="down-in"&&n._onDepMessage(t.depIndex,e)},qe=(n,e,t,s)=>{let r=n;if(r._status==="completed"||r._status==="errored")return;let i=r._cached,a=i===void 0?[X]:[X,[_,i]];r._status==="dirty"&&a.push(D),U(e,a,r._config.tierOf)},ie=new W({onMessage:$e,onSubscribe:qe});ve(ie);fe(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(Ne);let i={};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),i[o]=new n([],void 0,l)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let a=this;this._actions={emit(o){a._emit([[_,o]])},down(o){a._emit(j(o))},up(o){a._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 i=this._cached===void 0?void 0:this._cached,a=this._versioning,o=a?.id??t?.id,d=a?.version??0,l=se(e,i,{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=B(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=B(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,i))throw new O({actor:r,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(r,i))throw new O({actor:r,action:i,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:me()}}down(e,t){let s=j(e);s.length!==0&&(this._checkGuard(t),this._emit(s))}emit(e,t){this._checkGuard(t),this._emit([[_,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 i of this._deps)i.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=B(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 i;try{i=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 a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}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 i=="function"&&i(),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,i=this._deps[s];i.unsub=xe,i.unsub=i.node.subscribe(a=>{if(i.unsub===null)return;let o=this._config.tierOf,d=!1;for(let l of a)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 i=this._deps[r];if(i.unsub!=null){let a=i.unsub;i.unsub=null;try{a()}catch{}re(i)}}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=Ne(e);if(this._deps.push(s),this._sinks==null)return t;s.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Z),s.unsub=xe;try{s.unsub=e.subscribe(r=>{if(s.unsub===null)return;let i=this._config.tierOf,a=!1;for(let o of r)i(o[0])>=3&&(a=!0),this._config.onMessage(this,o,{direction:"down-in",depIndex:t},this._actions);a&&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([[f,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([[f,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 i={kind:"dep_message",depIndex:e,message:t};for(let a of this._inspectorHooks)a(i)}if(r!==G){if(r===k){this._depDirtied(s);return}if(r===M){this._depInvalidated(s),this._emit(ce);return}if(r===S||r===H){this._emit([t]);return}if(r===N){this._emit(Q);return}if(r===_)this._depSettledAsData(s,t[1]);else if(r===E)this._depSettledAsResolved(s);else if(r===v)this._depSettledAsTerminal(s,!0);else if(r===f)this._depSettledAsTerminal(s,t[1]);else{this._emit([t]);return}if(!this._fn){(r===_||r===E)&&this._emit([t]),(r===v||r===f)&&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(le),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([[f,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(ue)}_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(a){this._emit([[f,this._wrapFnError("cleanup threw",a)]]);return}}else if(e!=null&&typeof e=="object"){let a=e.beforeRun;if(typeof a=="function"){e.beforeRun=void 0;try{a()}catch(o){this._emit([[f,this._wrapFnError("cleanup.beforeRun threw",o)]]);return}}}let t=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),s=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let o=t[a];o!=null&&o.length>0&&(this._deps[a].prevData=o[o.length-1])}let r=this._deps.map(a=>a.terminal),i={prevData:s,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:t,prevData:s};for(let o of this._inspectorHooks)o(a)}this._isExecutingFn=!0;try{let a=this._fn(t,this._actions,i);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let o=a;(typeof o.beforeRun=="function"||typeof o.deactivate=="function"||typeof o.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[f,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Te?(this._rerunDepth=0,this._emit([[f,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"?[D,e[0]]:e;let s=!0,r=!1,i=!1,a=-1;for(let d of e){let l=t(d[0]);l<a&&(s=!1),l===3&&(r=!0),d[0]===k&&(i=!0),a=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&&!i&&this._status!=="dirty"){let d=0;for(;d<o.length&&t(o[d][0])===0;)d++;return d===0?[D,...o]:[...o.slice(0,d),D,...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]===f&&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!==S&&l!==H){r?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${l===S?"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 u=d[1];if(l===S)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(u),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(u))c=!1;else if(this._pauseLocks.delete(u),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let h=this._pauseBuffer;this._pauseBuffer=[],this._emit(h)}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:i,equalsError:a}=this._updateState(t);if(i.length>0&&this._config.inspectorEnabled){let o=this._config.globalInspector;if(o!=null)try{o({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let o=this._config.tierOf,d=[];for(let l of i)o(l[0])===3?this._pauseBuffer.push(l):d.push(l);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(i);a!=null&&this._emit([[f,a]])}_updateState(e){let t=this._config.tierOf,s,r,i=-1,a=0;for(let c of e)t(c[0])===3&&a++;let o=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===_){d=c;break}}for(let c=0;c<e.length;c++){let u=e[c],h=u[0];if(h===_){if(u.length>=2){let g=!1;if(o&&this._cached!==void 0)try{g=this._equals(this._cached,u[1])}catch(y){r=this._wrapFnError("equals threw",y),i=c;break}if(g){s==null&&(s=e.slice(0,c)),s.push(J),this._status="resolved";continue}this._cached=u[1],this._versioning!=null&&(d<0||c===d)&&we(this._versioning,u[1],this._hashFn)}this._status="settled",s?.push(u)}else if(s?.push(u),h===k)this._status="dirty";else if(h===E)this._status="resolved";else if(h===v)this._status="completed";else if(h===f)this._status="errored";else if(h===M){this._cached=void 0,this._status="dirty";let g=this._cleanup;if(typeof g=="function"){this._cleanup=void 0;try{g()}catch{}}else if(g!=null&&typeof g=="object"){let y=g.invalidate;if(typeof y=="function")try{y()}catch{}}}else h===N&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let l=i>=0?s??e.slice(0,i):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(ye()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],be(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}U(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);U(this._deliverToSinks,t,this._config.tierOf)}},Ae=n=>Array.isArray(n),oe=n=>typeof n=="object"&&n!=null&&!Array.isArray(n);function ke(n,e,t){let s=Ae(n)?n:[],r=typeof n=="function"?n:typeof e=="function"?e:void 0,i={};return Ae(n)?i=(oe(e)?e:t)??{}:oe(n)?i=n:i=(oe(e)?e:t)??{},new z(s,r,i)}function ae(n,e){return ke((s,r,i)=>n(r,i)??void 0,{describeKind:"producer",...e})}function Ye(n){return ae(e=>{let t=!1,s=()=>{n.onsuccess=null,n.onerror=null};return n.onsuccess=()=>{t||(t=!0,s(),e.down([[_,n.result],[v]]))},n.onerror=()=>{t||(t=!0,s(),e.down([[f,n.error??new Error("IndexedDB request failed")]]))},()=>{t=!0,s()}})}function Ke(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([[_,void 0],[v]]))},n.onerror=()=>{t||(t=!0,s(),e.down([[f,n.error??new Error("IndexedDB transaction failed")]]))},n.onabort=()=>{t||(t=!0,s(),e.down([[f,n.error??new Error("IndexedDB transaction aborted")]]))},()=>{t=!0,s()}})}function Je(n,e,t){return new Promise((s,r)=>{if(typeof indexedDB>"u"){r(new TypeError("indexedDB is not available in this environment"));return}let i=indexedDB.open(n,t);i.onupgradeneeded=()=>{let a=i.result;a.objectStoreNames.contains(e)||a.createObjectStore(e)},i.onsuccess=()=>s(i.result),i.onerror=()=>r(i.error??new Error("IndexedDB open failed"))})}function de(n,e,t,s,r){return Je(n,e,t).then(i=>new Promise((a,o)=>{let d=i.transaction(e,s),l=d.objectStore(e),c=r(l),u,h=!1,g=!1,y=()=>{!h||!g||(i.close(),a(u))};c.onsuccess=()=>{u=c.result,h=!0,y()},c.onerror=()=>{i.close(),o(c.error??new Error("IndexedDB request failed"))},d.oncomplete=()=>{if(g=!0,!h){i.close(),o(new Error("IndexedDB transaction completed without request result"));return}y()},d.onerror=()=>{i.close(),o(d.error??new Error("IndexedDB transaction failed"))},d.onabort=()=>{i.close(),o(d.error??new Error("IndexedDB transaction aborted"))}}))}function Xe(n){let{dbName:e,storeName:t}=n,s=n.version??1,r=n.key??"graphrefly_checkpoint";return{async save(i,a){await de(e,t,s,"readwrite",o=>o.put(a,r))},async load(i){let a=await de(e,t,s,"readonly",o=>o.get(r));return a==null||typeof a!="object"||Array.isArray(a)?null:a},async clear(i){await de(e,t,s,"readwrite",a=>a.delete(r))}}}0&&(module.exports={fromIDBRequest,fromIDBTransaction,indexedDbStorage});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { a as Node } from '../node-Dd6wHSib.cjs';
|
|
2
|
+
import { StorageTier } from './storage-core.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Browser-only storage backend + IndexedDB reactive sources.
|
|
6
|
+
*
|
|
7
|
+
* `indexedDbStorage` provides async {@link StorageTier} semantics backed by
|
|
8
|
+
* IndexedDB; `fromIDBRequest` / `fromIDBTransaction` wrap raw IDB primitives
|
|
9
|
+
* as reactive sources. Imports require the DOM lib — not safe to pull into
|
|
10
|
+
* Node-only bundles without `lib: ["dom"]` in the consumer's tsconfig.
|
|
11
|
+
*
|
|
12
|
+
* The legacy `extra/storage.ts` barrel re-exports this module for back-compat;
|
|
13
|
+
* browser-first consumers should import from here directly.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
type IndexedDbStorageSpec = {
|
|
19
|
+
dbName: string;
|
|
20
|
+
storeName: string;
|
|
21
|
+
/** Object-store key under which snapshots are written. @default `"graphrefly_checkpoint"`. */
|
|
22
|
+
key?: string;
|
|
23
|
+
version?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Wraps an `IDBRequest` as a one-shot reactive source.
|
|
27
|
+
*
|
|
28
|
+
* @param req - Request whose callbacks are converted to protocol messages.
|
|
29
|
+
* @returns `Node<T>` that emits `DATA` once on success then `COMPLETE`;
|
|
30
|
+
* emits `ERROR` on failure.
|
|
31
|
+
*
|
|
32
|
+
* @category extra
|
|
33
|
+
*/
|
|
34
|
+
declare function fromIDBRequest<T>(req: IDBRequest<T>): Node<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Wraps an `IDBTransaction` terminal lifecycle as a one-shot reactive source.
|
|
37
|
+
*
|
|
38
|
+
* @param tx - Transaction to observe.
|
|
39
|
+
* @returns `Node<void>` that emits `DATA` (`undefined`) then `COMPLETE` on
|
|
40
|
+
* success; emits `ERROR` on `error`/`abort`.
|
|
41
|
+
*
|
|
42
|
+
* @category extra
|
|
43
|
+
*/
|
|
44
|
+
declare function fromIDBTransaction(tx: IDBTransaction): Node<void>;
|
|
45
|
+
/**
|
|
46
|
+
* IndexedDB-backed async storage tier (browser runtime).
|
|
47
|
+
*
|
|
48
|
+
* All three methods return `Promise`s — pairs naturally with a warm/cold
|
|
49
|
+
* cadence where async writes are debounced per tier via
|
|
50
|
+
* `Graph.attachStorage`. Writes use `readwrite` transactions; reads use
|
|
51
|
+
* `readonly`. Missing records resolve to `null`.
|
|
52
|
+
*
|
|
53
|
+
* @param spec - Database name, store name, optional `key` (default
|
|
54
|
+
* `"graphrefly_checkpoint"`) and schema `version` (default `1`).
|
|
55
|
+
* @returns Async {@link StorageTier}.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { indexedDbStorage, memoryStorage } from "@graphrefly/graphrefly-ts";
|
|
60
|
+
*
|
|
61
|
+
* graph.attachStorage([
|
|
62
|
+
* memoryStorage(),
|
|
63
|
+
* indexedDbStorage({ dbName: "myApp", storeName: "checkpoints" }),
|
|
64
|
+
* ]);
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @category extra
|
|
68
|
+
*/
|
|
69
|
+
declare function indexedDbStorage(spec: IndexedDbStorageSpec): StorageTier;
|
|
70
|
+
|
|
71
|
+
export { type IndexedDbStorageSpec, fromIDBRequest, fromIDBTransaction, indexedDbStorage };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { a as Node } from '../node-Dd6wHSib.js';
|
|
2
|
+
import { StorageTier } from './storage-core.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Browser-only storage backend + IndexedDB reactive sources.
|
|
6
|
+
*
|
|
7
|
+
* `indexedDbStorage` provides async {@link StorageTier} semantics backed by
|
|
8
|
+
* IndexedDB; `fromIDBRequest` / `fromIDBTransaction` wrap raw IDB primitives
|
|
9
|
+
* as reactive sources. Imports require the DOM lib — not safe to pull into
|
|
10
|
+
* Node-only bundles without `lib: ["dom"]` in the consumer's tsconfig.
|
|
11
|
+
*
|
|
12
|
+
* The legacy `extra/storage.ts` barrel re-exports this module for back-compat;
|
|
13
|
+
* browser-first consumers should import from here directly.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
type IndexedDbStorageSpec = {
|
|
19
|
+
dbName: string;
|
|
20
|
+
storeName: string;
|
|
21
|
+
/** Object-store key under which snapshots are written. @default `"graphrefly_checkpoint"`. */
|
|
22
|
+
key?: string;
|
|
23
|
+
version?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Wraps an `IDBRequest` as a one-shot reactive source.
|
|
27
|
+
*
|
|
28
|
+
* @param req - Request whose callbacks are converted to protocol messages.
|
|
29
|
+
* @returns `Node<T>` that emits `DATA` once on success then `COMPLETE`;
|
|
30
|
+
* emits `ERROR` on failure.
|
|
31
|
+
*
|
|
32
|
+
* @category extra
|
|
33
|
+
*/
|
|
34
|
+
declare function fromIDBRequest<T>(req: IDBRequest<T>): Node<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Wraps an `IDBTransaction` terminal lifecycle as a one-shot reactive source.
|
|
37
|
+
*
|
|
38
|
+
* @param tx - Transaction to observe.
|
|
39
|
+
* @returns `Node<void>` that emits `DATA` (`undefined`) then `COMPLETE` on
|
|
40
|
+
* success; emits `ERROR` on `error`/`abort`.
|
|
41
|
+
*
|
|
42
|
+
* @category extra
|
|
43
|
+
*/
|
|
44
|
+
declare function fromIDBTransaction(tx: IDBTransaction): Node<void>;
|
|
45
|
+
/**
|
|
46
|
+
* IndexedDB-backed async storage tier (browser runtime).
|
|
47
|
+
*
|
|
48
|
+
* All three methods return `Promise`s — pairs naturally with a warm/cold
|
|
49
|
+
* cadence where async writes are debounced per tier via
|
|
50
|
+
* `Graph.attachStorage`. Writes use `readwrite` transactions; reads use
|
|
51
|
+
* `readonly`. Missing records resolve to `null`.
|
|
52
|
+
*
|
|
53
|
+
* @param spec - Database name, store name, optional `key` (default
|
|
54
|
+
* `"graphrefly_checkpoint"`) and schema `version` (default `1`).
|
|
55
|
+
* @returns Async {@link StorageTier}.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { indexedDbStorage, memoryStorage } from "@graphrefly/graphrefly-ts";
|
|
60
|
+
*
|
|
61
|
+
* graph.attachStorage([
|
|
62
|
+
* memoryStorage(),
|
|
63
|
+
* indexedDbStorage({ dbName: "myApp", storeName: "checkpoints" }),
|
|
64
|
+
* ]);
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @category extra
|
|
68
|
+
*/
|
|
69
|
+
declare function indexedDbStorage(spec: IndexedDbStorageSpec): StorageTier;
|
|
70
|
+
|
|
71
|
+
export { type IndexedDbStorageSpec, fromIDBRequest, fromIDBTransaction, indexedDbStorage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"../chunk-7TDOES3L.js";import"../chunk-W4TSQ6RJ.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{a as fromIDBRequest,b as fromIDBTransaction,c as indexedDbStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var c=(n,r)=>{for(var e in r)s(n,e,{get:r[e],enumerable:!0})},g=(n,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of a(r))!d.call(n,t)&&t!==e&&s(n,t,{get:()=>r[t],enumerable:!(o=u(r,t))||o.enumerable});return n};var f=n=>g(s({},"__esModule",{value:!0}),n);var S={};c(S,{dictStorage:()=>l,memoryStorage:()=>y,sortJsonValue:()=>i,stableJsonString:()=>k});module.exports=f(S);function i(n){if(n===null||typeof n!="object")return n;if(Array.isArray(n))return n.map(i);let r=n,e=Object.keys(r).sort(),o={};for(let t of e)o[t]=i(r[t]);return o}function k(n){return JSON.stringify(i(n),void 0,0)}function y(){let n=new Map;return{save(r,e){n.set(r,JSON.parse(JSON.stringify(e)))},load(r){let e=n.get(r);return e===void 0?null:JSON.parse(JSON.stringify(e))},clear(r){n.delete(r)},list(){return[...n.keys()].sort()}}}function l(n){return{save(r,e){n[r]=JSON.parse(JSON.stringify(e))},load(r){let e=n[r];return e===void 0?null:JSON.parse(JSON.stringify(e))},clear(r){delete n[r]},list(){return Object.keys(n).sort()}}}0&&(module.exports={dictStorage,memoryStorage,sortJsonValue,stableJsonString});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage tier primitive — browser-safe core (types + in-memory backends).
|
|
3
|
+
*
|
|
4
|
+
* Split out of `extra/storage.ts` so browser bundles can import the
|
|
5
|
+
* {@link StorageTier} contract, {@link memoryStorage}, {@link dictStorage}
|
|
6
|
+
* and shared JSON helpers without pulling `node:fs` / `node:sqlite` /
|
|
7
|
+
* `node:crypto`. Node-only backends (`fileStorage`, `sqliteStorage`) live in
|
|
8
|
+
* {@link ./storage-node}; browser-only ones (`indexedDbStorage`,
|
|
9
|
+
* `fromIDBRequest`, `fromIDBTransaction`) live in {@link ./storage-browser}.
|
|
10
|
+
* The legacy `extra/storage.ts` module re-exports all three for back-compat.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Single persistence primitive — supports sync and async backends alike via
|
|
16
|
+
* `void | Promise<void>` returns. `debounceMs` / `compactEvery` / `filter`
|
|
17
|
+
* are per-tier cadence controls honored by `Graph.attachStorage`;
|
|
18
|
+
* `cascadingCache` ignores them (it has its own eviction policy).
|
|
19
|
+
*/
|
|
20
|
+
interface StorageTier {
|
|
21
|
+
/** Read a value. Returns `null` (or resolves to `null`) on miss. */
|
|
22
|
+
load(key: string): unknown | Promise<unknown>;
|
|
23
|
+
/** Write a record. Sync tiers return `void`; async tiers return `Promise<void>`. */
|
|
24
|
+
save(key: string, data: unknown): void | Promise<void>;
|
|
25
|
+
/** Delete a value. Optional — tiers without `clear` are append/overwrite-only. */
|
|
26
|
+
clear?(key: string): void | Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Enumerate known keys. Optional — tiers that only address a single record
|
|
29
|
+
* (e.g. `indexedDbStorage`) or that can't cheaply enumerate (e.g. a remote
|
|
30
|
+
* write-only sink) may omit it. Callers that require enumeration (the
|
|
31
|
+
* surface `snapshot.list()` helper, MCP `graphrefly_snapshot_list`, CLI
|
|
32
|
+
* `graphrefly snapshot list`) should check before calling.
|
|
33
|
+
*/
|
|
34
|
+
list?(): readonly string[] | Promise<readonly string[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Debounce saves on this tier (ms). Hot tier: `0` (sync-through).
|
|
37
|
+
* Warm: `1000`. Cold: `60000`. Each tier holds its own last-save baseline,
|
|
38
|
+
* so cold flushes aren't penalized by hot flushes.
|
|
39
|
+
*/
|
|
40
|
+
debounceMs?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Every Nth record is a full snapshot; others are diffs against this
|
|
43
|
+
* tier's own baseline. Default `10`. Set `1` for always-full;
|
|
44
|
+
* `Number.POSITIVE_INFINITY` is unsafe — WAL replay needs periodic anchors.
|
|
45
|
+
*/
|
|
46
|
+
compactEvery?: number;
|
|
47
|
+
/** Pre-save filter — return `false` to skip this record on this tier. */
|
|
48
|
+
filter?: (key: string, record: unknown) => boolean;
|
|
49
|
+
}
|
|
50
|
+
/** Handle returned by `Graph.attachStorage` — dispose to stop observing. */
|
|
51
|
+
interface StorageHandle {
|
|
52
|
+
dispose(): void;
|
|
53
|
+
}
|
|
54
|
+
/** Recursively sort object keys so `JSON.stringify` output is order-independent. */
|
|
55
|
+
declare function sortJsonValue(value: unknown): unknown;
|
|
56
|
+
/**
|
|
57
|
+
* Stable JSON encoding (no trailing newline). Tiers that want POSIX newline
|
|
58
|
+
* convention (e.g. `fileStorage`) append their own; in-database tiers
|
|
59
|
+
* (`sqliteStorage`) keep the payload byte-identical for cross-tier hash/CID
|
|
60
|
+
* comparison.
|
|
61
|
+
*/
|
|
62
|
+
declare function stableJsonString(data: unknown): string;
|
|
63
|
+
/**
|
|
64
|
+
* In-memory storage tier (process-local; useful for tests and hot tier).
|
|
65
|
+
*
|
|
66
|
+
* @returns Sync {@link StorageTier} with JSON-cloned isolation.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* import { memoryStorage } from "@graphrefly/graphrefly-ts";
|
|
71
|
+
*
|
|
72
|
+
* const hot = memoryStorage();
|
|
73
|
+
* graph.attachStorage([hot]);
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @category extra
|
|
77
|
+
*/
|
|
78
|
+
declare function memoryStorage(): StorageTier;
|
|
79
|
+
/**
|
|
80
|
+
* Dict-backed storage tier — stores JSON-cloned values under caller keys in
|
|
81
|
+
* a caller-owned plain object. Useful for embedding in a parent state shape.
|
|
82
|
+
*
|
|
83
|
+
* @param storage - Caller-owned object used as the backing store.
|
|
84
|
+
* @returns Sync {@link StorageTier}.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { dictStorage } from "@graphrefly/graphrefly-ts";
|
|
89
|
+
*
|
|
90
|
+
* const state: Record<string, unknown> = {};
|
|
91
|
+
* graph.attachStorage([dictStorage(state)]);
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @category extra
|
|
95
|
+
*/
|
|
96
|
+
declare function dictStorage(storage: Record<string, unknown>): StorageTier;
|
|
97
|
+
|
|
98
|
+
export { type StorageHandle, type StorageTier, dictStorage, memoryStorage, sortJsonValue, stableJsonString };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage tier primitive — browser-safe core (types + in-memory backends).
|
|
3
|
+
*
|
|
4
|
+
* Split out of `extra/storage.ts` so browser bundles can import the
|
|
5
|
+
* {@link StorageTier} contract, {@link memoryStorage}, {@link dictStorage}
|
|
6
|
+
* and shared JSON helpers without pulling `node:fs` / `node:sqlite` /
|
|
7
|
+
* `node:crypto`. Node-only backends (`fileStorage`, `sqliteStorage`) live in
|
|
8
|
+
* {@link ./storage-node}; browser-only ones (`indexedDbStorage`,
|
|
9
|
+
* `fromIDBRequest`, `fromIDBTransaction`) live in {@link ./storage-browser}.
|
|
10
|
+
* The legacy `extra/storage.ts` module re-exports all three for back-compat.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Single persistence primitive — supports sync and async backends alike via
|
|
16
|
+
* `void | Promise<void>` returns. `debounceMs` / `compactEvery` / `filter`
|
|
17
|
+
* are per-tier cadence controls honored by `Graph.attachStorage`;
|
|
18
|
+
* `cascadingCache` ignores them (it has its own eviction policy).
|
|
19
|
+
*/
|
|
20
|
+
interface StorageTier {
|
|
21
|
+
/** Read a value. Returns `null` (or resolves to `null`) on miss. */
|
|
22
|
+
load(key: string): unknown | Promise<unknown>;
|
|
23
|
+
/** Write a record. Sync tiers return `void`; async tiers return `Promise<void>`. */
|
|
24
|
+
save(key: string, data: unknown): void | Promise<void>;
|
|
25
|
+
/** Delete a value. Optional — tiers without `clear` are append/overwrite-only. */
|
|
26
|
+
clear?(key: string): void | Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Enumerate known keys. Optional — tiers that only address a single record
|
|
29
|
+
* (e.g. `indexedDbStorage`) or that can't cheaply enumerate (e.g. a remote
|
|
30
|
+
* write-only sink) may omit it. Callers that require enumeration (the
|
|
31
|
+
* surface `snapshot.list()` helper, MCP `graphrefly_snapshot_list`, CLI
|
|
32
|
+
* `graphrefly snapshot list`) should check before calling.
|
|
33
|
+
*/
|
|
34
|
+
list?(): readonly string[] | Promise<readonly string[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Debounce saves on this tier (ms). Hot tier: `0` (sync-through).
|
|
37
|
+
* Warm: `1000`. Cold: `60000`. Each tier holds its own last-save baseline,
|
|
38
|
+
* so cold flushes aren't penalized by hot flushes.
|
|
39
|
+
*/
|
|
40
|
+
debounceMs?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Every Nth record is a full snapshot; others are diffs against this
|
|
43
|
+
* tier's own baseline. Default `10`. Set `1` for always-full;
|
|
44
|
+
* `Number.POSITIVE_INFINITY` is unsafe — WAL replay needs periodic anchors.
|
|
45
|
+
*/
|
|
46
|
+
compactEvery?: number;
|
|
47
|
+
/** Pre-save filter — return `false` to skip this record on this tier. */
|
|
48
|
+
filter?: (key: string, record: unknown) => boolean;
|
|
49
|
+
}
|
|
50
|
+
/** Handle returned by `Graph.attachStorage` — dispose to stop observing. */
|
|
51
|
+
interface StorageHandle {
|
|
52
|
+
dispose(): void;
|
|
53
|
+
}
|
|
54
|
+
/** Recursively sort object keys so `JSON.stringify` output is order-independent. */
|
|
55
|
+
declare function sortJsonValue(value: unknown): unknown;
|
|
56
|
+
/**
|
|
57
|
+
* Stable JSON encoding (no trailing newline). Tiers that want POSIX newline
|
|
58
|
+
* convention (e.g. `fileStorage`) append their own; in-database tiers
|
|
59
|
+
* (`sqliteStorage`) keep the payload byte-identical for cross-tier hash/CID
|
|
60
|
+
* comparison.
|
|
61
|
+
*/
|
|
62
|
+
declare function stableJsonString(data: unknown): string;
|
|
63
|
+
/**
|
|
64
|
+
* In-memory storage tier (process-local; useful for tests and hot tier).
|
|
65
|
+
*
|
|
66
|
+
* @returns Sync {@link StorageTier} with JSON-cloned isolation.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* import { memoryStorage } from "@graphrefly/graphrefly-ts";
|
|
71
|
+
*
|
|
72
|
+
* const hot = memoryStorage();
|
|
73
|
+
* graph.attachStorage([hot]);
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @category extra
|
|
77
|
+
*/
|
|
78
|
+
declare function memoryStorage(): StorageTier;
|
|
79
|
+
/**
|
|
80
|
+
* Dict-backed storage tier — stores JSON-cloned values under caller keys in
|
|
81
|
+
* a caller-owned plain object. Useful for embedding in a parent state shape.
|
|
82
|
+
*
|
|
83
|
+
* @param storage - Caller-owned object used as the backing store.
|
|
84
|
+
* @returns Sync {@link StorageTier}.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { dictStorage } from "@graphrefly/graphrefly-ts";
|
|
89
|
+
*
|
|
90
|
+
* const state: Record<string, unknown> = {};
|
|
91
|
+
* graph.attachStorage([dictStorage(state)]);
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @category extra
|
|
95
|
+
*/
|
|
96
|
+
declare function dictStorage(storage: Record<string, unknown>): StorageTier;
|
|
97
|
+
|
|
98
|
+
export { type StorageHandle, type StorageTier, dictStorage, memoryStorage, sortJsonValue, stableJsonString };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"../chunk-I6VIH3VA.js";import"../chunk-QYADASLV.js";export{d as dictStorage,c as memoryStorage,a as sortJsonValue,b as stableJsonString};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var N=(n,e)=>{for(var o in e)g(n,o,{get:e[o],enumerable:!0})},O=(n,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!T.call(n,a)&&a!==o&&g(n,a,{get:()=>e[a],enumerable:!(r=E(e,a))||r.enumerable});return n};var b=n=>O(g({},"__esModule",{value:!0}),n);var J={};N(J,{fileStorage:()=>v,sqliteStorage:()=>x});module.exports=b(J);var k=require("node:crypto"),c=require("node:fs"),p=require("node:path"),h=require("node:sqlite");function y(n){if(n===null||typeof n!="object")return n;if(Array.isArray(n))return n.map(y);let e=n,o=Object.keys(e).sort(),r={};for(let a of o)r[a]=y(e[a]);return r}function S(n){return JSON.stringify(y(n),void 0,0)}function v(n){let e=new TextEncoder,o=new TextDecoder("utf-8",{fatal:!0}),r=s=>{let t="";for(let i of s){if(i.length===1&&/[a-zA-Z0-9_-]/.test(i)){t+=i;continue}for(let d of e.encode(i))t+=`%${d.toString(16).padStart(2,"0")}`}return(0,p.join)(n,`${t}.json`)},a=s=>{if(!s.endsWith(".json"))return null;let t=s.slice(0,-5),i=[],d=f=>{for(let u=0;u<f.length;u++)i.push(f.charCodeAt(u))},l=0;for(;l<t.length;){let f=t[l];if(f==="%"&&l+2<t.length){let u=t.slice(l+1,l+3);if(/^[0-9a-f]{2}$/i.test(u)){i.push(Number.parseInt(u,16)),l+=3;continue}}d(f),l+=1}try{return o.decode(new Uint8Array(i))}catch{return null}};return{save(s,t){(0,c.mkdirSync)(n,{recursive:!0});let i=r(s),d=`${S(t)}
|
|
2
|
+
`,l=(0,p.basename)(i),f=(0,p.dirname)(i),u=(0,p.join)(f,`.${l}.${(0,k.randomBytes)(8).toString("hex")}.tmp`);try{(0,c.writeFileSync)(u,d,"utf8"),(0,c.renameSync)(u,i)}catch(m){try{(0,c.unlinkSync)(u)}catch{}throw m}},load(s){try{let t=(0,c.readFileSync)(r(s),"utf8").trim();return t?JSON.parse(t):null}catch{return null}},clear(s){try{(0,c.unlinkSync)(r(s))}catch(t){if(t.code!=="ENOENT")throw t}},list(){try{let s=(0,c.readdirSync)(n),t=[];for(let i of s){if(i.startsWith("."))continue;let d=a(i);d!==null&&t.push(d)}return t.sort()}catch(s){if(s.code==="ENOENT")return[];throw s}}}}function x(n){let e=new h.DatabaseSync(n);return e.exec("CREATE TABLE IF NOT EXISTS graphrefly_checkpoint (k TEXT PRIMARY KEY, v TEXT NOT NULL)"),{save(o,r){let a=S(r);e.prepare("INSERT OR REPLACE INTO graphrefly_checkpoint (k, v) VALUES (?, ?)").run(o,a)},load(o){let r=e.prepare("SELECT v FROM graphrefly_checkpoint WHERE k = ?").get(o);return r===void 0||typeof r.v!="string"||r.v.trim()===""?null:JSON.parse(r.v)},clear(o){e.prepare("DELETE FROM graphrefly_checkpoint WHERE k = ?").run(o)},list(){return e.prepare("SELECT k FROM graphrefly_checkpoint ORDER BY k").all().map(r=>r.k)},close(){try{e.close()}catch{}}}}0&&(module.exports={fileStorage,sqliteStorage});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { StorageTier } from './storage-core.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Node-only storage backends — `fileStorage` (atomic per-key JSON files) and
|
|
5
|
+
* `sqliteStorage` (Node 22.5+ `node:sqlite`). Imports `node:fs`, `node:path`,
|
|
6
|
+
* `node:crypto`, `node:sqlite`.
|
|
7
|
+
*
|
|
8
|
+
* Browser-safe consumers should import {@link ./storage-core} instead; the
|
|
9
|
+
* legacy `extra/storage.ts` barrel re-exports this module for back-compat.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Atomic JSON file storage tier (one file per key in a directory, temp + rename).
|
|
16
|
+
*
|
|
17
|
+
* Keys are sanitized to filesystem-safe names (`[^a-zA-Z0-9_-]` → `%<hex>`).
|
|
18
|
+
* `load` returns `null` for missing files, empty files, or invalid JSON.
|
|
19
|
+
*
|
|
20
|
+
* @param dir - Directory where per-key JSON files are written.
|
|
21
|
+
* @returns Sync {@link StorageTier}.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { fileStorage, memoryStorage } from "@graphrefly/graphrefly-ts";
|
|
26
|
+
*
|
|
27
|
+
* graph.attachStorage([memoryStorage(), fileStorage("./checkpoints")]);
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @category extra
|
|
31
|
+
*/
|
|
32
|
+
declare function fileStorage(dir: string): StorageTier;
|
|
33
|
+
/**
|
|
34
|
+
* SQLite storage tier using Node.js `node:sqlite` ({@link DatabaseSync}).
|
|
35
|
+
*
|
|
36
|
+
* Returns a {@link StorageTier} extended with `close()` — the caller owns the
|
|
37
|
+
* connection and should close it when discarding the tier.
|
|
38
|
+
*
|
|
39
|
+
* **Runtime:** Requires Node 22.5+ with `node:sqlite` enabled.
|
|
40
|
+
*
|
|
41
|
+
* @param path - SQLite database file path.
|
|
42
|
+
* @returns Sync {@link StorageTier} with an idempotent `close()` method.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { sqliteStorage, memoryStorage } from "@graphrefly/graphrefly-ts";
|
|
47
|
+
*
|
|
48
|
+
* const cold = sqliteStorage("./graphs.sqlite");
|
|
49
|
+
* graph.attachStorage([memoryStorage(), cold]);
|
|
50
|
+
* // ... later, on shutdown:
|
|
51
|
+
* cold.close();
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @category extra
|
|
55
|
+
*/
|
|
56
|
+
declare function sqliteStorage(path: string): StorageTier & {
|
|
57
|
+
close(): void;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { fileStorage, sqliteStorage };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { StorageTier } from './storage-core.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Node-only storage backends — `fileStorage` (atomic per-key JSON files) and
|
|
5
|
+
* `sqliteStorage` (Node 22.5+ `node:sqlite`). Imports `node:fs`, `node:path`,
|
|
6
|
+
* `node:crypto`, `node:sqlite`.
|
|
7
|
+
*
|
|
8
|
+
* Browser-safe consumers should import {@link ./storage-core} instead; the
|
|
9
|
+
* legacy `extra/storage.ts` barrel re-exports this module for back-compat.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Atomic JSON file storage tier (one file per key in a directory, temp + rename).
|
|
16
|
+
*
|
|
17
|
+
* Keys are sanitized to filesystem-safe names (`[^a-zA-Z0-9_-]` → `%<hex>`).
|
|
18
|
+
* `load` returns `null` for missing files, empty files, or invalid JSON.
|
|
19
|
+
*
|
|
20
|
+
* @param dir - Directory where per-key JSON files are written.
|
|
21
|
+
* @returns Sync {@link StorageTier}.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { fileStorage, memoryStorage } from "@graphrefly/graphrefly-ts";
|
|
26
|
+
*
|
|
27
|
+
* graph.attachStorage([memoryStorage(), fileStorage("./checkpoints")]);
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @category extra
|
|
31
|
+
*/
|
|
32
|
+
declare function fileStorage(dir: string): StorageTier;
|
|
33
|
+
/**
|
|
34
|
+
* SQLite storage tier using Node.js `node:sqlite` ({@link DatabaseSync}).
|
|
35
|
+
*
|
|
36
|
+
* Returns a {@link StorageTier} extended with `close()` — the caller owns the
|
|
37
|
+
* connection and should close it when discarding the tier.
|
|
38
|
+
*
|
|
39
|
+
* **Runtime:** Requires Node 22.5+ with `node:sqlite` enabled.
|
|
40
|
+
*
|
|
41
|
+
* @param path - SQLite database file path.
|
|
42
|
+
* @returns Sync {@link StorageTier} with an idempotent `close()` method.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { sqliteStorage, memoryStorage } from "@graphrefly/graphrefly-ts";
|
|
47
|
+
*
|
|
48
|
+
* const cold = sqliteStorage("./graphs.sqlite");
|
|
49
|
+
* graph.attachStorage([memoryStorage(), cold]);
|
|
50
|
+
* // ... later, on shutdown:
|
|
51
|
+
* cold.close();
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @category extra
|
|
55
|
+
*/
|
|
56
|
+
declare function sqliteStorage(path: string): StorageTier & {
|
|
57
|
+
close(): void;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { fileStorage, sqliteStorage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"../chunk-3JXNEPCD.js";import"../chunk-I6VIH3VA.js";import"../chunk-QYADASLV.js";export{a as fileStorage,b as sqliteStorage};
|