@graphrefly/graphrefly 0.47.2 → 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 +4 -3
- 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 +8 -8
- package/dist/base/index.cjs +152 -78
- 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 +75 -70
- package/dist/base/io/index.cjs +31 -17
- 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 +1 -1
- 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 +5 -3
- 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 +5 -3
- package/dist/base/sources/browser/index.js.map +1 -1
- package/dist/base/sources/event/index.cjs +28 -0
- 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 +4 -1
- package/dist/base/sources/index.cjs +75 -37
- 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 +5 -2
- package/dist/{chunk-R6ZCSXKX.js → chunk-23MAWVOJ.js} +3 -3
- package/dist/{chunk-MS3WPRJR.js → chunk-3REMCHSS.js} +6 -6
- 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-6ZLCPUXS.js → chunk-46X2EFQH.js} +15 -4
- 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-FQSQONOU.js → chunk-65OM4XLQ.js} +49 -3
- 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-3O3NKZJW.js → chunk-7T7WLEPM.js} +24 -3
- 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-6MRSX3YK.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-VP3TIUDF.js → chunk-DVTDF5OI.js} +2 -2
- package/dist/{chunk-OXD5LFQP.js → chunk-G7H6PN7P.js} +2 -2
- package/dist/{chunk-EL5VHUGK.js → chunk-GGKHHG5Y.js} +32 -18
- package/dist/chunk-GGKHHG5Y.js.map +1 -0
- package/dist/{chunk-446I4EGD.js → chunk-J5TBZFBD.js} +2 -2
- package/dist/{chunk-7AVQIGF6.js → chunk-K4ZYJ4EM.js} +554 -460
- package/dist/chunk-K4ZYJ4EM.js.map +1 -0
- package/dist/{chunk-QFE5BQH7.js → chunk-LTSI7ULC.js} +2 -2
- package/dist/{chunk-5GVURVIG.js → chunk-MMHGYX44.js} +12 -2
- package/dist/{chunk-5GVURVIG.js.map → chunk-MMHGYX44.js.map} +1 -1
- package/dist/{chunk-KRFGO5QH.js → chunk-MQMTRKY3.js} +118 -43
- 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-FVINAAKA.js → chunk-NBK6QQMG.js} +14 -13
- package/dist/{chunk-FVINAAKA.js.map → chunk-NBK6QQMG.js.map} +1 -1
- package/dist/{chunk-KNU73RZW.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-VAZXUK6G.js → chunk-SUNCHMML.js} +2 -2
- package/dist/{chunk-EP4WVQLX.js → chunk-T2U6N3FV.js} +6 -6
- package/dist/{chunk-T7SP3EYR.js → chunk-T5URUIIY.js} +33 -24
- package/dist/chunk-T5URUIIY.js.map +1 -0
- package/dist/{chunk-VNXAF2KE.js → chunk-TPTZZV25.js} +6 -6
- package/dist/chunk-TPTZZV25.js.map +1 -0
- package/dist/{chunk-IOJDYUA7.js → chunk-V46JWFGV.js} +6 -5
- package/dist/chunk-V46JWFGV.js.map +1 -0
- package/dist/{chunk-WGDEBIP4.js → chunk-X6ESZDR6.js} +5 -6
- package/dist/chunk-X6ESZDR6.js.map +1 -0
- package/dist/{chunk-N65E26UL.js → chunk-XEWV254I.js} +2 -2
- package/dist/{chunk-N65E26UL.js.map → chunk-XEWV254I.js.map} +1 -1
- package/dist/{chunk-PTWADEH3.js → chunk-YBJVKMTM.js} +34 -14
- package/dist/chunk-YBJVKMTM.js.map +1 -0
- package/dist/{chunk-DDTS7F5O.js → chunk-ZW32BPXV.js} +12 -3
- package/dist/chunk-ZW32BPXV.js.map +1 -0
- package/dist/compat/index.cjs +51 -4
- 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 +6 -6
- package/dist/compat/nestjs/index.cjs +51 -4
- 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 +3 -3
- 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 +2215 -1676
- 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 +169 -146
- package/dist/index.js.map +1 -1
- package/dist/presets/ai/index.cjs +46 -0
- package/dist/presets/ai/index.cjs.map +1 -1
- package/dist/presets/ai/index.js +12 -12
- package/dist/presets/harness/index.cjs +130 -18
- 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 +22 -22
- package/dist/presets/index.cjs +222 -53
- 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 +45 -45
- 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 +29 -21
- 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 +3 -3
- 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 +168 -47
- 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 +28 -28
- 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/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 +6 -6
- package/dist/utils/ai/browser.js.map +1 -1
- package/dist/utils/ai/index.cjs +250 -166
- 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 +21 -19
- 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 +2 -2
- 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.map +1 -1
- package/dist/utils/domain-templates/index.js +3 -3
- package/dist/utils/graphspec/index.cjs.map +1 -1
- package/dist/utils/graphspec/index.js +3 -3
- package/dist/utils/index.cjs +1642 -1225
- 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 +72 -54
- 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 +556 -462
- package/dist/utils/memory/index.cjs.map +1 -1
- package/dist/utils/memory/index.d.cts +203 -24
- package/dist/utils/memory/index.d.ts +203 -24
- 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 +9 -0
- 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 +2 -2
- 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.map +1 -1
- package/dist/utils/reduction/index.js +2 -2
- package/dist/utils/resilience/index.cjs +29 -20
- 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 +2 -2
- 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-3O3NKZJW.js.map +0 -1
- 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-6ZLCPUXS.js.map +0 -1
- package/dist/chunk-7AVQIGF6.js.map +0 -1
- package/dist/chunk-BXGZFGZ4.js.map +0 -1
- package/dist/chunk-DDTS7F5O.js.map +0 -1
- package/dist/chunk-EL5VHUGK.js.map +0 -1
- package/dist/chunk-FQSQONOU.js.map +0 -1
- package/dist/chunk-IOJDYUA7.js.map +0 -1
- package/dist/chunk-KRFGO5QH.js.map +0 -1
- package/dist/chunk-MS3WPRJR.js.map +0 -1
- package/dist/chunk-NPRP3MCV.js.map +0 -1
- package/dist/chunk-NY2PYHNC.js.map +0 -1
- package/dist/chunk-PKPO3JTZ.js.map +0 -1
- package/dist/chunk-PTWADEH3.js.map +0 -1
- package/dist/chunk-T7SP3EYR.js.map +0 -1
- package/dist/chunk-VNXAF2KE.js.map +0 -1
- package/dist/chunk-W2BOPXTI.js +0 -1
- package/dist/chunk-W2BOPXTI.js.map +0 -1
- package/dist/chunk-WGDEBIP4.js.map +0 -1
- /package/dist/{chunk-R6ZCSXKX.js.map → chunk-23MAWVOJ.js.map} +0 -0
- /package/dist/{chunk-6MRSX3YK.js.map → chunk-B5Y5GPD5.js.map} +0 -0
- /package/dist/{chunk-VP3TIUDF.js.map → chunk-DVTDF5OI.js.map} +0 -0
- /package/dist/{chunk-OXD5LFQP.js.map → chunk-G7H6PN7P.js.map} +0 -0
- /package/dist/{chunk-446I4EGD.js.map → chunk-J5TBZFBD.js.map} +0 -0
- /package/dist/{chunk-QFE5BQH7.js.map → chunk-LTSI7ULC.js.map} +0 -0
- /package/dist/{chunk-KNU73RZW.js.map → chunk-NSA5K5G2.js.map} +0 -0
- /package/dist/{chunk-MLTPJMH6.js.map → chunk-QQYULEZL.js.map} +0 -0
- /package/dist/{chunk-VAZXUK6G.js.map → chunk-SUNCHMML.js.map} +0 -0
- /package/dist/{chunk-EP4WVQLX.js.map → chunk-T2U6N3FV.js.map} +0 -0
package/dist/presets/ai/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
renderContextView,
|
|
8
8
|
taggedContextPool,
|
|
9
9
|
tierCompress
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-DVTDF5OI.js";
|
|
11
11
|
import {
|
|
12
12
|
AgentMemoryGraph,
|
|
13
13
|
agentMemory
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-23MAWVOJ.js";
|
|
15
15
|
import {
|
|
16
16
|
AgentGraph,
|
|
17
17
|
AgentLoopGraph,
|
|
@@ -20,19 +20,19 @@ import {
|
|
|
20
20
|
agent,
|
|
21
21
|
agentLoop,
|
|
22
22
|
presetRegistry
|
|
23
|
-
} from "../../chunk-
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-QMBYUVRL.js";
|
|
28
|
-
import "../../chunk-FMPF42Q4.js";
|
|
29
|
-
import "../../chunk-BXGZFGZ4.js";
|
|
30
|
-
import "../../chunk-OXD5LFQP.js";
|
|
31
|
-
import "../../chunk-5GVURVIG.js";
|
|
32
|
-
import "../../chunk-N6MNJNHB.js";
|
|
23
|
+
} from "../../chunk-65OM4XLQ.js";
|
|
24
|
+
import "../../chunk-3REMCHSS.js";
|
|
25
|
+
import "../../chunk-K4ZYJ4EM.js";
|
|
26
|
+
import "../../chunk-DHDCOOJU.js";
|
|
33
27
|
import "../../chunk-KUFXLAEY.js";
|
|
34
28
|
import "../../chunk-TSBFTJKM.js";
|
|
35
29
|
import "../../chunk-P5LBT622.js";
|
|
30
|
+
import "../../chunk-QMBYUVRL.js";
|
|
31
|
+
import "../../chunk-FMPF42Q4.js";
|
|
32
|
+
import "../../chunk-C5QD5DQX.js";
|
|
33
|
+
import "../../chunk-G7H6PN7P.js";
|
|
34
|
+
import "../../chunk-MMHGYX44.js";
|
|
35
|
+
import "../../chunk-N6MNJNHB.js";
|
|
36
36
|
import "../../chunk-AZDQPQ3V.js";
|
|
37
37
|
export {
|
|
38
38
|
AgentGraph,
|
|
@@ -682,7 +682,7 @@ function actorPool(parent, opts = {}) {
|
|
|
682
682
|
const name = opts.name ?? `actorPool-${++_actorPoolSeq}`;
|
|
683
683
|
const graph = new import_graph2.Graph(name);
|
|
684
684
|
parent.mount(name, graph);
|
|
685
|
-
const depthCap = opts.depthCap ??
|
|
685
|
+
const depthCap = opts.depthCap ?? 8;
|
|
686
686
|
let autoActor = 0;
|
|
687
687
|
const liveHandles = /* @__PURE__ */ new Set();
|
|
688
688
|
const contextPool = taggedContextPool(graph, {
|
|
@@ -814,6 +814,26 @@ function createAuditLog(opts) {
|
|
|
814
814
|
}
|
|
815
815
|
return log;
|
|
816
816
|
}
|
|
817
|
+
function readonlyAuditLog(log) {
|
|
818
|
+
return Object.freeze({
|
|
819
|
+
get entries() {
|
|
820
|
+
return log.entries;
|
|
821
|
+
},
|
|
822
|
+
get size() {
|
|
823
|
+
return log.size;
|
|
824
|
+
},
|
|
825
|
+
get lastValue() {
|
|
826
|
+
return log.lastValue;
|
|
827
|
+
},
|
|
828
|
+
get mutationLog() {
|
|
829
|
+
return log.mutationLog;
|
|
830
|
+
},
|
|
831
|
+
at: log.at.bind(log),
|
|
832
|
+
withLatest: log.withLatest.bind(log),
|
|
833
|
+
view: log.view.bind(log),
|
|
834
|
+
scan: log.scan.bind(log)
|
|
835
|
+
});
|
|
836
|
+
}
|
|
817
837
|
function deepFreeze(value) {
|
|
818
838
|
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
819
839
|
for (const k of Object.keys(value)) {
|
|
@@ -1400,6 +1420,16 @@ function topicBridge(name, sourceTopic, targetTopic, opts) {
|
|
|
1400
1420
|
|
|
1401
1421
|
// src/presets/harness/refine-loop.ts
|
|
1402
1422
|
var RefineLoopGraph = class extends import_graph5.Graph {
|
|
1423
|
+
/**
|
|
1424
|
+
* Best candidate so far. **SENTINEL until the first iteration settles** —
|
|
1425
|
+
* `loop.best.cache` is `undefined` (not `null`) before any iteration
|
|
1426
|
+
* produces a best, and a degenerate empty-candidate iteration leaves the
|
|
1427
|
+
* prior best in place rather than wiping it. Consumers guard with
|
|
1428
|
+
* `=== undefined` (spec §3 SENTINEL), not `== null`. (Anti-pattern sweep
|
|
1429
|
+
* 2026-05-18: dropped the `initial: null` eager-placeholder; `null` is
|
|
1430
|
+
* reserved for the per-iteration {@link Iteration.best} data field where an
|
|
1431
|
+
* empty batch is a valid domain value.)
|
|
1432
|
+
*/
|
|
1403
1433
|
best;
|
|
1404
1434
|
/**
|
|
1405
1435
|
* Best score so far. Pseudo-private (`_score`) to avoid colliding with any
|
|
@@ -1450,8 +1480,7 @@ var RefineLoopGraph = class extends import_graph5.Graph {
|
|
|
1450
1480
|
});
|
|
1451
1481
|
this.add(strategyNode, { name: "strategy" });
|
|
1452
1482
|
const lastFeedbackState = (0, import_core6.node)([], {
|
|
1453
|
-
name: "lastFeedback"
|
|
1454
|
-
initial: null
|
|
1483
|
+
name: "lastFeedback"
|
|
1455
1484
|
});
|
|
1456
1485
|
this.add(lastFeedbackState, { name: "lastFeedback" });
|
|
1457
1486
|
const prevCandidatesState = (0, import_core6.node)([], {
|
|
@@ -1470,7 +1499,7 @@ var RefineLoopGraph = class extends import_graph5.Graph {
|
|
|
1470
1499
|
// append-style; reactive consumers want every push
|
|
1471
1500
|
});
|
|
1472
1501
|
this.add(historyState, { name: "history" });
|
|
1473
|
-
const bestState = (0, import_core6.node)([], { name: "best"
|
|
1502
|
+
const bestState = (0, import_core6.node)([], { name: "best" });
|
|
1474
1503
|
this.add(bestState, { name: "best" });
|
|
1475
1504
|
const scoreState = (0, import_core6.node)([], { name: "score", initial: Number.NEGATIVE_INFINITY });
|
|
1476
1505
|
this.add(scoreState, { name: "score" });
|
|
@@ -1494,7 +1523,7 @@ var RefineLoopGraph = class extends import_graph5.Graph {
|
|
|
1494
1523
|
this.decide = hubDecideTopic;
|
|
1495
1524
|
this._pauseState = pauseState;
|
|
1496
1525
|
let latestStrategy = initialStrategy;
|
|
1497
|
-
let latestFeedback
|
|
1526
|
+
let latestFeedback;
|
|
1498
1527
|
let latestPrevCandidates = [];
|
|
1499
1528
|
this.addDisposer(
|
|
1500
1529
|
strategyNode.subscribe((msgs) => {
|
|
@@ -1515,7 +1544,7 @@ var RefineLoopGraph = class extends import_graph5.Graph {
|
|
|
1515
1544
|
iterationTrigger,
|
|
1516
1545
|
(iter) => {
|
|
1517
1546
|
const strat = latestStrategy;
|
|
1518
|
-
const isSeed = iter === 0 || latestFeedback
|
|
1547
|
+
const isSeed = iter === 0 || latestFeedback === void 0;
|
|
1519
1548
|
return (0, import_core6.node)(
|
|
1520
1549
|
[],
|
|
1521
1550
|
(_data, actions) => {
|
|
@@ -1907,7 +1936,7 @@ var RefineLoopGraph = class extends import_graph5.Graph {
|
|
|
1907
1936
|
decision = "paused";
|
|
1908
1937
|
}
|
|
1909
1938
|
(0, import_core6.batch)(() => {
|
|
1910
|
-
bestState.emit(best);
|
|
1939
|
+
if (best !== null) bestState.emit(best);
|
|
1911
1940
|
scoreState.emit(fb.score);
|
|
1912
1941
|
historyState.emit(nextHistory);
|
|
1913
1942
|
budgetState.emit(nextBudget);
|
|
@@ -2147,7 +2176,7 @@ function errorCritique(opts) {
|
|
|
2147
2176
|
function defaultToOutput(result) {
|
|
2148
2177
|
const { best, score, status } = result;
|
|
2149
2178
|
const scoreStr = Number.isFinite(score) ? score.toFixed(3) : String(score);
|
|
2150
|
-
const artifact = best
|
|
2179
|
+
const artifact = best;
|
|
2151
2180
|
if (status === "converged") {
|
|
2152
2181
|
return {
|
|
2153
2182
|
outcome: "success",
|
|
@@ -3085,6 +3114,10 @@ var PipelineGraph = class extends import_graph7.Graph {
|
|
|
3085
3114
|
{
|
|
3086
3115
|
name,
|
|
3087
3116
|
describeKind: "derived",
|
|
3117
|
+
// Spec §2.7 R2.7.1 (DS-2.7.A). fn must fire on
|
|
3118
|
+
// upstream-COMPLETE/ERROR-only-without-DATA so the
|
|
3119
|
+
// teardown-decision record + downstream terminal forward run.
|
|
3120
|
+
terminalAsRealInput: true,
|
|
3088
3121
|
meta: meta("approval_gate", opts.meta)
|
|
3089
3122
|
}
|
|
3090
3123
|
);
|
|
@@ -3302,6 +3335,11 @@ var PipelineGraph = class extends import_graph7.Graph {
|
|
|
3302
3335
|
describeKind: "derived",
|
|
3303
3336
|
completeWhenDepsComplete: opts.completeWhenDepsComplete ?? !(mode === "completed" || mode === "terminal"),
|
|
3304
3337
|
errorWhenDepsError: !(mode === "errored" || mode === "terminal"),
|
|
3338
|
+
// Spec §2.7 R2.7.1 (DS-2.7.A). `catch` exists to fire on a
|
|
3339
|
+
// source terminal — its whole job is `recover(cause, …)` on a
|
|
3340
|
+
// terminal-only wave. Without this opt-in the gate holds and
|
|
3341
|
+
// the recover branch never runs.
|
|
3342
|
+
terminalAsRealInput: true,
|
|
3305
3343
|
meta: meta("catch", opts.meta)
|
|
3306
3344
|
}
|
|
3307
3345
|
);
|
|
@@ -3770,7 +3808,10 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
3770
3808
|
depth;
|
|
3771
3809
|
/** Audit log of every queue mutation (Audit 2). */
|
|
3772
3810
|
events;
|
|
3773
|
-
/**
|
|
3811
|
+
/**
|
|
3812
|
+
* Read-only view of {@link JobQueueGraph.events} — Audit 2 `.audit`
|
|
3813
|
+
* duplication; M7 (cannot mutate the canonical log via the alias).
|
|
3814
|
+
*/
|
|
3774
3815
|
audit;
|
|
3775
3816
|
// Tier 8 / COMPOSITION-GUIDE §35: mutate wrappers for the four
|
|
3776
3817
|
// single-record mutation methods. Assigned in the constructor (NOT via
|
|
@@ -3811,7 +3852,7 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
3811
3852
|
retainedLimit: 1024,
|
|
3812
3853
|
graph: this
|
|
3813
3854
|
});
|
|
3814
|
-
this.audit = this.events;
|
|
3855
|
+
this.audit = readonlyAuditLog(this.events);
|
|
3815
3856
|
this._seqCursor = registerCursor(this, "seq", 0);
|
|
3816
3857
|
this._enqueueImpl = mutate(
|
|
3817
3858
|
(payload, enqueueOpts) => {
|
|
@@ -3864,7 +3905,7 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
3864
3905
|
}
|
|
3865
3906
|
);
|
|
3866
3907
|
this._nackImpl = mutate(
|
|
3867
|
-
(id, job, requeue) => {
|
|
3908
|
+
(id, job, requeue, _error) => {
|
|
3868
3909
|
if (requeue) {
|
|
3869
3910
|
this._jobs.set(id, { ...job, state: "queued" });
|
|
3870
3911
|
this._pending.append(id);
|
|
@@ -3877,12 +3918,16 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
3877
3918
|
log: this.events,
|
|
3878
3919
|
seq: this._seqCursor,
|
|
3879
3920
|
freeze: false,
|
|
3880
|
-
onSuccessRecord: ([id, job], _r, { t_ns, seq }) => ({
|
|
3921
|
+
onSuccessRecord: ([id, job, requeue, error], _r, { t_ns, seq }) => ({
|
|
3881
3922
|
action: "nack",
|
|
3882
3923
|
id,
|
|
3883
3924
|
attempts: job.attempts,
|
|
3884
3925
|
t_ns,
|
|
3885
|
-
seq: seq ?? 0
|
|
3926
|
+
seq: seq ?? 0,
|
|
3927
|
+
// F-CATCH D-3: surface the failure cause on the no-requeue
|
|
3928
|
+
// (terminal-failure) nack only. A requeue nack is a retry,
|
|
3929
|
+
// not a failure, so it carries no error.
|
|
3930
|
+
...!requeue && error !== void 0 ? { error } : {}
|
|
3886
3931
|
})
|
|
3887
3932
|
}
|
|
3888
3933
|
);
|
|
@@ -3954,10 +3999,20 @@ var JobQueueGraph = class extends import_graph11.Graph {
|
|
|
3954
3999
|
this._ackImpl(id, job);
|
|
3955
4000
|
return true;
|
|
3956
4001
|
}
|
|
4002
|
+
/**
|
|
4003
|
+
* Negatively-acknowledge an inflight job.
|
|
4004
|
+
*
|
|
4005
|
+
* @param opts.requeue - `true` (default) returns the job to the queue for
|
|
4006
|
+
* retry; `false` drops it permanently (terminal failure).
|
|
4007
|
+
* @param opts.error - Optional failure cause for a `requeue: false` nack.
|
|
4008
|
+
* Recorded on the emitted `"nack"` {@link JobEvent} as `error` so the
|
|
4009
|
+
* reason a job failed is recoverable from the event stream (F-CATCH
|
|
4010
|
+
* D-3). Ignored when `requeue` is `true` (a retry is not a failure).
|
|
4011
|
+
*/
|
|
3957
4012
|
nack(id, opts = {}) {
|
|
3958
4013
|
const job = this._jobs.get(id);
|
|
3959
4014
|
if (!job || job.state !== "inflight") return false;
|
|
3960
|
-
this._nackImpl(id, job, opts.requeue ?? true);
|
|
4015
|
+
this._nackImpl(id, job, opts.requeue ?? true, opts.error);
|
|
3961
4016
|
return true;
|
|
3962
4017
|
}
|
|
3963
4018
|
/**
|
|
@@ -4123,10 +4178,10 @@ var JobFlowGraph = class extends import_graph11.Graph {
|
|
|
4123
4178
|
let result;
|
|
4124
4179
|
try {
|
|
4125
4180
|
result = workFn(job, { signal: ac.signal });
|
|
4126
|
-
} catch {
|
|
4181
|
+
} catch (err) {
|
|
4127
4182
|
inflight.delete(entry);
|
|
4128
4183
|
inflightCounter?.emit(inflight.size);
|
|
4129
|
-
current.nack(job.id, { requeue: false });
|
|
4184
|
+
current.nack(job.id, { requeue: false, error: err });
|
|
4130
4185
|
processed += 1;
|
|
4131
4186
|
continue;
|
|
4132
4187
|
}
|
|
@@ -4177,7 +4232,7 @@ var JobFlowGraph = class extends import_graph11.Graph {
|
|
|
4177
4232
|
} else if (m[0] === import_core19.ERROR) {
|
|
4178
4233
|
settled = true;
|
|
4179
4234
|
cleanupSub();
|
|
4180
|
-
current.nack(job.id, { requeue: false });
|
|
4235
|
+
current.nack(job.id, { requeue: false, error: m[1] });
|
|
4181
4236
|
return;
|
|
4182
4237
|
}
|
|
4183
4238
|
}
|
|
@@ -4433,7 +4488,18 @@ var HarnessGraph = class extends import_graph12.Graph {
|
|
|
4433
4488
|
* (use {@link unrouted}), and the internal `triage-output` fan-in.
|
|
4434
4489
|
*/
|
|
4435
4490
|
queueTopics;
|
|
4436
|
-
/**
|
|
4491
|
+
/**
|
|
4492
|
+
* Strategy model — `auditedSuccessTracker` keyed by `StrategyKey`.
|
|
4493
|
+
*
|
|
4494
|
+
* **Ownership (EC10/EC15).** Owned by the harness: it is mounted as a
|
|
4495
|
+
* child subgraph (`harness.mount("strategy", strategy)`), so its disposal
|
|
4496
|
+
* cascades from `harness.destroy()` via the mount lifecycle. Do **not**
|
|
4497
|
+
* call `strategy.destroy()` independently — the harness's `triage-input`
|
|
4498
|
+
* node and (when `opts.priority` is set) `buildPriorityScores` hold
|
|
4499
|
+
* cross-graph deps on `strategy.entries`; destroying the strategy out of
|
|
4500
|
+
* band staleness those nodes while the rest of the loop keeps running.
|
|
4501
|
+
* Read/subscribe freely; let the harness own the lifecycle.
|
|
4502
|
+
*/
|
|
4437
4503
|
strategy;
|
|
4438
4504
|
/** Global retry count across all items (circuit breaker). Reactive — subscribable. */
|
|
4439
4505
|
totalRetries;
|
|
@@ -5275,6 +5341,11 @@ var AgentLoopGraph = class extends import_graph15.Graph {
|
|
|
5275
5341
|
chat.append("assistant", response.content, {
|
|
5276
5342
|
toolCalls: response.toolCalls
|
|
5277
5343
|
});
|
|
5344
|
+
if (capReached && hasToolCalls) {
|
|
5345
|
+
for (const tc of response.toolCalls) {
|
|
5346
|
+
chat.appendToolResult(tc.id, "[tool call denied: maxTurns reached]");
|
|
5347
|
+
}
|
|
5348
|
+
}
|
|
5278
5349
|
});
|
|
5279
5350
|
},
|
|
5280
5351
|
{ describeKind: "effect" }
|
|
@@ -5296,6 +5367,45 @@ var AgentLoopGraph = class extends import_graph15.Graph {
|
|
|
5296
5367
|
},
|
|
5297
5368
|
{ describeKind: "effect" }
|
|
5298
5369
|
);
|
|
5370
|
+
const effFullDeny = gatedToolCallsNode !== toolCallsRaw ? (0, import_core22.node)(
|
|
5371
|
+
[toolCallsRaw, gatedToolCallsNode],
|
|
5372
|
+
(batchData) => {
|
|
5373
|
+
if (latestAborted) return;
|
|
5374
|
+
const rawBatch = batchData[0];
|
|
5375
|
+
const gatedBatch = batchData[1];
|
|
5376
|
+
const rawCalls = rawBatch != null && rawBatch.length > 0 ? rawBatch.at(-1) : null;
|
|
5377
|
+
if (rawCalls == null || rawCalls.length === 0) return;
|
|
5378
|
+
const gatedCalls = gatedBatch != null && gatedBatch.length > 0 ? gatedBatch.at(-1) : null;
|
|
5379
|
+
const allowedIds = gatedCalls === null ? null : new Set(gatedCalls.map((c) => c.id));
|
|
5380
|
+
const denied = allowedIds === null ? rawCalls : rawCalls.filter((c) => !allowedIds.has(c.id));
|
|
5381
|
+
if (denied.length === 0) return;
|
|
5382
|
+
const isFullDeny = gatedCalls === null;
|
|
5383
|
+
(0, import_core22.batch)(() => {
|
|
5384
|
+
if (isFullDeny) {
|
|
5385
|
+
statusNode.emit(latestTurn >= maxTurns ? "done" : "thinking");
|
|
5386
|
+
}
|
|
5387
|
+
for (const c of denied)
|
|
5388
|
+
chat.appendToolResult(c.id, "[tool call denied by interceptor]");
|
|
5389
|
+
});
|
|
5390
|
+
},
|
|
5391
|
+
{
|
|
5392
|
+
name: "fullDenyRecovery",
|
|
5393
|
+
describeKind: "effect",
|
|
5394
|
+
meta: aiMeta("agent_full_deny_recovery"),
|
|
5395
|
+
// MUST be explicit: the core `node()` default is
|
|
5396
|
+
// `partial: false` (node.ts `opts.partial ?? false`),
|
|
5397
|
+
// and `gatedToolCallsNode` only ever emits RESOLVED on the
|
|
5398
|
+
// full-deny path (never DATA/terminal). Spec R2.7.0
|
|
5399
|
+
// (DS-2.7.A, 2026-05-19) holds the `partial: false`
|
|
5400
|
+
// first-run gate until every dep has contributed real
|
|
5401
|
+
// DATA, so a `partial: false` effFullDeny would hold the
|
|
5402
|
+
// fn FOREVER. Spec R2.7.2 = `partial: true` disables the
|
|
5403
|
+
// gate; the fn body's `denied`-subtraction guard above
|
|
5404
|
+
// covers the SENTINEL slot per the R2.7.2 author
|
|
5405
|
+
// contract.
|
|
5406
|
+
partial: true
|
|
5407
|
+
}
|
|
5408
|
+
) : null;
|
|
5299
5409
|
let latestStatus = statusNode.cache ?? "idle";
|
|
5300
5410
|
const statusSub = statusNode.subscribe((msgs) => {
|
|
5301
5411
|
for (const m of msgs) if (m[0] === import_core22.DATA) latestStatus = m[1];
|
|
@@ -5315,6 +5425,7 @@ var AgentLoopGraph = class extends import_graph15.Graph {
|
|
|
5315
5425
|
);
|
|
5316
5426
|
const kaResponse = (0, import_extra17.keepalive)(effResponse);
|
|
5317
5427
|
const kaResults = (0, import_extra17.keepalive)(effResults);
|
|
5428
|
+
const kaFullDeny = effFullDeny ? (0, import_extra17.keepalive)(effFullDeny) : null;
|
|
5318
5429
|
const kaAbort = (0, import_extra17.keepalive)(effAbort);
|
|
5319
5430
|
this._terminalResult = (0, import_core22.node)(
|
|
5320
5431
|
[statusNode, lastResponseState],
|
|
@@ -5367,6 +5478,7 @@ var AgentLoopGraph = class extends import_graph15.Graph {
|
|
|
5367
5478
|
this.addDisposer(statusSub);
|
|
5368
5479
|
this.addDisposer(kaResponse);
|
|
5369
5480
|
this.addDisposer(kaResults);
|
|
5481
|
+
if (kaFullDeny) this.addDisposer(kaFullDeny);
|
|
5370
5482
|
this.addDisposer(kaAbort);
|
|
5371
5483
|
this._disposeRunWiring = () => {
|
|
5372
5484
|
};
|