@graphrefly/ts 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -0
- package/dist/adapters/index.cjs +105 -66
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +11 -136
- package/dist/adapters/index.d.ts +11 -136
- package/dist/adapters/index.js +27 -225
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/observe-storage.d.cts +4 -4
- package/dist/adapters/observe-storage.d.ts +4 -4
- package/dist/adapters/observe-storage.js +1 -0
- package/dist/adapters/observe-storage.js.map +1 -1
- package/dist/adapters/react.cjs +166 -0
- package/dist/adapters/react.cjs.map +1 -0
- package/dist/adapters/react.d.cts +31 -0
- package/dist/adapters/react.d.ts +31 -0
- package/dist/adapters/react.js +51 -0
- package/dist/adapters/react.js.map +1 -0
- package/dist/adapters/solid.cjs +157 -0
- package/dist/adapters/solid.cjs.map +1 -0
- package/dist/adapters/solid.d.cts +26 -0
- package/dist/adapters/solid.d.ts +26 -0
- package/dist/adapters/solid.js +48 -0
- package/dist/adapters/solid.js.map +1 -0
- package/dist/adapters/svelte.cjs +148 -0
- package/dist/adapters/svelte.cjs.map +1 -0
- package/dist/adapters/svelte.d.cts +31 -0
- package/dist/adapters/svelte.d.ts +31 -0
- package/dist/adapters/svelte.js +46 -0
- package/dist/adapters/svelte.js.map +1 -0
- package/dist/adapters/vue.cjs +155 -0
- package/dist/adapters/vue.cjs.map +1 -0
- package/dist/adapters/vue.d.cts +26 -0
- package/dist/adapters/vue.d.ts +26 -0
- package/dist/adapters/vue.js +46 -0
- package/dist/adapters/vue.js.map +1 -0
- package/dist/agent-runtime-BesGDZcB.d.ts +555 -0
- package/dist/agent-runtime-DZTJ3C-p.d.cts +555 -0
- package/dist/agentic-memory-BmRCvh0d.d.ts +517 -0
- package/dist/agentic-memory-DfuVZ-lY.d.cts +517 -0
- package/dist/capability-admission-B0BzqAm5.d.cts +102 -0
- package/dist/capability-admission-g0mn9hpq.d.ts +102 -0
- package/dist/{chunk-JR4IKCR2.js → chunk-2747WN4Y.js} +5 -5
- package/dist/{chunk-2ILL7HQI.js → chunk-3JR3EDB2.js} +17 -17
- package/dist/{chunk-2ILL7HQI.js.map → chunk-3JR3EDB2.js.map} +1 -1
- package/dist/{chunk-GDL26N2T.js → chunk-3KN7NJDR.js} +2 -2
- package/dist/{chunk-DJC4CHLQ.js → chunk-43BKLFZU.js} +9 -9
- package/dist/chunk-6XAIOL3X.js +2407 -0
- package/dist/chunk-6XAIOL3X.js.map +1 -0
- package/dist/{chunk-SCRFRCGR.js → chunk-BSQGE5PS.js} +1 -1
- package/dist/{chunk-Y3ZLRGHC.js → chunk-CZNV3VXM.js} +16 -16
- package/dist/chunk-DGUM43GV.js +11 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/{chunk-JIMUDQN3.js → chunk-FBUU43PM.js} +2 -2
- package/dist/chunk-H75VXTGT.js +219 -0
- package/dist/chunk-H75VXTGT.js.map +1 -0
- package/dist/{chunk-RIIOUTGM.js → chunk-HKK2JD7Z.js} +12 -9
- package/dist/chunk-HKK2JD7Z.js.map +1 -0
- package/dist/{chunk-D6BG7U6A.js → chunk-IXZBUWSP.js} +3 -3
- package/dist/chunk-PC3BTTBE.js +3217 -0
- package/dist/chunk-PC3BTTBE.js.map +1 -0
- package/dist/chunk-QFY4AFY4.js +879 -0
- package/dist/chunk-QFY4AFY4.js.map +1 -0
- package/dist/{chunk-DK554R7P.js → chunk-S6HXABGL.js} +2 -1
- package/dist/chunk-S6HXABGL.js.map +1 -0
- package/dist/{chunk-PKVBHGBM.js → chunk-SS2A464I.js} +7 -7
- package/dist/chunk-UT3MHJCW.js +49 -0
- package/dist/chunk-UT3MHJCW.js.map +1 -0
- package/dist/{chunk-G4M3NHRJ.js → chunk-V7CIJE4B.js} +3 -3
- package/dist/{chunk-TEW47IVR.js → chunk-VPEFSDME.js} +2 -2
- package/dist/chunk-VTHLCFN4.js +368 -0
- package/dist/chunk-VTHLCFN4.js.map +1 -0
- package/dist/{chunk-SWTLEQL6.js → chunk-WQIA3GFB.js} +2 -2
- package/dist/chunk-WQIA3GFB.js.map +1 -0
- package/dist/{chunk-I3IHOHCJ.js → chunk-XKXWK2KP.js} +108 -64
- package/dist/chunk-XKXWK2KP.js.map +1 -0
- package/dist/{chunk-COHO25CZ.js → chunk-YDSIVHRR.js} +553 -7
- package/dist/chunk-YDSIVHRR.js.map +1 -0
- package/dist/chunk-YXMZ2N6J.js +1884 -0
- package/dist/chunk-YXMZ2N6J.js.map +1 -0
- package/dist/composition/index.cjs +102 -57
- package/dist/composition/index.cjs.map +1 -1
- package/dist/composition/index.d.cts +4 -4
- package/dist/composition/index.d.ts +4 -4
- package/dist/composition/index.js +6 -5
- package/dist/core/index.cjs +102 -57
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +5 -4
- package/dist/cqrs/index.cjs.map +1 -1
- package/dist/cqrs/index.d.cts +4 -4
- package/dist/cqrs/index.d.ts +4 -4
- package/dist/cqrs/index.js +3 -2
- package/dist/cqrs/index.js.map +1 -1
- package/dist/cqrs/messaging.cjs +312 -0
- package/dist/cqrs/messaging.cjs.map +1 -0
- package/dist/cqrs/messaging.d.cts +57 -0
- package/dist/cqrs/messaging.d.ts +57 -0
- package/dist/cqrs/messaging.js +274 -0
- package/dist/cqrs/messaging.js.map +1 -0
- package/dist/cqrs/work-queue.cjs +329 -0
- package/dist/cqrs/work-queue.cjs.map +1 -0
- package/dist/cqrs/work-queue.d.cts +90 -0
- package/dist/cqrs/work-queue.d.ts +90 -0
- package/dist/cqrs/work-queue.js +292 -0
- package/dist/cqrs/work-queue.js.map +1 -0
- package/dist/data/index.cjs +19 -0
- package/dist/data/index.cjs.map +1 -0
- package/dist/data/index.d.cts +36 -0
- package/dist/data/index.d.ts +36 -0
- package/dist/data/index.js +1 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data-structures/index.cjs +105 -57
- package/dist/data-structures/index.cjs.map +1 -1
- package/dist/data-structures/index.d.cts +8 -8
- package/dist/data-structures/index.d.ts +8 -8
- package/dist/data-structures/index.js +7 -6
- package/dist/{describe-BZb7AS2y.d.ts → describe-BpyJuWkw.d.ts} +1 -1
- package/dist/{describe-Ciu8SUnN.d.cts → describe-DYMw_l1C.d.cts} +1 -1
- package/dist/executors/work-queue.cjs +342 -0
- package/dist/executors/work-queue.cjs.map +1 -0
- package/dist/executors/work-queue.d.cts +90 -0
- package/dist/executors/work-queue.d.ts +90 -0
- package/dist/executors/work-queue.js +306 -0
- package/dist/executors/work-queue.js.map +1 -0
- package/dist/graph/index.cjs +112 -58
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +9 -9
- package/dist/graph/index.d.ts +9 -9
- package/dist/graph/index.js +18 -17
- package/dist/{graph-DfdF9zy4.d.ts → graph-D-1-SQeC.d.ts} +3 -3
- package/dist/{graph-s23RbbFO.d.cts → graph-DCEWh4T2.d.cts} +3 -3
- package/dist/{index-CAEmLCYF.d.cts → index-72VZC0-E.d.cts} +2 -2
- package/dist/{index-SnzZu3x7.d.ts → index-Bmxeu0nK.d.ts} +2 -2
- package/dist/index.cjs +112 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +118 -113
- package/dist/inspection/boundary.cjs +98 -0
- package/dist/inspection/boundary.cjs.map +1 -0
- package/dist/inspection/boundary.d.cts +61 -0
- package/dist/inspection/boundary.d.ts +61 -0
- package/dist/inspection/boundary.js +75 -0
- package/dist/inspection/boundary.js.map +1 -0
- package/dist/{messages-BZqrGGm1.d.ts → messages-CAzUPPJM.d.cts} +10 -5
- package/dist/{messages-BZqrGGm1.d.cts → messages-CAzUPPJM.d.ts} +10 -5
- package/dist/messaging/index.cjs +744 -613
- package/dist/messaging/index.cjs.map +1 -1
- package/dist/messaging/index.d.cts +216 -160
- package/dist/messaging/index.d.ts +216 -160
- package/dist/messaging/index.js +19 -749
- package/dist/messaging/index.js.map +1 -1
- package/dist/operators/index.cjs +102 -57
- package/dist/operators/index.cjs.map +1 -1
- package/dist/operators/index.d.cts +6 -6
- package/dist/operators/index.d.ts +6 -6
- package/dist/operators/index.js +8 -7
- package/dist/orchestration/index.cjs +3333 -59
- package/dist/orchestration/index.cjs.map +1 -1
- package/dist/orchestration/index.d.cts +7 -4
- package/dist/orchestration/index.d.ts +7 -4
- package/dist/orchestration/index.js +49 -8
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/messaging.cjs +314 -0
- package/dist/orchestration/messaging.cjs.map +1 -0
- package/dist/orchestration/messaging.d.cts +59 -0
- package/dist/orchestration/messaging.d.ts +59 -0
- package/dist/orchestration/messaging.js +276 -0
- package/dist/orchestration/messaging.js.map +1 -0
- package/dist/orchestration/work-queue.cjs +262 -0
- package/dist/orchestration/work-queue.cjs.map +1 -0
- package/dist/orchestration/work-queue.d.cts +85 -0
- package/dist/orchestration/work-queue.d.ts +85 -0
- package/dist/orchestration/work-queue.js +226 -0
- package/dist/orchestration/work-queue.js.map +1 -0
- package/dist/patterns/event-flow.cjs +447 -0
- package/dist/patterns/event-flow.cjs.map +1 -0
- package/dist/patterns/event-flow.d.cts +115 -0
- package/dist/patterns/event-flow.d.ts +115 -0
- package/dist/patterns/event-flow.js +14 -0
- package/dist/patterns/event-flow.js.map +1 -0
- package/dist/patterns/index.cjs +423 -18
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.cts +8 -5
- package/dist/patterns/index.d.ts +8 -5
- package/dist/patterns/index.js +13 -4
- package/dist/{reactive-collection-Cb1II1Fi.d.ts → reactive-collection-BAmfrGjd.d.ts} +9 -9
- package/dist/{reactive-collection-BxBqtIOE.d.cts → reactive-collection-DNV0-gFi.d.cts} +9 -9
- package/dist/{reactive-collection-storage-D-KmjE0J.d.cts → reactive-collection-storage-BNEldDyi.d.cts} +5 -5
- package/dist/{reactive-collection-storage-BNiEc-Gd.d.ts → reactive-collection-storage-YZsAQsWK.d.ts} +5 -5
- package/dist/{reactive-map-D-g3dv8I.d.cts → reactive-map-DRD1LJ2H.d.cts} +6 -6
- package/dist/{reactive-map-BcB4KsQR.d.ts → reactive-map-EsDiCmJk.d.ts} +6 -6
- package/dist/render/index.d.cts +3 -3
- package/dist/render/index.d.ts +3 -3
- package/dist/render/index.js +1 -0
- package/dist/{semantic-memory-graph-BYoIlP35.d.cts → semantic-memory-graph-DKuNzuWw.d.cts} +2 -2
- package/dist/{semantic-memory-graph-CxyXLms3.d.ts → semantic-memory-graph-uwbwJdhe.d.ts} +2 -2
- package/dist/solutions/index.cjs +4478 -2
- package/dist/solutions/index.cjs.map +1 -1
- package/dist/solutions/index.d.cts +13 -519
- package/dist/solutions/index.d.ts +13 -519
- package/dist/solutions/index.js +90 -6
- package/dist/solutions/reactive-layout/browser/index.cjs +449 -0
- package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/browser/index.d.cts +44 -0
- package/dist/solutions/reactive-layout/browser/index.d.ts +44 -0
- package/dist/solutions/reactive-layout/browser/index.js +69 -0
- package/dist/solutions/reactive-layout/browser/index.js.map +1 -0
- package/dist/solutions/reactive-layout/index.cjs +4266 -0
- package/dist/solutions/reactive-layout/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/index.d.cts +581 -0
- package/dist/solutions/reactive-layout/index.d.ts +581 -0
- package/dist/solutions/reactive-layout/index.js +86 -0
- package/dist/solutions/reactive-layout/index.js.map +1 -0
- package/dist/solutions/reactive-layout/node-canvas/index.cjs +545 -0
- package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/node-canvas/index.d.cts +54 -0
- package/dist/solutions/reactive-layout/node-canvas/index.d.ts +54 -0
- package/dist/solutions/reactive-layout/node-canvas/index.js +131 -0
- package/dist/solutions/reactive-layout/node-canvas/index.js.map +1 -0
- package/dist/solutions/reactive-layout/react-native/index.cjs +494 -0
- package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/react-native/index.d.cts +51 -0
- package/dist/solutions/reactive-layout/react-native/index.d.ts +51 -0
- package/dist/solutions/reactive-layout/react-native/index.js +77 -0
- package/dist/solutions/reactive-layout/react-native/index.js.map +1 -0
- package/dist/solutions/reactive-layout/skia/index.cjs +547 -0
- package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/skia/index.d.cts +64 -0
- package/dist/solutions/reactive-layout/skia/index.d.ts +64 -0
- package/dist/solutions/reactive-layout/skia/index.js +70 -0
- package/dist/solutions/reactive-layout/skia/index.js.map +1 -0
- package/dist/solutions/work-item/actions.cjs +2164 -0
- package/dist/solutions/work-item/actions.cjs.map +1 -0
- package/dist/solutions/work-item/actions.d.cts +201 -0
- package/dist/solutions/work-item/actions.d.ts +201 -0
- package/dist/solutions/work-item/actions.js +1454 -0
- package/dist/solutions/work-item/actions.js.map +1 -0
- package/dist/solutions/work-item/scheduling.cjs +2454 -0
- package/dist/solutions/work-item/scheduling.cjs.map +1 -0
- package/dist/solutions/work-item/scheduling.d.cts +433 -0
- package/dist/solutions/work-item/scheduling.d.ts +433 -0
- package/dist/solutions/work-item/scheduling.js +32 -0
- package/dist/solutions/work-item/scheduling.js.map +1 -0
- package/dist/solutions/work-item/work-queue.cjs +306 -0
- package/dist/solutions/work-item/work-queue.cjs.map +1 -0
- package/dist/solutions/work-item/work-queue.d.cts +71 -0
- package/dist/solutions/work-item/work-queue.d.ts +71 -0
- package/dist/solutions/work-item/work-queue.js +270 -0
- package/dist/solutions/work-item/work-queue.js.map +1 -0
- package/dist/sources/browser.cjs +169 -57
- package/dist/sources/browser.cjs.map +1 -1
- package/dist/sources/browser.d.cts +33 -6
- package/dist/sources/browser.d.ts +33 -6
- package/dist/sources/browser.js +73 -6
- package/dist/sources/browser.js.map +1 -1
- package/dist/sources/index.cjs +102 -57
- package/dist/sources/index.cjs.map +1 -1
- package/dist/sources/index.d.cts +5 -5
- package/dist/sources/index.d.ts +5 -5
- package/dist/sources/index.js +6 -5
- package/dist/sources/node.cjs.map +1 -1
- package/dist/sources/node.d.cts +4 -4
- package/dist/sources/node.d.ts +4 -4
- package/dist/sources/node.js +2 -1
- package/dist/sources/node.js.map +1 -1
- package/dist/storage/browser.js +1 -0
- package/dist/storage/browser.js.map +1 -1
- package/dist/storage/index.d.cts +5 -5
- package/dist/storage/index.d.ts +5 -5
- package/dist/storage/index.js +5 -4
- package/dist/storage/node.js +1 -0
- package/dist/storage/node.js.map +1 -1
- package/dist/store-C-joM4gh.d.ts +123 -0
- package/dist/store-CNJwmT-h.d.cts +123 -0
- package/dist/testing/index.cjs +1 -0
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +3 -2
- package/dist/{types-h12mNYbq.d.ts → types-BsJvElYZ.d.ts} +31 -31
- package/dist/{types-bNMSWKqF.d.cts → types-CcPIn7sy.d.cts} +31 -31
- package/dist/work-item-runtime-C3M79vE9.d.ts +228 -0
- package/dist/work-item-runtime-qaVgsL0T.d.cts +228 -0
- package/dist/work-queue/index.cjs +1132 -0
- package/dist/work-queue/index.cjs.map +1 -0
- package/dist/work-queue/index.d.cts +369 -0
- package/dist/work-queue/index.d.ts +369 -0
- package/dist/work-queue/index.js +1078 -0
- package/dist/work-queue/index.js.map +1 -0
- package/package.json +266 -2
- package/dist/chunk-COHO25CZ.js.map +0 -1
- package/dist/chunk-DK554R7P.js.map +0 -1
- package/dist/chunk-I3IHOHCJ.js.map +0 -1
- package/dist/chunk-RIIOUTGM.js.map +0 -1
- package/dist/chunk-SWTLEQL6.js.map +0 -1
- /package/dist/{chunk-JR4IKCR2.js.map → chunk-2747WN4Y.js.map} +0 -0
- /package/dist/{chunk-GDL26N2T.js.map → chunk-3KN7NJDR.js.map} +0 -0
- /package/dist/{chunk-DJC4CHLQ.js.map → chunk-43BKLFZU.js.map} +0 -0
- /package/dist/{chunk-SCRFRCGR.js.map → chunk-BSQGE5PS.js.map} +0 -0
- /package/dist/{chunk-Y3ZLRGHC.js.map → chunk-CZNV3VXM.js.map} +0 -0
- /package/dist/{chunk-JIMUDQN3.js.map → chunk-FBUU43PM.js.map} +0 -0
- /package/dist/{chunk-D6BG7U6A.js.map → chunk-IXZBUWSP.js.map} +0 -0
- /package/dist/{chunk-PKVBHGBM.js.map → chunk-SS2A464I.js.map} +0 -0
- /package/dist/{chunk-G4M3NHRJ.js.map → chunk-V7CIJE4B.js.map} +0 -0
- /package/dist/{chunk-TEW47IVR.js.map → chunk-VPEFSDME.js.map} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { o as ReactiveIndexRestoreState, a as IndexRow, n as ReactiveIndexOptions, j as ReactiveIndex, p as ReactiveListRestoreState, q as ReactiveLogRestoreState, r as ReactiveMapRestoreState } from '../reactive-collection-
|
|
2
|
-
export { C as CapacityPolicy, I as IndexChange, L as ListChange, c as LogChange, M as MapChange, O as OrderedCapacityPolicy, k as ReactiveIndexCapacityOrder, l as ReactiveIndexCapacityPolicy, m as ReactiveIndexOpt, s as ReactiveOpt, t as ReactiveView, u as RetentionPolicy, V as ViewCachePolicy, H as reactiveIndex } from '../reactive-collection-
|
|
3
|
-
import { b as ReactiveListOptions, R as ReactiveList, d as ReactiveLogOptions, c as ReactiveLog, g as ReactiveMapOptions, e as ReactiveMap } from '../reactive-map-
|
|
4
|
-
export { a as ReactiveListOpt, f as ReactiveMapOpt, h as ReactiveMapRetentionEntry, i as ReactiveMapRetentionPolicy, m as mergeReactiveLogs, r as reactiveList, j as reactiveLog, k as reactiveMap, s as scanLog } from '../reactive-map-
|
|
5
|
-
import '../types-
|
|
6
|
-
import '../messages-
|
|
7
|
-
import '../graph-
|
|
1
|
+
import { o as ReactiveIndexRestoreState, a as IndexRow, n as ReactiveIndexOptions, j as ReactiveIndex, p as ReactiveListRestoreState, q as ReactiveLogRestoreState, r as ReactiveMapRestoreState } from '../reactive-collection-DNV0-gFi.cjs';
|
|
2
|
+
export { C as CapacityPolicy, I as IndexChange, L as ListChange, c as LogChange, M as MapChange, O as OrderedCapacityPolicy, k as ReactiveIndexCapacityOrder, l as ReactiveIndexCapacityPolicy, m as ReactiveIndexOpt, s as ReactiveOpt, t as ReactiveView, u as RetentionPolicy, V as ViewCachePolicy, H as reactiveIndex } from '../reactive-collection-DNV0-gFi.cjs';
|
|
3
|
+
import { b as ReactiveListOptions, R as ReactiveList, d as ReactiveLogOptions, c as ReactiveLog, g as ReactiveMapOptions, e as ReactiveMap } from '../reactive-map-DRD1LJ2H.cjs';
|
|
4
|
+
export { a as ReactiveListOpt, f as ReactiveMapOpt, h as ReactiveMapRetentionEntry, i as ReactiveMapRetentionPolicy, m as mergeReactiveLogs, r as reactiveList, j as reactiveLog, k as reactiveMap, s as scanLog } from '../reactive-map-DRD1LJ2H.cjs';
|
|
5
|
+
import '../types-CcPIn7sy.cjs';
|
|
6
|
+
import '../messages-CAzUPPJM.cjs';
|
|
7
|
+
import '../graph-DCEWh4T2.cjs';
|
|
8
8
|
import '../core/index.cjs';
|
|
9
9
|
import '../codec-BB7p8fJc.cjs';
|
|
10
|
-
import '../describe-
|
|
10
|
+
import '../describe-DYMw_l1C.cjs';
|
|
11
11
|
import '../append-log-DisvEReb.cjs';
|
|
12
12
|
|
|
13
13
|
/** D161 synchronous collection-owned restore. This helper never reads storage. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { o as ReactiveIndexRestoreState, a as IndexRow, n as ReactiveIndexOptions, j as ReactiveIndex, p as ReactiveListRestoreState, q as ReactiveLogRestoreState, r as ReactiveMapRestoreState } from '../reactive-collection-
|
|
2
|
-
export { C as CapacityPolicy, I as IndexChange, L as ListChange, c as LogChange, M as MapChange, O as OrderedCapacityPolicy, k as ReactiveIndexCapacityOrder, l as ReactiveIndexCapacityPolicy, m as ReactiveIndexOpt, s as ReactiveOpt, t as ReactiveView, u as RetentionPolicy, V as ViewCachePolicy, H as reactiveIndex } from '../reactive-collection-
|
|
3
|
-
import { b as ReactiveListOptions, R as ReactiveList, d as ReactiveLogOptions, c as ReactiveLog, g as ReactiveMapOptions, e as ReactiveMap } from '../reactive-map-
|
|
4
|
-
export { a as ReactiveListOpt, f as ReactiveMapOpt, h as ReactiveMapRetentionEntry, i as ReactiveMapRetentionPolicy, m as mergeReactiveLogs, r as reactiveList, j as reactiveLog, k as reactiveMap, s as scanLog } from '../reactive-map-
|
|
5
|
-
import '../types-
|
|
6
|
-
import '../messages-
|
|
7
|
-
import '../graph-
|
|
1
|
+
import { o as ReactiveIndexRestoreState, a as IndexRow, n as ReactiveIndexOptions, j as ReactiveIndex, p as ReactiveListRestoreState, q as ReactiveLogRestoreState, r as ReactiveMapRestoreState } from '../reactive-collection-BAmfrGjd.js';
|
|
2
|
+
export { C as CapacityPolicy, I as IndexChange, L as ListChange, c as LogChange, M as MapChange, O as OrderedCapacityPolicy, k as ReactiveIndexCapacityOrder, l as ReactiveIndexCapacityPolicy, m as ReactiveIndexOpt, s as ReactiveOpt, t as ReactiveView, u as RetentionPolicy, V as ViewCachePolicy, H as reactiveIndex } from '../reactive-collection-BAmfrGjd.js';
|
|
3
|
+
import { b as ReactiveListOptions, R as ReactiveList, d as ReactiveLogOptions, c as ReactiveLog, g as ReactiveMapOptions, e as ReactiveMap } from '../reactive-map-EsDiCmJk.js';
|
|
4
|
+
export { a as ReactiveListOpt, f as ReactiveMapOpt, h as ReactiveMapRetentionEntry, i as ReactiveMapRetentionPolicy, m as mergeReactiveLogs, r as reactiveList, j as reactiveLog, k as reactiveMap, s as scanLog } from '../reactive-map-EsDiCmJk.js';
|
|
5
|
+
import '../types-BsJvElYZ.js';
|
|
6
|
+
import '../messages-CAzUPPJM.js';
|
|
7
|
+
import '../graph-D-1-SQeC.js';
|
|
8
8
|
import '../core/index.js';
|
|
9
9
|
import '../codec-BB7p8fJc.js';
|
|
10
|
-
import '../describe-
|
|
10
|
+
import '../describe-BpyJuWkw.js';
|
|
11
11
|
import '../append-log-DzKMmjxx.js';
|
|
12
12
|
|
|
13
13
|
/** D161 synchronous collection-owned restore. This helper never reads storage. */
|
|
@@ -9,13 +9,14 @@ import {
|
|
|
9
9
|
restoreReactiveLog,
|
|
10
10
|
restoreReactiveMap,
|
|
11
11
|
scanLog
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-HKK2JD7Z.js";
|
|
13
|
+
import "../chunk-V7CIJE4B.js";
|
|
14
|
+
import "../chunk-SS2A464I.js";
|
|
15
|
+
import "../chunk-XKXWK2KP.js";
|
|
16
|
+
import "../chunk-WQIA3GFB.js";
|
|
17
|
+
import "../chunk-S6HXABGL.js";
|
|
16
18
|
import "../chunk-4VLAQHZI.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-DK554R7P.js";
|
|
19
|
+
import "../chunk-DGUM43GV.js";
|
|
19
20
|
export {
|
|
20
21
|
mergeReactiveLogs,
|
|
21
22
|
reactiveIndex,
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/executors/work-queue.ts
|
|
21
|
+
var work_queue_exports = {};
|
|
22
|
+
__export(work_queue_exports, {
|
|
23
|
+
executorSubmitCommand: () => executorSubmitCommand,
|
|
24
|
+
executorWorkQueueRecipe: () => executorWorkQueueRecipe
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(work_queue_exports);
|
|
27
|
+
|
|
28
|
+
// src/protocol/messages.ts
|
|
29
|
+
var SENTINEL = void 0;
|
|
30
|
+
|
|
31
|
+
// src/ctx/types.ts
|
|
32
|
+
function depWaves(ctx, depIndex) {
|
|
33
|
+
return ctx.waveData[depIndex] ?? [];
|
|
34
|
+
}
|
|
35
|
+
function depBatch(ctx, depIndex) {
|
|
36
|
+
const waves = depWaves(ctx, depIndex);
|
|
37
|
+
if (waves.length === 0) return null;
|
|
38
|
+
const flattened = waves.flat().filter((v) => v !== SENTINEL);
|
|
39
|
+
return flattened.length === 0 ? [] : flattened;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/executors/work-queue.ts
|
|
43
|
+
function executorWorkQueueRecipe(graph, opts) {
|
|
44
|
+
const name = opts.name ?? "executorWorkQueue";
|
|
45
|
+
const submitCommands = opts.requests === void 0 ? void 0 : graph.node(
|
|
46
|
+
[opts.requests],
|
|
47
|
+
(ctx) => {
|
|
48
|
+
for (const raw of depBatch(ctx, 0) ?? []) {
|
|
49
|
+
const request = raw;
|
|
50
|
+
ctx.down([["DATA", executorSubmitCommand(request, opts.policy)]]);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{ name: `${name}/submitCommands`, factory: "executorWorkQueueSubmitCommands" }
|
|
54
|
+
);
|
|
55
|
+
const runtime = graph.node(
|
|
56
|
+
[opts.records, opts.outcomes],
|
|
57
|
+
(ctx) => {
|
|
58
|
+
const state = ctx.state.get() ?? emptyState();
|
|
59
|
+
for (const raw of depBatch(ctx, 0) ?? []) {
|
|
60
|
+
reduceRecord(ctx, state, raw, opts);
|
|
61
|
+
}
|
|
62
|
+
for (const raw of depBatch(ctx, 1) ?? []) {
|
|
63
|
+
reduceOutcome(ctx, state, raw, opts);
|
|
64
|
+
}
|
|
65
|
+
ctx.state.set(state);
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: `${name}/runtime`,
|
|
69
|
+
factory: "executorWorkQueueRuntime",
|
|
70
|
+
partial: true,
|
|
71
|
+
completeWhenDepsComplete: false,
|
|
72
|
+
errorWhenDepsError: false
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
return {
|
|
76
|
+
...submitCommands === void 0 ? {} : { submitCommands },
|
|
77
|
+
attempts: project(
|
|
78
|
+
graph,
|
|
79
|
+
runtime,
|
|
80
|
+
`${name}/attempts`,
|
|
81
|
+
"executorWorkQueueAttempts",
|
|
82
|
+
(fact) => fact.kind === "attempt" ? fact.attempt : void 0
|
|
83
|
+
),
|
|
84
|
+
commands: project(
|
|
85
|
+
graph,
|
|
86
|
+
runtime,
|
|
87
|
+
`${name}/commands`,
|
|
88
|
+
"executorWorkQueueCommands",
|
|
89
|
+
(fact) => fact.kind === "command" ? fact.command : void 0
|
|
90
|
+
),
|
|
91
|
+
issues: project(
|
|
92
|
+
graph,
|
|
93
|
+
runtime,
|
|
94
|
+
`${name}/issues`,
|
|
95
|
+
"executorWorkQueueIssues",
|
|
96
|
+
(fact) => fact.kind === "issue" ? fact.issue : void 0
|
|
97
|
+
)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function executorSubmitCommand(request, policy) {
|
|
101
|
+
const payloadExtra = policy?.payload?.(request) ?? {};
|
|
102
|
+
const submit = policy?.submit?.(request) ?? {};
|
|
103
|
+
const payload = {
|
|
104
|
+
...payloadExtra,
|
|
105
|
+
kind: "executor-queued-dispatch",
|
|
106
|
+
requestId: request.requestId,
|
|
107
|
+
operationId: request.operationId,
|
|
108
|
+
parentRequestId: request.parentRequestId,
|
|
109
|
+
inputId: request.input?.inputId,
|
|
110
|
+
effectRunId: request.effectRunId,
|
|
111
|
+
sourceRefs: request.sourceRefs,
|
|
112
|
+
idempotencyKey: request.requestId,
|
|
113
|
+
metadata: request.metadata
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
kind: "submit",
|
|
117
|
+
commandId: `${request.requestId}:executor-work-queue-submit`,
|
|
118
|
+
payload,
|
|
119
|
+
workId: submit.workId ?? `executor:${request.requestId}`,
|
|
120
|
+
priority: submit.priority,
|
|
121
|
+
tags: submit.tags ?? ["executor", request.requestKind],
|
|
122
|
+
requirements: submit.requirements,
|
|
123
|
+
notBeforeMs: submit.notBeforeMs,
|
|
124
|
+
deadlineMs: submit.deadlineMs,
|
|
125
|
+
idempotencyKey: request.requestId,
|
|
126
|
+
sourceRefs: stringRefs(request.sourceRefs)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function reduceRecord(ctx, state, record, opts) {
|
|
130
|
+
if (record.kind === "work-admitted") {
|
|
131
|
+
state.payloads.set(record.workId, record.payload);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
retireClaimForRecord(state, record);
|
|
135
|
+
if (record.kind !== "work-claimed") return;
|
|
136
|
+
if (opts.workerId !== void 0 && record.workerId !== opts.workerId) return;
|
|
137
|
+
const payload = state.payloads.get(record.workId);
|
|
138
|
+
if (payload === void 0) {
|
|
139
|
+
emit(ctx, { kind: "issue", issue: queueIssue(record, "executor-claim-without-payload") });
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const attempt = {
|
|
143
|
+
kind: "executor-queued-dispatch-attempt",
|
|
144
|
+
workId: record.workId,
|
|
145
|
+
leaseId: record.leaseId,
|
|
146
|
+
queueAttempt: record.attempt,
|
|
147
|
+
workerId: record.workerId,
|
|
148
|
+
requestId: payload.requestId,
|
|
149
|
+
operationId: payload.operationId,
|
|
150
|
+
routeId: payload.routeId,
|
|
151
|
+
executorId: payload.executorId,
|
|
152
|
+
profileId: payload.profileId,
|
|
153
|
+
payload,
|
|
154
|
+
sourceRefs: [...payload.sourceRefs ?? [], ref("work-queue-record", String(record.recordSeq))]
|
|
155
|
+
};
|
|
156
|
+
const key = outcomeKey(payload, record.attempt);
|
|
157
|
+
state.activeClaims.set(key, attempt);
|
|
158
|
+
emit(ctx, { kind: "attempt", attempt });
|
|
159
|
+
const pending = state.pendingOutcomes.get(key);
|
|
160
|
+
if (pending !== void 0) {
|
|
161
|
+
state.pendingOutcomes.delete(key);
|
|
162
|
+
for (const outcome of pending) {
|
|
163
|
+
mapClaimedOutcome(ctx, state, key, attempt, outcome, opts);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function reduceOutcome(ctx, state, outcome, opts) {
|
|
168
|
+
if (state.seenOutcomes.has(outcome.outcomeId)) return;
|
|
169
|
+
const key = outcomeKey(outcome, outcome.attempt);
|
|
170
|
+
if (state.terminalClaims.has(key)) {
|
|
171
|
+
state.seenOutcomes.add(outcome.outcomeId);
|
|
172
|
+
emit(ctx, {
|
|
173
|
+
kind: "issue",
|
|
174
|
+
issue: {
|
|
175
|
+
kind: "issue",
|
|
176
|
+
code: "executor-duplicate-terminal-outcome-for-queue-claim",
|
|
177
|
+
message: `ExecutorOutcome '${outcome.outcomeId}' arrived after the queue claim was already terminal`,
|
|
178
|
+
refs: [`executor-outcome:${outcome.outcomeId}`]
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const claim = state.activeClaims.get(key);
|
|
184
|
+
if (claim === void 0) {
|
|
185
|
+
bufferPendingOutcome(state, key, outcome);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
mapClaimedOutcome(ctx, state, key, claim, outcome, opts);
|
|
189
|
+
}
|
|
190
|
+
function mapClaimedOutcome(ctx, state, key, claim, outcome, opts) {
|
|
191
|
+
if (state.seenOutcomes.has(outcome.outcomeId)) return;
|
|
192
|
+
state.seenOutcomes.add(outcome.outcomeId);
|
|
193
|
+
if (state.terminalClaims.has(key)) {
|
|
194
|
+
emit(ctx, {
|
|
195
|
+
kind: "issue",
|
|
196
|
+
issue: {
|
|
197
|
+
kind: "issue",
|
|
198
|
+
code: "executor-duplicate-terminal-outcome-for-queue-claim",
|
|
199
|
+
message: `ExecutorOutcome '${outcome.outcomeId}' arrived after the queue claim was already terminal`,
|
|
200
|
+
refs: [`executor-outcome:${outcome.outcomeId}`, `work-queue-work:${claim.workId}`]
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (outcome.kind === "result") {
|
|
206
|
+
terminalizeClaim(state, key);
|
|
207
|
+
emit(ctx, {
|
|
208
|
+
kind: "command",
|
|
209
|
+
command: {
|
|
210
|
+
kind: "complete",
|
|
211
|
+
commandId: `${outcome.outcomeId}:queue-complete`,
|
|
212
|
+
workId: claim.workId,
|
|
213
|
+
leaseId: claim.leaseId,
|
|
214
|
+
attempt: claim.queueAttempt,
|
|
215
|
+
workerId: claim.workerId,
|
|
216
|
+
result: outcome.result,
|
|
217
|
+
sourceRefs: stringRefs(outcome.evidenceRefs)
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (outcome.kind === "canceled") {
|
|
223
|
+
terminalizeClaim(state, key);
|
|
224
|
+
emit(ctx, {
|
|
225
|
+
kind: "command",
|
|
226
|
+
command: {
|
|
227
|
+
kind: "cancel",
|
|
228
|
+
commandId: `${outcome.outcomeId}:queue-cancel`,
|
|
229
|
+
workId: claim.workId,
|
|
230
|
+
reason: outcome.reason,
|
|
231
|
+
sourceRefs: stringRefs(outcome.evidenceRefs)
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
terminalizeClaim(state, key);
|
|
237
|
+
emit(ctx, {
|
|
238
|
+
kind: "command",
|
|
239
|
+
command: {
|
|
240
|
+
kind: "fail",
|
|
241
|
+
commandId: `${outcome.outcomeId}:queue-fail`,
|
|
242
|
+
workId: claim.workId,
|
|
243
|
+
leaseId: claim.leaseId,
|
|
244
|
+
attempt: claim.queueAttempt,
|
|
245
|
+
workerId: claim.workerId,
|
|
246
|
+
error: outcomeError(outcome),
|
|
247
|
+
retryable: outcomeRetryable(outcome, opts.policy),
|
|
248
|
+
sourceRefs: stringRefs(outcome.evidenceRefs)
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function outcomeError(outcome) {
|
|
253
|
+
if (outcome.kind === "failure") return outcome.error;
|
|
254
|
+
if (outcome.kind === "timeout") {
|
|
255
|
+
return {
|
|
256
|
+
kind: "issue",
|
|
257
|
+
code: "executor-timeout",
|
|
258
|
+
message: `ExecutorOutcome '${outcome.outcomeId}' timed out`,
|
|
259
|
+
metadata: { timeoutMs: outcome.timeoutMs }
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
kind: "issue",
|
|
264
|
+
code: "executor-blocked",
|
|
265
|
+
message: `ExecutorOutcome '${outcome.outcomeId}' blocked`,
|
|
266
|
+
metadata: { needs: outcome.needs }
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
function outcomeRetryable(outcome, policy) {
|
|
270
|
+
if (outcome.kind === "failure") return outcome.retryable;
|
|
271
|
+
if (outcome.kind === "timeout") return outcome.retryable ?? policy?.retryableTimeout;
|
|
272
|
+
if (outcome.kind === "blocked") return policy?.retryableBlocked;
|
|
273
|
+
return void 0;
|
|
274
|
+
}
|
|
275
|
+
function project(graph, runtime, name, factory, select) {
|
|
276
|
+
return graph.node(
|
|
277
|
+
[runtime],
|
|
278
|
+
(ctx) => {
|
|
279
|
+
for (const raw of depBatch(ctx, 0) ?? []) {
|
|
280
|
+
const selected = select(raw);
|
|
281
|
+
if (selected !== void 0) ctx.down([["DATA", selected]]);
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{ name, factory, partial: true, completeWhenDepsComplete: false, errorWhenDepsError: false }
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
function emit(ctx, fact) {
|
|
288
|
+
ctx.down([["DATA", fact]]);
|
|
289
|
+
}
|
|
290
|
+
function emptyState() {
|
|
291
|
+
return {
|
|
292
|
+
payloads: /* @__PURE__ */ new Map(),
|
|
293
|
+
activeClaims: /* @__PURE__ */ new Map(),
|
|
294
|
+
pendingOutcomes: /* @__PURE__ */ new Map(),
|
|
295
|
+
terminalClaims: /* @__PURE__ */ new Set(),
|
|
296
|
+
seenOutcomes: /* @__PURE__ */ new Set()
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function terminalizeClaim(state, key) {
|
|
300
|
+
state.terminalClaims.add(key);
|
|
301
|
+
state.activeClaims.delete(key);
|
|
302
|
+
}
|
|
303
|
+
function bufferPendingOutcome(state, key, outcome) {
|
|
304
|
+
const pending = state.pendingOutcomes.get(key) ?? [];
|
|
305
|
+
if (!pending.some((candidate) => candidate.outcomeId === outcome.outcomeId)) {
|
|
306
|
+
state.pendingOutcomes.set(key, [...pending, outcome]);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function retireClaimForRecord(state, record) {
|
|
310
|
+
if (record.kind !== "attempt-completed" && record.kind !== "work-completed" && record.kind !== "work-canceled" && record.kind !== "work-dead-lettered" && record.kind !== "work-released" && record.kind !== "lease-expired") {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
for (const [key, claim] of state.activeClaims) {
|
|
314
|
+
if (claim.workId !== record.workId) continue;
|
|
315
|
+
if ("attempt" in record && record.attempt !== claim.queueAttempt) continue;
|
|
316
|
+
terminalizeClaim(state, key);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function outcomeKey(value, attempt) {
|
|
320
|
+
return `${value.requestId}:${value.operationId}:${attempt}`;
|
|
321
|
+
}
|
|
322
|
+
function queueIssue(record, code) {
|
|
323
|
+
return {
|
|
324
|
+
kind: "issue",
|
|
325
|
+
code,
|
|
326
|
+
message: `WorkQueue record '${record.kind}' cannot be mapped to executor dispatch`,
|
|
327
|
+
refs: [`work-queue-record:${record.recordSeq}`],
|
|
328
|
+
metadata: { queueRecordKind: record.kind, workId: record.workId }
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function ref(kind, id) {
|
|
332
|
+
return { kind, id };
|
|
333
|
+
}
|
|
334
|
+
function stringRefs(refs) {
|
|
335
|
+
return refs?.map((sourceRef) => `${sourceRef.kind}:${sourceRef.id}`);
|
|
336
|
+
}
|
|
337
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
338
|
+
0 && (module.exports = {
|
|
339
|
+
executorSubmitCommand,
|
|
340
|
+
executorWorkQueueRecipe
|
|
341
|
+
});
|
|
342
|
+
//# sourceMappingURL=work-queue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/executors/work-queue.ts","../../src/protocol/messages.ts","../../src/ctx/types.ts"],"sourcesContent":["/**\n * Durable executor dispatch recipe over workQueue (D328/D331).\n *\n * Claim records become graph-visible dispatch-attempt facts. Executor outcomes become queue\n * lifecycle commands. The recipe never calls ExecutorBinding or treats a queue claim as dispatch.\n */\n\nimport { type Ctx, depBatch } from \"../ctx/types.js\";\nimport type { DataIssue } from \"../data/index.js\";\nimport type { Graph } from \"../graph/graph.js\";\nimport type { Node } from \"../node/node.js\";\nimport type {\n\tAgentRequestIssued,\n\tExecutorOutcome,\n\tSourceRef,\n} from \"../orchestration/agent-runtime.js\";\nimport type { WorkQueueCommand, WorkQueueRecord } from \"../work-queue/index.js\";\n\nexport interface ExecutorQueuedDispatchPayload {\n\treadonly kind: \"executor-queued-dispatch\";\n\treadonly requestId: string;\n\treadonly operationId: string;\n\treadonly parentRequestId?: string;\n\treadonly sourceDecisionId?: string;\n\treadonly intentId?: string;\n\treadonly inputId?: string;\n\treadonly toolCallSeriesId?: string;\n\treadonly routeId?: string;\n\treadonly profileId?: string;\n\treadonly executorId?: string;\n\treadonly effectRunId?: string;\n\treadonly promptBundleRefs?: readonly SourceRef[];\n\treadonly toolDefinitionRefs?: readonly SourceRef[];\n\treadonly policyRefs?: readonly SourceRef[];\n\treadonly budgetRefs?: readonly SourceRef[];\n\treadonly permissionRefs?: readonly SourceRef[];\n\treadonly sandboxRefs?: readonly SourceRef[];\n\treadonly sourceRefs?: readonly SourceRef[];\n\treadonly artifactRefs?: readonly SourceRef[];\n\treadonly idempotencyKey?: string;\n\treadonly requirements?: readonly string[];\n\treadonly metadata?: Record<string, unknown>;\n}\n\nexport type ExecutorQueuedDispatchPayloadExtra = Partial<\n\tOmit<ExecutorQueuedDispatchPayload, \"kind\" | \"requestId\" | \"operationId\">\n>;\n\nexport interface ExecutorQueuedDispatchAttempt {\n\treadonly kind: \"executor-queued-dispatch-attempt\";\n\treadonly workId: string;\n\treadonly leaseId: string;\n\treadonly queueAttempt: number;\n\treadonly workerId: string;\n\treadonly requestId: string;\n\treadonly operationId: string;\n\treadonly routeId?: string;\n\treadonly executorId?: string;\n\treadonly profileId?: string;\n\treadonly payload: ExecutorQueuedDispatchPayload;\n\treadonly sourceRefs?: readonly SourceRef[];\n}\n\nexport interface ExecutorWorkQueueSubmitOptions {\n\treadonly workId?: string;\n\treadonly priority?: number;\n\treadonly tags?: readonly string[];\n\treadonly requirements?: readonly string[];\n\treadonly notBeforeMs?: number;\n\treadonly deadlineMs?: number;\n}\n\nexport interface ExecutorWorkQueuePolicy {\n\treadonly submit?: (request: AgentRequestIssued) => ExecutorWorkQueueSubmitOptions;\n\treadonly payload?: (request: AgentRequestIssued) => ExecutorQueuedDispatchPayloadExtra;\n\treadonly retryableBlocked?: boolean;\n\treadonly retryableTimeout?: boolean;\n}\n\nexport interface ExecutorWorkQueueRecipeOptions {\n\treadonly name?: string;\n\treadonly requests?: Node<AgentRequestIssued>;\n\treadonly records: Node<WorkQueueRecord<ExecutorQueuedDispatchPayload>>;\n\treadonly outcomes: Node<ExecutorOutcome>;\n\treadonly workerId?: string;\n\treadonly policy?: ExecutorWorkQueuePolicy;\n}\n\nexport interface ExecutorWorkQueueRecipeBundle {\n\treadonly submitCommands?: Node<WorkQueueCommand<ExecutorQueuedDispatchPayload>>;\n\treadonly attempts: Node<ExecutorQueuedDispatchAttempt>;\n\treadonly commands: Node<WorkQueueCommand<ExecutorQueuedDispatchPayload>>;\n\treadonly issues: Node<DataIssue>;\n}\n\ntype ExecutorQueueFact =\n\t| { readonly kind: \"attempt\"; readonly attempt: ExecutorQueuedDispatchAttempt }\n\t| { readonly kind: \"command\"; readonly command: WorkQueueCommand<ExecutorQueuedDispatchPayload> }\n\t| { readonly kind: \"issue\"; readonly issue: DataIssue };\n\ninterface ExecutorQueueState {\n\treadonly payloads: Map<string, ExecutorQueuedDispatchPayload>;\n\treadonly activeClaims: Map<string, ExecutorQueuedDispatchAttempt>;\n\treadonly pendingOutcomes: Map<string, ExecutorOutcome[]>;\n\treadonly terminalClaims: Set<string>;\n\treadonly seenOutcomes: Set<string>;\n}\n\nexport function executorWorkQueueRecipe(\n\tgraph: Graph,\n\topts: ExecutorWorkQueueRecipeOptions,\n): ExecutorWorkQueueRecipeBundle {\n\tconst name = opts.name ?? \"executorWorkQueue\";\n\tconst submitCommands =\n\t\topts.requests === undefined\n\t\t\t? undefined\n\t\t\t: graph.node<WorkQueueCommand<ExecutorQueuedDispatchPayload>>(\n\t\t\t\t\t[opts.requests],\n\t\t\t\t\t(ctx) => {\n\t\t\t\t\t\tfor (const raw of depBatch(ctx, 0) ?? []) {\n\t\t\t\t\t\t\tconst request = raw as AgentRequestIssued;\n\t\t\t\t\t\t\tctx.down([[\"DATA\", executorSubmitCommand(request, opts.policy)]]);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{ name: `${name}/submitCommands`, factory: \"executorWorkQueueSubmitCommands\" },\n\t\t\t\t);\n\tconst runtime = graph.node<ExecutorQueueFact>(\n\t\t[opts.records, opts.outcomes],\n\t\t(ctx) => {\n\t\t\tconst state = ctx.state.get<ExecutorQueueState>() ?? emptyState();\n\t\t\tfor (const raw of depBatch(ctx, 0) ?? []) {\n\t\t\t\treduceRecord(ctx, state, raw as WorkQueueRecord<ExecutorQueuedDispatchPayload>, opts);\n\t\t\t}\n\t\t\tfor (const raw of depBatch(ctx, 1) ?? []) {\n\t\t\t\treduceOutcome(ctx, state, raw as ExecutorOutcome, opts);\n\t\t\t}\n\t\t\tctx.state.set(state);\n\t\t},\n\t\t{\n\t\t\tname: `${name}/runtime`,\n\t\t\tfactory: \"executorWorkQueueRuntime\",\n\t\t\tpartial: true,\n\t\t\tcompleteWhenDepsComplete: false,\n\t\t\terrorWhenDepsError: false,\n\t\t},\n\t);\n\treturn {\n\t\t...(submitCommands === undefined ? {} : { submitCommands }),\n\t\tattempts: project(graph, runtime, `${name}/attempts`, \"executorWorkQueueAttempts\", (fact) =>\n\t\t\tfact.kind === \"attempt\" ? fact.attempt : undefined,\n\t\t),\n\t\tcommands: project(graph, runtime, `${name}/commands`, \"executorWorkQueueCommands\", (fact) =>\n\t\t\tfact.kind === \"command\" ? fact.command : undefined,\n\t\t),\n\t\tissues: project(graph, runtime, `${name}/issues`, \"executorWorkQueueIssues\", (fact) =>\n\t\t\tfact.kind === \"issue\" ? fact.issue : undefined,\n\t\t),\n\t};\n}\n\nexport function executorSubmitCommand(\n\trequest: AgentRequestIssued,\n\tpolicy?: ExecutorWorkQueuePolicy,\n): WorkQueueCommand<ExecutorQueuedDispatchPayload> {\n\tconst payloadExtra = policy?.payload?.(request) ?? {};\n\tconst submit = policy?.submit?.(request) ?? {};\n\tconst payload: ExecutorQueuedDispatchPayload = {\n\t\t...payloadExtra,\n\t\tkind: \"executor-queued-dispatch\",\n\t\trequestId: request.requestId,\n\t\toperationId: request.operationId,\n\t\tparentRequestId: request.parentRequestId,\n\t\tinputId: request.input?.inputId,\n\t\teffectRunId: request.effectRunId,\n\t\tsourceRefs: request.sourceRefs,\n\t\tidempotencyKey: request.requestId,\n\t\tmetadata: request.metadata,\n\t};\n\treturn {\n\t\tkind: \"submit\",\n\t\tcommandId: `${request.requestId}:executor-work-queue-submit`,\n\t\tpayload,\n\t\tworkId: submit.workId ?? `executor:${request.requestId}`,\n\t\tpriority: submit.priority,\n\t\ttags: submit.tags ?? [\"executor\", request.requestKind],\n\t\trequirements: submit.requirements,\n\t\tnotBeforeMs: submit.notBeforeMs,\n\t\tdeadlineMs: submit.deadlineMs,\n\t\tidempotencyKey: request.requestId,\n\t\tsourceRefs: stringRefs(request.sourceRefs),\n\t};\n}\n\nfunction reduceRecord(\n\tctx: Ctx,\n\tstate: ExecutorQueueState,\n\trecord: WorkQueueRecord<ExecutorQueuedDispatchPayload>,\n\topts: ExecutorWorkQueueRecipeOptions,\n): void {\n\tif (record.kind === \"work-admitted\") {\n\t\tstate.payloads.set(record.workId, record.payload);\n\t\treturn;\n\t}\n\tretireClaimForRecord(state, record);\n\tif (record.kind !== \"work-claimed\") return;\n\tif (opts.workerId !== undefined && record.workerId !== opts.workerId) return;\n\tconst payload = state.payloads.get(record.workId);\n\tif (payload === undefined) {\n\t\temit(ctx, { kind: \"issue\", issue: queueIssue(record, \"executor-claim-without-payload\") });\n\t\treturn;\n\t}\n\tconst attempt: ExecutorQueuedDispatchAttempt = {\n\t\tkind: \"executor-queued-dispatch-attempt\",\n\t\tworkId: record.workId,\n\t\tleaseId: record.leaseId,\n\t\tqueueAttempt: record.attempt,\n\t\tworkerId: record.workerId,\n\t\trequestId: payload.requestId,\n\t\toperationId: payload.operationId,\n\t\trouteId: payload.routeId,\n\t\texecutorId: payload.executorId,\n\t\tprofileId: payload.profileId,\n\t\tpayload,\n\t\tsourceRefs: [...(payload.sourceRefs ?? []), ref(\"work-queue-record\", String(record.recordSeq))],\n\t};\n\tconst key = outcomeKey(payload, record.attempt);\n\tstate.activeClaims.set(key, attempt);\n\temit(ctx, { kind: \"attempt\", attempt });\n\tconst pending = state.pendingOutcomes.get(key);\n\tif (pending !== undefined) {\n\t\tstate.pendingOutcomes.delete(key);\n\t\tfor (const outcome of pending) {\n\t\t\tmapClaimedOutcome(ctx, state, key, attempt, outcome, opts);\n\t\t}\n\t}\n}\n\nfunction reduceOutcome(\n\tctx: Ctx,\n\tstate: ExecutorQueueState,\n\toutcome: ExecutorOutcome,\n\topts: ExecutorWorkQueueRecipeOptions,\n): void {\n\tif (state.seenOutcomes.has(outcome.outcomeId)) return;\n\tconst key = outcomeKey(outcome, outcome.attempt);\n\tif (state.terminalClaims.has(key)) {\n\t\tstate.seenOutcomes.add(outcome.outcomeId);\n\t\temit(ctx, {\n\t\t\tkind: \"issue\",\n\t\t\tissue: {\n\t\t\t\tkind: \"issue\",\n\t\t\t\tcode: \"executor-duplicate-terminal-outcome-for-queue-claim\",\n\t\t\t\tmessage: `ExecutorOutcome '${outcome.outcomeId}' arrived after the queue claim was already terminal`,\n\t\t\t\trefs: [`executor-outcome:${outcome.outcomeId}`],\n\t\t\t},\n\t\t});\n\t\treturn;\n\t}\n\tconst claim = state.activeClaims.get(key);\n\tif (claim === undefined) {\n\t\tbufferPendingOutcome(state, key, outcome);\n\t\treturn;\n\t}\n\tmapClaimedOutcome(ctx, state, key, claim, outcome, opts);\n}\n\nfunction mapClaimedOutcome(\n\tctx: Ctx,\n\tstate: ExecutorQueueState,\n\tkey: string,\n\tclaim: ExecutorQueuedDispatchAttempt,\n\toutcome: ExecutorOutcome,\n\topts: ExecutorWorkQueueRecipeOptions,\n): void {\n\tif (state.seenOutcomes.has(outcome.outcomeId)) return;\n\tstate.seenOutcomes.add(outcome.outcomeId);\n\tif (state.terminalClaims.has(key)) {\n\t\temit(ctx, {\n\t\t\tkind: \"issue\",\n\t\t\tissue: {\n\t\t\t\tkind: \"issue\",\n\t\t\t\tcode: \"executor-duplicate-terminal-outcome-for-queue-claim\",\n\t\t\t\tmessage: `ExecutorOutcome '${outcome.outcomeId}' arrived after the queue claim was already terminal`,\n\t\t\t\trefs: [`executor-outcome:${outcome.outcomeId}`, `work-queue-work:${claim.workId}`],\n\t\t\t},\n\t\t});\n\t\treturn;\n\t}\n\tif (outcome.kind === \"result\") {\n\t\tterminalizeClaim(state, key);\n\t\temit(ctx, {\n\t\t\tkind: \"command\",\n\t\t\tcommand: {\n\t\t\t\tkind: \"complete\",\n\t\t\t\tcommandId: `${outcome.outcomeId}:queue-complete`,\n\t\t\t\tworkId: claim.workId,\n\t\t\t\tleaseId: claim.leaseId,\n\t\t\t\tattempt: claim.queueAttempt,\n\t\t\t\tworkerId: claim.workerId,\n\t\t\t\tresult: outcome.result,\n\t\t\t\tsourceRefs: stringRefs(outcome.evidenceRefs),\n\t\t\t},\n\t\t});\n\t\treturn;\n\t}\n\tif (outcome.kind === \"canceled\") {\n\t\tterminalizeClaim(state, key);\n\t\temit(ctx, {\n\t\t\tkind: \"command\",\n\t\t\tcommand: {\n\t\t\t\tkind: \"cancel\",\n\t\t\t\tcommandId: `${outcome.outcomeId}:queue-cancel`,\n\t\t\t\tworkId: claim.workId,\n\t\t\t\treason: outcome.reason,\n\t\t\t\tsourceRefs: stringRefs(outcome.evidenceRefs),\n\t\t\t},\n\t\t});\n\t\treturn;\n\t}\n\tterminalizeClaim(state, key);\n\temit(ctx, {\n\t\tkind: \"command\",\n\t\tcommand: {\n\t\t\tkind: \"fail\",\n\t\t\tcommandId: `${outcome.outcomeId}:queue-fail`,\n\t\t\tworkId: claim.workId,\n\t\t\tleaseId: claim.leaseId,\n\t\t\tattempt: claim.queueAttempt,\n\t\t\tworkerId: claim.workerId,\n\t\t\terror: outcomeError(outcome),\n\t\t\tretryable: outcomeRetryable(outcome, opts.policy),\n\t\t\tsourceRefs: stringRefs(outcome.evidenceRefs),\n\t\t},\n\t});\n}\n\nfunction outcomeError(\n\toutcome: Extract<ExecutorOutcome, { kind: \"failure\" | \"timeout\" | \"blocked\" }>,\n): unknown {\n\tif (outcome.kind === \"failure\") return outcome.error;\n\tif (outcome.kind === \"timeout\") {\n\t\treturn {\n\t\t\tkind: \"issue\",\n\t\t\tcode: \"executor-timeout\",\n\t\t\tmessage: `ExecutorOutcome '${outcome.outcomeId}' timed out`,\n\t\t\tmetadata: { timeoutMs: outcome.timeoutMs },\n\t\t} satisfies DataIssue;\n\t}\n\treturn {\n\t\tkind: \"issue\",\n\t\tcode: \"executor-blocked\",\n\t\tmessage: `ExecutorOutcome '${outcome.outcomeId}' blocked`,\n\t\tmetadata: { needs: outcome.needs },\n\t} satisfies DataIssue;\n}\n\nfunction outcomeRetryable(\n\toutcome: ExecutorOutcome,\n\tpolicy: ExecutorWorkQueuePolicy | undefined,\n): boolean | undefined {\n\tif (outcome.kind === \"failure\") return outcome.retryable;\n\tif (outcome.kind === \"timeout\") return outcome.retryable ?? policy?.retryableTimeout;\n\tif (outcome.kind === \"blocked\") return policy?.retryableBlocked;\n\treturn undefined;\n}\n\nfunction project<T>(\n\tgraph: Graph,\n\truntime: Node<ExecutorQueueFact>,\n\tname: string,\n\tfactory: string,\n\tselect: (fact: ExecutorQueueFact) => T | undefined,\n): Node<T> {\n\treturn graph.node<T>(\n\t\t[runtime],\n\t\t(ctx) => {\n\t\t\tfor (const raw of depBatch(ctx, 0) ?? []) {\n\t\t\t\tconst selected = select(raw as ExecutorQueueFact);\n\t\t\t\tif (selected !== undefined) ctx.down([[\"DATA\", selected]]);\n\t\t\t}\n\t\t},\n\t\t{ name, factory, partial: true, completeWhenDepsComplete: false, errorWhenDepsError: false },\n\t);\n}\n\nfunction emit(ctx: Ctx, fact: ExecutorQueueFact): void {\n\tctx.down([[\"DATA\", fact]]);\n}\n\nfunction emptyState(): ExecutorQueueState {\n\treturn {\n\t\tpayloads: new Map(),\n\t\tactiveClaims: new Map(),\n\t\tpendingOutcomes: new Map(),\n\t\tterminalClaims: new Set(),\n\t\tseenOutcomes: new Set(),\n\t};\n}\n\nfunction terminalizeClaim(state: ExecutorQueueState, key: string): void {\n\tstate.terminalClaims.add(key);\n\tstate.activeClaims.delete(key);\n}\n\nfunction bufferPendingOutcome(\n\tstate: ExecutorQueueState,\n\tkey: string,\n\toutcome: ExecutorOutcome,\n): void {\n\tconst pending = state.pendingOutcomes.get(key) ?? [];\n\tif (!pending.some((candidate) => candidate.outcomeId === outcome.outcomeId)) {\n\t\tstate.pendingOutcomes.set(key, [...pending, outcome]);\n\t}\n}\n\nfunction retireClaimForRecord(\n\tstate: ExecutorQueueState,\n\trecord: WorkQueueRecord<ExecutorQueuedDispatchPayload>,\n): void {\n\tif (\n\t\trecord.kind !== \"attempt-completed\" &&\n\t\trecord.kind !== \"work-completed\" &&\n\t\trecord.kind !== \"work-canceled\" &&\n\t\trecord.kind !== \"work-dead-lettered\" &&\n\t\trecord.kind !== \"work-released\" &&\n\t\trecord.kind !== \"lease-expired\"\n\t) {\n\t\treturn;\n\t}\n\tfor (const [key, claim] of state.activeClaims) {\n\t\tif (claim.workId !== record.workId) continue;\n\t\tif (\"attempt\" in record && record.attempt !== claim.queueAttempt) continue;\n\t\tterminalizeClaim(state, key);\n\t}\n}\n\nfunction outcomeKey(\n\tvalue: Pick<ExecutorQueuedDispatchPayload | ExecutorOutcome, \"requestId\" | \"operationId\">,\n\tattempt: number,\n): string {\n\treturn `${value.requestId}:${value.operationId}:${attempt}`;\n}\n\nfunction queueIssue(record: WorkQueueRecord, code: string): DataIssue {\n\treturn {\n\t\tkind: \"issue\",\n\t\tcode,\n\t\tmessage: `WorkQueue record '${record.kind}' cannot be mapped to executor dispatch`,\n\t\trefs: [`work-queue-record:${record.recordSeq}`],\n\t\tmetadata: { queueRecordKind: record.kind, workId: record.workId },\n\t};\n}\n\nfunction ref(kind: string, id: string): SourceRef {\n\treturn { kind, id };\n}\n\nfunction stringRefs(refs: readonly SourceRef[] | undefined): readonly string[] | undefined {\n\treturn refs?.map((sourceRef) => `${sourceRef.kind}:${sourceRef.id}`);\n}\n","/**\n * Wave-protocol message types and the tier const table.\n *\n * Canonical authority: ~/src/graphrefly/spec/rules.jsonl\n * R-msg-format, R-msg-closed-set, R-tier (D34), R-data-payload, R-sentinel.\n */\n\n/** Opaque pause-lock / pull identifier (R-pause-lockset, R-pull). */\nexport type LockId = string | symbol;\n\n/** Explicit pull demand payload (D269/D272). Params are holder-visible context, never DATA-up. */\nexport interface PullDemand {\n\treadonly pullId: LockId;\n\treadonly params?: unknown;\n}\n\n/**\n * The CLOSED set of 11 message types (R-msg-closed-set / D9 + D269 + START handshake).\n * No open set, no user-defined custom types. Adding a type is a spec change.\n */\nexport type Message =\n\t| readonly [\"START\"]\n\t| readonly [\"DIRTY\"]\n\t| readonly [\"DATA\", unknown]\n\t| readonly [\"RESOLVED\"]\n\t| readonly [\"INVALIDATE\"]\n\t| readonly [\"COMPLETE\"]\n\t| readonly [\"ERROR\", unknown]\n\t| readonly [\"TEARDOWN\"]\n\t| readonly [\"PAUSE\", LockId]\n\t| readonly [\"RESUME\", LockId]\n\t| readonly [\"PULL\", PullDemand];\n\n/** One array of messages delivered in one call = one Wave (R-wave-boundary). */\nexport type Wave = readonly Message[];\n\n/** The message-type tag (the first tuple element). */\nexport type MessageType = Message[0];\n\n/**\n * SENTINEL = absence-of-DATA (R-sentinel / D16). TS representation is `undefined`.\n * Never a valid DATA payload; `null` IS a valid DATA value (domain-level absence).\n */\nexport const SENTINEL = undefined;\n\n/** R-data-payload: ERROR payloads must not collide with terminal metadata shorthand. */\nexport function isInvalidErrorPayload(v: unknown): boolean {\n\treturn v === SENTINEL || typeof v === \"boolean\";\n}\n\n/** R-data-payload / D78: host-language failures that collide with ctx.terminal shorthand become diagnostics. */\nexport function errorPayload(reason: unknown, fallback = \"error without a valid payload\"): unknown {\n\treturn isInvalidErrorPayload(reason) ? new Error(fallback) : reason;\n}\n\nexport const TIER_START = 0;\nexport const TIER_CONTROL = 1;\nexport const TIER_NOTIFICATION = 2;\nexport const TIER_VALUE = 3;\nexport const TIER_SETTLE = 4;\nexport const TIER_TERMINAL = 5;\nexport const TIER_TEARDOWN = 6;\n\n/**\n * Tier const table (R-tier / D34). Tiers below value dispatch immediately; value\n * and above are batch-deferred. This is a compile-time const table (D18), not runtime config.\n */\nconst TIER: Record<MessageType, number> = {\n\tSTART: TIER_START,\n\tPAUSE: TIER_CONTROL,\n\tRESUME: TIER_CONTROL,\n\tPULL: TIER_CONTROL,\n\tDIRTY: TIER_NOTIFICATION,\n\tDATA: TIER_VALUE,\n\tRESOLVED: TIER_VALUE,\n\tINVALIDATE: TIER_SETTLE,\n\tCOMPLETE: TIER_TERMINAL,\n\tERROR: TIER_TERMINAL,\n\tTEARDOWN: TIER_TEARDOWN,\n};\n\nexport function messageTier(t: MessageType): number {\n\treturn TIER[t];\n}\n\n/** Value and above are deferred inside a batch (DATA/RESOLVED/INVALIDATE/terminal/teardown). */\nexport function isDeferredTier(t: MessageType): boolean {\n\treturn TIER[t] >= TIER_VALUE;\n}\n\n/** Value-tier messages (DATA/RESOLVED) occupy the tier-3 slot. */\nexport function isValueTier(t: MessageType): boolean {\n\treturn TIER[t] === TIER_VALUE;\n}\n\n/** The pause buffer holds the settle slice only: value-tier DATA/RESOLVED plus INVALIDATE. */\nexport function isPauseBufferedTier(t: MessageType): boolean {\n\tconst tier = TIER[t];\n\treturn tier === TIER_VALUE || tier === TIER_SETTLE;\n}\n\n/**\n * A TERMINAL message = tier 5 (COMPLETE | ERROR), R-tier / D34. Detected via the CENTRAL tier\n * table, NOT a per-variant `=== \"COMPLETE\" || === \"ERROR\"` check — so terminal routing stays\n * driven by the one const table (feedback_use_tier_for_signal_routing); discriminate COMPLETE vs\n * ERROR within the tier by the message type only where the handling actually differs.\n */\nexport function isTerminal(t: MessageType): boolean {\n\treturn TIER[t] === TIER_TERMINAL;\n}\n\n/**\n * ctx.up carries control/demand tiers only (R-ctx-up / D269): DIRTY, PAUSE, RESUME, PULL,\n * INVALIDATE, TEARDOWN. DATA/RESOLVED (tier 3) and COMPLETE/ERROR (tier 5) are\n * down-only.\n */\nexport function isUpAllowed(t: MessageType): boolean {\n\tconst tier = TIER[t];\n\treturn tier !== TIER_VALUE && tier !== TIER_TERMINAL;\n}\n","/**\n * The fn-invocation context and per-dep input shapes.\n *\n * Canonical authority: ~/src/graphrefly/spec/rules.jsonl\n * R-fn-contract (D8/D27), R-ctx-state (D23/D29), R-cleanup-hooks (D28), R-ctx-up.\n */\n\nimport type { Dispatcher } from \"../dispatcher/index.js\";\nimport type { EnvironmentDrivers } from \"../graph/environment.js\";\nimport type { Node } from \"../node/node.js\";\nimport { type Message, type PullDemand, SENTINEL, type Wave } from \"../protocol/messages.js\";\n\n/** A downstream sink callback (the only way to connect to a node's output). */\nexport type Sink = (msg: Message, delivery?: DeliveryMeta) => void;\n\n/** Internal delivery metadata used to preserve the upstream `ctx.down(msgs)` wave boundary. */\nexport interface DeliveryMeta {\n\treadonly wave: object;\n\treadonly last: boolean;\n}\n\n/**\n * Internal current-value reader. It is deliberately a symbol-backed implementation detail:\n * raw ctx exposes `waveData` + `terminal`; helpers below derive from that plus this dep cache.\n */\nexport const CTX_DEP_CACHE: unique symbol = Symbol(\"graphrefly.ctx.depCache\");\n\nexport interface CtxDepCache {\n\treadonly latest: readonly unknown[];\n}\n\n/** Internal node-construction binding for graph-local helper-created deps. */\nexport const CTX_NODE_BINDING: unique symbol = Symbol(\"graphrefly.ctx.nodeBinding\");\n\nexport interface CtxNodeBinding {\n\treadonly dispatcher: Dispatcher;\n\tcreate<T>(factory: () => Node<T>): Node<T>;\n}\n\n/** Per-dep wave projections: dep -> waves -> values/SENTINEL markers. */\nexport type WaveData = readonly (readonly (readonly unknown[])[])[];\n\n/** Terminal metadata parallel to `waveData`: false = none, true = COMPLETE, otherwise ERROR payload. */\nexport type TerminalData = readonly unknown[];\n\nexport function isTerminalNone(t: unknown): boolean {\n\treturn t === false || t === undefined;\n}\n\nexport function isTerminalComplete(t: unknown): t is true {\n\treturn t === true;\n}\n\nexport function isTerminalError(t: unknown): boolean {\n\treturn !isTerminalNone(t) && !isTerminalComplete(t);\n}\n\nexport function terminalErrorValue(t: unknown): unknown {\n\treturn isTerminalError(t) ? t : undefined;\n}\n\n/**\n * Per-node private cross-wave state (R-ctx-state / D23,D29). Default fresh-lifecycle\n * wipe; `persist(true)` keeps it across lifecycle transitions.\n */\nexport interface CtxState {\n\tget<S = unknown>(): S | undefined;\n\tset<S = unknown>(v: S): void;\n\tpersist(on?: boolean): void;\n}\n\n/**\n * Deferred SELF-rewire (R-rewire-deferred / D47). A node fn may, DURING its run, request a\n * mutation of its OWN dep set; the request is QUEUED and applied at the committed wave boundary\n * (after the current wave settles / batch commit / final-lock RESUME) as a fresh wave, reusing\n * R-rewire surgical/Option-C semantics (D42). This is the ONLY legal self-triggered rewire — an\n * IMMEDIATE in-fn `node.subscribeDep/unsubscribeDep/replaceDeps` is the D37 mid-fn feedback-cycle ERROR. An\n * added cached dep pushes `[DIRTY,DATA]` on the boundary wave (R-push-subscribe); a removed dep\n * is drained and, if it loses its last subscriber, `_deactivate`s + fires `onDeactivation`\n * (input-side teardown — the basis for higher-order operator cancellation / abortInFlight).\n */\nexport interface RewireNext {\n\t/** Defer subscribing to a dep (paired with the re-supplied fn — positional fn-deps lock, SD-1). */\n\tsubscribeDep(dep: Node<unknown>, fn: NodeFn): void;\n\t/** Defer unsubscribing from a dep (its source is torn down if it loses its last subscriber). */\n\tunsubscribeDep(dep: Node<unknown>, fn: NodeFn): void;\n\t/** Defer replacing the whole dep set (surgical: kept deps untouched, removed drained, added fresh-subscribe). */\n\treplaceDeps(deps: Node<unknown>[], fn: NodeFn): void;\n}\n\n/**\n * The single argument to a node fn: `(ctx) => void` (R-fn-contract / D8). All emission\n * is explicit via `ctx.down`; there is no return-value framing.\n */\nexport interface Ctx {\n\t/**\n\t * Emit upstream toward deps — control tiers only (R-ctx-up). IMMEDIATE. `towardDep` (a dep index)\n\t * routes the wave up ONE declared edge (R-up-routing directed-up); omitted = broadcast up all deps.\n\t * A pull DEMAND is `up([[PULL, { pullId, params }]])` — but for a SELF-demand (demanding a dep\n\t * this fn also reads) use {@link Ctx.upNext} instead, since an immediate demand whose delivery loops back\n\t * re-enters this fn mid-wave (D37 / R-reentrancy).\n\t */\n\tup(msgs: Wave, towardDep?: number): void;\n\t/** Emit downstream toward sinks. */\n\tdown(msgs: Wave): void;\n\t/**\n\t * The single raw dep-value input surface (R-ctx-wave-data / D77): dep -> upstream waves ->\n\t * per-wave DATA payloads and INVALIDATE/SENTINEL markers. `waveData[i] = []` means dep i\n\t * delivered no wave to this invocation; `waveData[i] = [[]]` means RESOLVED-only.\n\t */\n\twaveData: WaveData;\n\t/** Terminal metadata for the same invocation; terminal values never enter `waveData`. */\n\tterminal: TerminalData;\n\tstate: CtxState;\n\t/** Release external resources on deactivation (R-cleanup-hooks). */\n\tonDeactivation(fn: () => void): void;\n\t/** Flush on INVALIDATE (R-cleanup-hooks). */\n\tonInvalidate(fn: () => void): void;\n\t/** Graph-owned environment drivers for source/adapter boundaries (D130/D131). */\n\tenvironment(): EnvironmentDrivers;\n\t/** Holder-visible context for a PULL-caused invocation (D272); absent for ordinary waves. */\n\treadonly pull?: PullDemand;\n\t/**\n\t * Deferred SELF-rewire (R-rewire-deferred / D47) — the substrate affordance higher-order\n\t * operators (switchMap/mergeMap/concatMap/exhaustMap/flatMap) use to grow/shrink their own\n\t * inner-source dep set in response to their own data. Always present; see {@link RewireNext}.\n\t */\n\trewireNext: RewireNext;\n\t/**\n\t * Deferred up — the boundary-deferred form of {@link Ctx.up} (R-up-routing / R-pull / D59). Routes\n\t * `msgs` up from this node at the COMMITTED wave boundary (broadcast, or up the single `towardDep`\n\t * edge), riding the same R-rewire-deferred (D47) drain as {@link RewireNext}. This is the\n\t * SELF-DEMAND path: a consumer issues `ctx.upNext([[PULL, { pullId, params }]])` to demand a pull\n\t * dep it ALSO reads — the cone-routed PULL reaches the pullId-holder, whose delivery loops back as a\n\t * FRESH wave (not a mid-fn re-entry → no D37). The consumer accepts one-wave latency (the\n\t * HTTP-request model). No node reference needed: the author writes the pullId verbatim.\n\t */\n\tupNext(msgs: Wave, towardDep?: number): void;\n\t/**\n\t * Read a dep's latest value by index (dynamicNode only, R-dynamic-node / D35).\n\t * Present only on dynamicNode fns; all declared deps still participate in wave\n\t * tracking. Under D49/R-resolved-undirty an unread dep's change still fires the fn,\n\t * which re-emits its (unchanged) output as a DATA occurrence — there is NO equals-\n\t * absorption; pair with distinctUntilChanged to suppress unchanged re-emits (opt-in).\n\t */\n\ttrack?(depIndex: number): unknown;\n\t[CTX_DEP_CACHE]?: CtxDepCache;\n\t[CTX_NODE_BINDING]?: CtxNodeBinding;\n}\n\n/** A node fn (R-fn-contract). Registered in a dispatcher pool, indexed by Handle. */\nexport type NodeFn = (ctx: Ctx) => void;\n\n/** Number of declared dep slots visible in this invocation. */\nexport function depCount(ctx: Ctx): number {\n\treturn ctx.waveData.length;\n}\n\n/** DATA/SENTINEL projection batches delivered by one dep in this invocation. */\nexport function depWaves(ctx: Ctx, depIndex: number): readonly (readonly unknown[])[] {\n\treturn ctx.waveData[depIndex] ?? [];\n}\n\n/** Flattened DATA projection for old event-counting operator bodies; null = no wave. */\nexport function depBatch(ctx: Ctx, depIndex: number): readonly unknown[] | null {\n\tconst waves = depWaves(ctx, depIndex);\n\tif (waves.length === 0) return null;\n\tconst flattened = waves.flat().filter((v) => v !== SENTINEL);\n\treturn flattened.length === 0 ? [] : flattened;\n}\n\n/** Latest cached DATA for a dep, derived from implementation-owned dep cache. */\nexport function depLatest(ctx: Ctx, depIndex: number): unknown {\n\treturn ctx[CTX_DEP_CACHE]?.latest[depIndex];\n}\n\n/** Terminal metadata for one dep: false = none, true = COMPLETE, otherwise ERROR payload. */\nexport function depTerminal(ctx: Ctx, depIndex: number): unknown {\n\tconst t = ctx.terminal[depIndex];\n\treturn t === undefined ? false : t;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC2CO,IAAM,WAAW;;;ACoHjB,SAAS,SAAS,KAAU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AO,SAAS,oBAChB,OAAO,SAAS,mBAChB,OAAO,SAAS,wBAChB,OAAO,SAAS,mBAChB,OAAO,SAAS,iBACf;AACD;AAAA,EACD;AACA,aAAW,CAAC,KAAK,KAAK,KAAK,MAAM,cAAc;AAC9C,QAAI,MAAM,WAAW,OAAO,OAAQ;AACpC,QAAI,aAAa,UAAU,OAAO,YAAY,MAAM,aAAc;AAClE,qBAAiB,OAAO,GAAG;AAAA,EAC5B;AACD;AAEA,SAAS,WACR,OACA,SACS;AACT,SAAO,GAAG,MAAM,SAAS,IAAI,MAAM,WAAW,IAAI,OAAO;AAC1D;AAEA,SAAS,WAAW,QAAyB,MAAyB;AACrE,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA,SAAS,qBAAqB,OAAO,IAAI;AAAA,IACzC,MAAM,CAAC,qBAAqB,OAAO,SAAS,EAAE;AAAA,IAC9C,UAAU,EAAE,iBAAiB,OAAO,MAAM,QAAQ,OAAO,OAAO;AAAA,EACjE;AACD;AAEA,SAAS,IAAI,MAAc,IAAuB;AACjD,SAAO,EAAE,MAAM,GAAG;AACnB;AAEA,SAAS,WAAW,MAAuE;AAC1F,SAAO,MAAM,IAAI,CAAC,cAAc,GAAG,UAAU,IAAI,IAAI,UAAU,EAAE,EAAE;AACpE;","names":[]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { DataIssue } from '../data/index.cjs';
|
|
2
|
+
import { d as Graph } from '../graph-DCEWh4T2.cjs';
|
|
3
|
+
import { N as Node } from '../types-CcPIn7sy.cjs';
|
|
4
|
+
import { S as SourceRef, A as AgentRequestIssued, E as ExecutorOutcome } from '../agent-runtime-DZTJ3C-p.cjs';
|
|
5
|
+
import { WorkQueueCommand, WorkQueueRecord } from '../work-queue/index.cjs';
|
|
6
|
+
import '../core/index.cjs';
|
|
7
|
+
import '../messages-CAzUPPJM.cjs';
|
|
8
|
+
import '../codec-BB7p8fJc.cjs';
|
|
9
|
+
import '../describe-DYMw_l1C.cjs';
|
|
10
|
+
import '../messaging/index.cjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Durable executor dispatch recipe over workQueue (D328/D331).
|
|
14
|
+
*
|
|
15
|
+
* Claim records become graph-visible dispatch-attempt facts. Executor outcomes become queue
|
|
16
|
+
* lifecycle commands. The recipe never calls ExecutorBinding or treats a queue claim as dispatch.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
interface ExecutorQueuedDispatchPayload {
|
|
20
|
+
readonly kind: "executor-queued-dispatch";
|
|
21
|
+
readonly requestId: string;
|
|
22
|
+
readonly operationId: string;
|
|
23
|
+
readonly parentRequestId?: string;
|
|
24
|
+
readonly sourceDecisionId?: string;
|
|
25
|
+
readonly intentId?: string;
|
|
26
|
+
readonly inputId?: string;
|
|
27
|
+
readonly toolCallSeriesId?: string;
|
|
28
|
+
readonly routeId?: string;
|
|
29
|
+
readonly profileId?: string;
|
|
30
|
+
readonly executorId?: string;
|
|
31
|
+
readonly effectRunId?: string;
|
|
32
|
+
readonly promptBundleRefs?: readonly SourceRef[];
|
|
33
|
+
readonly toolDefinitionRefs?: readonly SourceRef[];
|
|
34
|
+
readonly policyRefs?: readonly SourceRef[];
|
|
35
|
+
readonly budgetRefs?: readonly SourceRef[];
|
|
36
|
+
readonly permissionRefs?: readonly SourceRef[];
|
|
37
|
+
readonly sandboxRefs?: readonly SourceRef[];
|
|
38
|
+
readonly sourceRefs?: readonly SourceRef[];
|
|
39
|
+
readonly artifactRefs?: readonly SourceRef[];
|
|
40
|
+
readonly idempotencyKey?: string;
|
|
41
|
+
readonly requirements?: readonly string[];
|
|
42
|
+
readonly metadata?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
type ExecutorQueuedDispatchPayloadExtra = Partial<Omit<ExecutorQueuedDispatchPayload, "kind" | "requestId" | "operationId">>;
|
|
45
|
+
interface ExecutorQueuedDispatchAttempt {
|
|
46
|
+
readonly kind: "executor-queued-dispatch-attempt";
|
|
47
|
+
readonly workId: string;
|
|
48
|
+
readonly leaseId: string;
|
|
49
|
+
readonly queueAttempt: number;
|
|
50
|
+
readonly workerId: string;
|
|
51
|
+
readonly requestId: string;
|
|
52
|
+
readonly operationId: string;
|
|
53
|
+
readonly routeId?: string;
|
|
54
|
+
readonly executorId?: string;
|
|
55
|
+
readonly profileId?: string;
|
|
56
|
+
readonly payload: ExecutorQueuedDispatchPayload;
|
|
57
|
+
readonly sourceRefs?: readonly SourceRef[];
|
|
58
|
+
}
|
|
59
|
+
interface ExecutorWorkQueueSubmitOptions {
|
|
60
|
+
readonly workId?: string;
|
|
61
|
+
readonly priority?: number;
|
|
62
|
+
readonly tags?: readonly string[];
|
|
63
|
+
readonly requirements?: readonly string[];
|
|
64
|
+
readonly notBeforeMs?: number;
|
|
65
|
+
readonly deadlineMs?: number;
|
|
66
|
+
}
|
|
67
|
+
interface ExecutorWorkQueuePolicy {
|
|
68
|
+
readonly submit?: (request: AgentRequestIssued) => ExecutorWorkQueueSubmitOptions;
|
|
69
|
+
readonly payload?: (request: AgentRequestIssued) => ExecutorQueuedDispatchPayloadExtra;
|
|
70
|
+
readonly retryableBlocked?: boolean;
|
|
71
|
+
readonly retryableTimeout?: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface ExecutorWorkQueueRecipeOptions {
|
|
74
|
+
readonly name?: string;
|
|
75
|
+
readonly requests?: Node<AgentRequestIssued>;
|
|
76
|
+
readonly records: Node<WorkQueueRecord<ExecutorQueuedDispatchPayload>>;
|
|
77
|
+
readonly outcomes: Node<ExecutorOutcome>;
|
|
78
|
+
readonly workerId?: string;
|
|
79
|
+
readonly policy?: ExecutorWorkQueuePolicy;
|
|
80
|
+
}
|
|
81
|
+
interface ExecutorWorkQueueRecipeBundle {
|
|
82
|
+
readonly submitCommands?: Node<WorkQueueCommand<ExecutorQueuedDispatchPayload>>;
|
|
83
|
+
readonly attempts: Node<ExecutorQueuedDispatchAttempt>;
|
|
84
|
+
readonly commands: Node<WorkQueueCommand<ExecutorQueuedDispatchPayload>>;
|
|
85
|
+
readonly issues: Node<DataIssue>;
|
|
86
|
+
}
|
|
87
|
+
declare function executorWorkQueueRecipe(graph: Graph, opts: ExecutorWorkQueueRecipeOptions): ExecutorWorkQueueRecipeBundle;
|
|
88
|
+
declare function executorSubmitCommand(request: AgentRequestIssued, policy?: ExecutorWorkQueuePolicy): WorkQueueCommand<ExecutorQueuedDispatchPayload>;
|
|
89
|
+
|
|
90
|
+
export { type ExecutorQueuedDispatchAttempt, type ExecutorQueuedDispatchPayload, type ExecutorQueuedDispatchPayloadExtra, type ExecutorWorkQueuePolicy, type ExecutorWorkQueueRecipeBundle, type ExecutorWorkQueueRecipeOptions, type ExecutorWorkQueueSubmitOptions, executorSubmitCommand, executorWorkQueueRecipe };
|