@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
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compileSpec
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B5Y5GPD5.js";
|
|
4
4
|
import {
|
|
5
5
|
pipelineGraph
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZW32BPXV.js";
|
|
7
7
|
import {
|
|
8
8
|
cascadingLlmAdapter
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-T2U6N3FV.js";
|
|
10
10
|
import {
|
|
11
11
|
CircuitOpenError,
|
|
12
12
|
adaptiveRateLimiter,
|
|
13
13
|
circuitBreaker
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-T5URUIIY.js";
|
|
15
15
|
import {
|
|
16
16
|
adaptInvokeResult,
|
|
17
17
|
adapterWrapper,
|
|
@@ -20,18 +20,18 @@ import {
|
|
|
20
20
|
emptyUsageStub,
|
|
21
21
|
withLayer,
|
|
22
22
|
withReplayCache
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XEWV254I.js";
|
|
24
24
|
import {
|
|
25
25
|
aiMeta,
|
|
26
26
|
resolveToolHandlerResult,
|
|
27
27
|
stripFences
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-3REMCHSS.js";
|
|
29
29
|
import {
|
|
30
30
|
topic
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-DHDCOOJU.js";
|
|
32
32
|
import {
|
|
33
33
|
firstValueFrom
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-N6MNJNHB.js";
|
|
35
35
|
|
|
36
36
|
// src/utils/ai/adapters/core/capabilities.ts
|
|
37
37
|
import { node } from "@graphrefly/pure-ts/core";
|
|
@@ -1971,14 +1971,88 @@ function handoff(from, toFactory, opts) {
|
|
|
1971
1971
|
);
|
|
1972
1972
|
}
|
|
1973
1973
|
|
|
1974
|
-
// src/utils/ai/agents/tool-
|
|
1975
|
-
import { factoryTag as factoryTag4, node as node13 } from "@graphrefly/pure-ts/core";
|
|
1974
|
+
// src/utils/ai/agents/tool-interceptor.ts
|
|
1975
|
+
import { factoryTag as factoryTag4, node as node13, RESOLVED } from "@graphrefly/pure-ts/core";
|
|
1976
1976
|
import { fromAny as fromAny10 } from "@graphrefly/pure-ts/extra";
|
|
1977
|
+
function toolInterceptor(opts = {}) {
|
|
1978
|
+
return (calls) => {
|
|
1979
|
+
const enabledNode = opts.enabled != null ? fromAny10(opts.enabled) : void 0;
|
|
1980
|
+
const predNodes = (opts.allow ?? []).map((p) => fromAny10(p));
|
|
1981
|
+
const deps = [calls, ...enabledNode ? [enabledNode] : [], ...predNodes];
|
|
1982
|
+
return node13(
|
|
1983
|
+
deps,
|
|
1984
|
+
(batchData, actions, ctx) => {
|
|
1985
|
+
const callsBatch = batchData[0];
|
|
1986
|
+
if (callsBatch == null || callsBatch.length === 0) {
|
|
1987
|
+
actions.down([[RESOLVED]]);
|
|
1988
|
+
return;
|
|
1989
|
+
}
|
|
1990
|
+
const data = batchData.map(
|
|
1991
|
+
(batch2, i) => batch2 != null && batch2.length > 0 ? batch2.at(-1) : ctx.prevData[i]
|
|
1992
|
+
);
|
|
1993
|
+
const incoming = data[0] ?? [];
|
|
1994
|
+
let cursor = 1;
|
|
1995
|
+
if (enabledNode) {
|
|
1996
|
+
const enabled = data[cursor++];
|
|
1997
|
+
if (enabled === false) {
|
|
1998
|
+
actions.down([[RESOLVED]]);
|
|
1999
|
+
return;
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
const preds = data.slice(cursor);
|
|
2003
|
+
const kept = incoming.filter((call) => {
|
|
2004
|
+
for (const pred of preds) {
|
|
2005
|
+
if (pred == null) continue;
|
|
2006
|
+
try {
|
|
2007
|
+
if (!pred(call)) return false;
|
|
2008
|
+
} catch {
|
|
2009
|
+
return false;
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
return true;
|
|
2013
|
+
});
|
|
2014
|
+
if (kept.length === 0) {
|
|
2015
|
+
actions.down([[RESOLVED]]);
|
|
2016
|
+
return;
|
|
2017
|
+
}
|
|
2018
|
+
actions.emit(kept);
|
|
2019
|
+
},
|
|
2020
|
+
{
|
|
2021
|
+
name: opts.name ?? "tool-interceptor",
|
|
2022
|
+
describeKind: "derived",
|
|
2023
|
+
// NON-partial (no `partial: true`) — deliberate. A seeded
|
|
2024
|
+
// `enabled`/predicate (with an `initial`) emits on activation,
|
|
2025
|
+
// so it is honoured before any tool call flows (the contract
|
|
2026
|
+
// callers must follow — see `allow` JSDoc). `partial: true`
|
|
2027
|
+
// was tried and REJECTED: it un-gates the node so `calls`
|
|
2028
|
+
// races ahead of a slower seeded policy dep on the activation
|
|
2029
|
+
// wave and leaks denied calls fail-OPEN. A *never-seeded*
|
|
2030
|
+
// (pure SENTINEL) policy has unspecified gating under either
|
|
2031
|
+
// setting — callers must seed an `initial`; not relied on.
|
|
2032
|
+
// Cross-ref `tool-selector.ts` (same non-partial shape).
|
|
2033
|
+
meta: { ...aiMeta("tool_interceptor"), ...factoryTag4("toolInterceptor") },
|
|
2034
|
+
equals: (a, b) => {
|
|
2035
|
+
const la = a;
|
|
2036
|
+
const lb = b;
|
|
2037
|
+
if (la.length !== lb.length) return false;
|
|
2038
|
+
for (let i = 0; i < la.length; i++) {
|
|
2039
|
+
if (la[i] !== lb[i]) return false;
|
|
2040
|
+
}
|
|
2041
|
+
return true;
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
);
|
|
2045
|
+
};
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
// src/utils/ai/agents/tool-selector.ts
|
|
2049
|
+
import { factoryTag as factoryTag5, node as node14 } from "@graphrefly/pure-ts/core";
|
|
2050
|
+
import { fromAny as fromAny11 } from "@graphrefly/pure-ts/extra";
|
|
1977
2051
|
function toolSelector(allTools, constraints, opts) {
|
|
1978
|
-
const allToolsNode =
|
|
1979
|
-
const constraintNodes = constraints.map((c) =>
|
|
2052
|
+
const allToolsNode = fromAny11(allTools);
|
|
2053
|
+
const constraintNodes = constraints.map((c) => fromAny11(c));
|
|
1980
2054
|
const deps = [allToolsNode, ...constraintNodes];
|
|
1981
|
-
return
|
|
2055
|
+
return node14(
|
|
1982
2056
|
deps,
|
|
1983
2057
|
(batchData, actions, ctx) => {
|
|
1984
2058
|
const data = batchData.map(
|
|
@@ -1999,7 +2073,7 @@ function toolSelector(allTools, constraints, opts) {
|
|
|
1999
2073
|
{
|
|
2000
2074
|
name: opts?.name ?? "tool-selector",
|
|
2001
2075
|
describeKind: "derived",
|
|
2002
|
-
meta: { ...aiMeta("tool_selector"), ...
|
|
2076
|
+
meta: { ...aiMeta("tool_selector"), ...factoryTag5("toolSelector") },
|
|
2003
2077
|
equals: (a, b) => {
|
|
2004
2078
|
const la = a;
|
|
2005
2079
|
const lb = b;
|
|
@@ -2052,18 +2126,18 @@ function gaugesAsContext(graph, actor, options) {
|
|
|
2052
2126
|
const separator = options?.separator ?? "\n";
|
|
2053
2127
|
const entries = [];
|
|
2054
2128
|
const sinceVersion = options?.sinceVersion;
|
|
2055
|
-
for (const [path,
|
|
2056
|
-
const meta =
|
|
2129
|
+
for (const [path, node17] of Object.entries(described.nodes)) {
|
|
2130
|
+
const meta = node17.meta ?? {};
|
|
2057
2131
|
const desc = meta.description;
|
|
2058
2132
|
const format = meta.format;
|
|
2059
2133
|
if (!desc && !format) continue;
|
|
2060
|
-
if (sinceVersion != null &&
|
|
2134
|
+
if (sinceVersion != null && node17.v != null) {
|
|
2061
2135
|
const lastSeen = sinceVersion.get(path);
|
|
2062
|
-
if (lastSeen != null && lastSeen.id ===
|
|
2136
|
+
if (lastSeen != null && lastSeen.id === node17.v.id && node17.v.version <= lastSeen.version)
|
|
2063
2137
|
continue;
|
|
2064
2138
|
}
|
|
2065
2139
|
const label = desc ?? path;
|
|
2066
|
-
const value =
|
|
2140
|
+
const value = node17.value;
|
|
2067
2141
|
const unit = meta.unit;
|
|
2068
2142
|
let formatted;
|
|
2069
2143
|
if (format === "currency" && typeof value === "number") {
|
|
@@ -2085,8 +2159,8 @@ function gaugesAsContext(graph, actor, options) {
|
|
|
2085
2159
|
const tagGroups = /* @__PURE__ */ new Map();
|
|
2086
2160
|
const ungrouped = [];
|
|
2087
2161
|
for (const entry of entries) {
|
|
2088
|
-
const
|
|
2089
|
-
const tags =
|
|
2162
|
+
const node17 = described.nodes[entry.path];
|
|
2163
|
+
const tags = node17.meta?.tags;
|
|
2090
2164
|
if (tags && tags.length > 0) {
|
|
2091
2165
|
const tag = tags[0];
|
|
2092
2166
|
let group = tagGroups.get(tag);
|
|
@@ -2117,8 +2191,8 @@ function gaugesAsContext(graph, actor, options) {
|
|
|
2117
2191
|
}
|
|
2118
2192
|
|
|
2119
2193
|
// src/utils/ai/graph-integration/graph-from-spec.ts
|
|
2120
|
-
import { COMPLETE, ERROR, node as
|
|
2121
|
-
import { fromAny as
|
|
2194
|
+
import { COMPLETE, ERROR, node as node15 } from "@graphrefly/pure-ts/core";
|
|
2195
|
+
import { fromAny as fromAny12, switchMap as switchMap3 } from "@graphrefly/pure-ts/extra";
|
|
2122
2196
|
var GRAPH_FROM_SPEC_SYSTEM_PROMPT = `You are a graph architect for GraphReFly, a reactive graph protocol.
|
|
2123
2197
|
|
|
2124
2198
|
Given a natural-language description, produce a JSON graph specification with this structure:
|
|
@@ -2181,12 +2255,12 @@ ${opts.systemPromptExtra}` : GRAPH_FROM_SPEC_SYSTEM_PROMPT;
|
|
|
2181
2255
|
return compileSpec(parsed, { catalog: opts?.catalog });
|
|
2182
2256
|
}
|
|
2183
2257
|
function graphFromSpecReactive(input, adapter, opts) {
|
|
2184
|
-
const inputNode =
|
|
2258
|
+
const inputNode = fromAny12(input);
|
|
2185
2259
|
return switchMap3(inputNode, (nl) => {
|
|
2186
2260
|
if (!nl || typeof nl !== "string" || nl.trim().length === 0) {
|
|
2187
|
-
return
|
|
2261
|
+
return node15([], { initial: null });
|
|
2188
2262
|
}
|
|
2189
|
-
return
|
|
2263
|
+
return node15(
|
|
2190
2264
|
(_data, actions) => {
|
|
2191
2265
|
const controller = new AbortController();
|
|
2192
2266
|
let cancelled = false;
|
|
@@ -2201,9 +2275,11 @@ function graphFromSpecReactive(input, adapter, opts) {
|
|
|
2201
2275
|
if (cancelled) return;
|
|
2202
2276
|
actions.down([[ERROR, err]]);
|
|
2203
2277
|
});
|
|
2204
|
-
return
|
|
2205
|
-
|
|
2206
|
-
|
|
2278
|
+
return {
|
|
2279
|
+
onDeactivation: () => {
|
|
2280
|
+
cancelled = true;
|
|
2281
|
+
controller.abort();
|
|
2282
|
+
}
|
|
2207
2283
|
};
|
|
2208
2284
|
},
|
|
2209
2285
|
{ describeKind: "producer", ...{ name: "graphFromSpec::call" } }
|
|
@@ -2250,11 +2326,11 @@ function knobsAsTools(graph, actor) {
|
|
|
2250
2326
|
const openai = [];
|
|
2251
2327
|
const mcp = [];
|
|
2252
2328
|
const definitions = [];
|
|
2253
|
-
for (const [path,
|
|
2254
|
-
if (
|
|
2329
|
+
for (const [path, node17] of Object.entries(described.nodes)) {
|
|
2330
|
+
if (node17.type !== "state") continue;
|
|
2255
2331
|
if (path.includes("::__meta__::")) continue;
|
|
2256
|
-
if (
|
|
2257
|
-
const meta =
|
|
2332
|
+
if (node17.status === "completed" || node17.status === "errored") continue;
|
|
2333
|
+
const meta = node17.meta ?? {};
|
|
2258
2334
|
const access = meta.access;
|
|
2259
2335
|
if (access === "human" || access === "system") continue;
|
|
2260
2336
|
const description = meta.description ?? `Set the value of ${path}`;
|
|
@@ -2283,7 +2359,7 @@ function knobsAsTools(graph, actor) {
|
|
|
2283
2359
|
});
|
|
2284
2360
|
const graphRef = graph;
|
|
2285
2361
|
const actorRef = actor;
|
|
2286
|
-
const nv =
|
|
2362
|
+
const nv = node17.v;
|
|
2287
2363
|
definitions.push({
|
|
2288
2364
|
name: path,
|
|
2289
2365
|
description,
|
|
@@ -2299,8 +2375,8 @@ function knobsAsTools(graph, actor) {
|
|
|
2299
2375
|
}
|
|
2300
2376
|
|
|
2301
2377
|
// src/utils/ai/graph-integration/suggest-strategy.ts
|
|
2302
|
-
import { COMPLETE as COMPLETE2, ERROR as ERROR2, node as
|
|
2303
|
-
import { fromAny as
|
|
2378
|
+
import { COMPLETE as COMPLETE2, ERROR as ERROR2, node as node16 } from "@graphrefly/pure-ts/core";
|
|
2379
|
+
import { fromAny as fromAny13, switchMap as switchMap4, withLatestFrom } from "@graphrefly/pure-ts/extra";
|
|
2304
2380
|
var SUGGEST_STRATEGY_SYSTEM_PROMPT = `You are a reactive graph optimizer for GraphReFly.
|
|
2305
2381
|
|
|
2306
2382
|
Given a graph's current structure (from describe()) and a problem statement, suggest topology and parameter changes to solve the problem.
|
|
@@ -2369,16 +2445,16 @@ async function suggestStrategy(graph, problem, adapter, opts) {
|
|
|
2369
2445
|
};
|
|
2370
2446
|
}
|
|
2371
2447
|
function suggestStrategyReactive(graph, problem, adapter, opts) {
|
|
2372
|
-
const problemNode =
|
|
2448
|
+
const problemNode = fromAny13(problem);
|
|
2373
2449
|
const paired = withLatestFrom(problemNode, graph);
|
|
2374
2450
|
return switchMap4(paired, (pair) => {
|
|
2375
|
-
if (pair == null) return
|
|
2451
|
+
if (pair == null) return node16([], { initial: null });
|
|
2376
2452
|
const [pText, g] = pair;
|
|
2377
2453
|
if (!g || !pText || typeof pText !== "string" || pText.trim().length === 0) {
|
|
2378
|
-
return
|
|
2454
|
+
return node16([], { initial: null });
|
|
2379
2455
|
}
|
|
2380
|
-
if (g.destroyed) return
|
|
2381
|
-
return
|
|
2456
|
+
if (g.destroyed) return node16([], { initial: null });
|
|
2457
|
+
return node16(
|
|
2382
2458
|
(_data, actions) => {
|
|
2383
2459
|
const controller = new AbortController();
|
|
2384
2460
|
let cancelled = false;
|
|
@@ -2390,9 +2466,11 @@ function suggestStrategyReactive(graph, problem, adapter, opts) {
|
|
|
2390
2466
|
if (cancelled) return;
|
|
2391
2467
|
actions.down([[ERROR2, err]]);
|
|
2392
2468
|
});
|
|
2393
|
-
return
|
|
2394
|
-
|
|
2395
|
-
|
|
2469
|
+
return {
|
|
2470
|
+
onDeactivation: () => {
|
|
2471
|
+
cancelled = true;
|
|
2472
|
+
controller.abort();
|
|
2473
|
+
}
|
|
2396
2474
|
};
|
|
2397
2475
|
},
|
|
2398
2476
|
{ describeKind: "producer", ...{ name: "suggestStrategy::call" } }
|
|
@@ -2421,14 +2499,14 @@ function validateGraphDef(def) {
|
|
|
2421
2499
|
errors.push(`Node "${name}": must be an object`);
|
|
2422
2500
|
continue;
|
|
2423
2501
|
}
|
|
2424
|
-
const
|
|
2425
|
-
if (typeof
|
|
2502
|
+
const node17 = raw;
|
|
2503
|
+
if (typeof node17.type !== "string" || !VALID_NODE_TYPES.has(node17.type)) {
|
|
2426
2504
|
errors.push(
|
|
2427
|
-
`Node "${name}": invalid type "${String(
|
|
2505
|
+
`Node "${name}": invalid type "${String(node17.type)}" (expected: ${[...VALID_NODE_TYPES].join(", ")})`
|
|
2428
2506
|
);
|
|
2429
2507
|
}
|
|
2430
|
-
if (Array.isArray(
|
|
2431
|
-
for (const dep of
|
|
2508
|
+
if (Array.isArray(node17.deps)) {
|
|
2509
|
+
for (const dep of node17.deps) {
|
|
2432
2510
|
if (typeof dep === "string" && !nodeNames.has(dep)) {
|
|
2433
2511
|
errors.push(`Node "${name}": dep "${dep}" does not reference an existing node`);
|
|
2434
2512
|
}
|
|
@@ -2494,6 +2572,7 @@ export {
|
|
|
2494
2572
|
contentGate,
|
|
2495
2573
|
redactor,
|
|
2496
2574
|
handoff,
|
|
2575
|
+
toolInterceptor,
|
|
2497
2576
|
toolSelector,
|
|
2498
2577
|
admissionScored,
|
|
2499
2578
|
admissionFilter3D,
|
|
@@ -2505,4 +2584,4 @@ export {
|
|
|
2505
2584
|
suggestStrategyReactive,
|
|
2506
2585
|
validateGraphDef
|
|
2507
2586
|
};
|
|
2508
|
-
//# sourceMappingURL=chunk-
|
|
2587
|
+
//# sourceMappingURL=chunk-MQMTRKY3.js.map
|