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,66 +1,37 @@
1
- import { compileChannelRoute, matchChannelRoute } from "../host/channel-url-matcher.js";
2
1
  import { resolveNitroChannelRuntimeBundle } from "./runtime-stack.js";
3
2
  /**
4
- * Per-request Nitro handler that dispatches to one of the agent's resolved
5
- * channels. Registered N times in `configure-message-routes.ts` — once per
6
- * channel — but uses the same handler file because Nitro can't pass
7
- * channel identity into a handler module from the registration site.
3
+ * Dispatches one channel request identified by `routeKey`.
8
4
  *
9
- * On every request the handler:
10
- *
11
- * 1. Loads the resolved channel set from the compiled bundle.
12
- * 2. Walks the channels and matches the incoming `(method, url)` against
13
- * each compiled URL pattern.
14
- * 3. Builds a `ChannelContext` carrying the per-request runtime, the
15
- * `waitUntil` background task accumulator, and the extracted path
16
- * params.
17
- * 4. Calls the matched channel's `fetch` and awaits any pending
18
- * background tasks before returning the response so serverless
19
- * invocations stay alive long enough to drive `runtime.run()` to
20
- * completion.
5
+ * Each channel route is mounted as its own virtual Nitro handler with the
6
+ * route key and artifacts config baked in. Nitro's router matches the URL
7
+ * and populates `event.context.params`, so no custom URL matching is
8
+ * needed the handler looks up the channel by its `(method, urlPath)` key
9
+ * directly. When routes register background work through `ctx.waitUntil`,
10
+ * Nitro forwards that work to `event.waitUntil()` so webhook
11
+ * acknowledgements can return immediately.
21
12
  */
