@graphrefly/graphrefly 0.47.1 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/composition/index.cjs +28 -19
- package/dist/base/composition/index.cjs.map +1 -1
- package/dist/base/composition/index.d.cts +14 -5
- package/dist/base/composition/index.d.ts +14 -5
- package/dist/base/composition/index.js +9 -9
- package/dist/base/index.cjs +294 -164
- package/dist/base/index.cjs.map +1 -1
- package/dist/base/index.d.cts +2 -2
- package/dist/base/index.d.ts +2 -2
- package/dist/base/index.js +77 -72
- package/dist/base/io/index.cjs +145 -85
- package/dist/base/io/index.cjs.map +1 -1
- package/dist/base/io/index.d.cts +32 -5
- package/dist/base/io/index.d.ts +32 -5
- package/dist/base/io/index.js +5 -5
- package/dist/base/mutation/index.cjs +21 -0
- package/dist/base/mutation/index.cjs.map +1 -1
- package/dist/base/mutation/index.d.cts +23 -1
- package/dist/base/mutation/index.d.ts +23 -1
- package/dist/base/mutation/index.js +3 -1
- package/dist/base/sources/browser/index.cjs +18 -12
- package/dist/base/sources/browser/index.cjs.map +1 -1
- package/dist/base/sources/browser/index.d.cts +20 -2
- package/dist/base/sources/browser/index.d.ts +20 -2
- package/dist/base/sources/browser/index.js +18 -12
- package/dist/base/sources/browser/index.js.map +1 -1
- package/dist/base/sources/event/index.cjs +29 -1
- package/dist/base/sources/event/index.cjs.map +1 -1
- package/dist/base/sources/event/index.d.cts +67 -3
- package/dist/base/sources/event/index.d.ts +67 -3
- package/dist/base/sources/event/index.js +5 -2
- package/dist/base/sources/index.cjs +96 -50
- package/dist/base/sources/index.cjs.map +1 -1
- package/dist/base/sources/index.d.cts +1 -1
- package/dist/base/sources/index.d.ts +1 -1
- package/dist/base/sources/index.js +7 -4
- package/dist/base/sources/node/index.cjs +43 -37
- package/dist/base/sources/node/index.cjs.map +1 -1
- package/dist/base/sources/node/index.js +43 -37
- package/dist/base/sources/node/index.js.map +1 -1
- package/dist/{chunk-J5WFUEO4.js → chunk-23MAWVOJ.js} +3 -3
- package/dist/{chunk-YXCPV26R.js → chunk-3REMCHSS.js} +39 -27
- package/dist/chunk-3REMCHSS.js.map +1 -0
- package/dist/{chunk-CEVNQ74M.js → chunk-3YGXPUHW.js} +2 -2
- package/dist/{chunk-CEVNQ74M.js.map → chunk-3YGXPUHW.js.map} +1 -1
- package/dist/{chunk-EVYY4X5A.js → chunk-46X2EFQH.js} +16 -5
- package/dist/chunk-46X2EFQH.js.map +1 -0
- package/dist/{chunk-NY2PYHNC.js → chunk-5UY3PNFY.js} +12 -5
- package/dist/chunk-5UY3PNFY.js.map +1 -0
- package/dist/{chunk-RGMTUZCL.js → chunk-65OM4XLQ.js} +50 -4
- package/dist/chunk-65OM4XLQ.js.map +1 -0
- package/dist/{chunk-3PSLNJDU.js → chunk-6DQYBIHW.js} +314 -49
- package/dist/chunk-6DQYBIHW.js.map +1 -0
- package/dist/{chunk-LDCSZ72P.js → chunk-6YBER5UP.js} +3 -3
- package/dist/{chunk-LDCSZ72P.js.map → chunk-6YBER5UP.js.map} +1 -1
- package/dist/{chunk-7EGRP2VX.js → chunk-7BULJTL6.js} +2 -2
- package/dist/{chunk-7EGRP2VX.js.map → chunk-7BULJTL6.js.map} +1 -1
- package/dist/{chunk-VLAGJZSL.js → chunk-7T7WLEPM.js} +25 -4
- package/dist/chunk-7T7WLEPM.js.map +1 -0
- package/dist/{chunk-PKPO3JTZ.js → chunk-AQAKDE7F.js} +29 -11
- package/dist/chunk-AQAKDE7F.js.map +1 -0
- package/dist/{chunk-2OB3CEJS.js → chunk-B5Y5GPD5.js} +2 -2
- package/dist/{chunk-BXGZFGZ4.js → chunk-C5QD5DQX.js} +22 -1
- package/dist/chunk-C5QD5DQX.js.map +1 -0
- package/dist/{chunk-4XCHZRUJ.js → chunk-D5YGR4TP.js} +58 -7
- package/dist/chunk-D5YGR4TP.js.map +1 -0
- package/dist/{chunk-NPRP3MCV.js → chunk-DHDCOOJU.js} +2 -2
- package/dist/chunk-DHDCOOJU.js.map +1 -0
- package/dist/{chunk-MTTRCEJT.js → chunk-DVTDF5OI.js} +2 -2
- package/dist/{chunk-SOOKUYVM.js → chunk-F7EKHR32.js} +13 -9
- package/dist/chunk-F7EKHR32.js.map +1 -0
- package/dist/{chunk-A7KV5UK4.js → chunk-G7H6PN7P.js} +2 -2
- package/dist/{chunk-OCUDSN63.js → chunk-GGKHHG5Y.js} +110 -64
- package/dist/chunk-GGKHHG5Y.js.map +1 -0
- package/dist/{chunk-RAGGHLCV.js → chunk-GUNIRPEJ.js} +8 -6
- package/dist/{chunk-RAGGHLCV.js.map → chunk-GUNIRPEJ.js.map} +1 -1
- package/dist/{chunk-YJ4U2D2C.js → chunk-J5TBZFBD.js} +9 -7
- package/dist/chunk-J5TBZFBD.js.map +1 -0
- package/dist/{chunk-Y52CS6YA.js → chunk-JA67ZQG2.js} +2 -2
- package/dist/{chunk-Y52CS6YA.js.map → chunk-JA67ZQG2.js.map} +1 -1
- package/dist/{chunk-U225SKB4.js → chunk-K4ZYJ4EM.js} +569 -424
- package/dist/chunk-K4ZYJ4EM.js.map +1 -0
- package/dist/{chunk-Z4YXAUDN.js → chunk-KUFXLAEY.js} +11 -7
- package/dist/{chunk-Z4YXAUDN.js.map → chunk-KUFXLAEY.js.map} +1 -1
- package/dist/{chunk-IHTWQEDR.js → chunk-LTSI7ULC.js} +3 -3
- package/dist/{chunk-IHTWQEDR.js.map → chunk-LTSI7ULC.js.map} +1 -1
- package/dist/{chunk-DKNHAICT.js → chunk-MMHGYX44.js} +25 -9
- package/dist/chunk-MMHGYX44.js.map +1 -0
- package/dist/{chunk-K7PDZYQE.js → chunk-MQMTRKY3.js} +129 -50
- package/dist/chunk-MQMTRKY3.js.map +1 -0
- package/dist/{chunk-42FQ27MQ.js → chunk-MTODGQBR.js} +44 -179
- package/dist/chunk-MTODGQBR.js.map +1 -0
- package/dist/{chunk-O3MT7DYI.js → chunk-N6MNJNHB.js} +2 -2
- package/dist/{chunk-FVINAAKA.js → chunk-NBK6QQMG.js} +14 -13
- package/dist/{chunk-FVINAAKA.js.map → chunk-NBK6QQMG.js.map} +1 -1
- package/dist/{chunk-DM4OMPWK.js → chunk-NSA5K5G2.js} +2 -2
- package/dist/{chunk-MLTPJMH6.js → chunk-QQYULEZL.js} +2 -2
- package/dist/chunk-QSW4DFKE.js +31 -0
- package/dist/chunk-QSW4DFKE.js.map +1 -0
- package/dist/{chunk-PZWISPIQ.js → chunk-S7HN5FHL.js} +17 -11
- package/dist/chunk-S7HN5FHL.js.map +1 -0
- package/dist/{chunk-4S53H2KR.js → chunk-SUNCHMML.js} +2 -2
- package/dist/{chunk-4GYMCUDZ.js → chunk-T2U6N3FV.js} +7 -7
- package/dist/{chunk-RJOG4IJU.js → chunk-T5URUIIY.js} +50 -35
- package/dist/chunk-T5URUIIY.js.map +1 -0
- package/dist/{chunk-B4AKFXGE.js → chunk-TPTZZV25.js} +6 -6
- package/dist/chunk-TPTZZV25.js.map +1 -0
- package/dist/{chunk-BU3SEFA5.js → chunk-V46JWFGV.js} +7 -6
- package/dist/chunk-V46JWFGV.js.map +1 -0
- package/dist/{chunk-IJRR6YAI.js → chunk-VLDRAMP7.js} +18 -12
- package/dist/chunk-VLDRAMP7.js.map +1 -0
- package/dist/{chunk-6XZYT4SW.js → chunk-X6ESZDR6.js} +8 -9
- package/dist/chunk-X6ESZDR6.js.map +1 -0
- package/dist/{chunk-E5OZPDIW.js → chunk-X7BA5PWG.js} +7 -5
- package/dist/chunk-X7BA5PWG.js.map +1 -0
- package/dist/{chunk-CXANAIZU.js → chunk-XEWV254I.js} +3 -3
- package/dist/{chunk-CXANAIZU.js.map → chunk-XEWV254I.js.map} +1 -1
- package/dist/{chunk-V4Y3TM7U.js → chunk-YBJVKMTM.js} +38 -16
- package/dist/chunk-YBJVKMTM.js.map +1 -0
- package/dist/{chunk-7ADWWI2T.js → chunk-ZW32BPXV.js} +17 -6
- package/dist/chunk-ZW32BPXV.js.map +1 -0
- package/dist/compat/index.cjs +52 -5
- package/dist/compat/index.cjs.map +1 -1
- package/dist/compat/index.d.cts +1 -1
- package/dist/compat/index.d.ts +1 -1
- package/dist/compat/index.js +7 -7
- package/dist/compat/nestjs/index.cjs +52 -5
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +1 -1
- package/dist/compat/nestjs/index.d.ts +1 -1
- package/dist/compat/nestjs/index.js +4 -4
- package/dist/{fallback-Bx46zqky.d.cts → fallback-BROR6ZhO.d.cts} +1 -1
- package/dist/{fallback-pIWW8A2d.d.ts → fallback-DO80aM_3.d.ts} +1 -1
- package/dist/{index-B_p8tnvf.d.cts → index-D1z3XcF9.d.cts} +1 -0
- package/dist/{index-_HDSmPyp.d.ts → index-DZ6yua0Q.d.ts} +1 -0
- package/dist/index.cjs +2387 -1707
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +173 -150
- package/dist/index.js.map +1 -1
- package/dist/presets/ai/index.cjs +88 -26
- package/dist/presets/ai/index.cjs.map +1 -1
- package/dist/presets/ai/index.js +14 -14
- package/dist/presets/harness/index.cjs +183 -51
- package/dist/presets/harness/index.cjs.map +1 -1
- package/dist/presets/harness/index.d.cts +15 -5
- package/dist/presets/harness/index.d.ts +15 -5
- package/dist/presets/harness/index.js +26 -26
- package/dist/presets/index.cjs +298 -101
- package/dist/presets/index.cjs.map +1 -1
- package/dist/presets/index.d.cts +2 -2
- package/dist/presets/index.d.ts +2 -2
- package/dist/presets/index.js +49 -49
- package/dist/presets/inspect/index.cjs +63 -14
- package/dist/presets/inspect/index.cjs.map +1 -1
- package/dist/presets/inspect/index.d.cts +1 -1
- package/dist/presets/inspect/index.d.ts +1 -1
- package/dist/presets/inspect/index.js +6 -6
- package/dist/presets/resilience/index.cjs +64 -44
- package/dist/presets/resilience/index.cjs.map +1 -1
- package/dist/presets/resilience/index.d.cts +12 -8
- package/dist/presets/resilience/index.d.ts +12 -8
- package/dist/presets/resilience/index.js +6 -6
- package/dist/{rate-limiter-DpVbSYdH.d.cts → rate-limiter-DC26FM8J.d.cts} +10 -1
- package/dist/{rate-limiter-CEALq4N1.d.ts → rate-limiter-DyWpwpQP.d.ts} +10 -1
- package/dist/{reactive-layout-fswlBUvX.d.ts → reactive-layout-BBBWH0V_.d.cts} +85 -4
- package/dist/{reactive-layout-fswlBUvX.d.cts → reactive-layout-BBBWH0V_.d.ts} +85 -4
- package/dist/solutions/index.cjs +239 -92
- package/dist/solutions/index.cjs.map +1 -1
- package/dist/solutions/index.d.cts +2 -2
- package/dist/solutions/index.d.ts +2 -2
- package/dist/solutions/index.js +32 -32
- package/dist/{spawnable-5mDY501F.d.cts → spawnable-B2IlW60f.d.cts} +23 -2
- package/dist/{spawnable-D3lR0oQu.d.ts → spawnable-tttFz2Nh.d.ts} +23 -2
- package/dist/testing/index.cjs +94 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +59 -0
- package/dist/testing/index.d.ts +59 -0
- package/dist/testing/index.js +73 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/{timeout-U5O4ESK3.js → timeout-BEABACRP.js} +2 -2
- package/dist/utils/ai/browser.cjs.map +1 -1
- package/dist/utils/ai/browser.d.cts +2 -2
- package/dist/utils/ai/browser.d.ts +2 -2
- package/dist/utils/ai/browser.js +10 -10
- package/dist/utils/ai/browser.js.map +1 -1
- package/dist/utils/ai/index.cjs +291 -191
- package/dist/utils/ai/index.cjs.map +1 -1
- package/dist/utils/ai/index.d.cts +108 -12
- package/dist/utils/ai/index.d.ts +108 -12
- package/dist/utils/ai/index.js +23 -21
- package/dist/utils/ai/node.cjs.map +1 -1
- package/dist/utils/ai/node.d.cts +5 -5
- package/dist/utils/ai/node.d.ts +5 -5
- package/dist/utils/ai/node.js +3 -3
- package/dist/utils/ai/node.js.map +1 -1
- package/dist/utils/cqrs/index.cjs +29 -3
- package/dist/utils/cqrs/index.cjs.map +1 -1
- package/dist/utils/cqrs/index.d.cts +12 -7
- package/dist/utils/cqrs/index.d.ts +12 -7
- package/dist/utils/cqrs/index.js +2 -2
- package/dist/utils/demo-shell/index.cjs +45 -19
- package/dist/utils/demo-shell/index.cjs.map +1 -1
- package/dist/utils/demo-shell/index.d.cts +1 -1
- package/dist/utils/demo-shell/index.d.ts +1 -1
- package/dist/utils/demo-shell/index.js +2 -2
- package/dist/utils/domain-templates/index.cjs +1 -1
- package/dist/utils/domain-templates/index.cjs.map +1 -1
- package/dist/utils/domain-templates/index.js +3 -3
- package/dist/utils/graphspec/index.cjs +1 -1
- package/dist/utils/graphspec/index.cjs.map +1 -1
- package/dist/utils/graphspec/index.js +3 -3
- package/dist/utils/harness/index.cjs +16 -10
- package/dist/utils/harness/index.cjs.map +1 -1
- package/dist/utils/harness/index.js +1 -1
- package/dist/utils/index.cjs +1692 -1192
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +7 -7
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.js +77 -59
- package/dist/utils/inspect/index.cjs +52 -4
- package/dist/utils/inspect/index.cjs.map +1 -1
- package/dist/utils/inspect/index.d.cts +32 -3
- package/dist/utils/inspect/index.d.ts +32 -3
- package/dist/utils/inspect/index.js +4 -4
- package/dist/utils/job-queue/index.cjs +46 -9
- package/dist/utils/job-queue/index.cjs.map +1 -1
- package/dist/utils/job-queue/index.d.cts +33 -3
- package/dist/utils/job-queue/index.d.ts +33 -3
- package/dist/utils/job-queue/index.js +2 -2
- package/dist/utils/memory/index.cjs +570 -425
- package/dist/utils/memory/index.cjs.map +1 -1
- package/dist/utils/memory/index.d.cts +261 -33
- package/dist/utils/memory/index.d.ts +261 -33
- package/dist/utils/memory/index.js +10 -2
- package/dist/utils/messaging/index.cjs.map +1 -1
- package/dist/utils/messaging/index.d.cts +4 -3
- package/dist/utils/messaging/index.d.ts +4 -3
- package/dist/utils/messaging/index.js +2 -2
- package/dist/utils/orchestration/index.cjs +14 -3
- package/dist/utils/orchestration/index.cjs.map +1 -1
- package/dist/utils/orchestration/index.js +3 -3
- package/dist/utils/process/index.cjs +32 -2
- package/dist/utils/process/index.cjs.map +1 -1
- package/dist/utils/process/index.d.cts +4 -3
- package/dist/utils/process/index.d.ts +4 -3
- package/dist/utils/process/index.js +3 -3
- package/dist/utils/reactive-layout/index.cjs +184 -55
- package/dist/utils/reactive-layout/index.cjs.map +1 -1
- package/dist/utils/reactive-layout/index.d.cts +128 -3
- package/dist/utils/reactive-layout/index.d.ts +128 -3
- package/dist/utils/reactive-layout/index.js +16 -8
- package/dist/utils/reduction/index.cjs +1 -1
- package/dist/utils/reduction/index.cjs.map +1 -1
- package/dist/utils/reduction/index.js +2 -2
- package/dist/utils/resilience/index.cjs +64 -43
- package/dist/utils/resilience/index.cjs.map +1 -1
- package/dist/utils/resilience/index.d.cts +1 -1
- package/dist/utils/resilience/index.d.ts +1 -1
- package/dist/utils/resilience/index.js +5 -5
- package/dist/utils/surface/index.cjs +1 -1
- package/dist/utils/surface/index.cjs.map +1 -1
- package/dist/utils/surface/index.js +4 -4
- package/package.json +15 -3
- package/dist/chunk-3PSLNJDU.js.map +0 -1
- package/dist/chunk-42FQ27MQ.js.map +0 -1
- package/dist/chunk-4XCHZRUJ.js.map +0 -1
- package/dist/chunk-6XZYT4SW.js.map +0 -1
- package/dist/chunk-7ADWWI2T.js.map +0 -1
- package/dist/chunk-B4AKFXGE.js.map +0 -1
- package/dist/chunk-BU3SEFA5.js.map +0 -1
- package/dist/chunk-BXGZFGZ4.js.map +0 -1
- package/dist/chunk-DKNHAICT.js.map +0 -1
- package/dist/chunk-E5OZPDIW.js.map +0 -1
- package/dist/chunk-EVYY4X5A.js.map +0 -1
- package/dist/chunk-IJRR6YAI.js.map +0 -1
- package/dist/chunk-K7PDZYQE.js.map +0 -1
- package/dist/chunk-NPRP3MCV.js.map +0 -1
- package/dist/chunk-NY2PYHNC.js.map +0 -1
- package/dist/chunk-OCUDSN63.js.map +0 -1
- package/dist/chunk-PKPO3JTZ.js.map +0 -1
- package/dist/chunk-PZWISPIQ.js.map +0 -1
- package/dist/chunk-RGMTUZCL.js.map +0 -1
- package/dist/chunk-RJOG4IJU.js.map +0 -1
- package/dist/chunk-SOOKUYVM.js.map +0 -1
- package/dist/chunk-U225SKB4.js.map +0 -1
- package/dist/chunk-V4Y3TM7U.js.map +0 -1
- package/dist/chunk-VLAGJZSL.js.map +0 -1
- package/dist/chunk-W2BOPXTI.js +0 -1
- package/dist/chunk-YJ4U2D2C.js.map +0 -1
- package/dist/chunk-YXCPV26R.js.map +0 -1
- package/dist/timeout-U5O4ESK3.js.map +0 -1
- /package/dist/{chunk-J5WFUEO4.js.map → chunk-23MAWVOJ.js.map} +0 -0
- /package/dist/{chunk-2OB3CEJS.js.map → chunk-B5Y5GPD5.js.map} +0 -0
- /package/dist/{chunk-MTTRCEJT.js.map → chunk-DVTDF5OI.js.map} +0 -0
- /package/dist/{chunk-A7KV5UK4.js.map → chunk-G7H6PN7P.js.map} +0 -0
- /package/dist/{chunk-O3MT7DYI.js.map → chunk-N6MNJNHB.js.map} +0 -0
- /package/dist/{chunk-DM4OMPWK.js.map → chunk-NSA5K5G2.js.map} +0 -0
- /package/dist/{chunk-MLTPJMH6.js.map → chunk-QQYULEZL.js.map} +0 -0
- /package/dist/{chunk-4S53H2KR.js.map → chunk-SUNCHMML.js.map} +0 -0
- /package/dist/{chunk-4GYMCUDZ.js.map → chunk-T2U6N3FV.js.map} +0 -0
- /package/dist/{chunk-W2BOPXTI.js.map → timeout-BEABACRP.js.map} +0 -0
package/dist/solutions/index.cjs
CHANGED
|
@@ -341,11 +341,13 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
341
341
|
if (latestOpts != null) {
|
|
342
342
|
attachSource();
|
|
343
343
|
}
|
|
344
|
-
return
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
344
|
+
return {
|
|
345
|
+
onDeactivation: () => {
|
|
346
|
+
stopped = true;
|
|
347
|
+
timer.cancel();
|
|
348
|
+
if (srcUnsub) srcUnsub();
|
|
349
|
+
if (optsUnsub) optsUnsub();
|
|
350
|
+
}
|
|
349
351
|
};
|
|
350
352
|
},
|
|
351
353
|
{
|
|
@@ -593,9 +595,11 @@ function _oneShotLlmCall(adapter, messages, config) {
|
|
|
593
595
|
invokeResult = adapter.invoke(messages, { ...config.invokeOpts, signal: ac.signal });
|
|
594
596
|
} catch (err) {
|
|
595
597
|
emitOnce(config.onFailure("throw", err));
|
|
596
|
-
return
|
|
597
|
-
|
|
598
|
-
|
|
598
|
+
return {
|
|
599
|
+
onDeactivation: () => {
|
|
600
|
+
unlinkParent();
|
|
601
|
+
ac.abort();
|
|
602
|
+
}
|
|
599
603
|
};
|
|
600
604
|
}
|
|
601
605
|
const callNode = (0, import_extra.fromAny)(invokeResult, { signal: ac.signal });
|
|
@@ -624,11 +628,13 @@ function _oneShotLlmCall(adapter, messages, config) {
|
|
|
624
628
|
unsub();
|
|
625
629
|
unsub = null;
|
|
626
630
|
}
|
|
627
|
-
return
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
631
|
+
return {
|
|
632
|
+
onDeactivation: () => {
|
|
633
|
+
unlinkParent();
|
|
634
|
+
ac.abort();
|
|
635
|
+
unsub?.();
|
|
636
|
+
unsub = null;
|
|
637
|
+
}
|
|
632
638
|
};
|
|
633
639
|
},
|
|
634
640
|
{ describeKind: "producer" }
|
|
@@ -892,9 +898,11 @@ function _retrySource(source, opts, emitState) {
|
|
|
892
898
|
const merged = makeMergedOptsMirror(opts);
|
|
893
899
|
const getCfg = () => resolveRetryConfig(merged.current());
|
|
894
900
|
const inner = _runRetryStateMachine(getCfg, () => source, a, emitState);
|
|
895
|
-
return
|
|
896
|
-
|
|
897
|
-
|
|
901
|
+
return {
|
|
902
|
+
onDeactivation: () => {
|
|
903
|
+
inner();
|
|
904
|
+
merged.unsub();
|
|
905
|
+
}
|
|
898
906
|
};
|
|
899
907
|
},
|
|
900
908
|
{
|
|
@@ -918,9 +926,11 @@ function _retryFactory(factory, opts, emitState) {
|
|
|
918
926
|
const merged = makeMergedOptsMirror(opts);
|
|
919
927
|
const getCfg = () => resolveRetryConfig(merged.current());
|
|
920
928
|
const inner = _runRetryStateMachine(getCfg, factory, a, emitState);
|
|
921
|
-
return
|
|
922
|
-
|
|
923
|
-
|
|
929
|
+
return {
|
|
930
|
+
onDeactivation: () => {
|
|
931
|
+
inner();
|
|
932
|
+
merged.unsub();
|
|
933
|
+
}
|
|
924
934
|
};
|
|
925
935
|
},
|
|
926
936
|
{
|
|
@@ -1074,16 +1084,20 @@ var ToolRegistryGraph = class extends import_graph2.Graph {
|
|
|
1074
1084
|
inner = handlerResultToNode(raw, ac.signal);
|
|
1075
1085
|
} catch (err) {
|
|
1076
1086
|
actions.down([[import_core8.ERROR, err]]);
|
|
1077
|
-
return
|
|
1078
|
-
|
|
1087
|
+
return {
|
|
1088
|
+
onDeactivation: () => {
|
|
1089
|
+
ac.abort();
|
|
1090
|
+
}
|
|
1079
1091
|
};
|
|
1080
1092
|
}
|
|
1081
1093
|
const unsub = inner.subscribe((batch13) => {
|
|
1082
1094
|
actions.down(batch13);
|
|
1083
1095
|
});
|
|
1084
|
-
return
|
|
1085
|
-
|
|
1086
|
-
|
|
1096
|
+
return {
|
|
1097
|
+
onDeactivation: () => {
|
|
1098
|
+
ac.abort();
|
|
1099
|
+
unsub();
|
|
1100
|
+
}
|
|
1087
1101
|
};
|
|
1088
1102
|
},
|
|
1089
1103
|
{
|
|
@@ -1319,6 +1333,11 @@ var AgentLoopGraph = class extends import_graph3.Graph {
|
|
|
1319
1333
|
chat.append("assistant", response.content, {
|
|
1320
1334
|
toolCalls: response.toolCalls
|
|
1321
1335
|
});
|
|
1336
|
+
if (capReached && hasToolCalls) {
|
|
1337
|
+
for (const tc of response.toolCalls) {
|
|
1338
|
+
chat.appendToolResult(tc.id, "[tool call denied: maxTurns reached]");
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1322
1341
|
});
|
|
1323
1342
|
},
|
|
1324
1343
|
{ describeKind: "effect" }
|
|
@@ -1340,6 +1359,45 @@ var AgentLoopGraph = class extends import_graph3.Graph {
|
|
|
1340
1359
|
},
|
|
1341
1360
|
{ describeKind: "effect" }
|
|
1342
1361
|
);
|
|
1362
|
+
const effFullDeny = gatedToolCallsNode !== toolCallsRaw ? (0, import_core9.node)(
|
|
1363
|
+
[toolCallsRaw, gatedToolCallsNode],
|
|
1364
|
+
(batchData) => {
|
|
1365
|
+
if (latestAborted) return;
|
|
1366
|
+
const rawBatch = batchData[0];
|
|
1367
|
+
const gatedBatch = batchData[1];
|
|
1368
|
+
const rawCalls = rawBatch != null && rawBatch.length > 0 ? rawBatch.at(-1) : null;
|
|
1369
|
+
if (rawCalls == null || rawCalls.length === 0) return;
|
|
1370
|
+
const gatedCalls = gatedBatch != null && gatedBatch.length > 0 ? gatedBatch.at(-1) : null;
|
|
1371
|
+
const allowedIds = gatedCalls === null ? null : new Set(gatedCalls.map((c) => c.id));
|
|
1372
|
+
const denied = allowedIds === null ? rawCalls : rawCalls.filter((c) => !allowedIds.has(c.id));
|
|
1373
|
+
if (denied.length === 0) return;
|
|
1374
|
+
const isFullDeny = gatedCalls === null;
|
|
1375
|
+
(0, import_core9.batch)(() => {
|
|
1376
|
+
if (isFullDeny) {
|
|
1377
|
+
statusNode.emit(latestTurn >= maxTurns ? "done" : "thinking");
|
|
1378
|
+
}
|
|
1379
|
+
for (const c of denied)
|
|
1380
|
+
chat.appendToolResult(c.id, "[tool call denied by interceptor]");
|
|
1381
|
+
});
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
name: "fullDenyRecovery",
|
|
1385
|
+
describeKind: "effect",
|
|
1386
|
+
meta: aiMeta("agent_full_deny_recovery"),
|
|
1387
|
+
// MUST be explicit: the core `node()` default is
|
|
1388
|
+
// `partial: false` (node.ts `opts.partial ?? false`),
|
|
1389
|
+
// and `gatedToolCallsNode` only ever emits RESOLVED on the
|
|
1390
|
+
// full-deny path (never DATA/terminal). Spec R2.7.0
|
|
1391
|
+
// (DS-2.7.A, 2026-05-19) holds the `partial: false`
|
|
1392
|
+
// first-run gate until every dep has contributed real
|
|
1393
|
+
// DATA, so a `partial: false` effFullDeny would hold the
|
|
1394
|
+
// fn FOREVER. Spec R2.7.2 = `partial: true` disables the
|
|
1395
|
+
// gate; the fn body's `denied`-subtraction guard above
|
|
1396
|
+
// covers the SENTINEL slot per the R2.7.2 author
|
|
1397
|
+
// contract.
|
|
1398
|
+
partial: true
|
|
1399
|
+
}
|
|
1400
|
+
) : null;
|
|
1343
1401
|
let latestStatus = statusNode.cache ?? "idle";
|
|
1344
1402
|
const statusSub = statusNode.subscribe((msgs) => {
|
|
1345
1403
|
for (const m of msgs) if (m[0] === import_core9.DATA) latestStatus = m[1];
|
|
@@ -1359,6 +1417,7 @@ var AgentLoopGraph = class extends import_graph3.Graph {
|
|
|
1359
1417
|
);
|
|
1360
1418
|
const kaResponse = (0, import_extra5.keepalive)(effResponse);
|
|
1361
1419
|
const kaResults = (0, import_extra5.keepalive)(effResults);
|
|
1420
|
+
const kaFullDeny = effFullDeny ? (0, import_extra5.keepalive)(effFullDeny) : null;
|
|
1362
1421
|
const kaAbort = (0, import_extra5.keepalive)(effAbort);
|
|
1363
1422
|
this._terminalResult = (0, import_core9.node)(
|
|
1364
1423
|
[statusNode, lastResponseState],
|
|
@@ -1411,6 +1470,7 @@ var AgentLoopGraph = class extends import_graph3.Graph {
|
|
|
1411
1470
|
this.addDisposer(statusSub);
|
|
1412
1471
|
this.addDisposer(kaResponse);
|
|
1413
1472
|
this.addDisposer(kaResults);
|
|
1473
|
+
if (kaFullDeny) this.addDisposer(kaFullDeny);
|
|
1414
1474
|
this.addDisposer(kaAbort);
|
|
1415
1475
|
this._disposeRunWiring = () => {
|
|
1416
1476
|
};
|
|
@@ -1710,6 +1770,26 @@ function createAuditLog(opts) {
|
|
|
1710
1770
|
}
|
|
1711
1771
|
return log;
|
|
1712
1772
|
}
|
|
1773
|
+
function readonlyAuditLog(log) {
|
|
1774
|
+
return Object.freeze({
|
|
1775
|
+
get entries() {
|
|
1776
|
+
return log.entries;
|
|
1777
|
+
},
|
|
1778
|
+
get size() {
|
|
1779
|
+
return log.size;
|
|
1780
|
+
},
|
|
1781
|
+
get lastValue() {
|
|
1782
|
+
return log.lastValue;
|
|
1783
|
+
},
|
|
1784
|
+
get mutationLog() {
|
|
1785
|
+
return log.mutationLog;
|
|
1786
|
+
},
|
|
1787
|
+
at: log.at.bind(log),
|
|
1788
|
+
withLatest: log.withLatest.bind(log),
|
|
1789
|
+
view: log.view.bind(log),
|
|
1790
|
+
scan: log.scan.bind(log)
|
|
1791
|
+
});
|
|
1792
|
+
}
|
|
1713
1793
|
function deepFreeze(value) {
|
|
1714
1794
|
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
1715
1795
|
for (const k of Object.keys(value)) {
|
|
@@ -3174,8 +3254,10 @@ function promptNode(adapter, deps, prompt, opts) {
|
|
|
3174
3254
|
} catch (err) {
|
|
3175
3255
|
done = true;
|
|
3176
3256
|
actions.down([[import_core15.ERROR, err]]);
|
|
3177
|
-
return
|
|
3178
|
-
|
|
3257
|
+
return {
|
|
3258
|
+
onDeactivation: () => {
|
|
3259
|
+
abortDispose?.();
|
|
3260
|
+
}
|
|
3179
3261
|
};
|
|
3180
3262
|
}
|
|
3181
3263
|
const callNode = (0, import_extra12.fromAny)(invokeResult);
|
|
@@ -3233,11 +3315,13 @@ function promptNode(adapter, deps, prompt, opts) {
|
|
|
3233
3315
|
}
|
|
3234
3316
|
}
|
|
3235
3317
|
});
|
|
3236
|
-
return
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3318
|
+
return {
|
|
3319
|
+
onDeactivation: () => {
|
|
3320
|
+
cancelled = true;
|
|
3321
|
+
sub();
|
|
3322
|
+
abortDispose?.();
|
|
3323
|
+
abortDispose = void 0;
|
|
3324
|
+
}
|
|
3241
3325
|
};
|
|
3242
3326
|
},
|
|
3243
3327
|
{
|
|
@@ -3542,7 +3626,7 @@ function withStatus(src, options) {
|
|
|
3542
3626
|
} else a.down([m]);
|
|
3543
3627
|
}
|
|
3544
3628
|
});
|
|
3545
|
-
return unsub;
|
|
3629
|
+
return { onDeactivation: unsub };
|
|
3546
3630
|
},
|
|
3547
3631
|
{
|
|
3548
3632
|
...operatorOpts(),
|
|
@@ -3767,7 +3851,7 @@ function withBreaker(breaker, options) {
|
|
|
3767
3851
|
}
|
|
3768
3852
|
});
|
|
3769
3853
|
syncState();
|
|
3770
|
-
return unsub;
|
|
3854
|
+
return { onDeactivation: unsub };
|
|
3771
3855
|
},
|
|
3772
3856
|
{
|
|
3773
3857
|
...operatorOpts(),
|
|
@@ -3909,8 +3993,10 @@ function budgetGate(source, constraints, opts) {
|
|
|
3909
3993
|
})
|
|
3910
3994
|
);
|
|
3911
3995
|
}
|
|
3912
|
-
return
|
|
3913
|
-
|
|
3996
|
+
return {
|
|
3997
|
+
onDeactivation: () => {
|
|
3998
|
+
for (const u of unsubs) u();
|
|
3999
|
+
}
|
|
3914
4000
|
};
|
|
3915
4001
|
},
|
|
3916
4002
|
{
|
|
@@ -4040,9 +4126,11 @@ function fallback(source, fb, options) {
|
|
|
4040
4126
|
} else a.down([m]);
|
|
4041
4127
|
}
|
|
4042
4128
|
});
|
|
4043
|
-
return
|
|
4044
|
-
|
|
4045
|
-
|
|
4129
|
+
return {
|
|
4130
|
+
onDeactivation: () => {
|
|
4131
|
+
sourceUnsub?.();
|
|
4132
|
+
fallbackUnsub?.();
|
|
4133
|
+
}
|
|
4046
4134
|
};
|
|
4047
4135
|
},
|
|
4048
4136
|
{
|
|
@@ -4107,31 +4195,40 @@ var RATE_LIMITER_INITIAL_STATE = Object.freeze({
|
|
|
4107
4195
|
pendingCount: 0,
|
|
4108
4196
|
paused: false
|
|
4109
4197
|
});
|
|
4198
|
+
function validateRateLimiterOpts(o) {
|
|
4199
|
+
if (o.maxEvents <= 0) throw new RangeError("maxEvents must be > 0");
|
|
4200
|
+
if (o.windowNs <= 0) throw new RangeError("windowNs must be > 0");
|
|
4201
|
+
if (o.maxBuffer === void 0) {
|
|
4202
|
+
throw new RangeError(
|
|
4203
|
+
"rateLimiter requires explicit maxBuffer (use Infinity to opt in to unbounded)"
|
|
4204
|
+
);
|
|
4205
|
+
}
|
|
4206
|
+
const isUnbounded = o.maxBuffer === Infinity;
|
|
4207
|
+
if (!isUnbounded && (!Number.isInteger(o.maxBuffer) || o.maxBuffer < 1)) {
|
|
4208
|
+
throw new RangeError("maxBuffer must be a positive integer (or Infinity for unbounded)");
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
function resolveInitialReactiveOpts(optsNode) {
|
|
4212
|
+
const cached = optsNode.cache;
|
|
4213
|
+
if (cached === void 0) {
|
|
4214
|
+
throw new RangeError(
|
|
4215
|
+
"rateLimiter: reactive (Node-form) opts must carry a cached value at construction \u2014 seed the opts Node with `initial`. Mode (bounded vs unbounded) and the initial cap are LOCKED from `.cache` at construction and the swap handler rejects mode toggles; an un-seeded Node would silently lock bounded `maxBuffer: 1` (D4)."
|
|
4216
|
+
);
|
|
4217
|
+
}
|
|
4218
|
+
return cached;
|
|
4219
|
+
}
|
|
4110
4220
|
function rateLimiter(source, opts) {
|
|
4111
4221
|
const isReactive = isNode(opts);
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
if (o.windowNs <= 0) throw new RangeError("windowNs must be > 0");
|
|
4116
|
-
if (o.maxBuffer === void 0) {
|
|
4117
|
-
throw new RangeError(
|
|
4118
|
-
"rateLimiter requires explicit maxBuffer (use Infinity to opt in to unbounded)"
|
|
4119
|
-
);
|
|
4120
|
-
}
|
|
4121
|
-
const isUnbounded0 = o.maxBuffer === Infinity;
|
|
4122
|
-
if (!isUnbounded0 && (!Number.isInteger(o.maxBuffer) || o.maxBuffer < 1)) {
|
|
4123
|
-
throw new RangeError("maxBuffer must be a positive integer (or Infinity for unbounded)");
|
|
4124
|
-
}
|
|
4125
|
-
}
|
|
4126
|
-
const initialOpts = isReactive ? opts.cache : opts;
|
|
4127
|
-
const initialMaxBuffer = initialOpts?.maxBuffer;
|
|
4222
|
+
const initialOpts = isReactive ? resolveInitialReactiveOpts(opts) : opts;
|
|
4223
|
+
validateRateLimiterOpts(initialOpts);
|
|
4224
|
+
const initialMaxBuffer = initialOpts.maxBuffer;
|
|
4128
4225
|
const isUnbounded = initialMaxBuffer === Infinity;
|
|
4129
4226
|
const out = (0, import_core22.node)(
|
|
4130
4227
|
(_data, a) => {
|
|
4131
|
-
let maxEvents = initialOpts
|
|
4132
|
-
let windowNs = initialOpts
|
|
4133
|
-
let maxBuffer = initialMaxBuffer
|
|
4134
|
-
let onOverflow = initialOpts
|
|
4228
|
+
let maxEvents = initialOpts.maxEvents;
|
|
4229
|
+
let windowNs = initialOpts.windowNs;
|
|
4230
|
+
let maxBuffer = initialMaxBuffer;
|
|
4231
|
+
let onOverflow = initialOpts.onOverflow ?? "drop-newest";
|
|
4135
4232
|
let refillPerSec = maxEvents * NS_PER_SEC / windowNs;
|
|
4136
4233
|
let tokenTimeNs = NS_PER_SEC / refillPerSec;
|
|
4137
4234
|
let bucket = tokenBucket(maxEvents, refillPerSec);
|
|
@@ -4254,11 +4351,13 @@ function rateLimiter(source, opts) {
|
|
|
4254
4351
|
} else a.down([m]);
|
|
4255
4352
|
}
|
|
4256
4353
|
});
|
|
4257
|
-
return
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4354
|
+
return {
|
|
4355
|
+
onDeactivation: () => {
|
|
4356
|
+
terminated = true;
|
|
4357
|
+
timer.cancel();
|
|
4358
|
+
unsub();
|
|
4359
|
+
optMirror.unsub();
|
|
4360
|
+
}
|
|
4262
4361
|
};
|
|
4263
4362
|
},
|
|
4264
4363
|
{
|
|
@@ -4958,6 +5057,10 @@ var PipelineGraph = class extends import_graph9.Graph {
|
|
|
4958
5057
|
{
|
|
4959
5058
|
name,
|
|
4960
5059
|
describeKind: "derived",
|
|
5060
|
+
// Spec §2.7 R2.7.1 (DS-2.7.A). fn must fire on
|
|
5061
|
+
// upstream-COMPLETE/ERROR-only-without-DATA so the
|
|
5062
|
+
// teardown-decision record + downstream terminal forward run.
|
|
5063
|
+
terminalAsRealInput: true,
|
|
4961
5064
|
meta: meta("approval_gate", opts.meta)
|
|
4962
5065
|
}
|
|
4963
5066
|
);
|
|
@@ -5175,6 +5278,11 @@ var PipelineGraph = class extends import_graph9.Graph {
|
|
|
5175
5278
|
describeKind: "derived",
|
|
5176
5279
|
completeWhenDepsComplete: opts.completeWhenDepsComplete ?? !(mode === "completed" || mode === "terminal"),
|
|
5177
5280
|
errorWhenDepsError: !(mode === "errored" || mode === "terminal"),
|
|
5281
|
+
// Spec §2.7 R2.7.1 (DS-2.7.A). `catch` exists to fire on a
|
|
5282
|
+
// source terminal — its whole job is `recover(cause, …)` on a
|
|
5283
|
+
// terminal-only wave. Without this opt-in the gate holds and
|
|
5284
|
+
// the recover branch never runs.
|
|
5285
|
+
terminalAsRealInput: true,
|
|
5178
5286
|
meta: meta("catch", opts.meta)
|
|
5179
5287
|
}
|
|
5180
5288
|
);
|
|
@@ -5377,7 +5485,10 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
5377
5485
|
depth;
|
|
5378
5486
|
/** Audit log of every queue mutation (Audit 2). */
|
|
5379
5487
|
events;
|
|
5380
|
-
/**
|
|
5488
|
+
/**
|
|
5489
|
+
* Read-only view of {@link JobQueueGraph.events} — Audit 2 `.audit`
|
|
5490
|
+
* duplication; M7 (cannot mutate the canonical log via the alias).
|
|
5491
|
+
*/
|
|
5381
5492
|
audit;
|
|
5382
5493
|
// Tier 8 / COMPOSITION-GUIDE §35: mutate wrappers for the four
|
|
5383
5494
|
// single-record mutation methods. Assigned in the constructor (NOT via
|
|
@@ -5418,7 +5529,7 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
5418
5529
|
retainedLimit: 1024,
|
|
5419
5530
|
graph: this
|
|
5420
5531
|
});
|
|
5421
|
-
this.audit = this.events;
|
|
5532
|
+
this.audit = readonlyAuditLog(this.events);
|
|
5422
5533
|
this._seqCursor = registerCursor(this, "seq", 0);
|
|
5423
5534
|
this._enqueueImpl = mutate(
|
|
5424
5535
|
(payload, enqueueOpts) => {
|
|
@@ -5471,7 +5582,7 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
5471
5582
|
}
|
|
5472
5583
|
);
|
|
5473
5584
|
this._nackImpl = mutate(
|
|
5474
|
-
(id, job, requeue) => {
|
|
5585
|
+
(id, job, requeue, _error) => {
|
|
5475
5586
|
if (requeue) {
|
|
5476
5587
|
this._jobs.set(id, { ...job, state: "queued" });
|
|
5477
5588
|
this._pending.append(id);
|
|
@@ -5484,12 +5595,16 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
5484
5595
|
log: this.events,
|
|
5485
5596
|
seq: this._seqCursor,
|
|
5486
5597
|
freeze: false,
|
|
5487
|
-
onSuccessRecord: ([id, job], _r, { t_ns, seq }) => ({
|
|
5598
|
+
onSuccessRecord: ([id, job, requeue, error], _r, { t_ns, seq }) => ({
|
|
5488
5599
|
action: "nack",
|
|
5489
5600
|
id,
|
|
5490
5601
|
attempts: job.attempts,
|
|
5491
5602
|
t_ns,
|
|
5492
|
-
seq: seq ?? 0
|
|
5603
|
+
seq: seq ?? 0,
|
|
5604
|
+
// F-CATCH D-3: surface the failure cause on the no-requeue
|
|
5605
|
+
// (terminal-failure) nack only. A requeue nack is a retry,
|
|
5606
|
+
// not a failure, so it carries no error.
|
|
5607
|
+
...!requeue && error !== void 0 ? { error } : {}
|
|
5493
5608
|
})
|
|
5494
5609
|
}
|
|
5495
5610
|
);
|
|
@@ -5561,10 +5676,20 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
5561
5676
|
this._ackImpl(id, job);
|
|
5562
5677
|
return true;
|
|
5563
5678
|
}
|
|
5679
|
+
/**
|
|
5680
|
+
* Negatively-acknowledge an inflight job.
|
|
5681
|
+
*
|
|
5682
|
+
* @param opts.requeue - `true` (default) returns the job to the queue for
|
|
5683
|
+
* retry; `false` drops it permanently (terminal failure).
|
|
5684
|
+
* @param opts.error - Optional failure cause for a `requeue: false` nack.
|
|
5685
|
+
* Recorded on the emitted `"nack"` {@link JobEvent} as `error` so the
|
|
5686
|
+
* reason a job failed is recoverable from the event stream (F-CATCH
|
|
5687
|
+
* D-3). Ignored when `requeue` is `true` (a retry is not a failure).
|
|
5688
|
+
*/
|
|
5564
5689
|
nack(id, opts = {}) {
|
|
5565
5690
|
const job = this._jobs.get(id);
|
|
5566
5691
|
if (!job || job.state !== "inflight") return false;
|
|
5567
|
-
this._nackImpl(id, job, opts.requeue ?? true);
|
|
5692
|
+
this._nackImpl(id, job, opts.requeue ?? true, opts.error);
|
|
5568
5693
|
return true;
|
|
5569
5694
|
}
|
|
5570
5695
|
/**
|
|
@@ -5730,10 +5855,10 @@ var JobFlowGraph = class extends import_graph11.Graph {
|
|
|
5730
5855
|
let result;
|
|
5731
5856
|
try {
|
|
5732
5857
|
result = workFn(job, { signal: ac.signal });
|
|
5733
|
-
} catch {
|
|
5858
|
+
} catch (err) {
|
|
5734
5859
|
inflight.delete(entry);
|
|
5735
5860
|
inflightCounter?.emit(inflight.size);
|
|
5736
|
-
current.nack(job.id, { requeue: false });
|
|
5861
|
+
current.nack(job.id, { requeue: false, error: err });
|
|
5737
5862
|
processed += 1;
|
|
5738
5863
|
continue;
|
|
5739
5864
|
}
|
|
@@ -5784,7 +5909,7 @@ var JobFlowGraph = class extends import_graph11.Graph {
|
|
|
5784
5909
|
} else if (m[0] === import_core26.ERROR) {
|
|
5785
5910
|
settled = true;
|
|
5786
5911
|
cleanupSub();
|
|
5787
|
-
current.nack(job.id, { requeue: false });
|
|
5912
|
+
current.nack(job.id, { requeue: false, error: m[1] });
|
|
5788
5913
|
return;
|
|
5789
5914
|
}
|
|
5790
5915
|
}
|
|
@@ -6040,7 +6165,18 @@ var HarnessGraph = class extends import_graph12.Graph {
|
|
|
6040
6165
|
* (use {@link unrouted}), and the internal `triage-output` fan-in.
|
|
6041
6166
|
*/
|
|
6042
6167
|
queueTopics;
|
|
6043
|
-
/**
|
|
6168
|
+
/**
|
|
6169
|
+
* Strategy model — `auditedSuccessTracker` keyed by `StrategyKey`.
|
|
6170
|
+
*
|
|
6171
|
+
* **Ownership (EC10/EC15).** Owned by the harness: it is mounted as a
|
|
6172
|
+
* child subgraph (`harness.mount("strategy", strategy)`), so its disposal
|
|
6173
|
+
* cascades from `harness.destroy()` via the mount lifecycle. Do **not**
|
|
6174
|
+
* call `strategy.destroy()` independently — the harness's `triage-input`
|
|
6175
|
+
* node and (when `opts.priority` is set) `buildPriorityScores` hold
|
|
6176
|
+
* cross-graph deps on `strategy.entries`; destroying the strategy out of
|
|
6177
|
+
* band staleness those nodes while the rest of the loop keeps running.
|
|
6178
|
+
* Read/subscribe freely; let the harness own the lifecycle.
|
|
6179
|
+
*/
|
|
6044
6180
|
strategy;
|
|
6045
6181
|
/** Global retry count across all items (circuit breaker). Reactive — subscribable. */
|
|
6046
6182
|
totalRetries;
|
|
@@ -6502,6 +6638,16 @@ var import_core28 = require("@graphrefly/pure-ts/core");
|
|
|
6502
6638
|
var import_extra19 = require("@graphrefly/pure-ts/extra");
|
|
6503
6639
|
var import_graph13 = require("@graphrefly/pure-ts/graph");
|
|
6504
6640
|
var RefineLoopGraph = class extends import_graph13.Graph {
|
|
6641
|
+
/**
|
|
6642
|
+
* Best candidate so far. **SENTINEL until the first iteration settles** —
|
|
6643
|
+
* `loop.best.cache` is `undefined` (not `null`) before any iteration
|
|
6644
|
+
* produces a best, and a degenerate empty-candidate iteration leaves the
|
|
6645
|
+
* prior best in place rather than wiping it. Consumers guard with
|
|
6646
|
+
* `=== undefined` (spec §3 SENTINEL), not `== null`. (Anti-pattern sweep
|
|
6647
|
+
* 2026-05-18: dropped the `initial: null` eager-placeholder; `null` is
|
|
6648
|
+
* reserved for the per-iteration {@link Iteration.best} data field where an
|
|
6649
|
+
* empty batch is a valid domain value.)
|
|
6650
|
+
*/
|
|
6505
6651
|
best;
|
|
6506
6652
|
/**
|
|
6507
6653
|
* Best score so far. Pseudo-private (`_score`) to avoid colliding with any
|
|
@@ -6552,8 +6698,7 @@ var RefineLoopGraph = class extends import_graph13.Graph {
|
|
|
6552
6698
|
});
|
|
6553
6699
|
this.add(strategyNode, { name: "strategy" });
|
|
6554
6700
|
const lastFeedbackState = (0, import_core28.node)([], {
|
|
6555
|
-
name: "lastFeedback"
|
|
6556
|
-
initial: null
|
|
6701
|
+
name: "lastFeedback"
|
|
6557
6702
|
});
|
|
6558
6703
|
this.add(lastFeedbackState, { name: "lastFeedback" });
|
|
6559
6704
|
const prevCandidatesState = (0, import_core28.node)([], {
|
|
@@ -6572,7 +6717,7 @@ var RefineLoopGraph = class extends import_graph13.Graph {
|
|
|
6572
6717
|
// append-style; reactive consumers want every push
|
|
6573
6718
|
});
|
|
6574
6719
|
this.add(historyState, { name: "history" });
|
|
6575
|
-
const bestState = (0, import_core28.node)([], { name: "best"
|
|
6720
|
+
const bestState = (0, import_core28.node)([], { name: "best" });
|
|
6576
6721
|
this.add(bestState, { name: "best" });
|
|
6577
6722
|
const scoreState = (0, import_core28.node)([], { name: "score", initial: Number.NEGATIVE_INFINITY });
|
|
6578
6723
|
this.add(scoreState, { name: "score" });
|
|
@@ -6596,7 +6741,7 @@ var RefineLoopGraph = class extends import_graph13.Graph {
|
|
|
6596
6741
|
this.decide = hubDecideTopic;
|
|
6597
6742
|
this._pauseState = pauseState;
|
|
6598
6743
|
let latestStrategy = initialStrategy;
|
|
6599
|
-
let latestFeedback
|
|
6744
|
+
let latestFeedback;
|
|
6600
6745
|
let latestPrevCandidates = [];
|
|
6601
6746
|
this.addDisposer(
|
|
6602
6747
|
strategyNode.subscribe((msgs) => {
|
|
@@ -6617,7 +6762,7 @@ var RefineLoopGraph = class extends import_graph13.Graph {
|
|
|
6617
6762
|
iterationTrigger,
|
|
6618
6763
|
(iter) => {
|
|
6619
6764
|
const strat = latestStrategy;
|
|
6620
|
-
const isSeed = iter === 0 || latestFeedback
|
|
6765
|
+
const isSeed = iter === 0 || latestFeedback === void 0;
|
|
6621
6766
|
return (0, import_core28.node)(
|
|
6622
6767
|
[],
|
|
6623
6768
|
(_data, actions) => {
|
|
@@ -6633,8 +6778,10 @@ var RefineLoopGraph = class extends import_graph13.Graph {
|
|
|
6633
6778
|
if (!cancelled) actions.down([[import_core28.ERROR, err]]);
|
|
6634
6779
|
}
|
|
6635
6780
|
);
|
|
6636
|
-
return
|
|
6637
|
-
|
|
6781
|
+
return {
|
|
6782
|
+
onDeactivation: () => {
|
|
6783
|
+
cancelled = true;
|
|
6784
|
+
}
|
|
6638
6785
|
};
|
|
6639
6786
|
}
|
|
6640
6787
|
actions.emit({ iter, items: result });
|
|
@@ -7007,7 +7154,7 @@ var RefineLoopGraph = class extends import_graph13.Graph {
|
|
|
7007
7154
|
decision = "paused";
|
|
7008
7155
|
}
|
|
7009
7156
|
(0, import_core28.batch)(() => {
|
|
7010
|
-
bestState.emit(best);
|
|
7157
|
+
if (best !== null) bestState.emit(best);
|
|
7011
7158
|
scoreState.emit(fb.score);
|
|
7012
7159
|
historyState.emit(nextHistory);
|
|
7013
7160
|
budgetState.emit(nextBudget);
|
|
@@ -7899,11 +8046,12 @@ var GuardedExecutionGraph = class extends import_graph17.Graph {
|
|
|
7899
8046
|
this.addDisposer((0, import_extra24.keepalive)(this.scope));
|
|
7900
8047
|
const scopedHandle = target.describe({
|
|
7901
8048
|
reactive: true,
|
|
7902
|
-
// F8 (
|
|
7903
|
-
//
|
|
7904
|
-
//
|
|
7905
|
-
// (full visibility)
|
|
7906
|
-
//
|
|
8049
|
+
// F8 (resolved 2026-05-18): `GraphDescribeOptions.actor` is now
|
|
8050
|
+
// `Actor | Node<Actor | null>`, so `_actorNode` (a
|
|
8051
|
+
// `Node<Actor | null>`) passes without a cast. A `null`/`undefined`
|
|
8052
|
+
// cache resolves to "no scoping" (full visibility) per
|
|
8053
|
+
// `resolveActorOption`. See graph.ts § "Cache-undefined/null
|
|
8054
|
+
// semantics".
|
|
7907
8055
|
actor: this._actorNode,
|
|
7908
8056
|
reactiveName: "scopedDescribe"
|
|
7909
8057
|
});
|
|
@@ -7949,11 +8097,11 @@ var GuardedExecutionGraph = class extends import_graph17.Graph {
|
|
|
7949
8097
|
const actorNode = actorOverride == null ? this._actorNode : isNode4(actorOverride) ? actorOverride : (0, import_core32.node)([], { name: "actor_override", initial: actorOverride });
|
|
7950
8098
|
const handle = this._target.describe({
|
|
7951
8099
|
reactive: true,
|
|
7952
|
-
// `
|
|
7953
|
-
//
|
|
7954
|
-
// `
|
|
7955
|
-
//
|
|
7956
|
-
//
|
|
8100
|
+
// F8 (resolved 2026-05-18): `actor` accepts `Node<Actor | null>`
|
|
8101
|
+
// directly. `actorNode` is `_actorNode` (`Node<Actor | null>`) or
|
|
8102
|
+
// an override (`Node<Actor>`/`Node<Actor | null>`); both assign
|
|
8103
|
+
// without a cast. `_describeReactive` resolves via
|
|
8104
|
+
// `resolveActorOption` (null/undefined cache → no scoping).
|
|
7957
8105
|
actor: actorNode,
|
|
7958
8106
|
...opts ?? {}
|
|
7959
8107
|
});
|
|
@@ -8054,7 +8202,6 @@ var ResilientPipelineGraph = class extends import_graph18.Graph {
|
|
|
8054
8202
|
} else {
|
|
8055
8203
|
const rateOpts = {
|
|
8056
8204
|
...opts.rateLimit,
|
|
8057
|
-
maxBuffer: opts.rateLimit.maxBuffer ?? Infinity,
|
|
8058
8205
|
meta: domainMeta("resilient", "rate-limit")
|
|
8059
8206
|
};
|
|
8060
8207
|
const bundle = rateLimiter(current, rateOpts);
|