@graphrefly/graphrefly 0.34.0 → 0.36.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-3U7IIQB2.js +1 -0
- package/dist/{chunk-YDWTVO4E.js → chunk-44QWWUA3.js} +1 -1
- package/dist/chunk-5CPPC75H.js +1 -0
- package/dist/chunk-5CZ3KIRJ.js +1 -0
- package/dist/chunk-5KPIYVCC.js +7 -0
- package/dist/{chunk-WBWBY6LI.js → chunk-5RTZ6DXG.js} +1 -1
- package/dist/{chunk-IPNJDNE7.js → chunk-5Z3AFBN7.js} +1 -1
- package/dist/{chunk-C5DINHNP.js → chunk-6G5YD37E.js} +1 -1
- package/dist/{chunk-TONEKQM3.js → chunk-7LYIKMW5.js} +1 -1
- package/dist/chunk-A5HZZYRK.js +1 -0
- package/dist/{chunk-CJMFZXIZ.js → chunk-AACJX2L7.js} +1 -1
- package/dist/chunk-AQC53OWG.js +1 -0
- package/dist/chunk-CE72X3WO.js +1 -0
- package/dist/chunk-CGA5RXO6.js +1 -0
- package/dist/chunk-D5RFJOZ2.js +1 -0
- package/dist/chunk-DBPFMCVH.js +1 -0
- package/dist/chunk-F36TA3ET.js +1 -0
- 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-GAOX6OPT.js → chunk-I57VSGRB.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-K5ZXJPWU.js +5 -0
- package/dist/{chunk-TZLEMGAK.js → chunk-KCE6WWJE.js} +2 -2
- package/dist/chunk-KL7CILPL.js +1 -0
- package/dist/chunk-KUVDFOJH.js +1 -0
- package/dist/{chunk-PBN426RU.js → chunk-LO3LO2TO.js} +1 -1
- package/dist/chunk-MQZWA3DF.js +1 -0
- package/dist/chunk-MYFR67PY.js +18 -0
- package/dist/{chunk-65WWQ5CB.js → chunk-N2GCKKKH.js} +5 -5
- package/dist/{chunk-KN2UMFT6.js → chunk-PCD2MU7X.js} +1 -1
- package/dist/{chunk-SFIM774L.js → chunk-PYEIPRSZ.js} +1 -1
- package/dist/chunk-Q7EUZ6NN.js +1 -0
- package/dist/{chunk-U2T2XWDA.js → chunk-QKUWS7CO.js} +1 -1
- package/dist/{chunk-Q46YJCQH.js → chunk-T6RPUERH.js} +1 -1
- package/dist/chunk-TQSTS3BY.js +1 -0
- package/dist/chunk-VN6RDSK2.js +1 -0
- package/dist/{chunk-UF746BQ4.js → chunk-XINLP35X.js} +1 -1
- package/dist/{chunk-A3GDELMY.js → chunk-YBA5N4XY.js} +7 -7
- package/dist/{chunk-INXDSJRC.js → chunk-YOUAVGHJ.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 +18 -18
- 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-2URa-V4S.d.cts +461 -0
- package/dist/{index-Ccv_61jG.d.cts → index-33mF4XyU.d.cts} +110 -27
- 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-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-CQtnGFrZ.d.cts → index-BC-xjOrd.d.cts} +7 -7
- package/dist/{index-ClKm7CFB.d.cts → index-BFuVcqL8.d.cts} +1 -1
- package/dist/index-BTJxM-wZ.d.ts +292 -0
- package/dist/{index-Jgl7ev9I.d.cts → index-BVNGEX7d.d.cts} +9 -9
- 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-zA1uVtk0.d.ts → index-BiomL7AW.d.ts} +1 -1
- package/dist/{index-BWiX5foT.d.ts → index-BjWZARLy.d.ts} +1 -1
- package/dist/{index-RJX4snyi.d.cts → index-BlRVj-7Q.d.cts} +21 -21
- package/dist/{index-Ds3Rz9m9.d.cts → index-BsZlbHM5.d.cts} +3 -3
- 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-p0bkNfby.d.cts → index-C4ig7whw.d.cts} +3 -3
- package/dist/{index-BRisOxlx.d.ts → index-CDvC1m5p.d.ts} +1 -1
- 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-Ced0dphF.d.ts → index-CVhBdCMf.d.ts} +9 -9
- package/dist/{index-b4a6Sg0R.d.ts → index-CZAixNU3.d.ts} +4 -4
- package/dist/index-Cjrpx2Mg.d.cts +171 -0
- 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-BUtCR0k6.d.ts → index-CsD0fqnO.d.ts} +7 -7
- package/dist/{index-ChZvMC4M.d.cts → index-CvUrRb4m.d.cts} +7 -7
- 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-nP13Qe6T.d.ts → index-DFe2Pk2u.d.ts} +1 -1
- package/dist/{index-IxinNgAH.d.cts → index-DHv2M7s8.d.cts} +16 -15
- package/dist/{index-Cn3taOmp.d.cts → index-DKp1CIbG.d.cts} +2 -2
- package/dist/{index-CoR-tOZA.d.cts → index-DLyQC5Ww.d.ts} +8 -7
- package/dist/{index-CNxdDb2e.d.ts → index-DSSsxS7B.d.ts} +3 -3
- package/dist/{index-DheNs40A.d.ts → index-DXSLMoma.d.ts} +2 -2
- package/dist/{index-BVTjuKeP.d.cts → index-D_QQ_dTD.d.cts} +1 -1
- 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-B5eS17Bz.d.ts → index-DtSVSKnd.d.ts} +47 -32
- package/dist/{index-Bi4ZP6Hc.d.ts → index-DxxvGTXp.d.ts} +110 -27
- package/dist/index-DzCQt2FJ.d.cts +292 -0
- package/dist/{index-D80nGRb9.d.ts → index-DzYTXMBz.d.ts} +3 -3
- package/dist/index-EfPb77rT.d.cts +26 -0
- package/dist/{index-B-KCkW4M.d.cts → index-GaW6Welt.d.cts} +4 -4
- package/dist/{index-D23g00HE.d.cts → index-HCp5ua_i.d.cts} +4 -4
- package/dist/{index-DupIl9wI.d.ts → index-JYtN9uqM.d.ts} +1 -1
- package/dist/index-KeBhbNg3.d.ts +461 -0
- package/dist/{index-BpjQanLs.d.cts → index-PluovH45.d.cts} +2 -2
- package/dist/{index-CbCNoogR.d.ts → index-Pu1Wa7en.d.ts} +16 -15
- package/dist/{index-ZIQaKIdY.d.cts → index-RJIY7QVW.d.cts} +47 -32
- 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-3L3RC3VJ.d.ts → index-isdlyeeO.d.ts} +7 -7
- package/dist/index-jA_OwwNg.d.ts +26 -0
- package/dist/{index-BFHpNSsV.d.ts → index-k67aNfqC.d.cts} +8 -7
- package/dist/index-kBUQj-rT.d.ts +171 -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-BlLBWSZ2.d.cts +120 -0
- package/dist/pipeline-graph-DdBoRu37.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-ScpWyqny.d.cts +196 -0
- package/dist/reactive-log-jirQsxMY.d.ts +196 -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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { B as BlockAdapters, C as CanvasMeasureAdapter, a as CanvasMeasureAdapterOptions, b as CanvasModule, c as CircleObstacle, d as CliMeasureAdapter, e as CliMeasureAdapterOptions, f as ComputeFlowLinesOptions, g as ContentBlock, F as FlowColumns, h as FlowContainer, j as FlowLinesResult, I as ImageMeasurer, k as ImageSizeAdapter, M as MeasuredBlock, N as NodeCanvasMeasureAdapter, O as Obstacle, P as PositionedBlock, l as PositionedLine, m as PrecomputedAdapter, n as PrecomputedAdapterOptions, R as ReactiveBlockLayoutBundle, o as ReactiveBlockLayoutOptions, p as ReactiveFlowLayoutBundle, q as ReactiveFlowLayoutOptions, r as RectObstacle, S as SvgBoundsAdapter, s as SvgMeasurer, t as circleIntervalForBand, u as computeBlockFlow, v as computeFlowLines, w as computeTotalHeight, x as measureBlock, y as measureBlocks, z as reactiveBlockLayout, A as reactiveFlowLayout, D as rectIntervalForBand } from '../../index-
|
|
2
|
-
export { C as CharPosition, I as Interval, a as LayoutCursor, b as LayoutLine, c as LayoutNextLineContext, d as LayoutNextLineResult, L as LineBreaksResult, M as MeasurementAdapter, P as PreparedSegment, R as ReactiveLayoutBundle, e as ReactiveLayoutOptions, S as SegmentBreakKind, f as SegmentMeasureStats, g as analyzeAndMeasure, h as carveTextLineSlots, i as computeCharPositions, j as computeLineBreaks, l as layoutNextLine, r as reactiveLayout } from '../../reactive-layout-
|
|
3
|
-
import '../../node-
|
|
4
|
-
import '../../graph-
|
|
5
|
-
import '../../meta-
|
|
1
|
+
export { B as BlockAdapters, C as CanvasMeasureAdapter, a as CanvasMeasureAdapterOptions, b as CanvasModule, c as CircleObstacle, d as CliMeasureAdapter, e as CliMeasureAdapterOptions, f as ComputeFlowLinesOptions, g as ContentBlock, F as FlowColumns, h as FlowContainer, j as FlowLinesResult, I as ImageMeasurer, k as ImageSizeAdapter, M as MeasuredBlock, N as NodeCanvasMeasureAdapter, O as Obstacle, P as PositionedBlock, l as PositionedLine, m as PrecomputedAdapter, n as PrecomputedAdapterOptions, R as ReactiveBlockLayoutBundle, o as ReactiveBlockLayoutOptions, p as ReactiveFlowLayoutBundle, q as ReactiveFlowLayoutOptions, r as RectObstacle, S as SvgBoundsAdapter, s as SvgMeasurer, t as circleIntervalForBand, u as computeBlockFlow, v as computeFlowLines, w as computeTotalHeight, x as measureBlock, y as measureBlocks, z as reactiveBlockLayout, A as reactiveFlowLayout, D as rectIntervalForBand } from '../../index-BZ1V5GzX.js';
|
|
2
|
+
export { C as CharPosition, I as Interval, a as LayoutCursor, b as LayoutLine, c as LayoutNextLineContext, d as LayoutNextLineResult, L as LineBreaksResult, M as MeasurementAdapter, P as PreparedSegment, R as ReactiveLayoutBundle, e as ReactiveLayoutOptions, S as SegmentBreakKind, f as SegmentMeasureStats, g as analyzeAndMeasure, h as carveTextLineSlots, i as computeCharPositions, j as computeLineBreaks, l as layoutNextLine, r as reactiveLayout } from '../../reactive-layout-Btv0-efV.js';
|
|
3
|
+
import '../../node-fSc-hCv8.js';
|
|
4
|
+
import '../../graph-Cv-8x0ZI.js';
|
|
5
|
+
import '../../meta-CC6EPdpK.js';
|
|
6
6
|
import '../../extra/storage-core.js';
|
|
7
|
+
import '../../extra/storage-tiers.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g,b as h,c as i,d as j,e as k,f as l,g as m,h as n,i as o,j as p,k as q,l as r,m as s,n as t,o as u}from"../../chunk-
|
|
1
|
+
import{a as g,b as h,c as i,d as j,e as k,f as l,g as m,h as n,i as o,j as p,k as q,l as r,m as s,n as t,o as u}from"../../chunk-J6TGRQUP.js";import{a,b,c,d,e,f}from"../../chunk-YOUAVGHJ.js";import"../../chunk-O32GJOUJ.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{i as CanvasMeasureAdapter,g as CliMeasureAdapter,l as ImageSizeAdapter,j as NodeCanvasMeasureAdapter,h as PrecomputedAdapter,k as SvgBoundsAdapter,a as analyzeAndMeasure,d as carveTextLineSlots,r as circleIntervalForBand,o as computeBlockFlow,e as computeCharPositions,t as computeFlowLines,b as computeLineBreaks,p as computeTotalHeight,c as layoutNextLine,m as measureBlock,n as measureBlocks,q as reactiveBlockLayout,u as reactiveFlowLayout,f as reactiveLayout,s as rectIntervalForBand};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`)}function on(t){if(t.version!==ye)throw new Error(`unsupported snapshot version ${String(t.version)} (expected ${ye})`);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 lr(t,e){let n=new WeakMap,r=(o,s)=>{if(Object.is(o,s))return!0;if(o==null||s==null||typeof o!="object"||typeof s!="object")return!1;let i=n.get(o);if(i==null&&(i=new WeakSet,n.set(o,i)),i.has(s))return!0;i.add(s);let a=o.constructor,d=s.constructor;if(a!==d)return!1;if(o instanceof Date)return o.getTime()===s.getTime();if(o instanceof RegExp)return o.source===s.source&&o.flags===s.flags;if(Array.isArray(o)){let p=s;if(o.length!==p.length)return!1;for(let f=0;f<o.length;f++)if(!r(o[f],p[f]))return!1;return!0}if(o instanceof Map){let p=s;if(o.size!==p.size)return!1;for(let[f,l]of o)if(!p.has(f)||!r(l,p.get(f)))return!1;return!0}if(o instanceof Set){let p=s;if(o.size!==p.size)return!1;for(let f of o){let l=!1;for(let g of p)if(r(f,g)){l=!0;break}if(!l)return!1}return!0}if(ArrayBuffer.isView(o)){let p=o,f=s;if(p.length!==f.length)return!1;for(let l=0;l<p.length;l++)if(p[l]!==f[l])return!1;return!0}let u=Object.keys(o),c=Object.keys(s);if(u.length!==c.length)return!1;let h=new Set(c);for(let p of u)if(!h.has(p)||!r(o[p],s[p]))return!1;return!0};return r(t,e)}function bt(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(bt);let e=t,n=Object.keys(e).sort(),r={};for(let o of n)r[o]=bt(e[o]);return r}function cr(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function fr(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function pr(t){return t==="TD"?"down":t==="BT"?"up":t==="RL"?"left":"right"}function un(t){let e=new Set,n=[];function r(o,s){let i=`${o}\0${s}`;e.has(i)||(e.add(i),n.push([o,s]))}for(let[o,s]of Object.entries(t.nodes)){let i=s.deps;if(i)for(let a of i)r(a,o)}for(let o of t.edges)r(o.from,o.to);return n}function dn(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 hr(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,{expand:o,...s}=t,i={...s,edges:n?t.edges:[],subgraphs:r?t.subgraphs:[]},a=JSON.stringify(bt(i),null,e.indent??2);return e.logger?.(a),a}function gr(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,o=[];o.push(`Graph ${t.name}`),o.push("Nodes:");for(let i of Object.keys(t.nodes).sort()){let a=t.nodes[i];o.push(`- ${i} (${a.type}/${a.status}): ${Ue(a.value)}`)}if(n){o.push("Edges:");for(let i of t.edges)o.push(`- ${i.from} -> ${i.to}`)}if(r){o.push("Subgraphs:");for(let i of t.subgraphs)o.push(`- ${i}`)}let s=o.join(`
|
|
5
5
|
`);return e.logger?.(s),s}function ln(t,e){let n=dn(e.direction),r=Object.keys(t.nodes).sort(),o=new Map;for(let i=0;i<r.length;i+=1)o.set(r[i],`n${i}`);let s=[`flowchart ${n}`];for(let i of r){let a=o.get(i);s.push(` ${a}["${cr(i)}"]`)}for(let[i,a]of un(t)){let d=o.get(i),u=o.get(a);!d||!u||s.push(` ${d} --> ${u}`)}return s.join(`
|
|
6
6
|
`)}function mr(t,e){let n=ln(t,e);return br(n)}function br(t,e){let n=e?.theme??"default",r=e?.autoSync??!0,s=JSON.stringify({code:t,mermaid:{theme:n},autoSync:r}),i=new TextEncoder().encode(s),a="";for(let u=0;u<i.length;u++)a+=String.fromCharCode(i[u]);return`https://mermaid.live/edit#base64:${globalThis.btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`}function yr(t,e){let n=dn(e.direction),r=Object.keys(t.nodes).sort(),o=new Map;for(let i=0;i<r.length;i+=1)o.set(r[i],`n${i}`);let s=[`direction: ${pr(n)}`];for(let i of r){let a=o.get(i);s.push(`${a}: "${fr(i)}"`)}for(let[i,a]of un(t)){let d=o.get(i),u=o.get(a);!d||!u||s.push(`${d} -> ${u}`)}return s.join(`
|
|
7
|
-
`)}function vr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ke(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 o=t.indexOf("]",n+1);if(o<=n+1){e+="\\[";continue}let s=t.slice(n+1,o);s.startsWith("!")&&(s=`^${s.slice(1)}`),s=s.replace(/\\/g,"\\\\"),e+=`[${s}]`,n=o;continue}e+=vr(r)}return e+="$",new RegExp(e)}var wr={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"},_r={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function Ue(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 xr(t){return t==="none"?_r:t==="ansi"||t==null?wr:{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 sn(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 Tr(t,e,n){for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);if(o<32||o===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${o.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function mt(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(I))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${I}' (path separator)`);if(t===ee)throw new Error(`Graph "${e}": ${n} name "${ee}" is reserved for meta companion paths`);Tr(t,e,n)}function Nr(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(I);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function Or(t,e){let n=!1;for(let o of t)if(!e.isMetaPassthrough(o[0])){n=!0;break}return n?t.filter(o=>e.isMetaPassthrough(o[0])):t}function cn(t){for(let e of t._mounts.values())cn(e);for(let e of t._nodes.values())try{e.down([[j]],{internal:!0})}catch{}}var ve=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(I))throw new Error(`Graph name must not contain '${I}' (got "${e}")`);if(e===ee)throw new Error(`Graph name "${ee}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??me,this._traceRing=new ke(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=Oe(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,o=n?.name??r;if(o==null||o==="")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 s=o,i=n?.annotation;if(mt(s,this.name,"add"),this._mounts.has(s))throw new Error(`Graph "${this.name}": name "${s}" is already a mount point`);if(this._nodes.has(s))throw new Error(`Graph "${this.name}": node "${s}" 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(s,e),this._nodeToName.set(e,s),this._emitTopology({kind:"added",name:s,nodeKind:"node"}),i!=null&&(this._annotations.set(s,i),this.config.inspectorEnabled&&this._traceRing.push({path:s,annotation:i,timestamp_ns:Q()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof P&&n._applyVersioning(e)}remove(e){mt(e,this.name,"remove");let n=this._mounts.get(e);if(n){let s={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,d]of i)a.includes(`${I}${ee}${I}`)||s.nodes.push(a);return s.nodes.sort(),s.mounts.push(e),s.mounts.push(...n._collectSubgraphs(`${e}${I}`)),this._mounts.delete(e),n._parent=void 0,cn(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:s}),s}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([[j]],{internal:!0});let o={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:o}),o}removeAll(e){let n=typeof e=="function"?e:(()=>{let s=Ke(e);return i=>s.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},o=[...this._nodes.keys(),...this._mounts.keys()].filter(s=>n(s));for(let s of o){let i=this.remove(s);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 o=e[r++];return{value:[o,n.get(o)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(I))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 o=r?.internal===!0;this.node(e).down([[C,n]],{actor:r?.actor,internal:o,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);fe(()=>{for(let[o,s]of r)this.set(o,s,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[X]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let o=r?.internal===!0;this.node(e).down([[M,n]],{actor:r?.actor,internal:o,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[V]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[d,u]of this._nodes)r.set(u,d);let a=[];for(let[d,u]of this._nodes)if(u instanceof P)for(let c of u._deps){let h=r.get(c.node);h!=null&&a.push([h,d])}return a.sort((d,u)=>d[0]<u[0]?-1:d[0]>u[0]?1:d[1]<u[1]?-1:d[1]>u[1]?1:0),a}let o=[];this._collectObserveTargets("",o);let s=new Map;for(let[a,d]of o)s.set(d,a);let i=[];for(let[a,d]of o)if(d instanceof P)for(let u of d._deps){let c=s.get(u.node);c!=null&&i.push([c,a])}return i.sort((a,d)=>a[0]<d[0]?-1:a[0]>d[0]?1:a[1]<d[1]?-1:a[1]>d[1]?1:0),i}mount(e,n){if(mt(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=Nr(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],o=n.slice(1);if(o.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 s=this._nodes.get(r);if(s&&o.length>0&&o[0]===ee)return this._resolveMetaChainFromNode(s,o,n.join(I));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${o.join(I)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(o.join(I))}_resolveMetaChainFromNode(e,n,r){let o=e,s=0,i=[...n];for(;s<i.length;){if(i[s]!==ee)throw new Error(`Graph "${this.name}": expected ${ee} segment in meta path "${r}"`);if(s+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${ee} in "${r}"`);let a=i[s+1],d=o.meta[a];if(!d)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);o=d,s+=2}return o}signal(e,n){if(n?.internal!==!0){for(let o of e)if(this.config.messageTier(o[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,o){for(let d of this._mounts.values())d._signalDeliver(e,n,r,o);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=Or(e,this.config);for(let d of[...this._nodes.keys()].sort()){let u=this._nodes.get(d);if(!r.has(u)){r.add(u);try{u.down(e,i)}catch(c){if(c instanceof Y)throw c;o.push(c)}a.length!==0&&this._signalMetaSubtree(u,a,r,i,o)}}}_signalMetaSubtree(e,n,r,o,s){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,o)}catch(d){if(d instanceof Y)throw d;s.push(d)}this._signalMetaSubtree(a,n,r,o,s)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,o=Pe(e?.detail,e?.fields),s=e?.format==="spec",i=s?Pe("minimal"):o,a=[];this._collectObserveTargets("",a);let d=new Map;for(let[_,x]of a)d.set(x,_);let u=[];{let _=a.map(([,E])=>E),x=new Set(d.values()),N=0;for(;_.length>0;){let E=_.shift();if(E instanceof P)for(let D of E._deps){let k=D.node;if(d.has(k))continue;let S=k.name??"",R=S;if(!R||x.has(R))if(S){let L=2;for(;x.has(`${S}#${L}`);)L++;R=`${S}#${L}`}else for(R=`__internal__/${N++}`;x.has(R);)R=`__internal__/${N++}`;d.set(k,R),x.add(R),u.push([R,k]),_.push(k)}}}let c=[...a,...u],h={};for(let[_,x]of c){if(n!=null&&!x.allowsObserve(n))continue;let N=ht(x,i),E=x instanceof P?x._deps.map(R=>d.get(R.node)??R.node.name??""):[],{name:D,...k}=N,S={...k,deps:E};if(!s){let R=this._annotations.get(_);R!=null&&(S.annotation=R)}if(r!=null)if(typeof r=="function"){let R=r;if(!(R.length>=2?R(_,S):R(S)))continue}else{let R=!0;for(let[L,z]of Object.entries(r)){let J=L==="deps_includes"?"depsIncludes":L==="meta_has"?"metaHas":L;if(J==="depsIncludes"){if(!S.deps.includes(String(z))){R=!1;break}continue}if(J==="metaHas"){if(!Object.hasOwn(S.meta??{},String(z))){R=!1;break}continue}if(S[J]!==z){R=!1;break}}if(!R)continue}h[_]=S}let p=new Set(Object.keys(h)),f=[];for(let[_,x]of c)if(x instanceof P)for(let N of x._deps){let E=d.get(N.node);E!=null&&f.push([E,_])}f.sort((_,x)=>_[0]<x[0]?-1:_[0]>x[0]?1:_[1]<x[1]?-1:_[1]>x[1]?1:0);let l=f.map(([_,x])=>({from:_,to:x}));(n!=null||r!=null)&&(l=l.filter(_=>p.has(_.from)&&p.has(_.to)));let g=this._collectSubgraphs(""),m=n!=null||r!=null?g.filter(_=>{let x=`${_}${I}`;return[...p].some(N=>N===_||N.startsWith(x))}):g,b=this,v=e,y={name:this.name,nodes:h,edges:l,subgraphs:m,expand(_){let x={...v,format:void 0};return Array.isArray(_)?(x.fields=_,x.detail=void 0):(x.detail=_,x.fields=void 0),b.describe(x)}},w=e??{},T=w.format;return T==="json"?hr(y,w):T==="pretty"?gr(y,w):T==="mermaid"?ln(y,w):T==="mermaid-url"?mr(y,w):T==="d2"?yr(y,w):T==="ascii"?Jt(y,w):y}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${r}`;n.push(o),n.push(...this._mounts.get(r)._collectSubgraphs(`${o}${I}`))}return n}resourceProfile(e){return nn(this,e)}reachable(e,n,r={}){return r.withDetail===!0?an(this.describe(),e,n,{...r,withDetail:!0}):an(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 o=this.describe({detail:"full"}),s=new Map(this._annotations),i=new Map;for(let[a,d]of Object.entries(o.nodes))d.lastMutation!=null&&i.set(a,d.lastMutation);return Xt(o,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:s,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",o=0,s=re(o,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,d=!1,u=()=>{a||d||(a=!0,Te(()=>{a=!1,!d&&(o+=1,s.emit(o))}))},c=i.onEvent(m=>{let b=m.type;b!=="data"&&b!=="error"&&b!=="complete"&&b!=="teardown"||u()}),h=[],p=new WeakSet,f=m=>{if(p.has(m)||d)return;p.add(m);let b=m.topology.subscribe(v=>{for(let y of v){if(y[0]!==C)continue;let w=y[1];if(u(),w.kind==="added"&&w.nodeKind==="mount"){let T=m._mounts.get(w.name);T!=null&&f(T)}}});h.push(b);for(let v of m._mounts.keys()){let y=m._mounts.get(v);y!=null&&f(y)}};f(this);let l;try{l=de([s],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(m,b)=>m===b})}catch(m){c();for(let b of h)b();throw i.dispose(),m}let g=oe(l);return{node:l,dispose(){d=!0,c();for(let m of h)m();h.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let o=0,s=re(o,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,d=!1,u=i.onEvent(f=>{let l=f.type;l!=="data"&&l!=="error"&&l!=="complete"&&l!=="teardown"||a||d||(a=!0,Te(()=>{a=!1,!d&&(o+=1,s.emit(o))}))}),c={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},h;try{h=de([s],()=>this._explainStatic(e,n,c),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(f,l)=>f.found===l.found&&f.reason===l.reason&&f.steps.length===l.steps.length&&kr(f.steps,l.steps)})}catch(f){throw u(),i.dispose(),f}let p=oe(h);return{node:h,dispose(){d=!0,u(),i.dispose(),p()}}}_pathsMatching(e){let n=Ke(e),r=[];return this._collectObserveTargets("",r),r.map(([o])=>o).filter(o=>n.test(o))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${I}${r}`;this._mounts.get(r)._collectObserveTargets(o,n)}for(let r of[...this._nodes.keys()].sort()){let o=this._nodes.get(r),s=e===""?r:`${e}${I}${r}`;n.push([s,o]),this._appendMetaObserveTargets(s,o,n)}}_appendMetaObserveTargets(e,n,r){for(let o of Object.keys(n.meta).sort()){let s=n.meta[o],i=`${e}${I}${ee}${I}${o}`;r.push([i,s]),this._appendMetaObserveTargets(i,s,r)}}observe(e,n){let r=typeof e=="string",s=sn(r?n:e),i=s.structured===!0||s.timeline===!0||s.causal===!0||s.derived===!0||s.detail==="minimal"||s.detail==="full"||s.format!=null,a=s.actor;if(r){let c=e,h=this.resolve(c);if(a!=null&&!h.allowsObserve(a))throw new Y({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,h]],s,"one"):{subscribe(p){return h.subscribe(p)},up(p){try{h.up?.(p)}catch(f){if(f instanceof Y)return;throw f}}}}let d=[];this._collectObserveTargets("",d),d.sort((c,h)=>c[0]<h[0]?-1:c[0]>h[0]?1:0);let u=a==null?d:d.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(u,s,"all"):{subscribe:c=>{let h=u.map(([p,f])=>f.subscribe(l=>{c(p,l)}));return()=>{for(let p of h)p()}},up:(c,h)=>{try{this.resolve(c).up?.(h)}catch(p){if(p instanceof Y)return;throw p}}}}_buildStructuredObserver(e,n,r){let o=r==="one"?e[0]?.[0]:void 0,s=i=>{if(r==="one"&&o!=null){let c=this.resolve(o);return this._buildStructuredObserver([[o,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,h)=>c[0]<h[0]?-1:c[0]>h[0]?1:0);let d=i.actor,u=d==null?a:a.filter(([,c])=>c.allowsObserve(d));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(e,n,s)}_createObserveResult(e,n,r){let o=n.timeline===!0,s=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",d=this.config.inspectorEnabled,u=(s||i)&&d,c=n.maxEvents,h=c!=null&&c>0?new ke(c):null,p=[],f=new Set,l={},g=new Set,m=0,b=0,v=0,y=0,w=0,T=0,_=!1,x=!1,N=0,E=new Map,D=new Map,k=new Map,S=O=>{h?h.push(O):p.push(O);for(let G of f)G(O)},R=()=>o?{timestamp_ns:Q(),in_batch:Se(),batch_id:N}:{},L=(O,G)=>{if(!(!u||!(O instanceof P)))return O._setInspectorHook(U=>{if(U.kind==="dep_message")E.set(O,U.depIndex);else if(U.kind==="run"){let we=U.batchData.map((A,H)=>A!=null&&A.length>0?A.at(-1):U.prevData[H]);D.set(O,we);let W=U.batchData.map(A=>A!=null?[...A]:void 0);k.set(O,W),i&&S({type:"derived",path:G,dep_values:we,dep_batches:W,...R()})}})},z=O=>{let G=E.get(O),U=D.get(O);if(!s||U==null)return{};let W=(G!=null&&G>=0&&O instanceof P?O._deps[G]:void 0)?.node,A=W?.v,H=k.get(O);return{trigger_dep_index:G,trigger_dep_name:W?.name,...A!=null?{trigger_version:{id:A.id,version:A.version}}:{},dep_values:[...U],...H!=null?{dep_batches:H}:{}}},J=[],ie=[];for(let[O,G]of e){let U=L(G,O);U&&J.push(U),ie.push(G.subscribe(we=>{N++;for(let W of we){let A=W[0],H=R();if(A===C){l[O]=W[1];let Xe=G instanceof P?G.lastMutation?.actor??ge:ge;S({type:"data",path:O,data:W[1],actor:Xe,...H,...z(G)})}else if(a)A===F?m++:A===B?b++:A===X?v++:A===K?y++:A===Z?w++:A===j?T++:A===V&&!g.has(O)?_=!0:A===M&&(x=!0,g.add(O));else if(A===F)m++,S({type:"dirty",path:O,...H});else if(A===B)b++,S({type:"resolved",path:O,...H,...z(G)});else if(A===X)v++,S({type:"invalidate",path:O,...H});else if(A===K)y++,S({type:"pause",path:O,lockId:W[1],...H});else if(A===Z)w++,S({type:"resume",path:O,lockId:W[1],...H});else if(A===V)g.has(O)||(_=!0),S({type:"complete",path:O,...H});else if(A===M){x=!0,g.add(O);let Xe=G instanceof P?G.lastMutation?.actor??ge:ge;S({type:"error",path:O,data:W[1],actor:Xe,...H})}else A===j&&(T++,S({type:"teardown",path:O,...H}))}}))}let qe=!1,Ye=()=>{if(!qe){qe=!0;for(let O of ie)O();for(let O of J)O();for(let O of Re)O({value:void 0,done:!0});Re.length=0}},Je=[],Re=[];f.add(O=>{let G=Re.shift();G?G({value:O,done:!1}):Je.push(O)});let yt={get values(){return l},get dirtyCount(){return m},get resolvedCount(){return b},get invalidateCount(){return v},get pauseCount(){return y},get resumeCount(){return w},get teardownCount(){return T},get events(){return h?h.toArray():[...p]},get anyCompletedCleanly(){return _},get anyErrored(){return x},get completedWithoutErrors(){return _&&!x},onEvent(O){return f.add(O),()=>f.delete(O)},dispose:Ye,expand(O){Ye();let G={...n};return typeof O=="string"?G.detail=O:Object.assign(G,O),r(sn(G))},[Symbol.asyncIterator](){return{next(){return Je.length>0?Promise.resolve({value:Je.shift(),done:!1}):qe?Promise.resolve({value:void 0,done:!0}):new Promise(O=>Re.push(O))},return(){return Ye(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(yt,n),yt}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let o=n.logger??(l=>console.log(l)),s=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=s==null&&i==null?()=>!0:l=>(s==null||s.has(l))&&(i==null||!i.has(l)),d=xr(n.theme),u=r==="stage-log"?Q():0,c=l=>l==null?"":n.stageLabels?.[l]??l,h=(l,g)=>l.length>g?`${l.slice(0,g-1)}\u2026`:l,p=l=>l.type==="data"||l.type==="error"?h(Ue(l.data),120):"",f=l=>{if(r==="stage-log"){let x=(Q()-u)/1e9,N=c(l.path).padEnd(9);if(l.type==="data"){let E=p(l);return`[${x.toFixed(3)}s] ${N} \u2190${E?` ${E}`:""}`}if(l.type==="error"){let E=p(l);return`[${x.toFixed(3)}s] ${N} \u2717${E?` ${E}`:""}`}return l.type==="complete"?`[${x.toFixed(3)}s] ${N} \u25A0 complete`:`[${x.toFixed(3)}s] ${N} ${l.type}`}if(r==="json")try{return JSON.stringify(l)}catch{return JSON.stringify({type:l.type,path:l.path,data:"[unserializable]"})}let g=d[l.type]??"",m=l.path?`${d.path}${l.path}${d.reset} `:"",b=l.type==="data"||l.type==="error",v=l.type==="pause"||l.type==="resume",y=b?` ${Ue(l.data)}`:v?` ${Ue(l.lockId)}`:"",w=l.type==="data"||l.type==="resolved"||l.type==="derived"?l:void 0,T=w?.trigger_dep_name!=null?` <- ${w.trigger_dep_name}`:w?.trigger_dep_index!=null?` <- #${w.trigger_dep_index}`:"",_=l.in_batch?" [batch]":"";return`${m}${g}${l.type.toUpperCase()}${d.reset}${y}${T}${_}`};e.onEvent(l=>{a(l.type)&&o(f(l),l)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){rn(this._disposers,this.name),this.signal([[j]],{internal:!0}),rn(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"}),o={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:d,guard:u,...c}=r.nodes[a];o[a]=c}let s=[...r.subgraphs].sort(),i={...r,version:1,nodes:o,subgraphs:s};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 Nt(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??me,{codec:o,codecVersion:s,payload:i}=Ot(e,r);return o.decode(i,s)}restore(e,n){if(on(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(s=>Ke(s)),o=n?.includeProducers===!0;for(let s of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(s)))continue;let i=e.nodes[s];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(s,new Error(`restore: slice.value is undefined for "${s}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!o)){if(i.v!=null){let d=this.tryResolve(s)?.v;if(d!=null&&d.id===i.v.id&&d.version===i.v.version)continue}try{this.set(s,i.value)}catch(a){n?.onError?.(s,a)}}}}}static fromSnapshot(e,n){on(e);let r=typeof n=="function"?n:n?.build,o=typeof n=="function"?void 0:n?.factories,s=new t(e.name);if(r)return r(s),s.restore(e),s;for(let f of[...e.subgraphs].sort((l,g)=>{let m=l.split(I).length,b=g.split(I).length;return m!==b?m-b:l<g?-1:l>g?1:0})){let l=f.split(I),g=s;for(let m of l)g._mounts.has(m)||g.mount(m,new t(m)),g=g._mounts.get(m)}let i=o?Object.entries(o).map(([f,l])=>({re:Ke(f),factory:l})):[],a=f=>{for(let l of i)if(l.re.test(f))return l.factory},d=f=>{let l=f.split(I),g=l.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${f}"`);let m=s;for(let b of l){let v=m._mounts.get(b);if(!v)throw new Error(`unknown mount "${b}" in path "${f}"`);m=v}return[m,g]},u=Object.entries(e.nodes).filter(([f])=>!f.includes(`${I}${ee}${I}`)).sort((f,l)=>f[0]<l[0]?-1:f[0]>l[0]?1:0),c=new Map(u),h=new Map,p=!0;for(;c.size>0&&p;){p=!1;for(let[f,l]of[...c.entries()]){let g=l?.deps??[];if(!g.every(T=>h.has(T)))continue;let[m,b]=d(f),v={...l?.meta??{}},y=a(f),w;if(l?.type==="state")w=re(l.value,{meta:v});else{if(y==null)continue;w=y(b,{path:f,type:l.type,value:l.value,meta:v,deps:g,resolvedDeps:g.map(T=>h.get(T))})}m.add(w,{name:b}),h.set(f,w),c.delete(f),p=!0}}if(c.size>0){let f=[...c.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 s.restore(e),s}toJSON(){return this.snapshot()}attachStorage(e,n={}){let r=e.map(u=>({tier:u,debounceMs:Math.max(0,u.debounceMs??0),compactEvery:Math.max(1,u.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 o=(u,c)=>{if(u.disposed)return;let h=dr(c.nodes);if(u.lastSnapshot!=null&&h!==""&&h===u.lastFingerprint)return;let p=u.seq+1,f=Me(),m=u.lastSnapshot==null||p%u.compactEvery===0?{mode:"full",snapshot:c,seq:p,timestamp_ns:f,format_version:ye}:{mode:"diff",diff:Er(u.lastSnapshot,c),seq:p,timestamp_ns:f,format_version:ye};if(u.tier.filter&&!u.tier.filter(this.name,m))return;let b;try{b=u.tier.save(this.name,m)}catch(v){n.onError?.(v,u.tier);return}if(b&&typeof b.then=="function"){let w=(u.savePending??Promise.resolve()).then(()=>b,()=>b).then(()=>{u.disposed||(u.seq=p,u.lastSnapshot=c,u.lastFingerprint=h)},T=>{n.onError?.(T,u.tier)});u.savePending=w.finally(()=>{u.savePending===w&&(u.savePending=void 0)})}else u.seq=p,u.lastSnapshot=c,u.lastFingerprint=h},s=(u,c)=>{try{o(u,c)}catch(h){n.onError?.(h,u.tier)}},i=(u,c)=>{if(!c.some(l=>{let g=this.config.messageTier(l[0]);return g>=3&&g<5}))return;if(n.filter){let l=this.tryResolve(u);if(l==null)return;let g=ht(l,Pe("standard"));if(!n.filter(u,g))return}let p,f=()=>(p==null&&(p=this.snapshot()),p);for(let l of r)l.disposed||(l.debounceMs===0?s(l,f()):(l.timer==null&&(l.timer=new $e),l.timer.start(l.debounceMs,()=>{l.disposed||s(l,this.snapshot())})))},a;if(n.paths!=null){let c=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(h=>{let p=this.tryResolve(h);return p==null?()=>{}:p.subscribe(f=>i(h,f))});a=()=>{for(let h of c)h()}}else a=this.observe().subscribe((u,c)=>i(u,c));let d=()=>{a();for(let u of r)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(d)};return this._storageDisposers.add(d),{dispose:d}}async _cascadeRestore(e,n){for(let r of e){let o;try{o=await r.load(this.name)}catch(i){n?.(i,r);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let s=o;try{if(s.mode==="full"&&s.snapshot!=null)return this.restore(s.snapshot),!0;if(s.version===ye&&s.nodes!=null)return this.restore(s),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let o of n){let s;try{s=await o.load(e)}catch(d){r?.onError?.(d,o);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let i=s,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===ye&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(d){r?.onError?.(d,o)}}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 o={path:e,annotation:n,timestamp_ns:Q(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(o)}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(o=>!e(o)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let o of n)this._traceRing.push(o);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),o=new Set(Object.keys(n.nodes)),s=[...o].filter(v=>!r.has(v)).sort(),i=[...r].filter(v=>!o.has(v)).sort(),a=[],d=[];for(let v of r){if(!o.has(v))continue;let y=e.nodes[v],w=n.nodes[v],T=y.v,_=w.v;T!=null&&_!=null&&T.id===_.id&&T.version!==_.version&&d.push({path:v,id:T.id,from:T.version,to:_.version});let x=T!=null&&_!=null&&T.id===_.id&&T.version===_.version;for(let N of["type","status","sentinel"]){let E=y[N],D=w[N];E!==D&&a.push({path:v,field:N,from:E,to:D})}if(!x)for(let N of["value","meta"]){let E=y[N],D=w[N];lr(E,D)||a.push({path:v,field:N,from:E,to:D})}}let u=v=>`${v.from} ${v.to}`,c=new Set(e.edges.map(u)),h=new Set(n.edges.map(u)),p=n.edges.filter(v=>!c.has(u(v))),f=e.edges.filter(v=>!h.has(u(v))),l=new Set(e.subgraphs),g=new Set(n.subgraphs),m=[...g].filter(v=>!l.has(v)).sort(),b=[...l].filter(v=>!g.has(v)).sort();return{nodesAdded:s,nodesRemoved:i,nodesChanged:a,versionChanges:d,edgesAdded:p,edgesRemoved:f,subgraphsAdded:m,subgraphsRemoved:b}}};function Er(t,e){let n=ve.diff(t,e),r={};for(let o of n.nodesAdded){let s=e.nodes[o];s!=null&&(r[o]=s)}return{...n,nodesAddedFull:r}}function an(t,e,n,r={}){let o={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?o:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let s=r.maxDepth;if(s!=null&&(!Number.isInteger(s)||s<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(s===0)return r.withDetail?o:[];let i=new Map,a=new Map,d=new Map,u=new Map,c=new Set;for(let[y,w]of Object.entries(t.nodes)){if(!y)continue;c.add(y);let T=w.deps??[];i.set(y,T);for(let _ of T)_&&(c.add(_),a.has(_)||a.set(_,new Set),a.get(_).add(y))}for(let y of t.edges){if(y==null||typeof y!="object")continue;let w=typeof y.from=="string"?y.from:"",T=typeof y.to=="string"?y.to:"";!w||!T||(c.add(w),c.add(T),u.has(w)||u.set(w,new Set),u.get(w).add(T),d.has(T)||d.set(T,new Set),d.get(T).add(w))}if(!c.has(e))return r.withDetail?o:[];let h=r.both===!0,p=y=>{if(h){let x=i.get(y)??[],N=d.get(y),E=a.get(y),D=u.get(y),k=[...x];return N&&k.push(...N),E&&k.push(...E),D&&k.push(...D),k}if(n==="upstream"){let x=i.get(y)??[],N=d.get(y);return N?[...x,...N]:x}let w=a.get(y),T=u.get(y),_=w?[...w]:[];return T&&_.push(...T),_},f=new Set([e]),l=new Map,g=[{path:e,depth:0}],m=0,b=!1;for(;m<g.length;){let y=g[m++];if(s!=null&&y.depth>=s){p(y.path).length>0&&(b=!0);continue}for(let w of p(y.path))!w||f.has(w)||(f.add(w),l.set(w,y.depth+1),g.push({path:w,depth:y.depth+1}))}let v=[...l.keys()].sort((y,w)=>y<w?-1:y>w?1:0);return r.withDetail?{paths:v,depths:l,truncated:b}:v}function kr(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.path!==o.path||r.type!==o.type||r.status!==o.status||r.hop!==o.hop||r.dep_index!==o.dep_index||r.annotation!==o.annotation||r.value!==o.value||r.lastMutation!==o.lastMutation)return!1;let s=r.v,i=o.v;if(s!==i&&(s==null||i==null||s.id!==i.id||s.version!==i.version))return!1}return!0}te();ft();function fn(t,e){let n=t.cache??0;return n>=e?!1:(t.down([[F],[C,n+1]]),!0)}function pn(t,e,n){return{[t]:!0,[`${t}_type`]:e,...n??{}}}function We(t,e){return pn("reduction",t,e)}function Rr(t,e,n,r){if(e.length===0)throw new RangeError("funnel requires at least one source");if(n.length===0)throw new RangeError("funnel requires at least one stage");let o=new ve(t,r),s=e.length===1?e[0]:Pt(...e);o.add(s,{name:"merged"});let i="merged";for(let a=0;a<n.length;a++){let d=n[a],u=new ve(d.name);d.build(u);try{u.resolve("input")}catch{throw new Error(`funnel stage "${d.name}" must define an "input" node`)}try{u.resolve("output")}catch{throw new Error(`funnel stage "${d.name}" must define an "output" node`)}o.mount(d.name,u);let c=o.resolve(i),h=`${d.name}::input`,p=o.resolve(h),f=`__bridge_${i}\u2192${d.name}_input`,l=It([c],([g])=>{p.emit(g)},{name:f});o.add(l,{name:f}),o.addDisposer(oe(l)),i=`${d.name}::output`}return o}function Sr(t,e,n,r){let o=r?.maxIterations??10,s=`__feedback_${e}`,i=re(0,{meta:We("feedback_counter",{maxIterations:o,feedbackFrom:e,feedbackTo:n})});t.add(i,{name:s});let a=t.resolve(e),d=t.resolve(n),u=`__feedback_effect_${e}`,c=ne([],(h,p)=>{let f=a.subscribe(l=>{for(let g of l){let m=g[0];if(m===C){let b=g[1];if(b==null)return;fe(()=>{fn(i,o)&&d.emit(b)})}else if(m===V||m===M){let b=m===M&&g.length>1?[M,g[1]]:[m];i.down([b])}}});return()=>f()},{name:u,describeKind:"effect",meta:{...We("feedback_effect",{feedbackFrom:e,feedbackTo:n}),_internal:!0}});return t.add(c,{name:u}),t.addDisposer(oe(c)),t}function Dr(t,e,n){if(e.length===0)throw new RangeError("budgetGate requires at least one constraint");let r=e.map(f=>f.node),o=[t,...r],s=[],i=!1,a=!1,d=Symbol("budget-gate"),u=new Array(e.length);function c(){return e.every((f,l)=>f.check(u[l]))}function h(f){for(;s.length>0&&c();){let l=s[0];s=s.slice(1),f.emit(l)}s.length===0&&a&&(a=!1,f.down([[B]]))}return ne([],(f,l)=>{for(let m=0;m<e.length;m++)u[m]=e[m].node.cache;let g=[];for(let m=0;m<o.length;m++){let b=o[m];g.push(b.subscribe(v=>{for(let y of v)p(y,m,l)}))}return()=>{for(let m of g)m()}},{...n,describeKind:"derived",meta:We("budget_gate",n?.meta)});function p(f,l,g){let m=f[0];if(l===0){if(m===C)return c()&&s.length===0?g.emit(f[1]):(s.push(f[1]),i||(i=!0,g.up([[K,d]]))),!0;if(m===F)return g.down([[F]]),!0;if(m===B)return s.length===0?g.down([[B]]):a=!0,!0;if(m===V||m===M){for(let b of s)g.emit(b);return s=[],a=!1,i&&(i=!1,g.up([[Z,d]])),g.down([f]),!0}return!1}return m===C&&(u[l-1]=f[1]),m===C||m===B?(c()&&s.length>0?(h(g),s.length===0&&i&&(i=!1,g.up([[Z,d]]))):!c()&&!i&&s.length>0&&(i=!0,g.up([[K,d]])),!0):m===F?!0:m===M?(g.down([f]),!0):m===V}}function Ar(t,e,n){if(t.length===0)throw new RangeError("scorer requires at least one source");if(t.length!==e.length)throw new RangeError("scorer requires the same number of sources and weights");let r=[...t,...e],o=t.length,s=n?.scoreFns;return de(r,i=>{let a=i.slice(0,o),d=i.slice(o),u=[],c=0;for(let h=0;h<o;h++){let p=a[h]??0,f=d[h]??0,g=(s?.[h]?s[h](p):p)*f;u.push(g),c+=g}return{value:a,score:c,breakdown:u}},{...n?{equals:n.equals,resubscribable:n.resubscribable,resetOnTeardown:n.resetOnTeardown}:{},describeKind:"derived",meta:We("scorer",n?.meta)})}function Mr(t){let e=$t({name:t?.name??"effectiveness-entries"}),n=de([e.entries],([i])=>new Map(i),{name:`${t?.name??"effectiveness"}-snapshot`,equals:(i,a)=>{let d=i,u=a;if(d.size!==u.size)return!1;for(let[c,h]of d){let p=u.get(c);if(!p||h.attempts!==p.attempts||h.successes!==p.successes)return!1}return!0}});function r(i,a){let d=e.get(i),u=(d?.attempts??0)+1,c=(d?.successes??0)+(a?1:0);e.set(i,{key:i,attempts:u,successes:c,successRate:c/u})}function o(i){return e.get(i)}let s=oe(n);return{node:n,record:r,lookup:o,dispose:()=>s()}}0&&(module.exports={budgetGate,effectivenessTracker,feedback,funnel,scorer});
|
|
7
|
+
`)}function vr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ke(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 o=t.indexOf("]",n+1);if(o<=n+1){e+="\\[";continue}let s=t.slice(n+1,o);s.startsWith("!")&&(s=`^${s.slice(1)}`),s=s.replace(/\\/g,"\\\\"),e+=`[${s}]`,n=o;continue}e+=vr(r)}return e+="$",new RegExp(e)}var wr={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"},_r={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function Ue(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 xr(t){return t==="none"?_r:t==="ansi"||t==null?wr:{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 sn(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 Tr(t,e,n){for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);if(o<32||o===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${o.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function mt(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(I))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${I}' (path separator)`);if(t===ee)throw new Error(`Graph "${e}": ${n} name "${ee}" is reserved for meta companion paths`);Tr(t,e,n)}function Nr(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(I);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function Or(t,e){let n=!1;for(let o of t)if(!e.isMetaPassthrough(o[0])){n=!0;break}return n?t.filter(o=>e.isMetaPassthrough(o[0])):t}function cn(t){for(let e of t._mounts.values())cn(e);for(let e of t._nodes.values())try{e.down([[j]],{internal:!0})}catch{}}var ve=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(I))throw new Error(`Graph name must not contain '${I}' (got "${e}")`);if(e===ee)throw new Error(`Graph name "${ee}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??me,this._traceRing=new ke(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=Oe(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,o=n?.name??r;if(o==null||o==="")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 s=o,i=n?.annotation;if(mt(s,this.name,"add"),this._mounts.has(s))throw new Error(`Graph "${this.name}": name "${s}" is already a mount point`);if(this._nodes.has(s))throw new Error(`Graph "${this.name}": node "${s}" 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(s,e),this._nodeToName.set(e,s),this._emitTopology({kind:"added",name:s,nodeKind:"node"}),i!=null&&(this._annotations.set(s,i),this.config.inspectorEnabled&&this._traceRing.push({path:s,annotation:i,timestamp_ns:Q()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof P&&n._applyVersioning(e)}remove(e){mt(e,this.name,"remove");let n=this._mounts.get(e);if(n){let s={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,d]of i)a.includes(`${I}${ee}${I}`)||s.nodes.push(a);return s.nodes.sort(),s.mounts.push(e),s.mounts.push(...n._collectSubgraphs(`${e}${I}`)),this._mounts.delete(e),n._parent=void 0,cn(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:s}),s}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([[j]],{internal:!0});let o={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:o}),o}removeAll(e){let n=typeof e=="function"?e:(()=>{let s=Ke(e);return i=>s.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},o=[...this._nodes.keys(),...this._mounts.keys()].filter(s=>n(s));for(let s of o){let i=this.remove(s);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 o=e[r++];return{value:[o,n.get(o)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(I))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 o=r?.internal===!0;this.node(e).down([[C,n]],{actor:r?.actor,internal:o,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);fe(()=>{for(let[o,s]of r)this.set(o,s,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[X]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let o=r?.internal===!0;this.node(e).down([[M,n]],{actor:r?.actor,internal:o,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[V]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[d,u]of this._nodes)r.set(u,d);let a=[];for(let[d,u]of this._nodes)if(u instanceof P)for(let c of u._deps){let h=r.get(c.node);h!=null&&a.push([h,d])}return a.sort((d,u)=>d[0]<u[0]?-1:d[0]>u[0]?1:d[1]<u[1]?-1:d[1]>u[1]?1:0),a}let o=[];this._collectObserveTargets("",o);let s=new Map;for(let[a,d]of o)s.set(d,a);let i=[];for(let[a,d]of o)if(d instanceof P)for(let u of d._deps){let c=s.get(u.node);c!=null&&i.push([c,a])}return i.sort((a,d)=>a[0]<d[0]?-1:a[0]>d[0]?1:a[1]<d[1]?-1:a[1]>d[1]?1:0),i}mount(e,n){if(n===void 0){let o=new t(e);return this.mount(e,o)}if(typeof n=="function"){let o=new t(e);return n(o),this.mount(e,o)}let r=n;if(mt(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 o=this;o!=null;o=o._parent)if(o===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=Nr(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],o=n.slice(1);if(o.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 s=this._nodes.get(r);if(s&&o.length>0&&o[0]===ee)return this._resolveMetaChainFromNode(s,o,n.join(I));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${o.join(I)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(o.join(I))}_resolveMetaChainFromNode(e,n,r){let o=e,s=0,i=[...n];for(;s<i.length;){if(i[s]!==ee)throw new Error(`Graph "${this.name}": expected ${ee} segment in meta path "${r}"`);if(s+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${ee} in "${r}"`);let a=i[s+1],d=o.meta[a];if(!d)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);o=d,s+=2}return o}signal(e,n){if(n?.internal!==!0){for(let o of e)if(this.config.messageTier(o[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,o){for(let d of this._mounts.values())d._signalDeliver(e,n,r,o);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=Or(e,this.config);for(let d of[...this._nodes.keys()].sort()){let u=this._nodes.get(d);if(!r.has(u)){r.add(u);try{u.down(e,i)}catch(c){if(c instanceof Y)throw c;o.push(c)}a.length!==0&&this._signalMetaSubtree(u,a,r,i,o)}}}_signalMetaSubtree(e,n,r,o,s){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,o)}catch(d){if(d instanceof Y)throw d;s.push(d)}this._signalMetaSubtree(a,n,r,o,s)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,o=Pe(e?.detail,e?.fields),s=e?.format==="spec",i=s?Pe("minimal"):o,a=[];this._collectObserveTargets("",a);let d=new Map;for(let[_,x]of a)d.set(x,_);let u=[];{let _=a.map(([,E])=>E),x=new Set(d.values()),N=0;for(;_.length>0;){let E=_.shift();if(E instanceof P)for(let D of E._deps){let k=D.node;if(d.has(k))continue;let S=k.name??"",R=S;if(!R||x.has(R))if(S){let L=2;for(;x.has(`${S}#${L}`);)L++;R=`${S}#${L}`}else for(R=`__internal__/${N++}`;x.has(R);)R=`__internal__/${N++}`;d.set(k,R),x.add(R),u.push([R,k]),_.push(k)}}}let c=[...a,...u],h={};for(let[_,x]of c){if(n!=null&&!x.allowsObserve(n))continue;let N=ht(x,i),E=x instanceof P?x._deps.map(R=>d.get(R.node)??R.node.name??""):[],{name:D,...k}=N,S={...k,deps:E};if(!s){let R=this._annotations.get(_);R!=null&&(S.annotation=R)}if(r!=null)if(typeof r=="function"){let R=r;if(!(R.length>=2?R(_,S):R(S)))continue}else{let R=!0;for(let[L,z]of Object.entries(r)){let J=L==="deps_includes"?"depsIncludes":L==="meta_has"?"metaHas":L;if(J==="depsIncludes"){if(!S.deps.includes(String(z))){R=!1;break}continue}if(J==="metaHas"){if(!Object.hasOwn(S.meta??{},String(z))){R=!1;break}continue}if(S[J]!==z){R=!1;break}}if(!R)continue}h[_]=S}let p=new Set(Object.keys(h)),f=[];for(let[_,x]of c)if(x instanceof P)for(let N of x._deps){let E=d.get(N.node);E!=null&&f.push([E,_])}f.sort((_,x)=>_[0]<x[0]?-1:_[0]>x[0]?1:_[1]<x[1]?-1:_[1]>x[1]?1:0);let l=f.map(([_,x])=>({from:_,to:x}));(n!=null||r!=null)&&(l=l.filter(_=>p.has(_.from)&&p.has(_.to)));let g=this._collectSubgraphs(""),m=n!=null||r!=null?g.filter(_=>{let x=`${_}${I}`;return[...p].some(N=>N===_||N.startsWith(x))}):g,b=this,v=e,y={name:this.name,nodes:h,edges:l,subgraphs:m,expand(_){let x={...v,format:void 0};return Array.isArray(_)?(x.fields=_,x.detail=void 0):(x.detail=_,x.fields=void 0),b.describe(x)}},w=e??{},T=w.format;return T==="json"?hr(y,w):T==="pretty"?gr(y,w):T==="mermaid"?ln(y,w):T==="mermaid-url"?mr(y,w):T==="d2"?yr(y,w):T==="ascii"?Jt(y,w):y}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${r}`;n.push(o),n.push(...this._mounts.get(r)._collectSubgraphs(`${o}${I}`))}return n}resourceProfile(e){return nn(this,e)}reachable(e,n,r={}){return r.withDetail===!0?an(this.describe(),e,n,{...r,withDetail:!0}):an(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 o=this.describe({detail:"full"}),s=new Map(this._annotations),i=new Map;for(let[a,d]of Object.entries(o.nodes))d.lastMutation!=null&&i.set(a,d.lastMutation);return Xt(o,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:s,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",o=0,s=re(o,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,d=!1,u=()=>{a||d||(a=!0,Te(()=>{a=!1,!d&&(o+=1,s.emit(o))}))},c=i.onEvent(m=>{let b=m.type;b!=="data"&&b!=="error"&&b!=="complete"&&b!=="teardown"||u()}),h=[],p=new WeakSet,f=m=>{if(p.has(m)||d)return;p.add(m);let b=m.topology.subscribe(v=>{for(let y of v){if(y[0]!==C)continue;let w=y[1];if(u(),w.kind==="added"&&w.nodeKind==="mount"){let T=m._mounts.get(w.name);T!=null&&f(T)}}});h.push(b);for(let v of m._mounts.keys()){let y=m._mounts.get(v);y!=null&&f(y)}};f(this);let l;try{l=de([s],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(m,b)=>m===b})}catch(m){c();for(let b of h)b();throw i.dispose(),m}let g=oe(l);return{node:l,dispose(){d=!0,c();for(let m of h)m();h.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let o=0,s=re(o,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,d=!1,u=i.onEvent(f=>{let l=f.type;l!=="data"&&l!=="error"&&l!=="complete"&&l!=="teardown"||a||d||(a=!0,Te(()=>{a=!1,!d&&(o+=1,s.emit(o))}))}),c={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},h;try{h=de([s],()=>this._explainStatic(e,n,c),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(f,l)=>f.found===l.found&&f.reason===l.reason&&f.steps.length===l.steps.length&&kr(f.steps,l.steps)})}catch(f){throw u(),i.dispose(),f}let p=oe(h);return{node:h,dispose(){d=!0,u(),i.dispose(),p()}}}_pathsMatching(e){let n=Ke(e),r=[];return this._collectObserveTargets("",r),r.map(([o])=>o).filter(o=>n.test(o))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${I}${r}`;this._mounts.get(r)._collectObserveTargets(o,n)}for(let r of[...this._nodes.keys()].sort()){let o=this._nodes.get(r),s=e===""?r:`${e}${I}${r}`;n.push([s,o]),this._appendMetaObserveTargets(s,o,n)}}_appendMetaObserveTargets(e,n,r){for(let o of Object.keys(n.meta).sort()){let s=n.meta[o],i=`${e}${I}${ee}${I}${o}`;r.push([i,s]),this._appendMetaObserveTargets(i,s,r)}}observe(e,n){let r=typeof e=="string",s=sn(r?n:e),i=s.structured===!0||s.timeline===!0||s.causal===!0||s.derived===!0||s.detail==="minimal"||s.detail==="full"||s.format!=null,a=s.actor;if(r){let c=e,h=this.resolve(c);if(a!=null&&!h.allowsObserve(a))throw new Y({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,h]],s,"one"):{subscribe(p){return h.subscribe(p)},up(p){try{h.up?.(p)}catch(f){if(f instanceof Y)return;throw f}}}}let d=[];this._collectObserveTargets("",d),d.sort((c,h)=>c[0]<h[0]?-1:c[0]>h[0]?1:0);let u=a==null?d:d.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(u,s,"all"):{subscribe:c=>{let h=u.map(([p,f])=>f.subscribe(l=>{c(p,l)}));return()=>{for(let p of h)p()}},up:(c,h)=>{try{this.resolve(c).up?.(h)}catch(p){if(p instanceof Y)return;throw p}}}}_buildStructuredObserver(e,n,r){let o=r==="one"?e[0]?.[0]:void 0,s=i=>{if(r==="one"&&o!=null){let c=this.resolve(o);return this._buildStructuredObserver([[o,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,h)=>c[0]<h[0]?-1:c[0]>h[0]?1:0);let d=i.actor,u=d==null?a:a.filter(([,c])=>c.allowsObserve(d));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(e,n,s)}_createObserveResult(e,n,r){let o=n.timeline===!0,s=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",d=this.config.inspectorEnabled,u=(s||i)&&d,c=n.maxEvents,h=c!=null&&c>0?new ke(c):null,p=[],f=new Set,l={},g=new Set,m=0,b=0,v=0,y=0,w=0,T=0,_=!1,x=!1,N=0,E=new Map,D=new Map,k=new Map,S=O=>{h?h.push(O):p.push(O);for(let G of f)G(O)},R=()=>o?{timestamp_ns:Q(),in_batch:Se(),batch_id:N}:{},L=(O,G)=>{if(!(!u||!(O instanceof P)))return O._setInspectorHook(U=>{if(U.kind==="dep_message")E.set(O,U.depIndex);else if(U.kind==="run"){let we=U.batchData.map((A,H)=>A!=null&&A.length>0?A.at(-1):U.prevData[H]);D.set(O,we);let W=U.batchData.map(A=>A!=null?[...A]:void 0);k.set(O,W),i&&S({type:"derived",path:G,dep_values:we,dep_batches:W,...R()})}})},z=O=>{let G=E.get(O),U=D.get(O);if(!s||U==null)return{};let W=(G!=null&&G>=0&&O instanceof P?O._deps[G]:void 0)?.node,A=W?.v,H=k.get(O);return{trigger_dep_index:G,trigger_dep_name:W?.name,...A!=null?{trigger_version:{id:A.id,version:A.version}}:{},dep_values:[...U],...H!=null?{dep_batches:H}:{}}},J=[],ie=[];for(let[O,G]of e){let U=L(G,O);U&&J.push(U),ie.push(G.subscribe(we=>{N++;for(let W of we){let A=W[0],H=R();if(A===C){l[O]=W[1];let Xe=G instanceof P?G.lastMutation?.actor??ge:ge;S({type:"data",path:O,data:W[1],actor:Xe,...H,...z(G)})}else if(a)A===F?m++:A===B?b++:A===X?v++:A===K?y++:A===Z?w++:A===j?T++:A===V&&!g.has(O)?_=!0:A===M&&(x=!0,g.add(O));else if(A===F)m++,S({type:"dirty",path:O,...H});else if(A===B)b++,S({type:"resolved",path:O,...H,...z(G)});else if(A===X)v++,S({type:"invalidate",path:O,...H});else if(A===K)y++,S({type:"pause",path:O,lockId:W[1],...H});else if(A===Z)w++,S({type:"resume",path:O,lockId:W[1],...H});else if(A===V)g.has(O)||(_=!0),S({type:"complete",path:O,...H});else if(A===M){x=!0,g.add(O);let Xe=G instanceof P?G.lastMutation?.actor??ge:ge;S({type:"error",path:O,data:W[1],actor:Xe,...H})}else A===j&&(T++,S({type:"teardown",path:O,...H}))}}))}let qe=!1,Ye=()=>{if(!qe){qe=!0;for(let O of ie)O();for(let O of J)O();for(let O of Re)O({value:void 0,done:!0});Re.length=0}},Je=[],Re=[];f.add(O=>{let G=Re.shift();G?G({value:O,done:!1}):Je.push(O)});let yt={get values(){return l},get dirtyCount(){return m},get resolvedCount(){return b},get invalidateCount(){return v},get pauseCount(){return y},get resumeCount(){return w},get teardownCount(){return T},get events(){return h?h.toArray():[...p]},get anyCompletedCleanly(){return _},get anyErrored(){return x},get completedWithoutErrors(){return _&&!x},onEvent(O){return f.add(O),()=>f.delete(O)},dispose:Ye,expand(O){Ye();let G={...n};return typeof O=="string"?G.detail=O:Object.assign(G,O),r(sn(G))},[Symbol.asyncIterator](){return{next(){return Je.length>0?Promise.resolve({value:Je.shift(),done:!1}):qe?Promise.resolve({value:void 0,done:!0}):new Promise(O=>Re.push(O))},return(){return Ye(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(yt,n),yt}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let o=n.logger??(l=>console.log(l)),s=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=s==null&&i==null?()=>!0:l=>(s==null||s.has(l))&&(i==null||!i.has(l)),d=xr(n.theme),u=r==="stage-log"?Q():0,c=l=>l==null?"":n.stageLabels?.[l]??l,h=(l,g)=>l.length>g?`${l.slice(0,g-1)}\u2026`:l,p=l=>l.type==="data"||l.type==="error"?h(Ue(l.data),120):"",f=l=>{if(r==="stage-log"){let x=(Q()-u)/1e9,N=c(l.path).padEnd(9);if(l.type==="data"){let E=p(l);return`[${x.toFixed(3)}s] ${N} \u2190${E?` ${E}`:""}`}if(l.type==="error"){let E=p(l);return`[${x.toFixed(3)}s] ${N} \u2717${E?` ${E}`:""}`}return l.type==="complete"?`[${x.toFixed(3)}s] ${N} \u25A0 complete`:`[${x.toFixed(3)}s] ${N} ${l.type}`}if(r==="json")try{return JSON.stringify(l)}catch{return JSON.stringify({type:l.type,path:l.path,data:"[unserializable]"})}let g=d[l.type]??"",m=l.path?`${d.path}${l.path}${d.reset} `:"",b=l.type==="data"||l.type==="error",v=l.type==="pause"||l.type==="resume",y=b?` ${Ue(l.data)}`:v?` ${Ue(l.lockId)}`:"",w=l.type==="data"||l.type==="resolved"||l.type==="derived"?l:void 0,T=w?.trigger_dep_name!=null?` <- ${w.trigger_dep_name}`:w?.trigger_dep_index!=null?` <- #${w.trigger_dep_index}`:"",_=l.in_batch?" [batch]":"";return`${m}${g}${l.type.toUpperCase()}${d.reset}${y}${T}${_}`};e.onEvent(l=>{a(l.type)&&o(f(l),l)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){rn(this._disposers,this.name),this.signal([[j]],{internal:!0}),rn(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"}),o={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:d,guard:u,...c}=r.nodes[a];o[a]=c}let s=[...r.subgraphs].sort(),i={...r,version:1,nodes:o,subgraphs:s};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 Nt(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??me,{codec:o,codecVersion:s,payload:i}=Ot(e,r);return o.decode(i,s)}restore(e,n){if(on(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(s=>Ke(s)),o=n?.includeProducers===!0;for(let s of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(s)))continue;let i=e.nodes[s];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(s,new Error(`restore: slice.value is undefined for "${s}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!o)){if(i.v!=null){let d=this.tryResolve(s)?.v;if(d!=null&&d.id===i.v.id&&d.version===i.v.version)continue}try{this.set(s,i.value)}catch(a){n?.onError?.(s,a)}}}}}static fromSnapshot(e,n){on(e);let r=typeof n=="function"?n:n?.build,o=typeof n=="function"?void 0:n?.factories,s=new t(e.name);if(r)return r(s),s.restore(e),s;for(let f of[...e.subgraphs].sort((l,g)=>{let m=l.split(I).length,b=g.split(I).length;return m!==b?m-b:l<g?-1:l>g?1:0})){let l=f.split(I),g=s;for(let m of l)g._mounts.has(m)||g.mount(m,new t(m)),g=g._mounts.get(m)}let i=o?Object.entries(o).map(([f,l])=>({re:Ke(f),factory:l})):[],a=f=>{for(let l of i)if(l.re.test(f))return l.factory},d=f=>{let l=f.split(I),g=l.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${f}"`);let m=s;for(let b of l){let v=m._mounts.get(b);if(!v)throw new Error(`unknown mount "${b}" in path "${f}"`);m=v}return[m,g]},u=Object.entries(e.nodes).filter(([f])=>!f.includes(`${I}${ee}${I}`)).sort((f,l)=>f[0]<l[0]?-1:f[0]>l[0]?1:0),c=new Map(u),h=new Map,p=!0;for(;c.size>0&&p;){p=!1;for(let[f,l]of[...c.entries()]){let g=l?.deps??[];if(!g.every(T=>h.has(T)))continue;let[m,b]=d(f),v={...l?.meta??{}},y=a(f),w;if(l?.type==="state")w=re(l.value,{meta:v});else{if(y==null)continue;w=y(b,{path:f,type:l.type,value:l.value,meta:v,deps:g,resolvedDeps:g.map(T=>h.get(T))})}m.add(w,{name:b}),h.set(f,w),c.delete(f),p=!0}}if(c.size>0){let f=[...c.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 s.restore(e),s}toJSON(){return this.snapshot()}attachSnapshotStorage(e,n={}){let r=e.map(u=>({tier:u,debounceMs:Math.max(0,u.debounceMs??0),compactEvery:Math.max(1,u.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 o=(u,c)=>{if(u.disposed)return;let h=dr(c.nodes);if(u.lastSnapshot!=null&&h!==""&&h===u.lastFingerprint)return;let p=u.seq+1,f=Me(),m=u.lastSnapshot==null||p%u.compactEvery===0?{name:this.name,mode:"full",snapshot:c,seq:p,timestamp_ns:f,format_version:ye}:{name:this.name,mode:"diff",diff:Er(u.lastSnapshot,c),seq:p,timestamp_ns:f,format_version:ye};if(u.tier.filter&&!u.tier.filter(m))return;let b;try{b=u.tier.save(m)}catch(v){n.onError?.(v,u.tier);return}if(b&&typeof b.then=="function"){let w=(u.savePending??Promise.resolve()).then(()=>b,()=>b).then(()=>{u.disposed||(u.seq=p,u.lastSnapshot=c,u.lastFingerprint=h)},T=>{n.onError?.(T,u.tier)});u.savePending=w.finally(()=>{u.savePending===w&&(u.savePending=void 0)})}else u.seq=p,u.lastSnapshot=c,u.lastFingerprint=h},s=(u,c)=>{try{o(u,c)}catch(h){n.onError?.(h,u.tier)}},i=(u,c)=>{if(!c.some(l=>{let g=this.config.messageTier(l[0]);return g>=3&&g<5}))return;if(n.filter){let l=this.tryResolve(u);if(l==null)return;let g=ht(l,Pe("standard"));if(!n.filter(u,g))return}let p,f=()=>(p==null&&(p=this.snapshot()),p);for(let l of r)l.disposed||(l.debounceMs===0?s(l,f()):(l.timer==null&&(l.timer=new $e),l.timer.start(l.debounceMs,()=>{l.disposed||s(l,this.snapshot())})))},a;if(n.paths!=null){let c=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(h=>{let p=this.tryResolve(h);return p==null?()=>{}:p.subscribe(f=>i(h,f))});a=()=>{for(let h of c)h()}}else a=this.observe().subscribe((u,c)=>i(u,c));let d=()=>{a();for(let u of r)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(d)};return this._storageDisposers.add(d),{dispose:d}}async _cascadeRestore(e,n){for(let r of e){let o;try{o=await r.load?.()}catch(i){n?.(i,r);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let s=o;try{if(s.mode==="full"&&s.snapshot!=null)return this.restore(s.snapshot),!0;if(s.version===ye&&s.nodes!=null)return this.restore(s),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let o of n){let s;try{s=await o.load?.()}catch(d){r?.onError?.(d,o);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let i=s,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===ye&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(d){r?.onError?.(d,o)}}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 o={path:e,annotation:n,timestamp_ns:Q(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(o)}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(o=>!e(o)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let o of n)this._traceRing.push(o);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),o=new Set(Object.keys(n.nodes)),s=[...o].filter(v=>!r.has(v)).sort(),i=[...r].filter(v=>!o.has(v)).sort(),a=[],d=[];for(let v of r){if(!o.has(v))continue;let y=e.nodes[v],w=n.nodes[v],T=y.v,_=w.v;T!=null&&_!=null&&T.id===_.id&&T.version!==_.version&&d.push({path:v,id:T.id,from:T.version,to:_.version});let x=T!=null&&_!=null&&T.id===_.id&&T.version===_.version;for(let N of["type","status","sentinel"]){let E=y[N],D=w[N];E!==D&&a.push({path:v,field:N,from:E,to:D})}if(!x)for(let N of["value","meta"]){let E=y[N],D=w[N];lr(E,D)||a.push({path:v,field:N,from:E,to:D})}}let u=v=>`${v.from} ${v.to}`,c=new Set(e.edges.map(u)),h=new Set(n.edges.map(u)),p=n.edges.filter(v=>!c.has(u(v))),f=e.edges.filter(v=>!h.has(u(v))),l=new Set(e.subgraphs),g=new Set(n.subgraphs),m=[...g].filter(v=>!l.has(v)).sort(),b=[...l].filter(v=>!g.has(v)).sort();return{nodesAdded:s,nodesRemoved:i,nodesChanged:a,versionChanges:d,edgesAdded:p,edgesRemoved:f,subgraphsAdded:m,subgraphsRemoved:b}}};function Er(t,e){let n=ve.diff(t,e),r={};for(let o of n.nodesAdded){let s=e.nodes[o];s!=null&&(r[o]=s)}return{...n,nodesAddedFull:r}}function an(t,e,n,r={}){let o={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?o:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let s=r.maxDepth;if(s!=null&&(!Number.isInteger(s)||s<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(s===0)return r.withDetail?o:[];let i=new Map,a=new Map,d=new Map,u=new Map,c=new Set;for(let[y,w]of Object.entries(t.nodes)){if(!y)continue;c.add(y);let T=w.deps??[];i.set(y,T);for(let _ of T)_&&(c.add(_),a.has(_)||a.set(_,new Set),a.get(_).add(y))}for(let y of t.edges){if(y==null||typeof y!="object")continue;let w=typeof y.from=="string"?y.from:"",T=typeof y.to=="string"?y.to:"";!w||!T||(c.add(w),c.add(T),u.has(w)||u.set(w,new Set),u.get(w).add(T),d.has(T)||d.set(T,new Set),d.get(T).add(w))}if(!c.has(e))return r.withDetail?o:[];let h=r.both===!0,p=y=>{if(h){let x=i.get(y)??[],N=d.get(y),E=a.get(y),D=u.get(y),k=[...x];return N&&k.push(...N),E&&k.push(...E),D&&k.push(...D),k}if(n==="upstream"){let x=i.get(y)??[],N=d.get(y);return N?[...x,...N]:x}let w=a.get(y),T=u.get(y),_=w?[...w]:[];return T&&_.push(...T),_},f=new Set([e]),l=new Map,g=[{path:e,depth:0}],m=0,b=!1;for(;m<g.length;){let y=g[m++];if(s!=null&&y.depth>=s){p(y.path).length>0&&(b=!0);continue}for(let w of p(y.path))!w||f.has(w)||(f.add(w),l.set(w,y.depth+1),g.push({path:w,depth:y.depth+1}))}let v=[...l.keys()].sort((y,w)=>y<w?-1:y>w?1:0);return r.withDetail?{paths:v,depths:l,truncated:b}:v}function kr(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.path!==o.path||r.type!==o.type||r.status!==o.status||r.hop!==o.hop||r.dep_index!==o.dep_index||r.annotation!==o.annotation||r.value!==o.value||r.lastMutation!==o.lastMutation)return!1;let s=r.v,i=o.v;if(s!==i&&(s==null||i==null||s.id!==i.id||s.version!==i.version))return!1}return!0}te();ft();function fn(t,e){let n=t.cache??0;return n>=e?!1:(t.down([[F],[C,n+1]]),!0)}function pn(t,e,n){return{[t]:!0,[`${t}_type`]:e,...n??{}}}function We(t,e){return pn("reduction",t,e)}function Rr(t,e,n,r){if(e.length===0)throw new RangeError("funnel requires at least one source");if(n.length===0)throw new RangeError("funnel requires at least one stage");let o=new ve(t,r),s=e.length===1?e[0]:Pt(...e);o.add(s,{name:"merged"});let i="merged";for(let a=0;a<n.length;a++){let d=n[a],u=new ve(d.name);d.build(u);try{u.resolve("input")}catch{throw new Error(`funnel stage "${d.name}" must define an "input" node`)}try{u.resolve("output")}catch{throw new Error(`funnel stage "${d.name}" must define an "output" node`)}o.mount(d.name,u);let c=o.resolve(i),h=`${d.name}::input`,p=o.resolve(h),f=`__bridge_${i}\u2192${d.name}_input`,l=It([c],([g])=>{p.emit(g)},{name:f});o.add(l,{name:f}),o.addDisposer(oe(l)),i=`${d.name}::output`}return o}function Sr(t,e,n,r){let o=r?.maxIterations??10,s=`__feedback_${e}`,i=re(0,{meta:We("feedback_counter",{maxIterations:o,feedbackFrom:e,feedbackTo:n})});t.add(i,{name:s});let a=t.resolve(e),d=t.resolve(n),u=`__feedback_effect_${e}`,c=ne([],(h,p)=>{let f=a.subscribe(l=>{for(let g of l){let m=g[0];if(m===C){let b=g[1];if(b==null)return;fe(()=>{fn(i,o)&&d.emit(b)})}else if(m===V||m===M){let b=m===M&&g.length>1?[M,g[1]]:[m];i.down([b])}}});return()=>f()},{name:u,describeKind:"effect",meta:{...We("feedback_effect",{feedbackFrom:e,feedbackTo:n}),_internal:!0}});return t.add(c,{name:u}),t.addDisposer(oe(c)),t}function Dr(t,e,n){if(e.length===0)throw new RangeError("budgetGate requires at least one constraint");let r=e.map(f=>f.node),o=[t,...r],s=[],i=!1,a=!1,d=Symbol("budget-gate"),u=new Array(e.length);function c(){return e.every((f,l)=>f.check(u[l]))}function h(f){for(;s.length>0&&c();){let l=s[0];s=s.slice(1),f.emit(l)}s.length===0&&a&&(a=!1,f.down([[B]]))}return ne([],(f,l)=>{for(let m=0;m<e.length;m++)u[m]=e[m].node.cache;let g=[];for(let m=0;m<o.length;m++){let b=o[m];g.push(b.subscribe(v=>{for(let y of v)p(y,m,l)}))}return()=>{for(let m of g)m()}},{...n,describeKind:"derived",meta:We("budget_gate",n?.meta)});function p(f,l,g){let m=f[0];if(l===0){if(m===C)return c()&&s.length===0?g.emit(f[1]):(s.push(f[1]),i||(i=!0,g.up([[K,d]]))),!0;if(m===F)return g.down([[F]]),!0;if(m===B)return s.length===0?g.down([[B]]):a=!0,!0;if(m===V||m===M){for(let b of s)g.emit(b);return s=[],a=!1,i&&(i=!1,g.up([[Z,d]])),g.down([f]),!0}return!1}return m===C&&(u[l-1]=f[1]),m===C||m===B?(c()&&s.length>0?(h(g),s.length===0&&i&&(i=!1,g.up([[Z,d]]))):!c()&&!i&&s.length>0&&(i=!0,g.up([[K,d]])),!0):m===F?!0:m===M?(g.down([f]),!0):m===V}}function Ar(t,e,n){if(t.length===0)throw new RangeError("scorer requires at least one source");if(t.length!==e.length)throw new RangeError("scorer requires the same number of sources and weights");let r=[...t,...e],o=t.length,s=n?.scoreFns;return de(r,i=>{let a=i.slice(0,o),d=i.slice(o),u=[],c=0;for(let h=0;h<o;h++){let p=a[h]??0,f=d[h]??0,g=(s?.[h]?s[h](p):p)*f;u.push(g),c+=g}return{value:a,score:c,breakdown:u}},{...n?{equals:n.equals,resubscribable:n.resubscribable,resetOnTeardown:n.resetOnTeardown}:{},describeKind:"derived",meta:We("scorer",n?.meta)})}function Mr(t){let e=$t({name:t?.name??"effectiveness-entries"}),n=de([e.entries],([i])=>new Map(i),{name:`${t?.name??"effectiveness"}-snapshot`,equals:(i,a)=>{let d=i,u=a;if(d.size!==u.size)return!1;for(let[c,h]of d){let p=u.get(c);if(!p||h.attempts!==p.attempts||h.successes!==p.successes)return!1}return!0}});function r(i,a){let d=e.get(i),u=(d?.attempts??0)+1,c=(d?.successes??0)+(a?1:0);e.set(i,{key:i,attempts:u,successes:c,successRate:c/u})}function o(i){return e.get(i)}let s=oe(n);return{node:n,record:r,lookup:o,dispose:()=>s()}}0&&(module.exports={budgetGate,effectivenessTracker,feedback,funnel,scorer});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import '../../node-
|
|
2
|
-
import '../../graph-
|
|
3
|
-
export { B as BudgetConstraint, a as BudgetGateOptions, E as EffectivenessEntry, b as EffectivenessSnapshot, c as EffectivenessTrackerBundle, d as EffectivenessTrackerOptions, F as FeedbackOptions, e as FunnelOptions, f as FunnelStage, S as ScoredItem, g as ScorerOptions, h as StepRef, j as budgetGate, k as effectivenessTracker, l as feedback, m as funnel, s as scorer } from '../../index-
|
|
4
|
-
import '../../meta-
|
|
1
|
+
import '../../node-fSc-hCv8.cjs';
|
|
2
|
+
import '../../graph-kTltt95s.cjs';
|
|
3
|
+
export { B as BudgetConstraint, a as BudgetGateOptions, E as EffectivenessEntry, b as EffectivenessSnapshot, c as EffectivenessTrackerBundle, d as EffectivenessTrackerOptions, F as FeedbackOptions, e as FunnelOptions, f as FunnelStage, S as ScoredItem, g as ScorerOptions, h as StepRef, j as budgetGate, k as effectivenessTracker, l as feedback, m as funnel, s as scorer } from '../../index-XxSeddWP.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 { B as BudgetConstraint, a as BudgetGateOptions, E as EffectivenessEntry, b as EffectivenessSnapshot, c as EffectivenessTrackerBundle, d as EffectivenessTrackerOptions, F as FeedbackOptions, e as FunnelOptions, f as FunnelStage, S as ScoredItem, g as ScorerOptions, h as StepRef, j as budgetGate, k as effectivenessTracker, l as feedback, m as funnel, s as scorer } from '../../index-
|
|
4
|
-
import '../../meta-
|
|
1
|
+
import '../../node-fSc-hCv8.js';
|
|
2
|
+
import '../../graph-Cv-8x0ZI.js';
|
|
3
|
+
export { B as BudgetConstraint, a as BudgetGateOptions, E as EffectivenessEntry, b as EffectivenessSnapshot, c as EffectivenessTrackerBundle, d as EffectivenessTrackerOptions, F as FeedbackOptions, e as FunnelOptions, f as FunnelStage, S as ScoredItem, g as ScorerOptions, h as StepRef, j as budgetGate, k as effectivenessTracker, l as feedback, m as funnel, s as scorer } from '../../index-DXSLMoma.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-LO3LO2TO.js";import"../../chunk-O32GJOUJ.js";import"../../chunk-TZQPPQEQ.js";import"../../chunk-5KPIYVCC.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-533RQFF6.js";import"../../chunk-JJTF75VS.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-MQZWA3DF.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{c as budgetGate,e as effectivenessTracker,b as feedback,a as funnel,d as scorer};
|