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,15 +1,15 @@
1
1
  /**
2
- * Convenience factory for the Slack channel.
2
+ * Convenience factory for the Slack route.
3
3
  *
4
- * Returns a `Channel` whose `fetch` handler verifies the Slack request
4
+ * Returns a `Route` whose `fetch` handler verifies the Slack request
5
5
  * (via the chat SDK), parses the inbound mention, projects the verified
6
6
  * Slack identity into an Ash-owned {@link SlackEventContext}, runs the
7
- * required {@link SlackChannelInput.auth} resolver to produce the
7
+ * required {@link SlackRouteInput.auth} resolver to produce the
8
8
  * principal, and dispatches via `agent.deliver()` (with a fallback to
9
9
  * `agent.run()`) under that principal.
10
10
  *
11
11
  * This is a *library helper*, not a framework default. The framework
12
- * only ships the HTTP message + run-stream channel pair (see
12
+ * only ships the HTTP message + session-stream route pair (see
13
13
  * `experimental-ash/channels/http`). Authors who want a Slack bot
14
14
  * create their own file under `agent/channels/` and export the result
15
15
  * of this factory.
@@ -17,9 +17,9 @@
17
17
  * @example
18
18
  * ```ts
19
19
  * // agent/channels/slack.ts → POST /slack
20
- * import { slackChannel, slackUser } from "experimental-ash/channels/slack";
20
+ * import { slackRoute, slackUser } from "experimental-ash/channels/slack";
21
21
  *
22
- * export default slackChannel({
22
+ * export default slackRoute({
23
23
  * credentials: {
24
24
  * botToken: process.env.SLACK_BOT_TOKEN!,
25
25
  * signingSecret: process.env.SLACK_SIGNING_SECRET!,
@@ -34,8 +34,12 @@
34
34
  * request to `chat.webhooks.slack(request)` which performs signature
35
35
  * verification, event parsing, and dispatch.
36
36
  */
37
- import { type Channel } from "../../definitions/channel.js";
38
- import { type AuthFn } from "../auth.js";
37
+ import { SlackChannel, type SlackChannelState, type SlackUserContext } from "../../../channel/slack-channel.js";
38
+ import type { Channel, ChannelClass } from "../../../channel/types.js";
39
+ import { type Route } from "../../definitions/channel.js";
40
+ import type { AuthFn } from "../auth.js";
41
+ export type { SlackChannelState, SlackUserContext };
42
+ export { SlackChannel };
39
43
  /**
40
44
  * Slack credentials and signing secret consumed by the underlying chat
41
45
  * SDK. Both fields are optional — when omitted, the underlying
@@ -43,7 +47,7 @@ import { type AuthFn } from "../auth.js";
43
47
  * defaults (`SLACK_BOT_TOKEN`, `SLACK_SIGNING_SECRET`).
44
48
  *
45
49
  * This shape is named `credentials` (rather than `auth`) so the slot
46
- * stays distinct from the inbound {@link SlackChannelInput.auth}
50
+ * stays distinct from the inbound {@link SlackRouteInput.auth}
47
51
  * resolver, which controls the *principal* the framework attaches to
48
52
  * each Slack-delivered turn.
49
53
  */
@@ -51,12 +55,16 @@ export interface SlackChannelCredentials {
51
55
  readonly botToken?: string;
52
56
  readonly signingSecret?: string;
53
57
  }
58
+ /**
59
+ * Classification of the Slack actor that authored one inbound mention.
60
+ */
61
+ export type SlackAuthorType = "user" | "bot";
54
62
  /**
55
63
  * Ash-owned projection of one verified inbound Slack mention.
56
64
  *
57
- * Constructed by {@link slackChannel} inside the chat SDK's
65
+ * Constructed by {@link slackRoute} inside the chat SDK's
58
66
  * `onNewMention` callback after the underlying signature check has
59
- * passed. It carries everything an {@link SlackChannelInput.auth}
67
+ * passed. It carries everything an {@link SlackRouteInput.auth}
60
68
  * resolver needs to derive a {@link SessionAuthContext} for the
61
69
  * delivered turn — without exposing any chat SDK types (CLAUDE.md item
62
70
  * 8).
@@ -75,8 +83,23 @@ export interface SlackEventContext {
75
83
  * resolver that requires it explicitly.
76
84
  */
