@graphrefly/graphrefly 0.34.0 → 0.35.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/{cascading-DKIb6Pk8.d.cts → cascading-B25wxpRa.d.cts} +3 -3
- package/dist/{cascading-Bg0a4VSf.d.ts → cascading-BsJ4GbnS.d.ts} +3 -3
- package/dist/{chunk-TZLEMGAK.js → chunk-2Y3DKIZL.js} +2 -2
- package/dist/chunk-3OT7K33Q.js +1 -0
- package/dist/chunk-53XJ2S6D.js +1 -0
- package/dist/chunk-5CPPC75H.js +1 -0
- package/dist/chunk-5KPIYVCC.js +7 -0
- package/dist/{chunk-GAOX6OPT.js → chunk-5XZRCS2M.js} +1 -1
- package/dist/{chunk-C5DINHNP.js → chunk-6G5YD37E.js} +1 -1
- package/dist/{chunk-WBWBY6LI.js → chunk-6SVKZ7VI.js} +1 -1
- package/dist/chunk-A5HZZYRK.js +1 -0
- package/dist/chunk-BGEY3PXH.js +1 -0
- package/dist/chunk-CD4CB6S7.js +1 -0
- package/dist/chunk-CE72X3WO.js +1 -0
- package/dist/chunk-CUQFO6MT.js +1 -0
- package/dist/chunk-D5RFJOZ2.js +1 -0
- package/dist/{chunk-A3GDELMY.js → chunk-E5YSBQSF.js} +7 -7
- package/dist/{chunk-SFIM774L.js → chunk-EUE7ELFQ.js} +1 -1
- package/dist/chunk-F3IGTWCQ.js +1 -0
- package/dist/chunk-F672GV32.js +1 -0
- package/dist/{chunk-GCUYSIM4.js → chunk-GWOKTENT.js} +1 -1
- package/dist/{chunk-4NYSEUKV.js → chunk-J6TGRQUP.js} +1 -1
- package/dist/{chunk-4F564IPP.js → chunk-JJTF75VS.js} +1 -1
- package/dist/{chunk-BY4WKPKM.js → chunk-JUJEPZOI.js} +1 -1
- package/dist/{chunk-65WWQ5CB.js → chunk-M5UC63ZI.js} +5 -5
- package/dist/chunk-MQZWA3DF.js +1 -0
- package/dist/chunk-MYFR67PY.js +18 -0
- package/dist/{chunk-KN2UMFT6.js → chunk-PCD2MU7X.js} +1 -1
- package/dist/{chunk-YDWTVO4E.js → chunk-PIIUJIF7.js} +1 -1
- package/dist/chunk-PVUTRA5K.js +5 -0
- package/dist/chunk-Q7EUZ6NN.js +1 -0
- package/dist/chunk-RLMYS3XZ.js +1 -0
- package/dist/chunk-RRFOCAH6.js +1 -0
- package/dist/{chunk-Q46YJCQH.js → chunk-T6RPUERH.js} +1 -1
- package/dist/{chunk-IPNJDNE7.js → chunk-T7GWBGOO.js} +1 -1
- package/dist/{chunk-U2T2XWDA.js → chunk-U347KVM4.js} +1 -1
- package/dist/chunk-UAMWD4GG.js +1 -0
- package/dist/chunk-VN6RDSK2.js +1 -0
- package/dist/{chunk-CJMFZXIZ.js → chunk-W2ZU226Q.js} +1 -1
- package/dist/{chunk-UF746BQ4.js → chunk-XINLP35X.js} +1 -1
- package/dist/{chunk-TONEKQM3.js → chunk-XMDNNSMK.js} +1 -1
- package/dist/{chunk-INXDSJRC.js → chunk-YOUAVGHJ.js} +1 -1
- package/dist/chunk-YV2A2VWG.js +1 -0
- package/dist/{chunk-PBN426RU.js → chunk-ZGVA2SR5.js} +1 -1
- package/dist/compat/index.cjs +10 -10
- package/dist/compat/index.d.cts +17 -14
- package/dist/compat/index.d.ts +17 -14
- package/dist/compat/index.js +1 -1
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nestjs/index.cjs +12 -12
- package/dist/compat/nestjs/index.d.cts +9 -6
- package/dist/compat/nestjs/index.d.ts +9 -6
- package/dist/compat/nestjs/index.js +1 -1
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/zustand/index.cjs +7 -7
- package/dist/compat/zustand/index.d.cts +5 -4
- package/dist/compat/zustand/index.d.ts +5 -4
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-BPDU_XV1.d.ts → composite-CT_mApQD.d.ts} +2 -2
- package/dist/{composite-CmvdhTJe.d.cts → composite-_XckYx2e.d.cts} +2 -2
- package/dist/{content-addressed-storage-DqIWCmZG.d.cts → content-addressed-storage-4-ST1tYk.d.cts} +5 -5
- package/dist/{content-addressed-storage-BUiREIuj.d.ts → content-addressed-storage-DuYMjV7o.d.ts} +5 -5
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/extra/browser.cjs +1 -1
- package/dist/extra/browser.d.cts +4 -3
- package/dist/extra/browser.d.ts +4 -3
- package/dist/extra/browser.js +1 -1
- package/dist/extra/index.cjs +19 -19
- package/dist/extra/index.d.cts +13 -12
- package/dist/extra/index.d.ts +13 -12
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +2 -3
- package/dist/extra/node.d.cts +3 -3
- package/dist/extra/node.d.ts +3 -3
- package/dist/extra/node.js +2 -2
- package/dist/extra/operators.cjs +1 -1
- package/dist/extra/operators.d.cts +1 -1
- package/dist/extra/operators.d.ts +1 -1
- package/dist/extra/operators.js +1 -1
- package/dist/extra/reactive.cjs +1 -1
- package/dist/extra/reactive.d.cts +4 -3
- package/dist/extra/reactive.d.ts +4 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.d.cts +57 -2
- package/dist/extra/sources.d.ts +57 -2
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-browser.cjs +1 -1
- package/dist/extra/storage-browser.d.cts +8 -42
- package/dist/extra/storage-browser.d.ts +8 -42
- package/dist/extra/storage-browser.js +1 -1
- package/dist/extra/storage-core.cjs +1 -1
- package/dist/extra/storage-core.d.cts +13 -83
- package/dist/extra/storage-core.d.ts +13 -83
- package/dist/extra/storage-core.js +1 -1
- package/dist/extra/storage-node.cjs +1 -2
- package/dist/extra/storage-node.d.cts +1 -59
- package/dist/extra/storage-node.d.ts +1 -59
- package/dist/extra/storage-node.js +0 -1
- package/dist/extra/storage-tiers-browser.cjs +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +49 -0
- package/dist/extra/storage-tiers-browser.d.ts +49 -0
- package/dist/extra/storage-tiers-browser.js +1 -0
- package/dist/extra/storage-tiers-node.cjs +1 -0
- package/dist/extra/storage-tiers-node.d.cts +86 -0
- package/dist/extra/storage-tiers-node.d.ts +86 -0
- package/dist/extra/storage-tiers-node.js +1 -0
- package/dist/extra/storage-tiers.cjs +1 -0
- package/dist/extra/storage-tiers.d.cts +284 -0
- package/dist/extra/storage-tiers.d.ts +284 -0
- package/dist/extra/storage-tiers.js +1 -0
- package/dist/{fallback-mYSd8vQo.d.ts → fallback-DuEXfA4F.d.ts} +14 -14
- package/dist/{fallback-9YznPvPP.d.cts → fallback-axI2cXwt.d.cts} +14 -14
- package/dist/graph/index.cjs +3 -3
- package/dist/graph/index.d.cts +6 -5
- package/dist/graph/index.d.ts +6 -5
- package/dist/graph/index.js +1 -1
- package/dist/{graph-BROUZPG9.d.ts → graph-Cv-8x0ZI.d.ts} +28 -16
- package/dist/{graph-DaoydJ_u.d.cts → graph-kTltt95s.d.cts} +28 -16
- package/dist/imperative-audit-ahAE65a9.d.cts +28 -0
- package/dist/imperative-audit-ahAE65a9.d.ts +28 -0
- package/dist/{index-CI5fULSz.d.ts → index-8OxXae3g.d.ts} +1 -1
- package/dist/{index-CQ1gt4rn.d.cts → index-9xhIaM-w.d.cts} +1 -1
- package/dist/{index-DhWrMTI6.d.cts → index-B3D_z0Z6.d.cts} +1 -1
- package/dist/{index-Ccv_61jG.d.cts → index-B3Dfl5sS.d.cts} +110 -27
- package/dist/{index-Dia4yc2y.d.ts → index-B4s70vYf.d.ts} +4 -4
- package/dist/{index-Db21wuaD.d.ts → index-B5UR87KG.d.ts} +3 -3
- package/dist/{index-DuvQAU02.d.ts → index-BBdwz2BW.d.ts} +2 -2
- package/dist/{index-B5eS17Bz.d.ts → index-BEvsFlfH.d.ts} +47 -32
- package/dist/{index-BUtCR0k6.d.ts → index-BF-ssbJB.d.ts} +7 -7
- package/dist/{index-ClKm7CFB.d.cts → index-BFuVcqL8.d.cts} +1 -1
- package/dist/{index-BkfL5MXh.d.cts → index-BWH17rK_.d.cts} +3 -3
- package/dist/{index-CD7qmvSf.d.ts → index-BZ1V5GzX.d.ts} +3 -3
- package/dist/{index-BDEhWLF4.d.cts → index-BhkPzu-Z.d.cts} +4 -4
- package/dist/{index-CNxdDb2e.d.ts → index-Bilohojo.d.ts} +3 -3
- package/dist/{index-zA1uVtk0.d.ts → index-BiomL7AW.d.ts} +1 -1
- package/dist/{index-BWiX5foT.d.ts → index-BjWZARLy.d.ts} +1 -1
- package/dist/{index-IxinNgAH.d.cts → index-BkbawFkI.d.cts} +16 -15
- package/dist/{index-RJX4snyi.d.cts → index-BlRVj-7Q.d.cts} +21 -21
- package/dist/index-BpFwRAf9.d.cts +26 -0
- package/dist/{index-Ds3Rz9m9.d.cts → index-BsZlbHM5.d.cts} +3 -3
- package/dist/{index-BFHpNSsV.d.ts → index-BtY2QVDf.d.cts} +8 -7
- package/dist/{index-BsxqmV6u.d.ts → index-BuMzxRO2.d.ts} +2 -2
- package/dist/{index-C5uMGVJw.d.ts → index-BwYGLgmI.d.ts} +4 -4
- package/dist/{index-3L3RC3VJ.d.ts → index-C40wA8zt.d.ts} +7 -7
- package/dist/{index-Bi4ZP6Hc.d.ts → index-C9xF16gc.d.ts} +110 -27
- package/dist/index-CAIhFfws.d.ts +171 -0
- package/dist/{index-BRisOxlx.d.ts → index-CDvC1m5p.d.ts} +1 -1
- package/dist/index-CGKs5ixV.d.cts +287 -0
- package/dist/{index-ygRFoyrN.d.ts → index-CI_yjtua.d.ts} +2 -2
- package/dist/{index-DxEcY7Om.d.ts → index-CIcu6fIR.d.ts} +1 -1
- package/dist/{index-CQtnGFrZ.d.cts → index-CfOSES72.d.cts} +7 -7
- package/dist/{index-Bd2AjMQY.d.ts → index-Cot94_82.d.ts} +21 -21
- package/dist/{index-B1hFhK1K.d.cts → index-CpZKtdMw.d.cts} +1 -1
- package/dist/{index-BO6t0HjV.d.cts → index-CqSJ25A9.d.cts} +1 -1
- package/dist/{index-Jgl7ev9I.d.cts → index-CzC0G0C3.d.cts} +9 -9
- package/dist/{index-p0bkNfby.d.cts → index-D6JRP-1_.d.cts} +3 -3
- package/dist/{index-D23g00HE.d.cts → index-D7r_vd0b.d.cts} +4 -4
- package/dist/{index-Cp91Sxbo.d.cts → index-D8IyqHvT.d.cts} +3 -3
- package/dist/{index-iKsmdnq6.d.cts → index-D9qoEOj_.d.cts} +2 -2
- package/dist/index-DBmBtqAN.d.ts +461 -0
- package/dist/{index-nP13Qe6T.d.ts → index-DFe2Pk2u.d.ts} +1 -1
- package/dist/{index-Cn3taOmp.d.cts → index-DKp1CIbG.d.cts} +2 -2
- package/dist/{index-CoR-tOZA.d.cts → index-DSD6xnbT.d.ts} +8 -7
- package/dist/{index-DheNs40A.d.ts → index-DXSLMoma.d.ts} +2 -2
- package/dist/{index-ZIQaKIdY.d.cts → index-DXZsXxtU.d.cts} +47 -32
- package/dist/{index-BVTjuKeP.d.cts → index-D_QQ_dTD.d.cts} +1 -1
- package/dist/{index-ChZvMC4M.d.cts → index-DeyzuqAi.d.cts} +7 -7
- package/dist/{index-Chi9IiHJ.d.ts → index-DlccEIi3.d.ts} +3 -3
- package/dist/{index-DR3XqZlV.d.cts → index-DmtWMP0X.d.cts} +1 -1
- package/dist/{index-CbCNoogR.d.ts → index-Dp69u0ym.d.ts} +16 -15
- package/dist/{index-b4a6Sg0R.d.ts → index-DwNNufVa.d.ts} +4 -4
- package/dist/{index-D80nGRb9.d.ts → index-DzYTXMBz.d.ts} +3 -3
- package/dist/index-DzgS5uYi.d.ts +26 -0
- package/dist/{index-B-KCkW4M.d.cts → index-GaW6Welt.d.cts} +4 -4
- package/dist/{index-DupIl9wI.d.ts → index-JYtN9uqM.d.ts} +1 -1
- package/dist/{index-Ced0dphF.d.ts → index-KNAMYngu.d.ts} +9 -9
- package/dist/{index-BpjQanLs.d.cts → index-PluovH45.d.cts} +2 -2
- package/dist/index-Qq-G9B6g.d.cts +171 -0
- package/dist/{index-yJY9thRY.d.cts → index-XxSeddWP.d.cts} +2 -2
- package/dist/{index-C8_bnDBZ.d.cts → index-ZhKyR8co.d.cts} +3 -3
- package/dist/index-hXKhbfh-.d.ts +287 -0
- package/dist/index-zK_mN1D-.d.cts +461 -0
- package/dist/index.cjs +59 -59
- package/dist/index.d.cts +53 -49
- package/dist/index.d.ts +53 -49
- package/dist/index.js +1 -1
- package/dist/{meta-BdjSt8ky.d.cts → meta-BGO6C7K9.d.cts} +1 -1
- package/dist/{meta-CtDjj7cU.d.ts → meta-CC6EPdpK.d.ts} +1 -1
- package/dist/{node-8qx0kgYt.d.cts → node-fSc-hCv8.d.cts} +1 -1
- package/dist/{node-8qx0kgYt.d.ts → node-fSc-hCv8.d.ts} +1 -1
- package/dist/{observable-B6Ba-TTI.d.cts → observable-Cqty11jG.d.cts} +1 -1
- package/dist/{observable-DOniYM2B.d.ts → observable-EAV_rNfM.d.ts} +1 -1
- package/dist/patterns/ai/browser.cjs +5 -5
- package/dist/patterns/ai/browser.d.cts +4 -4
- package/dist/patterns/ai/browser.d.ts +4 -4
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +19 -19
- package/dist/patterns/ai/index.d.cts +19 -17
- package/dist/patterns/ai/index.d.ts +19 -17
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.cjs +1 -2
- package/dist/patterns/ai/node.d.cts +9 -9
- package/dist/patterns/ai/node.d.ts +9 -9
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.cjs +6 -6
- package/dist/patterns/audit/index.d.cts +7 -5
- package/dist/patterns/audit/index.d.ts +7 -5
- package/dist/patterns/audit/index.js +1 -1
- package/dist/patterns/cqrs/index.cjs +7 -7
- package/dist/patterns/cqrs/index.d.cts +7 -4
- package/dist/patterns/cqrs/index.d.ts +7 -4
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +8 -8
- package/dist/patterns/demo-shell/index.d.cts +6 -5
- package/dist/patterns/demo-shell/index.d.ts +6 -5
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +5 -5
- package/dist/patterns/domain-templates/index.d.cts +5 -4
- package/dist/patterns/domain-templates/index.d.ts +5 -4
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +20 -20
- package/dist/patterns/graphspec/index.d.cts +6 -5
- package/dist/patterns/graphspec/index.d.ts +6 -5
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +7 -7
- package/dist/patterns/guarded-execution/index.d.cts +8 -6
- package/dist/patterns/guarded-execution/index.d.ts +8 -6
- package/dist/patterns/guarded-execution/index.js +1 -1
- package/dist/patterns/harness/index.cjs +12 -12
- package/dist/patterns/harness/index.d.cts +13 -10
- package/dist/patterns/harness/index.d.ts +13 -10
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +7 -7
- package/dist/patterns/job-queue/index.d.cts +8 -4
- package/dist/patterns/job-queue/index.d.ts +8 -4
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +4 -4
- package/dist/patterns/lens/index.d.cts +7 -6
- package/dist/patterns/lens/index.d.ts +7 -6
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +1 -1
- package/dist/patterns/memory/index.d.cts +5 -4
- package/dist/patterns/memory/index.d.ts +5 -4
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +7 -7
- package/dist/patterns/messaging/index.d.cts +6 -4
- package/dist/patterns/messaging/index.d.ts +6 -4
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.cjs +7 -7
- package/dist/patterns/orchestration/index.d.cts +8 -5
- package/dist/patterns/orchestration/index.d.ts +8 -5
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/process/index.cjs +1 -0
- package/dist/patterns/process/index.d.cts +10 -0
- package/dist/patterns/process/index.d.ts +10 -0
- package/dist/patterns/process/index.js +1 -0
- package/dist/patterns/reactive-layout/index.cjs +5 -5
- package/dist/patterns/reactive-layout/index.d.cts +6 -5
- package/dist/patterns/reactive-layout/index.d.ts +6 -5
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +1 -1
- package/dist/patterns/reduction/index.d.cts +5 -4
- package/dist/patterns/reduction/index.d.ts +5 -4
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.cjs +8 -8
- package/dist/patterns/refine-loop/index.d.cts +7 -5
- package/dist/patterns/refine-loop/index.d.ts +7 -5
- package/dist/patterns/refine-loop/index.js +1 -1
- package/dist/patterns/resilient-pipeline/index.cjs +1 -1
- package/dist/patterns/resilient-pipeline/index.d.cts +7 -6
- package/dist/patterns/resilient-pipeline/index.d.ts +7 -6
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +11 -11
- package/dist/patterns/surface/index.d.cts +7 -6
- package/dist/patterns/surface/index.d.ts +7 -6
- package/dist/patterns/surface/index.js +1 -1
- package/dist/pipeline-graph-B85HUrWg.d.cts +120 -0
- package/dist/pipeline-graph-HOTU4UG0.d.ts +120 -0
- package/dist/{reactive-layout-DBJ3Vz-m.d.ts → reactive-layout-Btv0-efV.d.ts} +2 -2
- package/dist/{reactive-layout-Dk9AOQb_.d.cts → reactive-layout-D9zqqaqK.d.cts} +2 -2
- package/dist/reactive-log-ByBb8g6A.d.ts +188 -0
- package/dist/reactive-log-CgbNqksB.d.cts +188 -0
- package/dist/{reactive-map-LjwjcFaW.d.ts → reactive-map-CHyeCf4D.d.ts} +1 -1
- package/dist/{reactive-map-Cm89Hk0c.d.cts → reactive-map-DmgeADH8.d.cts} +1 -1
- package/dist/{resilience-RjDIHZNZ.d.ts → resilience-BWP2c7Af.d.cts} +27 -45
- package/dist/{resilience-N_VtLf7W.d.cts → resilience-Bys63Cpd.d.ts} +27 -45
- package/dist/resilience-OBU472D2.js +1 -0
- package/dist/{sugar-CQkn_rxB.d.ts → sugar-D13E2M_z.d.ts} +1 -1
- package/dist/{sugar-DVEYhR7a.d.cts → sugar-DgaGJcI6.d.cts} +1 -1
- package/dist/{topology-tree-BB6oJxMz.d.cts → topology-tree-C50l9ARE.d.cts} +1 -1
- package/dist/{topology-tree-CAFOG5S5.d.ts → topology-tree-CJsT24DP.d.ts} +1 -1
- package/dist/{types-Cp_4coR_.d.cts → types-BMSGPlpO.d.cts} +1 -1
- package/dist/{types-B2LfBvNc.d.ts → types-CidcBDuk.d.ts} +1 -1
- package/package.json +41 -1
- package/dist/chunk-2JO6LXFT.js +0 -7
- package/dist/chunk-2LZ6DL45.js +0 -1
- package/dist/chunk-3JXNEPCD.js +0 -2
- package/dist/chunk-3Y4BXFFR.js +0 -1
- package/dist/chunk-55T3K37W.js +0 -1
- package/dist/chunk-6HQ6HVTF.js +0 -1
- package/dist/chunk-7Q2WPFQ7.js +0 -1
- package/dist/chunk-FKRPIRE6.js +0 -1
- package/dist/chunk-HTBOCKVD.js +0 -1
- package/dist/chunk-I6VIH3VA.js +0 -1
- package/dist/chunk-IB64M7VP.js +0 -1
- package/dist/chunk-IJFSR4NU.js +0 -1
- package/dist/chunk-LOF5HSD3.js +0 -18
- package/dist/chunk-T2TB37TW.js +0 -1
- package/dist/chunk-T7EQPKOP.js +0 -1
- package/dist/chunk-Y63GWRHO.js +0 -5
- package/dist/chunk-YUBV7EEE.js +0 -1
- package/dist/index-C2Dey3L-.d.cts +0 -152
- package/dist/index-ClJUZAOr.d.cts +0 -101
- package/dist/index-Cq7Uqgu4.d.ts +0 -192
- package/dist/index-Dtpr2FIB.d.ts +0 -101
- package/dist/index-HvJ90_tX.d.ts +0 -152
- package/dist/index-wcfc7W-f.d.cts +0 -192
- package/dist/reactive-log-CWC7jO4J.d.cts +0 -190
- package/dist/reactive-log-CqaBg8nf.d.ts +0 -190
- package/dist/resilience-7UZHSSGC.js +0 -1
- /package/dist/{chunk-L3KUKDZC.js → chunk-O32GJOUJ.js} +0 -0
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`)}function nn(t){if(t.version!==he)throw new Error(`unsupported snapshot version ${String(t.version)} (expected ${he})`);for(let e of["name","nodes","edges","subgraphs"])if(!(e in t))throw new Error(`snapshot missing required key "${e}"`);if(typeof t.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof t.nodes!="object"||t.nodes===null||Array.isArray(t.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(t.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(t.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function ar(t,e){let n=new WeakMap,r=(s,o)=>{if(Object.is(s,o))return!0;if(s==null||o==null||typeof s!="object"||typeof o!="object")return!1;let i=n.get(s);if(i==null&&(i=new WeakSet,n.set(s,i)),i.has(o))return!0;i.add(o);let a=s.constructor,u=o.constructor;if(a!==u)return!1;if(s instanceof Date)return s.getTime()===o.getTime();if(s instanceof RegExp)return s.source===o.source&&s.flags===o.flags;if(Array.isArray(s)){let h=o;if(s.length!==h.length)return!1;for(let f=0;f<s.length;f++)if(!r(s[f],h[f]))return!1;return!0}if(s instanceof Map){let h=o;if(s.size!==h.size)return!1;for(let[f,d]of s)if(!h.has(f)||!r(d,h.get(f)))return!1;return!0}if(s instanceof Set){let h=o;if(s.size!==h.size)return!1;for(let f of s){let d=!1;for(let g of h)if(r(f,g)){d=!0;break}if(!d)return!1}return!0}if(ArrayBuffer.isView(s)){let h=s,f=o;if(h.length!==f.length)return!1;for(let d=0;d<h.length;d++)if(h[d]!==f[d])return!1;return!0}let c=Object.keys(s),l=Object.keys(o);if(c.length!==l.length)return!1;let p=new Set(l);for(let h of c)if(!p.has(h)||!r(s[h],o[h]))return!1;return!0};return r(t,e)}function gt(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(gt);let e=t,n=Object.keys(e).sort(),r={};for(let s of n)r[s]=gt(e[s]);return r}function ur(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function cr(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function lr(t){return t==="TD"?"down":t==="BT"?"up":t==="RL"?"left":"right"}function on(t){let e=new Set,n=[];function r(s,o){let i=`${s}\0${o}`;e.has(i)||(e.add(i),n.push([s,o]))}for(let[s,o]of Object.entries(t.nodes)){let i=o.deps;if(i)for(let a of i)r(a,s)}for(let s of t.edges)r(s.from,s.to);return n}function an(t){if(t===void 0)return"LR";if(t==="TD"||t==="LR"||t==="BT"||t==="RL")return t;throw new Error(`invalid diagram direction ${String(t)}; expected one of: TD, LR, BT, RL`)}function dr(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,{expand:s,...o}=t,i={...o,edges:n?t.edges:[],subgraphs:r?t.subgraphs:[]},a=JSON.stringify(gt(i),null,e.indent??2);return e.logger?.(a),a}function fr(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,s=[];s.push(`Graph ${t.name}`),s.push("Nodes:");for(let i of Object.keys(t.nodes).sort()){let a=t.nodes[i];s.push(`- ${i} (${a.type}/${a.status}): ${je(a.value)}`)}if(n){s.push("Edges:");for(let i of t.edges)s.push(`- ${i.from} -> ${i.to}`)}if(r){s.push("Subgraphs:");for(let i of t.subgraphs)s.push(`- ${i}`)}let o=s.join(`
|
|
5
5
|
`);return e.logger?.(o),o}function un(t,e){let n=an(e.direction),r=Object.keys(t.nodes).sort(),s=new Map;for(let i=0;i<r.length;i+=1)s.set(r[i],`n${i}`);let o=[`flowchart ${n}`];for(let i of r){let a=s.get(i);o.push(` ${a}["${ur(i)}"]`)}for(let[i,a]of on(t)){let u=s.get(i),c=s.get(a);!u||!c||o.push(` ${u} --> ${c}`)}return o.join(`
|
|
6
6
|
`)}function pr(t,e){let n=un(t,e);return hr(n)}function hr(t,e){let n=e?.theme??"default",r=e?.autoSync??!0,o=JSON.stringify({code:t,mermaid:{theme:n},autoSync:r}),i=new TextEncoder().encode(o),a="";for(let c=0;c<i.length;c++)a+=String.fromCharCode(i[c]);return`https://mermaid.live/edit#base64:${globalThis.btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`}function gr(t,e){let n=an(e.direction),r=Object.keys(t.nodes).sort(),s=new Map;for(let i=0;i<r.length;i+=1)s.set(r[i],`n${i}`);let o=[`direction: ${lr(n)}`];for(let i of r){let a=s.get(i);o.push(`${a}: "${cr(i)}"`)}for(let[i,a]of on(t)){let u=s.get(i),c=s.get(a);!u||!c||o.push(`${u} -> ${c}`)}return o.join(`
|
|
7
|
-
`)}function mr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Be(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let s=t.indexOf("]",n+1);if(s<=n+1){e+="\\[";continue}let o=t.slice(n+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),e+=`[${o}]`,n=s;continue}e+=mr(r)}return e+="$",new RegExp(e)}var br={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},yr={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function je(t){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean"||t==null)return String(t);try{return JSON.stringify(t)}catch{return"[unserializable]"}}function vr(t){return t==="none"?yr:t==="ansi"||t==null?br:{data:t.data??"",dirty:t.dirty??"",resolved:t.resolved??"",invalidate:t.invalidate??"",pause:t.pause??"",resume:t.resume??"",complete:t.complete??"",error:t.error??"",teardown:t.teardown??"",derived:t.derived??"",path:t.path??"",reset:t.reset??""}}function rn(t){if(t==null)return{};let e=t.detail;return e==="full"?{...t,structured:t.structured??!0,timeline:t.timeline??!0,causal:t.causal??!0,derived:t.derived??!0}:e==="minimal"?{...t,structured:t.structured??!0}:t.format==="stage-log"?{...t,structured:t.structured??!0,timeline:t.timeline??!0}:t}function _r(t,e,n){for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s<32||s===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function ht(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(D))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${D}' (path separator)`);if(t===X)throw new Error(`Graph "${e}": ${n} name "${X}" is reserved for meta companion paths`);_r(t,e,n)}function xr(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(D);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function wr(t,e){let n=!1;for(let s of t)if(!e.isMetaPassthrough(s[0])){n=!0;break}return n?t.filter(s=>e.isMetaPassthrough(s[0])):t}function cn(t){for(let e of t._mounts.values())cn(e);for(let e of t._nodes.values())try{e.down([[H]],{internal:!0})}catch{}}var ge=class t{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_destroyed=!1;_topology;_topologyEmitters=new Set;constructor(e,n){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(D))throw new Error(`Graph name must not contain '${D}' (got "${e}")`);if(e===X)throw new Error(`Graph name "${X}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??pe,this._traceRing=new we(n?.traceCapacity??1e3),n?.versioning!=null&&this.setVersioning(n.versioning)}ancestors(e=!0){let n=[],r=e?this:this._parent;for(;r!=null;)n.push(r),r=r._parent;return n}get topology(){return this._topology==null&&(this._topology=It(e=>{let n=r=>{e.emit(r)};return this._topologyEmitters.add(n),()=>{this._topologyEmitters.delete(n)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let n of this._topologyEmitters)n(e)}add(e,n){let r=e.name,s=n?.name??r;if(s==null||s==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let o=s,i=n?.annotation;if(ht(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(o,e),this._nodeToName.set(e,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:j()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof I&&n._applyVersioning(e)}remove(e){ht(e,this.name,"remove");let n=this._mounts.get(e);if(n){let o={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,u]of i)a.includes(`${D}${X}${D}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...n._collectSubgraphs(`${e}${D}`)),this._mounts.delete(e),n._parent=void 0,cn(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:o}),o}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[H]],{internal:!0});let s={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:s}),s}removeAll(e){let n=typeof e=="function"?e:(()=>{let o=Be(e);return i=>o.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>n(o));for(let o of s){let i=this.remove(o);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),n=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let s=e[r++];return{value:[s,n.get(s)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(D))return this.resolve(e);let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return n}get(e){return this.node(e).cache}set(e,n,r){let s=r?.internal===!0;this.node(e).down([[V,n]],{actor:r?.actor,internal:s,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);Tt(()=>{for(let[s,o]of r)this.set(s,o,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[Y]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let s=r?.internal===!0;this.node(e).down([[P,n]],{actor:r?.actor,internal:s,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[J]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[u,c]of this._nodes)r.set(c,u);let a=[];for(let[u,c]of this._nodes)if(c instanceof I)for(let l of c._deps){let p=r.get(l.node);p!=null&&a.push([p,u])}return a.sort((u,c)=>u[0]<c[0]?-1:u[0]>c[0]?1:u[1]<c[1]?-1:u[1]>c[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,u]of s)o.set(u,a);let i=[];for(let[a,u]of s)if(u instanceof I)for(let c of u._deps){let l=o.get(c.node);l!=null&&i.push([l,a])}return i.sort((a,u)=>a[0]<u[0]?-1:a[0]>u[0]?1:a[1]<u[1]?-1:a[1]>u[1]?1:0),i}mount(e,n){if(ht(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(n===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(n._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${n._parent.name}"`);for(let r=this;r!=null;r=r._parent)if(r===n)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,n),n._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),n}resolve(e){let n=xr(e,this.name);return this._resolveFromSegments(n)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let n=e;if(n[0]===this.name&&(n=n.slice(1),n.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=n[0],s=n.slice(1);if(s.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let o=this._nodes.get(r);if(o&&s.length>0&&s[0]===X)return this._resolveMetaChainFromNode(o,s,n.join(D));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${s.join(D)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(s.join(D))}_resolveMetaChainFromNode(e,n,r){let s=e,o=0,i=[...n];for(;o<i.length;){if(i[o]!==X)throw new Error(`Graph "${this.name}": expected ${X} segment in meta path "${r}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${X} in "${r}"`);let a=i[o+1],u=s.meta[a];if(!u)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);s=u,o+=2}return s}signal(e,n){if(n?.internal!==!0){for(let s of e)if(this.config.messageTier(s[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,n??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,n,r,s){for(let u of this._mounts.values())u._signalDeliver(e,n,r,s);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=wr(e,this.config);for(let u of[...this._nodes.keys()].sort()){let c=this._nodes.get(u);if(!r.has(c)){r.add(c);try{c.down(e,i)}catch(l){if(l instanceof K)throw l;s.push(l)}a.length!==0&&this._signalMetaSubtree(c,a,r,i,s)}}}_signalMetaSubtree(e,n,r,s,o){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(n,s)}catch(u){if(u instanceof K)throw u;o.push(u)}this._signalMetaSubtree(a,n,r,s,o)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,s=Ge(e?.detail,e?.fields),o=e?.format==="spec",i=o?Ge("minimal"):s,a=[];this._collectObserveTargets("",a);let u=new Map;for(let[x,w]of a)u.set(w,x);let c=[];{let x=a.map(([,N])=>N),w=new Set(u.values()),E=0;for(;x.length>0;){let N=x.shift();if(N instanceof I)for(let A of N._deps){let R=A.node;if(u.has(R))continue;let S=R.name??"",k=S;if(!k||w.has(k))if(S){let G=2;for(;w.has(`${S}#${G}`);)G++;k=`${S}#${G}`}else for(k=`__internal__/${E++}`;w.has(k);)k=`__internal__/${E++}`;u.set(R,k),w.add(k),c.push([k,R]),x.push(R)}}}let l=[...a,...c],p={};for(let[x,w]of l){if(n!=null&&!w.allowsObserve(n))continue;let E=dt(w,i),N=w instanceof I?w._deps.map(k=>u.get(k.node)??k.node.name??""):[],{name:A,...R}=E,S={...R,deps:N};if(!o){let k=this._annotations.get(x);k!=null&&(S.annotation=k)}if(r!=null)if(typeof r=="function"){let k=r;if(!(k.length>=2?k(x,S):k(S)))continue}else{let k=!0;for(let[G,B]of Object.entries(r)){let q=G==="deps_includes"?"depsIncludes":G==="meta_has"?"metaHas":G;if(q==="depsIncludes"){if(!S.deps.includes(String(B))){k=!1;break}continue}if(q==="metaHas"){if(!Object.hasOwn(S.meta??{},String(B))){k=!1;break}continue}if(S[q]!==B){k=!1;break}}if(!k)continue}p[x]=S}let h=new Set(Object.keys(p)),f=[];for(let[x,w]of l)if(w instanceof I)for(let E of w._deps){let N=u.get(E.node);N!=null&&f.push([N,x])}f.sort((x,w)=>x[0]<w[0]?-1:x[0]>w[0]?1:x[1]<w[1]?-1:x[1]>w[1]?1:0);let d=f.map(([x,w])=>({from:x,to:w}));(n!=null||r!=null)&&(d=d.filter(x=>h.has(x.from)&&h.has(x.to)));let g=this._collectSubgraphs(""),m=n!=null||r!=null?g.filter(x=>{let w=`${x}${D}`;return[...h].some(E=>E===x||E.startsWith(w))}):g,y=this,_=e,b={name:this.name,nodes:p,edges:d,subgraphs:m,expand(x){let w={..._,format:void 0};return Array.isArray(x)?(w.fields=x,w.detail=void 0):(w.detail=x,w.fields=void 0),y.describe(w)}},v=e??{},T=v.format;return T==="json"?dr(b,v):T==="pretty"?fr(b,v):T==="mermaid"?un(b,v):T==="mermaid-url"?pr(b,v):T==="d2"?gr(b,v):T==="ascii"?qt(b,v):b}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${r}`;n.push(s),n.push(...this._mounts.get(r)._collectSubgraphs(`${s}${D}`))}return n}resourceProfile(e){return en(this,e)}reachable(e,n,r={}){return r.withDetail===!0?sn(this.describe(),e,n,{...r,withDetail:!0}):sn(this.describe(),e,n,r)}explain(e,n,r){return r?.reactive===!0?this._explainReactive(e,n,r):this._explainStatic(e,n,r)}_explainStatic(e,n,r){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,u]of Object.entries(s.nodes))u.lastMutation!=null&&i.set(a,u.lastMutation);return Yt(s,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",s=0,o=te(s,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,c=()=>{a||u||(a=!0,ve(()=>{a=!1,!u&&(s+=1,o.emit(s))}))},l=i.onEvent(m=>{let y=m.type;y!=="data"&&y!=="error"&&y!=="complete"&&y!=="teardown"||c()}),p=[],h=new WeakSet,f=m=>{if(h.has(m)||u)return;h.add(m);let y=m.topology.subscribe(_=>{for(let b of _){if(b[0]!==V)continue;let v=b[1];if(c(),v.kind==="added"&&v.nodeKind==="mount"){let T=m._mounts.get(v.name);T!=null&&f(T)}}});p.push(y);for(let _ of m._mounts.keys()){let b=m._mounts.get(_);b!=null&&f(b)}};f(this);let d;try{d=ue([o],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(m,y)=>m===y})}catch(m){l();for(let y of p)y();throw i.dispose(),m}let g=ft(d);return{node:d,dispose(){u=!0,l();for(let m of p)m();p.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let s=0,o=te(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,c=i.onEvent(f=>{let d=f.type;d!=="data"&&d!=="error"&&d!=="complete"&&d!=="teardown"||a||u||(a=!0,ve(()=>{a=!1,!u&&(s+=1,o.emit(s))}))}),l={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},p;try{p=ue([o],()=>this._explainStatic(e,n,l),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(f,d)=>f.found===d.found&&f.reason===d.reason&&f.steps.length===d.steps.length&&Er(f.steps,d.steps)})}catch(f){throw c(),i.dispose(),f}let h=ft(p);return{node:p,dispose(){u=!0,c(),i.dispose(),h()}}}_pathsMatching(e){let n=Be(e),r=[];return this._collectObserveTargets("",r),r.map(([s])=>s).filter(s=>n.test(s))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${D}${r}`;this._mounts.get(r)._collectObserveTargets(s,n)}for(let r of[...this._nodes.keys()].sort()){let s=this._nodes.get(r),o=e===""?r:`${e}${D}${r}`;n.push([o,s]),this._appendMetaObserveTargets(o,s,n)}}_appendMetaObserveTargets(e,n,r){for(let s of Object.keys(n.meta).sort()){let o=n.meta[s],i=`${e}${D}${X}${D}${s}`;r.push([i,o]),this._appendMetaObserveTargets(i,o,r)}}observe(e,n){let r=typeof e=="string",o=rn(r?n:e),i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(r){let l=e,p=this.resolve(l);if(a!=null&&!p.allowsObserve(a))throw new K({actor:a,action:"observe",nodeName:l});return i?this._buildStructuredObserver([[l,p]],o,"one"):{subscribe(h){return p.subscribe(h)},up(h){try{p.up?.(h)}catch(f){if(f instanceof K)return;throw f}}}}let u=[];this._collectObserveTargets("",u),u.sort((l,p)=>l[0]<p[0]?-1:l[0]>p[0]?1:0);let c=a==null?u:u.filter(([,l])=>l.allowsObserve(a));return i?this._buildStructuredObserver(c,o,"all"):{subscribe:l=>{let p=c.map(([h,f])=>f.subscribe(d=>{l(h,d)}));return()=>{for(let h of p)h()}},up:(l,p)=>{try{this.resolve(l).up?.(p)}catch(h){if(h instanceof K)return;throw h}}}}_buildStructuredObserver(e,n,r){let s=r==="one"?e[0]?.[0]:void 0,o=i=>{if(r==="one"&&s!=null){let l=this.resolve(s);return this._buildStructuredObserver([[s,l]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((l,p)=>l[0]<p[0]?-1:l[0]>p[0]?1:0);let u=i.actor,c=u==null?a:a.filter(([,l])=>l.allowsObserve(u));return this._buildStructuredObserver(c,i,"all")};return this._createObserveResult(e,n,o)}_createObserveResult(e,n,r){let s=n.timeline===!0,o=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",u=this.config.inspectorEnabled,c=(o||i)&&u,l=n.maxEvents,p=l!=null&&l>0?new we(l):null,h=[],f=new Set,d={},g=new Set,m=0,y=0,_=0,b=0,v=0,T=0,x=!1,w=!1,E=0,N=new Map,A=new Map,R=new Map,S=O=>{p?p.push(O):h.push(O);for(let M of f)M(O)},k=()=>s?{timestamp_ns:j(),in_batch:Re(),batch_id:E}:{},G=(O,M)=>{if(!(!c||!(O instanceof I)))return O._setInspectorHook(z=>{if(z.kind==="dep_message")N.set(O,z.depIndex);else if(z.kind==="run"){let me=z.batchData.map((C,F)=>C!=null&&C.length>0?C.at(-1):z.prevData[F]);A.set(O,me);let U=z.batchData.map(C=>C!=null?[...C]:void 0);R.set(O,U),i&&S({type:"derived",path:M,dep_values:me,dep_batches:U,...k()})}})},B=O=>{let M=N.get(O),z=A.get(O);if(!o||z==null)return{};let U=(M!=null&&M>=0&&O instanceof I?O._deps[M]:void 0)?.node,C=U?.v,F=R.get(O);return{trigger_dep_index:M,trigger_dep_name:U?.name,...C!=null?{trigger_version:{id:C.id,version:C.version}}:{},dep_values:[...z],...F!=null?{dep_batches:F}:{}}},q=[],oe=[];for(let[O,M]of e){let z=G(M,O);z&&q.push(z),oe.push(M.subscribe(me=>{E++;for(let U of me){let C=U[0],F=k();if(C===V){d[O]=U[1];let qe=M instanceof I?M.lastMutation?.actor??ce:ce;S({type:"data",path:O,data:U[1],actor:qe,...F,...B(M)})}else if(a)C===Z?m++:C===Q?y++:C===Y?_++:C===ee?b++:C===re?v++:C===H?T++:C===J&&!g.has(O)?x=!0:C===P&&(w=!0,g.add(O));else if(C===Z)m++,S({type:"dirty",path:O,...F});else if(C===Q)y++,S({type:"resolved",path:O,...F,...B(M)});else if(C===Y)_++,S({type:"invalidate",path:O,...F});else if(C===ee)b++,S({type:"pause",path:O,lockId:U[1],...F});else if(C===re)v++,S({type:"resume",path:O,lockId:U[1],...F});else if(C===J)g.has(O)||(x=!0),S({type:"complete",path:O,...F});else if(C===P){w=!0,g.add(O);let qe=M instanceof I?M.lastMutation?.actor??ce:ce;S({type:"error",path:O,data:U[1],actor:qe,...F})}else C===H&&(T++,S({type:"teardown",path:O,...F}))}}))}let Ue=!1,We=()=>{if(!Ue){Ue=!0;for(let O of oe)O();for(let O of q)O();for(let O of Te)O({value:void 0,done:!0});Te.length=0}},Ke=[],Te=[];f.add(O=>{let M=Te.shift();M?M({value:O,done:!1}):Ke.push(O)});let bt={get values(){return d},get dirtyCount(){return m},get resolvedCount(){return y},get invalidateCount(){return _},get pauseCount(){return b},get resumeCount(){return v},get teardownCount(){return T},get events(){return p?p.toArray():[...h]},get anyCompletedCleanly(){return x},get anyErrored(){return w},get completedWithoutErrors(){return x&&!w},onEvent(O){return f.add(O),()=>f.delete(O)},dispose:We,expand(O){We();let M={...n};return typeof O=="string"?M.detail=O:Object.assign(M,O),r(rn(M))},[Symbol.asyncIterator](){return{next(){return Ke.length>0?Promise.resolve({value:Ke.shift(),done:!1}):Ue?Promise.resolve({value:void 0,done:!0}):new Promise(O=>Te.push(O))},return(){return We(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(bt,n),bt}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let s=n.logger??(d=>console.log(d)),o=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=o==null&&i==null?()=>!0:d=>(o==null||o.has(d))&&(i==null||!i.has(d)),u=vr(n.theme),c=r==="stage-log"?j():0,l=d=>d==null?"":n.stageLabels?.[d]??d,p=(d,g)=>d.length>g?`${d.slice(0,g-1)}\u2026`:d,h=d=>d.type==="data"||d.type==="error"?p(je(d.data),120):"",f=d=>{if(r==="stage-log"){let w=(j()-c)/1e9,E=l(d.path).padEnd(9);if(d.type==="data"){let N=h(d);return`[${w.toFixed(3)}s] ${E} \u2190${N?` ${N}`:""}`}if(d.type==="error"){let N=h(d);return`[${w.toFixed(3)}s] ${E} \u2717${N?` ${N}`:""}`}return d.type==="complete"?`[${w.toFixed(3)}s] ${E} \u25A0 complete`:`[${w.toFixed(3)}s] ${E} ${d.type}`}if(r==="json")try{return JSON.stringify(d)}catch{return JSON.stringify({type:d.type,path:d.path,data:"[unserializable]"})}let g=u[d.type]??"",m=d.path?`${u.path}${d.path}${u.reset} `:"",y=d.type==="data"||d.type==="error",_=d.type==="pause"||d.type==="resume",b=y?` ${je(d.data)}`:_?` ${je(d.lockId)}`:"",v=d.type==="data"||d.type==="resolved"||d.type==="derived"?d:void 0,T=v?.trigger_dep_name!=null?` <- ${v.trigger_dep_name}`:v?.trigger_dep_index!=null?` <- #${v.trigger_dep_index}`:"",x=d.in_batch?" [batch]":"";return`${m}${g}${d.type.toUpperCase()}${u.reset}${b}${T}${x}`};e.onEvent(d=>{a(d.type)&&s(f(d),d)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){tn(this._disposers,this.name),this.signal([[H]],{internal:!0}),tn(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}get destroyed(){return this._destroyed}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}snapshot(e){let{expand:n,...r}=this.describe({detail:"full"}),s={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:u,guard:c,...l}=r.nodes[a];s[a]=l}let o=[...r.subgraphs].sort(),i={...r,version:1,nodes:s,subgraphs:o};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return vt(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??pe,{codec:s,codecVersion:o,payload:i}=_t(e,r);return s.decode(i,o)}restore(e,n){if(nn(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=n?.only==null?null:(Array.isArray(n.only)?n.only:[n.only]).map(o=>Be(o)),s=n?.includeProducers===!0;for(let o of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(o)))continue;let i=e.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let u=this.tryResolve(o)?.v;if(u!=null&&u.id===i.v.id&&u.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){n?.onError?.(o,a)}}}}}static fromSnapshot(e,n){nn(e);let r=typeof n=="function"?n:n?.build,s=typeof n=="function"?void 0:n?.factories,o=new t(e.name);if(r)return r(o),o.restore(e),o;for(let f of[...e.subgraphs].sort((d,g)=>{let m=d.split(D).length,y=g.split(D).length;return m!==y?m-y:d<g?-1:d>g?1:0})){let d=f.split(D),g=o;for(let m of d)g._mounts.has(m)||g.mount(m,new t(m)),g=g._mounts.get(m)}let i=s?Object.entries(s).map(([f,d])=>({re:Be(f),factory:d})):[],a=f=>{for(let d of i)if(d.re.test(f))return d.factory},u=f=>{let d=f.split(D),g=d.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${f}"`);let m=o;for(let y of d){let _=m._mounts.get(y);if(!_)throw new Error(`unknown mount "${y}" in path "${f}"`);m=_}return[m,g]},c=Object.entries(e.nodes).filter(([f])=>!f.includes(`${D}${X}${D}`)).sort((f,d)=>f[0]<d[0]?-1:f[0]>d[0]?1:0),l=new Map(c),p=new Map,h=!0;for(;l.size>0&&h;){h=!1;for(let[f,d]of[...l.entries()]){let g=d?.deps??[];if(!g.every(T=>p.has(T)))continue;let[m,y]=u(f),_={...d?.meta??{}},b=a(f),v;if(d?.type==="state")v=te(d.value,{meta:_});else{if(b==null)continue;v=b(y,{path:f,type:d.type,value:d.value,meta:_,deps:g,resolvedDeps:g.map(T=>p.get(T))})}m.add(v,{name:y}),p.set(f,v),l.delete(f),h=!0}}if(l.size>0){let f=[...l.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${f}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return o.restore(e),o}toJSON(){return this.snapshot()}attachStorage(e,n={}){let r=e.map(c=>({tier:c,debounceMs:Math.max(0,c.debounceMs??0),compactEvery:Math.max(1,c.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));n.autoRestore===!0&&this._cascadeRestore(e,n.onError);let s=(c,l)=>{if(c.disposed)return;let p=ir(l.nodes);if(c.lastSnapshot!=null&&p!==""&&p===c.lastFingerprint)return;let h=c.seq+1,f=Ee(),m=c.lastSnapshot==null||h%c.compactEvery===0?{mode:"full",snapshot:l,seq:h,timestamp_ns:f,format_version:he}:{mode:"diff",diff:Tr(c.lastSnapshot,l),seq:h,timestamp_ns:f,format_version:he};if(c.tier.filter&&!c.tier.filter(this.name,m))return;let y;try{y=c.tier.save(this.name,m)}catch(_){n.onError?.(_,c.tier);return}if(y&&typeof y.then=="function"){let v=(c.savePending??Promise.resolve()).then(()=>y,()=>y).then(()=>{c.disposed||(c.seq=h,c.lastSnapshot=l,c.lastFingerprint=p)},T=>{n.onError?.(T,c.tier)});c.savePending=v.finally(()=>{c.savePending===v&&(c.savePending=void 0)})}else c.seq=h,c.lastSnapshot=l,c.lastFingerprint=p},o=(c,l)=>{try{s(c,l)}catch(p){n.onError?.(p,c.tier)}},i=(c,l)=>{if(!l.some(d=>{let g=this.config.messageTier(d[0]);return g>=3&&g<5}))return;if(n.filter){let d=this.tryResolve(c);if(d==null)return;let g=dt(d,Ge("standard"));if(!n.filter(c,g))return}let h,f=()=>(h==null&&(h=this.snapshot()),h);for(let d of r)d.disposed||(d.debounceMs===0?o(d,f()):(d.timer==null&&(d.timer=new Ie),d.timer.start(d.debounceMs,()=>{d.disposed||o(d,this.snapshot())})))},a;if(n.paths!=null){let l=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(p=>{let h=this.tryResolve(p);return h==null?()=>{}:h.subscribe(f=>i(p,f))});a=()=>{for(let p of l)p()}}else a=this.observe().subscribe((c,l)=>i(c,l));let u=()=>{a();for(let c of r)c.disposed=!0,c.timer?.cancel();this._storageDisposers.delete(u)};return this._storageDisposers.add(u),{dispose:u}}async _cascadeRestore(e,n){for(let r of e){let s;try{s=await r.load(this.name)}catch(i){n?.(i,r);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===he&&o.nodes!=null)return this.restore(o),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let s of n){let o;try{o=await s.load(e)}catch(u){r?.onError?.(u,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===he&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(u){r?.onError?.(u,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${n.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,n,r){if(e!=null&&n!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,n),this.config.inspectorEnabled){let s={path:e,annotation:n,timestamp_ns:j(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(s)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let n=this._traceRing.toArray().filter(s=>!e(s)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let s of n)this._traceRing.push(s);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),s=new Set(Object.keys(n.nodes)),o=[...s].filter(_=>!r.has(_)).sort(),i=[...r].filter(_=>!s.has(_)).sort(),a=[],u=[];for(let _ of r){if(!s.has(_))continue;let b=e.nodes[_],v=n.nodes[_],T=b.v,x=v.v;T!=null&&x!=null&&T.id===x.id&&T.version!==x.version&&u.push({path:_,id:T.id,from:T.version,to:x.version});let w=T!=null&&x!=null&&T.id===x.id&&T.version===x.version;for(let E of["type","status","sentinel"]){let N=b[E],A=v[E];N!==A&&a.push({path:_,field:E,from:N,to:A})}if(!w)for(let E of["value","meta"]){let N=b[E],A=v[E];ar(N,A)||a.push({path:_,field:E,from:N,to:A})}}let c=_=>`${_.from} ${_.to}`,l=new Set(e.edges.map(c)),p=new Set(n.edges.map(c)),h=n.edges.filter(_=>!l.has(c(_))),f=e.edges.filter(_=>!p.has(c(_))),d=new Set(e.subgraphs),g=new Set(n.subgraphs),m=[...g].filter(_=>!d.has(_)).sort(),y=[...d].filter(_=>!g.has(_)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:u,edgesAdded:h,edgesRemoved:f,subgraphsAdded:m,subgraphsRemoved:y}}};function Tr(t,e){let n=ge.diff(t,e),r={};for(let s of n.nodesAdded){let o=e.nodes[s];o!=null&&(r[s]=o)}return{...n,nodesAddedFull:r}}function sn(t,e,n,r={}){let s={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?s:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=r.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return r.withDetail?s:[];let i=new Map,a=new Map,u=new Map,c=new Map,l=new Set;for(let[b,v]of Object.entries(t.nodes)){if(!b)continue;l.add(b);let T=v.deps??[];i.set(b,T);for(let x of T)x&&(l.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(b))}for(let b of t.edges){if(b==null||typeof b!="object")continue;let v=typeof b.from=="string"?b.from:"",T=typeof b.to=="string"?b.to:"";!v||!T||(l.add(v),l.add(T),c.has(v)||c.set(v,new Set),c.get(v).add(T),u.has(T)||u.set(T,new Set),u.get(T).add(v))}if(!l.has(e))return r.withDetail?s:[];let p=r.both===!0,h=b=>{if(p){let w=i.get(b)??[],E=u.get(b),N=a.get(b),A=c.get(b),R=[...w];return E&&R.push(...E),N&&R.push(...N),A&&R.push(...A),R}if(n==="upstream"){let w=i.get(b)??[],E=u.get(b);return E?[...w,...E]:w}let v=a.get(b),T=c.get(b),x=v?[...v]:[];return T&&x.push(...T),x},f=new Set([e]),d=new Map,g=[{path:e,depth:0}],m=0,y=!1;for(;m<g.length;){let b=g[m++];if(o!=null&&b.depth>=o){h(b.path).length>0&&(y=!0);continue}for(let v of h(b.path))!v||f.has(v)||(f.add(v),d.set(v,b.depth+1),g.push({path:v,depth:b.depth+1}))}let _=[...d.keys()].sort((b,v)=>b<v?-1:b>v?1:0);return r.withDetail?{paths:_,depths:d,truncated:y}:_}function Er(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.path!==s.path||r.type!==s.type||r.status!==s.status||r.hop!==s.hop||r.dep_index!==s.dep_index||r.annotation!==s.annotation||r.value!==s.value||r.lastMutation!==s.lastMutation)return!1;let o=r.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}function mt(t,e,n,r=0){if(!Number.isFinite(t))return r;if(!Number.isFinite(e)||e<=0||!Number.isFinite(n)||n<=0)return Math.max(r,t);let s=t*Math.exp(-n*e);return Math.max(r,s)}function ln(t){if(t!==void 0&&t<1)throw new RangeError("maxSize must be >= 1")}function ne(t){return new Map(t)}function $(t){return t.cache??new Map}function ze(t){return t.cache??[]}function Or(t,e){let n=Math.max(t.length,e.length),r=0,s=0,o=0;for(let i=0;i<n;i+=1){let a=t[i]??0,u=e[i]??0;r+=a*u,s+=a*a,o+=u*u}return s===0||o===0?0:r/Math.sqrt(s*o)}function Nr(t={}){let e=t.maxSize,n=t.policy??"fifo";ln(e);let r=te(new Map,{name:t.name,describeKind:"state"});function s(i){if(e!==void 0)for(;i.size>e;){let a;for(let u of i.values()){if(!a){a=u;continue}let c=n==="lru"?u.lastAccessNs:u.createdAtNs,l=n==="lru"?a.lastAccessNs:a.createdAtNs;c<l&&(a=u)}if(!a)break;i.delete(a.id)}}function o(i){r.emit(i)}return{entries:r,upsert(i,a){let u=j(),c=$(r),l=c.get(i),p=ne(c);p.set(i,{id:i,value:a,createdAtNs:l?.createdAtNs??u,lastAccessNs:u}),s(p),o(p)},remove(i){let a=ne($(r));a.delete(i)&&o(a)},clear(){$(r).size!==0&&o(new Map)},get(i){let a=$(r),u=a.get(i);if(u){if(n==="lru"){let c=j(),l=ne(a);l.set(i,{...u,lastAccessNs:c}),o(l)}return u.value}},has(i){return $(r).has(i)}}}function Rr(t,e={}){let n=e.maxSize,r=e.policy??"lru",s=e.decayRate??0,o=e.minScore??0,i=e.score??(()=>1);ln(n);let a=new ge(t),u=te(new Map,{name:"items",describeKind:"state"}),c=ue([u],([g])=>{let m=g??new Map,y=j(),_=[...m.values()].map(b=>{let v=(y-b.lastAccessNs)/1e9;return{...b,score:mt(b.baseScore,v,s,o)}});return _.sort((b,v)=>v.score-b.score||v.lastAccessNs-b.lastAccessNs),_},{name:"ranked",describeKind:"derived"}),l=ue([u],([g])=>(g??new Map).size,{name:"size",describeKind:"derived",initial:0});c.subscribe(()=>{}),l.subscribe(()=>{}),a.add(u,{name:"items"}),a.add(c,{name:"ranked"}),a.add(l,{name:"size"});function p(g,m){let y=(m-g.lastAccessNs)/1e9;return mt(g.baseScore,y,s,o)}function h(g){if(n!==void 0)for(;g.size>n;){let m=j(),y,_=Number.POSITIVE_INFINITY;for(let b of g.values()){let v=p(b,m);if(v<_){y=b,_=v;continue}if(v===_&&y){let T=r==="lru"?b.lastAccessNs:b.createdAtNs,x=r==="lru"?y.lastAccessNs:y.createdAtNs;T<x&&(y=b)}}if(!y)break;g.delete(y.id)}}function f(g){u.emit(g)}return Object.assign(a,{upsert(g,m,y){let _=j(),b=$(u),v=b.get(g),T=y?.score??i(m),x=ne(b);x.set(g,{id:g,value:m,baseScore:T,createdAtNs:v?.createdAtNs??_,lastAccessNs:_}),h(x),f(x)},remove(g){let m=ne($(u));m.delete(g)&&f(m)},clear(){$(u).size!==0&&f(new Map)},getItem(g){let m=$(u),y=m.get(g);if(y){if(r==="lru"){let _=ne(m);_.set(g,{...y,lastAccessNs:j()}),f(_)}return y}}})}function kr(t={}){let e=t.backend??"flat",n=t.dimension,r;if(e==="hnsw"&&(r=t.hnswFactory?.(),!r))throw new Error('vectorIndex backend "hnsw" requires an optional dependency adapter; install your HNSW package and provide `hnswFactory`.');let s=te(new Map,{describeKind:"state",name:"vector-index"});function o(a){if(n!==void 0&&a.length!==n)throw new RangeError(`vector dimension mismatch: expected ${n}, got ${a.length}`)}function i(a){s.emit(a)}return{backend:e,entries:s,upsert(a,u,c){o(u);let l=ne($(s));l.set(a,{id:a,vector:[...u],meta:c}),e==="hnsw"&&r.upsert(a,u,c),i(l)},remove(a){let u=ne($(s));u.delete(a)&&(e==="hnsw"&&r.remove(a),i(u))},clear(){$(s).size!==0&&(e==="hnsw"&&r.clear(),i(new Map))},search(a,u=5){return o(a),u<=0?[]:e==="hnsw"?r.search(a,u):[...$(s).values()].map(l=>({id:l.id,score:Or(a,l.vector),meta:l.meta})).sort((l,p)=>p.score-l.score).slice(0,u)}}}function Sr(t){let e=new ge(t),n=te(new Map,{name:"entities",describeKind:"state"}),r=te([],{name:"edges",describeKind:"state"}),s=ue([r],([u])=>{let c=u??[],l=new Map;for(let p of c){let h=l.get(p.from)??[];l.set(p.from,Object.freeze([...h,p]))}return l},{name:"adjacency",describeKind:"derived",initial:new Map});s.subscribe(()=>{}),e.add(n,{name:"entities"}),e.add(r,{name:"edges"}),e.add(s,{name:"adjacency"});function o(u){n.emit(u)}function i(u){r.emit(u)}return Object.assign(e,{upsertEntity(u,c){let l=ne($(n));l.set(u,c),o(l)},removeEntity(u){let c=ne($(n)),l=c.delete(u),p=ze(r),h=p.filter(f=>f.from!==u&&f.to!==u);!l&&h.length===p.length||(o(c),i(h))},link(u,c,l,p=1){let h=`${u}\0${c}\0${l}`,f=ze(r),d=new Set(f.map(m=>`${m.from}\0${m.to}\0${m.relation}`)),g=[...f];if(d.has(h))for(let m=0;m<g.length;m+=1){let y=g[m];if(y.from===u&&y.to===c&&y.relation===l){g[m]={...y,weight:p};break}}else g.push({from:u,to:c,relation:l,weight:p});i(g)},unlink(u,c,l){let p=ze(r),h=p.filter(f=>l===void 0?!(f.from===u&&f.to===c):!(f.from===u&&f.to===c&&f.relation===l));h.length!==p.length&&i(h)},related(u,c){return ze(r).filter(l=>(l.from===u||l.to===u)&&(c===void 0||l.relation===c))}})}0&&(module.exports={collection,decay,knowledgeGraph,lightCollection,vectorIndex});
|
|
7
|
+
`)}function mr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Be(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let s=t.indexOf("]",n+1);if(s<=n+1){e+="\\[";continue}let o=t.slice(n+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),e+=`[${o}]`,n=s;continue}e+=mr(r)}return e+="$",new RegExp(e)}var br={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},yr={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function je(t){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean"||t==null)return String(t);try{return JSON.stringify(t)}catch{return"[unserializable]"}}function vr(t){return t==="none"?yr:t==="ansi"||t==null?br:{data:t.data??"",dirty:t.dirty??"",resolved:t.resolved??"",invalidate:t.invalidate??"",pause:t.pause??"",resume:t.resume??"",complete:t.complete??"",error:t.error??"",teardown:t.teardown??"",derived:t.derived??"",path:t.path??"",reset:t.reset??""}}function rn(t){if(t==null)return{};let e=t.detail;return e==="full"?{...t,structured:t.structured??!0,timeline:t.timeline??!0,causal:t.causal??!0,derived:t.derived??!0}:e==="minimal"?{...t,structured:t.structured??!0}:t.format==="stage-log"?{...t,structured:t.structured??!0,timeline:t.timeline??!0}:t}function _r(t,e,n){for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s<32||s===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function ht(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(D))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${D}' (path separator)`);if(t===X)throw new Error(`Graph "${e}": ${n} name "${X}" is reserved for meta companion paths`);_r(t,e,n)}function xr(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(D);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function wr(t,e){let n=!1;for(let s of t)if(!e.isMetaPassthrough(s[0])){n=!0;break}return n?t.filter(s=>e.isMetaPassthrough(s[0])):t}function cn(t){for(let e of t._mounts.values())cn(e);for(let e of t._nodes.values())try{e.down([[H]],{internal:!0})}catch{}}var ge=class t{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_destroyed=!1;_topology;_topologyEmitters=new Set;constructor(e,n){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(D))throw new Error(`Graph name must not contain '${D}' (got "${e}")`);if(e===X)throw new Error(`Graph name "${X}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??pe,this._traceRing=new we(n?.traceCapacity??1e3),n?.versioning!=null&&this.setVersioning(n.versioning)}ancestors(e=!0){let n=[],r=e?this:this._parent;for(;r!=null;)n.push(r),r=r._parent;return n}get topology(){return this._topology==null&&(this._topology=It(e=>{let n=r=>{e.emit(r)};return this._topologyEmitters.add(n),()=>{this._topologyEmitters.delete(n)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let n of this._topologyEmitters)n(e)}nameOf(e){return this._nodeToName.get(e)}add(e,n){let r=e.name,s=n?.name??r;if(s==null||s==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let o=s,i=n?.annotation;if(ht(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(o,e),this._nodeToName.set(e,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:j()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof I&&n._applyVersioning(e)}remove(e){ht(e,this.name,"remove");let n=this._mounts.get(e);if(n){let o={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,u]of i)a.includes(`${D}${X}${D}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...n._collectSubgraphs(`${e}${D}`)),this._mounts.delete(e),n._parent=void 0,cn(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:o}),o}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[H]],{internal:!0});let s={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:s}),s}removeAll(e){let n=typeof e=="function"?e:(()=>{let o=Be(e);return i=>o.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>n(o));for(let o of s){let i=this.remove(o);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),n=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let s=e[r++];return{value:[s,n.get(s)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(D))return this.resolve(e);let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return n}get(e){return this.node(e).cache}set(e,n,r){let s=r?.internal===!0;this.node(e).down([[V,n]],{actor:r?.actor,internal:s,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);Tt(()=>{for(let[s,o]of r)this.set(s,o,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[Y]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let s=r?.internal===!0;this.node(e).down([[P,n]],{actor:r?.actor,internal:s,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[J]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[u,c]of this._nodes)r.set(c,u);let a=[];for(let[u,c]of this._nodes)if(c instanceof I)for(let l of c._deps){let p=r.get(l.node);p!=null&&a.push([p,u])}return a.sort((u,c)=>u[0]<c[0]?-1:u[0]>c[0]?1:u[1]<c[1]?-1:u[1]>c[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,u]of s)o.set(u,a);let i=[];for(let[a,u]of s)if(u instanceof I)for(let c of u._deps){let l=o.get(c.node);l!=null&&i.push([l,a])}return i.sort((a,u)=>a[0]<u[0]?-1:a[0]>u[0]?1:a[1]<u[1]?-1:a[1]>u[1]?1:0),i}mount(e,n){if(n===void 0){let s=new t(e);return this.mount(e,s)}if(typeof n=="function"){let s=new t(e);return n(s),this.mount(e,s)}let r=n;if(ht(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(r===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(r._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${r._parent.name}"`);for(let s=this;s!=null;s=s._parent)if(s===r)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,r),r._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),r}resolve(e){let n=xr(e,this.name);return this._resolveFromSegments(n)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let n=e;if(n[0]===this.name&&(n=n.slice(1),n.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=n[0],s=n.slice(1);if(s.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let o=this._nodes.get(r);if(o&&s.length>0&&s[0]===X)return this._resolveMetaChainFromNode(o,s,n.join(D));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${s.join(D)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(s.join(D))}_resolveMetaChainFromNode(e,n,r){let s=e,o=0,i=[...n];for(;o<i.length;){if(i[o]!==X)throw new Error(`Graph "${this.name}": expected ${X} segment in meta path "${r}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${X} in "${r}"`);let a=i[o+1],u=s.meta[a];if(!u)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);s=u,o+=2}return s}signal(e,n){if(n?.internal!==!0){for(let s of e)if(this.config.messageTier(s[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,n??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,n,r,s){for(let u of this._mounts.values())u._signalDeliver(e,n,r,s);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=wr(e,this.config);for(let u of[...this._nodes.keys()].sort()){let c=this._nodes.get(u);if(!r.has(c)){r.add(c);try{c.down(e,i)}catch(l){if(l instanceof K)throw l;s.push(l)}a.length!==0&&this._signalMetaSubtree(c,a,r,i,s)}}}_signalMetaSubtree(e,n,r,s,o){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(n,s)}catch(u){if(u instanceof K)throw u;o.push(u)}this._signalMetaSubtree(a,n,r,s,o)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,s=Ge(e?.detail,e?.fields),o=e?.format==="spec",i=o?Ge("minimal"):s,a=[];this._collectObserveTargets("",a);let u=new Map;for(let[x,w]of a)u.set(w,x);let c=[];{let x=a.map(([,N])=>N),w=new Set(u.values()),E=0;for(;x.length>0;){let N=x.shift();if(N instanceof I)for(let A of N._deps){let R=A.node;if(u.has(R))continue;let S=R.name??"",k=S;if(!k||w.has(k))if(S){let G=2;for(;w.has(`${S}#${G}`);)G++;k=`${S}#${G}`}else for(k=`__internal__/${E++}`;w.has(k);)k=`__internal__/${E++}`;u.set(R,k),w.add(k),c.push([k,R]),x.push(R)}}}let l=[...a,...c],p={};for(let[x,w]of l){if(n!=null&&!w.allowsObserve(n))continue;let E=dt(w,i),N=w instanceof I?w._deps.map(k=>u.get(k.node)??k.node.name??""):[],{name:A,...R}=E,S={...R,deps:N};if(!o){let k=this._annotations.get(x);k!=null&&(S.annotation=k)}if(r!=null)if(typeof r=="function"){let k=r;if(!(k.length>=2?k(x,S):k(S)))continue}else{let k=!0;for(let[G,B]of Object.entries(r)){let q=G==="deps_includes"?"depsIncludes":G==="meta_has"?"metaHas":G;if(q==="depsIncludes"){if(!S.deps.includes(String(B))){k=!1;break}continue}if(q==="metaHas"){if(!Object.hasOwn(S.meta??{},String(B))){k=!1;break}continue}if(S[q]!==B){k=!1;break}}if(!k)continue}p[x]=S}let h=new Set(Object.keys(p)),f=[];for(let[x,w]of l)if(w instanceof I)for(let E of w._deps){let N=u.get(E.node);N!=null&&f.push([N,x])}f.sort((x,w)=>x[0]<w[0]?-1:x[0]>w[0]?1:x[1]<w[1]?-1:x[1]>w[1]?1:0);let d=f.map(([x,w])=>({from:x,to:w}));(n!=null||r!=null)&&(d=d.filter(x=>h.has(x.from)&&h.has(x.to)));let g=this._collectSubgraphs(""),m=n!=null||r!=null?g.filter(x=>{let w=`${x}${D}`;return[...h].some(E=>E===x||E.startsWith(w))}):g,y=this,_=e,b={name:this.name,nodes:p,edges:d,subgraphs:m,expand(x){let w={..._,format:void 0};return Array.isArray(x)?(w.fields=x,w.detail=void 0):(w.detail=x,w.fields=void 0),y.describe(w)}},v=e??{},T=v.format;return T==="json"?dr(b,v):T==="pretty"?fr(b,v):T==="mermaid"?un(b,v):T==="mermaid-url"?pr(b,v):T==="d2"?gr(b,v):T==="ascii"?qt(b,v):b}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${r}`;n.push(s),n.push(...this._mounts.get(r)._collectSubgraphs(`${s}${D}`))}return n}resourceProfile(e){return en(this,e)}reachable(e,n,r={}){return r.withDetail===!0?sn(this.describe(),e,n,{...r,withDetail:!0}):sn(this.describe(),e,n,r)}explain(e,n,r){return r?.reactive===!0?this._explainReactive(e,n,r):this._explainStatic(e,n,r)}_explainStatic(e,n,r){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,u]of Object.entries(s.nodes))u.lastMutation!=null&&i.set(a,u.lastMutation);return Yt(s,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",s=0,o=te(s,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,c=()=>{a||u||(a=!0,ve(()=>{a=!1,!u&&(s+=1,o.emit(s))}))},l=i.onEvent(m=>{let y=m.type;y!=="data"&&y!=="error"&&y!=="complete"&&y!=="teardown"||c()}),p=[],h=new WeakSet,f=m=>{if(h.has(m)||u)return;h.add(m);let y=m.topology.subscribe(_=>{for(let b of _){if(b[0]!==V)continue;let v=b[1];if(c(),v.kind==="added"&&v.nodeKind==="mount"){let T=m._mounts.get(v.name);T!=null&&f(T)}}});p.push(y);for(let _ of m._mounts.keys()){let b=m._mounts.get(_);b!=null&&f(b)}};f(this);let d;try{d=ue([o],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(m,y)=>m===y})}catch(m){l();for(let y of p)y();throw i.dispose(),m}let g=ft(d);return{node:d,dispose(){u=!0,l();for(let m of p)m();p.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let s=0,o=te(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,c=i.onEvent(f=>{let d=f.type;d!=="data"&&d!=="error"&&d!=="complete"&&d!=="teardown"||a||u||(a=!0,ve(()=>{a=!1,!u&&(s+=1,o.emit(s))}))}),l={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},p;try{p=ue([o],()=>this._explainStatic(e,n,l),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(f,d)=>f.found===d.found&&f.reason===d.reason&&f.steps.length===d.steps.length&&Er(f.steps,d.steps)})}catch(f){throw c(),i.dispose(),f}let h=ft(p);return{node:p,dispose(){u=!0,c(),i.dispose(),h()}}}_pathsMatching(e){let n=Be(e),r=[];return this._collectObserveTargets("",r),r.map(([s])=>s).filter(s=>n.test(s))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${D}${r}`;this._mounts.get(r)._collectObserveTargets(s,n)}for(let r of[...this._nodes.keys()].sort()){let s=this._nodes.get(r),o=e===""?r:`${e}${D}${r}`;n.push([o,s]),this._appendMetaObserveTargets(o,s,n)}}_appendMetaObserveTargets(e,n,r){for(let s of Object.keys(n.meta).sort()){let o=n.meta[s],i=`${e}${D}${X}${D}${s}`;r.push([i,o]),this._appendMetaObserveTargets(i,o,r)}}observe(e,n){let r=typeof e=="string",o=rn(r?n:e),i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(r){let l=e,p=this.resolve(l);if(a!=null&&!p.allowsObserve(a))throw new K({actor:a,action:"observe",nodeName:l});return i?this._buildStructuredObserver([[l,p]],o,"one"):{subscribe(h){return p.subscribe(h)},up(h){try{p.up?.(h)}catch(f){if(f instanceof K)return;throw f}}}}let u=[];this._collectObserveTargets("",u),u.sort((l,p)=>l[0]<p[0]?-1:l[0]>p[0]?1:0);let c=a==null?u:u.filter(([,l])=>l.allowsObserve(a));return i?this._buildStructuredObserver(c,o,"all"):{subscribe:l=>{let p=c.map(([h,f])=>f.subscribe(d=>{l(h,d)}));return()=>{for(let h of p)h()}},up:(l,p)=>{try{this.resolve(l).up?.(p)}catch(h){if(h instanceof K)return;throw h}}}}_buildStructuredObserver(e,n,r){let s=r==="one"?e[0]?.[0]:void 0,o=i=>{if(r==="one"&&s!=null){let l=this.resolve(s);return this._buildStructuredObserver([[s,l]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((l,p)=>l[0]<p[0]?-1:l[0]>p[0]?1:0);let u=i.actor,c=u==null?a:a.filter(([,l])=>l.allowsObserve(u));return this._buildStructuredObserver(c,i,"all")};return this._createObserveResult(e,n,o)}_createObserveResult(e,n,r){let s=n.timeline===!0,o=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",u=this.config.inspectorEnabled,c=(o||i)&&u,l=n.maxEvents,p=l!=null&&l>0?new we(l):null,h=[],f=new Set,d={},g=new Set,m=0,y=0,_=0,b=0,v=0,T=0,x=!1,w=!1,E=0,N=new Map,A=new Map,R=new Map,S=O=>{p?p.push(O):h.push(O);for(let M of f)M(O)},k=()=>s?{timestamp_ns:j(),in_batch:Re(),batch_id:E}:{},G=(O,M)=>{if(!(!c||!(O instanceof I)))return O._setInspectorHook(z=>{if(z.kind==="dep_message")N.set(O,z.depIndex);else if(z.kind==="run"){let me=z.batchData.map((C,F)=>C!=null&&C.length>0?C.at(-1):z.prevData[F]);A.set(O,me);let U=z.batchData.map(C=>C!=null?[...C]:void 0);R.set(O,U),i&&S({type:"derived",path:M,dep_values:me,dep_batches:U,...k()})}})},B=O=>{let M=N.get(O),z=A.get(O);if(!o||z==null)return{};let U=(M!=null&&M>=0&&O instanceof I?O._deps[M]:void 0)?.node,C=U?.v,F=R.get(O);return{trigger_dep_index:M,trigger_dep_name:U?.name,...C!=null?{trigger_version:{id:C.id,version:C.version}}:{},dep_values:[...z],...F!=null?{dep_batches:F}:{}}},q=[],oe=[];for(let[O,M]of e){let z=G(M,O);z&&q.push(z),oe.push(M.subscribe(me=>{E++;for(let U of me){let C=U[0],F=k();if(C===V){d[O]=U[1];let qe=M instanceof I?M.lastMutation?.actor??ce:ce;S({type:"data",path:O,data:U[1],actor:qe,...F,...B(M)})}else if(a)C===Z?m++:C===Q?y++:C===Y?_++:C===ee?b++:C===re?v++:C===H?T++:C===J&&!g.has(O)?x=!0:C===P&&(w=!0,g.add(O));else if(C===Z)m++,S({type:"dirty",path:O,...F});else if(C===Q)y++,S({type:"resolved",path:O,...F,...B(M)});else if(C===Y)_++,S({type:"invalidate",path:O,...F});else if(C===ee)b++,S({type:"pause",path:O,lockId:U[1],...F});else if(C===re)v++,S({type:"resume",path:O,lockId:U[1],...F});else if(C===J)g.has(O)||(x=!0),S({type:"complete",path:O,...F});else if(C===P){w=!0,g.add(O);let qe=M instanceof I?M.lastMutation?.actor??ce:ce;S({type:"error",path:O,data:U[1],actor:qe,...F})}else C===H&&(T++,S({type:"teardown",path:O,...F}))}}))}let Ue=!1,We=()=>{if(!Ue){Ue=!0;for(let O of oe)O();for(let O of q)O();for(let O of Te)O({value:void 0,done:!0});Te.length=0}},Ke=[],Te=[];f.add(O=>{let M=Te.shift();M?M({value:O,done:!1}):Ke.push(O)});let bt={get values(){return d},get dirtyCount(){return m},get resolvedCount(){return y},get invalidateCount(){return _},get pauseCount(){return b},get resumeCount(){return v},get teardownCount(){return T},get events(){return p?p.toArray():[...h]},get anyCompletedCleanly(){return x},get anyErrored(){return w},get completedWithoutErrors(){return x&&!w},onEvent(O){return f.add(O),()=>f.delete(O)},dispose:We,expand(O){We();let M={...n};return typeof O=="string"?M.detail=O:Object.assign(M,O),r(rn(M))},[Symbol.asyncIterator](){return{next(){return Ke.length>0?Promise.resolve({value:Ke.shift(),done:!1}):Ue?Promise.resolve({value:void 0,done:!0}):new Promise(O=>Te.push(O))},return(){return We(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(bt,n),bt}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let s=n.logger??(d=>console.log(d)),o=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=o==null&&i==null?()=>!0:d=>(o==null||o.has(d))&&(i==null||!i.has(d)),u=vr(n.theme),c=r==="stage-log"?j():0,l=d=>d==null?"":n.stageLabels?.[d]??d,p=(d,g)=>d.length>g?`${d.slice(0,g-1)}\u2026`:d,h=d=>d.type==="data"||d.type==="error"?p(je(d.data),120):"",f=d=>{if(r==="stage-log"){let w=(j()-c)/1e9,E=l(d.path).padEnd(9);if(d.type==="data"){let N=h(d);return`[${w.toFixed(3)}s] ${E} \u2190${N?` ${N}`:""}`}if(d.type==="error"){let N=h(d);return`[${w.toFixed(3)}s] ${E} \u2717${N?` ${N}`:""}`}return d.type==="complete"?`[${w.toFixed(3)}s] ${E} \u25A0 complete`:`[${w.toFixed(3)}s] ${E} ${d.type}`}if(r==="json")try{return JSON.stringify(d)}catch{return JSON.stringify({type:d.type,path:d.path,data:"[unserializable]"})}let g=u[d.type]??"",m=d.path?`${u.path}${d.path}${u.reset} `:"",y=d.type==="data"||d.type==="error",_=d.type==="pause"||d.type==="resume",b=y?` ${je(d.data)}`:_?` ${je(d.lockId)}`:"",v=d.type==="data"||d.type==="resolved"||d.type==="derived"?d:void 0,T=v?.trigger_dep_name!=null?` <- ${v.trigger_dep_name}`:v?.trigger_dep_index!=null?` <- #${v.trigger_dep_index}`:"",x=d.in_batch?" [batch]":"";return`${m}${g}${d.type.toUpperCase()}${u.reset}${b}${T}${x}`};e.onEvent(d=>{a(d.type)&&s(f(d),d)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){tn(this._disposers,this.name),this.signal([[H]],{internal:!0}),tn(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}get destroyed(){return this._destroyed}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}snapshot(e){let{expand:n,...r}=this.describe({detail:"full"}),s={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:u,guard:c,...l}=r.nodes[a];s[a]=l}let o=[...r.subgraphs].sort(),i={...r,version:1,nodes:s,subgraphs:o};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return vt(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??pe,{codec:s,codecVersion:o,payload:i}=_t(e,r);return s.decode(i,o)}restore(e,n){if(nn(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=n?.only==null?null:(Array.isArray(n.only)?n.only:[n.only]).map(o=>Be(o)),s=n?.includeProducers===!0;for(let o of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(o)))continue;let i=e.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let u=this.tryResolve(o)?.v;if(u!=null&&u.id===i.v.id&&u.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){n?.onError?.(o,a)}}}}}static fromSnapshot(e,n){nn(e);let r=typeof n=="function"?n:n?.build,s=typeof n=="function"?void 0:n?.factories,o=new t(e.name);if(r)return r(o),o.restore(e),o;for(let f of[...e.subgraphs].sort((d,g)=>{let m=d.split(D).length,y=g.split(D).length;return m!==y?m-y:d<g?-1:d>g?1:0})){let d=f.split(D),g=o;for(let m of d)g._mounts.has(m)||g.mount(m,new t(m)),g=g._mounts.get(m)}let i=s?Object.entries(s).map(([f,d])=>({re:Be(f),factory:d})):[],a=f=>{for(let d of i)if(d.re.test(f))return d.factory},u=f=>{let d=f.split(D),g=d.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${f}"`);let m=o;for(let y of d){let _=m._mounts.get(y);if(!_)throw new Error(`unknown mount "${y}" in path "${f}"`);m=_}return[m,g]},c=Object.entries(e.nodes).filter(([f])=>!f.includes(`${D}${X}${D}`)).sort((f,d)=>f[0]<d[0]?-1:f[0]>d[0]?1:0),l=new Map(c),p=new Map,h=!0;for(;l.size>0&&h;){h=!1;for(let[f,d]of[...l.entries()]){let g=d?.deps??[];if(!g.every(T=>p.has(T)))continue;let[m,y]=u(f),_={...d?.meta??{}},b=a(f),v;if(d?.type==="state")v=te(d.value,{meta:_});else{if(b==null)continue;v=b(y,{path:f,type:d.type,value:d.value,meta:_,deps:g,resolvedDeps:g.map(T=>p.get(T))})}m.add(v,{name:y}),p.set(f,v),l.delete(f),h=!0}}if(l.size>0){let f=[...l.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${f}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return o.restore(e),o}toJSON(){return this.snapshot()}attachSnapshotStorage(e,n={}){let r=e.map(c=>({tier:c,debounceMs:Math.max(0,c.debounceMs??0),compactEvery:Math.max(1,c.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));n.autoRestore===!0&&this._cascadeRestore(e,n.onError);let s=(c,l)=>{if(c.disposed)return;let p=ir(l.nodes);if(c.lastSnapshot!=null&&p!==""&&p===c.lastFingerprint)return;let h=c.seq+1,f=Ee(),m=c.lastSnapshot==null||h%c.compactEvery===0?{name:this.name,mode:"full",snapshot:l,seq:h,timestamp_ns:f,format_version:he}:{name:this.name,mode:"diff",diff:Tr(c.lastSnapshot,l),seq:h,timestamp_ns:f,format_version:he};if(c.tier.filter&&!c.tier.filter(m))return;let y;try{y=c.tier.save(m)}catch(_){n.onError?.(_,c.tier);return}if(y&&typeof y.then=="function"){let v=(c.savePending??Promise.resolve()).then(()=>y,()=>y).then(()=>{c.disposed||(c.seq=h,c.lastSnapshot=l,c.lastFingerprint=p)},T=>{n.onError?.(T,c.tier)});c.savePending=v.finally(()=>{c.savePending===v&&(c.savePending=void 0)})}else c.seq=h,c.lastSnapshot=l,c.lastFingerprint=p},o=(c,l)=>{try{s(c,l)}catch(p){n.onError?.(p,c.tier)}},i=(c,l)=>{if(!l.some(d=>{let g=this.config.messageTier(d[0]);return g>=3&&g<5}))return;if(n.filter){let d=this.tryResolve(c);if(d==null)return;let g=dt(d,Ge("standard"));if(!n.filter(c,g))return}let h,f=()=>(h==null&&(h=this.snapshot()),h);for(let d of r)d.disposed||(d.debounceMs===0?o(d,f()):(d.timer==null&&(d.timer=new Ie),d.timer.start(d.debounceMs,()=>{d.disposed||o(d,this.snapshot())})))},a;if(n.paths!=null){let l=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(p=>{let h=this.tryResolve(p);return h==null?()=>{}:h.subscribe(f=>i(p,f))});a=()=>{for(let p of l)p()}}else a=this.observe().subscribe((c,l)=>i(c,l));let u=()=>{a();for(let c of r)c.disposed=!0,c.timer?.cancel();this._storageDisposers.delete(u)};return this._storageDisposers.add(u),{dispose:u}}async _cascadeRestore(e,n){for(let r of e){let s;try{s=await r.load?.()}catch(i){n?.(i,r);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===he&&o.nodes!=null)return this.restore(o),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let s of n){let o;try{o=await s.load?.()}catch(u){r?.onError?.(u,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===he&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(u){r?.onError?.(u,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${n.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,n,r){if(e!=null&&n!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,n),this.config.inspectorEnabled){let s={path:e,annotation:n,timestamp_ns:j(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(s)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let n=this._traceRing.toArray().filter(s=>!e(s)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let s of n)this._traceRing.push(s);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),s=new Set(Object.keys(n.nodes)),o=[...s].filter(_=>!r.has(_)).sort(),i=[...r].filter(_=>!s.has(_)).sort(),a=[],u=[];for(let _ of r){if(!s.has(_))continue;let b=e.nodes[_],v=n.nodes[_],T=b.v,x=v.v;T!=null&&x!=null&&T.id===x.id&&T.version!==x.version&&u.push({path:_,id:T.id,from:T.version,to:x.version});let w=T!=null&&x!=null&&T.id===x.id&&T.version===x.version;for(let E of["type","status","sentinel"]){let N=b[E],A=v[E];N!==A&&a.push({path:_,field:E,from:N,to:A})}if(!w)for(let E of["value","meta"]){let N=b[E],A=v[E];ar(N,A)||a.push({path:_,field:E,from:N,to:A})}}let c=_=>`${_.from} ${_.to}`,l=new Set(e.edges.map(c)),p=new Set(n.edges.map(c)),h=n.edges.filter(_=>!l.has(c(_))),f=e.edges.filter(_=>!p.has(c(_))),d=new Set(e.subgraphs),g=new Set(n.subgraphs),m=[...g].filter(_=>!d.has(_)).sort(),y=[...d].filter(_=>!g.has(_)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:u,edgesAdded:h,edgesRemoved:f,subgraphsAdded:m,subgraphsRemoved:y}}};function Tr(t,e){let n=ge.diff(t,e),r={};for(let s of n.nodesAdded){let o=e.nodes[s];o!=null&&(r[s]=o)}return{...n,nodesAddedFull:r}}function sn(t,e,n,r={}){let s={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?s:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=r.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return r.withDetail?s:[];let i=new Map,a=new Map,u=new Map,c=new Map,l=new Set;for(let[b,v]of Object.entries(t.nodes)){if(!b)continue;l.add(b);let T=v.deps??[];i.set(b,T);for(let x of T)x&&(l.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(b))}for(let b of t.edges){if(b==null||typeof b!="object")continue;let v=typeof b.from=="string"?b.from:"",T=typeof b.to=="string"?b.to:"";!v||!T||(l.add(v),l.add(T),c.has(v)||c.set(v,new Set),c.get(v).add(T),u.has(T)||u.set(T,new Set),u.get(T).add(v))}if(!l.has(e))return r.withDetail?s:[];let p=r.both===!0,h=b=>{if(p){let w=i.get(b)??[],E=u.get(b),N=a.get(b),A=c.get(b),R=[...w];return E&&R.push(...E),N&&R.push(...N),A&&R.push(...A),R}if(n==="upstream"){let w=i.get(b)??[],E=u.get(b);return E?[...w,...E]:w}let v=a.get(b),T=c.get(b),x=v?[...v]:[];return T&&x.push(...T),x},f=new Set([e]),d=new Map,g=[{path:e,depth:0}],m=0,y=!1;for(;m<g.length;){let b=g[m++];if(o!=null&&b.depth>=o){h(b.path).length>0&&(y=!0);continue}for(let v of h(b.path))!v||f.has(v)||(f.add(v),d.set(v,b.depth+1),g.push({path:v,depth:b.depth+1}))}let _=[...d.keys()].sort((b,v)=>b<v?-1:b>v?1:0);return r.withDetail?{paths:_,depths:d,truncated:y}:_}function Er(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.path!==s.path||r.type!==s.type||r.status!==s.status||r.hop!==s.hop||r.dep_index!==s.dep_index||r.annotation!==s.annotation||r.value!==s.value||r.lastMutation!==s.lastMutation)return!1;let o=r.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}function mt(t,e,n,r=0){if(!Number.isFinite(t))return r;if(!Number.isFinite(e)||e<=0||!Number.isFinite(n)||n<=0)return Math.max(r,t);let s=t*Math.exp(-n*e);return Math.max(r,s)}function ln(t){if(t!==void 0&&t<1)throw new RangeError("maxSize must be >= 1")}function ne(t){return new Map(t)}function $(t){return t.cache??new Map}function ze(t){return t.cache??[]}function Or(t,e){let n=Math.max(t.length,e.length),r=0,s=0,o=0;for(let i=0;i<n;i+=1){let a=t[i]??0,u=e[i]??0;r+=a*u,s+=a*a,o+=u*u}return s===0||o===0?0:r/Math.sqrt(s*o)}function Nr(t={}){let e=t.maxSize,n=t.policy??"fifo";ln(e);let r=te(new Map,{name:t.name,describeKind:"state"});function s(i){if(e!==void 0)for(;i.size>e;){let a;for(let u of i.values()){if(!a){a=u;continue}let c=n==="lru"?u.lastAccessNs:u.createdAtNs,l=n==="lru"?a.lastAccessNs:a.createdAtNs;c<l&&(a=u)}if(!a)break;i.delete(a.id)}}function o(i){r.emit(i)}return{entries:r,upsert(i,a){let u=j(),c=$(r),l=c.get(i),p=ne(c);p.set(i,{id:i,value:a,createdAtNs:l?.createdAtNs??u,lastAccessNs:u}),s(p),o(p)},remove(i){let a=ne($(r));a.delete(i)&&o(a)},clear(){$(r).size!==0&&o(new Map)},get(i){let a=$(r),u=a.get(i);if(u){if(n==="lru"){let c=j(),l=ne(a);l.set(i,{...u,lastAccessNs:c}),o(l)}return u.value}},has(i){return $(r).has(i)}}}function Rr(t,e={}){let n=e.maxSize,r=e.policy??"lru",s=e.decayRate??0,o=e.minScore??0,i=e.score??(()=>1);ln(n);let a=new ge(t),u=te(new Map,{name:"items",describeKind:"state"}),c=ue([u],([g])=>{let m=g??new Map,y=j(),_=[...m.values()].map(b=>{let v=(y-b.lastAccessNs)/1e9;return{...b,score:mt(b.baseScore,v,s,o)}});return _.sort((b,v)=>v.score-b.score||v.lastAccessNs-b.lastAccessNs),_},{name:"ranked",describeKind:"derived"}),l=ue([u],([g])=>(g??new Map).size,{name:"size",describeKind:"derived",initial:0});c.subscribe(()=>{}),l.subscribe(()=>{}),a.add(u,{name:"items"}),a.add(c,{name:"ranked"}),a.add(l,{name:"size"});function p(g,m){let y=(m-g.lastAccessNs)/1e9;return mt(g.baseScore,y,s,o)}function h(g){if(n!==void 0)for(;g.size>n;){let m=j(),y,_=Number.POSITIVE_INFINITY;for(let b of g.values()){let v=p(b,m);if(v<_){y=b,_=v;continue}if(v===_&&y){let T=r==="lru"?b.lastAccessNs:b.createdAtNs,x=r==="lru"?y.lastAccessNs:y.createdAtNs;T<x&&(y=b)}}if(!y)break;g.delete(y.id)}}function f(g){u.emit(g)}return Object.assign(a,{upsert(g,m,y){let _=j(),b=$(u),v=b.get(g),T=y?.score??i(m),x=ne(b);x.set(g,{id:g,value:m,baseScore:T,createdAtNs:v?.createdAtNs??_,lastAccessNs:_}),h(x),f(x)},remove(g){let m=ne($(u));m.delete(g)&&f(m)},clear(){$(u).size!==0&&f(new Map)},getItem(g){let m=$(u),y=m.get(g);if(y){if(r==="lru"){let _=ne(m);_.set(g,{...y,lastAccessNs:j()}),f(_)}return y}}})}function kr(t={}){let e=t.backend??"flat",n=t.dimension,r;if(e==="hnsw"&&(r=t.hnswFactory?.(),!r))throw new Error('vectorIndex backend "hnsw" requires an optional dependency adapter; install your HNSW package and provide `hnswFactory`.');let s=te(new Map,{describeKind:"state",name:"vector-index"});function o(a){if(n!==void 0&&a.length!==n)throw new RangeError(`vector dimension mismatch: expected ${n}, got ${a.length}`)}function i(a){s.emit(a)}return{backend:e,entries:s,upsert(a,u,c){o(u);let l=ne($(s));l.set(a,{id:a,vector:[...u],meta:c}),e==="hnsw"&&r.upsert(a,u,c),i(l)},remove(a){let u=ne($(s));u.delete(a)&&(e==="hnsw"&&r.remove(a),i(u))},clear(){$(s).size!==0&&(e==="hnsw"&&r.clear(),i(new Map))},search(a,u=5){return o(a),u<=0?[]:e==="hnsw"?r.search(a,u):[...$(s).values()].map(l=>({id:l.id,score:Or(a,l.vector),meta:l.meta})).sort((l,p)=>p.score-l.score).slice(0,u)}}}function Sr(t){let e=new ge(t),n=te(new Map,{name:"entities",describeKind:"state"}),r=te([],{name:"edges",describeKind:"state"}),s=ue([r],([u])=>{let c=u??[],l=new Map;for(let p of c){let h=l.get(p.from)??[];l.set(p.from,Object.freeze([...h,p]))}return l},{name:"adjacency",describeKind:"derived",initial:new Map});s.subscribe(()=>{}),e.add(n,{name:"entities"}),e.add(r,{name:"edges"}),e.add(s,{name:"adjacency"});function o(u){n.emit(u)}function i(u){r.emit(u)}return Object.assign(e,{upsertEntity(u,c){let l=ne($(n));l.set(u,c),o(l)},removeEntity(u){let c=ne($(n)),l=c.delete(u),p=ze(r),h=p.filter(f=>f.from!==u&&f.to!==u);!l&&h.length===p.length||(o(c),i(h))},link(u,c,l,p=1){let h=`${u}\0${c}\0${l}`,f=ze(r),d=new Set(f.map(m=>`${m.from}\0${m.to}\0${m.relation}`)),g=[...f];if(d.has(h))for(let m=0;m<g.length;m+=1){let y=g[m];if(y.from===u&&y.to===c&&y.relation===l){g[m]={...y,weight:p};break}}else g.push({from:u,to:c,relation:l,weight:p});i(g)},unlink(u,c,l){let p=ze(r),h=p.filter(f=>l===void 0?!(f.from===u&&f.to===c):!(f.from===u&&f.to===c&&f.relation===l));h.length!==p.length&&i(h)},related(u,c){return ze(r).filter(l=>(l.from===u||l.to===u)&&(c===void 0||l.relation===c))}})}0&&(module.exports={collection,decay,knowledgeGraph,lightCollection,vectorIndex});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import '../../node-
|
|
2
|
-
import '../../graph-
|
|
3
|
-
export { C as CollectionEntry, b as CollectionGraph, c as CollectionOptions, d as CollectionPolicy, H as HnswAdapter, e as KnowledgeEdge, K as KnowledgeGraphGraph, L as LightCollectionBundle, f as LightCollectionEntry, g as LightCollectionOptions, R as RankedCollectionEntry, h as VectorBackend, a as VectorIndexBundle, j as VectorIndexOptions, k as VectorRecord, V as VectorSearchResult, l as collection, m as decay, n as knowledgeGraph, o as lightCollection, v as vectorIndex } from '../../index-
|
|
4
|
-
import '../../meta-
|
|
1
|
+
import '../../node-fSc-hCv8.cjs';
|
|
2
|
+
import '../../graph-kTltt95s.cjs';
|
|
3
|
+
export { C as CollectionEntry, b as CollectionGraph, c as CollectionOptions, d as CollectionPolicy, H as HnswAdapter, e as KnowledgeEdge, K as KnowledgeGraphGraph, L as LightCollectionBundle, f as LightCollectionEntry, g as LightCollectionOptions, R as RankedCollectionEntry, h as VectorBackend, a as VectorIndexBundle, j as VectorIndexOptions, k as VectorRecord, V as VectorSearchResult, l as collection, m as decay, n as knowledgeGraph, o as lightCollection, v as vectorIndex } from '../../index-D9qoEOj_.cjs';
|
|
4
|
+
import '../../meta-BGO6C7K9.cjs';
|
|
5
5
|
import '../../extra/storage-core.cjs';
|
|
6
|
+
import '../../extra/storage-tiers.cjs';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import '../../node-
|
|
2
|
-
import '../../graph-
|
|
3
|
-
export { C as CollectionEntry, b as CollectionGraph, c as CollectionOptions, d as CollectionPolicy, H as HnswAdapter, e as KnowledgeEdge, K as KnowledgeGraphGraph, L as LightCollectionBundle, f as LightCollectionEntry, g as LightCollectionOptions, R as RankedCollectionEntry, h as VectorBackend, a as VectorIndexBundle, j as VectorIndexOptions, k as VectorRecord, V as VectorSearchResult, l as collection, m as decay, n as knowledgeGraph, o as lightCollection, v as vectorIndex } from '../../index-
|
|
4
|
-
import '../../meta-
|
|
1
|
+
import '../../node-fSc-hCv8.js';
|
|
2
|
+
import '../../graph-Cv-8x0ZI.js';
|
|
3
|
+
export { C as CollectionEntry, b as CollectionGraph, c as CollectionOptions, d as CollectionPolicy, H as HnswAdapter, e as KnowledgeEdge, K as KnowledgeGraphGraph, L as LightCollectionBundle, f as LightCollectionEntry, g as LightCollectionOptions, R as RankedCollectionEntry, h as VectorBackend, a as VectorIndexBundle, j as VectorIndexOptions, k as VectorRecord, V as VectorSearchResult, l as collection, m as decay, n as knowledgeGraph, o as lightCollection, v as vectorIndex } from '../../index-CI_yjtua.js';
|
|
4
|
+
import '../../meta-CC6EPdpK.js';
|
|
5
5
|
import '../../extra/storage-core.js';
|
|
6
|
+
import '../../extra/storage-tiers.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../../chunk-GWOKTENT.js";import"../../chunk-5KPIYVCC.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-533RQFF6.js";import"../../chunk-MQZWA3DF.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{c as collection,a as decay,e as knowledgeGraph,b as lightCollection,d as vectorIndex};
|