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,13 +1,13 @@
1
1
  /**
2
- * Channel-level HTTP authentication primitives.
2
+ * Route-level HTTP authentication primitives.
3
3
  *
4
4
  * The framework exposes two layers here:
5
5
  *
6
6
  * 1. **Low-level verifier helpers** (`verifyHttpBasic`, `verifyJwtHmac`,
7
7
  * `verifyJwtEcdsa`, `verifyOidc`, `verifyVercelOidc`,
8
8
  * `extractBearerToken`, `createIpAllowList`, `isIpAllowed`,
9
- * `createUnauthorizedResponse`, `withAuth`). These are pure functions
10
- * that channels compose by hand inside a `fetch` handler. Use them
9
+ * `createUnauthorizedResponse`). These are pure functions
10
+ * that routes compose by hand inside a `fetch` handler. Use them
11
11
  * when the strategy helpers don't fit — for example, when stacking
12
12
  * custom rate limits or rendering a custom `WWW-Authenticate`
13
13
  * challenge.
@@ -15,33 +15,32 @@
15
15
  * 2. **Strategy helpers** (`vercelOidc`, `httpBasic`, `jwtHmac`,
16
16
  * `jwtEcdsa`, `oidc`, `none`). These return an {@link AuthFn} suitable
17
17
  * for the required `auth` field on the framework's HTTP and Slack
18
- * channel factories. Use them when you want a one-liner channel
18
+ * route factories. Use them when you want a one-liner route
19
19
  * declaration.
20
20
  *
21
21
  * @example
22
22
  * ```ts
23
23
  * // agent/channels/api/message.ts — strategy helper, the common case
24
- * import { httpMessageChannel } from "experimental-ash/channels/http";
24
+ * import { httpRoute } from "experimental-ash/channels/http";
25
25
  * import { vercelOidc } from "experimental-ash/channels/auth";
26
26
  *
27
- * export default httpMessageChannel({ auth: vercelOidc() });
27
+ * export default httpRoute({ auth: vercelOidc() });
28
28
  * ```
29
29
  *
30
30
  * @example
31
31
  * ```ts
32
32
  * // agent/channels/api/message.ts — low-level verifier composition
33
- * import { defineChannel } from "experimental-ash";
34
- * import { httpMessageChannel } from "experimental-ash/channels/http";
33
+ * import { defineRoute } from "experimental-ash";
34
+ * import { httpRoute } from "experimental-ash/channels/http";
35
35
  * import {
36
36
  * createUnauthorizedResponse,
37
37
  * none,
38
38
  * verifyHttpBasic,
39
- * withAuth,
40
39
  * } from "experimental-ash/channels/auth";
41
40
  *
42
- * const base = httpMessageChannel({ auth: none() });
41
+ * const base = httpRoute({ auth: none() });
43
42
  *
44
- * export default defineChannel({
43
+ * export default defineRoute({
45
44
  * ...base,
46
45
  * async fetch(request, ctx) {
47
46
  * const auth = verifyHttpBasic(request.headers.get("authorization"), {
@@ -53,7 +52,8 @@
53
52
  * challenges: [{ scheme: "Basic", parameters: { realm: "weather" } }],
54
53
  * });
55
54
  * }
56
- * return base.fetch(request, withAuth(ctx, auth.sessionAuth));
55
+ * // Construct channel with auth baked in and pass to agent.run
56
+ * return base.fetch(request, ctx);
57
57
  * },
58
58
  * });
59
59
  * ```
@@ -201,7 +201,7 @@ export function createIpAllowList(entries) {
201
201
  }
202
202
  /**
203
203
  * Returns whether the supplied IP is permitted by `allowList`. `null`
204
- * inputs always return `false` — channels that need to allow unknown IPs
204
+ * inputs always return `false` — adapters that need to allow unknown IPs
205
205
  * should not call this helper at all.
206
206
  */
