@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
@@ -6,7 +6,7 @@ import { L as LockId, W as Wave, P as PullDemand, M as Message } from './message
6
6
  * Canonical authority: ~/src/graphrefly/spec/rules.jsonl
7
7
  * R-handle (D7), R-dispatch-all (D21), R-sync-core (D20/D21).
8
8
  *
9
- * Lifted from the validated handle-dispatch PoC (packages/pure-ts r8-poc, R8/R9):
9
+ * Lifted from the validated retired handle-dispatch PoC (R8/R9):
10
10
  * fn lives in an external pool, indexed by handle; `dispatcher.invoke` is uniformly
11
11
  * SYNC void — async/remote behavior lives in the fn body (it kicks off async work
12
12
  * and emits later via `ctx.down`), not in a different call mechanism.
@@ -290,21 +290,6 @@ type NodeVersionJson = NodeVersion;
290
290
  */
291
291
  declare function defaultNodeVersionHash(bytes: Uint8Array): string;
292
292
 
293
- /**
294
- * The node primitive — the thinnest substrate object (R-node-thin / D5).
295
- *
296
- * Holds a fn handle + deps + the wave state machine; ZERO inspection cruft
297
- * (naming/find/describe are the graph layer, CSP-2). Canonical authority:
298
- * ~/src/graphrefly/spec/rules.jsonl (R-node-*, R-two-phase, R-diamond, R-resolved-undirty,
299
- * R-first-run-gate, R-push-subscribe, R-rom-ram, R-fn-contract, R-initial, R-ctx-up).
300
- *
301
- * Slice 1 = core wave: state node, compute node, two-phase DIRTY->DATA, diamond
302
- * pending-counter join, first-run gate, substrate-synthesized undirty RESOLVED
303
- * (R-resolved-undirty / D49 — no equals-substitution; every occurrence is DATA),
304
- * push-on-subscribe, lazy activation, ROM/RAM. Lifecycle (terminal/INVALIDATE/cleanup),
305
- * control (PAUSE/async), batch, and dynamicNode land in later slices.
306
- */
307
-
308
293
  type Status = "sentinel" | "pending" | "dirty" | "settled" | "resolved" | "completed" | "errored";
