@graphrefly/ts 0.0.0 → 0.0.2
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/actions-types-CSC3NMDl.d.ts +657 -0
- package/dist/actions-types-wl9Mgkmr.d.cts +657 -0
- package/dist/adapters/index.cjs +5219 -2974
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +204 -192
- package/dist/adapters/index.d.ts +204 -192
- package/dist/adapters/index.js +3685 -1833
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/nestjs/microservices.cjs +841 -0
- package/dist/adapters/nestjs/microservices.cjs.map +1 -0
- package/dist/adapters/nestjs/microservices.d.cts +45 -0
- package/dist/adapters/nestjs/microservices.d.ts +45 -0
- package/dist/adapters/nestjs/microservices.js +206 -0
- package/dist/adapters/nestjs/microservices.js.map +1 -0
- package/dist/adapters/nestjs/native.cjs +1391 -0
- package/dist/adapters/nestjs/native.cjs.map +1 -0
- package/dist/adapters/nestjs/native.d.cts +111 -0
- package/dist/adapters/nestjs/native.d.ts +111 -0
- package/dist/adapters/nestjs/native.js +577 -0
- package/dist/adapters/nestjs/native.js.map +1 -0
- package/dist/adapters/nestjs/websockets.cjs +924 -0
- package/dist/adapters/nestjs/websockets.cjs.map +1 -0
- package/dist/adapters/nestjs/websockets.d.cts +47 -0
- package/dist/adapters/nestjs/websockets.d.ts +47 -0
- package/dist/adapters/nestjs/websockets.js +286 -0
- package/dist/adapters/nestjs/websockets.js.map +1 -0
- package/dist/adapters/nestjs.cjs +1085 -0
- package/dist/adapters/nestjs.cjs.map +1 -0
- package/dist/adapters/nestjs.d.cts +385 -0
- package/dist/adapters/nestjs.d.ts +385 -0
- package/dist/adapters/nestjs.js +112 -0
- package/dist/adapters/nestjs.js.map +1 -0
- package/dist/adapters/observe-storage.d.cts +4 -4
- package/dist/adapters/observe-storage.d.ts +4 -4
- package/dist/adapters/observe-storage.js +5 -4
- 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-types-core-CaXfKNtY.d.cts +406 -0
- package/dist/agent-runtime-types-core-hU299uIC.d.ts +406 -0
- package/dist/agent-runtime-types-tool-BEpSINol.d.ts +695 -0
- package/dist/agent-runtime-types-tool-DninPEzk.d.cts +695 -0
- package/dist/agentic-memory-retention-BmGX368S.d.ts +14 -0
- package/dist/agentic-memory-retention-Ih1qhX9Z.d.cts +14 -0
- package/dist/agentic-memory-types-CVSUS6XR.d.ts +473 -0
- package/dist/agentic-memory-types-FnnYlVUs.d.cts +473 -0
- package/dist/capability-admission-BW2CziT6.d.ts +102 -0
- package/dist/capability-admission-lwSecxXs.d.cts +102 -0
- package/dist/chunk-2KUAG2GZ.js +9693 -0
- package/dist/chunk-2KUAG2GZ.js.map +1 -0
- package/dist/chunk-2NJP6GO4.js +1320 -0
- package/dist/chunk-2NJP6GO4.js.map +1 -0
- package/dist/{chunk-GDL26N2T.js → chunk-3KN7NJDR.js} +2 -2
- package/dist/{chunk-COHO25CZ.js → chunk-4NWSNI4K.js} +2232 -1672
- package/dist/chunk-4NWSNI4K.js.map +1 -0
- package/dist/{chunk-Z2ANQ6JW.js → chunk-4Q77MMJY.js} +2 -2
- package/dist/chunk-6E76H4OU.js +132 -0
- package/dist/chunk-6E76H4OU.js.map +1 -0
- package/dist/chunk-7GOTIIQ7.js +819 -0
- package/dist/chunk-7GOTIIQ7.js.map +1 -0
- package/dist/{chunk-D6BG7U6A.js → chunk-7HZRJMN6.js} +3 -3
- package/dist/{chunk-SCRFRCGR.js → chunk-BSQGE5PS.js} +1 -1
- package/dist/{chunk-PKVBHGBM.js → chunk-CJIFGJQG.js} +7 -7
- package/dist/{chunk-G4M3NHRJ.js → chunk-CX6B6PO2.js} +93 -10
- package/dist/chunk-CX6B6PO2.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +11 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/{chunk-JIMUDQN3.js → chunk-E4QCH32M.js} +449 -447
- package/dist/chunk-E4QCH32M.js.map +1 -0
- package/dist/{chunk-RIIOUTGM.js → chunk-ECURQ3HD.js} +19 -129
- package/dist/chunk-ECURQ3HD.js.map +1 -0
- package/dist/{chunk-2ILL7HQI.js → chunk-EOKT4QFF.js} +134 -128
- package/dist/chunk-EOKT4QFF.js.map +1 -0
- package/dist/{chunk-K3FXTC3I.js → chunk-HJACH5PU.js} +3 -3
- package/dist/{chunk-GTPCOEOZ.js → chunk-IDMLXLLG.js} +3 -3
- package/dist/{chunk-DKP56CSW.js → chunk-JKAYLDQV.js} +2 -2
- package/dist/{chunk-4VLAQHZI.js → chunk-K7FB3JTD.js} +17 -1
- package/dist/chunk-K7FB3JTD.js.map +1 -0
- package/dist/chunk-L6LDXRWE.js +219 -0
- package/dist/chunk-L6LDXRWE.js.map +1 -0
- package/dist/chunk-M7J6Z4IJ.js +1930 -0
- package/dist/chunk-M7J6Z4IJ.js.map +1 -0
- package/dist/chunk-MQEQMS7B.js +1009 -0
- package/dist/chunk-MQEQMS7B.js.map +1 -0
- package/dist/chunk-MTELVIYR.js +1421 -0
- package/dist/chunk-MTELVIYR.js.map +1 -0
- package/dist/chunk-PVC7WDKI.js +885 -0
- package/dist/chunk-PVC7WDKI.js.map +1 -0
- package/dist/chunk-RAHNUYA5.js +368 -0
- package/dist/chunk-RAHNUYA5.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-I3IHOHCJ.js → chunk-SHZDP2MQ.js} +1181 -1001
- package/dist/chunk-SHZDP2MQ.js.map +1 -0
- package/dist/{chunk-Y3ZLRGHC.js → chunk-SIDJO2T4.js} +16 -16
- package/dist/chunk-STXRMPW4.js +4131 -0
- package/dist/chunk-STXRMPW4.js.map +1 -0
- package/dist/{chunk-JR4IKCR2.js → chunk-TPND5MJS.js} +5 -5
- package/dist/chunk-TQPCAIQI.js +612 -0
- package/dist/chunk-TQPCAIQI.js.map +1 -0
- package/dist/chunk-UT3MHJCW.js +49 -0
- package/dist/chunk-UT3MHJCW.js.map +1 -0
- package/dist/{chunk-TEW47IVR.js → chunk-VPEFSDME.js} +2 -2
- package/dist/{chunk-SWTLEQL6.js → chunk-WQIA3GFB.js} +2 -2
- package/dist/chunk-WQIA3GFB.js.map +1 -0
- package/dist/{chunk-DJC4CHLQ.js → chunk-YDWBXXQZ.js} +5 -5
- package/dist/{chunk-6PHB5CJS.js → chunk-ZLFRB6FI.js} +2 -2
- package/dist/composition/index.cjs +1256 -1059
- 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 +7 -6
- package/dist/core/index.cjs +1218 -1021
- 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 +1252 -1052
- package/dist/data-structures/index.cjs.map +1 -1
- package/dist/data-structures/index.d.cts +9 -8
- package/dist/data-structures/index.d.ts +9 -8
- package/dist/data-structures/index.js +9 -7
- package/dist/{describe-BZb7AS2y.d.ts → describe-B_A5fbXH.d.ts} +1 -1
- package/dist/{describe-Ciu8SUnN.d.cts → describe-CQRrkv-Q.d.cts} +1 -1
- package/dist/executors/tool-provider-adapters.cjs +3091 -0
- package/dist/executors/tool-provider-adapters.cjs.map +1 -0
- package/dist/executors/tool-provider-adapters.d.cts +174 -0
- package/dist/executors/tool-provider-adapters.d.ts +174 -0
- package/dist/executors/tool-provider-adapters.js +1336 -0
- package/dist/executors/tool-provider-adapters.js.map +1 -0
- package/dist/executors/tool-provider-runtime.cjs +5178 -0
- package/dist/executors/tool-provider-runtime.cjs.map +1 -0
- package/dist/executors/tool-provider-runtime.d.cts +17 -0
- package/dist/executors/tool-provider-runtime.d.ts +17 -0
- package/dist/executors/tool-provider-runtime.js +15 -0
- package/dist/executors/tool-provider-runtime.js.map +1 -0
- package/dist/executors/tool-provider.cjs +6392 -0
- package/dist/executors/tool-provider.cjs.map +1 -0
- package/dist/executors/tool-provider.d.cts +60 -0
- package/dist/executors/tool-provider.d.ts +60 -0
- package/dist/executors/tool-provider.js +89 -0
- package/dist/executors/tool-provider.js.map +1 -0
- 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 +1536 -1324
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +10 -9
- package/dist/graph/index.d.ts +10 -9
- package/dist/graph/index.js +22 -20
- package/dist/{graph-s23RbbFO.d.cts → graph-CWK3HLPB.d.cts} +134 -132
- package/dist/{graph-DfdF9zy4.d.ts → graph-ho5sotHP.d.ts} +134 -132
- package/dist/{index-SnzZu3x7.d.ts → index-CQWcE0Dw.d.ts} +18 -4
- package/dist/{index-CAEmLCYF.d.cts → index-DHA1i67c.d.cts} +18 -4
- package/dist/index.cjs +3331 -3020
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.js +114 -108
- 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/measurements-C0mAvWU1.d.cts +164 -0
- package/dist/measurements-OMpCeBwh.d.ts +164 -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 +756 -619
- package/dist/messaging/index.cjs.map +1 -1
- package/dist/messaging/index.d.cts +17 -226
- package/dist/messaging/index.d.ts +17 -226
- package/dist/messaging/index.js +19 -749
- package/dist/messaging/index.js.map +1 -1
- package/dist/operators/index.cjs +1256 -1059
- 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 +9 -8
- package/dist/orchestration/index.cjs +8664 -2617
- package/dist/orchestration/index.cjs.map +1 -1
- package/dist/orchestration/index.d.cts +171 -221
- package/dist/orchestration/index.d.ts +171 -221
- package/dist/orchestration/index.js +74 -982
- 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 +56 -0
- package/dist/orchestration/messaging.d.ts +56 -0
- package/dist/orchestration/messaging.js +276 -0
- package/dist/orchestration/messaging.js.map +1 -0
- package/dist/orchestration/work-queue.cjs +1500 -0
- package/dist/orchestration/work-queue.cjs.map +1 -0
- package/dist/orchestration/work-queue.d.cts +196 -0
- package/dist/orchestration/work-queue.d.ts +196 -0
- package/dist/orchestration/work-queue.js +1289 -0
- package/dist/orchestration/work-queue.js.map +1 -0
- package/dist/patterns/event-flow.cjs +433 -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 +748 -355
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.cts +9 -5
- package/dist/patterns/index.d.ts +9 -5
- package/dist/patterns/index.js +13 -4
- package/dist/process-types-C9uMYz3i.d.ts +200 -0
- package/dist/process-types-h3uRlzDc.d.cts +200 -0
- package/dist/{reactive-collection-BxBqtIOE.d.cts → reactive-collection-B9R0Bl1P.d.cts} +11 -41
- package/dist/{reactive-collection-Cb1II1Fi.d.ts → reactive-collection-BXFrH0U2.d.ts} +11 -41
- package/dist/{reactive-collection-storage-D-KmjE0J.d.cts → reactive-collection-storage-BLGv8Xp8.d.cts} +5 -5
- package/dist/{reactive-collection-storage-BNiEc-Gd.d.ts → reactive-collection-storage-a4zD3665.d.ts} +5 -5
- package/dist/{reactive-map-BcB4KsQR.d.ts → reactive-map-C_8sOfdS.d.cts} +7 -6
- package/dist/{reactive-map-D-g3dv8I.d.cts → reactive-map-jle5dnok.d.ts} +7 -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/scheduled-readiness-5rwQlyjV.d.ts +91 -0
- package/dist/scheduled-readiness-DpRY8jI0.d.cts +91 -0
- package/dist/semantic-memory-graph-C2ZUwIlq.d.ts +30 -0
- package/dist/semantic-memory-graph-DlZBD_Eu.d.cts +30 -0
- package/dist/{semantic-memory-graph-BYoIlP35.d.cts → semantic-memory-graph-types-BvzdqmkY.d.cts} +2 -28
- package/dist/{semantic-memory-graph-CxyXLms3.d.ts → semantic-memory-graph-types-Ci-OtahO.d.ts} +2 -28
- package/dist/solutions/index.cjs +6788 -2128
- package/dist/solutions/index.cjs.map +1 -1
- package/dist/solutions/index.d.cts +15 -519
- package/dist/solutions/index.d.ts +15 -519
- package/dist/solutions/index.js +91 -7
- package/dist/solutions/reactive-layout/browser/index.cjs +457 -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 +4494 -0
- package/dist/solutions/reactive-layout/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/index.d.cts +37 -0
- package/dist/solutions/reactive-layout/index.d.ts +37 -0
- package/dist/solutions/reactive-layout/index.js +146 -0
- package/dist/solutions/reactive-layout/index.js.map +1 -0
- package/dist/solutions/reactive-layout/node-canvas/index.cjs +555 -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 +504 -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 +557 -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 +2345 -0
- package/dist/solutions/work-item/actions.cjs.map +1 -0
- package/dist/solutions/work-item/actions.d.cts +40 -0
- package/dist/solutions/work-item/actions.d.ts +40 -0
- package/dist/solutions/work-item/actions.js +2078 -0
- package/dist/solutions/work-item/actions.js.map +1 -0
- package/dist/solutions/work-item/scheduling.cjs +9797 -0
- package/dist/solutions/work-item/scheduling.cjs.map +1 -0
- package/dist/solutions/work-item/scheduling.d.cts +1868 -0
- package/dist/solutions/work-item/scheduling.d.ts +1868 -0
- package/dist/solutions/work-item/scheduling.js +146 -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 +1399 -1052
- 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 +1345 -1065
- 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 +7 -6
- 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.cjs +16 -0
- package/dist/storage/browser.cjs.map +1 -1
- package/dist/storage/browser.js +4 -3
- package/dist/storage/browser.js.map +1 -1
- package/dist/storage/index.cjs +16 -0
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.d.cts +6 -5
- package/dist/storage/index.d.ts +6 -5
- package/dist/storage/index.js +10 -9
- package/dist/storage/node.cjs +16 -0
- package/dist/storage/node.cjs.map +1 -1
- package/dist/storage/node.js +4 -3
- package/dist/storage/node.js.map +1 -1
- package/dist/store-BmtEs9mG.d.ts +123 -0
- package/dist/store-PAAsYvML.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-BRNKoFHj.d.ts +357 -0
- package/dist/{types-h12mNYbq.d.ts → types-BS6CyR-x.d.cts} +49 -130
- package/dist/types-BWK2ay3e.d.cts +457 -0
- package/dist/types-BXKSAoE1.d.cts +357 -0
- package/dist/types-BaPpZItj.d.ts +457 -0
- package/dist/types-BhveCMg5.d.cts +274 -0
- package/dist/{types-bNMSWKqF.d.cts → types-C9NOgNJw.d.ts} +49 -130
- package/dist/types-CTsQ8Ww4.d.ts +274 -0
- package/dist/types-DL_05n2M.d.ts +34 -0
- package/dist/types-XDoqxYO9.d.cts +34 -0
- package/dist/work-item-runtime-types-BqtWnSCS.d.ts +138 -0
- package/dist/work-item-runtime-types-CHO03AKh.d.cts +138 -0
- package/dist/work-queue/index.cjs +1136 -0
- package/dist/work-queue/index.cjs.map +1 -0
- package/dist/work-queue/index.d.cts +21 -0
- package/dist/work-queue/index.d.ts +21 -0
- package/dist/work-queue/index.js +1082 -0
- package/dist/work-queue/index.js.map +1 -0
- package/package.json +603 -249
- package/dist/chunk-2ILL7HQI.js.map +0 -1
- package/dist/chunk-4VLAQHZI.js.map +0 -1
- package/dist/chunk-COHO25CZ.js.map +0 -1
- package/dist/chunk-DK554R7P.js.map +0 -1
- package/dist/chunk-G4M3NHRJ.js.map +0 -1
- package/dist/chunk-I3IHOHCJ.js.map +0 -1
- package/dist/chunk-JIMUDQN3.js.map +0 -1
- package/dist/chunk-RIIOUTGM.js.map +0 -1
- package/dist/chunk-SWTLEQL6.js.map +0 -1
- /package/dist/{chunk-GDL26N2T.js.map → chunk-3KN7NJDR.js.map} +0 -0
- /package/dist/{chunk-Z2ANQ6JW.js.map → chunk-4Q77MMJY.js.map} +0 -0
- /package/dist/{chunk-D6BG7U6A.js.map → chunk-7HZRJMN6.js.map} +0 -0
- /package/dist/{chunk-SCRFRCGR.js.map → chunk-BSQGE5PS.js.map} +0 -0
- /package/dist/{chunk-PKVBHGBM.js.map → chunk-CJIFGJQG.js.map} +0 -0
- /package/dist/{chunk-K3FXTC3I.js.map → chunk-HJACH5PU.js.map} +0 -0
- /package/dist/{chunk-GTPCOEOZ.js.map → chunk-IDMLXLLG.js.map} +0 -0
- /package/dist/{chunk-DKP56CSW.js.map → chunk-JKAYLDQV.js.map} +0 -0
- /package/dist/{chunk-Y3ZLRGHC.js.map → chunk-SIDJO2T4.js.map} +0 -0
- /package/dist/{chunk-JR4IKCR2.js.map → chunk-TPND5MJS.js.map} +0 -0
- /package/dist/{chunk-TEW47IVR.js.map → chunk-VPEFSDME.js.map} +0 -0
- /package/dist/{chunk-DJC4CHLQ.js.map → chunk-YDWBXXQZ.js.map} +0 -0
- /package/dist/{chunk-6PHB5CJS.js.map → chunk-ZLFRB6FI.js.map} +0 -0
package/dist/messaging/index.js
CHANGED
|
@@ -1,753 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "../chunk-I3IHOHCJ.js";
|
|
6
|
-
import "../chunk-4VLAQHZI.js";
|
|
7
|
-
import {
|
|
8
|
-
depBatch
|
|
9
|
-
} from "../chunk-SWTLEQL6.js";
|
|
10
|
-
import "../chunk-DK554R7P.js";
|
|
11
|
-
|
|
12
|
-
// src/messaging/index.ts
|
|
13
|
-
var PROMPTS_TOPIC = "prompts";
|
|
14
|
-
var RESPONSES_TOPIC = "responses";
|
|
15
|
-
var INJECTIONS_TOPIC = "injections";
|
|
16
|
-
var DEFERRED_TOPIC = "deferred";
|
|
17
|
-
var SPAWNS_TOPIC = "spawns";
|
|
18
|
-
var CONTEXT_TOPIC = "context";
|
|
19
|
-
var TODOS_TOPIC = "todos";
|
|
20
|
-
var STANDARD_TOPICS = Object.freeze([
|
|
2
|
+
CONTEXT_TOPIC,
|
|
3
|
+
DEFERRED_TOPIC,
|
|
4
|
+
INJECTIONS_TOPIC,
|
|
21
5
|
PROMPTS_TOPIC,
|
|
22
6
|
RESPONSES_TOPIC,
|
|
23
|
-
INJECTIONS_TOPIC,
|
|
24
|
-
DEFERRED_TOPIC,
|
|
25
7
|
SPAWNS_TOPIC,
|
|
26
|
-
|
|
27
|
-
TODOS_TOPIC
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
graph,
|
|
40
|
-
name,
|
|
41
|
-
now: opts.now ?? Date.now,
|
|
42
|
-
topics: Object.freeze([...unique]),
|
|
43
|
-
records: /* @__PURE__ */ new Map(),
|
|
44
|
-
seq: 0
|
|
45
|
-
};
|
|
46
|
-
for (const topic of unique) {
|
|
47
|
-
const producers = [];
|
|
48
|
-
const body = (ctx) => {
|
|
49
|
-
for (let i = 0; i < producers.length; i++) {
|
|
50
|
-
for (const produced of depBatch(ctx, i) ?? []) {
|
|
51
|
-
if (produced.kind === "publish") {
|
|
52
|
-
ctx.down([
|
|
53
|
-
[
|
|
54
|
-
"DATA",
|
|
55
|
-
produced.envelope
|
|
56
|
-
]
|
|
57
|
-
]);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const node = graph.node([], body, {
|
|
63
|
-
name: `${name}/${topic}`,
|
|
64
|
-
factory: "messageTopic",
|
|
65
|
-
meta: { topic },
|
|
66
|
-
completeWhenDepsComplete: false,
|
|
67
|
-
errorWhenDepsError: false
|
|
68
|
-
});
|
|
69
|
-
state.records.set(topic, { node, producers, body });
|
|
70
|
-
}
|
|
71
|
-
const bus = {
|
|
72
|
-
topics: state.topics,
|
|
73
|
-
topic(topic) {
|
|
74
|
-
return requireTopic(state, topic);
|
|
75
|
-
},
|
|
76
|
-
publish(topic, payload, publishOpts = {}) {
|
|
77
|
-
const node = requireTopic(state, topic);
|
|
78
|
-
const envelope = {
|
|
79
|
-
topic,
|
|
80
|
-
seq: ++state.seq,
|
|
81
|
-
payload,
|
|
82
|
-
timestampMs: state.now(),
|
|
83
|
-
...publishOpts.key === void 0 ? {} : { key: publishOpts.key }
|
|
84
|
-
};
|
|
85
|
-
node.down([["DATA", envelope]]);
|
|
86
|
-
return envelope;
|
|
87
|
-
},
|
|
88
|
-
has(topic) {
|
|
89
|
-
return state.records.has(topic);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
busStates.set(bus, state);
|
|
93
|
-
return bus;
|
|
94
|
-
}
|
|
95
|
-
function dynamicHub(graph, opts = {}) {
|
|
96
|
-
const name = opts.name ?? "dynamicHub";
|
|
97
|
-
const unknownTopic = normalizeUnknownTopicPolicy(opts.unknownTopic);
|
|
98
|
-
const maxTopics = normalizeHubLimit(
|
|
99
|
-
opts.maxTopics,
|
|
100
|
-
DEFAULT_DYNAMIC_HUB_MAX_TOPICS,
|
|
101
|
-
"dynamicHub: maxTopics"
|
|
102
|
-
);
|
|
103
|
-
const maxTopicLength = normalizeHubLimit(
|
|
104
|
-
opts.maxTopicLength,
|
|
105
|
-
DEFAULT_DYNAMIC_HUB_MAX_TOPIC_LENGTH,
|
|
106
|
-
"dynamicHub: maxTopicLength"
|
|
107
|
-
);
|
|
108
|
-
const now = opts.now ?? Date.now;
|
|
109
|
-
const initialTopics = uniqueTopics(opts.topics ?? [], maxTopicLength);
|
|
110
|
-
if (initialTopics.length > maxTopics) {
|
|
111
|
-
throw new Error("dynamicHub: topics exceed maxTopics");
|
|
112
|
-
}
|
|
113
|
-
const commandSources = [];
|
|
114
|
-
const commandBody = (ctx) => {
|
|
115
|
-
for (let i = 0; i < commandSources.length; i++) {
|
|
116
|
-
for (const command2 of depBatch(ctx, i) ?? []) ctx.down([["DATA", command2]]);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const command = graph.node([], commandBody, {
|
|
120
|
-
name: `${name}/command`,
|
|
121
|
-
factory: "dynamicHubCommand",
|
|
122
|
-
completeWhenDepsComplete: false,
|
|
123
|
-
errorWhenDepsError: false
|
|
124
|
-
});
|
|
125
|
-
const events = graph.node(
|
|
126
|
-
[command],
|
|
127
|
-
(ctx) => {
|
|
128
|
-
const runtime = ctx.state.get() ?? {
|
|
129
|
-
topics: [...initialTopics],
|
|
130
|
-
open: true,
|
|
131
|
-
seq: 0,
|
|
132
|
-
cursor: 0
|
|
133
|
-
};
|
|
134
|
-
ctx.state.persist(true);
|
|
135
|
-
for (const commandFact of depBatch(ctx, 0) ?? []) {
|
|
136
|
-
const parsed = parseDynamicHubCommand(commandFact);
|
|
137
|
-
if (typeof parsed === "string") {
|
|
138
|
-
ctx.down([["DATA", hubError(runtime, commandFact, parsed, timestampOrFallback(now))]]);
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
const reduced = reduceDynamicHubCommand(
|
|
142
|
-
runtime,
|
|
143
|
-
parsed,
|
|
144
|
-
unknownTopic,
|
|
145
|
-
maxTopics,
|
|
146
|
-
maxTopicLength,
|
|
147
|
-
now
|
|
148
|
-
);
|
|
149
|
-
for (const event of reduced) ctx.down([["DATA", event]]);
|
|
150
|
-
}
|
|
151
|
-
ctx.state.set(runtime);
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: `${name}/events`,
|
|
155
|
-
factory: "dynamicHubEvents",
|
|
156
|
-
meta: { unknownTopic },
|
|
157
|
-
completeWhenDepsComplete: false,
|
|
158
|
-
errorWhenDepsError: false
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
const status = graph.node(
|
|
162
|
-
[events],
|
|
163
|
-
(ctx) => {
|
|
164
|
-
for (const event of depBatch(ctx, 0) ?? []) {
|
|
165
|
-
const typed = event;
|
|
166
|
-
ctx.down([["DATA", typed.status]]);
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
name: `${name}/status`,
|
|
171
|
-
factory: "dynamicHubStatus",
|
|
172
|
-
completeWhenDepsComplete: false,
|
|
173
|
-
errorWhenDepsError: false
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
const errors = graph.node(
|
|
177
|
-
[events],
|
|
178
|
-
(ctx) => {
|
|
179
|
-
for (const event of depBatch(ctx, 0) ?? []) {
|
|
180
|
-
const typed = event;
|
|
181
|
-
if (typed.kind !== "error") continue;
|
|
182
|
-
ctx.down([
|
|
183
|
-
[
|
|
184
|
-
"DATA",
|
|
185
|
-
{
|
|
186
|
-
...typed.topic === void 0 ? {} : { topic: typed.topic },
|
|
187
|
-
error: typed.error,
|
|
188
|
-
command: typed.command,
|
|
189
|
-
meta: typed.meta
|
|
190
|
-
}
|
|
191
|
-
]
|
|
192
|
-
]);
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
name: `${name}/errors`,
|
|
197
|
-
factory: "dynamicHubErrors",
|
|
198
|
-
completeWhenDepsComplete: false,
|
|
199
|
-
errorWhenDepsError: false
|
|
200
|
-
}
|
|
201
|
-
);
|
|
202
|
-
const deadLetter = opts.deadLetter === true || unknownTopic === "dead-letter" ? graph.node(
|
|
203
|
-
[events],
|
|
204
|
-
(ctx) => {
|
|
205
|
-
for (const event of depBatch(ctx, 0) ?? []) {
|
|
206
|
-
const typed = event;
|
|
207
|
-
if (typed.kind !== "dead-letter") continue;
|
|
208
|
-
ctx.down([
|
|
209
|
-
[
|
|
210
|
-
"DATA",
|
|
211
|
-
{
|
|
212
|
-
...typed.topic === void 0 ? {} : { topic: typed.topic },
|
|
213
|
-
reason: typed.reason,
|
|
214
|
-
command: typed.command,
|
|
215
|
-
meta: typed.meta
|
|
216
|
-
}
|
|
217
|
-
]
|
|
218
|
-
]);
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
name: `${name}/deadLetter`,
|
|
223
|
-
factory: "dynamicHubDeadLetter",
|
|
224
|
-
completeWhenDepsComplete: false,
|
|
225
|
-
errorWhenDepsError: false
|
|
226
|
-
}
|
|
227
|
-
) : void 0;
|
|
228
|
-
const releaseEventsRetain = graph.retain(events, { reason: `${name}.dynamicHub.events` });
|
|
229
|
-
const hub = {
|
|
230
|
-
command,
|
|
231
|
-
events,
|
|
232
|
-
status,
|
|
233
|
-
errors,
|
|
234
|
-
...deadLetter === void 0 ? {} : { deadLetter },
|
|
235
|
-
create(topic, commandOpts = {}) {
|
|
236
|
-
return publishHubCommand(command, {
|
|
237
|
-
kind: "create",
|
|
238
|
-
topic,
|
|
239
|
-
...commandOpts.key === void 0 ? {} : { key: commandOpts.key },
|
|
240
|
-
...commandOpts.payload === void 0 ? {} : { payload: commandOpts.payload }
|
|
241
|
-
});
|
|
242
|
-
},
|
|
243
|
-
delete(topic, commandOpts = {}) {
|
|
244
|
-
return publishHubCommand(command, {
|
|
245
|
-
kind: "delete",
|
|
246
|
-
topic,
|
|
247
|
-
...commandOpts.key === void 0 ? {} : { key: commandOpts.key },
|
|
248
|
-
...commandOpts.payload === void 0 ? {} : { payload: commandOpts.payload }
|
|
249
|
-
});
|
|
250
|
-
},
|
|
251
|
-
publish(topic, payload, commandOpts = {}) {
|
|
252
|
-
return publishHubCommand(command, {
|
|
253
|
-
kind: "publish",
|
|
254
|
-
topic,
|
|
255
|
-
payload,
|
|
256
|
-
...commandOpts.key === void 0 ? {} : { key: commandOpts.key }
|
|
257
|
-
});
|
|
258
|
-
},
|
|
259
|
-
subscribeTopic(topic, commandOpts = {}) {
|
|
260
|
-
return publishHubCommand(command, {
|
|
261
|
-
kind: "subscribe",
|
|
262
|
-
topic,
|
|
263
|
-
...commandOpts.key === void 0 ? {} : { key: commandOpts.key },
|
|
264
|
-
...commandOpts.payload === void 0 ? {} : { payload: commandOpts.payload }
|
|
265
|
-
});
|
|
266
|
-
},
|
|
267
|
-
close(commandOpts = {}) {
|
|
268
|
-
return publishHubCommand(command, {
|
|
269
|
-
kind: "close",
|
|
270
|
-
...commandOpts.key === void 0 ? {} : { key: commandOpts.key },
|
|
271
|
-
...commandOpts.payload === void 0 ? {} : { payload: commandOpts.payload }
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
dynamicHubStates.set(hub, {
|
|
276
|
-
graph,
|
|
277
|
-
name,
|
|
278
|
-
maxTopicLength,
|
|
279
|
-
commandSources,
|
|
280
|
-
commandBody,
|
|
281
|
-
releaseEventsRetain
|
|
282
|
-
});
|
|
283
|
-
return hub;
|
|
284
|
-
}
|
|
285
|
-
function fromHubTopic(hub, topic, opts = {}) {
|
|
286
|
-
const state = requireDynamicHubState(hub);
|
|
287
|
-
assertTopicKey(topic, "fromHubTopic", state.maxTopicLength);
|
|
288
|
-
return state.graph.node(
|
|
289
|
-
[hub.events],
|
|
290
|
-
(ctx) => {
|
|
291
|
-
for (const event of depBatch(ctx, 0) ?? []) {
|
|
292
|
-
const typed = event;
|
|
293
|
-
if (typed.kind !== "message" || typed.topic !== topic) continue;
|
|
294
|
-
ctx.down([
|
|
295
|
-
[
|
|
296
|
-
"DATA",
|
|
297
|
-
{
|
|
298
|
-
topic,
|
|
299
|
-
seq: typed.meta.seq,
|
|
300
|
-
payload: typed.payload,
|
|
301
|
-
timestampMs: typed.meta.timestampMs,
|
|
302
|
-
...typed.key === void 0 ? {} : { key: typed.key }
|
|
303
|
-
}
|
|
304
|
-
]
|
|
305
|
-
]);
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
name: opts.name ?? `${state.name}/${topic}/fromHubTopic`,
|
|
310
|
-
factory: "fromHubTopic",
|
|
311
|
-
meta: { topic },
|
|
312
|
-
completeWhenDepsComplete: false,
|
|
313
|
-
errorWhenDepsError: false
|
|
314
|
-
}
|
|
315
|
-
);
|
|
316
|
-
}
|
|
317
|
-
function toHubTopic(graph, source, hub, topic, opts = {}) {
|
|
318
|
-
const state = requireDynamicHubState(hub);
|
|
319
|
-
assertTopicKey(topic, "toHubTopic", state.maxTopicLength);
|
|
320
|
-
if (state.graph !== graph) throw new Error("toHubTopic: hub and source graph must match");
|
|
321
|
-
if (isReachableUpstream(source, hub.command)) {
|
|
322
|
-
throw new Error("toHubTopic: source already depends on hub command path");
|
|
323
|
-
}
|
|
324
|
-
const commands = graph.node(
|
|
325
|
-
[source],
|
|
326
|
-
(ctx) => {
|
|
327
|
-
for (const value of depBatch(ctx, 0) ?? []) {
|
|
328
|
-
try {
|
|
329
|
-
const key = opts.keyOf?.(value);
|
|
330
|
-
ctx.down([
|
|
331
|
-
[
|
|
332
|
-
"DATA",
|
|
333
|
-
{
|
|
334
|
-
kind: "publish",
|
|
335
|
-
topic,
|
|
336
|
-
payload: value,
|
|
337
|
-
...key === void 0 ? {} : { key }
|
|
338
|
-
}
|
|
339
|
-
]
|
|
340
|
-
]);
|
|
341
|
-
} catch (error) {
|
|
342
|
-
ctx.down([
|
|
343
|
-
[
|
|
344
|
-
"DATA",
|
|
345
|
-
{
|
|
346
|
-
kind: "invalid",
|
|
347
|
-
topic,
|
|
348
|
-
error: error instanceof Error ? error.message : String(error)
|
|
349
|
-
}
|
|
350
|
-
]
|
|
351
|
-
]);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
name: opts.name ?? `${state.name}/${topic}/toHubTopic`,
|
|
357
|
-
factory: "toHubTopic",
|
|
358
|
-
meta: { topic },
|
|
359
|
-
completeWhenDepsComplete: false,
|
|
360
|
-
errorWhenDepsError: false
|
|
361
|
-
}
|
|
362
|
-
);
|
|
363
|
-
const commandSource = commands;
|
|
364
|
-
state.commandSources.push(commandSource);
|
|
365
|
-
try {
|
|
366
|
-
hub.command.replaceDeps([...state.commandSources], state.commandBody);
|
|
367
|
-
} catch (error) {
|
|
368
|
-
state.commandSources.splice(state.commandSources.indexOf(commandSource), 1);
|
|
369
|
-
releaseGraphNodes(graph, [commands], {
|
|
370
|
-
reason: "toHubTopic failed command wiring"
|
|
371
|
-
});
|
|
372
|
-
throw error;
|
|
373
|
-
}
|
|
374
|
-
return { commands };
|
|
375
|
-
}
|
|
376
|
-
function fromTopic(bus, topic) {
|
|
377
|
-
return bus.topic(topic);
|
|
378
|
-
}
|
|
379
|
-
function toTopic(graph, source, bus, topic, opts = {}) {
|
|
380
|
-
const state = busStates.get(bus);
|
|
381
|
-
if (state === void 0) throw new Error("toTopic: unknown message bus implementation");
|
|
382
|
-
if (state.graph !== graph) throw new Error("toTopic: bus and source graph must match");
|
|
383
|
-
const record = requireTopicRecord(state, topic);
|
|
384
|
-
const name = opts.name ?? `toTopic/${topic}`;
|
|
385
|
-
const producer = graph.node(
|
|
386
|
-
[source],
|
|
387
|
-
(ctx) => {
|
|
388
|
-
for (const value of depBatch(ctx, 0) ?? []) {
|
|
389
|
-
try {
|
|
390
|
-
const key = opts.keyOf?.(value);
|
|
391
|
-
const envelope = {
|
|
392
|
-
topic,
|
|
393
|
-
seq: ++state.seq,
|
|
394
|
-
payload: value,
|
|
395
|
-
timestampMs: state.now(),
|
|
396
|
-
...key === void 0 ? {} : { key }
|
|
397
|
-
};
|
|
398
|
-
ctx.down([
|
|
399
|
-
[
|
|
400
|
-
"DATA",
|
|
401
|
-
{
|
|
402
|
-
kind: "publish",
|
|
403
|
-
envelope
|
|
404
|
-
}
|
|
405
|
-
]
|
|
406
|
-
]);
|
|
407
|
-
} catch (error) {
|
|
408
|
-
ctx.down([["DATA", { kind: "error", topic, error }]]);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
name,
|
|
414
|
-
factory: "toTopic",
|
|
415
|
-
meta: { topic },
|
|
416
|
-
completeWhenDepsComplete: false,
|
|
417
|
-
errorWhenDepsError: false
|
|
418
|
-
}
|
|
419
|
-
);
|
|
420
|
-
record.producers.push(producer);
|
|
421
|
-
record.node.replaceDeps([...record.producers], record.body);
|
|
422
|
-
const events = graph.node(
|
|
423
|
-
[producer, source],
|
|
424
|
-
(ctx) => {
|
|
425
|
-
for (const produced of depBatch(ctx, 0) ?? []) {
|
|
426
|
-
const typed = produced;
|
|
427
|
-
if (typed.kind === "publish") {
|
|
428
|
-
ctx.down([
|
|
429
|
-
[
|
|
430
|
-
"DATA",
|
|
431
|
-
{
|
|
432
|
-
kind: "publish",
|
|
433
|
-
topic,
|
|
434
|
-
seq: typed.envelope.seq,
|
|
435
|
-
payload: typed.envelope.payload
|
|
436
|
-
}
|
|
437
|
-
]
|
|
438
|
-
]);
|
|
439
|
-
} else {
|
|
440
|
-
ctx.down([
|
|
441
|
-
["DATA", { kind: "error", topic, error: typed.error }]
|
|
442
|
-
]);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
const terminal = ctx.terminal[0];
|
|
446
|
-
if (terminal !== false && terminal !== void 0 && terminal !== true) {
|
|
447
|
-
ctx.down([
|
|
448
|
-
["DATA", { kind: "error", topic, error: terminal }]
|
|
449
|
-
]);
|
|
450
|
-
}
|
|
451
|
-
const sourceTerminal = ctx.terminal[1];
|
|
452
|
-
if (sourceTerminal === true) {
|
|
453
|
-
ctx.down([["DATA", { kind: "complete", topic }]]);
|
|
454
|
-
} else if (sourceTerminal !== false && sourceTerminal !== void 0) {
|
|
455
|
-
ctx.down([
|
|
456
|
-
["DATA", { kind: "error", topic, error: sourceTerminal }]
|
|
457
|
-
]);
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
name: `${name}/events`,
|
|
462
|
-
factory: "toTopicEvents",
|
|
463
|
-
meta: { topic },
|
|
464
|
-
completeWhenDepsComplete: false,
|
|
465
|
-
errorWhenDepsError: false,
|
|
466
|
-
terminalAsRealInput: true
|
|
467
|
-
}
|
|
468
|
-
);
|
|
469
|
-
return { events };
|
|
470
|
-
}
|
|
471
|
-
function requireTopic(state, topic) {
|
|
472
|
-
return requireTopicRecord(state, topic).node;
|
|
473
|
-
}
|
|
474
|
-
function requireTopicRecord(state, topic) {
|
|
475
|
-
const record = state.records.get(topic);
|
|
476
|
-
if (record === void 0) throw new Error(`messageBus: unknown topic '${topic}'`);
|
|
477
|
-
return record;
|
|
478
|
-
}
|
|
479
|
-
function uniqueTopics(topics, maxTopicLength) {
|
|
480
|
-
const unique = [...new Set(topics)];
|
|
481
|
-
if (unique.length !== topics.length) throw new Error("dynamicHub: duplicate topic");
|
|
482
|
-
for (const topic of unique) assertTopicKey(topic, "dynamicHub", maxTopicLength);
|
|
483
|
-
return Object.freeze(unique.sort());
|
|
484
|
-
}
|
|
485
|
-
function normalizeUnknownTopicPolicy(policy) {
|
|
486
|
-
if (policy === void 0) return "error";
|
|
487
|
-
if (policy === "drop" || policy === "error" || policy === "dead-letter" || policy === "create-as-fact") {
|
|
488
|
-
return policy;
|
|
489
|
-
}
|
|
490
|
-
throw new Error("dynamicHub: unknownTopic policy is not recognized");
|
|
491
|
-
}
|
|
492
|
-
function normalizeHubLimit(value, fallback, owner) {
|
|
493
|
-
if (value === void 0) return fallback;
|
|
494
|
-
if (!Number.isInteger(value) || value < 1) {
|
|
495
|
-
throw new Error(`${owner} must be a positive integer`);
|
|
496
|
-
}
|
|
497
|
-
return value;
|
|
498
|
-
}
|
|
499
|
-
function publishHubCommand(commandNode, command) {
|
|
500
|
-
commandNode.down([["DATA", command]]);
|
|
501
|
-
return command;
|
|
502
|
-
}
|
|
503
|
-
function parseDynamicHubCommand(value) {
|
|
504
|
-
if (!isObjectRecord(value)) return "dynamicHub: command fact must be an object";
|
|
505
|
-
const kind = value.kind;
|
|
506
|
-
if (kind !== "create" && kind !== "delete" && kind !== "publish" && kind !== "subscribe" && kind !== "close") {
|
|
507
|
-
return "dynamicHub: command kind is not recognized";
|
|
508
|
-
}
|
|
509
|
-
if (kind === "close") {
|
|
510
|
-
return {
|
|
511
|
-
kind,
|
|
512
|
-
...typeof value.key === "string" ? { key: value.key } : {},
|
|
513
|
-
...value.payload === void 0 ? {} : { payload: value.payload }
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
const topic = value.topic;
|
|
517
|
-
if (typeof topic !== "string" || topic.length === 0) {
|
|
518
|
-
return "dynamicHub: command topic must be a non-empty string";
|
|
519
|
-
}
|
|
520
|
-
if (kind === "publish") {
|
|
521
|
-
if (value.payload === void 0) return "dynamicHub: publish command payload is required";
|
|
522
|
-
return {
|
|
523
|
-
kind,
|
|
524
|
-
topic,
|
|
525
|
-
payload: value.payload,
|
|
526
|
-
...typeof value.key === "string" ? { key: value.key } : {}
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
return {
|
|
530
|
-
kind,
|
|
531
|
-
topic,
|
|
532
|
-
...typeof value.key === "string" ? { key: value.key } : {},
|
|
533
|
-
...value.payload === void 0 ? {} : { payload: value.payload }
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
function isObjectRecord(value) {
|
|
537
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
538
|
-
}
|
|
539
|
-
function readHubTimestamp(now) {
|
|
540
|
-
try {
|
|
541
|
-
const timestampMs = now();
|
|
542
|
-
return Number.isFinite(timestampMs) ? timestampMs : "dynamicHub: now() must return a finite number";
|
|
543
|
-
} catch (error) {
|
|
544
|
-
return `dynamicHub: now() threw: ${error instanceof Error ? error.message : String(error)}`;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
function timestampOrFallback(now) {
|
|
548
|
-
const timestampMs = readHubTimestamp(now);
|
|
549
|
-
return typeof timestampMs === "number" ? timestampMs : Date.now();
|
|
550
|
-
}
|
|
551
|
-
function reduceDynamicHubCommand(runtime, command, unknownTopic, maxTopics, maxTopicLength, now) {
|
|
552
|
-
const topic = "topic" in command ? command.topic : void 0;
|
|
553
|
-
if (topic !== void 0) {
|
|
554
|
-
const topicError = validateTopicKey(topic, "dynamicHub", maxTopicLength);
|
|
555
|
-
if (topicError !== void 0) {
|
|
556
|
-
return [hubError(runtime, command, topicError, timestampOrFallback(now))];
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
if (!runtime.open && command.kind !== "close") {
|
|
560
|
-
return [hubError(runtime, command, "dynamicHub: hub is closed", timestampOrFallback(now))];
|
|
561
|
-
}
|
|
562
|
-
switch (command.kind) {
|
|
563
|
-
case "create": {
|
|
564
|
-
const capacityError = canAddHubTopic(runtime, command.topic, maxTopics);
|
|
565
|
-
if (capacityError !== void 0) {
|
|
566
|
-
return [hubError(runtime, command, capacityError, timestampOrFallback(now))];
|
|
567
|
-
}
|
|
568
|
-
const timestampMs = readHubTimestamp(now);
|
|
569
|
-
if (typeof timestampMs === "string")
|
|
570
|
-
return [hubError(runtime, command, timestampMs, Date.now())];
|
|
571
|
-
addHubTopic(runtime, command.topic);
|
|
572
|
-
return [hubEvent(runtime, timestampMs, command)];
|
|
573
|
-
}
|
|
574
|
-
case "delete": {
|
|
575
|
-
if (!hasHubTopic(runtime, command.topic)) {
|
|
576
|
-
return unknownHubTopic(runtime, command, unknownTopic, now);
|
|
577
|
-
}
|
|
578
|
-
const timestampMs = readHubTimestamp(now);
|
|
579
|
-
if (typeof timestampMs === "string")
|
|
580
|
-
return [hubError(runtime, command, timestampMs, Date.now())];
|
|
581
|
-
deleteHubTopic(runtime, command.topic);
|
|
582
|
-
return [hubEvent(runtime, timestampMs, command)];
|
|
583
|
-
}
|
|
584
|
-
case "publish": {
|
|
585
|
-
if (!hasHubTopic(runtime, command.topic)) {
|
|
586
|
-
if (unknownTopic === "create-as-fact") {
|
|
587
|
-
const capacityError = canAddHubTopic(runtime, command.topic, maxTopics);
|
|
588
|
-
if (capacityError !== void 0) {
|
|
589
|
-
return [hubError(runtime, command, capacityError, timestampOrFallback(now))];
|
|
590
|
-
}
|
|
591
|
-
const createTimestampMs = readHubTimestamp(now);
|
|
592
|
-
if (typeof createTimestampMs === "string") {
|
|
593
|
-
return [hubError(runtime, command, createTimestampMs, Date.now())];
|
|
594
|
-
}
|
|
595
|
-
const messageTimestampMs = readHubTimestamp(now);
|
|
596
|
-
if (typeof messageTimestampMs === "string") {
|
|
597
|
-
return [hubError(runtime, command, messageTimestampMs, Date.now())];
|
|
598
|
-
}
|
|
599
|
-
addHubTopic(runtime, command.topic);
|
|
600
|
-
return [
|
|
601
|
-
hubEvent(runtime, createTimestampMs, { kind: "create", topic: command.topic }),
|
|
602
|
-
hubEvent(runtime, messageTimestampMs, {
|
|
603
|
-
kind: "message",
|
|
604
|
-
topic: command.topic,
|
|
605
|
-
payload: command.payload,
|
|
606
|
-
...command.key === void 0 ? {} : { key: command.key }
|
|
607
|
-
})
|
|
608
|
-
];
|
|
609
|
-
}
|
|
610
|
-
return unknownHubTopic(runtime, command, unknownTopic, now);
|
|
611
|
-
}
|
|
612
|
-
const timestampMs = readHubTimestamp(now);
|
|
613
|
-
if (typeof timestampMs === "string")
|
|
614
|
-
return [hubError(runtime, command, timestampMs, Date.now())];
|
|
615
|
-
return [
|
|
616
|
-
hubEvent(runtime, timestampMs, {
|
|
617
|
-
kind: "message",
|
|
618
|
-
topic: command.topic,
|
|
619
|
-
payload: command.payload,
|
|
620
|
-
...command.key === void 0 ? {} : { key: command.key }
|
|
621
|
-
})
|
|
622
|
-
];
|
|
623
|
-
}
|
|
624
|
-
case "subscribe": {
|
|
625
|
-
if (!hasHubTopic(runtime, command.topic)) {
|
|
626
|
-
if (unknownTopic === "create-as-fact") {
|
|
627
|
-
const capacityError = canAddHubTopic(runtime, command.topic, maxTopics);
|
|
628
|
-
if (capacityError !== void 0) {
|
|
629
|
-
return [hubError(runtime, command, capacityError, timestampOrFallback(now))];
|
|
630
|
-
}
|
|
631
|
-
const createTimestampMs = readHubTimestamp(now);
|
|
632
|
-
if (typeof createTimestampMs === "string") {
|
|
633
|
-
return [hubError(runtime, command, createTimestampMs, Date.now())];
|
|
634
|
-
}
|
|
635
|
-
const subscribeTimestampMs = readHubTimestamp(now);
|
|
636
|
-
if (typeof subscribeTimestampMs === "string") {
|
|
637
|
-
return [hubError(runtime, command, subscribeTimestampMs, Date.now())];
|
|
638
|
-
}
|
|
639
|
-
addHubTopic(runtime, command.topic);
|
|
640
|
-
return [
|
|
641
|
-
hubEvent(runtime, createTimestampMs, { kind: "create", topic: command.topic }),
|
|
642
|
-
hubEvent(runtime, subscribeTimestampMs, command)
|
|
643
|
-
];
|
|
644
|
-
}
|
|
645
|
-
return unknownHubTopic(runtime, command, unknownTopic, now);
|
|
646
|
-
}
|
|
647
|
-
const timestampMs = readHubTimestamp(now);
|
|
648
|
-
if (typeof timestampMs === "string")
|
|
649
|
-
return [hubError(runtime, command, timestampMs, Date.now())];
|
|
650
|
-
return [hubEvent(runtime, timestampMs, command)];
|
|
651
|
-
}
|
|
652
|
-
case "close": {
|
|
653
|
-
const timestampMs = readHubTimestamp(now);
|
|
654
|
-
if (typeof timestampMs === "string")
|
|
655
|
-
return [hubError(runtime, command, timestampMs, Date.now())];
|
|
656
|
-
runtime.open = false;
|
|
657
|
-
return [hubEvent(runtime, timestampMs, command)];
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
function hubEvent(runtime, timestampMs, event) {
|
|
662
|
-
const meta = nextHubMetadata(runtime, timestampMs);
|
|
663
|
-
return {
|
|
664
|
-
...event,
|
|
665
|
-
meta,
|
|
666
|
-
status: snapshotHubStatus(runtime, meta, event.kind)
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
function hubError(runtime, command, error, timestampMs) {
|
|
670
|
-
return hubEvent(runtime, timestampMs, {
|
|
671
|
-
kind: "error",
|
|
672
|
-
...isObjectRecord(command) && typeof command.topic === "string" ? { topic: command.topic } : {},
|
|
673
|
-
error,
|
|
674
|
-
command
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
function unknownHubTopic(runtime, command, policy, now) {
|
|
678
|
-
const topic = "topic" in command ? command.topic : void 0;
|
|
679
|
-
const reason = `dynamicHub: unknown topic '${topic ?? ""}'`;
|
|
680
|
-
if (policy === "drop") return [];
|
|
681
|
-
if (policy === "dead-letter") {
|
|
682
|
-
return [
|
|
683
|
-
hubEvent(runtime, timestampOrFallback(now), {
|
|
684
|
-
kind: "dead-letter",
|
|
685
|
-
...topic === void 0 ? {} : { topic },
|
|
686
|
-
reason,
|
|
687
|
-
command
|
|
688
|
-
})
|
|
689
|
-
];
|
|
690
|
-
}
|
|
691
|
-
return [hubError(runtime, command, reason, timestampOrFallback(now))];
|
|
692
|
-
}
|
|
693
|
-
function nextHubMetadata(runtime, timestampMs) {
|
|
694
|
-
runtime.seq += 1;
|
|
695
|
-
runtime.cursor = runtime.seq;
|
|
696
|
-
return { seq: runtime.seq, cursor: runtime.cursor, timestampMs };
|
|
697
|
-
}
|
|
698
|
-
function snapshotHubStatus(runtime, meta, kind) {
|
|
699
|
-
return {
|
|
700
|
-
open: runtime.open,
|
|
701
|
-
topics: Object.freeze([...runtime.topics].sort()),
|
|
702
|
-
seq: meta.seq,
|
|
703
|
-
cursor: meta.cursor,
|
|
704
|
-
lastEventKind: kind
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
function assertTopicKey(topic, owner, maxTopicLength) {
|
|
708
|
-
const error = validateTopicKey(topic, owner, maxTopicLength);
|
|
709
|
-
if (error !== void 0) throw new Error(error);
|
|
710
|
-
}
|
|
711
|
-
function validateTopicKey(topic, owner, maxTopicLength) {
|
|
712
|
-
if (typeof topic !== "string" || topic.length === 0) {
|
|
713
|
-
return `${owner}: topic must be a non-empty string`;
|
|
714
|
-
}
|
|
715
|
-
if (topic.length > maxTopicLength) {
|
|
716
|
-
return `${owner}: topic exceeds maxTopicLength`;
|
|
717
|
-
}
|
|
718
|
-
return void 0;
|
|
719
|
-
}
|
|
720
|
-
function hasHubTopic(runtime, topic) {
|
|
721
|
-
return runtime.topics.includes(topic);
|
|
722
|
-
}
|
|
723
|
-
function addHubTopic(runtime, topic) {
|
|
724
|
-
if (!hasHubTopic(runtime, topic)) runtime.topics = [...runtime.topics, topic];
|
|
725
|
-
}
|
|
726
|
-
function deleteHubTopic(runtime, topic) {
|
|
727
|
-
runtime.topics = runtime.topics.filter((existing) => existing !== topic);
|
|
728
|
-
}
|
|
729
|
-
function canAddHubTopic(runtime, topic, maxTopics) {
|
|
730
|
-
if (hasHubTopic(runtime, topic)) return void 0;
|
|
731
|
-
return runtime.topics.length >= maxTopics ? "dynamicHub: topic count exceeds maxTopics" : void 0;
|
|
732
|
-
}
|
|
733
|
-
function isReachableUpstream(from, target) {
|
|
734
|
-
const seen = /* @__PURE__ */ new Set();
|
|
735
|
-
const stack = [from];
|
|
736
|
-
while (stack.length > 0) {
|
|
737
|
-
const node = stack.pop();
|
|
738
|
-
if (node === void 0) continue;
|
|
739
|
-
if (node === target) return true;
|
|
740
|
-
if (seen.has(node)) continue;
|
|
741
|
-
seen.add(node);
|
|
742
|
-
for (const dep of node.deps) stack.push(dep);
|
|
743
|
-
}
|
|
744
|
-
return false;
|
|
745
|
-
}
|
|
746
|
-
function requireDynamicHubState(hub) {
|
|
747
|
-
const state = dynamicHubStates.get(hub);
|
|
748
|
-
if (state === void 0) throw new Error("dynamicHub: unknown hub implementation");
|
|
749
|
-
return state;
|
|
750
|
-
}
|
|
8
|
+
STANDARD_TOPICS,
|
|
9
|
+
TODOS_TOPIC,
|
|
10
|
+
eventMessage,
|
|
11
|
+
eventMessageIssue,
|
|
12
|
+
fromTopic,
|
|
13
|
+
isEventMessage,
|
|
14
|
+
messageBus,
|
|
15
|
+
toTopic
|
|
16
|
+
} from "../chunk-PVC7WDKI.js";
|
|
17
|
+
import "../chunk-UT3MHJCW.js";
|
|
18
|
+
import "../chunk-WQIA3GFB.js";
|
|
19
|
+
import "../chunk-S6HXABGL.js";
|
|
20
|
+
import "../chunk-DGUM43GV.js";
|
|
751
21
|
export {
|
|
752
22
|
CONTEXT_TOPIC,
|
|
753
23
|
DEFERRED_TOPIC,
|
|
@@ -757,11 +27,11 @@ export {
|
|
|
757
27
|
SPAWNS_TOPIC,
|
|
758
28
|
STANDARD_TOPICS,
|
|
759
29
|
TODOS_TOPIC,
|
|
760
|
-
|
|
761
|
-
|
|
30
|
+
eventMessage,
|
|
31
|
+
eventMessageIssue,
|
|
762
32
|
fromTopic,
|
|
33
|
+
isEventMessage,
|
|
763
34
|
messageBus,
|
|
764
|
-
toHubTopic,
|
|
765
35
|
toTopic
|
|
766
36
|
};
|
|
767
37
|
//# sourceMappingURL=index.js.map
|