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
@@ -0,0 +1,43 @@
1
+ import { RuntimeContextKey } from "../../context/key.js";
2
+ import type { ConnectionRegistry, ConnectionToolMetadata } from "../connections/types.js";
3
+ import type { ResolvedToolDefinition } from "../types.js";
4
+ /**
5
+ * Context key for the per-session connection registry.
6
+ *
7
+ * Created as a derived key (no codec) because the registry holds live
8
+ * client instances that cannot be serialized across step boundaries.
9
+ * The `connectionProvider` reconstructs it each step.
10
+ */
11
+ export declare const ConnectionRegistryKey: RuntimeContextKey<ConnectionRegistry>;
12
+ interface ConnectionSearchInput {
13
+ readonly connection?: string;
14
+ readonly keywords: string;
15
+ readonly limit?: number;
16
+ }
17
+ interface ConnectionSearchResultItem {
18
+ readonly connection: string;
19
+ readonly description: string;
20
+ readonly error?: string;
21
+ readonly inputSchema?: Record<string, unknown>;
22
+ readonly tool?: string;
23
+ }
24
+ /**
25
+ * Framework-provided `connection_search` tool.
26
+ *
27
+ * Searches for tools across all connections by matching a
28
+ * natural-language query against tool names and descriptions.
29
+ *
30
+ * When a connection's server is unreachable, or when no tools match
31
+ * the query, the result still includes the connection name and
32
+ * description so the model knows the connection exists.
33
+ *
34
+ * The `description` field is dynamically composed at registration time
35
+ * in `resolve-agent-graph.ts` to include the list of available
36
+ * connections.
37
+ */
38
+ export declare const CONNECTION_SEARCH_TOOL_DEFINITION: ResolvedToolDefinition;
39
+ export declare function executeConnectionSearch(input: ConnectionSearchInput): Promise<ConnectionSearchResultItem[]>;
40
+ export declare function tokenize(text: string): string[];
41
+ export declare function scoreMatch(queryTokens: string[], tool: ConnectionToolMetadata): number;
42
+ export {};
43
+ //# sourceMappingURL=connection-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-search.d.ts","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/connection-search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,uCAEjC,CAAC;AAEF,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,0BAA0B;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iCAAiC,EAAE,sBA2B/C,CAAC;AAEF,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAiEvC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAK/C;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,sBAAsB,GAAG,MAAM,CAmBtF"}
@@ -0,0 +1,135 @@
1
+ import { requireContext } from "../../context/container.js";
2
+ import { RuntimeContextKey } from "../../context/key.js";
3
+ /**
4
+ * Context key for the per-session connection registry.
5
+ *
6
+ * Created as a derived key (no codec) because the registry holds live
7
+ * client instances that cannot be serialized across step boundaries.
8
+ * The `connectionProvider` reconstructs it each step.
9
+ */
10
+ export const ConnectionRegistryKey = new RuntimeContextKey("ash.connectionRegistry");
11
+ /**
12
+ * Framework-provided `connection_search` tool.
13
+ *
14
+ * Searches for tools across all connections by matching a
15
+ * natural-language query against tool names and descriptions.
16
+ *
17
+ * When a connection's server is unreachable, or when no tools match
18
+ * the query, the result still includes the connection name and
19
+ * description so the model knows the connection exists.
20
+ *
21
+ * The `description` field is dynamically composed at registration time
22
+ * in `resolve-agent-graph.ts` to include the list of available
23
+ * connections.
24
+ */
25
+ export const CONNECTION_SEARCH_TOOL_DEFINITION = {
26
+ description: "Search for tools across your connections.",
27
+ execute: async (input) => executeConnectionSearch(input),
28
+ inputSchema: {
29
+ additionalProperties: false,
30
+ properties: {
31
+ connection: {
32
+ description: "Optional: limit search to a specific connection name.",
33
+ type: "string",
34
+ },
35
+ limit: {
36
+ description: "Max results to return. Default 10.",
37
+ type: "number",
38
+ },
39
+ keywords: {
40
+ description: "Search keywords and expanded aliases. Distill intent into keywords; avoid stop words like 'a', 'the', 'in'.",
41
+ type: "string",
42
+ },
43
+ },
44
+ required: ["keywords"],
45
+ type: "object",
46
+ },
47
+ logicalPath: "ash:framework/connection-search",
48
+ name: "connection_search",
49
+ sourceId: "ash:connection-search-tool",
50
+ sourceKind: "module",
51
+ };
52
+ export async function executeConnectionSearch(input) {
53
+ const registry = requireContext().tryGet(ConnectionRegistryKey);
54
+ if (registry === undefined) {
55
+ return [];
56
+ }
57
+ const limit = input.limit ?? 10;
58
+ const queryTokens = tokenize(input.keywords);
59
+ const results = [];
60
+ const failedConnections = [];
61
+ const targetConnections = input.connection !== undefined && input.connection !== ""
62
+ ? registry.getConnections().filter((c) => c.connectionName === input.connection)
63
+ : registry.getConnections();
64
+ for (const conn of targetConnections) {
65
+ let tools;
66
+ try {
67
+ const client = registry.getClient(conn.connectionName);
68
+ tools = await client.getToolMetadata();
69
+ }
70
+ catch (err) {
71
+ failedConnections.push({
72
+ connection: conn.connectionName,
73
+ description: conn.description,
74
+ error: `Could not reach ${conn.connectionName} server: ${err instanceof Error ? err.message : "unknown error"}`,
75
+ });
76
+ continue;
77
+ }
78
+ for (const tool of tools) {
79
+ const score = scoreMatch(queryTokens, tool);
80
+ if (score > 0) {
81
+ results.push({
82
+ item: {
83
+ connection: conn.connectionName,
84
+ description: tool.description,
85
+ inputSchema: tool.inputSchema,
86
+ tool: tool.name,
87
+ },
88
+ score,
89
+ });
90
+ }
91
+ }
92
+ }
93
+ results.sort((a, b) => b.score - a.score);
94
+ const matched = results.slice(0, limit).map((r) => r.item);
95
+ if (matched.length > 0) {
96
+ return [...matched, ...failedConnections];
97
+ }
98
+ // No keyword matches — return connection summaries so the model
99
+ // knows which connections exist even when the query is vague.
100
+ const summaries = targetConnections.map((c) => {
101
+ const failed = failedConnections.find((f) => f.connection === c.connectionName);
102
+ if (failed)
103
+ return failed;
104
+ return {
105
+ connection: c.connectionName,
106
+ description: c.description,
107
+ };
108
+ });
109
+ return summaries;
110
+ }
111
+ export function tokenize(text) {
112
+ return text
113
+ .toLowerCase()
114
+ .split(/[\s_\-./]+/)
115
+ .filter((t) => t.length > 1);
116
+ }
117
+ export function scoreMatch(queryTokens, tool) {
118
+ const nameTokens = tokenize(tool.name);
119
+ const descTokens = tokenize(tool.description);
120
+ let score = 0;
121
+ for (const qt of queryTokens) {
122
+ for (const nt of nameTokens) {
123
+ if (nt.includes(qt) || qt.includes(nt)) {
124
+ score += 3;
125
+ }
126
+ }
127
+ for (const dt of descTokens) {
128
+ if (dt.includes(qt) || qt.includes(dt)) {
129
+ score += 1;
130
+ }
131
+ }
132
+ }
133
+ return score;
134
+ }
135
+ //# sourceMappingURL=connection-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-search.js","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/connection-search.ts"],"names":[],"mappings":"AAAA,OA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IACvC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC;QAC7B,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;YAC5B,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;gBACvC,KAAK,IAAI,CAAC,CAAC;YACb,CAAC;QACH,CAAC;QACD,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;YAC5B,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;gBACvC,KAAK,IAAI,CAAC,CAAC;YACb,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -11,14 +11,14 @@ export interface ReadFileStamp {
11
11
  readonly sandboxName: string;
