experimental-ash 0.2.0-alpha.2 → 0.2.0-alpha.21

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 (585) hide show
  1. package/dist/src/channel/http-channel.d.ts +26 -0
  2. package/dist/src/channel/http-channel.d.ts.map +1 -0
  3. package/dist/src/channel/http-channel.js +24 -0
  4. package/dist/src/channel/http-channel.js.map +1 -0
  5. package/dist/src/channel/resolve-text.d.ts +20 -0
  6. package/dist/src/channel/resolve-text.d.ts.map +1 -0
  7. package/dist/src/channel/resolve-text.js +60 -0
  8. package/dist/src/channel/resolve-text.js.map +1 -0
  9. package/dist/src/channel/schedule-channel.d.ts +16 -0
  10. package/dist/src/channel/schedule-channel.d.ts.map +1 -0
  11. package/dist/src/channel/schedule-channel.js +20 -0
  12. package/dist/src/channel/schedule-channel.js.map +1 -0
  13. package/dist/src/channel/schedule.d.ts +4 -6
  14. package/dist/src/channel/schedule.d.ts.map +1 -1
  15. package/dist/src/channel/schedule.js +6 -9
  16. package/dist/src/channel/schedule.js.map +1 -1
  17. package/dist/src/channel/slack-channel.d.ts +125 -0
  18. package/dist/src/channel/slack-channel.d.ts.map +1 -0
  19. package/dist/src/channel/slack-channel.js +320 -0
  20. package/dist/src/channel/slack-channel.js.map +1 -0
  21. package/dist/src/channel/subagent-channel.d.ts +41 -0
  22. package/dist/src/channel/subagent-channel.d.ts.map +1 -0
  23. package/dist/src/channel/{subagent-emitter.js → subagent-channel.js} +15 -19
  24. package/dist/src/channel/subagent-channel.js.map +1 -0
  25. package/dist/src/channel/types.d.ts +157 -90
  26. package/dist/src/channel/types.d.ts.map +1 -1
  27. package/dist/src/channel/types.js +64 -1
  28. package/dist/src/channel/types.js.map +1 -1
  29. package/dist/src/cli/dev/input-requests.d.ts +4 -4
  30. package/dist/src/cli/dev/input-requests.d.ts.map +1 -1
  31. package/dist/src/cli/dev/input-requests.js +34 -65
  32. package/dist/src/cli/dev/input-requests.js.map +1 -1
  33. package/dist/src/cli/dev/repl.d.ts.map +1 -1
  34. package/dist/src/cli/dev/repl.js +41 -24
  35. package/dist/src/cli/dev/repl.js.map +1 -1
  36. package/dist/src/client/index.d.ts +3 -2
  37. package/dist/src/client/index.d.ts.map +1 -1
  38. package/dist/src/client/index.js +1 -0
  39. package/dist/src/client/index.js.map +1 -1
  40. package/dist/src/client/message-response.d.ts +5 -5
  41. package/dist/src/client/message-response.d.ts.map +1 -1
  42. package/dist/src/client/message-response.js +6 -6
  43. package/dist/src/client/message-response.js.map +1 -1
  44. package/dist/src/client/open-stream.d.ts +1 -1
  45. package/dist/src/client/open-stream.d.ts.map +1 -1
  46. package/dist/src/client/open-stream.js +1 -1
  47. package/dist/src/client/open-stream.js.map +1 -1
  48. package/dist/src/client/session-utils.d.ts +3 -3
  49. package/dist/src/client/session-utils.d.ts.map +1 -1
  50. package/dist/src/client/session-utils.js +4 -4
  51. package/dist/src/client/session-utils.js.map +1 -1
  52. package/dist/src/client/session.d.ts +5 -5
  53. package/dist/src/client/session.js +28 -28
  54. package/dist/src/client/session.js.map +1 -1
  55. package/dist/src/client/types.d.ts +8 -8
  56. package/dist/src/client/types.d.ts.map +1 -1
  57. package/dist/src/compiler/channel-url.d.ts +1 -1
  58. package/dist/src/compiler/channel-url.js +1 -1
  59. package/dist/src/compiler/manifest.d.ts +38 -5
  60. package/dist/src/compiler/manifest.d.ts.map +1 -1
  61. package/dist/src/compiler/manifest.js +15 -1
  62. package/dist/src/compiler/manifest.js.map +1 -1
  63. package/dist/src/compiler/module-map.js +8 -0
  64. package/dist/src/compiler/module-map.js.map +1 -1
  65. package/dist/src/compiler/normalize-channel.d.ts +1 -1
  66. package/dist/src/compiler/normalize-channel.js +3 -3
  67. package/dist/src/compiler/normalize-channel.js.map +1 -1
  68. package/dist/src/compiler/normalize-connection.d.ts +14 -0
  69. package/dist/src/compiler/normalize-connection.d.ts.map +1 -0
  70. package/dist/src/compiler/normalize-connection.js +29 -0
  71. package/dist/src/compiler/normalize-connection.js.map +1 -0
  72. package/dist/src/compiler/normalize-manifest.d.ts.map +1 -1
  73. package/dist/src/compiler/normalize-manifest.js +2 -0
  74. package/dist/src/compiler/normalize-manifest.js.map +1 -1
  75. package/dist/src/context/accessors.d.ts +13 -12
  76. package/dist/src/context/accessors.d.ts.map +1 -1
  77. package/dist/src/context/accessors.js +16 -17
  78. package/dist/src/context/accessors.js.map +1 -1
  79. package/dist/src/context/container.d.ts +17 -19
  80. package/dist/src/context/container.d.ts.map +1 -1
  81. package/dist/src/context/container.js +21 -14
  82. package/dist/src/context/container.js.map +1 -1
  83. package/dist/src/context/durable-context.d.ts +18 -0
  84. package/dist/src/context/durable-context.d.ts.map +1 -0
  85. package/dist/src/context/durable-context.js +49 -0
  86. package/dist/src/context/durable-context.js.map +1 -0
  87. package/dist/src/context/key.d.ts +43 -83
  88. package/dist/src/context/key.d.ts.map +1 -1
  89. package/dist/src/context/key.js +58 -80
  90. package/dist/src/context/key.js.map +1 -1
  91. package/dist/src/context/keys.d.ts +8 -20
  92. package/dist/src/context/keys.d.ts.map +1 -1
  93. package/dist/src/context/keys.js +20 -34
  94. package/dist/src/context/keys.js.map +1 -1
  95. package/dist/src/context/provider.d.ts +2 -2
  96. package/dist/src/context/provider.d.ts.map +1 -1
  97. package/dist/src/context/providers/connection.d.ts +4 -0
  98. package/dist/src/context/providers/connection.d.ts.map +1 -0
  99. package/dist/src/context/providers/connection.js +18 -0
  100. package/dist/src/context/providers/connection.js.map +1 -0
  101. package/dist/src/context/providers/session.d.ts.map +1 -1
  102. package/dist/src/context/providers/session.js +1 -2
  103. package/dist/src/context/providers/session.js.map +1 -1
  104. package/dist/src/context/providers/skill.d.ts.map +1 -1
  105. package/dist/src/context/providers/skill.js +2 -15
  106. package/dist/src/context/providers/skill.js.map +1 -1
  107. package/dist/src/context/run-step.d.ts +6 -8
  108. package/dist/src/context/run-step.d.ts.map +1 -1
  109. package/dist/src/context/run-step.js +15 -17
  110. package/dist/src/context/run-step.js.map +1 -1
  111. package/dist/src/context/seed-keys.d.ts +21 -0
  112. package/dist/src/context/seed-keys.d.ts.map +1 -0
  113. package/dist/src/context/seed-keys.js +31 -0
  114. package/dist/src/context/seed-keys.js.map +1 -0
  115. package/dist/src/context/serialize.d.ts +8 -9
  116. package/dist/src/context/serialize.d.ts.map +1 -1
  117. package/dist/src/context/serialize.js +38 -15
  118. package/dist/src/context/serialize.js.map +1 -1
  119. package/dist/src/discover/connections.d.ts +48 -0
  120. package/dist/src/discover/connections.d.ts.map +1 -0
  121. package/dist/src/discover/connections.js +169 -0
  122. package/dist/src/discover/connections.js.map +1 -0
  123. package/dist/src/discover/discover-agent.d.ts +1 -0
  124. package/dist/src/discover/discover-agent.d.ts.map +1 -1
  125. package/dist/src/discover/discover-agent.js +8 -0
  126. package/dist/src/discover/discover-agent.js.map +1 -1
  127. package/dist/src/discover/discover-subagent.js +7 -0
  128. package/dist/src/discover/discover-subagent.js.map +1 -1
  129. package/dist/src/discover/filesystem.d.ts +3 -3
  130. package/dist/src/discover/filesystem.d.ts.map +1 -1
  131. package/dist/src/discover/filesystem.js +7 -0
  132. package/dist/src/discover/filesystem.js.map +1 -1
  133. package/dist/src/discover/grammar.d.ts +20 -4
  134. package/dist/src/discover/grammar.d.ts.map +1 -1
  135. package/dist/src/discover/grammar.js +31 -5
  136. package/dist/src/discover/grammar.js.map +1 -1
  137. package/dist/src/discover/manifest.d.ts +28 -1
  138. package/dist/src/discover/manifest.d.ts.map +1 -1
  139. package/dist/src/discover/manifest.js +11 -1
  140. package/dist/src/discover/manifest.js.map +1 -1
  141. package/dist/src/evals/runner/artifacts.js +1 -1
  142. package/dist/src/evals/runner/artifacts.js.map +1 -1
  143. package/dist/src/evals/runner/derive-run-facts.js +5 -5
  144. package/dist/src/evals/runner/derive-run-facts.js.map +1 -1
  145. package/dist/src/evals/runner/execute-case.js +4 -4
  146. package/dist/src/evals/runner/execute-case.js.map +1 -1
  147. package/dist/src/evals/runner/execute-suite.js +1 -1
  148. package/dist/src/evals/runner/execute-suite.js.map +1 -1
  149. package/dist/src/evals/runner/reporters/braintrust.js +2 -2
  150. package/dist/src/evals/runner/reporters/braintrust.js.map +1 -1
  151. package/dist/src/evals/types.d.ts +4 -4
  152. package/dist/src/evals/types.d.ts.map +1 -1
  153. package/dist/src/execution/continuous-entry.d.ts +18 -9
  154. package/dist/src/execution/continuous-entry.d.ts.map +1 -1
  155. package/dist/src/execution/continuous-entry.js +62 -18
  156. package/dist/src/execution/continuous-entry.js.map +1 -1
  157. package/dist/src/execution/continuous-runtime.d.ts +1 -1
  158. package/dist/src/execution/continuous-runtime.d.ts.map +1 -1
  159. package/dist/src/execution/continuous-runtime.js +14 -10
  160. package/dist/src/execution/continuous-runtime.js.map +1 -1
  161. package/dist/src/execution/node-step.d.ts +1 -2
  162. package/dist/src/execution/node-step.d.ts.map +1 -1
  163. package/dist/src/execution/node-step.js +42 -55
  164. package/dist/src/execution/node-step.js.map +1 -1
  165. package/dist/src/execution/runtime-context.d.ts +3 -0
  166. package/dist/src/execution/runtime-context.d.ts.map +1 -1
  167. package/dist/src/execution/runtime-context.js +6 -4
  168. package/dist/src/execution/runtime-context.js.map +1 -1
  169. package/dist/src/execution/session.d.ts +2 -1
  170. package/dist/src/execution/session.d.ts.map +1 -1
  171. package/dist/src/execution/session.js +1 -0
  172. package/dist/src/execution/session.js.map +1 -1
  173. package/dist/src/execution/skills/access.d.ts.map +1 -1
  174. package/dist/src/execution/skills/instructions.d.ts +6 -6
  175. package/dist/src/execution/skills/instructions.d.ts.map +1 -1
  176. package/dist/src/execution/skills/instructions.js +15 -15
  177. package/dist/src/execution/skills/instructions.js.map +1 -1
  178. package/dist/src/execution/skills/types.d.ts +4 -4
  179. package/dist/src/execution/skills/types.d.ts.map +1 -1
  180. package/dist/src/execution/step-context.d.ts +27 -0
  181. package/dist/src/execution/step-context.d.ts.map +1 -0
  182. package/dist/src/execution/step-context.js +54 -0
  183. package/dist/src/execution/step-context.js.map +1 -0
  184. package/dist/src/execution/subagent-tool.d.ts +1 -1
  185. package/dist/src/execution/subagent-tool.d.ts.map +1 -1
  186. package/dist/src/execution/subagent-tool.js +3 -4
  187. package/dist/src/execution/subagent-tool.js.map +1 -1
  188. package/dist/src/execution/tool-compaction.d.ts +1 -3
  189. package/dist/src/execution/tool-compaction.d.ts.map +1 -1
  190. package/dist/src/execution/tool-compaction.js +6 -20
  191. package/dist/src/execution/tool-compaction.js.map +1 -1
  192. package/dist/src/execution/types.d.ts +1 -1
  193. package/dist/src/execution/types.d.ts.map +1 -1
  194. package/dist/src/execution/workflow-entry.d.ts +4 -5
  195. package/dist/src/execution/workflow-entry.d.ts.map +1 -1
  196. package/dist/src/execution/workflow-entry.js +7 -2
  197. package/dist/src/execution/workflow-entry.js.map +1 -1
  198. package/dist/src/execution/workflow-runtime.d.ts.map +1 -1
  199. package/dist/src/execution/workflow-runtime.js +10 -5
  200. package/dist/src/execution/workflow-runtime.js.map +1 -1
  201. package/dist/src/execution/workflow-steps.d.ts +13 -6
  202. package/dist/src/execution/workflow-steps.d.ts.map +1 -1
  203. package/dist/src/execution/workflow-steps.js +24 -19
  204. package/dist/src/execution/workflow-steps.js.map +1 -1
  205. package/dist/src/harness/emission.d.ts +36 -27
  206. package/dist/src/harness/emission.d.ts.map +1 -1
  207. package/dist/src/harness/emission.js +130 -84
  208. package/dist/src/harness/emission.js.map +1 -1
  209. package/dist/src/harness/execute-tool.d.ts +52 -0
  210. package/dist/src/harness/execute-tool.d.ts.map +1 -0
  211. package/dist/src/harness/execute-tool.js +59 -0
  212. package/dist/src/harness/execute-tool.js.map +1 -0
  213. package/dist/src/harness/input-extraction.d.ts +3 -3
  214. package/dist/src/harness/input-extraction.d.ts.map +1 -1
  215. package/dist/src/harness/input-extraction.js +15 -8
  216. package/dist/src/harness/input-extraction.js.map +1 -1
  217. package/dist/src/harness/input-requests.d.ts +46 -40
  218. package/dist/src/harness/input-requests.d.ts.map +1 -1
  219. package/dist/src/harness/input-requests.js +169 -245
  220. package/dist/src/harness/input-requests.js.map +1 -1
  221. package/dist/src/harness/messages.d.ts +10 -9
  222. package/dist/src/harness/messages.d.ts.map +1 -1
  223. package/dist/src/harness/messages.js +23 -20
  224. package/dist/src/harness/messages.js.map +1 -1
  225. package/dist/src/harness/provider-tools.d.ts +2 -2
  226. package/dist/src/harness/provider-tools.d.ts.map +1 -1
  227. package/dist/src/harness/provider-tools.js +7 -3
  228. package/dist/src/harness/provider-tools.js.map +1 -1
  229. package/dist/src/harness/step-hooks.d.ts +77 -0
  230. package/dist/src/harness/step-hooks.d.ts.map +1 -0
  231. package/dist/src/harness/step-hooks.js +192 -0
  232. package/dist/src/harness/step-hooks.js.map +1 -0
  233. package/dist/src/harness/tool-loop.d.ts +4 -2
  234. package/dist/src/harness/tool-loop.d.ts.map +1 -1
  235. package/dist/src/harness/tool-loop.js +130 -181
  236. package/dist/src/harness/tool-loop.js.map +1 -1
  237. package/dist/src/harness/tools.d.ts +12 -16
  238. package/dist/src/harness/tools.d.ts.map +1 -1
  239. package/dist/src/harness/tools.js +39 -33
  240. package/dist/src/harness/tools.js.map +1 -1
  241. package/dist/src/harness/types.d.ts +44 -28
  242. package/dist/src/harness/types.d.ts.map +1 -1
  243. package/dist/src/harness/types.js +6 -1
  244. package/dist/src/harness/types.js.map +1 -1
  245. package/dist/src/internal/application/compiled-artifacts.d.ts +5 -3
  246. package/dist/src/internal/application/compiled-artifacts.d.ts.map +1 -1
  247. package/dist/src/internal/application/compiled-artifacts.js +19 -40
  248. package/dist/src/internal/application/compiled-artifacts.js.map +1 -1
  249. package/dist/src/internal/application/package.js +1 -1
  250. package/dist/src/internal/authored-definition/channel.d.ts +3 -3
  251. package/dist/src/internal/authored-definition/channel.d.ts.map +1 -1
  252. package/dist/src/internal/authored-definition/channel.js +28 -4
  253. package/dist/src/internal/authored-definition/channel.js.map +1 -1
  254. package/dist/src/internal/authored-definition/connection.d.ts +10 -0
  255. package/dist/src/internal/authored-definition/connection.d.ts.map +1 -0
  256. package/dist/src/internal/authored-definition/connection.js +134 -0
  257. package/dist/src/internal/authored-definition/connection.js.map +1 -0
  258. package/dist/src/internal/authored-module.js +1 -1
  259. package/dist/src/internal/authored-module.js.map +1 -1
  260. package/dist/src/internal/message/builder.d.ts +1 -2
  261. package/dist/src/internal/message/builder.d.ts.map +1 -1
  262. package/dist/src/internal/message/builder.js +4 -12
  263. package/dist/src/internal/message/builder.js.map +1 -1
  264. package/dist/src/internal/nitro/host/configure-message-routes.d.ts +3 -1
  265. package/dist/src/internal/nitro/host/configure-message-routes.d.ts.map +1 -1
  266. package/dist/src/internal/nitro/host/configure-message-routes.js +124 -25
  267. package/dist/src/internal/nitro/host/configure-message-routes.js.map +1 -1
  268. package/dist/src/internal/nitro/host/create-application-nitro.d.ts.map +1 -1
  269. package/dist/src/internal/nitro/host/create-application-nitro.js +63 -21
  270. package/dist/src/internal/nitro/host/create-application-nitro.js.map +1 -1
  271. package/dist/src/internal/nitro/host/load-home-page-web-assets.d.ts +13 -0
  272. package/dist/src/internal/nitro/host/load-home-page-web-assets.d.ts.map +1 -0
  273. package/dist/src/internal/nitro/host/load-home-page-web-assets.js +35 -0
  274. package/dist/src/internal/nitro/host/load-home-page-web-assets.js.map +1 -0
  275. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
  276. package/dist/src/internal/nitro/host/prepare-application-host.js.map +1 -1
  277. package/dist/src/internal/nitro/routes/channel-dispatch.d.ts +10 -18
  278. package/dist/src/internal/nitro/routes/channel-dispatch.d.ts.map +1 -1
  279. package/dist/src/internal/nitro/routes/channel-dispatch.js +16 -45
  280. package/dist/src/internal/nitro/routes/channel-dispatch.js.map +1 -1
  281. package/dist/src/internal/nitro/routes/home-page/build-home-page-response.d.ts +88 -0
  282. package/dist/src/internal/nitro/routes/home-page/build-home-page-response.d.ts.map +1 -0
  283. package/dist/src/internal/nitro/routes/home-page/build-home-page-response.js +175 -0
  284. package/dist/src/internal/nitro/routes/home-page/build-home-page-response.js.map +1 -0
  285. package/dist/src/internal/nitro/routes/home.d.ts +7 -0
  286. package/dist/src/internal/nitro/routes/home.d.ts.map +1 -0
  287. package/dist/src/internal/nitro/routes/home.js +22 -0
  288. package/dist/src/internal/nitro/routes/home.js.map +1 -0
  289. package/dist/src/internal/nitro/routes/index.d.ts +3 -8
  290. package/dist/src/internal/nitro/routes/index.d.ts.map +1 -1
  291. package/dist/src/internal/nitro/routes/index.js +18 -36
  292. package/dist/src/internal/nitro/routes/index.js.map +1 -1
  293. package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +10 -3
  294. package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts.map +1 -1
  295. package/dist/src/internal/nitro/routes/runtime-artifacts.js +2 -9
  296. package/dist/src/internal/nitro/routes/runtime-artifacts.js.map +1 -1
  297. package/dist/src/internal/nitro/routes/runtime-stack.d.ts +8 -7
  298. package/dist/src/internal/nitro/routes/runtime-stack.d.ts.map +1 -1
  299. package/dist/src/internal/nitro/routes/runtime-stack.js +10 -10
  300. package/dist/src/internal/nitro/routes/runtime-stack.js.map +1 -1
  301. package/dist/src/internal/nitro/routes/schedule-task.d.ts +7 -7
  302. package/dist/src/internal/nitro/routes/schedule-task.d.ts.map +1 -1
  303. package/dist/src/internal/nitro/routes/schedule-task.js +22 -30
  304. package/dist/src/internal/nitro/routes/schedule-task.js.map +1 -1
  305. package/dist/src/internal/nitro/routes/web-ui/assets/index.js +10 -0
  306. package/dist/src/internal/nitro/routes/web-ui/assets/style.css +2 -0
  307. package/dist/src/internal/nitro/routes/web-ui/index.html +17 -0
  308. package/dist/src/internal/nitro/routes/workflow-data.d.ts +32 -0
  309. package/dist/src/internal/nitro/routes/workflow-data.d.ts.map +1 -0
  310. package/dist/src/internal/nitro/routes/workflow-data.js +142 -0
  311. package/dist/src/internal/nitro/routes/workflow-data.js.map +1 -0
  312. package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts +46 -0
  313. package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts.map +1 -0
  314. package/dist/src/internal/nitro/routes/workflow-route-helpers.js +137 -0
  315. package/dist/src/internal/nitro/routes/workflow-route-helpers.js.map +1 -0
  316. package/dist/src/internal/nitro/routes/workflow-run-events.d.ts +14 -0
  317. package/dist/src/internal/nitro/routes/workflow-run-events.d.ts.map +1 -0
  318. package/dist/src/internal/nitro/routes/workflow-run-events.js +42 -0
  319. package/dist/src/internal/nitro/routes/workflow-run-events.js.map +1 -0
  320. package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts +14 -0
  321. package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts.map +1 -0
  322. package/dist/src/internal/nitro/routes/workflow-run-steps.js +42 -0
  323. package/dist/src/internal/nitro/routes/workflow-run-steps.js.map +1 -0
  324. package/dist/src/internal/nitro/routes/workflow-run.d.ts +13 -0
  325. package/dist/src/internal/nitro/routes/workflow-run.d.ts.map +1 -0
  326. package/dist/src/internal/nitro/routes/workflow-run.js +35 -0
  327. package/dist/src/internal/nitro/routes/workflow-run.js.map +1 -0
  328. package/dist/src/internal/nitro/routes/workflow-runs.d.ts +11 -0
  329. package/dist/src/internal/nitro/routes/workflow-runs.d.ts.map +1 -0
  330. package/dist/src/internal/nitro/routes/workflow-runs.js +29 -0
  331. package/dist/src/internal/nitro/routes/workflow-runs.js.map +1 -0
  332. package/dist/src/protocol/message.d.ts +160 -76
  333. package/dist/src/protocol/message.d.ts.map +1 -1
  334. package/dist/src/protocol/message.js +92 -36
  335. package/dist/src/protocol/message.js.map +1 -1
  336. package/dist/src/protocol/routes.d.ts +11 -3
  337. package/dist/src/protocol/routes.d.ts.map +1 -1
  338. package/dist/src/protocol/routes.js +12 -4
  339. package/dist/src/protocol/routes.js.map +1 -1
  340. package/dist/src/public/channels/auth.d.ts +32 -81
  341. package/dist/src/public/channels/auth.d.ts.map +1 -1
  342. package/dist/src/public/channels/auth.js +23 -86
  343. package/dist/src/public/channels/auth.js.map +1 -1
  344. package/dist/src/public/channels/http.d.ts +66 -26
  345. package/dist/src/public/channels/http.d.ts.map +1 -1
  346. package/dist/src/public/channels/http.js +88 -78
  347. package/dist/src/public/channels/http.js.map +1 -1
  348. package/dist/src/public/channels/index.d.ts +9 -10
  349. package/dist/src/public/channels/index.d.ts.map +1 -1
  350. package/dist/src/public/channels/index.js +9 -9
  351. package/dist/src/public/channels/index.js.map +1 -1
  352. package/dist/src/public/channels/slack/index.d.ts +104 -37
  353. package/dist/src/public/channels/slack/index.d.ts.map +1 -1
  354. package/dist/src/public/channels/slack/index.js +168 -47
  355. package/dist/src/public/channels/slack/index.js.map +1 -1
  356. package/dist/src/public/channels/slack/lowlevel.d.ts +5 -5
  357. package/dist/src/public/channels/slack/lowlevel.d.ts.map +1 -1
  358. package/dist/src/public/channels/slack/lowlevel.js +4 -4
  359. package/dist/src/public/channels/slack/lowlevel.js.map +1 -1
  360. package/dist/src/public/connections/index.d.ts +25 -0
  361. package/dist/src/public/connections/index.d.ts.map +1 -0
  362. package/dist/src/public/connections/index.js +24 -0
  363. package/dist/src/public/connections/index.js.map +1 -0
  364. package/dist/src/public/definitions/channel.d.ts +89 -60
  365. package/dist/src/public/definitions/channel.d.ts.map +1 -1
  366. package/dist/src/public/definitions/channel.js +42 -24
  367. package/dist/src/public/definitions/channel.js.map +1 -1
  368. package/dist/src/public/definitions/connections/mcp.d.ts +60 -0
  369. package/dist/src/public/definitions/connections/mcp.d.ts.map +1 -0
  370. package/dist/src/public/definitions/connections/mcp.js +7 -0
  371. package/dist/src/public/definitions/connections/mcp.js.map +1 -0
  372. package/dist/src/public/definitions/tool.d.ts +14 -7
  373. package/dist/src/public/definitions/tool.d.ts.map +1 -1
  374. package/dist/src/public/definitions/tool.js.map +1 -1
  375. package/dist/src/public/index.d.ts +10 -9
  376. package/dist/src/public/index.d.ts.map +1 -1
  377. package/dist/src/public/index.js +7 -6
  378. package/dist/src/public/index.js.map +1 -1
  379. package/dist/src/public/sandboxes/internal.d.ts +1 -1
  380. package/dist/src/public/sandboxes/internal.js +1 -1
  381. package/dist/src/public/tools/defaults.d.ts +6 -6
  382. package/dist/src/public/tools/defaults.d.ts.map +1 -1
  383. package/dist/src/public/tools/defaults.js +6 -6
  384. package/dist/src/public/tools/defaults.js.map +1 -1
  385. package/dist/src/public/tools/internal.d.ts +1 -1
  386. package/dist/src/public/tools/internal.js +1 -1
  387. package/dist/src/runtime/actions/types.d.ts +21 -18
  388. package/dist/src/runtime/actions/types.d.ts.map +1 -1
  389. package/dist/src/runtime/actions/types.js +22 -19
  390. package/dist/src/runtime/actions/types.js.map +1 -1
  391. package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +37 -0
  392. package/dist/src/runtime/agent/bootstrap-model-utils.d.ts.map +1 -0
  393. package/dist/src/runtime/agent/bootstrap-model-utils.js +149 -0
  394. package/dist/src/runtime/agent/bootstrap-model-utils.js.map +1 -0
  395. package/dist/src/runtime/agent/bootstrap-model.d.ts.map +1 -1
  396. package/dist/src/runtime/agent/bootstrap-model.js +11 -80
  397. package/dist/src/runtime/agent/bootstrap-model.js.map +1 -1
  398. package/dist/src/runtime/agent/bootstrap.d.ts.map +1 -1
  399. package/dist/src/runtime/agent/bootstrap.js +4 -1
  400. package/dist/src/runtime/agent/bootstrap.js.map +1 -1
  401. package/dist/src/runtime/agent/mock-model-adapter.d.ts.map +1 -1
  402. package/dist/src/runtime/agent/mock-model-adapter.js +72 -134
  403. package/dist/src/runtime/agent/mock-model-adapter.js.map +1 -1
  404. package/dist/src/runtime/channels/registry.d.ts +21 -0
  405. package/dist/src/runtime/channels/registry.d.ts.map +1 -0
  406. package/dist/src/runtime/channels/registry.js +65 -0
  407. package/dist/src/runtime/channels/registry.js.map +1 -0
  408. package/dist/src/runtime/connections/mcp-client.d.ts +48 -0
  409. package/dist/src/runtime/connections/mcp-client.d.ts.map +1 -0
  410. package/dist/src/runtime/connections/mcp-client.js +182 -0
  411. package/dist/src/runtime/connections/mcp-client.js.map +1 -0
  412. package/dist/src/runtime/connections/registry.d.ts +33 -0
  413. package/dist/src/runtime/connections/registry.d.ts.map +1 -0
  414. package/dist/src/runtime/connections/registry.js +54 -0
  415. package/dist/src/runtime/connections/registry.js.map +1 -0
  416. package/dist/src/runtime/connections/types.d.ts +75 -0
  417. package/dist/src/runtime/connections/types.d.ts.map +1 -0
  418. package/dist/src/runtime/connections/types.js +9 -0
  419. package/dist/src/runtime/connections/types.js.map +1 -0
  420. package/dist/src/runtime/framework-channels/index.d.ts +6 -6
  421. package/dist/src/runtime/framework-channels/index.d.ts.map +1 -1
  422. package/dist/src/runtime/framework-channels/index.js +16 -14
  423. package/dist/src/runtime/framework-channels/index.js.map +1 -1
  424. package/dist/src/runtime/framework-tools/ask-question.js +4 -4
  425. package/dist/src/runtime/framework-tools/ask-question.js.map +1 -1
  426. package/dist/src/runtime/framework-tools/connection-execute.d.ts +10 -0
  427. package/dist/src/runtime/framework-tools/connection-execute.d.ts.map +1 -0
  428. package/dist/src/runtime/framework-tools/connection-execute.js +50 -0
  429. package/dist/src/runtime/framework-tools/connection-execute.js.map +1 -0
  430. package/dist/src/runtime/framework-tools/connection-search.d.ts +43 -0
  431. package/dist/src/runtime/framework-tools/connection-search.d.ts.map +1 -0
  432. package/dist/src/runtime/framework-tools/connection-search.js +135 -0
  433. package/dist/src/runtime/framework-tools/connection-search.js.map +1 -0
  434. package/dist/src/runtime/framework-tools/file-state.d.ts +5 -5
  435. package/dist/src/runtime/framework-tools/file-state.d.ts.map +1 -1
  436. package/dist/src/runtime/framework-tools/file-state.js +6 -8
  437. package/dist/src/runtime/framework-tools/file-state.js.map +1 -1
  438. package/dist/src/runtime/framework-tools/index.d.ts +3 -1
  439. package/dist/src/runtime/framework-tools/index.d.ts.map +1 -1
  440. package/dist/src/runtime/framework-tools/index.js +10 -1
  441. package/dist/src/runtime/framework-tools/index.js.map +1 -1
  442. package/dist/src/runtime/framework-tools/skill.d.ts +4 -4
  443. package/dist/src/runtime/framework-tools/skill.d.ts.map +1 -1
  444. package/dist/src/runtime/framework-tools/skill.js +14 -11
  445. package/dist/src/runtime/framework-tools/skill.js.map +1 -1
  446. package/dist/src/runtime/framework-tools/todo.d.ts.map +1 -1
  447. package/dist/src/runtime/framework-tools/todo.js +2 -4
  448. package/dist/src/runtime/framework-tools/todo.js.map +1 -1
  449. package/dist/src/runtime/input/types.d.ts +40 -115
  450. package/dist/src/runtime/input/types.d.ts.map +1 -1
  451. package/dist/src/runtime/input/types.js +28 -66
  452. package/dist/src/runtime/input/types.js.map +1 -1
  453. package/dist/src/runtime/loaders/module-map.js +8 -0
  454. package/dist/src/runtime/loaders/module-map.js.map +1 -1
  455. package/dist/src/runtime/prompt/compose.d.ts +4 -1
  456. package/dist/src/runtime/prompt/compose.d.ts.map +1 -1
  457. package/dist/src/runtime/prompt/compose.js +18 -1
  458. package/dist/src/runtime/prompt/compose.js.map +1 -1
  459. package/dist/src/runtime/prompt/connections.d.ts +10 -0
  460. package/dist/src/runtime/prompt/connections.d.ts.map +1 -0
  461. package/dist/src/runtime/prompt/connections.js +25 -0
  462. package/dist/src/runtime/prompt/connections.js.map +1 -0
  463. package/dist/src/runtime/resolve-agent-graph.d.ts.map +1 -1
  464. package/dist/src/runtime/resolve-agent-graph.js +29 -7
  465. package/dist/src/runtime/resolve-agent-graph.js.map +1 -1
  466. package/dist/src/runtime/resolve-agent.d.ts.map +1 -1
  467. package/dist/src/runtime/resolve-agent.js +3 -0
  468. package/dist/src/runtime/resolve-agent.js.map +1 -1
  469. package/dist/src/runtime/resolve-channel.d.ts.map +1 -1
  470. package/dist/src/runtime/resolve-channel.js +1 -0
  471. package/dist/src/runtime/resolve-channel.js.map +1 -1
  472. package/dist/src/runtime/resolve-connection.d.ts +16 -0
  473. package/dist/src/runtime/resolve-connection.d.ts.map +1 -0
  474. package/dist/src/runtime/resolve-connection.js +69 -0
  475. package/dist/src/runtime/resolve-connection.js.map +1 -0
  476. package/dist/src/runtime/resolve-tool.d.ts.map +1 -1
  477. package/dist/src/runtime/resolve-tool.js +8 -0
  478. package/dist/src/runtime/resolve-tool.js.map +1 -1
  479. package/dist/src/runtime/sessions/auth.d.ts +1 -1
  480. package/dist/src/runtime/sessions/compiled-agent-cache.d.ts +2 -0
  481. package/dist/src/runtime/sessions/compiled-agent-cache.d.ts.map +1 -1
  482. package/dist/src/runtime/sessions/compiled-agent-cache.js +14 -0
  483. package/dist/src/runtime/sessions/compiled-agent-cache.js.map +1 -1
  484. package/dist/src/runtime/skills/fragment-context.d.ts +2 -2
  485. package/dist/src/runtime/skills/fragment-context.d.ts.map +1 -1
  486. package/dist/src/runtime/skills/fragment-context.js +2 -2
  487. package/dist/src/runtime/skills/fragment-context.js.map +1 -1
  488. package/dist/src/runtime/standard-schema.d.ts +28 -0
  489. package/dist/src/runtime/standard-schema.d.ts.map +1 -0
  490. package/dist/src/runtime/standard-schema.js +65 -0
  491. package/dist/src/runtime/standard-schema.js.map +1 -0
  492. package/dist/src/runtime/types.d.ts +29 -3
  493. package/dist/src/runtime/types.d.ts.map +1 -1
  494. package/dist/src/services/dev-client/send-message.d.ts +2 -2
  495. package/dist/src/services/dev-client/send-message.d.ts.map +1 -1
  496. package/dist/src/services/dev-client/send-message.js +21 -22
  497. package/dist/src/services/dev-client/send-message.js.map +1 -1
  498. package/dist/src/services/dev-client/session.d.ts +5 -5
  499. package/dist/src/services/dev-client/session.d.ts.map +1 -1
  500. package/dist/src/services/dev-client/session.js +2 -2
  501. package/dist/src/services/dev-client/session.js.map +1 -1
  502. package/dist/src/services/dev-client.d.ts +6 -6
  503. package/dist/src/services/dev-client.d.ts.map +1 -1
  504. package/dist/src/services/dev-client.js +3 -3
  505. package/dist/src/services/dev-client.js.map +1 -1
  506. package/docs/external-agent-protocol.md +37 -34
  507. package/docs/internals/channels.md +15 -12
  508. package/docs/internals/context.md +81 -161
  509. package/docs/internals/message-runtime.md +28 -26
  510. package/docs/public/README.md +22 -20
  511. package/docs/public/auth-and-route-protection.md +15 -12
  512. package/docs/public/channels/README.md +16 -11
  513. package/docs/public/cli-build-and-debugging.md +1 -1
  514. package/docs/public/context-control.md +7 -3
  515. package/docs/public/evals.md +3 -3
  516. package/docs/public/getting-started.md +15 -12
  517. package/docs/public/human-in-the-loop.md +45 -57
  518. package/docs/public/migration-guide.md +71 -0
  519. package/docs/public/project-layout.md +5 -0
  520. package/docs/public/runs-and-streaming.md +32 -25
  521. package/docs/public/schedules.md +4 -4
  522. package/docs/public/session-context.md +131 -15
  523. package/docs/public/skills.md +27 -3
  524. package/docs/public/subagents.md +2 -2
  525. package/docs/public/tools.md +23 -30
  526. package/docs/public/typescript-api.md +16 -12
  527. package/docs/public/vercel-deployment.md +3 -4
  528. package/docs/public/workspace.md +11 -11
  529. package/package.json +18 -11
  530. package/dist/src/channel/emitter-registry.d.ts +0 -34
  531. package/dist/src/channel/emitter-registry.d.ts.map +0 -1
  532. package/dist/src/channel/emitter-registry.js +0 -63
  533. package/dist/src/channel/emitter-registry.js.map +0 -1
  534. package/dist/src/channel/http-emitter.d.ts +0 -16
  535. package/dist/src/channel/http-emitter.d.ts.map +0 -1
  536. package/dist/src/channel/http-emitter.js +0 -22
  537. package/dist/src/channel/http-emitter.js.map +0 -1
  538. package/dist/src/channel/schedule-emitter.d.ts +0 -15
  539. package/dist/src/channel/schedule-emitter.d.ts.map +0 -1
  540. package/dist/src/channel/schedule-emitter.js +0 -21
  541. package/dist/src/channel/schedule-emitter.js.map +0 -1
  542. package/dist/src/channel/slack-emitter.d.ts +0 -56
  543. package/dist/src/channel/slack-emitter.d.ts.map +0 -1
  544. package/dist/src/channel/slack-emitter.js +0 -235
  545. package/dist/src/channel/slack-emitter.js.map +0 -1
  546. package/dist/src/channel/subagent-emitter.d.ts +0 -41
  547. package/dist/src/channel/subagent-emitter.d.ts.map +0 -1
  548. package/dist/src/channel/subagent-emitter.js.map +0 -1
  549. package/dist/src/context/state.d.ts +0 -27
  550. package/dist/src/context/state.d.ts.map +0 -1
  551. package/dist/src/context/state.js +0 -53
  552. package/dist/src/context/state.js.map +0 -1
  553. package/dist/src/internal/message/nitro-route-shims.d.ts +0 -6
  554. package/dist/src/internal/message/nitro-route-shims.d.ts.map +0 -1
  555. package/dist/src/internal/message/nitro-route-shims.js +0 -38
  556. package/dist/src/internal/message/nitro-route-shims.js.map +0 -1
  557. package/dist/src/internal/message/rewrite-generated-imports.d.ts +0 -15
  558. package/dist/src/internal/message/rewrite-generated-imports.d.ts.map +0 -1
  559. package/dist/src/internal/message/rewrite-generated-imports.js +0 -59
  560. package/dist/src/internal/message/rewrite-generated-imports.js.map +0 -1
  561. package/dist/src/internal/nitro/host/channel-url-matcher.d.ts +0 -35
  562. package/dist/src/internal/nitro/host/channel-url-matcher.d.ts.map +0 -1
  563. package/dist/src/internal/nitro/host/channel-url-matcher.js +0 -57
  564. package/dist/src/internal/nitro/host/channel-url-matcher.js.map +0 -1
  565. package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.d.ts +0 -11
  566. package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.d.ts.map +0 -1
  567. package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.js +0 -264
  568. package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.js.map +0 -1
  569. package/dist/src/internal/nitro/routes/home-page/render-home-page.d.ts +0 -9
  570. package/dist/src/internal/nitro/routes/home-page/render-home-page.d.ts.map +0 -1
  571. package/dist/src/internal/nitro/routes/home-page/render-home-page.js +0 -15
  572. package/dist/src/internal/nitro/routes/home-page/render-home-page.js.map +0 -1
  573. package/dist/src/internal/nitro/routes/index.html +0 -525
  574. package/dist/src/internal/nitro/runtime-configuration.d.ts +0 -16
  575. package/dist/src/internal/nitro/runtime-configuration.d.ts.map +0 -1
  576. package/dist/src/internal/nitro/runtime-configuration.js +0 -23
  577. package/dist/src/internal/nitro/runtime-configuration.js.map +0 -1
  578. package/dist/src/internal/nitro/shims/runtime-configuration-plugin.d.ts +0 -10
  579. package/dist/src/internal/nitro/shims/runtime-configuration-plugin.d.ts.map +0 -1
  580. package/dist/src/internal/nitro/shims/runtime-configuration-plugin.js +0 -17
  581. package/dist/src/internal/nitro/shims/runtime-configuration-plugin.js.map +0 -1
  582. package/dist/src/runtime/tools/execute-tool.d.ts +0 -20
  583. package/dist/src/runtime/tools/execute-tool.d.ts.map +0 -1
  584. package/dist/src/runtime/tools/execute-tool.js +0 -69
  585. package/dist/src/runtime/tools/execute-tool.js.map +0 -1
