@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 $e}from"./chunk-
|
|
1
|
+
import{a as $e}from"./chunk-EUE7ELFQ.js";import{d as _e}from"./chunk-53XJ2S6D.js";import{u as X}from"./chunk-E5YSBQSF.js";import{a as Me}from"./chunk-GWOKTENT.js";import{c as Ce}from"./chunk-3OT7K33Q.js";import{g as we,i as ue}from"./chunk-BGEY3PXH.js";import{b as ie,d as U}from"./chunk-O32GJOUJ.js";import{f as ke,j as Se}from"./chunk-5KPIYVCC.js";import{b as A,s as q,t as Ae,x as _}from"./chunk-JJTF75VS.js";import{b as Oe}from"./chunk-TZQPPQEQ.js";import{m as z}from"./chunk-MQZWA3DF.js";import{D as Ne,E as S,F as Q,G as N,H as $,o as V}from"./chunk-LYCLF26R.js";import{b as P,i as F,j as W}from"./chunk-CK2E7BTU.js";import{b as Xe}from"./chunk-QYADASLV.js";var kt={};Xe(kt,{DEFAULT_DECAY_RATE:()=>D,DEFAULT_EXECUTE_PROMPT:()=>ce,DEFAULT_QUEUE_CONFIGS:()=>Z,DEFAULT_SEVERITY_WEIGHTS:()=>L,DEFAULT_TRIAGE_PROMPT:()=>le,DEFAULT_VERIFY_PROMPT:()=>de,HarnessGraph:()=>te,QUEUE_NAMES:()=>b,actuatorExecutor:()=>nt,affectedTaskFilter:()=>lt,autoSolidify:()=>ot,beforeAfterCompare:()=>ut,codeChangeBridge:()=>ct,createIntakeBridge:()=>st,defaultErrorClassifier:()=>ee,defaultLlmExecutor:()=>je,defaultLlmVerifier:()=>Ge,evalIntakeBridge:()=>at,evalSource:()=>it,evalVerifier:()=>Pe,harnessEvalPair:()=>Tt,harnessLoop:()=>vt,harnessProfile:()=>ht,harnessTrace:()=>bt,notifyEffect:()=>dt,priorityScore:()=>Et,refineExecutor:()=>pe,resolvePromptFn:()=>B,strategyKey:()=>j,strategyModel:()=>fe});function Ze(e,t){return{outcome:"success",detail:`actuator applied ${t.intervention} for ${rt(t.summary)}`,artifact:e}}function et(e,t){let n=e instanceof Error?e.message:String(e);return{outcome:"failure",detail:`actuator threw on ${t.intervention}: ${n}`}}function tt(e){return`actuator skipped ${e.intervention} (shouldApply returned false)`}function rt(e,t=80){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}function nt(e){let t=e.name??"actuator-executor",n=e.toOutput??Ze,r=e.onError??et,o=e.skipDetail??tt;return d=>{let s=A(d,i=>i!=null,{name:`${t}/gate-in`}),a=_(s,i=>e.shouldApply&&!e.shouldApply(i)?Q(c=>(c.down([[P,{outcome:"failure",detail:o(i)}],[F]]),()=>{}),{name:`${t}/skip`}):Q(c=>{let m=new AbortController,f=!1,l=null,g=R=>{f||(f=!0,c.down([[P,R],[F]]),l?.(),l=null)},y;try{let R=e.apply(i,{signal:m.signal});y=z(R,{signal:m.signal})}catch(R){return g(r(R,i)),()=>{m.abort()}}return l=y.subscribe(R=>{for(let E of R){if(f)return;if(E[0]===P){g(n(E[1],i));return}if(E[0]===W){g(r(E[1],i));return}if(E[0]===F){g(r(new Error("actuator inner completed without emitting DATA"),i));return}}}),f&&l&&(l(),l=null),()=>{m.abort(),l?.(),l=null}},{name:`${t}/inner`}),{name:t});return A(a,i=>i!=null,{name:`${t}/gate-out`})}}function ot(e){let t=e.name??"auto-solidify",n=e.extract??(o=>o.execution.artifact??null),r=e.predicate??(()=>!0);return Q(o=>{let d=null,s=!1,a=()=>{s||(s=!0,d?.(),d=null)},i=c=>{s||(o.down([[W,c]]),a())};return d=e.verifyResults.subscribe(c=>{if(!s)for(let m of c){if(s)return;if(m[0]!==P){if(m[0]===F){o.down([[F]]),a();return}continue}let f=m[1];if(f==null||!f.verified)continue;let l;try{l=r(f)}catch(y){i(y);return}if(!l)continue;let g;try{g=n(f)}catch(y){i(y);return}if(g!=null){try{e.write(g,f)}catch(y){i(y);return}o.down([[P,g]])}}}),s&&d&&(d(),d=null),()=>{a()}},{name:t})}function st(e,t,n,r){return $([e],([o])=>{if(o==null)return;let d=n(o);for(let s of d)t.publish(s)},{name:r?.name??"intake-bridge"})}function at(e,t,n){let r=n?.defaultSeverity??"medium";return $([e],([o])=>{if(o==null)return;let d=Array.isArray(o)?o:[o];for(let s of d)for(let a of s.tasks)if(!(a.valid&&a.judge_scores?.every(i=>i.pass))){if(!a.valid&&(!a.judge_scores||a.judge_scores.length===0)){t.publish({source:"eval",summary:`Task ${a.task_id} invalid (model: ${s.model})`,evidence:`Run ${s.run_id}: task produced invalid output`,affectsAreas:["graphspec"],affectsEvalTasks:[a.task_id],severity:r});continue}if(a.judge_scores)for(let i of a.judge_scores)i.pass||t.publish({source:"eval",summary:`${a.task_id}: ${i.claim} (model: ${s.model})`,evidence:i.reasoning,affectsAreas:["graphspec"],affectsEvalTasks:[a.task_id],severity:r})}},{name:n?.name??"eval-intake-bridge"})}function it(e,t){return _(e,()=>z(t()))}function ut(e,t){return N([e,t],([n,r])=>{let o=n,d=r,s=new Map(o.tasks.map(l=>[l.task_id,l])),a=new Map(d.tasks.map(l=>[l.task_id,l])),i=new Set([...s.keys(),...a.keys()]),c=[],m=[],f=[];for(let l of i){let g=s.get(l),y=a.get(l),R=g?.valid??!1,E=y?.valid??!1,I=g?.judge_scores?g.judge_scores.filter(w=>w.pass).length:void 0,k=y?.judge_scores?y.judge_scores.filter(w=>w.pass).length:void 0,O=I!==void 0&&k!==void 0?k-I:void 0;c.push({taskId:l,before:R,after:E,scoreDiff:O}),R&&!E&&m.push(l),!R&&E&&f.push(l)}return{newFailures:m,resolved:f,taskDeltas:c,overallImproved:f.length>m.length}},{name:"eval-delta"})}function lt(e,t){let n=t==null?null:Array.isArray(t)?S(t):t,r=[e];return n&&r.push(n),N(r,o=>{let d=o[0],s=n?new Set(o[1]):null,a=new Set;for(let i of d)for(let c of i.affectsEvalTasks??[])(s==null||s.has(c))&&a.add(c);return[...a].sort()},{name:"affected-task-filter"})}function ct(e,t,n,r){let o=r?.defaultSeverity??"high";function d(a){let i=[];for(let c of a.lintErrors??[])i.push({source:"code-change",summary:`Lint: ${c.rule} in ${c.file}:${c.line}`,evidence:c.message,affectsAreas:[c.file],severity:o});for(let c of a.testFailures??[])i.push({source:"test",summary:`Test failure: ${c.testId}`,evidence:c.message,affectsAreas:[c.file],affectsEvalTasks:[c.testId],severity:o});return i}let s=n??d;return $([e],([a])=>{if(a!=null)for(let i of s(a))t.publish(i)},{name:r?.name??"code-change-bridge"})}function dt(e,t,n){return $([e.latest],([r])=>{r!=null&&t(r)},{name:n?.name??"notify-effect"})}var b=["auto-fix","needs-decision","investigation","backlog"],Z={"auto-fix":{gated:!1},"needs-decision":{gated:!0},investigation:{gated:!0},backlog:{gated:!1}},L={critical:100,high:70,medium:40,low:10},D=Math.LN2/(168*3600);function j(e,t){return`${e}\u2192${t}`}var pt=/\b(parse|json|config|validation|syntax)\b/i,ee=e=>pt.test(e.detail)?"self-correctable":"structural",le=`You are a triage classifier for a reactive collaboration harness.
|
|
2
2
|
|
|
3
3
|
Given an intake item, classify it and output JSON:
|
|
4
4
|
{
|
|
@@ -13,7 +13,7 @@ Strategy model (past effectiveness):
|
|
|
13
13
|
{{strategy}}
|
|
14
14
|
|
|
15
15
|
Intake item:
|
|
16
|
-
{{item}}`,
|
|
16
|
+
{{item}}`,ce=`You are an implementation agent.
|
|
17
17
|
|
|
18
18
|
Given a triaged issue with root cause and intervention type, produce a fix.
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ Output JSON:
|
|
|
24
24
|
{
|
|
25
25
|
"outcome": "success" | "failure" | "partial",
|
|
26
26
|
"detail": "<description of what was done or what failed>"
|
|
27
|
-
}`,
|
|
27
|
+
}`,de=`You are a QA reviewer.
|
|
28
28
|
|
|
29
29
|
Given an execution result, verify whether the fix is correct.
|
|
30
30
|
|
|
@@ -39,5 +39,5 @@ Output JSON:
|
|
|
39
39
|
"verified": true/false,
|
|
40
40
|
"findings": ["<finding1>", ...],
|
|
41
41
|
"errorClass": "self-correctable" | "structural" // only if verified=false
|
|
42
|
-
}`;function B(e,t,n){if(typeof e=="function")return e;let r=e??t;return o=>n(r,o)}function ft(e){let{best:t,score:n,status:r}=e,o=Number.isFinite(n)?n.toFixed(3):String(n),d=t??void 0;return r==="converged"?{outcome:"success",detail:`refineLoop converged at score ${o}`,artifact:d}:r==="budget"?{outcome:"partial",detail:`refineLoop hit budget at score ${o}`,artifact:d}:{outcome:"failure",detail:`refineLoop errored (status=${r})`,artifact:d}}function
|
|
43
|
-
`),affectsAreas:p.affectsAreas,affectsEvalTasks:p.affectsEvalTasks,severity:p.severity??"high",relatedTo:[T],$reingestions:x+1})}let se=
|
|
42
|
+
}`;function B(e,t,n){if(typeof e=="function")return e;let r=e??t;return o=>n(r,o)}function ft(e){let{best:t,score:n,status:r}=e,o=Number.isFinite(n)?n.toFixed(3):String(n),d=t??void 0;return r==="converged"?{outcome:"success",detail:`refineLoop converged at score ${o}`,artifact:d}:r==="budget"?{outcome:"partial",detail:`refineLoop hit budget at score ${o}`,artifact:d}:{outcome:"failure",detail:`refineLoop errored (status=${r})`,artifact:d}}function pe(e){let t=e.name??"refine-executor",n=e.toOutput??ft;return r=>{let o=A(r,s=>s!=null,{name:`${t}/gate-in`}),d=_(o,s=>{let a=$e(e.seedFrom(s),e.evaluator,e.strategy,{...e.refine,dataset:e.datasetFor(s),name:`${t}/inner`});return N([a.status,a.best,a.score],([i,c,m])=>{let f=i;return f!=="converged"&&f!=="budget"&&f!=="errored"?null:n({best:c,score:m,status:f})},{name:`${t}/output`})},{name:t});return A(d,s=>s!=null,{name:`${t}/gate-out`})}}function mt(e){if(e.length===0)return Number.NEGATIVE_INFINITY;let t=0;for(let n of e)t+=n.score;return t/e.length}function gt(e){let{passCount:t,total:n,meanScore:r,threshold:o,missingArtifact:d}=e,s=Number.isFinite(r)?r.toFixed(3):String(r),a=!d&&n>0&&r>=o,i=d?["EXECUTE stage did not emit an artifact; cannot verify reactively"]:a?[`${t}/${n} eval tasks passed; mean score ${s} \u2265 ${o}`]:n===0?["No eval tasks were selected for this item \u2014 cannot verify"]:[`${t}/${n} eval tasks passed; mean score ${s} < threshold ${o}`];return a?{verified:!0,findings:i}:{verified:!1,findings:i,errorClass:"structural"}}function yt(e){return e.artifact??null}function Pe(e){let t=e.name??"eval-verifier",n=e.threshold??.5,r=e.toOutput??gt,o=e.extractArtifact??yt;return d=>{let s=A(d,i=>i!=null&&i[0]!=null&&i[1]!=null,{name:`${t}/gate-in`}),a=_(s,i=>{let[c,m]=i,f=o(c,m);if(f==null)return S(r({scores:[],meanScore:Number.NEGATIVE_INFINITY,passCount:0,total:0,threshold:n,missingArtifact:!0}));let l=S([f],{name:`${t}/candidates`}),g=S(e.datasetFor(m),{name:`${t}/dataset`}),y=e.evaluator(l,g);return N([y],([R])=>{let E=R;if(E==null)return null;let I=mt(E),k=E.filter(O=>O.score>=n).length;return r({scores:E,meanScore:I,passCount:k,total:E.length,threshold:n})},{name:`${t}/output`})},{name:t});return A(a,i=>i!=null,{name:`${t}/gate-out`})}}function Tt(e){let t=e.name??"harness-pair",n=pe({name:`${t}-exec`,seedFrom:e.seedFrom,evaluator:e.evaluator,strategy:e.strategy,datasetFor:e.datasetFor,refine:e.refine}),r=Pe({name:`${t}-verify`,evaluator:e.evaluator,datasetFor:e.datasetFor,threshold:e.threshold});return{executor:n,verifier:r}}function fe(){let e=Oe({name:"strategy-entries"}),t=N([e.entries],([s])=>{let a=s;return new Map(a)},{name:"strategy-model",equals:(s,a)=>{let i=s,c=a;if(i.size!==c.size)return!1;for(let[m,f]of i){let l=c.get(m);if(!l||f.attempts!==l.attempts||f.successes!==l.successes)return!1}return!0}});function n(s,a,i){let c=j(s,a),m=e.get(c),f=(m?.attempts??0)+1,l=(m?.successes??0)+(i?1:0);e.set(c,{rootCause:s,intervention:a,attempts:f,successes:l,successRate:l/f})}function r(s,a){return e.get(j(s,a))}let o=t.subscribe(()=>{});function d(){o()}return{node:t,record:n,lookup:r,dispose:d}}function Et(e,t,n,r,o){let d={...L,...o?.severityWeights},s=o?.decayRate??D,a=o?.effectivenessThreshold??.7,i=o?.effectivenessBoost??15,c=[e,t,n];return r&&c.push(r),N(c,m=>{let f=m[0],l=m[1],g=m[2],y=r?m[3]:0,R=d[f.severity??"medium"],E=(V()-g)/1e9,I=Me(R,E,s,0),k=j(f.rootCause,f.intervention),O=l.get(k);return O&&O.successRate>=a&&(I+=i),I+=y*20,I},{name:"priority-score"})}var Fe="intake",Rt="triage-output",Ve="retry",Le="verify-results",De="__unrouted";function je(e,t){let n=B(t,ce,(r,o)=>r.replace("{{item}}",JSON.stringify(o)));return r=>X(e,[r],n,{name:"execute",format:"json"})}function Ge(e,t){let n=B(t,de,(r,o)=>{let[d,s]=o;return r.replace("{{execution}}",JSON.stringify(d)).replace("{{item}}",JSON.stringify(s))});return r=>X(e,[r],o=>o==null?"":n(o),{name:"verify",format:"json"})}var te=class extends Se{queues;jobs;gates;queueTopics;strategy;totalRetries;totalReingestions;priorityScores;constructor(t,n,r,o,d,s,a,i,c){super(t),this.queues=n,this.queueTopics=r,this.jobs=o,this.gates=d,this.strategy=s,this.totalRetries=a,this.totalReingestions=i,this.priorityScores=c}get intake(){return this.queues.topic(Fe)}get verifyResults(){return this.queues.topic(Le)}get retry(){return this.queues.topic(Ve)}get unrouted(){return this.queues.topic(De)}stageNodes(){let t=this.queues,n=s=>t.has(s)?`queues::${s}::latest`:null,r=s=>s==null?[]:[s],o=b.flatMap(s=>r(n(s))),d=[];for(let[s]of this.gates)d.push(`gates::${s}/gate`);return[{label:"INTAKE",paths:r(n("intake"))},{label:"TRIAGE",paths:["triage"]},{label:"QUEUE",paths:o},{label:"GATE",paths:d},{label:"EXECUTE",paths:["execute"]},{label:"VERIFY",paths:r(n("verify-results"))},{label:"REFLECT",paths:["reflect"]},{label:"STRATEGY",paths:["strategy"]}]}};function vt(e,t){let n=t.adapter,r=t.maxRetries??2,o=t.retainedLimit??1e3,d=t.errorClassifier??ee,s=new Map;for(let u of b)s.set(u,{...Z[u],...t.queues?.[u]});let a=we(`${e}/queues`,{defaultTopicOptions:{retainedLimit:o}}),i=a.topic(Fe),c=a.topic(Rt),m=a.topic(Ve),f=a.topic(Le),l=new Map;for(let u of b)l.set(u,a.topic(u));let g=a.topic(De),y=fe(),R=q(i.latest,y.node),E=B(t.triagePrompt,le,(u,p)=>{let[T,x]=p;return u.replace("{{strategy}}",JSON.stringify(Array.from(x.entries()))).replace("{{item}}",JSON.stringify(T))}),I=X(n,[R],u=>{let p=u;return!p||!p[0]?"":E(p)},{name:"triage",format:"json"}),k=q(I,R),w=$([k],([u])=>{if(u==null)return;let[p,T]=u;if(!p?.route)return;let x=T?.[0],C={...p,...x};c.publish(C)}).subscribe(()=>{}),Qe=new Set(b);for(let u of b)ue(`bridge/${u}`,c,l.get(u),{map:p=>p.route===u?p:void 0});ue("bridge/__unrouted",c,g,{map:u=>Qe.has(u.route)?void 0:u});let G=new Map,re=new Map;for(let u of b)G.set(u,_e(`jobs/${u}`));let me=[];for(let u of b){let p=l.get(u),T=G.get(u),x=new WeakSet,C=$([p.events],([ae])=>{let H=ae??[];for(let h of H){if(x.has(h))continue;x.add(h);let M=T.enqueue(h);re.set(U(h),{route:u,id:M})}},{name:`jobs/${u}-mirror`});me.push(C.subscribe(()=>{}))}function ge(u){let p=U(u),T=re.get(p);T&&(G.get(T.route)?.removeById(T.id),re.delete(p))}let ye=Ce("gates"),Y=new Map;for(let u of b){let p=s.get(u);if(!p.gated)continue;let T=l.get(u),x=ye.gate(`${u}/gate`,T.latest,{maxPending:p.maxPending,startOpen:p.startOpen});Y.set(u,x)}let J=[];for(let u of b)s.get(u).gated&&Y.has(u)?J.push(Y.get(u).node):J.push(l.get(u).latest);J.push(m.latest);let ne=Ae(...J),Te=(t.executor??je(n,t.executePrompt))(ne),oe=q(Te,ne),Ee=(t.verifier??Ge(n,t.verifyPrompt))(oe),Re=q(Ee,oe),ve=t.maxReingestions??1,Ue=Math.min(t.maxTotalRetries??r*10,100),qe=Math.min(t.maxTotalReingestions??ve*10,100),xe=S(0),he=S(0);function Be(u,p,T){let x={item:T,outcome:p?.outcome??"failure",detail:p?.detail??"unknown",artifact:p?.artifact};return{item:T,execution:x,verified:u.verified,findings:u.findings??[],errorClass:u.errorClass}}function Ye(u,p){y.record(p.rootCause,p.intervention,!0),f.publish(u),ge(p)}function Je(u,p){let T=U(p),x=p.$retries??0,C={...p,$retries:x+1,summary:`[RETRY ${x+1}/${r}] ${T} \u2014 Previous attempt failed: ${u.findings.join("; ")}`,relatedTo:[T]};m.publish(C)}function Ie(u,p){y.record(p.rootCause,p.intervention,!1),f.publish(u),ge(p);let T=U(p),x=p.$reingestions??0;x<ve&&ie(he,qe)&&i.publish({source:p.source,summary:`Verification failed for: ${T}`,evidence:u.findings.join(`
|
|
43
|
+
`),affectsAreas:p.affectsAreas,affectsEvalTasks:p.affectsEvalTasks,severity:p.severity??"high",relatedTo:[T],$reingestions:x+1})}let se=Ne([Re],(u,p)=>{let T=u[0];if(T==null||T.length===0)return;let x=T[T.length-1];if(x==null)return;let[C,ae]=x,[H,h]=ae??[null,null];if(!C||!h)return;if(H==null){Ie({item:h,execution:{item:h,outcome:"failure",detail:"executor returned null"},verified:!1,findings:["executor returned null"],errorClass:"structural"},h);return}let M=Be(C,H,h);if(M.verified){Ye(M,h);return}let We=M.errorClass??d({item:h,outcome:H.outcome,detail:M.findings.join("; ")}),ze=h.$retries??0;We==="self-correctable"&&ze<r&&ie(xe,Ue)?Je(M,h):Ie(M,h)}),Ke=se.subscribe(()=>{}),be=N([se],()=>null,{name:"reflect",equals:()=>!1}),K;t.priority&&(K=xt(l,y,t));let v=new te(e,a,l,G,Y,y,xe,he,K);v.addDisposer(w),v.addDisposer(Ke),v.addDisposer(y.dispose);for(let u of me)v.addDisposer(u);if(v.add(I,{name:"triage"}),v.add(ne,{name:"execute-input"}),v.add(Te,{name:"execute"}),v.add(oe,{name:"execute-context"}),v.add(Ee,{name:"verify"}),v.add(Re,{name:"verify-context"}),v.add(se,{name:"verify-dispatch"}),v.add(be,{name:"reflect"}),v.add(y.node,{name:"strategy"}),v.addDisposer(be.subscribe(()=>{})),K)for(let[u,p]of K)v.add(p,{name:`priority/${u}`}),v.addDisposer(p.subscribe(()=>{}));v.mount("queues",a),v.mount("gates",ye);for(let[u,p]of G)v.mount(`jobs/${u}`,p);return v}function xt(e,t,n){if(!n.lastInteractionNs)throw new Error("harnessLoop: `opts.priority` requires `opts.lastInteractionNs` \u2014 pass a Node<number> (e.g. `fromTimer(60_000)` or a `state(monotonicNs())` you bump on human interaction). Priority scores only decay when this node settles; an internal default would freeze age at construction time.");let r=n.lastInteractionNs,o=n.priority??{},d={...L,...o.severityWeights},s=o.decayRate??D,a=o.effectivenessThreshold??.7,i=o.effectivenessBoost??15,c=new Map;for(let[m,f]of e){let l=N([f.latest,t.node,r],g=>{let y=g[0];if(y==null)return 0;let R=d[y.severity??"medium"]??40,E=(V()-g[2])/1e9,I=R*Math.exp(-s*Math.max(0,E)),k=`${y.rootCause}\u2192${y.intervention}`,w=g[1]?.get(k);return w&&w.successRate>=a&&(I+=i),I},{name:`priority/${m}`});c.set(m,l)}return c}function ht(e,t){let n=ke(e,t),r={};for(let o of b){let d=e.queues.has(o)?e.queues.topic(o):null;r[o]=d?.retained().length??0}return{...n,queueDepths:r,strategyEntries:e.strategy.node.cache?.size??0,totalRetries:e.totalRetries.cache??0,totalReingestions:e.totalReingestions.cache??0}}function It(e){let t={};for(let{label:n,paths:r}of e.stageNodes())for(let o of r)t[o]=n;return t}function bt(e,t){let n=t?.logger===null?null:t?.logger??console.log,r=t?.detail??"summary",o=V(),d=[],s=[],a=It(e);function i(){return(V()-o)/1e9}function c(m,f,l){let g={elapsed:i(),stage:m,type:f};r!=="summary"&&(g.summary=Nt(l)),r==="full"&&(g.data=l),s.push(g)}for(let[m,f]of Object.entries(a))try{let l=e.observe(m,{format:"stage-log",stageLabels:a,logger:n?g=>n(g):()=>{},includeTypes:["data","error","complete"]});l.onEvent(g=>{g.type==="data"?c(f,"data",g.data):g.type==="error"?c(f,"error",g.data):g.type==="complete"&&c(f,"complete",void 0)}),d.push(l)}catch(l){let g=l instanceof Error?l.message:String(l);c(f,"error",`observe-unavailable: ${m} \u2014 ${g}`),n&&n(`[${i().toFixed(3)}s] ${f.padEnd(9)} \u2717 observe-unavailable: ${g}`)}return{get events(){return s},dispose(){for(let m of d)m.dispose();d.length=0}}}function Nt(e){if(e==null)return"null";if(typeof e=="string")return He(e,80);if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{let t=JSON.stringify(e);return He(t,120)}catch{return String(e)}}function He(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}export{nt as a,ot as b,st as c,at as d,it as e,ut as f,lt as g,ct as h,dt as i,b as j,Z as k,L as l,D as m,j as n,ee as o,le as p,ce as q,de as r,B as s,pe as t,Pe as u,Tt as v,fe as w,Et as x,je as y,Ge as z,te as A,vt as B,ht as C,bt as D,kt as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as w,E as I,F as b,p as C}from"./chunk-LYCLF26R.js";import{a as S,b as h,c as A,d as x,i as T,j as p}from"./chunk-CK2E7BTU.js";function y(e,n,t){let u=new Set;for(let o of e.split(",")){let[r,i]=o.split("/"),s=i?Number.parseInt(i,10):1;if(Number.isNaN(s)||s<1)throw new Error(`Invalid cron step: ${o}`);let a,d;if(r==="*")a=n,d=t;else if(r.includes("-")){let[f,c]=r.split("-");a=Number.parseInt(f,10),d=Number.parseInt(c,10)}else a=Number.parseInt(r,10),d=a;if(Number.isNaN(a)||Number.isNaN(d))throw new Error(`Invalid cron field: ${e}`);if(a<n||d>t)throw new Error(`Cron field out of range: ${e} (${n}-${t})`);if(a>d)throw new Error(`Invalid cron range: ${a}-${d} in ${e}`);for(let f=a;f<=d;f+=s)u.add(f)}return u}function L(e){let n=e.trim().split(/\s+/);if(n.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${n.length}`);return{minutes:y(n[0],0,59),hours:y(n[1],0,23),daysOfMonth:y(n[2],1,31),months:y(n[3],1,12),daysOfWeek:y(n[4],0,6)}}function P(e,n){return e.minutes.has(n.getMinutes())&&e.hours.has(n.getHours())&&e.daysOfMonth.has(n.getDate())&&e.months.has(n.getMonth()+1)&&e.daysOfWeek.has(n.getDay())}function m(e){return{describeKind:"producer",...e}}function $(e){return/[\\^$+?.()|[\]{}]/.test(e)?`\\${e}`:e}function X(e){let n="^";for(let t=0;t<e.length;t+=1){let u=e[t];if(u==="*"){e[t+1]==="*"?(n+=".*",t+=1):n+="[^/]*";continue}n+=$(u)}return n+="$",new RegExp(n)}function Z(e,n){for(let t of n)if(t.test(e))return!0;return!1}function K(e,n){let t=w([e],(o,r)=>{let i=o[0];if(i==null||i.length===0){r.down([[x]]);return}for(let s of i)r.emit(s)},{describeKind:"derived",initial:e.cache}),u=t.subscribe.bind(t);return t.subscribe=(o,r)=>(n(o),u(o,r)),t}function ee(e,n){let{signal:t,period:u,...o}=n??{};return b(r=>{let i=!1,s=0,a,d,f=()=>{i=!0,a!==void 0&&clearTimeout(a),d!==void 0&&clearInterval(d),t?.removeEventListener("abort",l)},c=()=>{i||(u!=null?(r.emit(s++),d=setInterval(()=>{i||r.emit(s++)},u)):(i=!0,t?.removeEventListener("abort",l),r.emit(s++),r.down([[T]])))},l=()=>{i||(f(),r.down([[p,t.reason]]))};if(t?.aborted){l();return}return a=setTimeout(c,e),t?.addEventListener("abort",l,{once:!0}),f},m(o))}function ne(e){let{signal:n,...t}=e??{};return b(u=>{let o=!1,r,i,s=!1,a=!1,d=typeof requestAnimationFrame=="function"?requestAnimationFrame:void 0,f=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:void 0,c=typeof document<"u"?document:void 0,l=()=>{r!==void 0&&f&&f(r),i!==void 0&&clearTimeout(i),r=void 0,i=void 0},v=()=>{o=!0,l(),s&&(n?.removeEventListener("abort",N),s=!1),a&&c&&(c.removeEventListener("visibilitychange",k),a=!1)},N=()=>{o||(v(),u.down([[p,n.reason]]))},O=_=>{o||(u.emit(_),g())},g=()=>{o||(d&&(!c||c.visibilityState!=="hidden")?r=d(O):i=setTimeout(()=>O(performance.now()),16))},k=()=>{o||(l(),g())};return n?.aborted?(N(),v):(n?.addEventListener("abort",N,{once:!0}),s=n!==void 0,c&&d&&(c.addEventListener("visibilitychange",k),a=!0),g(),v)},m(t))}function te(e,n){let t=L(e),{tickMs:u,output:o,...r}=n??{},i=u??6e4,s=o==="date";return b(a=>{let d=-1,f=()=>{let l=new Date,v=l.getFullYear()*1e8+(l.getMonth()+1)*1e6+l.getDate()*1e4+l.getHours()*100+l.getMinutes();v!==d&&P(t,l)&&(d=v,a.emit(s?l:C()))};f();let c=setInterval(f,i);return()=>clearInterval(c)},{...m(r),name:r.name??`cron:${e}`})}function re(e,n,t){let{capture:u,passive:o,once:r,...i}=t??{};return b(s=>{let a=f=>{s.emit(f)},d={capture:u,passive:o,once:r};return e.addEventListener(n,a,d),()=>e.removeEventListener(n,a,d)},m(i))}function D(e,n){return b(t=>{let u=!1;try{for(let o of e){if(u)return;t.emit(o)}u||t.down([[T]])}catch(o){u||t.down([[p,o]])}return()=>{u=!0}},m(n))}function W(e){return e!=null&&typeof e.then=="function"}function q(e,n){let{signal:t,...u}=n??{};return b(o=>{let r=!1,i=()=>{r||(r=!0,o.down([[p,t.reason]]))};if(t?.aborted){i();return}return t?.addEventListener("abort",i,{once:!0}),Promise.resolve(e).then(s=>{r||(r=!0,t?.removeEventListener("abort",i),o.emit(s),o.down([[T]]))},s=>{r||(r=!0,t?.removeEventListener("abort",i),o.down([[p,s]]))}),()=>{r=!0,t?.removeEventListener("abort",i)}},m(u))}function H(e,n){let{signal:t,...u}=n??{};return b(o=>{let r=new AbortController,i=()=>r.abort(t?.reason);t?.aborted?r.abort(t.reason):t?.addEventListener("abort",i,{once:!0});let s=t??r.signal,a=!1,d=e[Symbol.asyncIterator](),f=()=>{a||s.aborted||Promise.resolve(d.next()).then(c=>{if(!(a||s.aborted)){if(c.done){o.down([[T]]);return}o.emit(c.value),f()}},c=>{!a&&!s.aborted&&o.down([[p,c]])})};return f(),()=>{a=!0,t?.removeEventListener("abort",i),r.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},m(u))}function U(e){return e!=null&&typeof e=="object"&&"cache"in e&&typeof e.subscribe=="function"}function V(e,n){if(U(e))return e;if(W(e))return q(e,n);if(e!=null){let t=e;if(typeof t[Symbol.asyncIterator]=="function")return H(e,n);if(typeof t[Symbol.iterator]=="function")return D(e,n)}return B(e)}function B(...e){return D(e,void 0)}function oe(e){return b(n=>{n.down([[T]])},m(e))}function ie(e){return b(()=>{},m(e))}function se(e,n){return b(t=>{t.down([[p,e]])},m(n))}function ue(e,n){let{signal:t,...u}=n??{},o=m(u),r=o.resubscribable===void 0?{...o,resubscribable:!0}:o;return b(i=>{let s,a=!1;try{let d=e();s=V(d,n).subscribe(c=>{if(!a)for(let l of c){let v=l[0];if(v!==S)if(v===h)i.emit(l[1]);else if(v===T){a=!0,i.down([[T]]);break}else if(v===p){a=!0,i.down([[p,l[1]]]);break}else i.down([l])}})}catch(d){let f=d===void 0?new Error("defer: thunk threw undefined"):d;i.down([[p,f]])}return()=>{a=!0,s?.()}},r)}function ae(e,n,t){return w([e],(o,r)=>{let i=o[0];if(i!=null&&i.length>0)for(let s of i)n(s)},{describeKind:"effect",...t}).subscribe(()=>{})}function de(e,n){return w([e],(t,u,o)=>{o.store.buf||(o.store.buf=[]);let r=o.store.buf,i=t[0];if(i!=null&&i.length>0)for(let s of i)r.push(s);if(o.terminalDeps[0]===!0){u.emit([...r]),u.down([[T]]);return}(i==null||i.length===0)&&u.down([[x]])},{describeKind:"derived",completeWhenDepsComplete:!1,...n})}function fe(e,n){return b(t=>e.subscribe(u=>{t.down(u)}),{...m(n),initial:e.cache})}function F(e,n,t){if(n<1)throw new RangeError("replay expects bufferSize >= 1");let u=[],o=b(r=>e.subscribe(i=>{for(let s of i)s[0]===h&&(u.push(s[1]),u.length>n&&u.shift());r.down(i)}),{...m(t),initial:e.cache});return K(o,r=>{for(let i of u)r([[h,i]])})}function ce(e,n){return F(e,1,n)}function le(e){return new Promise((n,t)=>{let u=!1,o=!1,r;r=e.subscribe(i=>{for(let s of i){if(u)return;if(s[0]===h){u=!0,n(s[1]),r?(r(),r=void 0):o=!0;return}if(s[0]===p){u=!0,t(s[1]),r?(r(),r=void 0):o=!0;return}if(s[0]===T){u=!0,t(new Error("completed without DATA")),r?(r(),r=void 0):o=!0;return}}}),o&&(r?.(),r=void 0)})}function R(e,n,t){return new Promise((u,o)=>{let r=!1,i=!1,s,a=t?.skipCurrent===!0;s=e.subscribe(d=>{for(let f of d){if(r)return;if(!(a&&f[0]===h)){if(f[0]===h){let c=f[1];if(n(c)){r=!0,u(c),s?(s(),s=void 0):i=!0;return}}if(f[0]===p){r=!0,o(f[1]),s?(s(),s=void 0):i=!0;return}if(f[0]===T){r=!0,o(new Error("completed without matching value")),s?(s(),s=void 0):i=!0;return}}}}),a=!1,i&&(s?.(),s=void 0)})}var E,M;async function pe(e,n){let t=n?.predicate??(r=>r!=null),u=n?.skipCurrent;if(n?.timeoutMs==null||n.timeoutMs<=0)return await R(e,t,{skipCurrent:u});if(E===void 0){let[r,i]=await Promise.all([import("./resilience-OBU472D2.js"),import("./backoff-HPZMEZNF.js")]);E=r.timeout,M=i.NS_PER_MS}let o=E(e,n.timeoutMs*M);return await R(o,t,{skipCurrent:u})}function be(e,n){let t=new AbortController,u=n?.reason??new Error("cancelled via nodeSignal"),o,r=!1,i=()=>{o?(o(),o=void 0):r=!0};return o=e.subscribe(s=>{if(!t.signal.aborted)for(let a of s){if(a[0]===h&&a[1]===!0){t.abort(u),i();return}if(a[0]===p){t.abort(a[1]),i();return}if(a[0]===T){i();return}}}),r&&(o?.(),o=void 0),{signal:t.signal,dispose:()=>{o&&(o(),o=void 0)}}}var me=F;function Te(e){return e.subscribe(()=>{})}function ve(e){let n=I(0);return{node:n,increment(){let t=n.cache??0;return t>=e?!1:(n.down([[A],[h,t+1]]),!0)},get(){return n.cache??0},atCap(){return(n.cache??0)>=e}}}export{L as a,P as b,$ as c,X as d,Z as e,ee as f,ne as g,te as h,re as i,D as j,q as k,H as l,V as m,B as n,oe as o,ie as p,se as q,ue as r,ae as s,de as t,fe as u,F as v,ce as w,le as x,R as y,pe as z,be as A,me as B,Te as C,ve as D};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{a as Ne,h as Re}from"./chunk-A5HZZYRK.js";import{a as Pe}from"./chunk-SGS4OJGS.js";import{x as fe}from"./chunk-JJTF75VS.js";import{a as Z,b as le,i as Oe}from"./chunk-4VVTGLXJ.js";import{f as pe}from"./chunk-MQZWA3DF.js";import{A as ee,D as be,E as U,F as B,m as J,p as D}from"./chunk-LYCLF26R.js";import{b as E,c as ye,d as ke,h as de,i as P,j as x}from"./chunk-CK2E7BTU.js";function Ce(r){return{describeKind:"producer",...r}}function oe(r,n){return B(i=>{let s=!0,u={emit(t){s&&i.emit(t)},error(t){s&&(s=!1,i.down([[x,t]]))},complete(){s&&(s=!1,i.down([[P]]))}},o;try{let t=r(u);o=typeof t=="function"?t:void 0}catch(t){return u.error(t),()=>{s=!1}}return()=>{s=!1;try{o?.()}catch{}}},Ce(n))}function Me(r,n,i){let s=!0,u,o=0,t=0,e={},a=[],c=()=>{let l=u;u=void 0;try{l?.()}catch{}};for(let l of n){let m=i?.name?`${i.name}::${l}`:l,g=i?.channelOpts?.[l],y=B(T=>(o++,()=>{t++,o>0&&t>=o&&t>=n.length&&c()}),Ce({...g,name:m}));e[l]=y,a.push(y)}let f={};for(let l of n)f[l]=m=>{s&&e[l].down([[E,m]])};f.error=l=>{s&&(s=!1,J(()=>{for(let m of a)m.down([[x,l]])}),c())},f.complete=()=>{s&&(s=!1,J(()=>{for(let l of a)l.down([[P]])}),c())};let p=r(f);return u=typeof p=="function"?p:void 0,Object.assign(e,{dispose:()=>{s&&(s=!1,J(()=>{for(let l of a)try{l.down([[P]])}catch{}}),c())}})}var he=class{ring;arr;constructor(n){n===Number.POSITIVE_INFINITY||n<=0?(this.arr=[],this.ring=null):(this.ring=new Pe(n),this.arr=null)}get length(){return this.ring!=null?this.ring.size:this.arr.length}push(n){this.ring!=null?this.ring.push(n):this.arr.push(n)}shift(){return this.ring!=null?this.ring.shift():this.arr.shift()}drain(){if(this.ring!=null){let i=this.ring.toArray();return this.ring.clear(),i}let n=this.arr;return this.arr=[],n}};function se(r){return r instanceof Error?r:new Error(String(r))}function De(r){return r===void 0?null:typeof r=="string"?Oe(r):r}function z(r,n){let{name:i,onTransportError:s,retry:u,backpressure:o,batchSize:t=Number.POSITIVE_INFINITY,flushIntervalMs:e=0,serialize:a,stopOn:c,onUpstreamMessage:f,onDispose:p,send:d,sendBatch:l,ctx:m}=n;if(!d&&!l)throw new Error("reactiveSink: `send` or `sendBatch` must be provided");let g=m,y=Math.max(1,u?.maxAttempts??1),T=De(u?.backoff??(y>1?"exponential":void 0)),h=u?.shouldRetry??(()=>!0),b=l!==void 0||t<Number.POSITIVE_INFINITY||e>0,w=k=>i?`${i}::${k}`:void 0,v=U(void 0,{equals:()=>!1,name:w("sent")}),S=U(null,{name:w("failed")}),L=U(0,{name:w("inFlight")}),F=U(null,{name:w("errors")}),K=b?U(0,{name:w("buffered")}):void 0,Y=o?U(!1,{name:w("paused")}):void 0,ie=0,Q=k=>{ie+=k,L.down([[E,ie]])},O=k=>{try{s?.(k)}catch{}try{F.down([[E,k]])}catch{}},q=new Set,V=k=>{q.add(k);let N=()=>q.delete(k);k.then(N,N)},I=(k,N,C)=>{let A=T?T(N-1,C,null):0,H=A==null?0:typeof A=="number"&&A>0?A:0,j=Math.max(1,Math.ceil(H/1e6));return new Promise(M=>{setTimeout(()=>M(k()),j)})},$=k=>k!=null&&typeof k=="object"&&typeof k.then=="function",_=k=>{let N;try{N=a?a(k):k}catch(M){let R=se(M);return O({stage:"serialize",error:R,value:k}),S.down([[E,{value:k,error:R,attempts:0}]]),Promise.resolve()}let C=0,A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k,attempt:C}),!(C<y&&h(R,C))){S.down([[E,{value:k,error:R,attempts:C}]]);return}return I(j,C,R)},H=()=>{Q(-1),v.down([[E,k]])};function j(){C+=1,Q(1);let M;try{M=d(N,g)}catch(R){return A(R)??Promise.resolve()}return $(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return j()},te=o?.maxBuffer??Number.POSITIVE_INFINITY,X=new he(te),G,ae=!1,me=()=>{K?.down([[E,X.length]])},ue=k=>{Y&&Y.down([[E,k]])},we=o?.strategy??"drop-oldest",Be=(k,N)=>{let C={value:k,payload:N};if(X.length<te)return X.push(C),me(),!0;if(we==="drop-oldest"){let H=X.shift();return X.push(C),me(),ue(!0),S.down([[E,{value:H.value,error:new Error("backpressure: buffer overflow \u2014 dropped oldest"),attempts:0}]]),!0}if(we==="drop-newest")return ue(!0),S.down([[E,{value:k,error:new Error("backpressure: buffer overflow \u2014 dropped newest"),attempts:0}]]),!1;let A=new Error("backpressure: buffer overflow");return O({stage:"send",error:A,value:k}),S.down([[E,{value:k,error:A,attempts:0}]]),ue(!0),!1},Fe=k=>{let N=0,C=k.map(M=>M.payload),A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k.map(ge=>ge.value),attempt:N}),!(N<y&&h(R,N))){for(let{value:ge}of k)S.down([[E,{value:ge,error:R,attempts:N}]]);return}return I(j,N,R)},H=()=>{Q(-1);for(let{value:M}of k)v.down([[E,M]])};function j(){N+=1,Q(1);let M;try{M=l(C,g)}catch(R){return A(R)??Promise.resolve()}return $(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return j()},He=async k=>{for(let N of k)await ze(N.value,N.payload)},ze=(k,N)=>{let C=0,A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k,attempt:C}),!(C<y&&h(R,C))){S.down([[E,{value:k,error:R,attempts:C}]]);return}return I(j,C,R)},H=()=>{Q(-1),v.down([[E,k]])};function j(){C+=1,Q(1);let M;try{M=d(N,g)}catch(R){return A(R)??Promise.resolve()}return $(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return j()},ne=()=>{if(ae||X.length===0)return Promise.resolve();let k=X.drain();if(me(),ue(!1),l!==void 0){let C=Fe(k);return V(C),C}let N=He(k);return V(N),N},qe=()=>{G!==void 0||ae||e<=0||(G=setTimeout(()=>{G=void 0,ne()},e))},Ue=r.subscribe(k=>{for(let N of k){let C=N[0];if(C!==E)try{f?.(N)}catch{}if(C===E){let A=N[1];if(b){let H;if(a)try{H=a(A)}catch(M){let R=se(M);O({stage:"serialize",error:R,value:A}),S.down([[E,{value:A,error:R,attempts:0}]]);continue}else H=A;if(!Be(A,H))continue;X.length>=t?ne():qe()}else{let H=_(A);V(H)}}else ee.messageTier(C)>=3&&b&&(G!==void 0&&(clearTimeout(G),G=void 0),ne())}}),Se;if(c){let k=!1;Se=c.subscribe(N=>{if(!k){k=!0;return}N.length>0&&!Te&&Ee()})}let Te=!1,Ee=()=>{if(Te)return;Te=!0,G!==void 0&&(clearTimeout(G),G=void 0),b&&ne(),ae=!0,Se?.(),Ue();let k=N=>{try{N.down([[de]])}catch{}};k(F),k(S),k(v),k(L),K&&k(K),Y&&k(Y);try{p?.()}catch{}},ce={dispose:Ee,sent:v,failed:S,inFlight:L,errors:F};return b&&(ce.buffered=K,ce.flush=async()=>{ae||(await ne(),await Promise.all(q))}),Y&&(ce.paused=Y),ce}function W(r){return{describeKind:"producer",...r}}function Ke(r,n){let{parse:i,closeOnTeardown:s=!1,...u}=n??{};return B(o=>{let t=!0,e,a=()=>{let T=e;e=void 0,T?.()},c=T=>{t&&(t=!1,o.down([T]),a())},f=(T,h=T)=>{if(t)try{let b=T!==null&&typeof T=="object"&&"data"in T?T.data:T,w=i?i(b,h):b;o.emit(w)}catch(b){c([x,b])}},p=T=>{c([x,T])},d=()=>{c([P])};if(typeof r=="function"){try{if(e=r(f,p,d),typeof e!="function")throw new Error("fromWebSocket register contract violation: register must return cleanup callable")}catch(T){c([x,T])}return()=>{t=!1,a()}}let l=r,m=T=>f(T,T),g=T=>p(T),y=()=>d();return l.addEventListener("message",m),l.addEventListener("error",g),l.addEventListener("close",y),e=()=>{l.removeEventListener("message",m),l.removeEventListener("error",g),l.removeEventListener("close",y),s&&l.close()},()=>{t=!1,a()}},W(u))}function Tr(r,n){return oe(r,n)}function $e(r,n){let{method:i="GET",headers:s,body:u,transform:o=b=>b.json(),timeoutNs:t=30*1e9,signal:e,completeAfterFetch:a=!1,refetchOnSubscribe:c=!1,...f}=n??{},p=U(0,{name:`${f.name??"http"}/fetchCount`}),d=U(0,{name:`${f.name??"http"}/lastUpdated`}),l=U(!1,{name:`${f.name??"http"}/fetched`}),m=0,g=u!==void 0?typeof u=="string"?u:JSON.stringify(u):void 0,y=b=>{let w=new AbortController,v=!0;if(e?.aborted)return v=!1,b.down([[x,e.reason??new Error("Aborted")]]),()=>{};e?.addEventListener("abort",()=>w.abort(e.reason),{once:!0});let S=setTimeout(()=>w.abort(new Error("Request timeout")),Math.ceil(t/1e6));return fetch(r,{method:i,headers:s,body:g,signal:w.signal}).then(async L=>{if(clearTimeout(S),!v)return;if(!L.ok)throw new Error(`HTTP ${L.status}: ${L.statusText}`);let F=await o(L);v&&(J(()=>{m+=1,p.down([[E,m]]),d.down([[E,D()]]),l.down([[E,!0]]),b.emit(F)}),a&&b.down([[P]]))}).catch(L=>{clearTimeout(S),v&&(L&&L.name==="AbortError"||b.down([[x,L]]))}),()=>{v=!1,w.abort()}},T=B(b=>y({emit:w=>b.emit(w),down:w=>b.down(w)}),{...W(f),resubscribable:c});return{...Re(T),fetchCount:p,lastUpdated:d,fetched:l}}function gr(r,n,i){let{method:s="POST",headers:u={"Content-Type":"application/json"},serialize:o=m=>JSON.stringify(m),timeoutNs:t,batchFormat:e="json-array",batchSize:a,flushIntervalMs:c,retry:f,onTransportError:p}=i??{},d=async m=>{let g=t!==void 0?new AbortController:void 0,y;g&&t!==void 0&&(y=setTimeout(()=>g.abort(new Error("Request timeout")),Math.ceil(t/1e6)));try{let T=await fetch(n,{method:s,headers:u,body:m,signal:g?.signal}),h=async()=>{try{await T.arrayBuffer?.()}catch{}};if(!T.ok)throw await h(),new Error(`HTTP ${T.status}: ${T.statusText}`);await h()}finally{y!==void 0&&clearTimeout(y)}};return a!==void 0||c!==void 0?z(r,{onTransportError:p,retry:f,batchSize:a,flushIntervalMs:c,sendBatch:async m=>{let g;e==="ndjson"?g=m.map(y=>{let T=o(y);return typeof T=="string"?T:new TextDecoder().decode(T)}).join(`
|
|
2
|
+
`):g=JSON.stringify(m),await d(g)}}):z(r,{onTransportError:p,retry:f,serialize:o,send:async m=>{await d(m)}})}function Ae(r){return Symbol.keyFor(r)??r.description??"message"}function re(r,n){return typeof r=="string"?r:n(r)}function Le(r,n){let i=`event: ${r}
|
|
3
|
+
`;if(n!==void 0){let s=n.split(/\r?\n/);for(let u of s)i+=`data: ${u}
|
|
4
|
+
`}return`${i}
|
|
5
|
+
`}function yr(r,n){let{serialize:i=l=>{if(l instanceof Error)return l.message;try{return JSON.stringify(l)}catch{return String(l)}},dataEvent:s="data",errorEvent:u="error",completeEvent:o="complete",includeResolved:t=!1,includeDirty:e=!1,keepAliveMs:a,signal:c,eventNameResolver:f=Ae}=n??{},p=new TextEncoder,d;return new ReadableStream({start(l){let m=!1,g,y=()=>{},T=()=>{m||(m=!0,g!==void 0&&clearInterval(g),c?.removeEventListener("abort",b),y(),l.close())};d=T;let h=(w,v)=>{m||l.enqueue(p.encode(Le(w,v)))},b=()=>{m||T()};y=r.subscribe(w=>{for(let v of w){let S=v[0];if(!(ee.isLocalOnly(S)&&!(S===ye&&e))){if(S===E){h(s,re(v[1],i));continue}if(S===x){h(u,re(v[1],i)),T();return}if(S===P){h(o),T();return}!t&&S===ke||h(f(S),v.length>1?re(v[1],i):void 0)}}}),a!==void 0&&a>0&&(g=setInterval(()=>{m||l.enqueue(p.encode(`: keepalive
|
|
6
|
+
|
|
7
|
+
`))},a)),c?.aborted?b():c?.addEventListener("abort",b,{once:!0})},cancel(){d?.()}})}function kr(r,n){let{serialize:i=d=>{if(d instanceof Error)return d.message;try{return JSON.stringify(d)}catch{return String(d)}},dataEvent:s="data",errorEvent:u="error",completeEvent:o="complete",includeResolved:t=!1,includeDirty:e=!1,keepAliveMs:a,signal:c,eventNameResolver:f=Ae}=n??{},p=new TextEncoder;return B(d=>{let l=!0,m,g=(h,b)=>{l&&d.emit(p.encode(Le(h,b)))},y=()=>{l&&(l=!1,d.down([[P]]))},T=r.subscribe(h=>{if(l)for(let b of h){let w=b[0];if(!(ee.isLocalOnly(w)&&!(w===ye&&e))){if(w===E){g(s,re(b[1],i));continue}if(w===x){g(u,re(b[1],i)),l=!1,d.down([[P]]);return}if(w===P){g(o),l=!1,d.down([[P]]);return}!t&&w===ke||g(f(w),b.length>1?re(b[1],i):void 0)}}});return a!==void 0&&a>0&&(m=setInterval(()=>{l&&d.emit(p.encode(`: keepalive
|
|
8
|
+
|
|
9
|
+
`))},a)),c?.aborted?y():c?.addEventListener("abort",y,{once:!0}),()=>{l=!1,m!==void 0&&clearInterval(m),c?.removeEventListener("abort",y),T()}})}function br(r){let n,i=!1;return new ReadableStream({start(s){n=r.subscribe(u=>{for(let o of u){let t=o[0];if(i)return;if(t===E)try{s.enqueue(o[1])}catch{i=!0,n?.()}else if(t===x){i=!0;try{s.error(o[1])}catch{}return}else if(t===P){i=!0;try{s.close()}catch{}return}}})},cancel(){i=!0,n?.()}})}async function*je(r,n){let i=n?.parse??(v=>v),s=n?.signal,u=new TextDecoder,o="",t="message",e=[],a,c,f=[],p=()=>{if(e.length===0&&t==="message"&&a===void 0){e=[];return}let v=e.join(`
|
|
10
|
+
`);f.push({event:t,data:i(v),id:a,retry:c}),t="message",e=[],a=void 0,c=void 0},d=v=>{if(v===""){p();return}if(v.startsWith(":"))return;let S=v.indexOf(":"),L=S<0?v:v.slice(0,S),F=S<0?"":v.slice(S+1);switch(F.startsWith(" ")&&(F=F.slice(1)),L){case"event":t=F;break;case"data":e.push(F);break;case"id":F.includes("\0")||(a=F);break;case"retry":{let K=Number(F);Number.isFinite(K)&&(c=K);break}}},l=(v,S)=>{o+=u.decode(v,{stream:!S});let L=o.split(/\r?\n/);o=L.pop()??"";for(let F of L)d(F)},m=r,g=r instanceof ReadableStream?r:m&&typeof m=="object"&&m.body instanceof ReadableStream?m.body:null,y,T,h=!1,b=()=>{h||(h=!0,y&&y.cancel().catch(()=>{}),T&&typeof T.return=="function"&&Promise.resolve(T.return()).catch(()=>{}))},w=()=>{b()};if(s){if(s.aborted)return;s.addEventListener("abort",w,{once:!0})}try{if(g){for(y=g.getReader();!s?.aborted;){let{value:v,done:S}=await y.read();if(S)break;for(l(v,!1);f.length>0;)yield f.shift()}l(new Uint8Array,!0)}else{for(T=r[Symbol.asyncIterator]();!s?.aborted;){let S=await T.next();if(S.done)break;for(l(S.value,!1);f.length>0;)yield f.shift()}l(new Uint8Array,!0)}if(o.trim()){for(let v of o.split(/\r?\n/))d(v);p()}for(;f.length>0;)yield f.shift()}finally{s&&s.removeEventListener("abort",w),b()}}function hr(r,n){let{parse:i,...s}=n??{};return B(u=>{let o=!0,t=new AbortController;return(async()=>{try{for await(let a of je(r,{parse:i,signal:t.signal})){if(!o)return;u.emit(a)}o&&u.down([[P]])}catch(a){o&&u.down([[x,a]])}})(),()=>{o=!1,t.abort()}},W(s))}function vr(r,n){let{method:i="GET",headers:s,body:u,signal:o,...t}=n??{};return B(e=>{let a=!0,c=new AbortController;if(o?.aborted)return e.down([[x,o.reason??new Error("Aborted")]]),()=>{};o?.addEventListener("abort",()=>c.abort(o.reason),{once:!0});let f=u!==void 0?typeof u=="string"?u:JSON.stringify(u):void 0;return(async()=>{try{let d=await fetch(r,{method:i,headers:s,body:f,signal:c.signal});if(!a)return;if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);if(!d.body)throw new Error("HTTP response has no body");let l=d.body.getReader();for(;a;){let{value:m,done:g}=await l.read();if(g)break;m&&e.emit(m)}a&&e.down([[P]])}catch(d){if(!a||d&&d.name==="AbortError")return;e.down([[x,d]])}})(),()=>{a=!1,c.abort()}},W(t))}function wr(r,n){let{intervalMs:i=5e3,...s}=n??{};return fe(pe(i,{period:i}),()=>$e(r,{...s,completeAfterFetch:!0}).node)}function Sr(r,n,i){let{serialize:s=T=>{if(typeof T=="string"||T instanceof Blob||T instanceof ArrayBuffer||ArrayBuffer.isView(T))return T;try{return JSON.stringify(T)}catch{return String(T)}},closeOnComplete:u=!0,closeOnError:o=!0,closeCode:t,closeReason:e,onTransportError:a,retry:c,backpressure:f,stopOn:p}=i??{},d=!1,l=T=>{if(!d){d=!0;try{n.close(t,e)}catch(h){let b=h instanceof Error?h:new Error(String(h));try{a?.({stage:"close",error:b,value:void 0,message:T})}catch{}}}},m=null,y=z(r,{onTransportError:a,serialize:T=>{let h=s(T);if(h===void 0)throw new Error("serialize returned undefined");return h},retry:c,backpressure:f,stopOn:p,onDispose:()=>{if(m){try{n.removeEventListener("close",m)}catch{}m=null}},send:T=>{n.send(T)},onUpstreamMessage:T=>{(T[0]===P&&u||T[0]===x&&o)&&l(T)}});return m=()=>{d=!0,y.dispose()},n.addEventListener("close",m),y}function Er(r,n){let{parse:i,maxRetries:s,backoff:u="exponential",closeOnTeardown:o=!0,...t}=n??{};return Ne(()=>Ke(r(),{parse:i,closeOnTeardown:o,...t}),{count:s,backoff:u})}function xr(r,n){let{method:i="notifications/message",onDisconnect:s,...u}=n??{};return oe(({emit:o,error:t})=>(r.setNotificationHandler(i,e=>o(e)),s?.(e=>t(e??new Error("MCP client disconnected"))),()=>r.setNotificationHandler(i,()=>{})),u)}function Or(r,n){return Me(({traces:s,metrics:u,logs:o,error:t})=>r({onTraces:e=>{J(()=>{for(let a of e)s(a)})},onMetrics:e=>{J(()=>{for(let a of e)u(a)})},onLogs:e=>{J(()=>{for(let a of e)o(a)})},onError:t})??void 0,["traces","metrics","logs"],n?.name?{name:n.name}:void 0)}function Nr(r,n){return oe(r,n)}function Rr(r){let n=r.match(/^<(\d{1,3})>\d?\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)/s);if(!n){let s=D();return{facility:1,severity:6,timestamp:new Date(Math.floor(s/1e6)).toISOString(),hostname:"-",appName:"-",procId:"-",msgId:"-",message:r.trim(),timestampNs:s}}let i=Number(n[1]);return{facility:i>>3,severity:i&7,timestamp:n[2],hostname:n[3],appName:n[4],procId:n[5],msgId:n[6],message:(n[7]??"").trim(),timestampNs:D()}}function Pr(r,n){return oe(r,n)}var We={c:"counter",g:"gauge",ms:"timer",h:"histogram",s:"set",d:"distribution"};function Cr(r){let n=r.split("|"),[i,s]=(n[0]??"").split(":");if(!i||s===void 0)throw new Error(`Invalid StatsD line: ${r}`);let u=n[1]?.trim()??"c",o=We[u]??"counter",t=o==="set"?0:Number(s),e,a={};for(let c=2;c<n.length;c++){let f=n[c].trim();if(f.startsWith("@"))e=Number(f.slice(1));else if(f.startsWith("#"))for(let p of f.slice(1).split(",")){let[d,l]=p.split(":");d&&(a[d]=l??"")}}return{name:i.trim(),value:t,type:o,sampleRate:e,tags:a,timestampNs:D()}}function Mr(r,n){let{intervalNs:i=15*1e9,headers:s,timeoutNs:u=10*1e9,signal:o,maxConsecutiveErrors:t=1}=n??{},e=Math.ceil(i/1e6),a=0;return fe(pe(0,{period:e,signal:o}),()=>B(c=>{let f=!0,p=new AbortController,d=setTimeout(()=>p.abort(new Error("Scrape timeout")),Math.ceil(u/1e6));return(async()=>{try{let m=await fetch(r,{headers:{Accept:"text/plain",...s},signal:p.signal});if(clearTimeout(d),!f)return;if(!m.ok)throw new Error(`Prometheus scrape ${m.status}: ${m.statusText}`);let g=await m.text();if(!f)return;let y=Qe(g);for(let T of y)c.emit(T);a=0,c.down([[P]])}catch(m){if(clearTimeout(d),!f||m instanceof Error&&m.name==="AbortError")return;a+=1,a>=t&&c.down([[x,m]])}})(),()=>{f=!1,clearTimeout(d),p.abort()}}))}function Qe(r){let n=[],i=new Map,s=new Map;for(let u of r.split(`
|
|
11
|
+
`)){let o=u.trim();if(!o)continue;if(o.startsWith("# TYPE ")){let d=o.slice(7),l=d.indexOf(" ");l>0&&i.set(d.slice(0,l),d.slice(l+1).trim());continue}if(o.startsWith("# HELP ")){let d=o.slice(7),l=d.indexOf(" ");l>0&&s.set(d.slice(0,l),d.slice(l+1).trim());continue}if(o.startsWith("#"))continue;let t,e={},a,c,f=o.indexOf("{");if(f>=0){t=o.slice(0,f);let d=o.indexOf("}",f);if(d<0)continue;let l=o.slice(f+1,d);e=Je(l);let m=o.slice(d+1).trim().split(/\s+/);a=m[0]??"",c=m[1]}else{let d=o.split(/\s+/);t=d[0]??"",a=d[1]??"",c=d[2]}if(!t||!a)continue;let p=t.replace(/(_total|_count|_sum|_bucket|_created|_info)$/,"");n.push({name:t,labels:e,value:Number(a),timestampMs:c?Number(c):void 0,type:i.get(p)??i.get(t),help:s.get(p)??s.get(t),timestampNs:D()})}return n}function Je(r){let n={},i=/(\w+)="((?:[^"\\]|\\.)*)"/g,s=i.exec(r);for(;s!==null;)n[s[1]]=s[2].replace(/\\(.)/g,"$1"),s=i.exec(r);return n}function Ar(r,n,i){let{fromBeginning:s=!1,deserialize:u=t=>{if(t===null)return null;try{return JSON.parse(t.toString())}catch{return t.toString()}},...o}=i??{};return B(t=>{let e=!0;return(async()=>{try{await r.subscribe({topic:n,fromBeginning:s}),await r.run({eachMessage:async({topic:c,partition:f,message:p})=>{if(!e)return;let d={};if(p.headers)for(let[l,m]of Object.entries(p.headers))m!==void 0&&(d[l]=typeof m=="string"?m:m.toString());t.emit({topic:c,partition:f,key:p.key?.toString()??null,value:u(p.value),headers:d,offset:p.offset,timestamp:p.timestamp,timestampNs:D()})}})}catch(c){e&&t.down([[x,c]])}})(),()=>{e=!1}},W(o))}function Lr(r,n,i,s){let{serialize:u=e=>JSON.stringify(e),keyExtractor:o,onTransportError:t}=s??{};return z(r,{onTransportError:t,send:async e=>{let a=o?.(e)??null,c=u(e);await n.send({topic:i,messages:[{key:a,value:Buffer.from(c)}]})}})}function Ir(r,n,i){let{blockMs:s=5e3,startId:u="$",parse:o=e=>{for(let c=0;c<e.length;c+=2)if(e[c]==="data")try{return JSON.parse(e[c+1])}catch{return e[c+1]}let a={};for(let c=0;c<e.length;c+=2)a[e[c]]=e[c+1];return a},...t}=i??{};return B(e=>{let a=!0,c=u;return(async()=>{for(;a;)try{let p=await r.xread("BLOCK",s,"STREAMS",n,c);if(!a)return;if(p)for(let[d,l]of p)for(let[m,g]of l)c=m,e.emit({id:m,key:n,data:o(g),timestampNs:D()})}catch(p){if(!a)return;e.down([[x,p]]);return}})(),()=>{a=!1}},W(t))}function Br(r,n,i,s){let{serialize:u=e=>["data",JSON.stringify(e)],maxLen:o,onTransportError:t}=s??{};return z(r,{onTransportError:t,send:async e=>{let a=u(e);await(o!==void 0?n.xadd(i,"MAXLEN","~",String(o),"*",...a):n.xadd(i,"*",...a))}})}function Fr(r,n){let{delimiter:i=",",hasHeader:s=!0,columns:u,parseLine:o,...t}=n??{},e=o??(a=>Ie(a,i));return B(a=>{let c=!1;return(async()=>{try{let p=u,d="";for await(let l of r){if(c)return;d+=l;let m=d.split(/\r?\n/);d=m.pop()??"";for(let g of m){if(c)return;if(!g.trim())continue;let y=e(g);if(!p&&s){p=y;continue}p||(p=y.map((h,b)=>`col${b}`));let T={};for(let h=0;h<p.length;h++)T[p[h]]=y[h]??"";a.emit(T)}}if(!c&&d.trim()){let l=e(d);if(p){let m={};for(let g=0;g<p.length;g++)m[p[g]]=l[g]??"";a.emit(m)}}c||a.down([[P]])}catch(p){c||a.down([[x,p]])}})(),()=>{c=!0}},W(t))}function Hr(r,n){let{delimiter:i=",",hasHeader:s=!0,columns:u,parseLine:o,...t}=n??{},e=o??(a=>Ie(a,i));return be([r],(a,c,f)=>{let p=a[0];if(p==null||p.length===0)return;let d=f.store;typeof d.buffer!="string"&&(d.buffer=""),d.headers===void 0&&u&&(d.headers=u.slice());for(let l of p){d.buffer=d.buffer+l;let m=d.buffer.split(/\r?\n/);d.buffer=m.pop()??"";for(let g of m){if(!g.trim())continue;let y=e(g);if(!d.headers&&s){d.headers=y;continue}d.headers||(d.headers=y.map((h,b)=>`col${b}`));let T={};for(let h=0;h<d.headers.length;h++)T[d.headers[h]]=y[h]??"";c.emit(T)}}},{describeKind:"derived",...t})}function zr(r,n){return be([r],(i,s,u)=>{let o=i[0];if(o==null||o.length===0)return;let t=u.store;typeof t.buffer!="string"&&(t.buffer="");for(let e of o){t.buffer=t.buffer+e;let a=t.buffer.split(/\r?\n/);t.buffer=a.pop()??"";for(let c of a)if(c.trim())try{s.emit(JSON.parse(c))}catch(f){s.down([[x,f]]);return}}},{describeKind:"derived",...n??{}})}function Ie(r,n){let i=[],s="",u=!1;for(let o=0;o<r.length;o++){let t=r[o];u?t==='"'?r[o+1]==='"'?(s+='"',o++):u=!1:s+=t:t==='"'?u=!0:t===n?(i.push(s),s=""):s+=t}return i.push(s),i}function qr(r,n){return B(i=>{let s=!1;return(async()=>{try{let o="";for await(let t of r){if(s)return;o+=t;let e=o.split(/\r?\n/);o=e.pop()??"";for(let a of e){if(s)return;let c=a.trim();c&&i.emit(JSON.parse(c))}}!s&&o.trim()&&i.emit(JSON.parse(o.trim())),s||i.down([[P]])}catch(o){s||i.down([[x,o]])}})(),()=>{s=!0}},W(n))}function Ur(r,n,i){let{intervalNs:s=5*1e9,format:u="JSONEachRow",signal:o,maxConsecutiveErrors:t=1}=i??{},e=Math.ceil(s/1e6),a=0;return fe(pe(0,{period:e,signal:o}),()=>B(c=>{let f=!0;return(async()=>{try{let d=await r.query({query:n,format:u});if(!f)return;let l=await d.json();if(!f)return;for(let m of l)c.emit(m);a=0,c.down([[P]])}catch(d){if(!f)return;a+=1,a>=t&&c.down([[x,d]])}})(),()=>{f=!1}}))}function Dr(r,n){let{autoAck:i=!0,deserialize:s=e=>{try{return JSON.parse(e.toString())}catch{return e.toString()}},onAckError:u,...o}=n??{},t=e=>{if(u)try{u(e instanceof Error?e:new Error(String(e)))}catch{}};return B(e=>{let a=!0;return(async()=>{for(;a;)try{let f=await r.receive();if(!a)return;let p={topic:f.getTopicName(),messageId:f.getMessageId().toString(),key:f.getPartitionKey(),value:s(f.getData()),properties:f.getProperties(),publishTime:f.getPublishTimestamp(),eventTime:f.getEventTimestamp(),timestampNs:D()};if(i)e.emit(p),r.acknowledge(f).catch(t);else{let d=!1,l={value:p,ack(){d||(d=!0,r.acknowledge(f).catch(t))},nack(m){if(d)return;d=!0;let g=r;try{let y=g.negativeAcknowledge?.(f);y&&typeof y.then=="function"&&y.catch(t)}catch(y){t(y)}}};e.emit(l)}}catch(f){a&&e.down([[x,f]]);return}})(),()=>{a=!1}},W(o))}function Kr(r,n,i){let{serialize:s=e=>Buffer.from(JSON.stringify(e)),keyExtractor:u,propertiesExtractor:o,onTransportError:t}=i??{};return z(r,{onTransportError:t,send:async e=>{await n.send({data:s(e),partitionKey:u?.(e),properties:o?.(e)})}})}function $r(r,n,i){let s=new TextDecoder,{queue:u,deserialize:o=e=>{let a=s.decode(e);try{return JSON.parse(a)}catch{return a}},...t}=i??{};return B(e=>{let a=!0,c=r.subscribe(n,u?{queue:u}:void 0);return(async()=>{try{for await(let p of c){if(!a)return;let d={};if(p.headers)for(let l of p.headers.keys())d[l]=p.headers.get(l);e.emit({subject:p.subject,data:o(p.data),headers:d,reply:p.reply,sid:p.sid,timestampNs:D()})}a&&e.down([[P]])}catch(p){a&&e.down([[x,p]])}})(),()=>{a=!1}},W(t))}function jr(r,n,i,s){let u=new TextEncoder,{serialize:o=e=>u.encode(JSON.stringify(e)),onTransportError:t}=s??{};return z(r,{onTransportError:t,send:e=>{n.publish(i,o(e))}})}function Wr(r,n,i){let{autoAck:s=!0,deserialize:u=a=>{try{return JSON.parse(a.toString())}catch{return a.toString()}},onAckError:o,...t}=i??{},e=a=>{if(o)try{o(a instanceof Error?a:new Error(String(a)))}catch{}};return B(a=>{let c=!0,f;return(async()=>{try{f=(await r.consume(n,l=>{if(!c)return;if(l===null){c&&a.down([[x,new Error("Consumer cancelled by broker")]]);return}let m={queue:n,routingKey:l.fields.routingKey,exchange:l.fields.exchange,content:u(l.content),properties:l.properties,deliveryTag:l.fields.deliveryTag,redelivered:l.fields.redelivered,timestampNs:D()};if(s){a.emit(m);try{r.ack(l)}catch(g){e(g)}}else{let g=!1,y=r,T={value:m,ack(){if(!g){g=!0;try{r.ack(l)}catch(h){e(h)}}},nack(h){if(g)return;g=!0;let b=h?.requeue;if(!y.nack){e(new Error("RabbitMQ channel does not expose `nack`; cannot negative-ack"));return}try{y.nack(l,!1,b)}catch(w){e(w)}}};a.emit(T)}},{noAck:!1})).consumerTag}catch(d){c&&a.down([[x,d]])}})(),()=>{c=!1,f!==void 0&&r.cancel(f)}},W(t))}function Qr(r,n,i,s){let{serialize:u=e=>Buffer.from(JSON.stringify(e)),routingKeyExtractor:o=()=>"",onTransportError:t}=s??{};return z(r,{onTransportError:t,send:e=>{let a=o(e),c=u(e);n.publish(i,a,c)}})}function Ve(r,n,i){let{serialize:s=p=>`${JSON.stringify(p)}
|
|
12
|
+
`,flushIntervalMs:u=0,batchSize:o=Number.POSITIVE_INFINITY,onTransportError:t,mode:e}=i??{},c=u>0||o<Number.POSITIVE_INFINITY?z(r,{onTransportError:t,batchSize:o,flushIntervalMs:u,serialize:s,sendBatch:p=>{n.write(p.join(""))}}):z(r,{onTransportError:t,serialize:s,send:p=>{n.write(p)}}),f=c.dispose;return c.dispose=()=>{f();try{n.end()}catch{}},c}function ve(r,n){return r.includes(n)||r.includes('"')||r.includes(`
|
|
13
|
+
`)?`"${r.replace(/"/g,'""')}"`:r}function Jr(r,n,i){let{columns:s,delimiter:u=",",writeHeader:o=!0,cellExtractor:t=(l,m)=>String(l[m]??""),flushIntervalMs:e=0,batchSize:a=Number.POSITIVE_INFINITY,onTransportError:c,...f}=i,p=!1;return Ve(r,n,{serialize:l=>{if(!p&&o){p=!0;let m=s.map(y=>ve(y,u)).join(u),g=s.map(y=>ve(t(l,y),u)).join(u);return`${m}
|
|
14
|
+
${g}
|
|
15
|
+
`}return`${s.map(m=>ve(t(l,m),u)).join(u)}
|
|
16
|
+
`},flushIntervalMs:e,batchSize:a,onTransportError:c,...f})}function Vr(r,n,i,s){let{batchSize:u=1e3,flushIntervalMs:o=5e3,format:t="JSONEachRow",transform:e=c=>c,onTransportError:a}=s??{};return z(r,{onTransportError:a,batchSize:u,flushIntervalMs:o,serialize:e,sendBatch:async c=>{await n.insert({table:i,values:c,format:t})}})}function _r(r,n,i,s){let{format:u="ndjson",keyGenerator:o=(d,l)=>{let m=Math.floor(l/1e6);return`data/${new Date(m).toISOString().replace(/[:.]/g,"-")}-${d}.${u==="ndjson"?"ndjson":"json"}`},batchSize:t=1e3,flushIntervalMs:e=1e4,transform:a=d=>d,onTransportError:c}=s??{},f=u==="ndjson"?"application/x-ndjson":"application/json",p=0;return z(r,{onTransportError:c,batchSize:t,flushIntervalMs:e,serialize:a,sendBatch:async d=>{p+=1;let l=u==="ndjson"?`${d.map(g=>JSON.stringify(g)).join(`
|
|
17
|
+
`)}
|
|
18
|
+
`:JSON.stringify(d),m=o(p,D());await n.putObject({Bucket:i,Key:m,Body:l,ContentType:f})}})}function Gr(r,n,i,s){let{toSQL:u=(t,e)=>({sql:`INSERT INTO "${e.replace(/"/g,'""')}" (data) VALUES ($1)`,params:[JSON.stringify(t)]}),onTransportError:o}=s??{};return z(r,{onTransportError:o,serialize:t=>u(t,i),send:async t=>{let e=t;await n.query(e.sql,e.params)}})}function Yr(r,n,i){let{toDocument:s=o=>o,onTransportError:u}=i??{};return z(r,{onTransportError:u,serialize:s,send:async o=>{await n.insertOne(o)}})}function Xr(r,n,i){let{labels:s={},toLine:u=e=>JSON.stringify(e),toLabels:o,onTransportError:t}=i??{};return z(r,{onTransportError:t,serialize:e=>({line:u(e),labels:o?{...s,...o(e)}:s}),send:async e=>{let{line:a,labels:c}=e,f=`${D()}`;await n.push({streams:[{stream:c,values:[[f,a]]}]})}})}function Zr(r,n,i){let{toResourceSpans:s=o=>[o],onTransportError:u}=i??{};return z(r,{onTransportError:u,serialize:s,send:async o=>{await n.push({resourceSpans:o})}})}function et(r,n,i,s){let{prefix:u="checkpoints/",debounceMs:o=500,compactEvery:t=10,onError:e}=s??{},a={name:`s3:${i}`,debounceMs:o,compactEvery:t,save(c){let f=Math.floor(D()/1e6),p=`${u}${r.name}/checkpoint-${f}.json`,d;try{d=JSON.stringify(c)}catch(l){e?.(l);return}n.putObject({Bucket:i,Key:p,Body:d,ContentType:"application/json"}).catch(l=>e?.(l))}};return r.attachSnapshotStorage([a],{onError:c=>e?.(c)})}function rt(r,n,i){let{prefix:s="graphrefly:checkpoint:",debounceMs:u=500,compactEvery:o=10,onError:t}=i??{},e=`${s}${r.name}`,a={name:`redis:${e}`,debounceMs:u,compactEvery:o,save(c){let f;try{f=JSON.stringify(c)}catch(p){t?.(p);return}n.set(e,f).catch(p=>t?.(p))},async load(){let c=await n.get(e);if(c!=null)try{return JSON.parse(c)}catch{return}}};return r.attachSnapshotStorage([a],{onError:c=>t?.(c)})}function tt(r,n,i){let{mapRow:s=t=>t,params:u,...o}=i??{};return B(t=>{try{let a=r.query(n,u).map(s);t.emit(a),t.down([[P]])}catch(e){t.down([[x,e instanceof Error?e:new Error(String(e))]])}},{describeKind:"producer",completeWhenDepsComplete:!1,...o})}function nt(r,n,i){let{mapRow:s=t=>t,params:u,...o}=i??{};return B(t=>{try{let e=r.iterate(n,u);J(()=>{for(let a of e)t.emit(s(a));t.down([[P]])})}catch(e){t.down([[x,e instanceof Error?e:new Error(String(e))]])}},{describeKind:"producer",completeWhenDepsComplete:!1,...o})}function ot(r,n,i,s){if(i.includes("\0")||i.length===0)throw new Error(`toSqlite: invalid table name: ${JSON.stringify(i)}`);let{toSQL:u=(O,q)=>({sql:`INSERT INTO "${q.replace(/"/g,'""')}" (data) VALUES (?)`,params:[JSON.stringify(O)]}),onTransportError:o,batchInsert:t=!1,maxBatchSize:e=1e3,flushIntervalMs:a=0}=s??{},c=O=>u(O,i);if(!t)return z(r,{onTransportError:o,serialize:c,send:O=>{let q=O;n.query(q.sql,q.params)}});let f=U(null),p=U(void 0,{equals:()=>!1}),d=U(null),l=U(0),m=U(0),g=O=>{try{o?.(O)}catch{}try{f.down([[E,O]])}catch{}},y=[],T=!1,h,b=!1,w=()=>m.down([[E,y.length]]),v=O=>{b||p.down([[E,O]])},S=O=>{b||d.down([[E,O]])},L=O=>{b||l.down([[E,O]])},F=O=>{b||g(O)},K=()=>{if(y.length===0||T)return;T=!0,L(1);try{n.query("BEGIN",[])}catch(I){T=!1,L(0),F({stage:"send",error:I instanceof Error?I:new Error(String(I)),value:void 0});return}let O=y;y=[],w();let q,V=0;for(let I of O)try{n.query(I.query.sql,I.query.params),V+=1}catch($){q=$ instanceof Error?$:new Error(String($));break}if(q){try{n.query("ROLLBACK",[])}catch{}F({stage:"send",error:q,value:void 0});for(let I of O)S({value:I.value,error:q,attempts:1})}else try{n.query("COMMIT",[]);for(let I of O)v(I.value)}catch(I){let $=I instanceof Error?I:new Error(String(I));F({stage:"send",error:$,value:void 0});for(let _=0;_<V;_++)S({value:O[_].value,error:$,attempts:1})}T=!1,L(0)},Y=()=>{a>0&&h===void 0&&!b&&(h=setTimeout(()=>{h=void 0,K()},a))},ie=r.subscribe(O=>{for(let q of O){let V=q[0];if(V===E){let I=q[1],$;try{$=c(I)}catch(_){let te=_ instanceof Error?_:new Error(String(_));g({stage:"serialize",error:te,value:I}),d.down([[E,{value:I,error:te,attempts:0}]]);continue}y.push({value:I,query:$}),w(),y.length>=e?K():Y()}else ee.messageTier(V)>=3&&K()}});return{dispose:()=>{if(!b){h!==void 0&&(clearTimeout(h),h=void 0),K(),b=!0,ie();for(let O of[f,p,d,l,m])try{O.down([[de]])}catch{}}},sent:p,failed:d,inFlight:l,errors:f,buffered:m,flush:async()=>{b||K()}}}function st(r,n){let{args:i,mapRow:s=o=>o,...u}=n??{};return B(o=>{let t=!0;return r.findMany(i).then(e=>{t&&(o.emit(e.map(s)),o.down([[P]]))}).catch(e=>{if(t)try{o.down([[x,e instanceof Error?e:new Error(String(e))]])}catch{}}),()=>{t=!1}},{...u,describeKind:"producer",completeWhenDepsComplete:!1})}function it(r,n){let{mapRow:i=u=>u,...s}=n??{};return B(u=>{let o=!0;return r.execute().then(t=>{o&&(u.emit(t.map(i)),u.down([[P]]))}).catch(t=>{if(o)try{u.down([[x,t instanceof Error?t:new Error(String(t))]])}catch{}}),()=>{o=!1}},{...s,describeKind:"producer",completeWhenDepsComplete:!1})}function at(r,n){let{mapRow:i=u=>u,...s}=n??{};return B(u=>{let o=!0;return r.execute().then(t=>{o&&(u.emit(t.map(i)),u.down([[P]]))}).catch(t=>{if(o)try{u.down([[x,t instanceof Error?t:new Error(String(t))]])}catch{}}),()=>{o=!1}},{...s,describeKind:"producer",completeWhenDepsComplete:!1})}async function ct(r,n){let i;try{i=await r.text()}catch{i=""}let s=n??"HTTP",u=new Error(`${s} API ${r.status}: ${r.statusText}${i?` \u2014 ${i}`:""}`);return u.status=r.status,u.headers=r.headers,u}export{oe as a,Me as b,z as c,Ke as d,Tr as e,$e as f,gr as g,yr as h,kr as i,br as j,je as k,hr as l,vr as m,wr as n,Sr as o,Er as p,xr as q,Or as r,Nr as s,Rr as t,Pr as u,Cr as v,Mr as w,Qe as x,Ar as y,Lr as z,Ir as A,Br as B,Fr as C,Hr as D,zr as E,qr as F,Ur as G,Dr as H,Kr as I,$r as J,jr as K,Wr as L,Qr as M,Ve as N,Jr as O,Vr as P,_r as Q,Gr as R,Yr as S,Xr as T,Zr as U,et as V,rt as W,tt as X,nt as Y,ot as Z,st as _,it as $,at as aa,ct as ba};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as O,f as v,k as P}from"./chunk-
|
|
1
|
+
import{a as O,f as v,k as P}from"./chunk-5CPPC75H.js";import{ba as _,k as A}from"./chunk-MYFR67PY.js";import{c as E}from"./chunk-A5HZZYRK.js";import{m as U,x as T}from"./chunk-MQZWA3DF.js";import{o as y}from"./chunk-LYCLF26R.js";function G(e={}){return e.sdk?V(e):H(e)}function b(e,t,o,r){let s=t?.model??o;if(!s)throw new Error("anthropicAdapter: model must be set via options.model or invokeOpts.model");let{system:n,chat:i}=J(e,t?.systemPrompt),a={model:s,messages:i.map(F),max_tokens:t?.maxTokens??4096};return n&&(a.system=n),t?.temperature!=null&&(a.temperature=t.temperature),t?.tools&&t.tools.length>0&&(a.tools=t.tools.map(Y)),t?.maxReasoningTokens!=null&&(a.thinking={type:"enabled",budget_tokens:t.maxReasoningTokens}),t?.cacheHint,r&&(a.stream=!0),t?.providerExtras&&Object.assign(a,t.providerExtras),a}function J(e,t){let o=[];t&&o.push(t);let r=[];for(let s of e)s.role==="system"?o.push(s.content):r.push(s);return{system:o.length>0?o.join(`
|
|
2
2
|
|
|
3
3
|
`):void 0,chat:r}}function F(e){if(e.role==="tool")return{role:"user",content:[{type:"tool_result",tool_use_id:e.toolCallId,content:e.content}]};if(e.role==="assistant"&&e.toolCalls&&e.toolCalls.length>0){let t=[];e.content&&t.push({type:"text",text:e.content});for(let o of e.toolCalls)t.push({type:"tool_use",id:o.id,name:o.name,input:o.arguments});return{role:"assistant",content:t}}return{role:e.role,content:e.content}}function Y(e){return{name:e.name,description:e.description,input_schema:e.parameters}}function R(e,t){if(!e)return{...t};let o={...e};return t.input_tokens!=null&&(o.input_tokens=t.input_tokens),t.output_tokens!=null&&(o.output_tokens=t.output_tokens),t.cache_read_input_tokens!=null&&(o.cache_read_input_tokens=t.cache_read_input_tokens),t.cache_creation_input_tokens!=null&&(o.cache_creation_input_tokens=t.cache_creation_input_tokens),t.cache_creation&&(o.cache_creation={...e.cache_creation??{},...t.cache_creation}),t.server_tool_use&&(o.server_tool_use={...e.server_tool_use??{},...t.server_tool_use}),o}function x(e){let t={input:{regular:e?.input_tokens??0},output:{regular:e?.output_tokens??0},raw:e};return e?.cache_read_input_tokens&&(t.input.cacheRead=e.cache_read_input_tokens),e?.cache_creation?(e.cache_creation.ephemeral_5m_input_tokens&&(t.input.cacheWrite5m=e.cache_creation.ephemeral_5m_input_tokens),e.cache_creation.ephemeral_1h_input_tokens&&(t.input.cacheWrite1h=e.cache_creation.ephemeral_1h_input_tokens)):e?.cache_creation_input_tokens&&(t.input.cacheWrite5m=e.cache_creation_input_tokens),e?.server_tool_use?.web_search_requests&&(t.auxiliary={webSearchRequests:e.server_tool_use.web_search_requests}),t}function K(e,t){let o=[],r=[];for(let s of e.content)if(s.type==="text"&&typeof s.text=="string")o.push(s.text);else if(s.type==="tool_use"){let n=s;r.push({id:n.id,name:n.name,arguments:n.input??{}})}return{content:o.join(""),toolCalls:r.length>0?r:void 0,usage:x(e.usage),finishReason:e.stop_reason,latencyMs:t,model:e.model,provider:"anthropic"}}function H(e){let t=e.apiKey??globalThis.process?.env?.ANTHROPIC_API_KEY,o=e.baseURL??"https://api.anthropic.com",r=e.anthropicVersion??"2023-06-01",s=e.fetchImpl??fetch,n=()=>{if(!t)throw new Error("anthropicAdapter: apiKey required for invoke/stream (or provide opts.sdk)");return{"x-api-key":t,"anthropic-version":r,"content-type":"application/json",...e.headers??{}}};return{provider:"anthropic",model:e.model,async invoke(i,a){let d=b(i,a,e.model,!1),g=y(),l=await s(`${o}/v1/messages`,{method:"POST",headers:n(),body:JSON.stringify(d),signal:a?.signal});if(!l.ok)throw await _(l,"Anthropic");let c=await l.json(),p=Math.max(0,(y()-g)/1e6);return K(c,p)},async*stream(i,a){let d=b(i,a,e.model,!0),g=await s(`${o}/v1/messages`,{method:"POST",headers:{...n(),accept:"text/event-stream"},body:JSON.stringify(d),signal:a?.signal});if(!g.ok)throw await _(g,"Anthropic");if(!g.body)throw new Error("anthropicAdapter: streaming response has no body");let l,c,p=new Map;for await(let m of A(g.body,{signal:a?.signal})){let h=m.data;if(!h)continue;let k;try{k=JSON.parse(h)}catch{continue}switch(k.type){case"message_start":{l=R(l,k.message.usage);break}case"content_block_start":{let u=k,f=u.content_block;f.type==="tool_use"&&(p.set(u.index,{id:String(f.id??""),name:String(f.name??""),argBuf:""}),yield{type:"tool-call-delta",delta:{id:String(f.id??""),name:String(f.name??"")}});break}case"content_block_delta":{let u=k,f=u.delta;if(f.type==="text_delta"&&typeof f.text=="string")yield{type:"token",delta:f.text};else if(f.type==="input_json_delta"&&typeof f.partial_json=="string"){let S=p.get(u.index);S&&(S.argBuf+=f.partial_json),yield{type:"tool-call-delta",delta:{argumentsDelta:f.partial_json}}}else f.type==="thinking_delta"&&typeof f.thinking=="string"&&(yield{type:"thinking",delta:f.thinking});break}case"message_delta":{let u=k;u.delta.stop_reason&&(c=u.delta.stop_reason),u.delta.usage&&(l=R(l,u.delta.usage));break}case"message_stop":break}}l&&(yield{type:"usage",usage:x(l)}),yield{type:"finish",reason:c??"stop"}}}}function V(e){let t=e.sdk;if(!t)throw new Error("sdkBackedAnthropic: sdk instance required");return{provider:"anthropic",model:e.model,async invoke(o,r){let s=b(o,r,e.model,!1),n=y(),i=await t.messages.create(s,{signal:r?.signal}),a=Math.max(0,(y()-n)/1e6);return K(i,a)},async*stream(o,r){if(!t.messages.stream)throw new Error("sdkBackedAnthropic: SDK instance does not expose .messages.stream");let s=b(o,r,e.model,!0),n,i;for await(let a of t.messages.stream(s,{signal:r?.signal}))switch(a.type){case"message_start":n=R(n,a.message.usage);break;case"content_block_delta":{let d=a.delta;d?.type==="text_delta"&&typeof d.text=="string"?yield{type:"token",delta:d.text}:d?.type==="input_json_delta"&&typeof d.partial_json=="string"?yield{type:"tool-call-delta",delta:{argumentsDelta:d.partial_json}}:d?.type==="thinking_delta"&&typeof d.thinking=="string"&&(yield{type:"thinking",delta:d.thinking});break}case"message_delta":{let d=a;d.delta.stop_reason&&(i=d.delta.stop_reason),d.delta.usage&&(n=R(n,d.delta.usage));break}}n&&(yield{type:"usage",usage:x(n)}),yield{type:"finish",reason:i??"stop"}}}}function D(e={}){return e.sdk?X(e):Q(e)}function w(e,t){let o=[],r=[];t?.systemPrompt&&o.push(t.systemPrompt);for(let i of e){if(i.role==="system"){o.push(i.content);continue}if(i.role==="tool"){r.push({role:"user",parts:[{functionResponse:{name:i.name??i.toolCallId??"tool",response:{result:i.content}}}]});continue}if(i.role==="assistant"&&i.toolCalls&&i.toolCalls.length>0){let a=[];i.content&&a.push({text:i.content});for(let d of i.toolCalls)a.push({functionCall:{name:d.name,args:d.arguments}});r.push({role:"model",parts:a});continue}r.push({role:i.role==="assistant"?"model":"user",parts:[{text:i.content}]})}let s={contents:r};o.length>0&&(s.systemInstruction={role:"system",parts:[{text:o.join(`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $}from"./chunk-
|
|
1
|
+
import{a as $}from"./chunk-BGEY3PXH.js";import{c as O}from"./chunk-O32GJOUJ.js";import{a as C}from"./chunk-T6RPUERH.js";import{j as A}from"./chunk-5KPIYVCC.js";import{b as x}from"./chunk-RLMYS3XZ.js";import{C as R}from"./chunk-MQZWA3DF.js";import{C as T,E as N,G as E,o as b,p as w,u as P,w as S}from"./chunk-LYCLF26R.js";import{b as v}from"./chunk-CK2E7BTU.js";import{b as M}from"./chunk-QYADASLV.js";var J={};M(J,{AuditTrailGraph:()=>k,PolicyEnforcerGraph:()=>G,auditTrail:()=>z,complianceSnapshot:()=>F,policyEnforcer:()=>K,reactiveExplainPath:()=>q});function V(i,t){return O("audit",i,t)}var L=new Set(["data","error","complete","teardown"]),k=class extends A{entries;count;_log;_target;constructor(t,n){super(n.name??`${t.name}_audit`,n.graph),this._target=t,this._log=x([],{name:"entries",...n.maxSize!=null?{maxSize:n.maxSize}:{}}),this.entries=this._log.entries,this.add(this.entries,{name:"entries"}),this.count=E([this.entries],([c])=>c.length,{name:"count",describeKind:"derived",meta:V("count")}),this.add(this.count,{name:"count"}),this.addDisposer(R(this.count));let o=n.includeTypes!=null?new Set(n.includeTypes):L,u=n.filter,a=0,h=t.observe({timeline:!0,structured:!0}),m=h.onEvent(c=>{if(c.type==="derived")return;let e=c.type;if(!o.has(e))return;let d=c.path??"",r={seq:a++,timestamp_ns:c.timestamp_ns??b(),wall_clock_ns:w(),path:d,type:e},f=(d?D(t,d):void 0)?.lastMutation;f!=null&&(r.actor=f.actor),e==="data"&&(r.value=c.data),e==="error"&&(r.error=c.data);let l=d?U(t,d):void 0;l!=null&&(r.annotation=l),!(u!=null&&!u(r))&&this._log.append(r)});this.addDisposer(()=>{m(),h.dispose()}),this.addDisposer(()=>this._log.disposeAllViews())}all(){return this.entries.cache??[]}byNode(t){return this.all().filter(n=>n.path===t)}byActor(t){return this.all().filter(n=>n.actor?.id===t)}byActorType(t){return this.all().filter(n=>n.actor?.type===t)}byTimeRange(t,n){return this.all().filter(o=>!(o.timestamp_ns<t||n!=null&&o.timestamp_ns>=n))}get target(){return this._target}};function z(i,t={}){return new k(i,t)}var G=class extends A{policies;violations;violationCount;_target;_mode;_currentGuard;constructor(t,n,o){super(o.name??`${t.name}_policy`,o.graph),this._target=t,this._mode=o.mode??"audit";let u=I(n)?n:N(n,{name:"policies"});this.policies=u,this.add(this.policies,{name:"policies"}),this.violations=new $("violations",{retainedLimit:o.violationsLimit??1e3}),this.mount("violations",this.violations),this.violationCount=E([this.violations.events],([e])=>e.length,{name:"violationCount",describeKind:"derived",meta:V("policy_violation_count")}),this.add(this.violationCount,{name:"violationCount"}),this.addDisposer(R(this.violationCount));let h=u.cache??[];this._currentGuard=P(h);let m=u.subscribe(e=>{for(let d of e)d[0]===v&&(h=d[1]??[],this._currentGuard=P(h))});this.addDisposer(m);let c=o.paths!=null?[...o.paths]:j(t);if(this._mode==="enforce"){let e=new Map,d=r=>{if(e.has(r))return;let s=D(t,r);if(!(s instanceof T))return;let f=(l,p)=>{let y=this._currentGuard(l,p);return y||this._publishViolation(l,p,r,"blocked"),y};e.set(r,s._pushGuard(f))};for(let r of c)d(r);if(o.paths==null){let r=C(t,(s,f,l)=>{if(s.kind==="added")if(s.nodeKind==="node")d(`${l}${s.name}`);else{let p=f._mounts.get(s.name);if(!(p instanceof A))return;let y=`${l}${s.name}::`,_=j(p);for(let g of _)d(g===""?`${l}${s.name}`:`${y}${g}`)}else if(s.kind==="removed")if(s.nodeKind==="node"){let p=`${l}${s.name}`,y=e.get(p);y!=null&&(y(),e.delete(p))}else{let p=`${l}${s.name}`,y=`${p}::`;for(let[_,g]of e)(_===p||_.startsWith(y))&&(g(),e.delete(_))}});this.addDisposer(r)}else{let r=t.topology.subscribe(s=>{for(let f of s){if(f[0]!==v)continue;let l=f[1];if(l.kind!=="removed"||l.nodeKind!=="node")continue;let p=e.get(l.name);p!=null&&(p(),e.delete(l.name))}});this.addDisposer(r)}this.addDisposer(()=>{for(let r of e.values())r();e.clear()})}else{let e=t.observe({timeline:!0,structured:!0}),d=e.onEvent(r=>{if(r.type!=="data"&&r.type!=="error")return;let s=r.path??"";if(!s||o.paths!=null&&!o.paths.includes(s))return;let f=r.actor??D(t,s)?.lastMutation?.actor;if(f==null)return;let l="write";this._currentGuard(f,l)||this._publishViolation(f,l,s,"observed")});this.addDisposer(()=>{d(),e.dispose()})}}_publishViolation(t,n,o,u){this.violations.publish({timestamp_ns:b(),wall_clock_ns:w(),path:o,actor:t,action:n,mode:this._mode,result:u})}all(){return this.violations.retained()}get mode(){return this._mode}get target(){return this._target}};function K(i,t,n={}){return new G(i,t,n)}function q(i,t,n,o){return i.explain(t,n,{reactive:!0,...o})}function F(i,t={}){let n={format_version:1,timestamp_ns:b(),wall_clock_ns:w(),graph:i.snapshot()};if(t.actor!=null&&(n.actor=t.actor),t.audit!=null){let u=[...t.audit.all()];n.audit={count:u.length,entries:u}}if(t.policies!=null){let u=t.policies.policies.cache??[];n.policies={mode:t.policies.mode,rules:u,violations:[...t.policies.all()]}}let o=B(n);return{...n,fingerprint:o}}function I(i){return typeof i=="object"&&i!==null&&"subscribe"in i}function D(i,t){try{return i.node(t)}catch{return}}function U(i,t){try{return i.annotation(t)}catch{return}}function j(i){let t=i.describe({detail:"minimal"});return Object.keys(t.nodes)}function B(i){return S(JSON.stringify(H(i)))}function H(i){let t=new Set,n=o=>{if(o===void 0)return{__undefined:!0};if(o===null)return null;let u=typeof o;if(u==="bigint")return{__bigint:o.toString()};if(u!=="object")return o;let a=o;if(t.has(a))return{__circular:!0};t.add(a);try{if(Array.isArray(a))return a.map(n);if(a instanceof Date)return{__date:a.toISOString()};if(a instanceof RegExp)return{__regexp:{source:a.source,flags:a.flags}};if(a instanceof Map)return{__map:[...a.entries()].map(([c,e])=>[n(c),n(e)])};if(a instanceof Set)return{__set:[...a].map(n)};if(ArrayBuffer.isView(a)){let m=a,c=new Array(m.length);for(let e=0;e<m.length;e++)c[e]=m[e]??0;return{__typed_array:{ctor:a.constructor.name,data:c}}}let h={};for(let m of Object.keys(a).sort())h[m]=n(a[m]);return h}finally{t.delete(a)}};return n(i)}export{k as a,z as b,G as c,K as d,q as e,F as f,J as g};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{f as F,g as j,h as A}from"./chunk-U347KVM4.js";import{h as b,j as x}from"./chunk-5KPIYVCC.js";import{p as _}from"./chunk-LYCLF26R.js";import{b as C,d as $,i as T,j as N}from"./chunk-CK2E7BTU.js";import{b as J}from"./chunk-QYADASLV.js";var Y={};J(Y,{SNAPSHOT_WIRE_VERSION:()=>v,SurfaceError:()=>o,asSurfaceError:()=>K,createGraph:()=>R,deleteSnapshot:()=>L,diffSnapshots:()=>V,listSnapshots:()=>W,restoreSnapshot:()=>U,runReduction:()=>D,saveSnapshot:()=>M});var o=class extends Error{code;details;constructor(t,r,n){super(r),this.name="SurfaceError",this.code=t,n!==void 0&&(this.details=n)}toJSON(){let t={code:this.code,message:this.message};if(this.details!==void 0){let r=q(this.details);r!==void 0&&(t.details=r)}return t}};function q(e){try{return JSON.parse(JSON.stringify(e))}catch{return}}function K(e,t="internal-error"){if(e instanceof o)return e;let r=e instanceof Error?e.message:String(e);return new o(t,r)}function R(e,t){let r=j(e);if(!r.valid)throw new o("invalid-spec",`GraphSpec validation failed:
|
|
2
|
+
${r.errors.join(`
|
|
3
|
+
`)}`,{errors:r.errors});let n=t?.catalog??{},s=F(e,n);if(!s.valid)throw new o("catalog-error",`Catalog validation failed:
|
|
4
|
+
${s.errors.join(`
|
|
5
|
+
`)}`,{errors:s.errors});try{return A(e,t)}catch(a){let i=a instanceof Error?a.message:String(a);throw new o("catalog-error",i)}}var z=3e4;async function D(e,t,r){let n=r?.inputPath??"input",s=r?.outputPath??"output",a=r?.timeoutMs??z,i=R(e,{catalog:r?.catalog}),u;try{u=i.resolve(s)}catch{throw i.destroy(),new o("node-not-found",`reduce: output path "${s}" is not registered`,{path:s})}try{i.resolve(n)}catch{throw i.destroy(),new o("node-not-found",`reduce: input path "${n}" is not registered`,{path:n})}try{return await new Promise((g,d)=>{let l=!1,y=!1,E,h,k=!1,m=p=>{y||(y=!0,E!==void 0&&clearTimeout(E),h!==void 0?(h(),h=void 0):k=!0,p())};h=u.subscribe(p=>{for(let f of p){if(y)return;if(l){if(f[0]===C){m(()=>g(f[1]));return}if(f[0]===$){let c=u.cache;m(()=>g(c));return}if(f[0]===N){let c=f[1],H=c instanceof Error?c.message:String(c),O=c instanceof Error?c:void 0;m(()=>d(new o("internal-error",`reduce: output emitted ERROR: ${H}`,O!=null?{cause:O}:void 0)));return}if(f[0]===T){m(()=>d(new o("internal-error","reduce: output COMPLETEd without a post-push DATA")));return}}}}),k&&(h?.(),h=void 0),l=!0;try{i.set(n,t)}catch(p){let f=p instanceof Error?p.message:String(p),c=p instanceof Error?p:void 0;m(()=>d(new o("internal-error",`reduce: failed to set input on "${n}": ${f}`,c!=null?{path:n,cause:c}:{path:n})));return}!y&&Number.isFinite(a)&&a>0&&(E=setTimeout(()=>{m(()=>d(new o("reduce-timeout",`reduce: no output emitted within ${a}ms`,{timeoutMs:a,outputPath:s})))},a),E.unref?.())})}finally{i.destroy()}}var v=b,S="snapshot:";function w(e){if(e.startsWith(S))throw new o("snapshot-failed",`snapshot id must not start with "${S}" (reserved); got "${e}"`,{snapshotId:e})}function G(e){return`${S}${e}`}function X(e){return e.startsWith(S)?e.slice(S.length):void 0}function P(e,t){if(e==null||typeof e!="object")throw new o("snapshot-not-found",`snapshot "${t}" not found in tier`,{snapshotId:t});let r=e;if("mode"in r){if(r.mode==="full"&&"snapshot"in r)return r.snapshot;throw r.mode==="diff"?new o("restore-failed",`snapshot "${t}" is a diff record; restore the baseline and replay WAL instead`,{snapshotId:t,mode:"diff"}):new o("restore-failed",`snapshot "${t}" has unknown mode "${String(r.mode)}"`,{snapshotId:t,mode:String(r.mode)})}if("nodes"in r&&"edges"in r&&"subgraphs"in r&&"name"in r)return r;throw new o("restore-failed",`snapshot "${t}" payload is not a GraphCheckpointRecord or GraphPersistSnapshot`,{snapshotId:t})}async function M(e,t,r){w(t);let n;try{n=e.snapshot()}catch(a){let i=a instanceof Error?a.message:String(a);throw new o("snapshot-failed",`snapshot "${t}" serialization failed: ${i}`,{snapshotId:t})}let s={name:e.name,mode:"full",seq:0,timestamp_ns:_(),format_version:v,snapshot:n};try{await r.save(G(t),s)}catch(a){let i=a instanceof Error?a.message:String(a);throw new o("snapshot-failed",`snapshot "${t}" save failed: ${i}`,{snapshotId:t})}return{snapshotId:t,timestamp_ns:s.timestamp_ns}}async function U(e,t,r){w(e);let n=G(e),s=await t.load(n);s===void 0&&(s=await t.load(e));let a=P(s,e);try{return x.fromSnapshot(a,r?.factories?{factories:r.factories}:void 0)}catch(i){let u=i instanceof Error?i.message:String(i);throw new o("restore-failed",`snapshot "${e}" restore failed: ${u}`,{snapshotId:e})}}async function V(e,t,r){w(e),w(t);let n=async g=>{let d=G(g),l=await r.load(d);return l===void 0&&(l=await r.load(g)),l},[s,a]=await Promise.all([n(e),n(t)]),i=P(s,e),u=P(a,t);return x.diff(i,u)}async function W(e,t){if(typeof e.list!="function")throw new o("tier-no-list","KvStorageTier does not implement list(); wrap the tier with an enumerator or use a different backend");let r=await e.list(),n=[],s=t?.includeUnprefixed===!0;for(let a of r){let i=X(a);i!==void 0?n.push(i):s&&n.push(a)}return n}async function L(e,t){if(w(e),typeof t.delete!="function")throw new o("snapshot-failed",`KvStorageTier is append-only (no delete()); cannot delete "${e}"`,{snapshotId:e});try{await t.delete(G(e))}catch(r){let n=r instanceof Error?r.message:String(r);throw new o("snapshot-failed",`snapshot "${e}" delete failed: ${n}`,{snapshotId:e})}}export{o as a,K as b,R as c,D as d,v as e,M as f,U as g,V as h,W as i,L as j,Y as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as x,x as w}from"./chunk-MQZWA3DF.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===void 0){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.delete)return;let s=await d(e);await i.delete(s)}}}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=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 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=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,K as e,j as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as O}from"./chunk-MQZWA3DF.js";import{D as H,E as A,G as N,m as D}from"./chunk-LYCLF26R.js";import{b as z,c as $,d as K,i as B,j as E}from"./chunk-CK2E7BTU.js";var C=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(n,t){if(t!==void 0&&t<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=t,t!==void 0){if(this._buf=new Array(t),n&&n.length>0){let s=Math.min(n.length,t),c=n.length-s;for(let o=0;o<s;o++)this._buf[o]=n[c+o];this._size=s}}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 t=n>=0?n:this._size+n;if(!(t<0||t>=this._size))return this._maxSize!==void 0?this._buf[(this._head+t)%this._maxSize]:this._buf[t]}append(n){this._rawAppend(n),this._version+=1}appendMany(n){if(n.length===0)return;let t=this._maxSize!==void 0&&n.length>this._maxSize?n.length-this._maxSize:0;for(let s=t;s<n.length;s++)this._rawAppend(n[s]);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 t=0;t<n;t++)this._buf[(this._head+t)%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 t=Math.min(n,this._size);if(this._maxSize===void 0)this._buf.splice(0,t);else{for(let s=0;s<t;s++)this._buf[(this._head+s)%this._maxSize]=void 0;this._head=(this._head+t)%this._maxSize}return this._size-=t,this._version+=1,t}slice(n,t){if(!Number.isInteger(n)||n<0)throw new RangeError(`slice: start must be a non-negative integer (got ${n})`);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 s=t===void 0?this._size:Math.min(Math.max(t,0),this._size),c=Math.min(n,this._size);if(c>=s)return[];let o=s-c;if(this._maxSize===void 0)return this._buf.slice(c,s);let p=new Array(o);for(let r=0;r<o;r++)p[r]=this._buf[(this._head+c+r)%this._maxSize];return p}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 t=Math.min(n,this._size);return this.slice(this._size-t,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let n=new Array(this._size);for(let t=0;t<this._size;t++)n[t]=this._buf[(this._head+t)%this._maxSize];return n}snapshot(){return this.toArray()}restore(n){if(this._maxSize===void 0){this._buf.length=0;for(let t=0;t<n.length;t++)this._buf.push(n[t]);this._size=this._buf.length}else{let t=this._maxSize;for(let o=0;o<t;o++)this._buf[o]=void 0;this._head=0;let s=Math.min(n.length,t),c=n.length-s;for(let o=0;o<s;o++)this._buf[o]=n[c+o];this._size=s}this._version+=1}_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 k(g){return g.subscribe(()=>{})}var G=64;function Q(g,n={}){let{name:t,maxSize:s,versioning:c,guard:o,backend:p}=n,r=p??new C(g,s),m=A(r.toArray(),{name:t,describeKind:"state",equals:(e,i)=>e===i,...c!=null?{versioning:c}:{},...o!=null?{guard:o}:{}});function v(){let e=r.toArray();D(()=>{m.down([[$]],{internal:!0}),m.down([[z,e]],{internal:!0})})}let u=new Map,h=new Map,_=new Map;function M(e,i){return`${e}:${i===void 0?"END":i}`}function y(e){if(e.size<G)return;let i=e.keys().next();if(i.done)return;let d=e.get(i.value);d!==void 0&&d.dispose(),e.delete(i.value)}function x(e){let i=r.version;try{return e()}finally{r.version!==i&&v()}}function P(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);let i=u.get(e);if(i!==void 0)return u.delete(e),u.set(e,i),i.node;y(u);let d=N([m],([f])=>{let l=f;return e===0||l.length===0?[]:l.slice(Math.max(0,l.length-e))},{initial:r.tail(e),describeKind:"derived"}),a=k(d);return u.set(e,{node:d,dispose:a}),d}function j(e,i){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);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 d=M(e,i),a=h.get(d);if(a!==void 0)return h.delete(d),h.set(d,a),a.node;y(h);let f=N([m],([b])=>{let T=b;return i===void 0?T.slice(e):T.slice(e,i)},{initial:r.slice(e,i),describeKind:"derived"}),l=k(f);return h.set(d,{node:f,dispose:l}),f}function q(e){let i=_.get(e);if(i!==void 0)return i.node;let d=N([m,e],([f,l])=>{let b=f,T=Math.max(0,Math.trunc(l??0));return b.slice(T)},{initial:[],describeKind:"derived"}),a=k(d);return _.set(e,{node:d,dispose:a}),d}let L,S;function R(){L===void 0&&(L=H([m],(e,i,d)=>{let a=e[0],l=a!=null&&a.length>0?a.at(-1):d.prevData[0];if(l==null||l.length===0){i.down([[K]]);return}i.emit(l[l.length-1])},{name:t!=null?`${t}::lastValue`:"lastValue",describeKind:"derived",initial:r.size===0?void 0:r.at(r.size-1)}),S=N([m],([e])=>e.length>0,{name:t!=null?`${t}::hasLatest`:"hasLatest",describeKind:"derived",initial:r.size>0}),k(L),k(S))}let I={entries:m,get size(){return r.size},at(e){return r.at(e)},append(e){x(()=>r.append(e))},appendMany(e){e.length!==0&&x(()=>r.appendMany(e))},clear(){x(()=>r.clear())},trimHead(e){x(()=>r.trimHead(e))},withLatest(){return R(),m},get lastValue(){return R(),L},get hasLatest(){return R(),S},view(e){switch(e.kind){case"tail":return P(e.n);case"slice":return j(e.start,e.stop);case"fromCursor":return q(e.cursor)}},attach(e){let i=e.subscribe(d=>{for(let a of d)a[0]===z&&I.append(a[1])});return()=>i()},attachStorage(e){if(e.length===0)return()=>{};let i=new Map;for(let a of e)i.set(a,r.size);(async()=>{for(let a of e)if(typeof a.loadEntries=="function")try{let f=await Promise.resolve(a.loadEntries());f.entries.length>0&&r.size===0&&(r.restore(f.entries),i.set(a,f.entries.length),v());break}catch{}})();let d=m.subscribe(a=>{for(let f of a){if(f[0]!==z)continue;let l=f[1];for(let b of e){let T=i.get(b)??0;if(l.length<T){try{let w=b.appendEntries(l);w instanceof Promise&&w.catch(()=>{})}catch{}i.set(b,l.length);continue}if(l.length===T)continue;let F=l.slice(T);i.set(b,l.length);try{let w=b.appendEntries(F);w instanceof Promise&&w.catch(()=>{})}catch{}}}});return()=>d()},disposeAllViews(){for(let e of u.values())e.dispose();u.clear();for(let e of h.values())e.dispose();h.clear();for(let e of _.values())e.dispose();_.clear()},dispose(){for(let e of u.values())e.dispose();u.clear();for(let e of h.values())e.dispose();h.clear();for(let e of _.values())e.dispose();_.clear()}};return I}var V=new WeakMap;function Z(g){let n=V.get(g);if(n)return n;let t=g.map(u=>u.cache??[]),s=t.flat(),c=A(s,{name:"mergeReactiveLogs",describeKind:"state",equals:(u,h)=>u===h}),o=g.map((u,h)=>[...t[h]??[]]),p=[];for(let u=0;u<g.length;u++){let h=u,_=g[h].subscribe(M=>{for(let y of M)y[0]===z?(o[h]=[...y[1]],c.emit(o.flat())):y[0]===B?o[h]=[]:y[0]===E&&c.down([[E,y[1]]])});p.push(_)}let r=O(c),m=!1,v={node:c,dispose(){if(!m){m=!0;for(let u of p)u();p.length=0,r(),V.delete(g)}}};return V.set(g,v),v}export{C as a,Q as b,Z as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Qr,b as Xr}from"./chunk-6SVKZ7VI.js";import{$ as Hr,A as hr,B as vr,C as xr,D as Tr,E as wr,F as Er,G as Nr,H as Mr,I as Sr,J as Rr,K as Wr,L as Or,M as Br,N as Ir,O as Lr,P as jr,Q as Cr,R as Vr,S as Pr,T as Ar,U as zr,V as Kr,W as Dr,X as Ur,Y as _r,Z as $r,_ as Fr,a as rn,aa as qr,b as tn,ba as nt,c as Jn,d as Qn,e as Xn,f as Yn,g as Zn,h as er,i as nr,j as rr,k as tr,l as or,m as sr,n as ir,o as ar,p as cr,q as dr,r as fr,s as ur,t as pr,u as lr,v as mr,w as gr,x as br,y as yr,z as kr}from"./chunk-MYFR67PY.js";import{a as Z,b as ee,c as ne,d as re,e as te,f as oe,g as se,h as ie,i as ae,j as ce,k as de}from"./chunk-A5HZZYRK.js";import{b as Yr,c as Zr,d as et,e as it,f as at}from"./chunk-Q7EUZ6NN.js";import{a as xt}from"./chunk-JUJEPZOI.js";import{a as ge,b as Ye}from"./chunk-5QDBSZBV.js";import{a as Y}from"./chunk-ESMPEKEV.js";import{a as ft,b as ut,c as pt,d as lt,e as mt,f as gt,g as bt,h as yt,i as kt,j as ht,k as vt}from"./chunk-D5RFJOZ2.js";import{a as ct,b as dt}from"./chunk-CE72X3WO.js";import{A as Sn,B as Rn,C as Wn,D as On,E as Bn,F as In,G as Ln,I as jn,J as Cn,K as Vn,L as Pn,M as An,N as zn,O as Kn,P as Dn,Q as Un,R as _n,S as $n,T as Fn,U as Hn,V as qn,W as Gn,a as U,b as J,c as on,d as sn,e as an,f as cn,g as dn,h as fn,i as Q,j as un,k as pn,l as ln,m as mn,n as gn,o as bn,p as yn,q as kn,r as hn,s as vn,t as X,u as xn,v as Tn,w as wn,x as En,y as Nn,z as Mn}from"./chunk-JJTF75VS.js";import{c as ke,d as he,e as ve,f as xe,g as Te,h as we,i as Ee}from"./chunk-4VVTGLXJ.js";import{a as rt,b as tt}from"./chunk-NNKJUORL.js";import{a as ot,b as st}from"./chunk-KGKJCHEK.js";import{a as Gr,b as Jr}from"./chunk-TZQPPQEQ.js";import{a as Ze,b as en,c as nn}from"./chunk-RLMYS3XZ.js";import{A as Ge,B as Je,C as Qe,D as Xe,a as be,b as ye,c as Ne,d as Me,e as Se,f as G,g as Re,h as We,i as Oe,j as Be,k as Ie,l as Le,m as je,n as Ce,o as Ve,p as Pe,q as Ae,r as ze,s as Ke,t as De,u as Ue,v as _e,w as $e,x as Fe,y as He,z as qe}from"./chunk-MQZWA3DF.js";import{A as K,D as j,E as O,H as D,m as B}from"./chunk-LYCLF26R.js";import{b as h,e as $,f as F,g as H,h as S,i as q,j as W}from"./chunk-CK2E7BTU.js";import{b as me}from"./chunk-QYADASLV.js";var Rt={};me(Rt,{CircuitOpenError:()=>ee,ContentAddressedMissError:()=>Yr,NS_PER_MS:()=>NS_PER_MS,NS_PER_SEC:()=>NS_PER_SEC,NativeIndexBackend:()=>rt,NativeListBackend:()=>ot,NativeLogBackend:()=>Ze,NativeMapBackend:()=>Gr,NativePubSubBackend:()=>_,RateLimiterOverflowError:()=>oe,ResettableTimer:()=>Y,TimeoutError:()=>ae,appendLogStorage:()=>mt,audit:()=>Ln,awaitSettled:()=>qe,buffer:()=>jn,bufferCount:()=>Cn,bufferTime:()=>Pn,cached:()=>$e,canonicalJson:()=>Zr,cascadingCache:()=>Tt,catchError:()=>Gn,checkpointToRedis:()=>Dr,checkpointToS3:()=>Kr,circuitBreaker:()=>ne,combine:()=>hn,combineLatest:()=>Fn,concat:()=>Tn,concatMap:()=>Mn,constant:()=>ke,contentAddressedStorage:()=>et,createTransport:()=>L,createWatermarkController:()=>Ye,csvRows:()=>Tr,debounce:()=>On,debounceTime:()=>Hn,decorrelatedJitter:()=>Te,defer:()=>ze,delay:()=>Wn,deserializeError:()=>A,dictKv:()=>ht,dictSnapshot:()=>vt,distill:()=>Xr,distinctUntilChanged:()=>yn,elementAt:()=>ln,empty:()=>Ve,escapeRegexChar:()=>Ne,exhaustMap:()=>Nn,exponential:()=>ve,externalBundle:()=>tn,externalProducer:()=>rn,fallback:()=>ce,fibonacci:()=>xe,filter:()=>J,find:()=>pn,first:()=>Q,firstValueFrom:()=>Fe,firstWhere:()=>He,flatMap:()=>Rn,forEach:()=>Ke,fromAny:()=>je,fromAsyncIter:()=>Le,fromCSV:()=>xr,fromClickHouseWatch:()=>Nr,fromCron:()=>We,fromDrizzle:()=>Hr,fromEvent:()=>Oe,fromHTTP:()=>Yn,fromHTTPPoll:()=>ir,fromHTTPStream:()=>sr,fromIter:()=>Be,fromKafka:()=>yr,fromKysely:()=>qr,fromMCP:()=>dr,fromNATS:()=>Rr,fromNDJSON:()=>Er,fromOTel:()=>fr,fromPrisma:()=>Fr,fromPrometheus:()=>gr,fromPromise:()=>Ie,fromPulsar:()=>Mr,fromRabbitMQ:()=>Or,fromRaf:()=>Re,fromRedisStream:()=>hr,fromSSE:()=>or,fromSqlite:()=>Ur,fromSqliteCursor:()=>_r,fromStatsD:()=>lr,fromSyslog:()=>ur,fromTimer:()=>G,fromWebSocket:()=>Qn,fromWebSocketReconnect:()=>cr,fromWebhook:()=>Xn,globToRegExp:()=>Me,interval:()=>Kn,jsonCodec:()=>ft,jsonCodecFor:()=>ut,keepalive:()=>Qe,kvStorage:()=>gt,last:()=>un,linear:()=>he,lru:()=>fe,makeHttpError:()=>nt,map:()=>U,matchesAnyPattern:()=>Se,matchesCron:()=>ye,memoryAppendLog:()=>yt,memoryBackend:()=>pt,memoryKv:()=>kt,memorySnapshot:()=>bt,merge:()=>X,mergeMap:()=>Sn,mergeReactiveLogs:()=>nn,nameToSignal:()=>V,ndjsonRows:()=>wr,never:()=>Pe,nodeSignal:()=>Ge,of:()=>Ce,onFirstData:()=>gn,pairwise:()=>kn,parseCron:()=>be,parsePrometheusText:()=>br,parseSSEStream:()=>tr,parseStatsD:()=>mr,parseSyslog:()=>pr,pausable:()=>Un,pubsub:()=>wt,race:()=>wn,rateLimiter:()=>se,reactiveCounter:()=>Xe,reactiveIndex:()=>tt,reactiveList:()=>st,reactiveLog:()=>en,reactiveMap:()=>Jr,reactiveSink:()=>Jn,reduce:()=>sn,repeat:()=>Dn,replay:()=>_e,rescue:()=>_n,resolveBackoffPreset:()=>Ee,retry:()=>Z,sample:()=>In,scan:()=>on,serializeError:()=>P,share:()=>Ue,shareReplay:()=>Je,signalToName:()=>I,singleFromAny:()=>it,singleNodeFromAny:()=>at,skip:()=>cn,snapshotStorage:()=>lt,sortJsonValue:()=>ct,stableJsonString:()=>dt,stratify:()=>xt,switchMap:()=>En,take:()=>an,takeUntil:()=>fn,takeWhile:()=>dn,tap:()=>mn,tapFirst:()=>bn,throttle:()=>Bn,throttleTime:()=>qn,throwError:()=>Ae,timeout:()=>de,toArray:()=>De,toCSV:()=>Lr,toClickHouse:()=>jr,toFile:()=>Ir,toHTTP:()=>Zn,toKafka:()=>kr,toLoki:()=>Ar,toMongo:()=>Pr,toNATS:()=>Wr,toObservable:()=>ge,toPostgres:()=>Vr,toPulsar:()=>Sr,toRabbitMQ:()=>Br,toReadableStream:()=>rr,toRedisStream:()=>vr,toS3:()=>Cr,toSSE:()=>er,toSSEBytes:()=>nr,toSqlite:()=>$r,toTempo:()=>zr,toWebSocket:()=>ar,tokenBucket:()=>te,valve:()=>$n,verifiable:()=>Qr,window:()=>zn,windowCount:()=>Vn,windowTime:()=>An,withBreaker:()=>re,withLatestFrom:()=>vn,withMaxAttempts:()=>we,withStatus:()=>ie,workerBridge:()=>pe,workerSelf:()=>le,zip:()=>xn});function fe(){let e=new Map,t=null,n=null;function p(r){r.prev?r.prev.next=r.next:t=r.next,r.next?r.next.prev=r.prev:n=r.prev,r.prev=null,r.next=null}function l(r){r.next=t,r.prev=null,t&&(t.prev=r),t=r,n===null&&(n=r)}return{insert(r){if(e.has(r)){this.touch(r);return}let f={key:r,prev:null,next:null};e.set(r,f),l(f)},touch(r){let f=e.get(r);f&&(p(f),l(f))},delete(r){let f=e.get(r);f&&(p(f),e.delete(r))},evict(r){let f=[];for(let v=0;v<r&&n!==null;v++){let N=n;f.push(N.key),p(N),e.delete(N.key)}return f},size(){return e.size}}}function ue(e){return e!=null&&typeof e.then=="function"}function C(e){ue(e)&&e.catch(()=>{})}function Tt(e,t){let n=new Map,p=t?.maxSize??0,l=p>0?t?.eviction??fe():null,r=t?.writeThrough??!1;function f(o,u,m){for(let g=0;g<m;g++)try{C(e[g].save(o,u))}catch{}}function v(o,u,m=0){for(let g=m;g<e.length;g++){let w;try{w=e[g].load(o)}catch{continue}if(ue(w)){let T=g;w.then(M=>{M!==void 0?(u.down([[h,M]]),f(o,M,T)):v(o,u,T+1)},()=>{v(o,u,T+1)});return}if(w!==void 0){u.down([[h,w]]),f(o,w,g);return}}}function N(){if(!(!l||p<=0))for(;l.size()>=p;){let o=l.evict(1);if(o.length===0)break;for(let u of o){let m=n.get(u);if(m){let g=m.cache;if(m.status!=="sentinel"&&e.length>0){let w=e.length-1;try{C(e[w].save(u,g))}catch{}for(let T=0;T<w;T++)try{let M=e[T].delete;M&&C(M.call(e[T],u))}catch{}}m.down([[S]])}n.delete(u)}}}return{load(o){let u=n.get(o);if(u)return l?.touch(o),u;l&&p>0&&l.size()>=p&&N();let m=O(void 0);return n.set(o,m),l?.insert(o),v(o,m),m},save(o,u){if(r)for(let g of e)try{C(g.save(o,u))}catch{}else if(e[0])try{C(e[0].save(o,u))}catch{}let m=n.get(o);if(m)m.down([[h,u]]),l?.touch(o);else{l&&p>0&&l.size()>=p&&N();let g=O(u);n.set(o,g),l?.insert(o)}},invalidate(o){let u=n.get(o);u&&v(o,u)},delete(o){l?.delete(o);let u=n.get(o);u&&u.down([[S]]),n.delete(o);for(let m of e)try{let g=m.delete;g&&C(g.call(m,o))}catch{}},has(o){return n.has(o)},get size(){return n.size}}}var _=class{_version=0;_topics=new Set;get version(){return this._version}get topicCount(){return this._topics.size}hasTopic(t){return this._topics.has(t)}topicNames(){return this._topics.values()}createTopic(t){return this._topics.has(t)?!1:(this._topics.add(t),this._version+=1,!0)}removeTopic(t){let n=this._topics.delete(t);return n&&(this._version+=1),n}};function wt(e={}){let{backend:t}=e,n=t??new _,p=new Map;function l(r){let f=p.get(r);return f===void 0&&(f=j({describeKind:"state"}),p.set(r,f),n.createTopic(r)),f}return{topic(r){return l(r)},publish(r,f){l(r).emit(f)},publishMany(r){B(()=>{for(let[f,v]of r)l(f).emit(v)})},removeTopic(r){let f=p.get(r);return f===void 0?!1:(p.delete(r),n.removeTopic(r),f.down([[S]]),!0)},has(r){return n.hasTopic(r)},get size(){return n.topicCount},topicNames(){return n.topicNames()}}}var Et=new Map([[$,"INVALIDATE"],[F,"PAUSE"],[H,"RESUME"],[S,"TEARDOWN"],[q,"COMPLETE"],[W,"ERROR"]]),Nt=new Map([["INVALIDATE",$],["PAUSE",F],["RESUME",H],["TEARDOWN",S],["COMPLETE",q],["ERROR",W]]);function I(e){let t=Et.get(e);return t||(Symbol.keyFor(e)??"UNKNOWN")}function V(e){let t=Nt.get(e);if(t)return t;if(e&&e!=="UNKNOWN")return Symbol.for(e)}function P(e){return e instanceof Error?{message:e.message,name:e.name,stack:e.stack}:{message:String(e),name:"Error"}}function A(e){let t=new Error(e.message);return t.name=e.name,e.stack&&(t.stack=e.stack),t}function L(e){if(typeof MessagePort<"u"&&e instanceof MessagePort)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),e.start(),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof SharedWorker<"u"&&e instanceof SharedWorker)return L(e.port);if(typeof Worker<"u"&&e instanceof Worker)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.terminate()}};if(typeof BroadcastChannel<"u"&&e instanceof BroadcastChannel)return{post(t,n){n&&n.length>0&&console.warn("[graphrefly] WorkerTransport: BroadcastChannel does not support Transferable objects. The transfer argument is ignored and objects will be cloned instead."),e.postMessage(t)},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof ServiceWorker<"u"&&e instanceof ServiceWorker)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>{p.source===e&&t(p.data)};return navigator.serviceWorker.addEventListener("message",n),()=>navigator.serviceWorker.removeEventListener("message",n)}};throw new Error("createTransport: unsupported target type. Expected Worker, SharedWorker, ServiceWorker, BroadcastChannel, or MessagePort.")}function Mt(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function pe(e,t){let n=Mt(e)?e:L(e),p=t.name??"workerBridge",l=Object.entries(t.expose??{}),r=t.import??[],f=t.transfer??{},v=O("connecting",{name:`${p}::meta::status`}),N=O(null,{name:`${p}::meta::error`}),o=new Map,u=new Map;for(let c of r){let a=O(void 0,{name:`${p}::${c}`});o.set(c,a)}let m;if(l.length>0){let c=l.map(([,d])=>d),a=j(c,(d,i)=>{let k={};for(let y=0;y<l.length;y++){let[R]=l[y],E=d[y];E!=null&&E.length>0&&(k[R]=E.at(-1))}Object.keys(k).length!==0&&i.emit(k)},{name:`${p}::aggregated`,partial:!0});m=D([a],d=>{let i=d[0];if(i==null||Object.keys(i).length===0)return;let k=[];for(let E of Object.keys(i)){let z=f[E];z&&k.push(...z(i[E]))}let y;for(let[E,z]of l)E in i&&z.v!=null&&(y==null&&(y={}),y[E]=z.v.version);let R={t:"b",u:i,...y?{v:y}:{}};try{n.post(R,k.length>0?k:void 0)}catch(E){N.down([[h,E instanceof Error?E:new Error(String(E))]])}}).subscribe(()=>{})}let g=!1,w=n.listen(c=>{if(g)return;let a=c;switch(a.t){case"r":{B(()=>{for(let[d,i]of Object.entries(a.stores)){let k=o.get(d);k&&k.down([[h,i]])}}),v.down([[h,"connected"]]);let s={};for(let[d,i]of l)s[d]=i.cache;n.post({t:"i",stores:s});break}case"v":{let s=o.get(a.s);s&&s.down([[h,a.d]]);break}case"b":{B(()=>{for(let[s,d]of Object.entries(a.u)){let i=a.v?.[s];if(i!=null){let y=u.get(s);if(y!=null&&i<=y)continue;u.set(s,i)}let k=o.get(s);k&&k.down([[h,d]])}});break}case"e":{let s=o.get(a.s);s&&s.down([[W,A(a.err)]]);break}case"s":{let s=V(a.sig);if(!s)break;let d=a.s==="*"?[...o.values()]:o.has(a.s)?[o.get(a.s)]:[];for(let i of d)i.down(a.d===void 0?[[s]]:[[s,a.d]]);break}}}),T=[];for(let[c,a]of l){let s=a.subscribe((d=>{if(!g)for(let i of d){let k=i[0];k!==h&&(K.isLocalOnly(k)||(k===W?n.post({t:"e",s:c,err:P(i[1])}):n.post({t:"s",s:c,sig:I(k),d:i.length>1?i[1]:void 0})))}}));T.push(s)}let M;if(t.timeoutMs!=null&&t.timeoutMs>0){let c=G(t.timeoutMs),a=J(v,d=>d==="connected");M=Q(X(U(c,()=>"timeout"),U(a,()=>"ready"))).subscribe(d=>{for(let i of d)i[0]===h&&i[1]==="timeout"&&(N.down([[h,new Error("Worker bridge handshake timeout")]]),x())})}function x(){if(!g){g=!0,M?.(),n.post({t:"s",s:"*",sig:I(S)}),m&&m();for(let c of T)c();T.length=0,w(),v.down([[h,"closed"]]),u.clear(),o.clear()}}let b={meta:{status:v,error:N},destroy:x};for(let[c,a]of o)b[c]=a;return b}function St(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function le(e,t){let n=St(e)?e:L(e),p=t.import??[],l=t.transfer??{},r=new Map,f=new Map,v={};for(let x of p){let b=O(void 0,{name:`worker::${x}`});r.set(x,b),v[x]=b}let N=t.expose(v),o=Object.entries(N),u,m=!1;if(o.length>0){let x=o.map(([,a])=>a),b=j(x,(a,s)=>{let d={};for(let i=0;i<o.length;i++){let[k]=o[i],y=a[i];y!=null&&y.length>0&&(d[k]=y.at(-1))}Object.keys(d).length!==0&&s.emit(d)},{name:"workerSelf::aggregated",partial:!0});u=D([b],a=>{if(m)return;let s=a[0];if(s==null||Object.keys(s).length===0)return;let d=[];for(let y of Object.keys(s)){let R=l[y];R&&d.push(...R(s[y]))}let i;for(let[y,R]of o)y in s&&R.v!=null&&(i==null&&(i={}),i[y]=R.v.version);let k={t:"b",u:s,...i?{v:i}:{}};try{n.post(k,d.length>0?d:void 0)}catch{}}).subscribe(()=>{})}let g=[];for(let[x,b]of o){let c=b.subscribe((a=>{if(!m)for(let s of a){let d=s[0];d!==h&&(K.isLocalOnly(d)||(d===W?n.post({t:"e",s:x,err:P(s[1])}):n.post({t:"s",s:x,sig:I(d),d:s.length>1?s[1]:void 0})))}}));g.push(c)}let w=n.listen(x=>{if(m)return;let b=x;switch(b.t){case"i":{B(()=>{for(let[c,a]of Object.entries(b.stores)){let s=r.get(c);s&&s.down([[h,a]])}});break}case"v":{let c=r.get(b.s);c&&c.down([[h,b.d]]);break}case"b":{B(()=>{for(let[c,a]of Object.entries(b.u)){let s=b.v?.[c];if(s!=null){let i=f.get(c);if(i!=null&&s<=i)continue;f.set(c,s)}let d=r.get(c);d&&d.down([[h,a]])}});break}case"e":{let c=r.get(b.s);c&&c.down([[W,A(b.err)]]);break}case"s":{let c=V(b.sig);if(!c)break;if(c===S&&b.s==="*"){M();return}let a=b.s==="*"?[...r.values()]:r.has(b.s)?[r.get(b.s)]:[];for(let s of a)s.down(b.d===void 0?[[c]]:[[c,b.d]]);break}}}),T={};for(let[x,b]of o)T[x]=b.cache;n.post({t:"r",stores:T});function M(){if(!m){m=!0,u&&u();for(let x of g)x();g.length=0,w(),n.terminate?.(),f.clear(),r.clear()}}return{destroy:M}}export{fe as a,Tt as b,_ as c,wt as d,I as e,V as f,P as g,A as h,L as i,pe as j,le as k,Rt as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as x,c as D,d as $,e as S,f as A,g as R,h as T,i as F,j as y,k as P,l as V}from"./chunk-
|
|
1
|
+
import{b as x,c as D,d as $,e as S,f as A,g as R,h as T,i as F,j as y,k as P,l as V}from"./chunk-5KPIYVCC.js";import{a as m,b as g,c as k,d as v,e as O,f as G,g as E,h as C}from"./chunk-LYCLF26R.js";import{b as u}from"./chunk-CK2E7BTU.js";import{b as _}from"./chunk-QYADASLV.js";var j={};_(j,{ENVELOPE_VERSION:()=>v,GRAPH_META_SEGMENT:()=>R,Graph:()=>y,JsonCodec:()=>m,SIZEOF_OVERHEAD:()=>D,SIZEOF_SYMBOL:()=>$,SNAPSHOT_VERSION:()=>T,createDagCborCodec:()=>g,createDagCborZstdCodec:()=>k,decodeEnvelope:()=>G,diffForWAL:()=>P,encodeEnvelope:()=>O,explainPath:()=>x,graphProfile:()=>A,mermaidLiveUrl:()=>F,reachable:()=>V,registerBuiltinCodecs:()=>E,replayWAL:()=>C,sizeof:()=>S,validateGraphObservability:()=>L,watchTopologyTree:()=>N});function N(p,n){let o=new Map,d=(s,a)=>{if(o.has(s))return;let c={off:()=>{},prefix:a};o.set(s,c);let f=s.topology.subscribe(l=>{for(let r of l){if(r[0]!==u)continue;let e=r[1];if(n(e,s,a),e.kind==="added"&&e.nodeKind==="mount"){let t=s._mounts.get(e.name);if(t instanceof y){let i=`${a}${e.name}::`;d(t,i)}}else if(e.kind==="removed"&&e.nodeKind==="mount"){let t=`${a}${e.name}::`;for(let[i,h]of Array.from(o.entries()))i!==p&&h.prefix.startsWith(t)&&(h.off(),o.delete(i))}}});c.off=f;for(let[l,r]of s._mounts)if(r instanceof y){let e=`${a}${l}::`;d(r,e)}};return d(p,""),()=>{for(let s of o.values())s.off();o.clear()}}function L(p,n={}){let o=[],d=n.requireFound??!0;if(n.skipDescribe!==!0)try{let r=p.describe(),e=new Set(Object.keys(r.nodes)),t=[];for(let[i,h]of Object.entries(r.nodes))for(let b of h.deps)b!==""&&!e.has(b)&&t.push(`${i} \u2192 ${b}`);for(let i of r.edges)e.has(i.from)||t.push(`edge.from: ${i.from}`),e.has(i.to)||t.push(`edge.to: ${i.to}`);t.length>0?o.push({kind:"describe",ok:!1,reason:`describe() has ${t.length} dangling pointer(s); nodes \u2289 deps`,danglingDeps:t}):o.push({kind:"describe",ok:!0,nodeCount:e.size,edgeCount:r.edges.length})}catch(r){o.push({kind:"describe",ok:!1,reason:`describe() threw: ${r instanceof Error?r.message:String(r)}`})}for(let r of n.formats??[])try{let e=p.describe({format:r});typeof e!="string"||e.length===0?o.push({kind:"describe-format",ok:!1,format:r,reason:`describe({ format: "${r}" }) returned empty or non-string output`}):o.push({kind:"describe-format",ok:!0,format:r,length:e.length})}catch(e){o.push({kind:"describe-format",ok:!1,format:r,reason:e instanceof Error?e.message:String(e)})}for(let r of n.paths??[])try{p.resolve(r),o.push({kind:"observe",ok:!0,path:r})}catch(e){o.push({kind:"observe",ok:!1,path:r,reason:e instanceof Error?e.message:String(e)})}for(let[r,e]of n.pairs??[])try{let t=p.explain(r,e);d&&t.found===!1?o.push({kind:"explain",ok:!1,from:r,to:e,reason:`explain(${r} \u2192 ${e}) found no path${t.reason?`: ${t.reason}`:""}`}):o.push({kind:"explain",ok:!0,from:r,to:e,found:t.found,steps:t.steps.length})}catch(t){o.push({kind:"explain",ok:!1,from:r,to:e,reason:t instanceof Error?t.message:String(t)})}let s=o.filter(r=>!r.ok),a=s.length===0,c=n.paths?.length??0,f=n.pairs?.length??0,l=n.formats?.length??0;return{ok:a,checks:o,failures:s,summary(){let r=[n.skipDescribe===!0?null:"describe",l>0?`${l} format${l===1?"":"s"}`:null,c>0?`${c} observe path${c===1?"":"s"}`:null,f>0?`${f} explain pair${f===1?"":"s"}`:null].filter(t=>t!=null),e=r.length>0?r.join(", "):"describe-only";return a?`validateGraphObservability: OK (${e})`:`validateGraphObservability: ${s.length} failure(s) across ${e}`}}}export{N as a,L as b,j as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as P}from"./chunk-
|
|
1
|
+
import{e as P}from"./chunk-PIIUJIF7.js";import{c as S}from"./chunk-O32GJOUJ.js";import{a as w}from"./chunk-T6RPUERH.js";import{j as O,l as R}from"./chunk-5KPIYVCC.js";import{b as _}from"./chunk-TZQPPQEQ.js";import{C as T}from"./chunk-MQZWA3DF.js";import{E as k,G as x,o as H}from"./chunk-LYCLF26R.js";import{b as M}from"./chunk-QYADASLV.js";var B={};M(B,{LensGraph:()=>C,graphLens:()=>N,watchTopologyTree:()=>w});function v(e){return S("lens",e)}function E(e){let t=Object.keys(e.nodes),o=new Map,n=new Map;for(let s of t){let a=e.nodes[s]?.deps??[];o.set(s,a);for(let h of a)n.has(h)||n.set(h,new Set),n.get(h).add(s)}let r=[],c=[];for(let s of t)(o.get(s)??[]).length===0&&r.push(s),n.has(s)||c.push(s);r.sort(),c.sort();let p=e.edges.length,f=0,m=1,g=2,d=new Map;for(let s of t)d.set(s,f);let y=!1,l=new Map,u=s=>{let a=d.get(s)??f;if(a===m)return y=!0,0;if(a===g)return l.get(s)??0;d.set(s,m);let h=0,b=n.get(s);if(b!=null)for(let F of b){let G=u(F);G+1>h&&(h=G+1)}return d.set(s,g),l.set(s,h),h},i=0;for(let s of r){let a=u(s);a>i&&(i=a)}for(let s of t)d.get(s)===f&&u(s);return{nodeCount:t.length,edgeCount:p,subgraphCount:e.subgraphs.length,sources:r,sinks:c,depth:i,hasCycles:y}}function $(e){let t=[];for(let[o,n]of Object.entries(e.nodes)){if(n.status!=="errored")continue;let r={path:o,status:"errored"},c=R(e,o,"upstream",{});for(let p of c)if(p!==o&&e.nodes[p]?.status==="errored"){r.upstreamCause=p;break}t.push(r)}return t.sort((o,n)=>o.path<n.path?-1:o.path>n.path?1:0),{ok:t.length===0,problems:t}}function q(e,t){return e.nodeCount===t.nodeCount&&e.edgeCount===t.edgeCount&&e.subgraphCount===t.subgraphCount&&e.depth===t.depth&&e.hasCycles===t.hasCycles&&D(e.sources,t.sources)&&D(e.sinks,t.sinks)}function L(e,t){if(e.ok!==t.ok||e.problems.length!==t.problems.length)return!1;for(let o=0;o<e.problems.length;o++){let n=e.problems[o],r=t.problems[o];if(n.path!==r.path||n.status!==r.status||n.upstreamCause!==r.upstreamCause)return!1}return!0}function D(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var C=class extends O{stats;health;flow;_target;constructor(t,o={}){super(o.name??`${t.name}_lens`,o.graph),this._target=t;let n=0,r=0,c=k(0,{name:"stats_tick"}),p=k(0,{name:"health_tick"});this.add(c,{name:"stats_tick"}),this.add(p,{name:"health_tick"});let f={name:"flow"};o.maxFlowPaths!=null&&(f.maxSize=o.maxFlowPaths),this.flow=_(f),this.add(this.flow.entries,{name:"flow"});let m=o.pathFilter,g=w(t,(l,u,i)=>{if(n+=1,c.emit(n),r+=1,p.emit(r),l.kind==="removed")if(l.nodeKind==="node"){let s=`${i}${l.name}`;this.flow.delete(s)}else{let s=`${i}${l.name}::`,a=[];for(let h of l.audit.nodes){let b=h===""?`${i}${l.name}`:`${s}${h}`;a.push(b)}a.length>0&&this.flow.deleteMany(a)}});this.addDisposer(g);let d=t.observe({timeline:!0,structured:!0}),y=d.onEvent(l=>{let u=l.type;if((u==="error"||u==="complete"||u==="data"||u==="teardown")&&(r+=1,p.emit(r)),u==="data"){let i=l.path??"";if(!i||m!=null&&!m(i))return;let s=this.flow.get(i),a=s!=null?s.count+1:1;this.flow.set(i,{path:i,count:a,lastUpdate_ns:H()})}});this.addDisposer(()=>{y(),d.dispose()}),this.stats=x([c],()=>E(t.describe({detail:"minimal"})),{name:"stats",describeKind:"derived",equals:q,meta:v("stats")}),this.add(this.stats,{name:"stats"}),this.addDisposer(T(this.stats)),this.health=x([p],()=>$(t.describe({detail:"standard"})),{name:"health",describeKind:"derived",equals:L,meta:v("health")}),this.add(this.health,{name:"health"}),this.addDisposer(T(this.health))}why(t,o,n){let r=P(this._target,t,o,n);return this.addDisposer(r.dispose),r}get target(){return this._target}};function N(e,t){return new C(e,t)}export{C as a,N as b,B as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as z}from"./chunk-
|
|
1
|
+
import{b as z}from"./chunk-ZGVA2SR5.js";import{g as Y,j as J}from"./chunk-5KPIYVCC.js";import{E as L,F as T,G as D,H as P}from"./chunk-LYCLF26R.js";import{b as Z}from"./chunk-QYADASLV.js";var pe={};Z(pe,{compileSpec:()=>se,decompileGraph:()=>ae,extractFnFactory:()=>V,extractSourceFactory:()=>B,generateCatalogPrompt:()=>K,isRichFnEntry:()=>M,isRichSourceEntry:()=>W,llmCompose:()=>ce,llmRefine:()=>X,specDiff:()=>ie,validateSpec:()=>A,validateSpecAgainstCatalog:()=>q});function M(i){return typeof i=="object"&&i!==null&&"factory"in i}function W(i){return typeof i=="object"&&i!==null&&"factory"in i}function V(i){return M(i)?i.factory:i}function B(i){return W(i)?i.factory:i}function K(i){let n=[];if(i.fns){let o=new Map;for(let[r,d]of Object.entries(i.fns)){let p=M(d)?d.tags?.[0]??"Other":"Other";o.has(p)||o.set(p,[]),o.get(p).push(ee(r,d))}for(let[r,d]of o)n.push(`${r}:
|
|
2
2
|
${d.join(`
|
|
3
3
|
`)}`)}if(i.sources){let o=[];for(let[r,d]of Object.entries(i.sources))o.push(te(r,d));o.length>0&&n.push(`Sources:
|
|
4
4
|
${o.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as O}from"./chunk-CUQFO6MT.js";import{f as B,m as K}from"./chunk-MQZWA3DF.js";import{p as k}from"./chunk-LYCLF26R.js";import{b as M,i as A,j as L}from"./chunk-CK2E7BTU.js";import{b as H}from"./chunk-QYADASLV.js";var Y={};H(Y,{processInstanceKeyOf:()=>J,processManager:()=>X});var J=i=>i.correlationId;function V(i){if(i==null)return Promise.resolve(void 0);let y=K(i);return new Promise((s,v)=>{let u=!1,f,r=()=>{f&&f()};f=y.subscribe(a=>{if(!u)for(let o of a){if(o[0]===M){u=!0,Promise.resolve().then(r),s(o[1]);return}if(o[0]===L){u=!0,Promise.resolve().then(r),v(o[1]);return}if(o[0]===A){u=!0,Promise.resolve().then(r),s(void 0);return}}})})}async function Q(i,y,s,v,u){let f;for(let r=0;r<=v;r++){if(r>0){let a=u[Math.min(r-1,u.length-1)]??0;a>0&&await new Promise(o=>setTimeout(o,a))}try{return await V(i(y,s))}catch(a){f=a}}return{kind:"fail",error:f}}function X(i,y,s){let v=s.retryMax??0,u=s.backoffMs??[0],f=1024,r=new Map,a=new Set,o=new Map,b=O({name:`${y}_process_instances`,retainedLimit:f,graph:i}),j=0;function $(){return++j}function S(e,t,n){C(e,t,n,void 0)}function C(e,t,n,d){let c=k(),g={correlationId:e,state:t,status:n,startedAt:o.get(e)??c,updatedAt:c,t_ns:c,seq:$(),...s.handlerVersion!==void 0?{handlerVersion:s.handlerVersion}:{},...d!==void 0?{reason:d}:{}};b.append(g)}let _=`_process_${y}_started`;i.event(_),s.persistence?.eventStorage&&i.attachEventStorage(s.persistence.eventStorage);async function x(e,t,n,d){if(a.delete(e),r.delete(e),o.delete(e),s.compensate)try{await V(s.compensate(t,n)),C(e,t,"compensated",d)}catch{S(e,t,"failed")}else S(e,t,"failed")}async function D(e,t){if(a.has(e)){if(t.kind==="fail"){let n=r.get(e)??s.initial;await x(e,n,t.error);return}if(t.kind==="continue"){if(r.set(e,t.state),t.emit)for(let n of t.emit)try{i._appendEvent(n.type,n.payload,{correlationId:e,aggregateId:e})}catch{}if(S(e,t.state,"running"),s.isTerminal?.(t.state)){a.delete(e),r.delete(e),o.delete(e),S(e,t.state,"terminated");return}if(t.schedule){let{afterMs:n,eventType:d}=t.schedule,c,g=B(n),l=p=>{for(let T of p)if(T[0]===M){if(c?c():queueMicrotask(()=>c?.()),!a.has(e))return;let E=r.get(e);if(E===void 0)return;let m=s.steps[d];if(!m)return;let w={type:d,payload:null,timestampNs:k(),seq:Number.NaN,correlationId:e,aggregateId:e};q(e,m,E,w)}};c=g.subscribe(l)}return}if(t.kind==="terminate"){if(r.set(e,t.state),t.emit)for(let n of t.emit)try{i._appendEvent(n.type,n.payload,{correlationId:e,aggregateId:e})}catch{}a.delete(e),r.delete(e),o.delete(e),S(e,t.state,"terminated")}}}let h=new Map;function q(e,t,n,d){let g=(h.get(e)??Promise.resolve()).then(async()=>{let l=r.get(e);if(l===void 0||!a.has(e))return;let p;try{p=await Q(t,l,d,v,u)}catch(T){await x(e,r.get(e)??s.initial,T);return}await D(e,p)});h.set(e,g),g.finally(()=>{h.get(e)===g&&h.delete(e)})}let P=!1,R=[];for(let e of s.watching){let t=i.event(e),n=0;n=(t.cache??[]).length;let c=t.subscribe(g=>{for(let l of g){if(l[0]!==M)continue;let p=l[1];if(p.length<=n)continue;let T=p.slice(n);n=p.length;for(let E of T){let m=E.correlationId;if(m===void 0||!a.has(m))continue;let w=s.steps[e];if(!w)continue;let N=r.get(m);N!==void 0&&q(m,w,N,E)}}});R.push(c)}function W(e,t){if(P||a.has(e))return;let n=k();o.set(e,n),r.set(e,s.initial),a.add(e);try{i._appendEvent(_,t??null,{correlationId:e,aggregateId:e})}catch{}S(e,s.initial,"running")}function F(e,t){if(P||!a.has(e))return;let n=r.get(e)??s.initial;x(e,n,new Error(`cancelled: ${t??"no reason given"}`),t)}function U(e){return r.get(e)}function z(){if(!P){P=!0;for(let e of R)try{e()}catch{}R.length=0}}return{instances:b,audit:b,start:W,cancel:F,getState:U,dispose:z}}export{J as a,X as b,Y as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as l,e as d,f as u}from"./chunk-D5RFJOZ2.js";import{randomBytes as E}from"crypto";import{mkdirSync as y,readdirSync as O,readFileSync as k,renameSync as b,unlinkSync as h,writeFileSync as L}from"fs";import{basename as v,dirname as A,join as m}from"path";import{DatabaseSync as w}from"sqlite";function S(n){let t=new TextEncoder,r=new TextDecoder("utf-8",{fatal:!0}),i=o=>{let e="";for(let s of o){if(s.length===1&&/[a-zA-Z0-9_-]/.test(s)){e+=s;continue}for(let p of t.encode(s))e+=`%${p.toString(16).padStart(2,"0")}`}return m(n,`${e}.bin`)},T=o=>{if(!o.endsWith(".bin"))return null;let e=o.slice(0,-4),s=[],p=c=>{for(let g=0;g<c.length;g++)s.push(c.charCodeAt(g))},a=0;for(;a<e.length;){let c=e[a];if(c==="%"&&a+2<e.length){let g=e.slice(a+1,a+3);if(/^[0-9a-f]{2}$/i.test(g)){s.push(Number.parseInt(g,16)),a+=3;continue}}p(c),a+=1}try{return r.decode(new Uint8Array(s))}catch{return null}};return{name:`file:${n}`,read(o){try{let e=k(i(o));return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}catch{return}},write(o,e){y(n,{recursive:!0});let s=i(o),p=v(s),a=A(s),c=m(a,`.${p}.${E(8).toString("hex")}.tmp`);try{L(c,e),b(c,s)}catch(g){try{h(c)}catch{}throw g}},delete(o){try{h(i(o))}catch(e){if(e.code!=="ENOENT")throw e}},list(o){try{let e=O(n),s=[];for(let p of e){if(p.startsWith("."))continue;let a=T(p);a!==null&&(o!==void 0&&!a.startsWith(o)||s.push(a))}return s.sort()}catch(e){if(e.code==="ENOENT")return[];throw e}}}}function f(n){let t=new w(n);return t.exec("CREATE TABLE IF NOT EXISTS graphrefly_storage (k TEXT PRIMARY KEY, v BLOB NOT NULL)"),{name:`sqlite:${n}`,read(r){return t.prepare("SELECT v FROM graphrefly_storage WHERE k = ?").get(r)?.v},write(r,i){t.prepare("INSERT OR REPLACE INTO graphrefly_storage (k, v) VALUES (?, ?)").run(r,i)},delete(r){t.prepare("DELETE FROM graphrefly_storage WHERE k = ?").run(r)},list(r){if(r===void 0)return t.prepare("SELECT k FROM graphrefly_storage ORDER BY k").all().map(e=>e.k);let i=r.replace(/[\\%_]/g,"\\$&");return t.prepare("SELECT k FROM graphrefly_storage WHERE k LIKE ? ESCAPE '\\' ORDER BY k").all(`${i}%`).map(o=>o.k)},close(){try{t.close()}catch{}}}}function K(n,t){return l(S(n),t)}function $(n,t){return d(S(n),t)}function _(n,t){let r=f(n),i=l(r,t);return Object.assign(i,{close:()=>r.close()})}function C(n,t){let r=f(n),i=d(r,t);return Object.assign(i,{close:()=>r.close()})}function I(n,t){return u(S(n),t)}function W(n,t){let r=f(n),i=u(r,t);return Object.assign(i,{close:()=>r.close()})}export{S as a,f as b,K as c,$ as d,_ as e,C as f,I as g,W as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as v}from"./chunk-KRH66M4O.js";import{i as y}from"./chunk-CLD3F4R5.js";import{G as x}from"./chunk-2Y3DKIZL.js";import{d as S}from"./chunk-VJLMUKOI.js";import{d as O}from"./chunk-VIMF6LGM.js";import{d as k}from"./chunk-6QZNQS5B.js";import{d as A}from"./chunk-GPW2V3RE.js";import{b as N}from"./chunk-6G5YD37E.js";import{E as b,J as g,m as _}from"./chunk-LYCLF26R.js";import{b as a,c as p,i as h,j as m}from"./chunk-CK2E7BTU.js";import{b as f}from"./chunk-QYADASLV.js";var j={};f(j,{jotai:()=>v,nanostores:()=>y,nestjs:()=>x,react:()=>S,signals:()=>T,solid:()=>O,svelte:()=>k,vue:()=>A,zustand:()=>N});var T={};f(T,{Signal:()=>q});var s=[];function i(n){let e=n.cache;return n.subscribe(o=>{for(let[d,r]of o)d===a&&(e=r)})(),e}var u=class{_node;_equals;constructor(e,t){this._equals=t?.equals??Object.is,this._node=b(e,{...t,resubscribable:!0,resetOnTeardown:!0})}get(){let e=s[s.length-1];return e?(this._node.status==="sentinel"&&i(this._node),e(this._node)):this._node.status==="sentinel"?i(this._node):this._node.cache}set(e){this._equals(this.get(),e)||_(()=>{this._node.down([[p],[a,e]])})}},l=class{_node;constructor(e,t){this._node=g(o=>{s.push(o);try{return e()}finally{s.pop()}},{...t,describeKind:"derived",resubscribable:!0,resetOnTeardown:!0})}get(){let e=s[s.length-1];return e?(this._node.status==="sentinel"&&i(this._node),e(this._node)):this._node.status==="sentinel"?i(this._node):this._node.cache}},q={State:u,Computed:l,sub:(n,e)=>{let t=typeof e=="function"?{data:e,error:void 0,complete:void 0}:e,o=!0;return n._node.subscribe(d=>{for(let[r,c]of d){if(r===a){if(o){o=!1;continue}t.data?.(c)}r===m&&t.error?.(c),r===h&&t.complete?.()}})}};export{T as a,j as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as H,b as T}from"./chunk-
|
|
1
|
+
import{a as H,b as T}from"./chunk-YOUAVGHJ.js";import{j as q}from"./chunk-5KPIYVCC.js";import{a as O,b as j}from"./chunk-533RQFF6.js";import{E as d,G as o,H as x,m as A}from"./chunk-LYCLF26R.js";import{b as ae}from"./chunk-QYADASLV.js";var ie={};ae(ie,{demoShell:()=>re});function w(h){return Math.max(0,Math.min(1,h))}function re(h){let B=w(h?.mainRatio??.65),E=w(h?.sideSplit??.5),J=Math.max(0,h?.viewportWidth??1280),k=h?.nodeRegistry??new Map,p=h?.adapter??null,S=h?.layoutFont??"14px monospace",u=h?.onHighlight,t=new q("demo-shell"),F=d(B,{name:"pane/main-ratio"}),D=d(E,{name:"pane/side-split"}),g=d(null,{name:"pane/fullscreen"}),G=d(J,{name:"viewport/width"});t.add(F,{name:"pane/main-ratio"}),t.add(D,{name:"pane/side-split"}),t.add(g,{name:"pane/fullscreen"}),t.add(G,{name:"viewport/width"});let L=o([F,G,g],([e,a,n])=>{let l=e,r=a,i=n;return i==="main"?r:i==="graph"||i==="code"?0:Math.round(r*l)},{name:"pane/main-width"}),R=o([L,G,g],([e,a,n])=>{let l=n,r=a;return l==="main"?0:l==="graph"||l==="code"?r:r-e},{name:"pane/side-width"}),C=o([D,g],([e,a])=>{let n=a;return n==="graph"?1:n==="code"||n==="main"?0:w(e)},{name:"pane/graph-height-ratio"}),K=o([C,g],([e,a])=>{let n=a;return n==="code"?1:n==="graph"||n==="main"?0:1-e},{name:"pane/code-height-ratio"});t.add(L,{name:"pane/main-width"}),t.add(R,{name:"pane/side-width"}),t.add(C,{name:"pane/graph-height-ratio"}),t.add(K,{name:"pane/code-height-ratio"});let b=d(null,{name:"demo/graph-ref"}),m=d(0,{name:"demo/graph-tick"});t.add(b,{name:"demo/graph-ref"}),t.add(m,{name:"demo/graph-tick"});let Q=o([b,m],([e,a])=>{let n=e;return n?n.describe({format:"mermaid"}):""},{name:"graph/mermaid"}),z=o([b,m],([e,a])=>{let n=e;if(!n)return null;let{expand:l,...r}=n.describe({detail:"standard"});return r},{name:"graph/describe"});t.add(Q,{name:"graph/mermaid"}),t.add(z,{name:"graph/describe"});let M=d(null,{name:"hover/target"});t.add(M,{name:"hover/target"});let P=o([M],([e])=>{let a=e;if(!a)return null;let n=k.get(a.id);return n?n.codeLine:null},{name:"highlight/code-scroll"}),W=o([M],([e])=>{let a=e;if(!a)return null;let n=k.get(a.id);return n?n.visualSelector:null},{name:"highlight/visual"}),N=o([M],([e])=>{let a=e;return a?a.id:null},{name:"highlight/graph"});if(t.add(P,{name:"highlight/code-scroll"}),t.add(W,{name:"highlight/visual"}),t.add(N,{name:"highlight/graph"}),u?.codeScroll){let e=u.codeScroll,a=x([P],([n])=>{e(n)});t.add(a,{name:"highlight/apply-code-scroll"})}if(u?.visual){let e=u.visual,a=x([W],([n])=>{e(n)});t.add(a,{name:"highlight/apply-visual"})}if(u?.graph){let e=u.graph,a=x([N],([n])=>{e(n)});t.add(a,{name:"highlight/apply-graph"})}let _=d(null,{name:"inspect/selected-node"});t.add(_,{name:"inspect/selected-node"});let U=O("standard"),X=o([_,b,m],([e,a,n])=>{let l=a,r=e;if(!l||!r)return null;try{let i=l.resolve(r),s=j(i,U);return{path:r,...s,value:i.cache}}catch{return null}},{name:"inspect/node-detail"}),Y=o([b,m],([e,a])=>{let n=e;return n?n.trace():[]},{name:"inspect/trace-log"});t.add(X,{name:"inspect/node-detail"}),t.add(Y,{name:"inspect/trace-log"});let I=d(!1,{name:"meta/debug"});t.add(I,{name:"meta/debug"});let Z=o([I,m],([e,a])=>e?t.describe({format:"mermaid"}):"",{name:"meta/shell-mermaid"});t.add(Z,{name:"meta/shell-mermaid"});let V=d("",{name:"layout/code-text"});if(t.add(V,{name:"layout/code-text"}),p){let e=new Map,a=o([z],([r])=>{let i=r;if(!i)return new Map;let s=new Map;for(let[c]of Object.entries(i.nodes)){let f=H(c,S,p,e),v=T(f,1/0,p,S,e),y=v.lines.reduce((te,ne)=>Math.max(te,ne.width),0),ee=v.lineCount*20;s.set(c,{width:y,height:ee})}return s},{name:"layout/graph-labels",equals:(r,i)=>{if(r===i)return!0;let s=r,c=i;if(s.size!==c.size)return!1;for(let[f,v]of s){let y=c.get(f);if(!y||y.width!==v.width||y.height!==v.height)return!1}return!0}}),n=o([V,R],([r,i])=>{let s=r;if(!s)return{lineCount:0,lines:[]};let c=H(s,S,p,e),f=i-40;return T(c,Math.max(100,f),p,S,e)},{name:"layout/code-lines"}),l=o([a],([r])=>{let i=r;if(i.size===0)return 200;let s=0;for(let{width:c}of i.values())c>s&&(s=c);return Math.max(200,Math.round(s+80))},{name:"layout/side-width-hint"});t.add(a,{name:"layout/graph-labels"}),t.add(n,{name:"layout/code-lines"}),t.add(l,{name:"layout/side-width-hint"})}let $=0;return{graph:t,setMainRatio(e){t.set("pane/main-ratio",w(e))},setSideSplit(e){t.set("pane/side-split",w(e))},setFullscreen(e){t.set("pane/fullscreen",e)},setViewportWidth(e){t.set("viewport/width",Math.max(0,e))},setHoverTarget(e){t.set("hover/target",e)},setDemoGraph(e){t.set("demo/graph-ref",e)},bumpGraphTick(){t.set("demo/graph-tick",++$)},selectNode(e){t.set("inspect/selected-node",e)},setMetaDebug(e){t.set("meta/debug",e)},setCodeText(e){t.set("layout/code-text",e)},batch(e){A(e)},destroy(){t.destroy()}}}export{re as a,ie as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as n}from"./chunk-
|
|
1
|
+
import{d as n}from"./chunk-PIIUJIF7.js";import{j as a}from"./chunk-5KPIYVCC.js";import{b as c}from"./chunk-QYADASLV.js";var s={};c(s,{GuardedExecutionGraph:()=>o,guardedExecution:()=>p});var o=class extends a{enforcer;violations;_target;_defaultActor;constructor(r,e){super(e.name??`${r.name}_guarded`,e.graph),this._target=r,this._defaultActor=e.actor;let t={mode:e.mode??"enforce",name:"enforcer"};e.violationsLimit!=null&&(t.violationsLimit=e.violationsLimit),this.enforcer=n(r,e.policies,t),this.violations=this.enforcer.violations,this.mount("enforcer",this.enforcer)}scopedDescribe(r){let e=r?.actor??this._defaultActor,t={...r,...e!=null?{actor:e}:{}};return this._target.describe(t)}get target(){return this._target}};function p(i,r){return new o(i,r)}export{o as a,p as b,s as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as G}from"./chunk-
|
|
1
|
+
import{a as G}from"./chunk-O32GJOUJ.js";import{j as z}from"./chunk-5KPIYVCC.js";import{D as H,E as M,G as N,o as R}from"./chunk-LYCLF26R.js";function q(t){for(let c of t){let m=c.codePointAt(0);if(m>=19968&&m<=40959||m>=13312&&m<=19903||m>=12288&&m<=12351||m>=12352&&m<=12447||m>=12448&&m<=12543||m>=44032&&m<=55215||m>=65280&&m<=65519)return!0}return!1}var E=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011"]),F=new Set([".",",","!","?",":",";",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]);function D(t){return t.replace(/[\t\n\r\f ]+/g," ").replace(/^ | $/g,"")}function O(t){let c=new Intl.Segmenter(void 0,{granularity:"word"}),m=[];for(let f of c.segment(t)){let h=f.segment,w=f.isWordLike??!1,u=[],s=[],r=[],p="",n=null;for(let i of h){let S;i===" "?S="space":i==="\u200B"?S="zero-width-break":i==="\xAD"?S="soft-hyphen":i===`
|
|
2
2
|
`?S="hard-break":S="text",n!==null&&S===n?p+=i:(n!==null&&(u.push(p),s.push(n==="text"&&w),r.push(n)),p=i,n=S)}n!==null&&(u.push(p),s.push(n==="text"&&w),r.push(n)),m.push({texts:u,isWordLike:s,kinds:r})}return m}function V(t,c,m,f,h){let w=D(t);if(w.length===0)return[];let u=O(w),s=new Intl.Segmenter(void 0,{granularity:"grapheme"}),r=[],p=[],n=[];for(let g of u)for(let o=0;o<g.texts.length;o++)r.push(g.texts[o]),p.push(g.kinds[o]),n.push(g.isWordLike[o]);let i=[],S=[],B=[];for(let g=0;g<r.length;g++){let o=r[g],y=p[g],I=n[g];if(y==="text"&&!I&&i.length>0&&S[S.length-1]==="text"&&o.length===1&&(F.has(o)||E.has(o))){i[i.length-1]+=o;continue}if(o==="-"&&i.length>0&&S[S.length-1]==="text"&&B[B.length-1]){i[i.length-1]+=o;continue}i.push(o),S.push(y),B.push(I)}let l=f.get(c);l||(l=new Map,f.set(c,l));function b(g){let o=l.get(g);if(o===void 0){h&&(h.misses+=1);let y=m.measureSegment(g,c).width;o=Number.isFinite(y)&&y>=0?y:0,l.set(g,o)}else h&&(h.hits+=1);return o}let d=[];for(let g=0;g<i.length;g++){let o=i[g],y=S[g];if(y!=="text"){d.push({text:o,width:y==="space"?b(" ")*o.length:0,kind:y,graphemeWidths:null});continue}if(q(o)){let a="";for(let x of s.segment(o)){let k=x.segment;if(a.length>0&&E.has(k)){a+=k;continue}if(a.length>0){let L=b(a);d.push({text:a,width:L,kind:"text",graphemeWidths:null})}a=k}if(a.length>0){let x=b(a);d.push({text:a,width:x,kind:"text",graphemeWidths:null})}continue}let I=b(o),e=null;if(B[g]&&o.length>1){let a=[];for(let x of s.segment(o))a.push(b(x.segment));a.length>1&&(e=a)}d.push({text:o,width:I,kind:"text",graphemeWidths:e})}return d}function J(t,c,m,f,h){if(t.length===0)return{lines:[],lineCount:0};let w=[],u=0,s=!1,r=0,p=0,n=0,i=0,S=-1,B=0,l=h.get(f);l||(l=new Map,h.set(f,l));let b=l.get("-");b===void 0&&(b=m.measureSegment("-",f).width,l.set("-",b));function d(e=n,a=i,x=u){let k="";for(let L=r;L<e;L++){let W=t[L];if(!(W.kind==="soft-hyphen"||W.kind==="hard-break"))if(L===r&&p>0&&W.graphemeWidths){let P=[...new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(W.text)].map(K=>K.segment);k+=P.slice(p).join("")}else k+=W.text}if(a>0&&e<t.length){let L=t[e],v=[...new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(L.text)].map(K=>K.segment),P=r===e?p:0;k+=v.slice(P,a).join("")}e>0&&t[e-1]?.kind==="soft-hyphen"&&!(r===e&&p>0)&&(k+="-"),w.push({text:k,width:x,startSegment:r,startGrapheme:p,endSegment:e,endGrapheme:a}),u=0,s=!1,S=-1,B=0}function g(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function o(e,a,x){s=!0,r=e,p=a,n=e+1,i=0,u=x}function y(e,a,x){s=!0,r=e,p=a,n=e,i=a+1,u=x}for(let e=0;e<t.length;e++){let a=t[e];if(a.kind==="hard-break"){s?d():w.push({text:"",width:0,startSegment:e,startGrapheme:0,endSegment:e,endGrapheme:0}),r=e+1,p=0;continue}let x=a.width;if(!s){x>c&&a.graphemeWidths?I(e,0,a.graphemeWidths):o(e,0,x),g(a.kind)&&(S=e+1,B=a.kind==="space"?u-x:u);continue}let k=u+x;if(k>c+.005){if(g(a.kind)){u+=x,n=e+1,i=0,d(e+1,0,a.kind==="space"?u-x:u);continue}if(S>=0){d(S,0,B),e--;continue}if(x>c&&a.graphemeWidths){d(),I(e,0,a.graphemeWidths);continue}d(),e--;continue}u=k,n=e+1,i=0,g(a.kind)&&(S=e+1,B=a.kind==="space"?u-x:u)}return s&&d(),{lines:w,lineCount:w.length};function I(e,a,x){for(let k=a;k<x.length;k++){let L=x[k];if(!s){y(e,k,L);continue}u+L>c+.005?(d(),y(e,k,L)):(u+=L,n=e,i=k+1)}s&&n===e&&i===x.length&&(n=e+1,i=0)}}function A(t){return t==="space"||t==="zero-width-break"||t==="soft-hyphen"}var T=null;function _(){return T===null&&(T=new Intl.Segmenter(void 0,{granularity:"grapheme"})),T}function j(t,c,m){if(c===0&&m<0)return t.text;let f=[..._().segment(t.text)].map(w=>w.segment),h=m<0?f.length:m;return f.slice(c,h).join("")}function C(t,c,m,f,h,w){let u="";for(let s=c;s<f;s++){let r=t[s];r.kind==="soft-hyphen"||r.kind==="hard-break"||(s===c&&m>0?u+=j(r,m,-1):u+=r.text)}if(h>0&&f<t.length){let s=t[f];u+=j(s,c===f?m:0,h)}return w&&(u+="-"),u}function $(t){if(!t?.adapter||!t.font)return 0;let c=t.cache;if(c){let m=c.get(t.font);m||(m=new Map,c.set(t.font,m));let f=m.get("-");return f===void 0&&(f=t.adapter.measureSegment("-",t.font).width,m.set("-",f)),f}return t.adapter.measureSegment("-",t.font).width}function te(t,c,m,f){let h=c.segmentIndex,w=c.graphemeIndex;if(h>=t.length)return null;if(w===0){for(;h<t.length;){let e=t[h];if(e.kind==="hard-break")return{text:"",width:0,start:{segmentIndex:c.segmentIndex,graphemeIndex:0},end:{segmentIndex:h+1,graphemeIndex:0}};if(e.kind==="space"||e.kind==="zero-width-break"||e.kind==="soft-hyphen"){h+=1;continue}break}if(h>=t.length)return null}let u=$(f),s=h,r=h===c.segmentIndex?w:0,p=0,n=s,i=0,S=!1,B=-1,l=0,b=0,d=!1,g=(e,a,x,k)=>{B=e,l=a,b=x,d=k==="soft-hyphen"},o=(e,a,x)=>{for(let k=a;k<x.length;k++){let L=x[k];if(!S){p=L,n=e,i=k+1,S=!0;continue}if(p+L>m+.005)return!0;p+=L,n=e,i=k+1}return n===e&&i===x.length&&(n=e+1,i=0),!1};if(r>0&&s<t.length){let e=t[s];if(e.graphemeWidths){if(o(s,r,e.graphemeWidths))return{text:C(t,s,r,n,i,!1),width:p,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}};h=n}}for(;h<t.length;){let e=t[h];if(e.kind==="hard-break"){if(S){let k=n>0&&t[n-1]?.kind==="soft-hyphen";return{text:C(t,s,r,n,i,k),width:p+(k?u:0),start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}}return{text:"",width:0,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:h+1,graphemeIndex:0}}}let a=e.width;if(!S){if(a>m&&e.graphemeWidths){if(o(h,0,e.graphemeWidths))return{text:C(t,s,r,n,i,!1),width:p,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}};h=n;continue}p=a,n=h+1,i=0,S=!0,A(e.kind)&&g(h+1,0,e.kind==="space"?p-a:p,e.kind),h+=1;continue}let x=p+a;if(x>m+.005){if(A(e.kind)){n=h+1,i=0;let L=e.kind==="soft-hyphen",W=e.kind==="space"?p:p+(L?u:0);return{text:C(t,s,r,n,i,L),width:W,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}}return B>=0?{text:C(t,s,r,B,l,d),width:b+(d?u:0),start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:B,graphemeIndex:l}}:a>m&&e.graphemeWidths?{text:C(t,s,r,n,i,!1),width:p,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}:{text:C(t,s,r,n,i,!1),width:p,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}}p=x,n=h+1,i=0,A(e.kind)&&g(h+1,0,e.kind==="space"?p-a:p,e.kind),h+=1}if(!S)return null;let y=n>0&&t[n-1]?.kind==="soft-hyphen";return{text:C(t,s,r,n,i,y),width:p+(y?u:0),start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}}function ne(t,c,m=0){let f=[t];for(let h=0;h<c.length;h++){let w=c[h],u=[];for(let s=0;s<f.length;s++){let r=f[s];if(w.right<=r.left||w.left>=r.right){u.push(r);continue}w.left>r.left&&u.push({left:r.left,right:w.left}),w.right<r.right&&u.push({left:w.right,right:r.right})}f=u}return m>0?f.filter(h=>h.right-h.left>=m):f}function Q(t,c,m){let f=[],h=new Intl.Segmenter(void 0,{granularity:"grapheme"});for(let w=0;w<t.lines.length;w++){let u=t.lines[w],s=w*m,r=0;for(let p=u.startSegment;p<c.length;p++){let n=c[p];if(n.kind==="soft-hyphen"||n.kind==="hard-break"){if(p>=u.endSegment&&u.endGrapheme===0)break;continue}let i=[...h.segment(n.text)].map(l=>l.segment);if(i.length===0)continue;let S=p===u.startSegment?u.startGrapheme:0,B;if(p<u.endSegment)B=i.length;else if(p===u.endSegment&&u.endGrapheme>0)B=u.endGrapheme;else break;for(let l=S;l<B;l++){let b=n.graphemeWidths?n.graphemeWidths[l]:n.width/i.length;f.push({x:r,y:s,width:b,height:m,line:w}),r+=b}}}return f}function re(t){let{adapter:c,name:m="reactive-layout"}=t,f=new z(m),h=new Map,w=M(t.text??"",{name:"text"}),u=M(t.font??"16px sans-serif",{name:"font"}),s=M(t.lineHeight??20,{name:"line-height"}),r=M(Math.max(0,t.maxWidth??800),{name:"max-width"});function p(l,b){if(l===null||b===null)return l===b;if(l.length!==b.length)return!1;for(let d=0;d<l.length;d++)if(l[d]!==b[d])return!1;return!0}let n=H([w,u],(l,b,d)=>{let g=l[0],o=g!=null&&g.length>0?g.at(-1):d.prevData[0],y=l[1],I=y!=null&&y.length>0?y.at(-1):d.prevData[1],e=R(),a={hits:0,misses:0},x=V(o,I,c,h,a),k=R()-e,L=a.hits+a.misses,W=L===0?1:a.hits/L,v=n.meta;v&&(G(v["cache-hit-rate"],W),G(v["segment-count"],x.length),G(v["layout-time-ns"],k)),b.emit(x);let P=()=>{h.clear(),c.clearCache?.()};return{deactivate:P,invalidate:P}},{name:"segments",describeKind:"derived",meta:{"cache-hit-rate":0,"segment-count":0,"layout-time-ns":0},equals:(l,b)=>{let d=l,g=b;if(d==null||g==null)return d===g;if(d.length!==g.length)return!1;for(let o=0;o<d.length;o++){let y=d[o],I=g[o];if(y.text!==I.text||y.width!==I.width||y.kind!==I.kind||!p(y.graphemeWidths??null,I.graphemeWidths??null))return!1}return!0}}),i=N([n,r,u],([l,b,d])=>J(l,b,c,d,h),{name:"line-breaks",equals:(l,b)=>{let d=l,g=b;if(d==null||g==null)return d===g;if(d.lineCount!==g.lineCount)return!1;for(let o=0;o<d.lines.length;o++){let y=d.lines[o],I=g.lines[o];if(y.text!==I.text||y.width!==I.width||y.startSegment!==I.startSegment||y.startGrapheme!==I.startGrapheme||y.endSegment!==I.endSegment||y.endGrapheme!==I.endGrapheme)return!1}return!0}}),S=N([i,s],([l,b])=>l.lineCount*b,{name:"height"}),B=N([i,n,s],([l,b,d])=>Q(l,b,d),{name:"char-positions",equals:(l,b)=>{let d=l,g=b;if(d==null||g==null)return d===g;if(d.length!==g.length)return!1;for(let o=0;o<d.length;o++)if(d[o].x!==g[o].x||d[o].y!==g[o].y||d[o].width!==g[o].width)return!1;return!0}});return f.add(w,{name:"text"}),f.add(u,{name:"font"}),f.add(s,{name:"line-height"}),f.add(r,{name:"max-width"}),f.add(n,{name:"segments"}),f.add(i,{name:"line-breaks"}),f.add(S,{name:"height"}),f.add(B,{name:"char-positions"}),{graph:f,setText:l=>f.set("text",l),setFont:l=>f.set("font",l),setLineHeight:l=>f.set("line-height",l),setMaxWidth:l=>f.set("max-width",Math.max(0,l)),segments:n,lineBreaks:i,height:S,charPositions:B}}export{V as a,J as b,te as c,ne as d,Q as e,re as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as f}from"./chunk-ZGVA2SR5.js";import{a as l,c as o,d,g as s,h as m,j as b,k as c}from"./chunk-A5HZZYRK.js";import{a as r,b as u}from"./chunk-4VVTGLXJ.js";import{b as y}from"./chunk-QYADASLV.js";var R={};y(R,{NS_PER_MS:()=>r,NS_PER_SEC:()=>u,resilientPipeline:()=>O});function O(p,e={}){let t=p;e.rateLimit!=null&&(t=s(t,e.rateLimit)),e.budget!=null&&e.budget.length>0&&(t=f(t,e.budget));let n;if(e.breaker!=null){let k=o(e.breaker),S=e.breakerOnOpen??"skip",a=d(k,{onOpen:S})(t);t=a.node,n=a.breakerState}if(e.timeoutMs!=null){if(e.timeoutMs<=0)throw new RangeError("timeoutMs must be > 0");if(e.timeoutMs>9e6)throw new RangeError("timeoutMs must be <= 9_000_000 (\u22482.5h) to stay within safe ns arithmetic");t=c(t,e.timeoutMs*1e6)}e.retry!=null&&(t=l(t,e.retry)),e.fallback!==void 0&&(t=b(t,e.fallback));let i=m(t,{initialStatus:e.initialStatus??"pending"});return{node:i.node,status:i.status,error:i.error,breakerState:n}}export{O as a,R as b};
|