@graphrefly/ts 0.0.1 → 0.0.3

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.
Files changed (333) hide show
  1. package/README.md +197 -117
  2. package/dist/actions-types-CH-XCU9O.d.cts +657 -0
  3. package/dist/actions-types-w2iPQTkv.d.ts +657 -0
  4. package/dist/adapters/index.cjs +5157 -2951
  5. package/dist/adapters/index.cjs.map +1 -1
  6. package/dist/adapters/index.d.cts +207 -70
  7. package/dist/adapters/index.d.ts +207 -70
  8. package/dist/adapters/index.js +3738 -1688
  9. package/dist/adapters/index.js.map +1 -1
  10. package/dist/adapters/nestjs/microservices.cjs +841 -0
  11. package/dist/adapters/nestjs/microservices.cjs.map +1 -0
  12. package/dist/adapters/nestjs/microservices.d.cts +45 -0
  13. package/dist/adapters/nestjs/microservices.d.ts +45 -0
  14. package/dist/adapters/nestjs/microservices.js +206 -0
  15. package/dist/adapters/nestjs/microservices.js.map +1 -0
  16. package/dist/adapters/nestjs/native.cjs +1391 -0
  17. package/dist/adapters/nestjs/native.cjs.map +1 -0
  18. package/dist/adapters/nestjs/native.d.cts +111 -0
  19. package/dist/adapters/nestjs/native.d.ts +111 -0
  20. package/dist/adapters/nestjs/native.js +577 -0
  21. package/dist/adapters/nestjs/native.js.map +1 -0
  22. package/dist/adapters/nestjs/websockets.cjs +924 -0
  23. package/dist/adapters/nestjs/websockets.cjs.map +1 -0
  24. package/dist/adapters/nestjs/websockets.d.cts +47 -0
  25. package/dist/adapters/nestjs/websockets.d.ts +47 -0
  26. package/dist/adapters/nestjs/websockets.js +286 -0
  27. package/dist/adapters/nestjs/websockets.js.map +1 -0
  28. package/dist/adapters/nestjs.cjs +1085 -0
  29. package/dist/adapters/nestjs.cjs.map +1 -0
  30. package/dist/adapters/nestjs.d.cts +385 -0
  31. package/dist/adapters/nestjs.d.ts +385 -0
  32. package/dist/adapters/nestjs.js +112 -0
  33. package/dist/adapters/nestjs.js.map +1 -0
  34. package/dist/adapters/observe-storage.d.cts +3 -3
  35. package/dist/adapters/observe-storage.d.ts +3 -3
  36. package/dist/adapters/observe-storage.js +4 -4
  37. package/dist/adapters/react.cjs.map +1 -1
  38. package/dist/adapters/react.d.cts +2 -2
  39. package/dist/adapters/react.d.ts +2 -2
  40. package/dist/adapters/react.js +1 -1
  41. package/dist/adapters/solid.cjs.map +1 -1
  42. package/dist/adapters/solid.d.cts +2 -2
  43. package/dist/adapters/solid.d.ts +2 -2
  44. package/dist/adapters/solid.js +1 -1
  45. package/dist/adapters/svelte.cjs.map +1 -1
  46. package/dist/adapters/svelte.d.cts +2 -2
  47. package/dist/adapters/svelte.d.ts +2 -2
  48. package/dist/adapters/svelte.js +1 -1
  49. package/dist/adapters/vue.cjs.map +1 -1
  50. package/dist/adapters/vue.d.cts +2 -2
  51. package/dist/adapters/vue.d.ts +2 -2
  52. package/dist/adapters/vue.js +1 -1
  53. package/dist/{agent-runtime-BesGDZcB.d.ts → agent-runtime-types-core-CKwrBDyi.d.ts} +171 -320
  54. package/dist/{agent-runtime-DZTJ3C-p.d.cts → agent-runtime-types-core-bfl4m0vM.d.cts} +171 -320
  55. package/dist/agent-runtime-types-tool-BLPV3azj.d.cts +695 -0
  56. package/dist/agent-runtime-types-tool-hwqvVqNt.d.ts +695 -0
  57. package/dist/agentic-memory-retention-CLwI76JK.d.ts +14 -0
  58. package/dist/agentic-memory-retention-Cz8GR6ie.d.cts +14 -0
  59. package/dist/{agentic-memory-DfuVZ-lY.d.cts → agentic-memory-types-JDr7MPhh.d.cts} +13 -57
  60. package/dist/{agentic-memory-BmRCvh0d.d.ts → agentic-memory-types-khYJgzKL.d.ts} +13 -57
  61. package/dist/{capability-admission-B0BzqAm5.d.cts → capability-admission-B8RNFyaZ.d.cts} +3 -3
  62. package/dist/{capability-admission-g0mn9hpq.d.ts → capability-admission-Dkw1Xz3r.d.ts} +3 -3
  63. package/dist/chunk-2KUAG2GZ.js +9693 -0
  64. package/dist/chunk-2KUAG2GZ.js.map +1 -0
  65. package/dist/{chunk-CZNV3VXM.js → chunk-3J7UPZL5.js} +11 -11
  66. package/dist/{chunk-HKK2JD7Z.js → chunk-3LYI6ADX.js} +12 -125
  67. package/dist/chunk-3LYI6ADX.js.map +1 -0
  68. package/dist/{chunk-YXMZ2N6J.js → chunk-4M37FH2I.js} +1071 -1025
  69. package/dist/chunk-4M37FH2I.js.map +1 -0
  70. package/dist/{chunk-YDSIVHRR.js → chunk-4NWSNI4K.js} +1598 -1584
  71. package/dist/chunk-4NWSNI4K.js.map +1 -0
  72. package/dist/{chunk-Z2ANQ6JW.js → chunk-4Q77MMJY.js} +2 -2
  73. package/dist/{chunk-SS2A464I.js → chunk-54WPEODM.js} +3 -3
  74. package/dist/chunk-54WPEODM.js.map +1 -0
  75. package/dist/chunk-6E76H4OU.js +132 -0
  76. package/dist/chunk-6E76H4OU.js.map +1 -0
  77. package/dist/chunk-7GOTIIQ7.js +819 -0
  78. package/dist/chunk-7GOTIIQ7.js.map +1 -0
  79. package/dist/{chunk-V7CIJE4B.js → chunk-DKFWDTVY.js} +92 -9
  80. package/dist/chunk-DKFWDTVY.js.map +1 -0
  81. package/dist/{chunk-FBUU43PM.js → chunk-E4QCH32M.js} +448 -446
  82. package/dist/chunk-E4QCH32M.js.map +1 -0
  83. package/dist/{chunk-XKXWK2KP.js → chunk-GXU6WFEJ.js} +1157 -1021
  84. package/dist/chunk-GXU6WFEJ.js.map +1 -0
  85. package/dist/{chunk-K3FXTC3I.js → chunk-HJACH5PU.js} +3 -3
  86. package/dist/{chunk-GTPCOEOZ.js → chunk-IDMLXLLG.js} +3 -3
  87. package/dist/{chunk-DKP56CSW.js → chunk-JKAYLDQV.js} +2 -2
  88. package/dist/{chunk-4VLAQHZI.js → chunk-K7FB3JTD.js} +17 -1
  89. package/dist/chunk-K7FB3JTD.js.map +1 -0
  90. package/dist/{chunk-43BKLFZU.js → chunk-KFURM6FM.js} +10 -10
  91. package/dist/{chunk-H75VXTGT.js → chunk-L6LDXRWE.js} +3 -3
  92. package/dist/{chunk-H75VXTGT.js.map → chunk-L6LDXRWE.js.map} +1 -1
  93. package/dist/chunk-MCOFHMUU.js +4131 -0
  94. package/dist/chunk-MCOFHMUU.js.map +1 -0
  95. package/dist/chunk-MQEQMS7B.js +1009 -0
  96. package/dist/chunk-MQEQMS7B.js.map +1 -0
  97. package/dist/chunk-MTELVIYR.js +1421 -0
  98. package/dist/chunk-MTELVIYR.js.map +1 -0
  99. package/dist/{chunk-3JR3EDB2.js → chunk-NNDIFUKX.js} +121 -115
  100. package/dist/chunk-NNDIFUKX.js.map +1 -0
  101. package/dist/{chunk-2747WN4Y.js → chunk-PUSRRALM.js} +3 -3
  102. package/dist/{chunk-QFY4AFY4.js → chunk-PVC7WDKI.js} +58 -52
  103. package/dist/chunk-PVC7WDKI.js.map +1 -0
  104. package/dist/{chunk-VTHLCFN4.js → chunk-RAHNUYA5.js} +2 -2
  105. package/dist/chunk-TQPCAIQI.js +612 -0
  106. package/dist/chunk-TQPCAIQI.js.map +1 -0
  107. package/dist/{chunk-IXZBUWSP.js → chunk-UEMN5URK.js} +2 -2
  108. package/dist/chunk-WOS7RJYZ.js +1320 -0
  109. package/dist/chunk-WOS7RJYZ.js.map +1 -0
  110. package/dist/{chunk-6PHB5CJS.js → chunk-ZLFRB6FI.js} +2 -2
  111. package/dist/composition/index.cjs +1228 -1076
  112. package/dist/composition/index.cjs.map +1 -1
  113. package/dist/composition/index.d.cts +3 -3
  114. package/dist/composition/index.d.ts +3 -3
  115. package/dist/composition/index.js +4 -4
  116. package/dist/core/index.cjs +1198 -1046
  117. package/dist/core/index.cjs.map +1 -1
  118. package/dist/core/index.d.cts +23 -2
  119. package/dist/core/index.d.ts +23 -2
  120. package/dist/core/index.js +2 -2
  121. package/dist/cqrs/index.d.cts +3 -3
  122. package/dist/cqrs/index.d.ts +3 -3
  123. package/dist/cqrs/messaging.d.cts +4 -4
  124. package/dist/cqrs/messaging.d.ts +4 -4
  125. package/dist/cqrs/work-queue.d.cts +5 -5
  126. package/dist/cqrs/work-queue.d.ts +5 -5
  127. package/dist/data-structures/index.cjs +1226 -1074
  128. package/dist/data-structures/index.cjs.map +1 -1
  129. package/dist/data-structures/index.d.cts +8 -7
  130. package/dist/data-structures/index.d.ts +8 -7
  131. package/dist/data-structures/index.js +6 -5
  132. package/dist/{describe-DYMw_l1C.d.cts → describe-BumQ-3_0.d.cts} +1 -1
  133. package/dist/{describe-BpyJuWkw.d.ts → describe-cYr_Z5zm.d.ts} +1 -1
  134. package/dist/executors/tool-provider-adapters.cjs +3091 -0
  135. package/dist/executors/tool-provider-adapters.cjs.map +1 -0
  136. package/dist/executors/tool-provider-adapters.d.cts +174 -0
  137. package/dist/executors/tool-provider-adapters.d.ts +174 -0
  138. package/dist/executors/tool-provider-adapters.js +1336 -0
  139. package/dist/executors/tool-provider-adapters.js.map +1 -0
  140. package/dist/executors/tool-provider-runtime.cjs +5178 -0
  141. package/dist/executors/tool-provider-runtime.cjs.map +1 -0
  142. package/dist/executors/tool-provider-runtime.d.cts +17 -0
  143. package/dist/executors/tool-provider-runtime.d.ts +17 -0
  144. package/dist/executors/tool-provider-runtime.js +15 -0
  145. package/dist/executors/tool-provider-runtime.js.map +1 -0
  146. package/dist/executors/tool-provider.cjs +6392 -0
  147. package/dist/executors/tool-provider.cjs.map +1 -0
  148. package/dist/executors/tool-provider.d.cts +60 -0
  149. package/dist/executors/tool-provider.d.ts +60 -0
  150. package/dist/executors/tool-provider.js +89 -0
  151. package/dist/executors/tool-provider.js.map +1 -0
  152. package/dist/executors/work-queue.d.cts +6 -6
  153. package/dist/executors/work-queue.d.ts +6 -6
  154. package/dist/graph/index.cjs +1499 -1341
  155. package/dist/graph/index.cjs.map +1 -1
  156. package/dist/graph/index.d.cts +9 -8
  157. package/dist/graph/index.d.ts +9 -8
  158. package/dist/graph/index.js +23 -22
  159. package/dist/{graph-DCEWh4T2.d.cts → graph-C1C-wb0L.d.cts} +266 -137
  160. package/dist/{graph-D-1-SQeC.d.ts → graph-CS0b4V9B.d.ts} +266 -137
  161. package/dist/{index-72VZC0-E.d.cts → index-DLrNopda.d.cts} +151 -10
  162. package/dist/{index-Bmxeu0nK.d.ts → index-DzJni3_6.d.ts} +151 -10
  163. package/dist/index.cjs +3397 -3140
  164. package/dist/index.cjs.map +1 -1
  165. package/dist/index.d.cts +12 -9
  166. package/dist/index.d.ts +12 -9
  167. package/dist/index.js +110 -109
  168. package/dist/inspection/boundary.d.cts +4 -4
  169. package/dist/inspection/boundary.d.ts +4 -4
  170. package/dist/measurements-BWAnochv.d.ts +294 -0
  171. package/dist/measurements-B_gJfD8h.d.cts +294 -0
  172. package/dist/messaging/index.cjs +57 -51
  173. package/dist/messaging/index.cjs.map +1 -1
  174. package/dist/messaging/index.d.cts +11 -276
  175. package/dist/messaging/index.d.ts +11 -276
  176. package/dist/messaging/index.js +1 -1
  177. package/dist/operators/index.cjs +1228 -1076
  178. package/dist/operators/index.cjs.map +1 -1
  179. package/dist/operators/index.d.cts +5 -5
  180. package/dist/operators/index.d.ts +5 -5
  181. package/dist/operators/index.js +5 -5
  182. package/dist/orchestration/index.cjs +8844 -6071
  183. package/dist/orchestration/index.cjs.map +1 -1
  184. package/dist/orchestration/index.d.cts +171 -224
  185. package/dist/orchestration/index.d.ts +171 -224
  186. package/dist/orchestration/index.js +42 -991
  187. package/dist/orchestration/index.js.map +1 -1
  188. package/dist/orchestration/messaging.d.cts +5 -8
  189. package/dist/orchestration/messaging.d.ts +5 -8
  190. package/dist/orchestration/work-queue.cjs +1243 -5
  191. package/dist/orchestration/work-queue.cjs.map +1 -1
  192. package/dist/orchestration/work-queue.d.cts +121 -10
  193. package/dist/orchestration/work-queue.d.ts +121 -10
  194. package/dist/orchestration/work-queue.js +1067 -4
  195. package/dist/orchestration/work-queue.js.map +1 -1
  196. package/dist/patterns/event-flow.cjs +6 -20
  197. package/dist/patterns/event-flow.cjs.map +1 -1
  198. package/dist/patterns/event-flow.d.cts +4 -4
  199. package/dist/patterns/event-flow.d.ts +4 -4
  200. package/dist/patterns/event-flow.js +2 -2
  201. package/dist/patterns/index.cjs +453 -465
  202. package/dist/patterns/index.cjs.map +1 -1
  203. package/dist/patterns/index.d.cts +6 -5
  204. package/dist/patterns/index.d.ts +6 -5
  205. package/dist/patterns/index.js +3 -3
  206. package/dist/process-types-BB7oRhX3.d.cts +200 -0
  207. package/dist/process-types-QNhyoYJ8.d.ts +200 -0
  208. package/dist/{reactive-collection-DNV0-gFi.d.cts → reactive-collection-BYlWvtnp.d.cts} +4 -34
  209. package/dist/{reactive-collection-BAmfrGjd.d.ts → reactive-collection-efOEdGFN.d.ts} +4 -34
  210. package/dist/{reactive-collection-storage-BNEldDyi.d.cts → reactive-collection-storage-BjoLsoiC.d.cts} +5 -5
  211. package/dist/{reactive-collection-storage-YZsAQsWK.d.ts → reactive-collection-storage-DwW6UuK_.d.ts} +5 -5
  212. package/dist/{reactive-map-DRD1LJ2H.d.cts → reactive-map-BHacbIqz.d.cts} +7 -2
  213. package/dist/{reactive-map-EsDiCmJk.d.ts → reactive-map-DN4Jyqnf.d.ts} +7 -2
  214. package/dist/render/index.d.cts +2 -2
  215. package/dist/render/index.d.ts +2 -2
  216. package/dist/scheduled-readiness-BmqXxnzX.d.ts +91 -0
  217. package/dist/scheduled-readiness-CYSw7KDE.d.cts +91 -0
  218. package/dist/semantic-memory-graph-B_LwbM-E.d.cts +30 -0
  219. package/dist/semantic-memory-graph-rsFNNhwn.d.ts +30 -0
  220. package/dist/{semantic-memory-graph-DKuNzuWw.d.cts → semantic-memory-graph-types-Y73bbwVI.d.cts} +2 -28
  221. package/dist/{semantic-memory-graph-uwbwJdhe.d.ts → semantic-memory-graph-types-safmPkuX.d.ts} +2 -28
  222. package/dist/solutions/index.cjs +6353 -6169
  223. package/dist/solutions/index.cjs.map +1 -1
  224. package/dist/solutions/index.d.cts +12 -10
  225. package/dist/solutions/index.d.ts +12 -10
  226. package/dist/solutions/index.js +5 -5
  227. package/dist/solutions/reactive-layout/browser/index.cjs +116 -108
  228. package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -1
  229. package/dist/solutions/reactive-layout/browser/index.d.cts +4 -4
  230. package/dist/solutions/reactive-layout/browser/index.d.ts +4 -4
  231. package/dist/solutions/reactive-layout/browser/index.js +3 -3
  232. package/dist/solutions/reactive-layout/index.cjs +3578 -3350
  233. package/dist/solutions/reactive-layout/index.cjs.map +1 -1
  234. package/dist/solutions/reactive-layout/index.d.cts +32 -576
  235. package/dist/solutions/reactive-layout/index.d.ts +32 -576
  236. package/dist/solutions/reactive-layout/index.js +65 -5
  237. package/dist/solutions/reactive-layout/node-canvas/index.cjs +127 -117
  238. package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -1
  239. package/dist/solutions/reactive-layout/node-canvas/index.d.cts +4 -4
  240. package/dist/solutions/reactive-layout/node-canvas/index.d.ts +4 -4
  241. package/dist/solutions/reactive-layout/node-canvas/index.js +3 -3
  242. package/dist/solutions/reactive-layout/react-native/index.cjs +127 -117
  243. package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -1
  244. package/dist/solutions/reactive-layout/react-native/index.d.cts +4 -4
  245. package/dist/solutions/reactive-layout/react-native/index.d.ts +4 -4
  246. package/dist/solutions/reactive-layout/react-native/index.js +3 -3
  247. package/dist/solutions/reactive-layout/skia/index.cjs +127 -117
  248. package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -1
  249. package/dist/solutions/reactive-layout/skia/index.d.cts +4 -4
  250. package/dist/solutions/reactive-layout/skia/index.d.ts +4 -4
  251. package/dist/solutions/reactive-layout/skia/index.js +3 -3
  252. package/dist/solutions/work-item/actions.cjs +1609 -1428
  253. package/dist/solutions/work-item/actions.cjs.map +1 -1
  254. package/dist/solutions/work-item/actions.d.cts +23 -184
  255. package/dist/solutions/work-item/actions.d.ts +23 -184
  256. package/dist/solutions/work-item/actions.js +1558 -934
  257. package/dist/solutions/work-item/actions.js.map +1 -1
  258. package/dist/solutions/work-item/scheduling.cjs +9181 -1838
  259. package/dist/solutions/work-item/scheduling.cjs.map +1 -1
  260. package/dist/solutions/work-item/scheduling.d.cts +1763 -328
  261. package/dist/solutions/work-item/scheduling.d.ts +1763 -328
  262. package/dist/solutions/work-item/scheduling.js +117 -3
  263. package/dist/solutions/work-item/work-queue.d.cts +7 -7
  264. package/dist/solutions/work-item/work-queue.d.ts +7 -7
  265. package/dist/sources/browser.cjs +1318 -1083
  266. package/dist/sources/browser.cjs.map +1 -1
  267. package/dist/sources/browser.d.cts +22 -6
  268. package/dist/sources/browser.d.ts +22 -6
  269. package/dist/sources/browser.js +4 -4
  270. package/dist/sources/browser.js.map +1 -1
  271. package/dist/sources/index.cjs +1318 -1083
  272. package/dist/sources/index.cjs.map +1 -1
  273. package/dist/sources/index.d.cts +4 -4
  274. package/dist/sources/index.d.ts +4 -4
  275. package/dist/sources/index.js +4 -4
  276. package/dist/sources/node.d.cts +3 -3
  277. package/dist/sources/node.d.ts +3 -3
  278. package/dist/storage/browser.cjs +16 -0
  279. package/dist/storage/browser.cjs.map +1 -1
  280. package/dist/storage/browser.js +3 -3
  281. package/dist/storage/index.cjs +16 -0
  282. package/dist/storage/index.cjs.map +1 -1
  283. package/dist/storage/index.d.cts +5 -4
  284. package/dist/storage/index.d.ts +5 -4
  285. package/dist/storage/index.js +6 -6
  286. package/dist/storage/node.cjs +16 -0
  287. package/dist/storage/node.cjs.map +1 -1
  288. package/dist/storage/node.js +3 -3
  289. package/dist/{store-C-joM4gh.d.ts → store-6_CHF6Ge.d.ts} +1 -1
  290. package/dist/{store-CNJwmT-h.d.cts → store-BljX8RkQ.d.cts} +1 -1
  291. package/dist/types-BAw2QVVE.d.cts +274 -0
  292. package/dist/types-BUbbbh4f.d.cts +34 -0
  293. package/dist/types-CMnzoL54.d.cts +457 -0
  294. package/dist/{types-CcPIn7sy.d.cts → types-CTN3XoMl.d.cts} +57 -108
  295. package/dist/types-CV_ohy5T.d.cts +357 -0
  296. package/dist/{types-BsJvElYZ.d.ts → types-DChxk1vK.d.ts} +57 -108
  297. package/dist/types-DRu7SnLV.d.ts +274 -0
  298. package/dist/types-DeID_FRl.d.ts +34 -0
  299. package/dist/types-IhKH0hGW.d.ts +357 -0
  300. package/dist/types-ePlD2uyT.d.ts +457 -0
  301. package/dist/{work-item-runtime-qaVgsL0T.d.cts → work-item-runtime-types-BTxLskN5.d.cts} +3 -93
  302. package/dist/{work-item-runtime-C3M79vE9.d.ts → work-item-runtime-types-DAsZbb2y.d.ts} +3 -93
  303. package/dist/work-queue/index.cjs +957 -953
  304. package/dist/work-queue/index.cjs.map +1 -1
  305. package/dist/work-queue/index.d.cts +9 -357
  306. package/dist/work-queue/index.d.ts +9 -357
  307. package/dist/work-queue/index.js +957 -953
  308. package/dist/work-queue/index.js.map +1 -1
  309. package/package.json +611 -513
  310. package/dist/chunk-3JR3EDB2.js.map +0 -1
  311. package/dist/chunk-4VLAQHZI.js.map +0 -1
  312. package/dist/chunk-6XAIOL3X.js +0 -2407
  313. package/dist/chunk-6XAIOL3X.js.map +0 -1
  314. package/dist/chunk-FBUU43PM.js.map +0 -1
  315. package/dist/chunk-HKK2JD7Z.js.map +0 -1
  316. package/dist/chunk-PC3BTTBE.js +0 -3217
  317. package/dist/chunk-PC3BTTBE.js.map +0 -1
  318. package/dist/chunk-QFY4AFY4.js.map +0 -1
  319. package/dist/chunk-SS2A464I.js.map +0 -1
  320. package/dist/chunk-V7CIJE4B.js.map +0 -1
  321. package/dist/chunk-XKXWK2KP.js.map +0 -1
  322. package/dist/chunk-YDSIVHRR.js.map +0 -1
  323. package/dist/chunk-YXMZ2N6J.js.map +0 -1
  324. /package/dist/{chunk-CZNV3VXM.js.map → chunk-3J7UPZL5.js.map} +0 -0
  325. /package/dist/{chunk-Z2ANQ6JW.js.map → chunk-4Q77MMJY.js.map} +0 -0
  326. /package/dist/{chunk-K3FXTC3I.js.map → chunk-HJACH5PU.js.map} +0 -0
  327. /package/dist/{chunk-GTPCOEOZ.js.map → chunk-IDMLXLLG.js.map} +0 -0
  328. /package/dist/{chunk-DKP56CSW.js.map → chunk-JKAYLDQV.js.map} +0 -0
  329. /package/dist/{chunk-43BKLFZU.js.map → chunk-KFURM6FM.js.map} +0 -0
  330. /package/dist/{chunk-2747WN4Y.js.map → chunk-PUSRRALM.js.map} +0 -0
  331. /package/dist/{chunk-VTHLCFN4.js.map → chunk-RAHNUYA5.js.map} +0 -0
  332. /package/dist/{chunk-IXZBUWSP.js.map → chunk-UEMN5URK.js.map} +0 -0
  333. /package/dist/{chunk-6PHB5CJS.js.map → chunk-ZLFRB6FI.js.map} +0 -0