@@ -1,14 +1,14 @@
1
1
  import type { RuntimeSkillSource } from "../../runtime/skills/source.js";
2
2
  /**
3
- * Enriches the base system prompt with a stable "Available skills" menu.
3
+ * Formats the "Available skills" system prompt section.
4
4
  *
5
5
  * All skills are always listed regardless of activation state. Active skill
6
6
  * instructions are never injected into the system prompt — the model already
7
- * has them from the `activate_skill` tool result. This keeps the system
7
+ * has them from the `load_skill` tool result. This keeps the system
8
8
  * prompt identical across the entire session, preserving prompt caching.
9
+ *
10
+ * Called at graph resolution time so the section is part of the turn
11
+ * agent's static instructions rather than injected per-step.
9
12
  */
10
- export declare function enrichInstructionsWithSkills(config: {
11
- readonly baseSystem: string;
12
- readonly skills: readonly RuntimeSkillSource[];
13
- }): string;
13
+ export declare function formatAvailableSkillsSection(skills: readonly RuntimeSkillSource[]): string | null;
14
14
  //# sourceMappingURL=instructions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../../src/execution/skills/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAChD,GAAG,MAAM,CAYT"}
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../../src/execution/skills/instructions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAAG,IAAI,CAejG"}
@@ -1,34 +1,34 @@
1
+ import { posix as pathPosix } from "node:path";
2
+ import { WORKSPACE_ROOT } from "../../runtime/workspace/types.js";
1
3
  /**
2
- * Enriches the base system prompt with a stable "Available skills" menu.
4
+ * Formats the "Available skills" system prompt section.
3
5
  *
4
6
  * All skills are always listed regardless of activation state. Active skill
5
7
  * instructions are never injected into the system prompt — the model already
6
- * has them from the `activate_skill` tool result. This keeps the system
8
+ * has them from the `load_skill` tool result. This keeps the system
7
9
  * prompt identical across the entire session, preserving prompt caching.
10
+ *
11
+ * Called at graph resolution time so the section is part of the turn
12
+ * agent's static instructions rather than injected per-step.
8
13
  */
