@graphrefly/graphrefly 0.27.0 → 0.28.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-B-5zmAUv.d.cts +180 -0
- package/dist/cascading-D9WG1-9L.d.ts +180 -0
- package/dist/chunk-2FOAM3OR.js +1 -0
- package/dist/chunk-2PMCKKRK.js +1 -0
- package/dist/chunk-3JXNEPCD.js +2 -0
- package/dist/chunk-3R5HFPX7.js +78 -0
- package/dist/chunk-4GKB4OUJ.js +1 -0
- package/dist/chunk-4VVTGLXJ.js +1 -0
- package/dist/chunk-5QDBSZBV.js +1 -0
- package/dist/chunk-6QZNQS5B.js +1 -0
- package/dist/chunk-6V3SEX2I.js +1 -0
- package/dist/chunk-76A3HVQE.js +9 -0
- package/dist/chunk-7H6LGFUG.js +64 -0
- package/dist/chunk-CK2E7BTU.js +1 -0
- package/dist/chunk-CKCSDI7T.js +6 -0
- package/dist/chunk-CRXTH3SH.js +1 -0
- package/dist/chunk-CWLN3X3N.js +1 -0
- package/dist/chunk-D7A7DBE4.js +1 -0
- package/dist/chunk-DBGGMN3D.js +1 -0
- package/dist/chunk-DQA3UIQ2.js +1 -0
- package/dist/chunk-ERLIRFPA.js +1 -0
- package/dist/chunk-ESMPEKEV.js +1 -0
- package/dist/chunk-ETWTCCJI.js +1 -0
- package/dist/chunk-FNYWM6JC.js +1 -0
- package/dist/chunk-GHJJR5P4.js +1 -0
- package/dist/chunk-GPW2V3RE.js +1 -0
- package/dist/chunk-I6VIH3VA.js +1 -0
- package/dist/chunk-K2GNMCQT.js +1 -0
- package/dist/chunk-LBTDSCCO.js +3 -0
- package/dist/chunk-LQ3Y5NJS.js +1 -0
- package/dist/chunk-MIQTDPY4.js +5 -0
- package/dist/chunk-MTTAAPCK.js +1 -0
- package/dist/chunk-OAWLCNJJ.js +1 -0
- package/dist/chunk-OBKQQA5I.js +1 -0
- package/dist/chunk-OYHGKYQM.js +1 -0
- package/dist/chunk-PIOGHC63.js +1 -0
- package/dist/chunk-QWAPKG3O.js +2 -0
- package/dist/chunk-QYADASLV.js +1 -0
- package/dist/chunk-RHESUC3V.js +43 -0
- package/dist/chunk-S35VARIR.js +1 -0
- package/dist/chunk-SC3U7ETD.js +1 -0
- package/dist/chunk-U3AICJKU.js +1 -0
- package/dist/chunk-UMBIDLJ4.js +1 -0
- package/dist/chunk-UPHHLMHE.js +1 -0
- package/dist/chunk-UPXUCFMX.js +1 -0
- package/dist/chunk-UWJE5FQA.js +18 -0
- package/dist/chunk-V6YQICXZ.js +1 -0
- package/dist/chunk-VIMF6LGM.js +1 -0
- package/dist/chunk-VJLMUKOI.js +1 -0
- package/dist/chunk-VPYBOXVT.js +1 -0
- package/dist/chunk-VTPVOGHH.js +1 -0
- package/dist/chunk-WQ2BN6X6.js +1 -0
- package/dist/chunk-XAUNPIMX.js +1 -0
- package/dist/chunk-Y2EMPB3I.js +1 -0
- package/dist/chunk-Z4HDAS2Q.js +1 -0
- package/dist/chunk-ZB5EHBIO.js +1 -0
- package/dist/chunk-ZV2DXV5A.js +23 -0
- package/dist/compat/index.cjs +14 -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 +14 -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 +6 -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-B-xqw4Kk.d.cts +69 -0
- package/dist/composite-BhbKHbOS.d.ts +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 +23 -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 +6 -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-CCwGKLCm.d.ts → graph-BZGRXwOm.d.ts} +134 -31
- package/dist/{graph-DNCrvZSn.d.cts → graph-D48Qw9Cg.d.cts} +134 -31
- package/dist/index-8FSVk4Uf.d.ts +135 -0
- package/dist/index-9oDeHH2u.d.cts +291 -0
- package/dist/{messaging-XDoYablx.d.ts → index-B0c4cmIO.d.ts} +31 -93
- package/dist/{index-VdHQMPy1.d.ts → index-B1AmmSlb.d.ts} +1 -1
- package/dist/{index-VHqptjhu.d.cts → index-B2pwesl9.d.cts} +1 -1
- package/dist/index-BHvIquRZ.d.ts +1957 -0
- package/dist/{index-Dzk2hrlR.d.ts → index-BVHOrDwO.d.ts} +1 -1
- package/dist/{index-CxFrXH4m.d.ts → index-BWJV63ti.d.ts} +1 -1
- package/dist/{index-Xi3u0HCQ.d.cts → index-B_agccPe.d.cts} +1 -1
- package/dist/index-BgyGlizc.d.ts +163 -0
- package/dist/index-BpA5c4G9.d.ts +357 -0
- package/dist/index-BpIFjILY.d.cts +357 -0
- package/dist/{index-3lsddbbS.d.ts → index-Bqachn9_.d.ts} +1 -1
- package/dist/index-Btib9rsU.d.ts +607 -0
- package/dist/{index-wEn0eFe8.d.ts → index-BwM9BEkt.d.ts} +1 -1
- package/dist/index-BxJ86YZZ.d.cts +105 -0
- package/dist/{audit-DRlSzBu9.d.ts → index-C73n7lo-.d.cts} +27 -21
- package/dist/index-CEXXwWVH.d.cts +192 -0
- package/dist/index-CHEswufn.d.cts +163 -0
- package/dist/{index-C0svESO4.d.ts → index-CMn8S8Hw.d.ts} +1 -1
- package/dist/{index-ByQxazQJ.d.cts → index-CRO83MmV.d.cts} +1 -1
- package/dist/{index-BuEoe-Qu.d.ts → index-CloUk1kY.d.ts} +9 -9
- package/dist/index-CpgYhnrG.d.ts +291 -0
- package/dist/{index-DO_6JN9Z.d.cts → index-Cyojz0AE.d.cts} +1 -1
- package/dist/{demo-shell-BDkOptd6.d.ts → index-CzobVSMr.d.ts} +14 -14
- package/dist/index-Czq6ynh8.d.ts +143 -0
- package/dist/{index-BaSM3aYt.d.ts → index-D-YB-Vl3.d.ts} +3 -3
- package/dist/index-DAlweici.d.ts +231 -0
- package/dist/index-DEwTb_fm.d.cts +1957 -0
- package/dist/{index-DYme44FM.d.cts → index-DL-rYJrx.d.cts} +1 -1
- package/dist/{memory-li6FL5RM.d.ts → index-DP4ZTkdw.d.ts} +26 -26
- package/dist/{index-BwfLUNw4.d.ts → index-DUqMOlKZ.d.cts} +173 -2040
- package/dist/{index-B1tloyhO.d.cts → index-D_NwnRYS.d.cts} +1 -1
- package/dist/index-DaLJvH8Z.d.ts +105 -0
- package/dist/index-DcXZBF5a.d.cts +135 -0
- package/dist/index-DfyOkTvs.d.ts +321 -0
- package/dist/{index-B9B7_HEY.d.ts → index-DiOXyAwt.d.ts} +1 -1
- package/dist/index-DpHe5e0Q.d.ts +186 -0
- package/dist/index-DraikLjn.d.ts +86 -0
- package/dist/{index-D8wS_PeY.d.cts → index-DxsnAMWD.d.cts} +9 -9
- package/dist/{messaging-Gt4LPbyA.d.cts → index-DyxjtScX.d.cts} +31 -93
- package/dist/{audit-ClmqGOCx.d.cts → index-HDpJe9hX.d.ts} +27 -21
- package/dist/{index-DVGiGFGT.d.cts → index-O6TgGUBV.d.cts} +3 -3
- package/dist/{index-B6EhDnjH.d.cts → index-Oi8d8w4R.d.cts} +1 -1
- package/dist/{index-C8oil6M6.d.ts → index-ROpQmGjE.d.ts} +30 -6
- package/dist/index-RukJ4DLS.d.cts +607 -0
- package/dist/{index-BHlKbUwO.d.cts → index-ZftwfxJM.d.ts} +173 -2040
- package/dist/{index-BPVt8kqc.d.ts → index-cByzxQIC.d.cts} +10 -195
- package/dist/index-dtN7YA2x.d.cts +143 -0
- package/dist/{index-CI3DprxP.d.cts → index-fM6y00vT.d.cts} +30 -6
- package/dist/{index-DlLp-2Xn.d.cts → index-m-yHof5p.d.ts} +10 -195
- package/dist/index-pXrDMpRO.d.cts +231 -0
- package/dist/index-rHJSKsU8.d.cts +186 -0
- package/dist/index-rX8HBM5h.d.cts +321 -0
- package/dist/{index-CO8uBlUh.d.cts → index-rnwQly8X.d.cts} +147 -20
- package/dist/index-sm373fsH.d.ts +192 -0
- package/dist/{memory-C6Z2tGpC.d.cts → index-tbf2gKHd.d.cts} +26 -26
- package/dist/{demo-shell-Crid1WdR.d.cts → index-u15meRxL.d.cts} +14 -14
- package/dist/{index-B6D3QNSA.d.ts → index-umtoWT8K.d.ts} +147 -20
- package/dist/index-vscRDkjW.d.cts +86 -0
- package/dist/index.cjs +150 -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-Cgj6zeji.d.cts} +5 -5
- package/dist/{meta-BxCA7rcr.d.cts → meta-CwesDrMD.d.ts} +5 -5
- package/dist/{node-BmerH3kS.d.cts → node-Cc1TniY8.d.cts} +36 -9
- package/dist/{node-BmerH3kS.d.ts → node-Cc1TniY8.d.ts} +36 -9
- package/dist/{observable-BgGUwcqp.d.ts → observable-Ct-gJ9jI.d.ts} +1 -1
- package/dist/{observable-DJt_AxzQ.d.cts → observable-glXQoGj2.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 +91 -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 +6 -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 +6 -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 +7 -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 +6 -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 +83 -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 +6 -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 +48 -0
- package/dist/patterns/harness/index.d.cts +8 -0
- package/dist/patterns/harness/index.d.ts +8 -0
- package/dist/patterns/harness/index.js +1 -0
- package/dist/patterns/job-queue/index.cjs +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +7 -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 +6 -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 +8 -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 +14 -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-MQP--J3F.d.cts → reactive-layout-CpYb5qLP.d.cts} +2 -2
- package/dist/{reactive-layout-u5Ulnqag.d.ts → reactive-layout-D8u4wuUR.d.ts} +2 -2
- package/dist/reactive-log-DPzuUDj5.d.cts +190 -0
- package/dist/reactive-log-YuH9VYN8.d.ts +190 -0
- package/dist/{composite-aUCvjZVR.d.ts → reactive-map-CdbNoSgP.d.ts} +2 -67
- package/dist/{composite-C7PcQvcs.d.cts → reactive-map-DUeRmb9d.d.cts} +2 -67
- package/dist/resilience-Ba5-b4WD.d.cts +493 -0
- package/dist/resilience-CGRzhnD3.d.ts +493 -0
- package/dist/resilience-QAHKANT5.js +1 -0
- package/dist/{sugar-D02n5JjF.d.cts → sugar-BV0htudb.d.cts} +8 -4
- package/dist/{sugar-CCOxXK1e.d.ts → sugar-Dtyrq2_q.d.ts} +8 -4
- package/dist/topology-tree-CYHOwQZ_.d.ts +25 -0
- package/dist/topology-tree-DROUdq5B.d.cts +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/chunk-N6UR7YVY.js
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
batch,
|
|
3
|
-
dynamicNode,
|
|
4
|
-
state
|
|
5
|
-
} from "./chunk-PHOUUNK7.js";
|
|
6
|
-
import {
|
|
7
|
-
DATA,
|
|
8
|
-
ERROR,
|
|
9
|
-
__export
|
|
10
|
-
} from "./chunk-SX52TAR4.js";
|
|
11
|
-
|
|
12
|
-
// src/compat/nanostores/index.ts
|
|
13
|
-
var nanostores_exports = {};
|
|
14
|
-
__export(nanostores_exports, {
|
|
15
|
-
action: () => action,
|
|
16
|
-
atom: () => atom,
|
|
17
|
-
computed: () => computed,
|
|
18
|
-
getValue: () => getValue,
|
|
19
|
-
map: () => map,
|
|
20
|
-
onMount: () => onMount,
|
|
21
|
-
onStart: () => onStart,
|
|
22
|
-
onStop: () => onStop
|
|
23
|
-
});
|
|
24
|
-
var START_LISTENERS = /* @__PURE__ */ new WeakMap();
|
|
25
|
-
var STOP_LISTENERS = /* @__PURE__ */ new WeakMap();
|
|
26
|
-
function trigger(node, map2) {
|
|
27
|
-
const callbacks = map2.get(node);
|
|
28
|
-
if (callbacks) {
|
|
29
|
-
for (const cb of callbacks) cb();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function createStore(node, extra = {}) {
|
|
33
|
-
let listeners = 0;
|
|
34
|
-
const store = {
|
|
35
|
-
...extra,
|
|
36
|
-
get: () => getVal(node),
|
|
37
|
-
subscribe: (cb) => {
|
|
38
|
-
if (listeners === 0) trigger(node, START_LISTENERS);
|
|
39
|
-
listeners++;
|
|
40
|
-
const sub = node.subscribe((msgs) => {
|
|
41
|
-
for (const [t, v] of msgs) {
|
|
42
|
-
if (t === DATA) cb(v);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
return () => {
|
|
46
|
-
sub();
|
|
47
|
-
listeners--;
|
|
48
|
-
if (listeners === 0) trigger(node, STOP_LISTENERS);
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
listen: (cb) => {
|
|
52
|
-
if (listeners === 0) trigger(node, START_LISTENERS);
|
|
53
|
-
listeners++;
|
|
54
|
-
let initial = true;
|
|
55
|
-
const sub = node.subscribe((msgs) => {
|
|
56
|
-
for (const [t, v] of msgs) {
|
|
57
|
-
if (t === DATA) {
|
|
58
|
-
if (initial) {
|
|
59
|
-
initial = false;
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
cb(v);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
return () => {
|
|
67
|
-
sub();
|
|
68
|
-
listeners--;
|
|
69
|
-
if (listeners === 0) trigger(node, STOP_LISTENERS);
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
_node: node
|
|
73
|
-
};
|
|
74
|
-
return store;
|
|
75
|
-
}
|
|
76
|
-
function pull(n) {
|
|
77
|
-
let val = n.cache;
|
|
78
|
-
let err;
|
|
79
|
-
const unsub = n.subscribe((msgs) => {
|
|
80
|
-
for (const [t, v] of msgs) {
|
|
81
|
-
if (t === DATA) val = v;
|
|
82
|
-
if (t === ERROR) err = v;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
unsub();
|
|
86
|
-
if (err) throw err;
|
|
87
|
-
return val;
|
|
88
|
-
}
|
|
89
|
-
function getVal(n) {
|
|
90
|
-
if (n.status === "sentinel") {
|
|
91
|
-
return pull(n);
|
|
92
|
-
}
|
|
93
|
-
return n.cache;
|
|
94
|
-
}
|
|
95
|
-
function atom(initial) {
|
|
96
|
-
const n = state(initial, {
|
|
97
|
-
resubscribable: true,
|
|
98
|
-
resetOnTeardown: true
|
|
99
|
-
});
|
|
100
|
-
return createStore(n, {
|
|
101
|
-
// `n.emit` routes through the framed pipeline: `bundle()` auto-
|
|
102
|
-
// prefixes `[DIRTY]` (diamond-safe wave coordination) and the
|
|
103
|
-
// node's `equals` (default `Object.is`) folds same-value writes
|
|
104
|
-
// into `RESOLVED`. Matches nanostores' documented Object.is
|
|
105
|
-
// dedup semantics without any custom check.
|
|
106
|
-
set: (value) => n.emit(value)
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function computed(stores, fn) {
|
|
110
|
-
const storeArray = Array.isArray(stores) ? stores : [stores];
|
|
111
|
-
const depNodes = storeArray.map((s) => s._node);
|
|
112
|
-
const n = dynamicNode(
|
|
113
|
-
depNodes,
|
|
114
|
-
(track) => {
|
|
115
|
-
const vals = storeArray.map((s) => {
|
|
116
|
-
const node = s._node;
|
|
117
|
-
if (node.status === "sentinel") {
|
|
118
|
-
pull(node);
|
|
119
|
-
}
|
|
120
|
-
return track(node);
|
|
121
|
-
});
|
|
122
|
-
return fn(...vals);
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
resubscribable: true,
|
|
126
|
-
resetOnTeardown: true,
|
|
127
|
-
equals: Object.is
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
return createStore(n);
|
|
131
|
-
}
|
|
132
|
-
function map(initial) {
|
|
133
|
-
const n = state(initial, {
|
|
134
|
-
resubscribable: true,
|
|
135
|
-
resetOnTeardown: true,
|
|
136
|
-
equals: () => false
|
|
137
|
-
});
|
|
138
|
-
return createStore(n, {
|
|
139
|
-
// `map`'s state node is configured with `equals: () => false`
|
|
140
|
-
// above, so every `emit` produces DATA (even for same-key same-
|
|
141
|
-
// value sets). The `emit` path is still required for diamond
|
|
142
|
-
// coordination (`[DIRTY]` auto-prefix via `bundle()`).
|
|
143
|
-
set: (value) => n.emit(value),
|
|
144
|
-
setKey: (key, value) => {
|
|
145
|
-
const current = getVal(n);
|
|
146
|
-
n.emit({ ...current, [key]: value });
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
function getValue(store) {
|
|
151
|
-
return store.get();
|
|
152
|
-
}
|
|
153
|
-
function onStart(store, cb) {
|
|
154
|
-
const node = store._node;
|
|
155
|
-
let callbacks = START_LISTENERS.get(node);
|
|
156
|
-
if (!callbacks) {
|
|
157
|
-
callbacks = /* @__PURE__ */ new Set();
|
|
158
|
-
START_LISTENERS.set(node, callbacks);
|
|
159
|
-
}
|
|
160
|
-
callbacks.add(cb);
|
|
161
|
-
}
|
|
162
|
-
function onStop(store, cb) {
|
|
163
|
-
const node = store._node;
|
|
164
|
-
let callbacks = STOP_LISTENERS.get(node);
|
|
165
|
-
if (!callbacks) {
|
|
166
|
-
callbacks = /* @__PURE__ */ new Set();
|
|
167
|
-
STOP_LISTENERS.set(node, callbacks);
|
|
168
|
-
}
|
|
169
|
-
callbacks.add(cb);
|
|
170
|
-
}
|
|
171
|
-
function onMount(store, cb) {
|
|
172
|
-
onStart(store, () => {
|
|
173
|
-
const stop = cb();
|
|
174
|
-
if (typeof stop === "function") onStop(store, stop);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
function action(_store, _name, fn) {
|
|
178
|
-
return (...args) => {
|
|
179
|
-
let result;
|
|
180
|
-
batch(() => {
|
|
181
|
-
result = fn(...args);
|
|
182
|
-
});
|
|
183
|
-
return result;
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export {
|
|
188
|
-
atom,
|
|
189
|
-
computed,
|
|
190
|
-
map,
|
|
191
|
-
getValue,
|
|
192
|
-
onStart,
|
|
193
|
-
onStop,
|
|
194
|
-
onMount,
|
|
195
|
-
action,
|
|
196
|
-
nanostores_exports
|
|
197
|
-
};
|
|
198
|
-
//# sourceMappingURL=chunk-N6UR7YVY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compat/nanostores/index.ts"],"sourcesContent":["import { batch } from \"../../core/batch.js\";\nimport { DATA, ERROR, type Messages } from \"../../core/messages.js\";\nimport type { Node } from \"../../core/node.js\";\nimport { dynamicNode, state, type TrackFn } from \"../../core/sugar.js\";\n\n/**\n * A Nanostores-compatible atom.\n *\n * @category compat\n */\nexport interface NanoAtom<T> {\n\t/** Get current value. */\n\tget(): T;\n\t/** Set a new value (writable atoms only). */\n\tset(value: T): void;\n\t/** Subscribe to value changes. Callback receives the new value.\n\t * Returns unsubscribe function. Called immediately with current value. */\n\tsubscribe(cb: (value: T) => void): () => void;\n\t/** Listen to value changes (no immediate call). Returns unsubscribe. */\n\tlisten(cb: (value: T) => void): () => void;\n\t/** The underlying GraphReFly node. */\n\treadonly _node: Node<T>;\n}\n\n/**\n * A Nanostores-compatible computed store.\n *\n * @category compat\n */\nexport interface NanoComputed<T> {\n\t/** Get current value. */\n\tget(): T;\n\t/** Subscribe to value changes. Called immediately with current value.\n\t * Returns unsubscribe function. */\n\tsubscribe(cb: (value: T) => void): () => void;\n\t/** Listen to value changes (no immediate call). Returns unsubscribe. */\n\tlisten(cb: (value: T) => void): () => void;\n\t/** The underlying GraphReFly node. */\n\treadonly _node: Node<T>;\n}\n\n/**\n * A Nanostores-compatible map.\n *\n * @category compat\n */\nexport interface NanoMap<T extends Record<string, unknown>> extends NanoAtom<T> {\n\t/** Set a single key. */\n\tsetKey<K extends keyof T>(key: K, value: T[K]): void;\n}\n\nconst START_LISTENERS = new WeakMap<Node<any>, Set<() => void>>();\nconst STOP_LISTENERS = new WeakMap<Node<any>, Set<() => void>>();\n\nfunction trigger(node: Node<any>, map: WeakMap<Node<any>, Set<() => void>>) {\n\tconst callbacks = map.get(node);\n\tif (callbacks) {\n\t\tfor (const cb of callbacks) cb();\n\t}\n}\n\nfunction createStore<T>(node: Node<T>, extra: any = {}): any {\n\tlet listeners = 0;\n\tconst store = {\n\t\t...extra,\n\t\tget: () => getVal(node),\n\t\tsubscribe: (cb: (value: T) => void) => {\n\t\t\tif (listeners === 0) trigger(node, START_LISTENERS);\n\t\t\tlisteners++;\n\t\t\t// Push-on-subscribe delivers the initial value via DATA — no explicit cb() needed.\n\t\t\tconst sub = node.subscribe((msgs: Messages) => {\n\t\t\t\tfor (const [t, v] of msgs) {\n\t\t\t\t\tif (t === DATA) cb(v as T);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tsub();\n\t\t\t\tlisteners--;\n\t\t\t\tif (listeners === 0) trigger(node, STOP_LISTENERS);\n\t\t\t};\n\t\t},\n\t\tlisten: (cb: (value: T) => void) => {\n\t\t\tif (listeners === 0) trigger(node, START_LISTENERS);\n\t\t\tlisteners++;\n\t\t\t// Skip the initial push-on-subscribe DATA — listen() fires on changes only.\n\t\t\tlet initial = true;\n\t\t\tconst sub = node.subscribe((msgs: Messages) => {\n\t\t\t\tfor (const [t, v] of msgs) {\n\t\t\t\t\tif (t === DATA) {\n\t\t\t\t\t\tif (initial) {\n\t\t\t\t\t\t\tinitial = false;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcb(v as T);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tsub();\n\t\t\t\tlisteners--;\n\t\t\t\tif (listeners === 0) trigger(node, STOP_LISTENERS);\n\t\t\t};\n\t\t},\n\t\t_node: node,\n\t};\n\treturn store;\n}\n\nfunction pull<T>(n: Node<T>): T {\n\tlet val: T | undefined | null = n.cache;\n\tlet err: any;\n\tconst unsub = n.subscribe((msgs: Messages) => {\n\t\tfor (const [t, v] of msgs) {\n\t\t\tif (t === DATA) val = v as T;\n\t\t\tif (t === ERROR) err = v;\n\t\t}\n\t});\n\tunsub();\n\tif (err) throw err;\n\treturn val as T;\n}\n\nfunction getVal<T>(n: Node<T>): T {\n\tif (n.status === \"sentinel\") {\n\t\treturn pull(n);\n\t}\n\treturn n.cache as T;\n}\n\n/**\n * Creates a nanostores-compatible atom.\n *\n * @param initial - Initial value.\n * @returns `NanoAtom<T>`\n *\n * @category compat\n */\nexport function atom<T>(initial: T): NanoAtom<T> {\n\tconst n = state<T>(initial, {\n\t\tresubscribable: true,\n\t\tresetOnTeardown: true,\n\t});\n\n\treturn createStore(n, {\n\t\t// `n.emit` routes through the framed pipeline: `bundle()` auto-\n\t\t// prefixes `[DIRTY]` (diamond-safe wave coordination) and the\n\t\t// node's `equals` (default `Object.is`) folds same-value writes\n\t\t// into `RESOLVED`. Matches nanostores' documented Object.is\n\t\t// dedup semantics without any custom check.\n\t\tset: (value: T) => n.emit(value),\n\t});\n}\n\n/**\n * Creates a nanostores-compatible computed store.\n *\n * @param stores - One or more atoms/computed stores.\n * @param fn - Compute function.\n * @returns `NanoComputed<T>`\n *\n * @category compat\n */\nexport function computed<T, A>(\n\tstoreA: NanoAtom<A> | NanoComputed<A>,\n\tfn: (a: A) => T,\n): NanoComputed<T>;\nexport function computed<T, A, B>(\n\tstores: [NanoAtom<A> | NanoComputed<A>, NanoAtom<B> | NanoComputed<B>],\n\tfn: (a: A, b: B) => T,\n): NanoComputed<T>;\nexport function computed<T, A, B, C>(\n\tstores: [\n\t\tNanoAtom<A> | NanoComputed<A>,\n\t\tNanoAtom<B> | NanoComputed<B>,\n\t\tNanoAtom<C> | NanoComputed<C>,\n\t],\n\tfn: (a: A, b: B, c: C) => T,\n): NanoComputed<T>;\nexport function computed<T>(stores: any, fn: (...args: any[]) => T): NanoComputed<T> {\n\tconst storeArray: Array<NanoAtom<any> | NanoComputed<any>> = Array.isArray(stores)\n\t\t? stores\n\t\t: [stores];\n\n\tconst depNodes = storeArray.map((s) => s._node);\n\tconst n = dynamicNode(\n\t\tdepNodes,\n\t\t(track: TrackFn) => {\n\t\t\tconst vals = storeArray.map((s) => {\n\t\t\t\tconst node = s._node;\n\t\t\t\tif (node.status === \"sentinel\") {\n\t\t\t\t\tpull(node);\n\t\t\t\t}\n\t\t\t\treturn track(node);\n\t\t\t});\n\t\t\treturn fn(...vals);\n\t\t},\n\t\t{\n\t\t\tresubscribable: true,\n\t\t\tresetOnTeardown: true,\n\t\t\tequals: Object.is as any,\n\t\t},\n\t);\n\n\treturn createStore(n);\n}\n\n/**\n * Creates a nanostores-compatible map.\n *\n * @param initial - Initial object value.\n * @returns `NanoMap<T>`\n *\n * @category compat\n */\nexport function map<T extends Record<string, unknown>>(initial: T): NanoMap<T> {\n\tconst n = state<T>(initial, {\n\t\tresubscribable: true,\n\t\tresetOnTeardown: true,\n\t\tequals: () => false,\n\t});\n\n\treturn createStore(n, {\n\t\t// `map`'s state node is configured with `equals: () => false`\n\t\t// above, so every `emit` produces DATA (even for same-key same-\n\t\t// value sets). The `emit` path is still required for diamond\n\t\t// coordination (`[DIRTY]` auto-prefix via `bundle()`).\n\t\tset: (value: T) => n.emit(value),\n\t\tsetKey: <K extends keyof T>(key: K, value: T[K]) => {\n\t\t\tconst current = getVal(n);\n\t\t\tn.emit({ ...current, [key]: value });\n\t\t},\n\t});\n}\n\n/**\n * Returns the current value of the store.\n *\n * @category compat\n */\nexport function getValue<T>(store: NanoAtom<T> | NanoComputed<T>): T {\n\treturn store.get();\n}\n\n/**\n * Adds a listener for the store start (first listener connected).\n *\n * @category compat\n */\nexport function onStart(store: NanoAtom<any> | NanoComputed<any>, cb: () => void): void {\n\tconst node = store._node;\n\tlet callbacks = START_LISTENERS.get(node);\n\tif (!callbacks) {\n\t\tcallbacks = new Set();\n\t\tSTART_LISTENERS.set(node, callbacks);\n\t}\n\tcallbacks.add(cb);\n}\n\n/**\n * Adds a listener for the store stop (last listener disconnected).\n *\n * @category compat\n */\nexport function onStop(store: NanoAtom<any> | NanoComputed<any>, cb: () => void): void {\n\tconst node = store._node;\n\tlet callbacks = STOP_LISTENERS.get(node);\n\tif (!callbacks) {\n\t\tcallbacks = new Set();\n\t\tSTOP_LISTENERS.set(node, callbacks);\n\t}\n\tcallbacks.add(cb);\n}\n\n/**\n * Adds a listener for the store mount (first listener connected).\n *\n * @returns A cleanup function called when the last listener is removed.\n * @category compat\n */\nexport function onMount(\n\tstore: NanoAtom<any> | NanoComputed<any>,\n\tcb: () => (() => void) | undefined,\n): void {\n\tonStart(store, () => {\n\t\tconst stop = cb();\n\t\tif (typeof stop === \"function\") onStop(store, stop);\n\t});\n}\n\n/**\n * Batches multiple store updates.\n *\n * @category compat\n */\nexport function action<Args extends any[], Return>(\n\t_store: NanoAtom<any> | NanoComputed<any>,\n\t_name: string,\n\tfn: (...args: Args) => Return,\n): (...args: Args) => Return {\n\treturn (...args: Args) => {\n\t\tlet result: any;\n\t\tbatch(() => {\n\t\t\tresult = fn(...args);\n\t\t});\n\t\treturn result as Return;\n\t};\n}\n"],"mappings":"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","names":["map"]}
|
package/dist/chunk-NC6S43JJ.js
DELETED
|
@@ -1,456 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TopicGraph
|
|
3
|
-
} from "./chunk-X5R3GL6H.js";
|
|
4
|
-
import {
|
|
5
|
-
domainMeta
|
|
6
|
-
} from "./chunk-JSCT3CR4.js";
|
|
7
|
-
import {
|
|
8
|
-
reactiveLog
|
|
9
|
-
} from "./chunk-J2VBW3DZ.js";
|
|
10
|
-
import {
|
|
11
|
-
keepalive
|
|
12
|
-
} from "./chunk-BVZYTZ5H.js";
|
|
13
|
-
import {
|
|
14
|
-
watchTopologyTree
|
|
15
|
-
} from "./chunk-OU5CQKNW.js";
|
|
16
|
-
import {
|
|
17
|
-
Graph
|
|
18
|
-
} from "./chunk-PF7GRZMW.js";
|
|
19
|
-
import {
|
|
20
|
-
NodeImpl,
|
|
21
|
-
defaultHash,
|
|
22
|
-
derived,
|
|
23
|
-
monotonicNs,
|
|
24
|
-
policyFromRules,
|
|
25
|
-
state,
|
|
26
|
-
wallClockNs
|
|
27
|
-
} from "./chunk-PHOUUNK7.js";
|
|
28
|
-
import {
|
|
29
|
-
DATA,
|
|
30
|
-
__export
|
|
31
|
-
} from "./chunk-SX52TAR4.js";
|
|
32
|
-
|
|
33
|
-
// src/patterns/audit.ts
|
|
34
|
-
var audit_exports = {};
|
|
35
|
-
__export(audit_exports, {
|
|
36
|
-
AuditTrailGraph: () => AuditTrailGraph,
|
|
37
|
-
PolicyEnforcerGraph: () => PolicyEnforcerGraph,
|
|
38
|
-
auditTrail: () => auditTrail,
|
|
39
|
-
complianceSnapshot: () => complianceSnapshot,
|
|
40
|
-
policyEnforcer: () => policyEnforcer,
|
|
41
|
-
reactiveExplainPath: () => reactiveExplainPath
|
|
42
|
-
});
|
|
43
|
-
function auditMeta(kind, extra) {
|
|
44
|
-
return domainMeta("audit", kind, extra);
|
|
45
|
-
}
|
|
46
|
-
var DEFAULT_INCLUDE_TYPES = /* @__PURE__ */ new Set([
|
|
47
|
-
"data",
|
|
48
|
-
"error",
|
|
49
|
-
"complete",
|
|
50
|
-
"teardown"
|
|
51
|
-
]);
|
|
52
|
-
var AuditTrailGraph = class extends Graph {
|
|
53
|
-
entries;
|
|
54
|
-
count;
|
|
55
|
-
_log;
|
|
56
|
-
_target;
|
|
57
|
-
constructor(target, opts) {
|
|
58
|
-
super(opts.name ?? `${target.name}_audit`, opts.graph);
|
|
59
|
-
this._target = target;
|
|
60
|
-
this._log = reactiveLog([], {
|
|
61
|
-
name: "entries",
|
|
62
|
-
...opts.maxSize != null ? { maxSize: opts.maxSize } : {}
|
|
63
|
-
});
|
|
64
|
-
this.entries = this._log.entries;
|
|
65
|
-
this.add("entries", this.entries);
|
|
66
|
-
this.count = derived(
|
|
67
|
-
[this.entries],
|
|
68
|
-
([snapshot]) => snapshot.length,
|
|
69
|
-
{ name: "count", describeKind: "derived", meta: auditMeta("count") }
|
|
70
|
-
);
|
|
71
|
-
this.add("count", this.count);
|
|
72
|
-
this.addDisposer(keepalive(this.count));
|
|
73
|
-
const includeTypes = opts.includeTypes != null ? new Set(opts.includeTypes) : DEFAULT_INCLUDE_TYPES;
|
|
74
|
-
const filter = opts.filter;
|
|
75
|
-
let seq = 0;
|
|
76
|
-
const handle = target.observe({ timeline: true, structured: true });
|
|
77
|
-
const offEvent = handle.onEvent((event) => {
|
|
78
|
-
if (event.type === "derived") return;
|
|
79
|
-
const type = event.type;
|
|
80
|
-
if (!includeTypes.has(type)) return;
|
|
81
|
-
const path = event.path ?? "";
|
|
82
|
-
const entry = {
|
|
83
|
-
seq: seq++,
|
|
84
|
-
timestamp_ns: event.timestamp_ns ?? monotonicNs(),
|
|
85
|
-
wall_clock_ns: wallClockNs(),
|
|
86
|
-
path,
|
|
87
|
-
type
|
|
88
|
-
};
|
|
89
|
-
const node = path ? safeNode(target, path) : void 0;
|
|
90
|
-
const lastMutation = node?.lastMutation;
|
|
91
|
-
if (lastMutation != null) entry.actor = lastMutation.actor;
|
|
92
|
-
if (type === "data") entry.value = event.data;
|
|
93
|
-
if (type === "error") entry.error = event.data;
|
|
94
|
-
const reason = path ? safeAnnotation(target, path) : void 0;
|
|
95
|
-
if (reason != null) entry.reason = reason;
|
|
96
|
-
if (filter != null && !filter(entry)) return;
|
|
97
|
-
this._log.append(entry);
|
|
98
|
-
});
|
|
99
|
-
this.addDisposer(() => {
|
|
100
|
-
offEvent();
|
|
101
|
-
handle.dispose();
|
|
102
|
-
});
|
|
103
|
-
this.addDisposer(() => this._log.disposeAllViews());
|
|
104
|
-
}
|
|
105
|
-
/** All entries currently in the ring (snapshot). */
|
|
106
|
-
all() {
|
|
107
|
-
return this.entries.cache ?? [];
|
|
108
|
-
}
|
|
109
|
-
/** Entries matching `path`. Order preserved. */
|
|
110
|
-
byNode(path) {
|
|
111
|
-
return this.all().filter((e) => e.path === path);
|
|
112
|
-
}
|
|
113
|
-
/** Entries whose `actor.id` matches. Use `byActorType` for type filtering. */
|
|
114
|
-
byActor(actorId) {
|
|
115
|
-
return this.all().filter((e) => e.actor?.id === actorId);
|
|
116
|
-
}
|
|
117
|
-
/** Entries whose `actor.type` matches (e.g. `"llm"`, `"human"`). */
|
|
118
|
-
byActorType(type) {
|
|
119
|
-
return this.all().filter((e) => e.actor?.type === type);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Entries with `timestamp_ns` in `[start_ns, end_ns)` (end exclusive).
|
|
123
|
-
* Omit `end_ns` to query open-ended.
|
|
124
|
-
*/
|
|
125
|
-
byTimeRange(start_ns, end_ns) {
|
|
126
|
-
return this.all().filter((e) => {
|
|
127
|
-
if (e.timestamp_ns < start_ns) return false;
|
|
128
|
-
if (end_ns != null && e.timestamp_ns >= end_ns) return false;
|
|
129
|
-
return true;
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
/** Reference to the audited graph (escape hatch for tooling). */
|
|
133
|
-
get target() {
|
|
134
|
-
return this._target;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
function auditTrail(target, opts = {}) {
|
|
138
|
-
return new AuditTrailGraph(target, opts);
|
|
139
|
-
}
|
|
140
|
-
var PolicyEnforcerGraph = class extends Graph {
|
|
141
|
-
policies;
|
|
142
|
-
violations;
|
|
143
|
-
violationCount;
|
|
144
|
-
_target;
|
|
145
|
-
_mode;
|
|
146
|
-
_currentGuard;
|
|
147
|
-
constructor(target, policies, opts) {
|
|
148
|
-
super(opts.name ?? `${target.name}_policy`, opts.graph);
|
|
149
|
-
this._target = target;
|
|
150
|
-
this._mode = opts.mode ?? "audit";
|
|
151
|
-
const policiesNode = isNode(policies) ? policies : state(policies, { name: "policies" });
|
|
152
|
-
this.policies = policiesNode;
|
|
153
|
-
this.add("policies", this.policies);
|
|
154
|
-
this.violations = new TopicGraph("violations", {
|
|
155
|
-
retainedLimit: opts.violationsLimit ?? 1e3
|
|
156
|
-
});
|
|
157
|
-
this.mount("violations", this.violations);
|
|
158
|
-
this.violationCount = derived(
|
|
159
|
-
[this.violations.events],
|
|
160
|
-
([snapshot]) => snapshot.length,
|
|
161
|
-
{
|
|
162
|
-
name: "violationCount",
|
|
163
|
-
describeKind: "derived",
|
|
164
|
-
meta: auditMeta("policy_violation_count")
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
this.add("violationCount", this.violationCount);
|
|
168
|
-
this.addDisposer(keepalive(this.violationCount));
|
|
169
|
-
const initialRules = policiesNode.cache ?? [];
|
|
170
|
-
let latestRules = initialRules;
|
|
171
|
-
this._currentGuard = policyFromRules(latestRules);
|
|
172
|
-
const offPolicies = policiesNode.subscribe((msgs) => {
|
|
173
|
-
for (const m of msgs) {
|
|
174
|
-
if (m[0] === DATA) {
|
|
175
|
-
latestRules = m[1] ?? [];
|
|
176
|
-
this._currentGuard = policyFromRules(latestRules);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
this.addDisposer(offPolicies);
|
|
181
|
-
const paths = opts.paths != null ? [...opts.paths] : collectPaths(target);
|
|
182
|
-
if (this._mode === "enforce") {
|
|
183
|
-
const restorers = /* @__PURE__ */ new Map();
|
|
184
|
-
const wrapAndPush = (path) => {
|
|
185
|
-
if (restorers.has(path)) return;
|
|
186
|
-
const node = safeNode(target, path);
|
|
187
|
-
if (!(node instanceof NodeImpl)) return;
|
|
188
|
-
const pathGuard = (actor, action) => {
|
|
189
|
-
const ok = this._currentGuard(actor, action);
|
|
190
|
-
if (!ok) {
|
|
191
|
-
this._publishViolation(actor, action, path, "blocked");
|
|
192
|
-
}
|
|
193
|
-
return ok;
|
|
194
|
-
};
|
|
195
|
-
restorers.set(path, node._pushGuard(pathGuard));
|
|
196
|
-
};
|
|
197
|
-
for (const path of paths) wrapAndPush(path);
|
|
198
|
-
if (opts.paths == null) {
|
|
199
|
-
const offTopology = watchTopologyTree(target, (event, emitter, prefix) => {
|
|
200
|
-
if (event.kind === "added") {
|
|
201
|
-
if (event.nodeKind === "node") {
|
|
202
|
-
wrapAndPush(`${prefix}${event.name}`);
|
|
203
|
-
} else {
|
|
204
|
-
const child = emitter._mounts.get(event.name);
|
|
205
|
-
if (!(child instanceof Graph)) return;
|
|
206
|
-
const mountPrefix = `${prefix}${event.name}::`;
|
|
207
|
-
const localPaths = collectPaths(child);
|
|
208
|
-
for (const localPath of localPaths) {
|
|
209
|
-
wrapAndPush(
|
|
210
|
-
localPath === "" ? `${prefix}${event.name}` : `${mountPrefix}${localPath}`
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
} else if (event.kind === "removed") {
|
|
215
|
-
if (event.nodeKind === "node") {
|
|
216
|
-
const qp = `${prefix}${event.name}`;
|
|
217
|
-
const r = restorers.get(qp);
|
|
218
|
-
if (r != null) {
|
|
219
|
-
r();
|
|
220
|
-
restorers.delete(qp);
|
|
221
|
-
}
|
|
222
|
-
} else {
|
|
223
|
-
const mountQp = `${prefix}${event.name}`;
|
|
224
|
-
const mountPrefix = `${mountQp}::`;
|
|
225
|
-
for (const [p, r] of restorers) {
|
|
226
|
-
if (p === mountQp || p.startsWith(mountPrefix)) {
|
|
227
|
-
r();
|
|
228
|
-
restorers.delete(p);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
this.addDisposer(offTopology);
|
|
235
|
-
} else {
|
|
236
|
-
const offCleanup = target.topology.subscribe((msgs) => {
|
|
237
|
-
for (const m of msgs) {
|
|
238
|
-
if (m[0] !== DATA) continue;
|
|
239
|
-
const event = m[1];
|
|
240
|
-
if (event.kind !== "removed" || event.nodeKind !== "node") continue;
|
|
241
|
-
const r = restorers.get(event.name);
|
|
242
|
-
if (r != null) {
|
|
243
|
-
r();
|
|
244
|
-
restorers.delete(event.name);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
this.addDisposer(offCleanup);
|
|
249
|
-
}
|
|
250
|
-
this.addDisposer(() => {
|
|
251
|
-
for (const r of restorers.values()) r();
|
|
252
|
-
restorers.clear();
|
|
253
|
-
});
|
|
254
|
-
} else {
|
|
255
|
-
const handle = target.observe({ timeline: true, structured: true });
|
|
256
|
-
const off = handle.onEvent((event) => {
|
|
257
|
-
if (event.type !== "data" && event.type !== "error") return;
|
|
258
|
-
const path = event.path ?? "";
|
|
259
|
-
if (!path) return;
|
|
260
|
-
if (opts.paths != null && !opts.paths.includes(path)) return;
|
|
261
|
-
const node = safeNode(target, path);
|
|
262
|
-
const lastMutation = node?.lastMutation;
|
|
263
|
-
if (lastMutation == null) return;
|
|
264
|
-
const action = "write";
|
|
265
|
-
if (this._currentGuard(lastMutation.actor, action)) return;
|
|
266
|
-
this._publishViolation(lastMutation.actor, action, path, "observed");
|
|
267
|
-
});
|
|
268
|
-
this.addDisposer(() => {
|
|
269
|
-
off();
|
|
270
|
-
handle.dispose();
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
_publishViolation(actor, action, path, result) {
|
|
275
|
-
this.violations.publish({
|
|
276
|
-
timestamp_ns: monotonicNs(),
|
|
277
|
-
wall_clock_ns: wallClockNs(),
|
|
278
|
-
path,
|
|
279
|
-
actor,
|
|
280
|
-
action,
|
|
281
|
-
mode: this._mode,
|
|
282
|
-
result
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
/** Snapshot of recorded violations. */
|
|
286
|
-
all() {
|
|
287
|
-
return this.violations.retained();
|
|
288
|
-
}
|
|
289
|
-
get mode() {
|
|
290
|
-
return this._mode;
|
|
291
|
-
}
|
|
292
|
-
get target() {
|
|
293
|
-
return this._target;
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
function policyEnforcer(target, policies, opts = {}) {
|
|
297
|
-
return new PolicyEnforcerGraph(target, policies, opts);
|
|
298
|
-
}
|
|
299
|
-
function reactiveExplainPath(target, from, to, opts) {
|
|
300
|
-
let v = 0;
|
|
301
|
-
const version = state(v, { name: "explain_version" });
|
|
302
|
-
const handle = target.observe({ timeline: true, structured: true });
|
|
303
|
-
const off = handle.onEvent((event) => {
|
|
304
|
-
const t = event.type;
|
|
305
|
-
if (t !== "data" && t !== "error" && t !== "complete" && t !== "teardown") return;
|
|
306
|
-
v += 1;
|
|
307
|
-
version.emit(v);
|
|
308
|
-
});
|
|
309
|
-
const explainOpts = {
|
|
310
|
-
...opts?.maxDepth != null ? { maxDepth: opts.maxDepth } : {},
|
|
311
|
-
...opts?.findCycle === true ? { findCycle: true } : {}
|
|
312
|
-
};
|
|
313
|
-
const node = derived([version], () => target.explain(from, to, explainOpts), {
|
|
314
|
-
name: opts?.name ?? "explain",
|
|
315
|
-
describeKind: "derived",
|
|
316
|
-
equals: (a, b) => a.found === b.found && a.reason === b.reason && a.steps.length === b.steps.length && causalStepsEqual(a.steps, b.steps),
|
|
317
|
-
meta: auditMeta("explain_path", { from, to })
|
|
318
|
-
});
|
|
319
|
-
const stopKeepalive = keepalive(node);
|
|
320
|
-
return {
|
|
321
|
-
node,
|
|
322
|
-
dispose() {
|
|
323
|
-
off();
|
|
324
|
-
handle.dispose();
|
|
325
|
-
stopKeepalive();
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
function causalStepsEqual(a, b) {
|
|
330
|
-
for (let i = 0; i < a.length; i++) {
|
|
331
|
-
const x = a[i];
|
|
332
|
-
const y = b[i];
|
|
333
|
-
if (x.path !== y.path) return false;
|
|
334
|
-
if (x.type !== y.type) return false;
|
|
335
|
-
if (x.status !== y.status) return false;
|
|
336
|
-
if (x.hop !== y.hop) return false;
|
|
337
|
-
if (x.dep_index !== y.dep_index) return false;
|
|
338
|
-
if (x.reason !== y.reason) return false;
|
|
339
|
-
if (x.value !== y.value) return false;
|
|
340
|
-
if (x.lastMutation !== y.lastMutation) return false;
|
|
341
|
-
const xv = x.v;
|
|
342
|
-
const yv = y.v;
|
|
343
|
-
if (xv !== yv) {
|
|
344
|
-
if (xv == null || yv == null) return false;
|
|
345
|
-
if (xv.id !== yv.id || xv.version !== yv.version) return false;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
return true;
|
|
349
|
-
}
|
|
350
|
-
function complianceSnapshot(target, opts = {}) {
|
|
351
|
-
const result = {
|
|
352
|
-
format_version: 1,
|
|
353
|
-
timestamp_ns: monotonicNs(),
|
|
354
|
-
wall_clock_ns: wallClockNs(),
|
|
355
|
-
graph: target.snapshot()
|
|
356
|
-
};
|
|
357
|
-
if (opts.actor != null) result.actor = opts.actor;
|
|
358
|
-
if (opts.audit != null) {
|
|
359
|
-
const entries = [...opts.audit.all()];
|
|
360
|
-
result.audit = { count: entries.length, entries };
|
|
361
|
-
}
|
|
362
|
-
if (opts.policies != null) {
|
|
363
|
-
const rules = opts.policies.policies.cache ?? [];
|
|
364
|
-
result.policies = {
|
|
365
|
-
mode: opts.policies.mode,
|
|
366
|
-
rules,
|
|
367
|
-
violations: [...opts.policies.all()]
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
const fingerprint = computeFingerprint(result);
|
|
371
|
-
return { ...result, fingerprint };
|
|
372
|
-
}
|
|
373
|
-
function isNode(x) {
|
|
374
|
-
return typeof x === "object" && x !== null && "subscribe" in x;
|
|
375
|
-
}
|
|
376
|
-
function safeNode(target, path) {
|
|
377
|
-
try {
|
|
378
|
-
return target.node(path);
|
|
379
|
-
} catch {
|
|
380
|
-
return void 0;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
function safeAnnotation(target, path) {
|
|
384
|
-
try {
|
|
385
|
-
return target.annotation(path);
|
|
386
|
-
} catch {
|
|
387
|
-
return void 0;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
function collectPaths(target) {
|
|
391
|
-
const described = target.describe({ detail: "minimal" });
|
|
392
|
-
return Object.keys(described.nodes);
|
|
393
|
-
}
|
|
394
|
-
function computeFingerprint(value) {
|
|
395
|
-
return defaultHash(JSON.stringify(canonicalize(value)));
|
|
396
|
-
}
|
|
397
|
-
function canonicalize(value) {
|
|
398
|
-
const stack = /* @__PURE__ */ new Set();
|
|
399
|
-
const walk = (v) => {
|
|
400
|
-
if (v === void 0) return { __undefined: true };
|
|
401
|
-
if (v === null) return null;
|
|
402
|
-
const t = typeof v;
|
|
403
|
-
if (t === "bigint") return { __bigint: v.toString() };
|
|
404
|
-
if (t !== "object") return v;
|
|
405
|
-
const obj = v;
|
|
406
|
-
if (stack.has(obj)) return { __circular: true };
|
|
407
|
-
stack.add(obj);
|
|
408
|
-
try {
|
|
409
|
-
if (Array.isArray(obj)) {
|
|
410
|
-
return obj.map(walk);
|
|
411
|
-
}
|
|
412
|
-
if (obj instanceof Date) {
|
|
413
|
-
return { __date: obj.toISOString() };
|
|
414
|
-
}
|
|
415
|
-
if (obj instanceof RegExp) {
|
|
416
|
-
return { __regexp: { source: obj.source, flags: obj.flags } };
|
|
417
|
-
}
|
|
418
|
-
if (obj instanceof Map) {
|
|
419
|
-
const entries = [...obj.entries()].map(([k, mv]) => [
|
|
420
|
-
walk(k),
|
|
421
|
-
walk(mv)
|
|
422
|
-
]);
|
|
423
|
-
return { __map: entries };
|
|
424
|
-
}
|
|
425
|
-
if (obj instanceof Set) {
|
|
426
|
-
const items = [...obj].map(walk);
|
|
427
|
-
return { __set: items };
|
|
428
|
-
}
|
|
429
|
-
if (ArrayBuffer.isView(obj)) {
|
|
430
|
-
const ta = obj;
|
|
431
|
-
const arr = new Array(ta.length);
|
|
432
|
-
for (let i = 0; i < ta.length; i++) arr[i] = ta[i] ?? 0;
|
|
433
|
-
return { __typed_array: { ctor: obj.constructor.name, data: arr } };
|
|
434
|
-
}
|
|
435
|
-
const out = {};
|
|
436
|
-
for (const k of Object.keys(obj).sort()) {
|
|
437
|
-
out[k] = walk(obj[k]);
|
|
438
|
-
}
|
|
439
|
-
return out;
|
|
440
|
-
} finally {
|
|
441
|
-
stack.delete(obj);
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
return walk(value);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
export {
|
|
448
|
-
AuditTrailGraph,
|
|
449
|
-
auditTrail,
|
|
450
|
-
PolicyEnforcerGraph,
|
|
451
|
-
policyEnforcer,
|
|
452
|
-
reactiveExplainPath,
|
|
453
|
-
complianceSnapshot,
|
|
454
|
-
audit_exports
|
|
455
|
-
};
|
|
456
|
-
//# sourceMappingURL=chunk-NC6S43JJ.js.map
|