12
12
  }
13
13
  /**
14
- * Durable session state holding read-file stamps keyed by
14
+ * Durable session context holding read-file stamps keyed by
15
15
  * `${sandboxName}:${normalizedPath}`.
16
16
  */
17
17
  export interface ReadFileState {
18
18
  readonly byTarget: Readonly<Record<string, ReadFileStamp>>;
19
19
  }
20
20
  /**
21
- * Durable context key for read-file stamps. Hydrated from session state at
21
+ * Durable context key for read-file stamps. Hydrated from session context at
22
22
  * step start, committed back at step end. Cleared on compaction via the
23
23
  * `read_file` tool's `onCompact` hook.
24
24
  */
@@ -35,7 +35,7 @@ export declare const ReadFileStateKey: ContextKey<ReadFileState>;
35
35
  */
36
36
  export declare function normalizeModelPath(path: string): string;
37
37
  /**
38
- * Builds the durable state key used to index a read-file stamp. Combines the
38
+ * Builds the durable context key used to index a read-file stamp. Combines the
39
39
  * sandbox name with the normalized absolute path so stamps from different
40
40
  * sandboxes never collide.
41
41
  *
@@ -54,10 +54,10 @@ export declare function createReadFileStamp(input: {
54
54
  sandboxName: string;
55
55
  }): ReadFileStamp;
56
56
  /**
57
- * Persists one read-file stamp into the durable context state.
57
+ * Persists one read-file stamp into the durable context.
58
58
  *
59
59
  * Centralizes the context read-update-write so callers in `read-file-tool`
60
- * and `write-file-tool` do not duplicate the state mutation pattern.
60
+ * and `write-file-tool` do not duplicate the context mutation pattern.
61
61
  */
