@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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as Node } from './node-BYInONRr.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Backoff strategies for {@link retry} (roadmap §3.1). Delays are in **nanoseconds**.
|
|
@@ -153,8 +153,19 @@ declare function withMaxAttempts(strategy: BackoffStrategy, maxAttempts: number)
|
|
|
153
153
|
*/
|
|
154
154
|
declare function resolveBackoffPreset(name: BackoffPreset): BackoffStrategy;
|
|
155
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Resilience utilities — roadmap §3.1 + §3.1c (retry, breaker, rate limit, status,
|
|
158
|
+
* fallback, cache, timeout, budgetGate).
|
|
159
|
+
*/
|
|
160
|
+
|
|
156
161
|
type RetryOptions = {
|
|
157
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* Max retry attempts after each terminal `ERROR` (not counting the first failure).
|
|
164
|
+
*
|
|
165
|
+
* **Required when `backoff` is set.** Pass `Infinity` to opt in to unbounded retries
|
|
166
|
+
* — the explicit value rules out the silent-infinite-budget footgun (a flaky provider
|
|
167
|
+
* + exponential backoff + omitted `count` would previously default to ~2.1B retries).
|
|
168
|
+
*/
|
|
158
169
|
count?: number;
|
|
159
170
|
/** Delay between attempts; strategies use **nanoseconds**. */
|
|
160
171
|
backoff?: BackoffStrategy | BackoffPreset;
|
|
@@ -177,12 +188,16 @@ type RetryFactoryOptions<T> = RetryOptions & {
|
|
|
177
188
|
* same retry pipeline as inner-node ERROR.
|
|
178
189
|
*
|
|
179
190
|
* @param input - Upstream node or factory that returns a fresh node per attempt.
|
|
180
|
-
* @param opts - `count` caps attempts; `backoff` supplies delay in **nanoseconds** (or a preset name); `initial` seeds the outer node cache (factory mode only).
|
|
191
|
+
* @param opts - `count` caps attempts (**required when `backoff` is set**; pass `Infinity` to opt in to unbounded); `backoff` supplies delay in **nanoseconds** (or a preset name); `initial` seeds the outer node cache (factory mode only).
|
|
181
192
|
* @returns Node that retries on error.
|
|
182
193
|
*
|
|
194
|
+
* @throws {RangeError} when `backoff` is provided without an explicit `count` (unbounded-retry footgun guard) or when `count < 0`.
|
|
195
|
+
*
|
|
183
196
|
* @remarks
|
|
184
197
|
* **Protocol:** Forwards unknown message tuples unchanged; handles `DIRTY`, `DATA`, `RESOLVED`, `COMPLETE`, `ERROR`.
|
|
185
198
|
*
|
|
199
|
+
* **Backoff floor:** every scheduled delay is floored at 1ms via `Math.max(1, delayNs / NS_PER_MS)` even when the strategy returns 0ns. This avoids 0-delay re-entrancy on the active stack frame on a tight ERROR loop. Strategies that return `null`/`undefined` stop retrying immediately and forward the original error.
|
|
200
|
+
*
|
|
186
201
|
* @example
|
|
187
202
|
* ```ts
|
|
188
203
|
* // Source mode — resubscribe the same node:
|
|
@@ -226,7 +241,12 @@ interface CircuitBreakerOptions {
|
|
|
226
241
|
cooldown?: BackoffStrategy;
|
|
227
242
|
/** Max trial requests allowed in half-open state. Default: 1. */
|
|
228
243
|
halfOpenMax?: number;
|
|
229
|
-
/**
|
|
244
|
+
/**
|
|
245
|
+
* Clock function returning **nanoseconds** with `monotonicNs()` semantics
|
|
246
|
+
* (monotonically non-decreasing; suitable for elapsed-time arithmetic — never
|
|
247
|
+
* use `Date.now()` because wall-clock skew can flip elapsed math negative).
|
|
248
|
+
* Default: `monotonicNs` from `core/clock`. Override for deterministic tests.
|
|
249
|
+
*/
|
|
230
250
|
now?: () => number;
|
|
231
251
|
}
|
|
232
252
|
interface CircuitBreaker {
|
|
@@ -236,7 +256,13 @@ interface CircuitBreaker {
|
|
|
236
256
|
recordSuccess(): void;
|
|
237
257
|
/** Record a failed execution. May transition to open. */
|
|
238
258
|
recordFailure(error?: unknown): void;
|
|
239
|
-
/**
|
|
259
|
+
/**
|
|
260
|
+
* Current circuit state (read-only, does not trigger transitions).
|
|
261
|
+
*
|
|
262
|
+
* **Telemetry:** wrap with {@link withBreaker} to surface this as a reactive
|
|
263
|
+
* `Node<CircuitState>` companion (`bundle.breakerState`) — every state
|
|
264
|
+
* transition (`closed`/`open`/`half-open`) emits to subscribers.
|
|
265
|
+
*/
|
|
240
266
|
readonly state: CircuitState;
|
|
241
267
|
/** Number of consecutive failures in the current closed period. */
|
|
242
268
|
readonly failureCount: number;
|
|
@@ -282,6 +308,8 @@ type WithBreakerBundle<T> = {
|
|
|
282
308
|
* @remarks
|
|
283
309
|
* **Success path:** `COMPLETE` calls {@link CircuitBreaker.recordSuccess}. **Failure path:** upstream `ERROR` calls {@link CircuitBreaker.recordFailure} and is forwarded.
|
|
284
310
|
*
|
|
311
|
+
* **State telemetry:** `breakerState: Node<CircuitState>` is a reactive companion that mirrors `breaker.state` — every transition (`closed`/`open`/`half-open`) emits a `DATA`. Also accessible via `node.meta.breakerState` for `describe()` traversal.
|
|
312
|
+
*
|
|
285
313
|
* @example
|
|
286
314
|
* ```ts
|
|
287
315
|
* import { state, withBreaker, circuitBreaker } from "@graphrefly/graphrefly-ts";
|
|
@@ -297,7 +325,14 @@ declare function withBreaker<T>(breaker: CircuitBreaker, options?: {
|
|
|
297
325
|
onOpen?: "skip" | "error";
|
|
298
326
|
}): (source: Node<T>) => WithBreakerBundle<T>;
|
|
299
327
|
interface TokenBucket {
|
|
300
|
-
/**
|
|
328
|
+
/**
|
|
329
|
+
* Number of tokens currently available (after refill).
|
|
330
|
+
*
|
|
331
|
+
* **Float-valued.** When `refillPerSecond` is fractional (or `capacity` × elapsed-fraction
|
|
332
|
+
* yields a non-integer), the bucket accumulates fractional refill credit between
|
|
333
|
+
* `tryConsume`s. Consumers should not assume integer tokens — e.g. with
|
|
334
|
+
* `tokenBucket(10, 2.5)` after 100ms of elapsed time `available()` may report `0.25`.
|
|
335
|
+
*/
|
|
301
336
|
available(): number;
|
|
302
337
|
/** Try to consume `cost` tokens. Returns `true` if successful. */
|
|
303
338
|
tryConsume(cost?: number): boolean;
|
|
@@ -310,33 +345,68 @@ interface TokenBucket {
|
|
|
310
345
|
*/
|
|
311
346
|
putBack(cost?: number): void;
|
|
312
347
|
}
|
|
348
|
+
/** Optional configuration for {@link tokenBucket}. */
|
|
349
|
+
interface TokenBucketOptions {
|
|
350
|
+
/**
|
|
351
|
+
* Clock function returning **nanoseconds** with `monotonicNs()` semantics
|
|
352
|
+
* (monotonically non-decreasing). Default: `monotonicNs` from `core/clock`.
|
|
353
|
+
* Override for deterministic tests — eliminates the need for `vi.useFakeTimers`
|
|
354
|
+
* to drive token-refill scheduling.
|
|
355
|
+
*/
|
|
356
|
+
clock?: () => number;
|
|
357
|
+
}
|
|
313
358
|
/**
|
|
314
359
|
* Token-bucket meter (capacity + refill rate per second). Use with {@link rateLimiter} or custom gates.
|
|
315
360
|
*
|
|
316
361
|
* @param capacity - Maximum tokens (must be positive).
|
|
317
|
-
* @param refillPerSecond - Tokens added per elapsed second (non-negative).
|
|
362
|
+
* @param refillPerSecond - Tokens added per elapsed second (non-negative; may be fractional).
|
|
363
|
+
* @param opts - Optional `clock` override for deterministic testing.
|
|
318
364
|
* @returns {@link TokenBucket} instance.
|
|
319
365
|
*
|
|
366
|
+
* @remarks
|
|
367
|
+
* **Float behavior:** the internal token counter is float-valued — fractional refill
|
|
368
|
+
* accumulates between `tryConsume` calls. See {@link TokenBucket.available} for caveats.
|
|
369
|
+
*
|
|
370
|
+
* **Clock injection:** pass `opts.clock` to drive refill scheduling deterministically
|
|
371
|
+
* in tests. The contract matches {@link circuitBreaker}'s `now` option: must return
|
|
372
|
+
* `monotonicNs()`-style nanoseconds, never `Date.now()` (wall-clock skew breaks
|
|
373
|
+
* elapsed math).
|
|
374
|
+
*
|
|
320
375
|
* @example
|
|
321
376
|
* ```ts
|
|
322
377
|
* import { tokenBucket } from "@graphrefly/graphrefly-ts";
|
|
323
378
|
*
|
|
324
379
|
* const bucket = tokenBucket(10, 2); // capacity 10, refill 2 tokens/sec
|
|
325
380
|
* bucket.tryConsume(3); // true — 7 tokens remaining
|
|
326
|
-
* bucket.available(); // ~7 (plus any elapsed refill)
|
|
381
|
+
* bucket.available(); // ~7 (plus any elapsed refill — float-valued)
|
|
382
|
+
*
|
|
383
|
+
* // Deterministic test:
|
|
384
|
+
* let t = 0;
|
|
385
|
+
* const tb = tokenBucket(5, 1, { clock: () => t });
|
|
386
|
+
* tb.tryConsume(5); // exhausts
|
|
387
|
+
* t = 1_000_000_000; // advance 1s → +1 refill
|
|
388
|
+
* tb.tryConsume(1); // true
|
|
327
389
|
* ```
|
|
328
390
|
*
|
|
329
391
|
* @category extra
|
|
330
392
|
*/
|
|
331
|
-
declare function tokenBucket(capacity: number, refillPerSecond: number): TokenBucket;
|
|
393
|
+
declare function tokenBucket(capacity: number, refillPerSecond: number, opts?: TokenBucketOptions): TokenBucket;
|
|
332
394
|
type RateLimiterOverflowPolicy = "drop-oldest" | "drop-newest" | "error";
|
|
333
395
|
type RateLimiterOptions = {
|
|
334
396
|
/** Maximum `DATA` emissions per window (must be > 0). */
|
|
335
397
|
maxEvents: number;
|
|
336
398
|
/** Window length in nanoseconds (must be > 0). */
|
|
337
399
|
windowNs: number;
|
|
338
|
-
/**
|
|
339
|
-
|
|
400
|
+
/**
|
|
401
|
+
* Cap on items queued while waiting for token refill.
|
|
402
|
+
*
|
|
403
|
+
* **Required.** Pass a finite positive integer (>= 1) for a bounded queue, OR
|
|
404
|
+
* the literal `Infinity` to opt in to an unbounded queue (caller acknowledges
|
|
405
|
+
* the unbounded-memory-growth risk on a high-rate source). Omitting this
|
|
406
|
+
* throws at construction time — the silent-unbounded-buffer footgun is the
|
|
407
|
+
* most common rateLimiter mis-configuration.
|
|
408
|
+
*/
|
|
409
|
+
maxBuffer: number;
|
|
340
410
|
/** Overflow policy when `maxBuffer` is exceeded. Default: `"drop-newest"`. */
|
|
341
411
|
onOverflow?: RateLimiterOverflowPolicy;
|
|
342
412
|
};
|
|
@@ -349,19 +419,42 @@ declare class RateLimiterOverflowError extends Error {
|
|
|
349
419
|
name: string;
|
|
350
420
|
constructor(maxBuffer: number);
|
|
351
421
|
}
|
|
422
|
+
/** Bundle returned by {@link rateLimiter}. */
|
|
423
|
+
type RateLimiterBundle<T> = {
|
|
424
|
+
/** The throttled stream — at most `maxEvents` `DATA` per `windowNs`. */
|
|
425
|
+
node: Node<T>;
|
|
426
|
+
/**
|
|
427
|
+
* Reactive companion: count of `DATA` items dropped since subscription start.
|
|
428
|
+
*
|
|
429
|
+
* - Increments on every drop under any overflow policy (`drop-newest`,
|
|
430
|
+
* `drop-oldest`). The `error` policy terminates the stream after a single
|
|
431
|
+
* overflow, so `droppedCount` increments at most once in that path.
|
|
432
|
+
* - Resets to `0` on terminal (`COMPLETE` / `ERROR` / `TEARDOWN`) — i.e. the
|
|
433
|
+
* counter scopes to the active subscription cycle.
|
|
434
|
+
* - Producer-pattern note: this companion is invisible to `describe()`
|
|
435
|
+
* traversal from `node` (effect-mirror limitation; same shape as
|
|
436
|
+
* `withBreaker.breakerState` and `withStatus.status`). Surface it via
|
|
437
|
+
* `node.meta.droppedCount` if you need it in topology snapshots.
|
|
438
|
+
*/
|
|
439
|
+
droppedCount: Node<number>;
|
|
440
|
+
};
|
|
352
441
|
/**
|
|
353
442
|
* Token-bucket rate limiter: at most `maxEvents` `DATA` values per `windowNs`.
|
|
354
443
|
*
|
|
355
444
|
* Uses {@link tokenBucket} internally (capacity = `maxEvents`, refill = `maxEvents / windowSeconds`).
|
|
356
|
-
* Excess items are queued FIFO
|
|
357
|
-
*
|
|
445
|
+
* Excess items are queued FIFO (in a fixed-capacity {@link RingBuffer} for O(1) push/shift)
|
|
446
|
+
* until a token is available. The queue is bounded by the **required** `maxBuffer` option
|
|
447
|
+
* with a configurable overflow policy.
|
|
358
448
|
*
|
|
359
449
|
* @param source - Upstream node.
|
|
360
|
-
* @param opts - Rate +
|
|
361
|
-
* @returns
|
|
450
|
+
* @param opts - Rate + bounded-buffer configuration. `maxBuffer` is required (use `Infinity` to opt in to unbounded).
|
|
451
|
+
* @returns `{ node, droppedCount }` bundle. Subscribe to `node` for the throttled stream and to `droppedCount` for backpressure pressure.
|
|
452
|
+
*
|
|
453
|
+
* @throws {RangeError} when `maxEvents` / `windowNs` is non-positive, when `maxBuffer` is omitted, or when `maxBuffer` is a finite value < 1.
|
|
362
454
|
*
|
|
363
455
|
* @remarks
|
|
364
|
-
* **Terminal:** `COMPLETE` / `ERROR` cancel the refill timer, drop the pending queue,
|
|
456
|
+
* **Terminal:** `COMPLETE` / `ERROR` cancel the refill timer, drop the pending queue,
|
|
457
|
+
* reset `droppedCount` to `0`, and propagate.
|
|
365
458
|
*
|
|
366
459
|
* @example
|
|
367
460
|
* ```ts
|
|
@@ -369,13 +462,18 @@ declare class RateLimiterOverflowError extends Error {
|
|
|
369
462
|
*
|
|
370
463
|
* const src = state(0);
|
|
371
464
|
* // Allow at most 5 DATA values per second; queue up to 100 excess items, drop newest beyond.
|
|
372
|
-
* const limited = rateLimiter(src, {
|
|
465
|
+
* const { node: limited, droppedCount } = rateLimiter(src, {
|
|
466
|
+
* maxEvents: 5,
|
|
467
|
+
* windowNs: NS_PER_SEC,
|
|
468
|
+
* maxBuffer: 100,
|
|
469
|
+
* });
|
|
470
|
+
* droppedCount.subscribe(([m]) => console.log("dropped so far:", m[1]));
|
|
373
471
|
* ```
|
|
374
472
|
*
|
|
375
473
|
* @category extra
|
|
376
474
|
*/
|
|
377
|
-
declare function rateLimiter<T>(source: Node<T>, opts: RateLimiterOptions):
|
|
378
|
-
type StatusValue = "pending" | "
|
|
475
|
+
declare function rateLimiter<T>(source: Node<T>, opts: RateLimiterOptions): RateLimiterBundle<T>;
|
|
476
|
+
type StatusValue = "pending" | "running" | "completed" | "errored";
|
|
379
477
|
type WithStatusBundle<T> = {
|
|
380
478
|
node: Node<T>;
|
|
381
479
|
status: Node<StatusValue>;
|
|
@@ -386,10 +484,25 @@ type WithStatusBundle<T> = {
|
|
|
386
484
|
*
|
|
387
485
|
* @param src - Upstream node to mirror.
|
|
388
486
|
* @param options - `initialStatus` defaults to `"pending"`.
|
|
389
|
-
* @returns `{ node, status, error }` where `
|
|
487
|
+
* @returns `{ node, status, error }` where `out` is the mirrored stream, `status` is a
|
|
488
|
+
* reactive `Node<StatusValue>` (`"pending" | "running" | "completed" | "errored"`),
|
|
489
|
+
* and `error` holds the last `ERROR` payload (cleared to `null` on the next `DATA`
|
|
490
|
+
* after `errored`).
|
|
390
491
|
*
|
|
391
492
|
* @remarks
|
|
392
|
-
* **
|
|
493
|
+
* **Lifecycle:** `pending` (no DATA yet) → `running` (on first DATA) → `completed`
|
|
494
|
+
* (on COMPLETE) or `errored` (on ERROR). After `errored`, the next `DATA` clears
|
|
495
|
+
* `error` and re-enters `running` inside a {@link batch} so subscribers see one
|
|
496
|
+
* consistent transition (matches graphrefly-py).
|
|
497
|
+
*
|
|
498
|
+
* **Producer-pattern visibility:** `out` is built via `node([], fn, …)`, so `src`
|
|
499
|
+
* appears as the source dependency in `describe()` traversal but the `status` /
|
|
500
|
+
* `error` companions are mirrored via subscribe-callback effects — they appear
|
|
501
|
+
* under `out.meta.status` / `out.meta.error` (and as `<name>::__meta__::status`
|
|
502
|
+
* paths in `describe()`) rather than as separate top-level edges. Subscribers
|
|
503
|
+
* to `out` see the throttled DATA stream; `status` / `error` companions may not
|
|
504
|
+
* appear as edges in `describe()` if no consumer subscribes to them (per
|
|
505
|
+
* COMPOSITION-GUIDE §1, push-on-subscribe semantics).
|
|
393
506
|
*
|
|
394
507
|
* @example
|
|
395
508
|
* ```ts
|
|
@@ -399,7 +512,7 @@ type WithStatusBundle<T> = {
|
|
|
399
512
|
* const { node, status, error } = withStatus(src);
|
|
400
513
|
*
|
|
401
514
|
* status.subscribe((msgs) => console.log("status:", msgs));
|
|
402
|
-
* src.down([[DATA, 42]]); // status → "
|
|
515
|
+
* src.down([[DATA, 42]]); // status → "running"
|
|
403
516
|
* ```
|
|
404
517
|
*
|
|
405
518
|
* @category extra
|
|
@@ -457,9 +570,14 @@ declare function fallback<T>(source: Node<T>, fb: FallbackInput<T>): Node<T>;
|
|
|
457
570
|
* the timer. Terminal messages (`COMPLETE`/`ERROR`) cancel the timer.
|
|
458
571
|
*
|
|
459
572
|
* @param source - Upstream node.
|
|
460
|
-
* @param timeoutNs - Deadline in nanoseconds.
|
|
573
|
+
* @param timeoutNs - Deadline in **nanoseconds** (must be > 0). Internally converted to milliseconds for `setTimeout` scheduling.
|
|
461
574
|
* @returns Node that errors on timeout.
|
|
462
575
|
*
|
|
576
|
+
* @throws {RangeError} when `timeoutNs <= 0`.
|
|
577
|
+
*
|
|
578
|
+
* @remarks
|
|
579
|
+
* **Scheduling:** internally uses {@link ResettableTimer} (raw `setTimeout`) per spec §5.10's resilience-operator carve-out. The deadline is `timeoutNs / NS_PER_MS` ms; sub-millisecond `timeoutNs` values get the same minimum-1ms host-scheduler granularity that `setTimeout` provides.
|
|
580
|
+
*
|
|
463
581
|
* @example
|
|
464
582
|
* ```ts
|
|
465
583
|
* import { timeout, never, NS_PER_SEC } from "@graphrefly/graphrefly-ts";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as MeasurementAdapter, P as PreparedSegment, L as LineBreaksResult, C as CharPosition, a as LayoutCursor, I as Interval, b as LayoutLine, c as LayoutNextLineContext, d as LayoutNextLineResult, R as ReactiveLayoutBundle, e as ReactiveLayoutOptions, S as SegmentBreakKind, f as SegmentMeasureStats, g as analyzeAndMeasure, h as carveTextLineSlots, i as computeCharPositions, j as computeLineBreaks, l as layoutNextLine, r as reactiveLayout } from './reactive-layout-
|
|
2
|
-
import {
|
|
3
|
-
import { G as Graph } from './graph-
|
|
1
|
+
import { M as MeasurementAdapter, P as PreparedSegment, L as LineBreaksResult, C as CharPosition, a as LayoutCursor, I as Interval, b as LayoutLine, c as LayoutNextLineContext, d as LayoutNextLineResult, R as ReactiveLayoutBundle, e as ReactiveLayoutOptions, S as SegmentBreakKind, f as SegmentMeasureStats, g as analyzeAndMeasure, h as carveTextLineSlots, i as computeCharPositions, j as computeLineBreaks, l as layoutNextLine, r as reactiveLayout } from './reactive-layout-8CSc0tiA.cjs';
|
|
2
|
+
import { N as Node } from './node-BYInONRr.cjs';
|
|
3
|
+
import { G as Graph } from './graph-BUwMAxJI.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* MeasurementAdapter implementations (roadmap §7.1 — pluggable backends).
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { b as NodeGuard, N as Node } from './node-BYInONRr.cjs';
|
|
2
|
+
import { G as Graph } from './graph-BUwMAxJI.cjs';
|
|
3
|
+
import { R as ReactiveLogOptions, a as ReactiveLogBundle } from './reactive-log-_zeEnB9H.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Audited-mutation framework (Audit 2 — locked 2026-04-24; promoted to
|
|
7
|
+
* `extra/mutation/` per consolidation plan §1, Tier 2.2).
|
|
8
|
+
*
|
|
9
|
+
* Phase-4 primitives share the same shape: imperative mutation methods +
|
|
10
|
+
* closure state + reactive audit log + freeze-at-entry + rollback-on-throw.
|
|
11
|
+
* This module factors out the common machinery so each primitive becomes
|
|
12
|
+
* declarative wiring over typed audit records:
|
|
13
|
+
* - `approvalGate`, `pipeline.approvalGate` (Wave A.2 Unit 8)
|
|
14
|
+
* - `JobQueueGraph` (Wave B.3 Unit 15)
|
|
15
|
+
* - `CqrsGraph.dispatch` (Wave C.2 Unit 20)
|
|
16
|
+
* - `CqrsGraph.saga` (Wave C.3 Unit 22)
|
|
17
|
+
* - `processManager` (Wave 7)
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Bounded increment for a self-owned counter state node.
|
|
22
|
+
*
|
|
23
|
+
* Reads `counter.cache`, bumps by 1 if under `cap`, writes back. Returns
|
|
24
|
+
* `false` when the cap is reached. Documented P3 exception: the counter is
|
|
25
|
+
* not a declared dep of the caller — it's a private budget read+written from
|
|
26
|
+
* a single call site. This helper keeps the `.cache` access in one named
|
|
27
|
+
* place.
|
|
28
|
+
*
|
|
29
|
+
* **Safety today:**
|
|
30
|
+
* 1. Single-threaded JS runner never invokes the caller concurrently.
|
|
31
|
+
* 2. `counter.down` writes the cache synchronously before returning, so
|
|
32
|
+
* synchronous re-entry through a downstream publish reads the
|
|
33
|
+
* freshly-incremented value — no double-count.
|
|
34
|
+
*
|
|
35
|
+
* **Future risk:** under a free-threaded runner (PY no-GIL or hypothetical
|
|
36
|
+
* concurrent TS runner), two concurrent firings could still race. Revisit
|
|
37
|
+
* when that surfaces.
|
|
38
|
+
*/
|
|
39
|
+
declare function tryIncrementBounded(counter: Node<number>, cap: number): boolean;
|
|
40
|
+
/** Shared base shape for every audit record. Per-primitive types extend this. */
|
|
41
|
+
interface BaseAuditRecord {
|
|
42
|
+
readonly t_ns: number;
|
|
43
|
+
readonly seq?: number;
|
|
44
|
+
readonly handlerVersion?: {
|
|
45
|
+
id: string;
|
|
46
|
+
version: string | number;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Allow `observe` and `signal`; deny external `write` on the audit log so
|
|
51
|
+
* consumers can subscribe + signal-bridge but cannot inject fake records.
|
|
52
|
+
*/
|
|
53
|
+
declare const DEFAULT_AUDIT_GUARD: NodeGuard;
|
|
54
|
+
type AuditLogOpts<R extends BaseAuditRecord> = {
|
|
55
|
+
name: string;
|
|
56
|
+
/** Bounded retention; default 1024 per Audit 2 / cross-cutting bounded-default policy. */
|
|
57
|
+
retainedLimit?: number;
|
|
58
|
+
/** Override the default audit guard. */
|
|
59
|
+
guard?: NodeGuard;
|
|
60
|
+
/** Mount the audit `entries` Node under this graph (and activate withLatest). */
|
|
61
|
+
graph?: Graph;
|
|
62
|
+
/** Pass-through to {@link reactiveLog}. */
|
|
63
|
+
versioning?: ReactiveLogOptions<R>["versioning"];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Build a reactive audit log with sane defaults: bounded retention, deny-write
|
|
67
|
+
* guard, `withLatest()` companions activated. Returns the {@link ReactiveLogBundle}
|
|
68
|
+
* directly — primitives expose this as `<primitive>.events` / `.decisions` /
|
|
69
|
+
* `.dispatches` / `.invocations` and alias it as `.audit`.
|
|
70
|
+
*
|
|
71
|
+
* @category internal
|
|
72
|
+
*/
|
|
73
|
+
declare function createAuditLog<R extends BaseAuditRecord>(opts: AuditLogOpts<R>): ReactiveLogBundle<R>;
|
|
74
|
+
type FailureMeta = {
|
|
75
|
+
t_ns: number;
|
|
76
|
+
seq?: number;
|
|
77
|
+
errorType: string;
|
|
78
|
+
};
|
|
79
|
+
type SuccessMeta = {
|
|
80
|
+
t_ns: number;
|
|
81
|
+
seq?: number;
|
|
82
|
+
};
|
|
83
|
+
/** Common opts shared by both tiers. */
|
|
84
|
+
type MutationOpts<TArgs extends readonly unknown[], R extends BaseAuditRecord> = {
|
|
85
|
+
/** Where to emit the audit record on success / failure. */
|
|
86
|
+
audit: ReactiveLogBundle<R>;
|
|
87
|
+
/** Build the success record from the action's args + result + meta. */
|
|
88
|
+
onSuccess?: (args: TArgs, result: unknown, meta: SuccessMeta) => R | undefined;
|
|
89
|
+
/** Build the failure record from the args + error + meta. */
|
|
90
|
+
onFailure?: (args: TArgs, error: unknown, meta: FailureMeta) => R | undefined;
|
|
91
|
+
/** Freeze inputs at entry (default `true`). Pass `false` for hot paths. */
|
|
92
|
+
freeze?: boolean;
|
|
93
|
+
/** Optional sequence cursor — auto-advanced and stamped onto records. */
|
|
94
|
+
seq?: Node<number>;
|
|
95
|
+
/** Optional handler version — stamped into the record (Audit 5). */
|
|
96
|
+
handlerVersion?: {
|
|
97
|
+
id: string;
|
|
98
|
+
version: string | number;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
type WrapMutationOpts<TArgs extends readonly unknown[], R extends BaseAuditRecord> = MutationOpts<TArgs, R>;
|
|
102
|
+
type LightMutationOpts<TArgs extends readonly unknown[], R extends BaseAuditRecord> = MutationOpts<TArgs, R>;
|
|
103
|
+
/**
|
|
104
|
+
* Advance a cursor node and return the new value. Emits `[DIRTY], [DATA, next]`
|
|
105
|
+
* directly on the cursor — atomic outside a batch, rollback-discardable inside.
|
|
106
|
+
*
|
|
107
|
+
* Resets to `0` if the cursor cache is missing, non-numeric, `NaN`, or
|
|
108
|
+
* non-finite (e.g. corrupted by `restore()` from a malformed snapshot, or
|
|
109
|
+
* by a misbehaving codec). `??` alone would let `NaN` and `""` pass through
|
|
110
|
+
* and silently corrupt audit ordering downstream.
|
|
111
|
+
*
|
|
112
|
+
* Works whether or not the cursor has any subscribers — `down` updates the
|
|
113
|
+
* cache regardless, so primitives that bump before consumers attach (e.g.
|
|
114
|
+
* `JobQueueGraph.enqueue`) still see a coherent sequence.
|
|
115
|
+
*
|
|
116
|
+
* @category internal
|
|
117
|
+
*/
|
|
118
|
+
declare function bumpCursor(seq: Node<number>): number;
|
|
119
|
+
/**
|
|
120
|
+
* Build a record via the supplied builder, stamp `handlerVersion` if present,
|
|
121
|
+
* and append it to the audit log. `undefined` records are skipped (callers
|
|
122
|
+
* pass an `onSuccess` / `onFailure` that returns `undefined` to opt out per
|
|
123
|
+
* call).
|
|
124
|
+
*
|
|
125
|
+
* @category internal
|
|
126
|
+
*/
|
|
127
|
+
declare function appendAudit<TArgs extends readonly unknown[], TValue, R extends BaseAuditRecord, M extends SuccessMeta | FailureMeta>(audit: ReactiveLogBundle<R>, builder: (args: TArgs, value: TValue, meta: M) => R | undefined, args: TArgs, value: TValue, meta: M, handlerVersion?: {
|
|
128
|
+
id: string;
|
|
129
|
+
version: string | number;
|
|
130
|
+
}): void;
|
|
131
|
+
/**
|
|
132
|
+
* Substrate-tier wrapper: run `action`, append a typed audit record on
|
|
133
|
+
* success or failure, advance an optional `seq` cursor. No batch frame — this
|
|
134
|
+
* is the hot-path-friendly variant for atomic single-write mutations.
|
|
135
|
+
*
|
|
136
|
+
* Behavior contract:
|
|
137
|
+
* 1. Freeze args at entry (default `true`; opt out with `freeze: false` for
|
|
138
|
+
* hot paths — e.g. wrapping `vectorIndex.upsert(id, vector[768], meta)`
|
|
139
|
+
* where the deep-freeze of a 768-dim vector is a measurable tax).
|
|
140
|
+
* 2. Bump `seq` (if provided) BEFORE the action runs. There is no batch frame,
|
|
141
|
+
* so the bump persists even on throw — the failure-audit record stamps the
|
|
142
|
+
* same `seq` so audit consumers see a contiguous sequence.
|
|
143
|
+
* 3. Run `action(args)`. On success, `appendAudit(onSuccess, ...)`.
|
|
144
|
+
* 4. On throw, `appendAudit(onFailure, ...)` then re-throw so callers see the
|
|
145
|
+
* failure.
|
|
146
|
+
*
|
|
147
|
+
* **Distinguish from {@link wrapMutation}:** `wrapMutation` opens a `batch()`
|
|
148
|
+
* frame (rollback-on-throw, seq advance discarded on rollback) and is the
|
|
149
|
+
* right choice when the action runs a user-supplied handler or a multi-step
|
|
150
|
+
* sequence that could leave inconsistent state mid-throw.
|
|
151
|
+
*
|
|
152
|
+
* **Cursor / log alignment caveat (substrate-tier):** `seq` is bumped BEFORE
|
|
153
|
+
* `action()` runs, and the audit-log append happens AFTER. There is no batch
|
|
154
|
+
* frame, so a synchronous subscriber to `seq` that fires between the two —
|
|
155
|
+
* including a subscriber on `audit.entries` itself if the substrate causes
|
|
156
|
+
* it to fire transitively — observes `seq=N` while the corresponding record
|
|
157
|
+
* is not yet in the log. Audit consumers that join `seq` and `audit.entries`
|
|
158
|
+
* reactively must tolerate this one-tick lag, or use {@link wrapMutation}
|
|
159
|
+
* (whose `batch()` frame defers downstream delivery until commit, so cursor
|
|
160
|
+
* and log appear together to subscribers). The same caveat applies to
|
|
161
|
+
* **re-entrant** invocation: if an `audit.entries` / `seq` subscriber
|
|
162
|
+
* triggers another `lightMutation`, the inner record can land on the log
|
|
163
|
+
* before the outer call's success/failure record.
|
|
164
|
+
*
|
|
165
|
+
* @category internal
|
|
166
|
+
*/
|
|
167
|
+
declare function lightMutation<TArgs extends readonly unknown[], TResult, R extends BaseAuditRecord>(action: (...args: TArgs) => TResult, opts: LightMutationOpts<TArgs, R>): (...args: TArgs) => TResult;
|
|
168
|
+
/**
|
|
169
|
+
* Orchestration-tier wrapper: like {@link lightMutation} but adds a `batch()`
|
|
170
|
+
* frame around the action so an in-flight throw rolls back partial state.
|
|
171
|
+
*
|
|
172
|
+
* Behavior contract:
|
|
173
|
+
* 1. Freeze args at entry (default `true`).
|
|
174
|
+
* 2. Open a batch frame (rollback-on-throw via core batch — Audit 2 #6).
|
|
175
|
+
* 3. Bump `seq` INSIDE the batch so a framework-level rollback discards the
|
|
176
|
+
* cursor advance (cursor stays in sync with audit log). M5.
|
|
177
|
+
* 4. Run `action(args)` and capture result.
|
|
178
|
+
* 5. On success: `appendAudit(onSuccess, ...)` inside the batch.
|
|
179
|
+
* 6. On throw: catch OUTSIDE the batch so the failure record emits in a
|
|
180
|
+
* fresh transaction after rollback — it persists. Re-throw so callers see
|
|
181
|
+
* the failure.
|
|
182
|
+
*
|
|
183
|
+
* **Distinguish from the file-private `wrapMutation` in
|
|
184
|
+
* `src/extra/reactive-map.ts:540`:** that helper is a transactional wrapper
|
|
185
|
+
* for the reactiveMap version counter (`pre/post-version` snapshot diffing,
|
|
186
|
+
* read vs. mutation gating). Different concern, file-private, not exported.
|
|
187
|
+
* This `wrapMutation` is the public Phase-4 audit framework.
|
|
188
|
+
*
|
|
189
|
+
* @category internal
|
|
190
|
+
*/
|
|
191
|
+
declare function wrapMutation<TArgs extends readonly unknown[], TResult, R extends BaseAuditRecord>(action: (...args: TArgs) => TResult, opts: WrapMutationOpts<TArgs, R>): (...args: TArgs) => TResult;
|
|
192
|
+
/**
|
|
193
|
+
* Promote a closure counter to a state node mounted under `graph`.
|
|
194
|
+
* Replaces ad-hoc `let _seq = 0` patterns with a node observable in
|
|
195
|
+
* `describe()` and persistable via storage tiers.
|
|
196
|
+
*
|
|
197
|
+
* @category internal
|
|
198
|
+
*/
|
|
199
|
+
declare function registerCursor(graph: Graph, name: string, initial?: number): Node<number>;
|
|
200
|
+
/**
|
|
201
|
+
* Promote a closure `Map<K, number>` to N state nodes (one per key) mounted
|
|
202
|
+
* under `<graph>::<name>::<key>`. Used by saga (per-event-type cursor).
|
|
203
|
+
*
|
|
204
|
+
* @category internal
|
|
205
|
+
*/
|
|
206
|
+
declare function registerCursorMap<K extends string>(graph: Graph, name: string, keys: readonly K[], initial?: number): {
|
|
207
|
+
readonly [P in K]: Node<number>;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export { type AuditLogOpts as A, type BaseAuditRecord as B, DEFAULT_AUDIT_GUARD as D, type FailureMeta as F, type LightMutationOpts as L, type MutationOpts as M, type SuccessMeta as S, type WrapMutationOpts as W, appendAudit as a, bumpCursor as b, createAuditLog as c, registerCursorMap as d, lightMutation as l, registerCursor as r, tryIncrementBounded as t, wrapMutation as w };
|