@@ -1,9 +1,1069 @@
1
+ import {
2
+ canonicalPublicSourceRefs,
3
+ dataIssue,
4
+ isRecord,
5
+ projectRuntimeFact,
6
+ ref,
7
+ sanitizeGraphVisibleRecord,
8
+ stableJsonStringify,
9
+ stableStringHash,
10
+ uniqueSourceRefs
11
+ } from "../chunk-TQPCAIQI.js";
1
12
  import {
2
13
  depBatch
3
14
  } from "../chunk-WQIA3GFB.js";
4
15
  import "../chunk-S6HXABGL.js";
5
16
  import "../chunk-DGUM43GV.js";
6
17
 
18
+ // src/orchestration/work-queue-scheduled-readiness.ts
19
+ var MAX_PUBLIC_COORDINATE_ID_CHARS = 160;
20
+ var MAX_COPIED_PUBLIC_REFS = 16;
21
+ var PRIVATE_COORDINATE_PATTERN = /(api[_-]?key|authorization|bearer|credential|oauth|password|private[_-]?key|secret|session[_-]?cookie|token)/i;
22
+ function workQueueScheduledReadinessProjector(graph, opts) {
23
+ const name = opts.name ?? "workQueueScheduledReadiness";
24
+ const runtime = graph.node(
25
+ [opts.records],
26
+ (ctx) => {
27
+ const state = ctx.state.get() ?? initialState();
28
+ for (const raw of depBatch(ctx, 0) ?? []) {
29
+ const translated = translateRecord(raw);
30
+ if (translated.kind === "none") continue;
31
+ if (translated.kind === "issue") {
32
+ emitIssue(ctx, state, translated.issue);
33
+ emitStatus(ctx, state, translated.status);
34
+ continue;
35
+ }
36
+ const identity = scheduleIdentity(translated.schedule);
37
+ const recordKey = `${translated.record.queueId}:${translated.record.recordSeq}`;
38
+ const existingRecordIdentity = state.recordScheduleIdentityByKey.get(recordKey);
39
+ if (existingRecordIdentity !== void 0) {
40
+ if (existingRecordIdentity !== identity) emitScheduleConflict(ctx, state, translated);
41
+ continue;
42
+ }
43
+ state.recordScheduleIdentityByKey.set(recordKey, identity);
44
+ const existing = state.schedulesById.get(translated.schedule.scheduleId);
45
+ if (existing !== void 0) {
46
+ if (scheduleIdentity(existing) !== identity) {
47
+ emitScheduleConflict(ctx, state, translated, existing);
48
+ }
49
+ continue;
50
+ }
51
+ state.schedulesById.set(translated.schedule.scheduleId, translated.schedule);
52
+ emitSchedule(ctx, state, translated.schedule);
53
+ emitStatus(ctx, state, translated.status);
54
+ emitAudit(ctx, state, "work-queue-scheduled-readiness-translated", {
55
+ subjectId: translated.schedule.scheduleId,
56
+ sourceRefs: translated.schedule.sourceRefs,
57
+ metadata: {
58
+ queueId: publicCoordinateId(translated.record.queueId),
59
+ workId: publicCoordinateId(translated.record.workId),
60
+ recordSeq: translated.record.recordSeq,
61
+ recordKind: translated.record.kind,
62
+ readyAtMs: translated.schedule.readyAtMs
63
+ }
64
+ });
65
+ }
66
+ ctx.down([["DATA", { kind: "views", views: buildViews(state) }]]);
67
+ ctx.state.set(state);
68
+ },
69
+ {
70
+ name: `${name}/runtime`,
71
+ factory: "workQueueScheduledReadinessProjector",
72
+ partial: true,
73
+ completeWhenDepsComplete: false,
74
+ errorWhenDepsError: false
75
+ }
76
+ );
77
+ return {
78
+ readinessSchedules: projectRuntimeFact(
79
+ graph,
80
+ runtime,
81
+ `${name}/readinessSchedules`,
82
+ "workQueueScheduledReadinessSchedules",
83
+ (fact) => fact.kind === "readiness-schedule" ? fact.schedule : void 0
84
+ ),
85
+ status: projectRuntimeFact(
86
+ graph,
87
+ runtime,
88
+ `${name}/status`,
89
+ "workQueueScheduledReadinessStatus",
90
+ (fact) => fact.kind === "status" ? fact.status : void 0
91
+ ),
92
+ issues: projectRuntimeFact(
93
+ graph,
94
+ runtime,
95
+ `${name}/issues`,
96
+ "workQueueScheduledReadinessIssues",
97
+ (fact) => fact.kind === "issue" ? fact.issue : void 0
98
+ ),
99
+ audit: projectRuntimeFact(
100
+ graph,
101
+ runtime,
102
+ `${name}/audit`,
103
+ "workQueueScheduledReadinessAudit",
104
+ (fact) => fact.kind === "audit" ? fact.audit : void 0
105
+ ),
106
+ views: projectRuntimeFact(
107
+ graph,
108
+ runtime,
109
+ `${name}/views`,
110
+ "workQueueScheduledReadinessViews",
111
+ (fact) => fact.kind === "views" ? fact.views : void 0
112
+ )
113
+ };
114
+ }
115
+ function workQueueReadinessHandoffProjector(graph, opts) {
116
+ const name = opts.name ?? "workQueueReadinessHandoff";
117
+ const deps = opts.overdue === void 0 ? [opts.records, opts.ready] : [opts.records, opts.ready, opts.overdue];
118
+ const runtime = graph.node(
119
+ deps,
120
+ (ctx) => {
121
+ const state = ctx.state.get() ?? handoffState();
122
+ for (const raw of depBatch(ctx, 0) ?? []) {
123
+ const record = raw;
124
+ ingestWorkQueueRecord(state, record);
125
+ }
126
+ for (const raw of depBatch(ctx, 1) ?? []) {
127
+ const ready = raw;
128
+ state.readyByScheduleId.set(ready.scheduleId, ready);
129
+ }
130
+ if (opts.overdue !== void 0) {
131
+ for (const raw of depBatch(ctx, 2) ?? []) {
132
+ emitOverdueHandoffStatus(ctx, state, raw);
133
+ }
134
+ }
135
+ evaluateReadyHandoffs(ctx, state);
136
+ ctx.down([["DATA", { kind: "views", views: buildHandoffViews(state) }]]);
137
+ ctx.state.set(state);
138
+ },
139
+ {
140
+ name: `${name}/runtime`,
141
+ factory: "workQueueReadinessHandoffProjector",
142
+ partial: true,
143
+ completeWhenDepsComplete: false,
144
+ errorWhenDepsError: false
145
+ }
146
+ );
147
+ return {
148
+ candidates: projectRuntimeFact(
149
+ graph,
150
+ runtime,
151
+ `${name}/candidates`,
152
+ "workQueueReadinessHandoffCandidates",
153
+ (fact) => fact.kind === "candidate" ? fact.candidate : void 0
154
+ ),
155
+ status: projectRuntimeFact(
156
+ graph,
157
+ runtime,
158
+ `${name}/status`,
159
+ "workQueueReadinessHandoffStatus",
160
+ (fact) => fact.kind === "status" ? fact.status : void 0
161
+ ),
162
+ issues: projectRuntimeFact(
163
+ graph,
164
+ runtime,
165
+ `${name}/issues`,
166
+ "workQueueReadinessHandoffIssues",
167
+ (fact) => fact.kind === "issue" ? fact.issue : void 0
168
+ ),
169
+ audit: projectRuntimeFact(
170
+ graph,
171
+ runtime,
172
+ `${name}/audit`,
173
+ "workQueueReadinessHandoffAudit",
174
+ (fact) => fact.kind === "audit" ? fact.audit : void 0
175
+ ),
176
+ views: projectRuntimeFact(
177
+ graph,
178
+ runtime,
179
+ `${name}/views`,
180
+ "workQueueReadinessHandoffViews",
181
+ (fact) => fact.kind === "views" ? fact.views : void 0
182
+ )
183
+ };
184
+ }
185
+ function workQueueLeaseExpirationCommandProjector(graph, opts) {
186
+ const name = opts.name ?? "workQueueLeaseExpirationCommands";
187
+ const runtime = graph.node(
188
+ [opts.candidates],
189
+ (ctx) => {
190
+ const state = ctx.state.get() ?? leaseExpirationCommandState();
191
+ for (const raw of depBatch(ctx, 0) ?? []) {
192
+ const candidate = raw;
193
+ if (candidate.candidateKind !== "lease-expiration-eligible") continue;
194
+ if (state.commandByCandidateId.has(candidate.candidateId)) continue;
195
+ const command = Object.freeze({
196
+ kind: "expire-leases",
197
+ commandId: `${candidate.candidateId}:expire-leases`,
198
+ queueId: candidate.queueId,
199
+ workIds: [candidate.workId],
200
+ limit: 1,
201
+ nowMs: candidate.nowMs,
202
+ causationId: candidate.scheduleId,
203
+ ...sourceRefStrings(candidate.sourceRefs) === void 0 ? {} : { sourceRefs: sourceRefStrings(candidate.sourceRefs) }
204
+ });
205
+ state.commandByCandidateId.set(candidate.candidateId, command);
206
+ ctx.down([["DATA", { kind: "command", command }]]);
207
+ emitLeaseCommandStatus(ctx, state, command, candidate);
208
+ }
209
+ ctx.down([["DATA", { kind: "views", views: buildLeaseCommandViews(state) }]]);
210
+ ctx.state.set(state);
211
+ },
212
+ {
213
+ name: `${name}/runtime`,
214
+ factory: "workQueueLeaseExpirationCommandProjector",
215
+ partial: true,
216
+ completeWhenDepsComplete: false,
217
+ errorWhenDepsError: false
218
+ }
219
+ );
220
+ return {
221
+ commands: projectRuntimeFact(
222
+ graph,
223
+ runtime,
224
+ `${name}/commands`,
225
+ "workQueueLeaseExpirationCommands",
226
+ (fact) => fact.kind === "command" ? fact.command : void 0
227
+ ),
228
+ status: projectRuntimeFact(
229
+ graph,
230
+ runtime,
231
+ `${name}/status`,
232
+ "workQueueLeaseExpirationCommandStatus",
233
+ (fact) => fact.kind === "status" ? fact.status : void 0
234
+ ),
235
+ views: projectRuntimeFact(
236
+ graph,
237
+ runtime,
238
+ `${name}/views`,
239
+ "workQueueLeaseExpirationCommandViews",
240
+ (fact) => fact.kind === "views" ? fact.views : void 0
241
+ )
242
+ };
243
+ }
244
+ function initialState() {
245
+ return {
246
+ recordScheduleIdentityByKey: /* @__PURE__ */ new Map(),
247
+ schedulesById: /* @__PURE__ */ new Map(),
248
+ statusById: /* @__PURE__ */ new Map(),
249
+ emittedKeys: /* @__PURE__ */ new Set(),
250
+ issueKeys: /* @__PURE__ */ new Set(),
251
+ auditSeq: 0
252
+ };
253
+ }
254
+ function handoffState() {
255
+ return {
256
+ originsByScheduleId: /* @__PURE__ */ new Map(),
257
+ worksById: /* @__PURE__ */ new Map(),
258
+ readyByScheduleId: /* @__PURE__ */ new Map(),
259
+ candidatesById: /* @__PURE__ */ new Map(),
260
+ statusById: /* @__PURE__ */ new Map(),
261
+ emittedKeys: /* @__PURE__ */ new Set(),
262
+ issueKeys: /* @__PURE__ */ new Set(),
263
+ auditSeq: 0
264
+ };
265
+ }
266
+ function leaseExpirationCommandState() {
267
+ return {
268
+ commandByCandidateId: /* @__PURE__ */ new Map(),
269
+ statusById: /* @__PURE__ */ new Map(),
270
+ emittedKeys: /* @__PURE__ */ new Set()
271
+ };
272
+ }
273
+ function ingestWorkQueueRecord(state, record) {
274
+ const translated = translateRecord(record);
275
+ if (translated.kind === "translated") {
276
+ state.originsByScheduleId.set(translated.schedule.scheduleId, {
277
+ record: translated.record,
278
+ schedule: translated.schedule,
279
+ scheduleKind: translated.status.scheduleKind
280
+ });
281
+ }
282
+ if (record.workId === void 0) return;
283
+ const recordWithWorkId = record;
284
+ const existing = state.worksById.get(
285
+ handoffWorkKey(recordWithWorkId.queueId, recordWithWorkId.workId)
286
+ );
287
+ if (existing !== void 0 && recordWithWorkId.recordSeq < existing.latestRecordSeq) return;
288
+ const work = ensureHandoffWorkState(state, recordWithWorkId);
289
+ work.latestRecordSeq = Math.max(work.latestRecordSeq, recordWithWorkId.recordSeq);
290
+ switch (recordWithWorkId.kind) {
291
+ case "work-admitted":
292
+ work.state = recordWithWorkId.notBeforeMs === void 0 ? "ready" : "scheduled";
293
+ work.notBeforeMs = recordWithWorkId.notBeforeMs;
294
+ work.retryAtMs = void 0;
295
+ work.deadlineMs = recordWithWorkId.deadlineMs;
296
+ clearHandoffLease(work);
297
+ break;
298
+ case "work-scheduled":
299
+ work.state = "scheduled";
300
+ work.notBeforeMs = recordWithWorkId.notBeforeMs;
301
+ work.deadlineMs = recordWithWorkId.deadlineMs;
302
+ break;
303
+ case "retry-scheduled":
304
+ work.state = recordWithWorkId.retryAtMs <= recordWithWorkId.recordedAtMs ? "ready" : "retry-wait";
305
+ work.retryAtMs = recordWithWorkId.retryAtMs;
306
+ work.notBeforeMs = void 0;
307
+ break;
308
+ case "work-claimed":
309
+ work.state = "leased";
310
+ work.leaseId = recordWithWorkId.leaseId;
311
+ work.attempt = recordWithWorkId.attempt;
312
+ work.workerId = recordWithWorkId.workerId;
313
+ work.leaseExpiresAtMs = recordWithWorkId.leaseExpiresAtMs;
314
+ break;
315
+ case "lease-renewed":
316
+ work.state = "leased";
317
+ work.leaseId = recordWithWorkId.leaseId;
318
+ work.attempt = recordWithWorkId.attempt;
319
+ work.workerId = recordWithWorkId.workerId;
320
+ work.leaseExpiresAtMs = recordWithWorkId.leaseExpiresAtMs;
321
+ break;
322
+ case "work-released":
323
+ case "lease-expired":
324
+ work.state = "ready";
325
+ clearHandoffLease(work);
326
+ break;
327
+ case "work-completed":
328
+ work.state = "completed";
329
+ clearHandoffLease(work);
330
+ break;
331
+ case "work-canceled":
332
+ work.state = "canceled";
333
+ clearHandoffLease(work);
334
+ break;
335
+ case "work-dead-lettered":
336
+ work.state = "dead-lettered";
337
+ clearHandoffLease(work);
338
+ break;
339
+ }
340
+ }
341
+ function ensureHandoffWorkState(state, record) {
342
+ const key = handoffWorkKey(record.queueId, record.workId);
343
+ const existing = state.worksById.get(key);
344
+ if (existing !== void 0) return existing;
345
+ const next = {
346
+ queueId: record.queueId,
347
+ workId: record.workId,
348
+ state: "ready",
349
+ latestRecordSeq: record.recordSeq
350
+ };
351
+ state.worksById.set(key, next);
352
+ return next;
353
+ }
354
+ function handoffWorkKey(queueId, workId) {
355
+ return stableJsonStringify([queueId, workId]);
356
+ }
357
+ function clearHandoffLease(work) {
358
+ work.leaseId = void 0;
359
+ work.attempt = void 0;
360
+ work.workerId = void 0;
361
+ work.leaseExpiresAtMs = void 0;
362
+ }
363
+ function evaluateReadyHandoffs(ctx, state) {
364
+ for (const ready of state.readyByScheduleId.values()) {
365
+ const origin = state.originsByScheduleId.get(ready.scheduleId);
366
+ if (origin === void 0) {
367
+ emitHandoffStatus(
368
+ ctx,
369
+ state,
370
+ handoffStatus("pending-origin", {
371
+ scheduleId: ready.scheduleId,
372
+ readyAtMs: ready.readyAtMs,
373
+ nowMs: ready.nowMs,
374
+ sourceRefs: ready.sourceRefs
375
+ })
376
+ );
377
+ continue;
378
+ }
379
+ const work = state.worksById.get(handoffWorkKey(origin.record.queueId, origin.record.workId));
380
+ if (work === void 0) {
381
+ emitHandoffStatus(
382
+ ctx,
383
+ state,
384
+ handoffStatus("pending-origin", {
385
+ queueId: origin.record.queueId,
386
+ workId: origin.record.workId,
387
+ scheduleId: ready.scheduleId,
388
+ readyAtMs: ready.readyAtMs,
389
+ nowMs: ready.nowMs,
390
+ sourceRefs: ready.sourceRefs
391
+ })
392
+ );
393
+ continue;
394
+ }
395
+ if (origin.record.recordSeq < work.latestRecordSeq) {
396
+ emitSuperseded(ctx, state, origin, work, ready, {
397
+ latestRecordSeq: work.latestRecordSeq
398
+ });
399
+ continue;
400
+ }
401
+ const terminal = terminalHandoffState(work.state);
402
+ if (terminal) {
403
+ emitHandoffStatus(
404
+ ctx,
405
+ state,
406
+ handoffStatus("ignored-terminal", {
407
+ queueId: work.queueId,
408
+ workId: work.workId,
409
+ scheduleId: ready.scheduleId,
410
+ readyAtMs: ready.readyAtMs,
411
+ nowMs: ready.nowMs,
412
+ currentState: work.state,
413
+ sourceRefs: ready.sourceRefs
414
+ })
415
+ );
416
+ continue;
417
+ }
418
+ if (origin.scheduleKind === "lease-expiration") {
419
+ evaluateLeaseExpirationReady(ctx, state, origin, work, ready);
420
+ continue;
421
+ }
422
+ evaluateClaimEligibilityReady(ctx, state, origin, work, ready);
423
+ }
424
+ }
425
+ function evaluateClaimEligibilityReady(ctx, state, origin, work, ready) {
426
+ if (work.state === "leased") {
427
+ emitHandoffStatus(
428
+ ctx,
429
+ state,
430
+ handoffStatus("ignored-stale", {
431
+ queueId: work.queueId,
432
+ workId: work.workId,
433
+ scheduleId: ready.scheduleId,
434
+ readyAtMs: ready.readyAtMs,
435
+ nowMs: ready.nowMs,
436
+ currentState: work.state,
437
+ sourceRefs: ready.sourceRefs
438
+ })
439
+ );
440
+ return;
441
+ }
442
+ if (work.notBeforeMs !== void 0 && work.notBeforeMs > ready.nowMs) {
443
+ emitSuperseded(ctx, state, origin, work, ready, { notBeforeMs: work.notBeforeMs });
444
+ return;
445
+ }
446
+ if (work.retryAtMs !== void 0 && work.retryAtMs > ready.nowMs) {
447
+ emitSuperseded(ctx, state, origin, work, ready, { retryAtMs: work.retryAtMs });
448
+ return;
449
+ }
450
+ emitCandidate(ctx, state, candidateFor(origin, ready, "claim-eligible"));
451
+ }
452
+ function evaluateLeaseExpirationReady(ctx, state, origin, work, ready) {
453
+ if (origin.record.kind !== "work-claimed" && origin.record.kind !== "lease-renewed") {
454
+ emitHandoffIssue(
455
+ ctx,
456
+ state,
457
+ dataIssue(
458
+ "work-queue-readiness-handoff-malformed-origin",
459
+ "Lease-expiration readiness must originate from a lease-bearing workQueue record.",
460
+ { subjectId: ready.scheduleId, refs: ready.sourceRefs }
461
+ )
462
+ );
463
+ return;
464
+ }
465
+ if (work.state !== "leased" || work.leaseId !== origin.record.leaseId || work.attempt !== origin.record.attempt || work.workerId !== origin.record.workerId) {
466
+ emitHandoffStatus(
467
+ ctx,
468
+ state,
469
+ handoffStatus("ignored-stale", {
470
+ queueId: work.queueId,
471
+ workId: work.workId,
472
+ scheduleId: ready.scheduleId,
473
+ readyAtMs: ready.readyAtMs,
474
+ nowMs: ready.nowMs,
475
+ currentState: work.state,
476
+ sourceRefs: ready.sourceRefs
477
+ })
478
+ );
479
+ return;
480
+ }
481
+ if (work.leaseExpiresAtMs !== origin.record.leaseExpiresAtMs) {
482
+ emitSuperseded(ctx, state, origin, work, ready, {
483
+ leaseExpiresAtMs: work.leaseExpiresAtMs
484
+ });
485
+ return;
486
+ }
487
+ if (work.leaseExpiresAtMs !== void 0 && work.leaseExpiresAtMs > ready.nowMs) {
488
+ emitSuperseded(ctx, state, origin, work, ready, {
489
+ leaseExpiresAtMs: work.leaseExpiresAtMs
490
+ });
491
+ return;
492
+ }
493
+ emitCandidate(ctx, state, candidateFor(origin, ready, "lease-expiration-eligible"));
494
+ }
495
+ function emitSuperseded(ctx, state, origin, work, ready, metadata) {
496
+ emitHandoffStatus(
497
+ ctx,
498
+ state,
499
+ handoffStatus("ignored-superseded", {
500
+ queueId: work.queueId,
501
+ workId: work.workId,
502
+ scheduleId: ready.scheduleId,
503
+ readyAtMs: ready.readyAtMs,
504
+ nowMs: ready.nowMs,
505
+ currentState: work.state,
506
+ sourceRefs: ready.sourceRefs,
507
+ metadata: {
508
+ originRecordSeq: origin.record.recordSeq,
509
+ originRecordKind: origin.record.kind,
510
+ ...metadata
511
+ }
512
+ })
513
+ );
514
+ }
515
+ function candidateFor(origin, ready, candidateKind) {
516
+ const lease = origin.record.kind === "work-claimed" || origin.record.kind === "lease-renewed" ? {
517
+ leaseId: origin.record.leaseId,
518
+ attempt: origin.record.attempt,
519
+ workerId: origin.record.workerId,
520
+ leaseExpiresAtMs: origin.record.leaseExpiresAtMs
521
+ } : {};
522
+ const metadata = sanitizeGraphVisibleRecord({
523
+ originRecordSeq: origin.record.recordSeq,
524
+ originRecordKind: origin.record.kind,
525
+ scheduleKind: origin.scheduleKind
526
+ });
527
+ return Object.freeze({
528
+ kind: "work-queue-readiness-candidate",
529
+ candidateId: `${ready.scheduleId}:work-queue:${candidateKind}`,
530
+ candidateKind,
531
+ queueId: origin.record.queueId,
532
+ workId: origin.record.workId,
533
+ scheduleId: ready.scheduleId,
534
+ readyAtMs: ready.readyAtMs,
535
+ nowMs: ready.nowMs,
536
+ originRecordSeq: origin.record.recordSeq,
537
+ originRecordKind: origin.record.kind,
538
+ ...lease,
539
+ sourceRefs: canonicalPublicSourceRefs(
540
+ uniqueSourceRefs([
541
+ ...ready.sourceRefs ?? [],
542
+ ref("work-queue-record", String(origin.record.recordSeq)),
543
+ ref("scheduled-readiness-ready", ready.scheduleId)
544
+ ])
545
+ ),
546
+ ...metadata === void 0 ? {} : { metadata }
547
+ });
548
+ }
549
+ function emitCandidate(ctx, state, candidate) {
550
+ const key = `candidate:${candidate.candidateId}`;
551
+ if (!state.emittedKeys.has(key)) {
552
+ state.emittedKeys.add(key);
553
+ state.candidatesById.set(candidate.candidateId, candidate);
554
+ ctx.down([["DATA", { kind: "candidate", candidate }]]);
555
+ emitHandoffAudit(ctx, state, "work-queue-readiness-candidate", {
556
+ subjectId: candidate.candidateId,
557
+ sourceRefs: candidate.sourceRefs,
558
+ metadata: {
559
+ candidateKind: candidate.candidateKind,
560
+ queueId: candidate.queueId,
561
+ workId: candidate.workId,
562
+ readyAtMs: candidate.readyAtMs,
563
+ nowMs: candidate.nowMs
564
+ }
565
+ });
566
+ } else {
567
+ state.candidatesById.set(candidate.candidateId, candidate);
568
+ }
569
+ emitHandoffStatus(
570
+ ctx,
571
+ state,
572
+ handoffStatus("candidate", {
573
+ queueId: candidate.queueId,
574
+ workId: candidate.workId,
575
+ scheduleId: candidate.scheduleId,
576
+ candidateId: candidate.candidateId,
577
+ candidateKind: candidate.candidateKind,
578
+ readyAtMs: candidate.readyAtMs,
579
+ nowMs: candidate.nowMs,
580
+ sourceRefs: candidate.sourceRefs
581
+ })
582
+ );
583
+ }
584
+ function emitOverdueHandoffStatus(ctx, state, overdue) {
585
+ const origin = state.originsByScheduleId.get(overdue.scheduleId);
586
+ emitHandoffStatus(
587
+ ctx,
588
+ state,
589
+ handoffStatus("overdue", {
590
+ queueId: origin?.record.queueId,
591
+ workId: origin?.record.workId,
592
+ scheduleId: overdue.scheduleId,
593
+ readyAtMs: overdue.readyAtMs,
594
+ nowMs: overdue.nowMs,
595
+ sourceRefs: overdue.sourceRefs,
596
+ metadata: {
597
+ deadlineMs: overdue.deadlineMs,
598
+ ...origin === void 0 ? {} : { originRecordSeq: origin.record.recordSeq, originRecordKind: origin.record.kind }
599
+ }
600
+ })
601
+ );
602
+ }
603
+ function handoffStatus(state, opts) {
604
+ const subject = opts.candidateId ?? opts.scheduleId ?? "unknown-work-queue-readiness";
605
+ const metadata = sanitizeGraphVisibleRecord(opts.metadata);
606
+ return Object.freeze({
607
+ kind: "work-queue-readiness-handoff-status",
608
+ statusId: `${subject}:work-queue-readiness-handoff-status:${state}`,
609
+ state,
610
+ ...opts.queueId === void 0 ? {} : { queueId: opts.queueId },
611
+ ...opts.workId === void 0 ? {} : { workId: opts.workId },
612
+ ...opts.scheduleId === void 0 ? {} : { scheduleId: opts.scheduleId },
613
+ ...opts.candidateId === void 0 ? {} : { candidateId: opts.candidateId },
614
+ ...opts.candidateKind === void 0 ? {} : { candidateKind: opts.candidateKind },
615
+ ...opts.readyAtMs === void 0 ? {} : { readyAtMs: opts.readyAtMs },
616
+ ...opts.nowMs === void 0 ? {} : { nowMs: opts.nowMs },
617
+ ...opts.currentState === void 0 ? {} : { currentState: opts.currentState },
618
+ ...opts.sourceRefs === void 0 ? {} : { sourceRefs: canonicalPublicSourceRefs(opts.sourceRefs) },
619
+ ...opts.issueCodes === void 0 ? {} : { issueCodes: opts.issueCodes },
620
+ ...metadata === void 0 ? {} : { metadata }
621
+ });
622
+ }
623
+ function emitHandoffStatus(ctx, state, status) {
624
+ state.statusById.set(status.statusId, status);
625
+ const key = `handoff-status:${status.statusId}:${stableJsonStringify(status)}`;
626
+ if (state.emittedKeys.has(key)) return;
627
+ state.emittedKeys.add(key);
628
+ ctx.down([["DATA", { kind: "status", status }]]);
629
+ }
630
+ function emitHandoffIssue(ctx, state, issue) {
631
+ const key = `${issue.code}:${issue.subjectId ?? ""}:${JSON.stringify(issue.details ?? {})}`;
632
+ if (state.issueKeys.has(key)) return;
633
+ state.issueKeys.add(key);
634
+ ctx.down([["DATA", { kind: "issue", issue }]]);
635
+ emitHandoffStatus(
636
+ ctx,
637
+ state,
638
+ handoffStatus("issue", {
639
+ scheduleId: issue.subjectId,
640
+ sourceRefs: issue.refs?.map(sourceRefFromIssueRef),
641
+ issueCodes: [issue.code]
642
+ })
643
+ );
644
+ }
645
+ function emitHandoffAudit(ctx, state, kind, opts) {
646
+ state.auditSeq += 1;
647
+ const metadata = sanitizeGraphVisibleRecord(opts.metadata);
648
+ ctx.down([
649
+ [
650
+ "DATA",
651
+ {
652
+ kind: "audit",
653
+ audit: Object.freeze({
654
+ id: `work-queue-readiness-handoff-audit-${state.auditSeq}`,
655
+ kind,
656
+ subjectId: opts.subjectId,
657
+ ...opts.sourceRefs === void 0 ? {} : { sourceRefs: canonicalPublicSourceRefs(opts.sourceRefs) },
658
+ ...metadata === void 0 ? {} : { metadata }
659
+ })
660
+ }
661
+ ]
662
+ ]);
663
+ }
664
+ function buildHandoffViews(state) {
665
+ return Object.freeze({
666
+ candidatesById: new Map(state.candidatesById),
667
+ statusById: new Map(state.statusById)
668
+ });
669
+ }
670
+ function emitLeaseCommandStatus(ctx, state, command, candidate) {
671
+ const status = handoffStatus("candidate", {
672
+ queueId: candidate.queueId,
673
+ workId: candidate.workId,
674
+ scheduleId: candidate.scheduleId,
675
+ candidateId: candidate.candidateId,
676
+ candidateKind: candidate.candidateKind,
677
+ readyAtMs: candidate.readyAtMs,
678
+ nowMs: candidate.nowMs,
679
+ sourceRefs: candidate.sourceRefs,
680
+ metadata: {
681
+ commandId: command.commandId,
682
+ commandKind: command.kind
683
+ }
684
+ });
685
+ state.statusById.set(status.statusId, status);
686
+ const key = `lease-command-status:${status.statusId}`;
687
+ if (state.emittedKeys.has(key)) return;
688
+ state.emittedKeys.add(key);
689
+ ctx.down([["DATA", { kind: "status", status }]]);
690
+ }
691
+ function buildLeaseCommandViews(state) {
692
+ return Object.freeze({
693
+ candidatesById: /* @__PURE__ */ new Map(),
694
+ statusById: new Map(state.statusById)
695
+ });
696
+ }
697
+ function sourceRefStrings(sourceRefs) {
698
+ if (sourceRefs === void 0 || sourceRefs.length === 0) return void 0;
699
+ return sourceRefs.map((sourceRef) => `${sourceRef.kind}:${sourceRef.id}`);
700
+ }
701
+ function sourceRefFromIssueRef(issueRef) {
702
+ const [kind, ...rest] = issueRef.split(":");
703
+ return ref(kind || "issue-ref", rest.join(":") || issueRef);
704
+ }
705
+ function terminalHandoffState(state) {
706
+ return state === "completed" || state === "canceled" || state === "dead-lettered";
707
+ }
708
+ function hasWorkRecordCoordinates(record) {
709
+ return typeof record.queueId === "string" && typeof record.workId === "string" && typeof record.recordSeq === "number" && Number.isFinite(record.recordSeq);
710
+ }
711
+ function hasLeaseRecordCoordinates(record) {
712
+ return hasWorkRecordCoordinates(record) && typeof record.leaseId === "string" && typeof record.attempt === "number" && Number.isFinite(record.attempt) && typeof record.workerId === "string";
713
+ }
714
+ function malformedRecord(record, message) {
715
+ const subjectId = typeof record.kind === "string" ? `work-queue-record:${publicCoordinateId(record.kind)}` : "unknown-work-queue-record";
716
+ const issue = dataIssue("work-queue-scheduled-readiness-malformed-record", message, {
717
+ subjectId,
718
+ refs: [],
719
+ details: sanitizeGraphVisibleRecord({
720
+ recordKind: typeof record.kind === "string" ? record.kind : void 0,
721
+ queueId: typeof record.queueId === "string" ? publicCoordinateId(record.queueId) : void 0,
722
+ workId: typeof record.workId === "string" ? publicCoordinateId(record.workId) : void 0,
723
+ recordSeq: typeof record.recordSeq === "number" && Number.isFinite(record.recordSeq) ? record.recordSeq : void 0
724
+ })
725
+ });
726
+ return {
727
+ kind: "issue",
728
+ issue,
729
+ status: issueStatus(subjectId, [issue])
730
+ };
731
+ }
732
+ function translateRecord(raw) {
733
+ if (!isRecord(raw)) {
734
+ const issue = dataIssue(
735
+ "work-queue-scheduled-readiness-malformed-record",
736
+ "WorkQueue scheduled readiness requires a graph-visible workQueue record.",
737
+ { subjectId: "unknown-work-queue-record", refs: [] }
738
+ );
739
+ return {
740
+ kind: "issue",
741
+ issue,
742
+ status: issueStatus("unknown-work-queue-record", [issue])
743
+ };
744
+ }
745
+ const unknownRecord = raw;
746
+ const rawRecord = unknownRecord;
747
+ switch (rawRecord.kind) {
748
+ case "work-admitted": {
749
+ const notBeforeMs = rawRecord.notBeforeMs;
750
+ if (notBeforeMs === void 0) return { kind: "none" };
751
+ if (typeof notBeforeMs !== "number") {
752
+ return malformedRecord(rawRecord, "Delayed work-admitted notBeforeMs must be a number.");
753
+ }
754
+ if (!hasWorkRecordCoordinates(rawRecord)) {
755
+ return malformedRecord(
756
+ rawRecord,
757
+ "Delayed work-admitted records require queueId, workId, and recordSeq."
758
+ );
759
+ }
760
+ const admitted = rawRecord;
761
+ return scheduleFromRecord(admitted, {
762
+ scheduleKind: "work-admitted",
763
+ scheduleId: workQueueScheduleId(admitted, "admission", admitted.recordSeq),
764
+ readyAtMs: notBeforeMs,
765
+ deadlineMs: admitted.deadlineMs,
766
+ reason: "work-queue-delayed-admission"
767
+ });
768
+ }
769
+ case "work-scheduled": {
770
+ if (!hasWorkRecordCoordinates(rawRecord)) {
771
+ return malformedRecord(
772
+ rawRecord,
773
+ "work-scheduled records require queueId, workId, and recordSeq."
774
+ );
775
+ }
776
+ const scheduled = rawRecord;
777
+ return scheduleFromRecord(scheduled, {
778
+ scheduleKind: "work-scheduled",
779
+ scheduleId: workQueueScheduleId(
780
+ scheduled,
781
+ "schedule",
782
+ scheduled.scheduleId ?? scheduled.commandId ?? scheduled.recordSeq
783
+ ),
784
+ readyAtMs: scheduled.notBeforeMs,
785
+ deadlineMs: scheduled.deadlineMs,
786
+ reason: scheduled.reason ?? "work-queue-schedule"
787
+ });
788
+ }
789
+ case "retry-scheduled": {
790
+ if (!hasWorkRecordCoordinates(rawRecord)) {
791
+ return malformedRecord(
792
+ rawRecord,
793
+ "retry-scheduled records require queueId, workId, and recordSeq."
794
+ );
795
+ }
796
+ const retry = rawRecord;
797
+ return scheduleFromRecord(retry, {
798
+ scheduleKind: "retry-scheduled",
799
+ scheduleId: workQueueScheduleId(retry, "retry", retry.commandId ?? retry.recordSeq),
800
+ readyAtMs: retry.retryAtMs,
801
+ reason: retry.reason ?? "work-queue-retry",
802
+ metadata: { delayMs: retry.delayMs }
803
+ });
804
+ }
805
+ case "work-claimed": {
806
+ if (!hasLeaseRecordCoordinates(rawRecord)) {
807
+ return malformedRecord(
808
+ rawRecord,
809
+ "work-claimed records require queueId, workId, recordSeq, leaseId, attempt, and workerId."
810
+ );
811
+ }
812
+ const claimed = rawRecord;
813
+ return scheduleFromRecord(claimed, {
814
+ scheduleKind: "lease-expiration",
815
+ scheduleId: workQueueLeaseScheduleId(claimed),
816
+ readyAtMs: claimed.leaseExpiresAtMs,
817
+ reason: "work-queue-lease-expiration",
818
+ leaseId: claimed.leaseId,
819
+ metadata: { attempt: claimed.attempt }
820
+ });
821
+ }
822
+ case "lease-renewed": {
823
+ if (!hasLeaseRecordCoordinates(rawRecord)) {
824
+ return malformedRecord(
825
+ rawRecord,
826
+ "lease-renewed records require queueId, workId, recordSeq, leaseId, attempt, and workerId."
827
+ );
828
+ }
829
+ const renewed = rawRecord;
830
+ return scheduleFromRecord(renewed, {
831
+ scheduleKind: "lease-expiration",
832
+ scheduleId: workQueueLeaseScheduleId(renewed),
833
+ readyAtMs: renewed.leaseExpiresAtMs,
834
+ reason: "work-queue-lease-expiration",
835
+ leaseId: renewed.leaseId,
836
+ metadata: {
837
+ attempt: renewed.attempt,
838
+ previousLeaseExpiresAtMs: renewed.previousLeaseExpiresAtMs
839
+ }
840
+ });
841
+ }
842
+ default:
843
+ return { kind: "none" };
844
+ }
845
+ }
846
+ function scheduleFromRecord(record, opts) {
847
+ if (!Number.isFinite(opts.readyAtMs) || !finiteOrUndefined(opts.deadlineMs)) {
848
+ const refs = recordSourceRefs(record, opts.leaseId);
849
+ const issue = dataIssue(
850
+ "work-queue-scheduled-readiness-malformed-record",
851
+ "WorkQueue delayed eligibility record must carry finite readiness and deadline coordinates.",
852
+ {
853
+ subjectId: workQueueRecordSubjectId(record),
854
+ refs,
855
+ details: {
856
+ recordKind: record.kind,
857
+ readyAtMs: opts.readyAtMs,
858
+ deadlineMs: opts.deadlineMs
859
+ }
860
+ }
861
+ );
862
+ return {
863
+ kind: "issue",
864
+ issue,
865
+ status: issueStatus(opts.scheduleId, [issue], record, refs)
866
+ };
867
+ }
868
+ const subjectRefs = recordSubjectRefs(record, opts.leaseId);
869
+ const sourceRefs = recordSourceRefs(record, opts.leaseId);
870
+ const recordPolicyRefs = policyRefs(record);
871
+ const metadata = sanitizeGraphVisibleRecord({
872
+ queueId: publicCoordinateId(record.queueId),
873
+ workId: publicCoordinateId(record.workId),
874
+ recordSeq: record.recordSeq,
875
+ recordKind: record.kind,
876
+ scheduleKind: opts.scheduleKind,
877
+ ...record.commandId === void 0 ? {} : { commandId: publicCoordinateId(record.commandId) },
878
+ ...opts.leaseId === void 0 ? {} : { leaseId: publicCoordinateId(opts.leaseId) },
879
+ ...opts.metadata ?? {}
880
+ });
881
+ const schedule = Object.freeze({
882
+ kind: "scheduled-readiness-requested",
883
+ scheduleId: opts.scheduleId,
884
+ subjectRefs,
885
+ readyAtMs: opts.readyAtMs,
886
+ ...opts.deadlineMs === void 0 ? {} : { deadlineMs: opts.deadlineMs },
887
+ reason: opts.reason,
888
+ ...recordPolicyRefs === void 0 ? {} : { policyRefs: recordPolicyRefs },
889
+ sourceRefs,
890
+ ...metadata === void 0 ? {} : { metadata }
891
+ });
892
+ return {
893
+ kind: "translated",
894
+ record,
895
+ schedule,
896
+ status: Object.freeze({
897
+ kind: "work-queue-scheduled-readiness-status",
898
+ statusId: `${opts.scheduleId}:work-queue-scheduled-readiness-status:translated`,
899
+ queueId: publicCoordinateId(record.queueId),
900
+ workId: publicCoordinateId(record.workId),
901
+ recordSeq: record.recordSeq,
902
+ state: "translated",
903
+ scheduleKind: opts.scheduleKind,
904
+ scheduleId: opts.scheduleId,
905
+ readyAtMs: opts.readyAtMs,
906
+ ...opts.deadlineMs === void 0 ? {} : { deadlineMs: opts.deadlineMs },
907
+ sourceRefs,
908
+ ...metadata === void 0 ? {} : { metadata }
909
+ })
910
+ };
911
+ }
912
+ function recordSubjectRefs(record, leaseId) {
913
+ return canonicalPublicSourceRefs(
914
+ uniqueSourceRefs([
915
+ ref("work-queue", publicCoordinateId(record.queueId)),
916
+ ref("work-queue-work", publicCoordinateId(record.workId)),
917
+ ref("work-queue-record", String(record.recordSeq)),
918
+ ...record.commandId === void 0 ? [] : [ref("work-queue-command", publicCoordinateId(record.commandId))],
919
+ ...leaseId === void 0 ? [] : [ref("work-queue-lease", publicCoordinateId(leaseId))]
920
+ ])
921
+ );
922
+ }
923
+ function recordSourceRefs(record, leaseId) {
924
+ return canonicalPublicSourceRefs(
925
+ uniqueSourceRefs([
926
+ ref("work-queue", publicCoordinateId(record.queueId)),
927
+ ref("work-queue-record", String(record.recordSeq)),
928
+ ...record.workId === void 0 ? [] : [ref("work-queue-work", publicCoordinateId(record.workId))],
929
+ ...record.commandId === void 0 ? [] : [ref("work-queue-command", publicCoordinateId(record.commandId))],
930
+ ...leaseId === void 0 ? [] : [ref("work-queue-lease", publicCoordinateId(leaseId))],
931
+ ...copiedPublicRefs(record.sourceRefs, "work-queue-source-ref")
932
+ ])
933
+ );
934
+ }
935
+ function policyRefs(record) {
936
+ if (record.policyRefs === void 0 || record.policyRefs.length === 0) return void 0;
937
+ return canonicalPublicSourceRefs(copiedPublicRefs(record.policyRefs, "work-queue-policy-ref"));
938
+ }
939
+ function workQueueScheduleId(record, part, id) {
940
+ return `workQueue:${publicCoordinateId(record.queueId)}:${publicCoordinateId(record.workId)}:${part}:${publicCoordinateId(String(id))}`;
941
+ }
942
+ function workQueueLeaseScheduleId(record) {
943
+ return `workQueue:${publicCoordinateId(record.queueId)}:${publicCoordinateId(record.workId)}:lease:${publicCoordinateId(record.leaseId)}:expires:${record.recordSeq}`;
944
+ }
945
+ function workQueueRecordSubjectId(record) {
946
+ return `${publicCoordinateId(record.queueId)}:${publicCoordinateId(record.workId)}:${record.recordSeq}`;
947
+ }
948
+ function copiedPublicRefs(ids, kind) {
949
+ if (ids === void 0 || ids.length === 0) return [];
950
+ const copied = ids.slice(0, MAX_COPIED_PUBLIC_REFS).map((id) => ref(kind, publicCoordinateId(id)));
951
+ if (ids.length <= MAX_COPIED_PUBLIC_REFS) return copied;
952
+ return [
953
+ ...copied,
954
+ ref(
955
+ `${kind}-overflow`,
956
+ `count:${ids.length}:hash:${stableStringHash(stableJsonStringify(ids))}`
957
+ )
958
+ ];
959
+ }
960
+ function publicCoordinateId(id) {
961
+ if (id.length <= MAX_PUBLIC_COORDINATE_ID_CHARS && !PRIVATE_COORDINATE_PATTERN.test(id)) {
962
+ return id;
963
+ }
964
+ return `bounded:${stableStringHash(id)}:${id.length}`;
965
+ }
966
+ function issueStatus(statusId, issues, record, sourceRefs) {
967
+ return Object.freeze({
968
+ kind: "work-queue-scheduled-readiness-status",
969
+ statusId: `${statusId}:work-queue-scheduled-readiness-status:issue`,
970
+ ...record?.queueId === void 0 ? {} : { queueId: publicCoordinateId(record.queueId) },
971
+ ...record?.workId === void 0 ? {} : { workId: publicCoordinateId(record.workId) },
972
+ ...record?.recordSeq === void 0 ? {} : { recordSeq: record.recordSeq },
973
+ state: "issue",
974
+ ...sourceRefs === void 0 ? {} : { sourceRefs },
975
+ issueCodes: issues.map((issue) => issue.code)
976
+ });
977
+ }
978
+ function finiteOrUndefined(value) {
979
+ return value === void 0 || Number.isFinite(value);
980
+ }
981
+ function scheduleIdentity(schedule) {
982
+ return stableJsonStringify({
983
+ scheduleId: schedule.scheduleId,
984
+ subjectRefs: schedule.subjectRefs,
985
+ readyAtMs: schedule.readyAtMs,
986
+ deadlineMs: schedule.deadlineMs,
987
+ reason: schedule.reason,
988
+ policyRefs: schedule.policyRefs,
989
+ sourceRefs: schedule.sourceRefs,
990
+ metadata: schedule.metadata
991
+ });
992
+ }
993
+ function emitScheduleConflict(ctx, state, translated, existing) {
994
+ const issue = dataIssue(
995
+ "work-queue-scheduled-readiness-schedule-conflict",
996
+ "WorkQueue delayed eligibility replayed with conflicting scheduled-readiness material; the first schedule was retained.",
997
+ {
998
+ subjectId: translated.schedule.scheduleId,
999
+ refs: translated.schedule.sourceRefs,
1000
+ details: {
1001
+ existingReadyAtMs: existing?.readyAtMs,
1002
+ incomingReadyAtMs: translated.schedule.readyAtMs,
1003
+ existingDeadlineMs: existing?.deadlineMs,
1004
+ incomingDeadlineMs: translated.schedule.deadlineMs,
1005
+ recordSeq: translated.record.recordSeq,
1006
+ recordKind: translated.record.kind
1007
+ }
1008
+ }
1009
+ );
1010
+ emitIssue(ctx, state, issue);
1011
+ emitStatus(
1012
+ ctx,
1013
+ state,
1014
+ issueStatus(
1015
+ `${translated.schedule.scheduleId}:conflict:${translated.record.recordSeq}`,
1016
+ [issue],
1017
+ translated.record,
1018
+ translated.schedule.sourceRefs
1019
+ )
1020
+ );
1021
+ }
1022
+ function emitSchedule(ctx, state, schedule) {
1023
+ const key = `schedule:${schedule.scheduleId}`;
1024
+ if (state.emittedKeys.has(key)) return;
1025
+ state.emittedKeys.add(key);
1026
+ ctx.down([["DATA", { kind: "readiness-schedule", schedule }]]);
1027
+ }
1028
+ function emitStatus(ctx, state, status) {
1029
+ state.statusById.set(status.statusId, status);
1030
+ const key = `status:${status.statusId}:${(status.issueCodes ?? []).join(",")}`;
1031
+ if (state.emittedKeys.has(key)) return;
1032
+ state.emittedKeys.add(key);
1033
+ ctx.down([["DATA", { kind: "status", status }]]);
1034
+ }
1035
+ function emitIssue(ctx, state, issue) {
1036
+ const key = `${issue.code}:${issue.subjectId ?? ""}:${JSON.stringify(issue.details ?? {})}`;
1037
+ if (state.issueKeys.has(key)) return;
1038
+ state.issueKeys.add(key);
1039
+ ctx.down([["DATA", { kind: "issue", issue }]]);
1040
+ }
1041
+ function emitAudit(ctx, state, kind, opts) {
1042
+ state.auditSeq += 1;
1043
+ const metadata = sanitizeGraphVisibleRecord(opts.metadata);
1044
+ ctx.down([
1045
+ [
1046
+ "DATA",
1047
+ {
1048
+ kind: "audit",
1049
+ audit: Object.freeze({
1050
+ id: `work-queue-scheduled-readiness-audit-${state.auditSeq}`,
1051
+ kind,
1052
+ subjectId: opts.subjectId,
1053
+ ...opts.sourceRefs === void 0 ? {} : { sourceRefs: canonicalPublicSourceRefs(opts.sourceRefs) },
1054
+ ...metadata === void 0 ? {} : { metadata }
1055
+ })
1056
+ }
1057
+ ]
1058
+ ]);
1059
+ }
1060
+ function buildViews(state) {
1061
+ return Object.freeze({
1062
+ schedulesById: new Map(state.schedulesById),
1063
+ statusById: new Map(state.statusById)
1064
+ });
1065
+ }
1066
+
7
1067
  // src/orchestration/work-queue.ts
