@graphrefly/graphrefly 0.38.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/budget-gate-CmmVtasH.d.ts +115 -0
- package/dist/budget-gate-DiP_nK0n.d.cts +115 -0
- package/dist/{cascading-BsJ4GbnS.d.ts → cascading-BzuxW0_w.d.cts} +2 -2
- package/dist/{cascading-B25wxpRa.d.cts → cascading-g2_rhhaM.d.ts} +2 -2
- package/dist/chunk-35JTVPOX.js +1 -0
- package/dist/chunk-3G5U5QNE.js +5 -0
- package/dist/{chunk-PHXZRR6C.js → chunk-4I45FVQS.js} +1 -1
- package/dist/chunk-5LK7XMEV.js +1 -0
- package/dist/{chunk-FWGIZP3W.js → chunk-5XRI6RM3.js} +1 -1
- package/dist/chunk-73PBQNST.js +1 -0
- package/dist/chunk-7JRF5YEK.js +3 -0
- package/dist/{chunk-4BDQXBXE.js → chunk-7NZMZJMW.js} +1 -1
- package/dist/chunk-7QFRK3N3.js +84 -0
- package/dist/{chunk-POCWFIJ7.js → chunk-7SD73DS6.js} +1 -1
- package/dist/{chunk-NBGPXQSP.js → chunk-A6ZSKGUG.js} +1 -1
- package/dist/{chunk-7KZZLWZ6.js → chunk-AU7YTQX7.js} +1 -1
- package/dist/chunk-C72GO4IZ.js +1 -0
- package/dist/{chunk-B5S7KTGP.js → chunk-CGDMTXSY.js} +1 -1
- package/dist/chunk-D27JNOLZ.js +1 -0
- package/dist/chunk-D47YVDR5.js +1 -0
- package/dist/chunk-EWF7KCDJ.js +61 -0
- package/dist/{chunk-IBGE62GZ.js → chunk-GEAO3TL3.js} +1 -1
- package/dist/chunk-GX5LSSRE.js +1 -0
- package/dist/{chunk-O245YLM5.js → chunk-HAWKGIXM.js} +1 -1
- package/dist/chunk-HX3EGQ5Z.js +1 -0
- package/dist/{chunk-RZ5HKPGI.js → chunk-IA7DUNGB.js} +1 -1
- package/dist/{chunk-K5C67OGE.js → chunk-INH6FS2G.js} +2 -2
- package/dist/chunk-INHC33EH.js +1 -0
- package/dist/chunk-IUB4NYI2.js +1 -0
- package/dist/{chunk-UVLZX2OU.js → chunk-JNMC2WJ6.js} +1 -1
- package/dist/{chunk-O2BLVQU4.js → chunk-KD4NHLMU.js} +1 -1
- package/dist/chunk-L6NSJVJZ.js +1 -0
- package/dist/{chunk-6773HURD.js → chunk-L7WY6TZS.js} +1 -1
- package/dist/chunk-LQNOXGET.js +1 -0
- package/dist/chunk-MC4UYY2X.js +1 -0
- package/dist/{chunk-6KZZ6XQE.js → chunk-N7UIBZCW.js} +1 -1
- package/dist/chunk-NQI2C36M.js +1 -0
- package/dist/chunk-R75BMDLA.js +1 -0
- package/dist/chunk-RF3QZP6D.js +1 -0
- package/dist/{chunk-NV63VQHI.js → chunk-S2U57TFC.js} +1 -1
- package/dist/{chunk-SP5O2MIX.js → chunk-SC7BQDNP.js} +1 -1
- package/dist/{chunk-6VFC334U.js → chunk-TFPZLQ5H.js} +1 -1
- package/dist/chunk-VJJLIEAL.js +1 -0
- package/dist/{chunk-FAYEMS5M.js → chunk-WHIZM6JV.js} +1 -1
- package/dist/chunk-XEUANKBO.js +43 -0
- package/dist/{chunk-DSOVKKTI.js → chunk-XQ55HO5N.js} +1 -1
- package/dist/chunk-ZJ7SM3G2.js +1 -0
- package/dist/{chunk-TMVY7OWG.js → chunk-ZOX3LBRV.js} +1 -1
- package/dist/compat/index.cjs +9 -13
- package/dist/compat/index.d.cts +16 -16
- package/dist/compat/index.d.ts +16 -16
- package/dist/compat/index.js +1 -1
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nestjs/index.cjs +7 -11
- package/dist/compat/nestjs/index.d.cts +8 -8
- package/dist/compat/nestjs/index.d.ts +8 -8
- package/dist/compat/nestjs/index.js +1 -1
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/zustand/index.cjs +3 -7
- package/dist/compat/zustand/index.d.cts +4 -4
- package/dist/compat/zustand/index.d.ts +4 -4
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-CgG0MqHm.d.cts → composite-CKd0e2vz.d.cts} +2 -2
- package/dist/{composite-DTOlDuch.d.ts → composite-DGatA-JK.d.ts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +1 -1
- package/dist/extra/browser.d.cts +1 -1
- package/dist/extra/browser.d.ts +1 -1
- package/dist/extra/index.cjs +16 -20
- package/dist/extra/index.d.cts +11 -9
- package/dist/extra/index.d.ts +11 -9
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +2 -2
- package/dist/extra/node.d.cts +1 -1
- package/dist/extra/node.d.ts +1 -1
- package/dist/extra/node.js +1 -1
- package/dist/extra/operators.cjs +1 -1
- package/dist/extra/operators.d.cts +1 -1
- package/dist/extra/operators.d.ts +1 -1
- package/dist/extra/operators.js +1 -1
- package/dist/extra/reactive.cjs +1 -1
- package/dist/extra/reactive.d.cts +3 -3
- package/dist/extra/reactive.d.ts +3 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/render/index.cjs +5 -0
- package/dist/extra/render/index.d.cts +183 -0
- package/dist/extra/render/index.d.ts +183 -0
- package/dist/extra/render/index.js +1 -0
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.d.cts +1 -1
- package/dist/extra/sources.d.ts +1 -1
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-browser.d.cts +1 -1
- package/dist/extra/storage-browser.d.ts +1 -1
- package/dist/{fallback-axI2cXwt.d.cts → fallback-8JYU8tlT.d.cts} +1 -1
- package/dist/{fallback-DuEXfA4F.d.ts → fallback-CMZl39L5.d.ts} +1 -1
- package/dist/graph/index.cjs +7 -7
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +1 -1
- package/dist/{graph-BjW1taJl.d.ts → graph-30XSgtVX.d.ts} +76 -100
- package/dist/{graph-CHsVwf9S.d.cts → graph-BUwMAxJI.d.cts} +76 -100
- package/dist/{index-CIcu6fIR.d.ts → index-2n8Eai6M.d.ts} +1 -1
- package/dist/{index-CrlHFsiT.d.ts → index-89FczVZ_.d.ts} +41 -85
- package/dist/{index-CM-i58FY.d.cts → index-8R1vzNOx.d.cts} +9 -9
- package/dist/{index-CDvC1m5p.d.ts → index-B2RUoIUz.d.ts} +1 -1
- package/dist/{index-BFaALJxR.d.ts → index-B41Asm7D.d.ts} +10 -8
- package/dist/{index-D-HZ7sP4.d.ts → index-B9fmw5n2.d.ts} +4 -6
- package/dist/{index-Bn0uZEL4.d.ts → index-BAlaVimV.d.ts} +9 -9
- package/dist/{index-DJVQ-t07.d.ts → index-BC9VybQs.d.ts} +41 -48
- package/dist/{index-5dNRlW7J.d.ts → index-BEHmxORq.d.ts} +11 -11
- package/dist/{index-DJNAWzcH.d.cts → index-BJ26eEjs.d.cts} +26 -19
- package/dist/{index-BiomL7AW.d.ts → index-BJSZxSFX.d.ts} +1 -1
- package/dist/{index-Czk3r0yA.d.cts → index-BKMdnYnk.d.ts} +56 -54
- package/dist/{index-BsZk9T8y.d.ts → index-BM9szD8n.d.cts} +14 -6
- package/dist/{index-BmWuVdER.d.ts → index-BUPVld1w.d.ts} +2 -2
- package/dist/{index-BwOsJfLJ.d.ts → index-BXd6OMEy.d.ts} +3 -3
- package/dist/index-BhUaMYm_.d.ts +113 -0
- package/dist/{index-BpMZzX9P.d.cts → index-BndG0cpK.d.cts} +3 -3
- package/dist/{index-AUqWe_fX.d.ts → index-Br3WnqEn.d.ts} +81 -9
- package/dist/{index-BhzwpIJc.d.cts → index-BskfDoZ_.d.ts} +14 -6
- package/dist/{index-D9vBTuzo.d.ts → index-C19qqa38.d.ts} +4 -4
- package/dist/{index-B-ORMr3k.d.ts → index-C7VV_qOs.d.ts} +4 -4
- package/dist/{index-BWUMIt7J.d.cts → index-CIRG8Hxp.d.cts} +11 -11
- package/dist/{index-B3D_z0Z6.d.cts → index-CL7oilfm.d.cts} +1 -1
- package/dist/{index-ML6vHKXK.d.ts → index-CPhBvRJU.d.ts} +1 -1
- package/dist/{index-CQsqqEVz.d.cts → index-CWHtYmSh.d.cts} +1 -1
- package/dist/{index-DKrIuF-r.d.ts → index-Cey6VTnX.d.ts} +8 -5
- package/dist/{resilience-BWP2c7Af.d.cts → index-CmqiJZKM.d.ts} +141 -23
- package/dist/{index-JYtN9uqM.d.ts → index-CoM4rzyB.d.ts} +1 -1
- package/dist/{index-C56XZiDe.d.cts → index-CpLpJb6A.d.cts} +8 -5
- package/dist/{index-BjWZARLy.d.ts → index-Ctb7_2sG.d.ts} +1 -1
- package/dist/index-CusEP3Sv.d.ts +210 -0
- package/dist/{resilience-Bys63Cpd.d.ts → index-CwP_KAMS.d.cts} +141 -23
- package/dist/{index-BFuVcqL8.d.cts → index-D3ayz3hy.d.cts} +1 -1
- package/dist/{index-Bpr0Pwgl.d.cts → index-DCbE8fFM.d.cts} +3 -3
- package/dist/{index-CAbHN_rP.d.cts → index-DIHcMLr6.d.cts} +1 -1
- package/dist/index-DINuaZlJ.d.cts +210 -0
- package/dist/{index-9xhIaM-w.d.cts → index-DOBLxOti.d.cts} +1 -1
- package/dist/{index-Di7OdwlO.d.ts → index-DQUVq1_d.d.ts} +37 -90
- package/dist/{index-BgzPO43H.d.cts → index-DTtBpuQy.d.cts} +4 -6
- package/dist/{index-D_QQ_dTD.d.cts → index-DYTBbF8T.d.cts} +1 -1
- package/dist/{index-UsU9ptzs.d.cts → index-DlgHqQxW.d.cts} +81 -9
- package/dist/{index-DTDVDzhA.d.ts → index-DlrWu9Hs.d.cts} +56 -54
- package/dist/{index-B2IUcH13.d.cts → index-DoYc8BWK.d.cts} +41 -48
- package/dist/{index-BUFCHvOR.d.ts → index-DszPlZzK.d.ts} +3 -3
- package/dist/{index-BqcgiSQg.d.cts → index-DyM4tFAe.d.cts} +10 -8
- package/dist/{index-CAV-3RpJ.d.cts → index-FVoPvhAu.d.cts} +4 -4
- package/dist/{index-Ckil6miL.d.cts → index-H_I66pav.d.cts} +2 -2
- package/dist/{index-C-3UXnHT.d.cts → index-IwFqHxCs.d.cts} +2 -2
- package/dist/index-K-vl_c6A.d.cts +113 -0
- package/dist/{index-CijfwEWx.d.ts → index-KlZ_ZUip.d.cts} +3 -3
- package/dist/{index-Bub6x_D4.d.cts → index-L8XI8Zql.d.cts} +37 -90
- package/dist/{index-DeSsvHDD.d.cts → index-MxYuWOrf.d.cts} +3 -3
- package/dist/{index-CpZKtdMw.d.cts → index-PgwvGWa1.d.cts} +1 -1
- package/dist/{index-Vz7KPfgz.d.ts → index-PlJ3MraE.d.ts} +1 -1
- package/dist/{index-BI1wMfyc.d.ts → index-PqbnoScQ.d.ts} +3 -3
- package/dist/{index-BsgxnHN8.d.cts → index-PsVHpPwP.d.cts} +3 -3
- package/dist/{index-D-B7U42V.d.cts → index-WyFKER-c.d.ts} +3 -3
- package/dist/{index-DY2f2b9z.d.ts → index-eaQuGJnv.d.ts} +3 -3
- package/dist/{index-DqICM_I7.d.ts → index-iTX5IqSP.d.ts} +67 -9
- package/dist/{index-Byp771zP.d.ts → index-jKLph6cu.d.ts} +2 -2
- package/dist/{index-CEVzBWeB.d.ts → index-jr6PuSBt.d.ts} +26 -19
- package/dist/{index-BkQqf1EF.d.cts → index-mNwgxC21.d.cts} +67 -9
- package/dist/{index-BaSy4L6w.d.cts → index-pVDQcbar.d.cts} +41 -85
- package/dist/{index-D7-RSD93.d.cts → index-xZYcDqFH.d.cts} +4 -4
- package/dist/{index-8OxXae3g.d.ts → index-yLt-aPMp.d.ts} +1 -1
- package/dist/{index-CqSJ25A9.d.cts → index-z8WFPVI8.d.cts} +1 -1
- package/dist/index.cjs +63 -59
- package/dist/index.d.cts +48 -47
- package/dist/index.d.ts +48 -47
- package/dist/index.js +1 -1
- package/dist/{meta-DreaEM_a.d.cts → meta-Ct9nqQS5.d.cts} +11 -7
- package/dist/{meta-BYqlATmg.d.ts → meta-D8OyedKp.d.ts} +11 -7
- package/dist/{node-fSc-hCv8.d.cts → node-BYInONRr.d.cts} +3 -3
- package/dist/{node-fSc-hCv8.d.ts → node-BYInONRr.d.ts} +3 -3
- package/dist/{observable-Cqty11jG.d.cts → observable-DMIlYJV1.d.cts} +1 -1
- package/dist/{observable-EAV_rNfM.d.ts → observable-DO8DDEzv.d.ts} +1 -1
- package/dist/patterns/ai/browser.cjs +5 -5
- package/dist/patterns/ai/browser.d.cts +4 -4
- package/dist/patterns/ai/browser.d.ts +4 -4
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +16 -20
- package/dist/patterns/ai/index.d.cts +17 -17
- package/dist/patterns/ai/index.d.ts +17 -17
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.cjs +1 -1
- package/dist/patterns/ai/node.d.cts +4 -4
- package/dist/patterns/ai/node.d.ts +4 -4
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.cjs +3 -7
- package/dist/patterns/audit/index.d.cts +6 -6
- package/dist/patterns/audit/index.d.ts +6 -6
- package/dist/patterns/audit/index.js +1 -1
- package/dist/patterns/cqrs/index.cjs +3 -7
- package/dist/patterns/cqrs/index.d.cts +6 -6
- package/dist/patterns/cqrs/index.d.ts +6 -6
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +5 -8
- package/dist/patterns/demo-shell/index.d.cts +5 -5
- package/dist/patterns/demo-shell/index.d.ts +5 -5
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +3 -7
- package/dist/patterns/domain-templates/index.d.cts +4 -4
- package/dist/patterns/domain-templates/index.d.ts +4 -4
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +37 -37
- package/dist/patterns/graphspec/index.d.cts +5 -5
- package/dist/patterns/graphspec/index.d.ts +5 -5
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +3 -7
- package/dist/patterns/guarded-execution/index.d.cts +7 -7
- package/dist/patterns/guarded-execution/index.d.ts +7 -7
- package/dist/patterns/guarded-execution/index.js +1 -1
- package/dist/patterns/harness/index.cjs +8 -12
- package/dist/patterns/harness/index.d.cts +12 -12
- package/dist/patterns/harness/index.d.ts +12 -12
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +3 -7
- package/dist/patterns/job-queue/index.d.cts +6 -6
- package/dist/patterns/job-queue/index.d.ts +6 -6
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +3 -7
- package/dist/patterns/lens/index.d.cts +6 -6
- package/dist/patterns/lens/index.d.ts +6 -6
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +3 -7
- package/dist/patterns/memory/index.d.cts +6 -6
- package/dist/patterns/memory/index.d.ts +6 -6
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +3 -7
- package/dist/patterns/messaging/index.d.cts +5 -5
- package/dist/patterns/messaging/index.d.ts +5 -5
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.cjs +3 -7
- package/dist/patterns/orchestration/index.d.cts +8 -8
- package/dist/patterns/orchestration/index.d.ts +8 -8
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/process/index.cjs +1 -1
- package/dist/patterns/process/index.d.cts +7 -7
- package/dist/patterns/process/index.d.ts +7 -7
- package/dist/patterns/process/index.js +1 -1
- package/dist/patterns/reactive-layout/index.cjs +4 -8
- package/dist/patterns/reactive-layout/index.d.cts +5 -5
- package/dist/patterns/reactive-layout/index.d.ts +5 -5
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +3 -7
- package/dist/patterns/reduction/index.d.cts +4 -4
- package/dist/patterns/reduction/index.d.ts +4 -4
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.cjs +5 -9
- package/dist/patterns/refine-loop/index.d.cts +6 -6
- package/dist/patterns/refine-loop/index.d.ts +6 -6
- package/dist/patterns/refine-loop/index.js +1 -1
- package/dist/patterns/resilient-pipeline/index.cjs +1 -1
- package/dist/patterns/resilient-pipeline/index.d.cts +4 -8
- package/dist/patterns/resilient-pipeline/index.d.ts +4 -8
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +12 -16
- package/dist/patterns/surface/index.d.cts +6 -6
- package/dist/patterns/surface/index.d.ts +6 -6
- package/dist/patterns/surface/index.js +1 -1
- package/dist/{pipeline-graph-DuHpXSOn.d.cts → pipeline-graph-BQPr2Lqs.d.cts} +34 -17
- package/dist/{pipeline-graph-9JBbmRxA.d.ts → pipeline-graph-D8vKcO_p.d.ts} +34 -17
- package/dist/{reactive-layout-BMLDB4Vd.d.cts → reactive-layout-8CSc0tiA.d.cts} +2 -2
- package/dist/{reactive-layout-D-tRiNhg.d.ts → reactive-layout-DkTXxtSy.d.ts} +2 -2
- package/dist/{reactive-log-BgWSA1fg.d.ts → reactive-log-BlAsPLl2.d.ts} +2 -2
- package/dist/{reactive-log-C3IMAGpT.d.cts → reactive-log-_zeEnB9H.d.cts} +2 -2
- package/dist/{reactive-map-DmgeADH8.d.cts → reactive-map-B2qfD3hb.d.cts} +1 -1
- package/dist/{reactive-map-CHyeCf4D.d.ts → reactive-map-jFIsE6Kt.d.ts} +1 -1
- package/dist/resilience-HTF2LBRS.js +1 -0
- package/dist/{sugar-D13E2M_z.d.ts → sugar-BhfjgetH.d.ts} +1 -1
- package/dist/{sugar-DgaGJcI6.d.cts → sugar-DzePN5-g.d.cts} +1 -1
- package/dist/{topology-tree-jrZue3ao.d.cts → topology-tree-B5Ngw3j0.d.cts} +1 -1
- package/dist/{topology-tree-D47-nI6Z.d.ts → topology-tree-BtvbgMXJ.d.ts} +1 -1
- package/dist/{types-BMSGPlpO.d.cts → types-1Dhoi7HM.d.cts} +1 -1
- package/dist/{types-CidcBDuk.d.ts → types-39jk0kaV.d.ts} +1 -1
- package/package.json +11 -1
- package/dist/chunk-2YFDSYEF.js +0 -1
- package/dist/chunk-5BGFS2XH.js +0 -1
- package/dist/chunk-CMTN3KPT.js +0 -80
- package/dist/chunk-DQJLC6YY.js +0 -1
- package/dist/chunk-G7JN6LCB.js +0 -1
- package/dist/chunk-KJEAIIIY.js +0 -43
- package/dist/chunk-LV3ACS5J.js +0 -1
- package/dist/chunk-NN3QPJ6U.js +0 -1
- package/dist/chunk-NSAZ6PR6.js +0 -1
- package/dist/chunk-O32GJOUJ.js +0 -1
- package/dist/chunk-QEVSIVSF.js +0 -1
- package/dist/chunk-QMC2PLNM.js +0 -7
- package/dist/chunk-QOJFR6GS.js +0 -1
- package/dist/chunk-SFK7MN7S.js +0 -1
- package/dist/chunk-TB7JKSVS.js +0 -61
- package/dist/chunk-UAXFKMAG.js +0 -1
- package/dist/chunk-XIMFHEKV.js +0 -1
- package/dist/chunk-XLMYQB6F.js +0 -1
- package/dist/chunk-XLYF4LBH.js +0 -1
- package/dist/imperative-audit-ahAE65a9.d.cts +0 -28
- package/dist/imperative-audit-ahAE65a9.d.ts +0 -28
- package/dist/index-CpdnP-0y.d.cts +0 -186
- package/dist/index-DOU1Ee_k.d.ts +0 -186
- package/dist/resilience-LGBK236C.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as I,x as w}from"./chunk-
|
|
1
|
+
import{t as I,x as w}from"./chunk-L7WY6TZS.js";import{c as O}from"./chunk-35JTVPOX.js";import{b as E}from"./chunk-TZQPPQEQ.js";import{m as d,s as g}from"./chunk-IA7DUNGB.js";import{E as R,G as V,m as h}from"./chunk-LYCLF26R.js";import{b}from"./chunk-CK2E7BTU.js";function C(o){return typeof o=="object"&&o!==null&&"cache"in o&&typeof o.subscribe=="function"}function H(o,a,e){let r=d(o),t=r.v!=null,p=R(e?.initialVerified??null,{meta:{...O("verifiable"),...t?{sourceVersion:null}:{}}}),x=e?.trigger!==void 0&&e.trigger!==null,s=null;if(x&&e?.autoVerify?s=I(d(e.trigger),r):x?s=d(e.trigger):e?.autoVerify&&(s=r),s!==null){let y;if(s===r)y=w(r,c=>a(c));else{let c=r.cache;r.subscribe(f=>{for(let M of f)M[0]===b&&(c=M[1])}),y=w(s,()=>a(c))}g(y,c=>{h(()=>{if(p.down([[b,c]]),t){let f=r.v;f!=null&&p.meta.sourceVersion.down([[b,{id:f.id,version:f.version}]])}})})}return{node:r,verified:p,trigger:s}}function B(o){o.subscribe(()=>{})}function v(o){return o instanceof Map?o:new Map}function S(o,a){if(!Array.isArray(a.upsert))throw new TypeError("distill extraction requires upsert: Array<{ key, value }>");h(()=>{for(let{key:e,value:r}of a.upsert)o.set(e,r);for(let e of a.remove??[])o.delete(e)})}function J(o,a,e){let r=d(o),t=E(e.mapOptions??{}),p=e.budget??2e3,s=e.context!==void 0&&e.context!==null?d(e.context):R(null),y=v(t.entries.cache);t.entries.subscribe(i=>{for(let u of i)u[0]===b&&(y=v(u[1]))});let c=d(a(r,t.entries));if(g(c,i=>{S(t,i)}),e.evict){let i=new Map,u=V([t.entries],([l])=>{let m=[],N=v(l);for(let n of i.keys())N.has(n)||(i.get(n)(),i.delete(n));for(let[n,T]of N){let k=e.evict(n,T);if(C(k)){if(!i.has(n)){let D=g(k,z=>{z===!0&&t.has(n)&&t.delete(n)});i.set(n,D)}continue}if(typeof k=="boolean"){k&&m.push(n);continue}throw new TypeError("distill evict() must return boolean or Node<boolean>")}return m});g(u,l=>{for(let m of l)t.delete(m)})}let f=e.consolidateTrigger!==void 0&&e.consolidateTrigger!==null;if(e.consolidate&&f){let i=d(e.consolidateTrigger),u=w(i,()=>e.consolidate(y));g(u,l=>{S(t,l)})}let M=V([t.entries,s],([i,u])=>{let l=[...v(i).entries()].map(([n,T])=>({key:n,value:T,score:e.score(T,u),cost:e.cost(T)}));l.sort((n,T)=>T.score-n.score);let m=[],N=p;for(let n of l)n.cost<=N&&(m.push({key:n.key,value:n.value,score:n.score}),N-=n.cost);return m},{meta:{...O("distill",{budget:p})}}),A=V([t.entries],([i])=>v(i).size);return B(M),B(A),{store:t,compact:M,size:A}}export{H as a,J as b};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{a as Fe}from"./chunk-HAWKGIXM.js";import{d as Pe}from"./chunk-5XRI6RM3.js";import{t as Z}from"./chunk-EWF7KCDJ.js";import{c as _e}from"./chunk-NQI2C36M.js";import{g as $e,i as le}from"./chunk-N7UIBZCW.js";import{b as q}from"./chunk-D27JNOLZ.js";import{a as Me}from"./chunk-ZJ7SM3G2.js";import{a as ue}from"./chunk-VJJLIEAL.js";import{f as Oe,i as we}from"./chunk-7JRF5YEK.js";import{b as S,s as U,t as Ce,x as _}from"./chunk-L7WY6TZS.js";import{b as Ae}from"./chunk-35JTVPOX.js";import{b as X}from"./chunk-TZQPPQEQ.js";import{C as Se,m as z}from"./chunk-IA7DUNGB.js";import{D as Ne,E as A,F as Q,G as b,H as $,o as V}from"./chunk-LYCLF26R.js";import{b as F,i as P,j as W}from"./chunk-CK2E7BTU.js";import{b as tt}from"./chunk-QYADASLV.js";var wt={};tt(wt,{DEFAULT_DECAY_RATE:()=>D,DEFAULT_EXECUTE_PROMPT:()=>de,DEFAULT_QUEUE_CONFIGS:()=>ee,DEFAULT_SEVERITY_WEIGHTS:()=>L,DEFAULT_TRIAGE_PROMPT:()=>ce,DEFAULT_VERIFY_PROMPT:()=>pe,HarnessGraph:()=>re,QUEUE_NAMES:()=>k,actuatorExecutor:()=>Ve,affectedTaskFilter:()=>pt,autoSolidify:()=>it,beforeAfterCompare:()=>dt,codeChangeBridge:()=>ft,createIntakeBridge:()=>ut,defaultErrorClassifier:()=>te,defaultLlmExecutor:()=>Qe,defaultLlmVerifier:()=>Ue,dispatchActuator:()=>at,effectivenessTracker:()=>yt,evalIntakeBridge:()=>lt,evalSource:()=>ct,evalVerifier:()=>Le,harnessEvalPair:()=>xt,harnessLoop:()=>It,harnessProfile:()=>Nt,harnessTrace:()=>St,notifyEffect:()=>mt,priorityScore:()=>ht,refineExecutor:()=>fe,resolvePromptFn:()=>B,strategyKey:()=>j,strategyModel:()=>me});function rt(e,t){return{outcome:"success",detail:`actuator applied ${t.intervention} for ${st(t.summary)}`,artifact:e}}function nt(e,t){let o=e instanceof Error?e.message:String(e);return{outcome:"failure",detail:`actuator threw on ${t.intervention}: ${o}`}}function ot(e){return`actuator skipped ${e.intervention} (shouldApply returned false)`}function st(e,t=80){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}function Ve(e){let t=e.name??"actuator-executor",o=e.toOutput??rt,s=e.onError??nt,n=e.skipDetail??ot;return d=>{let r=S(d,i=>i!=null,{name:`${t}/gate-in`}),a=_(r,i=>e.shouldApply&&!e.shouldApply(i)?Q(c=>(c.down([[F,{outcome:"failure",detail:n(i)}],[P]]),()=>{}),{name:`${t}/skip`}):Q(c=>{let m=new AbortController,f=!1,l=null,g=R=>{f||(f=!0,c.down([[F,R],[P]]),l?.(),l=null)},y;try{let R=e.apply(i,{signal:m.signal});y=z(R,{signal:m.signal})}catch(R){return g(s(R,i)),()=>{m.abort()}}return l=y.subscribe(R=>{for(let E of R){if(f)return;if(E[0]===F){g(o(E[1],i));return}if(E[0]===W){g(s(E[1],i));return}if(E[0]===P){g(s(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 S(a,i=>i!=null,{name:`${t}/gate-out`})}}function at(e){let t=e.name??"dispatch-actuator",o=e.default??null,s=o!=null;return Ve({apply:(n,d)=>{let r=Object.hasOwn(e.routes,n.intervention)?e.routes[n.intervention]:o;if(!r)throw new Error(`dispatchActuator: no route for intervention '${n.intervention}'`);return r(n,d)},shouldApply:n=>Object.hasOwn(e.routes,n.intervention)||s,skipDetail:n=>`no route for intervention '${n.intervention}'`,name:t})}function it(e){let t=e.name??"auto-solidify",o=e.extract??(n=>n.execution.artifact??null),s=e.predicate??(()=>!0);return Q(n=>{let d=null,r=!1,a=()=>{r||(r=!0,d?.(),d=null)},i=c=>{r||(n.down([[W,c]]),a())};return d=e.verifyResults.subscribe(c=>{if(!r)for(let m of c){if(r)return;if(m[0]!==F){if(m[0]===P){n.down([[P]]),a();return}continue}let f=m[1];if(f==null||!f.verified)continue;let l;try{l=s(f)}catch(y){i(y);return}if(!l)continue;let g;try{g=o(f)}catch(y){i(y);return}if(g!=null){try{e.write(g,f)}catch(y){i(y);return}n.down([[F,g]])}}}),r&&d&&(d(),d=null),()=>{a()}},{name:t})}function ut(e,t,o,s){return $([e],([n])=>{if(n==null)return;let d=o(n);for(let r of d)t.publish(r)},{name:s?.name??"intake-bridge"})}function lt(e,t,o){let s=o?.defaultSeverity??"medium";return $([e],([n])=>{if(n==null)return;let d=Array.isArray(n)?n:[n];for(let r of d)for(let a of r.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: ${r.model})`,evidence:`Run ${r.run_id}: task produced invalid output`,affectsAreas:["graphspec"],affectsEvalTasks:[a.task_id],severity:s});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: ${r.model})`,evidence:i.reasoning,affectsAreas:["graphspec"],affectsEvalTasks:[a.task_id],severity:s})}},{name:o?.name??"eval-intake-bridge"})}function ct(e,t){return _(e,()=>z(t()))}function dt(e,t){return b([e,t],([o,s])=>{let n=o,d=s,r=new Map(n.tasks.map(l=>[l.task_id,l])),a=new Map(d.tasks.map(l=>[l.task_id,l])),i=new Set([...r.keys(),...a.keys()]),c=[],m=[],f=[];for(let l of i){let g=r.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,N=y?.judge_scores?y.judge_scores.filter(w=>w.pass).length:void 0,O=I!==void 0&&N!==void 0?N-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 pt(e,t){let o=t==null?null:Array.isArray(t)?A(t):t,s=[e];return o&&s.push(o),b(s,n=>{let d=n[0],r=o?new Set(n[1]):null,a=new Set;for(let i of d)for(let c of i.affectsEvalTasks??[])(r==null||r.has(c))&&a.add(c);return[...a].sort()},{name:"affected-task-filter"})}function ft(e,t,o,s){let n=s?.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:n});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:n});return i}let r=o??d;return $([e],([a])=>{if(a!=null)for(let i of r(a))t.publish(i)},{name:s?.name??"code-change-bridge"})}function mt(e,t,o){return $([e.latest],([s])=>{s!=null&&t(s)},{name:o?.name??"notify-effect"})}var k=["auto-fix","needs-decision","investigation","backlog"],ee={"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 gt=/\b(parse|json|config|validation|syntax)\b/i,te=e=>gt.test(e.detail)?"self-correctable":"structural",ce=`You are a triage classifier for a reactive collaboration harness.
|
|
2
|
+
|
|
3
|
+
Given an intake item, classify it and output JSON:
|
|
4
|
+
{
|
|
5
|
+
"rootCause": "composition" | "missing-fn" | "bad-docs" | "schema-gap" | "regression" | "unknown",
|
|
6
|
+
"intervention": "template" | "catalog-fn" | "docs" | "wrapper" | "schema-change" | "investigate",
|
|
7
|
+
"route": "auto-fix" | "needs-decision" | "investigation" | "backlog",
|
|
8
|
+
"priority": <number 0-100>,
|
|
9
|
+
"triageReasoning": "<one sentence>"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Strategy model (past effectiveness):
|
|
13
|
+
{{strategy}}
|
|
14
|
+
|
|
15
|
+
Intake item:
|
|
16
|
+
{{item}}`,de=`You are an implementation agent.
|
|
17
|
+
|
|
18
|
+
Given a triaged issue with root cause and intervention type, produce a fix.
|
|
19
|
+
|
|
20
|
+
Issue:
|
|
21
|
+
{{item}}
|
|
22
|
+
|
|
23
|
+
Output JSON:
|
|
24
|
+
{
|
|
25
|
+
"outcome": "success" | "failure" | "partial",
|
|
26
|
+
"detail": "<description of what was done or what failed>"
|
|
27
|
+
}`,pe=`You are a QA reviewer.
|
|
28
|
+
|
|
29
|
+
Given an execution result, verify whether the fix is correct.
|
|
30
|
+
|
|
31
|
+
Execution:
|
|
32
|
+
{{execution}}
|
|
33
|
+
|
|
34
|
+
Original issue:
|
|
35
|
+
{{item}}
|
|
36
|
+
|
|
37
|
+
Output JSON:
|
|
38
|
+
{
|
|
39
|
+
"verified": true/false,
|
|
40
|
+
"findings": ["<finding1>", ...],
|
|
41
|
+
"errorClass": "self-correctable" | "structural" // only if verified=false
|
|
42
|
+
}`;function B(e,t,o){if(typeof e=="function")return e;let s=e??t;return n=>o(s,n)}function yt(e){let t=X({name:e?.name??"effectiveness-entries"}),o=b([t.entries],([r])=>new Map(r),{name:`${e?.name??"effectiveness"}-snapshot`,equals:(r,a)=>{let i=r,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 s(r,a){let i=t.get(r),c=(i?.attempts??0)+1,m=(i?.successes??0)+(a?1:0);t.set(r,{key:r,attempts:c,successes:m,successRate:m/c})}function n(r){return t.get(r)}let d=Se(o);return{node:o,record:s,lookup:n,dispose:()=>{d(),t.dispose()}}}function Tt(e){let{best:t,score:o,status:s}=e,n=Number.isFinite(o)?o.toFixed(3):String(o),d=t??void 0;return s==="converged"?{outcome:"success",detail:`refineLoop converged at score ${n}`,artifact:d}:s==="budget"?{outcome:"partial",detail:`refineLoop hit budget at score ${n}`,artifact:d}:{outcome:"failure",detail:`refineLoop errored (status=${s})`,artifact:d}}function fe(e){let t=e.name??"refine-executor",o=e.toOutput??Tt;return s=>{let n=S(s,r=>r!=null,{name:`${t}/gate-in`}),d=_(n,r=>{let a=Fe(e.seedFrom(r),e.evaluator,e.strategy,{...e.refine,dataset:e.datasetFor(r),name:`${t}/inner`});return b([a.status,a.best,a.score],([i,c,m])=>{let f=i;return f!=="converged"&&f!=="budget"&&f!=="errored"?null:o({best:c,score:m,status:f})},{name:`${t}/output`})},{name:t});return S(d,r=>r!=null,{name:`${t}/gate-out`})}}function Et(e){if(e.length===0)return Number.NEGATIVE_INFINITY;let t=0;for(let o of e)t+=o.score;return t/e.length}function vt(e){let{passCount:t,total:o,meanScore:s,threshold:n,missingArtifact:d}=e,r=Number.isFinite(s)?s.toFixed(3):String(s),a=!d&&o>0&&s>=n,i=d?["EXECUTE stage did not emit an artifact; cannot verify reactively"]:a?[`${t}/${o} eval tasks passed; mean score ${r} \u2265 ${n}`]:o===0?["No eval tasks were selected for this item \u2014 cannot verify"]:[`${t}/${o} eval tasks passed; mean score ${r} < threshold ${n}`];return a?{verified:!0,findings:i}:{verified:!1,findings:i,errorClass:"structural"}}function Rt(e){return e.artifact??null}function Le(e){let t=e.name??"eval-verifier",o=e.threshold??.5,s=e.toOutput??vt,n=e.extractArtifact??Rt;return d=>{let r=S(d,i=>i!=null&&i[0]!=null&&i[1]!=null,{name:`${t}/gate-in`}),a=_(r,i=>{let[c,m]=i,f=n(c,m);if(f==null)return A(s({scores:[],meanScore:Number.NEGATIVE_INFINITY,passCount:0,total:0,threshold:o,missingArtifact:!0}));let l=A([f],{name:`${t}/candidates`}),g=A(e.datasetFor(m),{name:`${t}/dataset`}),y=e.evaluator(l,g);return b([y],([R])=>{let E=R;if(E==null)return null;let I=Et(E),N=E.filter(O=>O.score>=o).length;return s({scores:E,meanScore:I,passCount:N,total:E.length,threshold:o})},{name:`${t}/output`})},{name:t});return S(a,i=>i!=null,{name:`${t}/gate-out`})}}function xt(e){let t=e.name??"harness-pair",o=fe({name:`${t}-exec`,seedFrom:e.seedFrom,evaluator:e.evaluator,strategy:e.strategy,datasetFor:e.datasetFor,refine:e.refine}),s=Le({name:`${t}-verify`,evaluator:e.evaluator,datasetFor:e.datasetFor,threshold:e.threshold});return{executor:o,verifier:s}}function me(){let e=X({name:"strategy-entries"}),t=b([e.entries],([r])=>{let a=r;return new Map(a)},{name:"strategy-model",equals:(r,a)=>{let i=r,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 o(r,a,i){let c=j(r,a),m=e.get(c),f=(m?.attempts??0)+1,l=(m?.successes??0)+(i?1:0);e.set(c,{rootCause:r,intervention:a,attempts:f,successes:l,successRate:l/f})}function s(r,a){return e.get(j(r,a))}let n=t.subscribe(()=>{});function d(){n()}return{node:t,record:o,lookup:s,dispose:d}}function ht(e,t,o,s,n){let d={...L,...n?.severityWeights},r=n?.decayRate??D,a=n?.effectivenessThreshold??.7,i=n?.effectivenessBoost??15,c=[e,t,o];return s&&c.push(s),b(c,m=>{let f=m[0],l=m[1],g=m[2],y=s?m[3]:0,R=d[f.severity??"medium"],E=(V()-g)/1e9,I=Me(R,E,r,0),N=j(f.rootCause,f.intervention),O=l.get(N);return O&&O.successRate>=a&&(I+=i),I+=y*20,I},{name:"priority-score"})}var De="intake",bt="triage-output",je="retry",Ge="verify-results",He="__unrouted";function Qe(e,t){let o=B(t,de,(s,n)=>s.replace("{{item}}",JSON.stringify(n)));return s=>Z(e,[s],o,{name:"execute",format:"json"})}function Ue(e,t){let o=B(t,pe,(s,n)=>{let[d,r]=n;return s.replace("{{execution}}",JSON.stringify(d)).replace("{{item}}",JSON.stringify(r))});return s=>Z(e,[s],n=>n==null?"":o(n),{name:"verify",format:"json"})}var re=class extends we{queues;jobs;gates;queueTopics;strategy;totalRetries;totalReingestions;priorityScores;constructor(t,o,s,n,d,r,a,i,c){super(t),this.queues=o,this.queueTopics=s,this.jobs=n,this.gates=d,this.strategy=r,this.totalRetries=a,this.totalReingestions=i,this.priorityScores=c}get intake(){return this.queues.topic(De)}get verifyResults(){return this.queues.topic(Ge)}get retry(){return this.queues.topic(je)}get unrouted(){return this.queues.topic(He)}stageNodes(){let t=this.queues,o=r=>t.has(r)?`queues::${r}::latest`:null,s=r=>r==null?[]:[r],n=k.flatMap(r=>s(o(r))),d=[];for(let[r]of this.gates)d.push(`gates::${r}/gate`);return[{label:"INTAKE",paths:s(o("intake"))},{label:"TRIAGE",paths:["triage"]},{label:"QUEUE",paths:n},{label:"GATE",paths:d},{label:"EXECUTE",paths:["execute"]},{label:"VERIFY",paths:s(o("verify-results"))},{label:"REFLECT",paths:["reflect"]},{label:"STRATEGY",paths:["strategy"]}]}};function It(e,t){let o=t.adapter,s=t.maxRetries??2,n=t.retainedLimit??1e3,d=t.errorClassifier??te,r=new Map;for(let u of k)r.set(u,{...ee[u],...t.queues?.[u]});let a=$e(`${e}/queues`,{defaultTopicOptions:{retainedLimit:n}}),i=a.topic(De),c=a.topic(bt),m=a.topic(je),f=a.topic(Ge),l=new Map;for(let u of k)l.set(u,a.topic(u));let g=a.topic(He),y=me(),R=U(i.latest,y.node),E=B(t.triagePrompt,ce,(u,p)=>{let[T,x]=p;return u.replace("{{strategy}}",JSON.stringify(Array.from(x.entries()))).replace("{{item}}",JSON.stringify(T))}),I=Z(o,[R],u=>{let p=u;return!p||!p[0]?"":E(p)},{name:"triage",format:"json"}),N=U(I,R),w=$([N],([u])=>{if(u==null)return;let[p,T]=u;if(!p?.route)return;let x=T?.[0],C={...p,...x};c.publish(C)}).subscribe(()=>{}),Be=new Set(k);for(let u of k)le(`bridge/${u}`,c,l.get(u),{map:p=>p.route===u?p:void 0});le("bridge/__unrouted",c,g,{map:u=>Be.has(u.route)?void 0:u});let G=new Map,ne=new Map;for(let u of k)G.set(u,Pe(`jobs/${u}`));let ge=[];for(let u of k){let p=l.get(u),T=G.get(u),x=new WeakSet,C=$([p.events],([ie])=>{let H=ie??[];for(let h of H){if(x.has(h))continue;x.add(h);let M=T.enqueue(h);ne.set(q(h),{route:u,id:M})}},{name:`jobs/${u}-mirror`});ge.push(C.subscribe(()=>{}))}function ye(u){let p=q(u),T=ne.get(p);T&&(G.get(T.route)?.removeById(T.id),ne.delete(p))}let Te=_e("gates"),Y=new Map;for(let u of k){let p=r.get(u);if(!p.gated)continue;let T=l.get(u),x=Te.approvalGate(`${u}/gate`,T.latest,{maxPending:p.maxPending,startOpen:p.startOpen});Y.set(u,x)}let J=[];for(let u of k)r.get(u).gated&&Y.has(u)?J.push(Y.get(u).node):J.push(l.get(u).latest);J.push(m.latest);let oe=Ce(...J),Ee=(t.executor??Qe(o,t.executePrompt))(oe),se=U(Ee,oe),ve=(t.verifier??Ue(o,t.verifyPrompt))(se),Re=U(ve,se),xe=t.maxReingestions??1,Ye=Math.min(t.maxTotalRetries??s*10,100),Je=Math.min(t.maxTotalReingestions??xe*10,100),he=A(0),be=A(0);function Ke(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 We(u,p){y.record(p.rootCause,p.intervention,!0),f.publish(u),ye(p)}function ze(u,p){let T=q(p),x=p.$retries??0,C={...p,$retries:x+1,summary:`[RETRY ${x+1}/${s}] ${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),ye(p);let T=q(p),x=p.$reingestions??0;x<xe&&ue(be,Je)&&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 ae=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,ie]=x,[H,h]=ie??[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=Ke(C,H,h);if(M.verified){We(M,h);return}let Ze=M.errorClass??d({item:h,outcome:H.outcome,detail:M.findings.join("; ")}),et=h.$retries??0;Ze==="self-correctable"&&et<s&&ue(he,Ye)?ze(M,h):Ie(M,h)}),Xe=ae.subscribe(()=>{}),ke=b([ae],()=>null,{name:"reflect",equals:()=>!1}),K;t.priority&&(K=kt(l,y,t));let v=new re(e,a,l,G,Y,y,he,be,K);v.addDisposer(w),v.addDisposer(Xe),v.addDisposer(y.dispose);for(let u of ge)v.addDisposer(u);if(v.add(I,{name:"triage"}),v.add(oe,{name:"execute-input"}),v.add(Ee,{name:"execute"}),v.add(se,{name:"execute-context"}),v.add(ve,{name:"verify"}),v.add(Re,{name:"verify-context"}),v.add(ae,{name:"verify-dispatch"}),v.add(ke,{name:"reflect"}),v.add(y.node,{name:"strategy"}),v.addDisposer(ke.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",Te);for(let[u,p]of G)v.mount(`jobs/${u}`,p);return v.tagFactory("harnessLoop",Ae(t)),v}function kt(e,t,o){if(!o.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 s=o.lastInteractionNs,n=o.priority??{},d={...L,...n.severityWeights},r=n.decayRate??D,a=n.effectivenessThreshold??.7,i=n.effectivenessBoost??15,c=new Map;for(let[m,f]of e){let l=b([f.latest,t.node,s],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(-r*Math.max(0,E)),N=`${y.rootCause}\u2192${y.intervention}`,w=g[1]?.get(N);return w&&w.successRate>=a&&(I+=i),I},{name:`priority/${m}`});c.set(m,l)}return c}function Nt(e,t){let o=Oe(e,t),s={};for(let n of k){let d=e.queues.has(n)?e.queues.topic(n):null;s[n]=d?.retained().length??0}return{...o,queueDepths:s,strategyEntries:e.strategy.node.cache?.size??0,totalRetries:e.totalRetries.cache??0,totalReingestions:e.totalReingestions.cache??0}}function At(e){let t={};for(let{label:o,paths:s}of e.stageNodes())for(let n of s)t[n]=o;return t}function St(e,t){let o=t?.logger===null?null:t?.logger??console.log,s=t?.detail??"summary",n=V(),d=[],r=[],a=At(e);function i(){return(V()-n)/1e9}function c(m,f,l){let g={elapsed:i(),stage:m,type:f};s!=="summary"&&(g.summary=Ot(l)),s==="full"&&(g.data=l),r.push(g)}for(let[m,f]of Object.entries(a))try{let l=e.observe(m,{format:"stage-log",stageLabels:a,logger:o?g=>o(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}`),o&&o(`[${i().toFixed(3)}s] ${f.padEnd(9)} \u2717 observe-unavailable: ${g}`)}return{get events(){return r},dispose(){for(let m of d)m.dispose();d.length=0}}}function Ot(e){if(e==null)return"null";if(typeof e=="string")return qe(e,80);if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{let t=JSON.stringify(e);return qe(t,120)}catch{return String(e)}}function qe(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}export{Ve as a,at as b,it as c,ut as d,lt as e,ct as f,dt as g,pt as h,ft as i,mt as j,k,ee as l,L as m,D as n,j as o,te as p,ce as q,de as r,pe as s,B as t,yt as u,fe as v,Le as w,xt as x,me as y,ht as z,Qe as A,Ue as B,re as C,It as D,Nt as E,St as F,wt as G};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as M,e as se,f as ae}from"./chunk-NN3QPJ6U.js";import{c as oe}from"./chunk-O32GJOUJ.js";import{k as re}from"./chunk-QMC2PLNM.js";import{b as ne}from"./chunk-DQJLC6YY.js";import{b as J}from"./chunk-7KZZLWZ6.js";import{C as z}from"./chunk-RZ5HKPGI.js";import{D as ee,E as te,G as j,m as Y,p as R,t as D}from"./chunk-LYCLF26R.js";import{b as X}from"./chunk-CK2E7BTU.js";import{b as ce}from"./chunk-QYADASLV.js";var me={};ce(me,{CqrsGraph:()=>G,cqrs:()=>fe,cqrsEventKeyOf:()=>pe,dispatchKeyOf:()=>he,sagaInvocationKeyOf:()=>ve});var k=class extends Error{constructor(e,n){super(e,n),this.name=this.constructor.name}},B=class extends k{constructor(n,t){super(`Duplicate ${n} registration: "${t}"`);this.kind=n;this.registrationName=t}},N=class extends k{constructor(n,t,r){super(`Command "${n}" emitted undeclared event "${t}". Declared emits: [${r.join(", ")}]`);this.commandName=n;this.eventName=t;this.declaredEmits=r}},K=class extends k{constructor(n,t,r){super(`Optimistic concurrency conflict on aggregate "${n}": expected version ${t}, got ${r}`);this.aggregateId=n;this.expected=t;this.actual=r}},H=class extends k{constructor(n){super(`Unknown command: "${n}". Register with command() first.`);this.commandName=n}},O=class extends k{constructor(n,t){super(`Command handler "${n}" threw: ${t instanceof Error?t.message:String(t)}`,{cause:t});this.commandName=n}};var P=class extends k{constructor(n,t){super(`Projection "${n}" rebuild failed: ${t instanceof Error?t.message:String(t)}`,{cause:t});this.projectionName=n}};var le=D((a,e)=>{a("write"),a("signal"),e("observe")}),ue=D((a,e)=>{a("observe"),a("signal"),e("write")}),ie=D((a,e)=>{a("observe"),a("signal"),e("write")});function $(a,e){return oe("cqrs",a,e)}function Z(a){if(a===null||typeof a!="object"||Object.isFrozen(a))return a;for(let e of Object.keys(a))Z(a[e]);return Object.freeze(a)}var pe=a=>`${a.type}::${a.aggregateId??"__default__"}`,he=a=>a.commandName,ve=a=>a.eventType,G=class extends re{_eventLogs=new Map;_eventLogsByAggregate=new Map;_aggregateVersions=new Map;_aggregateLru=new Map;_commandRegs=new Map;_projections=new Set;_sagas=new Set;_keepaliveDisposers=[];_seq=0;_retainedLimit;_freezeCommandPayload;_freezeEventPayload;_maxAggregates;_dispatchSeqCursor;dispatches;audit;aggregateEvictions;constructor(e,n={}){super(e,n.graph),this._retainedLimit=n.retainedLimit??1024,this._freezeCommandPayload=n.freezeCommandPayload??!0,this._freezeEventPayload=n.freezeEventPayload??!0,this._maxAggregates=n.maxAggregates??1e4,this.dispatches=M({name:"dispatches",retainedLimit:this._retainedLimit,graph:this}),this.audit=this.dispatches,this.aggregateEvictions=M({name:"aggregateEvictions",retainedLimit:this._retainedLimit,graph:this}),this._dispatchSeqCursor=se(this,"dispatch_seq",0)}aggregateVersion(e,n){return this._aggregateVersions.get(`${e}::${n}`)??0}_touchAggregate(e){this._aggregateLru.delete(e),this._aggregateLru.set(e,!0)}_enforceAggregateLru(){for(;this._aggregateLru.size>this._maxAggregates;){let e=this._aggregateLru.keys().next();if(e.done)break;let n=e.value;this._aggregateLru.delete(n);let t=n.indexOf("::");if(t<0)continue;let r=n.slice(0,t),s=n.slice(t+2),o=this._aggregateVersions.get(n)??0;this._aggregateVersions.delete(n);let i=this._eventLogsByAggregate.get(r);i&&(i.delete(s),i.size===0&&this._eventLogsByAggregate.delete(r)),this.aggregateEvictions.append({aggregateId:s,type:r,lastVersion:o,t_ns:R()})}}destroy(){for(let e of this._keepaliveDisposers)e();this._keepaliveDisposers.length=0,super.destroy()}_attachedEventTiers=[];_attachedTierDisposers=new Map;attachEventStorage(e){this._attachedEventTiers.push(e);for(let[n,t]of this._eventLogs){let r=t.log.attachStorage(e),s=this._attachedTierDisposers.get(n);s||(s=[],this._attachedTierDisposers.set(n,s)),s.push(r)}for(let[n,t]of this._eventLogsByAggregate)for(let[r,s]of t){let o=`${n}::${r}`,i=s.log.attachStorage(e),c=this._attachedTierDisposers.get(o);c||(c=[],this._attachedTierDisposers.set(o,c)),c.push(i)}return()=>{let n=this._attachedEventTiers.indexOf(e);n>=0&&this._attachedEventTiers.splice(n,1)}}_autoWireStreamStorage(e,n){if(this._attachedEventTiers.length===0)return;let t=this._attachedTierDisposers.get(e);t||(t=[],this._attachedTierDisposers.set(e,t));for(let r of this._attachedEventTiers)t.push(n.attachStorage(r))}_bumpDispatchSeq(){let n=(this._dispatchSeqCursor.cache??0)+1;return this._dispatchSeqCursor.emit(n),n}event(e,n){if(n!==void 0)return this._ensureAggregateStream(e,n).node;let t=this._eventLogs.get(e);if(t)return t.node;let r=J([],{name:e,versioning:0,maxSize:this._retainedLimit});r.withLatest();let s=r.entries,o=j([s],([i])=>i,{name:e,describeKind:"state",meta:$("event",{event_name:e}),guard:ie,initial:s.cache});return this.add(o,{name:e}),this._keepaliveDisposers.push(z(o)),this._eventLogs.set(e,{log:r,node:o}),this._autoWireStreamStorage(e,r),o}_ensureAggregateStream(e,n){this._eventLogs.has(e)||this.event(e);let t=this._eventLogsByAggregate.get(e);t||(t=new Map,this._eventLogsByAggregate.set(e,t));let r=`${e}::${n}`;this._touchAggregate(r);let s=t.get(n);if(s)return s;let o=`${e}_${n.replace(/[^a-zA-Z0-9_-]/g,"_")}`,i=J([],{name:o,versioning:0,maxSize:this._retainedLimit});i.withLatest();let c=i.entries,h=j([c],([p])=>p,{name:o,describeKind:"state",meta:$("event_aggregate",{event_name:e,aggregate_id:n}),guard:ie,initial:c.cache}),l=o,m=0;for(;this.nameOf(this.resolveOptional(l)??h)===l&&(m+=1,l=`${o}_${m}`,this.resolveOptional(l)!==void 0););try{this.add(h,{name:l})}catch{}this._keepaliveDisposers.push(z(h));let u={log:i,node:h};return t.set(n,u),this._autoWireStreamStorage(`${e}::${n}`,i),this._enforceAggregateLru(),u}resolveOptional(e){try{return this.resolve(e)}catch{return}}_appendEvent(e,n,t){let r=this._eventLogs.get(e);if(r||(this.event(e),r=this._eventLogs.get(e)),r.node.status==="completed"||r.node.status==="errored")throw new Error(`Cannot dispatch to terminated event stream "${e}" (status: ${r.node.status}).`);let s,o;if(t?.aggregateId!==void 0){let l=`${e}::${t.aggregateId}`;s=(this._aggregateVersions.get(l)??0)+1,this._aggregateVersions.set(l,s),o=this._ensureAggregateStream(e,t.aggregateId)}let i=r.log.entries.v,c=this._freezeEventPayload?Z(n):n,h={type:e,payload:c,timestampNs:R(),seq:++this._seq,...t?.aggregateId!==void 0?{aggregateId:t.aggregateId}:{},...s!==void 0?{aggregateVersion:s}:{},...t?.correlationId!==void 0?{correlationId:t.correlationId}:{},...t?.causationId!==void 0?{causationId:t.causationId}:{},...t?.metadata!==void 0?{metadata:Object.freeze({...t.metadata})}:{},...t?.handlerVersion!==void 0?{handlerVersion:t.handlerVersion}:{},...i!=null?{v0:{id:i.id,version:i.version}}:{}};return r.log.append(h),o&&o.log.append(h),h}command(e,n){if(this._commandRegs.has(e))throw new B("command",e);let t=typeof n=="function"?{handler:n}:n,r=te(void 0,{name:e,describeKind:"state",meta:{...$("command",{command_name:e}),error:null},guard:le});if(this.add(r,{name:e}),this._commandRegs.set(e,{handler:t.handler,...t.emits!==void 0?{emits:t.emits}:{},...t.handlerVersion!==void 0?{handlerVersion:t.handlerVersion}:{}}),t.emits)for(let s of t.emits)this._eventLogs.has(s)||this.event(s);return r}dispatch(e,n,t){let r=this._commandRegs.get(e);if(!r)throw new H(e);if(t?.aggregateId!==void 0&&t.expectedAggregateVersion!==void 0&&r.emits!==void 0){let u=0;for(let p of r.emits){let _=this._aggregateVersions.get(`${p}::${t.aggregateId}`);_!==void 0&&_>u&&(u=_)}if(u!==t.expectedAggregateVersion)throw new K(t.aggregateId,t.expectedAggregateVersion,u)}let s=this.resolve(e),o=this._freezeCommandPayload?Z(n):n,i=[],c=R(),h=0,l,m=!1;try{Y(()=>{h=this._bumpDispatchSeq(),s.emit(o,{internal:!0});try{r.handler(o,{emit:(u,p)=>{if(r.emits!==void 0&&!r.emits.includes(u))throw new N(e,u,r.emits);i.push(u),this._appendEvent(u,p,{...t?.aggregateId!==void 0?{aggregateId:t.aggregateId}:{},...t?.correlationId!==void 0?{correlationId:t.correlationId}:{},...t?.causationId!==void 0?{causationId:t.causationId}:{},...t?.metadata!==void 0?{metadata:Object.freeze({...t.metadata})}:{},...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}})}}),s.meta.error.emit(null,{internal:!0}),this.dispatches.append({commandName:e,payload:o,status:"success",emittedEvents:[...i],t_ns:c,seq:h,...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}})}catch(u){throw l=u,m=!0,u}})}catch(u){if(m){s.meta.error.emit(l,{internal:!0});let p=l instanceof Error?l.name:typeof l,_=l instanceof O?l:new O(e,l);this.dispatches.append({commandName:e,payload:o,status:"failed",error:_,errorType:p,emittedEvents:[...i],t_ns:c,seq:h,...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}})}throw m?l:u}}projection(e){let{name:n,events:t,reducer:r,initial:s}=e,o=e.mode??"scan",i=e.freezeInputs??!0,c=e.snapshot,h=t.map(d=>(this._eventLogs.has(d)||this.event(d),this._eventLogs.get(d).node));function l(d){d.sort((g,v)=>g.timestampNs-v.timestampNs||g.seq-v.seq||(g.aggregateId??"").localeCompare(v.aggregateId??""))}function m(d){let g=[];for(let v of d)g.push(...v);return l(g),g}let u=h.map(d=>d.cache??[]),p=m(u),_=i?Object.freeze(p):p,C=0,y=s;o==="scan"&&p.length>0&&(y=r(s,_),C=p.length);let q=o==="replay"?r(s,_):y,V=c?.saveDebounceMs??1e3,A=c?.saveEvery??1e3,E,L=0;function F(d){if(c?.save){if(L+=1,L>=A){L=0,E!==void 0&&(clearTimeout(E),E=void 0);let g=c.save(d);g instanceof Promise&&g.catch(()=>{});return}E!==void 0&&clearTimeout(E),E=setTimeout(()=>{E=void 0,L=0;let g=c.save(d);g instanceof Promise&&g.catch(()=>{})},V)}}let S=j(h,d=>{let g=m(d),v;if(o==="replay"){let w=i?Object.freeze(g):g;v=r(s,w)}else{let w=g.slice(C);C=g.length;let f=i?Object.freeze(w):w;v=r(y,f),y=v}return F(v),v},{name:n,describeKind:"derived",meta:$("projection",{projection_name:n,source_events:t}),guard:ue,initial:q});return this.add(S,{name:n}),this._keepaliveDisposers.push(z(S)),this._keepaliveDisposers.push(()=>{E!==void 0&&(clearTimeout(E),E=void 0)}),this._projections.add(n),{node:S,rebuild:async d=>{try{let g=d?.pageSize??1e3,v=d?.fromTier??this._attachedEventTiers[0]?.[0],w=m(h.map(T=>T.cache??[])).length,f=s;if(c?.load){let T=await c.load();T!==void 0&&(f=T)}if(!v||!v.loadEntries){let T=m(h.map(I=>I.cache??[])),b=i?Object.freeze(T):T;f=r(f,b)}else{let T=new Set(t),b,I=!1;for(;!I;){let U=await v.loadEntries({cursor:b,pageSize:g}),W=[...U.entries].filter(ge=>T.has(ge.type));l(W);let de=i?Object.freeze(W):W;f=r(f,de),b=U.cursor,I=!b||U.entries.length===0}}if(o==="scan"){let T=m(h.map(I=>I.cache??[])),b=T.slice(w);if(b.length>0){let I=i?Object.freeze(b):b;f=r(f,I)}y=f,C=T.length}return S.emit(f,{internal:!0}),f}catch(g){throw new P(n,g)}},reset:async()=>{try{let d=s;if(c?.load){let f=await c.load();f!==void 0&&(d=f)}let g=m(h.map(f=>f.cache??[])),v=i?Object.freeze(g):g,w=r(d,v);return o==="scan"&&(y=w,C=g.length),S.emit(w,{internal:!0}),w}catch(d){throw new P(n,d)}}}}saga(e,n,t,r={}){let s=n.map(p=>(this._eventLogs.has(p)||this.event(p),this._eventLogs.get(p).node)),o=ae(this,`${e}_cursor`,n,0),i=M({name:`${e}_invocations`,retainedLimit:this._retainedLimit,graph:this}),c=r.aggregateId,h=r.errorPolicy??"advance",l=new Map;for(let p of n){let _=o[p];l.set(p,_.cache??0);let C=_.subscribe(y=>{for(let q of y)q[0]===X&&l.set(p,q[1])});this._keepaliveDisposers.push(C)}let m={},u=ee(s,(p,_)=>{let C=m.n.meta.error;for(let y=0;y<p.length;y++){let q=p[y];if(q==null||q.length===0)continue;let V=q.at(-1);if(!V)continue;let A=n[y],E=o[A],L=l.get(A)??0;if(V.length>L){let F=V.slice(L),S=L;for(let Q of F){let x=Q;if(c!==void 0&&x.aggregateId!==c){S+=1;continue}try{t(x),C.emit(null,{internal:!0}),i.append({eventType:A,status:"success",aggregateId:x.aggregateId,event:x,t_ns:R(),...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}}),S+=1}catch(d){if(C.emit(d,{internal:!0}),i.append({eventType:A,status:"failed",error:d,errorType:d instanceof Error?d.name:typeof d,aggregateId:x.aggregateId,event:x,t_ns:R(),...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}}),h==="hold")break;S+=1}}E.emit(S)}}},{name:e,describeKind:"effect",meta:{...$("saga",{saga_name:e,source_events:n}),error:null}});return m.n=u,this.add(u,{name:e}),this._keepaliveDisposers.push(z(u)),this._sagas.add(e),{node:u,invocations:i,audit:i,cursors:o}}};function fe(a,e){let n=new G(a,e),{factory:t,factoryArgs:r,...s}=e??{};return n.tagFactory("cqrs",ne(s)),n}export{pe as a,he as b,ve as c,G as d,fe as e,me as f};
|
|
1
|
+
import{c as M,h as oe,i as ae}from"./chunk-VJJLIEAL.js";import{a as ne}from"./chunk-L6NSJVJZ.js";import{i as se}from"./chunk-7JRF5YEK.js";import{b as re}from"./chunk-35JTVPOX.js";import{b as J}from"./chunk-AU7YTQX7.js";import{C as z}from"./chunk-IA7DUNGB.js";import{D as ee,E as te,G as j,m as Y,p as R,t as D}from"./chunk-LYCLF26R.js";import{b as X}from"./chunk-CK2E7BTU.js";import{b as ce}from"./chunk-QYADASLV.js";var me={};ce(me,{CqrsGraph:()=>G,cqrs:()=>fe,cqrsEventKeyOf:()=>pe,dispatchKeyOf:()=>he,sagaInvocationKeyOf:()=>ve});var k=class extends Error{constructor(e,n){super(e,n),this.name=this.constructor.name}},B=class extends k{constructor(n,t){super(`Duplicate ${n} registration: "${t}"`);this.kind=n;this.registrationName=t}},N=class extends k{constructor(n,t,r){super(`Command "${n}" emitted undeclared event "${t}". Declared emits: [${r.join(", ")}]`);this.commandName=n;this.eventName=t;this.declaredEmits=r}},K=class extends k{constructor(n,t,r){super(`Optimistic concurrency conflict on aggregate "${n}": expected version ${t}, got ${r}`);this.aggregateId=n;this.expected=t;this.actual=r}},H=class extends k{constructor(n){super(`Unknown command: "${n}". Register with command() first.`);this.commandName=n}},O=class extends k{constructor(n,t){super(`Command handler "${n}" threw: ${t instanceof Error?t.message:String(t)}`,{cause:t});this.commandName=n}};var P=class extends k{constructor(n,t){super(`Projection "${n}" rebuild failed: ${t instanceof Error?t.message:String(t)}`,{cause:t});this.projectionName=n}};var le=D((o,e)=>{o("write"),o("signal"),e("observe")}),ue=D((o,e)=>{o("observe"),o("signal"),e("write")}),ie=D((o,e)=>{o("observe"),o("signal"),e("write")});function $(o,e){return ne("cqrs",o,e)}function Z(o){if(o===null||typeof o!="object"||Object.isFrozen(o))return o;for(let e of Object.keys(o))Z(o[e]);return Object.freeze(o)}var pe=o=>`${o.type}::${o.aggregateId??"__default__"}`,he=o=>o.commandName,ve=o=>o.eventType,G=class extends se{_eventLogs=new Map;_eventLogsByAggregate=new Map;_aggregateVersions=new Map;_aggregateLru=new Map;_commandRegs=new Map;_projections=new Set;_sagas=new Set;_keepaliveDisposers=[];_seq=0;_retainedLimit;_freezeCommandPayload;_freezeEventPayload;_maxAggregates;_dispatchSeqCursor;dispatches;audit;aggregateEvictions;constructor(e,n={}){super(e,n.graph),this._retainedLimit=n.retainedLimit??1024,this._freezeCommandPayload=n.freezeCommandPayload??!0,this._freezeEventPayload=n.freezeEventPayload??!0,this._maxAggregates=n.maxAggregates??1e4,this.dispatches=M({name:"dispatches",retainedLimit:this._retainedLimit,graph:this}),this.audit=this.dispatches,this.aggregateEvictions=M({name:"aggregateEvictions",retainedLimit:this._retainedLimit,graph:this}),this._dispatchSeqCursor=oe(this,"dispatch_seq",0)}aggregateVersion(e,n){return this._aggregateVersions.get(`${e}::${n}`)??0}_touchAggregate(e){this._aggregateLru.delete(e),this._aggregateLru.set(e,!0)}_enforceAggregateLru(){for(;this._aggregateLru.size>this._maxAggregates;){let e=this._aggregateLru.keys().next();if(e.done)break;let n=e.value;this._aggregateLru.delete(n);let t=n.indexOf("::");if(t<0)continue;let r=n.slice(0,t),s=n.slice(t+2),a=this._aggregateVersions.get(n)??0;this._aggregateVersions.delete(n);let i=this._eventLogsByAggregate.get(r);i&&(i.delete(s),i.size===0&&this._eventLogsByAggregate.delete(r)),this.aggregateEvictions.append({aggregateId:s,type:r,lastVersion:a,t_ns:R()})}}destroy(){for(let e of this._keepaliveDisposers)e();this._keepaliveDisposers.length=0,super.destroy()}_attachedEventTiers=[];_attachedTierDisposers=new Map;attachEventStorage(e){this._attachedEventTiers.push(e);for(let[n,t]of this._eventLogs){let r=t.log.attachStorage(e),s=this._attachedTierDisposers.get(n);s||(s=[],this._attachedTierDisposers.set(n,s)),s.push(r)}for(let[n,t]of this._eventLogsByAggregate)for(let[r,s]of t){let a=`${n}::${r}`,i=s.log.attachStorage(e),c=this._attachedTierDisposers.get(a);c||(c=[],this._attachedTierDisposers.set(a,c)),c.push(i)}return()=>{let n=this._attachedEventTiers.indexOf(e);n>=0&&this._attachedEventTiers.splice(n,1)}}_autoWireStreamStorage(e,n){if(this._attachedEventTiers.length===0)return;let t=this._attachedTierDisposers.get(e);t||(t=[],this._attachedTierDisposers.set(e,t));for(let r of this._attachedEventTiers)t.push(n.attachStorage(r))}_bumpDispatchSeq(){let n=(this._dispatchSeqCursor.cache??0)+1;return this._dispatchSeqCursor.emit(n),n}event(e,n){if(n!==void 0)return this._ensureAggregateStream(e,n).node;let t=this._eventLogs.get(e);if(t)return t.node;let r=J([],{name:e,versioning:0,maxSize:this._retainedLimit});r.withLatest();let s=r.entries,a=j([s],([i])=>i,{name:e,describeKind:"state",meta:$("event",{event_name:e}),guard:ie,initial:s.cache});return this.add(a,{name:e}),this._keepaliveDisposers.push(z(a)),this._eventLogs.set(e,{log:r,node:a}),this._autoWireStreamStorage(e,r),a}_ensureAggregateStream(e,n){this._eventLogs.has(e)||this.event(e);let t=this._eventLogsByAggregate.get(e);t||(t=new Map,this._eventLogsByAggregate.set(e,t));let r=`${e}::${n}`;this._touchAggregate(r);let s=t.get(n);if(s)return s;let a=`${e}_${n.replace(/[^a-zA-Z0-9_-]/g,"_")}`,i=J([],{name:a,versioning:0,maxSize:this._retainedLimit});i.withLatest();let c=i.entries,h=j([c],([p])=>p,{name:a,describeKind:"state",meta:$("event_aggregate",{event_name:e,aggregate_id:n}),guard:ie,initial:c.cache}),l=a,m=0;for(;this.nameOf(this.resolveOptional(l)??h)===l&&(m+=1,l=`${a}_${m}`,this.resolveOptional(l)!==void 0););try{this.add(h,{name:l})}catch{}this._keepaliveDisposers.push(z(h));let u={log:i,node:h};return t.set(n,u),this._autoWireStreamStorage(`${e}::${n}`,i),this._enforceAggregateLru(),u}resolveOptional(e){try{return this.resolve(e)}catch{return}}_appendEvent(e,n,t){let r=this._eventLogs.get(e);if(r||(this.event(e),r=this._eventLogs.get(e)),r.node.status==="completed"||r.node.status==="errored")throw new Error(`Cannot dispatch to terminated event stream "${e}" (status: ${r.node.status}).`);let s,a;if(t?.aggregateId!==void 0){let l=`${e}::${t.aggregateId}`;s=(this._aggregateVersions.get(l)??0)+1,this._aggregateVersions.set(l,s),a=this._ensureAggregateStream(e,t.aggregateId)}let i=r.log.entries.v,c=this._freezeEventPayload?Z(n):n,h={type:e,payload:c,timestampNs:R(),seq:++this._seq,...t?.aggregateId!==void 0?{aggregateId:t.aggregateId}:{},...s!==void 0?{aggregateVersion:s}:{},...t?.correlationId!==void 0?{correlationId:t.correlationId}:{},...t?.causationId!==void 0?{causationId:t.causationId}:{},...t?.metadata!==void 0?{metadata:Object.freeze({...t.metadata})}:{},...t?.handlerVersion!==void 0?{handlerVersion:t.handlerVersion}:{},...i!=null?{v0:{id:i.id,version:i.version}}:{}};return r.log.append(h),a&&a.log.append(h),h}command(e,n){if(this._commandRegs.has(e))throw new B("command",e);let t=typeof n=="function"?{handler:n}:n,r=te(void 0,{name:e,describeKind:"state",meta:{...$("command",{command_name:e}),error:null},guard:le});if(this.add(r,{name:e}),this._commandRegs.set(e,{handler:t.handler,...t.emits!==void 0?{emits:t.emits}:{},...t.handlerVersion!==void 0?{handlerVersion:t.handlerVersion}:{}}),t.emits)for(let s of t.emits)this._eventLogs.has(s)||this.event(s);return r}dispatch(e,n,t){let r=this._commandRegs.get(e);if(!r)throw new H(e);if(t?.aggregateId!==void 0&&t.expectedAggregateVersion!==void 0&&r.emits!==void 0){let u=0;for(let p of r.emits){let _=this._aggregateVersions.get(`${p}::${t.aggregateId}`);_!==void 0&&_>u&&(u=_)}if(u!==t.expectedAggregateVersion)throw new K(t.aggregateId,t.expectedAggregateVersion,u)}let s=this.resolve(e),a=this._freezeCommandPayload?Z(n):n,i=[],c=R(),h=0,l,m=!1;try{Y(()=>{h=this._bumpDispatchSeq(),s.emit(a,{internal:!0});try{r.handler(a,{emit:(u,p)=>{if(r.emits!==void 0&&!r.emits.includes(u))throw new N(e,u,r.emits);i.push(u),this._appendEvent(u,p,{...t?.aggregateId!==void 0?{aggregateId:t.aggregateId}:{},...t?.correlationId!==void 0?{correlationId:t.correlationId}:{},...t?.causationId!==void 0?{causationId:t.causationId}:{},...t?.metadata!==void 0?{metadata:Object.freeze({...t.metadata})}:{},...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}})}}),s.meta.error.emit(null,{internal:!0}),this.dispatches.append({commandName:e,payload:a,outcome:"success",emittedEvents:[...i],t_ns:c,seq:h,...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}})}catch(u){throw l=u,m=!0,u}})}catch(u){if(m){s.meta.error.emit(l,{internal:!0});let p=l instanceof Error?l.name:typeof l,_=l instanceof O?l:new O(e,l);this.dispatches.append({commandName:e,payload:a,outcome:"failure",error:_,errorType:p,emittedEvents:[...i],t_ns:c,seq:h,...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}})}throw m?l:u}}projection(e){let{name:n,events:t,reducer:r,initial:s}=e,a=e.mode??"scan",i=e.freezeInputs??!0,c=e.snapshot,h=t.map(d=>(this._eventLogs.has(d)||this.event(d),this._eventLogs.get(d).node));function l(d){d.sort((g,v)=>g.timestampNs-v.timestampNs||g.seq-v.seq||(g.aggregateId??"").localeCompare(v.aggregateId??""))}function m(d){let g=[];for(let v of d)g.push(...v);return l(g),g}let u=h.map(d=>d.cache??[]),p=m(u),_=i?Object.freeze(p):p,C=0,y=s;a==="scan"&&p.length>0&&(y=r(s,_),C=p.length);let q=a==="replay"?r(s,_):y,V=c?.saveDebounceMs??1e3,A=c?.saveEvery??1e3,E,L=0;function F(d){if(c?.save){if(L+=1,L>=A){L=0,E!==void 0&&(clearTimeout(E),E=void 0);let g=c.save(d);g instanceof Promise&&g.catch(()=>{});return}E!==void 0&&clearTimeout(E),E=setTimeout(()=>{E=void 0,L=0;let g=c.save(d);g instanceof Promise&&g.catch(()=>{})},V)}}let S=j(h,d=>{let g=m(d),v;if(a==="replay"){let w=i?Object.freeze(g):g;v=r(s,w)}else{let w=g.slice(C);C=g.length;let f=i?Object.freeze(w):w;v=r(y,f),y=v}return F(v),v},{name:n,describeKind:"derived",meta:$("projection",{projection_name:n,source_events:t}),guard:ue,initial:q});return this.add(S,{name:n}),this._keepaliveDisposers.push(z(S)),this._keepaliveDisposers.push(()=>{E!==void 0&&(clearTimeout(E),E=void 0)}),this._projections.add(n),{node:S,rebuild:async d=>{try{let g=d?.pageSize??1e3,v=d?.fromTier??this._attachedEventTiers[0]?.[0],w=m(h.map(T=>T.cache??[])).length,f=s;if(c?.load){let T=await c.load();T!==void 0&&(f=T)}if(!v||!v.loadEntries){let T=m(h.map(I=>I.cache??[])),b=i?Object.freeze(T):T;f=r(f,b)}else{let T=new Set(t),b,I=!1;for(;!I;){let U=await v.loadEntries({cursor:b,pageSize:g}),W=[...U.entries].filter(ge=>T.has(ge.type));l(W);let de=i?Object.freeze(W):W;f=r(f,de),b=U.cursor,I=!b||U.entries.length===0}}if(a==="scan"){let T=m(h.map(I=>I.cache??[])),b=T.slice(w);if(b.length>0){let I=i?Object.freeze(b):b;f=r(f,I)}y=f,C=T.length}return S.emit(f,{internal:!0}),f}catch(g){throw new P(n,g)}},reset:async()=>{try{let d=s;if(c?.load){let f=await c.load();f!==void 0&&(d=f)}let g=m(h.map(f=>f.cache??[])),v=i?Object.freeze(g):g,w=r(d,v);return a==="scan"&&(y=w,C=g.length),S.emit(w,{internal:!0}),w}catch(d){throw new P(n,d)}}}}saga(e,n,t,r={}){let s=n.map(p=>(this._eventLogs.has(p)||this.event(p),this._eventLogs.get(p).node)),a=ae(this,`${e}_cursor`,n,0),i=M({name:`${e}_invocations`,retainedLimit:this._retainedLimit,graph:this}),c=r.aggregateId,h=r.errorPolicy??"advance",l=new Map;for(let p of n){let _=a[p];l.set(p,_.cache??0);let C=_.subscribe(y=>{for(let q of y)q[0]===X&&l.set(p,q[1])});this._keepaliveDisposers.push(C)}let m={},u=ee(s,(p,_)=>{let C=m.n.meta.error;for(let y=0;y<p.length;y++){let q=p[y];if(q==null||q.length===0)continue;let V=q.at(-1);if(!V)continue;let A=n[y],E=a[A],L=l.get(A)??0;if(V.length>L){let F=V.slice(L),S=L;for(let Q of F){let x=Q;if(c!==void 0&&x.aggregateId!==c){S+=1;continue}try{t(x),C.emit(null,{internal:!0}),i.append({eventType:A,outcome:"success",aggregateId:x.aggregateId,event:x,t_ns:R(),...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}}),S+=1}catch(d){if(C.emit(d,{internal:!0}),i.append({eventType:A,outcome:"failure",error:d,errorType:d instanceof Error?d.name:typeof d,aggregateId:x.aggregateId,event:x,t_ns:R(),...r.handlerVersion!==void 0?{handlerVersion:r.handlerVersion}:{}}),h==="hold")break;S+=1}}E.emit(S)}}},{name:e,describeKind:"effect",meta:{...$("saga",{saga_name:e,source_events:n}),error:null}});return m.n=u,this.add(u,{name:e}),this._keepaliveDisposers.push(z(u)),this._sagas.add(e),{node:u,invocations:i,audit:i,cursors:a}}};function fe(o,e){let n=new G(o,e),{factory:t,factoryArgs:r,...s}=e??{};return n.tagFactory("cqrs",re(s)),n}export{pe as a,he as b,ve as c,G as d,fe as e,me as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(t,i,m,u=0){if(!Number.isFinite(t))return u;if(!Number.isFinite(i)||i<=0||!Number.isFinite(m)||m<=0)return Math.max(u,t);let n=t*Math.exp(-m*i);return Math.max(u,n)}export{r as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as f}from"./chunk-7JRF5YEK.js";import{E as d}from"./chunk-LYCLF26R.js";import{b as S}from"./chunk-CK2E7BTU.js";import{b}from"./chunk-QYADASLV.js";var g={};b(g,{create:()=>v});var m=()=>!1;function v(l){let o=new f("zustand"),t=d(void 0,{name:"state",equals:m});o.add(t,{name:"state"});let r=()=>t.cache,n=(e,s)=>{let a=t.cache,i=typeof e=="function"?e(a):e;t.emit(s?i:{...a,...i})},c={getState:r,setState:n,getInitialState:()=>T,subscribe:e=>{let s=!0,a=t.cache;return t.subscribe(i=>{for(let[u,p]of i)if(u===S){if(s){s=!1;continue}e(p,a),a=p}})},destroy:o.destroy.bind(o)},T=l(n,r,c);return t.emit(T),Object.assign(o,c)}export{v as a,g as b};
|