@graphrefly/graphrefly 0.41.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cascading-Cxs1eztH.d.cts → cascading-CH-_VwG9.d.cts} +2 -2
- package/dist/{cascading-BNfxffgc.d.ts → cascading-OgKQZjsa.d.ts} +2 -2
- package/dist/{chunk-L77I47VU.js → chunk-2K5RXLAH.js} +1 -1
- package/dist/chunk-3ERTUW2J.js +45 -0
- package/dist/chunk-3K7HA4Y6.js +1 -0
- package/dist/chunk-3ZZX7M25.js +1 -0
- package/dist/chunk-4QH6VJF4.js +1 -0
- package/dist/{chunk-M3FQSXEW.js → chunk-5QRRKBUT.js} +1 -1
- package/dist/chunk-5ST42ESJ.js +1 -0
- package/dist/{chunk-AK5RHMC5.js → chunk-6YFZMUMR.js} +1 -1
- package/dist/{chunk-SC27WTSG.js → chunk-7ARY3Y3T.js} +1 -1
- package/dist/chunk-7B7ELAT2.js +1 -0
- package/dist/{chunk-F7VUYPP6.js → chunk-7VKFXLZQ.js} +1 -1
- package/dist/chunk-ACMJ2ZPS.js +3 -0
- package/dist/{chunk-7PQLZMOG.js → chunk-AGNM6RS6.js} +1 -1
- package/dist/chunk-AS3TV2TV.js +1 -0
- package/dist/{chunk-CGNOWGV6.js → chunk-CISGGAIF.js} +1 -1
- package/dist/{chunk-ZAJ7J7TO.js → chunk-DEJTNNQC.js} +1 -1
- package/dist/{chunk-AI7QC7J6.js → chunk-FDZAZNRO.js} +1 -1
- package/dist/{chunk-OV5AA6HJ.js → chunk-FUZ6S2DY.js} +1 -1
- package/dist/{chunk-G3M3IMEV.js → chunk-G5VBJ5K6.js} +1 -1
- package/dist/{chunk-KNVCCBIU.js → chunk-HZKW2AAB.js} +1 -1
- package/dist/{chunk-CYOSWFT2.js → chunk-IZM3UEH3.js} +3 -3
- package/dist/{chunk-UISPDFJ3.js → chunk-KCACBSJH.js} +1 -1
- package/dist/{chunk-GI4Q7PNY.js → chunk-KT5DTRBP.js} +1 -1
- package/dist/{chunk-33N4TU3X.js → chunk-KY2LMAXU.js} +1 -1
- package/dist/{chunk-TT4C7DXW.js → chunk-LDQ3IUIP.js} +1 -1
- package/dist/chunk-LPRWATHB.js +61 -0
- package/dist/{chunk-X7QKTXXC.js → chunk-NWXQIOIB.js} +3 -3
- package/dist/{chunk-VV62MIG4.js → chunk-Q7QQQA3I.js} +1 -1
- package/dist/chunk-VE5SIZEM.js +1 -0
- package/dist/chunk-VRALOYRD.js +1 -0
- package/dist/{chunk-5VEZLQFN.js → chunk-WHMUB5QB.js} +1 -1
- package/dist/chunk-XLQPNNIC.js +1 -0
- package/dist/{chunk-YQRN4CIV.js → chunk-YGL7FPVQ.js} +1 -1
- package/dist/compat/index.cjs +5 -5
- 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 +5 -5
- 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 -3
- 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/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/{decay-C25AyNAj.d.cts → decay-2ZukgQ4o.d.cts} +2 -2
- package/dist/{decay-BnrlbxSv.d.ts → decay-CdEBmDIs.d.ts} +2 -2
- package/dist/extra/browser.d.cts +1 -1
- package/dist/extra/browser.d.ts +1 -1
- package/dist/extra/index.cjs +14 -14
- package/dist/extra/index.d.cts +10 -11
- package/dist/extra/index.d.ts +10 -11
- 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.d.cts +3 -3
- package/dist/extra/reactive.d.ts +3 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/render/index.d.cts +3 -3
- package/dist/extra/render/index.d.ts +3 -3
- package/dist/extra/sources.cjs +3 -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-CMZl39L5.d.ts → fallback-CqYVLL6X.d.ts} +1 -1
- package/dist/{fallback-8JYU8tlT.d.cts → fallback-Ctlj2tMY.d.cts} +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-BkIkog4h.d.ts → graph-7VguS7a4.d.ts} +3 -3
- package/dist/{graph-E6likq7w.d.cts → graph-C4SHb3Ly.d.cts} +3 -3
- package/dist/{index-DktLSZOc.d.cts → index-2B7u2pVn.d.cts} +4 -4
- package/dist/{index-DGD4_fj6.d.cts → index-3NmAfcH0.d.cts} +8 -5
- package/dist/{index-DfOK_oL5.d.ts → index-4Uz-e_fL.d.ts} +372 -17
- package/dist/{index-BAQrjuZF.d.ts → index-B-i4_g3k.d.ts} +2 -2
- package/dist/{index-DpiGqtrs.d.cts → index-B11anra4.d.cts} +441 -381
- package/dist/{index-WSlcjhQF.d.ts → index-B3OTH1dV.d.ts} +124 -13
- package/dist/{index-2n8Eai6M.d.ts → index-BG0BN3PB.d.ts} +1 -1
- package/dist/{index-z8WFPVI8.d.cts → index-BJX94aud.d.cts} +1 -1
- package/dist/{index-DhLyOHYZ.d.ts → index-BP8a88zx.d.ts} +11 -4
- package/dist/{index-Cnr1WrlX.d.cts → index-BTQtTb_H.d.cts} +14 -3
- package/dist/{index-BaA-xpSw.d.ts → index-BUYXac2c.d.ts} +3 -3
- package/dist/{index-DOBLxOti.d.cts → index-BVpm6noz.d.cts} +1 -1
- package/dist/{index-DhnsQfa3.d.ts → index-Bbkgpt5t.d.ts} +441 -381
- package/dist/{index-Cczxgd2D.d.ts → index-Bc41FuHp.d.cts} +3 -3
- package/dist/{index-BiHUBEKq.d.cts → index-BdGtBX-X.d.cts} +3 -3
- package/dist/index-BeT2r7sk.d.ts +760 -0
- package/dist/{index-da2V5vPy.d.ts → index-Bf7eqeSF.d.ts} +2 -2
- package/dist/{index-bXXLSvor.d.ts → index-Bn4zHYLj.d.ts} +4 -4
- package/dist/{index-DGTo1yka.d.cts → index-BoLv_OfD.d.cts} +2 -2
- package/dist/{index-B72TQQHd.d.cts → index-BsT7F2et.d.ts} +3 -3
- package/dist/{index-Bd91Nmf4.d.cts → index-BtAsBp8K.d.cts} +4 -4
- package/dist/{index-DgJc8Zgc.d.cts → index-C0-Jv1kP.d.cts} +81 -5
- package/dist/{index-C6ZUaos7.d.ts → index-C7O6r5fV.d.ts} +1 -1
- package/dist/{index-CL7oilfm.d.cts → index-C9kSENB4.d.cts} +1 -1
- package/dist/{index-yLt-aPMp.d.ts → index-CCq87F7t.d.ts} +1 -1
- package/dist/{index-DQQCOIt8.d.cts → index-CEMx8n40.d.cts} +10 -5
- package/dist/{index-BilOa6AE.d.cts → index-CJIuLu2f.d.cts} +124 -13
- package/dist/{index-B2RUoIUz.d.ts → index-CJK1JkYy.d.ts} +1 -1
- package/dist/{index-CG33HeBW.d.ts → index-CJQm0g38.d.ts} +8 -5
- package/dist/index-CPNSy-U0.d.cts +760 -0
- package/dist/{index-A3U3CSve.d.cts → index-CZjOhcBy.d.cts} +2 -2
- package/dist/{index-CAP3UGsq.d.ts → index-CZmcDtFn.d.ts} +1 -1
- package/dist/{index-DYTBbF8T.d.cts → index-ChOyVLKm.d.cts} +1 -1
- package/dist/{index-eaQuGJnv.d.ts → index-CpyNFqkB.d.ts} +3 -3
- package/dist/{index-BJSZxSFX.d.ts → index-CvrqGfNS.d.ts} +1 -1
- package/dist/{index-DuRsN9ae.d.cts → index-D-Xs74HZ.d.cts} +372 -17
- package/dist/{index-C5cQ7Gfx.d.ts → index-D6egPFAL.d.ts} +4 -4
- package/dist/{index-CD2dBMet.d.ts → index-D8l8hNXn.d.ts} +10 -5
- package/dist/{index-40ZT4MHj.d.ts → index-DBHK8O6H.d.ts} +14 -3
- package/dist/{index-DVDapw2k.d.cts → index-DBIqYS43.d.cts} +35 -21
- package/dist/{index-3k4Gg6-n.d.ts → index-DBevwHj_.d.ts} +3 -3
- package/dist/{index-Ctb7_2sG.d.ts → index-DIOoAZUX.d.ts} +1 -1
- package/dist/{index-BQ1fR4li.d.ts → index-DO9XxMzS.d.ts} +35 -21
- package/dist/{index-CQtWm7jS.d.ts → index-DQo8xBgd.d.ts} +9 -9
- package/dist/{index-DH4fm2Ck.d.ts → index-Dgs8zcj7.d.ts} +2 -2
- package/dist/{index-CtFNGe-m.d.cts → index-Dhc7a7Xo.d.cts} +2 -2
- package/dist/{index-MxYuWOrf.d.cts → index-DmAgG5CI.d.cts} +3 -3
- package/dist/{index-CoM4rzyB.d.ts → index-Dmqp7KjD.d.ts} +1 -1
- package/dist/{index-B6iTqKtJ.d.ts → index-Dn-wI9g4.d.ts} +2 -2
- package/dist/{index-C-dkXOpB.d.cts → index-Du7u1lSf.d.cts} +11 -4
- package/dist/{index-DVAlsmEU.d.cts → index-HoU88d5U.d.cts} +3 -3
- package/dist/{index-CRm0YIzC.d.cts → index-LIpQQE9f.d.cts} +9 -9
- package/dist/{index-CgnCFhr2.d.cts → index-f5IivDUX.d.cts} +1 -1
- package/dist/{index-PgwvGWa1.d.cts → index-hHcaFlJX.d.cts} +1 -1
- package/dist/{index-I1cCY3ZI.d.ts → index-pT8sCpOJ.d.ts} +81 -5
- package/dist/{index-D4uimgee.d.cts → index-sl4NyzQx.d.cts} +1 -1
- package/dist/{index-tV3AA9hI.d.cts → index-tJoTcnHh.d.cts} +2 -2
- package/dist/{index-D3ayz3hy.d.cts → index-z96luz5O.d.cts} +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.d.cts +45 -50
- package/dist/index.d.ts +45 -50
- package/dist/index.js +1 -1
- package/dist/{meta-D8OyedKp.d.ts → meta-BgVAsg9j.d.ts} +1 -1
- package/dist/{meta-Ct9nqQS5.d.cts → meta-vE8bxW1E.d.cts} +1 -1
- package/dist/{node-BYInONRr.d.cts → node-ClS5yC-B.d.cts} +1 -1
- package/dist/{node-BYInONRr.d.ts → node-ClS5yC-B.d.ts} +1 -1
- package/dist/{observable-DO8DDEzv.d.ts → observable-BsBzUrcI.d.ts} +1 -1
- package/dist/{observable-DMIlYJV1.d.cts → observable-DLGPPtb8.d.cts} +1 -1
- package/dist/patterns/ai/browser.d.cts +4 -4
- package/dist/patterns/ai/browser.d.ts +4 -4
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +17 -17
- 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.d.cts +4 -4
- package/dist/patterns/ai/node.d.ts +4 -4
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/cqrs/index.cjs +3 -3
- 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 -5
- 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 -3
- 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 +12 -12
- 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/harness/index.cjs +10 -8
- package/dist/patterns/harness/index.d.cts +11 -12
- package/dist/patterns/harness/index.d.ts +11 -12
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/inspect/index.cjs +3 -0
- package/dist/patterns/inspect/index.d.cts +9 -0
- package/dist/patterns/inspect/index.d.ts +9 -0
- package/dist/patterns/inspect/index.js +1 -0
- package/dist/patterns/job-queue/index.cjs +3 -3
- 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/memory/index.cjs +3 -3
- 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 -3
- 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 -3
- package/dist/patterns/orchestration/index.d.cts +7 -7
- package/dist/patterns/orchestration/index.d.ts +7 -7
- 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 -4
- 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 -3
- 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/surface/index.cjs +8 -8
- 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-MWrQZXCq.d.cts → pipeline-graph-WBlobVhU.d.cts} +5 -5
- package/dist/{pipeline-graph-CB4La-UW.d.ts → pipeline-graph-v8fMvqNk.d.ts} +5 -5
- package/dist/{reactive-layout-BtZfUKuL.d.cts → reactive-layout-Dsvob4zD.d.cts} +2 -2
- package/dist/{reactive-layout-KJj4E2dT.d.ts → reactive-layout-v7KPvxoc.d.ts} +2 -2
- package/dist/{reactive-log-_zeEnB9H.d.cts → reactive-log-B00laMSQ.d.cts} +1 -1
- package/dist/{reactive-log-BlAsPLl2.d.ts → reactive-log-BezYsbA_.d.ts} +1 -1
- package/dist/{reactive-map-6P_k3AQM.d.cts → reactive-map-48mnZ-nu.d.cts} +1 -1
- package/dist/{reactive-map-CjXByDV-.d.ts → reactive-map-BVVPdvmi.d.ts} +1 -1
- package/dist/resilience-445VFFXQ.js +1 -0
- package/dist/{sugar-BhfjgetH.d.ts → sugar-CH-2ZY90.d.ts} +1 -1
- package/dist/{sugar-DzePN5-g.d.cts → sugar-DStZfUEK.d.cts} +1 -1
- package/dist/{topology-tree-mF7Emqzm.d.ts → topology-tree-BNGvuG82.d.ts} +1 -1
- package/dist/{topology-tree-3LBKFsUo.d.cts → topology-tree-BSdfSwMi.d.cts} +1 -1
- package/dist/{types-1Dhoi7HM.d.cts → types-B1jDWVsM.d.cts} +1 -1
- package/dist/{types-39jk0kaV.d.ts → types-DkzUUs0H.d.ts} +1 -1
- package/package.json +11 -51
- package/dist/budget-gate-CmmVtasH.d.ts +0 -115
- package/dist/budget-gate-DiP_nK0n.d.cts +0 -115
- package/dist/chunk-2W553JJC.js +0 -1
- package/dist/chunk-4MKL6Q3K.js +0 -1
- package/dist/chunk-5B3JDG5F.js +0 -1
- package/dist/chunk-5QSXEMXG.js +0 -1
- package/dist/chunk-5TEFC2ZX.js +0 -1
- package/dist/chunk-5TOPVRN6.js +0 -1
- package/dist/chunk-EC2WNSZ7.js +0 -1
- package/dist/chunk-ELAASRBT.js +0 -3
- package/dist/chunk-H5SCWHWP.js +0 -1
- package/dist/chunk-OLIKJUKI.js +0 -1
- package/dist/chunk-POXANAJ6.js +0 -3
- package/dist/chunk-RSMEXK53.js +0 -43
- package/dist/chunk-SGS4OJGS.js +0 -1
- package/dist/chunk-URJ2VFNC.js +0 -1
- package/dist/chunk-VXPLLA4P.js +0 -1
- package/dist/chunk-WZYB3JQS.js +0 -1
- package/dist/chunk-Z6X7B6A4.js +0 -61
- package/dist/index-8s-Qm-gz.d.ts +0 -218
- package/dist/index-BgjS2b8N.d.ts +0 -366
- package/dist/index-BmSQLAZo.d.cts +0 -244
- package/dist/index-CGhMJNHb.d.cts +0 -128
- package/dist/index-CUIkE1l9.d.cts +0 -230
- package/dist/index-Ck35nA-T.d.ts +0 -244
- package/dist/index-CuPUehFa.d.cts +0 -218
- package/dist/index-D1Gc7wV5.d.ts +0 -230
- package/dist/index-N2MAxt7_.d.ts +0 -128
- package/dist/index-t6L2qpHh.d.cts +0 -366
- package/dist/patterns/audit/index.cjs +0 -3
- package/dist/patterns/audit/index.d.cts +0 -8
- package/dist/patterns/audit/index.d.ts +0 -8
- package/dist/patterns/audit/index.js +0 -1
- package/dist/patterns/guarded-execution/index.cjs +0 -3
- package/dist/patterns/guarded-execution/index.d.cts +0 -9
- package/dist/patterns/guarded-execution/index.d.ts +0 -9
- package/dist/patterns/guarded-execution/index.js +0 -1
- package/dist/patterns/lens/index.cjs +0 -3
- package/dist/patterns/lens/index.d.cts +0 -7
- package/dist/patterns/lens/index.d.ts +0 -7
- package/dist/patterns/lens/index.js +0 -1
- package/dist/patterns/refine-loop/index.cjs +0 -5
- package/dist/patterns/refine-loop/index.d.cts +0 -9
- package/dist/patterns/refine-loop/index.d.ts +0 -9
- package/dist/patterns/refine-loop/index.js +0 -1
- package/dist/patterns/resilient-pipeline/index.cjs +0 -3
- package/dist/patterns/resilient-pipeline/index.d.cts +0 -8
- package/dist/patterns/resilient-pipeline/index.d.ts +0 -8
- package/dist/patterns/resilient-pipeline/index.js +0 -1
- package/dist/resilience-JISHQD2F.js +0 -1
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import { A as Actor, N as Node, P as PolicyRuleData, G as GuardAction } from './node-BYInONRr.cjs';
|
|
2
|
-
import { G as Graph, a as GraphOptions, c as GraphPersistSnapshot } from './graph-E6likq7w.cjs';
|
|
3
|
-
import { T as TopicGraph } from './index-Cnr1WrlX.cjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Audit, policy enforcement, and compliance export (roadmap §9.2).
|
|
7
|
-
*
|
|
8
|
-
* Three composed factories that wrap any {@link Graph} with the harness
|
|
9
|
-
* accountability layer:
|
|
10
|
-
*
|
|
11
|
-
* - {@link auditTrail} — reactive mutation log with by-node/by-actor/by-time
|
|
12
|
-
* queries.
|
|
13
|
-
* - {@link policyGate} — reactive ABAC gate (Tier 2.3 rename of
|
|
14
|
-
* `policyEnforcer`); in `"audit"` mode records would-be denials, in
|
|
15
|
-
* `"enforce"` mode pushes guards onto target nodes so subsequent writes
|
|
16
|
-
* throw {@link GuardDenied}.
|
|
17
|
-
* - {@link complianceSnapshot} — point-in-time export of graph state +
|
|
18
|
-
* audit trail + policies for regulatory archival.
|
|
19
|
-
*
|
|
20
|
-
* @module
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/** A single recorded mutation/event in an {@link AuditTrailGraph}. */
|
|
24
|
-
interface AuditEntry {
|
|
25
|
-
seq: number;
|
|
26
|
-
timestamp_ns: number;
|
|
27
|
-
wall_clock_ns: number;
|
|
28
|
-
path: string;
|
|
29
|
-
type: "data" | "dirty" | "resolved" | "invalidate" | "pause" | "resume" | "complete" | "error" | "teardown";
|
|
30
|
-
actor?: Actor;
|
|
31
|
-
value?: unknown;
|
|
32
|
-
error?: unknown;
|
|
33
|
-
annotation?: string;
|
|
34
|
-
}
|
|
35
|
-
/** Options for {@link auditTrail}. */
|
|
36
|
-
interface AuditTrailOptions {
|
|
37
|
-
name?: string;
|
|
38
|
-
graph?: GraphOptions;
|
|
39
|
-
/** Ring-buffer cap for the underlying `reactiveLog`. Default: unbounded. */
|
|
40
|
-
maxSize?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Which event types to record. Default: `["data", "error", "complete",
|
|
43
|
-
* "teardown"]` — the user-meaningful set. Opt in to mid-wave protocol
|
|
44
|
-
* events (`"dirty"`, `"resolved"`, `"invalidate"`, `"pause"`, `"resume"`)
|
|
45
|
-
* by listing them explicitly. Note: those tier-1/tier-2 events do not
|
|
46
|
-
* carry an `actor` (no `lastMutation` populated) — record them only for
|
|
47
|
-
* protocol-level diagnostics.
|
|
48
|
-
*/
|
|
49
|
-
includeTypes?: readonly AuditEntry["type"][];
|
|
50
|
-
/** Per-event filter; return false to skip. */
|
|
51
|
-
filter?: (entry: AuditEntry) => boolean;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Mounted audit log — `entries` exposes the reactive `AuditEntry[]`; query
|
|
55
|
-
* helpers are sync convenience wrappers over the cached snapshot.
|
|
56
|
-
*/
|
|
57
|
-
declare class AuditTrailGraph extends Graph {
|
|
58
|
-
readonly entries: Node<readonly AuditEntry[]>;
|
|
59
|
-
readonly count: Node<number>;
|
|
60
|
-
private readonly _log;
|
|
61
|
-
private readonly _target;
|
|
62
|
-
constructor(target: Graph, opts: AuditTrailOptions);
|
|
63
|
-
/** All entries currently in the ring (snapshot). */
|
|
64
|
-
all(): readonly AuditEntry[];
|
|
65
|
-
/** Entries matching `path`. Order preserved. */
|
|
66
|
-
byNode(path: string): readonly AuditEntry[];
|
|
67
|
-
/** Entries whose `actor.id` matches. Use `byActorType` for type filtering. */
|
|
68
|
-
byActor(actorId: string): readonly AuditEntry[];
|
|
69
|
-
/** Entries whose `actor.type` matches (e.g. `"llm"`, `"human"`). */
|
|
70
|
-
byActorType(type: string): readonly AuditEntry[];
|
|
71
|
-
/**
|
|
72
|
-
* Entries with `timestamp_ns` in `[start_ns, end_ns)` (end exclusive).
|
|
73
|
-
* Omit `end_ns` to query open-ended.
|
|
74
|
-
*/
|
|
75
|
-
byTimeRange(start_ns: number, end_ns?: number): readonly AuditEntry[];
|
|
76
|
-
/** Reference to the audited graph (escape hatch for tooling). */
|
|
77
|
-
get target(): Graph;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Wraps any {@link Graph} with a reactive audit trail recording every event
|
|
81
|
-
* matching `includeTypes` (default: data + error + complete + teardown).
|
|
82
|
-
*
|
|
83
|
-
* Each entry carries `seq`, `timestamp_ns` (monotonic), `wall_clock_ns`,
|
|
84
|
-
* `path`, `type`, and — when available — `actor`, `value`, `error`, and the
|
|
85
|
-
* `graph.trace()` reasoning annotation for the path.
|
|
86
|
-
*
|
|
87
|
-
* The returned graph mounts an `entries` node + `count` derived. Query
|
|
88
|
-
* helpers (`byNode`, `byActor`, `byTimeRange`) operate on the cached
|
|
89
|
-
* snapshot synchronously.
|
|
90
|
-
*/
|
|
91
|
-
declare function auditTrail(target: Graph, opts?: AuditTrailOptions): AuditTrailGraph;
|
|
92
|
-
/** A single policy denial recorded by {@link PolicyGateGraph}. */
|
|
93
|
-
interface PolicyViolation {
|
|
94
|
-
timestamp_ns: number;
|
|
95
|
-
wall_clock_ns: number;
|
|
96
|
-
path: string;
|
|
97
|
-
actor: Actor;
|
|
98
|
-
action: GuardAction;
|
|
99
|
-
mode: "audit" | "enforce";
|
|
100
|
-
/** `"observed"` (audit mode after-the-fact) or `"blocked"` (enforce mode pre-write). */
|
|
101
|
-
result: "observed" | "blocked";
|
|
102
|
-
}
|
|
103
|
-
/** Options for {@link policyGate}. */
|
|
104
|
-
interface PolicyGateOptions {
|
|
105
|
-
name?: string;
|
|
106
|
-
graph?: GraphOptions;
|
|
107
|
-
/**
|
|
108
|
-
* `"audit"` (default) — observe events and record would-be denials;
|
|
109
|
-
* does not block writes. Audit mode requires `lastMutation` attribution
|
|
110
|
-
* on the audited node — anonymous/internal writes (no `actor` passed,
|
|
111
|
-
* unguarded node) are skipped silently because the policy cannot be
|
|
112
|
-
* evaluated without an actor.
|
|
113
|
-
*
|
|
114
|
-
* `"enforce"` — push guards onto target nodes so disallowed writes
|
|
115
|
-
* throw {@link GuardDenied}. Reverted on dispose.
|
|
116
|
-
*/
|
|
117
|
-
mode?: "audit" | "enforce";
|
|
118
|
-
/**
|
|
119
|
-
* Restrict enforcement to specific node paths (qualified). When omitted,
|
|
120
|
-
* applies to every node visible in `target.describe()` at construction
|
|
121
|
-
* time (subgraphs are walked transitively) AND subscribes to the full
|
|
122
|
-
* topology tree via {@link watchTopologyTree}, so nodes added to
|
|
123
|
-
* `target` OR any transitively-mounted subgraph after construction are
|
|
124
|
-
* guarded automatically (enforce mode only).
|
|
125
|
-
*
|
|
126
|
-
* Accepts a static `readonly string[]` or a reactive
|
|
127
|
-
* `Node<readonly string[]>` (Tier 3.4 — F.9 reactive primitive carve-out).
|
|
128
|
-
* When a `Node` is passed, the enforcer rebinds the guarded path set on
|
|
129
|
-
* every emission: paths added to the new set get wrapped, paths removed
|
|
130
|
-
* from the new set get released, and the audit-mode allow-list filter
|
|
131
|
-
* uses the latest cached value. Static-array callers retain the current
|
|
132
|
-
* "caller owns the path set" semantics.
|
|
133
|
-
*
|
|
134
|
-
* **Cost:** unrestricted mode runs `describe({detail:"minimal"})` once
|
|
135
|
-
* at construction (O(N) over the graph tree) plus one topology
|
|
136
|
-
* subscription per graph instance in the mount tree. Restricted mode
|
|
137
|
-
* (static or reactive) skips both and disables `watchTopologyTree`
|
|
138
|
-
* dynamic coverage — for reactive callers, the path-set Node is the
|
|
139
|
-
* single source of truth for which paths are guarded.
|
|
140
|
-
*/
|
|
141
|
-
paths?: readonly string[] | Node<readonly string[]>;
|
|
142
|
-
/**
|
|
143
|
-
* Ring-buffer cap for the violations topic. Default: 1000. Static
|
|
144
|
-
* number only — reactive form is deferred pending TopicGraph reactive
|
|
145
|
-
* `retainedLimit` support (see Tier 10.8 design follow-up in
|
|
146
|
-
* `docs/optimizations.md`).
|
|
147
|
-
*/
|
|
148
|
-
violationsLimit?: number;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Reactive ABAC enforcement layer. Policies are reactive — pass a
|
|
152
|
-
* `Node<readonly PolicyRuleData[]>` to allow LLMs (or any reactive source)
|
|
153
|
-
* to update them at runtime; the enforcer rebinds its internal
|
|
154
|
-
* {@link NodeGuard} on every push.
|
|
155
|
-
*/
|
|
156
|
-
declare class PolicyGateGraph extends Graph {
|
|
157
|
-
readonly policies: Node<readonly PolicyRuleData[]>;
|
|
158
|
-
readonly violations: TopicGraph<PolicyViolation>;
|
|
159
|
-
readonly violationCount: Node<number>;
|
|
160
|
-
private readonly _target;
|
|
161
|
-
private readonly _mode;
|
|
162
|
-
private _currentGuard;
|
|
163
|
-
constructor(target: Graph, policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>, opts: PolicyGateOptions);
|
|
164
|
-
private _publishViolation;
|
|
165
|
-
/** Snapshot of recorded violations. */
|
|
166
|
-
all(): readonly PolicyViolation[];
|
|
167
|
-
get mode(): "audit" | "enforce";
|
|
168
|
-
get target(): Graph;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Wraps a {@link Graph} with reactive policy enforcement. Pass either a
|
|
172
|
-
* static rule list or a {@link Node} of rules (LLM-updatable). Records
|
|
173
|
-
* `PolicyViolation` entries to `violations` topic; in `"enforce"` mode also
|
|
174
|
-
* pushes guards onto target nodes so disallowed writes throw.
|
|
175
|
-
*
|
|
176
|
-
* Self-tags via `g.tagFactory("policyGate", placeholderArgs(opts))` so
|
|
177
|
-
* `graph.describe()` surfaces `factory: "policyGate"` provenance (Phase 2.5
|
|
178
|
-
* DT5 ride-along, locked with the Tier 2.3 rename).
|
|
179
|
-
*/
|
|
180
|
-
declare function policyGate(target: Graph, policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>, opts?: PolicyGateOptions): PolicyGateGraph;
|
|
181
|
-
/** Options for {@link complianceSnapshot}. */
|
|
182
|
-
interface ComplianceSnapshotOptions {
|
|
183
|
-
audit?: AuditTrailGraph;
|
|
184
|
-
policies?: PolicyGateGraph;
|
|
185
|
-
/** Actor recorded as the snapshot taker. */
|
|
186
|
-
actor?: Actor;
|
|
187
|
-
}
|
|
188
|
-
/** Output of {@link complianceSnapshot}. JSON-serializable. */
|
|
189
|
-
interface ComplianceSnapshotResult {
|
|
190
|
-
format_version: 1;
|
|
191
|
-
timestamp_ns: number;
|
|
192
|
-
wall_clock_ns: number;
|
|
193
|
-
actor?: Actor;
|
|
194
|
-
graph: GraphPersistSnapshot;
|
|
195
|
-
audit?: {
|
|
196
|
-
count: number;
|
|
197
|
-
entries: AuditEntry[];
|
|
198
|
-
};
|
|
199
|
-
policies?: {
|
|
200
|
-
mode: "audit" | "enforce";
|
|
201
|
-
rules: readonly PolicyRuleData[];
|
|
202
|
-
violations: readonly PolicyViolation[];
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* Truncated SHA-256 hex (16 chars / ~64 bits) over a canonical encoding
|
|
206
|
-
* of every field above (excluding `fingerprint` itself). Deterministic
|
|
207
|
-
* across runs given identical inputs. Suitable for casual tamper-evidence
|
|
208
|
-
* and content-addressed dedup; for full cryptographic strength, hash the
|
|
209
|
-
* canonical JSON externally with Web Crypto / Node `crypto`.
|
|
210
|
-
*/
|
|
211
|
-
fingerprint: string;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* One-shot point-in-time export of a {@link Graph}'s state plus optional
|
|
215
|
-
* audit + policy bundles. Returns a JSON-serializable object with a
|
|
216
|
-
* deterministic truncated-SHA-256 {@link ComplianceSnapshotResult.fingerprint}
|
|
217
|
-
* over the canonical payload for tamper-evidence in regulatory archival.
|
|
218
|
-
*
|
|
219
|
-
* **Cryptographic strength:** the fingerprint is truncated to 64 bits for
|
|
220
|
-
* compact archival. Collision-resistant for casual integrity checks but NOT
|
|
221
|
-
* sufficient for adversarial tamper-evidence — pair with a full SHA-256
|
|
222
|
-
* (or stronger) over the canonical JSON when regulatory requirements demand
|
|
223
|
-
* collision resistance.
|
|
224
|
-
*/
|
|
225
|
-
declare function complianceSnapshot(target: Graph, opts?: ComplianceSnapshotOptions): ComplianceSnapshotResult;
|
|
226
|
-
|
|
227
|
-
type index_AuditEntry = AuditEntry;
|
|
228
|
-
type index_AuditTrailGraph = AuditTrailGraph;
|
|
229
|
-
declare const index_AuditTrailGraph: typeof AuditTrailGraph;
|
|
230
|
-
type index_AuditTrailOptions = AuditTrailOptions;
|
|
231
|
-
type index_ComplianceSnapshotOptions = ComplianceSnapshotOptions;
|
|
232
|
-
type index_ComplianceSnapshotResult = ComplianceSnapshotResult;
|
|
233
|
-
type index_PolicyGateGraph = PolicyGateGraph;
|
|
234
|
-
declare const index_PolicyGateGraph: typeof PolicyGateGraph;
|
|
235
|
-
type index_PolicyGateOptions = PolicyGateOptions;
|
|
236
|
-
type index_PolicyViolation = PolicyViolation;
|
|
237
|
-
declare const index_auditTrail: typeof auditTrail;
|
|
238
|
-
declare const index_complianceSnapshot: typeof complianceSnapshot;
|
|
239
|
-
declare const index_policyGate: typeof policyGate;
|
|
240
|
-
declare namespace index {
|
|
241
|
-
export { type index_AuditEntry as AuditEntry, index_AuditTrailGraph as AuditTrailGraph, type index_AuditTrailOptions as AuditTrailOptions, type index_ComplianceSnapshotOptions as ComplianceSnapshotOptions, type index_ComplianceSnapshotResult as ComplianceSnapshotResult, index_PolicyGateGraph as PolicyGateGraph, type index_PolicyGateOptions as PolicyGateOptions, type index_PolicyViolation as PolicyViolation, index_auditTrail as auditTrail, index_complianceSnapshot as complianceSnapshot, index_policyGate as policyGate };
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export { type AuditEntry as A, type ComplianceSnapshotOptions as C, PolicyGateGraph as P, type PolicyViolation as a, AuditTrailGraph as b, type AuditTrailOptions as c, type ComplianceSnapshotResult as d, type PolicyGateOptions as e, auditTrail as f, complianceSnapshot as g, index as i, policyGate as p };
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { N as Node } from './node-BYInONRr.cjs';
|
|
2
|
-
import { b as GraphDescribeOutput, G as Graph } from './graph-E6likq7w.cjs';
|
|
3
|
-
import { w as watchTopologyTree } from './topology-tree-3LBKFsUo.cjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Reactive graph observability preset (Tier 5.3 reshape — Session A.4 lock).
|
|
7
|
-
*
|
|
8
|
-
* `graphLens(target)` is a thin compositor (~30 LOC of glue) over two
|
|
9
|
-
* already-shipped reactive primitives:
|
|
10
|
-
*
|
|
11
|
-
* - `target.describe({ reactive: true })` — live topology snapshot.
|
|
12
|
-
* - `target.observe({ reactive: true, tiers: ["data"] })` — coalesced data
|
|
13
|
-
* changesets per outermost batch flush.
|
|
14
|
-
*
|
|
15
|
-
* It returns three Nodes plus a dispose function:
|
|
16
|
-
*
|
|
17
|
-
* - `topology: Node<GraphDescribeOutput>` — the live describe snapshot,
|
|
18
|
-
* re-emitting on every settle of the target tree (structural change,
|
|
19
|
-
* error/complete/teardown transition).
|
|
20
|
-
* - `health: Node<HealthReport>` — `{ok, problems[]}` aggregated from the
|
|
21
|
-
* live describe; `ok=false` when any node enters `"errored"` status,
|
|
22
|
-
* with `upstreamCause` walked backward through deps.
|
|
23
|
-
* - `flow: Node<ReadonlyMap<string, FlowEntry>>` — per-path DATA counters
|
|
24
|
-
* accumulating as `target.observe({reactive: true, tiers: ["data"]})`
|
|
25
|
-
* delivers changesets. The map is reconciled against `topology` on each
|
|
26
|
-
* topology change so removed nodes drop their entries.
|
|
27
|
-
*
|
|
28
|
-
* Pre-Tier-5.3 shipped a `LensGraph` class with `stats` / `health` / `flow`
|
|
29
|
-
* (as a `ReactiveMapBundle`) / `why(from, to)` / `flowEntryNode(...)`. The
|
|
30
|
-
* surface collapsed because every concern was already a one-liner over
|
|
31
|
-
* `describe({reactive:true})` + `observe({reactive:true, tiers})` once those
|
|
32
|
-
* landed in Tier 1.5.1 / 1.5.2 — the class added no protocol-level concept,
|
|
33
|
-
* just glue. Callers who need topology stats compose a derived over
|
|
34
|
-
* `topology` directly; callers who need a causal chain call
|
|
35
|
-
* `target.explain(from, to, { reactive: true })`.
|
|
36
|
-
*
|
|
37
|
-
* The transitive topology-subscription helper {@link watchTopologyTree} is
|
|
38
|
-
* re-exported here for downstream factories that need full-tree dynamic
|
|
39
|
-
* coverage without taking a dep on `graph/`.
|
|
40
|
-
*
|
|
41
|
-
* @module
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
/** A single health problem entry. */
|
|
45
|
-
interface HealthProblem {
|
|
46
|
-
path: string;
|
|
47
|
-
/** V1 only reports `"errored"`. Future versions may add `"completed"`, `"disconnected"`. */
|
|
48
|
-
status: "errored";
|
|
49
|
-
/** First errored upstream ancestor along the dep chain, when one exists and is distinct from `path`. */
|
|
50
|
-
upstreamCause?: string;
|
|
51
|
-
}
|
|
52
|
-
/** Aggregate health snapshot. `ok=true` iff `problems.length === 0`. */
|
|
53
|
-
interface HealthReport {
|
|
54
|
-
ok: boolean;
|
|
55
|
-
problems: readonly HealthProblem[];
|
|
56
|
-
}
|
|
57
|
-
/** Per-path flow entry stored in the {@link GraphLensView.flow} map. */
|
|
58
|
-
interface FlowEntry {
|
|
59
|
-
path: string;
|
|
60
|
-
/** Cumulative DATA emissions observed since the lens activated. */
|
|
61
|
-
count: number;
|
|
62
|
-
/** Monotonic ns at the most recent DATA emission for this path, or `null` if none yet. */
|
|
63
|
-
lastUpdate_ns: number | null;
|
|
64
|
-
}
|
|
65
|
-
/** Output of {@link graphLens}. */
|
|
66
|
-
interface GraphLensView {
|
|
67
|
-
/** Live describe snapshot. Re-emits on structural change AND status transitions. */
|
|
68
|
-
topology: Node<GraphDescribeOutput>;
|
|
69
|
-
/** Live `{ok, problems[]}`. Aggregated from `topology`; equality-deduped. */
|
|
70
|
-
health: Node<HealthReport>;
|
|
71
|
-
/** Per-path DATA counter map. Re-emits per outermost batch flush. */
|
|
72
|
-
flow: Node<ReadonlyMap<string, FlowEntry>>;
|
|
73
|
-
/**
|
|
74
|
-
* Tear down the underlying `describe({reactive:true})` subscription.
|
|
75
|
-
* The `flow` node activates lazily; subscribing-then-unsubscribing reclaims
|
|
76
|
-
* its observe stream automatically. Call `dispose()` once when finished.
|
|
77
|
-
*/
|
|
78
|
-
dispose(): void;
|
|
79
|
-
}
|
|
80
|
-
/** Build a `HealthReport` from a fresh `GraphDescribeOutput`. */
|
|
81
|
-
declare function computeHealthReport(described: GraphDescribeOutput): HealthReport;
|
|
82
|
-
/** Structural equality for {@link HealthReport} — used as the `health` derived's `equals`. */
|
|
83
|
-
declare function healthReportEqual(a: HealthReport, b: HealthReport): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Reactive observability preset over a target {@link Graph}.
|
|
86
|
-
*
|
|
87
|
-
* @param target - The graph to observe.
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```ts
|
|
91
|
-
* const g = new Graph("app");
|
|
92
|
-
* g.add(state(0, { name: "counter" }), { name: "counter" });
|
|
93
|
-
*
|
|
94
|
-
* const lens = graphLens(g);
|
|
95
|
-
* lens.topology.subscribe((msgs) => console.log("topology:", msgs));
|
|
96
|
-
* lens.health.subscribe((msgs) => console.log("health:", msgs));
|
|
97
|
-
* lens.flow.subscribe((msgs) => {
|
|
98
|
-
* for (const [type, payload] of msgs) {
|
|
99
|
-
* if (type === DATA) console.log("flow map size:", (payload as ReadonlyMap<string, FlowEntry>).size);
|
|
100
|
-
* }
|
|
101
|
-
* });
|
|
102
|
-
*
|
|
103
|
-
* // Causal chains: use the underlying primitive directly — `graphLens` no
|
|
104
|
-
* // longer wraps it, since `graph.explain({ reactive: true })` already
|
|
105
|
-
* // provides everything the old `lens.why()` did.
|
|
106
|
-
* const why = g.explain("counter", "consumer", { reactive: true });
|
|
107
|
-
*
|
|
108
|
-
* // Tear down when done.
|
|
109
|
-
* lens.dispose();
|
|
110
|
-
* ```
|
|
111
|
-
*
|
|
112
|
-
* @category observability
|
|
113
|
-
*/
|
|
114
|
-
declare function graphLens(target: Graph): GraphLensView;
|
|
115
|
-
|
|
116
|
-
type index_FlowEntry = FlowEntry;
|
|
117
|
-
type index_GraphLensView = GraphLensView;
|
|
118
|
-
type index_HealthProblem = HealthProblem;
|
|
119
|
-
type index_HealthReport = HealthReport;
|
|
120
|
-
declare const index_computeHealthReport: typeof computeHealthReport;
|
|
121
|
-
declare const index_graphLens: typeof graphLens;
|
|
122
|
-
declare const index_healthReportEqual: typeof healthReportEqual;
|
|
123
|
-
declare const index_watchTopologyTree: typeof watchTopologyTree;
|
|
124
|
-
declare namespace index {
|
|
125
|
-
export { type index_FlowEntry as FlowEntry, type index_GraphLensView as GraphLensView, type index_HealthProblem as HealthProblem, type index_HealthReport as HealthReport, index_computeHealthReport as computeHealthReport, index_graphLens as graphLens, index_healthReportEqual as healthReportEqual, index_watchTopologyTree as watchTopologyTree };
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export { type FlowEntry as F, type GraphLensView as G, type HealthProblem as H, type HealthReport as a, computeHealthReport as c, graphLens as g, healthReportEqual as h, index as i };
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { f as factoryTag, p as placeholderArgs } from './meta-Ct9nqQS5.cjs';
|
|
2
|
-
import { N as Node } from './node-BYInONRr.cjs';
|
|
3
|
-
import { S as StatusValue, C as CircuitState, R as RateLimiterState, a as RateLimiterOptions, b as CircuitBreakerOptions, c as RetryOptions, F as FallbackInput, N as NS_PER_MS, d as NS_PER_SEC } from './index-DGTo1yka.cjs';
|
|
4
|
-
import { G as Graph, a as GraphOptions } from './graph-E6likq7w.cjs';
|
|
5
|
-
import { B as BudgetConstraint } from './budget-gate-DiP_nK0n.cjs';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Resilience composition with correct nesting order (roadmap §9.0b — Tier 5.2 Wave-B rebuild).
|
|
9
|
-
*
|
|
10
|
-
* {@link resilientPipeline} composes the resilience primitives from
|
|
11
|
-
* `extra/resilience/` in the canonical nesting order:
|
|
12
|
-
*
|
|
13
|
-
* ```text
|
|
14
|
-
* rateLimit → budget → breaker → timeout → retry → fallback → status
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* Returns a {@link ResilientPipelineGraph} (Graph subclass) with mounted
|
|
18
|
-
* intermediate nodes and per-layer status companions, replacing the prior
|
|
19
|
-
* bundle return. Each intermediate is mounted under a stable name so
|
|
20
|
-
* `pipeline.describe()` shows the resilience chain in topology snapshots,
|
|
21
|
-
* mermaid renders, and `lens.health` aggregations.
|
|
22
|
-
*
|
|
23
|
-
* **Per-attempt timeout vs. retry ordering.** `timeout` is applied BEFORE
|
|
24
|
-
* `retry` so each retry attempt resubscribes to a fresh deadline (per-attempt
|
|
25
|
-
* semantics). If `timeout` wrapped `retry`, a single deadline would apply to
|
|
26
|
-
* the entire retry chain — not what callers expect.
|
|
27
|
-
*
|
|
28
|
-
* **`breakerOnOpen` + `retry` interaction.** With `breakerOnOpen: "error"` AND
|
|
29
|
-
* `retry`, retry sees `CircuitOpenError` and resubscribes; the next attempt
|
|
30
|
-
* very likely also breaker-open → another error → retry burns its budget
|
|
31
|
-
* against an open circuit. Either set retry's `backoff` long enough for the
|
|
32
|
-
* breaker reset window OR keep the default `breakerOnOpen: "skip"` (emits
|
|
33
|
-
* RESOLVED when open; downstream drops the beat without retry firing).
|
|
34
|
-
*
|
|
35
|
-
* **Reactive options (switchMap rebuild).** Every primitive option accepts a
|
|
36
|
-
* `T | Node<T>` (precedent-aligned with `FallbackInput<T>`). When the caller
|
|
37
|
-
* supplies a static value, the layer is built once at construction. When the
|
|
38
|
-
* caller supplies a `Node<T>`, the pipeline subscribes via `switchMap` and
|
|
39
|
-
* **rebuilds the layer on every option emission** — the chain stalls until
|
|
40
|
-
* the option Node emits its first DATA. Each rebuild creates a fresh
|
|
41
|
-
* primitive instance, so internal state is lost (rate-limiter pending buffer,
|
|
42
|
-
* breaker failure count, retry attempt count, in-flight timeout). Per-layer
|
|
43
|
-
* **companion Nodes** (`droppedCount`, `rateLimitState`, `breakerState`) are
|
|
44
|
-
* therefore exposed ONLY for the static-options path. Primitive-side widening
|
|
45
|
-
* (filed in `docs/optimizations.md` under "Tier 5.2 follow-up — primitive-side
|
|
46
|
-
* reactive-options widening") will preserve internal state once it lands and
|
|
47
|
-
* the pipeline will trivially forward Node-form options to the primitive.
|
|
48
|
-
*
|
|
49
|
-
* @module
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* `T | Node<T>` for primitive options — precedent-aligned with
|
|
54
|
-
* {@link FallbackInput} and `policyGate.policies`. When the caller supplies a
|
|
55
|
-
* static value, the layer is built once at construction. When the caller
|
|
56
|
-
* supplies a `Node<T>`, the pipeline subscribes via {@link switchMap}: the
|
|
57
|
-
* layer is rebuilt on every option emission. **State-loss caveat:** each
|
|
58
|
-
* rebuild creates a fresh primitive instance — `rateLimiter` loses its pending
|
|
59
|
-
* buffer, `circuitBreaker` resets failure count, `retry` resets attempt
|
|
60
|
-
* count, `timeout` cancels in-flight deadline. This is the documented
|
|
61
|
-
* switchMap-pattern semantics; primitive-side widening (filed in
|
|
62
|
-
* `docs/optimizations.md`) will preserve internal state once it lands and the
|
|
63
|
-
* pipeline can forward Node-form options directly.
|
|
64
|
-
*
|
|
65
|
-
* Per-layer **companion Nodes** (`droppedCount`, `rateLimitState`,
|
|
66
|
-
* `breakerState`) are exposed only for the static-options path — Node-form
|
|
67
|
-
* leaves them as `undefined` because each rebuild creates new companion
|
|
68
|
-
* instances and a switchMap-mirrored companion would track only the latest
|
|
69
|
-
* bundle. Callers needing both reactive options AND companions wait for
|
|
70
|
-
* primitive-side widening.
|
|
71
|
-
*/
|
|
72
|
-
type NodeOrValue<T> = T | Node<T>;
|
|
73
|
-
/**
|
|
74
|
-
* Options for {@link resilientPipeline}. Every layer is optional — omit a
|
|
75
|
-
* field and that layer is skipped.
|
|
76
|
-
*
|
|
77
|
-
* Reactive (`Node<T>`) forms are accepted everywhere a primitive value would
|
|
78
|
-
* fit; the pipeline subscribes via `switchMap` and rebuilds the layer on each
|
|
79
|
-
* emission. See module JSDoc for the rebuild semantics + state-loss caveat.
|
|
80
|
-
*/
|
|
81
|
-
interface ResilientPipelineOptions<T> {
|
|
82
|
-
/**
|
|
83
|
-
* Admission control — at most `maxEvents` `DATA` per `windowNs`. See
|
|
84
|
-
* {@link rateLimiter}.
|
|
85
|
-
*
|
|
86
|
-
* `maxBuffer` is optional at the pipeline layer (defaults to `Infinity`,
|
|
87
|
-
* preserving the historical unbounded behavior). Pass an explicit positive
|
|
88
|
-
* integer to opt in to a bounded queue.
|
|
89
|
-
*/
|
|
90
|
-
rateLimit?: NodeOrValue<Omit<RateLimiterOptions, "maxBuffer"> & {
|
|
91
|
-
maxBuffer?: number;
|
|
92
|
-
}>;
|
|
93
|
-
/** Cost/constraint gate. See {@link budgetGate}. */
|
|
94
|
-
budget?: NodeOrValue<ReadonlyArray<BudgetConstraint>>;
|
|
95
|
-
/** Circuit breaker — fail-fast when the downstream resource is unhealthy. See {@link circuitBreaker}. */
|
|
96
|
-
breaker?: NodeOrValue<CircuitBreakerOptions>;
|
|
97
|
-
/**
|
|
98
|
-
* Behavior when the breaker is open:
|
|
99
|
-
* - `"skip"` (default) — emit `RESOLVED` (lets downstream drop the beat).
|
|
100
|
-
* - `"error"` — emit a `CircuitOpenError` so `retry` / `fallback` can react.
|
|
101
|
-
* See module JSDoc for the retry-budget burn caveat.
|
|
102
|
-
*
|
|
103
|
-
* Static (configuration-only — no reactive form).
|
|
104
|
-
*/
|
|
105
|
-
breakerOnOpen?: "skip" | "error";
|
|
106
|
-
/** Retry policy on terminal `ERROR`. See {@link retry}. */
|
|
107
|
-
retry?: NodeOrValue<RetryOptions>;
|
|
108
|
-
/**
|
|
109
|
-
* Per-attempt deadline in milliseconds. Converted to ns internally. Omit
|
|
110
|
-
* to skip the timeout wrap.
|
|
111
|
-
*
|
|
112
|
-
* Specified in ms (not ns) because callers consistently think in
|
|
113
|
-
* millisecond deadlines; the underlying {@link timeout} primitive takes ns
|
|
114
|
-
* internally.
|
|
115
|
-
*/
|
|
116
|
-
timeoutMs?: NodeOrValue<number>;
|
|
117
|
-
/** Final fallback value emitted on terminal `ERROR` after retry exhausts. See {@link fallback}. */
|
|
118
|
-
fallback?: FallbackInput<T>;
|
|
119
|
-
/**
|
|
120
|
-
* Initial status reported by the status node. Default `"pending"`. Static.
|
|
121
|
-
*/
|
|
122
|
-
initialStatus?: StatusValue;
|
|
123
|
-
/** Wrapper graph name. Default `"resilient_pipeline"`. */
|
|
124
|
-
name?: string;
|
|
125
|
-
/** Wrapper graph options. */
|
|
126
|
-
graph?: GraphOptions;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Graph subclass returned by {@link resilientPipeline}. Mounts each
|
|
130
|
-
* configured intermediate under a stable name and exposes per-layer status
|
|
131
|
-
* companions.
|
|
132
|
-
*
|
|
133
|
-
* @category patterns
|
|
134
|
-
*/
|
|
135
|
-
declare class ResilientPipelineGraph<T> extends Graph {
|
|
136
|
-
/**
|
|
137
|
-
* Final resilient node — subscribe to this for `DATA` emissions.
|
|
138
|
-
*
|
|
139
|
-
* Named `output` (not `node`) because `Graph.node(name)` already names the
|
|
140
|
-
* path-resolution method on the base class; a `readonly node` field would
|
|
141
|
-
* shadow it.
|
|
142
|
-
*/
|
|
143
|
-
readonly output: Node<T>;
|
|
144
|
-
/** Live status: `"pending" | "running" | "completed" | "errored"`. */
|
|
145
|
-
readonly status: Node<StatusValue>;
|
|
146
|
-
/**
|
|
147
|
-
* Last error payload, or `null` when not errored.
|
|
148
|
-
*
|
|
149
|
-
* Named `lastError` (not `error`) because `Graph.error(name, err)` already
|
|
150
|
-
* names a method on the base class.
|
|
151
|
-
*/
|
|
152
|
-
readonly lastError: Node<unknown | null>;
|
|
153
|
-
/** Breaker state when `opts.breaker` is provided; `undefined` otherwise. */
|
|
154
|
-
readonly breakerState: Node<CircuitState> | undefined;
|
|
155
|
-
/**
|
|
156
|
-
* Drop-counter when `opts.rateLimit` is provided; `undefined` otherwise.
|
|
157
|
-
*
|
|
158
|
-
* **Lifetime note:** `droppedCount` retains its final value through
|
|
159
|
-
* terminal (`COMPLETE` / `ERROR` / `TEARDOWN`); the underlying counter
|
|
160
|
-
* resets to `0` only at the next subscription cycle.
|
|
161
|
-
*/
|
|
162
|
-
readonly droppedCount: Node<number> | undefined;
|
|
163
|
-
/**
|
|
164
|
-
* Combined rate-limit state when `opts.rateLimit` is provided; `undefined`
|
|
165
|
-
* otherwise. Same lifecycle as {@link droppedCount} but exposes
|
|
166
|
-
* `pendingCount` and `paused` alongside the drop counter for richer
|
|
167
|
-
* backpressure observability (Tier 5.2 D7).
|
|
168
|
-
*/
|
|
169
|
-
readonly rateLimitState: Node<RateLimiterState> | undefined;
|
|
170
|
-
constructor(source: Node<T>, opts?: ResilientPipelineOptions<T>);
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Compose a resilient pipeline around `source` in the canonical nesting
|
|
174
|
-
* order — `rateLimit → budget → breaker → timeout → retry → fallback → status`.
|
|
175
|
-
* Omit any option to skip that layer.
|
|
176
|
-
*
|
|
177
|
-
* Returns a {@link ResilientPipelineGraph} (Graph subclass) —
|
|
178
|
-
* `pipeline.output` is the externally visible final node; `pipeline.status`
|
|
179
|
-
* / `pipeline.lastError` / `pipeline.breakerState` / `pipeline.droppedCount`
|
|
180
|
-
* are the per-layer companions. Call `pipeline.describe()` to see the
|
|
181
|
-
* mounted intermediates; compose with {@link graphLens}'s `health` for
|
|
182
|
-
* aggregate status.
|
|
183
|
-
*
|
|
184
|
-
* **Naming note:** `output` and `lastError` (not `node` / `error`) avoid
|
|
185
|
-
* clashes with `Graph.node(name)` and `Graph.error(name, err)` on the base
|
|
186
|
-
* class.
|
|
187
|
-
*
|
|
188
|
-
* @param source - Upstream node to wrap.
|
|
189
|
-
* @param opts - See {@link ResilientPipelineOptions}. All fields optional.
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* ```ts
|
|
193
|
-
* const safeFetch = resilientPipeline(fetchNode, {
|
|
194
|
-
* rateLimit: { maxEvents: 10, windowNs: NS_PER_SEC },
|
|
195
|
-
* breaker: { failureThreshold: 5 },
|
|
196
|
-
* retry: { count: 3, backoff: "exponential" },
|
|
197
|
-
* timeoutMs: 10_000,
|
|
198
|
-
* fallback: null,
|
|
199
|
-
* });
|
|
200
|
-
* safeFetch.output.subscribe(msgs => console.log(msgs));
|
|
201
|
-
* safeFetch.status.subscribe(msgs => console.log(msgs));
|
|
202
|
-
* safeFetch.describe({ format: "ascii" }); // visualize the chain
|
|
203
|
-
* ```
|
|
204
|
-
*
|
|
205
|
-
* @category patterns
|
|
206
|
-
*/
|
|
207
|
-
declare function resilientPipeline<T>(source: Node<T>, opts?: ResilientPipelineOptions<T>): ResilientPipelineGraph<T>;
|
|
208
|
-
|
|
209
|
-
declare const index_BudgetConstraint: typeof BudgetConstraint;
|
|
210
|
-
declare const index_CircuitBreakerOptions: typeof CircuitBreakerOptions;
|
|
211
|
-
declare const index_CircuitState: typeof CircuitState;
|
|
212
|
-
declare const index_FallbackInput: typeof FallbackInput;
|
|
213
|
-
declare const index_NS_PER_MS: typeof NS_PER_MS;
|
|
214
|
-
declare const index_NS_PER_SEC: typeof NS_PER_SEC;
|
|
215
|
-
type index_NodeOrValue<T> = NodeOrValue<T>;
|
|
216
|
-
declare const index_RateLimiterOptions: typeof RateLimiterOptions;
|
|
217
|
-
declare const index_RateLimiterState: typeof RateLimiterState;
|
|
218
|
-
type index_ResilientPipelineGraph<T> = ResilientPipelineGraph<T>;
|
|
219
|
-
declare const index_ResilientPipelineGraph: typeof ResilientPipelineGraph;
|
|
220
|
-
type index_ResilientPipelineOptions<T> = ResilientPipelineOptions<T>;
|
|
221
|
-
declare const index_RetryOptions: typeof RetryOptions;
|
|
222
|
-
declare const index_StatusValue: typeof StatusValue;
|
|
223
|
-
declare const index_factoryTag: typeof factoryTag;
|
|
224
|
-
declare const index_placeholderArgs: typeof placeholderArgs;
|
|
225
|
-
declare const index_resilientPipeline: typeof resilientPipeline;
|
|
226
|
-
declare namespace index {
|
|
227
|
-
export { index_BudgetConstraint as BudgetConstraint, index_CircuitBreakerOptions as CircuitBreakerOptions, index_CircuitState as CircuitState, index_FallbackInput as FallbackInput, index_NS_PER_MS as NS_PER_MS, index_NS_PER_SEC as NS_PER_SEC, type index_NodeOrValue as NodeOrValue, index_RateLimiterOptions as RateLimiterOptions, index_RateLimiterState as RateLimiterState, index_ResilientPipelineGraph as ResilientPipelineGraph, type index_ResilientPipelineOptions as ResilientPipelineOptions, index_RetryOptions as RetryOptions, index_StatusValue as StatusValue, index_factoryTag as factoryTag, index_placeholderArgs as placeholderArgs, index_resilientPipeline as resilientPipeline };
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export { type NodeOrValue as N, ResilientPipelineGraph as R, type ResilientPipelineOptions as a, index as i, resilientPipeline as r };
|