62
62
  export declare function setReadFileStamp(ctx: AshContext, targetKey: string, stamp: ReadFileStamp): void;
63
63
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"file-state.d.ts","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/file-state.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOlD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2BAE3B,CAAC;AAMH;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAE1F;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,OAAO,EAAE,MAAM,CAAC;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AAE,MAAM,CAAC;CACrB,GAAG,aAAa,CAQhB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAK/F;AAMD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAExD"}
@@ -2,13 +2,11 @@ import { createHash } from "node:crypto";
2
2
  import { posix } from "node:path";
3
3
  import { ContextKey } from "../../context/key.js";
4
4
  /**
5
- * Durable context key for read-file stamps. Hydrated from session state at
5
+ * Durable context key for read-file stamps. Hydrated from session context at
6
6
  * step start, committed back at step end. Cleared on compaction via the
7
7
  * `read_file` tool's `onCompact` hook.
8
8
  */
9
- export const ReadFileStateKey = new ContextKey("ash.readFile", {
10
- initial: () => ({ byTarget: {} }),
11
- });
9
+ export const ReadFileStateKey = new ContextKey("ash.readFile");
12
10
  // ---------------------------------------------------------------------------
13
11
  // Path normalization
14
12
  // ---------------------------------------------------------------------------
@@ -26,7 +24,7 @@ export function normalizeModelPath(path) {
26
24
  return posix.normalize(path);
27
25
  }
28
26
  /**
29
- * Builds the durable state key used to index a read-file stamp. Combines the
27
+ * Builds the durable context key used to index a read-file stamp. Combines the
30
28
  * sandbox name with the normalized absolute path so stamps from different
31
29
  * sandboxes never collide.
32
30
  *
@@ -54,13 +52,13 @@ export function createReadFileStamp(input) {
54
52
  };
55
53
  }
56
54
  /**
57
- * Persists one read-file stamp into the durable context state.
55
+ * Persists one read-file stamp into the durable context.
58
56
  *
59
57
  * Centralizes the context read-update-write so callers in `read-file-tool`
60
- * and `write-file-tool` do not duplicate the state mutation pattern.
58
+ * and `write-file-tool` do not duplicate the context mutation pattern.
61
59
  */
