@graphrefly/ts 0.0.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/README.md +135 -0
  2. package/dist/actions-types-CSC3NMDl.d.ts +657 -0
  3. package/dist/actions-types-wl9Mgkmr.d.cts +657 -0
  4. package/dist/adapters/index.cjs +5219 -2974
  5. package/dist/adapters/index.cjs.map +1 -1
  6. package/dist/adapters/index.d.cts +204 -192
  7. package/dist/adapters/index.d.ts +204 -192
  8. package/dist/adapters/index.js +3685 -1833
  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 +4 -4
  35. package/dist/adapters/observe-storage.d.ts +4 -4
  36. package/dist/adapters/observe-storage.js +5 -4
  37. package/dist/adapters/observe-storage.js.map +1 -1
  38. package/dist/adapters/react.cjs +166 -0
  39. package/dist/adapters/react.cjs.map +1 -0
  40. package/dist/adapters/react.d.cts +31 -0
  41. package/dist/adapters/react.d.ts +31 -0
  42. package/dist/adapters/react.js +51 -0
  43. package/dist/adapters/react.js.map +1 -0
  44. package/dist/adapters/solid.cjs +157 -0
  45. package/dist/adapters/solid.cjs.map +1 -0
  46. package/dist/adapters/solid.d.cts +26 -0
  47. package/dist/adapters/solid.d.ts +26 -0
  48. package/dist/adapters/solid.js +48 -0
  49. package/dist/adapters/solid.js.map +1 -0
  50. package/dist/adapters/svelte.cjs +148 -0
  51. package/dist/adapters/svelte.cjs.map +1 -0
  52. package/dist/adapters/svelte.d.cts +31 -0
  53. package/dist/adapters/svelte.d.ts +31 -0
  54. package/dist/adapters/svelte.js +46 -0
  55. package/dist/adapters/svelte.js.map +1 -0
  56. package/dist/adapters/vue.cjs +155 -0
  57. package/dist/adapters/vue.cjs.map +1 -0
  58. package/dist/adapters/vue.d.cts +26 -0
  59. package/dist/adapters/vue.d.ts +26 -0
  60. package/dist/adapters/vue.js +46 -0
  61. package/dist/adapters/vue.js.map +1 -0
  62. package/dist/agent-runtime-types-core-CaXfKNtY.d.cts +406 -0
  63. package/dist/agent-runtime-types-core-hU299uIC.d.ts +406 -0
  64. package/dist/agent-runtime-types-tool-BEpSINol.d.ts +695 -0
  65. package/dist/agent-runtime-types-tool-DninPEzk.d.cts +695 -0
  66. package/dist/agentic-memory-retention-BmGX368S.d.ts +14 -0
  67. package/dist/agentic-memory-retention-Ih1qhX9Z.d.cts +14 -0
  68. package/dist/agentic-memory-types-CVSUS6XR.d.ts +473 -0
  69. package/dist/agentic-memory-types-FnnYlVUs.d.cts +473 -0
  70. package/dist/capability-admission-BW2CziT6.d.ts +102 -0
  71. package/dist/capability-admission-lwSecxXs.d.cts +102 -0
  72. package/dist/chunk-2KUAG2GZ.js +9693 -0
  73. package/dist/chunk-2KUAG2GZ.js.map +1 -0
  74. package/dist/chunk-2NJP6GO4.js +1320 -0
  75. package/dist/chunk-2NJP6GO4.js.map +1 -0
  76. package/dist/{chunk-GDL26N2T.js → chunk-3KN7NJDR.js} +2 -2
  77. package/dist/{chunk-COHO25CZ.js → chunk-4NWSNI4K.js} +2232 -1672
  78. package/dist/chunk-4NWSNI4K.js.map +1 -0
  79. package/dist/{chunk-Z2ANQ6JW.js → chunk-4Q77MMJY.js} +2 -2
  80. package/dist/chunk-6E76H4OU.js +132 -0
  81. package/dist/chunk-6E76H4OU.js.map +1 -0
  82. package/dist/chunk-7GOTIIQ7.js +819 -0
  83. package/dist/chunk-7GOTIIQ7.js.map +1 -0
  84. package/dist/{chunk-D6BG7U6A.js → chunk-7HZRJMN6.js} +3 -3
  85. package/dist/{chunk-SCRFRCGR.js → chunk-BSQGE5PS.js} +1 -1
  86. package/dist/{chunk-PKVBHGBM.js → chunk-CJIFGJQG.js} +7 -7
  87. package/dist/{chunk-G4M3NHRJ.js → chunk-CX6B6PO2.js} +93 -10
  88. package/dist/chunk-CX6B6PO2.js.map +1 -0
  89. package/dist/chunk-DGUM43GV.js +11 -0
  90. package/dist/chunk-DGUM43GV.js.map +1 -0
  91. package/dist/{chunk-JIMUDQN3.js → chunk-E4QCH32M.js} +449 -447
  92. package/dist/chunk-E4QCH32M.js.map +1 -0
  93. package/dist/{chunk-RIIOUTGM.js → chunk-ECURQ3HD.js} +19 -129
  94. package/dist/chunk-ECURQ3HD.js.map +1 -0
  95. package/dist/{chunk-2ILL7HQI.js → chunk-EOKT4QFF.js} +134 -128
  96. package/dist/chunk-EOKT4QFF.js.map +1 -0
  97. package/dist/{chunk-K3FXTC3I.js → chunk-HJACH5PU.js} +3 -3
  98. package/dist/{chunk-GTPCOEOZ.js → chunk-IDMLXLLG.js} +3 -3
  99. package/dist/{chunk-DKP56CSW.js → chunk-JKAYLDQV.js} +2 -2
  100. package/dist/{chunk-4VLAQHZI.js → chunk-K7FB3JTD.js} +17 -1
  101. package/dist/chunk-K7FB3JTD.js.map +1 -0
  102. package/dist/chunk-L6LDXRWE.js +219 -0
  103. package/dist/chunk-L6LDXRWE.js.map +1 -0
  104. package/dist/chunk-M7J6Z4IJ.js +1930 -0
  105. package/dist/chunk-M7J6Z4IJ.js.map +1 -0
  106. package/dist/chunk-MQEQMS7B.js +1009 -0
  107. package/dist/chunk-MQEQMS7B.js.map +1 -0
  108. package/dist/chunk-MTELVIYR.js +1421 -0
  109. package/dist/chunk-MTELVIYR.js.map +1 -0
  110. package/dist/chunk-PVC7WDKI.js +885 -0
  111. package/dist/chunk-PVC7WDKI.js.map +1 -0
  112. package/dist/chunk-RAHNUYA5.js +368 -0
  113. package/dist/chunk-RAHNUYA5.js.map +1 -0
  114. package/dist/{chunk-DK554R7P.js → chunk-S6HXABGL.js} +2 -1
  115. package/dist/chunk-S6HXABGL.js.map +1 -0
  116. package/dist/{chunk-I3IHOHCJ.js → chunk-SHZDP2MQ.js} +1181 -1001
  117. package/dist/chunk-SHZDP2MQ.js.map +1 -0
  118. package/dist/{chunk-Y3ZLRGHC.js → chunk-SIDJO2T4.js} +16 -16
  119. package/dist/chunk-STXRMPW4.js +4131 -0
  120. package/dist/chunk-STXRMPW4.js.map +1 -0
  121. package/dist/{chunk-JR4IKCR2.js → chunk-TPND5MJS.js} +5 -5
  122. package/dist/chunk-TQPCAIQI.js +612 -0
  123. package/dist/chunk-TQPCAIQI.js.map +1 -0
  124. package/dist/chunk-UT3MHJCW.js +49 -0
  125. package/dist/chunk-UT3MHJCW.js.map +1 -0
  126. package/dist/{chunk-TEW47IVR.js → chunk-VPEFSDME.js} +2 -2
  127. package/dist/{chunk-SWTLEQL6.js → chunk-WQIA3GFB.js} +2 -2
  128. package/dist/chunk-WQIA3GFB.js.map +1 -0
  129. package/dist/{chunk-DJC4CHLQ.js → chunk-YDWBXXQZ.js} +5 -5
  130. package/dist/{chunk-6PHB5CJS.js → chunk-ZLFRB6FI.js} +2 -2
  131. package/dist/composition/index.cjs +1256 -1059
  132. package/dist/composition/index.cjs.map +1 -1
  133. package/dist/composition/index.d.cts +4 -4
  134. package/dist/composition/index.d.ts +4 -4
  135. package/dist/composition/index.js +7 -6
  136. package/dist/core/index.cjs +1218 -1021
  137. package/dist/core/index.cjs.map +1 -1
  138. package/dist/core/index.d.cts +2 -2
  139. package/dist/core/index.d.ts +2 -2
  140. package/dist/core/index.js +5 -4
  141. package/dist/cqrs/index.cjs.map +1 -1
  142. package/dist/cqrs/index.d.cts +4 -4
  143. package/dist/cqrs/index.d.ts +4 -4
  144. package/dist/cqrs/index.js +3 -2
  145. package/dist/cqrs/index.js.map +1 -1
  146. package/dist/cqrs/messaging.cjs +312 -0
  147. package/dist/cqrs/messaging.cjs.map +1 -0
  148. package/dist/cqrs/messaging.d.cts +57 -0
  149. package/dist/cqrs/messaging.d.ts +57 -0
  150. package/dist/cqrs/messaging.js +274 -0
  151. package/dist/cqrs/messaging.js.map +1 -0
  152. package/dist/cqrs/work-queue.cjs +329 -0
  153. package/dist/cqrs/work-queue.cjs.map +1 -0
  154. package/dist/cqrs/work-queue.d.cts +90 -0
  155. package/dist/cqrs/work-queue.d.ts +90 -0
  156. package/dist/cqrs/work-queue.js +292 -0
  157. package/dist/cqrs/work-queue.js.map +1 -0
  158. package/dist/data/index.cjs +19 -0
  159. package/dist/data/index.cjs.map +1 -0
  160. package/dist/data/index.d.cts +36 -0
  161. package/dist/data/index.d.ts +36 -0
  162. package/dist/data/index.js +1 -0
  163. package/dist/data/index.js.map +1 -0
  164. package/dist/data-structures/index.cjs +1252 -1052
  165. package/dist/data-structures/index.cjs.map +1 -1
  166. package/dist/data-structures/index.d.cts +9 -8
  167. package/dist/data-structures/index.d.ts +9 -8
  168. package/dist/data-structures/index.js +9 -7
  169. package/dist/{describe-BZb7AS2y.d.ts → describe-B_A5fbXH.d.ts} +1 -1
  170. package/dist/{describe-Ciu8SUnN.d.cts → describe-CQRrkv-Q.d.cts} +1 -1
  171. package/dist/executors/tool-provider-adapters.cjs +3091 -0
  172. package/dist/executors/tool-provider-adapters.cjs.map +1 -0
  173. package/dist/executors/tool-provider-adapters.d.cts +174 -0
  174. package/dist/executors/tool-provider-adapters.d.ts +174 -0
  175. package/dist/executors/tool-provider-adapters.js +1336 -0
  176. package/dist/executors/tool-provider-adapters.js.map +1 -0
  177. package/dist/executors/tool-provider-runtime.cjs +5178 -0
  178. package/dist/executors/tool-provider-runtime.cjs.map +1 -0
  179. package/dist/executors/tool-provider-runtime.d.cts +17 -0
  180. package/dist/executors/tool-provider-runtime.d.ts +17 -0
  181. package/dist/executors/tool-provider-runtime.js +15 -0
  182. package/dist/executors/tool-provider-runtime.js.map +1 -0
  183. package/dist/executors/tool-provider.cjs +6392 -0
  184. package/dist/executors/tool-provider.cjs.map +1 -0
  185. package/dist/executors/tool-provider.d.cts +60 -0
  186. package/dist/executors/tool-provider.d.ts +60 -0
  187. package/dist/executors/tool-provider.js +89 -0
  188. package/dist/executors/tool-provider.js.map +1 -0
  189. package/dist/executors/work-queue.cjs +342 -0
  190. package/dist/executors/work-queue.cjs.map +1 -0
  191. package/dist/executors/work-queue.d.cts +90 -0
  192. package/dist/executors/work-queue.d.ts +90 -0
  193. package/dist/executors/work-queue.js +306 -0
  194. package/dist/executors/work-queue.js.map +1 -0
  195. package/dist/graph/index.cjs +1536 -1324
  196. package/dist/graph/index.cjs.map +1 -1
  197. package/dist/graph/index.d.cts +10 -9
  198. package/dist/graph/index.d.ts +10 -9
  199. package/dist/graph/index.js +22 -20
  200. package/dist/{graph-s23RbbFO.d.cts → graph-CWK3HLPB.d.cts} +134 -132
  201. package/dist/{graph-DfdF9zy4.d.ts → graph-ho5sotHP.d.ts} +134 -132
  202. package/dist/{index-SnzZu3x7.d.ts → index-CQWcE0Dw.d.ts} +18 -4
  203. package/dist/{index-CAEmLCYF.d.cts → index-DHA1i67c.d.cts} +18 -4
  204. package/dist/index.cjs +3331 -3020
  205. package/dist/index.cjs.map +1 -1
  206. package/dist/index.d.cts +14 -10
  207. package/dist/index.d.ts +14 -10
  208. package/dist/index.js +114 -108
  209. package/dist/inspection/boundary.cjs +98 -0
  210. package/dist/inspection/boundary.cjs.map +1 -0
  211. package/dist/inspection/boundary.d.cts +61 -0
  212. package/dist/inspection/boundary.d.ts +61 -0
  213. package/dist/inspection/boundary.js +75 -0
  214. package/dist/inspection/boundary.js.map +1 -0
  215. package/dist/measurements-C0mAvWU1.d.cts +164 -0
  216. package/dist/measurements-OMpCeBwh.d.ts +164 -0
  217. package/dist/{messages-BZqrGGm1.d.ts → messages-CAzUPPJM.d.cts} +10 -5
  218. package/dist/{messages-BZqrGGm1.d.cts → messages-CAzUPPJM.d.ts} +10 -5
  219. package/dist/messaging/index.cjs +756 -619
  220. package/dist/messaging/index.cjs.map +1 -1
  221. package/dist/messaging/index.d.cts +17 -226
  222. package/dist/messaging/index.d.ts +17 -226
  223. package/dist/messaging/index.js +19 -749
  224. package/dist/messaging/index.js.map +1 -1
  225. package/dist/operators/index.cjs +1256 -1059
  226. package/dist/operators/index.cjs.map +1 -1
  227. package/dist/operators/index.d.cts +6 -6
  228. package/dist/operators/index.d.ts +6 -6
  229. package/dist/operators/index.js +9 -8
  230. package/dist/orchestration/index.cjs +8664 -2617
  231. package/dist/orchestration/index.cjs.map +1 -1
  232. package/dist/orchestration/index.d.cts +171 -221
  233. package/dist/orchestration/index.d.ts +171 -221
  234. package/dist/orchestration/index.js +74 -982
  235. package/dist/orchestration/index.js.map +1 -1
  236. package/dist/orchestration/messaging.cjs +314 -0
  237. package/dist/orchestration/messaging.cjs.map +1 -0
  238. package/dist/orchestration/messaging.d.cts +56 -0
  239. package/dist/orchestration/messaging.d.ts +56 -0
  240. package/dist/orchestration/messaging.js +276 -0
  241. package/dist/orchestration/messaging.js.map +1 -0
  242. package/dist/orchestration/work-queue.cjs +1500 -0
  243. package/dist/orchestration/work-queue.cjs.map +1 -0
  244. package/dist/orchestration/work-queue.d.cts +196 -0
  245. package/dist/orchestration/work-queue.d.ts +196 -0
  246. package/dist/orchestration/work-queue.js +1289 -0
  247. package/dist/orchestration/work-queue.js.map +1 -0
  248. package/dist/patterns/event-flow.cjs +433 -0
  249. package/dist/patterns/event-flow.cjs.map +1 -0
  250. package/dist/patterns/event-flow.d.cts +115 -0
  251. package/dist/patterns/event-flow.d.ts +115 -0
  252. package/dist/patterns/event-flow.js +14 -0
  253. package/dist/patterns/event-flow.js.map +1 -0
  254. package/dist/patterns/index.cjs +748 -355
  255. package/dist/patterns/index.cjs.map +1 -1
  256. package/dist/patterns/index.d.cts +9 -5
  257. package/dist/patterns/index.d.ts +9 -5
  258. package/dist/patterns/index.js +13 -4
  259. package/dist/process-types-C9uMYz3i.d.ts +200 -0
  260. package/dist/process-types-h3uRlzDc.d.cts +200 -0
  261. package/dist/{reactive-collection-BxBqtIOE.d.cts → reactive-collection-B9R0Bl1P.d.cts} +11 -41
  262. package/dist/{reactive-collection-Cb1II1Fi.d.ts → reactive-collection-BXFrH0U2.d.ts} +11 -41
  263. package/dist/{reactive-collection-storage-D-KmjE0J.d.cts → reactive-collection-storage-BLGv8Xp8.d.cts} +5 -5
  264. package/dist/{reactive-collection-storage-BNiEc-Gd.d.ts → reactive-collection-storage-a4zD3665.d.ts} +5 -5
  265. package/dist/{reactive-map-BcB4KsQR.d.ts → reactive-map-C_8sOfdS.d.cts} +7 -6
  266. package/dist/{reactive-map-D-g3dv8I.d.cts → reactive-map-jle5dnok.d.ts} +7 -6
  267. package/dist/render/index.d.cts +3 -3
  268. package/dist/render/index.d.ts +3 -3
  269. package/dist/render/index.js +1 -0
  270. package/dist/scheduled-readiness-5rwQlyjV.d.ts +91 -0
  271. package/dist/scheduled-readiness-DpRY8jI0.d.cts +91 -0
  272. package/dist/semantic-memory-graph-C2ZUwIlq.d.ts +30 -0
  273. package/dist/semantic-memory-graph-DlZBD_Eu.d.cts +30 -0
  274. package/dist/{semantic-memory-graph-BYoIlP35.d.cts → semantic-memory-graph-types-BvzdqmkY.d.cts} +2 -28
  275. package/dist/{semantic-memory-graph-CxyXLms3.d.ts → semantic-memory-graph-types-Ci-OtahO.d.ts} +2 -28
  276. package/dist/solutions/index.cjs +6788 -2128
  277. package/dist/solutions/index.cjs.map +1 -1
  278. package/dist/solutions/index.d.cts +15 -519
  279. package/dist/solutions/index.d.ts +15 -519
  280. package/dist/solutions/index.js +91 -7
  281. package/dist/solutions/reactive-layout/browser/index.cjs +457 -0
  282. package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -0
  283. package/dist/solutions/reactive-layout/browser/index.d.cts +44 -0
  284. package/dist/solutions/reactive-layout/browser/index.d.ts +44 -0
  285. package/dist/solutions/reactive-layout/browser/index.js +69 -0
  286. package/dist/solutions/reactive-layout/browser/index.js.map +1 -0
  287. package/dist/solutions/reactive-layout/index.cjs +4494 -0
  288. package/dist/solutions/reactive-layout/index.cjs.map +1 -0
  289. package/dist/solutions/reactive-layout/index.d.cts +37 -0
  290. package/dist/solutions/reactive-layout/index.d.ts +37 -0
  291. package/dist/solutions/reactive-layout/index.js +146 -0
  292. package/dist/solutions/reactive-layout/index.js.map +1 -0
  293. package/dist/solutions/reactive-layout/node-canvas/index.cjs +555 -0
  294. package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -0
  295. package/dist/solutions/reactive-layout/node-canvas/index.d.cts +54 -0
  296. package/dist/solutions/reactive-layout/node-canvas/index.d.ts +54 -0
  297. package/dist/solutions/reactive-layout/node-canvas/index.js +131 -0
  298. package/dist/solutions/reactive-layout/node-canvas/index.js.map +1 -0
  299. package/dist/solutions/reactive-layout/react-native/index.cjs +504 -0
  300. package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -0
  301. package/dist/solutions/reactive-layout/react-native/index.d.cts +51 -0
  302. package/dist/solutions/reactive-layout/react-native/index.d.ts +51 -0
  303. package/dist/solutions/reactive-layout/react-native/index.js +77 -0
  304. package/dist/solutions/reactive-layout/react-native/index.js.map +1 -0
  305. package/dist/solutions/reactive-layout/skia/index.cjs +557 -0
  306. package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -0
  307. package/dist/solutions/reactive-layout/skia/index.d.cts +64 -0
  308. package/dist/solutions/reactive-layout/skia/index.d.ts +64 -0
  309. package/dist/solutions/reactive-layout/skia/index.js +70 -0
  310. package/dist/solutions/reactive-layout/skia/index.js.map +1 -0
  311. package/dist/solutions/work-item/actions.cjs +2345 -0
  312. package/dist/solutions/work-item/actions.cjs.map +1 -0
  313. package/dist/solutions/work-item/actions.d.cts +40 -0
  314. package/dist/solutions/work-item/actions.d.ts +40 -0
  315. package/dist/solutions/work-item/actions.js +2078 -0
  316. package/dist/solutions/work-item/actions.js.map +1 -0
  317. package/dist/solutions/work-item/scheduling.cjs +9797 -0
  318. package/dist/solutions/work-item/scheduling.cjs.map +1 -0
  319. package/dist/solutions/work-item/scheduling.d.cts +1868 -0
  320. package/dist/solutions/work-item/scheduling.d.ts +1868 -0
  321. package/dist/solutions/work-item/scheduling.js +146 -0
  322. package/dist/solutions/work-item/scheduling.js.map +1 -0
  323. package/dist/solutions/work-item/work-queue.cjs +306 -0
  324. package/dist/solutions/work-item/work-queue.cjs.map +1 -0
  325. package/dist/solutions/work-item/work-queue.d.cts +71 -0
  326. package/dist/solutions/work-item/work-queue.d.ts +71 -0
  327. package/dist/solutions/work-item/work-queue.js +270 -0
  328. package/dist/solutions/work-item/work-queue.js.map +1 -0
  329. package/dist/sources/browser.cjs +1399 -1052
  330. package/dist/sources/browser.cjs.map +1 -1
  331. package/dist/sources/browser.d.cts +33 -6
  332. package/dist/sources/browser.d.ts +33 -6
  333. package/dist/sources/browser.js +73 -6
  334. package/dist/sources/browser.js.map +1 -1
  335. package/dist/sources/index.cjs +1345 -1065
  336. package/dist/sources/index.cjs.map +1 -1
  337. package/dist/sources/index.d.cts +5 -5
  338. package/dist/sources/index.d.ts +5 -5
  339. package/dist/sources/index.js +7 -6
  340. package/dist/sources/node.cjs.map +1 -1
  341. package/dist/sources/node.d.cts +4 -4
  342. package/dist/sources/node.d.ts +4 -4
  343. package/dist/sources/node.js +2 -1
  344. package/dist/sources/node.js.map +1 -1
  345. package/dist/storage/browser.cjs +16 -0
  346. package/dist/storage/browser.cjs.map +1 -1
  347. package/dist/storage/browser.js +4 -3
  348. package/dist/storage/browser.js.map +1 -1
  349. package/dist/storage/index.cjs +16 -0
  350. package/dist/storage/index.cjs.map +1 -1
  351. package/dist/storage/index.d.cts +6 -5
  352. package/dist/storage/index.d.ts +6 -5
  353. package/dist/storage/index.js +10 -9
  354. package/dist/storage/node.cjs +16 -0
  355. package/dist/storage/node.cjs.map +1 -1
  356. package/dist/storage/node.js +4 -3
  357. package/dist/storage/node.js.map +1 -1
  358. package/dist/store-BmtEs9mG.d.ts +123 -0
  359. package/dist/store-PAAsYvML.d.cts +123 -0
  360. package/dist/testing/index.cjs +1 -0
  361. package/dist/testing/index.cjs.map +1 -1
  362. package/dist/testing/index.d.cts +1 -1
  363. package/dist/testing/index.d.ts +1 -1
  364. package/dist/testing/index.js +3 -2
  365. package/dist/types-BRNKoFHj.d.ts +357 -0
  366. package/dist/{types-h12mNYbq.d.ts → types-BS6CyR-x.d.cts} +49 -130
  367. package/dist/types-BWK2ay3e.d.cts +457 -0
  368. package/dist/types-BXKSAoE1.d.cts +357 -0
  369. package/dist/types-BaPpZItj.d.ts +457 -0
  370. package/dist/types-BhveCMg5.d.cts +274 -0
  371. package/dist/{types-bNMSWKqF.d.cts → types-C9NOgNJw.d.ts} +49 -130
  372. package/dist/types-CTsQ8Ww4.d.ts +274 -0
  373. package/dist/types-DL_05n2M.d.ts +34 -0
  374. package/dist/types-XDoqxYO9.d.cts +34 -0
  375. package/dist/work-item-runtime-types-BqtWnSCS.d.ts +138 -0
  376. package/dist/work-item-runtime-types-CHO03AKh.d.cts +138 -0
  377. package/dist/work-queue/index.cjs +1136 -0
  378. package/dist/work-queue/index.cjs.map +1 -0
  379. package/dist/work-queue/index.d.cts +21 -0
  380. package/dist/work-queue/index.d.ts +21 -0
  381. package/dist/work-queue/index.js +1082 -0
  382. package/dist/work-queue/index.js.map +1 -0
  383. package/package.json +603 -249
  384. package/dist/chunk-2ILL7HQI.js.map +0 -1
  385. package/dist/chunk-4VLAQHZI.js.map +0 -1
  386. package/dist/chunk-COHO25CZ.js.map +0 -1
  387. package/dist/chunk-DK554R7P.js.map +0 -1
  388. package/dist/chunk-G4M3NHRJ.js.map +0 -1
  389. package/dist/chunk-I3IHOHCJ.js.map +0 -1
  390. package/dist/chunk-JIMUDQN3.js.map +0 -1
  391. package/dist/chunk-RIIOUTGM.js.map +0 -1
  392. package/dist/chunk-SWTLEQL6.js.map +0 -1
  393. /package/dist/{chunk-GDL26N2T.js.map → chunk-3KN7NJDR.js.map} +0 -0
  394. /package/dist/{chunk-Z2ANQ6JW.js.map → chunk-4Q77MMJY.js.map} +0 -0
  395. /package/dist/{chunk-D6BG7U6A.js.map → chunk-7HZRJMN6.js.map} +0 -0
  396. /package/dist/{chunk-SCRFRCGR.js.map → chunk-BSQGE5PS.js.map} +0 -0
  397. /package/dist/{chunk-PKVBHGBM.js.map → chunk-CJIFGJQG.js.map} +0 -0
  398. /package/dist/{chunk-K3FXTC3I.js.map → chunk-HJACH5PU.js.map} +0 -0
  399. /package/dist/{chunk-GTPCOEOZ.js.map → chunk-IDMLXLLG.js.map} +0 -0
  400. /package/dist/{chunk-DKP56CSW.js.map → chunk-JKAYLDQV.js.map} +0 -0
  401. /package/dist/{chunk-Y3ZLRGHC.js.map → chunk-SIDJO2T4.js.map} +0 -0
  402. /package/dist/{chunk-JR4IKCR2.js.map → chunk-TPND5MJS.js.map} +0 -0
  403. /package/dist/{chunk-TEW47IVR.js.map → chunk-VPEFSDME.js.map} +0 -0
  404. /package/dist/{chunk-DJC4CHLQ.js.map → chunk-YDWBXXQZ.js.map} +0 -0
  405. /package/dist/{chunk-6PHB5CJS.js.map → chunk-ZLFRB6FI.js.map} +0 -0