77
85
  readonly teamId?: string;
78
- /** Slack user id of the message author, e.g. `U0123ABC`. */
86
+ /** Whether the mention came from a human user or another bot. */
87
+ readonly authorType: SlackAuthorType;
88
+ /**
89
+ * Slack actor id of the message author, e.g. `U0123ABC` for users or
90
+ * `B0123ABC` for bot-authored messages.
91
+ */
79
92
  readonly userId: string;
93
+ /**
94
+ * Slack handle of the message author, e.g. `jane.smith`. Populated
95
+ * by the chat SDK from the Slack `users.info` API response.
96
+ */
97
+ readonly userName: string;
98
+ /**
99
+ * Display name of the message author, e.g. `Jane Smith`. Populated
100
+ * by the chat SDK from the Slack `users.info` API response.
101
+ */
102
+ readonly fullName: string;
80
103
  /** Slack channel id where the mention happened, e.g. `C0123ABC`. */
81
104
  readonly channelId: string;
82
105
  /** Thread root timestamp identifying the conversation. */
@@ -85,20 +108,44 @@ export interface SlackEventContext {
85
108
  readonly text: string;
86
109
  /** Slack event timestamp of this specific mention. */
87
110
  readonly eventTs: string;
111
+ /**
112
+ * Raw Slack event type, e.g. `app_mention`, `message`, or
113
+ * `reaction_added`. Optional because some test fixtures and edge-case
114
+ * payloads omit the field.
115
+ */
116
+ readonly slackEventType?: string;
88
117
  }
89
118
  /**
90
- * Input for {@link slackChannel}.
119
+ * Factory for the channel instance used when {@link slackRoute} starts a new
120
+ * Slack-backed session.
91
121
  *
92
- * Unlike the HTTP channel factories, `auth` is **optional** here. The
93
- * chat SDK always hands the channel a verified Slack identity, and the
122
+ * The route passes the standard Slack channel state (`botToken` and
123
+ * `serializedThread`) into the factory. Authors can return the framework's
124
+ * default {@link SlackChannel}, a subclass, or any other registered
125
+ * {@link Channel} implementation that composes Slack-specific behavior such as
126
+ * context seeding or custom delivery policy.
127
+ *
128
+ * The constructor state should stay immutable after the session starts. Use
129
+ * `onDeliver(...)` and durable context for mutable per-session data.
130
+ *
131
+ * When omitted, {@link slackRoute} constructs a plain {@link SlackChannel}.
132
+ */
133
+ export interface SlackRouteChannelClass<C extends Channel = Channel> extends ChannelClass<C> {
134
+ new (state: SlackChannelState): C;
135
+ }
136
+ /**
137
+ * Input for {@link slackRoute}.
138
+ *
139
+ * Unlike the HTTP route factories, `auth` is **optional** here. The
140
+ * chat SDK always hands the route a verified Slack identity, and the
94
141
  * canonical projection of that identity into a `SessionAuthContext` is
95
- * stable enough to ship as a default — see {@link slackUser}. Channels
142
+ * stable enough to ship as a default — see {@link slackUser}. Routes
96
143
  * that need a custom projection (DB lookups, workspace allowlists,
97
- * cross-workspace mapping) pass their own {@link AuthFn}; channels that
144
+ * cross-workspace mapping) pass their own {@link AuthFn}; routes that
98
145
  * want to drop the principal entirely pass `none()` from
99
146
  * `experimental-ash/channels/auth`.
100
147
  */