22
- export default async (event) => {
23
- const bundle = await resolveNitroChannelRuntimeBundle();
24
- const compiledRoutes = bundle.channels.map((channel) => compileChannelRoute(channel.method, channel.urlPath));
25
- const requestUrl = new URL(event.req.url);
26
- const match = matchChannelRoute(compiledRoutes, {
27
- method: event.req.method,
28
- urlPath: requestUrl.pathname,
29
- });
30
- if (match === null) {
31
- // The Nitro router only invokes us for routes we registered, so a
32
- // miss here means the channel set has drifted between registration
33
- // and dispatch — bail with a 404 rather than throwing.
34
- return Response.json({ error: "No matching channel for this request.", ok: false }, { status: 404 });
35
- }
36
- const matchedChannel = bundle.channels.find((channel) => channel.method.toUpperCase() === match.route.method &&
37
- channel.urlPath === match.route.urlPath);
13
+ export async function dispatchChannelRequest(event, routeKey, config) {
14
+ const bundle = await resolveNitroChannelRuntimeBundle(config);
15
+ const matchedChannel = bundle.channels.find((channel) => `${channel.method.toUpperCase()} ${channel.urlPath}` === routeKey);
38
16
  if (matchedChannel === undefined) {
39
17
  return Response.json({ error: "No matching channel for this request.", ok: false }, { status: 404 });
40
18
  }
41
- // Snapshot the H3-attached socket peer IP once per request and pass it
42
- // through to the channel via `ChannelContext.requestIp`. Channels that
43
- // need IP allowlisting call `isIpAllowed(ctx.requestIp, allowList)` from
44
- // `experimental-ash/channels/auth`.
45
19
  const requestIp = extractSocketIp(event);
46
20
  const backgroundTasks = [];
47
21
  const ctx = {
48
- // The bundle's `runtime` field is the framework's internal workflow
49
- // runtime instance — `Runtime` in `channel/types.ts`. The public
50
- // channel surface exposes it as `agent` because, conceptually, what
51
- // a channel handler talks to is "this agent" (runtime + harness)
52
- // rather than "the workflow runtime."
53
22
  agent: bundle.runtime,
54
23
  waitUntil(task) {
55
24
  backgroundTasks.push(task);
56
25
  },
57
- params: match.params,
26
+ params: event.context.params ?? {},
58
27
  requestIp,
59
28
  };
60
29
  const response = await matchedChannel.fetch(event.req, ctx);
61
- await Promise.allSettled(backgroundTasks);
30
+ if (backgroundTasks.length > 0) {
31
+ event.waitUntil(Promise.allSettled(backgroundTasks));
32
+ }
62
33
  return response;
63
- };
34
+ }
64
35
  function extractSocketIp(event) {
65
36
  const ip = event.req.ip;
66
37
  return typeof ip === "string" && ip.length > 0 ? ip : null;
@@ -1 +1 @@
1
- {"version":3,"file":"channel-dispatch.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/channel-dispatch.ts"],"names":[],"m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,IAAI,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,88 @@
1
+ import type { HomePageData } from "./load-home-page-data.js";
2
+ /**
3
+ * One summary count shown in the home-page overview.
4
+ */
5
+ export interface HomePageSummaryCount {
6
+ readonly label: string;
7
+ readonly value: number;
8
+ }
9
+ /**
10
+ * One source-backed row displayed in the home-page tables.
11
+ */
12
+ export interface HomePageSourceRow {
13
+ readonly details: string;
14
+ readonly logicalPath: string;
15
+ readonly name: string;
16
+ readonly sourceKind: string;
17
+ }
18
+ /**
19
+ * One schedule row displayed in the home-page schedule table.
20
+ */
21
+ export interface HomePageScheduleRow {
22
+ readonly cron: string;
23
+ readonly logicalPath: string;
24
+ readonly name: string;
25
+ readonly preview: string;
26
+ }
27
+ /**
28
+ * One subagent row displayed in the home-page subagent table.
29
+ */
30
+ export interface HomePageSubagentRow {
31
+ readonly details: string;
32
+ readonly kind: "Local";
33
+ readonly logicalPath: string;
34
+ readonly name: string;
35
+ }
36
+ /**
37
+ * One endpoint row displayed in the home-page endpoint table.
38
+ */
39
+ export interface HomePageEndpointRow {
40
+ readonly method: "GET" | "POST";
41
+ readonly name: string;
42
+ readonly notes: string;
43
+ readonly path: string;
44
+ }
45
+ /**
46
+ * Runtime overview section returned by the home-page JSON route.
47
+ */
48
+ export interface HomePageOverview {
49
+ readonly configMetadata: Readonly<Record<string, string>>;
50
+ readonly configSource: string;
51
+ readonly discoveryErrors: number;
52
+ readonly discoveryWarnings: number;
53
+ readonly modelId: string;
54
+ readonly subagentCount: number;
55
+ readonly systemPromptSource: string;
56
+ }
57
+ /**
58
+ * System prompt section returned by the home-page JSON route.
59
+ */
60
+ export interface HomePageSystemPrompt {
61
+ readonly logicalPath: string;
62
+ readonly markdownPreview: string;
63
+ }
64
+ /**
65
+ * Full response payload returned by Ash's home-page JSON route.
66
+ */
67
+ export interface HomePageResponse {
68
+ readonly agentId: string;
69
+ readonly endpointRows: readonly HomePageEndpointRow[];
70
+ readonly heroSummary: string;
71
+ readonly messageRequestExample: string;
72
+ readonly overview: HomePageOverview;
73
+ readonly pageDescription: string;
74
+ readonly pageTitle: string;
75
+ readonly promptLayers: readonly HomePageSourceRow[];
76
+ readonly sandboxes: readonly HomePageSourceRow[];
77
+ readonly schedules: readonly HomePageScheduleRow[];
78
+ readonly skills: readonly HomePageSourceRow[];
79
+ readonly subagents: readonly HomePageSubagentRow[];
80
+ readonly summaryCounts: readonly HomePageSummaryCount[];
81
+ readonly systemPrompt: HomePageSystemPrompt;
82
+ readonly tools: readonly HomePageSourceRow[];
83
+ }
84
+ /**
85
+ * Builds the JSON payload served to Ash's static Nitro home page.
86
+ */
87
+ export declare function buildHomePageResponse(data: HomePageData): HomePageResponse;
88
+ //# sourceMappingURL=build-home-page-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-home-page-response.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/nitro/routes/home-page/build-home-page-response.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,YAAY,EAKb,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MA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B,CAAC;IACpC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACpD,QAAQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACjD,QAAQ,CAAC,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACnD,QAAQ,CAAC,aAAa,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACxD,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC9C;AAkJD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAiE1E"}
@@ -0,0 +1,175 @@
1
+ import { ASH_HEALTH_ROUTE_PATH, ASH_HOME_ROUTE_PATH, ASH_MESSAGE_ROUTE_PATH, ASH_MESSAGE_STREAM_ROUTE_PATTERN, } from "../../../../protocol/routes.js";
2
+ function pluralize(count, noun) {
3
+ return `${count} ${noun}${count === 1 ? "" : "s"}`;
4
+ }
5
+ function truncateCopy(value, maxLength) {
6
+ if (value.length <= maxLength) {
7
+ return value;
8
+ }
9
+ return `${value.slice(0, maxLength - 3).trimEnd()}...`;
10
+ }
11
+ function findSystemPrompt(agent) {
12
+ return agent.promptLayers.find((promptLayer) => promptLayer.kind === "system");
13
+ }
14
+ function createHeroSummary(data) {
15
+ const { agent, manifest, schedules } = data;
16
+ return `Compiled inspection surface for the current runtime. Runs on ${agent.config.model.id} with ${pluralize(agent.promptLayers.length, "prompt layer")}, ${pluralize(agent.skills.length, "skill")}, ${pluralize(agent.tools.length, "tool")}, ${pluralize(agent.sandboxes.length, "sandbox")}, ${pluralize(schedules.length, "schedule")}, and ${pluralize(manifest.subagents.length, "subagent")}.`;
17
+ }
18
+ function createPageDescription(data) {
19
+ return truncateCopy(createHeroSummary(data), 155);
20
+ }
21
+ function renderPromptLayerRows(promptLayers) {
22
+ return promptLayers.map((promptLayer) => ({
23
+ details: truncateCopy(promptLayer.markdown.trim(), promptLayer.kind === "system" ? 420 : 240),
24
+ logicalPath: promptLayer.logicalPath,
25
+ name: promptLayer.name,
26
+ sourceKind: promptLayer.sourceKind === "module" ? "Module" : promptLayer.sourceKind,
27
+ }));
28
+ }
29
+ function renderSkillRows(skills) {
30
+ return skills.map((skill) => ({
31
+ details: skill.description,
32
+ logicalPath: skill.logicalPath,
33
+ name: skill.name,
34
+ sourceKind: skill.sourceKind,
35
+ }));
36
+ }
37
+ function renderToolRows(agent) {
38
+ return agent.tools.map((tool) => ({
39
+ details: tool.description,
40
+ logicalPath: tool.logicalPath,
41
+ name: tool.name,
42
+ sourceKind: tool.sourceKind === "module" ? "Module" : tool.sourceKind,
43
+ }));
44
+ }
45
+ function renderSandboxRows(sandboxes) {
46
+ return sandboxes.map((sandbox) => {
47
+ const lifecycleLabels = [
48
+ sandbox.bootstrap !== undefined ? "template bootstrap" : null,
49
+ sandbox.onSession !== undefined ? "per-session init" : null,
50
+ ].filter((label) => label !== null);
51
+ const details = lifecycleLabels.length === 0
52
+ ? "No lifecycle hooks."
53
+ : `Lifecycle: ${lifecycleLabels.join(" + ")}.`;
54
+ return {
55
+ details,
56
+ logicalPath: sandbox.logicalPath,
57
+ name: sandbox.name,
58
+ sourceKind: sandbox.sourceKind === "module" ? "Module" : sandbox.sourceKind,
59
+ };
60
+ });
61
+ }
62
+ function renderScheduleRows(schedules) {
63
+ return schedules.map((schedule) => ({
64
+ cron: schedule.cron,
65
+ logicalPath: schedule.logicalPath,
66
+ name: schedule.name,
67
+ preview: truncateCopy(schedule.markdown.trim(), 220),
68
+ }));
69
+ }
70
+ function renderSubagentRows(manifest) {
71
+ const nestedSubagentCountByNodeId = new Map();
72
+ for (const edge of manifest.subagentEdges) {
73
+ nestedSubagentCountByNodeId.set(edge.parentNodeId, (nestedSubagentCountByNodeId.get(edge.parentNodeId) ?? 0) + 1);
74
+ }
75
+ return manifest.subagents.map((subagent) => ({
76
+ details: `Local subagent package with ${pluralize(subagent.agent.tools.length, "tool")} and ${pluralize(nestedSubagentCountByNodeId.get(subagent.nodeId) ?? 0, "nested subagent")}.`,
77
+ kind: "Local",
78
+ logicalPath: subagent.logicalPath,
79
+ name: subagent.name,
80
+ }));
81
+ }
82
+ function renderEndpointRows() {
83
+ return [
84
+ {
85
+ method: "GET",
86
+ name: "Health",
87
+ notes: "Readiness JSON for the current host.",
88
+ path: ASH_HEALTH_ROUTE_PATH,
89
+ },
90
+ {
91
+ method: "GET",
92
+ name: "Home data",
93
+ notes: "Inspection JSON consumed by the static home page.",
94
+ path: ASH_HOME_ROUTE_PATH,
95
+ },
96
+ {
97
+ method: "POST",
98
+ name: "Message",
99
+ notes: "Starts or resumes a durable agent run from JSON input.",
100
+ path: ASH_MESSAGE_ROUTE_PATH,
101
+ },
102
+ {
103
+ method: "GET",
104
+ name: "Run stream",
105
+ notes: "Streams NDJSON events for one active or completed run.",
106
+ path: ASH_MESSAGE_STREAM_ROUTE_PATTERN,
107
+ },
108
+ ];
109
+ }
110
+ /**
111
+ * Builds the JSON payload served to Ash's static Nitro home page.
112
+ */
113
+ export function buildHomePageResponse(data) {
114
+ const systemPrompt = findSystemPrompt(data.agent);
115
+ const requestExample = `POST ${ASH_MESSAGE_ROUTE_PATH}
116
+ content-type: application/json
117
+
118
+ {
119
+ "message": "Tell me what you can do."
120
+ }`;
121
+ return {
122
+ agentId: data.agent.config.name,
123
+ endpointRows: renderEndpointRows(),
124
+ heroSummary: createHeroSummary(data),
125
+ messageRequestExample: requestExample,
126
+ overview: {
127
+ configMetadata: data.agent.config.metadata,
128
+ configSource: data.agent.config.source?.logicalPath ?? "Implicit defaults",
129
+ discoveryErrors: data.agent.metadata.diagnosticsSummary.errors,
130
+ discoveryWarnings: data.agent.metadata.diagnosticsSummary.warnings,
131
+ modelId: data.agent.config.model.id,
132
+ subagentCount: data.manifest.subagents.length,
133
+ systemPromptSource: systemPrompt?.logicalPath ?? "No system prompt discovered",
134
+ },
135
+ pageDescription: createPageDescription(data),
136
+ pageTitle: `${data.agent.config.name} | Ash`,
137
+ promptLayers: renderPromptLayerRows(data.agent.promptLayers),
138
+ sandboxes: renderSandboxRows(data.agent.sandboxes),
139
+ schedules: renderScheduleRows(data.schedules),
140
+ skills: renderSkillRows(data.agent.skills),
141
+ subagents: renderSubagentRows(data.manifest),
142
+ summaryCounts: [
143
+ {
144
+ label: "prompt layer",
145
+ value: data.agent.promptLayers.length,
146
+ },
147
+ {
148
+ label: "skill",
149
+ value: data.agent.skills.length,
150
+ },
151
+ {
152
+ label: "tool",
153
+ value: data.agent.tools.length,
154
+ },
155
+ {
156
+ label: "sandbox",
157
+ value: data.agent.sandboxes.length,
158
+ },
159
+ {
160
+ label: "schedule",
161
+ value: data.schedules.length,
162
+ },
163
+ {
164
+ label: "subagent",
165
+ value: data.manifest.subagents.length,
166
+ },
167
+ ],
168
+ systemPrompt: {
169
+ logicalPath: systemPrompt?.logicalPath ?? "No system prompt discovered",
170
+ markdownPreview: truncateCopy(systemPrompt?.markdown.trim() ?? "This agent does not currently define a system prompt.", 420),
171
+ },
172
+ tools: renderToolRows(data.agent),
173
+ };
174
+ }
175
+ //# sourceMappingURL=build-home-page-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-home-page-response.js","sourceRoot":"","sources":["../../../../../../src/internal/nitro/routes/home-page/build-home-page-response.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,gCAAgC,GACjC,MAAM,gCAAgC,CAAC;AAoGxC,SAAS,SAAS,CAAC,KAAa,EAAE,IAAY;IAC5C,OAAO,GAAG,KAAK,IAAI,IA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KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;aAChC;YACD;gBACE,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM;aAC/B;YACD;gBACE,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM;aACnC;YACD;gBACE,KAAK,EAAE,UAAU;gBACjB,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM;aAC7B;YACD;gBACE,KAAK,EAAE,UAAU;gBACjB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM;aACtC;SACF;QACD,YAAY,EAAE;YACZ,WAAW,EAAE,YAAY,EAAE,WAAW,IAAI,6BAA6B;YACvE,eAAe,EAAE,YAAY,CAC3B,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,uDAAuD,EACxF,GAAG,CACJ;SACF;QACD,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;KAClC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Builds the package-owned JSON response consumed by Ash's static home page.
3
+ */
4
+ export declare function handleHomePageDataRequest(input?: {
5
+ appRoot?: string;
6
+ }): Promise<Response>;
7
+ //# sourceMappingURL=home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/home.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,KAAK,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,QAAQ,CAAC,CAOnB"}
@@ -0,0 +1,22 @@
1
+ import { buildHomePageResponse } from "./home-page/build-home-page-response.js";
2
+ import { loadHomePageData, resolveHomePageCompiledArtifactsSource, } from "./home-page/load-home-page-data.js";
3
+ async function createHomePagePayload(input) {
4
+ const data = await loadHomePageData({
5
+ compiledArtifactsSource: resolveHomePageCompiledArtifactsSource({
6
+ appRoot: input.appRoot,
7
+ }),
8
+ });
9
+ return buildHomePageResponse(data);
10
+ }
11
+ /**
12
+ * Builds the package-owned JSON response consumed by Ash's static home page.
13
+ */
14
+ export async function handleHomePageDataRequest(input = {}) {
15
+ return new Response(JSON.stringify(await createHomePagePayload(input)), {
16
+ headers: {
17
+ "cache-control": "no-store",
18
+ "content-type": "application/json; charset=utf-8",
19
+ },
20
+ });
21
+ }
22
+ //# sourceMappingURL=home.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,sCAAsC,GACvC,MAAM,oCAAoC,CAAC;AAE5C,KAAK,UAAU,qBAAqB,CAAC,KAA2B;IAC9D,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC;QAClC,uBAAuB,EAAE,sCAAsC,CAAC;YAC9D,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,QAA8B,EAAE;IAEhC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE;QACtE,OAAO,EAAE;YACP,eAAe,EAAE,UAAU;YAC3B,cAAc,EAAE,iCAAiC;SAClD;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,13 +1,8 @@
1
1
  /**
2
2
  * Builds the package-owned home page response for one resolved application.
3
3
  */
4
- export declare function handleHomePageRequest(input?: {
5
- appRoot?: string;
6
- homePageTemplate?: string;
4
+ export declare function handleHomePageRequest(input: {
5
+ agentInfoOnlyMode?: boolean;
6
+ homePageHtml: string;
7
7
  }): Promise<Response>;
8
- /**
9
- * Nitro route for Ash's package-owned home page.
10
- */
11
- declare const _default: () => Promise<Response>;
12
- export default _default;
13
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/index.ts"],"names":[],"mappings":"AAgDA;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1D,OAAO,CAAC,QAAQ,CAAC,CAMnB;AAED;;GAEG;8BACsB,OAAO,CAAC,QAAQ,CAAC;AAA1C,wBAEE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/index.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IACjD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAYpB"}
@@ -1,50 +1,32 @@
1
- import { readAshNitroRuntimeConfiguration } from "../runtime-configuration.js";
2
- import { buildHomePageViewModel } from "./home-page/build-home-page-view-model.js";
3
- import { loadHomePageData, resolveHomePageCompiledArtifactsSource, } from "./home-page/load-home-page-data.js";
4
- import { renderHomePage } from "./home-page/render-home-page.js";
5
- function resolveConfiguredAppRoot(configuredAppRoot) {
6
- if (typeof configuredAppRoot === "string") {
7
- return configuredAppRoot;
1
+ function resolveAgentInfoOnlyMode(configuredAgentInfoOnlyMode) {
2
+ if (typeof configuredAgentInfoOnlyMode === "boolean") {
3
+ return configuredAgentInfoOnlyMode;
8
4
  }
9
- const runtimeConfiguration = readAshNitroRuntimeConfiguration();
10
- return typeof runtimeConfiguration.appRoot === "string"
11
- ? runtimeConfiguration.appRoot
12
- : undefined;
5
+ return process.env.VERCEL === "1";
13
6
  }
14
- function resolveConfiguredHomePageTemplate(configuredHomePageTemplate) {
15
- if (typeof configuredHomePageTemplate === "string") {
16
- return configuredHomePageTemplate;
7
+ function injectHomePageRuntimeFlags(input) {
8
+ const runtimeFlagsScript = `<script>globalThis.__ASH_UI_AGENT_INFO_ONLY_MODE__=${input.agentInfoOnlyMode ? "true" : "false"};</script>`;
9
+ if (input.homePageHtml.includes("</head>")) {
10
+ return input.homePageHtml.replace("</head>", `${runtimeFlagsScript}</head>`);
17
11
  }
18
- const runtimeConfiguration = readAshNitroRuntimeConfiguration();
19
- if (typeof runtimeConfiguration.homePageTemplate !== "string") {
20
- throw new Error("Missing Ash home page template in Ash Nitro runtime configuration.");
12
+ if (input.homePageHtml.includes("</body>")) {
13
+ return input.homePageHtml.replace("</body>", `${runtimeFlagsScript}</body>`);
21
14
  }
22
- return runtimeConfiguration.homePageTemplate;
23
- }
24
- async function createHomePageHtml(input = {}) {
25
- const template = resolveConfiguredHomePageTemplate(input.homePageTemplate);
26
- const data = await loadHomePageData({
27
- compiledArtifactsSource: resolveHomePageCompiledArtifactsSource({
28
- appRoot: resolveConfiguredAppRoot(input.appRoot),
29
- }),
30
- });
31
- const viewModel = buildHomePageViewModel(data);
32
- return renderHomePage(template, viewModel);
15
+ return `${runtimeFlagsScript}${input.homePageHtml}`;
33
16
  }
34
17
  /**
35
18
  * Builds the package-owned home page response for one resolved application.
36
19
  */
37
- export async function handleHomePageRequest(input = {}) {
38
- return new Response(await createHomePageHtml(input), {
20
+ export async function handleHomePageRequest(input) {
21
+ const homePageHtml = injectHomePageRuntimeFlags({
22
+ agentInfoOnlyMode: resolveAgentInfoOnlyMode(input.agentInfoOnlyMode),
23
+ homePageHtml: input.homePageHtml,
24
+ });
25
+ return new Response(homePageHtml, {
39
26
  headers: {
27
+ "cache-control": "no-store",
40
28
  "content-type": "text/html; charset=utf-8",
41
29
  },
42
30
  });
43
31
  }
44
- /**
45
- * Nitro route for Ash's package-owned home page.
46
- */
47
- export default async () => {
48
- return await handleHomePageRequest();
49
- };
50
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EACL,gBAAgB,EAChB,sCAAsC,GACvC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,SAAS,wBAAwB,CAAC,iBAA0B;IAC1D,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,MAAM,oBAAoB,GAAG,gCAAgC,EAAE,CAAC;IAEhE,OAAO,OAAO,oBAAoB,CAAC,OAAO,KAAK,QAAQ;QACrD,CAAC,CAAC,oBAAoB,CAAC,OAAO;QAC9B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,iCAAiC,CAAC,0BAAmC;IAC5E,IAAI,OAAO,0BAA0B,KAAK,QAAQ,EAAE,CAAC;QACnD,OAAO,0BAA0B,CAAC;IACpC,CAAC;IAED,MAAM,oBAAoB,GAAG,gCAAgC,EAAE,CAAC;IAEhE,IAAI,OAAO,oBAAoB,CAAC,gBAAgB,KAAK,QAAQ,EAAE,CAAC;QAC9D,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,oBAAoB,CAAC,gBAAgB,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,kBAAkB,CAC/B,QAAyD,EAAE;IAE3D,MAAM,QAAQ,GAAG,iCAAiC,CAAC,KAAK,CAAC,gBAAgB,C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I,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,kBAAkB,SAAS,CAAC,CAAC;IAC/E,CAAC;IAED,OAAO,GAAG,kBAAkB,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,KAG3C;IACC,MAAM,YAAY,GAAG,0BAA0B,CAAC;QAC9C,iBAAiB,EAAE,wBAAwB,CAAC,KAAK,CAAC,iBAAiB,CAAC;QACpE,YAAY,EAAE,KAAK,CAAC,YAAY;KACjC,CAAC,CAAC;IAEH,OAAO,IAAI,QAAQ,CAAC,YAAY,EAAE;QAChC,OAAO,EAAE;YACP,eAAe,EAAE,UAAU;YAC3B,cAAc,EAAE,0BAA0B;SAC3C;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,9 +1,16 @@
1
1
  import { type RuntimeCompiledArtifactsSource } from "../../../runtime/compiled-artifacts-source.js";
2
+ /**
3
+ * Configuration values needed to resolve the compiled-artifact source for
4
+ * package-owned Nitro routes. Passed explicitly from virtual handlers
5
+ * rather than read from a global runtime configuration store.
6
+ */
7
+ export interface NitroArtifactsConfig {
8
+ readonly appRoot?: string;
9
+ readonly dev?: boolean;
10
+ }
2
11
  /**
3
12
  * Resolves the compiled-artifact source available to package-owned Nitro
4
13
  * routes.
5
14
  */
6
- export declare function resolveNitroCompiledArtifactsSource(input?: {
7
- appRoot?: string;
8
- }): RuntimeCompiledArtifactsSource;
15
+ export declare function resolveNitroCompiledArtifactsSource(config: NitroArtifactsConfig): RuntimeCompiledArtifactsSource;
9
16
  //# sourceMappingURL=runtime-artifacts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-artifacts.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/runtime-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,8BAA8B,EACpC,MAAM,+CAA+C,CAAC;AAIvD;;;GAGG;AACH,wBAAgB,mCAAmC,CACjD,KAAK,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,8BAA8B,CAyBhC"}
1
+ {"version":3,"file":"runtime-artifacts.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/runtime-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,8BAA8B,EACpC,MAAM,+CAA+C,CAAC;AAGvD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,oBAAoB,GAC3B,8BAA8B,CAkBhC"}
@@ -1,18 +1,11 @@
1
1
  import { createBundledRuntimeCompiledArtifactsSource, createDiskRuntimeCompiledArtifactsSource, } from "../../../runtime/compiled-artifacts-source.js";
2
2
  import { readBundledCompiledArtifacts } from "../../../runtime/loaders/bundled-artifacts.js";
3
- import { readAshNitroRuntimeConfiguration } from "../runtime-configuration.js";
4
3
  /**
5
4
  * Resolves the compiled-artifact source available to package-owned Nitro
6
5
  * routes.
7
6
  */
8
- export function resolveNitroCompiledArtifactsSource(input = {}) {
9
- const runtimeConfiguration = readAshNitroRuntimeConfiguration();
10
- const appRoot = typeof input.appRoot === "string"
11
- ? input.appRoot
12
- : typeof runtimeConfiguration.appRoot === "string"
13
- ? runtimeConfiguration.appRoot
14
- : undefined;
15
- const isDevelopment = runtimeConfiguration.dev === true;
7
+ export function resolveNitroCompiledArtifactsSource(config) {
8
+ const { appRoot, dev: isDevelopment } = config;
16
9
  if (isDevelopment && appRoot !== undefined) {
17
10
  return createDiskRuntimeCompiledArtifactsSource(appRoot);
18
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-artifacts.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/runtime-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,wCAAwC,GAEzC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAE/E;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CACjD,QAA8B,EAAE;IAEhC,MAAM,oBAAoB,GAAG,gCAAgC,EAAE,CAAC;IAChE,MAAM,OAAO,GACX,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;QAC/B,CAAC,CAAC,KAAK,CAAC,OAAO;QACf,CAAC,CAAC,OAAO,oBAAoB,CAAC,OAAO,KAAK,QAAQ;YAChD,CAAC,CAAC,oBAAoB,CAAC,OAAO;YAC9B,CAAC,CAAC,SAAS,CAAC;IAClB,MAAM,aAAa,GAAG,oBAAoB,CAAC,GAAG,KAAK,IAAI,CAAC;IAExD,IAAI,aAAa,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,wCAAwC,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,4BAA4B,EAAE,KAAK,IAAI,EAAE,CAAC;QAC5C,OAAO,2CAA2C,EAAE,CAAC;IACvD,CAAC;IAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,wCAAwC,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,IAAI,KAAK,CACb,4FAA4F,CAC7F,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"runtime-artifacts.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/runtime-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,wCAAwC,GAEzC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAY7F;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CACjD,MAA4B;IAE5B,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAE/C,IAAI,aAAa,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,wCAAwC,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,4BAA4B,EAAE,KAAK,IAAI,EAAE,CAAC;QAC5C,OAAO,2CAA2C,EAAE,CAAC;IACvD,CAAC;IAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,wCAAwC,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,IAAI,KAAK,CACb,4FAA4F,CAC7F,CAAC;AACJ,CAAC"}
@@ -1,6 +1,7 @@
1
- import { ScheduleChannel } from "../../../channel/schedule.js";
1
+ import { ScheduleDispatcher } from "../../../channel/schedule.js";
2
2
  import type { Runtime } from "../../../channel/types.js";
3
3
  import type { ResolvedChannelDefinition } from "../../../runtime/types.js";
4
+ import { type NitroArtifactsConfig } from "./runtime-artifacts.js";
4
5
  /**
5
6
  * Bundle returned to the per-channel Nitro dispatch handler.
6
7
  *
@@ -8,7 +9,7 @@ import type { ResolvedChannelDefinition } from "../../../runtime/types.js";
8
9
  * overrides minus authored disables) and the per-request workflow runtime.
9
10
  * The dispatch handler walks `channels` to match the inbound request
10
11
  * against a registered URL pattern, then calls the matched channel's
11
- * `fetch` with a `ChannelContext` built from `runtime`.
12
+ * `fetch` with a `RouteContext` built from `runtime`.
12
13
  */
13
14
  export interface NitroChannelRuntimeBundle {
14
15
  readonly channels: readonly ResolvedChannelDefinition[];
@@ -19,11 +20,11 @@ export interface NitroChannelRuntimeBundle {
19
20
  * (already merged with framework defaults by `resolve-agent-graph.ts`)
20
21
  * and a fresh workflow runtime.
21
22
  *
22
- * No singleton caching is needed — session state lives inside the
23
- * workflow's durable execution and the channel set is recomputed from the
24
- * compiled bundle on each request.
23
+ * No singleton caching is needed — durable session execution lives inside the
24
+ * workflow runtime and the channel set is recomputed from the compiled bundle
25
+ * on each request.
25
26
  */
26
- export declare function resolveNitroChannelRuntimeBundle(): Promise<NitroChannelRuntimeBundle>;
27
+ export declare function resolveNitroChannelRuntimeBundle(config: NitroArtifactsConfig): Promise<NitroChannelRuntimeBundle>;
27
28
  /**
28
29
  * Builds and returns the schedule channel backed by the workflow runtime.
29
30
  *
@@ -33,5 +34,5 @@ export declare function resolveNitroChannelRuntimeBundle(): Promise<NitroChannel
33
34
  * inbound HTTP request and do not fit the per-request `Channel.fetch`
34
35
  * shape.
35
36
  */
36
- export declare function resolveNitroScheduleChannel(): ScheduleChannel;
37
+ export declare function resolveNitroScheduleDispatcher(config: NitroArtifactsConfig): ScheduleDispatcher;
37
38
  //# sourceMappingURL=runtime-stack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-stack.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/runtime-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAG3E;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACxD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAsB,gCAAgC,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAU3F;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,IAAI,eAAe,CAI7D"}
1
+ {"version":3,"file":"runtime-stack.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/runtime-stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACxD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,yBAAyB,CAAC,CAUpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,oBAAoB,GAAG,kBAAkB,CAI/F"}