@@ -1,6 +1,44 @@
1
1
  import {
2
- timeout
3
- } from "../chunk-JR4IKCR2.js";
2
+ admitAgentRequestProposal,
3
+ agentRequestLedgerViews,
4
+ agentRequestProposalFromDecision,
5
+ breakerBundle,
6
+ constantBackoff,
7
+ effectRun,
8
+ effectRunCompletionProjector,
9
+ fakeExecutorBlocked,
10
+ fakeExecutorCanceled,
11
+ fakeExecutorFailure,
12
+ fakeExecutorResult,
13
+ fakeExecutorTimeout,
14
+ issueAgentRequest,
15
+ processBundle,
16
+ processEffectRunner,
17
+ rateLimitBundle,
18
+ requestSatisfactionProjector,
19
+ retryStatusBundle,
20
+ scheduledReadinessProjector,
21
+ structuredAgentDecisionInterpreter,
22
+ timeoutBundle,
23
+ toolProviderRunAdmissionProjector,
24
+ toolProviderRunRetryProjector
25
+ } from "../chunk-STXRMPW4.js";
26
+ import {
27
+ buildToolProviderAdapterInputs,
28
+ executorOutcomeViewProjector,
29
+ localBuiltinToolProviderCatalog,
30
+ resolveToolProviderExecutionPolicies,
31
+ toolProviderAdapterInputProjector,
32
+ toolProviderPolicyResolutionProjector,
33
+ validateToolProviderExecutionPolicy
34
+ } from "../chunk-MTELVIYR.js";
35
+ import {
36
+ buildToolProviderExecutorOutcome,
37
+ requestToolProviderAdapterRun,
38
+ toolProviderAdapterRunProjector
39
+ } from "../chunk-7GOTIIQ7.js";
40
+ import "../chunk-TQPCAIQI.js";
41
+ import "../chunk-TPND5MJS.js";
4
42
  import {
5
43
  backoffDelayMs,
6
44
  nextRetryDelayMs,
@@ -8,997 +46,51 @@ import {
8
46
  retryPolicy,
9
47
  shouldRetry
10
48
  } from "../chunk-OOEN33FB.js";
11
- import "../chunk-G4M3NHRJ.js";
12
- import "../chunk-PKVBHGBM.js";
13
- import "../chunk-I3IHOHCJ.js";
14
- import "../chunk-4VLAQHZI.js";
15
- import {
16
- depBatch
17
- } from "../chunk-SWTLEQL6.js";
18
- import "../chunk-DK554R7P.js";
19
-
20
- // src/orchestration/index.ts
21
- var processCommandSources = /* @__PURE__ */ new WeakMap();
22
- function retryStatusBundle(graph, events, opts = {}) {
23
- const policy = opts.policy ?? retryPolicy();
24
- const name = opts.name ?? "retry";
25
- const status = graph.node(
26
- [events],
27
- (ctx) => {
28
- let next = ctx.state.get() ?? { state: "idle", attempt: 0, maxAttempts: policy.maxAttempts };
29
- for (const raw of depBatch(ctx, 0) ?? []) {
30
- const event = raw;
31
- if (event.kind === "attempt") {
32
- next = { state: "running", attempt: event.attempt, maxAttempts: policy.maxAttempts };
33
- } else if (event.kind === "retry") {
34
- next = {
35
- state: "waiting",
36
- attempt: event.attempt,
37
- maxAttempts: policy.maxAttempts,
38
- delayMs: event.delayMs
39
- };
40
- } else if (event.kind === "success") {
41
- next = {
42
- state: "succeeded",
43
- attempt: event.attempt ?? next.attempt,
44
- maxAttempts: policy.maxAttempts
45
- };
46
- } else if (event.kind === "failure") {
47
- const attempt = event.attempt ?? next.attempt;
48
- next = {
49
- state: shouldRetry(policy, attempt) ? "failed" : "exhausted",
50
- attempt,
51
- maxAttempts: policy.maxAttempts,
52
- delayMs: shouldRetry(policy, attempt) ? nextRetryDelayMs(policy, attempt + 1) : void 0
53
- };
54
- } else {
55
- next = {
56
- state: "exhausted",
57
- attempt: event.attempt,
58
- maxAttempts: policy.maxAttempts
59
- };
60
- }
61
- }
62
- ctx.state.set(next);
63
- ctx.down([["DATA", next]]);
64
- },
65
- { name: `${name}/status`, factory: "retryStatus" }
66
- );
67
- const errors = graph.node(
68
- [events],
69
- (ctx) => {
70
- for (const raw of depBatch(ctx, 0) ?? []) {
71
- const event = raw;
72
- if ("error" in event) ctx.down([["DATA", event.error]]);
73
- }
74
- },
75
- { name: `${name}/errors`, factory: "retryErrors" }
76
- );
77
- return { status, errors };
78
- }
79
- function breakerBundle(graph, events, opts) {
80
- if (!Number.isInteger(opts.failureThreshold) || opts.failureThreshold <= 0) {
81
- throw new RangeError("breakerBundle: failureThreshold must be a positive integer");
82
- }
83
- const name = opts.name ?? "breaker";
84
- const now = opts.now ?? Date.now;
85
- const status = graph.node(
86
- [events],
87
- (ctx) => {
88
- let next = ctx.state.get() ?? { state: "closed", failures: 0 };
89
- if (next.state === "open" && opts.resetAfterMs !== void 0 && next.openedAtMs !== void 0 && now() - next.openedAtMs >= opts.resetAfterMs) {
90
- next = { ...next, state: "half-open" };
91
- }
92
- for (const raw of depBatch(ctx, 0) ?? []) {
93
- const event = raw;
94
- if (event.kind === "success") {
95
- next = { state: "closed", failures: 0 };
96
- } else if (event.kind === "failure" || event.kind === "exhausted") {
97
- const failures = next.failures + 1;
98
- next = failures >= opts.failureThreshold ? { state: "open", failures, openedAtMs: now() } : { ...next, failures };
99
- }
100
- }
101
- ctx.state.set(next);
102
- ctx.down([["DATA", next]]);
103
- },
104
- { name: `${name}/status`, factory: "breakerStatus" }
105
- );
106
- const allowed = graph.node(
107
- [status],
108
- (ctx) => {
109
- const statusBatch = depBatch(ctx, 0) ?? [];
110
- for (const value of statusBatch) {
111
- ctx.down([["DATA", value.state !== "open"]]);
112
- }
113
- },
114
- { name: `${name}/allowed`, factory: "breakerAllowed" }
115
- );
116
- return { status, allowed };
117
- }
118
- function rateLimitBundle(graph, source, opts) {
119
- if (!Number.isInteger(opts.max) || opts.max <= 0) {
120
- throw new RangeError("rateLimitBundle: max must be a positive integer");
121
- }
122
- if (!Number.isFinite(opts.windowMs) || opts.windowMs <= 0) {
123
- throw new RangeError("rateLimitBundle: windowMs must be positive");
124
- }
125
- const now = opts.now ?? Date.now;
126
- const name = opts.name ?? "rateLimit";
127
- const events = graph.node(
128
- [source],
129
- (ctx) => {
130
- const current = now();
131
- let state = ctx.state.get() ?? { count: 0, resetAtMs: current + opts.windowMs, allowed: 0, dropped: 0 };
132
- if (current >= state.resetAtMs) {
133
- state = { ...state, count: 0, resetAtMs: current + opts.windowMs };
134
- }
135
- for (const value of depBatch(ctx, 0) ?? []) {
136
- const allowed2 = state.count < opts.max;
137
- state = allowed2 ? { ...state, count: state.count + 1, allowed: state.allowed + 1 } : { ...state, dropped: state.dropped + 1 };
138
- const status2 = {
139
- allowed: state.allowed,
140
- dropped: state.dropped,
141
- remaining: Math.max(0, opts.max - state.count),
142
- resetAtMs: state.resetAtMs
143
- };
144
- ctx.down([
145
- [
146
- "DATA",
147
- allowed2 ? { kind: "allowed", value, status: status2 } : { kind: "dropped", value, status: status2 }
148
- ]
149
- ]);
150
- }
151
- ctx.state.set(state);
152
- },
153
- { name: `${name}/events`, factory: "rateLimitEvents" }
154
- );
155
- const allowed = graph.node(
156
- [events],
157
- (ctx) => {
158
- for (const event of depBatch(ctx, 0) ?? []) {
159
- const typed = event;
160
- if (typed.kind === "allowed") ctx.down([["DATA", typed.value]]);
161
- }
162
- },
163
- { name: `${name}/allowed`, factory: "rateLimitAllowed" }
164
- );
165
- const dropped = graph.node(
166
- [events],
167
- (ctx) => {
168
- for (const event of depBatch(ctx, 0) ?? []) {
169
- const typed = event;
170
- if (typed.kind === "dropped") ctx.down([["DATA", typed.value]]);
171
- }
172
- },
173
- { name: `${name}/dropped`, factory: "rateLimitDropped" }
174
- );
175
- const status = graph.node(
176
- [events],
177
- (ctx) => {
178
- for (const event of depBatch(ctx, 0) ?? []) {
179
- ctx.down([["DATA", event.status]]);
180
- }
181
- },
182
- { name: `${name}/status`, factory: "rateLimitStatus" }
183
- );
184
- return { allowed, dropped, status };
185
- }
186
- function timeoutBundle(graph, source, ms, opts = {}) {
187
- const name = opts.name ?? "timeout";
188
- const node = timeout(source, ms);
189
- const status = graph.node(
190
- [node],
191
- (ctx) => {
192
- const terminal = ctx.terminal[0];
193
- if (terminal === true) ctx.down([["DATA", "completed"]]);
194
- else if (terminal !== false && terminal !== void 0) ctx.down([["DATA", "errored"]]);
195
- else if ((depBatch(ctx, 0) ?? []).length > 0) ctx.down([["DATA", "running"]]);
196
- },
197
- { name: `${name}/status`, factory: "timeoutStatus" }
198
- );
199
- const errors = graph.node(
200
- [node],
201
- (ctx) => {
202
- const terminal = ctx.terminal[0];
203
- if (terminal !== true && terminal !== false && terminal !== void 0) {
204
- ctx.down([["DATA", terminal]]);
205
- }
206
- },
207
- { name: `${name}/errors`, factory: "timeoutErrors" }
208
- );
209
- return { node, status, errors };
210
- }
211
- function processBundle(graph, opts) {
212
- if (typeof opts.reduce !== "function") {
213
- throw new TypeError("processBundle: reduce must be a function");
214
- }
215
- if (opts.initialState === void 0) {
216
- throw new TypeError("processBundle: initialState must not be undefined");
217
- }
218
- const name = opts.name ?? "process";
219
- const now = opts.now ?? Date.now;
220
- const topology = graph.topologyGroup({ name: `${name}.process` });
221
- const command = topology.node([], null, {
222
- name: `${name}/command`,
223
- factory: "processCommand",
224
- completeWhenDepsComplete: false,
225
- errorWhenDepsError: false
226
- });
227
- const runtime = topology.node(
228
- [command],
229
- (ctx) => {
230
- let state2 = ctx.state.get() ?? {
231
- eventSeq: 0,
232
- effectSeq: 0,
233
- commandCount: 0,
234
- errorCount: 0,
235
- auditSeq: 0,
236
- seenEventIds: [],
237
- seenEffectIds: [],
238
- state: opts.initialState
239
- };
240
- ctx.state.persist(true);
241
- for (const raw of depBatch(ctx, 0) ?? []) {
242
- state2 = reduceProcessCommandFact(
243
- raw,
244
- state2,
245
- opts.reduce,
246
- now,
247
- (fact) => ctx.down([["DATA", fact]])
248
- );
249
- ctx.state.set(state2);
250
- }
251
- },
252
- {
253
- name: `${name}/runtime`,
254
- factory: "processRuntime",
255
- meta: { process: "facts-plus-reducer", d: "D136" },
256
- completeWhenDepsComplete: false,
257
- errorWhenDepsError: false
258
- }
259
- );
260
- const events = processProjection(
261
- topology,
262
- runtime,
263
- `${name}/events`,
264
- "processEvents",
265
- (fact) => fact.kind === "event" ? fact.event : void 0
266
- );
267
- const state = processProjection(
268
- topology,
269
- runtime,
270
- `${name}/state`,
271
- "processState",
272
- (fact) => fact.kind === "state" ? fact.state : void 0
273
- );
274
- const audit = processProjection(
275
- topology,
276
- runtime,
277
- `${name}/audit`,
278
- "processAudit",
279
- (fact) => fact.kind === "audit" ? fact.audit : void 0
280
- );
281
- const effectRequests = processProjection(
282
- topology,
283
- runtime,
284
- `${name}/effectRequests`,
285
- "processEffectRequests",
286
- (fact) => fact.kind === "effect-request" ? fact.effect : void 0
287
- );
288
- const status = processProjection(
289
- topology,
290
- runtime,
291
- `${name}/status`,
292
- "processStatus",
293
- (fact) => fact.kind === "status" ? fact.status : void 0
294
- );
295
- const errors = processProjection(
296
- topology,
297
- runtime,
298
- `${name}/errors`,
299
- "processErrors",
300
- (fact) => fact.kind === "error" ? fact.error : void 0
301
- );
302
- const cursor = processProjection(
303
- topology,
304
- runtime,
305
- `${name}/cursor`,
306
- "processCursor",
307
- (fact) => fact.kind === "cursor" ? fact.cursor : void 0
308
- );
309
- const retainProcessNodes = () => [
310
- graph.retain(runtime, { reason: `${name}.process.runtime` }),
311
- graph.retain(events, { reason: `${name}.process.events` }),
312
- graph.retain(state, { reason: `${name}.process.state` }),
313
- graph.retain(audit, { reason: `${name}.process.audit` }),
314
- graph.retain(effectRequests, { reason: `${name}.process.effectRequests` }),
315
- graph.retain(status, { reason: `${name}.process.status` }),
316
- graph.retain(errors, { reason: `${name}.process.errors` }),
317
- graph.retain(cursor, { reason: `${name}.process.cursor` })
318
- ];
319
- let releaseRetains = retainProcessNodes();
320
- let released = false;
321
- const bundle = {
322
- command,
323
- events,
324
- state,
325
- audit,
326
- effectRequests,
327
- status,
328
- errors,
329
- cursor,
330
- dispatch(next) {
331
- command.down([["DATA", next]]);
332
- return next;
333
- },
334
- release() {
335
- if (released) return;
336
- const activeRetains = releaseRetains;
337
- releaseRetains = [];
338
- for (const releaseRetain of activeRetains) releaseRetain();
339
- try {
340
- topology.release({ reason: `${name}.process.release` });
341
- released = true;
342
- processCommandSources.delete(
343
- bundle
344
- );
345
- } catch (error) {
346
- releaseRetains = retainProcessNodes();
347
- throw error;
348
- }
349
- }
350
- };
351
- processCommandSources.set(
352
- bundle,
353
- { sources: [] }
354
- );
355
- return bundle;
356
- }
357
- function processEffectRunner(graph, process, opts) {
358
- if (opts.outcomes.length === 0) {
359
- throw new RangeError("processEffectRunner: outcomes must contain at least one node");
360
- }
361
- const name = opts.name ?? "processEffectRunner";
362
- const topology = graph.topologyGroup({ name: `${name}.effectRunner` });
363
- const requests = topology.node(
364
- [process.effectRequests],
365
- (ctx) => {
366
- for (const request of depBatch(ctx, 0) ?? []) {
367
- ctx.down([["DATA", request]]);
368
- }
369
- },
370
- {
371
- name: `${name}/requests`,
372
- factory: "processEffectRunnerRequests",
373
- partial: true,
374
- completeWhenDepsComplete: false,
375
- errorWhenDepsError: false
376
- }
377
- );
378
- const runtime = topology.node(
379
- [...opts.outcomes],
380
- (ctx) => {
381
- for (let i = 0; i < opts.outcomes.length; i += 1) {
382
- for (const raw of depBatch(ctx, i) ?? []) {
383
- const parsed = parseProcessEffectOutcome(raw);
384
- if (typeof parsed === "string") {
385
- const error = {
386
- code: "malformed-outcome",
387
- message: parsed,
388
- outcome: raw
389
- };
390
- ctx.down([["DATA", { kind: "error", error }]]);
391
- continue;
392
- }
393
- const outcome = parsed;
394
- const command = processEffectOutcomeCommand(outcome);
395
- ctx.down([["DATA", { kind: "outcome", outcome }]]);
396
- ctx.down([["DATA", { kind: "command", command }]]);
397
- }
398
- }
399
- },
400
- {
401
- name: `${name}/runtime`,
402
- factory: "processEffectRunner",
403
- meta: { process: "effect-runner", d: "D156" },
404
- partial: true,
405
- completeWhenDepsComplete: false,
406
- errorWhenDepsError: false
407
- }
408
- );
409
- const outcomes = processEffectRunnerProjection(
410
- topology,
411
- runtime,
412
- `${name}/outcomes`,
413
- "processEffectRunnerOutcomes",
414
- (fact) => fact.kind === "outcome" ? fact.outcome : void 0
415
- );
416
- const commands = processEffectRunnerProjection(
417
- topology,
418
- runtime,
419
- `${name}/commands`,
420
- "processEffectRunnerCommands",
421
- (fact) => fact.kind === "command" ? fact.command : void 0
422
- );
423
- const errors = processEffectRunnerProjection(
424
- topology,
425
- runtime,
426
- `${name}/errors`,
427
- "processEffectRunnerErrors",
428
- (fact) => fact.kind === "error" ? fact.error : void 0
429
- );
430
- const status = topology.node(
431
- [requests, runtime],
432
- (ctx) => {
433
- let state = ctx.state.get() ?? { requested: 0, commanded: 0, rejected: 0 };
434
- for (const request of depBatch(ctx, 0) ?? []) {
435
- state = { ...state, requested: state.requested + 1 };
436
- const typedRequest = request;
437
- ctx.down([
438
- [
439
- "DATA",
440
- {
441
- state: "requested",
442
- effectId: typedRequest.id,
443
- effectType: typedRequest.type,
444
- requested: state.requested,
445
- commanded: state.commanded,
446
- rejected: state.rejected
447
- }
448
- ]
449
- ]);
450
- }
451
- for (const fact of depBatch(ctx, 1) ?? []) {
452
- const typedFact = fact;
453
- if (typedFact.kind === "command") {
454
- state = { ...state, commanded: state.commanded + 1 };
455
- ctx.down([
456
- [
457
- "DATA",
458
- {
459
- state: "commanded",
460
- effectId: typedFact.command.payload.effectId,
461
- effectType: typedFact.command.payload.effectType,
462
- commandId: typedFact.command.id,
463
- commandType: typedFact.command.type,
464
- requested: state.requested,
465
- commanded: state.commanded,
466
- rejected: state.rejected
467
- }
468
- ]
469
- ]);
470
- }
471
- if (typedFact.kind === "error") {
472
- state = { ...state, rejected: state.rejected + 1 };
473
- ctx.down([
474
- [
475
- "DATA",
476
- {
477
- state: "rejected",
478
- effectId: typedFact.error.effectId,
479
- effectType: typedFact.error.effectType,
480
- requested: state.requested,
481
- commanded: state.commanded,
482
- rejected: state.rejected
483
- }
484
- ]
485
- ]);
486
- }
487
- }
488
- ctx.state.set(state);
489
- },
490
- {
491
- name: `${name}/status`,
492
- factory: "processEffectRunnerStatus",
493
- partial: true,
494
- completeWhenDepsComplete: false,
495
- errorWhenDepsError: false
496
- }
497
- );
498
- const retainRunnerNodes = () => [
499
- graph.retain(requests, { reason: `${name}.effectRunner.requests` }),
500
- graph.retain(outcomes, { reason: `${name}.effectRunner.outcomes` }),
501
- graph.retain(commands, { reason: `${name}.effectRunner.commands` }),
502
- graph.retain(status, { reason: `${name}.effectRunner.status` }),
503
- graph.retain(errors, { reason: `${name}.effectRunner.errors` })
504
- ];
505
- let releaseRetains = retainRunnerNodes();
506
- try {
507
- attachProcessCommandSource(process, commands);
508
- } catch (error) {
509
- for (const releaseRetain of releaseRetains) releaseRetain();
510
- releaseRetains = [];
511
- topology.release({ reason: `${name}.effectRunner.failedAttach` });
512
- throw error;
513
- }
514
- let released = false;
515
- return {
516
- requests,
517
- outcomes,
518
- commands,
519
- status,
520
- errors,
521
- release() {
522
- if (released) return;
523
- const activeRetains = releaseRetains;
524
- releaseRetains = [];
525
- for (const releaseRetain of activeRetains) releaseRetain();
526
- detachProcessCommandSource(process, commands);
527
- try {
528
- topology.release({ reason: `${name}.effectRunner.release` });
529
- released = true;
530
- } catch (error) {
531
- attachProcessCommandSource(process, commands);
532
- releaseRetains = retainRunnerNodes();
533
- throw error;
534
- }
535
- }
536
- };
537
- }
538
- function constantBackoff(delayMs) {
539
- return { kind: "constant", delayMs };
540
- }
541
- function processEffectRunnerProjection(topology, runtime, name, factory, pick) {
542
- return topology.node(
543
- [runtime],
544
- (ctx) => {
545
- for (const fact of depBatch(ctx, 0) ?? []) {
546
- const value = pick(fact);
547
- if (value !== void 0) ctx.down([["DATA", value]]);
548
- }
549
- },
550
- {
551
- name,
552
- factory,
553
- partial: true,
554
- completeWhenDepsComplete: false,
555
- errorWhenDepsError: false
556
- }
557
- );
558
- }
559
- function parseProcessEffectOutcome(raw) {
560
- if (!isObjectRecord(raw)) return "processEffectRunner: outcome must be an object";
561
- if (typeof raw.kind !== "string") {
562
- return "processEffectRunner: outcome kind must be a string";
563
- }
564
- if (raw.kind !== "result" && raw.kind !== "failure" && raw.kind !== "cancel" && raw.kind !== "timeout") {
565
- return "processEffectRunner: outcome kind must be result, failure, cancel, or timeout";
566
- }
567
- if (typeof raw.effectId !== "string" || raw.effectId.length === 0) {
568
- return "processEffectRunner: outcome effectId must be a non-empty string";
569
- }
570
- if (typeof raw.effectType !== "string" || raw.effectType.length === 0) {
571
- return "processEffectRunner: outcome effectType must be a non-empty string";
572
- }
573
- if ("commandId" in raw && raw.commandId !== void 0) {
574
- if (typeof raw.commandId !== "string" || raw.commandId.length === 0) {
575
- return "processEffectRunner: outcome commandId must be a non-empty string";
576
- }
577
- }
578
- for (const key of ["processId", "correlationId", "causationId"]) {
579
- if (key in raw && raw[key] !== void 0 && typeof raw[key] !== "string") {
580
- return `processEffectRunner: outcome ${key} must be a string`;
581
- }
582
- }
583
- if ("metadata" in raw && raw.metadata !== void 0 && !isObjectRecord(raw.metadata)) {
584
- return "processEffectRunner: outcome metadata must be a plain object";
585
- }
586
- if (raw.kind === "result" && !("value" in raw)) {
587
- return "processEffectRunner: result outcome must carry value";
588
- }
589
- if ((raw.kind === "failure" || raw.kind === "timeout") && !("error" in raw)) {
590
- return `processEffectRunner: ${raw.kind} outcome must carry error`;
591
- }
592
- if (raw.kind === "cancel" && "reason" in raw && raw.reason !== void 0 && typeof raw.reason !== "string") {
593
- return "processEffectRunner: cancel outcome reason must be a string";
594
- }
595
- return raw;
596
- }
597
- function processEffectOutcomeCommand(outcome) {
598
- const commandType = processEffectCommandType(outcome.kind);
599
- return {
600
- id: outcome.commandId ?? `${outcome.effectId}:${commandType}`,
601
- type: commandType,
602
- payload: processEffectCommandPayload(outcome),
603
- processId: outcome.processId,
604
- correlationId: outcome.correlationId,
605
- causationId: outcome.causationId,
606
- metadata: outcome.metadata
607
- };
608
- }
609
- function processEffectCommandType(kind) {
610
- switch (kind) {
611
- case "result":
612
- return "effect.result";
613
- case "failure":
614
- return "effect.failure";
615
- case "cancel":
616
- return "effect.cancel";
617
- case "timeout":
618
- return "effect.timeout";
619
- }
620
- }
621
- function processEffectCommandPayload(outcome) {
622
- const base = {
623
- effectId: outcome.effectId,
624
- effectType: outcome.effectType,
625
- processId: outcome.processId,
626
- correlationId: outcome.correlationId,
627
- causationId: outcome.causationId,
628
- metadata: outcome.metadata
629
- };
630
- switch (outcome.kind) {
631
- case "result":
632
- return { ...base, kind: "result", value: outcome.value };
633
- case "failure":
634
- return { ...base, kind: "failure", error: outcome.error };
635
- case "cancel":
636
- return { ...base, kind: "cancel", reason: outcome.reason };
637
- case "timeout":
638
- return { ...base, kind: "timeout", error: outcome.error };
639
- }
640
- }
641
- function attachProcessCommandSource(process, source) {
642
- const attached = processCommandSources.get(process);
643
- if (attached === void 0) {
644
- throw new Error("processEffectRunner: process command source registry missing");
645
- }
646
- const sources = attached.sources;
647
- const previousSources = [...sources];
648
- if (!sources.includes(source)) sources.push(source);
649
- try {
650
- process.command.replaceDeps([...sources], processCommandSourceFn(sources.length));
651
- } catch (error) {
652
- sources.splice(0, sources.length, ...previousSources);
653
- process.command.replaceDeps(
654
- [...previousSources],
655
- processCommandSourceFn(previousSources.length)
656
- );
657
- throw error;
658
- }
659
- }
660
- function detachProcessCommandSource(process, source) {
661
- const attached = processCommandSources.get(process);
662
- if (attached === void 0) {
663
- throw new Error("processEffectRunner: process command source registry missing");
664
- }
665
- const sources = attached.sources;
666
- if (!sources.includes(source)) return;
667
- const previousSources = [...sources];
668
- const nextSources = sources.filter((candidate) => candidate !== source);
669
- sources.splice(0, sources.length, ...nextSources);
670
- try {
671
- process.command.replaceDeps([...nextSources], processCommandSourceFn(nextSources.length));
672
- } catch (error) {
673
- sources.splice(0, sources.length, ...previousSources);
674
- process.command.replaceDeps(
675
- [...previousSources],
676
- processCommandSourceFn(previousSources.length)
677
- );
678
- throw error;
679
- }
680
- }
681
- function processCommandSourceFn(sourceCount) {
682
- return (ctx) => {
683
- for (let i = 0; i < sourceCount; i += 1) {
684
- for (const command of depBatch(ctx, i) ?? []) {
685
- ctx.down([["DATA", command]]);
686
- }
687
- }
688
- };
689
- }
690
- function processRuntimeDraft(state) {
691
- return {
692
- eventSeq: state.eventSeq,
693
- effectSeq: state.effectSeq,
694
- commandCount: state.commandCount,
695
- errorCount: state.errorCount,
696
- auditSeq: state.auditSeq,
697
- seenEventIds: [...state.seenEventIds],
698
- seenEffectIds: [...state.seenEffectIds],
699
- state: state.state
700
- };
701
- }
702
- function reduceProcessCommandFact(raw, state, reduce, now, emit) {
703
- const draft = processRuntimeDraft(state);
704
- draft.commandCount += 1;
705
- const parsed = parseProcessCommand(raw);
706
- if (typeof parsed === "string") {
707
- emitProcessFailure(draft, emit, raw, void 0, "malformed-command", parsed);
708
- return draft;
709
- }
710
- const command = parsed;
711
- let reduction;
712
- const reducerState = cloneProcessState(state.state);
713
- if (!reducerState.ok) {
714
- emitProcessFailure(draft, emit, command, command, "malformed-state", reducerState.message);
715
- return draft;
716
- }
717
- try {
718
- reduction = reduce(command, reducerState.value);
719
- } catch (error) {
720
- rethrowGraphRuntimeInvariant(error);
721
- emitProcessFailure(draft, emit, command, command, "reducer-threw", errorMessage(error));
722
- return draft;
723
- }
724
- if (!isObjectRecord(reduction) || !("state" in reduction)) {
725
- emitProcessFailure(
726
- draft,
727
- emit,
728
- command,
729
- command,
730
- "malformed-state",
731
- "processBundle: reducer must return { state, events?, effects? }"
732
- );
733
- return draft;
734
- }
735
- if (reduction.state === void 0) {
736
- emitProcessFailure(
737
- draft,
738
- emit,
739
- command,
740
- command,
741
- "malformed-state",
742
- "processBundle: reducer state must not be undefined"
743
- );
744
- return draft;
745
- }
746
- const privateState = cloneProcessState(reduction.state);
747
- if (!privateState.ok) {
748
- emitProcessFailure(draft, emit, command, command, "malformed-state", privateState.message);
749
- return draft;
750
- }
751
- const visibleState = cloneProcessState(privateState.value);
752
- if (!visibleState.ok) {
753
- emitProcessFailure(draft, emit, command, command, "malformed-state", visibleState.message);
754
- return draft;
755
- }
756
- const preparedEvents = prepareProcessEvents(command, draft, reduction.events ?? []);
757
- if (typeof preparedEvents === "string") {
758
- emitProcessFailure(draft, emit, command, command, "malformed-event", preparedEvents);
759
- return draft;
760
- }
761
- const preparedEffects = prepareProcessEffects(command, draft, reduction.effects ?? []);
762
- if (typeof preparedEffects === "string") {
763
- emitProcessFailure(draft, emit, command, command, "malformed-effect", preparedEffects);
764
- return draft;
765
- }
766
- const timestampMs = readTimestampMs(now);
767
- if (typeof timestampMs === "string") {
768
- emitProcessFailure(draft, emit, command, command, "clock-threw", timestampMs);
769
- return draft;
770
- }
771
- draft.state = privateState.value;
772
- emit({ kind: "state", state: visibleState.value, cursor: processCursorOf(draft) });
773
- const events = [];
774
- for (const eventDraft of preparedEvents) {
775
- draft.eventSeq += 1;
776
- draft.seenEventIds.push(eventDraft.id);
777
- const event = {
778
- id: eventDraft.id,
779
- type: eventDraft.type,
780
- seq: draft.eventSeq,
781
- cursor: draft.eventSeq,
782
- commandId: command.id,
783
- commandType: command.type,
784
- payload: eventDraft.payload,
785
- timestampMs,
786
- ...eventDraft.processId === void 0 ? {} : { processId: eventDraft.processId },
787
- ...eventDraft.correlationId === void 0 ? {} : { correlationId: eventDraft.correlationId },
788
- ...eventDraft.causationId === void 0 ? {} : { causationId: eventDraft.causationId },
789
- ...eventDraft.metadata === void 0 ? {} : { metadata: eventDraft.metadata }
790
- };
791
- events.push(event);
792
- emit({ kind: "event", event });
793
- }
794
- const effects = [];
795
- for (const effectDraft of preparedEffects) {
796
- draft.effectSeq += 1;
797
- draft.seenEffectIds.push(effectDraft.id);
798
- const effect = {
799
- id: effectDraft.id,
800
- type: effectDraft.type,
801
- seq: draft.effectSeq,
802
- cursor: draft.effectSeq,
803
- commandId: command.id,
804
- commandType: command.type,
805
- payload: effectDraft.payload,
806
- timestampMs,
807
- ...effectDraft.processId === void 0 ? {} : { processId: effectDraft.processId },
808
- ...effectDraft.correlationId === void 0 ? {} : { correlationId: effectDraft.correlationId },
809
- ...effectDraft.causationId === void 0 ? {} : { causationId: effectDraft.causationId },
810
- ...effectDraft.metadata === void 0 ? {} : { metadata: effectDraft.metadata }
811
- };
812
- effects.push(effect);
813
- emit({ kind: "effect-request", effect });
814
- }
815
- emitProcessStatus(draft, emit, command, "accepted", events.length, effects.length);
816
- emitProcessAudit(draft, emit, command, "success", events, effects, void 0, void 0);
817
- emit({ kind: "cursor", cursor: processCursorOf(draft) });
818
- return draft;
819
- }
820
- function processProjection(graph, runtime, name, factory, select) {
821
- return graph.node(
822
- [runtime],
823
- (ctx) => {
824
- for (const raw of depBatch(ctx, 0) ?? []) {
825
- const selected = select(raw);
826
- if (selected !== void 0) ctx.down([["DATA", selected]]);
827
- }
828
- },
829
- { name, factory, completeWhenDepsComplete: false, errorWhenDepsError: false }
830
- );
831
- }
832
- function parseProcessCommand(value) {
833
- if (!isObjectRecord(value)) return "processBundle: command fact must be an object";
834
- if (typeof value.id !== "string" || value.id.length === 0) {
835
- return "processBundle: command id must be a non-empty string";
836
- }
837
- if (typeof value.type !== "string" || value.type.length === 0) {
838
- return "processBundle: command type must be a non-empty string";
839
- }
840
- return {
841
- id: value.id,
842
- type: value.type,
843
- payload: value.payload,
844
- ...typeof value.processId === "string" ? { processId: value.processId } : {},
845
- ...typeof value.correlationId === "string" ? { correlationId: value.correlationId } : {},
846
- ...typeof value.causationId === "string" ? { causationId: value.causationId } : {},
847
- ...isObjectRecord(value.metadata) ? { metadata: value.metadata } : {}
848
- };
849
- }
850
- function prepareProcessEvents(command, state, drafts) {
851
- if (!Array.isArray(drafts)) return "processBundle: events must be an array";
852
- const seen = /* @__PURE__ */ new Set();
853
- const out = [];
854
- for (let i = 0; i < drafts.length; i += 1) {
855
- const draft = drafts[i];
856
- if (!isObjectRecord(draft) || typeof draft.type !== "string" || draft.type.length === 0) {
857
- return "processBundle: event draft must have a non-empty type";
858
- }
859
- const id = typeof draft.id === "string" && draft.id.length > 0 ? draft.id : `${command.id}:event:${state.eventSeq + i + 1}`;
860
- if (seen.has(id)) return `processBundle: duplicate event '${id}'`;
861
- if (state.seenEventIds.includes(id)) return `processBundle: duplicate event '${id}'`;
862
- seen.add(id);
863
- out.push({
864
- id,
865
- type: draft.type,
866
- payload: draft.payload,
867
- ...typeof draft.processId === "string" ? { processId: draft.processId } : {},
868
- ...typeof draft.correlationId === "string" ? { correlationId: draft.correlationId } : {},
869
- ...typeof draft.causationId === "string" ? { causationId: draft.causationId } : {},
870
- ...isObjectRecord(draft.metadata) ? { metadata: draft.metadata } : {}
871
- });
872
- }
873
- return out;
874
- }
875
- function prepareProcessEffects(command, state, drafts) {
876
- if (!Array.isArray(drafts)) return "processBundle: effects must be an array";
877
- const seen = /* @__PURE__ */ new Set();
878
- const out = [];
879
- for (let i = 0; i < drafts.length; i += 1) {
880
- const draft = drafts[i];
881
- if (!isObjectRecord(draft) || typeof draft.type !== "string" || draft.type.length === 0) {
882
- return "processBundle: effect draft must have a non-empty type";
883
- }
884
- const id = typeof draft.id === "string" && draft.id.length > 0 ? draft.id : `${command.id}:effect:${state.effectSeq + i + 1}`;
885
- if (seen.has(id)) return `processBundle: duplicate effect '${id}'`;
886
- if (state.seenEffectIds.includes(id)) return `processBundle: duplicate effect '${id}'`;
887
- seen.add(id);
888
- out.push({
889
- id,
890
- type: draft.type,
891
- payload: draft.payload,
892
- ...typeof draft.processId === "string" ? { processId: draft.processId } : {},
893
- ...typeof draft.correlationId === "string" ? { correlationId: draft.correlationId } : {},
894
- ...typeof draft.causationId === "string" ? { causationId: draft.causationId } : {},
895
- ...isObjectRecord(draft.metadata) ? { metadata: draft.metadata } : {}
896
- });
897
- }
898
- return out;
899
- }
900
- function emitProcessFailure(state, emit, raw, command, code, message) {
901
- state.errorCount += 1;
902
- const cursor = processCursorOf(state);
903
- const error = {
904
- code,
905
- message,
906
- command: raw,
907
- ...command === void 0 ? {} : { commandId: command.id, commandType: command.type },
908
- cursor
909
- };
910
- emit({ kind: "error", error });
911
- emitProcessStatus(state, emit, command, "rejected", 0, 0, code);
912
- emitProcessAudit(state, emit, command, "failure", [], [], code, message);
913
- emit({ kind: "cursor", cursor: processCursorOf(state) });
914
- }
915
- function emitProcessStatus(state, emit, command, statusState, eventCount, effectCount, errorCode) {
916
- emit({
917
- kind: "status",
918
- status: {
919
- state: statusState,
920
- ...command === void 0 ? {} : { commandId: command.id, commandType: command.type },
921
- eventCount,
922
- effectCount,
923
- ...errorCode === void 0 ? {} : { errorCode },
924
- cursor: processCursorOf(state)
925
- }
926
- });
927
- }
928
- function emitProcessAudit(state, emit, command, outcome, events, effects, errorCode, errorMessage2) {
929
- state.auditSeq += 1;
930
- emit({
931
- kind: "audit",
932
- audit: {
933
- seq: state.auditSeq,
934
- ...command === void 0 ? {} : { commandId: command.id, commandType: command.type },
935
- outcome,
936
- eventIds: events.map((event) => event.id),
937
- eventTypes: events.map((event) => event.type),
938
- effectIds: effects.map((effect) => effect.id),
939
- effectTypes: effects.map((effect) => effect.type),
940
- ...errorCode === void 0 ? {} : { errorCode },
941
- ...errorMessage2 === void 0 ? {} : { errorMessage: errorMessage2 },
942
- cursor: processCursorOf(state)
943
- }
944
- });
945
- }
946
- function processCursorOf(state) {
947
- return {
948
- eventSeq: state.eventSeq,
949
- effectSeq: state.effectSeq,
950
- commandCount: state.commandCount,
951
- errorCount: state.errorCount,
952
- auditSeq: state.auditSeq
953
- };
954
- }
955
- function cloneProcessState(state) {
956
- if (typeof state !== "object" || state === null) return { ok: true, value: state };
957
- try {
958
- if (typeof globalThis.structuredClone === "function") {
959
- return { ok: true, value: globalThis.structuredClone(state) };
960
- }
961
- return { ok: true, value: JSON.parse(JSON.stringify(state)) };
962
- } catch (error) {
963
- return {
964
- ok: false,
965
- message: `processBundle: state must be cloneable before reducer execution (${errorMessage(error)})`
966
- };
967
- }
968
- }
969
- function readTimestampMs(now) {
970
- try {
971
- const timestampMs = now();
972
- if (!Number.isFinite(timestampMs)) return "processBundle: now() must return a finite number";
973
- return timestampMs;
974
- } catch (error) {
975
- return errorMessage(error);
976
- }
977
- }
978
- function rethrowGraphRuntimeInvariant(error) {
979
- const message = errorMessage(error);
980
- if (message.includes("R-reentrancy") || message.includes("R-rewire") || message.includes("R-graph-domain") || message.includes("D37") || message.includes("D22") || message.includes("different graph") || message.includes("cross-graph") || message.includes("wire bridge") || message.includes("mid-fn topology mutation") || message.includes("reentrant dep mutation") || message.includes("feedback cycle")) {
981
- throw error;
982
- }
983
- }
984
- function isObjectRecord(value) {
985
- return typeof value === "object" && value !== null && !Array.isArray(value);
986
- }
987
- function errorMessage(error) {
988
- return error instanceof Error ? error.message : String(error);
989
- }
49
+ import "../chunk-CX6B6PO2.js";
50
+ import "../chunk-CJIFGJQG.js";
51
+ import "../chunk-SHZDP2MQ.js";
52
+ import "../chunk-WQIA3GFB.js";
53
+ import "../chunk-S6HXABGL.js";
54
+ import "../chunk-K7FB3JTD.js";
55
+ import "../chunk-DGUM43GV.js";
990
56
  export {
57
+ admitAgentRequestProposal,
58
+ agentRequestLedgerViews,
59
+ agentRequestProposalFromDecision,
991
60
  backoffDelayMs,
992
61
  breakerBundle,
62
+ buildToolProviderAdapterInputs,
63
+ buildToolProviderExecutorOutcome,
993
64
  constantBackoff,
65
+ effectRun,
66
+ effectRunCompletionProjector,
67
+ executorOutcomeViewProjector,
68
+ fakeExecutorBlocked,
69
+ fakeExecutorCanceled,
70
+ fakeExecutorFailure,
71
+ fakeExecutorResult,
72
+ fakeExecutorTimeout,
73
+ issueAgentRequest,
74
+ localBuiltinToolProviderCatalog,
994
75
  nextRetryDelayMs,
995
76
  noBackoff,
996
77
  processBundle,
997
78
  processEffectRunner,
998
79
  rateLimitBundle,
80
+ requestSatisfactionProjector,
81
+ requestToolProviderAdapterRun,
82
+ resolveToolProviderExecutionPolicies,
999
83
  retryPolicy,
1000
84
  retryStatusBundle,
85
+ scheduledReadinessProjector,
1001
86
  shouldRetry,
1002
- timeoutBundle
87
+ structuredAgentDecisionInterpreter,
88
+ timeoutBundle,
89
+ toolProviderAdapterInputProjector,
90
+ toolProviderAdapterRunProjector,
91
+ toolProviderPolicyResolutionProjector,
92
+ toolProviderRunAdmissionProjector,
93
+ toolProviderRunRetryProjector,
94
+ validateToolProviderExecutionPolicy
1003
95
  };
1004
96
  //# sourceMappingURL=index.js.map