@graphrefly/graphrefly 0.27.0 → 0.29.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/backoff-HPZMEZNF.js +1 -0
- package/dist/cascading-Bp99ckMJ.d.ts +180 -0
- package/dist/cascading-CcAgRacD.d.cts +180 -0
- package/dist/chunk-22F4K3G7.js +1 -0
- package/dist/chunk-22SVXUPB.js +64 -0
- package/dist/chunk-2GQREQ6C.js +1 -0
- package/dist/chunk-3JXNEPCD.js +2 -0
- package/dist/chunk-4JJCCD5S.js +2 -0
- package/dist/chunk-4OFIQ66T.js +1 -0
- package/dist/chunk-4V4C7K56.js +1 -0
- package/dist/chunk-4VVTGLXJ.js +1 -0
- package/dist/chunk-567NWZ3T.js +1 -0
- package/dist/chunk-5JDE5JHE.js +1 -0
- package/dist/chunk-5QDBSZBV.js +1 -0
- package/dist/chunk-5Z4HDCO6.js +1 -0
- package/dist/chunk-63FFOHLA.js +1 -0
- package/dist/chunk-6QZNQS5B.js +1 -0
- package/dist/chunk-7JDLFI6N.js +1 -0
- package/dist/chunk-7TDOES3L.js +1 -0
- package/dist/chunk-A7IAQQ63.js +1 -0
- package/dist/chunk-AMG5VBHW.js +1 -0
- package/dist/chunk-AUY2YKCO.js +1 -0
- package/dist/chunk-AV3PIDFQ.js +1 -0
- package/dist/chunk-BA5URFYW.js +1 -0
- package/dist/chunk-BKPLTBL5.js +1 -0
- package/dist/chunk-BZP5T4X6.js +1 -0
- package/dist/chunk-CK2E7BTU.js +1 -0
- package/dist/chunk-CSJE2EKV.js +1 -0
- package/dist/chunk-E3AXATVZ.js +9 -0
- package/dist/chunk-ESMPEKEV.js +1 -0
- package/dist/chunk-GJR3P6JG.js +1 -0
- package/dist/chunk-GNCBXARM.js +1 -0
- package/dist/chunk-GPW2V3RE.js +1 -0
- package/dist/chunk-HSIEYSDY.js +1 -0
- package/dist/chunk-I6VIH3VA.js +1 -0
- package/dist/chunk-ISCENNXS.js +1 -0
- package/dist/chunk-JYOUF6UQ.js +1 -0
- package/dist/chunk-KASHOCF5.js +1 -0
- package/dist/chunk-LGSNR4LU.js +5 -0
- package/dist/chunk-LVGBLZM2.js +1 -0
- package/dist/chunk-MGKAO4EK.js +7 -0
- package/dist/chunk-NSG4C6BF.js +23 -0
- package/dist/chunk-OL33ZI6R.js +1 -0
- package/dist/chunk-PCZ35NXD.js +78 -0
- package/dist/chunk-PGMUCUHG.js +43 -0
- package/dist/chunk-QYADASLV.js +1 -0
- package/dist/chunk-RD52SNH2.js +1 -0
- package/dist/chunk-SLMYTGTU.js +1 -0
- package/dist/chunk-TWMEGG45.js +1 -0
- package/dist/chunk-UVJQ35G2.js +1 -0
- package/dist/chunk-VGTCGNRX.js +18 -0
- package/dist/chunk-VIMF6LGM.js +1 -0
- package/dist/chunk-VJLMUKOI.js +1 -0
- package/dist/chunk-VWPRPPKR.js +1 -0
- package/dist/chunk-W4TSQ6RJ.js +1 -0
- package/dist/chunk-WM7H7WTY.js +3 -0
- package/dist/chunk-Y32RJO24.js +1 -0
- package/dist/chunk-Y53B6NS4.js +1 -0
- package/dist/compat/index.cjs +15 -7656
- package/dist/compat/index.d.cts +15 -14
- package/dist/compat/index.d.ts +15 -14
- package/dist/compat/index.js +1 -50
- package/dist/compat/jotai/index.cjs +1 -2048
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +1 -9
- package/dist/compat/nanostores/index.cjs +1 -2175
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +1 -23
- package/dist/compat/nestjs/index.cjs +15 -6782
- package/dist/compat/nestjs/index.d.cts +7 -6
- package/dist/compat/nestjs/index.d.ts +7 -6
- package/dist/compat/nestjs/index.js +1 -83
- package/dist/compat/react/index.cjs +1 -141
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/react/index.js +1 -12
- package/dist/compat/solid/index.cjs +1 -128
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/solid/index.js +1 -12
- package/dist/compat/svelte/index.cjs +1 -131
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/svelte/index.js +1 -12
- package/dist/compat/vue/index.cjs +1 -146
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/vue/index.js +1 -12
- package/dist/compat/zustand/index.cjs +7 -4931
- package/dist/compat/zustand/index.d.cts +5 -5
- package/dist/compat/zustand/index.d.ts +5 -5
- package/dist/compat/zustand/index.js +1 -12
- package/dist/composite-BL-llbnE.d.ts +69 -0
- package/dist/composite-Dze--DaA.d.cts +69 -0
- package/dist/core/index.cjs +1 -2271
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +1 -110
- package/dist/extra/browser.cjs +1 -0
- package/dist/extra/browser.d.cts +3 -0
- package/dist/extra/browser.d.ts +3 -0
- package/dist/extra/browser.js +1 -0
- package/dist/extra/index.cjs +24 -9971
- package/dist/extra/index.d.cts +13 -6
- package/dist/extra/index.d.ts +13 -6
- package/dist/extra/index.js +1 -381
- package/dist/extra/node.cjs +3 -0
- package/dist/extra/node.d.cts +81 -0
- package/dist/extra/node.d.ts +81 -0
- package/dist/extra/node.js +2 -0
- package/dist/extra/operators.cjs +1 -0
- package/dist/extra/operators.d.cts +910 -0
- package/dist/extra/operators.d.ts +910 -0
- package/dist/extra/operators.js +1 -0
- package/dist/extra/reactive.cjs +1 -0
- package/dist/extra/reactive.d.cts +352 -0
- package/dist/extra/reactive.d.ts +352 -0
- package/dist/extra/reactive.js +1 -0
- package/dist/extra/sources.cjs +1 -2486
- package/dist/extra/sources.d.cts +6 -2
- package/dist/extra/sources.d.ts +6 -2
- package/dist/extra/sources.js +1 -57
- package/dist/extra/storage-browser.cjs +1 -0
- package/dist/extra/storage-browser.d.cts +71 -0
- package/dist/extra/storage-browser.d.ts +71 -0
- package/dist/extra/storage-browser.js +1 -0
- package/dist/extra/storage-core.cjs +1 -0
- package/dist/extra/storage-core.d.cts +98 -0
- package/dist/extra/storage-core.d.ts +98 -0
- package/dist/extra/storage-core.js +1 -0
- package/dist/extra/storage-node.cjs +2 -0
- package/dist/extra/storage-node.d.cts +60 -0
- package/dist/extra/storage-node.d.ts +60 -0
- package/dist/extra/storage-node.js +1 -0
- package/dist/fallback-BaTS7vVY.d.cts +258 -0
- package/dist/fallback-eOm3LNxP.d.ts +258 -0
- package/dist/graph/index.cjs +7 -5030
- package/dist/graph/index.d.cts +6 -5
- package/dist/graph/index.d.ts +6 -5
- package/dist/graph/index.js +1 -50
- package/dist/{graph-DNCrvZSn.d.cts → graph-DgohqXK-.d.cts} +151 -32
- package/dist/{graph-CCwGKLCm.d.ts → graph-Qjg9gWHI.d.ts} +151 -32
- package/dist/{index-BwfLUNw4.d.ts → index-2BVuRCI4.d.ts} +173 -2040
- package/dist/{index-BPVt8kqc.d.ts → index-2NvguqQA.d.ts} +10 -195
- package/dist/index-A65LZhoM.d.ts +186 -0
- package/dist/{index-DlLp-2Xn.d.cts → index-B-8FCEua.d.cts} +10 -195
- package/dist/index-B-gqvYel.d.ts +135 -0
- package/dist/index-B2PRuolf.d.cts +86 -0
- package/dist/index-BJqt9EwW.d.ts +231 -0
- package/dist/{index-BHlKbUwO.d.cts → index-BKjT5DiZ.d.cts} +173 -2040
- package/dist/{index-C0svESO4.d.ts → index-BM8BU4q6.d.ts} +1 -1
- package/dist/{index-VdHQMPy1.d.ts → index-BQaEnxBf.d.ts} +1 -1
- package/dist/index-BSfwiy5B.d.ts +192 -0
- package/dist/index-BTSkeCZs.d.cts +291 -0
- package/dist/index-BUVtw1Ay.d.cts +186 -0
- package/dist/index-BUi57v_p.d.ts +163 -0
- package/dist/{messaging-Gt4LPbyA.d.cts → index-BanNUILp.d.cts} +31 -93
- package/dist/{audit-DRlSzBu9.d.ts → index-BayHDRx6.d.cts} +27 -21
- package/dist/{index-B6D3QNSA.d.ts → index-BiyjsZ0m.d.ts} +148 -20
- package/dist/index-BqZ6vB2A.d.ts +2057 -0
- package/dist/{memory-li6FL5RM.d.ts → index-BuVidq3D.d.cts} +26 -26
- package/dist/index-Byh-xTyp.d.ts +105 -0
- package/dist/index-C08QPDcV.d.cts +321 -0
- package/dist/{demo-shell-BDkOptd6.d.ts → index-C66RJiX8.d.ts} +14 -14
- package/dist/index-C8RfjffH.d.ts +291 -0
- package/dist/index-CA1Cu7Ud.d.ts +873 -0
- package/dist/{index-ByQxazQJ.d.cts → index-CABbltIu.d.cts} +1 -1
- package/dist/{index-VHqptjhu.d.cts → index-CHEBsnYv.d.cts} +1 -1
- package/dist/{index-BuEoe-Qu.d.ts → index-CI0yDnLp.d.ts} +9 -9
- package/dist/{index-B9B7_HEY.d.ts → index-CJ45TW-h.d.ts} +1 -1
- package/dist/{index-CO8uBlUh.d.cts → index-CJZKZoo4.d.cts} +148 -20
- package/dist/{index-wEn0eFe8.d.ts → index-CX2tFJL1.d.ts} +1 -1
- package/dist/{index-BaSM3aYt.d.ts → index-CcWOJ6F0.d.ts} +3 -3
- package/dist/{audit-ClmqGOCx.d.cts → index-CiaVoZGo.d.ts} +27 -21
- package/dist/{index-Dzk2hrlR.d.ts → index-Ct5CWc4E.d.ts} +1 -1
- package/dist/index-D38duMCv.d.cts +357 -0
- package/dist/{index-C8oil6M6.d.ts → index-D5XJ2tSx.d.ts} +30 -6
- package/dist/{index-DO_6JN9Z.d.cts → index-D80do5jX.d.cts} +1 -1
- package/dist/index-D9HKAH_-.d.cts +231 -0
- package/dist/index-DBe_8XW5.d.cts +143 -0
- package/dist/{memory-C6Z2tGpC.d.cts → index-DCeTyFlB.d.ts} +26 -26
- package/dist/index-DDy8eeXS.d.ts +321 -0
- package/dist/index-DJ5oNBc8.d.ts +143 -0
- package/dist/{index-CI3DprxP.d.cts → index-DP0_O3ls.d.cts} +30 -6
- package/dist/{demo-shell-Crid1WdR.d.cts → index-DX8xS-yB.d.cts} +14 -14
- package/dist/index-DiZejfCI.d.cts +2057 -0
- package/dist/index-DknyJ2Fu.d.cts +163 -0
- package/dist/index-DoWMs-Kk.d.cts +135 -0
- package/dist/{messaging-XDoYablx.d.ts → index-DuB5aO4-.d.ts} +31 -93
- package/dist/index-DwjJGKxV.d.ts +357 -0
- package/dist/{index-B6EhDnjH.d.cts → index-H_oxVec5.d.cts} +1 -1
- package/dist/{index-3lsddbbS.d.ts → index-IMAHq-ia.d.ts} +1 -1
- package/dist/{index-B1tloyhO.d.cts → index-U1nir7MX.d.cts} +1 -1
- package/dist/index-Vg7tORgk.d.ts +86 -0
- package/dist/index-dig-r2tQ.d.cts +873 -0
- package/dist/{index-CxFrXH4m.d.ts → index-gsT79Xu9.d.ts} +1 -1
- package/dist/{index-D8wS_PeY.d.cts → index-i99Ka8s7.d.cts} +9 -9
- package/dist/index-iKkyJosF.d.cts +105 -0
- package/dist/{index-Xi3u0HCQ.d.cts → index-jleeotBT.d.cts} +1 -1
- package/dist/{index-DVGiGFGT.d.cts → index-kykKWwV-.d.cts} +3 -3
- package/dist/index-vgcLF5TH.d.cts +192 -0
- package/dist/{index-DYme44FM.d.cts → index-y1RllPn4.d.cts} +1 -1
- package/dist/index.cjs +151 -24142
- package/dist/index.d.cts +69 -2099
- package/dist/index.d.ts +69 -2099
- package/dist/index.js +1 -3868
- package/dist/{meta-CbznRPYJ.d.ts → meta-CX7YsOzp.d.cts} +5 -5
- package/dist/{meta-BxCA7rcr.d.cts → meta-CckhhFRd.d.ts} +5 -5
- package/dist/{node-BmerH3kS.d.cts → node-Dd6wHSib.d.cts} +71 -11
- package/dist/{node-BmerH3kS.d.ts → node-Dd6wHSib.d.ts} +71 -11
- package/dist/{observable-BgGUwcqp.d.ts → observable-BZJgo616.d.ts} +1 -1
- package/dist/{observable-DJt_AxzQ.d.cts → observable-kwzpLvbi.d.cts} +1 -1
- package/dist/patterns/ai/browser.cjs +25 -0
- package/dist/patterns/ai/browser.d.cts +127 -0
- package/dist/patterns/ai/browser.d.ts +127 -0
- package/dist/patterns/ai/browser.js +3 -0
- package/dist/patterns/ai/index.cjs +92 -0
- package/dist/patterns/ai/index.d.cts +17 -0
- package/dist/patterns/ai/index.d.ts +17 -0
- package/dist/patterns/ai/index.js +1 -0
- package/dist/patterns/ai/node.cjs +2 -0
- package/dist/patterns/ai/node.d.cts +58 -0
- package/dist/patterns/ai/node.d.ts +58 -0
- package/dist/patterns/ai/node.js +1 -0
- package/dist/patterns/audit/index.cjs +7 -0
- package/dist/patterns/audit/index.d.cts +6 -0
- package/dist/patterns/audit/index.d.ts +6 -0
- package/dist/patterns/audit/index.js +1 -0
- package/dist/patterns/cqrs/index.cjs +7 -0
- package/dist/patterns/cqrs/index.d.cts +5 -0
- package/dist/patterns/cqrs/index.d.ts +5 -0
- package/dist/patterns/cqrs/index.js +1 -0
- package/dist/patterns/demo-shell/index.cjs +8 -0
- package/dist/patterns/demo-shell/index.d.cts +6 -0
- package/dist/patterns/demo-shell/index.d.ts +6 -0
- package/dist/patterns/demo-shell/index.js +1 -0
- package/dist/patterns/domain-templates/index.cjs +7 -0
- package/dist/patterns/domain-templates/index.d.cts +5 -0
- package/dist/patterns/domain-templates/index.d.ts +5 -0
- package/dist/patterns/domain-templates/index.js +1 -0
- package/dist/patterns/graphspec/index.cjs +84 -0
- package/dist/patterns/graphspec/index.d.cts +7 -0
- package/dist/patterns/graphspec/index.d.ts +7 -0
- package/dist/patterns/graphspec/index.js +1 -0
- package/dist/patterns/guarded-execution/index.cjs +7 -0
- package/dist/patterns/guarded-execution/index.d.cts +7 -0
- package/dist/patterns/guarded-execution/index.d.ts +7 -0
- package/dist/patterns/guarded-execution/index.js +1 -0
- package/dist/patterns/harness/index.cjs +49 -0
- package/dist/patterns/harness/index.d.cts +11 -0
- package/dist/patterns/harness/index.d.ts +11 -0
- package/dist/patterns/harness/index.js +1 -0
- package/dist/patterns/job-queue/index.cjs +7 -0
- package/dist/patterns/job-queue/index.d.cts +5 -0
- package/dist/patterns/job-queue/index.d.ts +5 -0
- package/dist/patterns/job-queue/index.js +1 -0
- package/dist/patterns/lens/index.cjs +7 -0
- package/dist/patterns/lens/index.d.cts +7 -0
- package/dist/patterns/lens/index.d.ts +7 -0
- package/dist/patterns/lens/index.js +1 -0
- package/dist/patterns/memory/index.cjs +7 -0
- package/dist/patterns/memory/index.d.cts +5 -0
- package/dist/patterns/memory/index.d.ts +5 -0
- package/dist/patterns/memory/index.js +1 -0
- package/dist/patterns/messaging/index.cjs +7 -0
- package/dist/patterns/messaging/index.d.cts +5 -0
- package/dist/patterns/messaging/index.d.ts +5 -0
- package/dist/patterns/messaging/index.js +1 -0
- package/dist/patterns/orchestration/index.cjs +7 -0
- package/dist/patterns/orchestration/index.d.cts +6 -0
- package/dist/patterns/orchestration/index.d.ts +6 -0
- package/dist/patterns/orchestration/index.js +1 -0
- package/dist/patterns/reactive-layout/index.cjs +8 -6444
- package/dist/patterns/reactive-layout/index.d.cts +6 -6
- package/dist/patterns/reactive-layout/index.d.ts +6 -6
- package/dist/patterns/reactive-layout/index.js +1 -56
- package/dist/patterns/reduction/index.cjs +7 -0
- package/dist/patterns/reduction/index.d.cts +5 -0
- package/dist/patterns/reduction/index.d.ts +5 -0
- package/dist/patterns/reduction/index.js +1 -0
- package/dist/patterns/refine-loop/index.cjs +9 -0
- package/dist/patterns/refine-loop/index.d.cts +7 -0
- package/dist/patterns/refine-loop/index.d.ts +7 -0
- package/dist/patterns/refine-loop/index.js +1 -0
- package/dist/patterns/resilient-pipeline/index.cjs +1 -0
- package/dist/patterns/resilient-pipeline/index.d.cts +7 -0
- package/dist/patterns/resilient-pipeline/index.d.ts +7 -0
- package/dist/patterns/resilient-pipeline/index.js +1 -0
- package/dist/patterns/surface/index.cjs +15 -0
- package/dist/patterns/surface/index.d.cts +8 -0
- package/dist/patterns/surface/index.d.ts +8 -0
- package/dist/patterns/surface/index.js +1 -0
- package/dist/{reactive-layout-u5Ulnqag.d.ts → reactive-layout-BkBwVvwm.d.ts} +2 -2
- package/dist/{reactive-layout-MQP--J3F.d.cts → reactive-layout-PiFwVaWS.d.cts} +2 -2
- package/dist/reactive-log-1QTyx10a.d.ts +190 -0
- package/dist/reactive-log-BiVoSxke.d.cts +190 -0
- package/dist/{composite-aUCvjZVR.d.ts → reactive-map-CwO_COHy.d.cts} +2 -67
- package/dist/{composite-C7PcQvcs.d.cts → reactive-map-FeuTVAJb.d.ts} +2 -67
- package/dist/resilience-CBfYJW5C.d.ts +493 -0
- package/dist/resilience-XRUF267O.js +1 -0
- package/dist/resilience-uBz4yvYB.d.cts +493 -0
- package/dist/{sugar-CCOxXK1e.d.ts → sugar-CY-MCfZ9.d.ts} +17 -15
- package/dist/{sugar-D02n5JjF.d.cts → sugar-DHttV0LX.d.cts} +17 -15
- package/dist/topology-tree-CVjt2gp7.d.cts +25 -0
- package/dist/topology-tree-one6oSKY.d.ts +25 -0
- package/dist/types-O3GzJY2U.d.cts +401 -0
- package/dist/types-u64Ose53.d.ts +401 -0
- package/package.json +252 -22
- package/dist/ai-CaR_912Q.d.cts +0 -1033
- package/dist/ai-WlRltJV7.d.ts +0 -1033
- package/dist/chunk-3ZWCKRHX.js +0 -117
- package/dist/chunk-3ZWCKRHX.js.map +0 -1
- package/dist/chunk-7TAQJHQV.js +0 -103
- package/dist/chunk-7TAQJHQV.js.map +0 -1
- package/dist/chunk-APFNLIRG.js +0 -62
- package/dist/chunk-APFNLIRG.js.map +0 -1
- package/dist/chunk-AT5LKYNL.js +0 -395
- package/dist/chunk-AT5LKYNL.js.map +0 -1
- package/dist/chunk-BQ6RQQFF.js +0 -5087
- package/dist/chunk-BQ6RQQFF.js.map +0 -1
- package/dist/chunk-BVZYTZ5H.js +0 -599
- package/dist/chunk-BVZYTZ5H.js.map +0 -1
- package/dist/chunk-DST5DKZS.js +0 -1371
- package/dist/chunk-DST5DKZS.js.map +0 -1
- package/dist/chunk-GTE6PWRZ.js +0 -866
- package/dist/chunk-GTE6PWRZ.js.map +0 -1
- package/dist/chunk-HXZEYDUR.js +0 -94
- package/dist/chunk-HXZEYDUR.js.map +0 -1
- package/dist/chunk-J22W6HV3.js +0 -107
- package/dist/chunk-J22W6HV3.js.map +0 -1
- package/dist/chunk-J2VBW3DZ.js +0 -302
- package/dist/chunk-J2VBW3DZ.js.map +0 -1
- package/dist/chunk-JSCT3CR4.js +0 -38
- package/dist/chunk-JSCT3CR4.js.map +0 -1
- package/dist/chunk-JWBCY4NC.js +0 -330
- package/dist/chunk-JWBCY4NC.js.map +0 -1
- package/dist/chunk-K2AUJHVP.js +0 -2251
- package/dist/chunk-K2AUJHVP.js.map +0 -1
- package/dist/chunk-MJ2NKQQL.js +0 -119
- package/dist/chunk-MJ2NKQQL.js.map +0 -1
- package/dist/chunk-N6UR7YVY.js +0 -198
- package/dist/chunk-N6UR7YVY.js.map +0 -1
- package/dist/chunk-NC6S43JJ.js +0 -456
- package/dist/chunk-NC6S43JJ.js.map +0 -1
- package/dist/chunk-OFVJBJXR.js +0 -98
- package/dist/chunk-OFVJBJXR.js.map +0 -1
- package/dist/chunk-OHISZPOJ.js +0 -97
- package/dist/chunk-OHISZPOJ.js.map +0 -1
- package/dist/chunk-OU5CQKNW.js +0 -102
- package/dist/chunk-OU5CQKNW.js.map +0 -1
- package/dist/chunk-PF7GRZMW.js +0 -2712
- package/dist/chunk-PF7GRZMW.js.map +0 -1
- package/dist/chunk-PHOUUNK7.js +0 -2291
- package/dist/chunk-PHOUUNK7.js.map +0 -1
- package/dist/chunk-RNHBMHKA.js +0 -1665
- package/dist/chunk-RNHBMHKA.js.map +0 -1
- package/dist/chunk-SX52TAR4.js +0 -110
- package/dist/chunk-SX52TAR4.js.map +0 -1
- package/dist/chunk-VYPWMZ6H.js +0 -98
- package/dist/chunk-VYPWMZ6H.js.map +0 -1
- package/dist/chunk-WBZOVTYK.js +0 -171
- package/dist/chunk-WBZOVTYK.js.map +0 -1
- package/dist/chunk-WKNUIZOY.js +0 -354
- package/dist/chunk-WKNUIZOY.js.map +0 -1
- package/dist/chunk-X3VMZYBT.js +0 -713
- package/dist/chunk-X3VMZYBT.js.map +0 -1
- package/dist/chunk-X5R3GL6H.js +0 -525
- package/dist/chunk-X5R3GL6H.js.map +0 -1
- package/dist/chunk-XGPU467M.js +0 -136
- package/dist/chunk-XGPU467M.js.map +0 -1
- package/dist/compat/index.cjs.map +0 -1
- package/dist/compat/index.js.map +0 -1
- package/dist/compat/jotai/index.cjs.map +0 -1
- package/dist/compat/jotai/index.js.map +0 -1
- package/dist/compat/nanostores/index.cjs.map +0 -1
- package/dist/compat/nanostores/index.js.map +0 -1
- package/dist/compat/nestjs/index.cjs.map +0 -1
- package/dist/compat/nestjs/index.js.map +0 -1
- package/dist/compat/react/index.cjs.map +0 -1
- package/dist/compat/react/index.js.map +0 -1
- package/dist/compat/solid/index.cjs.map +0 -1
- package/dist/compat/solid/index.js.map +0 -1
- package/dist/compat/svelte/index.cjs.map +0 -1
- package/dist/compat/svelte/index.js.map +0 -1
- package/dist/compat/vue/index.cjs.map +0 -1
- package/dist/compat/vue/index.js.map +0 -1
- package/dist/compat/zustand/index.cjs.map +0 -1
- package/dist/compat/zustand/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/extra/index.cjs.map +0 -1
- package/dist/extra/index.js.map +0 -1
- package/dist/extra/sources.cjs.map +0 -1
- package/dist/extra/sources.js.map +0 -1
- package/dist/graph/index.cjs.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/patterns/ai.cjs +0 -7930
- package/dist/patterns/ai.cjs.map +0 -1
- package/dist/patterns/ai.d.cts +0 -10
- package/dist/patterns/ai.d.ts +0 -10
- package/dist/patterns/ai.js +0 -71
- package/dist/patterns/ai.js.map +0 -1
- package/dist/patterns/audit.cjs +0 -5805
- package/dist/patterns/audit.cjs.map +0 -1
- package/dist/patterns/audit.d.cts +0 -6
- package/dist/patterns/audit.d.ts +0 -6
- package/dist/patterns/audit.js +0 -29
- package/dist/patterns/audit.js.map +0 -1
- package/dist/patterns/demo-shell.cjs +0 -5604
- package/dist/patterns/demo-shell.cjs.map +0 -1
- package/dist/patterns/demo-shell.d.cts +0 -6
- package/dist/patterns/demo-shell.d.ts +0 -6
- package/dist/patterns/demo-shell.js +0 -15
- package/dist/patterns/demo-shell.js.map +0 -1
- package/dist/patterns/memory.cjs +0 -5283
- package/dist/patterns/memory.cjs.map +0 -1
- package/dist/patterns/memory.d.cts +0 -5
- package/dist/patterns/memory.d.ts +0 -5
- package/dist/patterns/memory.js +0 -20
- package/dist/patterns/memory.js.map +0 -1
- package/dist/patterns/reactive-layout/index.cjs.map +0 -1
- package/dist/patterns/reactive-layout/index.js.map +0 -1
- package/dist/storage-CMjUUuxn.d.ts +0 -190
- package/dist/storage-DdWlZo6U.d.cts +0 -190
package/dist/index.d.ts
CHANGED
|
@@ -1,2120 +1,90 @@
|
|
|
1
|
-
export { i as compat, a as signals } from './index-
|
|
2
|
-
export { b as batch, i as core, d as downWithBatch, a as isBatching, m as monotonicNs, w as wallClockNs } from './index-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { d as
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
import { i as index$
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export { A as
|
|
25
|
-
export {
|
|
26
|
-
export { T as
|
|
27
|
-
export { i as
|
|
28
|
-
export { i as
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
1
|
+
export { i as compat, a as signals } from './index-CI0yDnLp.js';
|
|
2
|
+
export { b as batch, i as core, d as downWithBatch, a as isBatching, m as monotonicNs, w as wallClockNs } from './index-CcWOJ6F0.js';
|
|
3
|
+
export { A as AckableMessage, a as AdapterHandlers, B as BatchMessage, b as BridgeMessage, c as BufferedSinkHandle, d as BundleTriad, C as CSVRow, e as CacheEvictionPolicy, f as CascadingCache, g as CascadingCacheOptions, h as CheckpointToRedisOptions, i as CheckpointToS3Options, j as ClickHouseClientLike, k as ClickHouseInsertClientLike, l as ClickHouseRow, m as CronSchedule, D as DrizzleQueryLike, E as EmitTriad, n as ErrorMessage, o as ExternalBundleOptions, p as ExternalRegister, F as FileWriterLike, q as FromCSVOptions, r as FromClickHouseWatchOptions, s as FromDrizzleOptions, t as FromHTTPOptions, u as FromHTTPPollOptions, v as FromHTTPStreamOptions, w as FromKafkaOptions, x as FromKyselyOptions, y as FromMCPOptions, z as FromNATSOptions, G as FromNDJSONOptions, H as FromOTelOptions, I as FromPrismaOptions, J as FromPrometheusOptions, K as FromPulsarOptions, L as FromRabbitMQOptions, M as FromRedisStreamOptions, N as FromSSEOptions, O as FromSqliteOptions, P as FromStatsDOptions, Q as FromSyslogOptions, R as FromWebSocketReconnectOptions, S as HTTPBundle, T as InitMessage, U as KafkaConsumerLike, V as KafkaMessage, W as KafkaProducerLike, X as KyselyQueryLike, Y as LokiClientLike, Z as LokiStream, _ as MCPClientLike, $ as MongoCollectionLike, a0 as NATSClientLike, a1 as NATSMessage, a2 as NATSSubscriptionLike, a3 as NativePubSubBackend, a4 as OTelBundle, a5 as OTelLog, a6 as OTelMetric, a7 as OTelRegister, a8 as OTelSpan, a9 as PostgresClientLike, aa as PrismaModelLike, ab as PrometheusMetric, ac as PubSubBackend, ad as PubSubHub, ae as PubSubHubOptions, af as PulsarConsumerLike, ag as PulsarMessage, ah as PulsarProducerLike, ai as RabbitMQChannelLike, aj as RabbitMQMessage, ak as ReactiveSinkBackpressureOptions, al as ReactiveSinkConfig, am as ReactiveSinkHandle, an as ReactiveSinkOptions, ao as ReactiveSinkRetryOptions, ap as ReadyMessage, aq as RedisCheckpointClientLike, ar as RedisClientLike, as as RedisStreamEntry, at as ResettableTimer, au as S3ClientLike, av as SSEEvent, aw as SignalMessage, ax as SingleFromAnyOptions, ay as SinkFailure, az as SinkHandle, aA as SinkTransportError, aB as SqliteDbLike, aC as SqliteIterableDbLike, aD as StatsDMetric, aE as StatsDRegister, aF as StratifyOptions, aG as StratifyRule, aH as SyslogMessage, aI as SyslogRegister, aJ as TempoClientLike, aK as ToCSVOptions, aL as ToClickHouseOptions, aM as ToFileOptions, aN as ToHTTPOptions, aO as ToKafkaOptions, aP as ToLokiOptions, aQ as ToMongoOptions, aR as ToNATSOptions, aS as ToPostgresOptions, aT as ToPulsarOptions, aU as ToRabbitMQOptions, aV as ToRedisStreamOptions, aW as ToS3Options, aX as ToSSEOptions, aY as ToSqliteOptions, aZ as ToTempoOptions, a_ as ToWebSocketOptions, a$ as ValueMessage, b0 as WatermarkController, b1 as WatermarkOptions, b2 as WebSocketLike, b3 as WebSocketMessageEventLike, b4 as WebSocketRegister, b5 as WebhookRegister, b6 as WorkerBridge, b7 as WorkerBridgeOptions, b8 as WorkerSelfHandle, b9 as WorkerSelfOptions, ba as WorkerTransport, bb as cascadingCache, bc as checkpointToRedis, bd as checkpointToS3, be as createTransport, bf as createWatermarkController, bg as csvRows, bh as deserializeError, bi as externalBundle, bj as externalProducer, bk as extra, bl as fromCSV, bm as fromClickHouseWatch, bn as fromDrizzle, bo as fromHTTP, bp as fromHTTPPoll, bq as fromHTTPStream, br as fromKafka, bs as fromKysely, bt as fromMCP, bu as fromNATS, bv as fromNDJSON, bw as fromOTel, bx as fromPrisma, by as fromPrometheus, bz as fromPulsar, bA as fromRabbitMQ, bB as fromRedisStream, bC as fromSSE, bD as fromSqlite, bE as fromSqliteCursor, bF as fromStatsD, bG as fromSyslog, bH as fromWebSocket, bI as fromWebSocketReconnect, bJ as fromWebhook, bK as lru, bL as matchesCron, bM as nameToSignal, bN as ndjsonRows, bO as parseCron, bP as parsePrometheusText, bQ as parseStatsD, bR as parseSyslog, bS as pubsub, bT as reactiveSink, bU as serializeError, bV as signalToName, bW as singleFromAny, bX as singleNodeFromAny, bY as stratify, bZ as toCSV, b_ as toClickHouse, b$ as toFile, c0 as toHTTP, c1 as toKafka, c2 as toLoki, c3 as toMongo, c4 as toNATS, c5 as toPostgres, c6 as toPulsar, c7 as toRabbitMQ, c8 as toReadableStream, c9 as toRedisStream, ca as toS3, cb as toSSE, cc as toSSEBytes, cd as toSqlite, ce as toTempo, cf as toWebSocket, cg as workerBridge, ch as workerSelf } from './index-2BVuRCI4.js';
|
|
4
|
+
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as ObservabilityCheck, c as ObservabilityDescribeFormat, d as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, V as ValidateObservabilityOptions, e as ValidateObservabilityResult, W as WALEntry, f as createDagCborCodec, g as createDagCborZstdCodec, h as decodeEnvelope, i as encodeEnvelope, j as graph, r as registerBuiltinCodecs, k as replayWAL, s as sizeof, v as validateGraphObservability } from './index-BiyjsZ0m.js';
|
|
5
|
+
export { C as ChatMessage, L as LLMAdapter, a as LLMInvokeOptions, b as LLMResponse, S as StreamDelta, T as TokenUsage, c as ToolCall, d as ToolDefinition } from './types-u64Ose53.js';
|
|
6
|
+
import { i as index$2 } from './index-BqZ6vB2A.js';
|
|
7
|
+
import { i as index$1 } from './index-CiaVoZGo.js';
|
|
8
|
+
import { i as index$3 } from './index-BSfwiy5B.js';
|
|
9
|
+
import { i as index$4 } from './index-C66RJiX8.js';
|
|
10
|
+
import { i as index$5 } from './index-BJqt9EwW.js';
|
|
11
|
+
import { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory, i as index$6 } from './index-DDy8eeXS.js';
|
|
12
|
+
import { i as index$7 } from './index-B-gqvYel.js';
|
|
13
|
+
import { i as index$8 } from './index-CA1Cu7Ud.js';
|
|
14
|
+
import { i as index$9 } from './index-Vg7tORgk.js';
|
|
15
|
+
import { i as index$b } from './index-BUi57v_p.js';
|
|
16
|
+
import { i as index$c } from './index-DCeTyFlB.js';
|
|
17
|
+
import { i as index$d } from './index-DuB5aO4-.js';
|
|
18
|
+
import { i as index$e } from './index-DJ5oNBc8.js';
|
|
19
|
+
import { i as index$a } from './index-D5XJ2tSx.js';
|
|
20
|
+
import { i as index$f } from './index-A65LZhoM.js';
|
|
21
|
+
import { i as index$g } from './index-DwjJGKxV.js';
|
|
22
|
+
import { i as index$h } from './index-Byh-xTyp.js';
|
|
23
|
+
import { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot, k as index$i } from './index-C8RfjffH.js';
|
|
24
|
+
export { A as Actor, C as COMPLETE, f as COMPLETE_MSG, g as COMPLETE_ONLY_BATCH, D as DATA, h as DEFAULT_ACTOR, i as DIRTY, j as DIRTY_MSG, k as DIRTY_ONLY_BATCH, l as DepRecord, E as ERROR, F as FnCtx, m as GlobalInspectorEvent, n as GlobalInspectorHook, o as GraphReFlyConfig, G as GuardAction, p as GuardDenied, q as GuardDeniedDetails, H as HashFn, I as INVALIDATE, r as INVALIDATE_MSG, s as INVALIDATE_ONLY_BATCH, M as Message, t as MessageContext, u as MessageTypeRegistration, v as MessageTypeRegistrationInput, b as Messages, a as Node, c as NodeActions, w as NodeCtx, e as NodeDescribeKind, x as NodeFn, d as NodeFnCleanup, y as NodeGuard, z as NodeImpl, B as NodeInspectorHook, J as NodeInspectorHookEvent, N as NodeOptions, K as NodeSink, L as NodeStatus, O as NodeTransportOptions, Q as NodeVersionInfo, R as OnMessageHandler, S as OnSubscribeHandler, T as PAUSE, U as PolicyAllow, W as PolicyDeny, P as PolicyRuleData, X as RESOLVED, Y as RESOLVED_MSG, Z as RESOLVED_ONLY_BATCH, _ as RESUME, $ as START, a0 as START_MSG, a1 as SubscribeContext, a2 as TEARDOWN, a3 as TEARDOWN_MSG, a4 as TEARDOWN_ONLY_BATCH, a5 as V0, a6 as V1, V as VersioningLevel, a7 as VersioningOptions, a8 as accessHintForGuard, a9 as advanceVersion, aa as configure, ab as createVersioning, ac as defaultConfig, ad as defaultHash, ae as isV1, af as node, ag as normalizeActor, ah as policy, ai as policyFromRules, aj as registerBuiltins } from './node-Dd6wHSib.js';
|
|
25
|
+
export { AsyncSourceOpts, EventTargetLike, FromCronOptions, NodeInput, ReactiveCounterBundle, awaitSettled, cached, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './extra/sources.js';
|
|
26
|
+
export { A as AutoTrackOptions, D as DerivedFn, a as DynamicFn, E as EffectFn, P as PipeOperator, b as ProducerFn, T as TrackFn, c as autoTrackNode, d as derived, e as dynamicNode, f as effect, p as pipe, g as producer, s as state } from './sugar-CY-MCfZ9.js';
|
|
27
|
+
export { B as BackoffPreset, d as BackoffStrategy, e as CircuitBreaker, a as CircuitBreakerOptions, f as CircuitOpenError, C as CircuitState, E as ExponentialBackoffOptions, F as FallbackInput, J as JitterMode, N as NS_PER_MS, c as NS_PER_SEC, R as RateLimiterOptions, g as RateLimiterOverflowError, h as RateLimiterOverflowPolicy, b as RetryOptions, i as RetrySourceOptions, S as StatusValue, T as TimeoutError, j as TokenBucket, W as WithBreakerBundle, k as WithStatusBundle, l as circuitBreaker, m as constant, n as decorrelatedJitter, o as exponential, p as fallback, q as fibonacci, r as linear, s as rateLimiter, t as resolveBackoffPreset, u as retry, v as retrySource, w as timeout, x as tokenBucket, y as withBreaker, z as withMaxAttempts, A as withStatus } from './resilience-CBfYJW5C.js';
|
|
28
|
+
export { C as CausalChain, e as CausalStep, D as DescribeFilter, E as ExplainPathOptions, f as GRAPH_META_SEGMENT, G as Graph, g as GraphActorOptions, h as GraphAttachStorageOptions, i as GraphCheckpointRecord, b as GraphDescribeOptions, c as GraphDescribeOutput, j as GraphDiagramDirection, k as GraphDiagramOptions, l as GraphDiffChange, m as GraphDiffResult, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, d as GraphPersistSnapshot, r as GraphProfileOptions, s as GraphProfileResult, t as GraphVersionChange, u as GraphWALDiff, N as NodeProfile, O as ObserveDetail, v as ObserveEvent, w as ObserveOptions, x as ObserveResult, y as ObserveTheme, z as ObserveThemeName, R as ReachableDirection, A as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, B as TraceEntry, F as diffForWAL, H as explainPath, I as graphProfile, J as mermaidLiveUrl, K as reachable } from './graph-Qjg9gWHI.js';
|
|
29
|
+
export { D as DescribeDetail, a as DescribeField, b as DescribeNodeOutput, r as resolveDescribeFields } from './meta-CckhhFRd.js';
|
|
30
|
+
export { D as DistillBundle, a as DistillOptions, E as Extraction, V as VerifiableBundle, b as VerifiableOptions, c as VerifyValue, d as distill, v as verifiable } from './composite-BL-llbnE.js';
|
|
31
|
+
export { IndexBackend, IndexRow, ListBackend, NativeIndexBackend, NativeListBackend, ReactiveIndexBundle, ReactiveIndexOptions, ReactiveListBundle, ReactiveListOptions, UpsertOptions, reactiveIndex, reactiveList } from './extra/reactive.js';
|
|
32
|
+
export { L as LogBackend, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, r as reactiveLog } from './reactive-log-1QTyx10a.js';
|
|
33
|
+
export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, r as reactiveMap } from './reactive-map-FeuTVAJb.js';
|
|
34
|
+
export { MergeMapOptions, TapObserver, ThrottleOptions, audit, buffer, bufferCount, bufferTime, catchError, combine, combineLatest, concat, concatMap, debounce, debounceTime, delay, distinctUntilChanged, elementAt, exhaustMap, filter, find, first, flatMap, interval, last, map, merge, mergeMap, pairwise, pausable, race, reduce, repeat, rescue, sample, scan, skip, switchMap, take, takeUntil, takeWhile, tap, throttle, throttleTime, valve, window, windowCount, windowTime, withLatestFrom, zip } from './extra/operators.js';
|
|
35
|
+
export { StorageHandle, StorageTier, dictStorage, memoryStorage, sortJsonValue, stableJsonString } from './extra/storage-core.js';
|
|
36
|
+
export { T as ToObservableOptions, t as toObservable } from './observable-BZJgo616.js';
|
|
37
|
+
export { i as jotai } from './index-IMAHq-ia.js';
|
|
38
|
+
export { i as nanostores } from './index-BM8BU4q6.js';
|
|
39
|
+
export { i as nestjs } from './index-2NvguqQA.js';
|
|
40
|
+
export { i as react } from './index-Ct5CWc4E.js';
|
|
41
|
+
export { i as solid } from './index-BQaEnxBf.js';
|
|
42
|
+
export { i as svelte } from './index-gsT79Xu9.js';
|
|
43
|
+
export { i as vue } from './index-CX2tFJL1.js';
|
|
44
|
+
export { w as watchTopologyTree } from './topology-tree-one6oSKY.js';
|
|
45
|
+
export { i as zustand } from './index-CJ45TW-h.js';
|
|
46
|
+
import './cascading-Bp99ckMJ.js';
|
|
47
|
+
import './fallback-eOm3LNxP.js';
|
|
48
|
+
import './reactive-layout-BkBwVvwm.js';
|
|
49
|
+
import 'rxjs';
|
|
34
50
|
import '@nestjs/common';
|
|
35
51
|
import '@nestjs/core';
|
|
36
|
-
import './reactive-layout-u5Ulnqag.js';
|
|
37
|
-
import 'rxjs';
|
|
38
52
|
import 'vue';
|
|
39
53
|
|
|
40
|
-
/**
|
|
41
|
-
* Domain templates (roadmap §8.2).
|
|
42
|
-
*
|
|
43
|
-
* Opinionated Graph factories for common "info → action" domains.
|
|
44
|
-
* Each template wires up §8.1 reduction primitives (stratify, funnel, feedback,
|
|
45
|
-
* budgetGate, scorer) with domain-specific stages. Users fork/extend by
|
|
46
|
-
* accessing named nodes and swapping stages.
|
|
47
|
-
*
|
|
48
|
-
* **Source injection (option B):** templates accept a `source` node, not a
|
|
49
|
-
* hardcoded adapter. Pass `fromOTel(...)`, `fromGitHook(...)`, or a test
|
|
50
|
-
* `state()` — the topology is the same.
|
|
51
|
-
*
|
|
52
|
-
* @module
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
/** Stratification branch config for observability signals. */
|
|
56
|
-
type ObservabilityBranch = {
|
|
57
|
-
name: string;
|
|
58
|
-
classify: (value: unknown) => boolean;
|
|
59
|
-
};
|
|
60
|
-
/** Options for {@link observabilityGraph}. */
|
|
61
|
-
type ObservabilityGraphOptions = GraphOptions & {
|
|
62
|
-
/** Ingested signal source (e.g. fromOTel(...) or test state). */
|
|
63
|
-
source: Node<unknown>;
|
|
64
|
-
/**
|
|
65
|
-
* Classification rules for signal stratification.
|
|
66
|
-
* Default: errors / traces / metrics branches.
|
|
67
|
-
*/
|
|
68
|
-
branches?: ObservabilityBranch[];
|
|
69
|
-
/**
|
|
70
|
-
* Correlation function: receives stratified branch values and produces
|
|
71
|
-
* correlated insights. Default: identity pass-through.
|
|
72
|
-
*/
|
|
73
|
-
correlate?: (values: unknown[]) => unknown;
|
|
74
|
-
/**
|
|
75
|
-
* SLO verification function: returns a verification result for a
|
|
76
|
-
* correlated insight. Default: always passes.
|
|
77
|
-
*/
|
|
78
|
-
sloCheck?: (value: unknown) => unknown;
|
|
79
|
-
/**
|
|
80
|
-
* Scorer weights for alert prioritization. One per branch.
|
|
81
|
-
* Default: equal weights [1, 1, 1].
|
|
82
|
-
*/
|
|
83
|
-
weights?: number[];
|
|
84
|
-
/** Max feedback iterations for false-positive learning. Default: 5. */
|
|
85
|
-
maxFeedbackIterations?: number;
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* OTel ingest → stratified reduction → correlation → SLO verification →
|
|
89
|
-
* alert prioritization → output.
|
|
90
|
-
*
|
|
91
|
-
* Well-known node names:
|
|
92
|
-
* - `"source"` — injected signal source
|
|
93
|
-
* - `"stratify::branch/<name>"` — per-branch classification
|
|
94
|
-
* - `"correlate"` — cross-branch correlation
|
|
95
|
-
* - `"slo_value"`, `"slo_verified"` — SLO verification pair
|
|
96
|
-
* - `"alerts"` — scored, prioritized output
|
|
97
|
-
* - `"output"` — final output (alias for alerts)
|
|
98
|
-
*
|
|
99
|
-
* @category patterns
|
|
100
|
-
*/
|
|
101
|
-
declare function observabilityGraph(name: string, opts: ObservabilityGraphOptions): Graph;
|
|
102
|
-
/** A structured issue extracted from raw findings. */
|
|
103
|
-
type ExtractedIssue = {
|
|
104
|
-
id: string;
|
|
105
|
-
title: string;
|
|
106
|
-
severity: number;
|
|
107
|
-
source: string;
|
|
108
|
-
raw: unknown;
|
|
109
|
-
};
|
|
110
|
-
/** Options for {@link issueTrackerGraph}. */
|
|
111
|
-
type IssueTrackerGraphOptions = GraphOptions & {
|
|
112
|
-
/** Findings source (e.g. fromGitHook(...), fromFSWatch(...)). */
|
|
113
|
-
source: Node<unknown>;
|
|
114
|
-
/**
|
|
115
|
-
* Extract structured issues from raw findings.
|
|
116
|
-
* Default: wraps raw value as a single issue.
|
|
117
|
-
*/
|
|
118
|
-
extract?: (raw: unknown) => ExtractedIssue;
|
|
119
|
-
/**
|
|
120
|
-
* Verify an extracted issue (assertion check).
|
|
121
|
-
* Default: always valid.
|
|
122
|
-
*/
|
|
123
|
-
verify?: (issue: ExtractedIssue) => unknown;
|
|
124
|
-
/**
|
|
125
|
-
* Detect regression by comparing against known patterns.
|
|
126
|
-
* Receives (current issue, known patterns).
|
|
127
|
-
* Default: no regression detected.
|
|
128
|
-
*/
|
|
129
|
-
detectRegression?: (issue: ExtractedIssue, known: unknown) => unknown;
|
|
130
|
-
/** Max feedback iterations for re-scanning. Default: 3. */
|
|
131
|
-
maxFeedbackIterations?: number;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Findings ingest → extraction → verification → regression detection →
|
|
135
|
-
* distillation → prioritized queue.
|
|
136
|
-
*
|
|
137
|
-
* Well-known node names:
|
|
138
|
-
* - `"source"` — injected findings source
|
|
139
|
-
* - `"extract"` — structured issue extraction
|
|
140
|
-
* - `"verify"` — issue verification
|
|
141
|
-
* - `"known_patterns"` — accumulated known issue patterns (state)
|
|
142
|
-
* - `"regression"` — regression detection
|
|
143
|
-
* - `"priority"` — severity-based prioritization
|
|
144
|
-
* - `"output"` — final prioritized output
|
|
145
|
-
*
|
|
146
|
-
* @category patterns
|
|
147
|
-
*/
|
|
148
|
-
declare function issueTrackerGraph(name: string, opts: IssueTrackerGraphOptions): Graph;
|
|
149
|
-
/** Classification result from LLM moderation. */
|
|
150
|
-
type ModerationResult = {
|
|
151
|
-
label: "safe" | "review" | "block";
|
|
152
|
-
confidence: number;
|
|
153
|
-
reason?: string;
|
|
154
|
-
original: unknown;
|
|
155
|
-
};
|
|
156
|
-
/** Options for {@link contentModerationGraph}. */
|
|
157
|
-
type ContentModerationGraphOptions = GraphOptions & {
|
|
158
|
-
/** Content source (text/multimedia ingest). */
|
|
159
|
-
source: Node<unknown>;
|
|
160
|
-
/**
|
|
161
|
-
* Classification function: returns a ModerationResult.
|
|
162
|
-
* Default: labels everything "review" with confidence 0.5.
|
|
163
|
-
*/
|
|
164
|
-
classify?: (content: unknown) => ModerationResult;
|
|
165
|
-
/** System prompt for LLM classification. */
|
|
166
|
-
systemPrompt?: string;
|
|
167
|
-
/** Scorer weights: [safe, review, block]. Default: [0.1, 1, 2]. */
|
|
168
|
-
weights?: [number, number, number];
|
|
169
|
-
/** Max feedback iterations for policy refinement. Default: 5. */
|
|
170
|
-
maxFeedbackIterations?: number;
|
|
171
|
-
/** Max review queue size. When set, oldest entries are trimmed on overflow. */
|
|
172
|
-
maxQueueSize?: number;
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* Content ingest → LLM/rule classification → stratified routing (safe/review/block) →
|
|
176
|
-
* human review queue → scorer → feedback (false positives → policy refinement) → output.
|
|
177
|
-
*
|
|
178
|
-
* Well-known node names:
|
|
179
|
-
* - `"source"` — content ingest
|
|
180
|
-
* - `"classify"` — LLM or rule-based classification
|
|
181
|
-
* - `"stratify::branch/safe"`, `"stratify::branch/review"`, `"stratify::branch/block"` — routed branches
|
|
182
|
-
* - `"review_queue"` — state node for human review items
|
|
183
|
-
* - `"priority"` — scored priority output
|
|
184
|
-
* - `"policy"` — writable state for policy refinement
|
|
185
|
-
* - `"output"` — final moderation output
|
|
186
|
-
*
|
|
187
|
-
* @category patterns
|
|
188
|
-
*/
|
|
189
|
-
declare function contentModerationGraph(name: string, opts: ContentModerationGraphOptions): Graph;
|
|
190
|
-
/** Schema validation result. */
|
|
191
|
-
type ValidationResult = {
|
|
192
|
-
valid: boolean;
|
|
193
|
-
errors: string[];
|
|
194
|
-
record: unknown;
|
|
195
|
-
};
|
|
196
|
-
/** Anomaly detection result. */
|
|
197
|
-
type AnomalyResult = {
|
|
198
|
-
anomaly: boolean;
|
|
199
|
-
score: number;
|
|
200
|
-
detail?: string;
|
|
201
|
-
record: unknown;
|
|
202
|
-
};
|
|
203
|
-
/** Options for {@link dataQualityGraph}. */
|
|
204
|
-
type DataQualityGraphOptions = GraphOptions & {
|
|
205
|
-
/** Data source (e.g. fromPrisma(...), fromKysely(...)). */
|
|
206
|
-
source: Node<unknown>;
|
|
207
|
-
/**
|
|
208
|
-
* Schema validation function.
|
|
209
|
-
* Default: always valid.
|
|
210
|
-
*/
|
|
211
|
-
validate?: (record: unknown) => ValidationResult;
|
|
212
|
-
/**
|
|
213
|
-
* Anomaly detection function.
|
|
214
|
-
* Default: no anomaly.
|
|
215
|
-
*/
|
|
216
|
-
detectAnomaly?: (record: unknown) => AnomalyResult;
|
|
217
|
-
/**
|
|
218
|
-
* Drift detection: compares current record against baseline.
|
|
219
|
-
* Default: no drift.
|
|
220
|
-
*/
|
|
221
|
-
detectDrift?: (record: unknown, baseline: unknown) => unknown;
|
|
222
|
-
/**
|
|
223
|
-
* Remediation suggestion function.
|
|
224
|
-
* Default: no suggestion.
|
|
225
|
-
*/
|
|
226
|
-
suggest?: (result: {
|
|
227
|
-
validation: ValidationResult;
|
|
228
|
-
anomaly: AnomalyResult;
|
|
229
|
-
}) => unknown;
|
|
230
|
-
/** Max feedback iterations for rule refinement. Default: 3. */
|
|
231
|
-
maxFeedbackIterations?: number;
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Data ingest → schema validation → anomaly detection → drift alerting →
|
|
235
|
-
* auto-remediation suggestions → output.
|
|
236
|
-
*
|
|
237
|
-
* Well-known node names:
|
|
238
|
-
* - `"source"` — data ingest
|
|
239
|
-
* - `"validate"` — schema validation
|
|
240
|
-
* - `"anomaly"` — anomaly detection
|
|
241
|
-
* - `"baseline"` — rolling baseline state
|
|
242
|
-
* - `"drift"` — drift detection
|
|
243
|
-
* - `"remediate"` — auto-remediation suggestions
|
|
244
|
-
* - `"output"` — combined quality report
|
|
245
|
-
*
|
|
246
|
-
* @category patterns
|
|
247
|
-
*/
|
|
248
|
-
declare function dataQualityGraph(name: string, opts: DataQualityGraphOptions): Graph;
|
|
249
|
-
|
|
250
|
-
type domainTemplates_AnomalyResult = AnomalyResult;
|
|
251
|
-
type domainTemplates_ContentModerationGraphOptions = ContentModerationGraphOptions;
|
|
252
|
-
type domainTemplates_DataQualityGraphOptions = DataQualityGraphOptions;
|
|
253
|
-
type domainTemplates_ExtractedIssue = ExtractedIssue;
|
|
254
|
-
type domainTemplates_IssueTrackerGraphOptions = IssueTrackerGraphOptions;
|
|
255
|
-
type domainTemplates_ModerationResult = ModerationResult;
|
|
256
|
-
type domainTemplates_ObservabilityBranch = ObservabilityBranch;
|
|
257
|
-
type domainTemplates_ObservabilityGraphOptions = ObservabilityGraphOptions;
|
|
258
|
-
type domainTemplates_ValidationResult = ValidationResult;
|
|
259
|
-
declare const domainTemplates_contentModerationGraph: typeof contentModerationGraph;
|
|
260
|
-
declare const domainTemplates_dataQualityGraph: typeof dataQualityGraph;
|
|
261
|
-
declare const domainTemplates_issueTrackerGraph: typeof issueTrackerGraph;
|
|
262
|
-
declare const domainTemplates_observabilityGraph: typeof observabilityGraph;
|
|
263
|
-
declare namespace domainTemplates {
|
|
264
|
-
export { type domainTemplates_AnomalyResult as AnomalyResult, type domainTemplates_ContentModerationGraphOptions as ContentModerationGraphOptions, type domainTemplates_DataQualityGraphOptions as DataQualityGraphOptions, type domainTemplates_ExtractedIssue as ExtractedIssue, type domainTemplates_IssueTrackerGraphOptions as IssueTrackerGraphOptions, type domainTemplates_ModerationResult as ModerationResult, type domainTemplates_ObservabilityBranch as ObservabilityBranch, type domainTemplates_ObservabilityGraphOptions as ObservabilityGraphOptions, type domainTemplates_ValidationResult as ValidationResult, domainTemplates_contentModerationGraph as contentModerationGraph, domainTemplates_dataQualityGraph as dataQualityGraph, domainTemplates_issueTrackerGraph as issueTrackerGraph, domainTemplates_observabilityGraph as observabilityGraph };
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* LLM graph composition (roadmap §8.3).
|
|
269
|
-
*
|
|
270
|
-
* Declarative GraphSpec schema + compiler/decompiler for graph topology.
|
|
271
|
-
* The LLM designs graphs as JSON; compileSpec instantiates them; decompileGraph
|
|
272
|
-
* extracts them back. Templates support reusable subgraph patterns. Feedback
|
|
273
|
-
* edges express bounded cycles via §8.1 feedback().
|
|
274
|
-
*
|
|
275
|
-
* @module
|
|
276
|
-
*/
|
|
277
|
-
|
|
278
|
-
/** A single node declaration in a GraphSpec. */
|
|
279
|
-
type GraphSpecNode = {
|
|
280
|
-
/** Node kind: state, producer, derived, effect, operator. */
|
|
281
|
-
type: "state" | "producer" | "derived" | "effect" | "operator";
|
|
282
|
-
/** Dependency node names (for derived/effect/operator). */
|
|
283
|
-
deps?: string[];
|
|
284
|
-
/** Named function from the catalog (for derived/effect/operator/producer). */
|
|
285
|
-
fn?: string;
|
|
286
|
-
/** Named source from the catalog (for producer). */
|
|
287
|
-
source?: string;
|
|
288
|
-
/** Freeform config passed to the catalog fn/source factory. */
|
|
289
|
-
config?: Record<string, unknown>;
|
|
290
|
-
/** Initial value (for state nodes). */
|
|
291
|
-
initial?: unknown;
|
|
292
|
-
/** Human/LLM-readable metadata. */
|
|
293
|
-
meta?: Record<string, unknown>;
|
|
294
|
-
};
|
|
295
|
-
/** Template instantiation node — expanded at compile time. */
|
|
296
|
-
type GraphSpecTemplateRef = {
|
|
297
|
-
type: "template";
|
|
298
|
-
/** Name of the template to instantiate. */
|
|
299
|
-
template: string;
|
|
300
|
-
/** Parameter bindings: template param name → node name. */
|
|
301
|
-
bind: Record<string, string>;
|
|
302
|
-
};
|
|
303
|
-
/** A reusable subgraph pattern with parameter substitution. */
|
|
304
|
-
type GraphSpecTemplate = {
|
|
305
|
-
/** Parameter names (prefixed with $ in node refs). */
|
|
306
|
-
params: string[];
|
|
307
|
-
/** Node declarations within the template. */
|
|
308
|
-
nodes: Record<string, GraphSpecNode>;
|
|
309
|
-
/** Which node's output is the template's output. */
|
|
310
|
-
output: string;
|
|
311
|
-
};
|
|
312
|
-
/** A feedback edge: bounded cycle from condition to reentry. */
|
|
313
|
-
type GraphSpecFeedbackEdge = {
|
|
314
|
-
/** Node whose DATA triggers the feedback. */
|
|
315
|
-
from: string;
|
|
316
|
-
/** State node that receives the feedback value. */
|
|
317
|
-
to: string;
|
|
318
|
-
/** Max iterations before stopping (default: 10). */
|
|
319
|
-
maxIterations?: number;
|
|
320
|
-
};
|
|
321
|
-
/** Declarative graph topology for LLM composition (§8.3). */
|
|
322
|
-
type GraphSpec = {
|
|
323
|
-
/** Graph name. */
|
|
324
|
-
name: string;
|
|
325
|
-
/** Node declarations (keyed by node name). */
|
|
326
|
-
nodes: Record<string, GraphSpecNode | GraphSpecTemplateRef>;
|
|
327
|
-
/** Reusable subgraph templates. */
|
|
328
|
-
templates?: Record<string, GraphSpecTemplate>;
|
|
329
|
-
/** Feedback edges (bounded cycles). */
|
|
330
|
-
feedback?: GraphSpecFeedbackEdge[];
|
|
331
|
-
};
|
|
332
|
-
/**
|
|
333
|
-
* Factory for creating a derived/effect/operator node from catalog.
|
|
334
|
-
* Receives resolved dep nodes and the config from the spec.
|
|
335
|
-
*/
|
|
336
|
-
type FnFactory = (deps: Node<unknown>[], config: Record<string, unknown>) => Node<unknown>;
|
|
337
|
-
/**
|
|
338
|
-
* Factory for creating a producer node from catalog.
|
|
339
|
-
* Receives the config from the spec.
|
|
340
|
-
*/
|
|
341
|
-
type SourceFactory = (config: Record<string, unknown>) => Node<unknown>;
|
|
342
|
-
/** Simple config field descriptor for LLM prompt generation and validation. */
|
|
343
|
-
type ConfigFieldSchema = {
|
|
344
|
-
/** Human-readable type: "string", "number", "boolean", "string[]", etc. */
|
|
345
|
-
type: string;
|
|
346
|
-
/** Whether this field is required (default: true). */
|
|
347
|
-
required?: boolean;
|
|
348
|
-
/** Allowed values (enum constraint). */
|
|
349
|
-
enum?: readonly (string | number | boolean)[];
|
|
350
|
-
/** Human-readable description for LLM context. */
|
|
351
|
-
description?: string;
|
|
352
|
-
/** Default value if omitted. */
|
|
353
|
-
default?: unknown;
|
|
354
|
-
};
|
|
355
|
-
/**
|
|
356
|
-
* Rich catalog entry: bundles a runtime factory with LLM-facing metadata.
|
|
357
|
-
*
|
|
358
|
-
* The metadata is used to:
|
|
359
|
-
* 1. Auto-generate prompt text for {@link llmCompose} (replaces manual `catalogDescription`)
|
|
360
|
-
* 2. Validate LLM output in {@link validateSpec} (catch wrong fn names, invalid config)
|
|
361
|
-
* 3. Provide actionable error messages for {@link llmRefine} feedback loops
|
|
362
|
-
*
|
|
363
|
-
* Developers register ONE object; the library handles prompt generation and validation.
|
|
364
|
-
*/
|
|
365
|
-
type CatalogFnEntry = {
|
|
366
|
-
/** Runtime factory. */
|
|
367
|
-
factory: FnFactory;
|
|
368
|
-
/** One-line description for LLM prompt (what it does, not how). */
|
|
369
|
-
description: string;
|
|
370
|
-
/** Config field schemas. Keys are config field names. */
|
|
371
|
-
configSchema?: Record<string, ConfigFieldSchema>;
|
|
372
|
-
/** Example config objects (shown in prompt for complex fns). */
|
|
373
|
-
examples?: Record<string, unknown>[];
|
|
374
|
-
/** Category tags for grouping in prompt (e.g., "resilience", "reduction", "ai"). */
|
|
375
|
-
tags?: string[];
|
|
376
|
-
};
|
|
377
|
-
/** Rich catalog entry for producer sources. */
|
|
378
|
-
type CatalogSourceEntry = {
|
|
379
|
-
/** Runtime factory. */
|
|
380
|
-
factory: SourceFactory;
|
|
381
|
-
/** One-line description for LLM prompt. */
|
|
382
|
-
description: string;
|
|
383
|
-
/** Config field schemas. */
|
|
384
|
-
configSchema?: Record<string, ConfigFieldSchema>;
|
|
385
|
-
/** Example config objects. */
|
|
386
|
-
examples?: Record<string, unknown>[];
|
|
387
|
-
/** Category tags. */
|
|
388
|
-
tags?: string[];
|
|
389
|
-
};
|
|
390
|
-
/**
|
|
391
|
-
* Fn/source lookup table passed to compileSpec and llmCompose.
|
|
392
|
-
*
|
|
393
|
-
* Accepts both bare factories (backward-compatible) and rich {@link CatalogFnEntry}
|
|
394
|
-
* / {@link CatalogSourceEntry} objects. When rich entries are provided, the library
|
|
395
|
-
* auto-generates LLM prompts and validates LLM output against the catalog.
|
|
396
|
-
*/
|
|
397
|
-
type GraphSpecCatalog = {
|
|
398
|
-
fns?: Record<string, FnFactory | CatalogFnEntry>;
|
|
399
|
-
sources?: Record<string, SourceFactory | CatalogSourceEntry>;
|
|
400
|
-
};
|
|
401
|
-
/** Type guard: is this a rich catalog fn entry (vs bare factory)? */
|
|
402
|
-
declare function isRichFnEntry(entry: FnFactory | CatalogFnEntry): entry is CatalogFnEntry;
|
|
403
|
-
/** Type guard: is this a rich catalog source entry (vs bare factory)? */
|
|
404
|
-
declare function isRichSourceEntry(entry: SourceFactory | CatalogSourceEntry): entry is CatalogSourceEntry;
|
|
405
|
-
/** Extract the runtime factory from a catalog entry (rich or bare). */
|
|
406
|
-
declare function extractFnFactory(entry: FnFactory | CatalogFnEntry): FnFactory;
|
|
407
|
-
/** Extract the runtime factory from a catalog source entry (rich or bare). */
|
|
408
|
-
declare function extractSourceFactory(entry: SourceFactory | CatalogSourceEntry): SourceFactory;
|
|
409
|
-
/**
|
|
410
|
-
* Auto-generate catalog prompt text from rich catalog entries.
|
|
411
|
-
*
|
|
412
|
-
* Groups fns by tag, formats each as `- name: description. Config: { ... }`.
|
|
413
|
-
* Falls back to listing names only for bare factories.
|
|
414
|
-
*/
|
|
415
|
-
declare function generateCatalogPrompt(catalog: GraphSpecCatalog): string;
|
|
416
|
-
/**
|
|
417
|
-
* Validate a GraphSpec against a catalog.
|
|
418
|
-
*
|
|
419
|
-
* Checks that fn/source names reference actual catalog entries, and validates
|
|
420
|
-
* config fields against configSchema when rich entries are available.
|
|
421
|
-
* Returns additional errors beyond structural {@link validateSpec} checks.
|
|
422
|
-
*/
|
|
423
|
-
declare function validateSpecAgainstCatalog(spec: GraphSpec, catalog: GraphSpecCatalog): GraphSpecValidation;
|
|
424
|
-
/** Validation result from {@link validateSpec}. */
|
|
425
|
-
type GraphSpecValidation = {
|
|
426
|
-
valid: boolean;
|
|
427
|
-
errors: string[];
|
|
428
|
-
};
|
|
429
|
-
/**
|
|
430
|
-
* Validate a GraphSpec JSON object.
|
|
431
|
-
*
|
|
432
|
-
* Checks structural validity: required fields, node types, dep references,
|
|
433
|
-
* template references, feedback edge targets, self-cycles, and bind completeness.
|
|
434
|
-
*/
|
|
435
|
-
declare function validateSpec(spec: unknown): GraphSpecValidation;
|
|
436
|
-
/** Options for {@link compileSpec}. */
|
|
437
|
-
type CompileSpecOptions = {
|
|
438
|
-
/** Fn/source catalog for resolving named factories. */
|
|
439
|
-
catalog?: GraphSpecCatalog;
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* Instantiate a Graph from a GraphSpec.
|
|
443
|
-
*
|
|
444
|
-
* Handles template expansion (mounted subgraphs), feedback wiring via §8.1
|
|
445
|
-
* feedback(), node factory lookup from the catalog, and topology validation.
|
|
446
|
-
*
|
|
447
|
-
* @param spec - Declarative graph topology.
|
|
448
|
-
* @param opts - Catalog and compile options.
|
|
449
|
-
* @returns A running Graph.
|
|
450
|
-
* @throws On validation failure, missing catalog entries, or unresolvable deps.
|
|
451
|
-
*
|
|
452
|
-
* @category patterns
|
|
453
|
-
*/
|
|
454
|
-
declare function compileSpec(spec: GraphSpec, opts?: CompileSpecOptions): Graph;
|
|
455
|
-
/**
|
|
456
|
-
* Extract a GraphSpec from a running graph.
|
|
457
|
-
*
|
|
458
|
-
* Uses `describe({ detail: "standard" })` as a starting point, then enriches:
|
|
459
|
-
* - Feedback edges recovered from counter node meta (`feedbackFrom`/`feedbackTo`)
|
|
460
|
-
* - Template refs recovered from output node meta (`_templateName`/`_templateBind`)
|
|
461
|
-
* - Structural fingerprinting as fallback for 2+ identical mounted subgraphs
|
|
462
|
-
*
|
|
463
|
-
* @param graph - Running graph to decompile.
|
|
464
|
-
* @returns A GraphSpec representation.
|
|
465
|
-
*
|
|
466
|
-
* @category patterns
|
|
467
|
-
*/
|
|
468
|
-
declare function decompileGraph(graph: Graph): GraphSpec;
|
|
469
|
-
/** A single change in a spec diff. */
|
|
470
|
-
type SpecDiffEntry = {
|
|
471
|
-
type: "added" | "removed" | "changed";
|
|
472
|
-
path: string;
|
|
473
|
-
detail?: string;
|
|
474
|
-
};
|
|
475
|
-
/** Structural diff between two GraphSpecs. */
|
|
476
|
-
type SpecDiffResult = {
|
|
477
|
-
entries: SpecDiffEntry[];
|
|
478
|
-
summary: string;
|
|
479
|
-
};
|
|
480
|
-
/**
|
|
481
|
-
* Compute a structural diff between two GraphSpecs.
|
|
482
|
-
*
|
|
483
|
-
* Template-aware: reports "changed template definition" vs "changed
|
|
484
|
-
* instantiation bindings." No runtime needed — pure JSON comparison.
|
|
485
|
-
*
|
|
486
|
-
* @param specA - The "before" spec.
|
|
487
|
-
* @param specB - The "after" spec.
|
|
488
|
-
* @returns Diff entries and a human-readable summary.
|
|
489
|
-
*
|
|
490
|
-
* @category patterns
|
|
491
|
-
*/
|
|
492
|
-
declare function specDiff(specA: GraphSpec, specB: GraphSpec): SpecDiffResult;
|
|
493
|
-
/** Options for {@link llmCompose}. */
|
|
494
|
-
type LLMComposeOptions = {
|
|
495
|
-
model?: string;
|
|
496
|
-
temperature?: number;
|
|
497
|
-
maxTokens?: number;
|
|
498
|
-
/** Extra instructions appended to the system prompt. */
|
|
499
|
-
systemPromptExtra?: string;
|
|
500
|
-
/**
|
|
501
|
-
* Available fn/source catalog names for the LLM to reference.
|
|
502
|
-
* When omitted and `catalog` contains rich {@link CatalogFnEntry} entries,
|
|
503
|
-
* the prompt is auto-generated via {@link generateCatalogPrompt}.
|
|
504
|
-
*/
|
|
505
|
-
catalogDescription?: string;
|
|
506
|
-
/**
|
|
507
|
-
* Catalog for auto-prompt generation and catalog-aware validation.
|
|
508
|
-
* When rich entries are provided, the catalog prompt is auto-generated
|
|
509
|
-
* and LLM output is validated against fn/source names and config schemas.
|
|
510
|
-
*/
|
|
511
|
-
catalog?: GraphSpecCatalog;
|
|
512
|
-
/**
|
|
513
|
-
* Max auto-refine attempts when the LLM output fails catalog validation.
|
|
514
|
-
* Each attempt feeds the validation errors back to the LLM via llmRefine.
|
|
515
|
-
* Default: 0 (no auto-refine). Set to 2-3 for production use.
|
|
516
|
-
*/
|
|
517
|
-
maxAutoRefine?: number;
|
|
518
|
-
};
|
|
519
|
-
/**
|
|
520
|
-
* Ask an LLM to compose a GraphSpec from a natural-language problem description.
|
|
521
|
-
*
|
|
522
|
-
* The LLM generates a GraphSpec (with templates + feedback), validated before
|
|
523
|
-
* returning. The spec is for human review before compilation via compileSpec().
|
|
524
|
-
*
|
|
525
|
-
* @param problem - Natural language problem description.
|
|
526
|
-
* @param adapter - LLM adapter for the generation call.
|
|
527
|
-
* @param opts - Model options and catalog description.
|
|
528
|
-
* @returns A validated GraphSpec.
|
|
529
|
-
* @throws On invalid LLM output or validation failure.
|
|
530
|
-
*
|
|
531
|
-
* @category patterns
|
|
532
|
-
*/
|
|
533
|
-
declare function llmCompose(problem: string, adapter: LLMAdapter, opts?: LLMComposeOptions): Promise<GraphSpec>;
|
|
534
|
-
/** Options for {@link llmRefine}. */
|
|
535
|
-
type LLMRefineOptions = LLMComposeOptions;
|
|
536
|
-
/**
|
|
537
|
-
* Ask an LLM to modify an existing GraphSpec based on feedback or changed requirements.
|
|
538
|
-
*
|
|
539
|
-
* @param currentSpec - The current GraphSpec to modify.
|
|
540
|
-
* @param feedback - Natural language feedback or changed requirements.
|
|
541
|
-
* @param adapter - LLM adapter for the generation call.
|
|
542
|
-
* @param opts - Model options.
|
|
543
|
-
* @returns A new GraphSpec incorporating the feedback.
|
|
544
|
-
* @throws On invalid LLM output or validation failure.
|
|
545
|
-
*
|
|
546
|
-
* @category patterns
|
|
547
|
-
*/
|
|
548
|
-
declare function llmRefine(currentSpec: GraphSpec, feedback: string, adapter: LLMAdapter, opts?: LLMRefineOptions): Promise<GraphSpec>;
|
|
549
|
-
|
|
550
|
-
type graphspec_CatalogFnEntry = CatalogFnEntry;
|
|
551
|
-
type graphspec_CatalogSourceEntry = CatalogSourceEntry;
|
|
552
|
-
type graphspec_CompileSpecOptions = CompileSpecOptions;
|
|
553
|
-
type graphspec_ConfigFieldSchema = ConfigFieldSchema;
|
|
554
|
-
type graphspec_FnFactory = FnFactory;
|
|
555
|
-
type graphspec_GraphSpec = GraphSpec;
|
|
556
|
-
type graphspec_GraphSpecCatalog = GraphSpecCatalog;
|
|
557
|
-
type graphspec_GraphSpecFeedbackEdge = GraphSpecFeedbackEdge;
|
|
558
|
-
type graphspec_GraphSpecNode = GraphSpecNode;
|
|
559
|
-
type graphspec_GraphSpecTemplate = GraphSpecTemplate;
|
|
560
|
-
type graphspec_GraphSpecTemplateRef = GraphSpecTemplateRef;
|
|
561
|
-
type graphspec_GraphSpecValidation = GraphSpecValidation;
|
|
562
|
-
type graphspec_LLMComposeOptions = LLMComposeOptions;
|
|
563
|
-
type graphspec_LLMRefineOptions = LLMRefineOptions;
|
|
564
|
-
type graphspec_SourceFactory = SourceFactory;
|
|
565
|
-
type graphspec_SpecDiffEntry = SpecDiffEntry;
|
|
566
|
-
type graphspec_SpecDiffResult = SpecDiffResult;
|
|
567
|
-
declare const graphspec_compileSpec: typeof compileSpec;
|
|
568
|
-
declare const graphspec_decompileGraph: typeof decompileGraph;
|
|
569
|
-
declare const graphspec_extractFnFactory: typeof extractFnFactory;
|
|
570
|
-
declare const graphspec_extractSourceFactory: typeof extractSourceFactory;
|
|
571
|
-
declare const graphspec_generateCatalogPrompt: typeof generateCatalogPrompt;
|
|
572
|
-
declare const graphspec_isRichFnEntry: typeof isRichFnEntry;
|
|
573
|
-
declare const graphspec_isRichSourceEntry: typeof isRichSourceEntry;
|
|
574
|
-
declare const graphspec_llmCompose: typeof llmCompose;
|
|
575
|
-
declare const graphspec_llmRefine: typeof llmRefine;
|
|
576
|
-
declare const graphspec_specDiff: typeof specDiff;
|
|
577
|
-
declare const graphspec_validateSpec: typeof validateSpec;
|
|
578
|
-
declare const graphspec_validateSpecAgainstCatalog: typeof validateSpecAgainstCatalog;
|
|
579
|
-
declare namespace graphspec {
|
|
580
|
-
export { type graphspec_CatalogFnEntry as CatalogFnEntry, type graphspec_CatalogSourceEntry as CatalogSourceEntry, type graphspec_CompileSpecOptions as CompileSpecOptions, type graphspec_ConfigFieldSchema as ConfigFieldSchema, type graphspec_FnFactory as FnFactory, type graphspec_GraphSpec as GraphSpec, type graphspec_GraphSpecCatalog as GraphSpecCatalog, type graphspec_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, type graphspec_GraphSpecNode as GraphSpecNode, type graphspec_GraphSpecTemplate as GraphSpecTemplate, type graphspec_GraphSpecTemplateRef as GraphSpecTemplateRef, type graphspec_GraphSpecValidation as GraphSpecValidation, type graphspec_LLMComposeOptions as LLMComposeOptions, type graphspec_LLMRefineOptions as LLMRefineOptions, type graphspec_SourceFactory as SourceFactory, type graphspec_SpecDiffEntry as SpecDiffEntry, type graphspec_SpecDiffResult as SpecDiffResult, graphspec_compileSpec as compileSpec, graphspec_decompileGraph as decompileGraph, graphspec_extractFnFactory as extractFnFactory, graphspec_extractSourceFactory as extractSourceFactory, graphspec_generateCatalogPrompt as generateCatalogPrompt, graphspec_isRichFnEntry as isRichFnEntry, graphspec_isRichSourceEntry as isRichSourceEntry, graphspec_llmCompose as llmCompose, graphspec_llmRefine as llmRefine, graphspec_specDiff as specDiff, graphspec_validateSpec as validateSpec, graphspec_validateSpecAgainstCatalog as validateSpecAgainstCatalog };
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Composable safety layer (roadmap §9.0b).
|
|
585
|
-
*
|
|
586
|
-
* {@link guardedExecution} wraps any {@link Graph} with:
|
|
587
|
-
*
|
|
588
|
-
* - {@link policyEnforcer} — reactive ABAC, policies stored as a `Node` so
|
|
589
|
-
* LLMs / humans can update them at runtime. Now with full transitive
|
|
590
|
-
* dynamic coverage via `watchTopologyTree`.
|
|
591
|
-
* - Scoped {@link GuardedExecutionGraph.scopedDescribe} — delegates to
|
|
592
|
-
* `target.describe({actor})` so callers see only what the actor is
|
|
593
|
-
* allowed to see.
|
|
594
|
-
* - The enforcer's `violations` topic is republished as `violations` on
|
|
595
|
-
* the wrapper, composable with {@link graphLens}.`health` alerts.
|
|
596
|
-
*
|
|
597
|
-
* V1 scope: policies + actor + scoped describe. Budget-as-option is NOT
|
|
598
|
-
* in V1 — it requires a cost-tracking design that hasn't landed yet.
|
|
599
|
-
* Callers who need a budget limit today append a budget-aware
|
|
600
|
-
* {@link PolicyRuleData} to the policies list (check current cost and
|
|
601
|
-
* `deny` when exhausted).
|
|
602
|
-
*
|
|
603
|
-
* @module
|
|
604
|
-
*/
|
|
605
|
-
|
|
606
|
-
/** Options for {@link guardedExecution}. */
|
|
607
|
-
interface GuardedExecutionOptions {
|
|
608
|
-
/**
|
|
609
|
-
* Policies enforced against every guarded write. Static list or a live
|
|
610
|
-
* `Node<readonly PolicyRuleData[]>` (LLM-updatable).
|
|
611
|
-
*
|
|
612
|
-
* **Deny-by-default gotcha:** the underlying `policyFromRules()` denies any
|
|
613
|
-
* action that matches no rule. An empty policies list in `mode: "enforce"`
|
|
614
|
-
* therefore blocks EVERY write AND every `observe` through the stacked
|
|
615
|
-
* guard — including `scopedDescribe()`. If you want a permissive base, add
|
|
616
|
-
* at least `{ effect: "allow", action: "*" }` and layer deny rules on top.
|
|
617
|
-
* In `mode: "audit"` no guards are stacked, so empty policies are safe.
|
|
618
|
-
*/
|
|
619
|
-
policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>;
|
|
620
|
-
/**
|
|
621
|
-
* Actor whose perspective drives {@link GuardedExecutionGraph.scopedDescribe}
|
|
622
|
-
* and {@link GuardedExecutionGraph.describe} — when omitted, callers must
|
|
623
|
-
* pass `{actor}` explicitly or they get the target's raw describe.
|
|
624
|
-
*/
|
|
625
|
-
actor?: Actor;
|
|
626
|
-
/**
|
|
627
|
-
* `"enforce"` (default) — push guards onto target nodes so disallowed
|
|
628
|
-
* writes throw {@link GuardDenied}.
|
|
629
|
-
* `"audit"` — record would-be denials to the `violations` topic without
|
|
630
|
-
* blocking writes.
|
|
631
|
-
*/
|
|
632
|
-
mode?: "audit" | "enforce";
|
|
633
|
-
/** Ring-buffer cap for the `violations` topic. Default 1000 (inherited from policyEnforcer). */
|
|
634
|
-
violationsLimit?: number;
|
|
635
|
-
/** Wrapper graph name. Default `${target.name}_guarded`. */
|
|
636
|
-
name?: string;
|
|
637
|
-
/** Wrapper graph options. */
|
|
638
|
-
graph?: GraphOptions;
|
|
639
|
-
}
|
|
640
|
-
/**
|
|
641
|
-
* Wrapper over a target {@link Graph} providing reactive ABAC + scoped
|
|
642
|
-
* describe. Mounts a {@link PolicyEnforcerGraph} under `enforcer`.
|
|
643
|
-
*
|
|
644
|
-
* @category patterns
|
|
645
|
-
*/
|
|
646
|
-
declare class GuardedExecutionGraph extends Graph {
|
|
647
|
-
readonly enforcer: PolicyEnforcerGraph;
|
|
648
|
-
readonly violations: TopicGraph<PolicyViolation>;
|
|
649
|
-
private readonly _target;
|
|
650
|
-
private readonly _defaultActor;
|
|
651
|
-
constructor(target: Graph, opts: GuardedExecutionOptions);
|
|
652
|
-
/**
|
|
653
|
-
* Describe the **target** graph scoped to the configured actor. Returns
|
|
654
|
-
* only nodes the actor is permitted to see (via the target's node guards
|
|
655
|
-
* filtering `describe()` via `actor`).
|
|
656
|
-
*
|
|
657
|
-
* Pass `{actor}` in opts to override the configured actor for this call.
|
|
658
|
-
* Pass any standard {@link GraphDescribeOptions} fields (`detail`,
|
|
659
|
-
* `fields`, `filter`) — they apply to the target's describe.
|
|
660
|
-
*
|
|
661
|
-
* **Mode interaction:**
|
|
662
|
-
* - In `mode: "enforce"` (default), the enforcer stacks a policy-derived
|
|
663
|
-
* guard on every target node. `scopedDescribe({actor})` then filters by
|
|
664
|
-
* the AND of per-node guards AND the stacked policy guard.
|
|
665
|
-
* - In `mode: "audit"`, NO guards are stacked — `scopedDescribe` filters
|
|
666
|
-
* purely by the target's pre-existing per-node guards. If a target has
|
|
667
|
-
* no node-level guards, the policy rules you pass have no effect on
|
|
668
|
-
* visibility (they only populate the `violations` topic on writes).
|
|
669
|
-
*/
|
|
670
|
-
scopedDescribe(opts?: Omit<GraphDescribeOptions, "actor"> & {
|
|
671
|
-
actor?: Actor;
|
|
672
|
-
}): GraphDescribeOutput;
|
|
673
|
-
/** The wrapped graph (escape hatch for tooling). */
|
|
674
|
-
get target(): Graph;
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Wrap a {@link Graph} with {@link policyEnforcer} plus a scoped describe
|
|
678
|
-
* lens. Returns a {@link GuardedExecutionGraph} that can be mounted, diffed,
|
|
679
|
-
* or composed with {@link graphLens}.
|
|
680
|
-
*
|
|
681
|
-
* @param target - The graph to guard.
|
|
682
|
-
* @param opts - See {@link GuardedExecutionOptions}.
|
|
683
|
-
*
|
|
684
|
-
* @example
|
|
685
|
-
* ```ts
|
|
686
|
-
* const guarded = guardedExecution(app, {
|
|
687
|
-
* actor: { type: "human", id: "alice" },
|
|
688
|
-
* policies: [
|
|
689
|
-
* { effect: "allow", action: "read", actorType: "human" },
|
|
690
|
-
* { effect: "deny", action: "write", pathPattern: "system::*" },
|
|
691
|
-
* ],
|
|
692
|
-
* mode: "enforce",
|
|
693
|
-
* });
|
|
694
|
-
*
|
|
695
|
-
* const view = guarded.scopedDescribe({ detail: "standard" });
|
|
696
|
-
* guarded.violations.events.subscribe(msgs => console.log("violations:", msgs));
|
|
697
|
-
* ```
|
|
698
|
-
*
|
|
699
|
-
* @category patterns
|
|
700
|
-
*/
|
|
701
|
-
declare function guardedExecution(target: Graph, opts: GuardedExecutionOptions): GuardedExecutionGraph;
|
|
702
|
-
|
|
703
|
-
declare const guardedExecution$1_DescribeFilter: typeof DescribeFilter;
|
|
704
|
-
type guardedExecution$1_GuardedExecutionGraph = GuardedExecutionGraph;
|
|
705
|
-
declare const guardedExecution$1_GuardedExecutionGraph: typeof GuardedExecutionGraph;
|
|
706
|
-
type guardedExecution$1_GuardedExecutionOptions = GuardedExecutionOptions;
|
|
707
|
-
declare const guardedExecution$1_guardedExecution: typeof guardedExecution;
|
|
708
|
-
declare namespace guardedExecution$1 {
|
|
709
|
-
export { guardedExecution$1_DescribeFilter as DescribeFilter, guardedExecution$1_GuardedExecutionGraph as GuardedExecutionGraph, type guardedExecution$1_GuardedExecutionOptions as GuardedExecutionOptions, guardedExecution$1_guardedExecution as guardedExecution };
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* Harness wiring types (roadmap §9.0).
|
|
714
|
-
*
|
|
715
|
-
* Shared types for the reactive collaboration loop: intake, triage, queue,
|
|
716
|
-
* gate, execute, verify, reflect. These types are intentionally domain-agnostic
|
|
717
|
-
* — the harness loop is not specific to eval workflows.
|
|
718
|
-
*
|
|
719
|
-
* @module
|
|
720
|
-
*/
|
|
721
|
-
/** Sources that can produce intake items. */
|
|
722
|
-
type IntakeSource = "eval" | "test" | "human" | "code-change" | "hypothesis" | "parity";
|
|
723
|
-
/** Severity levels for intake items. */
|
|
724
|
-
type Severity = "critical" | "high" | "medium" | "low";
|
|
725
|
-
/** Root cause categories for triage classification. */
|
|
726
|
-
type RootCause = "composition" | "missing-fn" | "bad-docs" | "schema-gap" | "regression" | "unknown";
|
|
727
|
-
/** Intervention types that address root causes. */
|
|
728
|
-
type Intervention = "template" | "catalog-fn" | "docs" | "wrapper" | "schema-change" | "investigate";
|
|
729
|
-
/** Routing destinations after triage. */
|
|
730
|
-
type QueueRoute = "auto-fix" | "needs-decision" | "investigation" | "backlog";
|
|
731
|
-
/** Ordered queue route names for iteration. */
|
|
732
|
-
declare const QUEUE_NAMES: readonly QueueRoute[];
|
|
733
|
-
/**
|
|
734
|
-
* An item entering the harness loop via the INTAKE stage.
|
|
735
|
-
*
|
|
736
|
-
* All intake sources produce this uniform shape — the intake topic
|
|
737
|
-
* doesn't care where items came from.
|
|
738
|
-
*/
|
|
739
|
-
interface IntakeItem {
|
|
740
|
-
source: IntakeSource;
|
|
741
|
-
summary: string;
|
|
742
|
-
evidence: string;
|
|
743
|
-
affectsAreas: string[];
|
|
744
|
-
affectsEvalTasks?: string[];
|
|
745
|
-
severity?: Severity;
|
|
746
|
-
relatedTo?: string[];
|
|
747
|
-
/** Item-carried reingestion count. Incremented on each full-loop reingestion. */
|
|
748
|
-
_reingestions?: number;
|
|
749
|
-
}
|
|
750
|
-
/** Output of the TRIAGE stage — enriched intake item with classification. */
|
|
751
|
-
interface TriagedItem extends IntakeItem {
|
|
752
|
-
rootCause: RootCause;
|
|
753
|
-
intervention: Intervention;
|
|
754
|
-
route: QueueRoute;
|
|
755
|
-
priority: number;
|
|
756
|
-
triageReasoning?: string;
|
|
757
|
-
/** Item-carried retry count. Incremented on each fast-retry pass. */
|
|
758
|
-
_retries?: number;
|
|
759
|
-
}
|
|
760
|
-
/** Effectiveness record for a rootCause→intervention pair. */
|
|
761
|
-
interface StrategyEntry {
|
|
762
|
-
rootCause: RootCause;
|
|
763
|
-
intervention: Intervention;
|
|
764
|
-
attempts: number;
|
|
765
|
-
successes: number;
|
|
766
|
-
successRate: number;
|
|
767
|
-
}
|
|
768
|
-
/** Key format: `${rootCause}→${intervention}`. */
|
|
769
|
-
type StrategyKey = `${RootCause}→${Intervention}`;
|
|
770
|
-
declare function strategyKey(rootCause: RootCause, intervention: Intervention): StrategyKey;
|
|
771
|
-
/** LLM output shape from the EXECUTE stage (partial — lacks `item`). */
|
|
772
|
-
type ExecuteOutput = {
|
|
773
|
-
outcome: "success" | "failure" | "partial";
|
|
774
|
-
detail: string;
|
|
775
|
-
};
|
|
776
|
-
/** Full execution result assembled downstream (LLM output + context). */
|
|
777
|
-
interface ExecutionResult {
|
|
778
|
-
item: TriagedItem;
|
|
779
|
-
outcome: "success" | "failure" | "partial";
|
|
780
|
-
detail: string;
|
|
781
|
-
}
|
|
782
|
-
/** Whether an error is self-correctable (fast-retry) or structural (full loop). */
|
|
783
|
-
type ErrorClass = "self-correctable" | "structural";
|
|
784
|
-
/** Classifier for fast-retry path. */
|
|
785
|
-
type ErrorClassifier = (result: ExecutionResult) => ErrorClass;
|
|
786
|
-
/** Default error classifier: parse/config errors are self-correctable. */
|
|
787
|
-
declare function defaultErrorClassifier(result: ExecutionResult): ErrorClass;
|
|
788
|
-
/** Result of the VERIFY stage. */
|
|
789
|
-
interface VerifyResult {
|
|
790
|
-
item: TriagedItem;
|
|
791
|
-
execution: ExecutionResult;
|
|
792
|
-
verified: boolean;
|
|
793
|
-
findings: string[];
|
|
794
|
-
errorClass?: ErrorClass;
|
|
795
|
-
}
|
|
796
|
-
/** Configurable signals for priority scoring. */
|
|
797
|
-
interface PrioritySignals {
|
|
798
|
-
/** Per-severity base weight (default: critical=100, high=70, medium=40, low=10). */
|
|
799
|
-
severityWeights?: Partial<Record<Severity, number>>;
|
|
800
|
-
/** Decay rate per second for attention decay (default ~1.15e-6 ≈ 7-day half-life). */
|
|
801
|
-
decayRate?: number;
|
|
802
|
-
/** Strategy model effectiveness boost threshold (default 0.7). */
|
|
803
|
-
effectivenessThreshold?: number;
|
|
804
|
-
/** Strategy model effectiveness boost amount (default 15). */
|
|
805
|
-
effectivenessBoost?: number;
|
|
806
|
-
}
|
|
807
|
-
/** Default severity weights. */
|
|
808
|
-
declare const DEFAULT_SEVERITY_WEIGHTS: Record<Severity, number>;
|
|
809
|
-
/** Default decay rate: ~7-day half-life. */
|
|
810
|
-
declare const DEFAULT_DECAY_RATE: number;
|
|
811
|
-
/** Per-queue configuration in the harness loop. */
|
|
812
|
-
interface QueueConfig {
|
|
813
|
-
/** Whether this queue is gated (requires human approval). */
|
|
814
|
-
gated: boolean;
|
|
815
|
-
/** Maximum pending items in the gate (default Infinity). */
|
|
816
|
-
maxPending?: number;
|
|
817
|
-
/** Start the gate in open (auto-approve) mode? */
|
|
818
|
-
startOpen?: boolean;
|
|
819
|
-
}
|
|
820
|
-
/** Default queue configurations. */
|
|
821
|
-
declare const DEFAULT_QUEUE_CONFIGS: Record<QueueRoute, QueueConfig>;
|
|
822
|
-
/** Options for {@link harnessLoop}. */
|
|
823
|
-
interface HarnessLoopOptions {
|
|
824
|
-
/** LLM adapter for promptNode-based stages (triage, execute, verify, reflect). */
|
|
825
|
-
adapter: unknown;
|
|
826
|
-
/** Custom triage prompt (receives IntakeItem + strategy model as context). */
|
|
827
|
-
triagePrompt?: string | ((...args: unknown[]) => string);
|
|
828
|
-
/** Custom execute prompt. */
|
|
829
|
-
executePrompt?: string | ((...args: unknown[]) => string);
|
|
830
|
-
/** Custom verify prompt. */
|
|
831
|
-
verifyPrompt?: string | ((...args: unknown[]) => string);
|
|
832
|
-
/** Per-queue configuration overrides. */
|
|
833
|
-
queues?: Partial<Record<QueueRoute, QueueConfig>>;
|
|
834
|
-
/** Priority scoring signals. */
|
|
835
|
-
priority?: PrioritySignals;
|
|
836
|
-
/** Error classifier for fast-retry path. */
|
|
837
|
-
errorClassifier?: ErrorClassifier;
|
|
838
|
-
/** Max fast-retries per item before routing to full intake (default 2). */
|
|
839
|
-
maxRetries?: number;
|
|
840
|
-
/** Global retry cap across all items — circuit breaker (default maxRetries × 10). */
|
|
841
|
-
maxTotalRetries?: number;
|
|
842
|
-
/** Max re-ingestions from verify→intake before giving up (default 1). */
|
|
843
|
-
maxReingestions?: number;
|
|
844
|
-
/** Global reingestion cap across all items — circuit breaker (default maxReingestions × 10). */
|
|
845
|
-
maxTotalReingestions?: number;
|
|
846
|
-
/** Retained limit for topic logs (default 1000). */
|
|
847
|
-
retainedLimit?: number;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
/**
|
|
851
|
-
* Harness bridge factories (roadmap §9.0).
|
|
852
|
-
*
|
|
853
|
-
* Intake bridges, eval source wrapper, before/after comparison,
|
|
854
|
-
* affected-task filter, code-change bridge, and notification effect.
|
|
855
|
-
* All are compositions of existing primitives — no new abstractions.
|
|
856
|
-
*
|
|
857
|
-
* @module
|
|
858
|
-
*/
|
|
859
|
-
|
|
860
|
-
/** Options for {@link createIntakeBridge}. */
|
|
861
|
-
interface IntakeBridgeOptions {
|
|
862
|
-
/** Name for the effect node (default "intake-bridge"). */
|
|
863
|
-
name?: string;
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* Generic source→intake bridge factory.
|
|
867
|
-
*
|
|
868
|
-
* Watches a source node for new values, passes each through a user-supplied
|
|
869
|
-
* `parser` that produces zero or more `IntakeItem`s, and publishes them to
|
|
870
|
-
* the given intake topic.
|
|
871
|
-
*
|
|
872
|
-
* This is the generalized pattern behind {@link evalIntakeBridge}. Use it for
|
|
873
|
-
* CI results, test failures, Slack messages, monitoring alerts, or any domain
|
|
874
|
-
* where structured results should flow into a harness loop.
|
|
875
|
-
*
|
|
876
|
-
* @param source - Reactive node emitting domain-specific data.
|
|
877
|
-
* @param intakeTopic - TopicGraph to publish IntakeItem entries to.
|
|
878
|
-
* @param parser - Converts source data into IntakeItem[]. Return empty array to skip.
|
|
879
|
-
* @param opts - Optional configuration.
|
|
880
|
-
* @returns The effect node (for lifecycle management).
|
|
881
|
-
*/
|
|
882
|
-
declare function createIntakeBridge<T>(source: Node<T>, intakeTopic: TopicGraph<IntakeItem>, parser: (value: T) => IntakeItem[], opts?: IntakeBridgeOptions): Node<unknown>;
|
|
883
|
-
/**
|
|
884
|
-
* Minimal eval result shape accepted by the bridge.
|
|
885
|
-
*
|
|
886
|
-
* TS eval runner uses `EvalRun` from `evals/lib/types.ts` which is a superset
|
|
887
|
-
* of this shape. The bridge only reads what it needs.
|
|
888
|
-
*/
|
|
889
|
-
interface EvalResult {
|
|
890
|
-
run_id: string;
|
|
891
|
-
model: string;
|
|
892
|
-
tasks: EvalTaskResult[];
|
|
893
|
-
}
|
|
894
|
-
interface EvalTaskResult {
|
|
895
|
-
task_id: string;
|
|
896
|
-
valid: boolean;
|
|
897
|
-
judge_scores?: EvalJudgeScore[];
|
|
898
|
-
}
|
|
899
|
-
interface EvalJudgeScore {
|
|
900
|
-
claim: string;
|
|
901
|
-
pass: boolean;
|
|
902
|
-
reasoning: string;
|
|
903
|
-
}
|
|
904
|
-
interface EvalIntakeBridgeOptions {
|
|
905
|
-
/** Name for the effect node (default "eval-intake-bridge"). */
|
|
906
|
-
name?: string;
|
|
907
|
-
/** Minimum severity for eval-sourced items (default "medium"). */
|
|
908
|
-
defaultSeverity?: Severity;
|
|
909
|
-
}
|
|
910
|
-
/**
|
|
911
|
-
* Create an effect node that watches an eval results source and publishes
|
|
912
|
-
* per-criterion findings to an intake topic.
|
|
913
|
-
*
|
|
914
|
-
* Each failing judge criterion produces a separate IntakeItem — not one
|
|
915
|
-
* item per task. This gives the triage stage granular findings to classify.
|
|
916
|
-
*
|
|
917
|
-
* @param evalSource - Node emitting EvalResult (or EvalResult[]).
|
|
918
|
-
* @param intakeTopic - TopicGraph to publish IntakeItem entries to.
|
|
919
|
-
* @param opts - Optional configuration.
|
|
920
|
-
* @returns The effect node (for lifecycle management).
|
|
921
|
-
*/
|
|
922
|
-
declare function evalIntakeBridge(evalSource: Node<EvalResult | EvalResult[]>, intakeTopic: TopicGraph<IntakeItem>, opts?: EvalIntakeBridgeOptions): Node<unknown>;
|
|
923
|
-
/**
|
|
924
|
-
* Wrap any eval runner as a reactive producer node.
|
|
925
|
-
*
|
|
926
|
-
* When `trigger` emits, calls `runner()` and emits the result downstream.
|
|
927
|
-
* Uses `switchMap` + `fromAny` — the async boundary stays in the source
|
|
928
|
-
* layer (spec §5.10). A new trigger cancels any in-flight run.
|
|
929
|
-
*
|
|
930
|
-
* ```ts
|
|
931
|
-
* const trigger = state(0); // bump to trigger a new run
|
|
932
|
-
* const results = evalSource(trigger, () => runEvals(config));
|
|
933
|
-
* results.subscribe(msgs => { ... });
|
|
934
|
-
* trigger.down([[DATA, 1]]); // fires the runner
|
|
935
|
-
* ```
|
|
936
|
-
*
|
|
937
|
-
* @param trigger - Any node; each new DATA emission fires the runner.
|
|
938
|
-
* @param runner - Returns an EvalResult (or promise of one).
|
|
939
|
-
*/
|
|
940
|
-
declare function evalSource<T extends EvalResult>(trigger: Node<unknown>, runner: () => T | Promise<T>): Node<T>;
|
|
941
|
-
/** Per-task delta produced by {@link beforeAfterCompare}. */
|
|
942
|
-
interface EvalTaskDelta {
|
|
943
|
-
taskId: string;
|
|
944
|
-
before: boolean;
|
|
945
|
-
after: boolean;
|
|
946
|
-
/** Score-level diff (after − before), undefined if no scores present. */
|
|
947
|
-
scoreDiff?: number;
|
|
948
|
-
}
|
|
949
|
-
/** Output of {@link beforeAfterCompare}. */
|
|
950
|
-
interface EvalDelta {
|
|
951
|
-
/** Task IDs that newly fail in `after` (were passing in `before`). */
|
|
952
|
-
newFailures: string[];
|
|
953
|
-
/** Task IDs that now pass in `after` (were failing in `before`). */
|
|
954
|
-
resolved: string[];
|
|
955
|
-
/** Full per-task breakdown. */
|
|
956
|
-
taskDeltas: EvalTaskDelta[];
|
|
957
|
-
/** True when net resolutions > net failures. */
|
|
958
|
-
overallImproved: boolean;
|
|
959
|
-
}
|
|
960
|
-
/**
|
|
961
|
-
* Derived node that computes before/after eval deltas.
|
|
962
|
-
*
|
|
963
|
-
* Pure computation: no LLM, no async. Compares per-task validity and
|
|
964
|
-
* pass counts between two `EvalResult` snapshots.
|
|
965
|
-
*
|
|
966
|
-
* @param before - Node holding the baseline eval result.
|
|
967
|
-
* @param after - Node holding the new eval result.
|
|
968
|
-
*/
|
|
969
|
-
declare function beforeAfterCompare(before: Node<EvalResult>, after: Node<EvalResult>): Node<EvalDelta>;
|
|
970
|
-
/**
|
|
971
|
-
* Derived node that selects which eval task IDs to re-run.
|
|
972
|
-
*
|
|
973
|
-
* Collects `affectsEvalTasks` from all triaged items, deduplicates, then
|
|
974
|
-
* optionally intersects with `fullTaskSet`. Returns a sorted array of IDs.
|
|
975
|
-
*
|
|
976
|
-
* Use this to avoid re-running the full eval suite after each fix: only the
|
|
977
|
-
* tasks that the triaged items claim to affect are returned.
|
|
978
|
-
*
|
|
979
|
-
* @param issues - Node holding the current list of triaged items.
|
|
980
|
-
* @param fullTaskSet - Optional node (or plain array) of all known task IDs.
|
|
981
|
-
* When provided, output is the intersection.
|
|
982
|
-
*/
|
|
983
|
-
declare function affectedTaskFilter(issues: Node<readonly TriagedItem[]>, fullTaskSet?: Node<readonly string[]> | readonly string[]): Node<string[]>;
|
|
984
|
-
/** A single lint error emitted by a CI tool. */
|
|
985
|
-
interface LintError {
|
|
986
|
-
file: string;
|
|
987
|
-
line: number;
|
|
988
|
-
col: number;
|
|
989
|
-
rule: string;
|
|
990
|
-
message: string;
|
|
991
|
-
}
|
|
992
|
-
/** A single test failure emitted by a test runner. */
|
|
993
|
-
interface TestFailure {
|
|
994
|
-
testId: string;
|
|
995
|
-
file: string;
|
|
996
|
-
message: string;
|
|
997
|
-
}
|
|
998
|
-
/** Structured code-change / CI event. */
|
|
999
|
-
interface CodeChange {
|
|
1000
|
-
/** Files touched by the change. */
|
|
1001
|
-
files: string[];
|
|
1002
|
-
lintErrors?: LintError[];
|
|
1003
|
-
testFailures?: TestFailure[];
|
|
1004
|
-
}
|
|
1005
|
-
/** Options for {@link codeChangeBridge}. */
|
|
1006
|
-
interface CodeChangeBridgeOptions {
|
|
1007
|
-
/** Name for the effect node (default "code-change-bridge"). */
|
|
1008
|
-
name?: string;
|
|
1009
|
-
/** Default severity for generated IntakeItems (default "high"). */
|
|
1010
|
-
defaultSeverity?: Severity;
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* Intake bridge for code-change / CI events.
|
|
1014
|
-
*
|
|
1015
|
-
* Watches a source node for `CodeChange` events and publishes one
|
|
1016
|
-
* `IntakeItem` per lint error and per test failure to the intake topic.
|
|
1017
|
-
* Pass a custom `parser` to override the default mapping.
|
|
1018
|
-
*
|
|
1019
|
-
* @param source - Node emitting CodeChange events.
|
|
1020
|
-
* @param intakeTopic - TopicGraph to publish IntakeItem entries to.
|
|
1021
|
-
* @param parser - Optional custom parser (overrides default).
|
|
1022
|
-
* @param opts - Optional configuration.
|
|
1023
|
-
*/
|
|
1024
|
-
declare function codeChangeBridge(source: Node<CodeChange>, intakeTopic: TopicGraph<IntakeItem>, parser?: (change: CodeChange) => IntakeItem[], opts?: CodeChangeBridgeOptions): Node<unknown>;
|
|
1025
|
-
/** Transport function for {@link notifyEffect}. Sync or async. */
|
|
1026
|
-
type NotifyTransport<T> = (item: T) => void | Promise<void>;
|
|
1027
|
-
/** Options for {@link notifyEffect}. */
|
|
1028
|
-
interface NotifyEffectOptions {
|
|
1029
|
-
/** Name for the effect node (default "notify-effect"). */
|
|
1030
|
-
name?: string;
|
|
1031
|
-
}
|
|
1032
|
-
/**
|
|
1033
|
-
* Effect node that sends each new topic entry to an external channel.
|
|
1034
|
-
*
|
|
1035
|
-
* The `transport` function is called for every item published to `topic`.
|
|
1036
|
-
* Async transports are bridged via `fromAny` (spec §5.10 compliant).
|
|
1037
|
-
*
|
|
1038
|
-
* Typical use: Slack webhook, GitHub PR comment, email notification, etc.
|
|
1039
|
-
* The factory provides reactive wiring; the transport supplies domain logic.
|
|
1040
|
-
*
|
|
1041
|
-
* ```ts
|
|
1042
|
-
* notifyEffect(alertQueue, async (item) => {
|
|
1043
|
-
* await fetch(SLACK_WEBHOOK, { method: 'POST', body: JSON.stringify({ text: item.summary }) });
|
|
1044
|
-
* });
|
|
1045
|
-
* ```
|
|
1046
|
-
*
|
|
1047
|
-
* @param topic - TopicGraph whose latest entry triggers the notification.
|
|
1048
|
-
* @param transport - Called with each new item. May return a Promise.
|
|
1049
|
-
* @param opts - Optional configuration.
|
|
1050
|
-
*/
|
|
1051
|
-
declare function notifyEffect<T>(topic: TopicGraph<T>, transport: NotifyTransport<T>, opts?: NotifyEffectOptions): Node<unknown>;
|
|
1052
|
-
|
|
1053
|
-
/**
|
|
1054
|
-
* Strategy model and priority scoring (roadmap §9.0).
|
|
1055
|
-
*
|
|
1056
|
-
* Pure-computation derived nodes — no LLM, no async.
|
|
1057
|
-
*
|
|
1058
|
-
* @module
|
|
1059
|
-
*/
|
|
1060
|
-
|
|
1061
|
-
/** Snapshot shape for the strategy model node. */
|
|
1062
|
-
type StrategySnapshot = ReadonlyMap<StrategyKey, StrategyEntry>;
|
|
1063
|
-
/** Bundle returned by {@link strategyModel}. */
|
|
1064
|
-
interface StrategyModelBundle {
|
|
1065
|
-
/** Reactive node — current strategy map. */
|
|
1066
|
-
readonly node: Node<StrategySnapshot>;
|
|
1067
|
-
/** Record a completed issue (success or failure). */
|
|
1068
|
-
record(rootCause: RootCause, intervention: Intervention, success: boolean): void;
|
|
1069
|
-
/** Look up effectiveness for a specific pair. */
|
|
1070
|
-
lookup(rootCause: RootCause, intervention: Intervention): StrategyEntry | undefined;
|
|
1071
|
-
/** Tear down internal keepalive subscriptions. */
|
|
1072
|
-
dispose(): void;
|
|
1073
|
-
}
|
|
1074
|
-
/**
|
|
1075
|
-
* Create a strategy model that tracks `rootCause × intervention → successRate`
|
|
1076
|
-
* over completed issues. Pure derived computation — no LLM.
|
|
1077
|
-
*
|
|
1078
|
-
* The model feeds back into TRIAGE for routing hints.
|
|
1079
|
-
*/
|
|
1080
|
-
declare function strategyModel(): StrategyModelBundle;
|
|
1081
|
-
/**
|
|
1082
|
-
* Create a priority scoring derived node for a single triaged item.
|
|
1083
|
-
*
|
|
1084
|
-
* Combines severity weight, attention decay, strategy model effectiveness,
|
|
1085
|
-
* and an optional external urgency signal.
|
|
1086
|
-
*
|
|
1087
|
-
* @param item - Node holding the triaged item.
|
|
1088
|
-
* @param strategy - Strategy model node.
|
|
1089
|
-
* @param lastInteractionNs - Node holding the monotonic timestamp (ns) of last human interaction.
|
|
1090
|
-
* @param urgency - Optional external urgency signal node (0–1 scale).
|
|
1091
|
-
* @param signals - Configurable scoring parameters.
|
|
1092
|
-
*/
|
|
1093
|
-
declare function priorityScore(item: Node<TriagedItem>, strategy: Node<StrategySnapshot>, lastInteractionNs: Node<number>, urgency?: Node<number>, signals?: PrioritySignals): Node<number>;
|
|
1094
|
-
|
|
1095
|
-
/**
|
|
1096
|
-
* harnessLoop() factory (roadmap §9.0).
|
|
1097
|
-
*
|
|
1098
|
-
* Wires the static 7-stage topology: INTAKE → TRIAGE → QUEUE → GATE →
|
|
1099
|
-
* EXECUTE → VERIFY → REFLECT. Static topology, flowing data — the Kafka
|
|
1100
|
-
* insight applied to human+LLM collaboration.
|
|
1101
|
-
*
|
|
1102
|
-
* @module
|
|
1103
|
-
*/
|
|
1104
|
-
|
|
1105
|
-
/** The graph returned by {@link harnessLoop}. */
|
|
1106
|
-
declare class HarnessGraph extends Graph {
|
|
1107
|
-
/** Intake topic — publish items here to enter the loop. */
|
|
1108
|
-
readonly intake: TopicGraph<IntakeItem>;
|
|
1109
|
-
/** Per-route queue topics. */
|
|
1110
|
-
readonly queues: ReadonlyMap<QueueRoute, TopicGraph<TriagedItem>>;
|
|
1111
|
-
/** Per-route gate controllers (only for gated queues). */
|
|
1112
|
-
readonly gates: ReadonlyMap<QueueRoute, GateController<TriagedItem>>;
|
|
1113
|
-
/** Strategy model bundle — record outcomes, lookup effectiveness. */
|
|
1114
|
-
readonly strategy: StrategyModelBundle;
|
|
1115
|
-
/** Verify results topic — subscribe to see verification outcomes. */
|
|
1116
|
-
readonly verifyResults: TopicGraph<VerifyResult>;
|
|
1117
|
-
/** Global retry count across all items (circuit breaker). Reactive — subscribable. */
|
|
1118
|
-
readonly totalRetries: Node<number>;
|
|
1119
|
-
/** Global reingestion count across all items (circuit breaker). Reactive — subscribable. */
|
|
1120
|
-
readonly totalReingestions: Node<number>;
|
|
1121
|
-
constructor(name: string, intake: TopicGraph<IntakeItem>, queues: Map<QueueRoute, TopicGraph<TriagedItem>>, gates: Map<QueueRoute, GateController<TriagedItem>>, strategy: StrategyModelBundle, verifyResults: TopicGraph<VerifyResult>, totalRetries: Node<number>, totalReingestions: Node<number>);
|
|
1122
|
-
}
|
|
1123
|
-
/**
|
|
1124
|
-
* Wire the reactive collaboration loop as a static-topology graph.
|
|
1125
|
-
*
|
|
1126
|
-
* The loop has 7 stages:
|
|
1127
|
-
* 1. **INTAKE** — items arrive from multiple sources via `intake.publish()`
|
|
1128
|
-
* 2. **TRIAGE** — promptNode classifies, routes, and prioritizes
|
|
1129
|
-
* 3. **QUEUE** — 4 priority-ordered TopicGraphs (auto-fix, needs-decision, investigation, backlog)
|
|
1130
|
-
* 4. **GATE** — human approval on configurable queues
|
|
1131
|
-
* 5. **EXECUTE** — promptNode or human implements the fix
|
|
1132
|
-
* 6. **VERIFY** — promptNode reviews + optional fast-retry
|
|
1133
|
-
* 7. **REFLECT** — strategy model records outcomes
|
|
1134
|
-
*
|
|
1135
|
-
* @param name - Graph name.
|
|
1136
|
-
* @param opts - Configuration.
|
|
1137
|
-
* @returns HarnessGraph with controller accessors.
|
|
1138
|
-
*/
|
|
1139
|
-
declare function harnessLoop(name: string, opts: HarnessLoopOptions): HarnessGraph;
|
|
1140
|
-
|
|
1141
|
-
/**
|
|
1142
|
-
* Harness-specific graph profiling (roadmap §9.0).
|
|
1143
|
-
*
|
|
1144
|
-
* Extends {@link graphProfile} with harness domain counters:
|
|
1145
|
-
* queue depths, strategy entries, retry/reingestion tracker sizes.
|
|
1146
|
-
*
|
|
1147
|
-
* @module
|
|
1148
|
-
*/
|
|
1149
|
-
|
|
1150
|
-
/** Harness-specific profile extending the base graph profile. */
|
|
1151
|
-
interface HarnessProfileResult extends GraphProfileResult {
|
|
1152
|
-
/** Per-queue retained item counts. */
|
|
1153
|
-
queueDepths: Record<QueueRoute, number>;
|
|
1154
|
-
/** Number of rootCause→intervention entries in the strategy model. */
|
|
1155
|
-
strategyEntries: number;
|
|
1156
|
-
/** Global retry count across all items. */
|
|
1157
|
-
totalRetries: number;
|
|
1158
|
-
/** Global reingestion count across all items. */
|
|
1159
|
-
totalReingestions: number;
|
|
1160
|
-
}
|
|
1161
|
-
/**
|
|
1162
|
-
* Profile a harness graph with domain-specific counters.
|
|
1163
|
-
*
|
|
1164
|
-
* @param harness - The HarnessGraph to profile.
|
|
1165
|
-
* @param opts - Optional base profile options.
|
|
1166
|
-
* @returns Harness profile with queue depths, strategy stats, and tracker sizes.
|
|
1167
|
-
*/
|
|
1168
|
-
declare function harnessProfile(harness: HarnessGraph, opts?: GraphProfileOptions): HarnessProfileResult;
|
|
1169
|
-
|
|
1170
|
-
/**
|
|
1171
|
-
* Harness pipeline trace (roadmap §9.0 — Inspection Tool Consolidation).
|
|
1172
|
-
*
|
|
1173
|
-
* Attaches reactive observers (via `observe()`) to all harness stages.
|
|
1174
|
-
* One call gives full pipeline visibility with stage labels and elapsed
|
|
1175
|
-
* timestamps relative to the `harnessTrace()` invocation time.
|
|
1176
|
-
*
|
|
1177
|
-
* Supports two output modes:
|
|
1178
|
-
* - **String logger** (default): rendered lines to `console.log` or a custom sink.
|
|
1179
|
-
* - **Structured events**: programmatic `TraceEvent[]` list for test assertions
|
|
1180
|
-
* and tooling. Access via `handle.events`.
|
|
1181
|
-
*
|
|
1182
|
-
* Supports configurable detail levels (`"summary"`, `"standard"`, `"full"`)
|
|
1183
|
-
* to control output verbosity without composing different tool calls.
|
|
1184
|
-
*
|
|
1185
|
-
* @module
|
|
1186
|
-
*/
|
|
1187
|
-
|
|
1188
|
-
/** Event type captured by structured trace. */
|
|
1189
|
-
type TraceEventType = "data" | "error" | "complete";
|
|
1190
|
-
/** A single structured trace event. */
|
|
1191
|
-
interface TraceEvent {
|
|
1192
|
-
/** Elapsed seconds since trace was created. */
|
|
1193
|
-
elapsed: number;
|
|
1194
|
-
/** Pipeline stage label (INTAKE, TRIAGE, QUEUE, GATE, EXECUTE, VERIFY, STRATEGY). */
|
|
1195
|
-
stage: string;
|
|
1196
|
-
/** Event type. */
|
|
1197
|
-
type: TraceEventType;
|
|
1198
|
-
/** Data payload (present for "data" and "error" events). Omitted at "summary" detail. */
|
|
1199
|
-
data?: unknown;
|
|
1200
|
-
/** Human-readable summary of the data. Present at "standard" and "full" detail. */
|
|
1201
|
-
summary?: string;
|
|
1202
|
-
}
|
|
1203
|
-
/** Detail level for trace output. */
|
|
1204
|
-
type TraceDetail =
|
|
1205
|
-
/** Stage + elapsed only. No data preview. Lowest overhead. */
|
|
1206
|
-
"summary"
|
|
1207
|
-
/** Stage + elapsed + truncated data preview. Default. */
|
|
1208
|
-
| "standard"
|
|
1209
|
-
/** Stage + elapsed + full raw data. Use for debugging, not production. */
|
|
1210
|
-
| "full";
|
|
1211
|
-
/** Handle returned by {@link harnessTrace}. Call `dispose()` to stop tracing. */
|
|
1212
|
-
interface HarnessTraceHandle {
|
|
1213
|
-
/** Stop tracing and detach all observers. Safe to call multiple times. */
|
|
1214
|
-
dispose(): void;
|
|
1215
|
-
/**
|
|
1216
|
-
* Structured trace events collected since creation. Plain array — no
|
|
1217
|
-
* subscription needed (COMPOSITION-GUIDE §1: avoid lazy-activation
|
|
1218
|
-
* friction for inspection tools). Populated reactively via observe().
|
|
1219
|
-
*/
|
|
1220
|
-
readonly events: readonly TraceEvent[];
|
|
1221
|
-
}
|
|
1222
|
-
/** Options for {@link harnessTrace}. */
|
|
1223
|
-
interface HarnessTraceOptions {
|
|
1224
|
-
/** Sink for rendered trace lines. Default: `console.log`. */
|
|
1225
|
-
logger?: (line: string) => void;
|
|
1226
|
-
/** Detail level for both string and structured output. Default: `"summary"`. */
|
|
1227
|
-
detail?: TraceDetail;
|
|
1228
|
-
}
|
|
1229
|
-
/**
|
|
1230
|
-
* Attach reactive trace observers to all harness pipeline stages.
|
|
1231
|
-
*
|
|
1232
|
-
* Wires `graph.observe(path, { format: "json" })` to each stage node,
|
|
1233
|
-
* intercepting the logger callback to emit stage-labeled lines with
|
|
1234
|
-
* elapsed timestamps. Surfaces DATA, ERROR, and COMPLETE events.
|
|
1235
|
-
*
|
|
1236
|
-
* **Structured events:** Every trace event is also pushed to
|
|
1237
|
-
* `handle.events` — a plain array (not a reactive node) that tests and
|
|
1238
|
-
* tooling can inspect programmatically. To use structured events alone
|
|
1239
|
-
* without string output, pass `{ logger: null }`.
|
|
1240
|
-
*
|
|
1241
|
-
* **Detail levels:**
|
|
1242
|
-
* - `"summary"` — stage + elapsed only. Minimal overhead.
|
|
1243
|
-
* - `"standard"` (default) — stage + elapsed + truncated data preview.
|
|
1244
|
-
* - `"full"` — stage + elapsed + full raw data object in events.
|
|
1245
|
-
*
|
|
1246
|
-
* Elapsed timestamps are relative to the `harnessTrace()` invocation time,
|
|
1247
|
-
* not the first event.
|
|
1248
|
-
*
|
|
1249
|
-
* @param harness - The HarnessGraph to trace.
|
|
1250
|
-
* @param opts - Optional configuration.
|
|
1251
|
-
* @returns Handle with `dispose()` to stop tracing and `events` for structured access.
|
|
1252
|
-
*/
|
|
1253
|
-
declare function harnessTrace(harness: HarnessGraph, opts?: HarnessTraceOptions): HarnessTraceHandle;
|
|
1254
|
-
|
|
1255
|
-
/**
|
|
1256
|
-
* Harness wiring (roadmap §9.0).
|
|
1257
|
-
*
|
|
1258
|
-
* Reactive collaboration loop: static-topology, flowing data.
|
|
1259
|
-
* Composes orchestration (gate), AI (promptNode), reduction (scorer/stratify),
|
|
1260
|
-
* and messaging (TopicGraph/bridge) into a 7-stage loop.
|
|
1261
|
-
*
|
|
1262
|
-
* @module
|
|
1263
|
-
*/
|
|
1264
|
-
|
|
1265
|
-
type index$2_CodeChange = CodeChange;
|
|
1266
|
-
type index$2_CodeChangeBridgeOptions = CodeChangeBridgeOptions;
|
|
1267
|
-
declare const index$2_DEFAULT_DECAY_RATE: typeof DEFAULT_DECAY_RATE;
|
|
1268
|
-
declare const index$2_DEFAULT_QUEUE_CONFIGS: typeof DEFAULT_QUEUE_CONFIGS;
|
|
1269
|
-
declare const index$2_DEFAULT_SEVERITY_WEIGHTS: typeof DEFAULT_SEVERITY_WEIGHTS;
|
|
1270
|
-
type index$2_ErrorClass = ErrorClass;
|
|
1271
|
-
type index$2_ErrorClassifier = ErrorClassifier;
|
|
1272
|
-
type index$2_EvalDelta = EvalDelta;
|
|
1273
|
-
type index$2_EvalIntakeBridgeOptions = EvalIntakeBridgeOptions;
|
|
1274
|
-
type index$2_EvalJudgeScore = EvalJudgeScore;
|
|
1275
|
-
type index$2_EvalResult = EvalResult;
|
|
1276
|
-
type index$2_EvalTaskDelta = EvalTaskDelta;
|
|
1277
|
-
type index$2_EvalTaskResult = EvalTaskResult;
|
|
1278
|
-
type index$2_ExecuteOutput = ExecuteOutput;
|
|
1279
|
-
type index$2_ExecutionResult = ExecutionResult;
|
|
1280
|
-
type index$2_HarnessGraph = HarnessGraph;
|
|
1281
|
-
declare const index$2_HarnessGraph: typeof HarnessGraph;
|
|
1282
|
-
type index$2_HarnessLoopOptions = HarnessLoopOptions;
|
|
1283
|
-
type index$2_HarnessProfileResult = HarnessProfileResult;
|
|
1284
|
-
type index$2_HarnessTraceHandle = HarnessTraceHandle;
|
|
1285
|
-
type index$2_HarnessTraceOptions = HarnessTraceOptions;
|
|
1286
|
-
type index$2_IntakeBridgeOptions = IntakeBridgeOptions;
|
|
1287
|
-
type index$2_IntakeItem = IntakeItem;
|
|
1288
|
-
type index$2_IntakeSource = IntakeSource;
|
|
1289
|
-
type index$2_Intervention = Intervention;
|
|
1290
|
-
type index$2_LintError = LintError;
|
|
1291
|
-
type index$2_NotifyEffectOptions = NotifyEffectOptions;
|
|
1292
|
-
type index$2_NotifyTransport<T> = NotifyTransport<T>;
|
|
1293
|
-
type index$2_PrioritySignals = PrioritySignals;
|
|
1294
|
-
declare const index$2_QUEUE_NAMES: typeof QUEUE_NAMES;
|
|
1295
|
-
type index$2_QueueConfig = QueueConfig;
|
|
1296
|
-
type index$2_QueueRoute = QueueRoute;
|
|
1297
|
-
type index$2_RootCause = RootCause;
|
|
1298
|
-
type index$2_Severity = Severity;
|
|
1299
|
-
type index$2_StrategyEntry = StrategyEntry;
|
|
1300
|
-
type index$2_StrategyKey = StrategyKey;
|
|
1301
|
-
type index$2_StrategyModelBundle = StrategyModelBundle;
|
|
1302
|
-
type index$2_StrategySnapshot = StrategySnapshot;
|
|
1303
|
-
type index$2_TestFailure = TestFailure;
|
|
1304
|
-
type index$2_TraceDetail = TraceDetail;
|
|
1305
|
-
type index$2_TraceEvent = TraceEvent;
|
|
1306
|
-
type index$2_TraceEventType = TraceEventType;
|
|
1307
|
-
type index$2_TriagedItem = TriagedItem;
|
|
1308
|
-
type index$2_VerifyResult = VerifyResult;
|
|
1309
|
-
declare const index$2_affectedTaskFilter: typeof affectedTaskFilter;
|
|
1310
|
-
declare const index$2_beforeAfterCompare: typeof beforeAfterCompare;
|
|
1311
|
-
declare const index$2_codeChangeBridge: typeof codeChangeBridge;
|
|
1312
|
-
declare const index$2_createIntakeBridge: typeof createIntakeBridge;
|
|
1313
|
-
declare const index$2_defaultErrorClassifier: typeof defaultErrorClassifier;
|
|
1314
|
-
declare const index$2_evalIntakeBridge: typeof evalIntakeBridge;
|
|
1315
|
-
declare const index$2_evalSource: typeof evalSource;
|
|
1316
|
-
declare const index$2_harnessLoop: typeof harnessLoop;
|
|
1317
|
-
declare const index$2_harnessProfile: typeof harnessProfile;
|
|
1318
|
-
declare const index$2_harnessTrace: typeof harnessTrace;
|
|
1319
|
-
declare const index$2_notifyEffect: typeof notifyEffect;
|
|
1320
|
-
declare const index$2_priorityScore: typeof priorityScore;
|
|
1321
|
-
declare const index$2_strategyKey: typeof strategyKey;
|
|
1322
|
-
declare const index$2_strategyModel: typeof strategyModel;
|
|
1323
|
-
declare namespace index$2 {
|
|
1324
|
-
export { type index$2_CodeChange as CodeChange, type index$2_CodeChangeBridgeOptions as CodeChangeBridgeOptions, index$2_DEFAULT_DECAY_RATE as DEFAULT_DECAY_RATE, index$2_DEFAULT_QUEUE_CONFIGS as DEFAULT_QUEUE_CONFIGS, index$2_DEFAULT_SEVERITY_WEIGHTS as DEFAULT_SEVERITY_WEIGHTS, type index$2_ErrorClass as ErrorClass, type index$2_ErrorClassifier as ErrorClassifier, type index$2_EvalDelta as EvalDelta, type index$2_EvalIntakeBridgeOptions as EvalIntakeBridgeOptions, type index$2_EvalJudgeScore as EvalJudgeScore, type index$2_EvalResult as EvalResult, type index$2_EvalTaskDelta as EvalTaskDelta, type index$2_EvalTaskResult as EvalTaskResult, type index$2_ExecuteOutput as ExecuteOutput, type index$2_ExecutionResult as ExecutionResult, index$2_HarnessGraph as HarnessGraph, type index$2_HarnessLoopOptions as HarnessLoopOptions, type index$2_HarnessProfileResult as HarnessProfileResult, type index$2_HarnessTraceHandle as HarnessTraceHandle, type index$2_HarnessTraceOptions as HarnessTraceOptions, type index$2_IntakeBridgeOptions as IntakeBridgeOptions, type index$2_IntakeItem as IntakeItem, type index$2_IntakeSource as IntakeSource, type index$2_Intervention as Intervention, type index$2_LintError as LintError, type index$2_NotifyEffectOptions as NotifyEffectOptions, type index$2_NotifyTransport as NotifyTransport, type index$2_PrioritySignals as PrioritySignals, index$2_QUEUE_NAMES as QUEUE_NAMES, type index$2_QueueConfig as QueueConfig, type index$2_QueueRoute as QueueRoute, type index$2_RootCause as RootCause, type index$2_Severity as Severity, type index$2_StrategyEntry as StrategyEntry, type index$2_StrategyKey as StrategyKey, type index$2_StrategyModelBundle as StrategyModelBundle, type index$2_StrategySnapshot as StrategySnapshot, type index$2_TestFailure as TestFailure, type index$2_TraceDetail as TraceDetail, type index$2_TraceEvent as TraceEvent, type index$2_TraceEventType as TraceEventType, type index$2_TriagedItem as TriagedItem, type index$2_VerifyResult as VerifyResult, index$2_affectedTaskFilter as affectedTaskFilter, index$2_beforeAfterCompare as beforeAfterCompare, index$2_codeChangeBridge as codeChangeBridge, index$2_createIntakeBridge as createIntakeBridge, index$2_defaultErrorClassifier as defaultErrorClassifier, index$2_evalIntakeBridge as evalIntakeBridge, index$2_evalSource as evalSource, index$2_harnessLoop as harnessLoop, index$2_harnessProfile as harnessProfile, index$2_harnessTrace as harnessTrace, index$2_notifyEffect as notifyEffect, index$2_priorityScore as priorityScore, index$2_strategyKey as strategyKey, index$2_strategyModel as strategyModel };
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
/** Aggregate topology stats emitted by {@link LensGraph.stats}. */
|
|
1328
|
-
interface TopologyStats {
|
|
1329
|
-
/** Total primary nodes across this graph and all transitively mounted subgraphs. */
|
|
1330
|
-
nodeCount: number;
|
|
1331
|
-
/** Total directed edges (derived from deps; no duplicates). */
|
|
1332
|
-
edgeCount: number;
|
|
1333
|
-
/** Count of mounted subgraphs (transitive). */
|
|
1334
|
-
subgraphCount: number;
|
|
1335
|
-
/** Qualified paths with no upstream deps (source nodes). Sorted. */
|
|
1336
|
-
sources: readonly string[];
|
|
1337
|
-
/** Qualified paths with no downstream consumers in-graph (sink nodes). Sorted. */
|
|
1338
|
-
sinks: readonly string[];
|
|
1339
|
-
/** Longest path from any source to any sink (in edges). `0` for empty graphs. */
|
|
1340
|
-
depth: number;
|
|
1341
|
-
/** `true` if the dep DAG contains a cycle (feedback edge). */
|
|
1342
|
-
hasCycles: boolean;
|
|
1343
|
-
}
|
|
1344
|
-
/** A single health problem entry. */
|
|
1345
|
-
interface HealthProblem {
|
|
1346
|
-
path: string;
|
|
1347
|
-
/** V1 only reports `"errored"`. Future versions may add `"completed"`, `"disconnected"`. */
|
|
1348
|
-
status: "errored";
|
|
1349
|
-
/** First errored upstream ancestor along the dep chain, when one exists and is distinct from `path`. */
|
|
1350
|
-
upstreamCause?: string;
|
|
1351
|
-
}
|
|
1352
|
-
/** Aggregate health snapshot. `ok=true` iff `problems.length === 0`. */
|
|
1353
|
-
interface HealthReport {
|
|
1354
|
-
ok: boolean;
|
|
1355
|
-
problems: readonly HealthProblem[];
|
|
1356
|
-
}
|
|
1357
|
-
/** One per-path flow entry stored in {@link LensGraph.flow}. */
|
|
1358
|
-
interface FlowEntry {
|
|
1359
|
-
path: string;
|
|
1360
|
-
/** Cumulative DATA emissions observed since the lens activated. */
|
|
1361
|
-
count: number;
|
|
1362
|
-
/** `monotonicNs()` at the most recent DATA emission, or `null` if none yet. */
|
|
1363
|
-
lastUpdate_ns: number | null;
|
|
1364
|
-
}
|
|
1365
|
-
/** Options for {@link graphLens}. */
|
|
1366
|
-
interface GraphLensOptions {
|
|
1367
|
-
name?: string;
|
|
1368
|
-
graph?: GraphOptions;
|
|
1369
|
-
/**
|
|
1370
|
-
* Limit which node paths `flow` tracks. When omitted, every path in
|
|
1371
|
-
* `target.describe()` is observed. Recommended for graphs with hundreds
|
|
1372
|
-
* of nodes since each tracked path adds one observe-event dispatch per
|
|
1373
|
-
* DATA emission.
|
|
1374
|
-
*/
|
|
1375
|
-
pathFilter?: (path: string) => boolean;
|
|
1376
|
-
/**
|
|
1377
|
-
* LRU cap on the {@link LensGraph.flow} map. When set, the flow tracker
|
|
1378
|
-
* evicts least-recently-used paths (by insertion / set order) once the
|
|
1379
|
-
* entry count exceeds this bound. Omit for unbounded (not recommended
|
|
1380
|
-
* for long-running graphs with churning paths). Passed through to the
|
|
1381
|
-
* underlying {@link reactiveMap}'s `maxSize`.
|
|
1382
|
-
*/
|
|
1383
|
-
maxFlowPaths?: number;
|
|
1384
|
-
}
|
|
1385
|
-
/**
|
|
1386
|
-
* Reactive observability surface for a target {@link Graph}.
|
|
1387
|
-
* See {@link graphLens}.
|
|
1388
|
-
*
|
|
1389
|
-
* @category observability
|
|
1390
|
-
*/
|
|
1391
|
-
declare class LensGraph extends Graph {
|
|
1392
|
-
/**
|
|
1393
|
-
* Aggregate structural stats — `nodeCount`, `edgeCount`, `sources`,
|
|
1394
|
-
* `sinks`, `depth`, `hasCycles`, `subgraphCount`. Recomputes on every
|
|
1395
|
-
* structural change via {@link watchTopologyTree} (transitive).
|
|
1396
|
-
*
|
|
1397
|
-
* Named `stats` (not `topology`) because `Graph.topology` already names
|
|
1398
|
-
* the raw `TopologyEvent` stream on every graph including `LensGraph`;
|
|
1399
|
-
* giving the lens its own `topology` accessor with an incompatible
|
|
1400
|
-
* `Node<TopologyStats>` type would break Liskov substitutability.
|
|
1401
|
-
*/
|
|
1402
|
-
readonly stats: Node<TopologyStats>;
|
|
1403
|
-
readonly health: Node<HealthReport>;
|
|
1404
|
-
/**
|
|
1405
|
-
* Per-path flow tracker — a live {@link ReactiveMapBundle} keyed by
|
|
1406
|
-
* qualified path. Use `.get(path)` / `.has(path)` / `.size` for O(1)
|
|
1407
|
-
* sync queries; subscribe to `.entries` for a reactive snapshot of the
|
|
1408
|
-
* whole map. Lazy — the snapshot is materialized only while `.entries`
|
|
1409
|
-
* has subscribers.
|
|
1410
|
-
*
|
|
1411
|
-
* Shape intentionally differs from `stats` / `health` (which are plain
|
|
1412
|
-
* `Node<Report>`) because `flow` is a keyed collection, not a single
|
|
1413
|
-
* aggregate value. The map shape exposes cheaper queries than any
|
|
1414
|
-
* snapshot-based design.
|
|
1415
|
-
*/
|
|
1416
|
-
readonly flow: ReactiveMapBundle<string, FlowEntry>;
|
|
1417
|
-
private readonly _target;
|
|
1418
|
-
constructor(target: Graph, opts?: GraphLensOptions);
|
|
1419
|
-
/**
|
|
1420
|
-
* Live causal chain from `from` to `to`. Recomputes whenever the target
|
|
1421
|
-
* mutates. Disposed automatically when the lens is destroyed.
|
|
1422
|
-
*
|
|
1423
|
-
* **Lifetime note:** every call to `why()` registers a lens-owned disposer
|
|
1424
|
-
* that runs on `lens.destroy()`. The returned `dispose` function releases
|
|
1425
|
-
* the internal subscription but does NOT remove the lens-owned disposer —
|
|
1426
|
-
* so heavy calling (e.g. per render frame) accumulates no-op disposers
|
|
1427
|
-
* until lens teardown. Cache the returned handle for long-lived queries.
|
|
1428
|
-
*
|
|
1429
|
-
* @param from - Qualified path of the upstream endpoint.
|
|
1430
|
-
* @param to - Qualified path of the downstream endpoint.
|
|
1431
|
-
* @param opts - See {@link reactiveExplainPath}.
|
|
1432
|
-
*/
|
|
1433
|
-
why(from: string, to: string, opts?: {
|
|
1434
|
-
maxDepth?: number;
|
|
1435
|
-
name?: string;
|
|
1436
|
-
findCycle?: boolean;
|
|
1437
|
-
}): {
|
|
1438
|
-
node: Node<CausalChain>;
|
|
1439
|
-
dispose: () => void;
|
|
1440
|
-
};
|
|
1441
|
-
/** Reference to the lensed graph. */
|
|
1442
|
-
get target(): Graph;
|
|
1443
|
-
}
|
|
1444
|
-
/**
|
|
1445
|
-
* Create a reactive observability lens over a {@link Graph}. Returns a
|
|
1446
|
-
* {@link LensGraph} with three reactive surfaces (`stats`, `health`, `flow`)
|
|
1447
|
-
* plus the `why(from, to)` method.
|
|
1448
|
-
*
|
|
1449
|
-
* The returned graph is detached. Mount it via `target.mount("lens", lens)`
|
|
1450
|
-
* if you want it to appear in the target's `describe()`, or keep it standalone.
|
|
1451
|
-
*
|
|
1452
|
-
* @param target - The graph to observe.
|
|
1453
|
-
* @param opts - See {@link GraphLensOptions}.
|
|
1454
|
-
*
|
|
1455
|
-
* @example
|
|
1456
|
-
* ```ts
|
|
1457
|
-
* const g = new Graph("app");
|
|
1458
|
-
* g.add("counter", state(0));
|
|
1459
|
-
* const lens = graphLens(g);
|
|
1460
|
-
* lens.stats.subscribe((msgs) => console.log(msgs[0]?.[1])); // TopologyStats
|
|
1461
|
-
* // Flow queries — O(1) without subscribing to snapshots:
|
|
1462
|
-
* lens.flow.get("counter"); // FlowEntry | undefined
|
|
1463
|
-
* lens.flow.size; // number
|
|
1464
|
-
* lens.flow.entries.subscribe(...); // reactive snapshot, lazy-materialized
|
|
1465
|
-
* ```
|
|
1466
|
-
*
|
|
1467
|
-
* @category observability
|
|
1468
|
-
*/
|
|
1469
|
-
declare function graphLens(target: Graph, opts?: GraphLensOptions): LensGraph;
|
|
1470
|
-
|
|
1471
|
-
type lens_FlowEntry = FlowEntry;
|
|
1472
|
-
type lens_GraphLensOptions = GraphLensOptions;
|
|
1473
|
-
type lens_HealthProblem = HealthProblem;
|
|
1474
|
-
type lens_HealthReport = HealthReport;
|
|
1475
|
-
type lens_LensGraph = LensGraph;
|
|
1476
|
-
declare const lens_LensGraph: typeof LensGraph;
|
|
1477
|
-
type lens_TopologyStats = TopologyStats;
|
|
1478
|
-
declare const lens_graphLens: typeof graphLens;
|
|
1479
|
-
declare const lens_watchTopologyTree: typeof watchTopologyTree;
|
|
1480
|
-
declare namespace lens {
|
|
1481
|
-
export { type lens_FlowEntry as FlowEntry, type lens_GraphLensOptions as GraphLensOptions, type lens_HealthProblem as HealthProblem, type lens_HealthReport as HealthReport, lens_LensGraph as LensGraph, type lens_TopologyStats as TopologyStats, lens_graphLens as graphLens, lens_watchTopologyTree as watchTopologyTree };
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
|
-
/**
|
|
1485
|
-
* Reduction primitives (roadmap §8.1).
|
|
1486
|
-
*
|
|
1487
|
-
* Composable building blocks for taking heterogeneous massive inputs and producing
|
|
1488
|
-
* prioritized, auditable, human-actionable output. Each primitive is either a Graph
|
|
1489
|
-
* factory or a Node factory, built on top of core + extra primitives.
|
|
1490
|
-
*
|
|
1491
|
-
* @module
|
|
1492
|
-
*/
|
|
1493
|
-
|
|
1494
|
-
type StepRef = string | Node<unknown>;
|
|
1495
|
-
/** A single routing rule for {@link stratify}. */
|
|
1496
|
-
type StratifyRule<T> = {
|
|
1497
|
-
/** Branch name (used as node name under `branch/<name>`). */
|
|
1498
|
-
name: string;
|
|
1499
|
-
/** Classifier: returns `true` if the value belongs to this branch. */
|
|
1500
|
-
classify: (value: T) => boolean;
|
|
1501
|
-
/** Optional operator chain applied to the branch after classification. */
|
|
1502
|
-
ops?: (n: Node<T>) => Node;
|
|
1503
|
-
};
|
|
1504
|
-
/** Options for {@link stratify}. */
|
|
1505
|
-
type StratifyOptions = GraphOptions & {
|
|
1506
|
-
meta?: Record<string, unknown>;
|
|
1507
|
-
};
|
|
1508
|
-
/**
|
|
1509
|
-
* Route input to different reduction branches based on classifier functions.
|
|
1510
|
-
*
|
|
1511
|
-
* Each branch gets an independent operator chain. Rules are reactive — update
|
|
1512
|
-
* the `"rules"` state node to rewrite classification at runtime. Rule updates
|
|
1513
|
-
* affect **future items only** (streaming classification, not retroactive).
|
|
1514
|
-
*
|
|
1515
|
-
* Branch nodes are structural — created at construction time and persist for
|
|
1516
|
-
* the graph's lifetime. If a rule name is removed from the rules array, the
|
|
1517
|
-
* corresponding branch silently drops items (classifier not found). To tear
|
|
1518
|
-
* down a dead branch, call `graph.remove("branch/<name>")`.
|
|
1519
|
-
*
|
|
1520
|
-
* @param name - Graph name.
|
|
1521
|
-
* @param source - Input node (registered externally or will be added as `"source"`).
|
|
1522
|
-
* @param rules - Initial routing rules.
|
|
1523
|
-
* @param opts - Optional graph/meta options.
|
|
1524
|
-
* @returns Graph with `"source"`, `"rules"`, and `"branch/<name>"` nodes.
|
|
1525
|
-
*
|
|
1526
|
-
* @category patterns
|
|
1527
|
-
*/
|
|
1528
|
-
declare function stratify<T>(name: string, source: Node<T>, rules: ReadonlyArray<StratifyRule<T>>, opts?: StratifyOptions): Graph;
|
|
1529
|
-
/** A named stage for {@link funnel}. */
|
|
1530
|
-
type FunnelStage = {
|
|
1531
|
-
/** Stage name (mounted as subgraph). */
|
|
1532
|
-
name: string;
|
|
1533
|
-
/** Builder: receives a sub-graph, should add an `"input"` and `"output"` node. */
|
|
1534
|
-
build: (sub: Graph) => void;
|
|
1535
|
-
};
|
|
1536
|
-
/** Options for {@link funnel}. */
|
|
1537
|
-
type FunnelOptions = GraphOptions & {
|
|
1538
|
-
meta?: Record<string, unknown>;
|
|
1539
|
-
};
|
|
1540
|
-
/**
|
|
1541
|
-
* Multi-source merge with sequential reduction stages.
|
|
1542
|
-
*
|
|
1543
|
-
* Sources are merged into a single stream. Each stage is a named subgraph
|
|
1544
|
-
* (mounted via `graph.mount()`). Stages connect linearly:
|
|
1545
|
-
* `merged → stage[0].input → stage[0].output → stage[1].input → ...`
|
|
1546
|
-
*
|
|
1547
|
-
* @param name - Graph name.
|
|
1548
|
-
* @param sources - Input nodes to merge.
|
|
1549
|
-
* @param stages - Sequential reduction stages.
|
|
1550
|
-
* @param opts - Optional graph/meta options.
|
|
1551
|
-
* @returns Graph with `"merged"` and mounted stage subgraphs.
|
|
1552
|
-
*
|
|
1553
|
-
* @category patterns
|
|
1554
|
-
*/
|
|
1555
|
-
declare function funnel<T>(name: string, sources: ReadonlyArray<Node<T>>, stages: ReadonlyArray<FunnelStage>, opts?: FunnelOptions): Graph;
|
|
1556
|
-
/** Options for {@link feedback}. */
|
|
1557
|
-
type FeedbackOptions = {
|
|
1558
|
-
/** Maximum feedback iterations before stopping (default: 10). */
|
|
1559
|
-
maxIterations?: number;
|
|
1560
|
-
/** Optional budget gate node path for cost-bounded iteration. */
|
|
1561
|
-
budgetNode?: StepRef;
|
|
1562
|
-
meta?: Record<string, unknown>;
|
|
1563
|
-
};
|
|
1564
|
-
/**
|
|
1565
|
-
* Introduce a bounded reactive cycle into an existing graph.
|
|
1566
|
-
*
|
|
1567
|
-
* When `condition` emits a non-null DATA value, the feedback effect routes it
|
|
1568
|
-
* back to the `reentry` state node — creating a cycle. Bounded by
|
|
1569
|
-
* `maxIterations` (default 10). The counter node (`__feedback_<condition>`)
|
|
1570
|
-
* is the source of truth — reset it to 0 to allow more iterations.
|
|
1571
|
-
*
|
|
1572
|
-
* To remove the feedback cycle, call `graph.remove("__feedback_<condition>")`.
|
|
1573
|
-
*
|
|
1574
|
-
* @param graph - Existing graph to augment with a feedback cycle.
|
|
1575
|
-
* @param condition - Path to a node whose DATA triggers feedback.
|
|
1576
|
-
* @param reentry - Path to a state node that receives the feedback value.
|
|
1577
|
-
* @param opts - Iteration bounds and metadata.
|
|
1578
|
-
* @returns The same graph (mutated with feedback nodes added).
|
|
1579
|
-
*
|
|
1580
|
-
* @category patterns
|
|
1581
|
-
*/
|
|
1582
|
-
declare function feedback(graph: Graph, condition: string, reentry: string, opts?: FeedbackOptions): Graph;
|
|
1583
|
-
/** A reactive constraint for {@link budgetGate}. */
|
|
1584
|
-
type BudgetConstraint<T = unknown> = {
|
|
1585
|
-
/** Constraint node whose value is checked. */
|
|
1586
|
-
node: Node<T>;
|
|
1587
|
-
/** Returns `true` when the constraint is satisfied (budget available). */
|
|
1588
|
-
check: (value: T) => boolean;
|
|
1589
|
-
};
|
|
1590
|
-
/** Options for {@link budgetGate}. */
|
|
1591
|
-
type BudgetGateOptions = Omit<NodeOptions<unknown>, "describeKind" | "name" | "meta"> & {
|
|
1592
|
-
meta?: Record<string, unknown>;
|
|
1593
|
-
};
|
|
1594
|
-
/**
|
|
1595
|
-
* Pass-through that respects reactive constraint nodes.
|
|
1596
|
-
*
|
|
1597
|
-
* DATA flows through when all constraints are satisfied. When any constraint
|
|
1598
|
-
* is exceeded, PAUSE is sent upstream and DATA is buffered. When constraints
|
|
1599
|
-
* relax, RESUME is sent and buffered DATA flushes.
|
|
1600
|
-
*
|
|
1601
|
-
* @param source - Input node.
|
|
1602
|
-
* @param constraints - Reactive constraint checks.
|
|
1603
|
-
* @param opts - Optional node options.
|
|
1604
|
-
* @returns Gated node.
|
|
1605
|
-
*
|
|
1606
|
-
* @category patterns
|
|
1607
|
-
*/
|
|
1608
|
-
declare function budgetGate<T>(source: Node<T>, constraints: ReadonlyArray<BudgetConstraint>, opts?: BudgetGateOptions): Node<T>;
|
|
1609
|
-
/** A scored item with full breakdown. */
|
|
1610
|
-
type ScoredItem<T = unknown> = {
|
|
1611
|
-
/** Original value. */
|
|
1612
|
-
value: T;
|
|
1613
|
-
/** Final weighted score. */
|
|
1614
|
-
score: number;
|
|
1615
|
-
/** Per-signal breakdown: signal index → weighted contribution. */
|
|
1616
|
-
breakdown: number[];
|
|
1617
|
-
};
|
|
1618
|
-
/** Options for {@link scorer}. */
|
|
1619
|
-
type ScorerOptions = Omit<NodeOptions<unknown>, "describeKind" | "name" | "meta"> & {
|
|
1620
|
-
meta?: Record<string, unknown>;
|
|
1621
|
-
/** Custom scoring function per signal. Default: identity (signal value IS the score). */
|
|
1622
|
-
scoreFns?: ReadonlyArray<(value: unknown) => number>;
|
|
1623
|
-
};
|
|
1624
|
-
/**
|
|
1625
|
-
* Reactive multi-signal scoring with live weights.
|
|
1626
|
-
*
|
|
1627
|
-
* Each source emits items to score. Weights are reactive state nodes that
|
|
1628
|
-
* LLM or human can adjust live. Output is sorted scored items with full
|
|
1629
|
-
* breakdown.
|
|
1630
|
-
*
|
|
1631
|
-
* @param sources - Signal nodes (each emits a numeric score dimension).
|
|
1632
|
-
* @param weights - Reactive weight nodes (one per source).
|
|
1633
|
-
* @param opts - Optional node/meta options.
|
|
1634
|
-
* @returns Node emitting scored output.
|
|
1635
|
-
*
|
|
1636
|
-
* @category patterns
|
|
1637
|
-
*/
|
|
1638
|
-
declare function scorer(sources: ReadonlyArray<Node<number>>, weights: ReadonlyArray<Node<number>>, opts?: ScorerOptions): Node<ScoredItem<number[]>>;
|
|
1639
|
-
/** A single effectiveness record for an action×context pair. */
|
|
1640
|
-
type EffectivenessEntry = {
|
|
1641
|
-
readonly key: string;
|
|
1642
|
-
readonly attempts: number;
|
|
1643
|
-
readonly successes: number;
|
|
1644
|
-
readonly successRate: number;
|
|
1645
|
-
};
|
|
1646
|
-
/** Snapshot shape for the effectiveness tracker node. */
|
|
1647
|
-
type EffectivenessSnapshot = ReadonlyMap<string, EffectivenessEntry>;
|
|
1648
|
-
/** Bundle returned by {@link effectivenessTracker}. */
|
|
1649
|
-
interface EffectivenessTrackerBundle {
|
|
1650
|
-
/** Reactive node — current effectiveness map snapshot. */
|
|
1651
|
-
readonly node: Node<EffectivenessSnapshot>;
|
|
1652
|
-
/** Record a completed action (success or failure). */
|
|
1653
|
-
record(key: string, success: boolean): void;
|
|
1654
|
-
/** Look up effectiveness for a specific key. */
|
|
1655
|
-
lookup(key: string): EffectivenessEntry | undefined;
|
|
1656
|
-
/** Tear down internal keepalive subscriptions. */
|
|
1657
|
-
dispose(): void;
|
|
1658
|
-
}
|
|
1659
|
-
/** Options for {@link effectivenessTracker}. */
|
|
1660
|
-
type EffectivenessTrackerOptions = {
|
|
1661
|
-
/** Name for the reactive map (default "effectiveness-entries"). */
|
|
1662
|
-
name?: string;
|
|
1663
|
-
};
|
|
1664
|
-
/**
|
|
1665
|
-
* Generic action×context → success rate tracker.
|
|
1666
|
-
*
|
|
1667
|
-
* Generalized from the harness `strategyModel` pattern. Tracks attempts and
|
|
1668
|
-
* successes per string key, exposes a reactive snapshot node, and provides
|
|
1669
|
-
* `record()` / `lookup()` methods.
|
|
1670
|
-
*
|
|
1671
|
-
* Use cases: A/B testing, routing optimization, cache policy tuning, retry
|
|
1672
|
-
* strategy selection — any domain that tracks effectiveness per action.
|
|
1673
|
-
*
|
|
1674
|
-
* @param opts - Optional configuration.
|
|
1675
|
-
* @returns Bundle with reactive node, record(), lookup(), dispose().
|
|
1676
|
-
*/
|
|
1677
|
-
declare function effectivenessTracker(opts?: EffectivenessTrackerOptions): EffectivenessTrackerBundle;
|
|
1678
|
-
|
|
1679
|
-
type reduction_BudgetConstraint<T = unknown> = BudgetConstraint<T>;
|
|
1680
|
-
type reduction_BudgetGateOptions = BudgetGateOptions;
|
|
1681
|
-
type reduction_EffectivenessEntry = EffectivenessEntry;
|
|
1682
|
-
type reduction_EffectivenessSnapshot = EffectivenessSnapshot;
|
|
1683
|
-
type reduction_EffectivenessTrackerBundle = EffectivenessTrackerBundle;
|
|
1684
|
-
type reduction_EffectivenessTrackerOptions = EffectivenessTrackerOptions;
|
|
1685
|
-
type reduction_FeedbackOptions = FeedbackOptions;
|
|
1686
|
-
type reduction_FunnelOptions = FunnelOptions;
|
|
1687
|
-
type reduction_FunnelStage = FunnelStage;
|
|
1688
|
-
type reduction_ScoredItem<T = unknown> = ScoredItem<T>;
|
|
1689
|
-
type reduction_ScorerOptions = ScorerOptions;
|
|
1690
|
-
type reduction_StepRef = StepRef;
|
|
1691
|
-
type reduction_StratifyOptions = StratifyOptions;
|
|
1692
|
-
type reduction_StratifyRule<T> = StratifyRule<T>;
|
|
1693
|
-
declare const reduction_budgetGate: typeof budgetGate;
|
|
1694
|
-
declare const reduction_effectivenessTracker: typeof effectivenessTracker;
|
|
1695
|
-
declare const reduction_feedback: typeof feedback;
|
|
1696
|
-
declare const reduction_funnel: typeof funnel;
|
|
1697
|
-
declare const reduction_scorer: typeof scorer;
|
|
1698
|
-
declare const reduction_stratify: typeof stratify;
|
|
1699
|
-
declare namespace reduction {
|
|
1700
|
-
export { type reduction_BudgetConstraint as BudgetConstraint, type reduction_BudgetGateOptions as BudgetGateOptions, type reduction_EffectivenessEntry as EffectivenessEntry, type reduction_EffectivenessSnapshot as EffectivenessSnapshot, type reduction_EffectivenessTrackerBundle as EffectivenessTrackerBundle, type reduction_EffectivenessTrackerOptions as EffectivenessTrackerOptions, type reduction_FeedbackOptions as FeedbackOptions, type reduction_FunnelOptions as FunnelOptions, type reduction_FunnelStage as FunnelStage, type reduction_ScoredItem as ScoredItem, type reduction_ScorerOptions as ScorerOptions, type reduction_StepRef as StepRef, type reduction_StratifyOptions as StratifyOptions, type reduction_StratifyRule as StratifyRule, reduction_budgetGate as budgetGate, reduction_effectivenessTracker as effectivenessTracker, reduction_feedback as feedback, reduction_funnel as funnel, reduction_scorer as scorer, reduction_stratify as stratify };
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
/**
|
|
1704
|
-
* Resilience composition with correct nesting order (roadmap §9.0b).
|
|
1705
|
-
*
|
|
1706
|
-
* {@link resilientPipeline} composes the resilience primitives from
|
|
1707
|
-
* `extra/resilience.ts` in the order discovered during the §9.1 eval runs:
|
|
1708
|
-
*
|
|
1709
|
-
* ```text
|
|
1710
|
-
* rateLimit → budget → breaker → timeout → retry → fallback → status
|
|
1711
|
-
* ```
|
|
1712
|
-
*
|
|
1713
|
-
* Note on retry/timeout ordering: `timeout` is applied BEFORE `retry` so each
|
|
1714
|
-
* retry attempt resubscribes to a fresh deadline (per-attempt semantics). If
|
|
1715
|
-
* `timeout` wrapped `retry`, a single deadline would apply to the entire
|
|
1716
|
-
* retry chain — not what callers expect.
|
|
1717
|
-
*
|
|
1718
|
-
* Every step is optional — omit the option and that layer is skipped. The
|
|
1719
|
-
* returned bundle exposes the final `Node<T>` plus the status/error/breaker
|
|
1720
|
-
* companions so callers can wire them into dashboards, alerts, or
|
|
1721
|
-
* {@link graphLens}.
|
|
1722
|
-
*
|
|
1723
|
-
* Subsumes the pre-1.0 `resilientFetch` template — that template becomes a
|
|
1724
|
-
* preconfigured instance of this factory for the HTTP fetch case.
|
|
1725
|
-
*
|
|
1726
|
-
* @module
|
|
1727
|
-
*/
|
|
1728
|
-
|
|
1729
|
-
/** Options for {@link resilientPipeline}. Every field is optional — omit to skip that layer. */
|
|
1730
|
-
interface ResilientPipelineOptions<T> {
|
|
1731
|
-
/** Admission control — at most `maxEvents` DATA per `windowNs`. See {@link rateLimiter}. */
|
|
1732
|
-
rateLimit?: RateLimiterOptions;
|
|
1733
|
-
/** Cost/constraint gate. See {@link budgetGate}. */
|
|
1734
|
-
budget?: ReadonlyArray<BudgetConstraint>;
|
|
1735
|
-
/** Circuit breaker — fail-fast when the downstream resource is unhealthy. See {@link circuitBreaker}. */
|
|
1736
|
-
breaker?: CircuitBreakerOptions;
|
|
1737
|
-
/**
|
|
1738
|
-
* Behavior when the breaker is open:
|
|
1739
|
-
* - `"skip"` — emit RESOLVED (default, lets downstream drop the beat)
|
|
1740
|
-
* - `"error"` — emit a `CircuitOpenError` so `retry`/`fallback` can react
|
|
1741
|
-
*
|
|
1742
|
-
* Only used when `breaker` is provided.
|
|
1743
|
-
*/
|
|
1744
|
-
breakerOnOpen?: "skip" | "error";
|
|
1745
|
-
/** Retry policy on terminal ERROR. See {@link retry}. */
|
|
1746
|
-
retry?: RetryOptions;
|
|
1747
|
-
/**
|
|
1748
|
-
* Per-attempt deadline in milliseconds. Converted to ns internally. Omit to skip the timeout wrap.
|
|
1749
|
-
*
|
|
1750
|
-
* Specified in ms (not ns) because callers consistently think in millisecond deadlines;
|
|
1751
|
-
* retry/breaker/ratelimit options take ns to match their primitives exactly.
|
|
1752
|
-
*/
|
|
1753
|
-
timeoutMs?: number;
|
|
1754
|
-
/** Final fallback value emitted on terminal ERROR after retry exhausts. See {@link fallback}. */
|
|
1755
|
-
fallback?: FallbackInput<T>;
|
|
1756
|
-
/** Initial status reported by the status node. Default `"pending"`. */
|
|
1757
|
-
initialStatus?: StatusValue;
|
|
1758
|
-
}
|
|
1759
|
-
/** Output bundle of {@link resilientPipeline}. */
|
|
1760
|
-
interface ResilientPipelineBundle<T> {
|
|
1761
|
-
/** The final resilient node. Subscribe to this for DATA emissions. */
|
|
1762
|
-
node: Node<T>;
|
|
1763
|
-
/** Live status: `"pending" | "active" | "completed" | "errored"`. */
|
|
1764
|
-
status: Node<StatusValue>;
|
|
1765
|
-
/** Last error payload, or `null` when not errored. */
|
|
1766
|
-
error: Node<unknown | null>;
|
|
1767
|
-
/** Breaker state when `opts.breaker` was provided; `undefined` otherwise. */
|
|
1768
|
-
breakerState: Node<CircuitState> | undefined;
|
|
1769
|
-
}
|
|
1770
|
-
/**
|
|
1771
|
-
* Compose a resilient pipeline around `source` in the canonical nesting
|
|
1772
|
-
* order — `rateLimit → budget → breaker → timeout → retry → fallback → status`.
|
|
1773
|
-
* Omit any option to skip that layer.
|
|
1774
|
-
*
|
|
1775
|
-
* @param source - Upstream node to wrap.
|
|
1776
|
-
* @param opts - See {@link ResilientPipelineOptions}. All fields optional.
|
|
1777
|
-
*
|
|
1778
|
-
* @example
|
|
1779
|
-
* ```ts
|
|
1780
|
-
* const safeFetch = resilientPipeline(fetchNode, {
|
|
1781
|
-
* rateLimit: { maxEvents: 10, windowNs: NS_PER_SEC },
|
|
1782
|
-
* breaker: { failureThreshold: 5 },
|
|
1783
|
-
* retry: { count: 3, backoff: "exponential" },
|
|
1784
|
-
* timeoutMs: 10_000,
|
|
1785
|
-
* fallback: null,
|
|
1786
|
-
* });
|
|
1787
|
-
* safeFetch.status.subscribe(msgs => console.log(msgs));
|
|
1788
|
-
* ```
|
|
1789
|
-
*
|
|
1790
|
-
* @category patterns
|
|
1791
|
-
*/
|
|
1792
|
-
declare function resilientPipeline<T>(source: Node<T>, opts?: ResilientPipelineOptions<T>): ResilientPipelineBundle<T>;
|
|
1793
|
-
|
|
1794
|
-
declare const resilientPipeline$1_NS_PER_MS: typeof NS_PER_MS;
|
|
1795
|
-
declare const resilientPipeline$1_NS_PER_SEC: typeof NS_PER_SEC;
|
|
1796
|
-
type resilientPipeline$1_ResilientPipelineBundle<T> = ResilientPipelineBundle<T>;
|
|
1797
|
-
type resilientPipeline$1_ResilientPipelineOptions<T> = ResilientPipelineOptions<T>;
|
|
1798
|
-
declare const resilientPipeline$1_resilientPipeline: typeof resilientPipeline;
|
|
1799
|
-
declare namespace resilientPipeline$1 {
|
|
1800
|
-
export { resilientPipeline$1_NS_PER_MS as NS_PER_MS, resilientPipeline$1_NS_PER_SEC as NS_PER_SEC, type resilientPipeline$1_ResilientPipelineBundle as ResilientPipelineBundle, type resilientPipeline$1_ResilientPipelineOptions as ResilientPipelineOptions, resilientPipeline$1_resilientPipeline as resilientPipeline };
|
|
1801
|
-
}
|
|
1802
|
-
|
|
1803
|
-
/**
|
|
1804
|
-
* Surface: create a graph from a {@link GraphSpec} (§9.3-core).
|
|
1805
|
-
*
|
|
1806
|
-
* Thin wrapper over {@link compileSpec} that converts the two failure modes
|
|
1807
|
-
* ({@link validateSpec} structural errors, and catalog-aware validation
|
|
1808
|
-
* errors) into typed {@link SurfaceError} throws. Consumers are MCP/CLI
|
|
1809
|
-
* wrappers, not end-user graph code — those should import `compileSpec`
|
|
1810
|
-
* directly.
|
|
1811
|
-
*
|
|
1812
|
-
* @module
|
|
1813
|
-
*/
|
|
1814
|
-
|
|
1815
|
-
/** Options for {@link createGraph}. Same shape as {@link CompileSpecOptions}. */
|
|
1816
|
-
type CreateGraphOptions = CompileSpecOptions;
|
|
1817
|
-
/**
|
|
1818
|
-
* Build a {@link Graph} from a parsed {@link GraphSpec} with surface-layer
|
|
1819
|
-
* error typing.
|
|
1820
|
-
*
|
|
1821
|
-
* @throws {SurfaceError} `invalid-spec` for structural errors;
|
|
1822
|
-
* `catalog-error` when fn/source names or config don't match the catalog.
|
|
1823
|
-
*/
|
|
1824
|
-
declare function createGraph(spec: GraphSpec, opts?: CreateGraphOptions): Graph;
|
|
1825
|
-
|
|
1826
|
-
/**
|
|
1827
|
-
* Typed errors for the surface layer (§9.3-core).
|
|
1828
|
-
*
|
|
1829
|
-
* The surface layer is consumed by `@graphrefly/mcp-server` and
|
|
1830
|
-
* `@graphrefly/cli`. Both have native error channels (MCP's `isError` flag,
|
|
1831
|
-
* CLI's exit codes), so surface functions throw a {@link SurfaceError}
|
|
1832
|
-
* carrying a structured code + details payload that wrappers can map to
|
|
1833
|
-
* their native shape. No `Result` envelope — keep the callsite idiom
|
|
1834
|
-
* `try/catch` and let each wrapper surface the error its own way.
|
|
1835
|
-
*
|
|
1836
|
-
* @module
|
|
1837
|
-
*/
|
|
1838
|
-
/** Structured error codes emitted by the surface layer. JSON-safe. */
|
|
1839
|
-
type SurfaceErrorCode = "invalid-spec" | "graph-not-found" | "graph-exists" | "snapshot-not-found" | "node-not-found" | "reduce-timeout" | "catalog-error" | "restore-failed" | "snapshot-failed" | "tier-no-list" | "internal-error";
|
|
1840
|
-
/** JSON-safe shape surfaces should echo back through the wrapper. */
|
|
1841
|
-
interface SurfaceErrorPayload {
|
|
1842
|
-
code: SurfaceErrorCode;
|
|
1843
|
-
message: string;
|
|
1844
|
-
/** Optional structured detail; must be JSON-safe. */
|
|
1845
|
-
details?: Readonly<Record<string, unknown>>;
|
|
1846
|
-
}
|
|
1847
|
-
/**
|
|
1848
|
-
* Thrown by surface layer functions on failure. `code` is the stable
|
|
1849
|
-
* machine-readable identifier; `details` carries structured context
|
|
1850
|
-
* (e.g. `validateSpec` errors, missing path name). Both fields round-trip
|
|
1851
|
-
* through `toJSON()` for wrappers that serialize errors over the wire.
|
|
1852
|
-
*/
|
|
1853
|
-
declare class SurfaceError extends Error {
|
|
1854
|
-
readonly code: SurfaceErrorCode;
|
|
1855
|
-
readonly details?: Readonly<Record<string, unknown>>;
|
|
1856
|
-
constructor(code: SurfaceErrorCode, message: string, details?: Readonly<Record<string, unknown>>);
|
|
1857
|
-
/**
|
|
1858
|
-
* JSON-safe payload for wire serialization. Defensively validates
|
|
1859
|
-
* `details` — if it can't be round-tripped through `JSON.stringify`
|
|
1860
|
-
* (cyclic refs, `BigInt`, `Error` instance not pre-toJSON'd), the
|
|
1861
|
-
* payload falls back to `{code, message}` only rather than crashing
|
|
1862
|
-
* the MCP/CLI wrapper when it serializes this error onto the wire.
|
|
1863
|
-
*/
|
|
1864
|
-
toJSON(): SurfaceErrorPayload;
|
|
1865
|
-
}
|
|
1866
|
-
/** Wrap any thrown value as a SurfaceError. Idempotent on existing SurfaceError. */
|
|
1867
|
-
declare function asSurfaceError(err: unknown, fallbackCode?: SurfaceErrorCode): SurfaceError;
|
|
1868
|
-
|
|
1869
|
-
/**
|
|
1870
|
-
* Surface: one-shot `input → pipeline → output` (§9.3-core).
|
|
1871
|
-
*
|
|
1872
|
-
* `runReduction` compiles a {@link GraphSpec}, pushes an input value to a
|
|
1873
|
-
* named state node, awaits the first post-push DATA emission on a named
|
|
1874
|
-
* output, then disposes the graph. Stateless per call — no graphId, no
|
|
1875
|
-
* registry.
|
|
1876
|
-
*
|
|
1877
|
-
* Named `runReduction` (not `reduce`) to avoid collision with the
|
|
1878
|
-
* reactive {@link reduce} operator in `extra/operators.ts`. The MCP tool
|
|
1879
|
-
* name (`graphrefly_reduce`) and CLI subcommand (`graphrefly reduce`) use
|
|
1880
|
-
* the short form; the library export carries the verb.
|
|
1881
|
-
*
|
|
1882
|
-
* The subscribe-before-push ordering is deliberate. `graph.set` propagates
|
|
1883
|
-
* synchronously for sync derived/operator chains; for async sources
|
|
1884
|
-
* (`fromPromise`, `fromAsyncIter`, LLM adapters) the first post-push DATA
|
|
1885
|
-
* arrives on a later tick. Subscribing before the push catches both, and
|
|
1886
|
-
* skipping the priming push-on-subscribe emission avoids resolving with the
|
|
1887
|
-
* stale pre-push cache (spec §2.2).
|
|
1888
|
-
*
|
|
1889
|
-
* @module
|
|
1890
|
-
*/
|
|
1891
|
-
|
|
1892
|
-
/** Options for {@link reduce}. */
|
|
1893
|
-
interface ReduceOptions {
|
|
1894
|
-
/** Fn/source catalog for {@link createGraph}. */
|
|
1895
|
-
catalog?: GraphSpecCatalog;
|
|
1896
|
-
/** Path of the state node that receives the input. Default `"input"`. */
|
|
1897
|
-
inputPath?: string;
|
|
1898
|
-
/** Path of the node whose first post-push DATA is the result. Default `"output"`. */
|
|
1899
|
-
outputPath?: string;
|
|
1900
|
-
/** Hard deadline in milliseconds. Default `30_000`. */
|
|
1901
|
-
timeoutMs?: number;
|
|
1902
|
-
}
|
|
1903
|
-
/**
|
|
1904
|
-
* Run a spec as a one-shot reduction: `input → graph → output`.
|
|
1905
|
-
*
|
|
1906
|
-
* Resolves on the first `[DATA, v]` **or** `[RESOLVED]` emitted by
|
|
1907
|
-
* `outputPath` after the input push. The RESOLVED path handles spec
|
|
1908
|
-
* §1.3.3 equals-substitution (output recomputed to a value equal to its
|
|
1909
|
-
* cache, so the graph skips the DATA push) by returning `outputNode.cache`
|
|
1910
|
-
* — the caller always gets the settled value, never hangs on idempotent
|
|
1911
|
-
* inputs.
|
|
1912
|
-
*
|
|
1913
|
-
* @throws {SurfaceError} `invalid-spec` / `catalog-error` (propagated from
|
|
1914
|
-
* {@link createGraph}), `node-not-found` when `inputPath`/`outputPath`
|
|
1915
|
-
* can't be resolved, `reduce-timeout` when `timeoutMs` elapses without
|
|
1916
|
-
* a post-push emission, or the ERROR payload from the graph re-thrown
|
|
1917
|
-
* as `internal-error`.
|
|
1918
|
-
*/
|
|
1919
|
-
declare function runReduction(spec: GraphSpec, input: unknown, opts?: ReduceOptions): Promise<unknown>;
|
|
1920
|
-
|
|
1921
|
-
/**
|
|
1922
|
-
* Surface: snapshot save/restore/diff/list over {@link StorageTier} (§9.3-core).
|
|
1923
|
-
*
|
|
1924
|
-
* One-shot snapshot management for stateless callers (MCP tools, CLI
|
|
1925
|
-
* commands) layered on the existing multi-tier auto-checkpoint substrate.
|
|
1926
|
-
* A saved snapshot is a `mode: "full"` {@link GraphCheckpointRecord} with
|
|
1927
|
-
* `seq: 0` — byte-identical to the baseline anchor
|
|
1928
|
-
* {@link Graph.attachStorage} writes on its first flush. An
|
|
1929
|
-
* auto-checkpointed graph can therefore be restored through this surface,
|
|
1930
|
-
* and a surface-saved snapshot can be picked up by `attachStorage({
|
|
1931
|
-
* autoRestore: true })`.
|
|
1932
|
-
*
|
|
1933
|
-
* The wire envelope stays at {@link SNAPSHOT_WIRE_VERSION}; no new format.
|
|
1934
|
-
*
|
|
1935
|
-
* @module
|
|
1936
|
-
*/
|
|
1937
|
-
|
|
1938
|
-
/**
|
|
1939
|
-
* Current envelope version. Re-exported from `graph.ts` so the one-shot
|
|
1940
|
-
* surface path and `Graph.attachStorage` write byte-identical
|
|
1941
|
-
* `format_version` fields — no silent wire drift.
|
|
1942
|
-
*/
|
|
1943
|
-
declare const SNAPSHOT_WIRE_VERSION = 1;
|
|
1944
|
-
/** Shape returned by {@link saveSnapshot}. */
|
|
1945
|
-
interface SaveSnapshotResult {
|
|
1946
|
-
snapshotId: string;
|
|
1947
|
-
timestamp_ns: number;
|
|
1948
|
-
}
|
|
1949
|
-
/** Options for {@link restoreSnapshot}. */
|
|
1950
|
-
interface RestoreSnapshotOptions {
|
|
1951
|
-
/** Passthrough to `Graph.fromSnapshot`. First matching pattern wins. */
|
|
1952
|
-
factories?: Record<string, GraphNodeFactory>;
|
|
1953
|
-
}
|
|
1954
|
-
/**
|
|
1955
|
-
* Write a graph's current state as a one-shot `mode: "full"` record.
|
|
1956
|
-
*
|
|
1957
|
-
* Uses the same {@link GraphCheckpointRecord} envelope as
|
|
1958
|
-
* {@link Graph.attachStorage} so the two persistence paths interoperate.
|
|
1959
|
-
*
|
|
1960
|
-
* @throws {SurfaceError} `snapshot-failed` when the tier's `save` throws.
|
|
1961
|
-
*/
|
|
1962
|
-
declare function saveSnapshot(graph: Graph, snapshotId: string, tier: StorageTier): Promise<SaveSnapshotResult>;
|
|
1963
|
-
/**
|
|
1964
|
-
* Load a snapshot from a tier and materialize it as a new {@link Graph}.
|
|
1965
|
-
*
|
|
1966
|
-
* Uses {@link Graph.fromSnapshot} to reconstruct topology; pass
|
|
1967
|
-
* `factories` when the graph includes non-state nodes that the default
|
|
1968
|
-
* hydrator can't rebuild on its own.
|
|
1969
|
-
*
|
|
1970
|
-
* **Requires a `mode: "full"` record.** Surface-written snapshots from
|
|
1971
|
-
* {@link saveSnapshot} always qualify. Records written by
|
|
1972
|
-
* {@link Graph.attachStorage} with `compactEvery > 1` may be
|
|
1973
|
-
* `mode: "diff"` between compacts — those throw `restore-failed` until
|
|
1974
|
-
* the tier's next compact flush (or until Phase 8.7 WAL replay lands).
|
|
1975
|
-
* If you need interop during development, either call
|
|
1976
|
-
* {@link saveSnapshot} explicitly (always full) or configure
|
|
1977
|
-
* `attachStorage({compactEvery: 1})`.
|
|
1978
|
-
*
|
|
1979
|
-
* @throws {SurfaceError} `snapshot-not-found` on miss; `restore-failed`
|
|
1980
|
-
* when the payload shape doesn't match, when the record is
|
|
1981
|
-
* `mode: "diff"`, or when `Graph.fromSnapshot` rejects.
|
|
1982
|
-
*/
|
|
1983
|
-
declare function restoreSnapshot(snapshotId: string, tier: StorageTier, opts?: RestoreSnapshotOptions): Promise<Graph>;
|
|
1984
|
-
/**
|
|
1985
|
-
* Load two snapshots and compute a {@link GraphDiffResult} via static
|
|
1986
|
-
* {@link Graph.diff}. Returns the audit shape (structural + value diff,
|
|
1987
|
-
* no payload); use {@link diffForWAL} directly for WAL-oriented diffs.
|
|
1988
|
-
*
|
|
1989
|
-
* @throws {SurfaceError} `snapshot-not-found` on either miss.
|
|
1990
|
-
*/
|
|
1991
|
-
declare function diffSnapshots(snapshotIdA: string, snapshotIdB: string, tier: StorageTier): Promise<GraphDiffResult>;
|
|
1992
|
-
/**
|
|
1993
|
-
* Enumerate snapshot ids on a tier.
|
|
1994
|
-
*
|
|
1995
|
-
* **Scope caveat:** returns every key on the tier, not just those
|
|
1996
|
-
* written by {@link saveSnapshot}. When the same tier also backs
|
|
1997
|
-
* {@link Graph.attachStorage} (for auto-checkpoints keyed by
|
|
1998
|
-
* `graph.name`), those names appear in this list too. Wrappers that
|
|
1999
|
-
* want a namespaced snapshot store should use a dedicated tier or
|
|
2000
|
-
* encode an id prefix on write. Tracked in `docs/optimizations.md`
|
|
2001
|
-
* under "surface `listSnapshots` namespacing".
|
|
2002
|
-
*
|
|
2003
|
-
* @throws {SurfaceError} `tier-no-list` when the tier does not implement
|
|
2004
|
-
* the optional `list()` method. Check `typeof tier.list === "function"`
|
|
2005
|
-
* before calling if you want to branch on capability.
|
|
2006
|
-
*/
|
|
2007
|
-
declare function listSnapshots(tier: StorageTier): Promise<readonly string[]>;
|
|
2008
|
-
/**
|
|
2009
|
-
* Delete a snapshot from a tier.
|
|
2010
|
-
*
|
|
2011
|
-
* Silent on miss (clear semantics). `tier.clear` is optional — throws
|
|
2012
|
-
* `snapshot-failed` when the tier is append-only.
|
|
2013
|
-
*
|
|
2014
|
-
* @throws {SurfaceError} `snapshot-failed` when `clear` is unsupported
|
|
2015
|
-
* or throws.
|
|
2016
|
-
*/
|
|
2017
|
-
declare function deleteSnapshot(snapshotId: string, tier: StorageTier): Promise<void>;
|
|
2018
|
-
|
|
2019
|
-
/**
|
|
2020
|
-
* Surface layer (§9.3-core) — shared, JSON-safe operations consumed by
|
|
2021
|
-
* `@graphrefly/mcp-server` and `@graphrefly/cli`.
|
|
2022
|
-
*
|
|
2023
|
-
* The surface is a thin projection of existing Graph APIs (`describe`,
|
|
2024
|
-
* `observe`, `explain`, `snapshot`, `restore`, static `diff`), plus two
|
|
2025
|
-
* genuinely new operations:
|
|
2026
|
-
*
|
|
2027
|
-
* 1. {@link createGraph} — `compileSpec` wrapped with typed surface errors.
|
|
2028
|
-
* 2. {@link reduce} — one-shot `input → pipeline → output`.
|
|
2029
|
-
*
|
|
2030
|
-
* Snapshot persistence reuses the {@link StorageTier} substrate introduced
|
|
2031
|
-
* for `Graph.attachStorage`, so one-shot snapshots and auto-checkpoints
|
|
2032
|
-
* share the {@link GraphCheckpointRecord} envelope. No new wire format.
|
|
2033
|
-
*
|
|
2034
|
-
* Errors throw as {@link SurfaceError} — wrappers map to their native
|
|
2035
|
-
* error channel (MCP `isError`, CLI exit code). No `Result<T, E>` wrapper.
|
|
2036
|
-
*
|
|
2037
|
-
* @module
|
|
2038
|
-
*/
|
|
2039
|
-
|
|
2040
|
-
type index$1_CatalogFnEntry = CatalogFnEntry;
|
|
2041
|
-
type index$1_CatalogSourceEntry = CatalogSourceEntry;
|
|
2042
|
-
type index$1_ConfigFieldSchema = ConfigFieldSchema;
|
|
2043
|
-
type index$1_CreateGraphOptions = CreateGraphOptions;
|
|
2044
|
-
type index$1_FnFactory = FnFactory;
|
|
2045
|
-
type index$1_GraphSpec = GraphSpec;
|
|
2046
|
-
type index$1_GraphSpecCatalog = GraphSpecCatalog;
|
|
2047
|
-
type index$1_GraphSpecFeedbackEdge = GraphSpecFeedbackEdge;
|
|
2048
|
-
type index$1_GraphSpecNode = GraphSpecNode;
|
|
2049
|
-
type index$1_GraphSpecTemplate = GraphSpecTemplate;
|
|
2050
|
-
type index$1_GraphSpecTemplateRef = GraphSpecTemplateRef;
|
|
2051
|
-
type index$1_GraphSpecValidation = GraphSpecValidation;
|
|
2052
|
-
type index$1_ReduceOptions = ReduceOptions;
|
|
2053
|
-
type index$1_RestoreSnapshotOptions = RestoreSnapshotOptions;
|
|
2054
|
-
declare const index$1_SNAPSHOT_WIRE_VERSION: typeof SNAPSHOT_WIRE_VERSION;
|
|
2055
|
-
type index$1_SaveSnapshotResult = SaveSnapshotResult;
|
|
2056
|
-
type index$1_SourceFactory = SourceFactory;
|
|
2057
|
-
type index$1_SurfaceError = SurfaceError;
|
|
2058
|
-
declare const index$1_SurfaceError: typeof SurfaceError;
|
|
2059
|
-
type index$1_SurfaceErrorCode = SurfaceErrorCode;
|
|
2060
|
-
type index$1_SurfaceErrorPayload = SurfaceErrorPayload;
|
|
2061
|
-
declare const index$1_asSurfaceError: typeof asSurfaceError;
|
|
2062
|
-
declare const index$1_createGraph: typeof createGraph;
|
|
2063
|
-
declare const index$1_deleteSnapshot: typeof deleteSnapshot;
|
|
2064
|
-
declare const index$1_diffSnapshots: typeof diffSnapshots;
|
|
2065
|
-
declare const index$1_listSnapshots: typeof listSnapshots;
|
|
2066
|
-
declare const index$1_restoreSnapshot: typeof restoreSnapshot;
|
|
2067
|
-
declare const index$1_runReduction: typeof runReduction;
|
|
2068
|
-
declare const index$1_saveSnapshot: typeof saveSnapshot;
|
|
2069
|
-
declare namespace index$1 {
|
|
2070
|
-
export { type index$1_CatalogFnEntry as CatalogFnEntry, type index$1_CatalogSourceEntry as CatalogSourceEntry, type index$1_ConfigFieldSchema as ConfigFieldSchema, type index$1_CreateGraphOptions as CreateGraphOptions, type index$1_FnFactory as FnFactory, type index$1_GraphSpec as GraphSpec, type index$1_GraphSpecCatalog as GraphSpecCatalog, type index$1_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, type index$1_GraphSpecNode as GraphSpecNode, type index$1_GraphSpecTemplate as GraphSpecTemplate, type index$1_GraphSpecTemplateRef as GraphSpecTemplateRef, type index$1_GraphSpecValidation as GraphSpecValidation, type index$1_ReduceOptions as ReduceOptions, type index$1_RestoreSnapshotOptions as RestoreSnapshotOptions, index$1_SNAPSHOT_WIRE_VERSION as SNAPSHOT_WIRE_VERSION, type index$1_SaveSnapshotResult as SaveSnapshotResult, type index$1_SourceFactory as SourceFactory, index$1_SurfaceError as SurfaceError, type index$1_SurfaceErrorCode as SurfaceErrorCode, type index$1_SurfaceErrorPayload as SurfaceErrorPayload, index$1_asSurfaceError as asSurfaceError, index$1_createGraph as createGraph, index$1_deleteSnapshot as deleteSnapshot, index$1_diffSnapshots as diffSnapshots, index$1_listSnapshots as listSnapshots, index$1_restoreSnapshot as restoreSnapshot, index$1_runReduction as runReduction, index$1_saveSnapshot as saveSnapshot };
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
54
|
/**
|
|
2074
55
|
* Patterns layer: domain/solution helpers (Phase 4+).
|
|
2075
56
|
*/
|
|
2076
57
|
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
58
|
+
declare const index_CatalogFnEntry: typeof CatalogFnEntry;
|
|
59
|
+
declare const index_CatalogSourceEntry: typeof CatalogSourceEntry;
|
|
60
|
+
declare const index_ConfigFieldSchema: typeof ConfigFieldSchema;
|
|
61
|
+
declare const index_CreateGraphOptions: typeof CreateGraphOptions;
|
|
62
|
+
declare const index_FnFactory: typeof FnFactory;
|
|
63
|
+
declare const index_GraphSpec: typeof GraphSpec;
|
|
64
|
+
declare const index_GraphSpecCatalog: typeof GraphSpecCatalog;
|
|
65
|
+
declare const index_GraphSpecFeedbackEdge: typeof GraphSpecFeedbackEdge;
|
|
66
|
+
declare const index_GraphSpecNode: typeof GraphSpecNode;
|
|
67
|
+
declare const index_GraphSpecTemplate: typeof GraphSpecTemplate;
|
|
68
|
+
declare const index_GraphSpecTemplateRef: typeof GraphSpecTemplateRef;
|
|
69
|
+
declare const index_GraphSpecValidation: typeof GraphSpecValidation;
|
|
70
|
+
declare const index_ReduceOptions: typeof ReduceOptions;
|
|
71
|
+
declare const index_RestoreSnapshotOptions: typeof RestoreSnapshotOptions;
|
|
2091
72
|
declare const index_SNAPSHOT_WIRE_VERSION: typeof SNAPSHOT_WIRE_VERSION;
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
type index_SurfaceError = SurfaceError;
|
|
73
|
+
declare const index_SaveSnapshotResult: typeof SaveSnapshotResult;
|
|
74
|
+
declare const index_SourceFactory: typeof SourceFactory;
|
|
2095
75
|
declare const index_SurfaceError: typeof SurfaceError;
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
declare const index_ai: typeof ai;
|
|
76
|
+
declare const index_SurfaceErrorCode: typeof SurfaceErrorCode;
|
|
77
|
+
declare const index_SurfaceErrorPayload: typeof SurfaceErrorPayload;
|
|
2099
78
|
declare const index_asSurfaceError: typeof asSurfaceError;
|
|
2100
|
-
declare const index_cqrs: typeof cqrs;
|
|
2101
79
|
declare const index_createGraph: typeof createGraph;
|
|
2102
80
|
declare const index_deleteSnapshot: typeof deleteSnapshot;
|
|
2103
|
-
declare const index_demoShell: typeof demoShell;
|
|
2104
81
|
declare const index_diffSnapshots: typeof diffSnapshots;
|
|
2105
|
-
declare const index_domainTemplates: typeof domainTemplates;
|
|
2106
|
-
declare const index_graphspec: typeof graphspec;
|
|
2107
|
-
declare const index_lens: typeof lens;
|
|
2108
82
|
declare const index_listSnapshots: typeof listSnapshots;
|
|
2109
|
-
declare const index_memory: typeof memory;
|
|
2110
|
-
declare const index_messaging: typeof messaging;
|
|
2111
|
-
declare const index_orchestration: typeof orchestration;
|
|
2112
|
-
declare const index_reduction: typeof reduction;
|
|
2113
83
|
declare const index_restoreSnapshot: typeof restoreSnapshot;
|
|
2114
84
|
declare const index_runReduction: typeof runReduction;
|
|
2115
85
|
declare const index_saveSnapshot: typeof saveSnapshot;
|
|
2116
86
|
declare namespace index {
|
|
2117
|
-
export {
|
|
87
|
+
export { index_CatalogFnEntry as CatalogFnEntry, index_CatalogSourceEntry as CatalogSourceEntry, index_ConfigFieldSchema as ConfigFieldSchema, index_CreateGraphOptions as CreateGraphOptions, index_FnFactory as FnFactory, index_GraphSpec as GraphSpec, index_GraphSpecCatalog as GraphSpecCatalog, index_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, index_GraphSpecNode as GraphSpecNode, index_GraphSpecTemplate as GraphSpecTemplate, index_GraphSpecTemplateRef as GraphSpecTemplateRef, index_GraphSpecValidation as GraphSpecValidation, index_ReduceOptions as ReduceOptions, index_RestoreSnapshotOptions as RestoreSnapshotOptions, index_SNAPSHOT_WIRE_VERSION as SNAPSHOT_WIRE_VERSION, index_SaveSnapshotResult as SaveSnapshotResult, index_SourceFactory as SourceFactory, index_SurfaceError as SurfaceError, index_SurfaceErrorCode as SurfaceErrorCode, index_SurfaceErrorPayload as SurfaceErrorPayload, index$1 as accountability, index$2 as ai, index_asSurfaceError as asSurfaceError, index$3 as cqrs, index_createGraph as createGraph, index_deleteSnapshot as deleteSnapshot, index$4 as demoShell, index_diffSnapshots as diffSnapshots, index$5 as domainTemplates, index$6 as graphspec, index$7 as guarded, index$8 as harness, index$9 as jobQueue, index$a as layout, index$b as lens, index_listSnapshots as listSnapshots, index$c as memory, index$d as messaging, index$e as orchestration, index$f as reduction, index$g as refine, index$h as resilientPipeline, index_restoreSnapshot as restoreSnapshot, index_runReduction as runReduction, index_saveSnapshot as saveSnapshot, index$i as surface };
|
|
2118
88
|
}
|
|
2119
89
|
|
|
2120
90
|
/**
|
|
@@ -2122,4 +92,4 @@ declare namespace index {
|
|
|
2122
92
|
*/
|
|
2123
93
|
declare const version = "0.0.0";
|
|
2124
94
|
|
|
2125
|
-
export {
|
|
95
|
+
export { CatalogFnEntry, CatalogSourceEntry, ConfigFieldSchema, CreateGraphOptions, FnFactory, GraphSpec, GraphSpecCatalog, GraphSpecFeedbackEdge, GraphSpecNode, GraphSpecTemplate, GraphSpecTemplateRef, GraphSpecValidation, ReduceOptions, RestoreSnapshotOptions, SNAPSHOT_WIRE_VERSION, SaveSnapshotResult, SourceFactory, SurfaceError, SurfaceErrorCode, SurfaceErrorPayload, index$1 as accountability, index$2 as ai, asSurfaceError, index$3 as cqrs, createGraph, deleteSnapshot, index$4 as demoShell, diffSnapshots, index$5 as domainTemplates, index$6 as graphspec, index$7 as guarded, index$8 as harness, index$9 as jobQueue, index$a as layout, index$b as lens, listSnapshots, index$c as memory, index$d as messaging, index$e as orchestration, index as patterns, index$f as reduction, index$g as refine, index$h as resilientPipeline, restoreSnapshot, runReduction, saveSnapshot, index$i as surface, version };
|