@graphrefly/graphrefly 0.37.0 → 0.39.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/budget-gate-CmmVtasH.d.ts +115 -0
- package/dist/budget-gate-DiP_nK0n.d.cts +115 -0
- package/dist/{cascading-BsJ4GbnS.d.ts → cascading-BzuxW0_w.d.cts} +2 -2
- package/dist/{cascading-B25wxpRa.d.cts → cascading-g2_rhhaM.d.ts} +2 -2
- package/dist/chunk-35JTVPOX.js +1 -0
- package/dist/chunk-3G5U5QNE.js +5 -0
- package/dist/chunk-4I45FVQS.js +1 -0
- package/dist/chunk-5LK7XMEV.js +1 -0
- package/dist/chunk-5XRI6RM3.js +1 -0
- package/dist/chunk-73PBQNST.js +1 -0
- package/dist/chunk-7JRF5YEK.js +3 -0
- package/dist/{chunk-YVYSO5CW.js → chunk-7NZMZJMW.js} +1 -1
- package/dist/chunk-7QFRK3N3.js +84 -0
- package/dist/{chunk-K6ZFJ473.js → chunk-7SD73DS6.js} +1 -1
- package/dist/{chunk-LOQRPP4Y.js → chunk-A6ZSKGUG.js} +1 -1
- package/dist/{chunk-KUVDFOJH.js → chunk-AU7YTQX7.js} +1 -1
- package/dist/chunk-C72GO4IZ.js +1 -0
- package/dist/{chunk-Q7EUZ6NN.js → chunk-CGDMTXSY.js} +1 -1
- package/dist/chunk-D27JNOLZ.js +1 -0
- package/dist/chunk-D47YVDR5.js +1 -0
- package/dist/chunk-EWF7KCDJ.js +61 -0
- package/dist/{chunk-PCD2MU7X.js → chunk-GEAO3TL3.js} +1 -1
- package/dist/chunk-GX5LSSRE.js +1 -0
- package/dist/{chunk-2C4NESZE.js → chunk-HAWKGIXM.js} +1 -1
- package/dist/chunk-HX3EGQ5Z.js +1 -0
- package/dist/{chunk-MQZWA3DF.js → chunk-IA7DUNGB.js} +1 -1
- package/dist/{chunk-MYFR67PY.js → chunk-INH6FS2G.js} +2 -2
- package/dist/chunk-INHC33EH.js +1 -0
- package/dist/chunk-IUB4NYI2.js +1 -0
- package/dist/{chunk-TFK4P4CX.js → chunk-JNMC2WJ6.js} +1 -1
- package/dist/{chunk-TLS7M7H4.js → chunk-KD4NHLMU.js} +1 -1
- package/dist/chunk-L6NSJVJZ.js +1 -0
- package/dist/chunk-L7WY6TZS.js +1 -0
- package/dist/chunk-LQNOXGET.js +1 -0
- package/dist/chunk-MC4UYY2X.js +1 -0
- package/dist/{chunk-U3COB5WU.js → chunk-N7UIBZCW.js} +1 -1
- package/dist/chunk-NQI2C36M.js +1 -0
- package/dist/chunk-R75BMDLA.js +1 -0
- package/dist/chunk-RF3QZP6D.js +1 -0
- package/dist/{chunk-MC5LZG3U.js → chunk-S2U57TFC.js} +1 -1
- package/dist/{chunk-QP5TH523.js → chunk-SC7BQDNP.js} +1 -1
- package/dist/{chunk-5CPPC75H.js → chunk-TFPZLQ5H.js} +1 -1
- package/dist/chunk-VJJLIEAL.js +1 -0
- package/dist/chunk-WHIZM6JV.js +1 -0
- package/dist/chunk-XEUANKBO.js +43 -0
- package/dist/chunk-XQ55HO5N.js +1 -0
- package/dist/chunk-ZJ7SM3G2.js +1 -0
- package/dist/{chunk-T4U24DXX.js → chunk-ZOX3LBRV.js} +1 -1
- package/dist/compat/index.cjs +9 -13
- package/dist/compat/index.d.cts +16 -16
- package/dist/compat/index.d.ts +16 -16
- 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 +8 -12
- package/dist/compat/nestjs/index.d.cts +8 -8
- package/dist/compat/nestjs/index.d.ts +8 -8
- 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 +3 -7
- package/dist/compat/zustand/index.d.cts +4 -4
- package/dist/compat/zustand/index.d.ts +4 -4
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-_XckYx2e.d.cts → composite-CKd0e2vz.d.cts} +10 -3
- package/dist/{composite-CT_mApQD.d.ts → composite-DGatA-JK.d.ts} +10 -3
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +1 -1
- package/dist/extra/browser.d.cts +1 -1
- package/dist/extra/browser.d.ts +1 -1
- package/dist/extra/index.cjs +17 -21
- package/dist/extra/index.d.cts +11 -9
- package/dist/extra/index.d.ts +11 -9
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +2 -2
- package/dist/extra/node.d.cts +108 -2
- package/dist/extra/node.d.ts +108 -2
- 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 +3 -3
- package/dist/extra/reactive.d.ts +3 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/render/index.cjs +5 -0
- package/dist/extra/render/index.d.cts +183 -0
- package/dist/extra/render/index.d.ts +183 -0
- package/dist/extra/render/index.js +1 -0
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.d.cts +1 -1
- package/dist/extra/sources.d.ts +1 -1
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-browser.d.cts +1 -1
- package/dist/extra/storage-browser.d.ts +1 -1
- package/dist/extra/storage-tiers-browser.d.cts +76 -5
- package/dist/extra/storage-tiers-browser.d.ts +76 -5
- package/dist/extra/storage-tiers-node.d.cts +137 -13
- package/dist/extra/storage-tiers-node.d.ts +137 -13
- package/dist/extra/storage-tiers.d.cts +151 -23
- package/dist/extra/storage-tiers.d.ts +151 -23
- package/dist/{fallback-axI2cXwt.d.cts → fallback-8JYU8tlT.d.cts} +1 -1
- package/dist/{fallback-DuEXfA4F.d.ts → fallback-CMZl39L5.d.ts} +1 -1
- package/dist/graph/index.cjs +7 -7
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +1 -1
- package/dist/{graph-YQXDndFy.d.ts → graph-30XSgtVX.d.ts} +287 -104
- package/dist/{graph-CaNXUc3c.d.cts → graph-BUwMAxJI.d.cts} +287 -104
- package/dist/{index-CIcu6fIR.d.ts → index-2n8Eai6M.d.ts} +1 -1
- package/dist/{index-BmLkcDlj.d.ts → index-89FczVZ_.d.ts} +47 -71
- package/dist/{index-Ci358GSC.d.cts → index-8R1vzNOx.d.cts} +9 -9
- package/dist/{index-CDvC1m5p.d.ts → index-B2RUoIUz.d.ts} +1 -1
- package/dist/{index-DuhOdNyg.d.ts → index-B41Asm7D.d.ts} +10 -8
- package/dist/{index-CKcnuQ2c.d.ts → index-B9fmw5n2.d.ts} +4 -6
- package/dist/{index-0qOD-421.d.ts → index-BAlaVimV.d.ts} +9 -9
- package/dist/{index-Ae6L8liv.d.ts → index-BC9VybQs.d.ts} +41 -48
- package/dist/{index-CUTHDZ7Q.d.ts → index-BEHmxORq.d.ts} +11 -11
- package/dist/{index-C_qi0WlF.d.cts → index-BJ26eEjs.d.cts} +26 -19
- package/dist/{index-BiomL7AW.d.ts → index-BJSZxSFX.d.ts} +1 -1
- package/dist/{index-DCAuN9u5.d.cts → index-BKMdnYnk.d.ts} +75 -39
- package/dist/{index-DfAo9WKr.d.ts → index-BM9szD8n.d.cts} +14 -6
- package/dist/{index-CajEOoAN.d.ts → index-BUPVld1w.d.ts} +2 -2
- package/dist/{index-C-pFD_FV.d.ts → index-BXd6OMEy.d.ts} +3 -3
- package/dist/index-BhUaMYm_.d.ts +113 -0
- package/dist/{index-DAKm44My.d.cts → index-BndG0cpK.d.cts} +3 -3
- package/dist/{index-Bpzw8hx3.d.ts → index-Br3WnqEn.d.ts} +84 -9
- package/dist/{index-D6tRNEKz.d.cts → index-BskfDoZ_.d.ts} +14 -6
- package/dist/{index-9mbs_PIG.d.ts → index-C19qqa38.d.ts} +4 -4
- package/dist/{index-fHKHdAso.d.ts → index-C7VV_qOs.d.ts} +4 -4
- package/dist/{index-CLPQyYY5.d.cts → index-CIRG8Hxp.d.cts} +11 -11
- package/dist/{index-B3D_z0Z6.d.cts → index-CL7oilfm.d.cts} +1 -1
- package/dist/{index-BOfHwQc1.d.ts → index-CPhBvRJU.d.ts} +1 -1
- package/dist/{index-B9qJmmv3.d.cts → index-CWHtYmSh.d.cts} +1 -1
- package/dist/{index-D_d1erkR.d.ts → index-Cey6VTnX.d.ts} +8 -5
- package/dist/{resilience-BWP2c7Af.d.cts → index-CmqiJZKM.d.ts} +141 -23
- package/dist/{index-JYtN9uqM.d.ts → index-CoM4rzyB.d.ts} +1 -1
- package/dist/{index-DTYIRT_v.d.cts → index-CpLpJb6A.d.cts} +8 -5
- package/dist/{index-BjWZARLy.d.ts → index-Ctb7_2sG.d.ts} +1 -1
- package/dist/index-CusEP3Sv.d.ts +210 -0
- package/dist/{resilience-Bys63Cpd.d.ts → index-CwP_KAMS.d.cts} +141 -23
- package/dist/{index-BFuVcqL8.d.cts → index-D3ayz3hy.d.cts} +1 -1
- package/dist/{index-CrpjECS6.d.cts → index-DCbE8fFM.d.cts} +3 -3
- package/dist/{index-D_DThl_J.d.cts → index-DIHcMLr6.d.cts} +1 -1
- package/dist/index-DINuaZlJ.d.cts +210 -0
- package/dist/{index-9xhIaM-w.d.cts → index-DOBLxOti.d.cts} +1 -1
- package/dist/index-DQUVq1_d.d.ts +374 -0
- package/dist/{index-B1IcU--K.d.cts → index-DTtBpuQy.d.cts} +4 -6
- package/dist/{index-D_QQ_dTD.d.cts → index-DYTBbF8T.d.cts} +1 -1
- package/dist/{index-DqtXA3yX.d.cts → index-DlgHqQxW.d.cts} +84 -9
- package/dist/{index-D1E1tqHT.d.ts → index-DlrWu9Hs.d.cts} +75 -39
- package/dist/{index-DcWbx58m.d.cts → index-DoYc8BWK.d.cts} +41 -48
- package/dist/{index-D0ZxFXYl.d.ts → index-DszPlZzK.d.ts} +3 -3
- package/dist/{index-BECJ8M0T.d.cts → index-DyM4tFAe.d.cts} +10 -8
- package/dist/{index-D11pGlaI.d.cts → index-FVoPvhAu.d.cts} +4 -4
- package/dist/{index-BwtIbzSV.d.cts → index-H_I66pav.d.cts} +2 -2
- package/dist/{index-e1m3ZHgc.d.cts → index-IwFqHxCs.d.cts} +2 -2
- package/dist/index-K-vl_c6A.d.cts +113 -0
- package/dist/{index-C4N-dg5U.d.cts → index-KlZ_ZUip.d.cts} +2 -2
- package/dist/index-L8XI8Zql.d.cts +374 -0
- package/dist/{index-D8IyqHvT.d.cts → index-MxYuWOrf.d.cts} +6 -4
- package/dist/{index-CpZKtdMw.d.cts → index-PgwvGWa1.d.cts} +1 -1
- package/dist/{index-B46GWgk3.d.ts → index-PlJ3MraE.d.ts} +1 -1
- package/dist/{index-DPqR3wdW.d.ts → index-PqbnoScQ.d.ts} +3 -3
- package/dist/{index-CU3z8Cel.d.cts → index-PsVHpPwP.d.cts} +3 -3
- package/dist/{index-C0tga1_x.d.ts → index-WyFKER-c.d.ts} +2 -2
- package/dist/{index-B5UR87KG.d.ts → index-eaQuGJnv.d.ts} +6 -4
- package/dist/{index-CzIWlnPp.d.ts → index-iTX5IqSP.d.ts} +140 -9
- package/dist/{index-CRycrNfn.d.ts → index-jKLph6cu.d.ts} +2 -2
- package/dist/{index-BhLA9feT.d.ts → index-jr6PuSBt.d.ts} +26 -19
- package/dist/{index-4IwO4mH2.d.cts → index-mNwgxC21.d.cts} +140 -9
- package/dist/{index-CkN8CZlT.d.cts → index-pVDQcbar.d.cts} +47 -71
- package/dist/{index-D6pwWiOc.d.cts → index-xZYcDqFH.d.cts} +4 -4
- package/dist/{index-8OxXae3g.d.ts → index-yLt-aPMp.d.ts} +1 -1
- package/dist/{index-CqSJ25A9.d.cts → index-z8WFPVI8.d.cts} +1 -1
- package/dist/index.cjs +64 -60
- package/dist/index.d.cts +48 -47
- package/dist/index.d.ts +48 -47
- package/dist/index.js +1 -1
- package/dist/meta-Ct9nqQS5.d.cts +102 -0
- package/dist/meta-D8OyedKp.d.ts +102 -0
- package/dist/{node-fSc-hCv8.d.cts → node-BYInONRr.d.cts} +3 -3
- package/dist/{node-fSc-hCv8.d.ts → node-BYInONRr.d.ts} +3 -3
- package/dist/{observable-Cqty11jG.d.cts → observable-DMIlYJV1.d.cts} +1 -1
- package/dist/{observable-EAV_rNfM.d.ts → observable-DO8DDEzv.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 +17 -21
- package/dist/patterns/ai/index.d.cts +17 -17
- package/dist/patterns/ai/index.d.ts +17 -17
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.cjs +1 -1
- package/dist/patterns/ai/node.d.cts +4 -4
- package/dist/patterns/ai/node.d.ts +4 -4
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.cjs +3 -7
- package/dist/patterns/audit/index.d.cts +6 -6
- package/dist/patterns/audit/index.d.ts +6 -6
- package/dist/patterns/audit/index.js +1 -1
- package/dist/patterns/cqrs/index.cjs +3 -7
- package/dist/patterns/cqrs/index.d.cts +6 -6
- package/dist/patterns/cqrs/index.d.ts +6 -6
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +5 -8
- package/dist/patterns/demo-shell/index.d.cts +5 -5
- package/dist/patterns/demo-shell/index.d.ts +5 -5
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +3 -7
- package/dist/patterns/domain-templates/index.d.cts +4 -4
- package/dist/patterns/domain-templates/index.d.ts +4 -4
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +38 -38
- package/dist/patterns/graphspec/index.d.cts +5 -5
- package/dist/patterns/graphspec/index.d.ts +5 -5
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +3 -7
- package/dist/patterns/guarded-execution/index.d.cts +7 -7
- package/dist/patterns/guarded-execution/index.d.ts +7 -7
- package/dist/patterns/guarded-execution/index.js +1 -1
- package/dist/patterns/harness/index.cjs +8 -12
- package/dist/patterns/harness/index.d.cts +12 -12
- package/dist/patterns/harness/index.d.ts +12 -12
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +3 -7
- package/dist/patterns/job-queue/index.d.cts +6 -6
- package/dist/patterns/job-queue/index.d.ts +6 -6
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +3 -7
- package/dist/patterns/lens/index.d.cts +6 -6
- package/dist/patterns/lens/index.d.ts +6 -6
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +3 -7
- package/dist/patterns/memory/index.d.cts +7 -5
- package/dist/patterns/memory/index.d.ts +7 -5
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +3 -7
- package/dist/patterns/messaging/index.d.cts +5 -5
- package/dist/patterns/messaging/index.d.ts +5 -5
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.cjs +3 -7
- package/dist/patterns/orchestration/index.d.cts +8 -8
- package/dist/patterns/orchestration/index.d.ts +8 -8
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/process/index.cjs +1 -1
- package/dist/patterns/process/index.d.cts +7 -7
- package/dist/patterns/process/index.d.ts +7 -7
- package/dist/patterns/process/index.js +1 -1
- package/dist/patterns/reactive-layout/index.cjs +4 -8
- package/dist/patterns/reactive-layout/index.d.cts +5 -5
- package/dist/patterns/reactive-layout/index.d.ts +5 -5
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +3 -7
- package/dist/patterns/reduction/index.d.cts +4 -4
- package/dist/patterns/reduction/index.d.ts +4 -4
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.cjs +5 -9
- package/dist/patterns/refine-loop/index.d.cts +6 -6
- package/dist/patterns/refine-loop/index.d.ts +6 -6
- 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 +4 -8
- package/dist/patterns/resilient-pipeline/index.d.ts +4 -8
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +13 -17
- package/dist/patterns/surface/index.d.cts +6 -6
- package/dist/patterns/surface/index.d.ts +6 -6
- package/dist/patterns/surface/index.js +1 -1
- package/dist/{pipeline-graph-BrrYGjuZ.d.cts → pipeline-graph-BQPr2Lqs.d.cts} +34 -17
- package/dist/{pipeline-graph-DX2Twdj-.d.ts → pipeline-graph-D8vKcO_p.d.ts} +34 -17
- package/dist/{reactive-layout-DrGjuwyC.d.cts → reactive-layout-8CSc0tiA.d.cts} +2 -2
- package/dist/{reactive-layout-BDdngW56.d.ts → reactive-layout-DkTXxtSy.d.ts} +2 -2
- package/dist/{reactive-log-jirQsxMY.d.ts → reactive-log-BlAsPLl2.d.ts} +30 -3
- package/dist/{reactive-log-ScpWyqny.d.cts → reactive-log-_zeEnB9H.d.cts} +30 -3
- package/dist/{reactive-map-DmgeADH8.d.cts → reactive-map-B2qfD3hb.d.cts} +1 -1
- package/dist/{reactive-map-CHyeCf4D.d.ts → reactive-map-jFIsE6Kt.d.ts} +1 -1
- package/dist/resilience-HTF2LBRS.js +1 -0
- package/dist/{sugar-D13E2M_z.d.ts → sugar-BhfjgetH.d.ts} +1 -1
- package/dist/{sugar-DgaGJcI6.d.cts → sugar-DzePN5-g.d.cts} +1 -1
- package/dist/{topology-tree-BkhmMg2a.d.cts → topology-tree-B5Ngw3j0.d.cts} +1 -1
- package/dist/{topology-tree-BI665P0L.d.ts → topology-tree-BtvbgMXJ.d.ts} +1 -1
- package/dist/{types-BMSGPlpO.d.cts → types-1Dhoi7HM.d.cts} +1 -1
- package/dist/{types-CidcBDuk.d.ts → types-39jk0kaV.d.ts} +1 -1
- package/package.json +11 -1
- package/dist/chunk-4EATTNAE.js +0 -1
- package/dist/chunk-533RQFF6.js +0 -1
- package/dist/chunk-6SVKZ7VI.js +0 -1
- package/dist/chunk-A5HZZYRK.js +0 -1
- package/dist/chunk-B4L5X2QO.js +0 -7
- package/dist/chunk-C5CBVOCB.js +0 -1
- package/dist/chunk-CZIQ6JCE.js +0 -1
- package/dist/chunk-FJ6IEMOS.js +0 -1
- package/dist/chunk-FMI4CWFL.js +0 -1
- package/dist/chunk-G6Q3DUMJ.js +0 -1
- package/dist/chunk-GDDPCDLG.js +0 -1
- package/dist/chunk-GFOT6UBB.js +0 -1
- package/dist/chunk-JJTF75VS.js +0 -1
- package/dist/chunk-K2WYIVHM.js +0 -1
- package/dist/chunk-KTWBUJO5.js +0 -61
- package/dist/chunk-M27MVZCP.js +0 -1
- package/dist/chunk-NKKUUKPD.js +0 -43
- package/dist/chunk-O32GJOUJ.js +0 -1
- package/dist/chunk-QKBCTKH7.js +0 -1
- package/dist/chunk-QWVQIL3T.js +0 -1
- package/dist/chunk-UODQF4EY.js +0 -1
- package/dist/chunk-WGST56ZH.js +0 -80
- package/dist/chunk-WSLN4JFO.js +0 -1
- package/dist/chunk-XIJKEXWR.js +0 -1
- package/dist/imperative-audit-ahAE65a9.d.cts +0 -28
- package/dist/imperative-audit-ahAE65a9.d.ts +0 -28
- package/dist/index-BCq12BqB.d.ts +0 -139
- package/dist/index-BokynmA4.d.cts +0 -186
- package/dist/index-DXz9uwcs.d.ts +0 -186
- package/dist/index-DbWwMWiB.d.cts +0 -139
- package/dist/meta-BGO6C7K9.d.cts +0 -41
- package/dist/meta-CC6EPdpK.d.ts +0 -41
- package/dist/resilience-OBU472D2.js +0 -1
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as DerivedFn } from './sugar-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { N as Node, c as NodeActions } from './node-BYInONRr.cjs';
|
|
2
|
+
import { D as DerivedFn } from './sugar-DzePN5-g.cjs';
|
|
3
|
+
import { B as BaseAuditRecord } from './index-DINuaZlJ.cjs';
|
|
4
|
+
import { a as ReactiveLogBundle } from './reactive-log-_zeEnB9H.cjs';
|
|
5
|
+
import { G as Graph, a as GraphOptions } from './graph-BUwMAxJI.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* PipelineGraph subclass (Wave A.1 Unit 1 — locked 2026-04-24).
|
|
9
9
|
*
|
|
10
10
|
* Specialized {@link Graph} that hosts workflow-DAG sugar methods:
|
|
11
|
-
* `task` / `classify` / `combine` / `approval` / `
|
|
12
|
-
* legacy `pipeline` / `task` / `branch` / `join` / `subPipeline` /
|
|
13
|
-
* `approval` / `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* `task` / `classify` / `combine` / `approval` / `approvalGate` / `catch`.
|
|
12
|
+
* The legacy `pipeline` / `task` / `branch` / `join` / `subPipeline` /
|
|
13
|
+
* `approval` / `loop` / `onFailure` factories from {@link ./index} continue
|
|
14
|
+
* to work for migration ease; new code should prefer methods on this class.
|
|
15
|
+
*
|
|
16
|
+
* **Tier 2.3 rename:** the prior `gate(...)` method is now `approvalGate(...)`,
|
|
17
|
+
* disambiguating it from the other gate-family primitives (`budgetGate` for
|
|
18
|
+
* numeric constraints, `valve` for boolean switching, `policyGate` for ABAC
|
|
19
|
+
* rules). The "gating dimension" here is **human judgment**.
|
|
16
20
|
*
|
|
17
21
|
* Construction: `pipelineGraph(name, opts?)` or `new PipelineGraph(name, opts)`.
|
|
18
22
|
*/
|
|
@@ -64,15 +68,28 @@ interface GateController<T> {
|
|
|
64
68
|
open(): void;
|
|
65
69
|
close(): void;
|
|
66
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Terminal-cause discriminator for the {@link PipelineGraph.catch} recovery
|
|
73
|
+
* handler. Tier 1.6.3 status-enum migration: was `{ kind: "complete" | "error" }`
|
|
74
|
+
* pre-1.0; aligned with the canonical lifecycle enum
|
|
75
|
+
* (`status: "running" | "completed" | "errored" | "cancelled"`). The variant
|
|
76
|
+
* structure is preserved — `errored` still carries `error: unknown` and
|
|
77
|
+
* `completed` carries no payload.
|
|
78
|
+
*/
|
|
67
79
|
type TerminalCause = {
|
|
68
|
-
kind: "
|
|
80
|
+
kind: "errored";
|
|
69
81
|
error: unknown;
|
|
70
82
|
} | {
|
|
71
|
-
kind: "
|
|
83
|
+
kind: "completed";
|
|
72
84
|
};
|
|
73
85
|
interface CatchOptions<T> {
|
|
74
|
-
/**
|
|
75
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Which terminal cause to recover. Default `"errored"` (Tier 1.6.3 rename
|
|
88
|
+
* of `"error"`). `"completed"` recovers COMPLETE; `"terminal"` recovers
|
|
89
|
+
* either. Aligns with the canonical lifecycle enum that
|
|
90
|
+
* {@link TerminalCause.kind} now uses.
|
|
91
|
+
*/
|
|
92
|
+
on?: "errored" | "completed" | "terminal";
|
|
76
93
|
completeWhenDepsComplete?: boolean;
|
|
77
94
|
meta?: Record<string, unknown>;
|
|
78
95
|
handlerVersion?: {
|
|
@@ -103,12 +120,12 @@ declare class PipelineGraph extends Graph {
|
|
|
103
120
|
}): Node<{
|
|
104
121
|
[K in keyof R]: unknown;
|
|
105
122
|
}>;
|
|
106
|
-
|
|
123
|
+
approvalGate<T>(name: string, source: StepRef, opts?: GateOptions<T>): GateController<T>;
|
|
107
124
|
/**
|
|
108
125
|
* Reactive approval step: passes items through when `approver` is truthy;
|
|
109
126
|
* holds at most one pending item (maxPending: 1) when falsy. A thin alias
|
|
110
|
-
* over `
|
|
111
|
-
* finer control (maxPending, onceOnly, manual approve/reject).
|
|
127
|
+
* over `approvalGate({ approver, maxPending: 1 })` — use `approvalGate()`
|
|
128
|
+
* directly for finer control (maxPending, onceOnly, manual approve/reject).
|
|
112
129
|
*/
|
|
113
130
|
approval<T>(name: string, source: StepRef, approver: Node<unknown>, opts?: Omit<GateOptions<T>, "approver" | "maxPending">): GateController<T>;
|
|
114
131
|
catch<T>(name: string, source: StepRef, recover: (cause: TerminalCause, actions: NodeActions) => T, opts?: CatchOptions<T>): Node<T>;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as DerivedFn } from './sugar-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { N as Node, c as NodeActions } from './node-BYInONRr.js';
|
|
2
|
+
import { D as DerivedFn } from './sugar-BhfjgetH.js';
|
|
3
|
+
import { B as BaseAuditRecord } from './index-CusEP3Sv.js';
|
|
4
|
+
import { a as ReactiveLogBundle } from './reactive-log-BlAsPLl2.js';
|
|
5
|
+
import { G as Graph, a as GraphOptions } from './graph-30XSgtVX.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* PipelineGraph subclass (Wave A.1 Unit 1 — locked 2026-04-24).
|
|
9
9
|
*
|
|
10
10
|
* Specialized {@link Graph} that hosts workflow-DAG sugar methods:
|
|
11
|
-
* `task` / `classify` / `combine` / `approval` / `
|
|
12
|
-
* legacy `pipeline` / `task` / `branch` / `join` / `subPipeline` /
|
|
13
|
-
* `approval` / `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* `task` / `classify` / `combine` / `approval` / `approvalGate` / `catch`.
|
|
12
|
+
* The legacy `pipeline` / `task` / `branch` / `join` / `subPipeline` /
|
|
13
|
+
* `approval` / `loop` / `onFailure` factories from {@link ./index} continue
|
|
14
|
+
* to work for migration ease; new code should prefer methods on this class.
|
|
15
|
+
*
|
|
16
|
+
* **Tier 2.3 rename:** the prior `gate(...)` method is now `approvalGate(...)`,
|
|
17
|
+
* disambiguating it from the other gate-family primitives (`budgetGate` for
|
|
18
|
+
* numeric constraints, `valve` for boolean switching, `policyGate` for ABAC
|
|
19
|
+
* rules). The "gating dimension" here is **human judgment**.
|
|
16
20
|
*
|
|
17
21
|
* Construction: `pipelineGraph(name, opts?)` or `new PipelineGraph(name, opts)`.
|
|
18
22
|
*/
|
|
@@ -64,15 +68,28 @@ interface GateController<T> {
|
|
|
64
68
|
open(): void;
|
|
65
69
|
close(): void;
|
|
66
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Terminal-cause discriminator for the {@link PipelineGraph.catch} recovery
|
|
73
|
+
* handler. Tier 1.6.3 status-enum migration: was `{ kind: "complete" | "error" }`
|
|
74
|
+
* pre-1.0; aligned with the canonical lifecycle enum
|
|
75
|
+
* (`status: "running" | "completed" | "errored" | "cancelled"`). The variant
|
|
76
|
+
* structure is preserved — `errored` still carries `error: unknown` and
|
|
77
|
+
* `completed` carries no payload.
|
|
78
|
+
*/
|
|
67
79
|
type TerminalCause = {
|
|
68
|
-
kind: "
|
|
80
|
+
kind: "errored";
|
|
69
81
|
error: unknown;
|
|
70
82
|
} | {
|
|
71
|
-
kind: "
|
|
83
|
+
kind: "completed";
|
|
72
84
|
};
|
|
73
85
|
interface CatchOptions<T> {
|
|
74
|
-
/**
|
|
75
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Which terminal cause to recover. Default `"errored"` (Tier 1.6.3 rename
|
|
88
|
+
* of `"error"`). `"completed"` recovers COMPLETE; `"terminal"` recovers
|
|
89
|
+
* either. Aligns with the canonical lifecycle enum that
|
|
90
|
+
* {@link TerminalCause.kind} now uses.
|
|
91
|
+
*/
|
|
92
|
+
on?: "errored" | "completed" | "terminal";
|
|
76
93
|
completeWhenDepsComplete?: boolean;
|
|
77
94
|
meta?: Record<string, unknown>;
|
|
78
95
|
handlerVersion?: {
|
|
@@ -103,12 +120,12 @@ declare class PipelineGraph extends Graph {
|
|
|
103
120
|
}): Node<{
|
|
104
121
|
[K in keyof R]: unknown;
|
|
105
122
|
}>;
|
|
106
|
-
|
|
123
|
+
approvalGate<T>(name: string, source: StepRef, opts?: GateOptions<T>): GateController<T>;
|
|
107
124
|
/**
|
|
108
125
|
* Reactive approval step: passes items through when `approver` is truthy;
|
|
109
126
|
* holds at most one pending item (maxPending: 1) when falsy. A thin alias
|
|
110
|
-
* over `
|
|
111
|
-
* finer control (maxPending, onceOnly, manual approve/reject).
|
|
127
|
+
* over `approvalGate({ approver, maxPending: 1 })` — use `approvalGate()`
|
|
128
|
+
* directly for finer control (maxPending, onceOnly, manual approve/reject).
|
|
112
129
|
*/
|
|
113
130
|
approval<T>(name: string, source: StepRef, approver: Node<unknown>, opts?: Omit<GateOptions<T>, "approver" | "maxPending">): GateController<T>;
|
|
114
131
|
catch<T>(name: string, source: StepRef, recover: (cause: TerminalCause, actions: NodeActions) => T, opts?: CatchOptions<T>): Node<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { G as Graph } from './graph-
|
|
1
|
+
import { N as Node } from './node-BYInONRr.cjs';
|
|
2
|
+
import { G as Graph } from './graph-BUwMAxJI.cjs';
|
|
3
3
|
|
|
4
4
|
/** Pluggable measurement backend. */
|
|
5
5
|
interface MeasurementAdapter {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { G as Graph } from './graph-
|
|
1
|
+
import { N as Node } from './node-BYInONRr.js';
|
|
2
|
+
import { G as Graph } from './graph-30XSgtVX.js';
|
|
3
3
|
|
|
4
4
|
/** Pluggable measurement backend. */
|
|
5
5
|
interface MeasurementAdapter {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V as VersioningLevel, b as NodeGuard, N as Node } from './node-BYInONRr.js';
|
|
2
2
|
import { AppendLogStorageTier } from './extra/storage-tiers.js';
|
|
3
3
|
|
|
4
4
|
type ReactiveLogOptions<T> = {
|
|
@@ -160,7 +160,34 @@ declare class NativeLogBackend<T> implements LogBackend<T> {
|
|
|
160
160
|
private _rawAppend;
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
|
-
* Creates an append-only reactive log
|
|
163
|
+
* Creates an append-only reactive log that emits immutable `readonly T[]` snapshots.
|
|
164
|
+
*
|
|
165
|
+
* Each structural mutation (`append`, `appendMany`, `clear`, `trimHead`) triggers
|
|
166
|
+
* a two-phase `[DIRTY, DATA]` emission on the `entries` node so downstream
|
|
167
|
+
* derived nodes update reactively. Views (`tail`, `slice`, `fromCursor`) are
|
|
168
|
+
* memoized derived nodes — subscribe once and they stay live.
|
|
169
|
+
*
|
|
170
|
+
* @param initial - Optional initial entries loaded into the log at construction.
|
|
171
|
+
* @param options - Optional name, max size (ring buffer), versioning level, guard policy, and custom backend.
|
|
172
|
+
* @returns `ReactiveLogBundle<T>` with `entries`, `append`, `appendMany`, `clear`, `trimHead`, `view`, `attach`, `attachStorage`, and disposal methods.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { reactiveLog } from "@graphrefly/graphrefly/extra";
|
|
177
|
+
*
|
|
178
|
+
* const log = reactiveLog<string>([], { name: "messages" });
|
|
179
|
+
* log.entries.subscribe((msgs) => {
|
|
180
|
+
* for (const m of msgs) {
|
|
181
|
+
* if (m[0] === 1) console.log("entries:", m[1]);
|
|
182
|
+
* }
|
|
183
|
+
* });
|
|
184
|
+
* log.append("hello");
|
|
185
|
+
* log.append("world");
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* **Ring buffer:** Pass `maxSize` to cap the log length; older entries are evicted on overflow.
|
|
190
|
+
* **Storage:** Call `attachStorage(tiers)` to wire one or more `AppendLogStorageTier` instances for persistence.
|
|
164
191
|
*
|
|
165
192
|
* @category extra
|
|
166
193
|
*/
|
|
@@ -193,4 +220,4 @@ interface MergedReactiveLog<T> {
|
|
|
193
220
|
*/
|
|
194
221
|
declare function mergeReactiveLogs<T>(logs: readonly Node<readonly T[]>[]): MergedReactiveLog<T>;
|
|
195
222
|
|
|
196
|
-
export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type
|
|
223
|
+
export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type ReactiveLogOptions as R, type ViewSpec as V, type ReactiveLogBundle as a, mergeReactiveLogs as m, reactiveLog as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V as VersioningLevel, b as NodeGuard, N as Node } from './node-BYInONRr.cjs';
|
|
2
2
|
import { AppendLogStorageTier } from './extra/storage-tiers.cjs';
|
|
3
3
|
|
|
4
4
|
type ReactiveLogOptions<T> = {
|
|
@@ -160,7 +160,34 @@ declare class NativeLogBackend<T> implements LogBackend<T> {
|
|
|
160
160
|
private _rawAppend;
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
|
-
* Creates an append-only reactive log
|
|
163
|
+
* Creates an append-only reactive log that emits immutable `readonly T[]` snapshots.
|
|
164
|
+
*
|
|
165
|
+
* Each structural mutation (`append`, `appendMany`, `clear`, `trimHead`) triggers
|
|
166
|
+
* a two-phase `[DIRTY, DATA]` emission on the `entries` node so downstream
|
|
167
|
+
* derived nodes update reactively. Views (`tail`, `slice`, `fromCursor`) are
|
|
168
|
+
* memoized derived nodes — subscribe once and they stay live.
|
|
169
|
+
*
|
|
170
|
+
* @param initial - Optional initial entries loaded into the log at construction.
|
|
171
|
+
* @param options - Optional name, max size (ring buffer), versioning level, guard policy, and custom backend.
|
|
172
|
+
* @returns `ReactiveLogBundle<T>` with `entries`, `append`, `appendMany`, `clear`, `trimHead`, `view`, `attach`, `attachStorage`, and disposal methods.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { reactiveLog } from "@graphrefly/graphrefly/extra";
|
|
177
|
+
*
|
|
178
|
+
* const log = reactiveLog<string>([], { name: "messages" });
|
|
179
|
+
* log.entries.subscribe((msgs) => {
|
|
180
|
+
* for (const m of msgs) {
|
|
181
|
+
* if (m[0] === 1) console.log("entries:", m[1]);
|
|
182
|
+
* }
|
|
183
|
+
* });
|
|
184
|
+
* log.append("hello");
|
|
185
|
+
* log.append("world");
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* **Ring buffer:** Pass `maxSize` to cap the log length; older entries are evicted on overflow.
|
|
190
|
+
* **Storage:** Call `attachStorage(tiers)` to wire one or more `AppendLogStorageTier` instances for persistence.
|
|
164
191
|
*
|
|
165
192
|
* @category extra
|
|
166
193
|
*/
|
|
@@ -193,4 +220,4 @@ interface MergedReactiveLog<T> {
|
|
|
193
220
|
*/
|
|
194
221
|
declare function mergeReactiveLogs<T>(logs: readonly Node<readonly T[]>[]): MergedReactiveLog<T>;
|
|
195
222
|
|
|
196
|
-
export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type
|
|
223
|
+
export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type ReactiveLogOptions as R, type ViewSpec as V, type ReactiveLogBundle as a, mergeReactiveLogs as m, reactiveLog as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as Node, V as VersioningLevel, a as NodeOptions } from './node-BYInONRr.cjs';
|
|
2
2
|
|
|
3
3
|
type ReactiveMapOptions<K, V> = {
|
|
4
4
|
/** Optional registry name for `describe()` / debugging. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as Node, V as VersioningLevel, a as NodeOptions } from './node-BYInONRr.js';
|
|
2
2
|
|
|
3
3
|
type ReactiveMapOptions<K, V> = {
|
|
4
4
|
/** Optional registry name for `describe()` / debugging. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-IUB4NYI2.js";import"./chunk-L6NSJVJZ.js";import"./chunk-SGS4OJGS.js";import"./chunk-ESMPEKEV.js";import"./chunk-4VVTGLXJ.js";import"./chunk-35JTVPOX.js";import"./chunk-IA7DUNGB.js";import"./chunk-LYCLF26R.js";import"./chunk-CK2E7BTU.js";import"./chunk-QYADASLV.js";export{c as CircuitOpenError,g as RateLimiterOverflowError,j as TimeoutError,a as budgetGate,d as circuitBreaker,k as fallback,h as rateLimiter,b as retry,l as timeout,f as tokenBucket,e as withBreaker,i as withStatus};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as NodeOptions, F as FnCtx, N as Node, c as NodeActions, d as NodeFnCleanup } from './node-BYInONRr.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Sugar constructors over the raw `node()` primitive.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as NodeOptions, F as FnCtx, N as Node, c as NodeActions, d as NodeFnCleanup } from './node-BYInONRr.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Sugar constructors over the raw `node()` primitive.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphrefly/graphrefly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319",
|
|
5
5
|
"description": "Reactive harness layer for agent workflows. Describe automations in plain language, trace every decision, enforce policies, persist checkpoints. Zero dependencies.",
|
|
6
6
|
"repository": {
|
|
@@ -157,6 +157,16 @@
|
|
|
157
157
|
"default": "./dist/extra/storage-tiers-browser.cjs"
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
|
+
"./extra/render": {
|
|
161
|
+
"import": {
|
|
162
|
+
"types": "./dist/extra/render/index.d.ts",
|
|
163
|
+
"default": "./dist/extra/render/index.js"
|
|
164
|
+
},
|
|
165
|
+
"require": {
|
|
166
|
+
"types": "./dist/extra/render/index.d.cts",
|
|
167
|
+
"default": "./dist/extra/render/index.cjs"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
160
170
|
"./graph": {
|
|
161
171
|
"import": {
|
|
162
172
|
"types": "./dist/graph/index.d.ts",
|
package/dist/chunk-4EATTNAE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as $}from"./chunk-U3COB5WU.js";import{c as O}from"./chunk-O32GJOUJ.js";import{a as C}from"./chunk-QWVQIL3T.js";import{j as A}from"./chunk-B4L5X2QO.js";import{b as x}from"./chunk-KUVDFOJH.js";import{C as R}from"./chunk-MQZWA3DF.js";import{C as T,E as N,G as E,o as b,p as w,u as P,w as S}from"./chunk-LYCLF26R.js";import{b as v}from"./chunk-CK2E7BTU.js";import{b as M}from"./chunk-QYADASLV.js";var J={};M(J,{AuditTrailGraph:()=>k,PolicyEnforcerGraph:()=>G,auditTrail:()=>z,complianceSnapshot:()=>F,policyEnforcer:()=>K,reactiveExplainPath:()=>q});function V(i,t){return O("audit",i,t)}var L=new Set(["data","error","complete","teardown"]),k=class extends A{entries;count;_log;_target;constructor(t,n){super(n.name??`${t.name}_audit`,n.graph),this._target=t,this._log=x([],{name:"entries",...n.maxSize!=null?{maxSize:n.maxSize}:{}}),this.entries=this._log.entries,this.add(this.entries,{name:"entries"}),this.count=E([this.entries],([c])=>c.length,{name:"count",describeKind:"derived",meta:V("count")}),this.add(this.count,{name:"count"}),this.addDisposer(R(this.count));let o=n.includeTypes!=null?new Set(n.includeTypes):L,u=n.filter,a=0,h=t.observe({timeline:!0,structured:!0}),m=h.onEvent(c=>{if(c.type==="derived")return;let e=c.type;if(!o.has(e))return;let d=c.path??"",r={seq:a++,timestamp_ns:c.timestamp_ns??b(),wall_clock_ns:w(),path:d,type:e},f=(d?D(t,d):void 0)?.lastMutation;f!=null&&(r.actor=f.actor),e==="data"&&(r.value=c.data),e==="error"&&(r.error=c.data);let l=d?U(t,d):void 0;l!=null&&(r.annotation=l),!(u!=null&&!u(r))&&this._log.append(r)});this.addDisposer(()=>{m(),h.dispose()}),this.addDisposer(()=>this._log.disposeAllViews())}all(){return this.entries.cache??[]}byNode(t){return this.all().filter(n=>n.path===t)}byActor(t){return this.all().filter(n=>n.actor?.id===t)}byActorType(t){return this.all().filter(n=>n.actor?.type===t)}byTimeRange(t,n){return this.all().filter(o=>!(o.timestamp_ns<t||n!=null&&o.timestamp_ns>=n))}get target(){return this._target}};function z(i,t={}){return new k(i,t)}var G=class extends A{policies;violations;violationCount;_target;_mode;_currentGuard;constructor(t,n,o){super(o.name??`${t.name}_policy`,o.graph),this._target=t,this._mode=o.mode??"audit";let u=I(n)?n:N(n,{name:"policies"});this.policies=u,this.add(this.policies,{name:"policies"}),this.violations=new $("violations",{retainedLimit:o.violationsLimit??1e3}),this.mount("violations",this.violations),this.violationCount=E([this.violations.events],([e])=>e.length,{name:"violationCount",describeKind:"derived",meta:V("policy_violation_count")}),this.add(this.violationCount,{name:"violationCount"}),this.addDisposer(R(this.violationCount));let h=u.cache??[];this._currentGuard=P(h);let m=u.subscribe(e=>{for(let d of e)d[0]===v&&(h=d[1]??[],this._currentGuard=P(h))});this.addDisposer(m);let c=o.paths!=null?[...o.paths]:j(t);if(this._mode==="enforce"){let e=new Map,d=r=>{if(e.has(r))return;let s=D(t,r);if(!(s instanceof T))return;let f=(l,p)=>{let y=this._currentGuard(l,p);return y||this._publishViolation(l,p,r,"blocked"),y};e.set(r,s._pushGuard(f))};for(let r of c)d(r);if(o.paths==null){let r=C(t,(s,f,l)=>{if(s.kind==="added")if(s.nodeKind==="node")d(`${l}${s.name}`);else{let p=f._mounts.get(s.name);if(!(p instanceof A))return;let y=`${l}${s.name}::`,_=j(p);for(let g of _)d(g===""?`${l}${s.name}`:`${y}${g}`)}else if(s.kind==="removed")if(s.nodeKind==="node"){let p=`${l}${s.name}`,y=e.get(p);y!=null&&(y(),e.delete(p))}else{let p=`${l}${s.name}`,y=`${p}::`;for(let[_,g]of e)(_===p||_.startsWith(y))&&(g(),e.delete(_))}});this.addDisposer(r)}else{let r=t.topology.subscribe(s=>{for(let f of s){if(f[0]!==v)continue;let l=f[1];if(l.kind!=="removed"||l.nodeKind!=="node")continue;let p=e.get(l.name);p!=null&&(p(),e.delete(l.name))}});this.addDisposer(r)}this.addDisposer(()=>{for(let r of e.values())r();e.clear()})}else{let e=t.observe({timeline:!0,structured:!0}),d=e.onEvent(r=>{if(r.type!=="data"&&r.type!=="error")return;let s=r.path??"";if(!s||o.paths!=null&&!o.paths.includes(s))return;let f=r.actor??D(t,s)?.lastMutation?.actor;if(f==null)return;let l="write";this._currentGuard(f,l)||this._publishViolation(f,l,s,"observed")});this.addDisposer(()=>{d(),e.dispose()})}}_publishViolation(t,n,o,u){this.violations.publish({timestamp_ns:b(),wall_clock_ns:w(),path:o,actor:t,action:n,mode:this._mode,result:u})}all(){return this.violations.retained()}get mode(){return this._mode}get target(){return this._target}};function K(i,t,n={}){return new G(i,t,n)}function q(i,t,n,o){return i.explain(t,n,{reactive:!0,...o})}function F(i,t={}){let n={format_version:1,timestamp_ns:b(),wall_clock_ns:w(),graph:i.snapshot()};if(t.actor!=null&&(n.actor=t.actor),t.audit!=null){let u=[...t.audit.all()];n.audit={count:u.length,entries:u}}if(t.policies!=null){let u=t.policies.policies.cache??[];n.policies={mode:t.policies.mode,rules:u,violations:[...t.policies.all()]}}let o=B(n);return{...n,fingerprint:o}}function I(i){return typeof i=="object"&&i!==null&&"subscribe"in i}function D(i,t){try{return i.node(t)}catch{return}}function U(i,t){try{return i.annotation(t)}catch{return}}function j(i){let t=i.describe({detail:"minimal"});return Object.keys(t.nodes)}function B(i){return S(JSON.stringify(H(i)))}function H(i){let t=new Set,n=o=>{if(o===void 0)return{__undefined:!0};if(o===null)return null;let u=typeof o;if(u==="bigint")return{__bigint:o.toString()};if(u!=="object")return o;let a=o;if(t.has(a))return{__circular:!0};t.add(a);try{if(Array.isArray(a))return a.map(n);if(a instanceof Date)return{__date:a.toISOString()};if(a instanceof RegExp)return{__regexp:{source:a.source,flags:a.flags}};if(a instanceof Map)return{__map:[...a.entries()].map(([c,e])=>[n(c),n(e)])};if(a instanceof Set)return{__set:[...a].map(n)};if(ArrayBuffer.isView(a)){let m=a,c=new Array(m.length);for(let e=0;e<m.length;e++)c[e]=m[e]??0;return{__typed_array:{ctor:a.constructor.name,data:c}}}let h={};for(let m of Object.keys(a).sort())h[m]=n(a[m]);return h}finally{t.delete(a)}};return n(i)}export{k as a,z as b,G as c,K as d,q as e,F as f,J as g};
|
package/dist/chunk-533RQFF6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as l,v as o}from"./chunk-LYCLF26R.js";function h(t,e){if(e!=null&&e.length>0)return new Set(e);switch(t){case"standard":return new Set(["type","status","value","deps","meta","v"]);case"full":return null;default:return new Set(["type","deps"])}}function m(t){return t._describeKind!=null?t._describeKind:t._deps.length>0?"derived":t._fn!=null?"producer":"state"}function g(t){let e={};for(let[r,a]of Object.entries(t.meta))try{e[r]=a.cache}catch{}return e}function y(t,e){let r=e==null,a=!r&&e!=null?[...e].filter(n=>n.startsWith("meta.")).map(n=>n.slice(5)):null,d=r||e.has("meta")||a!=null&&a.length>0,c="state",p=[];t instanceof l&&(c=m(t),p=t._deps.map(n=>n.node.name??""));let s={type:c,deps:p};(r||e.has("status"))&&(s.status=t.status);let i=t instanceof l?t._guard:void 0;if(d){let n={...g(t)};if(i!=null&&n.access===void 0&&(n.access=o(i)),a!=null&&a.length>0&&!e.has("meta")){let f={};for(let u of a)u in n&&(f[u]=n[u]);s.meta=f}else s.meta=n}if(t.name!=null&&(s.name=t.name),r||e.has("value")){t.status==="sentinel"&&(s.sentinel=!0);try{s.value=t.cache}catch{}}if((r||e.has("v"))&&t.v!=null){let n={id:t.v.id,version:t.v.version};"cid"in t.v&&(n.cid=t.v.cid,n.prev=t.v.prev),s.v=n}return(r||e.has("guard"))&&i!=null&&(s.guard=o(i)),(r||e.has("lastMutation"))&&t.lastMutation!=null&&(s.lastMutation=t.lastMutation),s}export{h as a,y as b};
|
package/dist/chunk-6SVKZ7VI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as A,x as v}from"./chunk-JJTF75VS.js";import{b as I}from"./chunk-TZQPPQEQ.js";import{m as p,s as y}from"./chunk-MQZWA3DF.js";import{E as R,G as w,m as h}from"./chunk-LYCLF26R.js";import{b}from"./chunk-CK2E7BTU.js";function z(t){return typeof t=="object"&&t!==null&&"cache"in t&&typeof t.subscribe=="function"}function F(t,a,e){let r=p(t),i=r.v!=null,g=R(e?.initialVerified??null,{...i?{meta:{sourceVersion:null}}:{}}),x=e?.trigger!==void 0&&e.trigger!==null,s=null;if(x&&e?.autoVerify?s=A(p(e.trigger),r):x?s=p(e.trigger):e?.autoVerify&&(s=r),s!==null){let d;if(s===r)d=v(r,c=>a(c));else{let c=r.cache;r.subscribe(f=>{for(let M of f)M[0]===b&&(c=M[1])}),d=v(s,()=>a(c))}y(d,c=>{h(()=>{if(g.down([[b,c]]),i){let f=r.v;f!=null&&g.meta.sourceVersion.down([[b,{id:f.id,version:f.version}]])}})})}return{node:r,verified:g,trigger:s}}function E(t){t.subscribe(()=>{})}function k(t){return t instanceof Map?t:new Map}function B(t,a){if(!Array.isArray(a.upsert))throw new TypeError("distill extraction requires upsert: Array<{ key, value }>");h(()=>{for(let{key:e,value:r}of a.upsert)t.set(e,r);for(let e of a.remove??[])t.delete(e)})}function G(t,a,e){let r=p(t),i=I(e.mapOptions??{}),g=e.budget??2e3,s=e.context!==void 0&&e.context!==null?p(e.context):R(null),d=k(i.entries.cache);i.entries.subscribe(o=>{for(let u of o)u[0]===b&&(d=k(u[1]))});let c=v(r,o=>a(o,d));if(y(c,o=>{B(i,o)}),e.evict){let o=new Map,u=w([i.entries],([l])=>{let m=[],N=k(l);for(let n of o.keys())N.has(n)||(o.get(n)(),o.delete(n));for(let[n,T]of N){let V=e.evict(n,T);if(z(V)){if(!o.has(n)){let S=y(V,D=>{D===!0&&i.has(n)&&i.delete(n)});o.set(n,S)}continue}if(typeof V=="boolean"){V&&m.push(n);continue}throw new TypeError("distill evict() must return boolean or Node<boolean>")}return m});y(u,l=>{for(let m of l)i.delete(m)})}let f=e.consolidateTrigger!==void 0&&e.consolidateTrigger!==null;if(e.consolidate&&f){let o=p(e.consolidateTrigger),u=v(o,()=>e.consolidate(d));y(u,l=>{B(i,l)})}let M=w([i.entries,s],([o,u])=>{let l=[...k(o).entries()].map(([n,T])=>({key:n,value:T,score:e.score(T,u),cost:e.cost(T)}));l.sort((n,T)=>T.score-n.score);let m=[],N=g;for(let n of l)n.cost<=N&&(m.push({key:n.key,value:n.value,score:n.score}),N-=n.cost);return m}),O=w([i.entries],([o])=>k(o).size);return E(M),E(O),{store:i,compact:M,size:O}}export{F as a,G as b};
|
package/dist/chunk-A5HZZYRK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as E}from"./chunk-ESMPEKEV.js";import{a as g,b as B,i as L}from"./chunk-4VVTGLXJ.js";import{m as I}from"./chunk-MQZWA3DF.js";import{D as _,F as R,m as M,o as S}from"./chunk-LYCLF26R.js";import{b,c as k,d as y,h as C,i as h,j as T}from"./chunk-CK2E7BTU.js";function O(e){return{describeKind:"derived",...e}}function V(e){return e<0?0:e}function F(e){return e[1]}function W(e){if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("backoff strategy must return a finite number");return e<0?0:e}function te(e,i){return typeof e=="function"?j(e,i):U(e,i)}function U(e,i){let r=i?.count,n=i?.backoff,c=r!==void 0?r:n===void 0?0:2147483647;if(c<0)throw new RangeError("retry count must be >= 0");let u=n===void 0?null:typeof n=="string"?L(n):n;return R(t=>{let o=0,l=!1,s=null,f,a=new E;function w(){f?.(),f=void 0}function N(p){if(l)return;if(o>=c){w(),t.down([[T,p]]);return}let m=u===null?0:u(o,p,s);if(m==null){w(),t.down([[T,p]]);return}let d;try{d=W(m)}catch{w(),t.down([[T,p]]);return}s=d,o+=1,w();let x=d>0?d/1e6:1;a.start(x,()=>{l||v()})}function v(){a.cancel(),w(),f=e.subscribe(p=>{if(!l)for(let m of p){let d=m[0];if(d===k)t.down([[k]]);else if(d===b)o=0,s=null,t.emit(m[1]);else if(d===y)t.down([[y]]);else if(d===h)w(),t.down([[h]]);else if(d===T){N(F(m));return}else t.down([m])}})}return v(),()=>{l=!0,a.cancel(),w()}},{...O(),initial:e.cache})}function j(e,i){let r=i?.count,n=i?.backoff,c=r!==void 0?r:n===void 0?0:2147483647;if(c<0)throw new RangeError("retry count must be >= 0");let u=n===void 0?null:typeof n=="string"?L(n):n;return R(t=>{let o=0,l=!1,s=null,f,a=new E;function w(){f?.(),f=void 0}function N(p){if(l)return;if(o>=c){w(),t.down([[T,p]]);return}let m=u===null?0:u(o,p,s);if(m==null){w(),t.down([[T,p]]);return}let d;try{d=W(m)}catch{w(),t.down([[T,p]]);return}s=d,o+=1,w();let x=d>0?d/1e6:1;a.start(x,()=>{l||v()})}function v(){a.cancel(),w();let p;try{p=e()}catch(m){N(m);return}f=p.subscribe(m=>{if(!l)for(let d of m){let x=d[0];if(x===k)t.down([[k]]);else if(x===b)o=0,s=null,t.emit(d[1]);else if(x===y)t.down([[y]]);else if(x===h)w(),t.down([[h]]);else if(x===T){N(F(d));return}else t.down([d])}})}return v(),()=>{l=!0,a.cancel(),w()}},{...O(),initial:i?.initial})}var P=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};function ne(e){let i=Math.max(1,e?.failureThreshold??5),r=V(e?.cooldownNs??30*1e9),n=e?.cooldown??null,c=Math.max(1,e?.halfOpenMax??1),u=e?.now??S,t="closed",o=0,l=0,s=0,f=r,a=0;function w(){if(!n)return r;let p=n(l);return p!==null?p:r}function N(){t="open",f=w(),s=u(),a=0}return{canExecute(){return t==="closed"?!0:t==="open"?u()-s>=f?(t="half-open",a=1,!0):!1:a<c?(a++,!0):!1},recordSuccess(){t==="half-open"?(t="closed",o=0,l=0):t==="closed"&&(o=0)},recordFailure(p){if(t==="half-open"){l++,N();return}t==="closed"&&(o++,o>=i&&N())},get state(){return t},get failureCount(){return o},reset(){t="closed",o=0,l=0,a=0}}}function re(e,i){let r=i?.onOpen??"skip";return n=>{let c=_([],(u,t)=>{function o(){c.meta.breakerState.down([[b,e.state]])}let l=n.subscribe(s=>{for(let f of s){let a=f[0];a===k?t.down([[k]]):a===b?e.canExecute()?(o(),t.emit(f[1])):(o(),r==="error"?t.down([[T,new P]]):t.down([[y]])):a===y?t.down([[y]]):a===h?(e.recordSuccess(),o(),t.down([[h]])):a===T?(e.recordFailure(F(f)),o(),t.down([f])):t.down([f])}});return o(),l},{...O(),meta:{breakerState:e.state},completeWhenDepsComplete:!1,initial:n.cache});return{node:c,breakerState:c.meta.breakerState}}}function K(e,i){if(e<=0)throw new RangeError("capacity must be > 0");if(i<0)throw new RangeError("refillPerSecond must be >= 0");let r=e,n=S();function c(u){if(i>0){let t=u-n;r=Math.min(e,r+t/1e9*i)}n=u}return{available(){return c(S()),r},tryConsume(u=1){if(u<=0)return!0;let t=S();return c(t),r>=u?(r-=u,!0):!1},putBack(u=1){u<=0||(c(S()),r=Math.min(e,r+u))}}}var A=class extends Error{name="RateLimiterOverflowError";constructor(i){super(`rateLimiter buffer overflow (maxBuffer=${i})`)}};function oe(e,i){let{maxEvents:r,windowNs:n}=i;if(r<=0)throw new RangeError("maxEvents must be > 0");if(n<=0)throw new RangeError("windowNs must be > 0");let c=i.maxBuffer;if(c!==void 0&&c<1)throw new RangeError("maxBuffer must be >= 1");let u=i.onOverflow??"drop-newest",t=r*1e9/n;return R(o=>{let l=K(r,t),s=[],f=new E,a=!1,w=1e9/t;function N(){for(;s.length>0;)if(l.tryConsume(1))o.emit(s.shift());else{f.start(Math.max(1,w/1e6),N);return}}let v=e.subscribe(p=>{for(let m of p){if(a)return;let d=m[0];if(d===k)o.down([[k]]);else if(d===b){if(c!==void 0&&s.length>=c){if(u!=="drop-newest")if(u==="drop-oldest")s.shift(),s.push(m[1]);else{a=!0,f.cancel(),s.length=0,o.down([[T,new A(c)]]);return}}else s.push(m[1]);N()}else if(d===y)o.down([[y]]);else if(d===h)a=!0,f.cancel(),s.length=0,o.down([[h]]);else if(d===T)a=!0,f.cancel(),s.length=0,o.down([m]);else if(d===C){a=!0,f.cancel(),s.length=0,o.down([m]);return}else o.down([m])}});return()=>{a=!0,f.cancel(),v()}},{...O(),initial:e.cache})}function ie(e,i){let r=i?.initialStatus??"pending",n=_([],(c,u)=>{let t=r;return n.meta.status.down([[b,r]]),n.meta.error.down([[b,null]]),e.subscribe(l=>{for(let s of l){let f=s[0];if(f===k)u.down([[k]]);else if(f===b)t==="errored"?M(()=>{n.meta.error.down([[b,null]]),n.meta.status.down([[b,"active"]])}):n.meta.status.down([[b,"active"]]),t="active",u.emit(s[1]);else if(f===y)u.down([[y]]);else if(f===h)n.meta.status.down([[b,"completed"]]),t="completed",u.down([[h]]);else if(f===T){let a=F(s);M(()=>{n.meta.error.down([[b,a]]),n.meta.status.down([[b,"errored"]])}),t="errored",u.down([s])}else u.down([s])}})},{...O(),meta:{status:r,error:null},completeWhenDepsComplete:!1,resubscribable:!0,initial:e.cache});return{node:n,status:n.meta.status,error:n.meta.error}}var D=class extends Error{name="TimeoutError";constructor(i){super(`Timed out after ${i/1e6}ms`)}};function $(e){return e!=null&&typeof e=="object"&&"cache"in e&&typeof e.subscribe=="function"}function Y(e){return e!=null&&typeof e.then=="function"}function q(e){return e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function"}function se(e,i){return R(r=>{let n,c;function u(){c?.(),c=void 0,$(i)||Y(i)||q(i)?n=I(i).subscribe(o=>{r.down(o)}):(r.emit(i),r.down([[h]]))}return c=e.subscribe(t=>{for(let o of t){let l=o[0];if(l===k)r.down([[k]]);else if(l===b)r.emit(o[1]);else if(l===y)r.down([[y]]);else if(l===h)r.down([[h]]);else if(l===T){u();return}else if(l===C){n?.(),r.down([o]);return}else r.down([o])}}),()=>{c?.(),n?.()}},{...O(),initial:e.cache})}function ue(e,i){if(i<=0)throw new RangeError("timeoutNs must be > 0");return R(r=>{let n=!1,c=new E;function u(){let o=i/1e6;c.start(o,()=>{n||(n=!0,t(),r.down([[T,new D(i)]]))})}let t=e.subscribe(o=>{for(let l of o){if(n)return;let s=l[0];if(s===k)r.down([[k]]);else if(s===b)u(),r.emit(l[1]);else if(s===y)r.down([[y]]);else if(s===h){c.cancel(),n=!0,r.down([[h]]);return}else if(s===T){c.cancel(),n=!0,r.down([l]);return}else if(s===C){c.cancel(),n=!0,r.down([l]);return}else r.down([l])}});return u(),()=>{n=!0,c.cancel(),t()}},{...O(),initial:e.cache})}export{te as a,P as b,ne as c,re as d,K as e,A as f,oe as g,ie as h,D as i,se as j,ue as k};
|
package/dist/chunk-B4L5X2QO.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as Se}from"./chunk-SGS4OJGS.js";import{a as Le}from"./chunk-ESMPEKEV.js";import{a as re,b as _e}from"./chunk-533RQFF6.js";import{C as Ee}from"./chunk-MQZWA3DF.js";import{A as we,C as L,E as ne,F as Me,G as Oe,e as $e,f as Ne,i as Z,k as Te,l as xe,m as Ae,o as K,p as Pe,s as W}from"./chunk-LYCLF26R.js";import{b as Y,c as me,d as be,e as te,f as ye,g as ve,h as z,i as X,j as Q}from"./chunk-CK2E7BTU.js";function Ie(e,t,r,n={}){let s=t in e.nodes,o=r in e.nodes;if(!s)return oe(t,r,"no-such-from");if(!o)return oe(t,r,"no-such-to");let i=n.maxDepth;if(i!=null&&(!Number.isInteger(i)||i<0))throw new Error("explainPath: maxDepth must be an integer >= 0");if(t===r){if(n.findCycle===!0){let u=ct(e,t,n);if(u!=null)return u}let l=se(t,e.nodes[t],0,n);return ie(t,r,[l])}if(i===0)return oe(t,r,"no-path");let a=je(e,t,r,i);return a.found?ie(t,r,Be(e,a.pathOrder,n)):oe(t,r,a.truncated?"max-depth-exceeded":"no-path")}function je(e,t,r,n){let s=new Map,o=[{path:r,depth:0}],i=new Set([r]),a=0,l=!1;for(;a<o.length;){let h=o[a++];if(h.path===t)break;if(n!=null&&h.depth>=n){let g=e.nodes[h.path];g?.deps&&g.deps.length>0&&(l=!0);continue}let p=e.nodes[h.path];if(p==null)continue;let f=p.deps??[],c=new Map;for(let g=0;g<f.length;g++){let O=f[g];if(!O)continue;let S=c.get(O);S==null&&(S=[],c.set(O,S)),S.push(g)}for(let[g,O]of c)i.has(g)||(i.add(g),s.set(g,{from:h.path,depIndices:O}),o.push({path:g,depth:h.depth+1}))}if(!s.has(t))return{found:!1,pathOrder:[],truncated:l};let u=[{path:t}],d=t;for(;d!==r;){let h=s.get(d);if(h==null)return{found:!1,pathOrder:[],truncated:!1};u[u.length-1].depIndices=h.depIndices,u.push({path:h.from}),d=h.from}return{found:!0,pathOrder:u,truncated:!1}}function ct(e,t,r){let n=e.nodes[t];if(n==null)return null;let s=n.deps??[],o=[];for(let a=0;a<s.length;a++)s[a]===t&&o.push(a);if(o.length>0){let a=se(t,n,0,r);a.dep_index=o[0];let l=se(t,n,1,r);return ie(t,t,[a,l])}let i=null;for(let a=0;a<s.length;a++){let l=s[a];if(!l||l===t)continue;let u=je(e,l,t,r.maxDepth);u.found&&(i==null||u.pathOrder.length<i.pathOrder.length)&&(i=u,i={found:!0,pathOrder:[{path:t,depIndices:[a]},...u.pathOrder],truncated:!1})}return i==null?null:ie(t,t,Be(e,i.pathOrder,r))}function Be(e,t,r){return t.map((n,s)=>{let o=e.nodes[n.path],i=se(n.path,o,s,r);return n.depIndices!=null&&n.depIndices.length>0&&(i.dep_index=n.depIndices[0],n.depIndices.length>1&&(i.dep_indices=[...n.depIndices])),i})}function se(e,t,r,n){let s={path:e,type:t.type,hop:r};t.status!==void 0&&(s.status=t.status),"value"in t&&(s.value=t.value),t.v!=null&&(s.v=t.v);let o=n.annotations?.get(e)??t.annotation;o!=null&&(s.annotation=o);let i=n.lastMutations?.get(e)??t.lastMutation;return i!=null&&(s.lastMutation=i),s}function ie(e,t,r){return Fe(e,t,!0,"ok",r)}function oe(e,t,r){return Fe(e,t,!1,r,[])}function Fe(e,t,r,n,s){let o=dt(e,t,r,n,s);return{from:e,to:t,found:r,reason:n,steps:s,text:o,toJSON(){return{from:e,to:t,found:r,reason:n,steps:s}}}}function dt(e,t,r,n,s){if(!r)switch(n){case"no-such-from":return`explainPath: no node named "${e}"`;case"no-such-to":return`explainPath: no node named "${t}"`;case"max-depth-exceeded":return`explainPath: no path from "${e}" to "${t}" within maxDepth`;default:return`explainPath: no path from "${e}" to "${t}"`}let o=[`Causal path: ${e} \u2192 ${t} (${s.length} step(s))`];for(let i of s){let l=` ${i.hop===0?"\xB7":"\u2193"} ${i.path} (${i.type}${i.status?`/${i.status}`:""})`;if(o.push(l),"value"in i&&o.push(` value: ${ft(i.value)}`),i.annotation!=null&&o.push(` annotation: ${i.annotation}`),i.lastMutation!=null){let u=i.lastMutation.actor;o.push(` actor: ${u.type}${u.id?`:${u.id}`:""}`)}}return o.join(`
|
|
2
|
-
`)}function ft(e){if(e===void 0)return"<sentinel>";if(e===null)return"null";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{let t=JSON.stringify(e);return t.length>80?`${t.slice(0,77)}...`:t}catch{return String(e)}}var A={object:56,array:64,string:40,number:8,boolean:4,null:0,undefined:0,symbol:40,bigint:16,function:120,map:72,set:72,mapEntry:40,setEntry:24,date:24,regexp:48,error:64,url:80,promise:48,weakmap:40,weakset:40},pt=Symbol.for("sizeof");function He(e){let t=new WeakSet,r=new WeakSet,n=[e],s=0;for(;n.length>0;){let o=n.pop();s+=ht(o,t,r,n)}return s}function ht(e,t,r,n){if(e==null)return 0;switch(typeof e){case"number":return A.number;case"boolean":return A.boolean;case"string":return A.string+e.length*2;case"bigint":return A.bigint+gt(e);case"symbol":return A.symbol;case"function":return t.has(e)?0:(t.add(e),A.function);case"undefined":return 0}let o=e;if(t.has(o))return 0;t.add(o);let i=o[pt];if(typeof i=="function")try{let u=i.call(o);if(typeof u=="number"&&Number.isFinite(u))return u}catch{}if(o instanceof Date)return A.date;if(o instanceof RegExp)return A.regexp+o.source.length*2;if(o instanceof Error){let u=o.message?o.message.length*2:0,d=o.stack?o.stack.length*2:0;return A.error+u+d}if(typeof URL<"u"&&o instanceof URL)return A.url+o.href.length*2;if(typeof Promise<"u"&&o instanceof Promise)return A.promise;if(o instanceof WeakMap)return A.weakmap;if(o instanceof WeakSet)return A.weakset;if(o instanceof Map){let u=A.map;for(let[d,h]of o)u+=A.mapEntry,n.push(d),n.push(h);return u}if(o instanceof Set){let u=A.set;for(let d of o)u+=A.setEntry,n.push(d);return u}if(Array.isArray(o)){let u=A.array+o.length*8;for(let d of o)n.push(d);return u}if(o instanceof ArrayBuffer)return r.has(o)?0:(r.add(o),o.byteLength);if(ArrayBuffer.isView(o)){let u=o;return r.has(u.buffer)?48:(r.add(u.buffer),u.buffer.byteLength+48)}let a=A.object,l=Object.keys(o);for(let u of l){a+=A.string+u.length*2;try{n.push(o[u])}catch{}}return a}function gt(e){let t=e<0n?-e:e;if(t===0n)return 0;let r=t.toString(2).length;return Math.ceil(r/32)*8}function Ve(e,t){let r=t?.topN??10,n=e.describe({detail:"standard"}),s=[],o=e._collectObserveTargets;typeof o=="function"&&o.call(e,"",s);let i=new Map;for(let[p,f]of s)i.set(p,f);let a=[];for(let[p,f]of Object.entries(n.nodes)){let c=i.get(p),g=c instanceof L?c:null,O=g?He(g.cache):0,S=g?g._sinkCount:0,b=f.deps?.length??0,m=f.type==="effect"&&S===0,y=S===0?f.type==="effect"?"orphan-effect":f.type==="derived"?"idle-derived":f.type==="producer"?"idle-producer":null:null;a.push({path:p,type:f.type,status:f.status??"unknown",valueSizeBytes:O,subscriberCount:S,depCount:b,isOrphanEffect:m,orphanKind:y})}let l=a.reduce((p,f)=>p+f.valueSizeBytes,0),u=(p,f)=>[...a].sort(f??((c,g)=>g[p]-c[p])).slice(0,r),d=a.filter(p=>p.orphanKind!=null),h=a.filter(p=>p.isOrphanEffect);return{nodeCount:a.length,edgeCount:n.edges.length,subgraphCount:n.subgraphs.length,nodes:a,totalValueSizeBytes:l,hotspots:{byValueSize:u("valueSizeBytes"),bySubscriberCount:u("subscriberCount"),byDepCount:u("depCount")},orphans:d,orphanEffects:h}}function Re(e){return e>=768&&e<=879||e>=1155&&e<=1161||e>=1425&&e<=1469||e>=1552&&e<=1562||e>=1611&&e<=1631||e>=1648&&e===1648||e>=1750&&e<=1756||e>=1759&&e<=1764||e>=1767&&e<=1768||e>=1770&&e<=1773||e>=1840&&e<=1866||e>=1958&&e<=1968||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2641||e>=2672&&e<=2673||e>=2677&&e===2677||e>=3633&&e===3633||e>=3636&&e<=3642||e>=3655&&e<=3662||e>=3761&&e===3761||e>=3764&&e<=3772||e>=3784&&e<=3790||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65024&&e<=65039||e>=65056&&e<=65071||e===8205?0:e>=4352&&e<=4447||e>=8986&&e<=8987||e>=9001&&e<=9002||e>=9193&&e<=9203||e>=9208&&e<=9210||e>=9725&&e<=9726||e>=9748&&e<=9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e>=9898&&e<=9899||e>=9917&&e<=9918||e>=9924&&e<=9925||e===9934||e===9940||e===9962||e>=9970&&e<=9971||e===9973||e===9978||e===9981||e===9986||e===9989||e>=9992&&e<=9997||e===9999||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e>=10548&&e<=10549||e>=11013&&e<=11015||e>=11035&&e<=11036||e===11088||e===11093||e>=11904&&e<=12350||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=40959||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510||e>=126980&&e===126980||e===127183||e>=127344&&e<=127345||e===127358||e===127359||e===127374||e>=127377&&e<=127386||e>=127456&&e<=127487||e>=127488&&e<=127490||e===127514||e===127535||e>=127538&&e<=127546||e>=127568&&e<=127569||e>=127744&&e<=129535||e>=129536&&e<=129791||e>=129792&&e<=130047||e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}function ae(e){let t=0;for(let r of e)t+=Re(r.codePointAt(0));return t}function ze(e,t){if(t<=0)return"";let r=0,n="";for(let s of e){let o=Re(s.codePointAt(0));if(r+o>t){if(t<=1)return"\u2026";for(;r+1>t&&n.length>0;){let i=[...n].pop();n=n.slice(0,-i.length),r-=Re(i.codePointAt(0))}return`${n}\u2026`}n+=s,r+=o}return n}var mt={horizontal:"\u2500",vertical:"\u2502",cornerTL:"\u250C",cornerTR:"\u2510",cornerBL:"\u2514",cornerBR:"\u2518",tDown:"\u252C",tUp:"\u2534",tRight:"\u251C",tLeft:"\u2524",cross:"\u253C",arrowRight:"\u25B6",arrowDown:"\u25BC",arrowLeft:"\u25C0",arrowUp:"\u25B2",boxTL:"\u250C",boxTR:"\u2510",boxBL:"\u2514",boxBR:"\u2518",boxH:"\u2500",boxV:"\u2502"},bt={horizontal:"-",vertical:"|",cornerTL:"+",cornerTR:"+",cornerBL:"+",cornerBR:"+",tDown:"+",tUp:"+",tRight:"+",tLeft:"+",cross:"+",arrowRight:">",arrowDown:"v",arrowLeft:"<",arrowUp:"^",boxTL:"+",boxTR:"+",boxBL:"+",boxBR:"+",boxH:"-",boxV:"|"};function Ue(e,t){let r=t.charset==="ascii"?bt:mt,n=e.width,s=e.height,o=Array.from({length:s},()=>Array.from({length:n},()=>" ")),i=Array.from({length:s},()=>Array.from({length:n},()=>"empty"));for(let a of e.edges)vt(o,i,r,a);for(let a of e.boxes)yt(o,i,r,a,t.labelOf(a.id));return o.map(a=>Et(a.join(""))).join(`
|
|
3
|
-
`)}function yt(e,t,r,n,s){let{x:o,y:i,w:a,h:l}=n;if(a<2||l<2){l>0&&Ke(e,t,o,i,a,s);return}V(e,t,o,i,r.boxTL);for(let d=o+1;d<o+a-1;d+=1)V(e,t,d,i,r.boxH);V(e,t,o+a-1,i,r.boxTR);for(let d=i+1;d<i+l-1;d+=1){V(e,t,o,d,r.boxV);for(let h=o+1;h<o+a-1;h+=1)Je(e,t,h,d," ","empty");V(e,t,o+a-1,d,r.boxV)}V(e,t,o,i+l-1,r.boxBL);for(let d=o+1;d<o+a-1;d+=1)V(e,t,d,i+l-1,r.boxH);V(e,t,o+a-1,i+l-1,r.boxBR);let u=i+Math.floor(l/2);Ke(e,t,o+1,u,a-2,s)}function V(e,t,r,n,s){Je(e,t,r,n,s,s===" "?"empty":s==="\u2500"||s==="-"?"boxH":s==="\u2502"||s==="|"?"boxV":"boxCorner")}function Je(e,t,r,n,s,o){if(n<0||n>=e.length)return;let i=e[n];r<0||r>=i.length||(i[r]=s,t[n][r]=o)}function Ke(e,t,r,n,s,o){if(n<0||n>=e.length)return;let i=r,a=s;for(let l of o){let u=ae(l);if(u!==0){if(a<u)break;i>=0&&i<e[n].length&&(e[n][i]=l,t[n][i]="label",u===2&&i+1<e[n].length&&(e[n][i+1]="",t[n][i+1]="label")),i+=u,a-=u}}for(;a>0;)i>=0&&i<e[n].length&&(e[n][i]=" ",t[n][i]="empty"),i+=1,a-=1}function vt(e,t,r,n){let s=n.points;if(s.length<2)return;for(let l=0;l+1<s.length;l+=1)xt(e,t,r,s[l],s[l+1]);for(let l=1;l+1<s.length;l+=1){let u=s[l-1],d=s[l],h=s[l+1],p=wt(u,d,h,r);p&&qe(e,t,d.x,d.y,p,"edgeCorner")}let o=s[s.length-1],i=s[s.length-2],a=Ot(i,o,r);a&&qe(e,t,o.x,o.y,a,"arrow")}function xt(e,t,r,n,s){if(!(n.x===s.x&&n.y===s.y)){if(n.y===s.y){let o=n.y,i=Math.min(n.x,s.x),a=Math.max(n.x,s.x);for(let l=i;l<=a;l+=1)We(e,t,l,o,r,"h")}else if(n.x===s.x){let o=n.x,i=Math.min(n.y,s.y),a=Math.max(n.y,s.y);for(let l=i;l<=a;l+=1)We(e,t,o,l,r,"v")}}}function We(e,t,r,n,s,o){if(n<0||n>=e.length)return;let i=e[n];if(r<0||r>=i.length)return;let a=t[n][r];if(!(a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label")){if(a==="empty"){i[r]=o==="h"?s.horizontal:s.vertical,t[n][r]=o==="h"?"edgeH":"edgeV";return}if(a==="edgeH"&&o==="v"){i[r]=s.cross,t[n][r]="edgeCorner";return}if(a==="edgeV"&&o==="h"){i[r]=s.cross,t[n][r]="edgeCorner";return}}}function qe(e,t,r,n,s,o){if(n<0||n>=e.length)return;let i=e[n];if(r<0||r>=i.length)return;let a=t[n][r];a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label"||(i[r]=s,t[n][r]=o)}function wt(e,t,r,n){let s=e.y===t.y,o=t.y===r.y;if(s===o)return;if(s){let l=e.x<t.x,u=r.y>t.y;return l&&u?n.cornerTR:l&&!u?n.cornerBR:!l&&u?n.cornerTL:n.cornerBL}let i=e.y<t.y,a=r.x>t.x;return i&&a?n.cornerBL:i&&!a?n.cornerBR:!i&&a?n.cornerTL:n.cornerTR}function Ot(e,t,r){if(t.x>e.x)return r.arrowRight;if(t.x<e.x)return r.arrowLeft;if(t.y>e.y)return r.arrowDown;if(t.y<e.y)return r.arrowUp}function Et(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===32;)t-=1;return e.slice(0,t)}function Qe(e){let t=_t(e);St(t),Rt(t),Gt(t),Dt(t,e);let r=$t(t,e),{width:n,height:s}=Tt(t),o=[];for(let i of t.layers)for(let a of i)a.isVirtual||o.push({id:a.id,layer:a.layer,order:a.order,x:a.x,y:a.y,w:a.w,h:a.h});return{boxes:o,edges:r,width:n,height:s}}function _t(e){let t=new Map;for(let s of e.nodes)t.set(s,{id:s,isVirtual:!1,layer:-1,order:0,x:0,y:0,w:e.widthCells(s),h:e.heightCells(s),in:[],out:[]});let r=[],n=0;for(let s of e.edges){if(s.from===s.to)continue;let o=t.get(s.from),i=t.get(s.to);if(!o||!i)continue;let a={chainId:n++,chainFrom:s.from,chainTo:s.to,fromId:s.from,toId:s.to,hopIndex:0,chainLen:1};o.out.push(a),i.in.push(a),r.push(a)}return{nodes:t,layers:[],hops:r}}function St(e){let t=new Map;for(let o of e.nodes.values())t.set(o.id,o.in.length);let r=[];for(let o of e.nodes.values())(t.get(o.id)??0)===0&&(o.layer=0,r.push(o));let n=new Set,s=0;for(;s<r.length;){let o=r[s++];if(!n.has(o.id)){n.add(o.id);for(let i of o.out){let a=e.nodes.get(i.toId);a.layer=Math.max(a.layer,o.layer+1);let l=(t.get(a.id)??0)-1;t.set(a.id,l),l<=0&&r.push(a)}}}for(let o of e.nodes.values())o.layer<0&&(o.layer=0)}function Rt(e){let t=Math.max(0,...Array.from(e.nodes.values(),o=>o.layer)),r=Array.from({length:t+1},()=>[]);for(let o of e.nodes.values())r[o.layer].push(o);let n=[],s=0;for(let o of e.hops){let i=e.nodes.get(o.fromId),a=e.nodes.get(o.toId),l=a.layer-i.layer;if(l<=0){i.out=i.out.filter(h=>h!==o),a.in=a.in.filter(h=>h!==o);continue}if(l===1){o.hopIndex=0,o.chainLen=1,n.push(o);continue}i.out=i.out.filter(h=>h!==o),a.in=a.in.filter(h=>h!==o);let u=i;for(let h=1;h<l;h+=1){let p=`__virt_${s++}__`,f={id:p,isVirtual:!0,layer:i.layer+h,order:0,x:0,y:0,w:0,h:1,in:[],out:[]};e.nodes.set(p,f),r[f.layer].push(f);let c={chainId:o.chainId,chainFrom:o.chainFrom,chainTo:o.chainTo,fromId:u.id,toId:p,hopIndex:h-1,chainLen:l};u.out.push(c),f.in.push(c),n.push(c),u=f}let d={chainId:o.chainId,chainFrom:o.chainFrom,chainTo:o.chainTo,fromId:u.id,toId:a.id,hopIndex:l-1,chainLen:l};u.out.push(d),a.in.push(d),n.push(d)}for(let o of r)for(let i=0;i<o.length;i+=1)o[i].order=i;e.layers=r,e.hops=n}function Gt(e){for(let r=0;r<4;r+=1){for(let n=1;n<e.layers.length;n+=1)Ye(e,e.layers[n],"in"),ue(e.layers[n]);for(let n=e.layers.length-2;n>=0;n-=1)Ye(e,e.layers[n],"out"),ue(e.layers[n])}for(let r=0;r<2;r+=1){let n=!1;for(let s=1;s<e.layers.length;s+=1){let o=e.layers[s];for(let i=0;i+1<o.length;i+=1){let a=Xe(e,o[i],o[i+1],"in");[o[i],o[i+1]]=[o[i+1],o[i]],ue(o),Xe(e,o[i],o[i+1],"in")<a?n=!0:([o[i],o[i+1]]=[o[i+1],o[i]],ue(o))}}if(!n)break}}function Ye(e,t,r){let n=new Map;for(let s of t){let o=r==="in"?s.in:s.out;if(o.length===0){n.set(s.id,s.order);continue}let i=0,a=0;for(let l of o){let u=e.nodes.get(r==="in"?l.fromId:l.toId);u&&(i+=u.order,a+=1)}n.set(s.id,a===0?s.order:i/a)}t.sort((s,o)=>{let i=n.get(s.id),a=n.get(o.id);return i!==a?i-a:s.order-o.order})}function ue(e){for(let t=0;t<e.length;t+=1)e[t].order=t}function Xe(e,t,r,n){let s=n==="in"?t.in:t.out,o=n==="in"?r.in:r.out,i=0;for(let a of s)for(let l of o){let u=e.nodes.get(n==="in"?a.fromId:a.toId)?.order??0,d=e.nodes.get(n==="in"?l.fromId:l.toId)?.order??0;(t.order<r.order&&u>d||t.order>r.order&&u<d)&&(i+=1)}return i}function Dt(e,t){t.direction==="LR"?Ct(e,t):kt(e,t)}function Ct(e,t){let r=[],n=0;for(let s=0;s<e.layers.length;s+=1){r.push(n);let o=0;for(let i of e.layers[s])o=Math.max(o,i.w);n+=o+t.layerGap}for(let s=0;s<e.layers.length;s+=1)for(let o of e.layers[s])o.x=r[s];for(let s of e.layers){let o=0;for(let i of s)i.y=o,o+=i.h+t.nodeGap}Ze(e,t,"y")}function kt(e,t){let r=[],n=0;for(let s=0;s<e.layers.length;s+=1){r.push(n);let o=0;for(let i of e.layers[s])o=Math.max(o,i.h);n+=o+t.layerGap}for(let s=0;s<e.layers.length;s+=1)for(let o of e.layers[s])o.y=r[s];for(let s of e.layers){let o=0;for(let i of s)i.x=o,o+=i.w+t.nodeGap}Ze(e,t,"x")}function Ze(e,t,r){let n=o=>r==="y"?o.h:o.w,s=t.nodeGap;for(let o=0;o<2;o+=1){let i=o===0?e.layers.slice(1):e.layers.slice(0,-1).reverse();for(let a of i){let l=new Map;for(let d of a){let h=o===0?d.in:d.out;if(h.length===0)continue;let p=[];for(let c of h){let g=e.nodes.get(o===0?c.fromId:c.toId);if(!g)continue;let O=r==="y"?g.y:g.x;p.push(O+Math.floor(n(g)/2))}if(p.length===0)continue;p.sort((c,g)=>c-g);let f=p[Math.floor(p.length/2)];l.set(d.id,f-Math.floor(n(d)/2))}let u=0;for(let d of a){let h=l.get(d.id),p=r==="y"?d.y:d.x,c=Math.max(h??p,u);r==="y"?d.y=c:d.x=c,u=c+n(d)+s}}}}function $t(e,t){let r=new Map;for(let u of e.hops){let d=r.get(u.chainId);d?d.push(u):r.set(u.chainId,[u])}for(let u of r.values())u.sort((d,h)=>d.hopIndex-h.hopIndex);let n=t.direction==="LR",s=u=>n?u.x:u.y,o=u=>n?u.w:u.h,i=u=>n?u.y+Math.floor(u.h/2):u.x+Math.floor(u.w/2),a=new Map;for(let u=0;u+1<e.layers.length;u+=1){let d=e.layers[u],h=e.layers[u+1],p=0;for(let _ of d)p=Math.max(p,s(_)+o(_));let f=Number.POSITIVE_INFINITY;for(let _ of h)f=Math.min(f,s(_));let c=Number.isFinite(f)?f-1:p,g=Math.max(1,c-p+1),O=[];for(let _ of d)for(let R of _.out)O.push(R);O.sort((_,R)=>{let k=i(e.nodes.get(_.fromId)),$=i(e.nodes.get(R.fromId));if(k!==$)return k-$;let D=i(e.nodes.get(_.toId)),G=i(e.nodes.get(R.toId));return D-G});let S=[],b=new Map;for(let _ of O){let R=i(e.nodes.get(_.fromId)),k=i(e.nodes.get(_.toId)),$=Math.min(R,k),D=Math.max(R,k),G=-1;for(let P=0;P<S.length;P+=1){let F=S[P],H=!0;for(let U of F)if(U.lo<=D&&$<=U.hi){H=!1;break}if(H){F.push({lo:$,hi:D}),G=P;break}}G<0&&(S.push([{lo:$,hi:D}]),G=S.length-1),b.set(_,G)}let m=S.length,y=g>=Math.max(3,m+2),x=y?p+1:p,v=y?c-1:c,w=Math.max(1,v-x+1);for(let _ of O){let R=b.get(_),k;if(m<=1)k=x+Math.floor(w/2);else{let $=(w-1)/(m-1);k=x+Math.floor(R*$)}a.set(_,Math.max(p,Math.min(c,k)))}}let l=[];for(let[,u]of r){let d=[];for(let p=0;p<u.length;p+=1){let f=u[p],c=e.nodes.get(f.fromId),g=e.nodes.get(f.toId),O=a.get(f),S=c.isVirtual?s(c):s(c)+o(c),b=g.isVirtual?s(g):s(g)-1,m=i(c),y=i(g);p===0&&le(d,n,S,m),m!==y&&(le(d,n,O,m),le(d,n,O,y)),le(d,n,b,y)}let h=u[0];l.push({from:h.chainFrom,to:h.chainTo,points:Nt(d)})}return l}function le(e,t,r,n){e.push(t?{x:r,y:n}:{x:n,y:r})}function Nt(e){let t=[];for(let r of e){let n=t[t.length-1];(!n||n.x!==r.x||n.y!==r.y)&&t.push(r)}return t}function Tt(e){let t=0,r=0;for(let n of e.layers)for(let s of n)t=Math.max(t,s.x+s.w),r=Math.max(r,s.y+s.h);return{width:t,height:r}}var At=24,Pt=4,Mt=1,Lt=3;function et(e,t){let r=It(t.direction),n=Math.max(3,t.maxLabelWidth??At),s=t.asciiCharset??"unicode",o=Object.keys(e.nodes).sort(),i=new Set(o),a=e.edges.filter(f=>i.has(f.from)&&i.has(f.to)),l=new Map,u=new Map;for(let f of o){let c=ze(f,n);l.set(f,c),u.set(f,ae(c)+4)}let d=Qe({nodes:o,edges:a,widthCells:f=>u.get(f)??3,heightCells:()=>Lt,layerGap:Pt,nodeGap:Mt,direction:r}),h=Ue(d,{charset:s,labelOf:f=>l.get(f)??f}),p=t.logger;return p&&p(h),h}function It(e){if(e===void 0||e==="LR")return"LR";if(e==="TD")return"TD";throw new Error(`ascii describe supports direction "LR" or "TD" only; got ${String(e)}`)}var T="::",B="__meta__",q=1;function tt(e,t){let r=Math.max(16,e.size*4),n=0;for(;e.size>0;){if(n++>=r){console.error(`[Graph "${t}".destroy] disposer drain exceeded cap (${r}); ${e.size} disposer(s) discarded`),e.clear();return}let s=e.values().next();if(s.done)return;let o=s.value;e.delete(o);try{o()}catch(i){console.error(`[Graph "${t}".destroy] disposer threw:`,i)}}}function st(e){return e!=null&&typeof e=="object"&&"cache"in e&&typeof e.subscribe=="function"&&typeof e.down=="function"}function jt(e){if(e!=null)return st(e)?e.cache:e}function Bt(e){let t=[];for(let r of Object.keys(e).sort()){let n=e[r].v;n!=null&&t.push(`${r} ${n.id} ${n.version}`)}return t.join(`
|
|
4
|
-
`)}function nt(e){if(e.version!==q)throw new Error(`unsupported snapshot version ${String(e.version)} (expected ${q})`);for(let t of["name","nodes","edges","subgraphs"])if(!(t in e))throw new Error(`snapshot missing required key "${t}"`);if(typeof e.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof e.nodes!="object"||e.nodes===null||Array.isArray(e.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(e.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(e.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function Ft(e,t){let r=new WeakMap,n=(s,o)=>{if(Object.is(s,o))return!0;if(s==null||o==null||typeof s!="object"||typeof o!="object")return!1;let i=r.get(s);if(i==null&&(i=new WeakSet,r.set(s,i)),i.has(o))return!0;i.add(o);let a=s.constructor,l=o.constructor;if(a!==l)return!1;if(s instanceof Date)return s.getTime()===o.getTime();if(s instanceof RegExp)return s.source===o.source&&s.flags===o.flags;if(Array.isArray(s)){let p=o;if(s.length!==p.length)return!1;for(let f=0;f<s.length;f++)if(!n(s[f],p[f]))return!1;return!0}if(s instanceof Map){let p=o;if(s.size!==p.size)return!1;for(let[f,c]of s)if(!p.has(f)||!n(c,p.get(f)))return!1;return!0}if(s instanceof Set){let p=o;if(s.size!==p.size)return!1;for(let f of s){let c=!1;for(let g of p)if(n(f,g)){c=!0;break}if(!c)return!1}return!0}if(ArrayBuffer.isView(s)){let p=s,f=o;if(p.length!==f.length)return!1;for(let c=0;c<p.length;c++)if(p[c]!==f[c])return!1;return!0}let u=Object.keys(s),d=Object.keys(o);if(u.length!==d.length)return!1;let h=new Set(d);for(let p of u)if(!h.has(p)||!n(s[p],o[p]))return!1;return!0};return n(e,t)}function De(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(De);let t=e,r=Object.keys(t).sort(),n={};for(let s of r)n[s]=De(t[s]);return n}function Ht(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Vt(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"')}function zt(e){return e==="TD"?"down":e==="BT"?"up":e==="RL"?"left":"right"}function it(e){let t=new Set,r=[];function n(s,o){let i=`${s}\0${o}`;t.has(i)||(t.add(i),r.push([s,o]))}for(let[s,o]of Object.entries(e.nodes)){let i=o.deps;if(i)for(let a of i)n(a,s)}for(let s of e.edges)n(s.from,s.to);return r}function at(e){if(e===void 0)return"LR";if(e==="TD"||e==="LR"||e==="BT"||e==="RL")return e;throw new Error(`invalid diagram direction ${String(e)}; expected one of: TD, LR, BT, RL`)}function Kt(e,t){let r=t.includeEdges??!0,n=t.includeSubgraphs??!0,{expand:s,...o}=e,i={...o,edges:r?e.edges:[],subgraphs:n?e.subgraphs:[]},a=JSON.stringify(De(i),null,t.indent??2);return t.logger?.(a),a}function Wt(e,t){let r=t.includeEdges??!0,n=t.includeSubgraphs??!0,s=[];s.push(`Graph ${e.name}`),s.push("Nodes:");for(let i of Object.keys(e.nodes).sort()){let a=e.nodes[i];s.push(`- ${i} (${a.type}/${a.status}): ${de(a.value)}`)}if(r){s.push("Edges:");for(let i of e.edges)s.push(`- ${i.from} -> ${i.to}`)}if(n){s.push("Subgraphs:");for(let i of e.subgraphs)s.push(`- ${i}`)}let o=s.join(`
|
|
5
|
-
`);return t.logger?.(o),o}function ut(e,t){let r=at(t.direction),n=Object.keys(e.nodes).sort(),s=new Map;for(let i=0;i<n.length;i+=1)s.set(n[i],`n${i}`);let o=[`flowchart ${r}`];for(let i of n){let a=s.get(i);o.push(` ${a}["${Ht(i)}"]`)}for(let[i,a]of it(e)){let l=s.get(i),u=s.get(a);!l||!u||o.push(` ${l} --> ${u}`)}return o.join(`
|
|
6
|
-
`)}function qt(e,t){let r=ut(e,t);return Ut(r)}function Ut(e,t){let r=t?.theme??"default",n=t?.autoSync??!0,o=JSON.stringify({code:e,mermaid:{theme:r},autoSync:n}),i=new TextEncoder().encode(o),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 Jt(e,t){let r=at(t.direction),n=Object.keys(e.nodes).sort(),s=new Map;for(let i=0;i<n.length;i+=1)s.set(n[i],`n${i}`);let o=[`direction: ${zt(r)}`];for(let i of n){let a=s.get(i);o.push(`${a}: "${Vt(i)}"`)}for(let[i,a]of it(e)){let l=s.get(i),u=s.get(a);!l||!u||o.push(`${l} -> ${u}`)}return o.join(`
|
|
7
|
-
`)}function Yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ce(e){let t="^";for(let r=0;r<e.length;r+=1){let n=e[r];if(n==="*"){t+=".*";continue}if(n==="?"){t+=".";continue}if(n==="["){let s=e.indexOf("]",r+1);if(s<=r+1){t+="\\[";continue}let o=e.slice(r+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),t+=`[${o}]`,r=s;continue}t+=Yt(n)}return t+="$",new RegExp(t)}var Xt={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"},Qt={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function de(e){if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean"||e==null)return String(e);try{return JSON.stringify(e)}catch{return"[unserializable]"}}function Zt(e){return e==="none"?Qt:e==="ansi"||e==null?Xt:{data:e.data??"",dirty:e.dirty??"",resolved:e.resolved??"",invalidate:e.invalidate??"",pause:e.pause??"",resume:e.resume??"",complete:e.complete??"",error:e.error??"",teardown:e.teardown??"",derived:e.derived??"",path:e.path??"",reset:e.reset??""}}function rt(e){if(e==null)return{};let t=e.detail;return t==="full"?{...e,structured:e.structured??!0,timeline:e.timeline??!0,causal:e.causal??!0,derived:e.derived??!0}:t==="minimal"?{...e,structured:e.structured??!0}:e.format==="stage-log"?{...e,structured:e.structured??!0,timeline:e.timeline??!0}:e}function en(e,t,r){for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);if(s<32||s===127)throw new Error(`Graph "${t}": ${r} "${e}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${n})`)}}function Ge(e,t,r){if(e==="")throw new Error(`Graph "${t}": ${r} name must be non-empty`);if(e.includes(T))throw new Error(`Graph "${t}": ${r} "${e}" must not contain '${T}' (path separator)`);if(e===B)throw new Error(`Graph "${t}": ${r} name "${B}" is reserved for meta companion paths`);en(e,t,r)}function tn(e,t){if(e==="")throw new Error(`Graph "${t}": resolve path must be non-empty`);let r=e.split(T);for(let n of r)if(n==="")throw new Error(`Graph "${t}": resolve path has empty segment`);return r}function nn(e,t){let r=!1;for(let s of e)if(!t.isMetaPassthrough(s[0])){r=!0;break}return r?e.filter(s=>t.isMetaPassthrough(s[0])):e}function lt(e){for(let t of e._mounts.values())lt(t);for(let t of e._nodes.values())try{t.down([[z]],{internal:!0})}catch{}}var Ce=class e{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(t,r){if(t==="")throw new Error("Graph name must be non-empty");if(t.includes(T))throw new Error(`Graph name must not contain '${T}' (got "${t}")`);if(t===B)throw new Error(`Graph name "${B}" is reserved for meta companion paths`);this.name=t,this.opts=Object.freeze({...r??{}}),this.config=r?.config??we,this._traceRing=new Se(r?.traceCapacity??1e3),r?.versioning!=null&&this.setVersioning(r.versioning)}ancestors(t=!0){let r=[],n=t?this:this._parent;for(;n!=null;)r.push(n),n=n._parent;return r}get topology(){return this._topology==null&&(this._topology=Me(t=>{let r=n=>{t.emit(n)};return this._topologyEmitters.add(r),()=>{this._topologyEmitters.delete(r)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(t){if(!(this._topology==null||this._topologyEmitters.size===0))for(let r of this._topologyEmitters)r(t)}nameOf(t){return this._nodeToName.get(t)}add(t,r){let n=t.name,s=r?.name??n;if(s==null||s==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let o=s,i=r?.annotation;if(Ge(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" already exists`);let a=this._nodeToName.get(t);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(o,t),this._nodeToName.set(t,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:K()})),t}setVersioning(t){if(t!=null)for(let r of this._nodes.values())r instanceof L&&r._applyVersioning(t)}remove(t){Ge(t,this.name,"remove");let r=this._mounts.get(t);if(r){let o={kind:"mount",nodes:[],mounts:[]},i=[];r._collectObserveTargets("",i);for(let[a,l]of i)a.includes(`${T}${B}${T}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(t),o.mounts.push(...r._collectSubgraphs(`${t}${T}`)),this._mounts.delete(t),r._parent=void 0,lt(r),this._emitTopology({kind:"removed",name:t,nodeKind:"mount",audit:o}),o}let n=this._nodes.get(t);if(!n)throw new Error(`Graph "${this.name}": unknown node or mount "${t}"`);this._nodes.delete(t),this._nodeToName.delete(n),n.down([[z]],{internal:!0});let s={kind:"node",nodes:[t],mounts:[]};return this._emitTopology({kind:"removed",name:t,nodeKind:"node",audit:s}),s}removeAll(t){let r=typeof t=="function"?t:(()=>{let o=ce(t);return i=>o.test(i)})(),n={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>r(o));for(let o of s){let i=this.remove(o);n.nodes.push(...i.nodes),n.mounts.push(...i.mounts)}return n.nodes.sort(),n.mounts.sort(),n}[Symbol.iterator](){let t=[...this._nodes.keys()].sort(),r=this._nodes,n=0;return{[Symbol.iterator](){return this},next(){if(n>=t.length)return{value:void 0,done:!0};let s=t[n++];return{value:[s,r.get(s)],done:!1}}}}node(t){if(t==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(t.includes(T))return this.resolve(t);let r=this._nodes.get(t);if(!r)throw new Error(`Graph "${this.name}": unknown node "${t}"`);return r}get(t){return this.node(t).cache}set(t,r,n){let s=n?.internal===!0;this.node(t).down([[Y,r]],{actor:n?.actor,internal:s,delivery:"write"})}setAll(t,r){let n=Symbol.iterator in t?t:Object.entries(t);Ae(()=>{for(let[s,o]of n)this.set(s,o,r)})}invalidate(t,r){let n=r?.internal===!0;this.node(t).down([[te]],{actor:r?.actor,internal:n,delivery:"write"})}error(t,r,n){let s=n?.internal===!0;this.node(t).down([[Q,r]],{actor:n?.actor,internal:s,delivery:"write"})}complete(t,r){let n=r?.internal===!0;this.node(t).down([[X]],{actor:r?.actor,internal:n,delivery:"write"})}edges(t){let r=t?.recursive===!0,n=new Map;if(!r){for(let[l,u]of this._nodes)n.set(u,l);let a=[];for(let[l,u]of this._nodes)if(u instanceof L)for(let d of u._deps){let h=n.get(d.node);h!=null&&a.push([h,l])}return a.sort((l,u)=>l[0]<u[0]?-1:l[0]>u[0]?1:l[1]<u[1]?-1:l[1]>u[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,l]of s)o.set(l,a);let i=[];for(let[a,l]of s)if(l instanceof L)for(let u of l._deps){let d=o.get(u.node);d!=null&&i.push([d,a])}return i.sort((a,l)=>a[0]<l[0]?-1:a[0]>l[0]?1:a[1]<l[1]?-1:a[1]>l[1]?1:0),i}mount(t,r){if(r===void 0){let s=new e(t);return this.mount(t,s)}if(typeof r=="function"){let s=new e(t);return r(s),this.mount(t,s)}let n=r;if(Ge(t,this.name,"mount"),this._nodes.has(t))throw new Error(`Graph "${this.name}": cannot mount at "${t}" \u2014 node with that name exists`);if(this._mounts.has(t))throw new Error(`Graph "${this.name}": mount "${t}" 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 s=this;s!=null;s=s._parent)if(s===n)throw new Error(`Graph "${this.name}": mount("${t}", \u2026) would create a mount cycle`);return this._mounts.set(t,n),n._parent=this,this._emitTopology({kind:"added",name:t,nodeKind:"mount"}),n}resolve(t){let r=tn(t,this.name);return this._resolveFromSegments(r)}tryResolve(t){try{return this.resolve(t)}catch{return}}_resolveFromSegments(t){let r=t;if(r[0]===this.name&&(r=r.slice(1),r.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let n=r[0],s=r.slice(1);if(s.length===0){let a=this._nodes.get(n);if(a)return a;throw this._mounts.has(n)?new Error(`Graph "${this.name}": path ends at subgraph "${n}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${n}"`)}let o=this._nodes.get(n);if(o&&s.length>0&&s[0]===B)return this._resolveMetaChainFromNode(o,s,r.join(T));let i=this._mounts.get(n);if(!i)throw this._nodes.has(n)?new Error(`Graph "${this.name}": "${n}" is a node; trailing path "${s.join(T)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${n}"`);return i.resolve(s.join(T))}_resolveMetaChainFromNode(t,r,n){let s=t,o=0,i=[...r];for(;o<i.length;){if(i[o]!==B)throw new Error(`Graph "${this.name}": expected ${B} segment in meta path "${n}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${B} in "${n}"`);let a=i[o+1],l=s.meta[a];if(!l)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${n}"`);s=l,o+=2}return s}signal(t,r){if(r?.internal!==!0){for(let s of t)if(this.config.messageTier(s[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let n=[];if(this._signalDeliver(t,r??{},new Set,n),n.length>0)throw n[0]}_signalDeliver(t,r,n,s){for(let l of this._mounts.values())l._signalDeliver(t,r,n,s);let i=r.internal===!0?{internal:!0}:{actor:r.actor,delivery:"signal"},a=nn(t,this.config);for(let l of[...this._nodes.keys()].sort()){let u=this._nodes.get(l);if(!n.has(u)){n.add(u);try{u.down(t,i)}catch(d){if(d instanceof W)throw d;s.push(d)}a.length!==0&&this._signalMetaSubtree(u,a,n,i,s)}}}_signalMetaSubtree(t,r,n,s,o){for(let i of Object.keys(t.meta).sort()){let a=t.meta[i];if(!n.has(a)){n.add(a);try{a.down(r,s)}catch(l){if(l instanceof W)throw l;o.push(l)}this._signalMetaSubtree(a,r,n,s,o)}}}describe(t){if(t?.reactive===!0)return this._describeReactive(t);let r=jt(t?.actor),n=t?.filter,s=re(t?.detail,t?.fields),o=t?.format==="spec",i=o?re("minimal"):s,a=[];this._collectObserveTargets("",a);let l=new Map;for(let[v,w]of a)l.set(w,v);let u=[];{let v=a.map(([,R])=>R),w=new Set(l.values()),_=0;for(;v.length>0;){let R=v.shift();if(R instanceof L)for(let k of R._deps){let $=k.node;if(l.has($))continue;let D=$.name??"",G=D;if(!G||w.has(G))if(D){let P=2;for(;w.has(`${D}#${P}`);)P++;G=`${D}#${P}`}else for(G=`__internal__/${_++}`;w.has(G);)G=`__internal__/${_++}`;l.set($,G),w.add(G),u.push([G,$]),v.push($)}}}let d=[...a,...u],h={};for(let[v,w]of d){if(r!=null&&!w.allowsObserve(r))continue;let _=_e(w,i),R=w instanceof L?w._deps.map(G=>l.get(G.node)??G.node.name??""):[],{name:k,...$}=_,D={...$,deps:R};if(!o){let G=this._annotations.get(v);G!=null&&(D.annotation=G)}if(n!=null)if(typeof n=="function"){let G=n;if(!(G.length>=2?G(v,D):G(D)))continue}else{let G=!0;for(let[P,F]of Object.entries(n)){let H=P==="deps_includes"?"depsIncludes":P==="meta_has"?"metaHas":P;if(H==="depsIncludes"){if(!D.deps.includes(String(F))){G=!1;break}continue}if(H==="metaHas"){if(!Object.hasOwn(D.meta??{},String(F))){G=!1;break}continue}if(D[H]!==F){G=!1;break}}if(!G)continue}h[v]=D}let p=new Set(Object.keys(h)),f=[];for(let[v,w]of d)if(w instanceof L)for(let _ of w._deps){let R=l.get(_.node);R!=null&&f.push([R,v])}f.sort((v,w)=>v[0]<w[0]?-1:v[0]>w[0]?1:v[1]<w[1]?-1:v[1]>w[1]?1:0);let c=f.map(([v,w])=>({from:v,to:w}));(r!=null||n!=null)&&(c=c.filter(v=>p.has(v.from)&&p.has(v.to)));let g=this._collectSubgraphs(""),O=r!=null||n!=null?g.filter(v=>{let w=`${v}${T}`;return[...p].some(_=>_===v||_.startsWith(w))}):g,S=this,b=t,m={name:this.name,nodes:h,edges:c,subgraphs:O,expand(v){let w={...b,format:void 0};return Array.isArray(v)?(w.fields=v,w.detail=void 0):(w.detail=v,w.fields=void 0),S.describe(w)}},y=t??{},x=y.format;return x==="json"?Kt(m,y):x==="pretty"?Wt(m,y):x==="mermaid"?ut(m,y):x==="mermaid-url"?qt(m,y):x==="d2"?Jt(m,y):x==="ascii"?et(m,y):m}_collectSubgraphs(t){let r=[];for(let n of[...this._mounts.keys()].sort()){let s=t===""?n:`${t}${n}`;r.push(s),r.push(...this._mounts.get(n)._collectSubgraphs(`${s}${T}`))}return r}resourceProfile(t){return Ve(this,t)}reachable(t,r,n={}){return n.withDetail===!0?ot(this.describe(),t,r,{...n,withDetail:!0}):ot(this.describe(),t,r,n)}explain(t,r,n){return n?.reactive===!0?this._explainReactive(t,r,n):this._explainStatic(t,r,n)}_explainStatic(t,r,n){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,l]of Object.entries(s.nodes))l.lastMutation!=null&&i.set(a,l.lastMutation);return Ie(s,t,r,{...n?.maxDepth!=null?{maxDepth:n.maxDepth}:{},...n?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(t){let r={...t,reactive:!1},n=t.reactiveName??"describe",s=0,o=ne(s,{name:`${n}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=()=>{a||l||(a=!0,xe(()=>{a=!1,!l&&(s+=1,o.emit(s))}))},d=i.onEvent(b=>{let m=b.type;m!=="data"&&m!=="error"&&m!=="complete"&&m!=="teardown"||u()}),h=[],p=new WeakSet,f=b=>{if(p.has(b)||l)return;p.add(b);let m=b.topology.subscribe(y=>{for(let x of y){if(x[0]!==Y)continue;let v=x[1];if(u(),v.kind==="added"&&v.nodeKind==="mount"){let w=b._mounts.get(v.name);w!=null&&f(w)}}});h.push(m);for(let y of b._mounts.keys()){let x=b._mounts.get(y);x!=null&&f(x)}};f(this);let c,g=t.actor;st(g)&&(c=g.subscribe(b=>{let m=!1,y=!1;for(let x of b){let v=x[0];v===Y?m=!0:(v===X||v===Q||v===z)&&(y=!0)}m&&u(),y&&(c?.(),c=void 0,u())}));let O;try{O=Oe([o],()=>this.describe(r),{name:n,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(b,m)=>b===m})}catch(b){d(),c?.();for(let m of h)m();throw i.dispose(),b}let S=Ee(O);return{node:O,dispose(){l=!0,d(),c?.();for(let b of h)b();h.length=0,i.dispose(),S()}}}_explainReactive(t,r,n){let s=0,o=ne(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=i.onEvent(f=>{let c=f.type;c!=="data"&&c!=="error"&&c!=="complete"&&c!=="teardown"||a||l||(a=!0,xe(()=>{a=!1,!l&&(s+=1,o.emit(s))}))}),d={...n?.maxDepth!=null?{maxDepth:n.maxDepth}:{},...n?.findCycle===!0?{findCycle:!0}:{}},h;try{h=Oe([o],()=>this._explainStatic(t,r,d),{name:n?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:t,to:r},equals:(f,c)=>f.found===c.found&&f.reason===c.reason&&f.steps.length===c.steps.length&&on(f.steps,c.steps)})}catch(f){throw u(),i.dispose(),f}let p=Ee(h);return{node:h,dispose(){l=!0,u(),i.dispose(),p()}}}_pathsMatching(t){let r=ce(t),n=[];return this._collectObserveTargets("",n),n.map(([s])=>s).filter(s=>r.test(s))}_collectObserveTargets(t,r){for(let n of[...this._mounts.keys()].sort()){let s=t===""?n:`${t}${T}${n}`;this._mounts.get(n)._collectObserveTargets(s,r)}for(let n of[...this._nodes.keys()].sort()){let s=this._nodes.get(n),o=t===""?n:`${t}${T}${n}`;r.push([o,s]),this._appendMetaObserveTargets(o,s,r)}}_appendMetaObserveTargets(t,r,n){for(let s of Object.keys(r.meta).sort()){let o=r.meta[s],i=`${t}${T}${B}${T}${s}`;n.push([i,o]),this._appendMetaObserveTargets(i,o,n)}}observe(t,r){let n=typeof t=="string",o=rt(n?r:t),i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(n){let d=t,h=this.resolve(d);if(a!=null&&!h.allowsObserve(a))throw new W({actor:a,action:"observe",nodeName:d});return i?this._buildStructuredObserver([[d,h]],o,"one"):{subscribe(p){return h.subscribe(p)},up(p){try{h.up?.(p)}catch(f){if(f instanceof W)return;throw f}}}}let l=[];this._collectObserveTargets("",l),l.sort((d,h)=>d[0]<h[0]?-1:d[0]>h[0]?1:0);let u=a==null?l:l.filter(([,d])=>d.allowsObserve(a));return i?this._buildStructuredObserver(u,o,"all"):{subscribe:d=>{let h=u.map(([p,f])=>f.subscribe(c=>{d(p,c)}));return()=>{for(let p of h)p()}},up:(d,h)=>{try{this.resolve(d).up?.(h)}catch(p){if(p instanceof W)return;throw p}}}}_buildStructuredObserver(t,r,n){let s=n==="one"?t[0]?.[0]:void 0,o=i=>{if(n==="one"&&s!=null){let d=this.resolve(s);return this._buildStructuredObserver([[s,d]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((d,h)=>d[0]<h[0]?-1:d[0]>h[0]?1:0);let l=i.actor,u=l==null?a:a.filter(([,d])=>d.allowsObserve(l));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(t,r,o)}_createObserveResult(t,r,n){let s=r.timeline===!0,o=r.causal===!0,i=r.derived===!0,a=r.detail==="minimal",l=this.config.inspectorEnabled,u=(o||i)&&l,d=r.maxEvents,h=d!=null&&d>0?new Se(d):null,p=[],f=new Set,c={},g=new Set,O=0,S=0,b=0,m=0,y=0,x=0,v=!1,w=!1,_=0,R=new Map,k=new Map,$=new Map,D=E=>{h?h.push(E):p.push(E);for(let N of f)N(E)},G=()=>s?{timestamp_ns:K(),in_batch:Te(),batch_id:_}:{},P=(E,N)=>{if(!(!u||!(E instanceof L)))return E._setInspectorHook(I=>{if(I.kind==="dep_message")R.set(E,I.depIndex);else if(I.kind==="run"){let J=I.batchData.map((C,M)=>C!=null&&C.length>0?C.at(-1):I.prevData[M]);k.set(E,J);let j=I.batchData.map(C=>C!=null?[...C]:void 0);$.set(E,j),i&&D({type:"derived",path:N,dep_values:J,dep_batches:j,...G()})}})},F=E=>{let N=R.get(E),I=k.get(E);if(!o||I==null)return{};let j=(N!=null&&N>=0&&E instanceof L?E._deps[N]:void 0)?.node,C=j?.v,M=$.get(E);return{trigger_dep_index:N,trigger_dep_name:j?.name,...C!=null?{trigger_version:{id:C.id,version:C.version}}:{},dep_values:[...I],...M!=null?{dep_batches:M}:{}}},H=[],U=[];for(let[E,N]of t){let I=P(N,E);I&&H.push(I),U.push(N.subscribe(J=>{_++;for(let j of J){let C=j[0],M=G();if(C===Y){c[E]=j[1];let ge=N instanceof L?N.lastMutation?.actor??Z:Z;D({type:"data",path:E,data:j[1],actor:ge,...M,...F(N)})}else if(a)C===me?O++:C===be?S++:C===te?b++:C===ye?m++:C===ve?y++:C===z?x++:C===X&&!g.has(E)?v=!0:C===Q&&(w=!0,g.add(E));else if(C===me)O++,D({type:"dirty",path:E,...M});else if(C===be)S++,D({type:"resolved",path:E,...M,...F(N)});else if(C===te)b++,D({type:"invalidate",path:E,...M});else if(C===ye)m++,D({type:"pause",path:E,lockId:j[1],...M});else if(C===ve)y++,D({type:"resume",path:E,lockId:j[1],...M});else if(C===X)g.has(E)||(v=!0),D({type:"complete",path:E,...M});else if(C===Q){w=!0,g.add(E);let ge=N instanceof L?N.lastMutation?.actor??Z:Z;D({type:"error",path:E,data:j[1],actor:ge,...M})}else C===z&&(x++,D({type:"teardown",path:E,...M}))}}))}let fe=!1,pe=()=>{if(!fe){fe=!0;for(let E of U)E();for(let E of H)E();for(let E of ee)E({value:void 0,done:!0});ee.length=0}},he=[],ee=[];f.add(E=>{let N=ee.shift();N?N({value:E,done:!1}):he.push(E)});let ke={get values(){return c},get dirtyCount(){return O},get resolvedCount(){return S},get invalidateCount(){return b},get pauseCount(){return m},get resumeCount(){return y},get teardownCount(){return x},get events(){return h?h.toArray():[...p]},get anyCompletedCleanly(){return v},get anyErrored(){return w},get completedWithoutErrors(){return v&&!w},onEvent(E){return f.add(E),()=>f.delete(E)},dispose:pe,expand(E){pe();let N={...r};return typeof E=="string"?N.detail=E:Object.assign(N,E),n(rt(N))},[Symbol.asyncIterator](){return{next(){return he.length>0?Promise.resolve({value:he.shift(),done:!1}):fe?Promise.resolve({value:void 0,done:!0}):new Promise(E=>ee.push(E))},return(){return pe(),Promise.resolve({value:void 0,done:!0})}}}};return r.format!=null&&this._attachFormatLogger(ke,r),ke}_attachFormatLogger(t,r){let n=r.format;if(n==null)return;let s=r.logger??(c=>console.log(c)),o=r.includeTypes?new Set(r.includeTypes):null,i=r.excludeTypes?new Set(r.excludeTypes):null,a=o==null&&i==null?()=>!0:c=>(o==null||o.has(c))&&(i==null||!i.has(c)),l=Zt(r.theme),u=n==="stage-log"?K():0,d=c=>c==null?"":r.stageLabels?.[c]??c,h=(c,g)=>c.length>g?`${c.slice(0,g-1)}\u2026`:c,p=c=>c.type==="data"||c.type==="error"?h(de(c.data),120):"",f=c=>{if(n==="stage-log"){let w=(K()-u)/1e9,_=d(c.path).padEnd(9);if(c.type==="data"){let R=p(c);return`[${w.toFixed(3)}s] ${_} \u2190${R?` ${R}`:""}`}if(c.type==="error"){let R=p(c);return`[${w.toFixed(3)}s] ${_} \u2717${R?` ${R}`:""}`}return c.type==="complete"?`[${w.toFixed(3)}s] ${_} \u25A0 complete`:`[${w.toFixed(3)}s] ${_} ${c.type}`}if(n==="json")try{return JSON.stringify(c)}catch{return JSON.stringify({type:c.type,path:c.path,data:"[unserializable]"})}let g=l[c.type]??"",O=c.path?`${l.path}${c.path}${l.reset} `:"",S=c.type==="data"||c.type==="error",b=c.type==="pause"||c.type==="resume",m=S?` ${de(c.data)}`:b?` ${de(c.lockId)}`:"",y=c.type==="data"||c.type==="resolved"||c.type==="derived"?c:void 0,x=y?.trigger_dep_name!=null?` <- ${y.trigger_dep_name}`:y?.trigger_dep_index!=null?` <- #${y.trigger_dep_index}`:"",v=c.in_batch?" [batch]":"";return`${O}${g}${c.type.toUpperCase()}${l.reset}${m}${x}${v}`};t.onEvent(c=>{a(c.type)&&s(f(c),c)})}addDisposer(t){return this._disposers.add(t),()=>{this._disposers.delete(t)}}destroy(){tt(this._disposers,this.name),this.signal([[z]],{internal:!0}),tt(this._storageDisposers,this.name);for(let t of[...this._mounts.values()])t._parent=void 0,t._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}get destroyed(){return this._destroyed}_destroyClearOnly(){for(let t of[...this._mounts.values()])t._parent=void 0,t._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}snapshot(t){let{expand:r,...n}=this.describe({detail:"full"}),s={};for(let a of Object.keys(n.nodes).sort()){let{lastMutation:l,guard:u,...d}=n.nodes[a];s[a]=d}let o=[...n.subgraphs].sort(),i={...n,version:1,nodes:s,subgraphs:o};if(t?.format==null)return i;if(t.format==="json-string")return JSON.stringify(i);if(t.format==="bytes"){if(t.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(t.codec);if(a==null)throw new Error(`snapshot: codec "${t.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return $e(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(t.format)}"`)}static decode(t,r){let n=r?.config??we,{codec:s,codecVersion:o,payload:i}=Ne(t,n);return s.decode(i,o)}restore(t,r){if(nt(t),t.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${t.name}" does not match this graph`);let n=r?.only==null?null:(Array.isArray(r.only)?r.only:[r.only]).map(o=>ce(o)),s=r?.includeProducers===!0;for(let o of Object.keys(t.nodes).sort()){if(n!==null&&!n.some(a=>a.test(o)))continue;let i=t.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&r?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let l=this.tryResolve(o)?.v;if(l!=null&&l.id===i.v.id&&l.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){r?.onError?.(o,a)}}}}}static fromSnapshot(t,r){nt(t);let n=typeof r=="function"?r:r?.build,s=typeof r=="function"?void 0:r?.factories,o=new e(t.name);if(n)return n(o),o.restore(t),o;for(let f of[...t.subgraphs].sort((c,g)=>{let O=c.split(T).length,S=g.split(T).length;return O!==S?O-S:c<g?-1:c>g?1:0})){let c=f.split(T),g=o;for(let O of c)g._mounts.has(O)||g.mount(O,new e(O)),g=g._mounts.get(O)}let i=s?Object.entries(s).map(([f,c])=>({re:ce(f),factory:c})):[],a=f=>{for(let c of i)if(c.re.test(f))return c.factory},l=f=>{let c=f.split(T),g=c.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${f}"`);let O=o;for(let S of c){let b=O._mounts.get(S);if(!b)throw new Error(`unknown mount "${S}" in path "${f}"`);O=b}return[O,g]},u=Object.entries(t.nodes).filter(([f])=>!f.includes(`${T}${B}${T}`)).sort((f,c)=>f[0]<c[0]?-1:f[0]>c[0]?1:0),d=new Map(u),h=new Map,p=!0;for(;d.size>0&&p;){p=!1;for(let[f,c]of[...d.entries()]){let g=c?.deps??[];if(!g.every(x=>h.has(x)))continue;let[O,S]=l(f),b={...c?.meta??{}},m=a(f),y;if(c?.type==="state")y=ne(c.value,{meta:b});else{if(m==null)continue;y=m(S,{path:f,type:c.type,value:c.value,meta:b,deps:g,resolvedDeps:g.map(x=>h.get(x))})}O.add(y,{name:S}),h.set(f,y),d.delete(f),p=!0}}if(d.size>0){let f=[...d.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${f}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return o.restore(t),o}toJSON(){return this.snapshot()}attachSnapshotStorage(t,r={}){let n=t.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}));r.autoRestore===!0&&this._cascadeRestore(t,r.onError);let s=(u,d)=>{if(u.disposed)return;let h=Bt(d.nodes);if(u.lastSnapshot!=null&&h!==""&&h===u.lastFingerprint)return;let p=u.seq+1,f=Pe(),O=u.lastSnapshot==null||p%u.compactEvery===0?{name:this.name,mode:"full",snapshot:d,seq:p,timestamp_ns:f,format_version:q}:{name:this.name,mode:"diff",diff:rn(u.lastSnapshot,d),seq:p,timestamp_ns:f,format_version:q};if(u.tier.filter&&!u.tier.filter(O))return;let S;try{S=u.tier.save(O)}catch(b){r.onError?.(b,u.tier);return}if(S&&typeof S.then=="function"){let y=(u.savePending??Promise.resolve()).then(()=>S,()=>S).then(()=>{u.disposed||(u.seq=p,u.lastSnapshot=d,u.lastFingerprint=h)},x=>{r.onError?.(x,u.tier)});u.savePending=y.finally(()=>{u.savePending===y&&(u.savePending=void 0)})}else u.seq=p,u.lastSnapshot=d,u.lastFingerprint=h},o=(u,d)=>{try{s(u,d)}catch(h){r.onError?.(h,u.tier)}},i=(u,d)=>{if(!d.some(c=>{let g=this.config.messageTier(c[0]);return g>=3&&g<5}))return;if(r.filter){let c=this.tryResolve(u);if(c==null)return;let g=_e(c,re("standard"));if(!r.filter(u,g))return}let p,f=()=>(p==null&&(p=this.snapshot()),p);for(let c of n)c.disposed||(c.debounceMs===0?o(c,f()):(c.timer==null&&(c.timer=new Le),c.timer.start(c.debounceMs,()=>{c.disposed||o(c,this.snapshot())})))},a;if(r.paths!=null){let d=(typeof r.paths=="string"?this._pathsMatching(r.paths):r.paths).map(h=>{let p=this.tryResolve(h);return p==null?()=>{}:p.subscribe(f=>i(h,f))});a=()=>{for(let h of d)h()}}else a=this.observe().subscribe((u,d)=>i(u,d));let l=()=>{a();for(let u of n)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(l)};return this._storageDisposers.add(l),{dispose:l}}async _cascadeRestore(t,r){for(let n of t){let s;try{s=await n.load?.()}catch(i){r?.(i,n);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===q&&o.nodes!=null)return this.restore(o),!0}catch(i){r?.(i,n)}}return!1}static async fromStorage(t,r,n){for(let s of r){let o;try{o=await s.load?.()}catch(l){n?.onError?.(l,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===q&&i.nodes!=null?i:void 0;if(a!=null)try{return e.fromSnapshot(a,n)}catch(l){n?.onError?.(l,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${t}" across ${r.length} tier(s)`)}_annotations=new Map;_traceRing;trace(t,r,n){if(t!=null&&r!=null){if(this.tryResolve(t)==null)return;if(this._annotations.set(t,r),this.config.inspectorEnabled){let s={path:t,annotation:r,timestamp_ns:K(),...n?.actor!=null?{actor:n.actor}:{}};this._traceRing.push(s)}return}return t!=null?this.config.inspectorEnabled?this._annotations.get(t):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(t){return this._annotations.get(t)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(t){let r=this._traceRing.toArray().filter(s=>!t(s)),n=this._traceRing.size-r.length;this._traceRing.clear();for(let s of r)this._traceRing.push(s);return n}static diff(t,r){let n=new Set(Object.keys(t.nodes)),s=new Set(Object.keys(r.nodes)),o=[...s].filter(b=>!n.has(b)).sort(),i=[...n].filter(b=>!s.has(b)).sort(),a=[],l=[];for(let b of n){if(!s.has(b))continue;let m=t.nodes[b],y=r.nodes[b],x=m.v,v=y.v;x!=null&&v!=null&&x.id===v.id&&x.version!==v.version&&l.push({path:b,id:x.id,from:x.version,to:v.version});let w=x!=null&&v!=null&&x.id===v.id&&x.version===v.version;for(let _ of["type","status","sentinel"]){let R=m[_],k=y[_];R!==k&&a.push({path:b,field:_,from:R,to:k})}if(!w)for(let _ of["value","meta"]){let R=m[_],k=y[_];Ft(R,k)||a.push({path:b,field:_,from:R,to:k})}}let u=b=>`${b.from} ${b.to}`,d=new Set(t.edges.map(u)),h=new Set(r.edges.map(u)),p=r.edges.filter(b=>!d.has(u(b))),f=t.edges.filter(b=>!h.has(u(b))),c=new Set(t.subgraphs),g=new Set(r.subgraphs),O=[...g].filter(b=>!c.has(b)).sort(),S=[...c].filter(b=>!g.has(b)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:l,edgesAdded:p,edgesRemoved:f,subgraphsAdded:O,subgraphsRemoved:S}}};function rn(e,t){let r=Ce.diff(e,t),n={};for(let s of r.nodesAdded){let o=t.nodes[s];o!=null&&(n[s]=o)}return{...r,nodesAddedFull:n}}function ot(e,t,r,n={}){let s={paths:[],depths:new Map,truncated:!1};if(!t)return n.withDetail?s:[];if(!n.both&&r!=="upstream"&&r!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=n.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return n.withDetail?s:[];let i=new Map,a=new Map,l=new Map,u=new Map,d=new Set;for(let[m,y]of Object.entries(e.nodes)){if(!m)continue;d.add(m);let x=y.deps??[];i.set(m,x);for(let v of x)v&&(d.add(v),a.has(v)||a.set(v,new Set),a.get(v).add(m))}for(let m of e.edges){if(m==null||typeof m!="object")continue;let y=typeof m.from=="string"?m.from:"",x=typeof m.to=="string"?m.to:"";!y||!x||(d.add(y),d.add(x),u.has(y)||u.set(y,new Set),u.get(y).add(x),l.has(x)||l.set(x,new Set),l.get(x).add(y))}if(!d.has(t))return n.withDetail?s:[];let h=n.both===!0,p=m=>{if(h){let w=i.get(m)??[],_=l.get(m),R=a.get(m),k=u.get(m),$=[...w];return _&&$.push(..._),R&&$.push(...R),k&&$.push(...k),$}if(r==="upstream"){let w=i.get(m)??[],_=l.get(m);return _?[...w,..._]:w}let y=a.get(m),x=u.get(m),v=y?[...y]:[];return x&&v.push(...x),v},f=new Set([t]),c=new Map,g=[{path:t,depth:0}],O=0,S=!1;for(;O<g.length;){let m=g[O++];if(o!=null&&m.depth>=o){p(m.path).length>0&&(S=!0);continue}for(let y of p(m.path))!y||f.has(y)||(f.add(y),c.set(y,m.depth+1),g.push({path:y,depth:m.depth+1}))}let b=[...c.keys()].sort((m,y)=>m<y?-1:m>y?1:0);return n.withDetail?{paths:b,depths:c,truncated:S}:b}function on(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=e[r],s=t[r];if(n.path!==s.path||n.type!==s.type||n.status!==s.status||n.hop!==s.hop||n.dep_index!==s.dep_index||n.annotation!==s.annotation||n.value!==s.value||n.lastMutation!==s.lastMutation)return!1;let o=n.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}export{ae as a,Ie as b,A as c,pt as d,He as e,Ve as f,B as g,q as h,Ut as i,Ce as j,rn as k,ot as l};
|
package/dist/chunk-C5CBVOCB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f}from"./chunk-XIJKEXWR.js";import{a as l,c as o,d,g as s,h as m,j as b,k as c}from"./chunk-A5HZZYRK.js";import{a as r,b as u}from"./chunk-4VVTGLXJ.js";import{b as y}from"./chunk-QYADASLV.js";var R={};y(R,{NS_PER_MS:()=>r,NS_PER_SEC:()=>u,resilientPipeline:()=>O});function O(p,e={}){let t=p;e.rateLimit!=null&&(t=s(t,e.rateLimit)),e.budget!=null&&e.budget.length>0&&(t=f(t,e.budget));let n;if(e.breaker!=null){let k=o(e.breaker),S=e.breakerOnOpen??"skip",a=d(k,{onOpen:S})(t);t=a.node,n=a.breakerState}if(e.timeoutMs!=null){if(e.timeoutMs<=0)throw new RangeError("timeoutMs must be > 0");if(e.timeoutMs>9e6)throw new RangeError("timeoutMs must be <= 9_000_000 (\u22482.5h) to stay within safe ns arithmetic");t=c(t,e.timeoutMs*1e6)}e.retry!=null&&(t=l(t,e.retry)),e.fallback!==void 0&&(t=b(t,e.fallback));let i=m(t,{initialStatus:e.initialStatus??"pending"});return{node:i.node,status:i.status,error:i.error,breakerState:n}}export{O as a,R as b};
|
package/dist/chunk-CZIQ6JCE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as O,b as H,c as j,d as E,e as W,f as ne}from"./chunk-QP5TH523.js";import{a as N}from"./chunk-O32GJOUJ.js";import{a as X,j as T}from"./chunk-B4L5X2QO.js";import{D as I,E as y,G as L,o as S}from"./chunk-LYCLF26R.js";import{b as te}from"./chunk-QYADASLV.js";var ie={};te(ie,{CanvasMeasureAdapter:()=>$,CliMeasureAdapter:()=>D,ImageSizeAdapter:()=>J,NodeCanvasMeasureAdapter:()=>q,PrecomputedAdapter:()=>V,SvgBoundsAdapter:()=>z,analyzeAndMeasure:()=>O,carveTextLineSlots:()=>E,circleIntervalForBand:()=>Q,computeBlockFlow:()=>_,computeCharPositions:()=>W,computeFlowLines:()=>ee,computeLineBreaks:()=>H,computeTotalHeight:()=>U,layoutNextLine:()=>j,measureBlock:()=>Y,measureBlocks:()=>K,reactiveBlockLayout:()=>re,reactiveFlowLayout:()=>se,reactiveLayout:()=>ne,rectIntervalForBand:()=>Z});var D=class{cellPx;constructor(t){this.cellPx=t?.cellPx??8}measureSegment(t,n){return{width:X(t)*this.cellPx}}},G=class extends Error{name="KeyError"},V=class{metrics;fallback;constructor(t){this.metrics=t.metrics;let n=t.fallback??"per-char";if(n!=="per-char"&&n!=="error")throw new Error(`fallback must be 'per-char' or 'error', got ${JSON.stringify(t.fallback)}`);this.fallback=n}measureSegment(t,n){let i=this.metrics[n];if(i){let o=i[t];if(o!==void 0)return{width:o}}if(this.fallback==="error")throw new G(`PrecomputedAdapter: no metrics for segment ${JSON.stringify(t)} in font ${JSON.stringify(n)}`);let r=0;if(i)for(let o of t){let l=i[o];l!==void 0&&(r+=l)}return{width:r}}},$=class{ctx=null;currentFont="";emojiCorrection;constructor(t){this.emojiCorrection=t?.emojiCorrection??1}getContext(){if(!this.ctx){if(typeof OffscreenCanvas>"u")throw new Error("CanvasMeasureAdapter requires a browser environment with OffscreenCanvas support. Use CliMeasureAdapter or NodeCanvasMeasureAdapter for Node.js.");let n=new OffscreenCanvas(0,0).getContext("2d");if(!n)throw new Error("CanvasMeasureAdapter: failed to get 2d context");this.ctx=n}return this.ctx}measureSegment(t,n){let i=this.getContext();n!==this.currentFont&&(i.font=n,this.currentFont=n);let r=i.measureText(t).width;return this.emojiCorrection!==1&&new RegExp("\\p{Emoji_Presentation}","u").test(t)&&(r*=this.emojiCorrection),{width:r}}clearCache(){this.currentFont=""}},q=class{ctx=null;currentFont="";canvasModule;constructor(t){this.canvasModule=t}getContext(){if(!this.ctx){let n=this.canvasModule.createCanvas(0,0).getContext("2d");if(!n)throw new Error("NodeCanvasMeasureAdapter: failed to get 2d context");this.ctx=n}return this.ctx}measureSegment(t,n){let i=this.getContext();return n!==this.currentFont&&(i.font=n,this.currentFont=n),{width:i.measureText(t).width}}clearCache(){this.currentFont=""}},z=class{measureSvg(t){let n=t.match(/viewBox\s*=\s*["']([^"']+)["']/);if(n){let o=n[1].trim().split(/[\s,]+/);if(o.length>=4){let l=Number.parseFloat(o[2]),a=Number.parseFloat(o[3]);if(Number.isFinite(l)&&Number.isFinite(a)&&l>0&&a>0)return{width:l,height:a};throw new Error("SvgBoundsAdapter: viewBox width/height are missing, non-finite, or not positive")}}let i=t.match(/<svg[^>]*\bwidth\s*=\s*["']?([\d.]+)/),r=t.match(/<svg[^>]*\bheight\s*=\s*["']?([\d.]+)/);if(i&&r){let o=Number.parseFloat(i[1]),l=Number.parseFloat(r[1]);if(Number.isFinite(o)&&Number.isFinite(l)&&o>0&&l>0)return{width:o,height:l};throw new Error("SvgBoundsAdapter: svg width/height attributes are non-finite or not positive")}throw new Error("SvgBoundsAdapter: cannot determine dimensions \u2014 SVG has no viewBox or width/height attributes")}},J=class{sizes;constructor(t){this.sizes=new Map(Object.entries(t))}measureImage(t){let n=this.sizes.get(t);if(!n)throw new Error(`ImageSizeAdapter: no dimensions registered for ${JSON.stringify(t)}`);return{width:n.width,height:n.height}}};function Y(e,t,n,i,r,o,l){switch(e.type){case"text":{let a=e.font??r,m=e.lineHeight??o,d=O(e.text,a,n.text,i),w=H(d,t,n.text,a,i),v=W(w,d,m),B=w.lineCount*m,c=0;for(let x of w.lines)x.width>c&&(c=x.width);return{index:l,type:"text",width:Math.min(c,t),height:B,textSegments:d,textLineBreaks:w,textCharPositions:v}}case"image":{let a,m;if(e.naturalWidth!=null&&e.naturalHeight!=null)a=e.naturalWidth,m=e.naturalHeight;else if(n.image){let d=n.image.measureImage(e.src);a=d.width,m=d.height}else throw new Error(`Image block at index ${l} has no naturalWidth/naturalHeight and no ImageMeasurer adapter`);return a>t&&(m=m*t/a,a=t),{index:l,type:"image",width:a,height:m}}case"svg":{let a,m;if(e.viewBox)a=e.viewBox.width,m=e.viewBox.height;else if(n.svg){let d=n.svg.measureSvg(e.content);a=d.width,m=d.height}else throw new Error(`SVG block at index ${l} has no viewBox and no SvgMeasurer adapter`);return a>t&&(m=m*t/a,a=t),{index:l,type:"svg",width:a,height:m}}}}function K(e,t,n,i,r,o){return e.map((l,a)=>Y(l,t,n,i,r,o,a))}function _(e,t){let n=[],i=0;for(let r=0;r<e.length;r++){let o=e[r];n.push({...o,x:0,y:i}),i+=o.height+(r<e.length-1?t:0)}return n}function U(e){if(e.length===0)return 0;let t=e[e.length-1];return t.y+t.height}function re(e){let{adapters:t,name:n="reactive-block-layout",defaultFont:i="16px sans-serif",defaultLineHeight:r=20}=e,o=new T(n),l=new Map,a=y(e.blocks??[],{name:"blocks"}),m=y(Math.max(0,e.maxWidth??800),{name:"max-width"}),d=y(e.gap??0,{name:"gap"}),w=I([a,m],(c,x,s)=>{let p=c[0]!=null&&c[0].length>0?c[0].at(-1):s.prevData[0],h=c[1]!=null&&c[1].length>0?c[1].at(-1):s.prevData[1],g=S(),u=K(p,h,t,l,i,r),f=S()-g,b=w.meta;b&&(N(b["block-count"],u.length),N(b["layout-time-ns"],f)),x.emit(u);let C=()=>{l.clear(),t.text.clearCache?.()};return{deactivate:C,invalidate:C}},{name:"measured-blocks",describeKind:"derived",meta:{"block-count":0,"layout-time-ns":0},equals:(c,x)=>{let s=c,p=x;if(s==null||p==null)return s===p;if(s.length!==p.length)return!1;for(let h=0;h<s.length;h++){let g=s[h],u=p[h];if(g.type!==u.type||g.width!==u.width||g.height!==u.height||g.index!==u.index)return!1}return!0}}),v=L([w,d],([c,x])=>_(c,x),{name:"block-flow",equals:(c,x)=>{let s=c,p=x;if(s==null||p==null)return s===p;if(s.length!==p.length)return!1;for(let h=0;h<s.length;h++){let g=s[h],u=p[h];if(g.x!==u.x||g.y!==u.y||g.width!==u.width||g.height!==u.height)return!1}return!0}}),B=L([v],([c])=>U(c),{name:"total-height"});return o.add(a,{name:"blocks"}),o.add(m,{name:"max-width"}),o.add(d,{name:"gap"}),o.add(w,{name:"measured-blocks"}),o.add(v,{name:"block-flow"}),o.add(B,{name:"total-height"}),{graph:o,setBlocks:c=>o.set("blocks",c),setMaxWidth:c=>o.set("max-width",Math.max(0,c)),setGap:c=>o.set("gap",c),measuredBlocks:w,blockFlow:v,totalHeight:B}}function Q(e,t,n){let i=e.hPad??0,r=e.vPad??0,o=t-r,l=n+r;if(o>=e.cy+e.r||l<=e.cy-e.r)return null;let a=e.cy>=o&&e.cy<=l?0:e.cy<o?o-e.cy:e.cy-l;if(a>=e.r)return null;let m=Math.sqrt(e.r*e.r-a*a);return{left:e.cx-m-i,right:e.cx+m+i}}function Z(e,t,n){let i=e.hPad??0,r=e.vPad??0;return n<=e.y-r||t>=e.y+e.h+r?null:{left:e.x-i,right:e.x+e.w+i}}function oe(e,t,n){return e.kind==="circle"?Q(e,t,n):Z(e,t,n)}function ee(e,t,n,i,r,o,l){let a=l?.paragraphSpacing??r,m=[],d={segmentIndex:0,graphemeIndex:0};if(e.length===0||n.count<=0||r<=0)return{lines:m,cursor:d};let w=t.paddingX??0,v=t.paddingY??0,B=Math.max(0,t.width-w*2),c=Math.max(0,t.height-v*2),x=n.gap*Math.max(0,n.count-1),s=Math.max(0,(B-x)/n.count);if(s<=0)return{lines:m,cursor:d};e:for(let p=0;p<n.count;p++){let h=w+p*(s+n.gap),g=h+s,u=v;for(;u+r<=v+c;){let f=u+r,b=[];for(let k=0;k<i.length;k++){let M=oe(i[k],u,f);M!==null&&b.push(M)}let C=E({left:h,right:g},b,o);if(C.length===0){u+=r;continue}let P=!1;for(let k=0;k<C.length;k++){let M=C[k],R=M.right-M.left,F=j(e,d,R);if(F===null)return{lines:m,cursor:d};if(F.text.length===0&&F.width===0){d=F.end,P=!0;break}m.push({x:M.left,y:u,width:F.width,slotWidth:R,text:F.text,columnIndex:p,flushToRight:M.right<g-.5}),d=F.end}if(P){u+=a;continue}if(u+=r,d.segmentIndex>=e.length)break e}if(d.segmentIndex>=e.length)break}return{lines:m,cursor:d}}function se(e){let{adapter:t,name:n="reactive-flow-layout",minSlotWidth:i=20}=e,r=new T(n),o=new Map,l=y(e.text??"",{name:"text"}),a=y(e.font??"16px sans-serif",{name:"font"}),m=y(e.lineHeight??20,{name:"line-height"}),d=y(e.container??{width:800,height:600,paddingX:0,paddingY:0},{name:"container"}),w=y(e.columns??{count:1,gap:0},{name:"columns"}),v=y(e.obstacles??[],{name:"obstacles"}),B=y(e.paragraphSpacing??null,{name:"paragraph-spacing"}),c=I([l,a],(s,p,h)=>{let g=s[0],u=g!=null&&g.length>0?g.at(-1):h.prevData[0],f=s[1],b=f!=null&&f.length>0?f.at(-1):h.prevData[1],C=O(u,b,t,o);p.emit(C);let P=()=>{o.clear(),t.clearCache?.()};return{deactivate:P,invalidate:P}},{name:"segments",describeKind:"derived"}),x=L([c,d,w,v,m,B],([s,p,h,g,u,f])=>{let b=s,C=S(),P=f??u,{lines:k,cursor:M}=ee(b,p,h,g,u,i,{paragraphSpacing:P}),R=S()-C,F=Math.max(0,b.length-M.segmentIndex),A=x.meta;return A&&(N(A["line-count"],k.length),N(A["layout-time-ns"],R),N(A["overflow-segments"],F)),k},{name:"flow-lines",meta:{"line-count":0,"layout-time-ns":0,"overflow-segments":0},equals:(s,p)=>{let h=s,g=p;if(h.length!==g.length)return!1;for(let u=0;u<h.length;u++){let f=h[u],b=g[u];if(f.x!==b.x||f.y!==b.y||f.width!==b.width||f.slotWidth!==b.slotWidth||f.text!==b.text||f.columnIndex!==b.columnIndex||f.flushToRight!==b.flushToRight)return!1}return!0}});return r.add(l,{name:"text"}),r.add(a,{name:"font"}),r.add(m,{name:"line-height"}),r.add(d,{name:"container"}),r.add(w,{name:"columns"}),r.add(v,{name:"obstacles"}),r.add(B,{name:"paragraph-spacing"}),r.add(c,{name:"segments"}),r.add(x,{name:"flow-lines"}),{graph:r,setText:s=>r.set("text",s),setFont:s=>r.set("font",s),setLineHeight:s=>r.set("line-height",s),setContainer:s=>r.set("container",s),setColumns:s=>r.set("columns",s),setObstacles:s=>r.set("obstacles",s),setParagraphSpacing:s=>r.set("paragraph-spacing",s),segments:c,flowLines:x}}export{D as a,V as b,$ as c,q as d,z as e,J as f,Y as g,K as h,_ as i,U as j,re as k,Q as l,Z as m,ee as n,se as o,ie as p};
|