@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
@@ -0,0 +1,819 @@
1
+ import {
2
+ boundPublicText,
3
+ boundedPublicText,
4
+ dataIssue,
5
+ forEachDepBatch,
6
+ forbiddenDataKeys,
7
+ forbiddenProviderRawMaterialKeys,
8
+ isRecord,
9
+ maxPublicReasonChars,
10
+ projectRuntimeFact,
11
+ publicMaterialForbiddenKeys,
12
+ ref,
13
+ sanitizeAdapterInputIssue,
14
+ sanitizeAdapterInputSourceRefs,
15
+ sanitizeAgentNeed,
16
+ sanitizeAgentOutputEnvelope,
17
+ sanitizeGraphVisibleRecord,
18
+ sanitizeProviderGraphVisibleRecord,
19
+ sanitizeRuntimeMetadata,
20
+ stableJsonStringify,
21
+ stableStringHash
22
+ } from "./chunk-TQPCAIQI.js";
23
+ import {
24
+ depBatch
25
+ } from "./chunk-WQIA3GFB.js";
26
+
27
+ // src/orchestration/agent-runtime-adapter-run.ts
28
+ function normalizeToolProviderAdapterBindings(bindings) {
29
+ const result = /* @__PURE__ */ new Map();
30
+ const bindingList = Array.isArray(bindings) ? bindings : void 0;
31
+ if (bindingList === void 0) {
32
+ const bindingMap = bindings;
33
+ for (const [providerId, binding] of bindingMap.entries()) {
34
+ if (providerId !== binding.providerId) {
35
+ throw new RangeError(
36
+ `attachToolProviderAdapterRuntime: binding key '${providerId}' must match provider '${binding.providerId}'`
37
+ );
38
+ }
39
+ result.set(providerId, binding);
40
+ }
41
+ return result;
42
+ }
43
+ for (const binding of bindingList) {
44
+ if (result.has(binding.providerId)) {
45
+ throw new RangeError(
46
+ `attachToolProviderAdapterRuntime: duplicate binding for provider '${binding.providerId}'`
47
+ );
48
+ }
49
+ result.set(binding.providerId, binding);
50
+ }
51
+ return result;
52
+ }
53
+ function requestToolProviderAdapterRun(input, opts = {}) {
54
+ const attempt = opts.attempt ?? 1;
55
+ return Object.freeze({
56
+ kind: "tool-provider-adapter-run-requested",
57
+ runId: opts.runId ?? defaultToolProviderAdapterRunId(input.adapterInputId, attempt, input),
58
+ adapterInputId: input.adapterInputId,
59
+ requestId: input.requestId,
60
+ operationId: input.operationId,
61
+ routeId: input.routeId,
62
+ providerId: input.providerId,
63
+ executorId: input.executorId,
64
+ profileId: input.profileId,
65
+ attempt,
66
+ reason: sanitizeToolProviderAdapterRunReason(opts.reason, attempt),
67
+ retryOfOutcomeId: opts.retryOfOutcomeId,
68
+ policyRefs: sanitizeAdapterInputSourceRefs(opts.policyRefs ?? input.policyRefs ?? []),
69
+ sourceRefs: sanitizeAdapterInputSourceRefs([
70
+ ref("tool-provider-adapter-input", input.adapterInputId),
71
+ ...input.sourceRefs ?? [],
72
+ ...opts.sourceRefs ?? []
73
+ ]),
74
+ metadata: sanitizeProviderGraphVisibleRecord(opts.metadata),
75
+ requestedAtMs: opts.requestedAtMs
76
+ });
77
+ }
78
+ function toolProviderAdapterRunProjector(graph, opts) {
79
+ return toolProviderAdapterRunProjectorInternal(graph, opts);
80
+ }
81
+ function toolProviderAdapterRunProjectorInternal(graph, opts) {
82
+ const name = opts.name ?? "toolProviderAdapterRun";
83
+ const explicitRunDeps = opts.runRequests ?? [];
84
+ const autoRunReadyInputs = opts.autoRunReadyInputs ?? true;
85
+ const runtime = graph.node(
86
+ [opts.inputs, ...explicitRunDeps],
87
+ (ctx) => {
88
+ const state = ctx.state.get() ?? {
89
+ inputs: /* @__PURE__ */ new Map(),
90
+ emittedKeys: /* @__PURE__ */ new Set(),
91
+ statusKeys: /* @__PURE__ */ new Set(),
92
+ issueKeys: /* @__PURE__ */ new Set(),
93
+ auditSeq: 0
94
+ };
95
+ for (const raw of depBatch(ctx, 0) ?? []) {
96
+ const input = raw;
97
+ state.inputs.set(input.adapterInputId, input);
98
+ opts.privateRetentionHooks?.onAdapterInputKey?.({
99
+ adapterInputId: input.adapterInputId,
100
+ dropInput: () => {
101
+ state.inputs.delete(input.adapterInputId);
102
+ }
103
+ });
104
+ if (input.status !== "ready") continue;
105
+ if (autoRunReadyInputs) {
106
+ emitRunRequested(
107
+ ctx,
108
+ state,
109
+ requestToolProviderAdapterRun(input, {
110
+ requestedAtMs: opts.now?.()
111
+ }),
112
+ opts.privateRetentionHooks
113
+ );
114
+ } else if (explicitRunDeps.length === 0) {
115
+ emitRunIssue(
116
+ ctx,
117
+ state,
118
+ "tool-provider-adapter-run-request-missing",
119
+ "Ready tool provider adapter input has no visible run request.",
120
+ input.adapterInputId,
121
+ [ref("tool-provider-adapter-input", input.adapterInputId)],
122
+ opts.privateRetentionHooks
123
+ );
124
+ emitRunStatus(
125
+ ctx,
126
+ state,
127
+ {
128
+ kind: "tool-provider-adapter-run-status",
129
+ runId: defaultToolProviderAdapterRunId(input.adapterInputId, 1, input),
130
+ adapterInputId: input.adapterInputId,
131
+ requestId: input.requestId,
132
+ operationId: input.operationId,
133
+ status: "missing-request",
134
+ attempt: 1,
135
+ sourceRefs: [ref("tool-provider-adapter-input", input.adapterInputId)]
136
+ },
137
+ opts.privateRetentionHooks
138
+ );
139
+ }
140
+ }
141
+ forEachDepBatch(ctx, 1, explicitRunDeps.length, (raw) => {
142
+ if (!isToolProviderAdapterRunRequestedLike(raw)) {
143
+ const request2 = fallbackToolProviderAdapterRunRequest(raw, opts.publicText);
144
+ const issue = dataIssue(
145
+ "tool-provider-adapter-run-request-invalid-shape",
146
+ "Tool provider adapter run request must be a data object with runId, adapterInputId, requestId, operationId, and attempt.",
147
+ {
148
+ subjectId: request2.adapterInputId,
149
+ refs: [ref("tool-provider-adapter-run", request2.runId)]
150
+ }
151
+ );
152
+ emitRunIssueFact(ctx, state, issue, opts.privateRetentionHooks);
153
+ emitRunStatus(
154
+ ctx,
155
+ state,
156
+ {
157
+ kind: "tool-provider-adapter-run-status",
158
+ runId: request2.runId,
159
+ adapterInputId: request2.adapterInputId,
160
+ requestId: request2.requestId,
161
+ operationId: request2.operationId,
162
+ status: "mismatched-request",
163
+ attempt: request2.attempt,
164
+ issues: [issue],
165
+ sourceRefs: request2.sourceRefs
166
+ },
167
+ opts.privateRetentionHooks
168
+ );
169
+ emitRunAudit(ctx, state, "tool-provider-adapter-run-request-invalid-shape", request2, {
170
+ issueCode: issue.code
171
+ });
172
+ return;
173
+ }
174
+ const request = raw;
175
+ const input = state.inputs.get(request.adapterInputId);
176
+ if (input === void 0) {
177
+ const replayClassification = opts.privateRetentionHooks?.classifyRetainedRunRequestReplayEvidence?.(request);
178
+ if (replayClassification?.kind === "retention-gap") {
179
+ emitRunRequested(
180
+ ctx,
181
+ state,
182
+ sanitizeRetainedToolProviderAdapterRunRequest(request, opts.publicText),
183
+ opts.privateRetentionHooks
184
+ );
185
+ return;
186
+ }
187
+ const issue = dataIssue(
188
+ "tool-provider-adapter-run-request-missing-input",
189
+ "Tool provider adapter run request references an unknown adapter input.",
190
+ {
191
+ subjectId: request.adapterInputId,
192
+ refs: sanitizeAdapterInputSourceRefs([
193
+ ref("tool-provider-adapter-run", request.runId),
194
+ ...request.sourceRefs ?? []
195
+ ])
196
+ }
197
+ );
198
+ emitRunIssueFact(ctx, state, issue, opts.privateRetentionHooks);
199
+ emitRunStatus(
200
+ ctx,
201
+ state,
202
+ {
203
+ kind: "tool-provider-adapter-run-status",
204
+ runId: request.runId,
205
+ adapterInputId: request.adapterInputId,
206
+ requestId: request.requestId,
207
+ operationId: request.operationId,
208
+ status: "missing-input",
209
+ attempt: request.attempt,
210
+ issues: [issue],
211
+ sourceRefs: sanitizeAdapterInputSourceRefs(request.sourceRefs ?? [])
212
+ },
213
+ opts.privateRetentionHooks
214
+ );
215
+ return;
216
+ }
217
+ const issues = runRequestIdentityIssues(request, input);
218
+ if (input.status !== "ready") {
219
+ issues.push(
220
+ dataIssue(
221
+ "tool-provider-adapter-run-request-input-not-ready",
222
+ "Tool provider adapter run request requires a ready adapter input.",
223
+ {
224
+ subjectId: input.requestId,
225
+ refs: [ref("tool-provider-adapter-input", input.adapterInputId)],
226
+ details: { status: input.status }
227
+ }
228
+ )
229
+ );
230
+ }
231
+ if (issues.length > 0) {
232
+ for (const issue of issues)
233
+ emitRunIssueFact(ctx, state, issue, opts.privateRetentionHooks);
234
+ emitRunStatus(
235
+ ctx,
236
+ state,
237
+ {
238
+ kind: "tool-provider-adapter-run-status",
239
+ runId: request.runId,
240
+ adapterInputId: request.adapterInputId,
241
+ requestId: request.requestId,
242
+ operationId: request.operationId,
243
+ status: "mismatched-request",
244
+ attempt: request.attempt,
245
+ issues: Object.freeze(issues),
246
+ sourceRefs: sanitizeAdapterInputSourceRefs(request.sourceRefs ?? [])
247
+ },
248
+ opts.privateRetentionHooks
249
+ );
250
+ emitRunAudit(ctx, state, "tool-provider-adapter-run-request-rejected", request, {
251
+ issueCodes: issues.map((issue) => issue.code)
252
+ });
253
+ return;
254
+ }
255
+ emitRunRequested(
256
+ ctx,
257
+ state,
258
+ sanitizeToolProviderAdapterRunRequest(request, input, opts.publicText),
259
+ opts.privateRetentionHooks
260
+ );
261
+ });
262
+ ctx.state.set(state);
263
+ },
264
+ { name: `${name}/runtime`, factory: "toolProviderAdapterRunProjector", partial: true }
265
+ );
266
+ return {
267
+ requests: projectRuntimeFact(
268
+ graph,
269
+ runtime,
270
+ `${name}/requests`,
271
+ "toolProviderAdapterRunRequests",
272
+ (fact) => fact.kind === "request" ? fact.request : void 0
273
+ ),
274
+ status: projectRuntimeFact(
275
+ graph,
276
+ runtime,
277
+ `${name}/status`,
278
+ "toolProviderAdapterRunStatus",
279
+ (fact) => fact.kind === "status" ? fact.status : void 0
280
+ ),
281
+ issues: projectRuntimeFact(
282
+ graph,
283
+ runtime,
284
+ `${name}/issues`,
285
+ "toolProviderAdapterRunIssues",
286
+ (fact) => fact.kind === "issue" ? fact.issue : void 0
287
+ ),
288
+ audit: projectRuntimeFact(
289
+ graph,
290
+ runtime,
291
+ `${name}/audit`,
292
+ "toolProviderAdapterRunAudit",
293
+ (fact) => fact.kind === "audit" ? fact.audit : void 0
294
+ )
295
+ };
296
+ }
297
+ function defaultToolProviderAdapterRunId(adapterInputId, attempt, input) {
298
+ const suffix = input === void 0 ? "" : `:${stableStringHash(stableJsonStringify(input))}`;
299
+ return `${adapterInputId}:run-${attempt}${suffix}`;
300
+ }
301
+ function sanitizeToolProviderAdapterRunReason(reason, attempt, policy) {
302
+ const value = reason ?? (attempt === 1 ? "initial" : "retry");
303
+ return boundPublicText(value, maxPublicReasonChars(policy)).text;
304
+ }
305
+ function sanitizeToolProviderAdapterRunRequest(request, input, policy) {
306
+ return Object.freeze({
307
+ ...request,
308
+ reason: sanitizeToolProviderAdapterRunReason(request.reason, request.attempt, policy),
309
+ policyRefs: sanitizeAdapterInputSourceRefs(request.policyRefs ?? input.policyRefs ?? []),
310
+ sourceRefs: sanitizeAdapterInputSourceRefs([
311
+ ref("tool-provider-adapter-input", input.adapterInputId),
312
+ ...input.sourceRefs ?? [],
313
+ ...request.sourceRefs ?? []
314
+ ]),
315
+ metadata: sanitizeProviderGraphVisibleRecord(request.metadata)
316
+ });
317
+ }
318
+ function sanitizeRetainedToolProviderAdapterRunRequest(request, policy) {
319
+ const policyRefs = sanitizeAdapterInputSourceRefs(request.policyRefs ?? []);
320
+ const sourceRefs = sanitizeAdapterInputSourceRefs(request.sourceRefs ?? []);
321
+ const metadata = sanitizeProviderGraphVisibleRecord(request.metadata);
322
+ return Object.freeze({
323
+ kind: "tool-provider-adapter-run-requested",
324
+ runId: request.runId,
325
+ adapterInputId: request.adapterInputId,
326
+ requestId: request.requestId,
327
+ operationId: request.operationId,
328
+ ...request.routeId === void 0 ? {} : { routeId: request.routeId },
329
+ ...request.providerId === void 0 ? {} : { providerId: request.providerId },
330
+ ...request.executorId === void 0 ? {} : { executorId: request.executorId },
331
+ ...request.profileId === void 0 ? {} : { profileId: request.profileId },
332
+ attempt: request.attempt,
333
+ reason: sanitizeToolProviderAdapterRunReason(request.reason, request.attempt, policy),
334
+ ...request.retryOfOutcomeId === void 0 ? {} : { retryOfOutcomeId: request.retryOfOutcomeId },
335
+ ...policyRefs.length === 0 ? {} : { policyRefs },
336
+ ...sourceRefs.length === 0 ? {} : { sourceRefs },
337
+ ...metadata === void 0 ? {} : { metadata },
338
+ ...request.requestedAtMs === void 0 ? {} : { requestedAtMs: request.requestedAtMs }
339
+ });
340
+ }
341
+ function isToolProviderAdapterRunRequestedLike(value) {
342
+ const attempt = isRecord(value) ? value.attempt : void 0;
343
+ return isRecord(value) && value.kind === "tool-provider-adapter-run-requested" && typeof value.runId === "string" && value.runId.length > 0 && typeof value.adapterInputId === "string" && value.adapterInputId.length > 0 && typeof value.requestId === "string" && value.requestId.length > 0 && typeof value.operationId === "string" && value.operationId.length > 0 && typeof attempt === "number" && Number.isInteger(attempt) && attempt > 0 && typeof value.reason === "string" && value.reason.length > 0;
344
+ }
345
+ function fallbackToolProviderAdapterRunRequest(raw, policy) {
346
+ const record = isRecord(raw) ? raw : {};
347
+ const adapterInputId = typeof record.adapterInputId === "string" && record.adapterInputId.length > 0 ? record.adapterInputId : "<invalid-adapter-input>";
348
+ const runId = typeof record.runId === "string" && record.runId.length > 0 ? record.runId : `${adapterInputId}:invalid-run`;
349
+ const attempt = typeof record.attempt === "number" && Number.isInteger(record.attempt) && record.attempt > 0 ? record.attempt : 1;
350
+ const metadata = isRecord(record.metadata) ? sanitizeProviderGraphVisibleRecord(record.metadata, policy) : void 0;
351
+ return Object.freeze({
352
+ kind: "tool-provider-adapter-run-requested",
353
+ runId,
354
+ adapterInputId,
355
+ requestId: typeof record.requestId === "string" && record.requestId.length > 0 ? record.requestId : "<invalid-request>",
356
+ operationId: typeof record.operationId === "string" && record.operationId.length > 0 ? record.operationId : "<invalid-operation>",
357
+ attempt,
358
+ reason: sanitizeToolProviderAdapterRunReason(
359
+ typeof record.reason === "string" && record.reason.length > 0 ? record.reason : "manual",
360
+ attempt,
361
+ policy
362
+ ),
363
+ sourceRefs: sanitizeAdapterInputSourceRefs([
364
+ ref("tool-provider-adapter-run", runId),
365
+ ...sanitizeUntrustedSourceRefs(record.sourceRefs)
366
+ ]),
367
+ ...metadata === void 0 ? {} : { metadata }
368
+ });
369
+ }
370
+ function sanitizeUntrustedSourceRefs(value) {
371
+ if (!Array.isArray(value)) return [];
372
+ return Object.freeze(
373
+ value.filter(
374
+ (sourceRef) => isRecord(sourceRef) && typeof sourceRef.kind === "string" && sourceRef.kind.length > 0 && typeof sourceRef.id === "string" && sourceRef.id.length > 0
375
+ ).map((sourceRef) => ({
376
+ kind: sourceRef.kind,
377
+ id: sourceRef.id,
378
+ ...isRecord(sourceRef.metadata) ? { metadata: sourceRef.metadata } : {}
379
+ }))
380
+ );
381
+ }
382
+ function runRequestIdentityIssues(request, input) {
383
+ const refs = sanitizeAdapterInputSourceRefs([
384
+ ref("tool-provider-adapter-run", request.runId),
385
+ ref("tool-provider-adapter-input", input.adapterInputId),
386
+ ...request.sourceRefs ?? []
387
+ ]);
388
+ const issues = [];
389
+ if (request.kind !== "tool-provider-adapter-run-requested") {
390
+ issues.push(
391
+ dataIssue(
392
+ "tool-provider-adapter-run-request-invalid-kind",
393
+ "Tool provider adapter run request kind must be tool-provider-adapter-run-requested.",
394
+ { subjectId: request.adapterInputId, refs }
395
+ )
396
+ );
397
+ }
398
+ if (request.runId.length === 0) {
399
+ issues.push(
400
+ dataIssue(
401
+ "tool-provider-adapter-run-request-missing-run-id",
402
+ "Tool provider adapter run request requires runId.",
403
+ {
404
+ subjectId: request.adapterInputId,
405
+ refs
406
+ }
407
+ )
408
+ );
409
+ }
410
+ if (!Number.isInteger(request.attempt) || request.attempt < 1) {
411
+ issues.push(
412
+ dataIssue(
413
+ "tool-provider-adapter-run-request-invalid-attempt",
414
+ "Tool provider adapter run request attempt must be a positive integer.",
415
+ { subjectId: request.adapterInputId, refs }
416
+ )
417
+ );
418
+ }
419
+ if (request.requestId !== input.requestId) {
420
+ issues.push(
421
+ dataIssue(
422
+ "tool-provider-adapter-run-request-stale-request",
423
+ "Tool provider adapter run request requestId does not match the adapter input.",
424
+ { subjectId: input.requestId, refs }
425
+ )
426
+ );
427
+ }
428
+ if (request.operationId !== input.operationId) {
429
+ issues.push(
430
+ dataIssue(
431
+ "tool-provider-adapter-run-request-stale-operation",
432
+ "Tool provider adapter run request operationId does not match the adapter input.",
433
+ { subjectId: input.requestId, refs }
434
+ )
435
+ );
436
+ }
437
+ if (request.routeId !== void 0 && request.routeId !== input.routeId) {
438
+ issues.push(
439
+ dataIssue(
440
+ "tool-provider-adapter-run-request-stale-route",
441
+ "Tool provider adapter run request routeId does not match the adapter input.",
442
+ { subjectId: input.requestId, refs }
443
+ )
444
+ );
445
+ }
446
+ if (request.providerId !== void 0 && request.providerId !== input.providerId) {
447
+ issues.push(
448
+ dataIssue(
449
+ "tool-provider-adapter-run-request-stale-provider",
450
+ "Tool provider adapter run request providerId does not match the adapter input.",
451
+ { subjectId: input.requestId, refs }
452
+ )
453
+ );
454
+ }
455
+ if (request.executorId !== void 0 && request.executorId !== input.executorId) {
456
+ issues.push(
457
+ dataIssue(
458
+ "tool-provider-adapter-run-request-stale-executor",
459
+ "Tool provider adapter run request executorId does not match the adapter input.",
460
+ { subjectId: input.requestId, refs }
461
+ )
462
+ );
463
+ }
464
+ if (request.profileId !== void 0 && request.profileId !== input.profileId) {
465
+ issues.push(
466
+ dataIssue(
467
+ "tool-provider-adapter-run-request-stale-profile",
468
+ "Tool provider adapter run request profileId does not match the adapter input.",
469
+ { subjectId: input.requestId, refs }
470
+ )
471
+ );
472
+ }
473
+ for (const forbidden of [
474
+ ...forbiddenDataKeys(request),
475
+ ...forbiddenProviderRawMaterialKeys(request)
476
+ ]) {
477
+ issues.push(
478
+ dataIssue(
479
+ "tool-provider-adapter-run-request-forbidden-runtime-material",
480
+ "Tool provider adapter run request must not contain runtime-private adapter material.",
481
+ { subjectId: input.requestId, refs, details: { reason: forbidden.reason } }
482
+ )
483
+ );
484
+ }
485
+ return issues;
486
+ }
487
+ function emitRunRequested(ctx, state, request, privateRetentionHooks) {
488
+ const key = `${request.runId}:${request.adapterInputId}:${request.attempt}`;
489
+ if (state.emittedKeys.has(key)) return;
490
+ state.emittedKeys.add(key);
491
+ ctx.down([["DATA", { kind: "request", request }]]);
492
+ privateRetentionHooks?.onRunRequestKey?.({
493
+ key,
494
+ request,
495
+ dropKey: () => state.emittedKeys.delete(key)
496
+ });
497
+ emitRunStatus(
498
+ ctx,
499
+ state,
500
+ {
501
+ kind: "tool-provider-adapter-run-status",
502
+ runId: request.runId,
503
+ adapterInputId: request.adapterInputId,
504
+ requestId: request.requestId,
505
+ operationId: request.operationId,
506
+ status: "requested",
507
+ attempt: request.attempt,
508
+ sourceRefs: request.sourceRefs
509
+ },
510
+ privateRetentionHooks
511
+ );
512
+ emitRunAudit(ctx, state, "tool-provider-adapter-run-requested", request, {
513
+ reason: request.reason,
514
+ attempt: request.attempt
515
+ });
516
+ }
517
+ function emitRunStatus(ctx, state, status, privateRetentionHooks) {
518
+ const cleanSourceRefs = status.sourceRefs === void 0 ? void 0 : sanitizeAdapterInputSourceRefs(status.sourceRefs);
519
+ const cleanIssues = status.issues === void 0 ? void 0 : Object.freeze(status.issues.map((issue) => sanitizeAdapterInputIssue(issue)));
520
+ const cleanMetadata = sanitizeProviderGraphVisibleRecord(status.metadata);
521
+ const cleanStatus = Object.freeze({
522
+ kind: status.kind,
523
+ runId: status.runId,
524
+ adapterInputId: status.adapterInputId,
525
+ ...status.requestId === void 0 ? {} : { requestId: status.requestId },
526
+ ...status.operationId === void 0 ? {} : { operationId: status.operationId },
527
+ status: status.status,
528
+ ...status.attempt === void 0 ? {} : { attempt: status.attempt },
529
+ ...status.outcomeId === void 0 ? {} : { outcomeId: status.outcomeId },
530
+ ...cleanIssues === void 0 || cleanIssues.length === 0 ? {} : { issues: cleanIssues },
531
+ ...cleanSourceRefs === void 0 || cleanSourceRefs.length === 0 ? {} : { sourceRefs: cleanSourceRefs },
532
+ ...cleanMetadata === void 0 ? {} : { metadata: cleanMetadata }
533
+ });
534
+ const key = stableJsonStringify({
535
+ runId: cleanStatus.runId,
536
+ adapterInputId: cleanStatus.adapterInputId,
537
+ requestId: cleanStatus.requestId,
538
+ attempt: cleanStatus.attempt,
539
+ status: cleanStatus.status,
540
+ outcomeId: cleanStatus.outcomeId
541
+ });
542
+ if (state.statusKeys.has(key)) return;
543
+ state.statusKeys.add(key);
544
+ ctx.down([
545
+ ["DATA", { kind: "status", status: cleanStatus }]
546
+ ]);
547
+ privateRetentionHooks?.onRunStatusKey?.({
548
+ key,
549
+ status: cleanStatus,
550
+ dropKey: () => state.statusKeys.delete(key)
551
+ });
552
+ }
553
+ function emitRunIssue(ctx, state, code, message, subjectId, refs, privateRetentionHooks) {
554
+ emitRunIssueFact(
555
+ ctx,
556
+ state,
557
+ dataIssue(code, message, { subjectId, refs }),
558
+ privateRetentionHooks
559
+ );
560
+ }
561
+ function emitRunIssueFact(ctx, state, issue, privateRetentionHooks) {
562
+ const key = stableJsonStringify({
563
+ code: issue.code,
564
+ subjectId: issue.subjectId,
565
+ refs: issue.refs ?? [],
566
+ details: issue.details
567
+ });
568
+ if (state.issueKeys.has(key)) return;
569
+ state.issueKeys.add(key);
570
+ ctx.down([["DATA", { kind: "issue", issue }]]);
571
+ privateRetentionHooks?.onRunIssueKey?.({
572
+ key,
573
+ issue,
574
+ dropKey: () => state.issueKeys.delete(key)
575
+ });
576
+ }
577
+ function emitRunAudit(ctx, state, kind, request, metadata) {
578
+ state.auditSeq += 1;
579
+ ctx.down([
580
+ [
581
+ "DATA",
582
+ {
583
+ kind: "audit",
584
+ audit: {
585
+ id: `${request.runId}:audit:${state.auditSeq}`,
586
+ kind,
587
+ subjectId: request.requestId,
588
+ sourceRefs: sanitizeAdapterInputSourceRefs(request.sourceRefs ?? []),
589
+ metadata: sanitizeProviderGraphVisibleRecord({
590
+ runId: request.runId,
591
+ adapterInputId: request.adapterInputId,
592
+ ...metadata
593
+ })
594
+ }
595
+ }
596
+ ]
597
+ ]);
598
+ }
599
+
600
+ // src/orchestration/agent-runtime-executor-outcome.ts
601
+ function adapterRuntimeIdentity(input) {
602
+ if (input.status !== "ready") {
603
+ throw new RangeError("buildToolProviderExecutorOutcome: adapter input must be ready");
604
+ }
605
+ if (input.routeId === void 0 || input.executorId === void 0 || input.profileId === void 0) {
606
+ throw new RangeError(
607
+ "buildToolProviderExecutorOutcome: ready adapter input is missing route/executor/profile identity"
608
+ );
609
+ }
610
+ return {
611
+ routeId: input.routeId,
612
+ executorId: input.executorId,
613
+ profileId: input.profileId
614
+ };
615
+ }
616
+ function defaultToolProviderAdapterEvidenceRefs(input) {
617
+ return sanitizeAdapterInputSourceRefs([
618
+ ref("tool-provider-adapter-input", input.adapterInputId),
619
+ ...input.sourceRefs ?? []
620
+ ]);
621
+ }
622
+ function buildToolProviderExecutorOutcome(input, result, opts = {}) {
623
+ const ids = adapterRuntimeIdentity(input);
624
+ const attempt = opts.attempt ?? 1;
625
+ const occurredAtMs = result.occurredAtMs ?? opts.occurredAtMs;
626
+ const evidenceRefs = result.evidenceRefs === void 0 ? defaultToolProviderAdapterEvidenceRefs(input) : sanitizeAdapterInputSourceRefs(result.evidenceRefs);
627
+ const issues = result.issues === void 0 ? void 0 : Object.freeze(
628
+ result.issues.map((issue2) => sanitizeAdapterInputIssue(issue2, opts.publicText))
629
+ );
630
+ const textIssues = [];
631
+ const metadata = sanitizeRuntimeMetadata(
632
+ {
633
+ ...result.metadata ?? {},
634
+ adapterInputId: input.adapterInputId,
635
+ ...opts.runId === void 0 ? {} : { runId: opts.runId },
636
+ providerId: input.providerId,
637
+ toolName: input.toolName,
638
+ operation: input.operation
639
+ },
640
+ input,
641
+ opts.publicText,
642
+ textIssues
643
+ );
644
+ if (metadata === void 0 && result.metadata !== void 0) {
645
+ textIssues.push(
646
+ dataIssue(
647
+ "tool-provider-adapter-runtime-metadata-redacted",
648
+ "Tool provider adapter runtime metadata was omitted because it contained runtime-private material.",
649
+ {
650
+ subjectId: input.requestId,
651
+ refs: [ref("tool-provider-adapter-input", input.adapterInputId)],
652
+ severity: "warning"
653
+ }
654
+ )
655
+ );
656
+ }
657
+ const base = {
658
+ outcomeId: opts.outcomeId ?? `${input.adapterInputId}:${toolProviderOutcomeRunSegment(opts.runId, attempt)}:${result.kind}`,
659
+ requestId: input.requestId,
660
+ operationId: input.operationId,
661
+ routeId: ids.routeId,
662
+ executorId: ids.executorId,
663
+ profileId: ids.profileId,
664
+ attempt,
665
+ evidenceRefs,
666
+ ...input.input?.inputId === void 0 ? {} : { inputId: input.input.inputId },
667
+ ...input.input?.inputKind === void 0 ? {} : { inputKind: input.input.inputKind },
668
+ ...occurredAtMs === void 0 ? {} : { occurredAtMs },
669
+ ...issues === void 0 ? {} : { issues },
670
+ ...result.usage === void 0 ? {} : { usage: result.usage },
671
+ ...metadata === void 0 ? {} : { metadata }
672
+ };
673
+ const candidate = (() => {
674
+ switch (result.kind) {
675
+ case "result":
676
+ return {
677
+ ...base,
678
+ kind: "result",
679
+ result: sanitizeAgentOutputEnvelope(result.result, input, opts.publicText, textIssues)
680
+ };
681
+ case "failure":
682
+ return {
683
+ ...base,
684
+ kind: "failure",
685
+ error: sanitizeAdapterInputIssue(result.error, opts.publicText),
686
+ ...result.retryable === void 0 ? {} : { retryable: result.retryable }
687
+ };
688
+ case "canceled":
689
+ return {
690
+ ...base,
691
+ kind: "canceled",
692
+ ...result.reason === void 0 ? {} : {
693
+ reason: boundedPublicText(
694
+ result.reason,
695
+ "reason",
696
+ input,
697
+ opts.publicText,
698
+ textIssues
699
+ )
700
+ }
701
+ };
702
+ case "timeout":
703
+ return {
704
+ ...base,
705
+ kind: "timeout",
706
+ ...result.timeoutMs === void 0 ? {} : { timeoutMs: result.timeoutMs },
707
+ ...result.retryable === void 0 ? {} : { retryable: result.retryable }
708
+ };
709
+ case "blocked":
710
+ return {
711
+ ...base,
712
+ kind: "blocked",
713
+ needs: Object.freeze(
714
+ result.needs.map((need) => sanitizeAgentNeed(need, input, opts.publicText, textIssues))
715
+ )
716
+ };
717
+ }
718
+ })();
719
+ const boundedCandidate = textIssues.length === 0 ? candidate : {
720
+ ...candidate,
721
+ issues: Object.freeze([...candidate.issues ?? [], ...textIssues])
722
+ };
723
+ const materialIssues = (boundedCandidate.issues ?? []).filter(
724
+ (issue2) => issue2.code === "tool-provider-adapter-runtime-forbidden-runtime-material"
725
+ );
726
+ const leakIssues = forbiddenAdapterRuntimeMaterialIssues(
727
+ boundedCandidate,
728
+ ref("executor-outcome", boundedCandidate.outcomeId),
729
+ "executor-outcome"
730
+ );
731
+ if (leakIssues.length === 0 && materialIssues.length === 0)
732
+ return Object.freeze(boundedCandidate);
733
+ const allLeakIssues = Object.freeze([...materialIssues, ...leakIssues]);
734
+ const issue = allLeakIssues[0] ?? dataIssue("tool-provider-adapter-runtime-invalid", "invalid");
735
+ const failureMetadata = sanitizeGraphVisibleRecord({
736
+ adapterInputId: input.adapterInputId,
737
+ ...opts.runId === void 0 ? {} : { runId: opts.runId },
738
+ providerId: input.providerId,
739
+ toolName: input.toolName,
740
+ operation: input.operation
741
+ });
742
+ return Object.freeze({
743
+ kind: "failure",
744
+ outcomeId: `${input.adapterInputId}:${toolProviderOutcomeRunSegment(
745
+ opts.runId,
746
+ attempt
747
+ )}:failure`,
748
+ requestId: input.requestId,
749
+ operationId: input.operationId,
750
+ routeId: ids.routeId,
751
+ executorId: ids.executorId,
752
+ profileId: ids.profileId,
753
+ attempt,
754
+ evidenceRefs,
755
+ ...input.input?.inputId === void 0 ? {} : { inputId: input.input.inputId },
756
+ ...input.input?.inputKind === void 0 ? {} : { inputKind: input.input.inputKind },
757
+ ...occurredAtMs === void 0 ? {} : { occurredAtMs },
758
+ ...failureMetadata === void 0 ? {} : { metadata: failureMetadata },
759
+ error: issue,
760
+ retryable: false,
761
+ issues: allLeakIssues
762
+ });
763
+ }
764
+ function agentRequestStatusForExecutorOutcome(outcome) {
765
+ switch (outcome.kind) {
766
+ case "result":
767
+ return "completed";
768
+ case "failure":
769
+ return "failed";
770
+ case "canceled":
771
+ return "canceled";
772
+ case "timeout":
773
+ return "timeout";
774
+ case "blocked":
775
+ return "blocked";
776
+ }
777
+ }
778
+ function toolProviderOutcomeRunSegment(runId, attempt) {
779
+ return runId === void 0 ? `attempt-${attempt}` : `${runId}:attempt-${attempt}`;
780
+ }
781
+ function adapterRuntimeIssue(input, code, error) {
782
+ return dataIssue(code, "Tool provider adapter runtime failed.", {
783
+ subjectId: input.requestId,
784
+ refs: [ref("tool-provider-adapter-input", input.adapterInputId)],
785
+ details: { errorType: error instanceof Error ? error.name : typeof error }
786
+ });
787
+ }
788
+ function forbiddenAdapterRuntimeMaterialIssues(value, subjectRef, area) {
789
+ if (value === void 0) return [];
790
+ const forbidden = publicMaterialForbiddenKeys(value, "provider");
791
+ if (forbidden.length === 0) return [];
792
+ return Object.freeze(
793
+ forbidden.map(
794
+ (entry) => dataIssue(
795
+ "tool-provider-adapter-runtime-forbidden-runtime-material",
796
+ "Tool provider adapter runtime output must not contain runtime-private adapter material.",
797
+ { subjectId: subjectRef.id, refs: [subjectRef], details: { area, reason: entry.reason } }
798
+ )
799
+ )
800
+ );
801
+ }
802
+ function outcomeIssues(outcome) {
803
+ if (outcome.kind === "failure") return Object.freeze([outcome.error, ...outcome.issues ?? []]);
804
+ return outcome.issues ?? [];
805
+ }
806
+
807
+ export {
808
+ normalizeToolProviderAdapterBindings,
809
+ requestToolProviderAdapterRun,
810
+ toolProviderAdapterRunProjector,
811
+ toolProviderAdapterRunProjectorInternal,
812
+ runRequestIdentityIssues,
813
+ defaultToolProviderAdapterEvidenceRefs,
814
+ buildToolProviderExecutorOutcome,
815
+ agentRequestStatusForExecutorOutcome,
816
+ adapterRuntimeIssue,
817
+ outcomeIssues
818
+ };
819
+ //# sourceMappingURL=chunk-7GOTIIQ7.js.map