@graphrefly/graphrefly 0.44.0 → 0.45.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/README.md +21 -17
- package/dist/compat/index.cjs +20 -10
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +1 -22
- package/dist/compat/index.d.ts +1 -22
- package/dist/compat/index.js +3 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +21 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +1 -2
- package/dist/compat/jotai/index.d.ts +1 -2
- package/dist/compat/jotai/index.js +3 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +21 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +1 -2
- package/dist/compat/nanostores/index.d.ts +1 -2
- package/dist/compat/nanostores/index.js +3 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +20 -10
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +1 -13
- package/dist/compat/nestjs/index.d.ts +1 -13
- package/dist/compat/nestjs/index.js +3 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +21 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +1 -2
- package/dist/compat/react/index.d.ts +1 -2
- package/dist/compat/react/index.js +3 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +21 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +1 -2
- package/dist/compat/solid/index.d.ts +1 -2
- package/dist/compat/solid/index.js +3 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +21 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +1 -2
- package/dist/compat/svelte/index.d.ts +1 -2
- package/dist/compat/svelte/index.js +3 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +21 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +1 -3
- package/dist/compat/vue/index.d.ts +1 -3
- package/dist/compat/vue/index.js +3 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +21 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +1 -6
- package/dist/compat/zustand/index.d.ts +1 -6
- package/dist/compat/zustand/index.js +3 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/core/index.cjs +21 -1
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +1 -3
- package/dist/core/index.d.ts +1 -3
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -0
- package/dist/extra/browser.cjs +21 -1
- package/dist/extra/browser.cjs.map +1 -0
- package/dist/extra/browser.d.cts +1 -4
- package/dist/extra/browser.d.ts +1 -4
- package/dist/extra/browser.js +3 -1
- package/dist/extra/browser.js.map +1 -0
- package/dist/extra/index.cjs +20 -19
- package/dist/extra/index.cjs.map +1 -0
- package/dist/extra/index.d.cts +1 -17
- package/dist/extra/index.d.ts +1 -17
- package/dist/extra/index.js +3 -1
- package/dist/extra/index.js.map +1 -0
- package/dist/extra/node.cjs +21 -2
- package/dist/extra/node.cjs.map +1 -0
- package/dist/extra/node.d.cts +1 -187
- package/dist/extra/node.d.ts +1 -187
- package/dist/extra/node.js +3 -2
- package/dist/extra/node.js.map +1 -0
- package/dist/extra/operators.cjs +21 -1
- package/dist/extra/operators.cjs.map +1 -0
- package/dist/extra/operators.d.cts +1 -958
- package/dist/extra/operators.d.ts +1 -958
- package/dist/extra/operators.js +3 -1
- package/dist/extra/operators.js.map +1 -0
- package/dist/extra/reactive.cjs +21 -1
- package/dist/extra/reactive.cjs.map +1 -0
- package/dist/extra/reactive.d.cts +1 -353
- package/dist/extra/reactive.d.ts +1 -353
- package/dist/extra/reactive.js +3 -1
- package/dist/extra/reactive.js.map +1 -0
- package/dist/extra/render/index.cjs +21 -5
- package/dist/extra/render/index.cjs.map +1 -0
- package/dist/extra/render/index.d.cts +1 -183
- package/dist/extra/render/index.d.ts +1 -183
- package/dist/extra/render/index.js +3 -1
- package/dist/extra/render/index.js.map +1 -0
- package/dist/extra/sources.cjs +21 -3
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +1 -584
- package/dist/extra/sources.d.ts +1 -584
- package/dist/extra/sources.js +3 -1
- package/dist/extra/sources.js.map +1 -0
- package/dist/extra/storage-browser.cjs +21 -1
- package/dist/extra/storage-browser.cjs.map +1 -0
- package/dist/extra/storage-browser.d.cts +1 -37
- package/dist/extra/storage-browser.d.ts +1 -37
- package/dist/extra/storage-browser.js +3 -1
- package/dist/extra/storage-browser.js.map +1 -0
- package/dist/extra/storage-core.cjs +21 -1
- package/dist/extra/storage-core.cjs.map +1 -0
- package/dist/extra/storage-core.d.cts +1 -28
- package/dist/extra/storage-core.d.ts +1 -28
- package/dist/extra/storage-core.js +3 -1
- package/dist/extra/storage-core.js.map +1 -0
- package/dist/extra/storage-node.cjs +20 -0
- package/dist/extra/storage-node.cjs.map +1 -0
- package/dist/extra/storage-node.d.cts +1 -2
- package/dist/extra/storage-node.d.ts +1 -2
- package/dist/extra/storage-node.js +3 -0
- package/dist/extra/storage-node.js.map +1 -0
- package/dist/extra/storage-tiers-browser.cjs +21 -1
- package/dist/extra/storage-tiers-browser.cjs.map +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +1 -120
- package/dist/extra/storage-tiers-browser.d.ts +1 -120
- package/dist/extra/storage-tiers-browser.js +3 -1
- package/dist/extra/storage-tiers-browser.js.map +1 -0
- package/dist/extra/storage-tiers-node.cjs +21 -1
- package/dist/extra/storage-tiers-node.cjs.map +1 -0
- package/dist/extra/storage-tiers-node.d.cts +1 -210
- package/dist/extra/storage-tiers-node.d.ts +1 -210
- package/dist/extra/storage-tiers-node.js +3 -1
- package/dist/extra/storage-tiers-node.js.map +1 -0
- package/dist/extra/storage-tiers.cjs +21 -1
- package/dist/extra/storage-tiers.cjs.map +1 -0
- package/dist/extra/storage-tiers.d.cts +1 -412
- package/dist/extra/storage-tiers.d.ts +1 -412
- package/dist/extra/storage-tiers.js +3 -1
- package/dist/extra/storage-tiers.js.map +1 -0
- package/dist/extra/storage-wal.cjs +21 -0
- package/dist/extra/storage-wal.cjs.map +1 -0
- package/dist/extra/storage-wal.d.cts +1 -0
- package/dist/extra/storage-wal.d.ts +1 -0
- package/dist/extra/storage-wal.js +3 -0
- package/dist/extra/storage-wal.js.map +1 -0
- package/dist/graph/index.cjs +21 -7
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +1 -7
- package/dist/graph/index.d.ts +1 -7
- package/dist/graph/index.js +3 -1
- package/dist/graph/index.js.map +1 -0
- package/dist/index.cjs +20 -227
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +45 -95
- package/dist/index.d.ts +45 -95
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -0
- package/dist/patterns/ai/browser.cjs +20 -7
- package/dist/patterns/ai/browser.cjs.map +1 -0
- package/dist/patterns/ai/browser.d.cts +1 -127
- package/dist/patterns/ai/browser.d.ts +1 -127
- package/dist/patterns/ai/browser.js +3 -3
- package/dist/patterns/ai/browser.js.map +1 -0
- package/dist/patterns/ai/index.cjs +20 -73
- package/dist/patterns/ai/index.cjs.map +1 -0
- package/dist/patterns/ai/index.d.cts +1 -20
- package/dist/patterns/ai/index.d.ts +1 -20
- package/dist/patterns/ai/index.js +3 -1
- package/dist/patterns/ai/index.js.map +1 -0
- package/dist/patterns/ai/node.cjs +21 -1
- package/dist/patterns/ai/node.cjs.map +1 -0
- package/dist/patterns/ai/node.d.cts +1 -59
- package/dist/patterns/ai/node.d.ts +1 -59
- package/dist/patterns/ai/node.js +3 -1
- package/dist/patterns/ai/node.js.map +1 -0
- package/dist/patterns/cqrs/index.cjs +21 -3
- package/dist/patterns/cqrs/index.cjs.map +1 -0
- package/dist/patterns/cqrs/index.d.cts +1 -8
- package/dist/patterns/cqrs/index.d.ts +1 -8
- package/dist/patterns/cqrs/index.js +3 -1
- package/dist/patterns/cqrs/index.js.map +1 -0
- package/dist/patterns/demo-shell/index.cjs +21 -5
- package/dist/patterns/demo-shell/index.cjs.map +1 -0
- package/dist/patterns/demo-shell/index.d.cts +1 -7
- package/dist/patterns/demo-shell/index.d.ts +1 -7
- package/dist/patterns/demo-shell/index.js +3 -1
- package/dist/patterns/demo-shell/index.js.map +1 -0
- package/dist/patterns/domain-templates/index.cjs +21 -3
- package/dist/patterns/domain-templates/index.cjs.map +1 -0
- package/dist/patterns/domain-templates/index.d.cts +1 -6
- package/dist/patterns/domain-templates/index.d.ts +1 -6
- package/dist/patterns/domain-templates/index.js +3 -1
- package/dist/patterns/domain-templates/index.js.map +1 -0
- package/dist/patterns/graphspec/index.cjs +21 -86
- package/dist/patterns/graphspec/index.cjs.map +1 -0
- package/dist/patterns/graphspec/index.d.cts +1 -8
- package/dist/patterns/graphspec/index.d.ts +1 -8
- package/dist/patterns/graphspec/index.js +3 -1
- package/dist/patterns/graphspec/index.js.map +1 -0
- package/dist/patterns/harness/index.cjs +21 -48
- package/dist/patterns/harness/index.cjs.map +1 -0
- package/dist/patterns/harness/index.d.cts +1 -13
- package/dist/patterns/harness/index.d.ts +1 -13
- package/dist/patterns/harness/index.js +3 -1
- package/dist/patterns/harness/index.js.map +1 -0
- package/dist/patterns/inspect/index.cjs +21 -3
- package/dist/patterns/inspect/index.cjs.map +1 -0
- package/dist/patterns/inspect/index.d.cts +1 -9
- package/dist/patterns/inspect/index.d.ts +1 -9
- package/dist/patterns/inspect/index.js +3 -1
- package/dist/patterns/inspect/index.js.map +1 -0
- package/dist/patterns/job-queue/index.cjs +21 -3
- package/dist/patterns/job-queue/index.cjs.map +1 -0
- package/dist/patterns/job-queue/index.d.cts +1 -9
- package/dist/patterns/job-queue/index.d.ts +1 -9
- package/dist/patterns/job-queue/index.js +3 -1
- package/dist/patterns/job-queue/index.js.map +1 -0
- package/dist/patterns/memory/index.cjs +21 -3
- package/dist/patterns/memory/index.cjs.map +1 -0
- package/dist/patterns/memory/index.d.cts +1 -8
- package/dist/patterns/memory/index.d.ts +1 -8
- package/dist/patterns/memory/index.js +3 -1
- package/dist/patterns/memory/index.js.map +1 -0
- package/dist/patterns/messaging/index.cjs +21 -3
- package/dist/patterns/messaging/index.cjs.map +1 -0
- package/dist/patterns/messaging/index.d.cts +1 -7
- package/dist/patterns/messaging/index.d.ts +1 -7
- package/dist/patterns/messaging/index.js +3 -1
- package/dist/patterns/messaging/index.js.map +1 -0
- package/dist/patterns/orchestration/index.cjs +21 -3
- package/dist/patterns/orchestration/index.cjs.map +1 -0
- package/dist/patterns/orchestration/index.d.cts +1 -8
- package/dist/patterns/orchestration/index.d.ts +1 -8
- package/dist/patterns/orchestration/index.js +3 -1
- package/dist/patterns/orchestration/index.js.map +1 -0
- package/dist/patterns/process/index.cjs +21 -3
- package/dist/patterns/process/index.cjs.map +1 -0
- package/dist/patterns/process/index.d.cts +1 -10
- package/dist/patterns/process/index.d.ts +1 -10
- package/dist/patterns/process/index.js +3 -1
- package/dist/patterns/process/index.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +21 -4
- package/dist/patterns/reactive-layout/index.cjs.map +1 -0
- package/dist/patterns/reactive-layout/index.d.cts +1 -7
- package/dist/patterns/reactive-layout/index.d.ts +1 -7
- package/dist/patterns/reactive-layout/index.js +3 -1
- package/dist/patterns/reactive-layout/index.js.map +1 -0
- package/dist/patterns/reduction/index.cjs +21 -3
- package/dist/patterns/reduction/index.cjs.map +1 -0
- package/dist/patterns/reduction/index.d.cts +1 -6
- package/dist/patterns/reduction/index.d.ts +1 -6
- package/dist/patterns/reduction/index.js +3 -1
- package/dist/patterns/reduction/index.js.map +1 -0
- package/dist/patterns/surface/index.cjs +21 -13
- package/dist/patterns/surface/index.cjs.map +1 -0
- package/dist/patterns/surface/index.d.cts +1 -9
- package/dist/patterns/surface/index.d.ts +1 -9
- package/dist/patterns/surface/index.js +3 -1
- package/dist/patterns/surface/index.js.map +1 -0
- package/dist/patterns/topology-view/index.cjs +21 -0
- package/dist/patterns/topology-view/index.cjs.map +1 -0
- package/dist/patterns/topology-view/index.d.cts +1 -0
- package/dist/patterns/topology-view/index.d.ts +1 -0
- package/dist/patterns/topology-view/index.js +3 -0
- package/dist/patterns/topology-view/index.js.map +1 -0
- package/dist/testing/index.cjs +21 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +608 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/cascading-BglDkMdX.d.cts +0 -199
- package/dist/cascading-MFgxu7Yo.d.ts +0 -199
- package/dist/chunk-2T7U5EU6.js +0 -1
- package/dist/chunk-3G5U5QNE.js +0 -5
- package/dist/chunk-4VVTGLXJ.js +0 -1
- package/dist/chunk-5M4CCMMD.js +0 -45
- package/dist/chunk-5QDBSZBV.js +0 -1
- package/dist/chunk-5XJ6B66J.js +0 -1
- package/dist/chunk-6QZNQS5B.js +0 -1
- package/dist/chunk-6X7AFUJV.js +0 -9
- package/dist/chunk-7K6PWTDQ.js +0 -1
- package/dist/chunk-7LIAPXJB.js +0 -1
- package/dist/chunk-7WPU3UHQ.js +0 -1
- package/dist/chunk-A5WCQ5NO.js +0 -1
- package/dist/chunk-APPIWSGD.js +0 -84
- package/dist/chunk-BEZWM2SY.js +0 -1
- package/dist/chunk-C72GO4IZ.js +0 -1
- package/dist/chunk-CB676TKJ.js +0 -1
- package/dist/chunk-CE6TI2TL.js +0 -1
- package/dist/chunk-CE72X3WO.js +0 -1
- package/dist/chunk-CK2E7BTU.js +0 -1
- package/dist/chunk-CLVB32RD.js +0 -1
- package/dist/chunk-CRVT7D2P.js +0 -1
- package/dist/chunk-D5RFJOZ2.js +0 -1
- package/dist/chunk-D7GPHKFH.js +0 -1
- package/dist/chunk-DHRX7JX4.js +0 -2
- package/dist/chunk-ESMPEKEV.js +0 -1
- package/dist/chunk-F672GV32.js +0 -1
- package/dist/chunk-FZMYDOWV.js +0 -1
- package/dist/chunk-GHBWHMRZ.js +0 -1
- package/dist/chunk-GLERH466.js +0 -1
- package/dist/chunk-GPW2V3RE.js +0 -1
- package/dist/chunk-HIDYF36O.js +0 -1
- package/dist/chunk-HITNVN6B.js +0 -3
- package/dist/chunk-HY4DJBA7.js +0 -5
- package/dist/chunk-KZIEYVXN.js +0 -1
- package/dist/chunk-L6NSJVJZ.js +0 -1
- package/dist/chunk-N4MQX6JU.js +0 -18
- package/dist/chunk-N7FHEL4D.js +0 -1
- package/dist/chunk-NTEURFZH.js +0 -1
- package/dist/chunk-OIVP6KFV.js +0 -1
- package/dist/chunk-OPHBU3LG.js +0 -1
- package/dist/chunk-OYQOZP2F.js +0 -5
- package/dist/chunk-PTZK576G.js +0 -1
- package/dist/chunk-QYADASLV.js +0 -1
- package/dist/chunk-ST7UXLWR.js +0 -1
- package/dist/chunk-SVY7VUYU.js +0 -1
- package/dist/chunk-TK3NWWD4.js +0 -1
- package/dist/chunk-TSOYJ743.js +0 -1
- package/dist/chunk-UNGSTR4X.js +0 -61
- package/dist/chunk-VIMF6LGM.js +0 -1
- package/dist/chunk-VJLMUKOI.js +0 -1
- package/dist/chunk-VN6RDSK2.js +0 -1
- package/dist/chunk-VV4N5P64.js +0 -1
- package/dist/chunk-W3I423PS.js +0 -1
- package/dist/chunk-WJR24TAG.js +0 -1
- package/dist/chunk-XTGKMHSW.js +0 -1
- package/dist/chunk-YBB7ZGTY.js +0 -1
- package/dist/chunk-Z4NPUARF.js +0 -1
- package/dist/chunk-ZGNQRPDT.js +0 -1
- package/dist/chunk-ZKPSFFKU.js +0 -1
- package/dist/chunk-ZLV5SQSX.js +0 -1
- package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
- package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
- package/dist/decay-BvOWTZ00.d.ts +0 -112
- package/dist/decay-CFlLvXUT.d.cts +0 -112
- package/dist/fallback-74oxi34l.d.cts +0 -250
- package/dist/fallback-DUyyBTBK.d.ts +0 -250
- package/dist/graph-CWvEUQAq.d.cts +0 -1861
- package/dist/graph-D9LFnda9.d.ts +0 -1861
- package/dist/index-5k1T6jl0.d.cts +0 -121
- package/dist/index-9770hRuQ.d.cts +0 -779
- package/dist/index-B-_tFaqV.d.cts +0 -468
- package/dist/index-B17QddL1.d.cts +0 -374
- package/dist/index-B1F8Enjf.d.ts +0 -704
- package/dist/index-B5S8ULbU.d.ts +0 -515
- package/dist/index-B8YnZpIR.d.ts +0 -102
- package/dist/index-BHskSB8v.d.ts +0 -3413
- package/dist/index-BIYAkbAi.d.cts +0 -26
- package/dist/index-BQSKmbuG.d.cts +0 -127
- package/dist/index-BaQaY_IQ.d.cts +0 -231
- package/dist/index-BmZXHqkE.d.ts +0 -36
- package/dist/index-BoJ5JHxI.d.ts +0 -557
- package/dist/index-BocU7pqs.d.ts +0 -779
- package/dist/index-BrPrLl4e.d.cts +0 -86
- package/dist/index-BxNs2HB9.d.cts +0 -1858
- package/dist/index-Byu-OpX_.d.ts +0 -113
- package/dist/index-C1T3d7V-.d.cts +0 -704
- package/dist/index-C5ri2Axc.d.cts +0 -301
- package/dist/index-C5stwKcw.d.cts +0 -44
- package/dist/index-C9l6OEBL.d.ts +0 -26
- package/dist/index-CBBLl_rc.d.ts +0 -127
- package/dist/index-CBGUK09R.d.ts +0 -754
- package/dist/index-CC-AvFTy.d.cts +0 -557
- package/dist/index-CJF1URuX.d.ts +0 -121
- package/dist/index-CK29LV56.d.cts +0 -34
- package/dist/index-CMh5Rz1y.d.ts +0 -385
- package/dist/index-CPQlGA29.d.ts +0 -34
- package/dist/index-CR8QpwX8.d.ts +0 -2680
- package/dist/index-CS0LTlB8.d.cts +0 -385
- package/dist/index-CSOmP7xT.d.cts +0 -291
- package/dist/index-CYq8vAyV.d.ts +0 -291
- package/dist/index-CZ3r5Rxp.d.ts +0 -374
- package/dist/index-CasX6Pfq.d.cts +0 -358
- package/dist/index-CdAlHFEt.d.ts +0 -44
- package/dist/index-CdTelp1M.d.ts +0 -202
- package/dist/index-CeFiHtAg.d.ts +0 -468
- package/dist/index-Cj3WohTd.d.cts +0 -202
- package/dist/index-Climxqsu.d.cts +0 -754
- package/dist/index-Co7uli2l.d.cts +0 -3413
- package/dist/index-CviRnE4K.d.ts +0 -45
- package/dist/index-Cwv0KWcU.d.cts +0 -102
- package/dist/index-CzLVrjxn.d.ts +0 -231
- package/dist/index-D0aciIex.d.cts +0 -209
- package/dist/index-DHen9Klo.d.ts +0 -1858
- package/dist/index-DV_1YuVk.d.cts +0 -221
- package/dist/index-Dc4AYqrJ.d.cts +0 -515
- package/dist/index-Dgl1HpPn.d.ts +0 -86
- package/dist/index-DisjX8a-.d.ts +0 -221
- package/dist/index-UPSiS-X7.d.cts +0 -2680
- package/dist/index-Yq60JP3s.d.ts +0 -209
- package/dist/index-ZVQhLa2i.d.cts +0 -37
- package/dist/index-_6ODbuOu.d.cts +0 -45
- package/dist/index-hcDJ8PSI.d.cts +0 -36
- package/dist/index-nozs3fFC.d.ts +0 -301
- package/dist/index-p09KSrTN.d.ts +0 -358
- package/dist/index-sqkqlb1p.d.ts +0 -37
- package/dist/index-tRCxuAXF.d.cts +0 -113
- package/dist/node-kK3CvTrR.d.cts +0 -1347
- package/dist/node-kK3CvTrR.d.ts +0 -1347
- package/dist/observable-DWjNfLvC.d.ts +0 -36
- package/dist/observable-e3eiPPFy.d.cts +0 -36
- package/dist/pipeline-graph-CIKhynsF.d.cts +0 -142
- package/dist/pipeline-graph-Sgj0gCwn.d.ts +0 -142
- package/dist/reactive-layout-DOTs9P3X.d.ts +0 -183
- package/dist/reactive-layout-DgctbqZo.d.cts +0 -183
- package/dist/reactive-log-BKALbfal.d.ts +0 -223
- package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
- package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
- package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
- package/dist/resilience-6LYQJAC5.js +0 -1
- package/dist/sugar-DQjFmVqb.d.cts +0 -399
- package/dist/sugar-fhLIE7TT.d.ts +0 -399
- package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
- package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
- package/dist/types-C0_yquda.d.cts +0 -442
- package/dist/types-CWFysE9E.d.ts +0 -442
package/dist/backoff-HPZMEZNF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-4VVTGLXJ.js";import"./chunk-QYADASLV.js";export{a as NS_PER_MS,b as NS_PER_SEC,c as constant,g as decorrelatedJitter,e as exponential,f as fibonacci,d as linear,i as resolveBackoffPreset,h as withMaxAttempts};
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { L as LLMAdapter, C as ChatMessage, a as LLMInvokeOptions } from './types-C0_yquda.cjs';
|
|
2
|
-
import { b as CircuitBreakerOptions, C as CircuitBreaker } from './index-C1T3d7V-.cjs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* OpenAICompatAdapter — default fetch-backed, optional SDK-backed.
|
|
6
|
-
*
|
|
7
|
-
* Covers any provider that speaks OpenAI chat/completions. Preset base URLs
|
|
8
|
-
* for OpenAI, OpenRouter, Groq, Ollama, DeepSeek, xAI Grok (all expose the
|
|
9
|
-
* same `/v1/chat/completions` shape).
|
|
10
|
-
*
|
|
11
|
-
* Token usage mapping:
|
|
12
|
-
* - `prompt_tokens` → `input.regular` (minus cached_tokens)
|
|
13
|
-
* - `prompt_tokens_details.cached_tokens` → `input.cacheRead`
|
|
14
|
-
* - `prompt_tokens_details.audio_tokens` → `input.audio`
|
|
15
|
-
* - `completion_tokens` → `output.regular` (minus reasoning)
|
|
16
|
-
* - `completion_tokens_details.reasoning_tokens` → `output.reasoning`
|
|
17
|
-
* - `completion_tokens_details.audio_tokens` → `output.audio`
|
|
18
|
-
* - `completion_tokens_details.accepted_prediction_tokens` → `output.predictionAccepted`
|
|
19
|
-
* - `completion_tokens_details.rejected_prediction_tokens` → `output.predictionRejected`
|
|
20
|
-
*
|
|
21
|
-
* DeepSeek compatibility: `prompt_cache_hit_tokens` / `prompt_cache_miss_tokens`
|
|
22
|
-
* are surfaced in the `raw` field of `TokenUsage`; when present we prefer
|
|
23
|
-
* them over the OpenAI-style `cached_tokens` for cache-read attribution.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
type OpenAICompatPreset = "openai" | "openrouter" | "groq" | "ollama" | "deepseek" | "xai";
|
|
27
|
-
interface OpenAICompatAdapterOptions {
|
|
28
|
-
preset?: OpenAICompatPreset;
|
|
29
|
-
/** Explicit provider label (defaults to preset's provider). */
|
|
30
|
-
provider?: string;
|
|
31
|
-
/** API key. Falls back to the preset's default env var on Node. */
|
|
32
|
-
apiKey?: string;
|
|
33
|
-
model?: string;
|
|
34
|
-
/** Override base URL (wins over `preset`). */
|
|
35
|
-
baseURL?: string;
|
|
36
|
-
/** Extra request headers. */
|
|
37
|
-
headers?: Record<string, string>;
|
|
38
|
-
/** Extra request-body fields merged on every request (OpenRouter routing etc.). */
|
|
39
|
-
bodyExtras?: Record<string, unknown>;
|
|
40
|
-
/** User-provided SDK instance (OpenAI-family shape). */
|
|
41
|
-
sdk?: OpenAISdkLike;
|
|
42
|
-
/** Custom fetch (for tests). */
|
|
43
|
-
fetchImpl?: typeof fetch;
|
|
44
|
-
}
|
|
45
|
-
interface OpenAISdkLike {
|
|
46
|
-
chat: {
|
|
47
|
-
completions: {
|
|
48
|
-
create(params: Record<string, unknown>, opts?: {
|
|
49
|
-
signal?: AbortSignal;
|
|
50
|
-
}): Promise<OpenAIChatResponse>;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
interface OpenAIChatResponse {
|
|
55
|
-
id: string;
|
|
56
|
-
choices: ReadonlyArray<{
|
|
57
|
-
message: {
|
|
58
|
-
role: string;
|
|
59
|
-
content?: string | null;
|
|
60
|
-
tool_calls?: ReadonlyArray<{
|
|
61
|
-
id: string;
|
|
62
|
-
type: "function";
|
|
63
|
-
function: {
|
|
64
|
-
name: string;
|
|
65
|
-
arguments: string;
|
|
66
|
-
};
|
|
67
|
-
}>;
|
|
68
|
-
reasoning_content?: string;
|
|
69
|
-
};
|
|
70
|
-
finish_reason?: string;
|
|
71
|
-
}>;
|
|
72
|
-
usage?: OpenAIUsage;
|
|
73
|
-
model?: string;
|
|
74
|
-
}
|
|
75
|
-
interface OpenAIUsage {
|
|
76
|
-
prompt_tokens?: number;
|
|
77
|
-
completion_tokens?: number;
|
|
78
|
-
total_tokens?: number;
|
|
79
|
-
prompt_tokens_details?: {
|
|
80
|
-
cached_tokens?: number;
|
|
81
|
-
audio_tokens?: number;
|
|
82
|
-
};
|
|
83
|
-
completion_tokens_details?: {
|
|
84
|
-
reasoning_tokens?: number;
|
|
85
|
-
audio_tokens?: number;
|
|
86
|
-
accepted_prediction_tokens?: number;
|
|
87
|
-
rejected_prediction_tokens?: number;
|
|
88
|
-
};
|
|
89
|
-
prompt_cache_hit_tokens?: number;
|
|
90
|
-
prompt_cache_miss_tokens?: number;
|
|
91
|
-
}
|
|
92
|
-
declare function openAICompatAdapter(opts?: OpenAICompatAdapterOptions): LLMAdapter;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* `createAdapter` — provider-dispatching factory.
|
|
96
|
-
*
|
|
97
|
-
* One entry point, one config object. Picks the right concrete adapter by
|
|
98
|
-
* `provider`, forwards everything else. Users who want finer control import
|
|
99
|
-
* the concrete adapter directly (`anthropicAdapter`, `openAICompatAdapter`,
|
|
100
|
-
* `googleAdapter`, `dryRunAdapter`, `webllmAdapter`, `chromeNanoAdapter`).
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
type AdapterProvider = "anthropic" | OpenAICompatPreset | "google" | "dry-run" | "fallback";
|
|
104
|
-
interface CreateAdapterOptions {
|
|
105
|
-
provider: AdapterProvider;
|
|
106
|
-
apiKey?: string;
|
|
107
|
-
model?: string;
|
|
108
|
-
baseURL?: string;
|
|
109
|
-
headers?: Record<string, string>;
|
|
110
|
-
/** OpenAI-compat bodyExtras (OpenRouter routing, etc.). */
|
|
111
|
-
bodyExtras?: Record<string, unknown>;
|
|
112
|
-
/** Provider-specific SDK instance (any of AnthropicSdkLike / OpenAISdkLike / GoogleSdkLike). */
|
|
113
|
-
sdk?: unknown;
|
|
114
|
-
/** Custom fetch (for tests). */
|
|
115
|
-
fetchImpl?: typeof fetch;
|
|
116
|
-
/** Extra per-provider options forwarded verbatim. */
|
|
117
|
-
extras?: Record<string, unknown>;
|
|
118
|
-
}
|
|
119
|
-
declare function createAdapter(opts: CreateAdapterOptions): LLMAdapter;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* `cascadingLlmAdapter` — N-tier fallback over any mix of LLM adapters.
|
|
123
|
-
*
|
|
124
|
-
* Same structural pattern as `cascadingCache` and `Graph.attachSnapshotStorage`:
|
|
125
|
-
* ordered list, first-success wins, per-tier breaker optional, filter gates
|
|
126
|
-
* per request. Semantics:
|
|
127
|
-
*
|
|
128
|
-
* - `invoke()`: try tier 0 first. On error (or breaker-open), fall through
|
|
129
|
-
* to tier 1, 2, ... until one succeeds or all fail.
|
|
130
|
-
* - `stream()`: tries to start the stream on tier 0; once tokens begin, it
|
|
131
|
-
* commits — failures in mid-stream surface rather than re-starting on the
|
|
132
|
-
* next tier (would double-bill and confuse consumers). **State-machine
|
|
133
|
-
* consumers (usage accounting, UI accumulators) must handle errors in a
|
|
134
|
-
* catch block — no synthetic `{type: "finish"}` is emitted after a thrown
|
|
135
|
-
* stream error.**
|
|
136
|
-
* - `filter`: skips a tier for requests that use features it doesn't
|
|
137
|
-
* support (e.g., Chrome Nano can't do tool use).
|
|
138
|
-
* - `breaker`: per-tier circuit; when open, cascade treats the tier as
|
|
139
|
-
* unavailable and moves on immediately.
|
|
140
|
-
*
|
|
141
|
-
* On exhaustion, throws `AllTiersExhaustedError` with separate `skipped` and
|
|
142
|
-
* `failed` collections so consumers can distinguish "no tier applicable"
|
|
143
|
-
* from "all tiers failed".
|
|
144
|
-
*/
|
|
145
|
-
|
|
146
|
-
interface AdapterTier {
|
|
147
|
-
name: string;
|
|
148
|
-
adapter: LLMAdapter;
|
|
149
|
-
/** Per-tier circuit breaker. If omitted, no breaker on this tier. */
|
|
150
|
-
breaker?: CircuitBreakerOptions | CircuitBreaker;
|
|
151
|
-
/** Skip this tier when the request doesn't fit (e.g. Chrome Nano + tools). */
|
|
152
|
-
filter?: (messages: readonly ChatMessage[], opts?: LLMInvokeOptions) => boolean;
|
|
153
|
-
}
|
|
154
|
-
interface CascadeExhaustionReport {
|
|
155
|
-
/** Tiers that never ran (filter returned false, or breaker was open). */
|
|
156
|
-
readonly skipped: ReadonlyArray<{
|
|
157
|
-
name: string;
|
|
158
|
-
reason: "filter" | "breaker";
|
|
159
|
-
}>;
|
|
160
|
-
/** Tiers that ran and threw. */
|
|
161
|
-
readonly failed: ReadonlyMap<string, unknown>;
|
|
162
|
-
}
|
|
163
|
-
interface CascadingLlmAdapterOptions {
|
|
164
|
-
onFallback?: (from: string, to: string, error: unknown) => void;
|
|
165
|
-
onExhausted?: (report: CascadeExhaustionReport) => void;
|
|
166
|
-
/** Whether to attempt stream retry on subsequent tiers before first chunk. Default true. */
|
|
167
|
-
streamRetryBeforeFirstChunk?: boolean;
|
|
168
|
-
}
|
|
169
|
-
declare class AllTiersExhaustedError extends Error {
|
|
170
|
-
name: string;
|
|
171
|
-
readonly skipped: ReadonlyArray<{
|
|
172
|
-
name: string;
|
|
173
|
-
reason: "filter" | "breaker";
|
|
174
|
-
}>;
|
|
175
|
-
readonly failed: ReadonlyMap<string, unknown>;
|
|
176
|
-
constructor(report: CascadeExhaustionReport);
|
|
177
|
-
}
|
|
178
|
-
declare function cascadingLlmAdapter(tiers: readonly AdapterTier[], opts?: CascadingLlmAdapterOptions): LLMAdapter;
|
|
179
|
-
/**
|
|
180
|
-
* Tiny type-safe constructor for an {@link AdapterTier}. Cleans up the
|
|
181
|
-
* heterogeneous array-type cast users (and `browser-presets.ts`) had to write
|
|
182
|
-
* by hand. Per Wave A Unit 13 decision.
|
|
183
|
-
*
|
|
184
|
-
* @example
|
|
185
|
-
* ```ts
|
|
186
|
-
* cascadingLlmAdapter([
|
|
187
|
-
* tier("local", webllmAdapter(...)),
|
|
188
|
-
* tier("cloud", anthropicAdapter(...), { breaker: { failureThreshold: 5 } }),
|
|
189
|
-
* ]);
|
|
190
|
-
* ```
|
|
191
|
-
*
|
|
192
|
-
* @category ai
|
|
193
|
-
*/
|
|
194
|
-
declare function tier(name: string, adapter: LLMAdapter, opts?: {
|
|
195
|
-
breaker?: CircuitBreakerOptions | CircuitBreaker;
|
|
196
|
-
filter?: AdapterTier["filter"];
|
|
197
|
-
}): AdapterTier;
|
|
198
|
-
|
|
199
|
-
export { type AdapterProvider as A, type CascadingLlmAdapterOptions as C, type OpenAICompatAdapterOptions as O, type CascadeExhaustionReport as a, type AdapterTier as b, createAdapter as c, AllTiersExhaustedError as d, type CreateAdapterOptions as e, type OpenAICompatPreset as f, type OpenAISdkLike as g, cascadingLlmAdapter as h, openAICompatAdapter as o, tier as t };
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { L as LLMAdapter, C as ChatMessage, a as LLMInvokeOptions } from './types-CWFysE9E.js';
|
|
2
|
-
import { b as CircuitBreakerOptions, C as CircuitBreaker } from './index-B1F8Enjf.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* OpenAICompatAdapter — default fetch-backed, optional SDK-backed.
|
|
6
|
-
*
|
|
7
|
-
* Covers any provider that speaks OpenAI chat/completions. Preset base URLs
|
|
8
|
-
* for OpenAI, OpenRouter, Groq, Ollama, DeepSeek, xAI Grok (all expose the
|
|
9
|
-
* same `/v1/chat/completions` shape).
|
|
10
|
-
*
|
|
11
|
-
* Token usage mapping:
|
|
12
|
-
* - `prompt_tokens` → `input.regular` (minus cached_tokens)
|
|
13
|
-
* - `prompt_tokens_details.cached_tokens` → `input.cacheRead`
|
|
14
|
-
* - `prompt_tokens_details.audio_tokens` → `input.audio`
|
|
15
|
-
* - `completion_tokens` → `output.regular` (minus reasoning)
|
|
16
|
-
* - `completion_tokens_details.reasoning_tokens` → `output.reasoning`
|
|
17
|
-
* - `completion_tokens_details.audio_tokens` → `output.audio`
|
|
18
|
-
* - `completion_tokens_details.accepted_prediction_tokens` → `output.predictionAccepted`
|
|
19
|
-
* - `completion_tokens_details.rejected_prediction_tokens` → `output.predictionRejected`
|
|
20
|
-
*
|
|
21
|
-
* DeepSeek compatibility: `prompt_cache_hit_tokens` / `prompt_cache_miss_tokens`
|
|
22
|
-
* are surfaced in the `raw` field of `TokenUsage`; when present we prefer
|
|
23
|
-
* them over the OpenAI-style `cached_tokens` for cache-read attribution.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
type OpenAICompatPreset = "openai" | "openrouter" | "groq" | "ollama" | "deepseek" | "xai";
|
|
27
|
-
interface OpenAICompatAdapterOptions {
|
|
28
|
-
preset?: OpenAICompatPreset;
|
|
29
|
-
/** Explicit provider label (defaults to preset's provider). */
|
|
30
|
-
provider?: string;
|
|
31
|
-
/** API key. Falls back to the preset's default env var on Node. */
|
|
32
|
-
apiKey?: string;
|
|
33
|
-
model?: string;
|
|
34
|
-
/** Override base URL (wins over `preset`). */
|
|
35
|
-
baseURL?: string;
|
|
36
|
-
/** Extra request headers. */
|
|
37
|
-
headers?: Record<string, string>;
|
|
38
|
-
/** Extra request-body fields merged on every request (OpenRouter routing etc.). */
|
|
39
|
-
bodyExtras?: Record<string, unknown>;
|
|
40
|
-
/** User-provided SDK instance (OpenAI-family shape). */
|
|
41
|
-
sdk?: OpenAISdkLike;
|
|
42
|
-
/** Custom fetch (for tests). */
|
|
43
|
-
fetchImpl?: typeof fetch;
|
|
44
|
-
}
|
|
45
|
-
interface OpenAISdkLike {
|
|
46
|
-
chat: {
|
|
47
|
-
completions: {
|
|
48
|
-
create(params: Record<string, unknown>, opts?: {
|
|
49
|
-
signal?: AbortSignal;
|
|
50
|
-
}): Promise<OpenAIChatResponse>;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
interface OpenAIChatResponse {
|
|
55
|
-
id: string;
|
|
56
|
-
choices: ReadonlyArray<{
|
|
57
|
-
message: {
|
|
58
|
-
role: string;
|
|
59
|
-
content?: string | null;
|
|
60
|
-
tool_calls?: ReadonlyArray<{
|
|
61
|
-
id: string;
|
|
62
|
-
type: "function";
|
|
63
|
-
function: {
|
|
64
|
-
name: string;
|
|
65
|
-
arguments: string;
|
|
66
|
-
};
|
|
67
|
-
}>;
|
|
68
|
-
reasoning_content?: string;
|
|
69
|
-
};
|
|
70
|
-
finish_reason?: string;
|
|
71
|
-
}>;
|
|
72
|
-
usage?: OpenAIUsage;
|
|
73
|
-
model?: string;
|
|
74
|
-
}
|
|
75
|
-
interface OpenAIUsage {
|
|
76
|
-
prompt_tokens?: number;
|
|
77
|
-
completion_tokens?: number;
|
|
78
|
-
total_tokens?: number;
|
|
79
|
-
prompt_tokens_details?: {
|
|
80
|
-
cached_tokens?: number;
|
|
81
|
-
audio_tokens?: number;
|
|
82
|
-
};
|
|
83
|
-
completion_tokens_details?: {
|
|
84
|
-
reasoning_tokens?: number;
|
|
85
|
-
audio_tokens?: number;
|
|
86
|
-
accepted_prediction_tokens?: number;
|
|
87
|
-
rejected_prediction_tokens?: number;
|
|
88
|
-
};
|
|
89
|
-
prompt_cache_hit_tokens?: number;
|
|
90
|
-
prompt_cache_miss_tokens?: number;
|
|
91
|
-
}
|
|
92
|
-
declare function openAICompatAdapter(opts?: OpenAICompatAdapterOptions): LLMAdapter;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* `createAdapter` — provider-dispatching factory.
|
|
96
|
-
*
|
|
97
|
-
* One entry point, one config object. Picks the right concrete adapter by
|
|
98
|
-
* `provider`, forwards everything else. Users who want finer control import
|
|
99
|
-
* the concrete adapter directly (`anthropicAdapter`, `openAICompatAdapter`,
|
|
100
|
-
* `googleAdapter`, `dryRunAdapter`, `webllmAdapter`, `chromeNanoAdapter`).
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
type AdapterProvider = "anthropic" | OpenAICompatPreset | "google" | "dry-run" | "fallback";
|
|
104
|
-
interface CreateAdapterOptions {
|
|
105
|
-
provider: AdapterProvider;
|
|
106
|
-
apiKey?: string;
|
|
107
|
-
model?: string;
|
|
108
|
-
baseURL?: string;
|
|
109
|
-
headers?: Record<string, string>;
|
|
110
|
-
/** OpenAI-compat bodyExtras (OpenRouter routing, etc.). */
|
|
111
|
-
bodyExtras?: Record<string, unknown>;
|
|
112
|
-
/** Provider-specific SDK instance (any of AnthropicSdkLike / OpenAISdkLike / GoogleSdkLike). */
|
|
113
|
-
sdk?: unknown;
|
|
114
|
-
/** Custom fetch (for tests). */
|
|
115
|
-
fetchImpl?: typeof fetch;
|
|
116
|
-
/** Extra per-provider options forwarded verbatim. */
|
|
117
|
-
extras?: Record<string, unknown>;
|
|
118
|
-
}
|
|
119
|
-
declare function createAdapter(opts: CreateAdapterOptions): LLMAdapter;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* `cascadingLlmAdapter` — N-tier fallback over any mix of LLM adapters.
|
|
123
|
-
*
|
|
124
|
-
* Same structural pattern as `cascadingCache` and `Graph.attachSnapshotStorage`:
|
|
125
|
-
* ordered list, first-success wins, per-tier breaker optional, filter gates
|
|
126
|
-
* per request. Semantics:
|
|
127
|
-
*
|
|
128
|
-
* - `invoke()`: try tier 0 first. On error (or breaker-open), fall through
|
|
129
|
-
* to tier 1, 2, ... until one succeeds or all fail.
|
|
130
|
-
* - `stream()`: tries to start the stream on tier 0; once tokens begin, it
|
|
131
|
-
* commits — failures in mid-stream surface rather than re-starting on the
|
|
132
|
-
* next tier (would double-bill and confuse consumers). **State-machine
|
|
133
|
-
* consumers (usage accounting, UI accumulators) must handle errors in a
|
|
134
|
-
* catch block — no synthetic `{type: "finish"}` is emitted after a thrown
|
|
135
|
-
* stream error.**
|
|
136
|
-
* - `filter`: skips a tier for requests that use features it doesn't
|
|
137
|
-
* support (e.g., Chrome Nano can't do tool use).
|
|
138
|
-
* - `breaker`: per-tier circuit; when open, cascade treats the tier as
|
|
139
|
-
* unavailable and moves on immediately.
|
|
140
|
-
*
|
|
141
|
-
* On exhaustion, throws `AllTiersExhaustedError` with separate `skipped` and
|
|
142
|
-
* `failed` collections so consumers can distinguish "no tier applicable"
|
|
143
|
-
* from "all tiers failed".
|
|
144
|
-
*/
|
|
145
|
-
|
|
146
|
-
interface AdapterTier {
|
|
147
|
-
name: string;
|
|
148
|
-
adapter: LLMAdapter;
|
|
149
|
-
/** Per-tier circuit breaker. If omitted, no breaker on this tier. */
|
|
150
|
-
breaker?: CircuitBreakerOptions | CircuitBreaker;
|
|
151
|
-
/** Skip this tier when the request doesn't fit (e.g. Chrome Nano + tools). */
|
|
152
|
-
filter?: (messages: readonly ChatMessage[], opts?: LLMInvokeOptions) => boolean;
|
|
153
|
-
}
|
|
154
|
-
interface CascadeExhaustionReport {
|
|
155
|
-
/** Tiers that never ran (filter returned false, or breaker was open). */
|
|
156
|
-
readonly skipped: ReadonlyArray<{
|
|
157
|
-
name: string;
|
|
158
|
-
reason: "filter" | "breaker";
|
|
159
|
-
}>;
|
|
160
|
-
/** Tiers that ran and threw. */
|
|
161
|
-
readonly failed: ReadonlyMap<string, unknown>;
|
|
162
|
-
}
|
|
163
|
-
interface CascadingLlmAdapterOptions {
|
|
164
|
-
onFallback?: (from: string, to: string, error: unknown) => void;
|
|
165
|
-
onExhausted?: (report: CascadeExhaustionReport) => void;
|
|
166
|
-
/** Whether to attempt stream retry on subsequent tiers before first chunk. Default true. */
|
|
167
|
-
streamRetryBeforeFirstChunk?: boolean;
|
|
168
|
-
}
|
|
169
|
-
declare class AllTiersExhaustedError extends Error {
|
|
170
|
-
name: string;
|
|
171
|
-
readonly skipped: ReadonlyArray<{
|
|
172
|
-
name: string;
|
|
173
|
-
reason: "filter" | "breaker";
|
|
174
|
-
}>;
|
|
175
|
-
readonly failed: ReadonlyMap<string, unknown>;
|
|
176
|
-
constructor(report: CascadeExhaustionReport);
|
|
177
|
-
}
|
|
178
|
-
declare function cascadingLlmAdapter(tiers: readonly AdapterTier[], opts?: CascadingLlmAdapterOptions): LLMAdapter;
|
|
179
|
-
/**
|
|
180
|
-
* Tiny type-safe constructor for an {@link AdapterTier}. Cleans up the
|
|
181
|
-
* heterogeneous array-type cast users (and `browser-presets.ts`) had to write
|
|
182
|
-
* by hand. Per Wave A Unit 13 decision.
|
|
183
|
-
*
|
|
184
|
-
* @example
|
|
185
|
-
* ```ts
|
|
186
|
-
* cascadingLlmAdapter([
|
|
187
|
-
* tier("local", webllmAdapter(...)),
|
|
188
|
-
* tier("cloud", anthropicAdapter(...), { breaker: { failureThreshold: 5 } }),
|
|
189
|
-
* ]);
|
|
190
|
-
* ```
|
|
191
|
-
*
|
|
192
|
-
* @category ai
|
|
193
|
-
*/
|
|
194
|
-
declare function tier(name: string, adapter: LLMAdapter, opts?: {
|
|
195
|
-
breaker?: CircuitBreakerOptions | CircuitBreaker;
|
|
196
|
-
filter?: AdapterTier["filter"];
|
|
197
|
-
}): AdapterTier;
|
|
198
|
-
|
|
199
|
-
export { type AdapterProvider as A, type CascadingLlmAdapterOptions as C, type OpenAICompatAdapterOptions as O, type CascadeExhaustionReport as a, type AdapterTier as b, createAdapter as c, AllTiersExhaustedError as d, type CreateAdapterOptions as e, type OpenAICompatPreset as f, type OpenAISdkLike as g, cascadingLlmAdapter as h, openAICompatAdapter as o, tier as t };
|
package/dist/chunk-2T7U5EU6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as I,b as P,c as V,d as _,f as j,g as w}from"./chunk-3G5U5QNE.js";import{a as C,b as D,c as $,d as R,g as A,h as S,i as N,j as h,k as T,l as F}from"./chunk-HITNVN6B.js";import{a as m,b as g,c as k,d as v,e as O,f as E,g as G,h as x}from"./chunk-NTEURFZH.js";import{b as u}from"./chunk-CK2E7BTU.js";import{b as H}from"./chunk-QYADASLV.js";var q={};H(q,{ENVELOPE_VERSION:()=>v,GRAPH_META_SEGMENT:()=>S,Graph:()=>h,JsonCodec:()=>m,SIZEOF_OVERHEAD:()=>C,SIZEOF_SYMBOL:()=>D,SNAPSHOT_VERSION:()=>N,createDagCborCodec:()=>g,createDagCborZstdCodec:()=>k,decodeEnvelope:()=>E,diffForWAL:()=>T,encodeEnvelope:()=>O,explainPath:()=>R,graphProfile:()=>A,reachable:()=>F,registerBuiltinCodecs:()=>G,replayWAL:()=>x,sizeof:()=>$,validateGraphObservability:()=>W,validateNoIslands:()=>M,watchTopologyTree:()=>L});function L(n,p){let o=new Map,c=(s,a)=>{if(o.has(s))return;let i={off:()=>{},prefix:a};o.set(s,i);let f=s.topology.subscribe(l=>{for(let t of l){if(t[0]!==u)continue;let e=t[1];if(p(e,s,a),e.kind==="added"&&e.nodeKind==="mount"){let r=s._mounts.get(e.name);if(r instanceof h){let d=`${a}${e.name}::`;c(r,d)}}else if(e.kind==="removed"&&e.nodeKind==="mount"){let r=`${a}${e.name}::`;for(let[d,y]of Array.from(o.entries()))d!==n&&y.prefix.startsWith(r)&&(y.off(),o.delete(d))}}});i.off=f;for(let[l,t]of s._mounts)if(t instanceof h){let e=`${a}${l}::`;c(t,e)}};return c(n,""),()=>{for(let s of o.values())s.off();o.clear()}}function M(n){let p=n.describe({detail:"minimal"}),o=Object.keys(p.nodes),c=new Set;for(let a of o){let i=p.nodes[a];if(!i)continue;let f=i.deps??[];for(let l of f)c.add(l)}let s=[];for(let a of o){let i=p.nodes[a];if(!i||a.startsWith("__internal__/"))continue;let l=(i.deps??[]).length,t=c.has(a);if(l===0&&!t){let e=i.type??"unknown";s.push({path:a,kind:e})}}return s.sort((a,i)=>a.path<i.path?-1:a.path>i.path?1:0),{ok:s.length===0,orphans:s,summary(){if(s.length===0)return"validateNoIslands: ok (no islands)";let a=s.slice(0,3).map(i=>`${i.path} (${i.kind})`).join(", ");return`validateNoIslands: ${s.length} island node(s) \u2014 ${a}${s.length>3?", \u2026":""}`}}}var K={json:n=>V(n),pretty:n=>w(n),mermaid:n=>_(n),"mermaid-url":n=>j(n),d2:n=>P(n),ascii:n=>I(n)};function W(n,p={}){let o=[],c=p.requireFound??!0;if(p.skipDescribe!==!0)try{let t=n.describe(),e=new Set(Object.keys(t.nodes)),r=[];for(let[d,y]of Object.entries(t.nodes))for(let b of y.deps)b!==""&&!e.has(b)&&r.push(`${d} \u2192 ${b}`);for(let d of t.edges)e.has(d.from)||r.push(`edge.from: ${d.from}`),e.has(d.to)||r.push(`edge.to: ${d.to}`);r.length>0?o.push({kind:"describe",ok:!1,reason:`describe() has ${r.length} dangling pointer(s); nodes \u2289 deps`,danglingDeps:r}):o.push({kind:"describe",ok:!0,nodeCount:e.size,edgeCount:t.edges.length})}catch(t){o.push({kind:"describe",ok:!1,reason:`describe() threw: ${t instanceof Error?t.message:String(t)}`})}if((p.formats?.length??0)>0){let t=n.describe();for(let e of p.formats)try{let r=K[e](t);typeof r!="string"||r.length===0?o.push({kind:"describe-format",ok:!1,format:e,reason:`${e} renderer returned empty or non-string output`}):o.push({kind:"describe-format",ok:!0,format:e,length:r.length})}catch(r){o.push({kind:"describe-format",ok:!1,format:e,reason:r instanceof Error?r.message:String(r)})}}for(let t of p.paths??[])try{n.resolve(t),o.push({kind:"observe",ok:!0,path:t})}catch(e){o.push({kind:"observe",ok:!1,path:t,reason:e instanceof Error?e.message:String(e)})}for(let[t,e]of p.pairs??[])try{let r=n.explain(t,e);c&&r.found===!1?o.push({kind:"explain",ok:!1,from:t,to:e,reason:`explain(${t} \u2192 ${e}) found no path${r.reason?`: ${r.reason}`:""}`}):o.push({kind:"explain",ok:!0,from:t,to:e,found:r.found,steps:r.steps.length})}catch(r){o.push({kind:"explain",ok:!1,from:t,to:e,reason:r instanceof Error?r.message:String(r)})}let s=o.filter(t=>!t.ok),a=s.length===0,i=p.paths?.length??0,f=p.pairs?.length??0,l=p.formats?.length??0;return{ok:a,checks:o,failures:s,summary(){let t=[p.skipDescribe===!0?null:"describe",l>0?`${l} format${l===1?"":"s"}`:null,i>0?`${i} observe path${i===1?"":"s"}`:null,f>0?`${f} explain pair${f===1?"":"s"}`:null].filter(r=>r!=null),e=t.length>0?t.join(", "):"describe-only";return a?`validateGraphObservability: OK (${e})`:`validateGraphObservability: ${s.length} failure(s) across ${e}`}}}export{L as a,M as b,W as c,q as d};
|
package/dist/chunk-3G5U5QNE.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as S,b as _}from"./chunk-C72GO4IZ.js";var no={horizontal:"\u2500",vertical:"\u2502",cornerTL:"\u250C",cornerTR:"\u2510",cornerBL:"\u2514",cornerBR:"\u2518",tDown:"\u252C",tUp:"\u2534",tRight:"\u251C",tLeft:"\u2524",cross:"\u253C",arrowRight:"\u25B6",arrowDown:"\u25BC",arrowLeft:"\u25C0",arrowUp:"\u25B2",boxTL:"\u250C",boxTR:"\u2510",boxBL:"\u2514",boxBR:"\u2518",boxH:"\u2500",boxV:"\u2502"},to={horizontal:"-",vertical:"|",cornerTL:"+",cornerTR:"+",cornerBL:"+",cornerBR:"+",tDown:"+",tUp:"+",tRight:"+",tLeft:"+",cross:"+",arrowRight:">",arrowDown:"v",arrowLeft:"<",arrowUp:"^",boxTL:"+",boxTR:"+",boxBL:"+",boxBR:"+",boxH:"-",boxV:"|"};function F(o,t){let s=t.charset==="ascii"?to:no,i=o.width,r=o.height,e=Array.from({length:r},()=>Array.from({length:i},()=>" ")),n=Array.from({length:r},()=>Array.from({length:i},()=>"empty"));for(let a of o.edges)so(e,n,s,a);for(let a of o.boxes)io(e,n,s,a,t.labelOf(a.id));return e.map(a=>uo(a.join(""))).join(`
|
|
2
|
-
`)}function io(o,t,s,i,r){let{x:e,y:n,w:a,h:l}=i;if(a<2||l<2){l>0&&U(o,t,e,n,a,r);return}w(o,t,e,n,s.boxTL);for(let u=e+1;u<e+a-1;u+=1)w(o,t,u,n,s.boxH);w(o,t,e+a-1,n,s.boxTR);for(let u=n+1;u<n+l-1;u+=1){w(o,t,e,u,s.boxV);for(let f=e+1;f<e+a-1;f+=1)k(o,t,f,u," ","empty");w(o,t,e+a-1,u,s.boxV)}w(o,t,e,n+l-1,s.boxBL);for(let u=e+1;u<e+a-1;u+=1)w(o,t,u,n+l-1,s.boxH);w(o,t,e+a-1,n+l-1,s.boxBR);let c=n+Math.floor(l/2);U(o,t,e+1,c,a-2,r)}function w(o,t,s,i,r){k(o,t,s,i,r,r===" "?"empty":r==="\u2500"||r==="-"?"boxH":r==="\u2502"||r==="|"?"boxV":"boxCorner")}function k(o,t,s,i,r,e){if(i<0||i>=o.length)return;let n=o[i];s<0||s>=n.length||(n[s]=r,t[i][s]=e)}function U(o,t,s,i,r,e){if(i<0||i>=o.length)return;let n=s,a=r;for(let l of e){let c=S(l);if(c!==0){if(a<c)break;n>=0&&n<o[i].length&&(o[i][n]=l,t[i][n]="label",c===2&&n+1<o[i].length&&(o[i][n+1]="",t[i][n+1]="label")),n+=c,a-=c}}for(;a>0;)n>=0&&n<o[i].length&&(o[i][n]=" ",t[i][n]="empty"),n+=1,a-=1}function so(o,t,s,i){let r=i.points;if(r.length<2)return;for(let l=0;l+1<r.length;l+=1)ao(o,t,s,r[l],r[l+1]);for(let l=1;l+1<r.length;l+=1){let c=r[l-1],u=r[l],f=r[l+1],d=co(c,u,f,s);d&&K(o,t,u.x,u.y,d,"edgeCorner")}let e=r[r.length-1],n=r[r.length-2],a=lo(n,e,s);a&&K(o,t,e.x,e.y,a,"arrow")}function ao(o,t,s,i,r){if(!(i.x===r.x&&i.y===r.y)){if(i.y===r.y){let e=i.y,n=Math.min(i.x,r.x),a=Math.max(i.x,r.x);for(let l=n;l<=a;l+=1)z(o,t,l,e,s,"h")}else if(i.x===r.x){let e=i.x,n=Math.min(i.y,r.y),a=Math.max(i.y,r.y);for(let l=n;l<=a;l+=1)z(o,t,e,l,s,"v")}}}function z(o,t,s,i,r,e){if(i<0||i>=o.length)return;let n=o[i];if(s<0||s>=n.length)return;let a=t[i][s];if(!(a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label")){if(a==="empty"){n[s]=e==="h"?r.horizontal:r.vertical,t[i][s]=e==="h"?"edgeH":"edgeV";return}if(a==="edgeH"&&e==="v"){n[s]=r.cross,t[i][s]="edgeCorner";return}if(a==="edgeV"&&e==="h"){n[s]=r.cross,t[i][s]="edgeCorner";return}}}function K(o,t,s,i,r,e){if(i<0||i>=o.length)return;let n=o[i];if(s<0||s>=n.length)return;let a=t[i][s];a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label"||(n[s]=r,t[i][s]=e)}function co(o,t,s,i){let r=o.y===t.y,e=t.y===s.y;if(r===e)return;if(r){let l=o.x<t.x,c=s.y>t.y;return l&&c?i.cornerTR:l&&!c?i.cornerBR:!l&&c?i.cornerTL:i.cornerBL}let n=o.y<t.y,a=s.x>t.x;return n&&a?i.cornerBL:n&&!a?i.cornerBR:!n&&a?i.cornerTL:i.cornerTR}function lo(o,t,s){if(t.x>o.x)return s.arrowRight;if(t.x<o.x)return s.arrowLeft;if(t.y>o.y)return s.arrowDown;if(t.y<o.y)return s.arrowUp}function uo(o){let t=o.length;for(;t>0&&o.charCodeAt(t-1)===32;)t-=1;return o.slice(0,t)}function Y(o){let t=fo(o);po(t),ho(t),go(t),yo(t,o);let s=xo(t,o),{width:i,height:r}=wo(t),e=[];for(let n of t.layers)for(let a of n)a.isVirtual||e.push({id:a.id,layer:a.layer,order:a.order,x:a.x,y:a.y,w:a.w,h:a.h});return{boxes:e,edges:s,width:i,height:r}}function fo(o){let t=new Map;for(let r of o.nodes)t.set(r,{id:r,isVirtual:!1,layer:-1,order:0,x:0,y:0,w:o.widthCells(r),h:o.heightCells(r),in:[],out:[]});let s=[],i=0;for(let r of o.edges){if(r.from===r.to)continue;let e=t.get(r.from),n=t.get(r.to);if(!e||!n)continue;let a={chainId:i++,chainFrom:r.from,chainTo:r.to,fromId:r.from,toId:r.to,hopIndex:0,chainLen:1};e.out.push(a),n.in.push(a),s.push(a)}return{nodes:t,layers:[],hops:s}}function po(o){let t=new Map;for(let e of o.nodes.values())t.set(e.id,e.in.length);let s=[];for(let e of o.nodes.values())(t.get(e.id)??0)===0&&(e.layer=0,s.push(e));let i=new Set,r=0;for(;r<s.length;){let e=s[r++];if(!i.has(e.id)){i.add(e.id);for(let n of e.out){let a=o.nodes.get(n.toId);a.layer=Math.max(a.layer,e.layer+1);let l=(t.get(a.id)??0)-1;t.set(a.id,l),l<=0&&s.push(a)}}}for(let e of o.nodes.values())e.layer<0&&(e.layer=0)}function ho(o){let t=Math.max(0,...Array.from(o.nodes.values(),e=>e.layer)),s=Array.from({length:t+1},()=>[]);for(let e of o.nodes.values())s[e.layer].push(e);let i=[],r=0;for(let e of o.hops){let n=o.nodes.get(e.fromId),a=o.nodes.get(e.toId),l=a.layer-n.layer;if(l<=0){n.out=n.out.filter(f=>f!==e),a.in=a.in.filter(f=>f!==e);continue}if(l===1){e.hopIndex=0,e.chainLen=1,i.push(e);continue}n.out=n.out.filter(f=>f!==e),a.in=a.in.filter(f=>f!==e);let c=n;for(let f=1;f<l;f+=1){let d=`__virt_${r++}__`,h={id:d,isVirtual:!0,layer:n.layer+f,order:0,x:0,y:0,w:0,h:1,in:[],out:[]};o.nodes.set(d,h),s[h.layer].push(h);let p={chainId:e.chainId,chainFrom:e.chainFrom,chainTo:e.chainTo,fromId:c.id,toId:d,hopIndex:f-1,chainLen:l};c.out.push(p),h.in.push(p),i.push(p),c=h}let u={chainId:e.chainId,chainFrom:e.chainFrom,chainTo:e.chainTo,fromId:c.id,toId:a.id,hopIndex:l-1,chainLen:l};c.out.push(u),a.in.push(u),i.push(u)}for(let e of s)for(let n=0;n<e.length;n+=1)e[n].order=n;o.layers=s,o.hops=i}function go(o){for(let s=0;s<4;s+=1){for(let i=1;i<o.layers.length;i+=1)J(o,o.layers[i],"in"),G(o.layers[i]);for(let i=o.layers.length-2;i>=0;i-=1)J(o,o.layers[i],"out"),G(o.layers[i])}for(let s=0;s<2;s+=1){let i=!1;for(let r=1;r<o.layers.length;r+=1){let e=o.layers[r];for(let n=0;n+1<e.length;n+=1){let a=W(o,e[n],e[n+1],"in");[e[n],e[n+1]]=[e[n+1],e[n]],G(e),W(o,e[n],e[n+1],"in")<a?i=!0:([e[n],e[n+1]]=[e[n+1],e[n]],G(e))}}if(!i)break}}function J(o,t,s){let i=new Map;for(let r of t){let e=s==="in"?r.in:r.out;if(e.length===0){i.set(r.id,r.order);continue}let n=0,a=0;for(let l of e){let c=o.nodes.get(s==="in"?l.fromId:l.toId);c&&(n+=c.order,a+=1)}i.set(r.id,a===0?r.order:n/a)}t.sort((r,e)=>{let n=i.get(r.id),a=i.get(e.id);return n!==a?n-a:r.order-e.order})}function G(o){for(let t=0;t<o.length;t+=1)o[t].order=t}function W(o,t,s,i){let r=i==="in"?t.in:t.out,e=i==="in"?s.in:s.out,n=0;for(let a of r)for(let l of e){let c=o.nodes.get(i==="in"?a.fromId:a.toId)?.order??0,u=o.nodes.get(i==="in"?l.fromId:l.toId)?.order??0;(t.order<s.order&&c>u||t.order>s.order&&c<u)&&(n+=1)}return n}function yo(o,t){t.direction==="LR"?mo(o,t):bo(o,t)}function mo(o,t){let s=[],i=0;for(let r=0;r<o.layers.length;r+=1){s.push(i);let e=0;for(let n of o.layers[r])e=Math.max(e,n.w);i+=e+t.layerGap}for(let r=0;r<o.layers.length;r+=1)for(let e of o.layers[r])e.x=s[r];for(let r of o.layers){let e=0;for(let n of r)n.y=e,e+=n.h+t.nodeGap}X(o,t,"y")}function bo(o,t){let s=[],i=0;for(let r=0;r<o.layers.length;r+=1){s.push(i);let e=0;for(let n of o.layers[r])e=Math.max(e,n.h);i+=e+t.layerGap}for(let r=0;r<o.layers.length;r+=1)for(let e of o.layers[r])e.y=s[r];for(let r of o.layers){let e=0;for(let n of r)n.x=e,e+=n.w+t.nodeGap}X(o,t,"x")}function X(o,t,s){let i=e=>s==="y"?e.h:e.w,r=t.nodeGap;for(let e=0;e<2;e+=1){let n=e===0?o.layers.slice(1):o.layers.slice(0,-1).reverse();for(let a of n){let l=new Map;for(let u of a){let f=e===0?u.in:u.out;if(f.length===0)continue;let d=[];for(let p of f){let y=o.nodes.get(e===0?p.fromId:p.toId);if(!y)continue;let m=s==="y"?y.y:y.x;d.push(m+Math.floor(i(y)/2))}if(d.length===0)continue;d.sort((p,y)=>p-y);let h=d[Math.floor(d.length/2)];l.set(u.id,h-Math.floor(i(u)/2))}let c=0;for(let u of a){let f=l.get(u.id),d=s==="y"?u.y:u.x,p=Math.max(f??d,c);s==="y"?u.y=p:u.x=p,c=p+i(u)+r}}}}function xo(o,t){let s=new Map;for(let c of o.hops){let u=s.get(c.chainId);u?u.push(c):s.set(c.chainId,[c])}for(let c of s.values())c.sort((u,f)=>u.hopIndex-f.hopIndex);let i=t.direction==="LR",r=c=>i?c.x:c.y,e=c=>i?c.w:c.h,n=c=>i?c.y+Math.floor(c.h/2):c.x+Math.floor(c.w/2),a=new Map;for(let c=0;c+1<o.layers.length;c+=1){let u=o.layers[c],f=o.layers[c+1],d=0;for(let g of u)d=Math.max(d,r(g)+e(g));let h=Number.POSITIVE_INFINITY;for(let g of f)h=Math.min(h,r(g));let p=Number.isFinite(h)?h-1:d,y=Math.max(1,p-d+1),m=[];for(let g of u)for(let b of g.out)m.push(b);m.sort((g,b)=>{let x=n(o.nodes.get(g.fromId)),L=n(o.nodes.get(b.fromId));if(x!==L)return x-L;let O=n(o.nodes.get(g.toId)),M=n(o.nodes.get(b.toId));return O-M});let D=[],C=new Map;for(let g of m){let b=n(o.nodes.get(g.fromId)),x=n(o.nodes.get(g.toId)),L=Math.min(b,x),O=Math.max(b,x),M=-1;for(let R=0;R<D.length;R+=1){let j=D[R],N=!0;for(let V of j)if(V.lo<=O&&L<=V.hi){N=!1;break}if(N){j.push({lo:L,hi:O}),M=R;break}}M<0&&(D.push([{lo:L,hi:O}]),M=D.length-1),C.set(g,M)}let I=D.length,T=y>=Math.max(3,I+2),P=T?d+1:d,ro=T?p-1:p,$=Math.max(1,ro-P+1);for(let g of m){let b=C.get(g),x;if(I<=1)x=P+Math.floor($/2);else{let L=($-1)/(I-1);x=P+Math.floor(b*L)}a.set(g,Math.max(d,Math.min(p,x)))}}let l=[];for(let[,c]of s){let u=[];for(let d=0;d<c.length;d+=1){let h=c[d],p=o.nodes.get(h.fromId),y=o.nodes.get(h.toId),m=a.get(h),D=p.isVirtual?r(p):r(p)+e(p),C=y.isVirtual?r(y):r(y)-1,I=n(p),T=n(y);d===0&&v(u,i,D,I),I!==T&&(v(u,i,m,I),v(u,i,m,T)),v(u,i,C,T)}let f=c[0];l.push({from:f.chainFrom,to:f.chainTo,points:Lo(u)})}return l}function v(o,t,s,i){o.push(t?{x:s,y:i}:{x:i,y:s})}function Lo(o){let t=[];for(let s of o){let i=t[t.length-1];(!i||i.x!==s.x||i.y!==s.y)&&t.push(s)}return t}function wo(o){let t=0,s=0;for(let i of o.layers)for(let r of i)t=Math.max(t,r.x+r.w),s=Math.max(s,r.y+r.h);return{width:t,height:s}}var Do=24,Io=4,To=1,Mo=3;function Oo(o,t){let s=Co(t?.direction),i=Math.max(3,t?.maxLabelWidth??Do),r=t?.asciiCharset??"unicode",e=Object.keys(o.nodes).sort(),n=new Set(e),a=o.edges.filter(d=>n.has(d.from)&&n.has(d.to)),l=new Map,c=new Map;for(let d of e){let h=_(d,i);l.set(d,h),c.set(d,S(h)+4)}let u=Y({nodes:e,edges:a,widthCells:d=>c.get(d)??3,heightCells:()=>Mo,layerGap:Io,nodeGap:To,direction:s}),f=F(u,{charset:r,labelOf:d=>l.get(d)??d});return t?.logger?.(f),f}function Co(o){if(o===void 0||o==="LR")return"LR";if(o==="TD")return"TD";throw new Error(`ascii describe supports direction "LR" or "TD" only; got ${String(o)}`)}function E(o){if(o===null||typeof o!="object")return o;if(Array.isArray(o))return o.map(E);let t=o,s=Object.keys(t).sort(),i={};for(let r of s)i[r]=E(t[r]);return i}function q(o){return o.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Q(o){return o.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Z(o){return o==="TD"?"down":o==="BT"?"up":o==="RL"?"left":"right"}function A(o){let t=new Set,s=[];function i(r,e){let n=`${r}\0${e}`;t.has(n)||(t.add(n),s.push([r,e]))}for(let[r,e]of Object.entries(o.nodes)){let n=e.deps;if(n)for(let a of n)i(a,r)}for(let r of o.edges)i(r.from,r.to);return s}function B(o){if(o===void 0)return"LR";if(o==="TD"||o==="LR"||o==="BT"||o==="RL")return o;throw new Error(`invalid diagram direction ${String(o)}; expected one of: TD, LR, BT, RL`)}function oo(o){if(typeof o=="string")return JSON.stringify(o);if(typeof o=="number"||typeof o=="boolean"||o==null)return String(o);try{return JSON.stringify(o)}catch{return"[unserializable]"}}function Ro(o,t){let s=B(t?.direction),i=Object.keys(o.nodes).sort(),r=new Map;for(let n=0;n<i.length;n+=1)r.set(i[n],`n${n}`);let e=[`direction: ${Z(s)}`];for(let n of i){let a=r.get(n);e.push(`${a}: "${Q(n)}"`)}for(let[n,a]of A(o)){let l=r.get(n),c=r.get(a);!l||!c||e.push(`${l} -> ${c}`)}return e.join(`
|
|
3
|
-
`)}function So(o,t){let s=t?.includeEdges??!0,i=t?.includeSubgraphs??!0,{expand:r,...e}=o,n={...e,edges:s?o.edges:[],subgraphs:i?o.subgraphs:[]},a=JSON.stringify(E(n),null,t?.indent??2);return t?.logger?.(a),a}function H(o,t){let s=B(t?.direction),i=Object.keys(o.nodes).sort(),r=new Map;for(let n=0;n<i.length;n+=1)r.set(i[n],`n${n}`);let e=[`flowchart ${s}`];for(let n of i){let a=r.get(n);e.push(` ${a}["${q(n)}"]`)}for(let[n,a]of A(o)){let l=r.get(n),c=r.get(a);!l||!c||e.push(` ${l} --> ${c}`)}return e.join(`
|
|
4
|
-
`)}function eo(o,t){let s=t?.theme??"default",i=t?.autoSync??!0,e=JSON.stringify({code:o,mermaid:{theme:s},autoSync:i}),n=new TextEncoder().encode(e),a="";for(let c=0;c<n.length;c++)a+=String.fromCharCode(n[c]);return`https://mermaid.live/edit#base64:${globalThis.btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`}function Go(o,t){let s=H(o,t);return eo(s,t)}function vo(o,t){let s=t?.includeEdges??!0,i=t?.includeSubgraphs??!0,r=[];r.push(`Graph ${o.name}`),r.push("Nodes:");for(let n of Object.keys(o.nodes).sort()){let a=o.nodes[n];r.push(`- ${n} (${a.type}/${a.status}): ${oo(a.value)}`)}if(s){r.push("Edges:");for(let n of o.edges)r.push(`- ${n.from} -> ${n.to}`)}if(i){r.push("Subgraphs:");for(let n of o.subgraphs)r.push(`- ${n}`)}let e=r.join(`
|
|
5
|
-
`);return t?.logger?.(e),e}export{Oo as a,Ro as b,So as c,H as d,eo as e,Go as f,vo as g};
|
package/dist/chunk-4VVTGLXJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var E=1e6,k=1e9;function i(e){return e<0?0:e}function l(e,t){return t==="none"?e:t==="full"?Math.random()*e:e/2+Math.random()*(e/2)}function b(e,t){return e+Math.random()*(t-e)}function S(e){let t=i(e);return()=>t}function m(e,t){let n=i(e),o=t===void 0?n:i(t);return a=>n+o*Math.max(0,a)}function p(e){let t=i(e?.baseNs??1e8),n=e?.factor!==void 0&&e.factor<1?1:e?.factor??2,o=i(e?.maxDelayNs??30*1e9),a=e?.jitter??"none";return f=>{let r;if(t===0)r=0;else if(n===1)r=t;else{let c=o/t,u=1;for(let s=0;s<Math.max(0,f);s++){if(u>=c){u=c;break}u*=n}r=t*u,r>o&&(r=o)}return l(r,a)}}function x(e=100*1e6,t=30*1e9){let n=i(e),o=i(t);function a(f){if(f<=0)return 1;let r=1,c=2;for(let u=1;u<f;u++){let s=r+c;r=c,c=s}return c}return f=>{let r=a(f)*n;return r<=o?r:o}}function _(e=100*1e6,t=30*1e9){return(n,o,a)=>{let r=Math.min(t,(a??e)*3);return b(e,r)}}function d(e,t){return(n,o,a)=>n>=t?null:e(n,o,a)}function B(e){if(e==="constant")return S(1*1e9);if(e==="linear")return m(1*1e9);if(e==="exponential")return p();if(e==="fibonacci")return x();if(e==="decorrelatedJitter")return _();throw new Error(`Unknown backoff preset: "${String(e)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}export{E as a,k as b,S as c,m as d,p as e,x as f,_ as g,d as h,B as i};
|
package/dist/chunk-5M4CCMMD.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import{d as tt,e as rt}from"./chunk-FZMYDOWV.js";import{s as $e,t as Me,v as Ze}from"./chunk-UNGSTR4X.js";import{g as Ne,i as Ge}from"./chunk-OIVP6KFV.js";import{c as et}from"./chunk-ZKPSFFKU.js";import{b as me}from"./chunk-7LIAPXJB.js";import{b as Xe}from"./chunk-TSOYJ743.js";import{a as _e}from"./chunk-W3I423PS.js";import{g as ze,j as xe}from"./chunk-HITNVN6B.js";import{b as Re,s as De,t as Ke,x as Ie}from"./chunk-CLVB32RD.js";import{b as Ye}from"./chunk-GHBWHMRZ.js";import{b as Se}from"./chunk-BEZWM2SY.js";import{C as We,m as ke}from"./chunk-CRVT7D2P.js";import{D as Be,E as A,F as Ee,G as x,J as O,m as fe,o as H}from"./chunk-NTEURFZH.js";import{b as L,i as X,j as Y}from"./chunk-CK2E7BTU.js";import{b as pt}from"./chunk-QYADASLV.js";var Yt={};pt(Yt,{DEFAULT_DECAY_RATE:()=>ee,DEFAULT_EXECUTE_PROMPT:()=>Le,DEFAULT_QUEUE_CONFIGS:()=>Ae,DEFAULT_SEVERITY_WEIGHTS:()=>Z,DEFAULT_TRIAGE_PROMPT:()=>He,DEFAULT_VERIFY_PROMPT:()=>Ve,HarnessGraph:()=>Ce,QUEUE_NAMES:()=>M,actuatorExecutor:()=>nt,affectedTaskFilter:()=>kt,autoSolidify:()=>ht,beforeAfterCompare:()=>It,blindVariation:()=>Pt,codeChangeBridge:()=>St,createIntakeBridge:()=>Et,defaultErrorClassifier:()=>we,defaultLlmExecutor:()=>ct,defaultLlmVerifier:()=>dt,dispatchActuator:()=>vt,effectivenessTracker:()=>wt,errorCritique:()=>Dt,evalIntakeBridge:()=>xt,evalSource:()=>Rt,evalVerifier:()=>at,harnessEvalPair:()=>Ht,harnessLoop:()=>qt,harnessProfile:()=>Jt,harnessTrace:()=>Ut,notifyEffect:()=>Nt,priorityScore:()=>Lt,refineExecutor:()=>Je,refineLoop:()=>je,resolvePromptFn:()=>pe,strategyKey:()=>te,strategyModel:()=>Qe});function yt(e,r){return{outcome:"success",detail:`actuator applied ${r.intervention} for ${Tt(r.summary)}`,artifact:e}}function gt(e,r){let u=e instanceof Error?e.message:String(e);return{outcome:"failure",detail:`actuator threw on ${r.intervention}: ${u}`}}function bt(e){return`actuator skipped ${e.intervention} (shouldApply returned false)`}function Tt(e,r=80){return e.length<=r?e:`${e.slice(0,r-1)}\u2026`}function nt(e){let r=e.name??"actuator-executor",u=e.toOutput??yt,n=e.onError??gt,s=e.skipDetail??bt;return(t,a)=>{let o=t.payload.item;return e.shouldApply&&!e.shouldApply(o)?{...t.payload,execution:{item:o,outcome:"failure",detail:s(o)}}:Ee(l=>{let i=new AbortController,c=a?.signal,m=()=>{};if(c)if(c.aborted)i.abort();else{let h=()=>i.abort();c.addEventListener("abort",h,{once:!0}),m=()=>c.removeEventListener("abort",h)}let d=!1,y=null,g=h=>{d||(d=!0,l.down([[L,{...t.payload,execution:{item:o,...h}}],[X]]),y?.(),y=null)},R;try{let h=e.apply(o,{signal:i.signal});R=ke(h,{signal:i.signal})}catch(h){return g(n(h,o)),()=>{m(),i.abort()}}return y=R.subscribe(h=>{for(let E of h){if(d)return;if(E[0]===L){g(u(E[1],o));return}if(E[0]===Y){g(n(E[1],o));return}if(E[0]===X){g(n(new Error("actuator inner completed without emitting DATA"),o));return}}}),d&&y&&(y(),y=null),()=>{m(),i.abort(),y?.(),y=null}},{name:`${r}/inner`})}}function vt(e){let r=e.name??"dispatch-actuator",u=e.default??null,n=u!=null;return nt({apply:(s,t)=>{let a=Object.hasOwn(e.routes,s.intervention)?e.routes[s.intervention]:u;if(!a)throw new Error(`dispatchActuator: no route for intervention '${s.intervention}'`);return a(s,t)},shouldApply:s=>Object.hasOwn(e.routes,s.intervention)||n,skipDetail:s=>`no route for intervention '${s.intervention}'`,name:r})}function ht(e){let r=e.name??"auto-solidify",u=e.extract??(s=>s.execution.artifact??null),n=e.predicate??(()=>!0);return Ee(s=>{let t=null,a=!1,o=()=>{a||(a=!0,t?.(),t=null)},l=i=>{a||(s.down([[Y,i]]),o())};return t=e.verifyResults.subscribe(i=>{if(!a)for(let c of i){if(a)return;if(c[0]!==L){if(c[0]===X){s.down([[X]]),o();return}continue}let m=c[1];if(m==null||!m.verified)continue;let d;try{d=n(m)}catch(g){l(g);return}if(!d)continue;let y;try{y=u(m)}catch(g){l(g);return}if(y!=null){try{e.write(y,m)}catch(g){l(g);return}s.down([[L,y]])}}}),a&&t&&(t(),t=null),()=>{o()}},{name:r})}function Et(e,r,u,n){return O([e],([s])=>{if(s==null)return;let t=u(s);for(let a of t)r.publish(a)},{name:n?.name??"intake-bridge"})}function xt(e,r,u){let n=u?.defaultSeverity??"medium";return O([e],([s])=>{if(s==null)return;let t=Array.isArray(s)?s:[s];for(let a of t)for(let o of a.tasks)if(!(o.valid&&o.judge_scores?.every(l=>l.pass))){if(!o.valid&&(!o.judge_scores||o.judge_scores.length===0)){r.publish({source:"eval",summary:`Task ${o.task_id} invalid (model: ${a.model})`,evidence:`Run ${a.run_id}: task produced invalid output`,affectsAreas:["graphspec"],affectsEvalTasks:[o.task_id],severity:n});continue}if(o.judge_scores)for(let l of o.judge_scores)l.pass||r.publish({source:"eval",summary:`${o.task_id}: ${l.claim} (model: ${a.model})`,evidence:l.reasoning,affectsAreas:["graphspec"],affectsEvalTasks:[o.task_id],severity:n})}},{name:u?.name??"eval-intake-bridge"})}function Rt(e,r){return Ie(e,()=>ke(r()))}function It(e,r){return x([e,r],([u,n])=>{let s=u,t=n,a=new Map(s.tasks.map(d=>[d.task_id,d])),o=new Map(t.tasks.map(d=>[d.task_id,d])),l=new Set([...a.keys(),...o.keys()]),i=[],c=[],m=[];for(let d of l){let y=a.get(d),g=o.get(d),R=y?.valid??!1,h=g?.valid??!1,E=y?.judge_scores?y.judge_scores.filter(_=>_.pass).length:void 0,$=g?.judge_scores?g.judge_scores.filter(_=>_.pass).length:void 0,w=E!==void 0&&$!==void 0?$-E:void 0;i.push({taskId:d,before:R,after:h,scoreDiff:w}),R&&!h&&c.push(d),!R&&h&&m.push(d)}return{newFailures:c,resolved:m,taskDeltas:i,overallImproved:m.length>c.length}},{name:"eval-delta"})}function kt(e,r){let u=r==null?null:Array.isArray(r)?A(r):r,n=[e];return u&&n.push(u),x(n,s=>{let t=s[0],a=u?new Set(s[1]):null,o=new Set;for(let l of t)for(let i of l.affectsEvalTasks??[])(a==null||a.has(i))&&o.add(i);return[...o].sort()},{name:"affected-task-filter"})}function St(e,r,u,n){let s=n?.defaultSeverity??"high";function t(o){let l=[];for(let i of o.lintErrors??[])l.push({source:"code-change",summary:`Lint: ${i.rule} in ${i.file}:${i.line}`,evidence:i.message,affectsAreas:[i.file],severity:s});for(let i of o.testFailures??[])l.push({source:"test",summary:`Test failure: ${i.testId}`,evidence:i.message,affectsAreas:[i.file],affectsEvalTasks:[i.testId],severity:s});return l}let a=u??t;return O([e],([o])=>{if(o!=null)for(let l of a(o))r.publish(l)},{name:n?.name??"code-change-bridge"})}function Nt(e,r,u){return O([e.latest],([n])=>{n!=null&&r(n)},{name:u?.name??"notify-effect"})}var M=["auto-fix","needs-decision","investigation","backlog"],Ae={"auto-fix":{gated:!1},"needs-decision":{gated:!0},investigation:{gated:!0},backlog:{gated:!1}},Z={critical:100,high:70,medium:40,low:10},ee=Math.LN2/(168*3600);function te(e,r){return`${e}\u2192${r}`}var At=/\b(parse|json|config|validation|syntax)\b/i,we=e=>At.test(e.detail)?"self-correctable":"structural",He=`You are a triage classifier for a reactive collaboration harness.
|
|
2
|
-
|
|
3
|
-
Given an intake item, classify it and output JSON:
|
|
4
|
-
{
|
|
5
|
-
"rootCause": "composition" | "missing-fn" | "bad-docs" | "schema-gap" | "regression" | "unknown",
|
|
6
|
-
"intervention": "template" | "catalog-fn" | "docs" | "wrapper" | "schema-change" | "investigate",
|
|
7
|
-
"route": "auto-fix" | "needs-decision" | "investigation" | "backlog",
|
|
8
|
-
"priority": <number 0-100>,
|
|
9
|
-
"triageReasoning": "<one sentence>"
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
Strategy model (past effectiveness):
|
|
13
|
-
{{strategy}}
|
|
14
|
-
|
|
15
|
-
Intake item:
|
|
16
|
-
{{item}}`,Le=`You are an implementation agent.
|
|
17
|
-
|
|
18
|
-
Given a triaged issue with root cause and intervention type, produce a fix.
|
|
19
|
-
|
|
20
|
-
Issue:
|
|
21
|
-
{{item}}
|
|
22
|
-
|
|
23
|
-
Output JSON:
|
|
24
|
-
{
|
|
25
|
-
"outcome": "success" | "failure" | "partial",
|
|
26
|
-
"detail": "<description of what was done or what failed>"
|
|
27
|
-
}`,Ve=`You are a QA reviewer.
|
|
28
|
-
|
|
29
|
-
Given an execution result, verify whether the fix is correct.
|
|
30
|
-
|
|
31
|
-
Execution:
|
|
32
|
-
{{execution}}
|
|
33
|
-
|
|
34
|
-
Original issue:
|
|
35
|
-
{{item}}
|
|
36
|
-
|
|
37
|
-
Output JSON:
|
|
38
|
-
{
|
|
39
|
-
"verified": true/false,
|
|
40
|
-
"findings": ["<finding1>", ...],
|
|
41
|
-
"errorClass": "self-correctable" | "structural" // only if verified=false
|
|
42
|
-
}`;function pe(e,r,u){if(typeof e=="function")return e;let n=e??r;return s=>u(n,s)}function wt(e){let r=Se({name:e?.name??"effectiveness-entries"}),u=x([r.entries],([a])=>new Map(a),{name:`${e?.name??"effectiveness"}-snapshot`,equals:(a,o)=>{let l=a,i=o;if(l.size!==i.size)return!1;for(let[c,m]of l){let d=i.get(c);if(!d||m.attempts!==d.attempts||m.successes!==d.successes)return!1}return!0}});function n(a,o){let l=r.get(a),i=(l?.attempts??0)+1,c=(l?.successes??0)+(o?1:0);r.set(a,{key:a,attempts:i,successes:c,successRate:c/i})}function s(a){return r.get(a)}let t=We(u);return{node:u,record:n,lookup:s,dispose:()=>{t(),r.dispose()}}}function Ct(e){if(typeof e!="object"||e===null)return!1;let r=e;return typeof r.subscribe=="function"&&typeof r.down=="function"&&typeof r.emit=="function"}function ot(e,r){if(e.length===0)return{best:null,bestScore:Number.NEGATIVE_INFINITY};if(e.length===1){let t=qe(r);return{best:e[0],bestScore:t}}if(r.some(t=>typeof t.candidateIndex=="number")){let t=new Array(e.length);for(let l=0;l<e.length;l++)t[l]={sum:0,count:0};for(let l of r){let i=l.candidateIndex;typeof i=="number"&&i>=0&&i<e.length&&(t[i].sum+=l.score,t[i].count+=1)}let a=e[0],o=t[0].count>0?t[0].sum/t[0].count:Number.NEGATIVE_INFINITY;for(let l=1;l<e.length;l++){let i=t[l].count>0?t[l].sum/t[l].count:Number.NEGATIVE_INFINITY;i>o&&(o=i,a=e[l])}return{best:a,bestScore:o}}let n=e[0],s=r[0]?.score??Number.NEGATIVE_INFINITY;for(let t=1;t<e.length;t++){let a=r[t]?.score??Number.NEGATIVE_INFINITY;a>s&&(s=a,n=e[t])}return{best:n,bestScore:s}}function qe(e){if(e.length===0)return Number.NEGATIVE_INFINITY;let r=0;for(let u of e)r+=u.score;return r/e.length}function je(e,r,u,n){let s=n.name??"refine-loop",t=new xe(s,n.graph),a=Ct(n.dataset)?n.dataset:A(n.dataset,{name:"dataset"});t.add(a,{name:"dataset"});let o=A(0,{name:"iteration"});t.add(o,{name:"iteration"});let l=A(u,{name:"strategy",equals:()=>!1});t.add(l,{name:"strategy"});let i=A(null,{name:"lastFeedback"});t.add(i,{name:"lastFeedback"});let c=A([],{name:"prevCandidates"});t.add(c,{name:"prevCandidates"});let m=A(!1,{name:"paused"});t.add(m,{name:"paused"});let d=A("running",{name:"status"});t.add(d,{name:"status"});let y=A([],{name:"history",equals:()=>!1});t.add(y,{name:"history"});let g=A(null,{name:"best"});t.add(g,{name:"best"});let R=A(Number.NEGATIVE_INFINITY,{name:"score"});t.add(R,{name:"score"});let h=A(0,{name:"budget-used"});t.add(h,{name:"budget-used"});let E=Ne("stages");t.mount("stages",E);let $=E.topic("generate"),w=E.topic("evaluate"),_=E.topic("analyze"),ye=E.topic("decide"),V=u,U=null,re=[];t.addDisposer(l.subscribe(b=>{for(let T of b)T[0]===L&&(V=T[1])})),t.addDisposer(i.subscribe(b=>{for(let T of b)T[0]===L&&(U=T[1])})),t.addDisposer(c.subscribe(b=>{for(let T of b)T[0]===L&&(re=T[1])}));let G=Ie(o,b=>{let T=V,C=b===0||U==null;return Be([],(k,P)=>{let v=!1;try{let f=C?T.seed(e):T.generate(U,re);if(f instanceof Promise)return f.then(p=>{v||P.emit(p)},p=>{v||P.down([[Y,p]])}),()=>{v=!0};P.emit(f)}catch(f){v=!0,P.down([[Y,f]])}},{describeKind:"producer"})},{name:"candidates"});t.add(G,{name:"candidates"});let ne=O([G],(b,T,C)=>{let k=C.terminalDeps[0];k!==void 0&&k!==!0&&d.emit("errored")},{name:"error-watcher",errorWhenDepsError:!1});t.add(ne,{name:"error-watcher"}),t.addDisposer(ne.subscribe(()=>{}));let Q=x([G,o],([b,T])=>({iteration:T,candidates:b,timestamp_ns:H()}),{name:"generate-event"});t.add(Q,{name:"generate-event"}),t.addDisposer(Q.subscribe(()=>{}));let B=O([Q],([b])=>{$.publish(b)},{name:"generate-publish"});t.add(B,{name:"generate-publish"}),t.addDisposer(B.subscribe(()=>{}));let oe=O([G],([b])=>{c.emit(b)},{name:"generate-mirror"});t.add(oe,{name:"generate-mirror"}),t.addDisposer(oe.subscribe(()=>{}));let z=r(G,a);t.add(z,{name:"scores"});let ae=x([z,G,o],([b,T,C])=>({iteration:C,candidates:T,scores:b,timestamp_ns:H()}),{name:"evaluate-event"});t.add(ae,{name:"evaluate-event"}),t.addDisposer(ae.subscribe(()=>{}));let ge=O([ae],([b])=>{w.publish(b)},{name:"evaluate-publish"});t.add(ge,{name:"evaluate-publish"}),t.addDisposer(ge.subscribe(()=>{}));let se=x([z,G],([b,T])=>V.analyze(b,T),{name:"feedback"});t.add(se,{name:"feedback"});let q=x([se,G,o],([b,T,C])=>({iteration:C,candidates:T,feedback:b,timestamp_ns:H()}),{name:"analyze-event"});t.add(q,{name:"analyze-event"}),t.addDisposer(q.subscribe(()=>{}));let ie=O([q],([b])=>{_.publish(b)},{name:"analyze-publish"});t.add(ie,{name:"analyze-publish"}),t.addDisposer(ie.subscribe(()=>{}));let ue=x([y],([b])=>{let T=b;if(n.patience==null||T.length<=n.patience)return!1;let C=T.slice(-(n.patience+1)),k=C[0].bestScore;return C.slice(1).every(P=>P.bestScore<=k)},{name:"patience-check"});t.add(ue,{name:"patience-check"});let K=x([R],([b])=>n.minScore!=null&&b>=n.minScore,{name:"min-score-check"});t.add(K,{name:"min-score-check"});let le=x([y],([b])=>{let T=b;if(n.minDelta==null||T.length<2)return!1;let C=T[T.length-2].bestScore,k=T[T.length-1].bestScore;return Math.abs(k-C)<n.minDelta},{name:"min-delta-check"});t.add(le,{name:"min-delta-check"});let ce=x([h],([b])=>n.maxEvaluations!=null&&b>=n.maxEvaluations,{name:"max-evaluations-check"});t.add(ce,{name:"max-evaluations-check"});let W=x([o],([b])=>n.maxIterations!=null&&b>=n.maxIterations,{name:"max-iterations-check"});t.add(W,{name:"max-iterations-check"});let de=x([h],([b])=>n.budget!=null&&b>=n.budget,{name:"budget-exhausted-check"});t.add(de,{name:"budget-exhausted-check"}),t.addDisposer(ue.subscribe(()=>{})),t.addDisposer(K.subscribe(()=>{})),t.addDisposer(le.subscribe(()=>{})),t.addDisposer(ce.subscribe(()=>{})),t.addDisposer(W.subscribe(()=>{})),t.addDisposer(de.subscribe(()=>{}));let be=x([ue,K,le,ce,W],([b,T,C,k,P])=>b?{converged:!0,reason:"patience"}:T?{converged:!0,reason:"min-score"}:C?{converged:!0,reason:"min-delta"}:k?{converged:!0,reason:"max-evaluations"}:P?{converged:!0,reason:"max-iterations"}:{converged:!1},{name:"converged"});t.add(be,{name:"converged"}),t.addDisposer(be.subscribe(()=>{}));let Te=-1,ve=O([se,z,G],([b,T,C])=>{let k=o.cache,P=b,v=C,f=T;if(k<=Te)return;Te=k;let{best:p,bestScore:I}=ot(v,f),S=y.cache,j={n:k,candidates:v,scores:f,feedback:P,best:p,bestScore:I,timestamp_ns:H()},F=[...S,j],J=h.cache+v.length,N="continue",D,Pe=n.budget!=null&&J>=n.budget,Fe=m.cache;if(Pe)N="budget",D="budget";else if(n.minScore!=null&&P.score>=n.minScore)N="converged",D="min-score";else if(n.maxIterations!=null&&k>=n.maxIterations)N="converged",D="max-iterations";else if(n.maxEvaluations!=null&&J>=n.maxEvaluations)N="converged",D="max-evaluations";else if(n.minDelta!=null&&F.length>=2){let he=F[F.length-2].bestScore,Oe=F[F.length-1].bestScore;Math.abs(Oe-he)<n.minDelta&&(N="converged",D="min-delta")}else if(n.patience!=null&&F.length>n.patience){let he=F.slice(-(n.patience+1)),Oe=he[0].bestScore;he.slice(1).every(mt=>mt.bestScore<=Oe)&&(N="converged",D="patience")}N==="continue"&&Fe&&(N="paused"),fe(()=>{g.emit(p),R.emit(P.score),y.emit(F),h.emit(J),i.emit(P),ye.publish({iteration:k,decision:N,reason:D,timestamp_ns:H()}),N==="continue"?o.emit(k+1):d.emit(N==="converged"?"converged":N==="budget"?"budget":"paused")})},{name:"decide-bridge"});return t.add(ve,{name:"decide-bridge"}),t.addDisposer(ve.subscribe(()=>{})),Object.assign(t,{best:g,score:R,status:d,history:y,strategy:l,iteration:o,generate:$,evaluate:w,analyze:_,decide:ye,setStrategy(b){l.emit(b)},pause(){m.emit(!0)},resume(){d.cache==="paused"&&fe(()=>{m.emit(!1),d.emit("running"),o.emit(o.cache+1)})}})}function Pt(e){let r=e.width??4;return{name:e.name??"blindVariation",seed(n){return[n]},analyze(n,s){let t=qe(n),a=null;for(let o of n)(!a||o.score<a.score)&&(a=o);return{summary:`blindVariation iteration: mean=${t.toFixed(3)}, n=${n.length}`,score:t,weakTasks:a?[a.taskId]:[]}},async generate(n,s){if(s.length===0)throw new Error("blindVariation.generate: empty candidate batch \u2014 cannot derive prior for teacher");let t=s[s.length-1],a=0,l={prior:t,reportCost:i=>{a+=i}};try{if(e.parallel!==!1)return await Promise.all(Array.from({length:r},()=>e.teacher(l)));let i=[];for(let c=0;c<r;c++)i.push(await e.teacher(l));return i}finally{if(e.tokens!=null&&a>0){let i=e.tokens.cache??0;e.tokens.emit(i+a)}}}}}function Ft(e){return typeof e=="object"&&e!==null&&e.kind==="errorCritique"}function Ot(e,r){return e.length===0?`No task scored below the batch mean (${r.score.toFixed(3)}). Reinforce the current direction.`:`Failures below threshold:
|
|
43
|
-
${e.map(n=>{let s=n.error!=null?` | error: ${n.error}`:"";return`- ${n.taskId} (score=${n.score.toFixed(3)})${s}`}).join(`
|
|
44
|
-
`)}`}function Dt(e){let r=e.width??4,u=e.name??"errorCritique",n=e.maxFailureSamples??5,s=e.formatCritique??Ot;return{name:u,seed(t){return[t]},analyze(t,a){let o=qe(t),l=typeof e.failureThreshold=="function"?e.failureThreshold(t):e.failureThreshold,i=l===void 0&&!Number.isFinite(o),c=l??o,m=i?[...t].sort((w,_)=>w.score-_.score):t.filter(w=>w.score<c).slice().sort((w,_)=>w.score-_.score),d=m.slice(0,n),{best:y,bestScore:g}=ot(a,t),R={summary:"",score:o,weakTasks:d.map(w=>w.taskId)},h=s(d,R),E={kind:"errorCritique",best:y,failures:d,critiqueText:h},$=m.length>d.length?` (top ${d.length} retained)`:"";return{summary:`errorCritique iteration: mean=${o.toFixed(3)}, failures=${m.length}${$}/${t.length}, bestScore=${g.toFixed(3)}`,critique:E,weakTasks:d.map(w=>w.taskId),score:o}},async generate(t,a){if(a.length===0)throw new Error("errorCritique.generate: empty candidate batch \u2014 cannot derive prior for teacher");let o=Ft(t.critique)?t.critique:void 0,l=o!==void 0?o.best:a[a.length-1],i=o?.critiqueText??t.summary,c=o?.failures??[],m=0,y={prior:l,critique:i,failures:c,reportCost:g=>{m+=g}};try{if(e.parallel!==!1)return await Promise.all(Array.from({length:r},()=>e.teacher(y)));let g=[];for(let R=0;R<r;R++)g.push(await e.teacher(y));return g}finally{if(e.tokens!=null&&m>0){let g=e.tokens.cache??0;e.tokens.emit(g+m)}}}}}function _t(e){let{best:r,score:u,status:n}=e,s=Number.isFinite(u)?u.toFixed(3):String(u),t=r??void 0;return n==="converged"?{outcome:"success",detail:`refineLoop converged at score ${s}`,artifact:t}:n==="budget"?{outcome:"partial",detail:`refineLoop hit budget at score ${s}`,artifact:t}:{outcome:"failure",detail:`refineLoop errored (status=${n})`,artifact:t}}function Je(e){let r=e.name??"refine-executor",u=e.toOutput??_t;return n=>{let s=n.payload.item,t=je(e.seedFrom(s),e.evaluator,e.strategy,{...e.refine,dataset:e.datasetFor(s),name:`${r}/inner`}),a=x([t.status,t.best,t.score],([o,l,i])=>{let c=o;if(c!=="converged"&&c!=="budget"&&c!=="errored")return null;let m=u({best:l,score:i,status:c});return{...n.payload,execution:{item:s,...m}}},{name:`${r}/output`});return Re(a,o=>o!=null,{name:`${r}/gate-out`})}}function $t(e){if(e.length===0)return Number.NEGATIVE_INFINITY;let r=0;for(let u of e)r+=u.score;return r/e.length}function Mt(e){let{passCount:r,total:u,meanScore:n,threshold:s,missingArtifact:t}=e,a=Number.isFinite(n)?n.toFixed(3):String(n),o=!t&&u>0&&n>=s,l=t?["EXECUTE stage did not emit an artifact; cannot verify reactively"]:o?[`${r}/${u} eval tasks passed; mean score ${a} \u2265 ${s}`]:u===0?["No eval tasks were selected for this item \u2014 cannot verify"]:[`${r}/${u} eval tasks passed; mean score ${a} < threshold ${s}`];return o?{verified:!0,findings:l}:{verified:!1,findings:l,errorClass:"structural"}}function Gt(e){return e.artifact??null}function at(e){let r=e.name??"eval-verifier",u=e.threshold??.5,n=e.toOutput??Mt,s=e.extractArtifact??Gt;return t=>{let{item:a,execution:o}=t.payload;if(o==null)return{...t.payload,verify:{verified:!1,findings:["evalVerifier: prior execute stage produced no execution"],errorClass:"structural"}};let l=s(o,a);if(l==null)return{...t.payload,verify:n({scores:[],meanScore:Number.NEGATIVE_INFINITY,passCount:0,total:0,threshold:u,missingArtifact:!0})};let i=A([l],{name:`${r}/candidates`}),c=A(e.datasetFor(a),{name:`${r}/dataset`}),m;fe(()=>{m=e.evaluator(i,c)});let d=x([m],([y])=>{let g=y;if(g==null)return null;let R=$t(g),h=g.filter(E=>E.score>=u).length;return{...t.payload,verify:n({scores:g,meanScore:R,passCount:h,total:g.length,threshold:u})}},{name:`${r}/output`});return Re(d,y=>y!=null,{name:`${r}/gate-out`})}}function Ht(e){let r=e.name??"harness-pair",u=Je({name:`${r}-exec`,seedFrom:e.seedFrom,evaluator:e.evaluator,strategy:e.strategy,datasetFor:e.datasetFor,refine:e.refine}),n=at({name:`${r}-verify`,evaluator:e.evaluator,datasetFor:e.datasetFor,threshold:e.threshold});return{executor:u,verifier:n}}function Qe(){let e=Se({name:"strategy-entries"}),r=x([e.entries],([a])=>{let o=a;return new Map(o)},{name:"strategy-model",equals:(a,o)=>{let l=a,i=o;if(l.size!==i.size)return!1;for(let[c,m]of l){let d=i.get(c);if(!d||m.attempts!==d.attempts||m.successes!==d.successes)return!1}return!0}});function u(a,o,l){let i=te(a,o),c=e.get(i),m=(c?.attempts??0)+1,d=(c?.successes??0)+(l?1:0);e.set(i,{rootCause:a,intervention:o,attempts:m,successes:d,successRate:d/m})}function n(a,o){return e.get(te(a,o))}let s=r.subscribe(()=>{});function t(){s()}return{node:r,record:u,lookup:n,dispose:t}}function Lt(e,r,u,n,s){let t={...Z,...s?.severityWeights},a=s?.decayRate??ee,o=s?.effectivenessThreshold??.7,l=s?.effectivenessBoost??15,i=[e,r,u];return n&&i.push(n),x(i,c=>{let m=c[0],d=c[1],y=c[2],g=n?c[3]:0,R=t[m.severity??"medium"],h=(H()-y)/1e9,E=Xe(R,h,a,0),$=te(m.rootCause,m.intervention),w=d.get($);return w&&w.successRate>=o&&(E+=l),E+=g*20,E},{name:"priority-score"})}var st="intake",Vt="triage-output",it="retry",ut="verify-results",lt="__unrouted";function ct(e,r){let u=pe(r,Le,(n,s)=>n.replace("{{item}}",JSON.stringify(s)));return(n,s)=>{let t=n.payload.item,a=[{role:"user",content:u(t)}],o=i=>({...n.payload,execution:{item:t,outcome:"failure",detail:i}}),l=i=>i instanceof Error?i.message:String(i);return Me(e,a,{parentSignal:s?.signal,onSuccess:i=>{let c;try{c=JSON.parse($e(String(i.content)))}catch(d){return o(`execute parse error: ${l(d)}`)}if(c==null||typeof c!="object"||Array.isArray(c))return o(`execute parse error: non-object response: ${JSON.stringify(c)}`);let m=c;return{...n.payload,execution:{item:t,outcome:m.outcome??"failure",detail:m.detail??"unknown",artifact:m.artifact}}},onFailure:(i,c)=>o(i==="complete"?"adapter completed without emitting DATA":`executor failed: ${l(c)}`)})}}function dt(e,r){let u=pe(r,Ve,(n,s)=>{let[t,a]=s;return n.replace("{{execution}}",JSON.stringify(t)).replace("{{item}}",JSON.stringify(a))});return(n,s)=>{let{item:t,execution:a}=n.payload;if(a==null)return{...n.payload,verify:{verified:!1,findings:["verifier: prior execute stage produced no execution"],errorClass:"structural"}};let o=[{role:"user",content:u([a,t])}],l=c=>({...n.payload,verify:{verified:!1,findings:[c],errorClass:"self-correctable"}}),i=c=>c instanceof Error?c.message:String(c);return Me(e,o,{parentSignal:s?.signal,onSuccess:c=>{let m;try{m=JSON.parse($e(String(c.content)))}catch(y){return l(`verify parse error: ${i(y)}`)}if(m==null||typeof m!="object"||Array.isArray(m))return l(`verify parse error: non-object response: ${JSON.stringify(m)}`);let d=m;return{...n.payload,verify:{verified:d.verified===!0,findings:d.findings??[],errorClass:d.errorClass}}},onFailure:(c,m)=>l(c==="complete"?"verifier completed without emitting DATA":`verifier failed: ${i(m)}`)})}}var Ce=class extends xe{queues;executeFlow;jobs;gates;queueTopics;strategy;totalRetries;totalReingestions;priorityScores;reflect;constructor(r,u,n,s,t,a,o,l,i,c,m){super(r),this.queues=u,this.executeFlow=n,this.queueTopics=s,this.jobs=t,this.gates=a,this.strategy=o,this.totalRetries=l,this.totalReingestions=i,this.reflect=c,this.priorityScores=m}get intake(){return this.queues.topic(st)}get verifyResults(){return this.queues.topic(ut)}get retry(){return this.queues.topic(it)}get unrouted(){return this.queues.topic(lt)}stageNodes(){let r=this.queues,u=a=>r.has(a)?`queues::${a}::latest`:null,n=a=>a==null?[]:[a],s=M.flatMap(a=>n(u(a))),t=[];for(let[a]of this.gates)t.push(`gates::${a}/gate`);return[{label:"INTAKE",paths:n(u("intake"))},{label:"TRIAGE",paths:["triage"]},{label:"QUEUE",paths:s},{label:"GATE",paths:t},{label:"EXECUTE",paths:["executeFlow::execute::events"]},{label:"VERIFY",paths:["executeFlow::verify::events"]},{label:"REFLECT",paths:["reflect"]},{label:"STRATEGY",paths:["strategy"]}]}};function qt(e,r){let u=r.adapter,n=r.maxRetries??2,s=r.retainedLimit??1e3,t=r.errorClassifier??we,a=new Map;for(let f of M)a.set(f,{...Ae[f],...r.queues?.[f]});let o=Ne(`${e}/queues`,{defaultTopicOptions:{retainedLimit:s}}),l=o.topic(st),i=o.topic(Vt),c=o.topic(it),m=o.topic(ut),d=new Map;for(let f of M)d.set(f,o.topic(f));let y=o.topic(lt),g=Qe(),R=De(l.latest,g.node),h=pe(r.triagePrompt,He,(f,p)=>{let[I,S]=p;return f.replace("{{strategy}}",JSON.stringify(Array.from(S.entries()))).replace("{{item}}",JSON.stringify(I))}),E=Ze(u,[R],f=>{let p=f;return!p||!p[0]?"":h(p)},{name:"triage",format:"json"}),$=De(E,R),_=O([$],([f])=>{if(f==null)return;let[p,I]=f;if(!p?.route)return;let S=I?.[0],j={...p,...S};i.publish(j)}).subscribe(()=>{}),ye=new Set(M);for(let f of M)Ge(`bridge/${f}`,i,d.get(f),{map:p=>p.route===f?p:void 0});Ge("bridge/__unrouted",i,y,{map:f=>ye.has(f.route)?void 0:f});let V=new Map,U=new Map;for(let f of M)V.set(f,tt(`jobs/${f}`));let re=[];for(let f of M){let p=d.get(f),I=V.get(f),S=new WeakSet,j=O([p.events],([F])=>{let J=F??[];for(let N of J){if(S.has(N))continue;S.add(N);let D=I.enqueue(N);U.set(me(N),{route:f,id:D})}},{name:`jobs/${f}-mirror`});re.push(j.subscribe(()=>{}))}function G(f){let p=me(f),I=U.get(p);I&&(V.get(I.route)?.removeById(I.id),U.delete(p))}let ne=et("gates"),Q=new Map;for(let f of M){let p=a.get(f);if(!p.gated)continue;let I=d.get(f),S=ne.approvalGate(`${f}/gate`,I.latest,{maxPending:p.maxPending,startOpen:p.startOpen});Q.set(f,S)}let B=[];for(let f of M)a.get(f).gated&&Q.has(f)?B.push(Q.get(f).output):B.push(d.get(f).latest);B.push(c.latest);let oe=Ke(...B),z=r.executor??ct(u,r.executePrompt),ae=r.verifier??dt(u,r.verifyPrompt),ge=r.executeMaxPerPump??Number.MAX_SAFE_INTEGER,se=r.verifyMaxPerPump??Number.MAX_SAFE_INTEGER,q=rt(`${e}/executeFlow`,{stages:[{name:"execute",work:f=>z(f),maxPerPump:ge},{name:"verify",work:f=>ae(f),maxPerPump:se}]}),ie=O([oe],([f])=>{f!=null&&q.enqueue({item:f})},{name:"execute-enqueue"}),ue=ie.subscribe(()=>{}),K=r.maxReingestions??1,le=Math.min(r.maxTotalRetries??n*10,100),ce=Math.min(r.maxTotalReingestions??K*10,100),W=A(0),de=A(0);function be(f,p,I){return{item:I,execution:f,verified:p.verified,findings:p.findings??[],errorClass:p.errorClass}}function Te(f,p){g.record(p.rootCause,p.intervention,!0),m.publish(f),G(p)}function ve(f,p){let I=me(p),S=p.$retries??0,j={...p,$retries:S+1,summary:`[RETRY ${S+1}/${n}] ${I} \u2014 Previous attempt failed: ${f.findings.join("; ")}`,relatedTo:[I]};c.publish(j)}function Ue(f,p){g.record(p.rootCause,p.intervention,!1),m.publish(f),G(p);let I=me(p),S=p.$reingestions??0;S<K&&_e(de,ce)&&l.publish({source:p.source,summary:`Verification failed for: ${I}`,evidence:f.findings.join(`
|
|
45
|
-
`),affectsAreas:p.affectsAreas,affectsEvalTasks:p.affectsEvalTasks,severity:p.severity??"high",relatedTo:[I],$reingestions:S+1})}let b=0,T=O([q.completed],([f])=>{let p=f??[];b>p.length&&(b=p.length);let I=b;b=p.length;for(let S=I;S<p.length;S++){let j=p[S],{item:F,execution:J,verify:N}=j.payload;if(J==null||N==null){G(F);continue}let D=be(J,N,F);if(D.verified){Te(D,F);continue}let Pe=D.errorClass??t({item:F,outcome:J.outcome,detail:D.findings.join("; ")}),Fe=F.$retries??0;Pe==="self-correctable"&&Fe<n&&_e(W,le)?ve(D,F):Ue(D,F)}},{name:"verify-dispatch"}),C=T.subscribe(()=>{}),k=x([q.completed],()=>null,{name:"reflect",equals:()=>!1}),P;r.priority&&(P=jt(d,g,r));let v=new Ce(e,o,q,d,V,Q,g,W,de,k,P);v.addDisposer(_),v.addDisposer(ue),v.addDisposer(C),v.addDisposer(g.dispose);for(let f of re)v.addDisposer(f);if(v.add(R,{name:"triage-input"}),v.add(E,{name:"triage"}),v.add($,{name:"router-input"}),v.add(oe,{name:"execute-input"}),v.add(ie,{name:"execute-enqueue"}),v.add(T,{name:"verify-dispatch"}),v.add(k,{name:"reflect"}),v.add(g.node,{name:"strategy"}),v.addDisposer(k.subscribe(()=>{})),P)for(let[f,p]of P)v.add(p,{name:`priority/${f}`}),v.addDisposer(p.subscribe(()=>{}));v.mount("queues",o),v.mount("gates",ne),v.mount("executeFlow",q);for(let[f,p]of V)v.mount(`jobs/${f}`,p);return v.tagFactory("harnessLoop",Ye(r)),v}function jt(e,r,u){if(!u.lastInteractionNs)throw new Error("harnessLoop: `opts.priority` requires `opts.lastInteractionNs` \u2014 pass a Node<number> (e.g. `fromTimer(60_000)` or a `state(monotonicNs())` you bump on human interaction). Priority scores only decay when this node settles; an internal default would freeze age at construction time.");let n=u.lastInteractionNs,s=u.priority??{},t={...Z,...s.severityWeights},a=s.decayRate??ee,o=s.effectivenessThreshold??.7,l=s.effectivenessBoost??15,i=new Map;for(let[c,m]of e){let d=x([m.latest,r.node,n],y=>{let g=y[0];if(g==null)return 0;let R=t[g.severity??"medium"]??40,h=(H()-y[2])/1e9,E=R*Math.exp(-a*Math.max(0,h)),$=`${g.rootCause}\u2192${g.intervention}`,_=y[1]?.get($);return _&&_.successRate>=o&&(E+=l),E},{name:`priority/${c}`});i.set(c,d)}return i}function Jt(e,r){let u=ze(e,r),n={};for(let s of M){let t=e.queues.has(s)?e.queues.topic(s):null;n[s]=t?.retained().length??0}return{...u,queueDepths:n,strategyEntries:e.strategy.node.cache?.size??0,totalRetries:e.totalRetries.cache??0,totalReingestions:e.totalReingestions.cache??0}}function Qt(e){let r={};for(let{label:u,paths:n}of e.stageNodes())for(let s of n)r[s]=u;return r}function Ut(e,r){let u=r?.logger===null?null:r?.logger??console.log,n=r?.detail??"summary",s=H(),t=[],a=[],o=Qt(e);function l(){return(H()-s)/1e9}function i(c,m,d){let y={elapsed:l(),stage:c,type:m};n!=="summary"&&(y.summary=Bt(d)),n==="full"&&(y.data=d),a.push(y)}for(let[c,m]of Object.entries(o))try{let d=e.observe(c,{format:"stage-log",stageLabels:o,logger:u?y=>u(y):()=>{},includeTypes:["data","error","complete"]});d.onEvent(y=>{y.type==="data"?i(m,"data",y.data):y.type==="error"?i(m,"error",y.data):y.type==="complete"&&i(m,"complete",void 0)}),t.push(d)}catch(d){let y=d instanceof Error?d.message:String(d);i(m,"error",`observe-unavailable: ${c} \u2014 ${y}`),u&&u(`[${l().toFixed(3)}s] ${m.padEnd(9)} \u2717 observe-unavailable: ${y}`)}return{get events(){return a},dispose(){for(let c of t)c.dispose();t.length=0}}}function Bt(e){if(e==null)return"null";if(typeof e=="string")return ft(e,80);if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{let r=JSON.stringify(e);return ft(r,120)}catch{return String(e)}}function ft(e,r){return e.length>r?`${e.slice(0,r-1)}\u2026`:e}export{nt as a,vt as b,ht as c,Et as d,xt as e,Rt as f,It as g,kt as h,St as i,Nt as j,M as k,Ae as l,Z as m,ee as n,te as o,we as p,He as q,Le as r,Ve as s,pe as t,wt as u,je as v,Pt as w,Dt as x,Je as y,at as z,Ht as A,Qe as B,Lt as C,ct as D,dt as E,Ce as F,qt as G,Jt as H,Ut as I,Yt as J};
|
package/dist/chunk-5QDBSZBV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as i,f,g as s,i as l,j as u}from"./chunk-CK2E7BTU.js";import{Observable as b}from"rxjs";function g(a,t){return t?.raw?new b(e=>a.subscribe(r=>{if(!e.closed){e.next(r);for(let o of r){if(o[0]===u){e.error(o[1]);return}if(o[0]===l){e.complete();return}}}})):new b(e=>a.subscribe(r=>{for(let o of r){if(e.closed)return;if(o[0]===i)e.next(o[1]);else if(o[0]===u){e.error(o[1]);return}else if(o[0]===l){e.complete();return}}}))}var p=0;function O(a,t){if(t.highWaterMark<1)throw new RangeError("highWaterMark must be >= 1");if(t.lowWaterMark<0)throw new RangeError("lowWaterMark must be >= 0");if(t.lowWaterMark>=t.highWaterMark)throw new RangeError("lowWaterMark must be < highWaterMark");let e=Symbol(`bp-${++p}`),n=0,r=!1;return{onEnqueue(){return n+=1,!r&&n>=t.highWaterMark?(r=!0,a([[f,e]]),!0):!1},onDequeue(){return n>0&&(n-=1),r&&n<=t.lowWaterMark?(r=!1,a([[s,e]]),!0):!1},get pending(){return n},get paused(){return r},dispose(){r&&(r=!1,a([[s,e]]))}}}export{g as a,O as b};
|
package/dist/chunk-5XJ6B66J.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as G,c as F}from"./chunk-Z4NPUARF.js";import{a as A}from"./chunk-N7FHEL4D.js";import{a as q}from"./chunk-L6NSJVJZ.js";import{j as I}from"./chunk-HITNVN6B.js";import{b as E}from"./chunk-YBB7ZGTY.js";import{C as M}from"./chunk-CRVT7D2P.js";import{E as d,G as o,J as O,m as S}from"./chunk-NTEURFZH.js";import{b as V}from"./chunk-QYADASLV.js";var $={};V($,{contentModerationGraph:()=>Q,dataQualityGraph:()=>T,issueTrackerGraph:()=>B,observabilityGraph:()=>D});function r(u,a){return q("domain_template",u,a)}function D(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=[{name:"errors",classify:e=>C(e,"error")},{name:"traces",classify:e=>C(e,"trace")},{name:"metrics",classify:e=>C(e,"metric")}],m=a.branches??h,y=m.map(e=>({name:e.name,classify:e.classify})),c=A("stratify",a.source,y);n.mount("stratify",c);let k=m.map(e=>{try{let i=n.resolve(`stratify::branch/${e.name}`);return o([i],([x])=>x,{initial:null})}catch{return d(null)}}),l=a.correlate??(e=>e),_=o(k,e=>l(e),{meta:r("observability",{stage:"correlate"})});n.add(_,{name:"correlate"});let N=a.sloCheck??(()=>({pass:!0})),w=o([_],e=>e[0],{meta:r("observability",{stage:"slo_value"})}),f=o([w],e=>N(e[0]),{meta:r("observability",{stage:"slo_verified"})});n.add(w,{name:"slo_value"}),n.add(f,{name:"slo_verified"});let v=a.weights??m.map(()=>1),b=k.map(e=>o([e],i=>i[0]!=null?1:0)),p=v.map(e=>d(e));for(let e=0;e<b.length;e++)n.add(b[e],{name:`__signal_${e}`}),n.add(p[e],{name:`__weight_${e}`});let t=F(b,p);n.add(t,{name:"alerts"});let g=o([t,f],e=>({scored:e[0],slo:e[1]}),{meta:r("observability",{stage:"output"})});n.add(g,{name:"output"});let R=d(null,{meta:r("observability",{stage:"feedback_reentry"})});n.add(R,{name:"feedback_reentry"});let s=o([f],e=>{let i=e[0];return i&&i.pass===!1?i:null},{meta:r("observability",{stage:"feedback_condition"})});return n.add(s,{name:"feedback_condition"}),G(n,"feedback_condition","feedback_reentry",{maxIterations:a.maxFeedbackIterations??5}),n}function B(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=0,m=e=>({id:`issue-${++h}`,title:String(e),severity:1,source:"unknown",raw:e}),y=a.extract??m,c=o([a.source],e=>y(e[0]),{meta:r("issue_tracker",{stage:"extract"})});n.add(c,{name:"extract"});let k=a.verify??(()=>({valid:!0})),l=o([c],e=>{let i=e[0];return{issue:i,verification:k(i)}},{meta:r("issue_tracker",{stage:"verify"})});n.add(l,{name:"verify"});let _=d([],{meta:r("issue_tracker",{stage:"known_patterns"})});n.add(_,{name:"known_patterns"});let N=a.detectRegression??(()=>({regression:!1})),w=o([c,_],e=>{let i=e[0],x=e[1];return{issue:i,regression:N(i,x)}},{meta:r("issue_tracker",{stage:"regression"})});n.add(w,{name:"regression"});let f=o([c],e=>e[0]?.severity??0),v=o([w],e=>e[0]?.regression?2:0);n.add(f,{name:"__severity_signal"}),n.add(v,{name:"__regression_signal"});let b=d(1),p=d(1.5);n.add(b,{name:"__severity_weight"}),n.add(p,{name:"__regression_weight"});let t=F([f,v],[b,p]);n.add(t,{name:"priority"});let g=o([l,w,t],e=>({verified:e[0],regression:e[1],priority:e[2]}),{meta:r("issue_tracker",{stage:"output"})});n.add(g,{name:"output"});let R=d(null,{meta:r("issue_tracker",{stage:"feedback_reentry"})});n.add(R,{name:"feedback_reentry"});let s=o([l],e=>{let i=e[0];if(i){let x=i.verification;if(x&&x.valid===!1)return i}return null},{meta:r("issue_tracker",{stage:"feedback_condition"})});return n.add(s,{name:"feedback_condition"}),G(n,"feedback_condition","feedback_reentry",{maxIterations:a.maxFeedbackIterations??3}),n}function Q(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=s=>({label:"review",confidence:.5,original:s}),m=a.classify??h,y=o([a.source],s=>m(s[0]),{meta:r("content_moderation",{stage:"classify"})});n.add(y,{name:"classify"});let c=A("stratify",y,[{name:"safe",classify:s=>s.label==="safe"},{name:"review",classify:s=>s.label==="review"},{name:"block",classify:s=>s.label==="block"}]);n.mount("stratify",c);let k=E([],{name:"review_queue",maxSize:a.maxQueueSize});n.add(k.entries,{name:"review_queue"});let l;try{l=n.resolve("stratify::branch/review")}catch{l=d(null),n.add(l,{name:"__review_fallback"})}let _=O([l],s=>{let e=s[0];e&&k.append(e)});n.add(_,{name:"__review_accumulator"}),n.addDisposer(M(_));let N=d({},{meta:r("content_moderation",{stage:"policy",access:"both",description:"Moderation policy rules \u2014 updated via feedback"})});n.add(N,{name:"policy"});let w=a.weights??[.1,1,2],f=o([y],s=>s[0]?.confidence??0),v=o([y],s=>{let e=s[0];return e?e.label==="block"?w[2]:e.label==="review"?w[1]:w[0]:0});n.add(f,{name:"__confidence_signal"}),n.add(v,{name:"__severity_signal"});let b=d(1),p=d(1);n.add(b,{name:"__w_confidence"}),n.add(p,{name:"__w_severity"});let t=F([f,v],[b,p]);n.add(t,{name:"priority"});let g=o([y,t],s=>({classification:s[0],priority:s[1]}),{meta:r("content_moderation",{stage:"output"})});n.add(g,{name:"output"});let R=o([k.entries,N],s=>{let e=s[0];if(e&&e.length>0){let i=e[e.length-1];if(i&&i.falsePositive)return i}return null},{meta:r("content_moderation",{stage:"feedback_condition"})});return n.add(R,{name:"feedback_condition"}),G(n,"feedback_condition","policy",{maxIterations:a.maxFeedbackIterations??5}),n}function T(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=a.validate??(t=>({valid:!0,errors:[],record:t})),m=o([a.source],t=>t[0]!=null?h(t[0]):void 0,{meta:r("data_quality",{stage:"validate"})});n.add(m,{name:"validate"});let y=a.detectAnomaly??(t=>({anomaly:!1,score:0,record:t})),c=o([a.source],t=>t[0]!=null?y(t[0]):void 0,{meta:r("data_quality",{stage:"anomaly"})});n.add(c,{name:"anomaly"});let k=d(null,{meta:r("data_quality",{stage:"baseline",description:"Rolling baseline for drift detection"})});n.add(k,{name:"baseline"});let l=O([m],t=>{let g=t[0];g?.valid&&S(()=>{k.emit(g.record)})});n.add(l,{name:"__baseline_updater"}),M(l);let _=a.detectDrift??(()=>({drift:!1})),N=o([a.source,k],t=>_(t[0],t[1]),{meta:r("data_quality",{stage:"drift"})});n.add(N,{name:"drift"});let w=a.suggest??(()=>null),f=o([m,c],t=>w({validation:t[0],anomaly:t[1]}),{meta:r("data_quality",{stage:"remediate"})});n.add(f,{name:"remediate"});let v=o([m,c,N,f],t=>({validation:t[0],anomaly:t[1],drift:t[2],remediation:t[3]}),{meta:r("data_quality",{stage:"output"})});n.add(v,{name:"output"});let b=d([],{meta:r("data_quality",{stage:"validation_rules"})});n.add(b,{name:"validation_rules"});let p=o([c],t=>{let g=t[0];return g?.anomaly?g:null},{meta:r("data_quality",{stage:"feedback_condition"})});return n.add(p,{name:"feedback_condition"}),G(n,"feedback_condition","validation_rules",{maxIterations:a.maxFeedbackIterations??3}),n}function C(u,a){if(u==null||typeof u!="object")return!1;let n=u;return n.type===a||n.kind===a}export{D as a,B as b,Q as c,T as d,$ as e};
|
package/dist/chunk-6QZNQS5B.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as d,c as i,d as R}from"./chunk-CK2E7BTU.js";import{b as T}from"./chunk-QYADASLV.js";var h={};T(h,{useStore:()=>y,useSubscribe:()=>p,useSubscribeRecord:()=>S});function p(e){return{subscribe(s){let n=e.subscribe(()=>{s(e.cache)});return s(e.cache),n}}}function y(e){return{subscribe(s){let n=e.subscribe(()=>{s(e.cache)});return s(e.cache),n},set(s){e.down([[i],[d,s]])},update(s){let n=s(e.cache);e.down([[i],[d,n]])}}}function S(e,s){return{subscribe(n){let a=[],l=()=>{for(let o of a)o();a=[]},b=()=>{let o={};for(let t of e.cache??[]){let c=s(t),r={};for(let u of Object.keys(c))r[u]=c[u].cache;o[t]=r}return o},f=o=>{l();for(let t of o){let c=s(t);for(let r of Object.keys(c)){let u=c[r].subscribe(()=>{n(b())});a.push(u)}}n(b())},v=e.subscribe(o=>{o.some(t=>t[0]===d||t[0]===R)&&f(e.cache??[])});return f(e.cache??[]),()=>{v(),l()}}}}export{p as a,y as b,S as c,h as d};
|