62
60
  export function setReadFileStamp(ctx, targetKey, stamp) {
63
- const state = ctx.get(ReadFileStateKey);
61
+ const state = ctx.ensure(ReadFileStateKey, () => ({ byTarget: {} }));
64
62
  ctx.set(ReadFileStateKey, {
65
63
  byTarget: { ...state.byTarget, [targetKey]: stamp },
66
64
  });
@@ -1 +1 @@
1
- {"version":3,"file":"file-state.js","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/file-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AA0BlD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,UAAU,CAAgB,cAAc,EAAE;IAC5E,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;CAClC,CAAC,CAAC;AAEH,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,WAAmB,EAAE,cAAsB;IAChF,OAAO,GAAG,WAAW,IAAI,cAAc,EAAE,CAAC;AAC5C,CAAC;AAED,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAInC;IACC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9E,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;QACpD,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC;AACJ,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,CAAC,KAInC;IACC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9E,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;QACpD,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAe,EAAE,SAAiB,EAAE,KAAoB;IACvF,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACrE,GAAG,CAAC,GAAG,CAAC,gBAAgB,EAAE;QACxB,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE;KACpD,CAAC,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAe;IAChD,GAAG,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9C,CAAC"}
@@ -1,3 +1,4 @@
1
+ export { ConnectionRegistryKey } from "./connection-search.js";
1
2
  export type { ReadFileStamp, ReadFileState } from "./file-state.js";
2
3
  export { ReadFileStateKey } from "./file-state.js";
3
4
  export type { SkillToolState } from "./skill.js";
@@ -10,9 +11,10 @@ import type { ResolvedToolDefinition } from "../types.js";
10
11
  * alongside authored tools during graph resolution.
11
12
  *
12
13
  * The set of tools varies based on the agent configuration. For example,
13
- * `activate_skill` is only included when the agent has skills.
14
+ * `load_skill` is only included when the agent has skills.
14
15
  */
15
16
  export declare function getFrameworkToolDefinitions(config: {
17
+ readonly hasConnections: boolean;
16
18
  readonly hasSkills: boolean;
17
19
  readonly isRoot: boolean;
18
20
  }): readonly ResolvedToolDefinition[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/index.ts"],"names":[],"mappings":"AAWA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAClD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,GAAG,SAAS,sBAAsB,EAAE,CAsBpC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,WAAW,CAAC,MAAM,CAAC,CAa9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAClD,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,GAAG,SAAS,sBAAsB,EAAE,CA2BpC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,WAAW,CAAC,MAAM,CAAC,CAe9D"}
@@ -1,5 +1,7 @@
1
1
  import { ASK_QUESTION_TOOL_DEFINITION } from "./ask-question.js";
2
2
  import { BASH_TOOL_DEFINITION } from "./bash.js";
3
+ import { CONNECTION_EXECUTE_TOOL_DEFINITION } from "./connection-execute.js";
4
+ import { CONNECTION_SEARCH_TOOL_DEFINITION } from "./connection-search.js";
3
5
  import { GLOB_TOOL_DEFINITION } from "./glob.js";
4
6
  import { GREP_TOOL_DEFINITION } from "./grep.js";
5
7
  import { READ_FILE_TOOL_DEFINITION } from "./read-file.js";
@@ -8,6 +10,7 @@ import { TODO_TOOL_DEFINITION } from "./todo.js";
8
10
  import { WEB_FETCH_TOOL_DEFINITION } from "./web-fetch.js";
9
11
  import { WEB_SEARCH_TOOL_DEFINITION } from "./web-search.js";
10
12
  import { WRITE_FILE_TOOL_DEFINITION } from "./write-file.js";
13
+ export { ConnectionRegistryKey } from "./connection-search.js";
11
14
  export { ReadFileStateKey } from "./file-state.js";
12
15
  export { SkillStateKey } from "./skill.js";
13
16
  export { TodoStateKey } from "./todo.js";
@@ -16,7 +19,7 @@ export { TodoStateKey } from "./todo.js";
16
19
  * alongside authored tools during graph resolution.
17
20
  *
18
21
  * The set of tools varies based on the agent configuration. For example,
19
- * `activate_skill` is only included when the agent has skills.
22
+ * `load_skill` is only included when the agent has skills.
20
23
  */
21
24
  export function getFrameworkToolDefinitions(config) {
22
25
  const definitions = [
@@ -36,6 +39,10 @@ export function getFrameworkToolDefinitions(config) {
36
39
  if (config.hasSkills) {
37
40
  definitions.push(SKILL_TOOL_DEFINITION);
38
41
  }
42
+ if (config.hasConnections) {
43
+ definitions.push(CONNECTION_SEARCH_TOOL_DEFINITION);
44
+ definitions.push(CONNECTION_EXECUTE_TOOL_DEFINITION);
45
+ }
39
46
  return definitions;
40
47
  }
41
48
  /**
@@ -50,6 +57,8 @@ export function getAllFrameworkToolNames() {
50
57
  return new Set([
51
58
  ASK_QUESTION_TOOL_DEFINITION.name,
52
59
  BASH_TOOL_DEFINITION.name,
60
+ CONNECTION_EXECUTE_TOOL_DEFINITION.name,
61
+ CONNECTION_SEARCH_TOOL_DEFINITION.name,
53
62
  GLOB_TOOL_DEFINITION.name,
54
63
  GREP_TOOL_DEFINITION.name,
55
64
  READ_FILE_TOOL_DEFINITION.name,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAA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AAW,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QACpD,WAAW,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,IAAI,GAAG,CAAC;QACb,4BAA4B,CAAC,IAAI;QACjC,oBAAoB,CAAC,IAAI;QACzB,kCAAkC,CAAC,IAAI;QACvC,iCAAiC,CAAC,IAAI;QACtC,oBAAoB,CAAC,IAAI;QACzB,oBAAoB,CAAC,IAAI;QACzB,yBAAyB,CAAC,IAAI;QAC9B,0BAA0B,CAAC,IAAI;QAC/B,oBAAoB,CAAC,IAAI;QACzB,yBAAyB,CAAC,IAAI;QAC9B,0BAA0B,CAAC,IAAI;QAC/B,qBAAqB,CAAC,IAAI;KAC3B,CAAC,CAAC;AACL,CAAC"}
@@ -8,19 +8,19 @@ export interface SkillToolState {
8
8
  }
9
9
  export declare const SkillStateKey: ContextKey<SkillToolState>;
10
10
  /**
11
- * Typed input accepted by {@link executeActivateSkillTool}.
11
+ * Typed input accepted by {@link executeLoadSkillTool}.
12
12
  */
13
- export interface ActivateSkillInput {
13
+ export interface LoadSkillInput {
14
14
  readonly skill: string;
15
15
  }
16
16
  /**
17
- * Executes the `activate_skill` tool.
17
+ * Executes the `load_skill` tool.
18
18
  *
19
19
  * Reads the {@link SkillAccess} from the active unified context and
20
20
  * delegates to `skillAccess.activate()`. On successful activation,
21
21
  * persists the updated active skill IDs to {@link SkillStateKey} so
22
22
  * they survive workflow step boundaries and compaction.
23
23
  */
24
- export declare function executeActivateSkillTool(args: ActivateSkillInput): Promise<unknown>;
24
+ export declare function executeLoadSkillTool(args: LoadSkillInput): Promise<unknown>;
25
25
  export declare const SKILL_TOOL_DEFINITION: ResolvedToolDefinition;
26
26
  //# sourceMappingURL=skill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/skill.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAM1D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,aAAa,4BAExB,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAmBzF;AAMD,eAAO,MAAM,qBAAqB,EAAE,sBAwBnC,CAAC"}
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/skill.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAM1D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,aAAa,4BAA+C,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAmBjF;AAMD,eAAO,MAAM,qBAAqB,EAAE,sBA4BnC,CAAC"}
@@ -1,22 +1,20 @@
1
1
  import { requireContext } from "../../context/container.js";
2
2
  import { ContextKey } from "../../context/key.js";
3
3
  import { SkillKey } from "../../context/keys.js";
4
- export const SkillStateKey = new ContextKey("ash.skills", {
5
- initial: () => ({ activeIds: [] }),
6
- });
4
+ export const SkillStateKey = new ContextKey("ash.skills");
7
5
  /**
8
- * Executes the `activate_skill` tool.
6
+ * Executes the `load_skill` tool.
9
7
  *
10
8
  * Reads the {@link SkillAccess} from the active unified context and
11
9
  * delegates to `skillAccess.activate()`. On successful activation,
12
10
  * persists the updated active skill IDs to {@link SkillStateKey} so
13
11
  * they survive workflow step boundaries and compaction.
14
12
  */
15
- export async function executeActivateSkillTool(args) {
13
+ export async function executeLoadSkillTool(args) {
16
14
  const ctx = requireContext();
17
15
  const skills = ctx.tryGet(SkillKey);
18
16
  if (skills === undefined) {
19
- throw new Error("The activate_skill tool requires skill access on the runtime context. " +
17
+ throw new Error("The load_skill tool requires skill access on the runtime context. " +
20
18
  "Ensure the step is running inside a managed runtime context with skill support.");
21
19
  }
22
20
  const { skill } = args;
@@ -30,8 +28,13 @@ export async function executeActivateSkillTool(args) {
30
28
  // Tool definition
31
29
  // ---------------------------------------------------------------------------
32
30
  export const SKILL_TOOL_DEFINITION = {
33
- description: "Load the full instructions for one available skill by name or id before relying on that skill.",
34
- execute: (input) => executeActivateSkillTool(input),
31
+ description: [
32
+ "Load the full instructions for one available skill by name or id.",
33
+ "Use this tool when the request clearly matches a listed skill description or when the user explicitly asks for that skill.",
34
+ "Loading adds the skill instructions to the current turn.",
35
+ 'Choose the "skill" value from the Available skills block.',
36
+ ].join(" "),
37
+ execute: (input) => executeLoadSkillTool(input),
35
38
  inputSchema: {
36
39
  additionalProperties: false,
37
40
  properties: {
@@ -43,14 +46,14 @@ export const SKILL_TOOL_DEFINITION = {
43
46
  required: ["skill"],
44
47
  type: "object",
45
48
  },
46
- logicalPath: "ash:framework/activate-skill",
47
- name: "activate_skill",
49
+ logicalPath: "ash:framework/load-skill",
50
+ name: "load_skill",
48
51
  onCompact({ ctx }) {
49
52
  // Wipe what the tool wrote so stale skill activations don't persist
50
53
  // across the compaction boundary.
51
54
  ctx.set(SkillStateKey, { activeIds: [] });
52
55
  },
53
- sourceId: "ash:activate-skill-tool",
56
+ sourceId: "ash:load-skill-tool",
54
57
  sourceKind: "module",
55
58
  };
56
59
  //# sourceMappingURL=skill.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill.js","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAcjD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,UAAU,CAAiB,YAAY,EAAE;IACxE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;CACnC,CAAC,CAAC;AASH;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAAwB;IACrE,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAEpC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,wEAAwE;YACtE,iFAAiF,CACpF,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACvB,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,qBAAqB,GAA2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AAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACtC;AAkCD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAY7D;AAMD,eAAO,MAAM,oBAAoB,EAAE,sBAmElC,CAAC"}
@@ -1,8 +1,6 @@
1
1
  import { requireContext } from "../../context/container.js";
2
2
  import { ContextKey } from "../../context/key.js";
3
- export const TodoStateKey = new ContextKey("ash.todo", {
4
- initial: () => ({ items: [] }),
5
- });
3
+ export const TodoStateKey = new ContextKey("ash.todo");
6
4
  function formatTodoSummary(state) {
7
5
  if (state.items.length === 0)
8
6
  return undefined;
@@ -46,7 +44,7 @@ export function executeTodoTool(input) {
46
44
  ctx.set(TodoStateKey, newState);
47
45
  return formatTodoResult(newState);
48
46
  }
49
- const current = ctx.get(TodoStateKey);
47
+ const current = ctx.ensure(TodoStateKey, () => ({ items: [] }));
50
48
  return formatTodoResult(current);
51
49
  }
52
50
  // ---------------------------------------------------------------------------
@@ -1 +1 @@
1
- {"version":3,"file":"todo.js","sourceRoot":"","sources":["../../../../src/runtime/framework-tools/todo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAuBlD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,UAAU,CAAY,UAAU,EAAE;IAChE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;CAC/B,CAAC,CAAC;AAYH,SAAS,iBAAiB,CAAC,KAAgB;IACzC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACrC,MAAM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