9
- export function enrichInstructionsWithSkills(config) {
10
- if (config.skills.length === 0) {
11
- return config.baseSystem;
12
- }
13
- const menu = formatAvailableSkillsSection(config.skills);
14
- if (menu === null) {
15
- return config.baseSystem;
16
- }
17
- return `${config.baseSystem}\n\n${menu}`;
18
- }
19
- function formatAvailableSkillsSection(skills) {
14
+ export function formatAvailableSkillsSection(skills) {
20
15
  if (skills.length === 0) {
21
16
  return null;
22
17
  }
23
18
  const lines = [
24
19
  "Available skills",
25
- "Use the activate_skill tool to load a skill by name or id before following its full instructions.",
26
20
  "Listed skills are available in this run. Do not claim a listed skill is inaccessible unless activation or workspace inspection actually fails.",
21
+ "If the user names a skill or the request clearly matches one of the descriptions below, call load_skill before proceeding.",
22
+ "If multiple skills match, activate the minimal set that covers the task. After activation, follow the returned instructions instead of improvising around them.",
23
+ "If activation fails, say so briefly and continue with the best fallback. Packaged sibling files under a skill path can be inspected with bash or read_file when needed.",
27
24
  ...skills.map((skill) => formatAvailableSkillLine(skill)),
28
25
  ];
29
26
  return lines.join("\n");
30
27
  }
31
28
  function formatAvailableSkillLine(skill) {
32
- return `- ${skill.name}: ${skill.description}`;
29
+ return `- ${skill.name}: ${skill.description} (path: ${formatSkillWorkspacePath(skill.logicalPath)})`;
30
+ }
31
+ function formatSkillWorkspacePath(logicalPath) {
32
+ return pathPosix.join(WORKSPACE_ROOT, logicalPath);
33
33
  }
34
34
  //# sourceMappingURL=instructions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../../../src/execution/skills/instructions.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAG5C;IACC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,MAAM,IAAI,GAAG,4BAA4B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEzD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,OAAO,GAAG,MAAM,CAAC,UAAU,OAAO,IAAI,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,4BAA4B,CAAC,MAAqC;IACzE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG;QACZ,kBAAkB;QAClB,mGAAmG;QACnG,gJAAgJ;QAChJ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;KAC1D,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAyB;IACzD,OAAO,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;AACjD,CAAC"}
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../../../src/execution/skills/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAqC;IAChF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG;QACZ,kBAAkB;QAClB,gJAAgJ;QAChJ,4HAA4H;QAC5H,iKAAiK;QACjK,yKAAyK;QACzK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;KAC1D,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAyB;IACzD,OAAO,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,WAAW,WAAW,wBAAwB,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;AACxG,CAAC;AAED,SAAS,wBAAwB,CAAC,WAAmB;IACnD,OAAO,SAAS,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AACrD,CAAC"}
@@ -45,9 +45,9 @@ export interface SkillHandle {
45
45
  semanticText(): Promise<string>;
46
46
  }
47
47
  /**
48
- * Result of attempting to activate a skill.
48
+ * Result of attempting to load a skill through the framework tool.
49
49
  */
50
- export type ActivateSkillResult = {
50
+ export type LoadSkillResult = {
51
51
  readonly activated: true;
52
52
  readonly description: string;
53
53
  readonly instructions: string;
@@ -61,14 +61,14 @@ export type ActivateSkillResult = {
61
61
  * Mutable skill access layer for one step execution.
62
62
  *
63
63
  * Created by {@link createSkillAccess} and placed on the
64
- * {@link AshContext} (via `SkillKey`) so the `activate_skill` tool executor
64
+ * {@link AshContext} (via `SkillKey`) so the `load_skill` tool executor
65
65
  * can read the available skills and record activations.
66
66
  */
67
67
  export interface SkillAccess {
68
68
  /**
69
69
  * Activates a skill by name or id. Returns the activation outcome.
70
70
  */
71
- activate(identifier: string): ActivateSkillResult;
71
+ activate(identifier: string): LoadSkillResult;
72
72
  /**
73
73
  * Returns all active skill IDs including any activated during this step.
74
74
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/execution/skills/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,GAAG,eAAe,CAAC;IAE7D;;;OAGG;IACH,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC;IAE3C;;;OAGG;IACH,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC;IAE5C;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE,QAAQ,C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{ AshContext } from "../context/container.js";
3
+ import type { HarnessSession, StepInput, StepResult } from "../harness/types.js";
4
+ export interface StepDeliveryInput {
5
+ readonly auth?: SessionAuthContext | null;
6
+ readonly payload: DeliverPayload;
7
+ }
8
+ export interface PreparedStepContext {
9
+ readonly channel: Channel;
10
+ readonly channelStateSnapshot: Record<string, unknown>;
11
+ readonly ctx: AshContext;
12
+ readonly input: StepInput | undefined;
13
+ }
14
+ export declare function prepareStepContext(input: {
15
+ readonly delivery?: StepDeliveryInput;
16
+ readonly serializedRuntimeContext: Record<string, unknown>;
17
+ readonly session: HarnessSession;
18
+ }): Promise<PreparedStepContext>;
19
+ /**
20
+ * Runs one step inside the provider lifecycle and asserts that the
21
+ * channel's serialized state was not mutated during execution.
22
+ *
23
+ * Combines {@link runStep} with a post-step channel stability check so
24
+ * callers do not need to repeat the three-call sequence themselves.
25
+ */
26
+ export declare function runStepWithChannelGuard(prepared: PreparedStepContext, session: HarnessSession, callback: (session: HarnessSession) => Promise<StepResult>): Promise<StepResult>;
27
+ //# sourceMappingURL=step-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-context.d.ts","sourceRoot":"","sources":["../../../src/execution/step-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM1D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvD,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3D,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA0B/B;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,UAAU,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,CAQrB"}
@@ -0,0 +1,54 @@
1
+ import { isDeepStrictEqual } from "node:util";
2
+ import { hydrateDurableContext } from "../context/durable-context.js";
3
+ import { AuthKey, ChannelKey } from "../context/keys.js";
4
+ import { runStep } from "../context/run-step.js";
5
+ import { deserializeRuntimeContext } from "../context/serialize.js";
6
+ import { seedPendingInputRequestsContext } from "../harness/input-requests.js";
7
+ export async function prepareStepContext(input) {
8
+ const ctx = await deserializeRuntimeContext(input.serializedRuntimeContext);
9
+ await hydrateDurableContext(ctx, input.session);
10
+ seedPendingInputRequestsContext(ctx, input.session);
11
+ if (input.delivery?.auth !== undefined) {
12
+ ctx.set(AuthKey, input.delivery.auth ?? null);
13
+ }
14
+ const channel = ctx.get(ChannelKey);
15
+ const channelStateSnapshot = channel.serialize();
16
+ const resolved = input.delivery !== undefined ? await channel.onDeliver(ctx, input.delivery.payload) : undefined;
17
+ assertChannelStateIsStable({
18
+ channel,
19
+ phase: "onDeliver",
20
+ serializedState: channelStateSnapshot,
21
+ });
22
+ return {
23
+ channel,
24
+ channelStateSnapshot,
25
+ ctx,
26
+ input: resolved,
27
+ };
28
+ }
29
+ /**
30
+ * Runs one step inside the provider lifecycle and asserts that the
31
+ * channel's serialized state was not mutated during execution.
32
+ *
33
+ * Combines {@link runStep} with a post-step channel stability check so
34
+ * callers do not need to repeat the three-call sequence themselves.
35
+ */
36
+ export async function runStepWithChannelGuard(prepared, session, callback) {
37
+ const stepResult = await runStep(prepared.ctx, session, callback);
38
+ assertChannelStateIsStable({
39
+ channel: prepared.channel,
40
+ phase: "step execution",
41
+ serializedState: prepared.channelStateSnapshot,
42
+ });
43
+ return stepResult;
44
+ }
45
+ function assertChannelStateIsStable(input) {
46
+ const currentState = input.channel.serialize();
47
+ if (isDeepStrictEqual(currentState, input.serializedState)) {
48
+ return;
49
+ }
50
+ throw new Error(`Channel "${input.channel.kind}" mutated its serialized state during ${input.phase}. ` +
51
+ "Channel constructor state must stay immutable after the run starts. " +
52
+ "Move per-session mutable data into durable context or session.internal instead.");
53
+ }
54
+ //# sourceMappingURL=step-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-context.js","sourceRoot":"","sources":["../../../src/execution/step-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAe/E,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAIxC;IACC,MAAM,GAAG,GAAG,MAAM,yBAAyB,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5E,MAAM,qBAAqB,CAAC,GAAG,EAAE,KA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E,CAAC;IAC/C,IAAI,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3D,OAAO;IACT,CAAC;IAED,MAAM,IAAI,KAAK,CACb,YAAY,KAAK,CAAC,OAAO,CAAC,IAAI,yCAAyC,KAAK,CAAC,KAAK,IAAI;QACpF,sEAAsE;QACtE,iFAAiF,CACpF,CAAC;AACJ,CAAC"}
@@ -16,7 +16,7 @@ export interface CreateSubagentToolExecutorInput {
16
16
  * Parent harness emit function. Used to bracket the child run with
17
17
  * `subagent.started` / `subagent.completed` lifecycle events and to
18
18
  * forward each pre-wrapped `subagent.event` envelope produced by the
19
- * child's {@link SubagentChannelEmitter}.
19
+ * child's {@link SubagentChannel}.
20
20
  */
21
21
  readonly parentEmit: HarnessEmitFn;
22
22
  readonly subagentTool: PreparedRuntimeSubagentTool;
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-tool.d.ts","sourceRoot":"","sources":["../../../src/execution/subagent-tool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA8BpD;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,GACrC,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAiErC"}
1
+ {"version":3,"file":"subagent-tool.d.ts","sourceRoot":"","sources":["../../../src/execution/subagent-tool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA8BpD;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,GACrC,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAgErC"}
@@ -1,4 +1,4 @@
1
- import { SubagentChannelEmitter } from "../channel/subagent-emitter.js";
1
+ import { SubagentChannel } from "../channel/subagent-channel.js";
2
2
  import { requireContext } from "../context/container.js";
3
3
  import { AuthKey, BundleKey, InitiatorAuthKey, SessionKey } from "../context/keys.js";
4
4
  import { mintSubagentContinuationToken } from "./session.js";
@@ -7,7 +7,7 @@ import { formatSubagentInvocation } from "./subagent-invocation.js";
7
7
  * Drains every event from the child's run handle and forwards it
8
8
  * verbatim to the parent's emit function.
9
9
  *
10
- * The child's {@link SubagentChannelEmitter} has already wrapped every
10
+ * The child's {@link SubagentChannel} has already wrapped every
11
11
  * event in a `subagent.event` envelope tagged with the child's call id
12
12
  * and subagent name, so this pump has no envelope-construction logic —
13
13
  * it is a literal forwarder.
@@ -59,7 +59,7 @@ export function createSubagentToolExecutor(input) {
59
59
  }).message ?? "";
60
60
  const handle = await childRuntime.run({
61
61
  auth: parentAuth,
62
- channelEmitter: new SubagentChannelEmitter({
62
+ channel: new SubagentChannel({
63
63
  callId,
64
64
  subagentName: subagentTool.name,
65
65
  }),
@@ -70,7 +70,6 @@ export function createSubagentToolExecutor(input) {
70
70
  },
71
71
  mode: "task",
72
72
  parent: {
73
- runId: parentSession.runId,
74
73
  sessionId: parentSession.sessionId,
75
74
  turn: parentSession.turn,
76
75
  },
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-tool.js","sourceRoot":"","sources":["../../../src/execution/subagent-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKtF,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;;;;;;;GAQG;AACH,KAAK,UAAU,kBAAkB,CAAC,KAGjC;IACC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAE/C,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5C,IAAI,IAAI;gBAAE,OAAO;YACjB,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;AACH,CAAC;AAuBD;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAsC;IAEtC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE1D,OAAO,KAAK,EAAE,IAAa,EAAoB,EAAE;QAC/C,MAAM,SAAS,GAAG,cAAc,EAAE,CAAC;QACnC,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU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@ import type { ResolvedToolDefinition } from "../runtime/types.js";
9
9
  * {@link CompactionCallbackResult}:
10
10
  *
11
11
  * - `messages` from each hook are concatenated in order.
12
- * - `sessionPatch` from each hook is shallow-merged into `session.state`;
13
- * later tools overwrite earlier on key collision.
14
- * - Hooks may also mutate context directly via the {@link AshContext}
12
+ * - Hooks may mutate durable context directly via the {@link AshContext}
15
13
  * handle they receive; later hooks observe the mutation.
16
14
  * - A hook returning `void` is treated as a no-op.
17
15
  * - Hooks are isolated: if one throws, the dispatcher logs the error
@@ -1 +1 @@
1
- {"version":3,"file":"tool-compaction.d.ts","sourceRoot":"","sources":["../../../src/execution/tool-compaction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,sBAAsB,EAAE,GACvC,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAoDhE"}
1
+ {"version":3,"file":"tool-compaction.d.ts","sourceRoot":"","sources":["../../../src/execution/tool-compaction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIlE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,sBAAsB,EAAE,GACvC,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAsChE"}
@@ -1,4 +1,5 @@
1
1
  import { requireContext } from "../context/container.js";
2
+ const NEVER_ABORT_SIGNAL = new AbortController().signal;
2
3
  /**
3
4
  * Builds the harness compaction callback for a list of resolved tools.
4
5
  *
@@ -8,9 +9,7 @@ import { requireContext } from "../context/container.js";
8
9
  * {@link CompactionCallbackResult}:
9
10
  *
10
11
  * - `messages` from each hook are concatenated in order.
11
- * - `sessionPatch` from each hook is shallow-merged into `session.state`;
12
- * later tools overwrite earlier on key collision.
13
- * - Hooks may also mutate context directly via the {@link AshContext}
12
+ * - Hooks may mutate durable context directly via the {@link AshContext}
14
13
  * handle they receive; later hooks observe the mutation.
15
14
  * - A hook returning `void` is treated as a no-op.
16
15
  * - Hooks are isolated: if one throws, the dispatcher logs the error
@@ -32,38 +31,25 @@ export function createToolCompactionHandler(tools) {
32
31
  // v1 has no real cancellation plumbing through the harness yet — pass
33
32
  // a never-aborting signal so hooks can adopt the parameter without a
34
33
  // breaking change later when a real signal is threaded through.
35
- const signal = new AbortController().signal;
34
+ const signal = NEVER_ABORT_SIGNAL;
36
35
  const messages = [];
37
- let state = session.state ?? {};
38
- let mutated = false;
39
36
  for (const tool of participants) {
40
- const hook = tool.onCompact;
41
- if (hook === undefined)
42
- continue;
43
37
  let result;
44
38
  try {
45
- result = (await hook({ ctx, session, signal })) ?? {};
39
+ // biome-ignore lint/style/noNonNullAssertion: participants filtered to only include tools with onCompact
40
+ result = (await tool.onCompact({ ctx, session, signal })) ?? {};
46
41
  }
47
42
  catch (error) {
48
- // Isolate failures: a single broken hook should not block the
49
- // remaining tools. Log enough context for the author to find the
50
- // bug, then move on.
51
43
  console.warn(`[ash] Compaction hook for tool "${tool.name}" threw and was skipped:`, error);
52
44
  continue;
53
45
  }
54
- if (result === undefined)
55
- continue;
56
46
  if (result.messages !== undefined && result.messages.length > 0) {
57
47
  messages.push(...result.messages);
58
48
  }
59
- if (result.sessionPatch !== undefined) {
60
- state = { ...state, ...result.sessionPatch };
61
- mutated = true;
62
- }
63
49
  }
64
50
  return {
65
51
  messages,
66
- session: mutated ? { ...session, state } : session,
52
+ session,
67
53
  };
68
54
  };
69
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tool-compaction.js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AED,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAC7B,sEAAsE;QACtE,qEAAqE;QACrE,gEAAgE;QAChE,MAAM,MAAM,GAAG,kBAAkB,CAAC;QAElC,MAAM,QAAQ,GAAmB,EAAE,CAAC;QAEpC,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;YAChC,IAAI,MAA6E,CAAC;YAClF,IAAI,CAAC;gBACH,yGAAyG;gBACzG,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,SAAU,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACnE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,mCAAmC,IAAI,CAAC,IAAI,0BAA0B,EAAE,KAAK,CAAC,CAAC;gBAC5F,SAAS;YACX,CAAC;YAED,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChE,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ;YACR,OAAO;SACR,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { HarnessSession } from "../harness/types.js";
2
- export type { ChannelEmitter, DeliverInput, EventEmitFn, RunHandle, RunInput, RunResult, Runtime, SessionParent, SessionTurn, } from "../channel/types.js";
2
+ export type { Channel, DeliverInput, EventEmitFn, RunHandle, RunInput, RunResult, Runtime, SessionParent, SessionTurn, } from "../channel/types.js";
3
3
  /**
4
4
  * Serializable projection of a step result for workflow persistence.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,YAAY,EACV,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,aAAa,EACb,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,YAAY,EACV,OAAO,EACP,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,aAAa,EACb,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC"}
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Serializable input for the workflow entrypoint.
3
3
  *
4
- * All runtime state is carried inside `serializedContext`, which is produced
5
- * by `serializeContext(ctx)` in the workflow runtime and deserialized at
6
- * each `"use step"` boundary. The workflow body extracts values it needs
7
- * for plumbing (continuation token, mode, bundle source) directly from
8
- * the serialized record.
4
+ * Runtime seed keys are carried inside `serializedContext`, which is produced
5
+ * by `serializeRuntimeContext(ctx)` in the workflow runtime and deserialized
6
+ * at each `"use step"` boundary. Durable authored context is stored
7
+ * separately on `session.context` and rehydrated before each step.
9
8
  */
10
9
  export interface WorkflowEntryInput {
11
10
  readonly input: {
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-entry.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-entry.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAiF3F"}
1
+ {"version":3,"file":"workflow-entry.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-entry.ts"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAsF3F"}
@@ -18,14 +18,16 @@ export async function workflowEntry(input) {
18
18
  "use workflow";
19
19
  const continuationToken = input.serializedContext["ash.continuationToken"];
20
20
  const mode = input.serializedContext["ash.mode"];
21
+ const sessionId = input.serializedContext["ash.sessionId"];
21
22
  const serializedBundle = input.serializedContext["ash.bundle"];
22
23
  const session = await createSessionStep({
23
24
  compiledArtifactsSource: serializedBundle.source,
24
25
  continuationToken,
25
26
  nodeSelector: serializedBundle.nodeSelector,
27
+ sessionId,
26
28
  });
27
29
  let currentSession = session;
28
- const firstTurnResult = await runTurn(input.serializedContext, currentSession, { message: input.input.message }, mode);
30
+ const firstTurnResult = await runTurn(input.serializedContext, currentSession, { payload: { message: input.input.message } }, mode);
29
31
  currentSession = firstTurnResult.session;
30
32
  if (firstTurnResult.action === "done") {
31
33
  return { output: firstTurnResult.output ?? "" };
@@ -58,7 +60,10 @@ export async function workflowEntry(input) {
58
60
  if (ready.done) {
59
61
  break;
60
62
  }
61
- coalesced = coalesceTurnInputs(coalesced, ready.value);
63
+ coalesced = {
64
+ auth: ready.value.auth ?? coalesced.auth,
65
+ payload: coalesceTurnInputs(coalesced.payload, ready.value.payload),
66
+ };
62
67
  }
63
68
  const turnResult = await runTurn(input.serializedContext, currentSession, coalesced, mode);
64
69
  currentSession = turnResult.session;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-entry.js","sourceRoot":"","sources":["../../../src/execution/workflow-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAuBxE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAyB;IAC3D,cAAc,CAAC;IAEf,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC,uBAAuB,CAAW,CAAC;IACrF,MAAM,IAAI,GAAG,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAY,CAAC;IAC5D,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAG5D,CAAC;IAEF,MAAM,OAAO,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AC,CAAC;AAEpD,KAAK,UAAU,gBAAgB,CAAI,OAAmB;IACpD,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-runtime.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKV,OAAO,EACR,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAQ9F;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;CAElC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,QAAQ,CAAC,uBAAuB,EAAE,8BAA8B,CAAC;IACjE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,GAAG,OAAO,CAyCV"}
1
+ {"version":3,"file":"workflow-runtime.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAMV,OAAO,EACR,MAAM,qBAAqB,CAAC;AAO7B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAQ9F;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;CAElC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,QAAQ,CAAC,uBAAuB,EAAE,8BAA8B,CAAC;IACjE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,GAAG,OAAO,CA8CV"}
@@ -1,5 +1,5 @@
1
1
  import { getRun, resumeHook, start } from "workflow/api";
2
- import { serializeContext } from "../context/serialize.js";
2
+ import { assertNoDurableContextInRuntimeSeed, serializeRuntimeContext, } from "../context/serialize.js";
3
3
  import { resolveInstalledPackageInfo } from "../internal/application/package.js";
4
4
  import { getCompiledRuntimeAgentBundle } from "../runtime/sessions/compiled-agent-cache.js";
5
5
  import { buildRunContext } from "./runtime-context.js";
@@ -34,7 +34,8 @@ export function createWorkflowRuntime(config) {
34
34
  nodeSelector: config.nodeSelector,
35
35
  });
36
36
  const ctx = buildRunContext({ bundle, run: input });
37
- const serializedContext = serializeContext(ctx);
37
+ assertNoDurableContextInRuntimeSeed(ctx);
38
+ const serializedContext = serializeRuntimeContext(ctx);
38
39
  const run = await start(workflowEntryReference, [
39
40
  {
40
41
  input: input.input,
@@ -53,10 +54,14 @@ export function createWorkflowRuntime(config) {
53
54
  };
54
55
  },
55
56
  async deliver(input) {
56
- await resumeHook(input.continuationToken, input.payload);
57
+ const hookPayload = {
58
+ auth: input.auth,
59
+ payload: input.payload,
60
+ };
61
+ await resumeHook(input.continuationToken, hookPayload);
57
62
  },
58
- async getEventStream(runId, options) {
59
- return parseNdjsonStream(getRun(runId).getReadable({ startIndex: options?.startIndex }));
63
+ async getEventStream(sessionId, options) {
64
+ return parseNdjsonStream(getRun(sessionId).getReadable({ startIndex: options?.startIndex }));
60
65
  },
61
66
  };
62
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-runtime.js","sourceRoot":"","sources":["../../../src/execution/workflow-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AASzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAGjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAC5C,MAAM,gBAAgB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,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;wBAExC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;4BACpB,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAA6B,CAAC,CAAC;wBACnE,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC;oBAAS,CAAC;gBACT,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,17 +1,23 @@
1
- import type { HarnessSession, StepInput } from "../harness/types.js";
1
+ import type { HookPayload } from "../channel/types.js";
2
+ import { type HarnessSession } from "../harness/types.js";
2
3
  import type { RuntimeCompiledArtifactsSource } from "../runtime/compiled-artifacts-source.js";
3
4
  import type { DurableStepResult } from "./types.js";
4
5
  /**
5
6
  * Runs one atomic harness step inside a durable `"use step"` boundary.
6
7
  *
7
8
  * Receives a serialized context (plain JSON) and deserializes it at the
8
- * top of the step so all seed keys (channel emitter, bundle, etc.) are
9
- * live instances. The deserialized bundle is already resolved to the
10
- * correct node (root or subagent) via the BundleKey codec.
9
+ * top of the step so all seed keys (channel, bundle, etc.) are live
10
+ * instances. The deserialized bundle is already resolved to the correct
11
+ * node (root or subagent) via the BundleKey codec.
12
+ *
13
+ * When `input` is defined, the delivery goes through the channel's
14
+ * {@link Channel.onDeliver} and the runtime's pending-input resolution
15
+ * before the harness sees it. Deliver-time auth from the
16
+ * {@link HookPayload} is applied to the context before the step runs.
11
17
  */
12
- export declare function durableRunStep(serializedContext: Record<string, unknown>, session: HarnessSession, input: StepInput | undefined): Promise<DurableStepResult>;
18
+ export declare function durableRunStep(serializedContext: Record<string, unknown>, session: HarnessSession, input: HookPayload | undefined): Promise<DurableStepResult>;
13
19
  /**
14
- * Creates the durable session state inside a step boundary before the
20
+ * Creates the durable harness session inside a step boundary before the
15
21
  * workflow enters its long-lived turn loop.
16
22
  *
17
23
  * The optional `nodeSelector` targets a specific node in the compiled
@@ -22,5 +28,6 @@ export declare function createSessionStep(input: {
22
28
  readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
23
29
  readonly continuationToken: string;
24
30
  readonly nodeSelector?: string;
31
+ readonly sessionId: string;
25
32
  }): Promise<HarnessSession>;
26
33
  //# sourceMappingURL=workflow-steps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-steps.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-steps.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAI9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,SAAS,GAAG,SAAS,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAoD5B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,uBAAuB,EAAE,8BAA8B,CAAC;IACjE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,GAAG,OAAO,CAAC,cAAc,CAAC,CAe1B"}
1
+ {"version":3,"file":"workflow-steps.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-steps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,KAAK,cA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