@graphrefly/graphrefly 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cascading-DKIb6Pk8.d.cts → cascading-B25wxpRa.d.cts} +3 -3
- package/dist/{cascading-Bg0a4VSf.d.ts → cascading-BsJ4GbnS.d.ts} +3 -3
- package/dist/{chunk-TZLEMGAK.js → chunk-2Y3DKIZL.js} +2 -2
- package/dist/chunk-3OT7K33Q.js +1 -0
- package/dist/chunk-53XJ2S6D.js +1 -0
- package/dist/chunk-5CPPC75H.js +1 -0
- package/dist/chunk-5KPIYVCC.js +7 -0
- package/dist/{chunk-GAOX6OPT.js → chunk-5XZRCS2M.js} +1 -1
- package/dist/{chunk-C5DINHNP.js → chunk-6G5YD37E.js} +1 -1
- package/dist/{chunk-WBWBY6LI.js → chunk-6SVKZ7VI.js} +1 -1
- package/dist/chunk-A5HZZYRK.js +1 -0
- package/dist/chunk-BGEY3PXH.js +1 -0
- package/dist/chunk-CD4CB6S7.js +1 -0
- package/dist/chunk-CE72X3WO.js +1 -0
- package/dist/chunk-CUQFO6MT.js +1 -0
- package/dist/chunk-D5RFJOZ2.js +1 -0
- package/dist/{chunk-A3GDELMY.js → chunk-E5YSBQSF.js} +7 -7
- package/dist/{chunk-SFIM774L.js → chunk-EUE7ELFQ.js} +1 -1
- package/dist/chunk-F3IGTWCQ.js +1 -0
- package/dist/chunk-F672GV32.js +1 -0
- package/dist/{chunk-GCUYSIM4.js → chunk-GWOKTENT.js} +1 -1
- package/dist/{chunk-4NYSEUKV.js → chunk-J6TGRQUP.js} +1 -1
- package/dist/{chunk-4F564IPP.js → chunk-JJTF75VS.js} +1 -1
- package/dist/{chunk-BY4WKPKM.js → chunk-JUJEPZOI.js} +1 -1
- package/dist/{chunk-65WWQ5CB.js → chunk-M5UC63ZI.js} +5 -5
- package/dist/chunk-MQZWA3DF.js +1 -0
- package/dist/chunk-MYFR67PY.js +18 -0
- package/dist/{chunk-KN2UMFT6.js → chunk-PCD2MU7X.js} +1 -1
- package/dist/{chunk-YDWTVO4E.js → chunk-PIIUJIF7.js} +1 -1
- package/dist/chunk-PVUTRA5K.js +5 -0
- package/dist/chunk-Q7EUZ6NN.js +1 -0
- package/dist/chunk-RLMYS3XZ.js +1 -0
- package/dist/chunk-RRFOCAH6.js +1 -0
- package/dist/{chunk-Q46YJCQH.js → chunk-T6RPUERH.js} +1 -1
- package/dist/{chunk-IPNJDNE7.js → chunk-T7GWBGOO.js} +1 -1
- package/dist/{chunk-U2T2XWDA.js → chunk-U347KVM4.js} +1 -1
- package/dist/chunk-UAMWD4GG.js +1 -0
- package/dist/chunk-VN6RDSK2.js +1 -0
- package/dist/{chunk-CJMFZXIZ.js → chunk-W2ZU226Q.js} +1 -1
- package/dist/{chunk-UF746BQ4.js → chunk-XINLP35X.js} +1 -1
- package/dist/{chunk-TONEKQM3.js → chunk-XMDNNSMK.js} +1 -1
- package/dist/{chunk-INXDSJRC.js → chunk-YOUAVGHJ.js} +1 -1
- package/dist/chunk-YV2A2VWG.js +1 -0
- package/dist/{chunk-PBN426RU.js → chunk-ZGVA2SR5.js} +1 -1
- package/dist/compat/index.cjs +10 -10
- package/dist/compat/index.d.cts +17 -14
- package/dist/compat/index.d.ts +17 -14
- package/dist/compat/index.js +1 -1
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nestjs/index.cjs +12 -12
- package/dist/compat/nestjs/index.d.cts +9 -6
- package/dist/compat/nestjs/index.d.ts +9 -6
- package/dist/compat/nestjs/index.js +1 -1
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/zustand/index.cjs +7 -7
- package/dist/compat/zustand/index.d.cts +5 -4
- package/dist/compat/zustand/index.d.ts +5 -4
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-BPDU_XV1.d.ts → composite-CT_mApQD.d.ts} +2 -2
- package/dist/{composite-CmvdhTJe.d.cts → composite-_XckYx2e.d.cts} +2 -2
- package/dist/{content-addressed-storage-DqIWCmZG.d.cts → content-addressed-storage-4-ST1tYk.d.cts} +5 -5
- package/dist/{content-addressed-storage-BUiREIuj.d.ts → content-addressed-storage-DuYMjV7o.d.ts} +5 -5
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/extra/browser.cjs +1 -1
- package/dist/extra/browser.d.cts +4 -3
- package/dist/extra/browser.d.ts +4 -3
- package/dist/extra/browser.js +1 -1
- package/dist/extra/index.cjs +19 -19
- package/dist/extra/index.d.cts +13 -12
- package/dist/extra/index.d.ts +13 -12
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +2 -3
- package/dist/extra/node.d.cts +3 -3
- package/dist/extra/node.d.ts +3 -3
- package/dist/extra/node.js +2 -2
- package/dist/extra/operators.cjs +1 -1
- package/dist/extra/operators.d.cts +1 -1
- package/dist/extra/operators.d.ts +1 -1
- package/dist/extra/operators.js +1 -1
- package/dist/extra/reactive.cjs +1 -1
- package/dist/extra/reactive.d.cts +4 -3
- package/dist/extra/reactive.d.ts +4 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.d.cts +57 -2
- package/dist/extra/sources.d.ts +57 -2
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-browser.cjs +1 -1
- package/dist/extra/storage-browser.d.cts +8 -42
- package/dist/extra/storage-browser.d.ts +8 -42
- package/dist/extra/storage-browser.js +1 -1
- package/dist/extra/storage-core.cjs +1 -1
- package/dist/extra/storage-core.d.cts +13 -83
- package/dist/extra/storage-core.d.ts +13 -83
- package/dist/extra/storage-core.js +1 -1
- package/dist/extra/storage-node.cjs +1 -2
- package/dist/extra/storage-node.d.cts +1 -59
- package/dist/extra/storage-node.d.ts +1 -59
- package/dist/extra/storage-node.js +0 -1
- package/dist/extra/storage-tiers-browser.cjs +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +49 -0
- package/dist/extra/storage-tiers-browser.d.ts +49 -0
- package/dist/extra/storage-tiers-browser.js +1 -0
- package/dist/extra/storage-tiers-node.cjs +1 -0
- package/dist/extra/storage-tiers-node.d.cts +86 -0
- package/dist/extra/storage-tiers-node.d.ts +86 -0
- package/dist/extra/storage-tiers-node.js +1 -0
- package/dist/extra/storage-tiers.cjs +1 -0
- package/dist/extra/storage-tiers.d.cts +284 -0
- package/dist/extra/storage-tiers.d.ts +284 -0
- package/dist/extra/storage-tiers.js +1 -0
- package/dist/{fallback-mYSd8vQo.d.ts → fallback-DuEXfA4F.d.ts} +14 -14
- package/dist/{fallback-9YznPvPP.d.cts → fallback-axI2cXwt.d.cts} +14 -14
- package/dist/graph/index.cjs +3 -3
- package/dist/graph/index.d.cts +6 -5
- package/dist/graph/index.d.ts +6 -5
- package/dist/graph/index.js +1 -1
- package/dist/{graph-BROUZPG9.d.ts → graph-Cv-8x0ZI.d.ts} +28 -16
- package/dist/{graph-DaoydJ_u.d.cts → graph-kTltt95s.d.cts} +28 -16
- package/dist/imperative-audit-ahAE65a9.d.cts +28 -0
- package/dist/imperative-audit-ahAE65a9.d.ts +28 -0
- package/dist/{index-CI5fULSz.d.ts → index-8OxXae3g.d.ts} +1 -1
- package/dist/{index-CQ1gt4rn.d.cts → index-9xhIaM-w.d.cts} +1 -1
- package/dist/{index-DhWrMTI6.d.cts → index-B3D_z0Z6.d.cts} +1 -1
- package/dist/{index-Ccv_61jG.d.cts → index-B3Dfl5sS.d.cts} +110 -27
- package/dist/{index-Dia4yc2y.d.ts → index-B4s70vYf.d.ts} +4 -4
- package/dist/{index-Db21wuaD.d.ts → index-B5UR87KG.d.ts} +3 -3
- package/dist/{index-DuvQAU02.d.ts → index-BBdwz2BW.d.ts} +2 -2
- package/dist/{index-B5eS17Bz.d.ts → index-BEvsFlfH.d.ts} +47 -32
- package/dist/{index-BUtCR0k6.d.ts → index-BF-ssbJB.d.ts} +7 -7
- package/dist/{index-ClKm7CFB.d.cts → index-BFuVcqL8.d.cts} +1 -1
- package/dist/{index-BkfL5MXh.d.cts → index-BWH17rK_.d.cts} +3 -3
- package/dist/{index-CD7qmvSf.d.ts → index-BZ1V5GzX.d.ts} +3 -3
- package/dist/{index-BDEhWLF4.d.cts → index-BhkPzu-Z.d.cts} +4 -4
- package/dist/{index-CNxdDb2e.d.ts → index-Bilohojo.d.ts} +3 -3
- package/dist/{index-zA1uVtk0.d.ts → index-BiomL7AW.d.ts} +1 -1
- package/dist/{index-BWiX5foT.d.ts → index-BjWZARLy.d.ts} +1 -1
- package/dist/{index-IxinNgAH.d.cts → index-BkbawFkI.d.cts} +16 -15
- package/dist/{index-RJX4snyi.d.cts → index-BlRVj-7Q.d.cts} +21 -21
- package/dist/index-BpFwRAf9.d.cts +26 -0
- package/dist/{index-Ds3Rz9m9.d.cts → index-BsZlbHM5.d.cts} +3 -3
- package/dist/{index-BFHpNSsV.d.ts → index-BtY2QVDf.d.cts} +8 -7
- package/dist/{index-BsxqmV6u.d.ts → index-BuMzxRO2.d.ts} +2 -2
- package/dist/{index-C5uMGVJw.d.ts → index-BwYGLgmI.d.ts} +4 -4
- package/dist/{index-3L3RC3VJ.d.ts → index-C40wA8zt.d.ts} +7 -7
- package/dist/{index-Bi4ZP6Hc.d.ts → index-C9xF16gc.d.ts} +110 -27
- package/dist/index-CAIhFfws.d.ts +171 -0
- package/dist/{index-BRisOxlx.d.ts → index-CDvC1m5p.d.ts} +1 -1
- package/dist/index-CGKs5ixV.d.cts +287 -0
- package/dist/{index-ygRFoyrN.d.ts → index-CI_yjtua.d.ts} +2 -2
- package/dist/{index-DxEcY7Om.d.ts → index-CIcu6fIR.d.ts} +1 -1
- package/dist/{index-CQtnGFrZ.d.cts → index-CfOSES72.d.cts} +7 -7
- package/dist/{index-Bd2AjMQY.d.ts → index-Cot94_82.d.ts} +21 -21
- package/dist/{index-B1hFhK1K.d.cts → index-CpZKtdMw.d.cts} +1 -1
- package/dist/{index-BO6t0HjV.d.cts → index-CqSJ25A9.d.cts} +1 -1
- package/dist/{index-Jgl7ev9I.d.cts → index-CzC0G0C3.d.cts} +9 -9
- package/dist/{index-p0bkNfby.d.cts → index-D6JRP-1_.d.cts} +3 -3
- package/dist/{index-D23g00HE.d.cts → index-D7r_vd0b.d.cts} +4 -4
- package/dist/{index-Cp91Sxbo.d.cts → index-D8IyqHvT.d.cts} +3 -3
- package/dist/{index-iKsmdnq6.d.cts → index-D9qoEOj_.d.cts} +2 -2
- package/dist/index-DBmBtqAN.d.ts +461 -0
- package/dist/{index-nP13Qe6T.d.ts → index-DFe2Pk2u.d.ts} +1 -1
- package/dist/{index-Cn3taOmp.d.cts → index-DKp1CIbG.d.cts} +2 -2
- package/dist/{index-CoR-tOZA.d.cts → index-DSD6xnbT.d.ts} +8 -7
- package/dist/{index-DheNs40A.d.ts → index-DXSLMoma.d.ts} +2 -2
- package/dist/{index-ZIQaKIdY.d.cts → index-DXZsXxtU.d.cts} +47 -32
- package/dist/{index-BVTjuKeP.d.cts → index-D_QQ_dTD.d.cts} +1 -1
- package/dist/{index-ChZvMC4M.d.cts → index-DeyzuqAi.d.cts} +7 -7
- package/dist/{index-Chi9IiHJ.d.ts → index-DlccEIi3.d.ts} +3 -3
- package/dist/{index-DR3XqZlV.d.cts → index-DmtWMP0X.d.cts} +1 -1
- package/dist/{index-CbCNoogR.d.ts → index-Dp69u0ym.d.ts} +16 -15
- package/dist/{index-b4a6Sg0R.d.ts → index-DwNNufVa.d.ts} +4 -4
- package/dist/{index-D80nGRb9.d.ts → index-DzYTXMBz.d.ts} +3 -3
- package/dist/index-DzgS5uYi.d.ts +26 -0
- package/dist/{index-B-KCkW4M.d.cts → index-GaW6Welt.d.cts} +4 -4
- package/dist/{index-DupIl9wI.d.ts → index-JYtN9uqM.d.ts} +1 -1
- package/dist/{index-Ced0dphF.d.ts → index-KNAMYngu.d.ts} +9 -9
- package/dist/{index-BpjQanLs.d.cts → index-PluovH45.d.cts} +2 -2
- package/dist/index-Qq-G9B6g.d.cts +171 -0
- package/dist/{index-yJY9thRY.d.cts → index-XxSeddWP.d.cts} +2 -2
- package/dist/{index-C8_bnDBZ.d.cts → index-ZhKyR8co.d.cts} +3 -3
- package/dist/index-hXKhbfh-.d.ts +287 -0
- package/dist/index-zK_mN1D-.d.cts +461 -0
- package/dist/index.cjs +59 -59
- package/dist/index.d.cts +53 -49
- package/dist/index.d.ts +53 -49
- package/dist/index.js +1 -1
- package/dist/{meta-BdjSt8ky.d.cts → meta-BGO6C7K9.d.cts} +1 -1
- package/dist/{meta-CtDjj7cU.d.ts → meta-CC6EPdpK.d.ts} +1 -1
- package/dist/{node-8qx0kgYt.d.cts → node-fSc-hCv8.d.cts} +1 -1
- package/dist/{node-8qx0kgYt.d.ts → node-fSc-hCv8.d.ts} +1 -1
- package/dist/{observable-B6Ba-TTI.d.cts → observable-Cqty11jG.d.cts} +1 -1
- package/dist/{observable-DOniYM2B.d.ts → observable-EAV_rNfM.d.ts} +1 -1
- package/dist/patterns/ai/browser.cjs +5 -5
- package/dist/patterns/ai/browser.d.cts +4 -4
- package/dist/patterns/ai/browser.d.ts +4 -4
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +19 -19
- package/dist/patterns/ai/index.d.cts +19 -17
- package/dist/patterns/ai/index.d.ts +19 -17
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.cjs +1 -2
- package/dist/patterns/ai/node.d.cts +9 -9
- package/dist/patterns/ai/node.d.ts +9 -9
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.cjs +6 -6
- package/dist/patterns/audit/index.d.cts +7 -5
- package/dist/patterns/audit/index.d.ts +7 -5
- package/dist/patterns/audit/index.js +1 -1
- package/dist/patterns/cqrs/index.cjs +7 -7
- package/dist/patterns/cqrs/index.d.cts +7 -4
- package/dist/patterns/cqrs/index.d.ts +7 -4
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +8 -8
- package/dist/patterns/demo-shell/index.d.cts +6 -5
- package/dist/patterns/demo-shell/index.d.ts +6 -5
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +5 -5
- package/dist/patterns/domain-templates/index.d.cts +5 -4
- package/dist/patterns/domain-templates/index.d.ts +5 -4
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +20 -20
- package/dist/patterns/graphspec/index.d.cts +6 -5
- package/dist/patterns/graphspec/index.d.ts +6 -5
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +7 -7
- package/dist/patterns/guarded-execution/index.d.cts +8 -6
- package/dist/patterns/guarded-execution/index.d.ts +8 -6
- package/dist/patterns/guarded-execution/index.js +1 -1
- package/dist/patterns/harness/index.cjs +12 -12
- package/dist/patterns/harness/index.d.cts +13 -10
- package/dist/patterns/harness/index.d.ts +13 -10
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +7 -7
- package/dist/patterns/job-queue/index.d.cts +8 -4
- package/dist/patterns/job-queue/index.d.ts +8 -4
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +4 -4
- package/dist/patterns/lens/index.d.cts +7 -6
- package/dist/patterns/lens/index.d.ts +7 -6
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +1 -1
- package/dist/patterns/memory/index.d.cts +5 -4
- package/dist/patterns/memory/index.d.ts +5 -4
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +7 -7
- package/dist/patterns/messaging/index.d.cts +6 -4
- package/dist/patterns/messaging/index.d.ts +6 -4
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.cjs +7 -7
- package/dist/patterns/orchestration/index.d.cts +8 -5
- package/dist/patterns/orchestration/index.d.ts +8 -5
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/process/index.cjs +1 -0
- package/dist/patterns/process/index.d.cts +10 -0
- package/dist/patterns/process/index.d.ts +10 -0
- package/dist/patterns/process/index.js +1 -0
- package/dist/patterns/reactive-layout/index.cjs +5 -5
- package/dist/patterns/reactive-layout/index.d.cts +6 -5
- package/dist/patterns/reactive-layout/index.d.ts +6 -5
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +1 -1
- package/dist/patterns/reduction/index.d.cts +5 -4
- package/dist/patterns/reduction/index.d.ts +5 -4
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.cjs +8 -8
- package/dist/patterns/refine-loop/index.d.cts +7 -5
- package/dist/patterns/refine-loop/index.d.ts +7 -5
- package/dist/patterns/refine-loop/index.js +1 -1
- package/dist/patterns/resilient-pipeline/index.cjs +1 -1
- package/dist/patterns/resilient-pipeline/index.d.cts +7 -6
- package/dist/patterns/resilient-pipeline/index.d.ts +7 -6
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +11 -11
- package/dist/patterns/surface/index.d.cts +7 -6
- package/dist/patterns/surface/index.d.ts +7 -6
- package/dist/patterns/surface/index.js +1 -1
- package/dist/pipeline-graph-B85HUrWg.d.cts +120 -0
- package/dist/pipeline-graph-HOTU4UG0.d.ts +120 -0
- package/dist/{reactive-layout-DBJ3Vz-m.d.ts → reactive-layout-Btv0-efV.d.ts} +2 -2
- package/dist/{reactive-layout-Dk9AOQb_.d.cts → reactive-layout-D9zqqaqK.d.cts} +2 -2
- package/dist/reactive-log-ByBb8g6A.d.ts +188 -0
- package/dist/reactive-log-CgbNqksB.d.cts +188 -0
- package/dist/{reactive-map-LjwjcFaW.d.ts → reactive-map-CHyeCf4D.d.ts} +1 -1
- package/dist/{reactive-map-Cm89Hk0c.d.cts → reactive-map-DmgeADH8.d.cts} +1 -1
- package/dist/{resilience-RjDIHZNZ.d.ts → resilience-BWP2c7Af.d.cts} +27 -45
- package/dist/{resilience-N_VtLf7W.d.cts → resilience-Bys63Cpd.d.ts} +27 -45
- package/dist/resilience-OBU472D2.js +1 -0
- package/dist/{sugar-CQkn_rxB.d.ts → sugar-D13E2M_z.d.ts} +1 -1
- package/dist/{sugar-DVEYhR7a.d.cts → sugar-DgaGJcI6.d.cts} +1 -1
- package/dist/{topology-tree-BB6oJxMz.d.cts → topology-tree-C50l9ARE.d.cts} +1 -1
- package/dist/{topology-tree-CAFOG5S5.d.ts → topology-tree-CJsT24DP.d.ts} +1 -1
- package/dist/{types-Cp_4coR_.d.cts → types-BMSGPlpO.d.cts} +1 -1
- package/dist/{types-B2LfBvNc.d.ts → types-CidcBDuk.d.ts} +1 -1
- package/package.json +41 -1
- package/dist/chunk-2JO6LXFT.js +0 -7
- package/dist/chunk-2LZ6DL45.js +0 -1
- package/dist/chunk-3JXNEPCD.js +0 -2
- package/dist/chunk-3Y4BXFFR.js +0 -1
- package/dist/chunk-55T3K37W.js +0 -1
- package/dist/chunk-6HQ6HVTF.js +0 -1
- package/dist/chunk-7Q2WPFQ7.js +0 -1
- package/dist/chunk-FKRPIRE6.js +0 -1
- package/dist/chunk-HTBOCKVD.js +0 -1
- package/dist/chunk-I6VIH3VA.js +0 -1
- package/dist/chunk-IB64M7VP.js +0 -1
- package/dist/chunk-IJFSR4NU.js +0 -1
- package/dist/chunk-LOF5HSD3.js +0 -18
- package/dist/chunk-T2TB37TW.js +0 -1
- package/dist/chunk-T7EQPKOP.js +0 -1
- package/dist/chunk-Y63GWRHO.js +0 -5
- package/dist/chunk-YUBV7EEE.js +0 -1
- package/dist/index-C2Dey3L-.d.cts +0 -152
- package/dist/index-ClJUZAOr.d.cts +0 -101
- package/dist/index-Cq7Uqgu4.d.ts +0 -192
- package/dist/index-Dtpr2FIB.d.ts +0 -101
- package/dist/index-HvJ90_tX.d.ts +0 -152
- package/dist/index-wcfc7W-f.d.cts +0 -192
- package/dist/reactive-log-CWC7jO4J.d.cts +0 -190
- package/dist/reactive-log-CqaBg8nf.d.ts +0 -190
- package/dist/resilience-7UZHSSGC.js +0 -1
- /package/dist/{chunk-L3KUKDZC.js → chunk-O32GJOUJ.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Node } from './node-
|
|
1
|
+
import { a as Node } from './node-fSc-hCv8.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Backoff strategies for {@link retry} (roadmap §3.1). Delays are in **nanoseconds**.
|
|
@@ -159,64 +159,45 @@ type RetryOptions = {
|
|
|
159
159
|
/** Delay between attempts; strategies use **nanoseconds**. */
|
|
160
160
|
backoff?: BackoffStrategy | BackoffPreset;
|
|
161
161
|
};
|
|
162
|
+
/** Factory-mode-only options. `initial` seeds the outer node's cache before the first attempt. */
|
|
163
|
+
type RetryFactoryOptions<T> = RetryOptions & {
|
|
164
|
+
/** Initial cache value for the outer node before the factory runs the first time. */
|
|
165
|
+
initial?: T;
|
|
166
|
+
};
|
|
162
167
|
/**
|
|
163
|
-
*
|
|
168
|
+
* Retry operator — two modes selected by the type of `input`:
|
|
169
|
+
*
|
|
170
|
+
* **Source mode** (`input: Node<T>`): resubscribes to the same node after each terminal
|
|
171
|
+
* `ERROR`. The upstream should use `resubscribable: true` if it must emit again after `ERROR`.
|
|
164
172
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
173
|
+
* **Factory mode** (`input: () => Node<T>`): invokes the factory to build a fresh `Node<T>`
|
|
174
|
+
* on every connect / reconnect. Ideal for producers that capture per-attempt resources
|
|
175
|
+
* (sockets, clients, file handles) that become unusable after an error. Synchronous
|
|
176
|
+
* exceptions thrown by the factory are treated as terminal ERROR and run through the
|
|
177
|
+
* same retry pipeline as inner-node ERROR.
|
|
178
|
+
*
|
|
179
|
+
* @param input - Upstream node or factory that returns a fresh node per attempt.
|
|
180
|
+
* @param opts - `count` caps attempts; `backoff` supplies delay in **nanoseconds** (or a preset name); `initial` seeds the outer node cache (factory mode only).
|
|
167
181
|
* @returns Node that retries on error.
|
|
168
182
|
*
|
|
169
183
|
* @remarks
|
|
170
|
-
* **Resubscribable sources:** The upstream should use `resubscribable: true` if it must emit again after `ERROR`.
|
|
171
184
|
* **Protocol:** Forwards unknown message tuples unchanged; handles `DIRTY`, `DATA`, `RESOLVED`, `COMPLETE`, `ERROR`.
|
|
172
185
|
*
|
|
173
186
|
* @example
|
|
174
187
|
* ```ts
|
|
175
|
-
*
|
|
188
|
+
* // Source mode — resubscribe the same node:
|
|
189
|
+
* import { ERROR, NS_PER_SEC, producer, retry, constant } from "@graphrefly/graphrefly-ts";
|
|
176
190
|
*
|
|
177
191
|
* const src = producer(
|
|
178
|
-
* (a) => {
|
|
179
|
-
* a.down([[ERROR, new Error("x")]]);
|
|
180
|
-
* },
|
|
192
|
+
* (a) => { a.down([[ERROR, new Error("x")]]); },
|
|
181
193
|
* { resubscribable: true },
|
|
182
194
|
* );
|
|
183
195
|
* const out = retry(src, { count: 2, backoff: constant(0.25 * NS_PER_SEC) });
|
|
184
|
-
* ```
|
|
185
196
|
*
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
declare function retry<T>(source: Node<T>, opts?: RetryOptions): Node<T>;
|
|
189
|
-
/**
|
|
190
|
-
* Options for {@link retrySource}. Superset of {@link RetryOptions} with an
|
|
191
|
-
* optional `initial` forwarded to the outer node cache.
|
|
192
|
-
*
|
|
193
|
-
* @category extra
|
|
194
|
-
*/
|
|
195
|
-
type RetrySourceOptions<T> = RetryOptions & {
|
|
196
|
-
/** Initial cache value for the outer node (forwarded to `NodeOptions.initial`). */
|
|
197
|
-
initial?: T;
|
|
198
|
-
};
|
|
199
|
-
/**
|
|
200
|
-
* Fresh-instance variant of {@link retry}: invokes the `factory` to build a
|
|
201
|
-
* new `Node<T>` on every connect / reconnect. Unlike {@link retry}, which
|
|
202
|
-
* re-subscribes to the same node (requiring `resubscribable: true`), this
|
|
203
|
-
* creates a new source per attempt — ideal for producers that capture
|
|
204
|
-
* per-attempt resources (sockets, clients, file handles) that become unusable
|
|
205
|
-
* after an error.
|
|
206
|
-
*
|
|
207
|
-
* Synchronous exceptions thrown by `factory` are treated as terminal ERROR
|
|
208
|
-
* and run through the same retry pipeline as inner-node ERROR.
|
|
209
|
-
*
|
|
210
|
-
* @param factory - Called to build a fresh source per attempt.
|
|
211
|
-
* @param opts - `count` caps attempts; `backoff` supplies delay (ns) or preset.
|
|
212
|
-
* @returns Node that retries by rebuilding the source.
|
|
213
|
-
*
|
|
214
|
-
* @example
|
|
215
|
-
* ```ts
|
|
216
|
-
* import { NS_PER_SEC, exponential, retrySource, fromWebSocket } from "@graphrefly/graphrefly-ts";
|
|
197
|
+
* // Factory mode — fresh node per attempt (e.g. reconnecting WebSocket):
|
|
198
|
+
* import { NS_PER_SEC, exponential, retry, fromWebSocket } from "@graphrefly/graphrefly-ts";
|
|
217
199
|
*
|
|
218
|
-
*
|
|
219
|
-
* const connected$ = retrySource(
|
|
200
|
+
* const connected$ = retry(
|
|
220
201
|
* () => fromWebSocket(new WebSocket("wss://example/stream")),
|
|
221
202
|
* { count: 10, backoff: exponential({ baseNs: 1 * NS_PER_SEC }) },
|
|
222
203
|
* );
|
|
@@ -224,7 +205,8 @@ type RetrySourceOptions<T> = RetryOptions & {
|
|
|
224
205
|
*
|
|
225
206
|
* @category extra
|
|
226
207
|
*/
|
|
227
|
-
declare function
|
|
208
|
+
declare function retry<T>(input: Node<T>, opts?: RetryOptions): Node<T>;
|
|
209
|
+
declare function retry<T>(input: () => Node<T>, opts?: RetryFactoryOptions<T>): Node<T>;
|
|
228
210
|
type CircuitState = "closed" | "open" | "half-open";
|
|
229
211
|
/**
|
|
230
212
|
* Thrown when {@link withBreaker} is configured with `onOpen: "error"` and the breaker rejects work.
|
|
@@ -490,4 +472,4 @@ declare function fallback<T>(source: Node<T>, fb: FallbackInput<T>): Node<T>;
|
|
|
490
472
|
*/
|
|
491
473
|
declare function timeout<T>(source: Node<T>, timeoutNs: number): Node<T>;
|
|
492
474
|
|
|
493
|
-
export {
|
|
475
|
+
export { type BackoffPreset as B, type CircuitState as C, type ExponentialBackoffOptions as E, type FallbackInput as F, type JitterMode as J, NS_PER_MS as N, type RateLimiterOptions as R, type StatusValue as S, TimeoutError as T, type WithBreakerBundle as W, type CircuitBreakerOptions as a, type RetryOptions as b, NS_PER_SEC as c, type BackoffStrategy as d, type CircuitBreaker as e, CircuitOpenError as f, RateLimiterOverflowError as g, type RateLimiterOverflowPolicy as h, type TokenBucket as i, type WithStatusBundle as j, circuitBreaker as k, constant as l, decorrelatedJitter as m, exponential as n, fallback as o, fibonacci as p, linear as q, rateLimiter as r, resolveBackoffPreset as s, retry as t, timeout as u, tokenBucket as v, withBreaker as w, withMaxAttempts as x, withStatus as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Node } from './node-
|
|
1
|
+
import { a as Node } from './node-fSc-hCv8.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Backoff strategies for {@link retry} (roadmap §3.1). Delays are in **nanoseconds**.
|
|
@@ -159,64 +159,45 @@ type RetryOptions = {
|
|
|
159
159
|
/** Delay between attempts; strategies use **nanoseconds**. */
|
|
160
160
|
backoff?: BackoffStrategy | BackoffPreset;
|
|
161
161
|
};
|
|
162
|
+
/** Factory-mode-only options. `initial` seeds the outer node's cache before the first attempt. */
|
|
163
|
+
type RetryFactoryOptions<T> = RetryOptions & {
|
|
164
|
+
/** Initial cache value for the outer node before the factory runs the first time. */
|
|
165
|
+
initial?: T;
|
|
166
|
+
};
|
|
162
167
|
/**
|
|
163
|
-
*
|
|
168
|
+
* Retry operator — two modes selected by the type of `input`:
|
|
169
|
+
*
|
|
170
|
+
* **Source mode** (`input: Node<T>`): resubscribes to the same node after each terminal
|
|
171
|
+
* `ERROR`. The upstream should use `resubscribable: true` if it must emit again after `ERROR`.
|
|
164
172
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
173
|
+
* **Factory mode** (`input: () => Node<T>`): invokes the factory to build a fresh `Node<T>`
|
|
174
|
+
* on every connect / reconnect. Ideal for producers that capture per-attempt resources
|
|
175
|
+
* (sockets, clients, file handles) that become unusable after an error. Synchronous
|
|
176
|
+
* exceptions thrown by the factory are treated as terminal ERROR and run through the
|
|
177
|
+
* same retry pipeline as inner-node ERROR.
|
|
178
|
+
*
|
|
179
|
+
* @param input - Upstream node or factory that returns a fresh node per attempt.
|
|
180
|
+
* @param opts - `count` caps attempts; `backoff` supplies delay in **nanoseconds** (or a preset name); `initial` seeds the outer node cache (factory mode only).
|
|
167
181
|
* @returns Node that retries on error.
|
|
168
182
|
*
|
|
169
183
|
* @remarks
|
|
170
|
-
* **Resubscribable sources:** The upstream should use `resubscribable: true` if it must emit again after `ERROR`.
|
|
171
184
|
* **Protocol:** Forwards unknown message tuples unchanged; handles `DIRTY`, `DATA`, `RESOLVED`, `COMPLETE`, `ERROR`.
|
|
172
185
|
*
|
|
173
186
|
* @example
|
|
174
187
|
* ```ts
|
|
175
|
-
*
|
|
188
|
+
* // Source mode — resubscribe the same node:
|
|
189
|
+
* import { ERROR, NS_PER_SEC, producer, retry, constant } from "@graphrefly/graphrefly-ts";
|
|
176
190
|
*
|
|
177
191
|
* const src = producer(
|
|
178
|
-
* (a) => {
|
|
179
|
-
* a.down([[ERROR, new Error("x")]]);
|
|
180
|
-
* },
|
|
192
|
+
* (a) => { a.down([[ERROR, new Error("x")]]); },
|
|
181
193
|
* { resubscribable: true },
|
|
182
194
|
* );
|
|
183
195
|
* const out = retry(src, { count: 2, backoff: constant(0.25 * NS_PER_SEC) });
|
|
184
|
-
* ```
|
|
185
196
|
*
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
declare function retry<T>(source: Node<T>, opts?: RetryOptions): Node<T>;
|
|
189
|
-
/**
|
|
190
|
-
* Options for {@link retrySource}. Superset of {@link RetryOptions} with an
|
|
191
|
-
* optional `initial` forwarded to the outer node cache.
|
|
192
|
-
*
|
|
193
|
-
* @category extra
|
|
194
|
-
*/
|
|
195
|
-
type RetrySourceOptions<T> = RetryOptions & {
|
|
196
|
-
/** Initial cache value for the outer node (forwarded to `NodeOptions.initial`). */
|
|
197
|
-
initial?: T;
|
|
198
|
-
};
|
|
199
|
-
/**
|
|
200
|
-
* Fresh-instance variant of {@link retry}: invokes the `factory` to build a
|
|
201
|
-
* new `Node<T>` on every connect / reconnect. Unlike {@link retry}, which
|
|
202
|
-
* re-subscribes to the same node (requiring `resubscribable: true`), this
|
|
203
|
-
* creates a new source per attempt — ideal for producers that capture
|
|
204
|
-
* per-attempt resources (sockets, clients, file handles) that become unusable
|
|
205
|
-
* after an error.
|
|
206
|
-
*
|
|
207
|
-
* Synchronous exceptions thrown by `factory` are treated as terminal ERROR
|
|
208
|
-
* and run through the same retry pipeline as inner-node ERROR.
|
|
209
|
-
*
|
|
210
|
-
* @param factory - Called to build a fresh source per attempt.
|
|
211
|
-
* @param opts - `count` caps attempts; `backoff` supplies delay (ns) or preset.
|
|
212
|
-
* @returns Node that retries by rebuilding the source.
|
|
213
|
-
*
|
|
214
|
-
* @example
|
|
215
|
-
* ```ts
|
|
216
|
-
* import { NS_PER_SEC, exponential, retrySource, fromWebSocket } from "@graphrefly/graphrefly-ts";
|
|
197
|
+
* // Factory mode — fresh node per attempt (e.g. reconnecting WebSocket):
|
|
198
|
+
* import { NS_PER_SEC, exponential, retry, fromWebSocket } from "@graphrefly/graphrefly-ts";
|
|
217
199
|
*
|
|
218
|
-
*
|
|
219
|
-
* const connected$ = retrySource(
|
|
200
|
+
* const connected$ = retry(
|
|
220
201
|
* () => fromWebSocket(new WebSocket("wss://example/stream")),
|
|
221
202
|
* { count: 10, backoff: exponential({ baseNs: 1 * NS_PER_SEC }) },
|
|
222
203
|
* );
|
|
@@ -224,7 +205,8 @@ type RetrySourceOptions<T> = RetryOptions & {
|
|
|
224
205
|
*
|
|
225
206
|
* @category extra
|
|
226
207
|
*/
|
|
227
|
-
declare function
|
|
208
|
+
declare function retry<T>(input: Node<T>, opts?: RetryOptions): Node<T>;
|
|
209
|
+
declare function retry<T>(input: () => Node<T>, opts?: RetryFactoryOptions<T>): Node<T>;
|
|
228
210
|
type CircuitState = "closed" | "open" | "half-open";
|
|
229
211
|
/**
|
|
230
212
|
* Thrown when {@link withBreaker} is configured with `onOpen: "error"` and the breaker rejects work.
|
|
@@ -490,4 +472,4 @@ declare function fallback<T>(source: Node<T>, fb: FallbackInput<T>): Node<T>;
|
|
|
490
472
|
*/
|
|
491
473
|
declare function timeout<T>(source: Node<T>, timeoutNs: number): Node<T>;
|
|
492
474
|
|
|
493
|
-
export {
|
|
475
|
+
export { type BackoffPreset as B, type CircuitState as C, type ExponentialBackoffOptions as E, type FallbackInput as F, type JitterMode as J, NS_PER_MS as N, type RateLimiterOptions as R, type StatusValue as S, TimeoutError as T, type WithBreakerBundle as W, type CircuitBreakerOptions as a, type RetryOptions as b, NS_PER_SEC as c, type BackoffStrategy as d, type CircuitBreaker as e, CircuitOpenError as f, RateLimiterOverflowError as g, type RateLimiterOverflowPolicy as h, type TokenBucket as i, type WithStatusBundle as j, circuitBreaker as k, constant as l, decorrelatedJitter as m, exponential as n, fallback as o, fibonacci as p, linear as q, rateLimiter as r, resolveBackoffPreset as s, retry as t, timeout as u, tokenBucket as v, withBreaker as w, withMaxAttempts as x, withStatus as y };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-A5HZZYRK.js";import"./chunk-ESMPEKEV.js";import"./chunk-4VVTGLXJ.js";import"./chunk-MQZWA3DF.js";import"./chunk-LYCLF26R.js";import"./chunk-CK2E7BTU.js";import"./chunk-QYADASLV.js";export{b as CircuitOpenError,f as RateLimiterOverflowError,i as TimeoutError,c as circuitBreaker,j as fallback,g as rateLimiter,a as retry,k as timeout,e as tokenBucket,d as withBreaker,h as withStatus};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NodeOptions, F as FnCtx, a as Node, c as NodeActions, d as NodeFnCleanup } from './node-
|
|
1
|
+
import { N as NodeOptions, F as FnCtx, a as Node, c as NodeActions, d as NodeFnCleanup } from './node-fSc-hCv8.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Sugar constructors over the raw `node()` primitive.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NodeOptions, F as FnCtx, a as Node, c as NodeActions, d as NodeFnCleanup } from './node-
|
|
1
|
+
import { N as NodeOptions, F as FnCtx, a as Node, c as NodeActions, d as NodeFnCleanup } from './node-fSc-hCv8.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.35.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": {
|
|
@@ -127,6 +127,36 @@
|
|
|
127
127
|
"default": "./dist/extra/storage-browser.cjs"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
+
"./extra/storage-tiers": {
|
|
131
|
+
"import": {
|
|
132
|
+
"types": "./dist/extra/storage-tiers.d.ts",
|
|
133
|
+
"default": "./dist/extra/storage-tiers.js"
|
|
134
|
+
},
|
|
135
|
+
"require": {
|
|
136
|
+
"types": "./dist/extra/storage-tiers.d.cts",
|
|
137
|
+
"default": "./dist/extra/storage-tiers.cjs"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"./extra/storage-tiers-node": {
|
|
141
|
+
"import": {
|
|
142
|
+
"types": "./dist/extra/storage-tiers-node.d.ts",
|
|
143
|
+
"default": "./dist/extra/storage-tiers-node.js"
|
|
144
|
+
},
|
|
145
|
+
"require": {
|
|
146
|
+
"types": "./dist/extra/storage-tiers-node.d.cts",
|
|
147
|
+
"default": "./dist/extra/storage-tiers-node.cjs"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"./extra/storage-tiers-browser": {
|
|
151
|
+
"import": {
|
|
152
|
+
"types": "./dist/extra/storage-tiers-browser.d.ts",
|
|
153
|
+
"default": "./dist/extra/storage-tiers-browser.js"
|
|
154
|
+
},
|
|
155
|
+
"require": {
|
|
156
|
+
"types": "./dist/extra/storage-tiers-browser.d.cts",
|
|
157
|
+
"default": "./dist/extra/storage-tiers-browser.cjs"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
130
160
|
"./graph": {
|
|
131
161
|
"import": {
|
|
132
162
|
"types": "./dist/graph/index.d.ts",
|
|
@@ -387,6 +417,16 @@
|
|
|
387
417
|
"default": "./dist/patterns/orchestration/index.cjs"
|
|
388
418
|
}
|
|
389
419
|
},
|
|
420
|
+
"./patterns/process": {
|
|
421
|
+
"import": {
|
|
422
|
+
"types": "./dist/patterns/process/index.d.ts",
|
|
423
|
+
"default": "./dist/patterns/process/index.js"
|
|
424
|
+
},
|
|
425
|
+
"require": {
|
|
426
|
+
"types": "./dist/patterns/process/index.d.cts",
|
|
427
|
+
"default": "./dist/patterns/process/index.cjs"
|
|
428
|
+
}
|
|
429
|
+
},
|
|
390
430
|
"./patterns/reactive-layout": {
|
|
391
431
|
"import": {
|
|
392
432
|
"types": "./dist/patterns/reactive-layout/index.d.ts",
|
package/dist/chunk-2JO6LXFT.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{B as Ee}from"./chunk-T7EQPKOP.js";import{A as we,C as L,E as ne,F as Me,G as Oe,e as $e,f as Te,i as Y,k as Ne,l as xe,m as Ae,o as K,p as Pe,s as W}from"./chunk-LYCLF26R.js";import{b as Q,c as me,d as be,e as Z,f as ye,g as ve,h as z,i as ee,j as te}from"./chunk-CK2E7BTU.js";function Ie(e,t,r,n={}){let o=t in e.nodes,s=r in e.nodes;if(!o)return se(t,r,"no-such-from");if(!s)return se(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=lt(e,t,n);if(u!=null)return u}let l=oe(t,e.nodes[t],0,n);return ie(t,r,[l])}if(i===0)return se(t,r,"no-path");let a=je(e,t,r,i);return a.found?ie(t,r,Be(e,a.pathOrder,n)):se(t,r,a.truncated?"max-depth-exceeded":"no-path")}function je(e,t,r,n){let o=new Map,s=[{path:r,depth:0}],i=new Set([r]),a=0,l=!1;for(;a<s.length;){let h=s[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 b=f[g];if(!b)continue;let v=c.get(b);v==null&&(v=[],c.set(b,v)),v.push(g)}for(let[g,b]of c)i.has(g)||(i.add(g),o.set(g,{from:h.path,depIndices:b}),s.push({path:g,depth:h.depth+1}))}if(!o.has(t))return{found:!1,pathOrder:[],truncated:l};let u=[{path:t}],d=t;for(;d!==r;){let h=o.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 lt(e,t,r){let n=e.nodes[t];if(n==null)return null;let o=n.deps??[],s=[];for(let a=0;a<o.length;a++)o[a]===t&&s.push(a);if(s.length>0){let a=oe(t,n,0,r);a.dep_index=s[0];let l=oe(t,n,1,r);return ie(t,t,[a,l])}let i=null;for(let a=0;a<o.length;a++){let l=o[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,o)=>{let s=e.nodes[n.path],i=oe(n.path,s,o,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 oe(e,t,r,n){let o={path:e,type:t.type,hop:r};t.status!==void 0&&(o.status=t.status),"value"in t&&(o.value=t.value),t.v!=null&&(o.v=t.v);let s=n.annotations?.get(e)??t.annotation;s!=null&&(o.annotation=s);let i=n.lastMutations?.get(e)??t.lastMutation;return i!=null&&(o.lastMutation=i),o}function ie(e,t,r){return Fe(e,t,!0,"ok",r)}function se(e,t,r){return Fe(e,t,!1,r,[])}function Fe(e,t,r,n,o){let s=ct(e,t,r,n,o);return{from:e,to:t,found:r,reason:n,steps:o,text:s,toJSON(){return{from:e,to:t,found:r,reason:n,steps:o}}}}function ct(e,t,r,n,o){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 s=[`Causal path: ${e} \u2192 ${t} (${o.length} step(s))`];for(let i of o){let l=` ${i.hop===0?"\xB7":"\u2193"} ${i.path} (${i.type}${i.status?`/${i.status}`:""})`;if(s.push(l),"value"in i&&s.push(` value: ${dt(i.value)}`),i.annotation!=null&&s.push(` annotation: ${i.annotation}`),i.lastMutation!=null){let u=i.lastMutation.actor;s.push(` actor: ${u.type}${u.id?`:${u.id}`:""}`)}}return s.join(`
|
|
2
|
-
`)}function dt(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},ft=Symbol.for("sizeof");function He(e){let t=new WeakSet,r=new WeakSet,n=[e],o=0;for(;n.length>0;){let s=n.pop();o+=pt(s,t,r,n)}return o}function pt(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+ht(e);case"symbol":return A.symbol;case"function":return t.has(e)?0:(t.add(e),A.function);case"undefined":return 0}let s=e;if(t.has(s))return 0;t.add(s);let i=s[ft];if(typeof i=="function")try{let u=i.call(s);if(typeof u=="number"&&Number.isFinite(u))return u}catch{}if(s instanceof Date)return A.date;if(s instanceof RegExp)return A.regexp+s.source.length*2;if(s instanceof Error){let u=s.message?s.message.length*2:0,d=s.stack?s.stack.length*2:0;return A.error+u+d}if(typeof URL<"u"&&s instanceof URL)return A.url+s.href.length*2;if(typeof Promise<"u"&&s instanceof Promise)return A.promise;if(s instanceof WeakMap)return A.weakmap;if(s instanceof WeakSet)return A.weakset;if(s instanceof Map){let u=A.map;for(let[d,h]of s)u+=A.mapEntry,n.push(d),n.push(h);return u}if(s instanceof Set){let u=A.set;for(let d of s)u+=A.setEntry,n.push(d);return u}if(Array.isArray(s)){let u=A.array+s.length*8;for(let d of s)n.push(d);return u}if(s instanceof ArrayBuffer)return r.has(s)?0:(r.add(s),s.byteLength);if(ArrayBuffer.isView(s)){let u=s;return r.has(u.buffer)?48:(r.add(u.buffer),u.buffer.byteLength+48)}let a=A.object,l=Object.keys(s);for(let u of l){a+=A.string+u.length*2;try{n.push(s[u])}catch{}}return a}function ht(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"}),o=[],s=e._collectObserveTargets;typeof s=="function"&&s.call(e,"",o);let i=new Map;for(let[p,f]of o)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,b=g?He(g.cache):0,v=g?g._sinkCount:0,w=f.deps?.length??0,m=f.type==="effect"&&v===0,y=v===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:b,subscriberCount:v,depCount:w,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 o of e){let s=Re(o.codePointAt(0));if(r+s>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+=o,r+=s}return n}var gt={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"},mt={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"?mt:gt,n=e.width,o=e.height,s=Array.from({length:o},()=>Array.from({length:n},()=>" ")),i=Array.from({length:o},()=>Array.from({length:n},()=>"empty"));for(let a of e.edges)yt(s,i,r,a);for(let a of e.boxes)bt(s,i,r,a,t.labelOf(a.id));return s.map(a=>Ot(a.join(""))).join(`
|
|
3
|
-
`)}function bt(e,t,r,n,o){let{x:s,y:i,w:a,h:l}=n;if(a<2||l<2){l>0&&Ke(e,t,s,i,a,o);return}V(e,t,s,i,r.boxTL);for(let d=s+1;d<s+a-1;d+=1)V(e,t,d,i,r.boxH);V(e,t,s+a-1,i,r.boxTR);for(let d=i+1;d<i+l-1;d+=1){V(e,t,s,d,r.boxV);for(let h=s+1;h<s+a-1;h+=1)Je(e,t,h,d," ","empty");V(e,t,s+a-1,d,r.boxV)}V(e,t,s,i+l-1,r.boxBL);for(let d=s+1;d<s+a-1;d+=1)V(e,t,d,i+l-1,r.boxH);V(e,t,s+a-1,i+l-1,r.boxBR);let u=i+Math.floor(l/2);Ke(e,t,s+1,u,a-2,o)}function V(e,t,r,n,o){Je(e,t,r,n,o,o===" "?"empty":o==="\u2500"||o==="-"?"boxH":o==="\u2502"||o==="|"?"boxV":"boxCorner")}function Je(e,t,r,n,o,s){if(n<0||n>=e.length)return;let i=e[n];r<0||r>=i.length||(i[r]=o,t[n][r]=s)}function Ke(e,t,r,n,o,s){if(n<0||n>=e.length)return;let i=r,a=o;for(let l of s){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 yt(e,t,r,n){let o=n.points;if(o.length<2)return;for(let l=0;l+1<o.length;l+=1)vt(e,t,r,o[l],o[l+1]);for(let l=1;l+1<o.length;l+=1){let u=o[l-1],d=o[l],h=o[l+1],p=xt(u,d,h,r);p&&qe(e,t,d.x,d.y,p,"edgeCorner")}let s=o[o.length-1],i=o[o.length-2],a=wt(i,s,r);a&&qe(e,t,s.x,s.y,a,"arrow")}function vt(e,t,r,n,o){if(!(n.x===o.x&&n.y===o.y)){if(n.y===o.y){let s=n.y,i=Math.min(n.x,o.x),a=Math.max(n.x,o.x);for(let l=i;l<=a;l+=1)We(e,t,l,s,r,"h")}else if(n.x===o.x){let s=n.x,i=Math.min(n.y,o.y),a=Math.max(n.y,o.y);for(let l=i;l<=a;l+=1)We(e,t,s,l,r,"v")}}}function We(e,t,r,n,o,s){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]=s==="h"?o.horizontal:o.vertical,t[n][r]=s==="h"?"edgeH":"edgeV";return}if(a==="edgeH"&&s==="v"){i[r]=o.cross,t[n][r]="edgeCorner";return}if(a==="edgeV"&&s==="h"){i[r]=o.cross,t[n][r]="edgeCorner";return}}}function qe(e,t,r,n,o,s){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]=o,t[n][r]=s)}function xt(e,t,r,n){let o=e.y===t.y,s=t.y===r.y;if(o===s)return;if(o){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 wt(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 Ot(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=Et(e);_t(t),St(t),Rt(t),Dt(t,e);let r=kt(t,e),{width:n,height:o}=Tt(t),s=[];for(let i of t.layers)for(let a of i)a.isVirtual||s.push({id:a.id,layer:a.layer,order:a.order,x:a.x,y:a.y,w:a.w,h:a.h});return{boxes:s,edges:r,width:n,height:o}}function Et(e){let t=new Map;for(let o of e.nodes)t.set(o,{id:o,isVirtual:!1,layer:-1,order:0,x:0,y:0,w:e.widthCells(o),h:e.heightCells(o),in:[],out:[]});let r=[],n=0;for(let o of e.edges){if(o.from===o.to)continue;let s=t.get(o.from),i=t.get(o.to);if(!s||!i)continue;let a={chainId:n++,chainFrom:o.from,chainTo:o.to,fromId:o.from,toId:o.to,hopIndex:0,chainLen:1};s.out.push(a),i.in.push(a),r.push(a)}return{nodes:t,layers:[],hops:r}}function _t(e){let t=new Map;for(let s of e.nodes.values())t.set(s.id,s.in.length);let r=[];for(let s of e.nodes.values())(t.get(s.id)??0)===0&&(s.layer=0,r.push(s));let n=new Set,o=0;for(;o<r.length;){let s=r[o++];if(!n.has(s.id)){n.add(s.id);for(let i of s.out){let a=e.nodes.get(i.toId);a.layer=Math.max(a.layer,s.layer+1);let l=(t.get(a.id)??0)-1;t.set(a.id,l),l<=0&&r.push(a)}}}for(let s of e.nodes.values())s.layer<0&&(s.layer=0)}function St(e){let t=Math.max(0,...Array.from(e.nodes.values(),s=>s.layer)),r=Array.from({length:t+1},()=>[]);for(let s of e.nodes.values())r[s.layer].push(s);let n=[],o=0;for(let s of e.hops){let i=e.nodes.get(s.fromId),a=e.nodes.get(s.toId),l=a.layer-i.layer;if(l<=0){i.out=i.out.filter(h=>h!==s),a.in=a.in.filter(h=>h!==s);continue}if(l===1){s.hopIndex=0,s.chainLen=1,n.push(s);continue}i.out=i.out.filter(h=>h!==s),a.in=a.in.filter(h=>h!==s);let u=i;for(let h=1;h<l;h+=1){let p=`__virt_${o++}__`,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:s.chainId,chainFrom:s.chainFrom,chainTo:s.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:s.chainId,chainFrom:s.chainFrom,chainTo:s.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 s of r)for(let i=0;i<s.length;i+=1)s[i].order=i;e.layers=r,e.hops=n}function Rt(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 o=1;o<e.layers.length;o+=1){let s=e.layers[o];for(let i=0;i+1<s.length;i+=1){let a=Xe(e,s[i],s[i+1],"in");[s[i],s[i+1]]=[s[i+1],s[i]],ue(s),Xe(e,s[i],s[i+1],"in")<a?n=!0:([s[i],s[i+1]]=[s[i+1],s[i]],ue(s))}}if(!n)break}}function Ye(e,t,r){let n=new Map;for(let o of t){let s=r==="in"?o.in:o.out;if(s.length===0){n.set(o.id,o.order);continue}let i=0,a=0;for(let l of s){let u=e.nodes.get(r==="in"?l.fromId:l.toId);u&&(i+=u.order,a+=1)}n.set(o.id,a===0?o.order:i/a)}t.sort((o,s)=>{let i=n.get(o.id),a=n.get(s.id);return i!==a?i-a:o.order-s.order})}function ue(e){for(let t=0;t<e.length;t+=1)e[t].order=t}function Xe(e,t,r,n){let o=n==="in"?t.in:t.out,s=n==="in"?r.in:r.out,i=0;for(let a of o)for(let l of s){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"?Gt(e,t):Ct(e,t)}function Gt(e,t){let r=[],n=0;for(let o=0;o<e.layers.length;o+=1){r.push(n);let s=0;for(let i of e.layers[o])s=Math.max(s,i.w);n+=s+t.layerGap}for(let o=0;o<e.layers.length;o+=1)for(let s of e.layers[o])s.x=r[o];for(let o of e.layers){let s=0;for(let i of o)i.y=s,s+=i.h+t.nodeGap}Ze(e,t,"y")}function Ct(e,t){let r=[],n=0;for(let o=0;o<e.layers.length;o+=1){r.push(n);let s=0;for(let i of e.layers[o])s=Math.max(s,i.h);n+=s+t.layerGap}for(let o=0;o<e.layers.length;o+=1)for(let s of e.layers[o])s.y=r[o];for(let o of e.layers){let s=0;for(let i of o)i.x=s,s+=i.w+t.nodeGap}Ze(e,t,"x")}function Ze(e,t,r){let n=s=>r==="y"?s.h:s.w,o=t.nodeGap;for(let s=0;s<2;s+=1){let i=s===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=s===0?d.in:d.out;if(h.length===0)continue;let p=[];for(let c of h){let g=e.nodes.get(s===0?c.fromId:c.toId);if(!g)continue;let b=r==="y"?g.y:g.x;p.push(b+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)+o}}}}function kt(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",o=u=>n?u.x:u.y,s=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,o(_)+s(_));let f=Number.POSITIVE_INFINITY;for(let _ of h)f=Math.min(f,o(_));let c=Number.isFinite(f)?f-1:p,g=Math.max(1,c-p+1),b=[];for(let _ of d)for(let R of _.out)b.push(R);b.sort((_,R)=>{let k=i(e.nodes.get(_.fromId)),$=i(e.nodes.get(R.fromId));if(k!==$)return k-$;let G=i(e.nodes.get(_.toId)),D=i(e.nodes.get(R.toId));return G-D});let v=[],w=new Map;for(let _ of b){let R=i(e.nodes.get(_.fromId)),k=i(e.nodes.get(_.toId)),$=Math.min(R,k),G=Math.max(R,k),D=-1;for(let P=0;P<v.length;P+=1){let F=v[P],H=!0;for(let U of F)if(U.lo<=G&&$<=U.hi){H=!1;break}if(H){F.push({lo:$,hi:G}),D=P;break}}D<0&&(v.push([{lo:$,hi:G}]),D=v.length-1),w.set(_,D)}let m=v.length,y=g>=Math.max(3,m+2),S=y?p+1:p,x=y?c-1:c,O=Math.max(1,x-S+1);for(let _ of b){let R=w.get(_),k;if(m<=1)k=S+Math.floor(O/2);else{let $=(O-1)/(m-1);k=S+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),b=a.get(f),v=c.isVirtual?o(c):o(c)+s(c),w=g.isVirtual?o(g):o(g)-1,m=i(c),y=i(g);p===0&&le(d,n,v,m),m!==y&&(le(d,n,b,m),le(d,n,b,y)),le(d,n,w,y)}let h=u[0];l.push({from:h.chainFrom,to:h.chainTo,points:$t(d)})}return l}function le(e,t,r,n){e.push(t?{x:r,y:n}:{x:n,y:r})}function $t(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 o of n)t=Math.max(t,o.x+o.w),r=Math.max(r,o.y+o.h);return{width:t,height:r}}var Nt=24,At=4,Pt=1,Mt=3;function et(e,t){let r=Lt(t.direction),n=Math.max(3,t.maxLabelWidth??Nt),o=t.asciiCharset??"unicode",s=Object.keys(e.nodes).sort(),i=new Set(s),a=e.edges.filter(f=>i.has(f.from)&&i.has(f.to)),l=new Map,u=new Map;for(let f of s){let c=ze(f,n);l.set(f,c),u.set(f,ae(c)+4)}let d=Qe({nodes:s,edges:a,widthCells:f=>u.get(f)??3,heightCells:()=>Mt,layerGap:At,nodeGap:Pt,direction:r}),h=Ue(d,{charset:o,labelOf:f=>l.get(f)??f}),p=t.logger;return p&&p(h),h}function Lt(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 N="::",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 o=e.values().next();if(o.done)return;let s=o.value;e.delete(s);try{s()}catch(i){console.error(`[Graph "${t}".destroy] disposer threw:`,i)}}}function It(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 jt(e,t){let r=new WeakMap,n=(o,s)=>{if(Object.is(o,s))return!0;if(o==null||s==null||typeof o!="object"||typeof s!="object")return!1;let i=r.get(o);if(i==null&&(i=new WeakSet,r.set(o,i)),i.has(s))return!0;i.add(s);let a=o.constructor,l=s.constructor;if(a!==l)return!1;if(o instanceof Date)return o.getTime()===s.getTime();if(o instanceof RegExp)return o.source===s.source&&o.flags===s.flags;if(Array.isArray(o)){let p=s;if(o.length!==p.length)return!1;for(let f=0;f<o.length;f++)if(!n(o[f],p[f]))return!1;return!0}if(o instanceof Map){let p=s;if(o.size!==p.size)return!1;for(let[f,c]of o)if(!p.has(f)||!n(c,p.get(f)))return!1;return!0}if(o instanceof Set){let p=s;if(o.size!==p.size)return!1;for(let f of o){let c=!1;for(let g of p)if(n(f,g)){c=!0;break}if(!c)return!1}return!0}if(ArrayBuffer.isView(o)){let p=o,f=s;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(o),d=Object.keys(s);if(u.length!==d.length)return!1;let h=new Set(d);for(let p of u)if(!h.has(p)||!n(o[p],s[p]))return!1;return!0};return n(e,t)}function Ge(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Ge);let t=e,r=Object.keys(t).sort(),n={};for(let o of r)n[o]=Ge(t[o]);return n}function Bt(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Ft(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Ht(e){return e==="TD"?"down":e==="BT"?"up":e==="RL"?"left":"right"}function ot(e){let t=new Set,r=[];function n(o,s){let i=`${o}\0${s}`;t.has(i)||(t.add(i),r.push([o,s]))}for(let[o,s]of Object.entries(e.nodes)){let i=s.deps;if(i)for(let a of i)n(a,o)}for(let o of e.edges)n(o.from,o.to);return r}function it(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 Vt(e,t){let r=t.includeEdges??!0,n=t.includeSubgraphs??!0,{expand:o,...s}=e,i={...s,edges:r?e.edges:[],subgraphs:n?e.subgraphs:[]},a=JSON.stringify(Ge(i),null,t.indent??2);return t.logger?.(a),a}function zt(e,t){let r=t.includeEdges??!0,n=t.includeSubgraphs??!0,o=[];o.push(`Graph ${e.name}`),o.push("Nodes:");for(let i of Object.keys(e.nodes).sort()){let a=e.nodes[i];o.push(`- ${i} (${a.type}/${a.status}): ${de(a.value)}`)}if(r){o.push("Edges:");for(let i of e.edges)o.push(`- ${i.from} -> ${i.to}`)}if(n){o.push("Subgraphs:");for(let i of e.subgraphs)o.push(`- ${i}`)}let s=o.join(`
|
|
5
|
-
`);return t.logger?.(s),s}function at(e,t){let r=it(t.direction),n=Object.keys(e.nodes).sort(),o=new Map;for(let i=0;i<n.length;i+=1)o.set(n[i],`n${i}`);let s=[`flowchart ${r}`];for(let i of n){let a=o.get(i);s.push(` ${a}["${Bt(i)}"]`)}for(let[i,a]of ot(e)){let l=o.get(i),u=o.get(a);!l||!u||s.push(` ${l} --> ${u}`)}return s.join(`
|
|
6
|
-
`)}function Kt(e,t){let r=at(e,t);return Wt(r)}function Wt(e,t){let r=t?.theme??"default",n=t?.autoSync??!0,s=JSON.stringify({code:e,mermaid:{theme:r},autoSync:n}),i=new TextEncoder().encode(s),a="";for(let u=0;u<i.length;u++)a+=String.fromCharCode(i[u]);return`https://mermaid.live/edit#base64:${globalThis.btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`}function qt(e,t){let r=it(t.direction),n=Object.keys(e.nodes).sort(),o=new Map;for(let i=0;i<n.length;i+=1)o.set(n[i],`n${i}`);let s=[`direction: ${Ht(r)}`];for(let i of n){let a=o.get(i);s.push(`${a}: "${Ft(i)}"`)}for(let[i,a]of ot(e)){let l=o.get(i),u=o.get(a);!l||!u||s.push(`${l} -> ${u}`)}return s.join(`
|
|
7
|
-
`)}function Ut(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 o=e.indexOf("]",r+1);if(o<=r+1){t+="\\[";continue}let s=e.slice(r+1,o);s.startsWith("!")&&(s=`^${s.slice(1)}`),s=s.replace(/\\/g,"\\\\"),t+=`[${s}]`,r=o;continue}t+=Ut(n)}return t+="$",new RegExp(t)}var Jt={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"},Yt={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 Xt(e){return e==="none"?Yt:e==="ansi"||e==null?Jt:{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 Qt(e,t,r){for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o<32||o===127)throw new Error(`Graph "${t}": ${r} "${e}" must not contain control character (U+${o.toString(16).padStart(4,"0").toUpperCase()} at index ${n})`)}}function De(e,t,r){if(e==="")throw new Error(`Graph "${t}": ${r} name must be non-empty`);if(e.includes(N))throw new Error(`Graph "${t}": ${r} "${e}" must not contain '${N}' (path separator)`);if(e===B)throw new Error(`Graph "${t}": ${r} name "${B}" is reserved for meta companion paths`);Qt(e,t,r)}function Zt(e,t){if(e==="")throw new Error(`Graph "${t}": resolve path must be non-empty`);let r=e.split(N);for(let n of r)if(n==="")throw new Error(`Graph "${t}": resolve path has empty segment`);return r}function en(e,t){let r=!1;for(let o of e)if(!t.isMetaPassthrough(o[0])){r=!0;break}return r?e.filter(o=>t.isMetaPassthrough(o[0])):e}function ut(e){for(let t of e._mounts.values())ut(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(N))throw new Error(`Graph name must not contain '${N}' (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)}add(t,r){let n=t.name,o=r?.name??n;if(o==null||o==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let s=o,i=r?.annotation;if(De(s,this.name,"add"),this._mounts.has(s))throw new Error(`Graph "${this.name}": name "${s}" is already a mount point`);if(this._nodes.has(s))throw new Error(`Graph "${this.name}": node "${s}" already exists`);let a=this._nodeToName.get(t);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(s,t),this._nodeToName.set(t,s),this._emitTopology({kind:"added",name:s,nodeKind:"node"}),i!=null&&(this._annotations.set(s,i),this.config.inspectorEnabled&&this._traceRing.push({path:s,annotation:i,timestamp_ns:K()})),t}setVersioning(t){if(t!=null)for(let r of this._nodes.values())r instanceof L&&r._applyVersioning(t)}remove(t){De(t,this.name,"remove");let r=this._mounts.get(t);if(r){let s={kind:"mount",nodes:[],mounts:[]},i=[];r._collectObserveTargets("",i);for(let[a,l]of i)a.includes(`${N}${B}${N}`)||s.nodes.push(a);return s.nodes.sort(),s.mounts.push(t),s.mounts.push(...r._collectSubgraphs(`${t}${N}`)),this._mounts.delete(t),r._parent=void 0,ut(r),this._emitTopology({kind:"removed",name:t,nodeKind:"mount",audit:s}),s}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 o={kind:"node",nodes:[t],mounts:[]};return this._emitTopology({kind:"removed",name:t,nodeKind:"node",audit:o}),o}removeAll(t){let r=typeof t=="function"?t:(()=>{let s=ce(t);return i=>s.test(i)})(),n={kind:"mount",nodes:[],mounts:[]},o=[...this._nodes.keys(),...this._mounts.keys()].filter(s=>r(s));for(let s of o){let i=this.remove(s);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 o=t[n++];return{value:[o,r.get(o)],done:!1}}}}node(t){if(t==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(t.includes(N))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 o=n?.internal===!0;this.node(t).down([[Q,r]],{actor:n?.actor,internal:o,delivery:"write"})}setAll(t,r){let n=Symbol.iterator in t?t:Object.entries(t);Ae(()=>{for(let[o,s]of n)this.set(o,s,r)})}invalidate(t,r){let n=r?.internal===!0;this.node(t).down([[Z]],{actor:r?.actor,internal:n,delivery:"write"})}error(t,r,n){let o=n?.internal===!0;this.node(t).down([[te,r]],{actor:n?.actor,internal:o,delivery:"write"})}complete(t,r){let n=r?.internal===!0;this.node(t).down([[ee]],{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 o=[];this._collectObserveTargets("",o);let s=new Map;for(let[a,l]of o)s.set(l,a);let i=[];for(let[a,l]of o)if(l instanceof L)for(let u of l._deps){let d=s.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(De(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(r===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(r._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${r._parent.name}"`);for(let n=this;n!=null;n=n._parent)if(n===r)throw new Error(`Graph "${this.name}": mount("${t}", \u2026) would create a mount cycle`);return this._mounts.set(t,r),r._parent=this,this._emitTopology({kind:"added",name:t,nodeKind:"mount"}),r}resolve(t){let r=Zt(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],o=r.slice(1);if(o.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 s=this._nodes.get(n);if(s&&o.length>0&&o[0]===B)return this._resolveMetaChainFromNode(s,o,r.join(N));let i=this._mounts.get(n);if(!i)throw this._nodes.has(n)?new Error(`Graph "${this.name}": "${n}" is a node; trailing path "${o.join(N)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${n}"`);return i.resolve(o.join(N))}_resolveMetaChainFromNode(t,r,n){let o=t,s=0,i=[...r];for(;s<i.length;){if(i[s]!==B)throw new Error(`Graph "${this.name}": expected ${B} segment in meta path "${n}"`);if(s+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${B} in "${n}"`);let a=i[s+1],l=o.meta[a];if(!l)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${n}"`);o=l,s+=2}return o}signal(t,r){if(r?.internal!==!0){for(let o of t)if(this.config.messageTier(o[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let n=[];if(this._signalDeliver(t,r??{},new Set,n),n.length>0)throw n[0]}_signalDeliver(t,r,n,o){for(let l of this._mounts.values())l._signalDeliver(t,r,n,o);let i=r.internal===!0?{internal:!0}:{actor:r.actor,delivery:"signal"},a=en(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;o.push(d)}a.length!==0&&this._signalMetaSubtree(u,a,n,i,o)}}}_signalMetaSubtree(t,r,n,o,s){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,o)}catch(l){if(l instanceof W)throw l;s.push(l)}this._signalMetaSubtree(a,r,n,o,s)}}}describe(t){if(t?.reactive===!0)return this._describeReactive(t);let r=t?.actor,n=t?.filter,o=re(t?.detail,t?.fields),s=t?.format==="spec",i=s?re("minimal"):o,a=[];this._collectObserveTargets("",a);let l=new Map;for(let[x,O]of a)l.set(O,x);let u=[];{let x=a.map(([,R])=>R),O=new Set(l.values()),_=0;for(;x.length>0;){let R=x.shift();if(R instanceof L)for(let k of R._deps){let $=k.node;if(l.has($))continue;let G=$.name??"",D=G;if(!D||O.has(D))if(G){let P=2;for(;O.has(`${G}#${P}`);)P++;D=`${G}#${P}`}else for(D=`__internal__/${_++}`;O.has(D);)D=`__internal__/${_++}`;l.set($,D),O.add(D),u.push([D,$]),x.push($)}}}let d=[...a,...u],h={};for(let[x,O]of d){if(r!=null&&!O.allowsObserve(r))continue;let _=_e(O,i),R=O instanceof L?O._deps.map(D=>l.get(D.node)??D.node.name??""):[],{name:k,...$}=_,G={...$,deps:R};if(!s){let D=this._annotations.get(x);D!=null&&(G.annotation=D)}if(n!=null)if(typeof n=="function"){let D=n;if(!(D.length>=2?D(x,G):D(G)))continue}else{let D=!0;for(let[P,F]of Object.entries(n)){let H=P==="deps_includes"?"depsIncludes":P==="meta_has"?"metaHas":P;if(H==="depsIncludes"){if(!G.deps.includes(String(F))){D=!1;break}continue}if(H==="metaHas"){if(!Object.hasOwn(G.meta??{},String(F))){D=!1;break}continue}if(G[H]!==F){D=!1;break}}if(!D)continue}h[x]=G}let p=new Set(Object.keys(h)),f=[];for(let[x,O]of d)if(O instanceof L)for(let _ of O._deps){let R=l.get(_.node);R!=null&&f.push([R,x])}f.sort((x,O)=>x[0]<O[0]?-1:x[0]>O[0]?1:x[1]<O[1]?-1:x[1]>O[1]?1:0);let c=f.map(([x,O])=>({from:x,to:O}));(r!=null||n!=null)&&(c=c.filter(x=>p.has(x.from)&&p.has(x.to)));let g=this._collectSubgraphs(""),b=r!=null||n!=null?g.filter(x=>{let O=`${x}${N}`;return[...p].some(_=>_===x||_.startsWith(O))}):g,v=this,w=t,m={name:this.name,nodes:h,edges:c,subgraphs:b,expand(x){let O={...w,format:void 0};return Array.isArray(x)?(O.fields=x,O.detail=void 0):(O.detail=x,O.fields=void 0),v.describe(O)}},y=t??{},S=y.format;return S==="json"?Vt(m,y):S==="pretty"?zt(m,y):S==="mermaid"?at(m,y):S==="mermaid-url"?Kt(m,y):S==="d2"?qt(m,y):S==="ascii"?et(m,y):m}_collectSubgraphs(t){let r=[];for(let n of[...this._mounts.keys()].sort()){let o=t===""?n:`${t}${n}`;r.push(o),r.push(...this._mounts.get(n)._collectSubgraphs(`${o}${N}`))}return r}resourceProfile(t){return Ve(this,t)}reachable(t,r,n={}){return n.withDetail===!0?st(this.describe(),t,r,{...n,withDetail:!0}):st(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 o=this.describe({detail:"full"}),s=new Map(this._annotations),i=new Map;for(let[a,l]of Object.entries(o.nodes))l.lastMutation!=null&&i.set(a,l.lastMutation);return Ie(o,t,r,{...n?.maxDepth!=null?{maxDepth:n.maxDepth}:{},...n?.findCycle===!0?{findCycle:!0}:{},annotations:s,lastMutations:i})}_describeReactive(t){let r={...t,reactive:!1},n=t.reactiveName??"describe",o=0,s=ne(o,{name:`${n}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=()=>{a||l||(a=!0,xe(()=>{a=!1,!l&&(o+=1,s.emit(o))}))},d=i.onEvent(b=>{let v=b.type;v!=="data"&&v!=="error"&&v!=="complete"&&v!=="teardown"||u()}),h=[],p=new WeakSet,f=b=>{if(p.has(b)||l)return;p.add(b);let v=b.topology.subscribe(w=>{for(let m of w){if(m[0]!==Q)continue;let y=m[1];if(u(),y.kind==="added"&&y.nodeKind==="mount"){let S=b._mounts.get(y.name);S!=null&&f(S)}}});h.push(v);for(let w of b._mounts.keys()){let m=b._mounts.get(w);m!=null&&f(m)}};f(this);let c;try{c=Oe([s],()=>this.describe(r),{name:n,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(b,v)=>b===v})}catch(b){d();for(let v of h)v();throw i.dispose(),b}let g=Ee(c);return{node:c,dispose(){l=!0,d();for(let b of h)b();h.length=0,i.dispose(),g()}}}_explainReactive(t,r,n){let o=0,s=ne(o,{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&&(o+=1,s.emit(o))}))}),d={...n?.maxDepth!=null?{maxDepth:n.maxDepth}:{},...n?.findCycle===!0?{findCycle:!0}:{}},h;try{h=Oe([s],()=>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&&nn(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(([o])=>o).filter(o=>r.test(o))}_collectObserveTargets(t,r){for(let n of[...this._mounts.keys()].sort()){let o=t===""?n:`${t}${N}${n}`;this._mounts.get(n)._collectObserveTargets(o,r)}for(let n of[...this._nodes.keys()].sort()){let o=this._nodes.get(n),s=t===""?n:`${t}${N}${n}`;r.push([s,o]),this._appendMetaObserveTargets(s,o,r)}}_appendMetaObserveTargets(t,r,n){for(let o of Object.keys(r.meta).sort()){let s=r.meta[o],i=`${t}${N}${B}${N}${o}`;n.push([i,s]),this._appendMetaObserveTargets(i,s,n)}}observe(t,r){let n=typeof t=="string",s=rt(n?r:t),i=s.structured===!0||s.timeline===!0||s.causal===!0||s.derived===!0||s.detail==="minimal"||s.detail==="full"||s.format!=null,a=s.actor;if(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]],s,"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,s,"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 o=n==="one"?t[0]?.[0]:void 0,s=i=>{if(n==="one"&&o!=null){let d=this.resolve(o);return this._buildStructuredObserver([[o,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,s)}_createObserveResult(t,r,n){let o=r.timeline===!0,s=r.causal===!0,i=r.derived===!0,a=r.detail==="minimal",l=this.config.inspectorEnabled,u=(s||i)&&l,d=r.maxEvents,h=d!=null&&d>0?new Se(d):null,p=[],f=new Set,c={},g=new Set,b=0,v=0,w=0,m=0,y=0,S=0,x=!1,O=!1,_=0,R=new Map,k=new Map,$=new Map,G=E=>{h?h.push(E):p.push(E);for(let T of f)T(E)},D=()=>o?{timestamp_ns:K(),in_batch:Ne(),batch_id:_}:{},P=(E,T)=>{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&&G({type:"derived",path:T,dep_values:J,dep_batches:j,...D()})}})},F=E=>{let T=R.get(E),I=k.get(E);if(!s||I==null)return{};let j=(T!=null&&T>=0&&E instanceof L?E._deps[T]:void 0)?.node,C=j?.v,M=$.get(E);return{trigger_dep_index:T,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,T]of t){let I=P(T,E);I&&H.push(I),U.push(T.subscribe(J=>{_++;for(let j of J){let C=j[0],M=D();if(C===Q){c[E]=j[1];let ge=T instanceof L?T.lastMutation?.actor??Y:Y;G({type:"data",path:E,data:j[1],actor:ge,...M,...F(T)})}else if(a)C===me?b++:C===be?v++:C===Z?w++:C===ye?m++:C===ve?y++:C===z?S++:C===ee&&!g.has(E)?x=!0:C===te&&(O=!0,g.add(E));else if(C===me)b++,G({type:"dirty",path:E,...M});else if(C===be)v++,G({type:"resolved",path:E,...M,...F(T)});else if(C===Z)w++,G({type:"invalidate",path:E,...M});else if(C===ye)m++,G({type:"pause",path:E,lockId:j[1],...M});else if(C===ve)y++,G({type:"resume",path:E,lockId:j[1],...M});else if(C===ee)g.has(E)||(x=!0),G({type:"complete",path:E,...M});else if(C===te){O=!0,g.add(E);let ge=T instanceof L?T.lastMutation?.actor??Y:Y;G({type:"error",path:E,data:j[1],actor:ge,...M})}else C===z&&(S++,G({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 X)E({value:void 0,done:!0});X.length=0}},he=[],X=[];f.add(E=>{let T=X.shift();T?T({value:E,done:!1}):he.push(E)});let ke={get values(){return c},get dirtyCount(){return b},get resolvedCount(){return v},get invalidateCount(){return w},get pauseCount(){return m},get resumeCount(){return y},get teardownCount(){return S},get events(){return h?h.toArray():[...p]},get anyCompletedCleanly(){return x},get anyErrored(){return O},get completedWithoutErrors(){return x&&!O},onEvent(E){return f.add(E),()=>f.delete(E)},dispose:pe,expand(E){pe();let T={...r};return typeof E=="string"?T.detail=E:Object.assign(T,E),n(rt(T))},[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=>X.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 o=r.logger??(c=>console.log(c)),s=r.includeTypes?new Set(r.includeTypes):null,i=r.excludeTypes?new Set(r.excludeTypes):null,a=s==null&&i==null?()=>!0:c=>(s==null||s.has(c))&&(i==null||!i.has(c)),l=Xt(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 O=(K()-u)/1e9,_=d(c.path).padEnd(9);if(c.type==="data"){let R=p(c);return`[${O.toFixed(3)}s] ${_} \u2190${R?` ${R}`:""}`}if(c.type==="error"){let R=p(c);return`[${O.toFixed(3)}s] ${_} \u2717${R?` ${R}`:""}`}return c.type==="complete"?`[${O.toFixed(3)}s] ${_} \u25A0 complete`:`[${O.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]??"",b=c.path?`${l.path}${c.path}${l.reset} `:"",v=c.type==="data"||c.type==="error",w=c.type==="pause"||c.type==="resume",m=v?` ${de(c.data)}`:w?` ${de(c.lockId)}`:"",y=c.type==="data"||c.type==="resolved"||c.type==="derived"?c:void 0,S=y?.trigger_dep_name!=null?` <- ${y.trigger_dep_name}`:y?.trigger_dep_index!=null?` <- #${y.trigger_dep_index}`:"",x=c.in_batch?" [batch]":"";return`${b}${g}${c.type.toUpperCase()}${l.reset}${m}${S}${x}`};t.onEvent(c=>{a(c.type)&&o(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"}),o={};for(let a of Object.keys(n.nodes).sort()){let{lastMutation:l,guard:u,...d}=n.nodes[a];o[a]=d}let s=[...n.subgraphs].sort(),i={...n,version:1,nodes:o,subgraphs:s};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:o,codecVersion:s,payload:i}=Te(t,n);return o.decode(i,s)}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(s=>ce(s)),o=r?.includeProducers===!0;for(let s of Object.keys(t.nodes).sort()){if(n!==null&&!n.some(a=>a.test(s)))continue;let i=t.nodes[s];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&r?.onError?.(s,new Error(`restore: slice.value is undefined for "${s}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!o)){if(i.v!=null){let l=this.tryResolve(s)?.v;if(l!=null&&l.id===i.v.id&&l.version===i.v.version)continue}try{this.set(s,i.value)}catch(a){r?.onError?.(s,a)}}}}}static fromSnapshot(t,r){nt(t);let n=typeof r=="function"?r:r?.build,o=typeof r=="function"?void 0:r?.factories,s=new e(t.name);if(n)return n(s),s.restore(t),s;for(let f of[...t.subgraphs].sort((c,g)=>{let b=c.split(N).length,v=g.split(N).length;return b!==v?b-v:c<g?-1:c>g?1:0})){let c=f.split(N),g=s;for(let b of c)g._mounts.has(b)||g.mount(b,new e(b)),g=g._mounts.get(b)}let i=o?Object.entries(o).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(N),g=c.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${f}"`);let b=s;for(let v of c){let w=b._mounts.get(v);if(!w)throw new Error(`unknown mount "${v}" in path "${f}"`);b=w}return[b,g]},u=Object.entries(t.nodes).filter(([f])=>!f.includes(`${N}${B}${N}`)).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(S=>h.has(S)))continue;let[b,v]=l(f),w={...c?.meta??{}},m=a(f),y;if(c?.type==="state")y=ne(c.value,{meta:w});else{if(m==null)continue;y=m(v,{path:f,type:c.type,value:c.value,meta:w,deps:g,resolvedDeps:g.map(S=>h.get(S))})}b.add(y,{name:v}),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 s.restore(t),s}toJSON(){return this.snapshot()}attachStorage(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 o=(u,d)=>{if(u.disposed)return;let h=It(d.nodes);if(u.lastSnapshot!=null&&h!==""&&h===u.lastFingerprint)return;let p=u.seq+1,f=Pe(),b=u.lastSnapshot==null||p%u.compactEvery===0?{mode:"full",snapshot:d,seq:p,timestamp_ns:f,format_version:q}:{mode:"diff",diff:tn(u.lastSnapshot,d),seq:p,timestamp_ns:f,format_version:q};if(u.tier.filter&&!u.tier.filter(this.name,b))return;let v;try{v=u.tier.save(this.name,b)}catch(w){r.onError?.(w,u.tier);return}if(v&&typeof v.then=="function"){let y=(u.savePending??Promise.resolve()).then(()=>v,()=>v).then(()=>{u.disposed||(u.seq=p,u.lastSnapshot=d,u.lastFingerprint=h)},S=>{r.onError?.(S,u.tier)});u.savePending=y.finally(()=>{u.savePending===y&&(u.savePending=void 0)})}else u.seq=p,u.lastSnapshot=d,u.lastFingerprint=h},s=(u,d)=>{try{o(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?s(c,f()):(c.timer==null&&(c.timer=new Le),c.timer.start(c.debounceMs,()=>{c.disposed||s(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 o;try{o=await n.load(this.name)}catch(i){r?.(i,n);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let s=o;try{if(s.mode==="full"&&s.snapshot!=null)return this.restore(s.snapshot),!0;if(s.version===q&&s.nodes!=null)return this.restore(s),!0}catch(i){r?.(i,n)}}return!1}static async fromStorage(t,r,n){for(let o of r){let s;try{s=await o.load(t)}catch(l){n?.onError?.(l,o);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let i=s,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===q&&i.nodes!=null?i:void 0;if(a!=null)try{return e.fromSnapshot(a,n)}catch(l){n?.onError?.(l,o)}}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 o={path:t,annotation:r,timestamp_ns:K(),...n?.actor!=null?{actor:n.actor}:{}};this._traceRing.push(o)}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(o=>!t(o)),n=this._traceRing.size-r.length;this._traceRing.clear();for(let o of r)this._traceRing.push(o);return n}static diff(t,r){let n=new Set(Object.keys(t.nodes)),o=new Set(Object.keys(r.nodes)),s=[...o].filter(w=>!n.has(w)).sort(),i=[...n].filter(w=>!o.has(w)).sort(),a=[],l=[];for(let w of n){if(!o.has(w))continue;let m=t.nodes[w],y=r.nodes[w],S=m.v,x=y.v;S!=null&&x!=null&&S.id===x.id&&S.version!==x.version&&l.push({path:w,id:S.id,from:S.version,to:x.version});let O=S!=null&&x!=null&&S.id===x.id&&S.version===x.version;for(let _ of["type","status","sentinel"]){let R=m[_],k=y[_];R!==k&&a.push({path:w,field:_,from:R,to:k})}if(!O)for(let _ of["value","meta"]){let R=m[_],k=y[_];jt(R,k)||a.push({path:w,field:_,from:R,to:k})}}let u=w=>`${w.from} ${w.to}`,d=new Set(t.edges.map(u)),h=new Set(r.edges.map(u)),p=r.edges.filter(w=>!d.has(u(w))),f=t.edges.filter(w=>!h.has(u(w))),c=new Set(t.subgraphs),g=new Set(r.subgraphs),b=[...g].filter(w=>!c.has(w)).sort(),v=[...c].filter(w=>!g.has(w)).sort();return{nodesAdded:s,nodesRemoved:i,nodesChanged:a,versionChanges:l,edgesAdded:p,edgesRemoved:f,subgraphsAdded:b,subgraphsRemoved:v}}};function tn(e,t){let r=Ce.diff(e,t),n={};for(let o of r.nodesAdded){let s=t.nodes[o];s!=null&&(n[o]=s)}return{...r,nodesAddedFull:n}}function st(e,t,r,n={}){let o={paths:[],depths:new Map,truncated:!1};if(!t)return n.withDetail?o:[];if(!n.both&&r!=="upstream"&&r!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let s=n.maxDepth;if(s!=null&&(!Number.isInteger(s)||s<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(s===0)return n.withDetail?o:[];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 S=y.deps??[];i.set(m,S);for(let x of S)x&&(d.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(m))}for(let m of e.edges){if(m==null||typeof m!="object")continue;let y=typeof m.from=="string"?m.from:"",S=typeof m.to=="string"?m.to:"";!y||!S||(d.add(y),d.add(S),u.has(y)||u.set(y,new Set),u.get(y).add(S),l.has(S)||l.set(S,new Set),l.get(S).add(y))}if(!d.has(t))return n.withDetail?o:[];let h=n.both===!0,p=m=>{if(h){let O=i.get(m)??[],_=l.get(m),R=a.get(m),k=u.get(m),$=[...O];return _&&$.push(..._),R&&$.push(...R),k&&$.push(...k),$}if(r==="upstream"){let O=i.get(m)??[],_=l.get(m);return _?[...O,..._]:O}let y=a.get(m),S=u.get(m),x=y?[...y]:[];return S&&x.push(...S),x},f=new Set([t]),c=new Map,g=[{path:t,depth:0}],b=0,v=!1;for(;b<g.length;){let m=g[b++];if(s!=null&&m.depth>=s){p(m.path).length>0&&(v=!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 w=[...c.keys()].sort((m,y)=>m<y?-1:m>y?1:0);return n.withDetail?{paths:w,depths:c,truncated:v}:w}function nn(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=e[r],o=t[r];if(n.path!==o.path||n.type!==o.type||n.status!==o.status||n.hop!==o.hop||n.dep_index!==o.dep_index||n.annotation!==o.annotation||n.value!==o.value||n.lastMutation!==o.lastMutation)return!1;let s=n.v,i=o.v;if(s!==i&&(s==null||i==null||s.id!==i.id||s.version!==i.version))return!1}return!0}export{ae as a,Ie as b,A as c,ft as d,He as e,Ve as f,B as g,q as h,Wt as i,Ce as j,tn as k,st as l};
|
package/dist/chunk-2LZ6DL45.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as j,c as K,d as V,e as $}from"./chunk-7Q2WPFQ7.js";import{a as R}from"./chunk-ESMPEKEV.js";import{c as S}from"./chunk-I6VIH3VA.js";import{n as D}from"./chunk-4F564IPP.js";import{m as w,w as T}from"./chunk-T7EQPKOP.js";import{G as N,o as b,p as L}from"./chunk-LYCLF26R.js";import{j as O}from"./chunk-CK2E7BTU.js";function v(){let e=new Error("aborted");return e.name="AbortError",e}function W(e,r){return e<=0?Promise.resolve():r?.aborted?Promise.reject(v()):new Promise((t,a)=>{let p=new R,u,y=()=>{p.cancel(),r&&u&&r.removeEventListener("abort",u)};p.start(e,()=>{y(),t()}),r&&(u=()=>{y(),a(v())},r.addEventListener("abort",u,{once:!0}))})}function U(e={}){let r=e.provider??"dry-run",t=e.model??"dry-run-v1",a=e.latencyMs??0,p=Math.max(1,e.streamChunkSize??16),u=e.respond??(d=>{let o=[...d].reverse().find(n=>n.role==="user");return o?`echo: ${o.content}`:"dry-run: no user message"}),y=e.usage??((d,o)=>{let n=d.reduce((s,l)=>s+l.content.length,0);return{input:{regular:Math.ceil(n/4)},output:{regular:Math.ceil(o.length/4)}}});return{provider:r,model:t,async invoke(d,o){if(await W(a,o?.signal),o?.signal?.aborted)throw v();let n=u(d,o),s=y(d,n);return{content:n,usage:s,finishReason:"stop",model:o?.model??t,provider:r,tier:o?.tier,metadata:{dryRun:!0}}},async*stream(d,o){let n=u(d,o),s=y(d,n),l=Math.ceil(n.length/p)||1,i=a>0?a/l:0;for(let c=0;c<n.length;c+=p){if(o?.signal?.aborted)throw v();await W(i,o?.signal),yield{type:"token",delta:n.slice(c,c+p)}}yield{type:"usage",usage:s},yield{type:"finish",reason:"stop"}}}}function _(e){let{storage:r,mode:t="read-write",keyFn:a,keyPrefix:p="llm-replay"}=e,y=V({storage:r,keyPrefix:p,mode:t==="read-strict"?"read":t,keyContext:({messages:o,opts:n})=>{let{signal:s,keyContext:l,...i}=n??{};return{messages:o,opts:i}}});async function d(o,n){if(a){if(a.length<=1){let l={messages:o,opts:n,context:n?.keyContext},i=await a(l);return`${p}:${i}`}let s=await a(o,n);return`${p}:${s}`}return y.keyFor({messages:o,opts:n})}return{keyFor:d,async lookup(o,n){if(t!=="write"){if(a){let s=await d(o,n),l=await r.load(s);return l??void 0}return y.lookup({messages:o,opts:n})}},async store(o,n,s){if(t!=="read"){if(a){let l=await d(o,n);await r.save(l,s);return}await y.store({messages:o,opts:n},s)}},async forget(o,n){if(!(t==="read"||t==="write")&&r.clear){if(a){let s=await d(o,n);await r.clear(s);return}await y.forget({messages:o,opts:n})}}}}function z(e,r,t){return{provider:t?.provider??e.provider,model:t?.model??e.model,capabilities:t?.capabilities??e.capabilities?.bind(e),invoke:r.invoke,stream:r.stream}}function ce(e,r){let{onResp:t,onError:a,name:p}=r;if(e!=null&&typeof e.then=="function"){let n=e;return a?n.then(t).catch(s=>{throw a(s),s}):n.then(t)}if(e!=null&&typeof e=="object"&&"content"in e)return t(e);let u=w(e);if(a){let n=!1;u.subscribe(s=>{for(let l of s){if(n)return;l[0]===O&&(n=!0,a(l[1]))}})}let y,d=!1,o=D(u,n=>{y=t(n),d=!0});return N([o],([n])=>n==null?null:d?y:t(n),{name:p??"adapt/invokeTap"})}function pe(e){let r=e.endNs??b();return{timestamp:r,wallClock:e.startWallClockNs??L(),provider:e.provider,model:e.model,tier:e.tier,usage:e.usage,latencyMs:Math.max(0,(r-e.startNs)/1e6),method:e.method,...e.error?{error:e.error}:{}}}function ye(){return{input:{regular:0},output:{regular:0}}}var G=Symbol.for("graphrefly.adapter.middlewareLayers");function J(e,r,t){let p=[...t?Q(t):[],r];return Object.defineProperty(e,G,{value:Object.freeze(p),enumerable:!1,writable:!1,configurable:!1}),e}function Q(e){let r=e[G];return Array.isArray(r)?r:[]}var M=class extends Error{constructor(t,a){super(`withReplayCache: no cached response for ${a} (key=${t}, mode=read-strict)`);this.key=t;this.method=a}name="ReplayCacheMissError"};function q(e,r){let t=r.mode??"read-write",a=r.cacheStreaming??!1,p=r.captureStreamCadence??!1,u=r.replaySpeed??1,y=r.keyPrefix??"llm-replay",d=t==="read"||t==="read-strict",o=_({storage:r.storage,mode:t==="write-only"?"write":t,keyFn:r.keyFn,keyPrefix:y}),n=i=>i<=0?Promise.resolve():new Promise(c=>{new R().start(i,()=>c())}),s=$(async({messages:i,invokeOpts:c})=>await T(w(e.invoke(i,c))),{keyFn:({_precomputedKey:i})=>i}),l=z(e,{async invoke(i,c){let C=await o.keyFor(i,c),f=await o.lookup(i,c);if(f?.response){let k=f.response;return{...k,metadata:{...k.metadata??{},replayCache:"hit"}}}if(t==="read-strict")throw new M(C,"invoke");let h=await s({messages:i,invokeOpts:c,_precomputedKey:C});return d||await o.store(i,c,{response:h,storedAtNs:L()}),h},async*stream(i,c){if(!a){for await(let m of e.stream(i,c))yield m;return}let C=await o.keyFor(i,c),f=await o.lookup(i,c);if(f){let m=f.response;if(f.streamChunks&&f.streamCadenceMs)for(let g=0;g<f.streamChunks.length;g++){let A=f.streamCadenceMs[g]??0,E=u>0?A/u:0;E>0&&await n(E),yield{type:"token",delta:f.streamChunks[g]?.delta??""}}else m.content&&(yield{type:"token",delta:m.content});m.usage&&(yield{type:"usage",usage:m.usage}),yield{type:"finish",reason:m.finishReason??"stop"};return}if(t==="read-strict")throw new M(C,"stream");let h="",k,P,F=[],I=[],x;for await(let m of e.stream(i,c)){if(m.type==="token"&&(h+=m.delta,p)){let g=b(),A=x===void 0?0:(g-x)/1e6;I.push(A),x=g,F.push({delta:m.delta})}m.type==="usage"&&(k=m.usage),m.type==="finish"&&(P=m.reason),yield m}if((h||k)&&!d){let g={response:{content:h,usage:k??{input:{regular:0},output:{regular:0}},finishReason:P,model:e.model??c?.model??"",provider:e.provider},storedAtNs:L(),...p?{streamChunks:F,streamCadenceMs:I}:{}};await o.store(i,c,g)}}});return J(l,"withReplayCache",e),l}var B=K;var Ae=M;function H(e,r){return{content:"[fallback: no cached response available for this request]",usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:r,provider:e,metadata:{degraded:!0,reason:"no-fixture"}}}function Y(e,r,t){return typeof e=="string"?{content:e,usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:t,provider:r,metadata:{degraded:!0,reason:"respond"}}:e}async function X(e,r){if("key"in e)return e.key;let t=B({messages:e.messages,opts:e.invokeOpts??{}}),a=await j(t);return`${r}:${a}`}function Z(e){let r={response:e.response,storedAtNs:L()};if("key"in e&&e.stream){let t=e.stream.chunks.filter(a=>a.type==="token");return{...r,streamChunks:t.map(a=>({delta:a.delta})),streamCadenceMs:e.stream.delaysMs??t.map(()=>0)}}return r}function ee(e,r){let t=[];if(e.fixtures!=null&&t.push("fixtures"),e.fixturesStorage!=null&&t.push("fixturesStorage"),t.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\` and \`fixturesStorage\` are mutually exclusive; got both ${t.join(" and ")}. Pick one source. For filesystem directories use the node subpath's \`fallbackAdapter\`.`);if(e.fixtures){let a=S(),p=e.fixtures,u=(async()=>{for(let y of p){let d=await X(y,r);await a.save(d,Z(y))}})();return u.catch(()=>{}),{tier:a,seedReady:u}}return e.fixturesStorage?{tier:e.fixturesStorage,seedReady:Promise.resolve()}:{tier:void 0,seedReady:Promise.resolve()}}function Se(e={}){let r=e.provider??"fallback",t=e.model??"fallback",a=e.onMiss??"respond",p=e.keyPrefix??"fallback",u=e.record?e.record.adapter:a==="throw"?U({provider:r,model:t,respond:()=>"[unreachable: read-strict mode throws on miss]"}):{provider:r,model:t,async invoke(s,l){let i=e.respond?e.respond(s,l):H(r,t);return Y(i,r,t)},async*stream(s,l){let i=e.respond?e.respond(s,l):H(r,t),c=Y(i,r,t);yield{type:"token",delta:c.content},c.usage&&(yield{type:"usage",usage:c.usage}),yield{type:"finish",reason:c.finishReason??"stop"}}},y,d=Promise.resolve();if(e.record){if(!e.record.storage)throw new TypeError("fallbackAdapter: `record.storage` is required in record mode. For filesystem `record.dir` convenience, use the node subpath's `fallbackAdapter`.");y=e.record.storage}else{let s=ee(e,p);y=s.tier??S(),d=s.seedReady}let o=e.record?"read-write":a==="throw"?"read-strict":"read",n=q(u,{storage:y,mode:o,keyPrefix:p,cacheStreaming:!0,captureStreamCadence:!0,replaySpeed:e.replaySpeed,...e.keyFn?{keyFn:e.keyFn}:{}});return{provider:r,model:t,capabilities:n.capabilities?.bind(n),async invoke(s,l){return await d,n.invoke(s,l)},async*stream(s,l){await d;for await(let i of n.stream(s,l))yield i}}}export{U as a,z as b,ce as c,pe as d,ye as e,J as f,M as g,q as h,B as i,Ae as j,Se as k};
|
package/dist/chunk-3JXNEPCD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as f}from"./chunk-I6VIH3VA.js";import{randomBytes as g}from"crypto";import{mkdirSync as y,readdirSync as S,readFileSync as m,renameSync as T,unlinkSync as h,writeFileSync as k}from"fs";import{basename as w,dirname as N,join as d}from"path";import{DatabaseSync as R}from"sqlite";function F(u){let s=new TextEncoder,i=new TextDecoder("utf-8",{fatal:!0}),n=e=>{let t="";for(let r of e){if(r.length===1&&/[a-zA-Z0-9_-]/.test(r)){t+=r;continue}for(let a of s.encode(r))t+=`%${a.toString(16).padStart(2,"0")}`}return d(u,`${t}.json`)},p=e=>{if(!e.endsWith(".json"))return null;let t=e.slice(0,-5),r=[],a=l=>{for(let o=0;o<l.length;o++)r.push(l.charCodeAt(o))},c=0;for(;c<t.length;){let l=t[c];if(l==="%"&&c+2<t.length){let o=t.slice(c+1,c+3);if(/^[0-9a-f]{2}$/i.test(o)){r.push(Number.parseInt(o,16)),c+=3;continue}}a(l),c+=1}try{return i.decode(new Uint8Array(r))}catch{return null}};return{save(e,t){y(u,{recursive:!0});let r=n(e),a=`${f(t)}
|
|
2
|
-
`,c=w(r),l=N(r),o=d(l,`.${c}.${g(8).toString("hex")}.tmp`);try{k(o,a,"utf8"),T(o,r)}catch(E){try{h(o)}catch{}throw E}},load(e){try{let t=m(n(e),"utf8").trim();return t?JSON.parse(t):null}catch{return null}},clear(e){try{h(n(e))}catch(t){if(t.code!=="ENOENT")throw t}},list(){try{let e=S(u),t=[];for(let r of e){if(r.startsWith("."))continue;let a=p(r);a!==null&&t.push(a)}return t.sort()}catch(e){if(e.code==="ENOENT")return[];throw e}}}}function L(u){let s=new R(u);return s.exec("CREATE TABLE IF NOT EXISTS graphrefly_checkpoint (k TEXT PRIMARY KEY, v TEXT NOT NULL)"),{save(i,n){let p=f(n);s.prepare("INSERT OR REPLACE INTO graphrefly_checkpoint (k, v) VALUES (?, ?)").run(i,p)},load(i){let n=s.prepare("SELECT v FROM graphrefly_checkpoint WHERE k = ?").get(i);return n===void 0||typeof n.v!="string"||n.v.trim()===""?null:JSON.parse(n.v)},clear(i){s.prepare("DELETE FROM graphrefly_checkpoint WHERE k = ?").run(i)},list(){return s.prepare("SELECT k FROM graphrefly_checkpoint ORDER BY k").all().map(n=>n.k)},close(){try{s.close()}catch{}}}}export{F as a,L as b};
|
package/dist/chunk-3Y4BXFFR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as I}from"./chunk-L3KUKDZC.js";import{g as q,j as P}from"./chunk-2JO6LXFT.js";import{D as R,E as j,G as E,m as C}from"./chunk-LYCLF26R.js";import{b as _,d as D,i as A,j as M}from"./chunk-CK2E7BTU.js";import{b as W}from"./chunk-QYADASLV.js";var ne={};W(ne,{approval:()=>z,branch:()=>V,gate:()=>J,join:()=>Q,loop:()=>X,onFailure:()=>ee,pipeline:()=>$,sensor:()=>Z,subPipeline:()=>Y,task:()=>U});function v(e,n){if(typeof n=="string")return{node:e.resolve(n),path:n};let o=L(e,n);if(!o)throw new Error("orchestration dep node must already be registered in the graph so explicit edges can be recorded; pass a string path or register the node first");return{node:n,path:o}}function L(e,n){let o=e.describe(),r=`::${q}::`;for(let t of Object.keys(o.nodes).sort())if(!t.includes(r))try{if(e.resolve(t)===n)return t}catch{}}function N(e,n,o,r){e.add(o,{name:n})}function y(e,n){return I("orchestration",e,n)}function H(e){let n=r=>{let t=r.trim();return t.length===0?0:Number(t)},o;return typeof e=="string"?o=n(e):e===null?o=0:o=Number(e),Number.isFinite(o)?Math.max(0,Math.trunc(o)):1}function $(e,n){return new P(e,n)}function U(e,n,o,r){let i=(r?.deps??[]).map(a=>v(e,a)),{deps:s,...p}=r??{},h=(a,u,c)=>{let m=a.map((T,b)=>T!=null&&T.length>0?T.at(-1):c.prevData[b]);u.emit(o(m,c))},d=R(i.map(a=>a.node),h,{...p,name:n,describeKind:"derived",meta:y("task",r?.meta)});return N(e,n,d,i.flatMap(a=>a.path?[a.path]:[])),d}function V(e,n,o,r,t){let i=v(e,o),s=E([i.node],([p])=>({branch:r(p)?"then":"else",value:p}),{...t,name:n,meta:y("branch",t?.meta)});return N(e,n,s,i.path?[i.path]:[]),s}function z(e,n,o,r,t){let i=v(e,o),s=v(e,r),p=t?.isApproved??(d=>!!d),h=R([i.node,s.node],(d,a,u)=>{let c=d[0],m=d[1],T=m!=null&&m.length>0?m.at(-1):u.prevData[1];if(T===void 0||!p(T)){a.down([[D]]);return}if(c==null||c.length===0){m!=null&&m.length>0&&u.prevData[0]!==void 0?a.emit(u.prevData[0]):a.down([[D]]);return}for(let b of c)a.emit(b)},{...t,name:n,describeKind:"derived",meta:y("approval",t?.meta)});return N(e,n,h,[i.path,s.path].filter(d=>typeof d=="string")),h}function J(e,n,o,r){let t=r?.maxPending??1/0;if(t<1&&t!==1/0)throw new RangeError("gate: maxPending must be >= 1");let i=r?.startOpen??!1;typeof o!="string"&&!L(e,o)&&e.add(o,{name:`${n}/source`});let s=v(e,o),p=j([],{name:"pending",equals:()=>!1}),h=j(i,{name:"isOpen"}),d=E([p],([f])=>f.length,{name:"count"}),a=j(null,{name:"lastRejected",equals:()=>!1}),u=[],c=!1,m=i,T=h.subscribe(f=>{for(let l of f)l[0]===_&&(m=l[1])});function b(){p.emit([...u])}function K(f){u.push(f),u.length>t&&u.shift(),b()}function G(f){let l=u.splice(0,f);return b(),l}function O(f){if(c)throw new Error(`gate: ${f}() called after gate was torn down`)}let S=R([s.node],(f,l,k)=>{let g=k.terminalDeps[0];if(g!==void 0){c=!0,u=[],b(),l.down(g===!0?[[A]]:[[M,g]]);return}let w=f[0];if(w==null||w.length===0){l.down([[D]]);return}for(let F of w)m?l.emit(F):(K(F),l.down([[D]]))},{name:n,describeKind:"derived",meta:y("gate",r?.meta)}),B={node:S,pending:p,count:d,isOpen:h,lastRejected:a,approve(f=1){O("approve");let l=G(f);for(let k of l){if(c)break;S.emit(k)}},reject(f=1){O("reject"),C(()=>{let l=[...u],k=Math.min(f,l.length);for(let g=0;g<k;g++)a.emit(l[g]);G(f)})},modify(f,l=1){O("modify");let k=[...u],g=G(l);for(let w=0;w<g.length&&!c;w++)S.emit(f(g[w],w,k))},open(){O("open"),C(()=>{h.emit(!0);let f=G(u.length);for(let l of f){if(c)break;S.emit(l)}})},close(){O("close"),h.emit(!1)}};e.addDisposer(d.subscribe(()=>{})),e.addDisposer(T),N(e,n,S,s.path?[s.path]:[]);let x=new P(`${n}_state`);return x.add(p,{name:"pending"}),x.add(h,{name:"isOpen"}),x.add(d,{name:"count"}),x.add(a,{name:"lastRejected"}),e.mount(`${n}_state`,x),e.addDisposer(a.subscribe(()=>{})),B}function Q(e,n,o,r){let t=o.map(s=>v(e,s)),i=E(t.map(s=>s.node),s=>s,{...r,name:n,meta:y("join",r?.meta)});return N(e,n,i,t.flatMap(s=>s.path?[s.path]:[])),i}function X(e,n,o,r,t){let i=v(e,o),s=t?.iterations,p=typeof s=="number"||s===void 0?void 0:v(e,s),h=typeof s=="number"?s:void 0,d=R(p?[i.node,p.node]:[i.node],(a,u,c)=>{let m=a[0],T=m!=null&&m.length>0?m.at(-1):c.prevData[0],b=p?a[1]:void 0,K=h??(p?b!=null&&b.length>0?b.at(-1):c.prevData[1]:1),G=H(K);for(let O=0;O<G;O+=1)T=r(T,O,u);u.emit(T)},{...t,name:n,describeKind:"derived",meta:y("loop",t?.meta)});return N(e,n,d,[i.path,p?.path].filter(a=>typeof a=="string")),d}function Y(e,n,o,r){let t=o instanceof P?o:$(n,r);return typeof o=="function"&&o(t),e.mount(n,t),t}function Z(e,n,o,r){let t=R([],()=>{},{...r,name:n,initial:o,describeKind:"producer",meta:y("sensor",r?.meta)});return N(e,n,t,[]),{node:t,push(i){t.emit(i)},error(i){t.down([[M,i]])},complete(){t.down([[A]])}}}function ee(e,n,o,r,t){let i=v(e,o),s=!1,p=R([],(h,d)=>{let a=i.node.subscribe(u=>{for(let c of u){if(s)return;if(c[0]===M)try{d.emit(r(c[1],d))}catch(m){s=!0,d.down([[M,m]])}else d.down([c]),c[0]===A&&(s=!0)}});return()=>a()},{...t,name:n,describeKind:"derived",completeWhenDepsComplete:!1,errorWhenDepsError:!1,meta:y("onFailure",t?.meta)});return N(e,n,p,i.path?[i.path]:[]),p}export{$ as a,U as b,V as c,z as d,J as e,Q as f,X as g,Y as h,Z as i,ee as j,ne as k};
|
package/dist/chunk-55T3K37W.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f}from"./chunk-PBN426RU.js";import{a as l,d as o,e as d,h as s,i as m,k as b,l as c}from"./chunk-FKRPIRE6.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-6HQ6HVTF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q}from"./chunk-L3KUKDZC.js";import{b as v}from"./chunk-KGKJCHEK.js";import{b as T}from"./chunk-TZQPPQEQ.js";import{b as y}from"./chunk-HTBOCKVD.js";import{j as g}from"./chunk-2JO6LXFT.js";import{B as p}from"./chunk-T7EQPKOP.js";import{D as w,G as m}from"./chunk-LYCLF26R.js";import{b as x}from"./chunk-QYADASLV.js";var $={};x($,{JobFlowGraph:()=>h,JobQueueGraph:()=>u,jobFlow:()=>k,jobQueue:()=>E});var N=2147483647;function J(s,e){if(!Number.isFinite(s)||!Number.isInteger(s)||s<0)throw new Error(`${e} must be a non-negative integer`);return s}function c(s,e){return q("job_queue",s,e)}var u=class extends g{_pending;_jobs;_seq=0;pending;jobs;depth;constructor(e,t={}){super(e,t.graph),this._pending=v([],{name:"pending"}),this._jobs=T({name:"jobs"}),this.pending=this._pending.items,this.jobs=this._jobs.entries,this.add(this.pending,{name:"pending"}),this.add(this.jobs,{name:"jobs"}),this.depth=m([this.pending],([n])=>n.length,{name:"depth",describeKind:"derived",meta:c("queue_depth"),initial:0}),this.add(this.depth,{name:"depth"}),this.addDisposer(p(this.depth))}enqueue(e,t={}){let n=t.id??`${this.name}-${++this._seq}`;if(this._jobs.get(n)!==void 0)throw new Error(`jobQueue("${this.name}"): duplicate job id "${n}"`);let r={id:n,payload:e,attempts:0,metadata:Object.freeze({...t.metadata??{}}),state:"queued"};return this._jobs.set(n,r),this._pending.append(n),n}claim(e=1){let t=J(e,"job queue claim limit");if(t===0)return[];let n=[];for(;n.length<t&&this.pending.cache.length!==0;){let d=this._pending.pop(0),o=this._jobs.get(d);if(!o||o.state!=="queued")continue;let i={...o,state:"inflight",attempts:o.attempts+1};this._jobs.set(d,i),n.push(i)}return n}ack(e){let t=this._jobs.get(e);return!t||t.state!=="inflight"?!1:(this._jobs.delete(e),!0)}nack(e,t={}){let n=this._jobs.get(e);return!n||n.state!=="inflight"?!1:t.requeue??!0?(this._jobs.set(e,{...n,state:"queued"}),this._pending.append(e),!0):(this._jobs.delete(e),!0)}removeById(e){let t=this._jobs.get(e);if(!t)return!1;if(t.state==="queued"){let r=this.pending.cache.indexOf(e);r>=0&&this._pending.pop(r)}return this._jobs.delete(e),!0}},h=class extends g{_stageNames;_queues=new Map;_completed;completed;completedCount;constructor(e,t={}){super(e,t.graph);let n=(t.stages??["incoming","processing","done"]).map(o=>o.trim());if(n.length<2)throw new Error(`jobFlow("${e}"): requires at least 2 stages`);if(new Set(n).size!==n.length)throw new Error(`jobFlow("${e}"): stage names must be unique`);this._stageNames=Object.freeze([...n]);for(let o of this._stageNames){let i=E(`${e}-${o}`);this._queues.set(o,i),this.mount(o,i)}this._completed=y([],{name:"completed"}),this.completed=this._completed.entries,this.add(this.completed,{name:"completed"}),this.completedCount=m([this.completed],([o])=>o.length,{name:"completedCount",describeKind:"derived",meta:c("job_flow_completed_count"),initial:0}),this.add(this.completedCount,{name:"completedCount"}),this.addDisposer(p(this.completedCount));let d=Math.max(1,J(t.maxPerPump??N,"job flow maxPerPump"));for(let o=0;o<this._stageNames.length;o+=1){let i=this._stageNames[o],l=this.queue(i),b=o+1<this._stageNames.length?this.queue(this._stageNames[o+1]):null,_=w([l.pending],()=>{let f=0;for(;f<d;){let j=l.claim(1);if(j.length===0)break;let a=j[0];if(!a)break;b?b.enqueue(a.payload,{metadata:{...a.metadata,job_flow_from:i}}):this._completed.append(a),l.ack(a.id),f+=1}},{name:`pump_${i}`,describeKind:"effect",meta:c("job_flow_pump")});this.add(_,{name:`pump_${i}`}),this.addDisposer(p(_))}}stages(){return this._stageNames}queue(e){let t=this._queues.get(e);if(!t)throw new Error(`jobFlow("${this.name}"): unknown stage "${e}"`);return t}enqueue(e,t={}){return this.queue(this._stageNames[0]).enqueue(e,t)}retainedCompleted(){return this.completed.cache}};function E(s,e){return new u(s,e)}function k(s,e){return new h(s,e)}export{u as a,h as b,E as c,k as d,$ as e};
|
package/dist/chunk-7Q2WPFQ7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as x,w}from"./chunk-T7EQPKOP.js";import{i as g,j as p}from"./chunk-CK2E7BTU.js";async function k(o){let i=typeof o=="string"?new TextEncoder().encode(o):o,c=await globalThis.crypto.subtle.digest("SHA-256",i),t=new Uint8Array(c),n="";for(let r=0;r<t.length;r++)n+=b[t[r]];return n}var b=new Array(256);for(let o=0;o<256;o++)b[o]=o.toString(16).padStart(2,"0");var m=class extends Error{constructor(c,t){super(`content-addressed lookup miss in read-strict mode: ${c}`);this.key=c;this.context=t;this.name="ContentAddressedMissError"}};function T(o){let i=new Set,c=t=>{if(t===null||typeof t!="object")return t;let n=t;if(i.has(n))return{__cycle:!0};i.add(n);try{if(Array.isArray(t))return t.map(c);let r={};for(let d of Object.keys(t).sort())r[d]=c(t[d]);return r}finally{i.delete(n)}};return JSON.stringify(c(o))}function P(o){let{storage:i,keyContext:c,keyPrefix:t,mode:n="read-write"}=o,r=c??(e=>e);async function d(e){let s=T(r(e)),a=await k(s);return t?`${t}:${a}`:a}return{keyFor:d,async lookup(e){if(n==="write")return;let s=await d(e),a=await i.load(s);if(a==null){if(n==="read-strict")throw new m(s,e);return}return a},async store(e,s){if(n==="read")return;let a=await d(e);await i.save(a,s)},async forget(e){if(n==="read"||n==="write"||!i.clear)return;let s=await d(e);await i.clear(s)}}}function j(o,i={}){let c=i.keyFn??(n=>String(n)),t=new Map;return n=>{let r=c(n),d=t.get(r);if(d)return d;let e=o(n),s;e!=null&&typeof e.then=="function"?s=Promise.resolve(e):e!=null&&typeof e=="object"&&"subscribe"in e&&"cache"in e?s=w(e):e!=null&&typeof e=="object"&&Symbol.asyncIterator in e?s=(async()=>{let u=e[Symbol.asyncIterator]();try{let{value:l,done:f}=await u.next();if(f)throw new Error("singleFromAny: factory returned empty async iterable");return l}finally{await u.return?.()}})():e!=null&&typeof e=="object"&&Symbol.iterator in e?s=(async()=>{let u=e[Symbol.iterator]();try{let{value:l,done:f}=u.next();if(f)throw new Error("singleFromAny: factory returned empty iterable");return l}finally{u.return?.()}})():s=Promise.resolve(e);let a,y=()=>{t.get(r)===a&&t.delete(r)};return a=s.then(u=>(y(),u),u=>{throw y(),u}),t.set(r,a),a}}function K(o,i={}){let c=i.keyFn??(n=>String(n)),t=new Map;return n=>{let r=c(n),d=t.get(r);if(d)return d;let e=x(o(n));t.set(r,e);let s=e.subscribe(a=>{for(let y of a)if(y[0]===p||y[0]===g){t.get(r)===e&&t.delete(r),s();return}});return e}}export{k as a,m as b,T as c,P as d,j as e,K as f};
|
package/dist/chunk-FKRPIRE6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as E}from"./chunk-ESMPEKEV.js";import{a as B,b as R,i as _}from"./chunk-4VVTGLXJ.js";import{m as I}from"./chunk-T7EQPKOP.js";import{D as P,F as g,m as L,o as O}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 S(e){return{describeKind:"derived",...e}}function V(e){return e<0?0:e}function M(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 Z(e,s){let r=s?.count,n=s?.backoff,l=r!==void 0?r:n===void 0?0:2147483647;if(l<0)throw new RangeError("retry count must be >= 0");let u=n===void 0?null:typeof n=="string"?_(n):n;return g(t=>{let o=0,c=!1,i=null,f,a=new E;function w(){f?.(),f=void 0}function N(p){if(c)return;if(o>=l){w(),t.down([[T,p]]);return}let m=u===null?0:u(o,p,i);if(m==null){w(),t.down([[T,p]]);return}let d;try{d=W(m)}catch{w(),t.down([[T,p]]);return}i=d,o+=1,w();let v=d>0?d/1e6:1;a.start(v,()=>{c||x()})}function x(){a.cancel(),w(),f=e.subscribe(p=>{if(!c)for(let m of p){let d=m[0];if(d===k)t.down([[k]]);else if(d===b)o=0,i=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(M(m));return}else t.down([m])}})}return x(),()=>{c=!0,a.cancel(),w()}},{...S(),initial:e.cache})}function ee(e,s){let r=s?.count,n=s?.backoff,l=r!==void 0?r:n===void 0?0:2147483647;if(l<0)throw new RangeError("retry count must be >= 0");let u=n===void 0?null:typeof n=="string"?_(n):n;return g(t=>{let o=0,c=!1,i=null,f,a=new E;function w(){f?.(),f=void 0}function N(p){if(c)return;if(o>=l){w(),t.down([[T,p]]);return}let m=u===null?0:u(o,p,i);if(m==null){w(),t.down([[T,p]]);return}let d;try{d=W(m)}catch{w(),t.down([[T,p]]);return}i=d,o+=1,w();let v=d>0?d/1e6:1;a.start(v,()=>{c||x()})}function x(){a.cancel(),w();let p;try{p=e()}catch(m){N(m);return}f=p.subscribe(m=>{if(!c)for(let d of m){let v=d[0];if(v===k)t.down([[k]]);else if(v===b)o=0,i=null,t.emit(d[1]);else if(v===y)t.down([[y]]);else if(v===h)w(),t.down([[h]]);else if(v===T){N(M(d));return}else t.down([d])}})}return x(),()=>{c=!0,a.cancel(),w()}},{...S(),initial:s?.initial})}var A=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};function te(e){let s=Math.max(1,e?.failureThreshold??5),r=V(e?.cooldownNs??30*1e9),n=e?.cooldown??null,l=Math.max(1,e?.halfOpenMax??1),u=e?.now??O,t="closed",o=0,c=0,i=0,f=r,a=0;function w(){if(!n)return r;let p=n(c);return p!==null?p:r}function N(){t="open",f=w(),i=u(),a=0}return{canExecute(){return t==="closed"?!0:t==="open"?u()-i>=f?(t="half-open",a=1,!0):!1:a<l?(a++,!0):!1},recordSuccess(){t==="half-open"?(t="closed",o=0,c=0):t==="closed"&&(o=0)},recordFailure(p){if(t==="half-open"){c++,N();return}t==="closed"&&(o++,o>=s&&N())},get state(){return t},get failureCount(){return o},reset(){t="closed",o=0,c=0,a=0}}}function ne(e,s){let r=s?.onOpen??"skip";return n=>{let l=P([],(u,t)=>{function o(){l.meta.breakerState.down([[b,e.state]])}let c=n.subscribe(i=>{for(let f of i){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 A]]):t.down([[y]])):a===y?t.down([[y]]):a===h?(e.recordSuccess(),o(),t.down([[h]])):a===T?(e.recordFailure(M(f)),o(),t.down([f])):t.down([f])}});return o(),c},{...S(),meta:{breakerState:e.state},completeWhenDepsComplete:!1,initial:n.cache});return{node:l,breakerState:l.meta.breakerState}}}function U(e,s){if(e<=0)throw new RangeError("capacity must be > 0");if(s<0)throw new RangeError("refillPerSecond must be >= 0");let r=e,n=O();function l(u){if(s>0){let t=u-n;r=Math.min(e,r+t/1e9*s)}n=u}return{available(){return l(O()),r},tryConsume(u=1){if(u<=0)return!0;let t=O();return l(t),r>=u?(r-=u,!0):!1},putBack(u=1){u<=0||(l(O()),r=Math.min(e,r+u))}}}var D=class extends Error{name="RateLimiterOverflowError";constructor(s){super(`rateLimiter buffer overflow (maxBuffer=${s})`)}};function re(e,s){let{maxEvents:r,windowNs:n}=s;if(r<=0)throw new RangeError("maxEvents must be > 0");if(n<=0)throw new RangeError("windowNs must be > 0");let l=s.maxBuffer;if(l!==void 0&&l<1)throw new RangeError("maxBuffer must be >= 1");let u=s.onOverflow??"drop-newest",t=r*1e9/n;return g(o=>{let c=U(r,t),i=[],f=new E,a=!1,w=1e9/t;function N(){for(;i.length>0;)if(c.tryConsume(1))o.emit(i.shift());else{f.start(Math.max(1,w/1e6),N);return}}let x=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(l!==void 0&&i.length>=l){if(u!=="drop-newest")if(u==="drop-oldest")i.shift(),i.push(m[1]);else{a=!0,f.cancel(),i.length=0,o.down([[T,new D(l)]]);return}}else i.push(m[1]);N()}else if(d===y)o.down([[y]]);else if(d===h)a=!0,f.cancel(),i.length=0,o.down([[h]]);else if(d===T)a=!0,f.cancel(),i.length=0,o.down([m]);else if(d===C){a=!0,f.cancel(),i.length=0,o.down([m]);return}else o.down([m])}});return()=>{a=!0,f.cancel(),x()}},{...S(),initial:e.cache})}function oe(e,s){let r=s?.initialStatus??"pending",n=P([],(l,u)=>{let t=r;return n.meta.status.down([[b,r]]),n.meta.error.down([[b,null]]),e.subscribe(c=>{for(let i of c){let f=i[0];if(f===k)u.down([[k]]);else if(f===b)t==="errored"?L(()=>{n.meta.error.down([[b,null]]),n.meta.status.down([[b,"active"]])}):n.meta.status.down([[b,"active"]]),t="active",u.emit(i[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=M(i);L(()=>{n.meta.error.down([[b,a]]),n.meta.status.down([[b,"errored"]])}),t="errored",u.down([i])}else u.down([i])}})},{...S(),meta:{status:r,error:null},completeWhenDepsComplete:!1,resubscribable:!0,initial:e.cache});return{node:n,status:n.meta.status,error:n.meta.error}}var F=class extends Error{name="TimeoutError";constructor(s){super(`Timed out after ${s/1e6}ms`)}};function j(e){return e!=null&&typeof e=="object"&&"cache"in e&&typeof e.subscribe=="function"}function K(e){return e!=null&&typeof e.then=="function"}function $(e){return e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function"}function ie(e,s){return g(r=>{let n,l;function u(){l?.(),l=void 0,j(s)||K(s)||$(s)?n=I(s).subscribe(o=>{r.down(o)}):(r.emit(s),r.down([[h]]))}return l=e.subscribe(t=>{for(let o of t){let c=o[0];if(c===k)r.down([[k]]);else if(c===b)r.emit(o[1]);else if(c===y)r.down([[y]]);else if(c===h)r.down([[h]]);else if(c===T){u();return}else if(c===C){n?.(),r.down([o]);return}else r.down([o])}}),()=>{l?.(),n?.()}},{...S(),initial:e.cache})}function se(e,s){if(s<=0)throw new RangeError("timeoutNs must be > 0");return g(r=>{let n=!1,l=new E;function u(){let o=s/1e6;l.start(o,()=>{n||(n=!0,t(),r.down([[T,new F(s)]]))})}let t=e.subscribe(o=>{for(let c of o){if(n)return;let i=c[0];if(i===k)r.down([[k]]);else if(i===b)u(),r.emit(c[1]);else if(i===y)r.down([[y]]);else if(i===h){l.cancel(),n=!0,r.down([[h]]);return}else if(i===T){l.cancel(),n=!0,r.down([c]);return}else if(i===C){l.cancel(),n=!0,r.down([c]);return}else r.down([c])}});return u(),()=>{n=!0,l.cancel(),t()}},{...S(),initial:e.cache})}export{Z as a,ee as b,A as c,te as d,ne as e,U as f,D as g,re as h,oe as i,F as j,ie as k,se as l};
|
package/dist/chunk-HTBOCKVD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as S,G as g,m as x}from"./chunk-LYCLF26R.js";import{b as z,c as w}from"./chunk-CK2E7BTU.js";var p=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(n,i){if(i!==void 0&&i<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=i,i!==void 0){if(this._buf=new Array(i),n&&n.length>0){let r=Math.min(n.length,i),h=n.length-r;for(let l=0;l<r;l++)this._buf[l]=n[h+l];this._size=r}}else this._buf=n?[...n]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(n){if(!Number.isInteger(n))return;let i=n>=0?n:this._size+n;if(!(i<0||i>=this._size))return this._maxSize!==void 0?this._buf[(this._head+i)%this._maxSize]:this._buf[i]}append(n){this._rawAppend(n),this._version+=1}appendMany(n){if(n.length===0)return;let i=this._maxSize!==void 0&&n.length>this._maxSize?n.length-this._maxSize:0;for(let r=i;r<n.length;r++)this._rawAppend(n[r]);this._version+=1}clear(){if(this._size===0)return 0;let n=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let i=0;i<n;i++)this._buf[(this._head+i)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,n}trimHead(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return 0;let i=Math.min(n,this._size);if(this._maxSize===void 0)this._buf.splice(0,i);else{for(let r=0;r<i;r++)this._buf[(this._head+r)%this._maxSize]=void 0;this._head=(this._head+i)%this._maxSize}return this._size-=i,this._version+=1,i}slice(n,i){if(!Number.isInteger(n)||n<0)throw new RangeError(`slice: start must be a non-negative integer (got ${n})`);if(i!==void 0&&(!Number.isInteger(i)||i<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${i})`);let r=i===void 0?this._size:Math.min(Math.max(i,0),this._size),h=Math.min(n,this._size);if(h>=r)return[];let l=r-h;if(this._maxSize===void 0)return this._buf.slice(h,r);let s=new Array(l);for(let u=0;u<l;u++)s[u]=this._buf[(this._head+h+u)%this._maxSize];return s}tail(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`tail: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return[];let i=Math.min(n,this._size);return this.slice(this._size-i,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let n=new Array(this._size);for(let i=0;i<this._size;i++)n[i]=this._buf[(this._head+i)%this._maxSize];return n}_rawAppend(n){if(this._maxSize===void 0){this._buf.push(n),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=n,this._size+=1):(this._buf[this._head]=n,this._head=(this._head+1)%this._maxSize)}};function A(_){return _.subscribe(()=>{})}var E=64;function L(_,n={}){let{name:i,maxSize:r,versioning:h,backend:l}=n,s=l??new p(_,r),u=S(s.toArray(),{name:i,describeKind:"state",equals:(e,t)=>e===t,...h!=null?{versioning:h}:{}});function M(){let e=s.toArray();x(()=>{u.down([[w]]),u.down([[z,e]])})}let d=new Map,a=new Map;function v(e,t){return`${e}:${t===void 0?"END":t}`}function y(e){if(e.size<E)return;let t=e.keys().next();if(t.done)return;let o=e.get(t.value);o!==void 0&&o.dispose(),e.delete(t.value)}function b(e){let t=s.version;try{return e()}finally{s.version!==t&&M()}}return{entries:u,get size(){return s.size},at(e){return s.at(e)},append(e){b(()=>s.append(e))},appendMany(e){e.length!==0&&b(()=>s.appendMany(e))},clear(){b(()=>s.clear())},trimHead(e){b(()=>s.trimHead(e))},tail(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);let t=d.get(e);if(t!==void 0)return d.delete(e),d.set(e,t),t.node;y(d);let o=g([u],([m])=>{let c=m;return e===0||c.length===0?[]:c.slice(Math.max(0,c.length-e))},{initial:s.tail(e),describeKind:"derived"}),f=A(o);return d.set(e,{node:o,dispose:f}),o},slice(e,t){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(t!==void 0&&(!Number.isInteger(t)||t<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${t})`);let o=v(e,t),f=a.get(o);if(f!==void 0)return a.delete(o),a.set(o,f),f.node;y(a);let m=g([u],([k])=>{let T=k;return t===void 0?T.slice(e):T.slice(e,t)},{initial:s.slice(e,t),describeKind:"derived"}),c=A(m);return a.set(o,{node:m,dispose:c}),m},disposeTail(e){let t=d.get(e);return t===void 0?!1:(t.dispose(),d.delete(e),!0)},disposeSlice(e,t){let o=v(e,t),f=a.get(o);return f===void 0?!1:(f.dispose(),a.delete(o),!0)},disposeAllViews(){for(let e of d.values())e.dispose();d.clear();for(let e of a.values())e.dispose();a.clear()},dispose(){for(let e of d.values())e.dispose();d.clear();for(let e of a.values())e.dispose();a.clear()}}}export{p as a,L as b};
|
package/dist/chunk-I6VIH3VA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(n){if(n===null||typeof n!="object")return n;if(Array.isArray(n))return n.map(t);let r=n,e=Object.keys(r).sort(),o={};for(let i of e)o[i]=t(r[i]);return o}function s(n){return JSON.stringify(t(n),void 0,0)}function u(){let n=new Map;return{save(r,e){n.set(r,JSON.parse(JSON.stringify(e)))},load(r){let e=n.get(r);return e===void 0?null:JSON.parse(JSON.stringify(e))},clear(r){n.delete(r)},list(){return[...n.keys()].sort()}}}function a(n){return{save(r,e){n[r]=JSON.parse(JSON.stringify(e))},load(r){let e=n[r];return e===void 0?null:JSON.parse(JSON.stringify(e))},clear(r){delete n[r]},list(){return Object.keys(n).sort()}}}export{t as a,s as b,u as c,a as d};
|