207
207
  export function isIpAllowed(ip, allowList) {
@@ -245,84 +245,21 @@ function formatChallenge(challenge) {
245
245
  function escapeChallengeValue(value) {
246
246
  return value.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
247
247
  }
248
- // ---------------------------------------------------------------------------
249
- // Context wrapping
250
- // ---------------------------------------------------------------------------
251
- /**
252
- * Returns a {@link ChannelContext} whose agent handle auto-injects the
253
- * supplied `sessionAuth` into every `run()` and `deliver()` call. Use this
254
- * in a wrapping channel after verifying credentials so the inner channel's
255
- * `agent.run()` calls carry the authenticated principal without the inner
256
- * channel having to know auth happened.
257
- *
258
- * The returned context is shallow-spread from the input — `params`,
259
- * `requestIp`, and `waitUntil` come straight through. Only `agent` is
260
- * replaced with a wrapped version.
261
- *
262
- * @example
263
- * ```ts
264
- * import { defineChannel } from "experimental-ash";
265
- * import { httpMessageChannel } from "experimental-ash/channels/http";
266
- * import {
267
- * createUnauthorizedResponse,
268
- * none,
269
- * verifyHttpBasic,
270
- * withAuth,
271
- * } from "experimental-ash/channels/auth";
272
- *
273
- * const base = httpMessageChannel({ auth: none() });
274
- *
275
- * export default defineChannel({
276
- * ...base,
277
- * async fetch(request, ctx) {
278
- * const result = verifyHttpBasic(request.headers.get("authorization"), {
279
- * username: "ops",
280
- * password: process.env.ROUTE_AUTH_BASIC_PASSWORD!,
281
- * });
282
- * if (!result.ok) {
283
- * return createUnauthorizedResponse({
284
- * challenges: [{ scheme: "Basic", parameters: { realm: "weather" } }],
285
- * });
286
- * }
287
- * return base.fetch(request, withAuth(ctx, result.sessionAuth));
288
- * },
289
- * });
290
- * ```
291
- *
292
- * Stacking multiple wrappers (auth, rate limiting, tracing, etc.) is
293
- * function composition — each wrapper substitutes the agent; the
294
- * innermost agent is the real one. The pattern is forward-compatible
295
- * with future middleware helpers (`withRateLimit`, `withTracing`, ...)
296
- * that follow the same shape.
297
- */
298
- export function withAuth(ctx, sessionAuth) {
299
- const wrappedAgent = {
300
- run: (input) => ctx.agent.run({ ...input, auth: sessionAuth }),
301
- deliver: (input) => ctx.agent.deliver({ ...input, auth: sessionAuth }),
302
- getEventStream: (runId, options) => ctx.agent.getEventStream(runId, options),
303
- };
304
- return {
305
- agent: wrappedAgent,
306
- waitUntil: ctx.waitUntil,
307
- params: ctx.params,
308
- requestIp: ctx.requestIp,
309
- };
310
- }
311
248
  /**
312
249
  * Returns an {@link AuthFn} that always emits `undefined` — the explicit
313
- * "no auth" choice for channel factories.
250
+ * "no auth" choice for route factories.
314
251
  *
315
- * Channel factories require an `auth` argument; passing `none()` is the
252
+ * Route factories require an `auth` argument; passing `none()` is the
316
253
  * way to opt into an open route without an implicit default. The factory
317
- * then dispatches every request with `withAuth(ctx, null)` so the harness
318
- * sees `getSession().auth === null`.
254
+ * then dispatches every request with `auth: null` on the channel so the
255
+ * harness sees `getSession().auth === null`.
319
256
  *
320
257
  * @example
321
258
  * ```ts
322
- * import { httpMessageChannel } from "experimental-ash/channels/http";
259
+ * import { httpRoute } from "experimental-ash/channels/http";
323
260
  * import { none } from "experimental-ash/channels/auth";
324
261
  *
325
- * export default httpMessageChannel({ auth: none() });
262
+ * export default httpRoute({ auth: none() });
326
263
  * ```
327
264
  */
328
265
  export function none() {
@@ -370,13 +307,13 @@ export async function verifyVercelOidc(token, opts = {}) {
370
307
  });
371
308
  }
372
309
  // ---------------------------------------------------------------------------
373
- // Strategy helpers — return AuthFn<Request> for HTTP channel factories
310
+ // Strategy helpers — return AuthFn<Request> for HTTP route factories
374
311
  // ---------------------------------------------------------------------------
375
312
  /**
376
313
  * Returns an {@link AuthFn} that verifies the inbound request against the
377
314
  * Vercel OIDC issuer via {@link verifyVercelOidc}.
378
315
  *
379
- * This is the recommended `auth` provider for channels deployed on
316
+ * This is the recommended `auth` provider for routes deployed on
380
317
  * Vercel. The dev client at `services/dev-client/request-headers.ts`
381
318
  * already attaches `Authorization: Bearer ${VERCEL_OIDC_TOKEN}` for
382
319
  * Ash-owned routes during local development, so the same provider works
@@ -384,10 +321,10 @@ export async function verifyVercelOidc(token, opts = {}) {
384
321
  *
385
322
  * @example
386
323
  * ```ts
387
- * import { httpMessageChannel } from "experimental-ash/channels/http";
324
+ * import { httpRoute } from "experimental-ash/channels/http";
388
325
  * import { vercelOidc } from "experimental-ash/channels/auth";
389
326
  *
390
- * export default httpMessageChannel({ auth: vercelOidc() });
327
+ * export default httpRoute({ auth: vercelOidc() });
391
328
  * ```
392
329
  */
393
330
  export function vercelOidc(opts = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/public/channels/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GAAG,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,SAAS,yBAAyB,CAChC,KAAa;IAEb,IAAI,OAAqC,CAAC;IAC1C,IAAI,CAAC;QACH,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GACb,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;QAC7B,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;QACf,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;YAC1B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC;YAC3E,CAAC,CAAC,EAAE,CAAC;IAEX,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;AAC5C,CAAC"}
@@ -1,35 +1,75 @@
1
1
  /**
2
- * Framework-shipped HTTP channel factories.
2
+ * Framework-shipped HTTP route factories.
3
3
  *
4
- * `httpMessageChannel()` returns the inbound message channel — the public
5
- * HTTP entry point for starting and resuming agent runs. Authored at the
4
+ * `httpRoute()` returns the inbound message route — the public
5
+ * HTTP entry point for starting and resuming agent sessions. Authored at the
6
6
  * logical filesystem path `agent/channels/.well-known/ash/v1/message.ts`,
7
7
  * mounted at `POST /.well-known/ash/v1/message`.
8
8
  *
9
- * `httpRunStreamChannel()` returns the outbound event stream channel.
9
+ * `httpRunStreamRoute()` returns the outbound event stream route.
10
10
  * Authored at the logical filesystem path
11
- * `agent/channels/.well-known/ash/v1/runs/[runId]/stream.ts`, mounted at
12
- * `GET /.well-known/ash/v1/runs/:runId/stream`. Reads run events from the
11
+ * `agent/channels/.well-known/ash/v1/sessions/[sessionId]/stream.ts`, mounted at
12
+ * `GET /.well-known/ash/v1/sessions/:sessionId/stream`. Reads session events from the
13
13
  * agent via {@link Agent.getEventStream}.
14
14
  *
15
- * Both channels are mounted automatically by the framework at their logical
15
+ * Both routes are mounted automatically by the framework at their logical
16
16
  * paths unless the user authors a file at the same path (override) or
17
- * exports `disableChannel()` from such a file (disable).
17
+ * exports `disableRoute()` from such a file (disable).
18
18
  *
19
- * Both factories require an `auth` argument — see {@link HttpChannelInput}.
20
- * The common case is `httpMessageChannel({ auth: vercelOidc() })`. Open
21
- * routes are an explicit choice via `httpMessageChannel({ auth: none() })`.
19
+ * Both factories require an `auth` argument — see {@link HttpRouteInput}
20
+ * and {@link HttpRunStreamRouteInput}.
21
+ * The common case is `httpRoute({ auth: vercelOidc() })`. Open
22
+ * routes are an explicit choice via `httpRoute({ auth: none() })`.
22
23
  */
23
- import { type Channel } from "../definitions/channel.js";
24
+ import { HttpChannel, type HttpChannelState } from "../../channel/http-channel.js";
25
+ import type { ChannelClass } from "../../channel/types.js";
26
+ import { type Route } from "../definitions/channel.js";
24
27
  import { type AuthFn } from "./auth.js";
28
+ export type { HttpChannelState };
29
+ export { HttpChannel };
25
30
  /**
26
- * Input shared by all framework-shipped HTTP channel factories.
31
+ * Factory for the channel instance used when {@link httpRoute} starts a
32
+ * new HTTP-backed session.
27
33
  *
28
- * `auth` is required so every channel declaration explicitly states how
34
+ * The helper passes the initial serialized state into the constructor. The
35
+ * framework default is `{}` because the built-in {@link HttpChannel} is
36
+ * stateless, but custom subclasses may persist additional durable fields.
37
+ */
38
+ export interface HttpRouteChannelClass<C extends HttpChannel = HttpChannel> extends ChannelClass<C> {
39
+ new (state: HttpChannelState): C;
40
+ }
41
+ /**
42
+ * Input for {@link httpRoute}.
43
+ *
44
+ * `auth` is required so every route declaration explicitly states how
29
45
  * inbound requests are authenticated. The common case is
30
46
  * `auth: vercelOidc()`; open routes pass `auth: none()`.
31
47
  */
32
- export interface HttpChannelInput {
48
+ export interface HttpRouteInput {
49
+ /**
50
+ * Required authenticator for the inbound request. Returns a
51
+ * {@link SessionAuthContext} on success, `null` to reject the request
52
+ * with a 401, or `undefined` to allow the request through with no
53
+ * principal attached. See {@link AuthFn}.
54
+ */
55
+ readonly auth: AuthFn<Request>;
56
+ /**
57
+ * Optional channel class used for new HTTP-backed sessions.
58
+ *
59
+ * Use this when you want to keep the stock Ash HTTP wire protocol but need
60
+ * custom channel behavior for `onDeliver()` or `onEvent()`. The helper
61
+ * automatically declares the class on the route's `serializableChannels`
62
+ * list so the runtime can rehydrate it after workflow boundaries.
63
+ */
64
+ readonly channel?: HttpRouteChannelClass;
65
+ }
66
+ /**
67
+ * Input for {@link httpRunStreamRoute}.
68
+ *
69
+ * The stream route only needs request authentication because it never starts a
70
+ * new session and therefore never persists a channel instance.
71
+ */
72
+ export interface HttpRunStreamRouteInput {
33
73
  /**
34
74
  * Required authenticator for the inbound request. Returns a
35
75
  * {@link SessionAuthContext} on success, `null` to reject the request
@@ -39,7 +79,7 @@ export interface HttpChannelInput {
39
79
  readonly auth: AuthFn<Request>;
40
80
  }
41
81
  /**
42
- * Returns the framework-shipped HTTP message channel.
82
+ * Returns the framework-shipped HTTP message route.
43
83
  *
44
84
  * Accepts JSON bodies of the form:
45
85
  * ```json
@@ -47,30 +87,30 @@ export interface HttpChannelInput {
47
87
  * { "continuationToken": "...", "message": "..." } // resume an existing session
48
88
  * ```
49
89
  *
50
- * Responds with `202 Accepted` on a new session, including the run id in
51
- * the `x-ash-run-id` header and the stream URL in the `Location` header.
90
+ * Responds with `202 Accepted` on a new session, including the session id in
91
+ * the `x-ash-session-id` header and the stream URL in the `Location` header.
52
92
  * Responds with `200 OK` on a successful resume.
53
93
  *
54
94
  * Inbound auth is mandatory: pass `auth: vercelOidc()` for the standard
55
95
  * Vercel deployment, `auth: none()` for an explicit open route, or any
56
96
  * other {@link AuthFn} (or hand-written function) for custom verification.
57
97
  */
58
- export declare function httpMessageChannel(input: HttpChannelInput): Channel;
98
+ export declare function httpRoute(input: HttpRouteInput): Route;
59
99
  /**
60
- * Returns the framework-shipped HTTP run-stream channel.
100
+ * Returns the framework-shipped HTTP session-stream route.
61
101
  *
62
- * Reads `runId` from the path parameter (filesystem path
63
- * `runs/[runId]/stream`) and returns a long-lived NDJSON `Response` whose
64
- * body is the durable workflow event stream for that run.
102
+ * Reads `sessionId` from the path parameter (filesystem path
103
+ * `sessions/[sessionId]/stream`) and returns a long-lived NDJSON `Response`
104
+ * whose body is the durable workflow event stream for that session.
65
105
  *
66
106
  * Honors a `startIndex` query parameter so a reconnecting or resuming
67
- * client can skip events it already consumed for the current run. Without
107
+ * client can skip events it already consumed for the current session. Without
68
108
  * this, follow-up turns would replay every event from the start of the
69
- * run and the dev REPL would render the previous turn over and over.
109
+ * session and the dev REPL would render the previous turn over and over.
70
110
  *
71
111
  * Inbound auth is mandatory: pass `auth: vercelOidc()` for the standard
72
112
  * Vercel deployment, `auth: none()` for an explicit open route, or any
73
113
  * other {@link AuthFn} for custom verification.
74
114
  */
75
- export declare function httpRunStreamChannel(input: HttpChannelInput): Channel;
115
+ export declare function httpRunStreamRoute(input: HttpRunStreamRouteInput): Route;
76
116
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/public/channels/http.ts"],"names":[],"mappings":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