@graphrefly/graphrefly 0.26.0 → 0.28.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-B-5zmAUv.d.cts +180 -0
- package/dist/cascading-D9WG1-9L.d.ts +180 -0
- package/dist/chunk-2FOAM3OR.js +1 -0
- package/dist/chunk-2PMCKKRK.js +1 -0
- package/dist/chunk-3JXNEPCD.js +2 -0
- package/dist/chunk-3R5HFPX7.js +78 -0
- package/dist/chunk-4GKB4OUJ.js +1 -0
- package/dist/chunk-4VVTGLXJ.js +1 -0
- package/dist/chunk-5QDBSZBV.js +1 -0
- package/dist/chunk-6QZNQS5B.js +1 -0
- package/dist/chunk-6V3SEX2I.js +1 -0
- package/dist/chunk-76A3HVQE.js +9 -0
- package/dist/chunk-7H6LGFUG.js +64 -0
- package/dist/chunk-CK2E7BTU.js +1 -0
- package/dist/chunk-CKCSDI7T.js +6 -0
- package/dist/chunk-CRXTH3SH.js +1 -0
- package/dist/chunk-CWLN3X3N.js +1 -0
- package/dist/chunk-D7A7DBE4.js +1 -0
- package/dist/chunk-DBGGMN3D.js +1 -0
- package/dist/chunk-DQA3UIQ2.js +1 -0
- package/dist/chunk-ERLIRFPA.js +1 -0
- package/dist/chunk-ESMPEKEV.js +1 -0
- package/dist/chunk-ETWTCCJI.js +1 -0
- package/dist/chunk-FNYWM6JC.js +1 -0
- package/dist/chunk-GHJJR5P4.js +1 -0
- package/dist/chunk-GPW2V3RE.js +1 -0
- package/dist/chunk-I6VIH3VA.js +1 -0
- package/dist/chunk-K2GNMCQT.js +1 -0
- package/dist/chunk-LBTDSCCO.js +3 -0
- package/dist/chunk-LQ3Y5NJS.js +1 -0
- package/dist/chunk-MIQTDPY4.js +5 -0
- package/dist/chunk-MTTAAPCK.js +1 -0
- package/dist/chunk-OAWLCNJJ.js +1 -0
- package/dist/chunk-OBKQQA5I.js +1 -0
- package/dist/chunk-OYHGKYQM.js +1 -0
- package/dist/chunk-PIOGHC63.js +1 -0
- package/dist/chunk-QWAPKG3O.js +2 -0
- package/dist/chunk-QYADASLV.js +1 -0
- package/dist/chunk-RHESUC3V.js +43 -0
- package/dist/chunk-S35VARIR.js +1 -0
- package/dist/chunk-SC3U7ETD.js +1 -0
- package/dist/chunk-U3AICJKU.js +1 -0
- package/dist/chunk-UMBIDLJ4.js +1 -0
- package/dist/chunk-UPHHLMHE.js +1 -0
- package/dist/chunk-UPXUCFMX.js +1 -0
- package/dist/chunk-UWJE5FQA.js +18 -0
- package/dist/chunk-V6YQICXZ.js +1 -0
- package/dist/chunk-VIMF6LGM.js +1 -0
- package/dist/chunk-VJLMUKOI.js +1 -0
- package/dist/chunk-VPYBOXVT.js +1 -0
- package/dist/chunk-VTPVOGHH.js +1 -0
- package/dist/chunk-WQ2BN6X6.js +1 -0
- package/dist/chunk-XAUNPIMX.js +1 -0
- package/dist/chunk-Y2EMPB3I.js +1 -0
- package/dist/chunk-Z4HDAS2Q.js +1 -0
- package/dist/chunk-ZB5EHBIO.js +1 -0
- package/dist/chunk-ZV2DXV5A.js +23 -0
- package/dist/compat/index.cjs +14 -7656
- package/dist/compat/index.d.cts +15 -14
- package/dist/compat/index.d.ts +15 -14
- package/dist/compat/index.js +1 -49
- 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 +14 -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 -82
- 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 +6 -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-B-xqw4Kk.d.cts +69 -0
- package/dist/composite-BhbKHbOS.d.ts +69 -0
- package/dist/core/index.cjs +1 -2271
- package/dist/core/index.d.cts +4 -3
- package/dist/core/index.d.ts +4 -3
- 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 +23 -9971
- package/dist/extra/index.d.cts +13 -5
- package/dist/extra/index.d.ts +13 -5
- package/dist/extra/index.js +1 -375
- 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 +6 -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-6tZ5jEzr.d.cts → graph-BZGRXwOm.d.ts} +134 -31
- package/dist/{graph-DQ69XU0g.d.ts → graph-D48Qw9Cg.d.cts} +134 -31
- package/dist/index-8FSVk4Uf.d.ts +135 -0
- package/dist/index-9oDeHH2u.d.cts +291 -0
- package/dist/index-B0c4cmIO.d.ts +207 -0
- package/dist/{index-CDAjUFIv.d.ts → index-B1AmmSlb.d.ts} +1 -1
- package/dist/{index-Bd_fwmLf.d.cts → index-B2pwesl9.d.cts} +1 -1
- package/dist/index-BHvIquRZ.d.ts +1957 -0
- package/dist/{index-CPgZ5wRl.d.ts → index-BVHOrDwO.d.ts} +1 -1
- package/dist/{index-DrISNAOm.d.ts → index-BWJV63ti.d.ts} +1 -1
- package/dist/{index-B_IP40nB.d.cts → index-B_agccPe.d.cts} +1 -1
- package/dist/index-BgyGlizc.d.ts +163 -0
- package/dist/index-BpA5c4G9.d.ts +357 -0
- package/dist/index-BpIFjILY.d.cts +357 -0
- package/dist/{index-qldRdbQw.d.ts → index-Bqachn9_.d.ts} +1 -1
- package/dist/index-Btib9rsU.d.ts +607 -0
- package/dist/{index-BYOHF0zP.d.ts → index-BwM9BEkt.d.ts} +1 -1
- package/dist/index-BxJ86YZZ.d.cts +105 -0
- package/dist/index-C73n7lo-.d.cts +251 -0
- package/dist/index-CEXXwWVH.d.cts +192 -0
- package/dist/index-CHEswufn.d.cts +163 -0
- package/dist/{index-xdGjv0nO.d.ts → index-CMn8S8Hw.d.ts} +1 -1
- package/dist/{index-QBpffFW-.d.cts → index-CRO83MmV.d.cts} +1 -1
- package/dist/{index-BjI6ty9z.d.ts → index-CloUk1kY.d.ts} +9 -9
- package/dist/index-CpgYhnrG.d.ts +291 -0
- package/dist/{index-CUyrtuOf.d.cts → index-Cyojz0AE.d.cts} +1 -1
- package/dist/{demo-shell-DEp-nMTl.d.ts → index-CzobVSMr.d.ts} +14 -14
- package/dist/index-Czq6ynh8.d.ts +143 -0
- package/dist/index-D-YB-Vl3.d.ts +195 -0
- package/dist/index-DAlweici.d.ts +231 -0
- package/dist/index-DEwTb_fm.d.cts +1957 -0
- package/dist/{index-DFhjO4Gg.d.cts → index-DL-rYJrx.d.cts} +1 -1
- package/dist/index-DP4ZTkdw.d.ts +139 -0
- package/dist/{index-BeIdBfcb.d.cts → index-DUqMOlKZ.d.cts} +200 -2366
- package/dist/{index-Bxb5ZYc9.d.cts → index-D_NwnRYS.d.cts} +1 -1
- package/dist/index-DaLJvH8Z.d.ts +105 -0
- package/dist/index-DcXZBF5a.d.cts +135 -0
- package/dist/index-DfyOkTvs.d.ts +321 -0
- package/dist/{index-CmnuOibw.d.ts → index-DiOXyAwt.d.ts} +1 -1
- package/dist/index-DpHe5e0Q.d.ts +186 -0
- package/dist/index-DraikLjn.d.ts +86 -0
- package/dist/{index-BEfE8H_G.d.cts → index-DxsnAMWD.d.cts} +9 -9
- package/dist/index-DyxjtScX.d.cts +207 -0
- package/dist/index-HDpJe9hX.d.ts +251 -0
- package/dist/index-O6TgGUBV.d.cts +195 -0
- package/dist/{index-B4MP_8V_.d.cts → index-Oi8d8w4R.d.cts} +1 -1
- package/dist/{index-BW1z3BN9.d.ts → index-ROpQmGjE.d.ts} +30 -6
- package/dist/index-RukJ4DLS.d.cts +607 -0
- package/dist/{index-DdD5MVDL.d.ts → index-ZftwfxJM.d.ts} +200 -2366
- package/dist/{index-CuYwdKO-.d.ts → index-cByzxQIC.d.cts} +10 -195
- package/dist/index-dtN7YA2x.d.cts +143 -0
- package/dist/{index-C8mdwMXc.d.cts → index-fM6y00vT.d.cts} +30 -6
- package/dist/{index-_oMEWlDq.d.cts → index-m-yHof5p.d.ts} +10 -195
- package/dist/index-pXrDMpRO.d.cts +231 -0
- package/dist/index-rHJSKsU8.d.cts +186 -0
- package/dist/index-rX8HBM5h.d.cts +321 -0
- package/dist/{index-CUwyr1Kk.d.cts → index-rnwQly8X.d.cts} +147 -20
- package/dist/index-sm373fsH.d.ts +192 -0
- package/dist/index-tbf2gKHd.d.cts +139 -0
- package/dist/{demo-shell-26p5fVxn.d.cts → index-u15meRxL.d.cts} +14 -14
- package/dist/{index-eJ6T_qGM.d.ts → index-umtoWT8K.d.ts} +147 -20
- package/dist/index-vscRDkjW.d.cts +86 -0
- package/dist/index.cjs +150 -24142
- package/dist/index.d.cts +69 -3756
- package/dist/index.d.ts +69 -3756
- package/dist/index.js +1 -7292
- package/dist/{meta-C0-8XW6Q.d.cts → meta-Cgj6zeji.d.cts} +5 -5
- package/dist/{meta-BGqSZ7mt.d.ts → meta-CwesDrMD.d.ts} +5 -5
- package/dist/{node-C_IBuvX2.d.cts → node-Cc1TniY8.d.cts} +36 -9
- package/dist/{node-C_IBuvX2.d.ts → node-Cc1TniY8.d.ts} +36 -9
- package/dist/{observable-DCk45RH5.d.ts → observable-Ct-gJ9jI.d.ts} +1 -1
- package/dist/{observable-Crr1jgzx.d.cts → observable-glXQoGj2.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 +91 -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 +6 -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 +6 -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 +7 -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 +6 -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 +83 -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 +6 -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 +48 -0
- package/dist/patterns/harness/index.d.cts +8 -0
- package/dist/patterns/harness/index.d.ts +8 -0
- package/dist/patterns/harness/index.js +1 -0
- package/dist/patterns/job-queue/index.cjs +6 -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 +6 -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 +6 -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 +6 -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 +6 -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 +7 -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 +6 -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 +8 -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 +14 -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-BaOQefHu.d.cts → reactive-layout-CpYb5qLP.d.cts} +2 -2
- package/dist/{reactive-layout-D9gejYXE.d.ts → reactive-layout-D8u4wuUR.d.ts} +2 -2
- package/dist/reactive-log-DPzuUDj5.d.cts +190 -0
- package/dist/reactive-log-YuH9VYN8.d.ts +190 -0
- package/dist/reactive-map-CdbNoSgP.d.ts +238 -0
- package/dist/reactive-map-DUeRmb9d.d.cts +238 -0
- package/dist/resilience-Ba5-b4WD.d.cts +493 -0
- package/dist/resilience-CGRzhnD3.d.ts +493 -0
- package/dist/resilience-QAHKANT5.js +1 -0
- package/dist/sugar-BV0htudb.d.cts +205 -0
- package/dist/sugar-Dtyrq2_q.d.ts +205 -0
- package/dist/topology-tree-CYHOwQZ_.d.ts +25 -0
- package/dist/topology-tree-DROUdq5B.d.cts +25 -0
- package/dist/types-O3GzJY2U.d.cts +401 -0
- package/dist/types-u64Ose53.d.ts +401 -0
- package/package.json +267 -7
- package/dist/chunk-3ZWCKRHX.js +0 -117
- package/dist/chunk-3ZWCKRHX.js.map +0 -1
- package/dist/chunk-6LDQFTYS.js +0 -102
- package/dist/chunk-6LDQFTYS.js.map +0 -1
- package/dist/chunk-7TAQJHQV.js +0 -103
- package/dist/chunk-7TAQJHQV.js.map +0 -1
- package/dist/chunk-AMCG74RZ.js +0 -7000
- package/dist/chunk-AMCG74RZ.js.map +0 -1
- package/dist/chunk-BVZYTZ5H.js +0 -599
- package/dist/chunk-BVZYTZ5H.js.map +0 -1
- package/dist/chunk-FQMKGR6L.js +0 -330
- package/dist/chunk-FQMKGR6L.js.map +0 -1
- package/dist/chunk-HXZEYDUR.js +0 -94
- package/dist/chunk-HXZEYDUR.js.map +0 -1
- package/dist/chunk-IZYUSJC7.js +0 -1369
- package/dist/chunk-IZYUSJC7.js.map +0 -1
- package/dist/chunk-J22W6HV3.js +0 -107
- package/dist/chunk-J22W6HV3.js.map +0 -1
- package/dist/chunk-JSCT3CR4.js +0 -38
- package/dist/chunk-JSCT3CR4.js.map +0 -1
- package/dist/chunk-JYXEWPH4.js +0 -62
- package/dist/chunk-JYXEWPH4.js.map +0 -1
- package/dist/chunk-LCE3GF5P.js +0 -866
- package/dist/chunk-LCE3GF5P.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-OHISZPOJ.js +0 -97
- package/dist/chunk-OHISZPOJ.js.map +0 -1
- package/dist/chunk-PHOUUNK7.js +0 -2291
- package/dist/chunk-PHOUUNK7.js.map +0 -1
- package/dist/chunk-RB6QPHJ7.js +0 -393
- package/dist/chunk-RB6QPHJ7.js.map +0 -1
- package/dist/chunk-SN4YWWYO.js +0 -171
- package/dist/chunk-SN4YWWYO.js.map +0 -1
- package/dist/chunk-SX52TAR4.js +0 -110
- package/dist/chunk-SX52TAR4.js.map +0 -1
- package/dist/chunk-THTWHNU4.js +0 -2712
- package/dist/chunk-THTWHNU4.js.map +0 -1
- package/dist/chunk-VYPWMZ6H.js +0 -98
- package/dist/chunk-VYPWMZ6H.js.map +0 -1
- package/dist/chunk-XGPU467M.js +0 -136
- package/dist/chunk-XGPU467M.js.map +0 -1
- package/dist/chunk-ZQMEI34O.js +0 -713
- package/dist/chunk-ZQMEI34O.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-C0ZXMaXO.d.cts +0 -392
- package/dist/index-CY2TljO4.d.ts +0 -392
- package/dist/index.cjs.map +0 -1
- package/dist/index.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/reactive-layout/index.cjs.map +0 -1
- package/dist/patterns/reactive-layout/index.js.map +0 -1
- package/dist/storage-BMycWEh2.d.ts +0 -190
- package/dist/storage-DiqWHzVI.d.cts +0 -190
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { a as Node } from './node-Cc1TniY8.js';
|
|
2
|
+
import { R as ReactiveMapBundle } from './reactive-map-CdbNoSgP.js';
|
|
3
|
+
import { a as GraphOptions, G as Graph, C as CausalChain } from './graph-BZGRXwOm.js';
|
|
4
|
+
import { w as watchTopologyTree } from './topology-tree-CYHOwQZ_.js';
|
|
5
|
+
|
|
6
|
+
/** Aggregate topology stats emitted by {@link LensGraph.stats}. */
|
|
7
|
+
interface TopologyStats {
|
|
8
|
+
/** Total primary nodes across this graph and all transitively mounted subgraphs. */
|
|
9
|
+
nodeCount: number;
|
|
10
|
+
/** Total directed edges (derived from deps; no duplicates). */
|
|
11
|
+
edgeCount: number;
|
|
12
|
+
/** Count of mounted subgraphs (transitive). */
|
|
13
|
+
subgraphCount: number;
|
|
14
|
+
/** Qualified paths with no upstream deps (source nodes). Sorted. */
|
|
15
|
+
sources: readonly string[];
|
|
16
|
+
/** Qualified paths with no downstream consumers in-graph (sink nodes). Sorted. */
|
|
17
|
+
sinks: readonly string[];
|
|
18
|
+
/** Longest path from any source to any sink (in edges). `0` for empty graphs. */
|
|
19
|
+
depth: number;
|
|
20
|
+
/** `true` if the dep DAG contains a cycle (feedback edge). */
|
|
21
|
+
hasCycles: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** A single health problem entry. */
|
|
24
|
+
interface HealthProblem {
|
|
25
|
+
path: string;
|
|
26
|
+
/** V1 only reports `"errored"`. Future versions may add `"completed"`, `"disconnected"`. */
|
|
27
|
+
status: "errored";
|
|
28
|
+
/** First errored upstream ancestor along the dep chain, when one exists and is distinct from `path`. */
|
|
29
|
+
upstreamCause?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Aggregate health snapshot. `ok=true` iff `problems.length === 0`. */
|
|
32
|
+
interface HealthReport {
|
|
33
|
+
ok: boolean;
|
|
34
|
+
problems: readonly HealthProblem[];
|
|
35
|
+
}
|
|
36
|
+
/** One per-path flow entry stored in {@link LensGraph.flow}. */
|
|
37
|
+
interface FlowEntry {
|
|
38
|
+
path: string;
|
|
39
|
+
/** Cumulative DATA emissions observed since the lens activated. */
|
|
40
|
+
count: number;
|
|
41
|
+
/** `monotonicNs()` at the most recent DATA emission, or `null` if none yet. */
|
|
42
|
+
lastUpdate_ns: number | null;
|
|
43
|
+
}
|
|
44
|
+
/** Options for {@link graphLens}. */
|
|
45
|
+
interface GraphLensOptions {
|
|
46
|
+
name?: string;
|
|
47
|
+
graph?: GraphOptions;
|
|
48
|
+
/**
|
|
49
|
+
* Limit which node paths `flow` tracks. When omitted, every path in
|
|
50
|
+
* `target.describe()` is observed. Recommended for graphs with hundreds
|
|
51
|
+
* of nodes since each tracked path adds one observe-event dispatch per
|
|
52
|
+
* DATA emission.
|
|
53
|
+
*/
|
|
54
|
+
pathFilter?: (path: string) => boolean;
|
|
55
|
+
/**
|
|
56
|
+
* LRU cap on the {@link LensGraph.flow} map. When set, the flow tracker
|
|
57
|
+
* evicts least-recently-used paths (by insertion / set order) once the
|
|
58
|
+
* entry count exceeds this bound. Omit for unbounded (not recommended
|
|
59
|
+
* for long-running graphs with churning paths). Passed through to the
|
|
60
|
+
* underlying {@link reactiveMap}'s `maxSize`.
|
|
61
|
+
*/
|
|
62
|
+
maxFlowPaths?: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Reactive observability surface for a target {@link Graph}.
|
|
66
|
+
* See {@link graphLens}.
|
|
67
|
+
*
|
|
68
|
+
* @category observability
|
|
69
|
+
*/
|
|
70
|
+
declare class LensGraph extends Graph {
|
|
71
|
+
/**
|
|
72
|
+
* Aggregate structural stats — `nodeCount`, `edgeCount`, `sources`,
|
|
73
|
+
* `sinks`, `depth`, `hasCycles`, `subgraphCount`. Recomputes on every
|
|
74
|
+
* structural change via {@link watchTopologyTree} (transitive).
|
|
75
|
+
*
|
|
76
|
+
* Named `stats` (not `topology`) because `Graph.topology` already names
|
|
77
|
+
* the raw `TopologyEvent` stream on every graph including `LensGraph`;
|
|
78
|
+
* giving the lens its own `topology` accessor with an incompatible
|
|
79
|
+
* `Node<TopologyStats>` type would break Liskov substitutability.
|
|
80
|
+
*/
|
|
81
|
+
readonly stats: Node<TopologyStats>;
|
|
82
|
+
readonly health: Node<HealthReport>;
|
|
83
|
+
/**
|
|
84
|
+
* Per-path flow tracker — a live {@link ReactiveMapBundle} keyed by
|
|
85
|
+
* qualified path. Use `.get(path)` / `.has(path)` / `.size` for O(1)
|
|
86
|
+
* sync queries; subscribe to `.entries` for a reactive snapshot of the
|
|
87
|
+
* whole map. Lazy — the snapshot is materialized only while `.entries`
|
|
88
|
+
* has subscribers.
|
|
89
|
+
*
|
|
90
|
+
* Shape intentionally differs from `stats` / `health` (which are plain
|
|
91
|
+
* `Node<Report>`) because `flow` is a keyed collection, not a single
|
|
92
|
+
* aggregate value. The map shape exposes cheaper queries than any
|
|
93
|
+
* snapshot-based design.
|
|
94
|
+
*/
|
|
95
|
+
readonly flow: ReactiveMapBundle<string, FlowEntry>;
|
|
96
|
+
private readonly _target;
|
|
97
|
+
constructor(target: Graph, opts?: GraphLensOptions);
|
|
98
|
+
/**
|
|
99
|
+
* Live causal chain from `from` to `to`. Recomputes whenever the target
|
|
100
|
+
* mutates. Disposed automatically when the lens is destroyed.
|
|
101
|
+
*
|
|
102
|
+
* **Lifetime note:** every call to `why()` registers a lens-owned disposer
|
|
103
|
+
* that runs on `lens.destroy()`. The returned `dispose` function releases
|
|
104
|
+
* the internal subscription but does NOT remove the lens-owned disposer —
|
|
105
|
+
* so heavy calling (e.g. per render frame) accumulates no-op disposers
|
|
106
|
+
* until lens teardown. Cache the returned handle for long-lived queries.
|
|
107
|
+
*
|
|
108
|
+
* @param from - Qualified path of the upstream endpoint.
|
|
109
|
+
* @param to - Qualified path of the downstream endpoint.
|
|
110
|
+
* @param opts - See {@link reactiveExplainPath}.
|
|
111
|
+
*/
|
|
112
|
+
why(from: string, to: string, opts?: {
|
|
113
|
+
maxDepth?: number;
|
|
114
|
+
name?: string;
|
|
115
|
+
findCycle?: boolean;
|
|
116
|
+
}): {
|
|
117
|
+
node: Node<CausalChain>;
|
|
118
|
+
dispose: () => void;
|
|
119
|
+
};
|
|
120
|
+
/** Reference to the lensed graph. */
|
|
121
|
+
get target(): Graph;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Create a reactive observability lens over a {@link Graph}. Returns a
|
|
125
|
+
* {@link LensGraph} with three reactive surfaces (`stats`, `health`, `flow`)
|
|
126
|
+
* plus the `why(from, to)` method.
|
|
127
|
+
*
|
|
128
|
+
* The returned graph is detached. Mount it via `target.mount("lens", lens)`
|
|
129
|
+
* if you want it to appear in the target's `describe()`, or keep it standalone.
|
|
130
|
+
*
|
|
131
|
+
* @param target - The graph to observe.
|
|
132
|
+
* @param opts - See {@link GraphLensOptions}.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* const g = new Graph("app");
|
|
137
|
+
* g.add(state(0, { name: "counter" }));
|
|
138
|
+
* const lens = graphLens(g);
|
|
139
|
+
* lens.stats.subscribe((msgs) => console.log(msgs[0]?.[1])); // TopologyStats
|
|
140
|
+
* // Flow queries — O(1) without subscribing to snapshots:
|
|
141
|
+
* lens.flow.get("counter"); // FlowEntry | undefined
|
|
142
|
+
* lens.flow.size; // number
|
|
143
|
+
* lens.flow.entries.subscribe(...); // reactive snapshot, lazy-materialized
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @category observability
|
|
147
|
+
*/
|
|
148
|
+
declare function graphLens(target: Graph, opts?: GraphLensOptions): LensGraph;
|
|
149
|
+
|
|
150
|
+
type index_FlowEntry = FlowEntry;
|
|
151
|
+
type index_GraphLensOptions = GraphLensOptions;
|
|
152
|
+
type index_HealthProblem = HealthProblem;
|
|
153
|
+
type index_HealthReport = HealthReport;
|
|
154
|
+
type index_LensGraph = LensGraph;
|
|
155
|
+
declare const index_LensGraph: typeof LensGraph;
|
|
156
|
+
type index_TopologyStats = TopologyStats;
|
|
157
|
+
declare const index_graphLens: typeof graphLens;
|
|
158
|
+
declare const index_watchTopologyTree: typeof watchTopologyTree;
|
|
159
|
+
declare namespace index {
|
|
160
|
+
export { type index_FlowEntry as FlowEntry, type index_GraphLensOptions as GraphLensOptions, type index_HealthProblem as HealthProblem, type index_HealthReport as HealthReport, index_LensGraph as LensGraph, type index_TopologyStats as TopologyStats, index_graphLens as graphLens, index_watchTopologyTree as watchTopologyTree };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export { type FlowEntry as F, type GraphLensOptions as G, type HealthProblem as H, LensGraph as L, type TopologyStats as T, type HealthReport as a, graphLens as g, index as i };
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { a as Node } from './node-Cc1TniY8.js';
|
|
2
|
+
import { NodeInput } from './extra/sources.js';
|
|
3
|
+
import { G as Graph, a as GraphOptions } from './graph-BZGRXwOm.js';
|
|
4
|
+
import { T as TopicGraph } from './index-B0c4cmIO.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* refineLoop — universal prompt/artifact optimization loop as a reactive Graph.
|
|
8
|
+
*
|
|
9
|
+
* Roadmap §9.8 (Wave 2.5). The loop is a 4-topic reactive pipeline:
|
|
10
|
+
*
|
|
11
|
+
* iterationTrigger ──▶ GENERATE ──▶ EVALUATE ──▶ ANALYZE ──▶ DECIDE
|
|
12
|
+
* │ │
|
|
13
|
+
* └─────── feedback + trigger ◀─────┘
|
|
14
|
+
*
|
|
15
|
+
* Each stage is a `TopicGraph` so dispatches stay O(1) per subscriber (cursor-
|
|
16
|
+
* based) and every iteration is observable, replayable, and checkpointable.
|
|
17
|
+
*
|
|
18
|
+
* Composition invariants (from COMPOSITION-GUIDE):
|
|
19
|
+
* - §7 feedback cycle: only `iterationTrigger` drives re-generation. Strategy
|
|
20
|
+
* + feedback + dataset are read via closure updaters (§28 factory-time seed)
|
|
21
|
+
* so mid-run swaps apply to the NEXT iteration, never retrigger the current.
|
|
22
|
+
* - §28 factory-time seed: strategy, lastFeedback, prevCandidates, dataset
|
|
23
|
+
* closures captured at wiring time + updated via subscribe handlers so the
|
|
24
|
+
* first activation doesn't drop the initial pair.
|
|
25
|
+
* - §32 nested-drain state-mirror: the decide-effect writes `lastFeedback`
|
|
26
|
+
* BEFORE bumping `iterationTrigger` inside its `batch()`, guaranteeing the
|
|
27
|
+
* mirror is current when the next-iteration wave reaches the generate fn.
|
|
28
|
+
* - §19 terminal-emission: history / best emit once per iteration (settled),
|
|
29
|
+
* not on every intermediate wave.
|
|
30
|
+
* - §27 attachStorage: the whole graph is checkpointable — pause overnight,
|
|
31
|
+
* resume tomorrow from the exact iteration count, candidate set, strategy.
|
|
32
|
+
*
|
|
33
|
+
* Scope clamp (v1): core factory + `RefineStrategy<T>` + `blindVariation` and
|
|
34
|
+
* `errorCritique` built-ins + budget gating + checkpoint/resume.
|
|
35
|
+
* `mutateAndRefine` / registry / `autoSelectStrategy` / `optimizeCatalog` /
|
|
36
|
+
* `refineExecutor` are deferred.
|
|
37
|
+
*
|
|
38
|
+
* @module
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/** A single task row — the unit the evaluator scores one candidate against. */
|
|
42
|
+
interface DatasetItem {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly [k: string]: unknown;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One candidate's score on one task. Higher is better by convention.
|
|
48
|
+
*
|
|
49
|
+
* Set `candidateIndex` when the evaluator fans out scores across multiple
|
|
50
|
+
* candidates (e.g. `candidates × tasks`). `pickBest` aggregates mean scores
|
|
51
|
+
* per `candidateIndex` when present; when absent, falls back to positional
|
|
52
|
+
* alignment (`scores[i]` ↔ `candidates[i]`).
|
|
53
|
+
*/
|
|
54
|
+
interface EvalResult {
|
|
55
|
+
readonly taskId: string;
|
|
56
|
+
readonly score: number;
|
|
57
|
+
readonly error?: string;
|
|
58
|
+
readonly detail?: unknown;
|
|
59
|
+
/** 0-based index into the `candidates` batch this score belongs to. */
|
|
60
|
+
readonly candidateIndex?: number;
|
|
61
|
+
}
|
|
62
|
+
/** Aggregated feedback the strategy produces from a scores batch. */
|
|
63
|
+
interface Feedback {
|
|
64
|
+
readonly summary: string;
|
|
65
|
+
readonly critique?: unknown;
|
|
66
|
+
readonly weakTasks?: readonly string[];
|
|
67
|
+
readonly score: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Strategy interface — plain object, no base class. Strategies implement three
|
|
71
|
+
* pure hooks; the loop infrastructure wraps them in reactive nodes so every
|
|
72
|
+
* decision is visible in `describe()`.
|
|
73
|
+
*
|
|
74
|
+
* `generate` may be sync or async. Async generates yield a microtask per
|
|
75
|
+
* iteration — that's what gives `pause()` / `setStrategy()` a window to
|
|
76
|
+
* interleave. **A fully synchronous `generate` will drain the entire loop
|
|
77
|
+
* during factory activation** (all iterations run before `refineLoop()`
|
|
78
|
+
* returns), which is usually not what you want for observable, steerable
|
|
79
|
+
* loops. Real strategies that call LLMs / evals are async and Just Work;
|
|
80
|
+
* custom sync strategies for tests are fine but should be marked `async`
|
|
81
|
+
* to match real cadence.
|
|
82
|
+
*/
|
|
83
|
+
interface RefineStrategy<T> {
|
|
84
|
+
readonly name: string;
|
|
85
|
+
/** Produce initial candidates from the seed. Called at iteration 0. */
|
|
86
|
+
seed(seed: T): readonly T[];
|
|
87
|
+
/** Reduce scores to feedback. Pure function. */
|
|
88
|
+
analyze(scores: readonly EvalResult[], candidates: readonly T[]): Feedback;
|
|
89
|
+
/**
|
|
90
|
+
* Generate next-iteration candidates from feedback + prior candidates.
|
|
91
|
+
* Async allowed — the loop awaits via `fromAny`.
|
|
92
|
+
*/
|
|
93
|
+
generate(feedback: Feedback, candidates: readonly T[]): Promise<readonly T[]> | readonly T[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Evaluator shape — Shape 4 (2026-04-22): both `candidates` and `dataset` are
|
|
97
|
+
* reactive nodes; the evaluator's returned node IS the EVALUATE topic's source
|
|
98
|
+
* (no glue). Implementers can batch-eval (e.g. `funnel` with concurrency) or
|
|
99
|
+
* map per-candidate — user's code.
|
|
100
|
+
*/
|
|
101
|
+
type Evaluator<T> = (candidates: Node<readonly T[]>, dataset: Node<readonly DatasetItem[]>) => Node<readonly EvalResult[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Early-stop controls. Each field fans into its own derived node; the four
|
|
104
|
+
* combine via `||` into `converged: Node<boolean>`. Callers see exactly
|
|
105
|
+
* which rule tripped via `status` / the DECIDE topic's `reason`.
|
|
106
|
+
*/
|
|
107
|
+
interface ConvergenceOptions {
|
|
108
|
+
/** Stop when aggregate score has not improved for N iterations. */
|
|
109
|
+
patience?: number;
|
|
110
|
+
/** Stop when aggregate score reaches or exceeds this. */
|
|
111
|
+
minScore?: number;
|
|
112
|
+
/** Stop when absolute delta between consecutive scores falls below this. */
|
|
113
|
+
minDelta?: number;
|
|
114
|
+
/** Stop after N total evaluations (iteration count × per-iter candidates). */
|
|
115
|
+
maxEvaluations?: number;
|
|
116
|
+
/** Stop after N iterations. Always set a finite bound in production. */
|
|
117
|
+
maxIterations?: number;
|
|
118
|
+
}
|
|
119
|
+
/** Emitted to the GENERATE topic each time the strategy produces a batch. */
|
|
120
|
+
interface GenerateEvent<T> {
|
|
121
|
+
readonly iteration: number;
|
|
122
|
+
readonly candidates: readonly T[];
|
|
123
|
+
readonly timestamp_ns: number;
|
|
124
|
+
}
|
|
125
|
+
/** Emitted to the EVALUATE topic when scores settle for an iteration. */
|
|
126
|
+
interface EvaluateEvent<T> {
|
|
127
|
+
readonly iteration: number;
|
|
128
|
+
readonly candidates: readonly T[];
|
|
129
|
+
readonly scores: readonly EvalResult[];
|
|
130
|
+
readonly timestamp_ns: number;
|
|
131
|
+
}
|
|
132
|
+
/** Emitted to the ANALYZE topic — strategy's reduction over scores. */
|
|
133
|
+
interface AnalyzeEvent<T> {
|
|
134
|
+
readonly iteration: number;
|
|
135
|
+
readonly candidates: readonly T[];
|
|
136
|
+
readonly feedback: Feedback;
|
|
137
|
+
readonly timestamp_ns: number;
|
|
138
|
+
}
|
|
139
|
+
/** Emitted to the DECIDE topic — branch taken this iteration. */
|
|
140
|
+
interface DecideEvent {
|
|
141
|
+
readonly iteration: number;
|
|
142
|
+
readonly decision: "continue" | "converged" | "budget" | "paused";
|
|
143
|
+
readonly reason?: string;
|
|
144
|
+
readonly timestamp_ns: number;
|
|
145
|
+
}
|
|
146
|
+
type RefineStatus = "running" | "converged" | "budget" | "paused" | "errored";
|
|
147
|
+
interface Iteration<T> {
|
|
148
|
+
readonly n: number;
|
|
149
|
+
readonly candidates: readonly T[];
|
|
150
|
+
readonly scores: readonly EvalResult[];
|
|
151
|
+
readonly feedback: Feedback;
|
|
152
|
+
/** `null` iff the candidate batch for this iteration was empty. */
|
|
153
|
+
readonly best: T | null;
|
|
154
|
+
readonly bestScore: number;
|
|
155
|
+
readonly timestamp_ns: number;
|
|
156
|
+
}
|
|
157
|
+
interface RefineLoopOptions extends ConvergenceOptions {
|
|
158
|
+
/** Reactive dataset OR a plain array (auto-wrapped into `state`). */
|
|
159
|
+
dataset: NodeInput<readonly DatasetItem[]> | readonly DatasetItem[];
|
|
160
|
+
/** Total teacher calls cap across iterations. Default: unlimited. */
|
|
161
|
+
budget?: number;
|
|
162
|
+
/** Graph name. Default: `"refine-loop"`. */
|
|
163
|
+
name?: string;
|
|
164
|
+
/** Extra graph options forwarded to the underlying `Graph`. */
|
|
165
|
+
graph?: GraphOptions;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Return type — extends Graph so all observability tools (`describe`,
|
|
169
|
+
* `explain`, `observe`, `attachStorage`, `snapshot`) Just Work.
|
|
170
|
+
*/
|
|
171
|
+
interface RefineLoopGraph<T> extends Graph {
|
|
172
|
+
readonly best: Node<T | null>;
|
|
173
|
+
readonly score: Node<number>;
|
|
174
|
+
readonly status: Node<RefineStatus>;
|
|
175
|
+
readonly history: Node<readonly Iteration<T>[]>;
|
|
176
|
+
readonly strategy: Node<RefineStrategy<T>>;
|
|
177
|
+
readonly iteration: Node<number>;
|
|
178
|
+
/** Stage topics — subscribe for per-stage streaming / cursor consumers. */
|
|
179
|
+
readonly generate: TopicGraph<GenerateEvent<T>>;
|
|
180
|
+
readonly evaluate: TopicGraph<EvaluateEvent<T>>;
|
|
181
|
+
readonly analyze: TopicGraph<AnalyzeEvent<T>>;
|
|
182
|
+
readonly decide: TopicGraph<DecideEvent>;
|
|
183
|
+
/** Swap the active strategy mid-run (human-in-the-loop handoff). */
|
|
184
|
+
setStrategy(next: RefineStrategy<T>): void;
|
|
185
|
+
/** Pause after the current iteration completes. */
|
|
186
|
+
pause(): void;
|
|
187
|
+
/** Resume a paused loop. */
|
|
188
|
+
resume(): void;
|
|
189
|
+
}
|
|
190
|
+
declare function refineLoop<T>(seed: T, evaluator: Evaluator<T>, initialStrategy: RefineStrategy<T>, opts: RefineLoopOptions): RefineLoopGraph<T>;
|
|
191
|
+
/**
|
|
192
|
+
* Context passed to a `blindVariation` teacher per call. `reportCost` is a
|
|
193
|
+
* per-call hook — see `BlindVariationOptions.tokens`.
|
|
194
|
+
*/
|
|
195
|
+
interface BlindVariationContext<T> {
|
|
196
|
+
readonly prior: T;
|
|
197
|
+
/**
|
|
198
|
+
* Report tokens consumed by this teacher call. Aggregated per iteration
|
|
199
|
+
* and flushed to `opts.tokens` in the strategy's `finally` block so
|
|
200
|
+
* partial spend is preserved when the teacher throws mid-batch.
|
|
201
|
+
*/
|
|
202
|
+
readonly reportCost: (tokens: number) => void;
|
|
203
|
+
}
|
|
204
|
+
interface BlindVariationOptions<T> {
|
|
205
|
+
/** Name — default: `"blindVariation"`. */
|
|
206
|
+
name?: string;
|
|
207
|
+
/** Number of candidates generated per iteration. Default: 4. */
|
|
208
|
+
width?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Run teacher calls in parallel via `Promise.all`. Default `true` — the
|
|
211
|
+
* common case (independent LLM calls). Set `false` to run sequentially
|
|
212
|
+
* via `for/await` when teachers share stateful resources (rate limiters,
|
|
213
|
+
* rolling context, serial API ordering) that don't tolerate concurrency.
|
|
214
|
+
*/
|
|
215
|
+
parallel?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Optional cost counter node. Running total tokens reported via
|
|
218
|
+
* `ctx.reportCost` during each iteration is added to this node in the
|
|
219
|
+
* strategy's `finally` block — fires on success AND on teacher throw so
|
|
220
|
+
* partial spend is never lost. User owns the node; wire to `budgetGate`,
|
|
221
|
+
* `attachStorage`, telemetry, etc.
|
|
222
|
+
*/
|
|
223
|
+
tokens?: Node<number>;
|
|
224
|
+
/**
|
|
225
|
+
* Teacher — given `{prior, reportCost}`, produce one variant. Async
|
|
226
|
+
* allowed. Called `width` times per iteration. Call `ctx.reportCost(n)`
|
|
227
|
+
* to track tokens consumed per call (optional, no-op if `opts.tokens`
|
|
228
|
+
* is not set).
|
|
229
|
+
*/
|
|
230
|
+
teacher: (ctx: BlindVariationContext<T>) => Promise<T> | T;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Simplest built-in strategy: generate N variants per iteration via the
|
|
234
|
+
* supplied `teacher`; no feedback-informed steering (equivalent to Random
|
|
235
|
+
* Search). Validates the loop infrastructure end-to-end and is the baseline
|
|
236
|
+
* every other strategy should outperform.
|
|
237
|
+
*
|
|
238
|
+
* `analyze` records the mean score and flags the worst task — strategies that
|
|
239
|
+
* care about per-task critique layer on top.
|
|
240
|
+
*/
|
|
241
|
+
declare function blindVariation<T>(opts: BlindVariationOptions<T>): RefineStrategy<T>;
|
|
242
|
+
/**
|
|
243
|
+
* Context passed to an `errorCritique` teacher. `critique` is the pre-formatted
|
|
244
|
+
* summary a prompt template can drop in verbatim; `failures` carries the
|
|
245
|
+
* structured evidence (per-task error / score / detail) for richer prompts.
|
|
246
|
+
*/
|
|
247
|
+
interface ErrorCritiqueContext<T> {
|
|
248
|
+
readonly prior: T;
|
|
249
|
+
readonly critique: string;
|
|
250
|
+
readonly failures: readonly EvalResult[];
|
|
251
|
+
/**
|
|
252
|
+
* Report tokens consumed by this teacher call. Aggregated per iteration
|
|
253
|
+
* and flushed to `opts.tokens` in the strategy's `finally` block so
|
|
254
|
+
* partial spend is preserved when the teacher throws mid-batch.
|
|
255
|
+
*/
|
|
256
|
+
readonly reportCost: (tokens: number) => void;
|
|
257
|
+
}
|
|
258
|
+
interface ErrorCritiqueOptions<T> {
|
|
259
|
+
/** Name — default: `"errorCritique"`. */
|
|
260
|
+
name?: string;
|
|
261
|
+
/** Number of candidates generated per iteration. Default: 4. */
|
|
262
|
+
width?: number;
|
|
263
|
+
/**
|
|
264
|
+
* Cut-off below which a task is classified as a failure and fed into the
|
|
265
|
+
* critique. Default: the batch mean — any task scoring below the batch
|
|
266
|
+
* mean is a failure. Pass a number for an absolute cut-off, or a function
|
|
267
|
+
* for per-batch computation (e.g. a percentile). When the default mean
|
|
268
|
+
* is non-finite (NaN / ±Infinity from a degenerate evaluator), ALL scores
|
|
269
|
+
* are treated as failures so the critique loop continues to steer.
|
|
270
|
+
*/
|
|
271
|
+
failureThreshold?: number | ((scores: readonly EvalResult[]) => number);
|
|
272
|
+
/** Cap on failure samples packed into the critique. Default: 5. */
|
|
273
|
+
maxFailureSamples?: number;
|
|
274
|
+
/**
|
|
275
|
+
* Format failures into the `critique` string passed to the teacher. Default
|
|
276
|
+
* joins `- taskId (score=N) | error: …` lines. Override to shape LLM prompts.
|
|
277
|
+
*
|
|
278
|
+
* **Note:** the `feedback` argument is a shell with `{score, weakTasks}`
|
|
279
|
+
* populated; `summary` is empty because `analyze` computes the final summary
|
|
280
|
+
* AFTER `formatCritique` runs (the summary embeds the formatted count).
|
|
281
|
+
* Rely on `failures` and `feedback.score` — do not read `feedback.summary`
|
|
282
|
+
* here.
|
|
283
|
+
*/
|
|
284
|
+
formatCritique?: (failures: readonly EvalResult[], feedback: Feedback) => string;
|
|
285
|
+
/**
|
|
286
|
+
* Run teacher calls in parallel via `Promise.all`. Default `true` — the
|
|
287
|
+
* common case (independent LLM calls). Set `false` to run sequentially
|
|
288
|
+
* via `for/await` when teachers share stateful resources (rate limiters,
|
|
289
|
+
* rolling context, serial API ordering) that don't tolerate concurrency.
|
|
290
|
+
*/
|
|
291
|
+
parallel?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Optional cost counter node. Running total tokens reported via
|
|
294
|
+
* `ctx.reportCost` during each iteration is added to this node in the
|
|
295
|
+
* strategy's `finally` block — fires on success AND on teacher throw so
|
|
296
|
+
* partial spend is never lost. User owns the node; wire to `budgetGate`,
|
|
297
|
+
* `attachStorage`, telemetry, etc.
|
|
298
|
+
*/
|
|
299
|
+
tokens?: Node<number>;
|
|
300
|
+
/**
|
|
301
|
+
* Teacher — given `{prior, critique, failures, reportCost}`, produce one
|
|
302
|
+
* refined variant. Called `width` times per iteration. Async allowed.
|
|
303
|
+
* Call `ctx.reportCost(n)` to track tokens consumed per call (optional,
|
|
304
|
+
* no-op if `opts.tokens` is not set).
|
|
305
|
+
*/
|
|
306
|
+
teacher: (ctx: ErrorCritiqueContext<T>) => Promise<T> | T;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Critique-driven strategy (ProTeGi-style "textual gradient"). Each iteration:
|
|
310
|
+
* 1. `analyze` classifies tasks scoring below a threshold as failures, picks
|
|
311
|
+
* the best candidate from the batch, and packs both plus a formatted
|
|
312
|
+
* critique string into `feedback.critique` as a private payload.
|
|
313
|
+
* 2. `generate` unpacks that payload and calls the teacher with
|
|
314
|
+
* `{prior, critique, failures, reportCost}` `width` times, returning the
|
|
315
|
+
* refined batch.
|
|
316
|
+
*
|
|
317
|
+
* The teacher receives a pre-formatted string (drop into an LLM prompt) AND
|
|
318
|
+
* the structured failure list (for richer prompts that want per-task detail).
|
|
319
|
+
* Throws on empty candidate batches — matches `blindVariation`'s contract
|
|
320
|
+
* (no silent zero-candidate cycles).
|
|
321
|
+
*
|
|
322
|
+
* When `setStrategy()` swaps this strategy in mid-run, the first `generate`
|
|
323
|
+
* may receive a `Feedback` produced by the prior strategy (no private payload);
|
|
324
|
+
* the fallback path uses `candidates[last]` as the prior and the feedback
|
|
325
|
+
* summary as the critique, so the loop keeps running without a stall. When a
|
|
326
|
+
* private payload IS present, `priv.critiqueText` takes precedence over any
|
|
327
|
+
* edits a caller made to `feedback.summary` — treat `critique` as the
|
|
328
|
+
* strategy-owned channel.
|
|
329
|
+
*/
|
|
330
|
+
declare function errorCritique<T>(opts: ErrorCritiqueOptions<T>): RefineStrategy<T>;
|
|
331
|
+
|
|
332
|
+
type index_AnalyzeEvent<T> = AnalyzeEvent<T>;
|
|
333
|
+
type index_BlindVariationContext<T> = BlindVariationContext<T>;
|
|
334
|
+
type index_BlindVariationOptions<T> = BlindVariationOptions<T>;
|
|
335
|
+
type index_ConvergenceOptions = ConvergenceOptions;
|
|
336
|
+
type index_DatasetItem = DatasetItem;
|
|
337
|
+
type index_DecideEvent = DecideEvent;
|
|
338
|
+
type index_ErrorCritiqueContext<T> = ErrorCritiqueContext<T>;
|
|
339
|
+
type index_ErrorCritiqueOptions<T> = ErrorCritiqueOptions<T>;
|
|
340
|
+
type index_EvalResult = EvalResult;
|
|
341
|
+
type index_EvaluateEvent<T> = EvaluateEvent<T>;
|
|
342
|
+
type index_Evaluator<T> = Evaluator<T>;
|
|
343
|
+
type index_Feedback = Feedback;
|
|
344
|
+
type index_GenerateEvent<T> = GenerateEvent<T>;
|
|
345
|
+
type index_Iteration<T> = Iteration<T>;
|
|
346
|
+
type index_RefineLoopGraph<T> = RefineLoopGraph<T>;
|
|
347
|
+
type index_RefineLoopOptions = RefineLoopOptions;
|
|
348
|
+
type index_RefineStatus = RefineStatus;
|
|
349
|
+
type index_RefineStrategy<T> = RefineStrategy<T>;
|
|
350
|
+
declare const index_blindVariation: typeof blindVariation;
|
|
351
|
+
declare const index_errorCritique: typeof errorCritique;
|
|
352
|
+
declare const index_refineLoop: typeof refineLoop;
|
|
353
|
+
declare namespace index {
|
|
354
|
+
export { type index_AnalyzeEvent as AnalyzeEvent, type index_BlindVariationContext as BlindVariationContext, type index_BlindVariationOptions as BlindVariationOptions, type index_ConvergenceOptions as ConvergenceOptions, type index_DatasetItem as DatasetItem, type index_DecideEvent as DecideEvent, type index_ErrorCritiqueContext as ErrorCritiqueContext, type index_ErrorCritiqueOptions as ErrorCritiqueOptions, type index_EvalResult as EvalResult, type index_EvaluateEvent as EvaluateEvent, type index_Evaluator as Evaluator, type index_Feedback as Feedback, type index_GenerateEvent as GenerateEvent, type index_Iteration as Iteration, type index_RefineLoopGraph as RefineLoopGraph, type index_RefineLoopOptions as RefineLoopOptions, type index_RefineStatus as RefineStatus, type index_RefineStrategy as RefineStrategy, index_blindVariation as blindVariation, index_errorCritique as errorCritique, index_refineLoop as refineLoop };
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export { type AnalyzeEvent as A, type BlindVariationContext as B, type ConvergenceOptions as C, type DatasetItem as D, type ErrorCritiqueContext as E, type Feedback as F, type GenerateEvent as G, type Iteration as I, type RefineLoopGraph as R, type BlindVariationOptions as a, type DecideEvent as b, type ErrorCritiqueOptions as c, type EvalResult as d, type EvaluateEvent as e, type Evaluator as f, type RefineLoopOptions as g, type RefineStatus as h, index as i, type RefineStrategy as j, blindVariation as k, errorCritique as l, refineLoop as r };
|