309
294
  interface NodeOptions<T = unknown> {
310
295
  /** Pre-populate cache; source pushes [DATA, initial] on subscribe (R-initial). `null` is valid. */
@@ -336,8 +321,9 @@ interface NodeOptions<T = unknown> {
336
321
  * then RE-QUIETS (1:1). Delivery content =
337
322
  * the orthogonal `pausable` mode: `true` → coalesced LATEST (one DATA); `'resumeAll'` → buffered
338
323
  * BACKLOG. `pullId` + `pausable:false` is REJECTED at construction. A SELF-triggered demand (a
339
- * consumer demanding a dep it ALSO reads) must defer via {@link Ctx.upNext} (R-rewire-deferred /
340
- * D37). Author the pullId as a shared module const used at both this node and the demander's fn.
324
+ * consumer demanding a dep it ALSO reads) must defer via {@link import("../ctx/types.js").Ctx.upNext}
325
+ * (R-rewire-deferred / D37). Author the pullId as a shared module const used at both this node and
326
+ * the demander's fn.
341
327
  */
342
328
  pullId?: LockId;
343
329
  /** Buffer the last N outgoing DATA for late subscribers (R-replay-buffer). */
@@ -364,6 +350,37 @@ interface NodeOptions<T = unknown> {
364
350
  */
365
351
  factory?: string;
366
352
  }
353
+
354
+ /**
355
+ * The node primitive — the thinnest substrate object (R-node-thin / D5).
356
+ *
357
+ * Holds a fn handle + deps + the wave state machine; ZERO inspection cruft
358
+ * (naming/find/describe are the graph layer, CSP-2). Canonical authority:
359
+ * ~/src/graphrefly/spec/rules.jsonl (R-node-*, R-two-phase, R-diamond, R-resolved-undirty,
360
+ * R-first-run-gate, R-push-subscribe, R-rom-ram, R-fn-contract, R-initial, R-ctx-up).
361
+ *
362
+ * Slice 1 = core wave: state node, compute node, two-phase DIRTY->DATA, diamond
363
+ * pending-counter join, first-run gate, substrate-synthesized undirty RESOLVED
364
+ * (R-resolved-undirty / D49 — no equals-substitution; every occurrence is DATA),
365
+ * push-on-subscribe, lazy activation, ROM/RAM. Lifecycle (terminal/INVALIDATE/cleanup),
366
+ * control (PAUSE/async), batch, and dynamicNode land in later slices.
367
+ */
368
+
369
+ /**
370
+ * Reactive substrate node that owns dependencies, wave handling, lifecycle, and subscribers.
371
+ *
372
+ * @example
373
+ * ```ts
374
+ * import { node } from "@graphrefly/ts";
375
+ *
376
+ * const source = node<number>([], null);
377
+ * source.subscribe((value) => console.log(value));
378
+ * source.down([["DATA", 1]]);
379
+ * ```
380
+ * @remarks **Substrate primitive:** `Node` is graph-agnostic; use `graph().node`,
381
+ * `graph().state`, or `graph().derived` when you want inspection and lifecycle ownership.
382
+ * @category core
383
+ */
367
384
  declare class Node<T = unknown> {
368
385
  private readonly _core;
369
386
  private readonly _id;
@@ -381,6 +398,7 @@ declare class Node<T = unknown> {
381
398
  private _released;
382
399
  private get _syncCtx();
383
400
  private set _syncCtx(value);
401
+ private static _retainIndirectRuntimeMethods;
384
402
  constructor(deps: Node<unknown>[], handleOrFn: Handle | NodeFn | null, opts?: NodeOptions<T>);
385
403
  /** R-pull (D55/D272): true while a pull node is not serving a PULL demand pulse. */
386
404
  private _isPullQuiet;
@@ -421,23 +439,6 @@ declare class Node<T = unknown> {
421
439
  * ONE declared edge (R-up-routing directed-up); omitted = broadcast up all deps.
422
440
  */
423
441
  up(msgs: Wave, towardDep?: number): void;
424
- /**
425
- * Enqueue a deferred self-rewire op (issued from this node's fn via `ctx.rewireNext`).
426
- * Applied at the committed wave boundary (boundary.ts drain), never in place — the in-fn
427
- * immediate path (`subscribeDep`/`replaceDeps`/`unsubscribeDep`) still throws mid-run (D37/R-reentrancy).
428
- */
429
- private _requestRewireNext;
430
- /**
431
- * Enqueue a deferred up-going control/demand wave (R-up-routing / R-pull / D269): at the committed wave
432
- * boundary, route `msgs` up from THIS node (broadcast, or up the single `towardDep` edge). The
433
- * deferred form of `ctx.up` — the SELF-demand path: a consumer issues `ctx.upNext([[PULL,
434
- * { pullId }]])` to demand a dep it ALSO reads; the demand applies at the boundary (not mid-fn), so
435
- * the pull node's delivery loops back as a FRESH wave rather than re-entering the consumer (D37 /
436
- * R-reentrancy). Rides the same R-rewire-deferred (D47) drain as ctx.rewireNext.
437
- */
438
- private _requestUpNext;
439
- /** Apply one queued self-rewire at the boundary (drain thunk). */
440
- private _applyRewireNext;
441
442
  /**
442
443
  * Replace this node's deps atomically (surgical, Option-C). Requires an explicit
443
444
  * `fn` (SD-1 fn-deps pairing — user fns read dep input positionally). Kept deps
@@ -450,57 +451,29 @@ declare class Node<T = unknown> {
450
451
  subscribeDep(depNode: Node<unknown>, fn: NodeFn): number;
451
452
  /** Unsubscribe from one dep (special case of replaceDeps); idempotent if absent (fn swap still applies). */
452
453
  unsubscribeDep(depNode: Node<unknown>, fn: NodeFn): void;
454
+ private _requestRewireNext;
455
+ private _requestUpNext;
456
+ private _applyRewireNext;
453
457
  private _dedupDeps;
454
- /** Is `target` reachable upstream from `from` (following deps)? Cycle-prevention DFS. */
455
458
  private _reachableUpstream;
456
459
  private _assertRewireDepOwner;
457
460
  private _rewire;
458
461
  private _activate;
459
- /**
460
- * Subscribe to a dep. The dispatch callback reads the dep's CURRENT index from a
461
- * mutable box (O(1)); a surgical rewire that reorders kept deps just updates the box
462
- * (R-rewire Option-C / D42) — no re-subscribe, no per-message indexOf scan. A removed
463
- * dep's box is set to -1 so any stale in-flight callback drops (drain).
464
- */
465
- private _subscribeDepAt;
466
- private _seedRestoredDepAt;
467
462
  private _deactivate;
468
463
  private _assertNotReleased;
469
464
  private _subscriberCount;
470
465
  private _isRuntimeQuiescentForRelease;
471
466
  private _releaseRuntime;
472
467
  private _resetDepState;
468
+ private _subscribeDepAt;
469
+ private _seedRestoredDepAt;
473
470
  private _recordDepProjection;
474
471
  private _depProjectionHasData;
475
472
  private _receiveFromDep;
476
- /**
477
- * R-terminal-settles-dirty (B35): release a dep's outstanding in-wave DIRTY contribution.
478
- * A settle-class event for that dep (DATA/RESOLVED inline above, INVALIDATE, and now
479
- * COMPLETE/ERROR) clears its dirty flag + decrements _pending. No-op if the dep already
480
- * settled this wave (DATA/RESOLVED ran first) — so the normal DATA-then-COMPLETE flow is
481
- * unaffected. This makes the exactly-one-settle invariant a single, shared step.
482
- */
483
473
  private _releaseDepDirty;
484
- /**
485
- * R-terminal-settles-dirty (B35): settle a node whose dirtied dep was released by an ABSORBED
486
- * terminal that is NOT a real input (a plain derived/effect — the common default-node case when
487
- * one of several deps completes while others stay live). Runs only when the release drained
488
- * _pending while the node still owes a downstream settle (it broadcast DIRTY this wave):
489
- * - if some OTHER dep delivered real DATA this wave (a value occurred) → recompute (→ DATA);
490
- * - else the terminal's signalled change did not materialise (no value) → one undirty RESOLVED
491
- * (R-resolved-undirty), keeping the cache (a terminal, unlike INVALIDATE, leaves the value).
492
- * A terminalAsRealInput node instead recomputes unconditionally (its fn reads the terminal).
493
- */
494
474
  private _settleAfterAbsorbedTerminal;
495
475
  private _markDirty;
496
476
  private _maybeRun;
497
- /**
498
- * R-rewire atomic settle (after a rewire that warrants a recompute): emit a proper
499
- * two-phase DIRTY→DATA wave (R-dirty-before-data — a rewire-triggered settle is a wave),
500
- * once, with every added dep already wired. Mirrors _maybeRun/_tryRun's pause + gate +
501
- * pending guards, then injects the phase-1 DIRTY the added dep's [START,DATA] handshake
502
- * did not carry.
503
- */
504
477
  private _settleRewire;
505
478
  private _tryRun;
506
479
  private _allDepsSettled;
@@ -513,14 +486,6 @@ declare class Node<T = unknown> {
513
486
  private _down;
514
487
  private _up;
515
488
  private _markDemandRouted;
516
- /**
517
- * Forward one up-going control message toward deps (R-up-routing): up the single declared edge
518
- * `towardDep` (directed — prunes other branches; only meaningful on the issuer's FIRST hop) or
519
- * broadcast up ALL deps. A depless source has no deps → the message DROPS here (the terminus —
520
- * e.g. a cone-routed PULL whose pullId no node up this cone holds, R-up-at-source). Recursive
521
- * forwarding carries the same per-wave route state and no `towardDep` → broadcast beyond the
522
- * first hop.
523
- */
524
489
  private _forwardUp;
525
490
  private _isPaused;
526
491
  private _hasBoundaryPauseLock;
@@ -528,48 +493,17 @@ declare class Node<T = unknown> {
528
493
  private _pauseAcquire;
529
494
  private _pauseRelease;
530
495
  private _onResume;
531
- /**
532
- * R-pull (D269): can this pull node fire a demand NOW? — not terminal, settle-ready (_pending===0),
533
- * and no OTHER (non-pullId) lock holds it paused. The gate that decides fire-now vs OWE.
534
- */
535
496
  private _canFireDemand;
536
- /**
537
- * R-pull (D269/D272): deliver ONE demand pulse — install activePull so the demand wave may
538
- * emit, fire it, then clear activePull so the node is quiet again (1:1).
539
- */
540
497
  private _deliverPullDemand;
541
- /**
542
- * R-pull (D269): a cone-routed PULL of THIS node's pullId arrived (R-up-routing) = a DEMAND.
543
- * Fire immediately if able; else OWE it — pin-5 (a dep DIRTY in flight, _pending>0) or F4/F5 (an
544
- * external PAUSE lock co-holds the node) — and fire when the node next becomes able. A demand
545
- * arriving WHILE a delivery is in flight (synchronous re-entry) is DROPPED (1:1, QA guard).
546
- */
547
498
  private _onDemand;
548
- /**
549
- * R-pull (D55): service ONE demand. Delivery content = the orthogonal pausable mode:
550
- * - 'resumeAll' → drain the buffered BACKLOG (each `_down` re-synthesizes a leading DIRTY, so
551
- * the per-entry replay is DIRTY-before-DATA — R-pause-modes per-entry arrival order);
552
- * - true → deliver the coalesced LATEST as ONE DIRTY-before-DATA wave (pin 2: the quiet absorb
553
- * suppressed the dep's original DIRTY, so the demand wave restores it before the value).
554
- * Neither branch fires when nothing changed since the last demand → the demand is SILENT.
555
- * Called by `_deliverPullDemand` only when settle-ready; the caller has released the pullId, so
556
- * `_markDirty` relays the leading DIRTY (not absorbed).
557
- */
558
499
  private _firePullDemand;
559
- /**
560
- * R-pull (D269): fire a demand that was OWED (deferred at demand time) once the node becomes
561
- * able — called from the dep-settle arms (DATA/RESOLVED/INVALIDATE/terminal drain _pending, pin-5
562
- * + B1/F6) and from `_pauseRelease` (an external PAUSE lock releases, F4/F5).
563
- */
564
500
  private _fireOwedDemandIfReady;
565
- /** Should an outgoing settle slice be deferred into the pause buffer? */
566
501
  private _shouldBufferOnPause;
567
- /** R-invalidate-idempotent: clear cache + flush + cascade; no-op if nothing cached. */
568
502
  private _invalidate;
569
503
  private _allDepsTerminal;
504
+ private _emitToSubs;
570
505
  /** R-terminal: resubscribable reset clears terminal + dep state + re-arms the gate. */
571
506
  private _resetLifecycle;
572
- private _emitToSubs;
573
507
  /** Batch commit (R-batch-coalesce): deliver the deferred tier-3 wave now. */
574
508
  __commitBatchedWave(wave: Wave): void;
575
509
  /** Batch rollback: balance the immediate DIRTY with a RESOLVED so downstream un-dirties. */
@@ -583,6 +517,21 @@ declare class Node<T = unknown> {
583
517
  * node([], fn) — producer (runs on activation)
584
518
  * node([a, b], fn) — compute / derived
585
519
  * node([dep]) — passthrough wire
520
+ *
521
+ * @param deps - Upstream nodes this node reads positionally from `ctx`.
522
+ * @param handleOrFn - Dispatcher handle, node function, or `null` for a manual source/state node.
523
+ * @param opts - Node runtime options such as `initial`, `name`, pool, dispatcher, and restore data.
524
+ * @returns A graph-agnostic `Node`.
525
+ * @example
526
+ * ```ts
527
+ * import { depLatest, node } from "@graphrefly/ts";
528
+ *
529
+ * const source = node<number>([], null, { initial: 1 });
530
+ * const doubled = node<number>([source], (ctx) => {
531
+ * ctx.down([["DATA", Number(depLatest(ctx, 0)) * 2]]);
532
+ * });
533
+ * ```
534
+ * @category core
586
535
  */
587
536
  declare function node<T = unknown>(deps?: Node<unknown>[], handleOrFn?: Handle | NodeFn | null, opts?: NodeOptions<T>): Node<T>;
588
537
  /**
@@ -0,0 +1,357 @@
1
+ import { DataIssue } from './data/index.cjs';
2
+ import { L as LockId } from './messages-CAzUPPJM.cjs';
3
+ import { N as Node } from './types-CTN3XoMl.cjs';
4
+ import { d as MessageBus } from './types-BAw2QVVE.cjs';
5
+
6
+ interface WorkQueueOptions<_T = unknown> {
7
+ readonly queueId: string;
8
+ readonly bus: MessageBus;
9
+ readonly topic: string;
10
+ readonly subscriptionId: string;
11
+ readonly from?: "earliest" | "latest" | number;
12
+ readonly name?: string;
13
+ readonly now?: () => number;
14
+ readonly leaseDurationMs?: number;
15
+ readonly retry?: WorkQueueRetryPolicy;
16
+ }
17
+ interface WorkQueueRetryPolicy {
18
+ readonly maxAttempts?: number;
19
+ readonly delayMs?: number;
20
+ }
21
+ interface WorkQueueCommandBase {
22
+ readonly commandId: string;
23
+ readonly queueId?: string;
24
+ readonly idempotencyKey?: string;
25
+ readonly correlationId?: string;
26
+ readonly causationId?: string;
27
+ readonly sourceRefs?: readonly string[];
28
+ readonly policyRefs?: readonly string[];
29
+ readonly actorRefs?: readonly string[];
30
+ readonly auditRefs?: readonly string[];
31
+ readonly nowMs?: number;
32
+ }
33
+ type WorkQueueCommand<T = unknown> = (WorkQueueCommandBase & {
34
+ readonly kind: "submit";
35
+ readonly payload: T;
36
+ readonly workId?: string;
37
+ readonly priority?: number;
38
+ readonly tags?: readonly string[];
39
+ readonly requirements?: readonly string[];
40
+ readonly notBeforeMs?: number;
41
+ readonly deadlineMs?: number;
42
+ }) | (WorkQueueCommandBase & {
43
+ readonly kind: "claim";
44
+ readonly workerId: string;
45
+ readonly requestedWorkIds?: readonly string[];
46
+ readonly limit?: number;
47
+ readonly leaseDurationMs?: number;
48
+ }) | (WorkQueueCommandBase & {
49
+ readonly kind: "renew-lease";
50
+ readonly workId: string;
51
+ readonly leaseId: string;
52
+ readonly attempt: number;
53
+ readonly workerId: string;
54
+ readonly leaseDurationMs?: number;
55
+ readonly leaseExpiresAtMs?: number;
56
+ }) | (WorkQueueCommandBase & {
57
+ readonly kind: "release";
58
+ readonly workId: string;
59
+ readonly leaseId: string;
60
+ readonly attempt: number;
61
+ readonly workerId: string;
62
+ readonly reason?: string;
63
+ }) | (WorkQueueCommandBase & {
64
+ readonly kind: "complete";
65
+ readonly workId: string;
66
+ readonly leaseId: string;
67
+ readonly attempt: number;
68
+ readonly workerId: string;
69
+ readonly result?: unknown;
70
+ }) | (WorkQueueCommandBase & {
71
+ readonly kind: "fail";
72
+ readonly workId: string;
73
+ readonly leaseId: string;
74
+ readonly attempt: number;
75
+ readonly workerId: string;
76
+ readonly error?: unknown;
77
+ readonly retryable?: boolean;
78
+ }) | (WorkQueueCommandBase & {
79
+ readonly kind: "cancel";
80
+ readonly workId: string;
81
+ readonly reason?: string;
82
+ }) | (WorkQueueCommandBase & {
83
+ readonly kind: "schedule";
84
+ readonly workId: string;
85
+ readonly scheduleId?: string;
86
+ readonly scheduleAtMs?: number;
87
+ readonly runAtMs?: number;
88
+ readonly notBeforeMs: number;
89
+ readonly deadlineMs?: number;
90
+ readonly reason?: string;
91
+ }) | (WorkQueueCommandBase & {
92
+ readonly kind: "expire-leases";
93
+ readonly workIds?: readonly string[];
94
+ readonly limit?: number;
95
+ });
96
+ interface WorkQueueRecordBase {
97
+ readonly kind: string;
98
+ readonly recordSeq: number;
99
+ readonly queueId: string;
100
+ readonly workId?: string;
101
+ readonly commandId?: string;
102
+ readonly idempotencyKey?: string;
103
+ readonly correlationId?: string;
104
+ readonly causationId?: string;
105
+ readonly sourceRefs?: readonly string[];
106
+ readonly policyRefs?: readonly string[];
107
+ readonly actorRefs?: readonly string[];
108
+ readonly auditRefs?: readonly string[];
109
+ readonly issueRefs?: readonly string[];
110
+ readonly recordedAtMs: number;
111
+ }
112
+ type WorkQueueRecord<T = unknown> = (WorkQueueRecordBase & {
113
+ readonly kind: "work-admitted";
114
+ readonly workId: string;
115
+ readonly payload: T;
116
+ readonly messageBus: {
117
+ readonly topic: string;
118
+ readonly seq: number;
119
+ readonly subscriptionId: string;
120
+ };
121
+ readonly priority?: number;
122
+ readonly tags?: readonly string[];
123
+ readonly requirements?: readonly string[];
124
+ readonly notBeforeMs?: number;
125
+ readonly deadlineMs?: number;
126
+ }) | (WorkQueueRecordBase & {
127
+ readonly kind: "work-rejected" | "admission-rejected";
128
+ readonly workId?: string;
129
+ readonly messageBus?: {
130
+ readonly topic: string;
131
+ readonly seq: number;
132
+ readonly subscriptionId: string;
133
+ };
134
+ readonly reason: string;
135
+ readonly existingWorkId?: string;
136
+ }) | (WorkQueueRecordBase & {
137
+ readonly kind: "work-scheduled";
138
+ readonly workId: string;
139
+ readonly scheduleId?: string;
140
+ readonly scheduleAtMs?: number;
141
+ readonly runAtMs?: number;
142
+ readonly notBeforeMs: number;
143
+ readonly deadlineMs?: number;
144
+ readonly reason?: string;
145
+ }) | (WorkQueueRecordBase & {
146
+ readonly kind: "work-claimed";
147
+ readonly workId: string;
148
+ readonly leaseId: string;
149
+ readonly attempt: number;
150
+ readonly workerId: string;
151
+ readonly claimedAtMs: number;
152
+ readonly leaseExpiresAtMs: number;
153
+ }) | (WorkQueueRecordBase & {
154
+ readonly kind: "lease-renewed";
155
+ readonly workId: string;
156
+ readonly leaseId: string;
157
+ readonly attempt: number;
158
+ readonly workerId: string;
159
+ readonly previousLeaseExpiresAtMs: number;
160
+ readonly leaseExpiresAtMs: number;
161
+ readonly renewedAtMs: number;
162
+ }) | (WorkQueueRecordBase & {
163
+ readonly kind: "work-released";
164
+ readonly workId: string;
165
+ readonly leaseId: string;
166
+ readonly attempt: number;
167
+ readonly workerId: string;
168
+ readonly releasedAtMs: number;
169
+ readonly reason?: string;
170
+ }) | (WorkQueueRecordBase & {
171
+ readonly kind: "lease-expired";
172
+ readonly workId: string;
173
+ readonly leaseId: string;
174
+ readonly attempt: number;
175
+ readonly workerId: string;
176
+ readonly leaseExpiresAtMs: number;
177
+ readonly expiredAtMs: number;
178
+ }) | (WorkQueueRecordBase & {
179
+ readonly kind: "attempt-completed" | "work-completed";
180
+ readonly workId: string;
181
+ readonly leaseId: string;
182
+ readonly attempt: number;
183
+ readonly workerId: string;
184
+ readonly result?: unknown;
185
+ }) | (WorkQueueRecordBase & {
186
+ readonly kind: "attempt-failed";
187
+ readonly workId: string;
188
+ readonly leaseId: string;
189
+ readonly attempt: number;
190
+ readonly workerId: string;
191
+ readonly error?: unknown;
192
+ readonly retryable?: boolean;
193
+ }) | (WorkQueueRecordBase & {
194
+ readonly kind: "retry-scheduled";
195
+ readonly workId: string;
196
+ readonly retryAtMs: number;
197
+ readonly delayMs: number;
198
+ readonly reason?: string;
199
+ }) | (WorkQueueRecordBase & {
200
+ readonly kind: "work-dead-lettered";
201
+ readonly workId: string;
202
+ readonly reason: string;
203
+ readonly exhaustedAttempts?: number;
204
+ }) | (WorkQueueRecordBase & {
205
+ readonly kind: "work-canceled";
206
+ readonly workId: string;
207
+ readonly reason?: string;
208
+ readonly canceledAtMs: number;
209
+ readonly canceledLeaseId?: string;
210
+ readonly attempt?: number;
211
+ }) | (WorkQueueRecordBase & {
212
+ readonly kind: "lifecycle-rejected" | "admission-deduped";
213
+ readonly workId?: string;
214
+ readonly messageBus?: {
215
+ readonly topic: string;
216
+ readonly seq: number;
217
+ readonly subscriptionId: string;
218
+ };
219
+ readonly reason: string;
220
+ readonly existingWorkId?: string;
221
+ });
222
+ interface WorkQueueStatus {
223
+ readonly kind: "command-accepted" | "command-rejected" | "admission-accepted" | "admission-rejected" | "admission-retryable" | "projection-ready" | "projection-partial" | "projection-stale" | "maintenance-applied" | "maintenance-noop" | "policy-warning";
224
+ readonly queueId: string;
225
+ readonly workId?: string;
226
+ readonly commandId?: string;
227
+ readonly recordSeq?: number;
228
+ readonly asOfRecordSeq?: number;
229
+ readonly issueCode?: string;
230
+ readonly timestampMs: number;
231
+ readonly details?: unknown;
232
+ }
233
+ interface WorkQueueAvailableItem<T = unknown> {
234
+ readonly workId: string;
235
+ readonly state: WorkQueueDerivedState;
236
+ readonly payload: T;
237
+ readonly admissionSeq: number;
238
+ readonly priority?: number;
239
+ readonly tags?: readonly string[];
240
+ readonly requirements?: readonly string[];
241
+ readonly notBeforeMs?: number;
242
+ readonly retryAtMs?: number;
243
+ readonly deadlineMs?: number;
244
+ }
245
+ interface WorkQueueAvailablePage<T = unknown> {
246
+ readonly items: readonly WorkQueueAvailableItem<T>[];
247
+ readonly nextAfterWorkId?: string;
248
+ readonly nextAfterAdmissionSeq?: number;
249
+ readonly hasMore: boolean;
250
+ readonly asOfRecordSeq: number;
251
+ }
252
+ interface WorkQueueWorkSnapshot<T = unknown> {
253
+ readonly workId: string;
254
+ readonly state?: WorkQueueDerivedState;
255
+ readonly payload?: T;
256
+ readonly activeLease?: {
257
+ readonly leaseId: string;
258
+ readonly attempt: number;
259
+ readonly workerId: string;
260
+ readonly leaseExpiresAtMs: number;
261
+ };
262
+ readonly records: readonly WorkQueueRecord<T>[];
263
+ readonly asOfRecordSeq: number;
264
+ }
265
+ interface WorkQueueDeadLetterPage<T = unknown> {
266
+ readonly entries: readonly WorkQueueRecord<T>[];
267
+ readonly nextAfterDeadLetterSeq?: number;
268
+ readonly hasMore: boolean;
269
+ readonly asOfRecordSeq: number;
270
+ }
271
+ interface WorkQueueAvailableParams {
272
+ readonly limit?: number;
273
+ readonly afterWorkId?: string;
274
+ readonly afterAdmissionSeq?: number;
275
+ readonly nowMs?: number;
276
+ readonly includeIssues?: boolean;
277
+ }
278
+ interface WorkQueueDeadLetterParams {
279
+ readonly limit?: number;
280
+ readonly afterDeadLetterSeq?: number;
281
+ readonly afterWorkId?: string;
282
+ }
283
+ type WorkQueueDerivedState = "scheduled" | "ready" | "leased" | "retry-wait" | "completed" | "canceled" | "dead-lettered";
284
+ interface WorkQueueProjection<TPage> {
285
+ readonly snapshot: Node<TPage>;
286
+ readonly snapshotPullId: LockId;
287
+ readonly status: Node<WorkQueueStatus>;
288
+ readonly issues: Node<DataIssue>;
289
+ }
290
+ interface WorkQueueAvailableProjection<T = unknown> {
291
+ readonly available: Node<WorkQueueAvailablePage<T>>;
292
+ readonly availablePullId: LockId;
293
+ readonly status: Node<WorkQueueStatus>;
294
+ readonly issues: Node<DataIssue>;
295
+ }
296
+ interface WorkQueue<T = unknown> {
297
+ readonly commands: Node<WorkQueueCommand<T>>;
298
+ readonly records: Node<WorkQueueRecord<T>>;
299
+ readonly status: Node<WorkQueueStatus>;
300
+ readonly issues: Node<DataIssue>;
301
+ submit(payload: T, opts?: Omit<Partial<Extract<WorkQueueCommand<T>, {
302
+ kind: "submit";
303
+ }>>, "kind" | "payload" | "commandId"> & {
304
+ commandId?: string;
305
+ }): unknown;
306
+ claim(opts: Omit<Extract<WorkQueueCommand<T>, {
307
+ kind: "claim";
308
+ }>, "kind" | "commandId"> & {
309
+ commandId?: string;
310
+ }): WorkQueueCommand<T>;
311
+ renewLease(opts: Omit<Extract<WorkQueueCommand<T>, {
312
+ kind: "renew-lease";
313
+ }>, "kind" | "commandId"> & {
314
+ commandId?: string;
315
+ }): WorkQueueCommand<T>;
316
+ release(opts: Omit<Extract<WorkQueueCommand<T>, {
317
+ kind: "release";
318
+ }>, "kind" | "commandId"> & {
319
+ commandId?: string;
320
+ }): WorkQueueCommand<T>;
321
+ complete(opts: Omit<Extract<WorkQueueCommand<T>, {
322
+ kind: "complete";
323
+ }>, "kind" | "commandId"> & {
324
+ commandId?: string;
325
+ }): WorkQueueCommand<T>;
326
+ fail(opts: Omit<Extract<WorkQueueCommand<T>, {
327
+ kind: "fail";
328
+ }>, "kind" | "commandId"> & {
329
+ commandId?: string;
330
+ }): WorkQueueCommand<T>;
331
+ cancel(opts: Omit<Extract<WorkQueueCommand<T>, {
332
+ kind: "cancel";
333
+ }>, "kind" | "commandId"> & {
334
+ commandId?: string;
335
+ }): WorkQueueCommand<T>;
336
+ schedule(opts: Omit<Extract<WorkQueueCommand<T>, {
337
+ kind: "schedule";
338
+ }>, "kind" | "commandId"> & {
339
+ commandId?: string;
340
+ }): WorkQueueCommand<T>;
341
+ expireLeases(opts?: Omit<Extract<WorkQueueCommand<T>, {
342
+ kind: "expire-leases";
343
+ }>, "kind" | "commandId"> & {
344
+ commandId?: string;
345
+ }): WorkQueueCommand<T>;
346
+ available(opts?: {
347
+ name?: string;
348
+ }): WorkQueueAvailableProjection<T>;
349
+ work(workId: string, opts?: {
350
+ name?: string;
351
+ }): WorkQueueProjection<WorkQueueWorkSnapshot<T>>;
352
+ deadLetter(opts?: {
353
+ name?: string;
354
+ }): WorkQueueProjection<WorkQueueDeadLetterPage<T>>;
355
+ }
356
+
357
+ export type { WorkQueueCommand as W, WorkQueueRecord as a, WorkQueueOptions as b, WorkQueue as c, WorkQueueAvailableItem as d, WorkQueueAvailablePage as e, WorkQueueAvailableParams as f, WorkQueueAvailableProjection as g, WorkQueueDeadLetterPage as h, WorkQueueDeadLetterParams as i, WorkQueueDerivedState as j, WorkQueueProjection as k, WorkQueueRetryPolicy as l, WorkQueueStatus as m, WorkQueueWorkSnapshot as n };