8
1068
  function orchestrationWorkQueueRecipe(graph, opts) {
9
1069
  const name = opts.name ?? "orchestrationWorkQueue";
@@ -100,7 +1160,7 @@ function reduceRecord(ctx, state, record) {
100
1160
  if (isQueuedEffectPayload(record.payload)) {
101
1161
  state.payloads.set(record.workId, record.payload);
102
1162
  } else {
103
- emitIssue(ctx, state, record, "orchestration-queue-malformed-payload");
1163
+ emitIssue2(ctx, state, record, "orchestration-queue-malformed-payload");
104
1164
  }
105
1165
  return;
106
1166
  }
@@ -110,7 +1170,7 @@ function reduceRecord(ctx, state, record) {
110
1170
  state.terminalRecords.add(key);
111
1171
  const payload = record.workId === void 0 ? void 0 : state.payloads.get(record.workId);
112
1172
  if (payload === void 0) {
113
- emitIssue(ctx, state, record, "orchestration-queue-record-without-payload");
1173
+ emitIssue2(ctx, state, record, "orchestration-queue-record-without-payload");
114
1174
  return;
115
1175
  }
116
1176
  const evidence = evidenceFromRecord(record, payload);
@@ -182,7 +1242,7 @@ function project(graph, runtime, name, factory, pick) {
182
1242
  function emit(ctx, fact) {
183
1243
  ctx.down([["DATA", fact]]);
184
1244
  }
185
- function emitIssue(ctx, state, record, code) {
1245
+ function emitIssue2(ctx, state, record, code) {
186
1246
  const issue = queueIssue(record, code);
187
1247
  emit(ctx, { kind: "issue", issue });
188
1248
  state.auditSeq += 1;
@@ -221,6 +1281,9 @@ function isObjectRecord(value) {
221
1281
  }
222
1282
  export {
223
1283
  orchestrationWorkQueueRecipe,
224
- processEffectSubmitCommand
1284
+ processEffectSubmitCommand,
1285
+ workQueueLeaseExpirationCommandProjector,
1286
+ workQueueReadinessHandoffProjector,
1287
+ workQueueScheduledReadinessProjector
225
1288
  };
226
1289
  //# sourceMappingURL=work-queue.js.map