101
- export interface SlackChannelInput {
148
+ export interface SlackRouteInput {
102
149
  /**
103
150
  * Outbound credentials and signing secret for the chat SDK. Renamed
104
151
  * from the previous `auth` field.
@@ -109,27 +156,47 @@ export interface SlackChannelInput {
109
156
  * bot's `userName`. Defaults to `"ash-agent"`.
110
157
  */
111
158
  readonly botName?: string;
159
+ /**
160
+ * Optional channel class used for new Slack-backed sessions.
161
+ *
162
+ * Use this when you want to keep the stock Slack webhook/auth parsing from
163
+ * {@link slackRoute} but need a custom channel implementation for
164
+ * `onDeliver()` or `onEvent()`. The class constructor receives the
165
+ * framework's default Slack channel state for the current thread and returns
166
+ * the channel object that `agent.run()` should persist with the session.
167
+ * Stable transport identity belongs on that serialized state; mutable
168
+ * session-scoped data belongs in durable context or `session.internal`.
169
+ *
170
+ * The route helper automatically declares the class on the route's
171
+ * `serializableChannels` list so the runtime can rehydrate it after
172
+ * workflow boundaries. No global registration is needed.
173
+ */
174
+ readonly channel?: SlackRouteChannelClass;
112
175
  /**
113
176
  * Optional projection of the verified Slack identity into a
114
177
  * {@link SessionAuthContext}. Defaults to {@link slackUser}, which
115
- * builds the standard `slack:<teamId>:<userId>` principal. The
116
- * resolver runs once per inbound mention after signature verification
117
- * has passed. Returning a `SessionAuthContext` attaches the
118
- * principal; returning `null` drops the message (logged); returning
119
- * `undefined` dispatches with no principal attached.
178
+ * builds the standard human Slack principal and maps bot-authored
179
+ * mentions onto a service principal. The resolver runs once per
180
+ * inbound mention after signature verification has passed. Returning
181
+ * a `SessionAuthContext` attaches the principal; returning `null`
182
+ * drops the message (logged); returning `undefined` dispatches with
183
+ * no principal attached.
120
184
  */
121
185
  readonly auth?: AuthFn<SlackEventContext>;
122
186
  }
123
187
  /**
124
- * Default {@link AuthFn} for the Slack channel.
188
+ * Default {@link AuthFn} for the Slack route.
189
+ *
190
+ * Builds a Slack-scoped principal from the verified mention. Human
191
+ * mentions become `user` principals; bot-authored mentions become
192
+ * `service` principals so authored routes can distinguish automation
193
+ * callers from people.
125
194
  *
126
- * Builds a Slack-scoped principal from the verified mention. When the
127
- * inbound event carries a workspace id, the principal is
128
- * `slack:<teamId>:<userId>` (globally unique across workspaces, the
129
- * right default for multi-workspace deployments). When `teamId` is
130
- * absent the common single-workspace case — the principal falls back
131
- * to `slack:<userId>`, which is unique within the only workspace the
132
- * bot ever sees.
195
+ * When the inbound event carries a workspace id, human principals use
196
+ * `slack:<teamId>:<userId>` and bot principals use
197
+ * `slack:<teamId>:bot:<userId>`. When `teamId` is absent the common
198
+ * single-workspace case the identifiers fall back to
199
+ * `slack:<userId>` and `slack:bot:<userId>`.
133
200
  *
134
201
  * Use a hand-written {@link AuthFn} when you need richer behavior:
135
202
  * looking up internal user ids, gating on workspace allowlists, or
@@ -137,15 +204,15 @@ export interface SlackChannelInput {
137
204
  */
138
205
  export declare function slackUser(): AuthFn<SlackEventContext>;
139
206
  /**
140
- * Returns the framework's default Slack {@link Channel} implementation.
207
+ * Returns the framework's default Slack {@link Route} implementation.
141
208
  *
142
- * The returned channel handles `POST` Slack webhooks. The URL path is
143
- * derived from the channel file's location under `agent/channels/`.
209
+ * The returned route handles `POST` Slack webhooks. The URL path is
210
+ * derived from the route file's location under `agent/channels/`.
144
211
  *
145
- * `input` is optional — `slackChannel()` is equivalent to
146
- * `slackChannel({ auth: slackUser() })` and reads `SLACK_BOT_TOKEN` /
212
+ * `input` is optional — `slackRoute()` is equivalent to
213
+ * `slackRoute({ auth: slackUser() })` and reads `SLACK_BOT_TOKEN` /
147
214
  * `SLACK_SIGNING_SECRET` from the environment via the chat SDK's own
148
215
  * defaults.
149
216
  */
150
- export declare function slackChannel(input?: SlackChannelInput): Channel;
217
+ export declare function slackRoute(input?: SlackRouteInput): Route;
151
218
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/public/channels/slack/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,KAAK,MAAM,EAAY,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,IA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SAAS,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IAC1F,KAAK,KAAK,EAAE,iBAAiB,GAAG,CAAC,CAAC;CACnC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IAC1C;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAAC,iBAAiB,CAAC,CA+BrD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,GAAE,eAAoB,GAAG,KAAK,CA2J7D"}
@@ -1,15 +1,15 @@
1
1
  /**
2
- * Convenience factory for the Slack channel.
2
+ * Convenience factory for the Slack route.
3
3
  *
4
- * Returns a `Channel` whose `fetch` handler verifies the Slack request
4
+ * Returns a `Route` whose `fetch` handler verifies the Slack request
5
5
  * (via the chat SDK), parses the inbound mention, projects the verified
6
6
  * Slack identity into an Ash-owned {@link SlackEventContext}, runs the
7
- * required {@link SlackChannelInput.auth} resolver to produce the
7
+ * required {@link SlackRouteInput.auth} resolver to produce the
8
8
  * principal, and dispatches via `agent.deliver()` (with a fallback to
9
9
  * `agent.run()`) under that principal.
10
10
  *
11
11
  * This is a *library helper*, not a framework default. The framework
12
- * only ships the HTTP message + run-stream channel pair (see
12
+ * only ships the HTTP message + session-stream route pair (see
13
13
  * `experimental-ash/channels/http`). Authors who want a Slack bot
14
14
  * create their own file under `agent/channels/` and export the result
15
15
  * of this factory.
@@ -17,9 +17,9 @@
17
17
  * @example
18
18
  * ```ts
19
19
  * // agent/channels/slack.ts → POST /slack
20
- * import { slackChannel, slackUser } from "experimental-ash/channels/slack";
20
+ * import { slackRoute, slackUser } from "experimental-ash/channels/slack";
21
21
  *
22
- * export default slackChannel({
22
+ * export default slackRoute({
23
23
  * credentials: {
24
24
  * botToken: process.env.SLACK_BOT_TOKEN!,
25
25
  * signingSecret: process.env.SLACK_SIGNING_SECRET!,
@@ -34,19 +34,22 @@
34
34
  * request to `chat.webhooks.slack(request)` which performs signature
35
35
  * verification, event parsing, and dispatch.
36
36
  */
37
- import { SlackChannelEmitter } from "../../../channel/slack-emitter.js";
38
- import { defineChannel } from "../../definitions/channel.js";
39
- import { withAuth } from "../auth.js";
37
+ import { SlackChannel, } from "../../../channel/slack-channel.js";
38
+ import { defineRoute } from "../../definitions/channel.js";
39
+ export { SlackChannel };
40
40
  /**
41
- * Default {@link AuthFn} for the Slack channel.
41
+ * Default {@link AuthFn} for the Slack route.
42
42
  *
43
- * Builds a Slack-scoped principal from the verified mention. When the
44
- * inbound event carries a workspace id, the principal is
45
- * `slack:<teamId>:<userId>` (globally unique across workspaces, the
46
- * right default for multi-workspace deployments). When `teamId` is
47
- * absent — the common single-workspace case — the principal falls back
48
- * to `slack:<userId>`, which is unique within the only workspace the
49
- * bot ever sees.
43
+ * Builds a Slack-scoped principal from the verified mention. Human
44
+ * mentions become `user` principals; bot-authored mentions become
45
+ * `service` principals so authored routes can distinguish automation
46
+ * callers from people.
47
+ *
48
+ * When the inbound event carries a workspace id, human principals use
49
+ * `slack:<teamId>:<userId>` and bot principals use
50
+ * `slack:<teamId>:bot:<userId>`. When `teamId` is absent — the common
51
+ * single-workspace case — the identifiers fall back to
52
+ * `slack:<userId>` and `slack:bot:<userId>`.
50
53
  *
51
54
  * Use a hand-written {@link AuthFn} when you need richer behavior:
52
55
  * looking up internal user ids, gating on workspace allowlists, or
@@ -55,44 +58,61 @@ import { withAuth } from "../auth.js";
55
58
  export function slackUser() {
56
59
  return (event) => {
57
60
  const attributes = {
61
+ author_type: event.authorType,
58
62
  channel_id: event.channelId,
63
+ full_name: event.fullName,
59
64
  thread_ts: event.threadTs,
60
65
  user_id: event.userId,
66
+ user_name: event.userName,
61
67
  };
62
68
  if (event.teamId !== undefined) {
63
69
  attributes.team_id = event.teamId;
64
70
  }
71
+ const principalId = event.teamId !== undefined
72
+ ? event.authorType === "bot"
73
+ ? `slack:${event.teamId}:bot:${event.userId}`
74
+ : `slack:${event.teamId}:${event.userId}`
75
+ : event.authorType === "bot"
76
+ ? `slack:bot:${event.userId}`
77
+ : `slack:${event.userId}`;
65
78
  return {
66
79
  attributes,
67
80
  authenticator: "slack-webhook",
68
81
  issuer: event.teamId !== undefined ? `slack:${event.teamId}` : "slack",
69
- principalId: event.teamId !== undefined
70
- ? `slack:${event.teamId}:${event.userId}`
71
- : `slack:${event.userId}`,
72
- principalType: "user",
82
+ principalId,
83
+ principalType: event.authorType === "bot" ? "service" : "user",
73
84
  };
74
85
  };
75
86
  }
76
87
  /**
77
- * Returns the framework's default Slack {@link Channel} implementation.
88
+ * Returns the framework's default Slack {@link Route} implementation.
78
89
  *
79
- * The returned channel handles `POST` Slack webhooks. The URL path is
80
- * derived from the channel file's location under `agent/channels/`.
90
+ * The returned route handles `POST` Slack webhooks. The URL path is
91
+ * derived from the route file's location under `agent/channels/`.
81
92
  *
82
- * `input` is optional — `slackChannel()` is equivalent to
83
- * `slackChannel({ auth: slackUser() })` and reads `SLACK_BOT_TOKEN` /
93
+ * `input` is optional — `slackRoute()` is equivalent to
94
+ * `slackRoute({ auth: slackUser() })` and reads `SLACK_BOT_TOKEN` /
84
95
  * `SLACK_SIGNING_SECRET` from the environment via the chat SDK's own
85
96
  * defaults.
86
97
  */
87
- export function slackChannel(input = {}) {
98
+ export function slackRoute(input = {}) {
88
99
  const resolveAuth = input.auth ?? slackUser();
89
- return defineChannel({
100
+ if (input.channel !== undefined && !(input.channel.prototype instanceof SlackChannel)) {
101
+ throw new TypeError("slackRoute: `channel` must extend `SlackChannel`.");
102
+ }
103
+ if (input.channel !== undefined &&
104
+ input.channel !== SlackChannel &&
105
+ input.channel.kind === SlackChannel.kind) {
106
+ throw new TypeError('slackRoute: custom channel classes must declare a unique static `kind` instead of inheriting "slack".');
107
+ }
108
+ return defineRoute({
90
109
  method: "POST",
110
+ serializableChannels: input.channel !== undefined ? [input.channel] : undefined,
91
111
  async fetch(request, ctx) {
92
112
  // Dynamically import the chat SDK so the public surface stays free
93
113
  // of any third-party type leakage (CLAUDE.md item 8). The dynamic
94
114
  // imports also let bundlers tree-shake Slack support out of agents
95
- // that never construct a slackChannel.
115
+ // that never construct a slackRoute.
96
116
  const [slackModule, stateModule, chatModule] = (await Promise.all([
97
117
  import("@chat-adapter/slack"),
98
118
  import("@chat-adapter/state-memory"),
@@ -148,24 +168,49 @@ export function slackChannel(input = {}) {
148
168
  return;
149
169
  }
150
170
  // resolved is either a SessionAuthContext (authenticated) or
151
- // undefined (anonymous, allowed through). withAuth(ctx, null)
152
- // is safe to call in either case — it ensures dispatched
153
- // agent.run/deliver carry the verified principal (or explicit
154
- // null) without the inner emitter having to know which path ran.
171
+ // undefined (anonymous, allowed through).
155
172
  const sessionAuth = resolved ?? null;
156
- const authedCtx = withAuth(ctx, sessionAuth);
157
173
  try {
158
- await authedCtx.agent.deliver({
174
+ await ctx.agent.deliver({
175
+ auth: sessionAuth,
159
176
  continuationToken,
160
177
  payload: { message: event.text },
161
178
  });
162
179
  }
163
180
  catch {
164
- const handle = await authedCtx.agent.run({
165
- channelEmitter: new SlackChannelEmitter({
166
- botToken: input.credentials?.botToken,
167
- serializedThread: thread.toJSON(),
168
- }),
181
+ // Only direct `app_mention` events are allowed to open a new
182
+ // session. Other subscribed Slack events may continue an
183
+ // existing session, but if no session exists yet we drop them
184
+ // instead of treating every event as a root trigger.
185
+ if (event.slackEventType !== "app_mention") {
186
+ console.warn("[slack] dropped non-app mention without active session", {
187
+ channelId: event.channelId,
188
+ eventType: event.slackEventType,
189
+ threadTs: event.threadTs,
190
+ });
191
+ return;
192
+ }
193
+ const userContext = {
194
+ channelId: event.channelId,
195
+ fullName: event.fullName,
196
+ teamId: event.teamId,
197
+ threadTs: event.threadTs,
198
+ userId: event.userId,
199
+ userName: event.userName,
200
+ };
201
+ const handle = await ctx.agent.run({
202
+ auth: sessionAuth,
203
+ channel: input.channel !== undefined
204
+ ? new input.channel({
205
+ botToken: input.credentials?.botToken,
206
+ serializedThread: thread.toJSON(),
207
+ userContext,
208
+ })
209
+ : new SlackChannel({
210
+ botToken: input.credentials?.botToken,
211
+ serializedThread: thread.toJSON(),
212
+ userContext,
213
+ }),
169
214
  continuationToken,
170
215
  input: { message: event.text },
171
216
  mode: "conversation",
@@ -174,6 +219,13 @@ export function slackChannel(input = {}) {
174
219
  ctx.waitUntil(handle.result);
175
220
  }
176
221
  });
222
+ // Slack sends interaction payloads (button clicks, select menus) as
223
+ // form-encoded data, while Events API payloads are JSON. Detect and
224
+ // handle interactions before delegating to the Chat SDK.
225
+ const contentType = request.headers.get("content-type") ?? "";
226
+ if (contentType.includes("application/x-www-form-urlencoded")) {
227
+ return await handleSlackInteraction(request, ctx);
228
+ }
177
229
  return await chat.webhooks.slack(request, {
178
230
  waitUntil: ctx.waitUntil,
179
231
  });
@@ -197,12 +249,6 @@ export function slackChannel(input = {}) {
197
249
  */
198
250
  function projectSlackMention(input) {
199
251
  const { message } = input;
200
- // Drop bot-authored mentions outright — `slack:<teamId>:B...` is not
201
- // a stable user principal. The chat SDK already filters self-bot
202
- // messages; this guards against mentions from third-party bots.
203
- if (message.author.isBot === true) {
204
- return { ok: false, missing: ["author.isBot"] };
205
- }
206
252
  // user id and event ts come straight off the typed Message fields
207
253
  // the chat SDK populated when parsing the inbound webhook.
208
254
  // `message.author.userId` defaults to "unknown" when the underlying
@@ -213,8 +259,13 @@ function projectSlackMention(input) {
213
259
  // it from the typed raw payload when present. Optional: single-
214
260
  // workspace bots don't need it, and the default `slackUser()`
215
261
  // resolver falls back to `slack:<userId>` when teamId is absent.
216
- const raw = message.raw !== null && typeof message.raw === "object" ? message.raw : null;
262
+ const raw = message.raw;
217
263
  const teamId = raw?.team_id ?? raw?.team;
264
+ const slackEventType = raw?.type;
265
+ let authorType = "user";
266
+ if (message.author.isBot === true || raw?.bot_id !== undefined) {
267
+ authorType = "bot";
268
+ }
218
269
  const missing = [];
219
270
  if (!userId)
220
271
  missing.push("user");
@@ -224,15 +275,85 @@ function projectSlackMention(input) {
224
275
  return { ok: false, missing };
225
276
  }
226
277
  const event = {
278
+ authorType,
227
279
  channelId: input.channel,
228
280
  eventTs,
281
+ fullName: message.author.fullName,
229
282
  text: message.text,
230
283
  threadTs: input.threadTs,
231
284
  userId,
285
+ userName: message.author.userName,
232
286
  };
233
287
  if (teamId !== undefined) {
234
288
  event.teamId = teamId;
235
289
  }
290
+ if (slackEventType !== undefined) {
291
+ event.slackEventType = slackEventType;
292
+ }
236
293
  return { ok: true, event };
237
294
  }
295
+ /**
296
+ * Handles Slack interaction payloads (button clicks, select menus)
297
+ * arriving at the same webhook URL as Events API payloads.
298
+ *
299
+ * Slack sends interaction payloads as `application/x-www-form-urlencoded`
300
+ * with a `payload` JSON field. This function parses the payload, maps
301
+ * actions to {@link InputResponse} objects, and delivers them to the
302
+ * parked session.
303
+ */
304
+ async function handleSlackInteraction(request, ctx) {
305
+ let payload;
306
+ try {
307
+ const body = await request.formData();
308
+ const raw = body.get("payload");
309
+ if (typeof raw !== "string") {
310
+ return new Response("ok", { status: 200 });
311
+ }
312
+ payload = JSON.parse(raw);
313
+ }
314
+ catch {
315
+ return new Response("ok", { status: 200 });
316
+ }
317
+ if (payload.type !== "block_actions") {
318
+ return new Response("ok", { status: 200 });
319
+ }
320
+ const channel = payload.channel?.id ?? payload.container?.channel_id;
321
+ const threadTs = payload.message?.thread_ts ?? payload.message?.ts ?? payload.container?.thread_ts;
322
+ if (channel === undefined || threadTs === undefined) {
323
+ return new Response("ok", { status: 200 });
324
+ }
325
+ const continuationToken = `slack:${channel}:${threadTs}`;
326
+ const inputResponses = [];
327
+ for (const action of payload.actions ?? []) {
328
+ if (action.type === "button") {
329
+ const requestId = action.value;
330
+ if (requestId === undefined) {
331
+ continue;
332
+ }
333
+ inputResponses.push({ requestId, optionId: action.action_id });
334
+ }
335
+ else if (action.type === "static_select" || action.type === "external_select") {
336
+ const optionId = action.selected_option?.value;
337
+ if (optionId === undefined) {
338
+ continue;
339
+ }
340
+ const requestId = action.action_id.startsWith("select_")
341
+ ? action.action_id.slice(7)
342
+ : action.action_id;
343
+ inputResponses.push({ requestId, optionId });
344
+ }
345
+ }
346
+ if (inputResponses.length > 0) {
347
+ try {
348
+ await ctx.agent.deliver({
349
+ continuationToken,
350
+ payload: { inputResponses },
351
+ });
352
+ }
353
+ catch (error) {
354
+ console.error("[ash] Slack interaction deliver failed.", error);
355
+ }
356
+ }
357
+ return new Response("ok", { status: 200 });
358
+ }
238
359
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/public/channels/slack/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,EAAgB,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAe,QAAQ,EAAE,MAAM,YAAY,CAAC;AAyFnD;;;;;;;;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AAE,GAAG,EAAE,CAAC,CAAC;AAC7C,CAAC"}
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Lower-level Slack channel primitives for users who write their own
3
- * `fetch` handler instead of using the {@link slackChannel} convenience
3
+ * `fetch` handler instead of using the {@link slackRoute} convenience
4
4
  * factory.
5
5
  *
6
6
  * Today this just re-exports the framework's default
7
- * {@link SlackChannelEmitter} so handcrafted Slack channels can still rely
7
+ * {@link SlackChannel} so handcrafted Slack routes can still rely
8
8
  * on the standard reply behavior. Future additions
9
9
  * (`verifySlackSignature`, `parseSlackEvent`, typed `SlackEvent` unions)
10
- * will live alongside the emitter and remain Ash-owned implementations
10
+ * will live alongside the channel and remain Ash-owned implementations
11
11
  * rather than re-exports of `@chat-adapter/slack` (CLAUDE.md item 8).
12
12
  */
13
- export type { SlackChannelEmitterState } from "../../../channel/slack-emitter.js";
14
- export { SlackChannelEmitter } from "../../../channel/slack-emitter.js";
13
+ export type { SlackChannelState } from "../../../channel/slack-channel.js";
14
+ export { SlackChannel } from "../../../channel/slack-channel.js";
15
15
  //# sourceMappingURL=lowlevel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lowlevel.d.ts","sourceRoot":"","sources":["../../../../../src/public/channels/slack/lowlevel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"lowlevel.d.ts","sourceRoot":"","sources":["../../../../../src/public/channels/slack/lowlevel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC"}