experimental-ash 0.2.0-alpha.9 → 0.3.0-alpha.10

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 (883) hide show
  1. package/README.md +3 -4
  2. package/bin/ash.d.ts +2 -2
  3. package/bin/ash.js +13 -4
  4. package/dist/src/channel/adapter.d.ts +178 -0
  5. package/dist/src/channel/adapter.d.ts.map +1 -0
  6. package/dist/src/channel/adapter.js +47 -0
  7. package/dist/src/channel/adapter.js.map +1 -0
  8. package/dist/src/channel/schedule.d.ts +3 -6
  9. package/dist/src/channel/schedule.d.ts.map +1 -1
  10. package/dist/src/channel/schedule.js +4 -10
  11. package/dist/src/channel/schedule.js.map +1 -1
  12. package/dist/src/channel/slack-adapter.d.ts +116 -0
  13. package/dist/src/channel/slack-adapter.d.ts.map +1 -0
  14. package/dist/src/channel/slack-adapter.js +594 -0
  15. package/dist/src/channel/slack-adapter.js.map +1 -0
  16. package/dist/src/channel/slack-render.d.ts +30 -0
  17. package/dist/src/channel/slack-render.d.ts.map +1 -0
  18. package/dist/src/channel/slack-render.js +244 -0
  19. package/dist/src/channel/slack-render.js.map +1 -0
  20. package/dist/src/channel/slack-state.d.ts +68 -0
  21. package/dist/src/channel/slack-state.d.ts.map +1 -0
  22. package/dist/src/channel/slack-state.js +2 -0
  23. package/dist/src/channel/slack-state.js.map +1 -0
  24. package/dist/src/channel/slack-types.d.ts +187 -0
  25. package/dist/src/channel/slack-types.d.ts.map +1 -0
  26. package/dist/src/channel/slack-types.js +2 -0
  27. package/dist/src/channel/slack-types.js.map +1 -0
  28. package/dist/src/channel/types.d.ts +135 -121
  29. package/dist/src/channel/types.d.ts.map +1 -1
  30. package/dist/src/cli/dev/environment.d.ts.map +1 -1
  31. package/dist/src/cli/dev/input-requests.js +1 -1
  32. package/dist/src/cli/dev/input-requests.js.map +1 -1
  33. package/dist/src/cli/dev/repl.d.ts +28 -1
  34. package/dist/src/cli/dev/repl.d.ts.map +1 -1
  35. package/dist/src/cli/dev/repl.js +547 -123
  36. package/dist/src/cli/dev/repl.js.map +1 -1
  37. package/dist/src/cli/dev/terminal.d.ts +2 -0
  38. package/dist/src/cli/dev/terminal.d.ts.map +1 -1
  39. package/dist/src/cli/dev/terminal.js +69 -3
  40. package/dist/src/cli/dev/terminal.js.map +1 -1
  41. package/dist/src/cli/run.js.map +1 -1
  42. package/dist/src/cli/templates/init-app/package.json +1 -1
  43. package/dist/src/cli/ui/output.d.ts +2 -1
  44. package/dist/src/cli/ui/output.d.ts.map +1 -1
  45. package/dist/src/cli/ui/output.js +9 -0
  46. package/dist/src/cli/ui/output.js.map +1 -1
  47. package/dist/src/client/client-error.d.ts.map +1 -1
  48. package/dist/src/client/client.d.ts.map +1 -1
  49. package/dist/src/client/index.d.ts +2 -2
  50. package/dist/src/client/index.d.ts.map +1 -1
  51. package/dist/src/client/index.js.map +1 -1
  52. package/dist/src/client/message-response.d.ts.map +1 -1
  53. package/dist/src/client/session.d.ts.map +1 -1
  54. package/dist/src/compiler/artifacts.d.ts +0 -1
  55. package/dist/src/compiler/artifacts.d.ts.map +1 -1
  56. package/dist/src/compiler/artifacts.js +0 -6
  57. package/dist/src/compiler/artifacts.js.map +1 -1
  58. package/dist/src/compiler/compile-agent.d.ts +6 -0
  59. package/dist/src/compiler/compile-agent.d.ts.map +1 -1
  60. package/dist/src/compiler/compile-agent.js +4 -2
  61. package/dist/src/compiler/compile-agent.js.map +1 -1
  62. package/dist/src/compiler/compile-from-memory.d.ts +84 -0
  63. package/dist/src/compiler/compile-from-memory.d.ts.map +1 -0
  64. package/dist/src/compiler/compile-from-memory.js +61 -0
  65. package/dist/src/compiler/compile-from-memory.js.map +1 -0
  66. package/dist/src/compiler/manifest.d.ts +50 -24
  67. package/dist/src/compiler/manifest.d.ts.map +1 -1
  68. package/dist/src/compiler/manifest.js +17 -3
  69. package/dist/src/compiler/manifest.js.map +1 -1
  70. package/dist/src/compiler/module-map.d.ts +9 -1
  71. package/dist/src/compiler/module-map.d.ts.map +1 -1
  72. package/dist/src/compiler/module-map.js +25 -1
  73. package/dist/src/compiler/module-map.js.map +1 -1
  74. package/dist/src/compiler/normalize-agent-config.js +4 -10
  75. package/dist/src/compiler/normalize-agent-config.js.map +1 -1
  76. package/dist/src/compiler/normalize-channel.d.ts +1 -1
  77. package/dist/src/compiler/normalize-channel.js +3 -3
  78. package/dist/src/compiler/normalize-channel.js.map +1 -1
  79. package/dist/src/compiler/normalize-connection.d.ts +14 -0
  80. package/dist/src/compiler/normalize-connection.d.ts.map +1 -0
  81. package/dist/src/compiler/normalize-connection.js +29 -0
  82. package/dist/src/compiler/normalize-connection.js.map +1 -0
  83. package/dist/src/compiler/normalize-manifest.d.ts.map +1 -1
  84. package/dist/src/compiler/normalize-manifest.js +2 -0
  85. package/dist/src/compiler/normalize-manifest.js.map +1 -1
  86. package/dist/src/compiler/normalize-sandbox.d.ts +3 -3
  87. package/dist/src/compiler/normalize-sandbox.js +3 -3
  88. package/dist/src/context/accessors.d.ts +32 -15
  89. package/dist/src/context/accessors.d.ts.map +1 -1
  90. package/dist/src/context/accessors.js +45 -29
  91. package/dist/src/context/accessors.js.map +1 -1
  92. package/dist/src/context/container.d.ts +55 -16
  93. package/dist/src/context/container.d.ts.map +1 -1
  94. package/dist/src/context/container.js +84 -16
  95. package/dist/src/context/container.js.map +1 -1
  96. package/dist/src/context/key.d.ts +48 -59
  97. package/dist/src/context/key.d.ts.map +1 -1
  98. package/dist/src/context/key.js +17 -52
  99. package/dist/src/context/key.js.map +1 -1
  100. package/dist/src/context/keys.d.ts +4 -13
  101. package/dist/src/context/keys.d.ts.map +1 -1
  102. package/dist/src/context/keys.js +13 -28
  103. package/dist/src/context/keys.js.map +1 -1
  104. package/dist/src/context/node.d.ts +2 -2
  105. package/dist/src/context/node.d.ts.map +1 -1
  106. package/dist/src/context/node.js +1 -1
  107. package/dist/src/context/node.js.map +1 -1
  108. package/dist/src/context/provider.d.ts +23 -10
  109. package/dist/src/context/provider.d.ts.map +1 -1
  110. package/dist/src/context/providers/connection.d.ts +4 -0
  111. package/dist/src/context/providers/connection.d.ts.map +1 -0
  112. package/dist/src/context/providers/connection.js +18 -0
  113. package/dist/src/context/providers/connection.js.map +1 -0
  114. package/dist/src/context/providers/sandbox.d.ts +2 -2
  115. package/dist/src/context/providers/sandbox.d.ts.map +1 -1
  116. package/dist/src/context/providers/sandbox.js +5 -3
  117. package/dist/src/context/providers/sandbox.js.map +1 -1
  118. package/dist/src/context/providers/session.d.ts +2 -2
  119. package/dist/src/context/providers/session.d.ts.map +1 -1
  120. package/dist/src/context/providers/session.js +4 -4
  121. package/dist/src/context/providers/session.js.map +1 -1
  122. package/dist/src/context/providers/skill.d.ts +2 -2
  123. package/dist/src/context/providers/skill.d.ts.map +1 -1
  124. package/dist/src/context/providers/skill.js +4 -17
  125. package/dist/src/context/providers/skill.js.map +1 -1
  126. package/dist/src/context/run-step.d.ts +9 -10
  127. package/dist/src/context/run-step.d.ts.map +1 -1
  128. package/dist/src/context/run-step.js +32 -25
  129. package/dist/src/context/run-step.js.map +1 -1
  130. package/dist/src/context/seed-keys.d.ts +21 -0
  131. package/dist/src/context/seed-keys.d.ts.map +1 -0
  132. package/dist/src/context/seed-keys.js +19 -0
  133. package/dist/src/context/seed-keys.js.map +1 -0
  134. package/dist/src/context/serialize.d.ts +3 -3
  135. package/dist/src/context/serialize.d.ts.map +1 -1
  136. package/dist/src/context/serialize.js +15 -4
  137. package/dist/src/context/serialize.js.map +1 -1
  138. package/dist/src/discover/connections.d.ts +49 -0
  139. package/dist/src/discover/connections.d.ts.map +1 -0
  140. package/dist/src/discover/connections.js +169 -0
  141. package/dist/src/discover/connections.js.map +1 -0
  142. package/dist/src/discover/discover-agent.d.ts +10 -1
  143. package/dist/src/discover/discover-agent.d.ts.map +1 -1
  144. package/dist/src/discover/discover-agent.js +36 -16
  145. package/dist/src/discover/discover-agent.js.map +1 -1
  146. package/dist/src/discover/discover-subagent.d.ts +6 -0
  147. package/dist/src/discover/discover-subagent.d.ts.map +1 -1
  148. package/dist/src/discover/discover-subagent.js +27 -9
  149. package/dist/src/discover/discover-subagent.js.map +1 -1
  150. package/dist/src/discover/filesystem.d.ts +3 -3
  151. package/dist/src/discover/filesystem.d.ts.map +1 -1
  152. package/dist/src/discover/filesystem.js +11 -4
  153. package/dist/src/discover/filesystem.js.map +1 -1
  154. package/dist/src/discover/grammar.d.ts +43 -13
  155. package/dist/src/discover/grammar.d.ts.map +1 -1
  156. package/dist/src/discover/grammar.js +42 -27
  157. package/dist/src/discover/grammar.js.map +1 -1
  158. package/dist/src/discover/lib.d.ts +3 -4
  159. package/dist/src/discover/lib.d.ts.map +1 -1
  160. package/dist/src/discover/lib.js +3 -1
  161. package/dist/src/discover/lib.js.map +1 -1
  162. package/dist/src/discover/manifest.d.ts +41 -16
  163. package/dist/src/discover/manifest.d.ts.map +1 -1
  164. package/dist/src/discover/manifest.js +11 -1
  165. package/dist/src/discover/manifest.js.map +1 -1
  166. package/dist/src/discover/markdown.d.ts +4 -2
  167. package/dist/src/discover/markdown.d.ts.map +1 -1
  168. package/dist/src/discover/markdown.js +3 -4
  169. package/dist/src/discover/markdown.js.map +1 -1
  170. package/dist/src/discover/project-source.d.ts +128 -0
  171. package/dist/src/discover/project-source.d.ts.map +1 -0
  172. package/dist/src/discover/project-source.js +153 -0
  173. package/dist/src/discover/project-source.js.map +1 -0
  174. package/dist/src/discover/project.d.ts +12 -3
  175. package/dist/src/discover/project.d.ts.map +1 -1
  176. package/dist/src/discover/project.js +34 -31
  177. package/dist/src/discover/project.js.map +1 -1
  178. package/dist/src/discover/resource-tree.d.ts +4 -2
  179. package/dist/src/discover/resource-tree.d.ts.map +1 -1
  180. package/dist/src/discover/resource-tree.js +4 -3
  181. package/dist/src/discover/resource-tree.js.map +1 -1
  182. package/dist/src/discover/sandboxes.d.ts +24 -47
  183. package/dist/src/discover/sandboxes.d.ts.map +1 -1
  184. package/dist/src/discover/sandboxes.js +102 -195
  185. package/dist/src/discover/sandboxes.js.map +1 -1
  186. package/dist/src/discover/skills.d.ts +6 -0
  187. package/dist/src/discover/skills.d.ts.map +1 -1
  188. package/dist/src/discover/skills.js +15 -29
  189. package/dist/src/discover/skills.js.map +1 -1
  190. package/dist/src/discover/system.d.ts +3 -2
  191. package/dist/src/discover/system.d.ts.map +1 -1
  192. package/dist/src/discover/system.js +2 -0
  193. package/dist/src/discover/system.js.map +1 -1
  194. package/dist/src/evals/reporters/index.js.map +1 -1
  195. package/dist/src/evals/runner/derive-run-facts.js.map +1 -1
  196. package/dist/src/evals/runner/reporters/braintrust.js.map +1 -1
  197. package/dist/src/evals/runner/reporters/console.d.ts.map +1 -1
  198. package/dist/src/execution/continuous-entry.d.ts +28 -27
  199. package/dist/src/execution/continuous-entry.d.ts.map +1 -1
  200. package/dist/src/execution/continuous-entry.js +208 -35
  201. package/dist/src/execution/continuous-entry.js.map +1 -1
  202. package/dist/src/execution/continuous-runtime.d.ts +1 -1
  203. package/dist/src/execution/continuous-runtime.d.ts.map +1 -1
  204. package/dist/src/execution/continuous-runtime.js +35 -10
  205. package/dist/src/execution/continuous-runtime.js.map +1 -1
  206. package/dist/src/execution/node-step.d.ts.map +1 -1
  207. package/dist/src/execution/node-step.js +34 -20
  208. package/dist/src/execution/node-step.js.map +1 -1
  209. package/dist/src/execution/runtime-context.d.ts +8 -3
  210. package/dist/src/execution/runtime-context.d.ts.map +1 -1
  211. package/dist/src/execution/runtime-context.js +11 -7
  212. package/dist/src/execution/runtime-context.js.map +1 -1
  213. package/dist/src/execution/sandboxes/bash-tool.d.ts +20 -8
  214. package/dist/src/execution/sandboxes/bash-tool.d.ts.map +1 -1
  215. package/dist/src/execution/sandboxes/bash-tool.js +34 -10
  216. package/dist/src/execution/sandboxes/bash-tool.js.map +1 -1
  217. package/dist/src/execution/sandboxes/bindings/local.js +6 -5
  218. package/dist/src/execution/sandboxes/bindings/local.js.map +1 -1
  219. package/dist/src/execution/sandboxes/bindings/vercel.d.ts.map +1 -1
  220. package/dist/src/execution/sandboxes/bindings/vercel.js +55 -20
  221. package/dist/src/execution/sandboxes/bindings/vercel.js.map +1 -1
  222. package/dist/src/execution/sandboxes/ensure.d.ts +9 -8
  223. package/dist/src/execution/sandboxes/ensure.d.ts.map +1 -1
  224. package/dist/src/execution/sandboxes/ensure.js +21 -26
  225. package/dist/src/execution/sandboxes/ensure.js.map +1 -1
  226. package/dist/src/execution/sandboxes/glob-tool.d.ts +14 -6
  227. package/dist/src/execution/sandboxes/glob-tool.d.ts.map +1 -1
  228. package/dist/src/execution/sandboxes/glob-tool.js +138 -22
  229. package/dist/src/execution/sandboxes/glob-tool.js.map +1 -1
  230. package/dist/src/execution/sandboxes/grep-tool.d.ts +11 -6
  231. package/dist/src/execution/sandboxes/grep-tool.d.ts.map +1 -1
  232. package/dist/src/execution/sandboxes/grep-tool.js +137 -50
  233. package/dist/src/execution/sandboxes/grep-tool.js.map +1 -1
  234. package/dist/src/execution/sandboxes/prewarm.d.ts +1 -1
  235. package/dist/src/execution/sandboxes/prewarm.d.ts.map +1 -1
  236. package/dist/src/execution/sandboxes/prewarm.js +83 -37
  237. package/dist/src/execution/sandboxes/prewarm.js.map +1 -1
  238. package/dist/src/execution/sandboxes/read-file-tool.d.ts +4 -5
  239. package/dist/src/execution/sandboxes/read-file-tool.d.ts.map +1 -1
  240. package/dist/src/execution/sandboxes/read-file-tool.js +11 -18
  241. package/dist/src/execution/sandboxes/read-file-tool.js.map +1 -1
  242. package/dist/src/execution/sandboxes/require-sandbox.d.ts +5 -4
  243. package/dist/src/execution/sandboxes/require-sandbox.d.ts.map +1 -1
  244. package/dist/src/execution/sandboxes/require-sandbox.js +9 -8
  245. package/dist/src/execution/sandboxes/require-sandbox.js.map +1 -1
  246. package/dist/src/execution/sandboxes/ripgrep-probe.d.ts +10 -0
  247. package/dist/src/execution/sandboxes/ripgrep-probe.d.ts.map +1 -0
  248. package/dist/src/execution/sandboxes/ripgrep-probe.js +45 -0
  249. package/dist/src/execution/sandboxes/ripgrep-probe.js.map +1 -0
  250. package/dist/src/execution/sandboxes/session.d.ts +9 -0
  251. package/dist/src/execution/sandboxes/session.d.ts.map +1 -1
  252. package/dist/src/execution/sandboxes/session.js +4 -0
  253. package/dist/src/execution/sandboxes/session.js.map +1 -1
  254. package/dist/src/execution/sandboxes/truncate-output.d.ts +73 -0
  255. package/dist/src/execution/sandboxes/truncate-output.d.ts.map +1 -0
  256. package/dist/src/execution/sandboxes/truncate-output.js +111 -0
  257. package/dist/src/execution/sandboxes/truncate-output.js.map +1 -0
  258. package/dist/src/execution/sandboxes/types.d.ts +2 -3
  259. package/dist/src/execution/sandboxes/types.d.ts.map +1 -1
  260. package/dist/src/execution/sandboxes/write-file-tool.d.ts +4 -5
  261. package/dist/src/execution/sandboxes/write-file-tool.d.ts.map +1 -1
  262. package/dist/src/execution/sandboxes/write-file-tool.js +9 -13
  263. package/dist/src/execution/sandboxes/write-file-tool.js.map +1 -1
  264. package/dist/src/execution/session-snapshot.d.ts +21 -0
  265. package/dist/src/execution/session-snapshot.d.ts.map +1 -0
  266. package/dist/src/execution/session-snapshot.js +58 -0
  267. package/dist/src/execution/session-snapshot.js.map +1 -0
  268. package/dist/src/execution/session-start.d.ts +16 -0
  269. package/dist/src/execution/session-start.d.ts.map +1 -0
  270. package/dist/src/execution/session-start.js +55 -0
  271. package/dist/src/execution/session-start.js.map +1 -0
  272. package/dist/src/execution/session.d.ts +17 -13
  273. package/dist/src/execution/session.d.ts.map +1 -1
  274. package/dist/src/execution/session.js +19 -16
  275. package/dist/src/execution/session.js.map +1 -1
  276. package/dist/src/execution/skills/access.d.ts.map +1 -1
  277. package/dist/src/execution/skills/instructions.d.ts +6 -6
  278. package/dist/src/execution/skills/instructions.d.ts.map +1 -1
  279. package/dist/src/execution/skills/instructions.js +15 -15
  280. package/dist/src/execution/skills/instructions.js.map +1 -1
  281. package/dist/src/execution/skills/types.d.ts +4 -4
  282. package/dist/src/execution/skills/types.d.ts.map +1 -1
  283. package/dist/src/execution/subagent-invocation.d.ts +11 -2
  284. package/dist/src/execution/subagent-invocation.d.ts.map +1 -1
  285. package/dist/src/execution/subagent-invocation.js.map +1 -1
  286. package/dist/src/execution/subagent-tool.d.ts +27 -26
  287. package/dist/src/execution/subagent-tool.d.ts.map +1 -1
  288. package/dist/src/execution/subagent-tool.js +45 -77
  289. package/dist/src/execution/subagent-tool.js.map +1 -1
  290. package/dist/src/execution/tool-compaction.js +2 -2
  291. package/dist/src/execution/tool-compaction.js.map +1 -1
  292. package/dist/src/execution/types.d.ts +3 -1
  293. package/dist/src/execution/types.d.ts.map +1 -1
  294. package/dist/src/execution/web-fetch/tool.d.ts +20 -4
  295. package/dist/src/execution/web-fetch/tool.d.ts.map +1 -1
  296. package/dist/src/execution/web-fetch/tool.js +13 -7
  297. package/dist/src/execution/web-fetch/tool.js.map +1 -1
  298. package/dist/src/execution/workflow-entry.d.ts +7 -9
  299. package/dist/src/execution/workflow-entry.d.ts.map +1 -1
  300. package/dist/src/execution/workflow-entry.js +208 -43
  301. package/dist/src/execution/workflow-entry.js.map +1 -1
  302. package/dist/src/execution/workflow-runtime.d.ts.map +1 -1
  303. package/dist/src/execution/workflow-runtime.js +6 -1
  304. package/dist/src/execution/workflow-runtime.js.map +1 -1
  305. package/dist/src/execution/workflow-steps.d.ts +20 -8
  306. package/dist/src/execution/workflow-steps.d.ts.map +1 -1
  307. package/dist/src/execution/workflow-steps.js +186 -23
  308. package/dist/src/execution/workflow-steps.js.map +1 -1
  309. package/dist/src/harness/attachment-staging.d.ts +52 -0
  310. package/dist/src/harness/attachment-staging.d.ts.map +1 -0
  311. package/dist/src/harness/attachment-staging.js +116 -0
  312. package/dist/src/harness/attachment-staging.js.map +1 -0
  313. package/dist/src/harness/compaction.d.ts +13 -9
  314. package/dist/src/harness/compaction.d.ts.map +1 -1
  315. package/dist/src/harness/compaction.js +87 -38
  316. package/dist/src/harness/compaction.js.map +1 -1
  317. package/dist/src/harness/emission.d.ts +11 -42
  318. package/dist/src/harness/emission.d.ts.map +1 -1
  319. package/dist/src/harness/emission.js +78 -237
  320. package/dist/src/harness/emission.js.map +1 -1
  321. package/dist/src/harness/execute-tool.d.ts +24 -35
  322. package/dist/src/harness/execute-tool.d.ts.map +1 -1
  323. package/dist/src/harness/execute-tool.js +1 -58
  324. package/dist/src/harness/execute-tool.js.map +1 -1
  325. package/dist/src/harness/input-requests.d.ts +2 -0
  326. package/dist/src/harness/input-requests.d.ts.map +1 -1
  327. package/dist/src/harness/input-requests.js +27 -16
  328. package/dist/src/harness/input-requests.js.map +1 -1
  329. package/dist/src/harness/instrumentation-config.d.ts +18 -0
  330. package/dist/src/harness/instrumentation-config.d.ts.map +1 -0
  331. package/dist/src/harness/instrumentation-config.js +32 -0
  332. package/dist/src/harness/instrumentation-config.js.map +1 -0
  333. package/dist/src/harness/messages.d.ts +28 -6
  334. package/dist/src/harness/messages.d.ts.map +1 -1
  335. package/dist/src/harness/messages.js +56 -11
  336. package/dist/src/harness/messages.js.map +1 -1
  337. package/dist/src/harness/otel-integration.d.ts +10 -0
  338. package/dist/src/harness/otel-integration.d.ts.map +1 -0
  339. package/dist/src/harness/otel-integration.js +19 -0
  340. package/dist/src/harness/otel-integration.js.map +1 -0
  341. package/dist/src/harness/provider-tools.js.map +1 -1
  342. package/dist/src/harness/runtime-actions.d.ts +106 -0
  343. package/dist/src/harness/runtime-actions.d.ts.map +1 -0
  344. package/dist/src/harness/runtime-actions.js +261 -0
  345. package/dist/src/harness/runtime-actions.js.map +1 -0
  346. package/dist/src/harness/step-hooks.d.ts +67 -0
  347. package/dist/src/harness/step-hooks.d.ts.map +1 -0
  348. package/dist/src/harness/step-hooks.js +215 -0
  349. package/dist/src/harness/step-hooks.js.map +1 -0
  350. package/dist/src/harness/tool-loop.d.ts +0 -12
  351. package/dist/src/harness/tool-loop.d.ts.map +1 -1
  352. package/dist/src/harness/tool-loop.js +409 -162
  353. package/dist/src/harness/tool-loop.js.map +1 -1
  354. package/dist/src/harness/tool-result-pruning.d.ts +40 -0
  355. package/dist/src/harness/tool-result-pruning.d.ts.map +1 -0
  356. package/dist/src/harness/tool-result-pruning.js +142 -0
  357. package/dist/src/harness/tool-result-pruning.js.map +1 -0
  358. package/dist/src/harness/tools.d.ts +12 -3
  359. package/dist/src/harness/tools.d.ts.map +1 -1
  360. package/dist/src/harness/tools.js +22 -25
  361. package/dist/src/harness/tools.js.map +1 -1
  362. package/dist/src/harness/types.d.ts +32 -15
  363. package/dist/src/harness/types.d.ts.map +1 -1
  364. package/dist/src/internal/application/compiled-artifacts.d.ts +19 -3
  365. package/dist/src/internal/application/compiled-artifacts.d.ts.map +1 -1
  366. package/dist/src/internal/application/compiled-artifacts.js +64 -41
  367. package/dist/src/internal/application/compiled-artifacts.js.map +1 -1
  368. package/dist/src/internal/application/package.d.ts +0 -4
  369. package/dist/src/internal/application/package.d.ts.map +1 -1
  370. package/dist/src/internal/application/package.js +14 -24
  371. package/dist/src/internal/application/package.js.map +1 -1
  372. package/dist/src/internal/application/paths.d.ts +6 -1
  373. package/dist/src/internal/application/paths.d.ts.map +1 -1
  374. package/dist/src/internal/application/paths.js +12 -2
  375. package/dist/src/internal/application/paths.js.map +1 -1
  376. package/dist/src/internal/attachments/data.d.ts +36 -0
  377. package/dist/src/internal/attachments/data.d.ts.map +1 -0
  378. package/dist/src/internal/attachments/data.js +192 -0
  379. package/dist/src/internal/attachments/data.js.map +1 -0
  380. package/dist/src/internal/attachments/errors.d.ts +58 -0
  381. package/dist/src/internal/attachments/errors.d.ts.map +1 -0
  382. package/dist/src/internal/attachments/errors.js +37 -0
  383. package/dist/src/internal/attachments/errors.js.map +1 -0
  384. package/dist/src/internal/attachments/refs.d.ts +88 -0
  385. package/dist/src/internal/attachments/refs.d.ts.map +1 -0
  386. package/dist/src/internal/attachments/refs.js +118 -0
  387. package/dist/src/internal/attachments/refs.js.map +1 -0
  388. package/dist/src/internal/authored-definition/channel.d.ts +3 -3
  389. package/dist/src/internal/authored-definition/channel.d.ts.map +1 -1
  390. package/dist/src/internal/authored-definition/channel.js +5 -4
  391. package/dist/src/internal/authored-definition/channel.js.map +1 -1
  392. package/dist/src/internal/authored-definition/connection.d.ts +10 -0
  393. package/dist/src/internal/authored-definition/connection.d.ts.map +1 -0
  394. package/dist/src/internal/authored-definition/connection.js +147 -0
  395. package/dist/src/internal/authored-definition/connection.js.map +1 -0
  396. package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -2
  397. package/dist/src/internal/authored-definition/schema-backed.d.ts.map +1 -1
  398. package/dist/src/internal/authored-definition/schema-backed.js.map +1 -1
  399. package/dist/src/internal/authored-module.d.ts.map +1 -1
  400. package/dist/src/internal/authored-module.js +2 -2
  401. package/dist/src/internal/authored-module.js.map +1 -1
  402. package/dist/src/internal/json-schema.d.ts +2 -1
  403. package/dist/src/internal/json-schema.d.ts.map +1 -1
  404. package/dist/src/internal/json-schema.js.map +1 -1
  405. package/dist/src/internal/message/builder.d.ts +9 -5
  406. package/dist/src/internal/message/builder.d.ts.map +1 -1
  407. package/dist/src/internal/message/builder.js +107 -54
  408. package/dist/src/internal/message/builder.js.map +1 -1
  409. package/dist/src/internal/message/nitro-step-entry.d.ts +18 -0
  410. package/dist/src/internal/message/nitro-step-entry.d.ts.map +1 -0
  411. package/dist/src/internal/message/nitro-step-entry.js +132 -0
  412. package/dist/src/internal/message/nitro-step-entry.js.map +1 -0
  413. package/dist/src/internal/message/vercel-workflow-output.d.ts +35 -16
  414. package/dist/src/internal/message/vercel-workflow-output.d.ts.map +1 -1
  415. package/dist/src/internal/message/vercel-workflow-output.js +314 -121
  416. package/dist/src/internal/message/vercel-workflow-output.js.map +1 -1
  417. package/dist/src/internal/nitro/host/build-application.d.ts.map +1 -1
  418. package/dist/src/internal/nitro/host/build-application.js +57 -20
  419. package/dist/src/internal/nitro/host/build-application.js.map +1 -1
  420. package/dist/src/internal/nitro/host/configure-message-routes.d.ts +5 -2
  421. package/dist/src/internal/nitro/host/configure-message-routes.d.ts.map +1 -1
  422. package/dist/src/internal/nitro/host/configure-message-routes.js +194 -80
  423. package/dist/src/internal/nitro/host/configure-message-routes.js.map +1 -1
  424. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +9 -2
  425. package/dist/src/internal/nitro/host/create-application-nitro.d.ts.map +1 -1
  426. package/dist/src/internal/nitro/host/create-application-nitro.js +414 -29
  427. package/dist/src/internal/nitro/host/create-application-nitro.js.map +1 -1
  428. package/dist/src/internal/nitro/host/prepare-application-host.d.ts.map +1 -1
  429. package/dist/src/internal/nitro/host/prepare-application-host.js +0 -2
  430. package/dist/src/internal/nitro/host/prepare-application-host.js.map +1 -1
  431. package/dist/src/internal/nitro/host/start-development-server.js.map +1 -1
  432. package/dist/src/internal/nitro/host/types.d.ts +4 -1
  433. package/dist/src/internal/nitro/host/types.d.ts.map +1 -1
  434. package/dist/src/internal/nitro/routes/channel-dispatch.d.ts +10 -18
  435. package/dist/src/internal/nitro/routes/channel-dispatch.d.ts.map +1 -1
  436. package/dist/src/internal/nitro/routes/channel-dispatch.js +16 -45
  437. package/dist/src/internal/nitro/routes/channel-dispatch.js.map +1 -1
  438. package/dist/src/internal/nitro/routes/health.d.ts.map +1 -1
  439. package/dist/src/internal/nitro/routes/home-page/load-home-page-data.js.map +1 -1
  440. package/dist/src/internal/nitro/routes/home.d.ts +0 -5
  441. package/dist/src/internal/nitro/routes/home.d.ts.map +1 -1
  442. package/dist/src/internal/nitro/routes/home.js +2 -18
  443. package/dist/src/internal/nitro/routes/home.js.map +1 -1
  444. package/dist/src/internal/nitro/routes/index.d.ts +2 -7
  445. package/dist/src/internal/nitro/routes/index.d.ts.map +1 -1
  446. package/dist/src/internal/nitro/routes/index.js +2 -19
  447. package/dist/src/internal/nitro/routes/index.js.map +1 -1
  448. package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +10 -3
  449. package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts.map +1 -1
  450. package/dist/src/internal/nitro/routes/runtime-artifacts.js +2 -9
  451. package/dist/src/internal/nitro/routes/runtime-artifacts.js.map +1 -1
  452. package/dist/src/internal/nitro/routes/runtime-stack.d.ts +5 -4
  453. package/dist/src/internal/nitro/routes/runtime-stack.d.ts.map +1 -1
  454. package/dist/src/internal/nitro/routes/runtime-stack.js +7 -7
  455. package/dist/src/internal/nitro/routes/runtime-stack.js.map +1 -1
  456. package/dist/src/internal/nitro/routes/schedule-task.d.ts +7 -7
  457. package/dist/src/internal/nitro/routes/schedule-task.d.ts.map +1 -1
  458. package/dist/src/internal/nitro/routes/schedule-task.js +22 -30
  459. package/dist/src/internal/nitro/routes/schedule-task.js.map +1 -1
  460. package/dist/src/internal/nitro/routes/web-ui/assets/index.js +5 -4
  461. package/dist/src/internal/nitro/routes/web-ui/assets/style.css +1 -1
  462. package/dist/src/internal/nitro/routes/workflow-data.d.ts.map +1 -1
  463. package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts.map +1 -1
  464. package/dist/src/internal/nitro/routes/workflow-run-events.d.ts.map +1 -1
  465. package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts.map +1 -1
  466. package/dist/src/internal/nitro/routes/workflow-run.d.ts.map +1 -1
  467. package/dist/src/internal/nitro/routes/workflow-runs.d.ts.map +1 -1
  468. package/dist/src/internal/runtime-registry.d.ts.map +1 -1
  469. package/dist/src/internal/runtime-registry.js.map +1 -1
  470. package/dist/src/protocol/message.d.ts +117 -8
  471. package/dist/src/protocol/message.d.ts.map +1 -1
  472. package/dist/src/protocol/message.js +158 -3
  473. package/dist/src/protocol/message.js.map +1 -1
  474. package/dist/src/public/channels/auth.d.ts +32 -81
  475. package/dist/src/public/channels/auth.d.ts.map +1 -1
  476. package/dist/src/public/channels/auth.js +23 -86
  477. package/dist/src/public/channels/auth.js.map +1 -1
  478. package/dist/src/public/channels/http.d.ts +57 -16
  479. package/dist/src/public/channels/http.d.ts.map +1 -1
  480. package/dist/src/public/channels/http.js +167 -45
  481. package/dist/src/public/channels/http.js.map +1 -1
  482. package/dist/src/public/channels/index.d.ts +12 -9
  483. package/dist/src/public/channels/index.d.ts.map +1 -1
  484. package/dist/src/public/channels/index.js +10 -8
  485. package/dist/src/public/channels/index.js.map +1 -1
  486. package/dist/src/public/channels/slack/index.d.ts +86 -25
  487. package/dist/src/public/channels/slack/index.d.ts.map +1 -1
  488. package/dist/src/public/channels/slack/index.js +115 -97
  489. package/dist/src/public/channels/slack/index.js.map +1 -1
  490. package/dist/src/public/channels/slack/lowlevel.d.ts +7 -8
  491. package/dist/src/public/channels/slack/lowlevel.d.ts.map +1 -1
  492. package/dist/src/public/channels/slack/lowlevel.js +6 -7
  493. package/dist/src/public/channels/slack/lowlevel.js.map +1 -1
  494. package/dist/src/public/channels/slack/slack-interaction.d.ts +16 -0
  495. package/dist/src/public/channels/slack/slack-interaction.d.ts.map +1 -0
  496. package/dist/src/public/channels/slack/slack-interaction.js +56 -0
  497. package/dist/src/public/channels/slack/slack-interaction.js.map +1 -0
  498. package/dist/src/public/channels/upload-policy.d.ts +120 -0
  499. package/dist/src/public/channels/upload-policy.d.ts.map +1 -0
  500. package/dist/src/public/channels/upload-policy.js +179 -0
  501. package/dist/src/public/channels/upload-policy.js.map +1 -0
  502. package/dist/src/public/connections/index.d.ts +25 -0
  503. package/dist/src/public/connections/index.d.ts.map +1 -0
  504. package/dist/src/public/connections/index.js +24 -0
  505. package/dist/src/public/connections/index.js.map +1 -0
  506. package/dist/src/public/context/index.d.ts +17 -0
  507. package/dist/src/public/context/index.d.ts.map +1 -0
  508. package/dist/src/public/context/index.js +15 -0
  509. package/dist/src/public/context/index.js.map +1 -0
  510. package/dist/src/public/definitions/channel.d.ts +61 -53
  511. package/dist/src/public/definitions/channel.d.ts.map +1 -1
  512. package/dist/src/public/definitions/channel.js +24 -24
  513. package/dist/src/public/definitions/channel.js.map +1 -1
  514. package/dist/src/public/definitions/connections/mcp.d.ts +73 -0
  515. package/dist/src/public/definitions/connections/mcp.d.ts.map +1 -0
  516. package/dist/src/public/definitions/connections/mcp.js +7 -0
  517. package/dist/src/public/definitions/connections/mcp.js.map +1 -0
  518. package/dist/src/public/definitions/instrumentation.d.ts +67 -0
  519. package/dist/src/public/definitions/instrumentation.d.ts.map +1 -0
  520. package/dist/src/public/definitions/instrumentation.js +32 -0
  521. package/dist/src/public/definitions/instrumentation.js.map +1 -0
  522. package/dist/src/public/definitions/sandbox.d.ts +51 -57
  523. package/dist/src/public/definitions/sandbox.d.ts.map +1 -1
  524. package/dist/src/public/definitions/sandbox.js.map +1 -1
  525. package/dist/src/public/definitions/tool.d.ts +92 -33
  526. package/dist/src/public/definitions/tool.d.ts.map +1 -1
  527. package/dist/src/public/definitions/tool.js.map +1 -1
  528. package/dist/src/public/helpers/markdown.js.map +1 -1
  529. package/dist/src/public/index.d.ts +19 -24
  530. package/dist/src/public/index.d.ts.map +1 -1
  531. package/dist/src/public/index.js +19 -16
  532. package/dist/src/public/index.js.map +1 -1
  533. package/dist/src/public/instrumentation/index.d.ts +22 -0
  534. package/dist/src/public/instrumentation/index.d.ts.map +1 -0
  535. package/dist/src/public/instrumentation/index.js +22 -0
  536. package/dist/src/public/instrumentation/index.js.map +1 -0
  537. package/dist/src/public/sandboxes/backends/vercel.js.map +1 -1
  538. package/dist/src/public/sandboxes/defaults.d.ts +2 -1
  539. package/dist/src/public/sandboxes/defaults.d.ts.map +1 -1
  540. package/dist/src/public/sandboxes/defaults.js +5 -9
  541. package/dist/src/public/sandboxes/defaults.js.map +1 -1
  542. package/dist/src/public/sandboxes/index.d.ts +23 -14
  543. package/dist/src/public/sandboxes/index.d.ts.map +1 -1
  544. package/dist/src/public/sandboxes/index.js +22 -13
  545. package/dist/src/public/sandboxes/index.js.map +1 -1
  546. package/dist/src/public/sandboxes/internal.d.ts +2 -2
  547. package/dist/src/public/sandboxes/internal.d.ts.map +1 -1
  548. package/dist/src/public/sandboxes/internal.js +2 -5
  549. package/dist/src/public/sandboxes/internal.js.map +1 -1
  550. package/dist/src/public/schedules/index.d.ts +20 -0
  551. package/dist/src/public/schedules/index.d.ts.map +1 -0
  552. package/dist/src/public/schedules/index.js +20 -0
  553. package/dist/src/public/schedules/index.js.map +1 -0
  554. package/dist/src/public/skills/index.d.ts +24 -0
  555. package/dist/src/public/skills/index.d.ts.map +1 -0
  556. package/dist/src/public/skills/index.js +23 -0
  557. package/dist/src/public/skills/index.js.map +1 -0
  558. package/dist/src/public/subagents/index.d.ts +19 -0
  559. package/dist/src/public/subagents/index.d.ts.map +1 -0
  560. package/dist/src/public/subagents/index.js +19 -0
  561. package/dist/src/public/subagents/index.js.map +1 -0
  562. package/dist/src/public/system/index.d.ts +31 -0
  563. package/dist/src/public/system/index.d.ts.map +1 -0
  564. package/dist/src/public/system/index.js +31 -0
  565. package/dist/src/public/system/index.js.map +1 -0
  566. package/dist/src/public/tools/defaults.d.ts +3 -2
  567. package/dist/src/public/tools/defaults.d.ts.map +1 -1
  568. package/dist/src/public/tools/defaults.js +3 -2
  569. package/dist/src/public/tools/defaults.js.map +1 -1
  570. package/dist/src/public/tools/define-bash-tool.d.ts +10 -33
  571. package/dist/src/public/tools/define-bash-tool.d.ts.map +1 -1
  572. package/dist/src/public/tools/define-bash-tool.js +11 -28
  573. package/dist/src/public/tools/define-bash-tool.js.map +1 -1
  574. package/dist/src/public/tools/define-glob-tool.d.ts +10 -42
  575. package/dist/src/public/tools/define-glob-tool.d.ts.map +1 -1
  576. package/dist/src/public/tools/define-glob-tool.js +11 -37
  577. package/dist/src/public/tools/define-glob-tool.js.map +1 -1
  578. package/dist/src/public/tools/define-grep-tool.d.ts +10 -42
  579. package/dist/src/public/tools/define-grep-tool.d.ts.map +1 -1
  580. package/dist/src/public/tools/define-grep-tool.js +11 -37
  581. package/dist/src/public/tools/define-grep-tool.js.map +1 -1
  582. package/dist/src/public/tools/define-read-file-tool.d.ts +9 -40
  583. package/dist/src/public/tools/define-read-file-tool.d.ts.map +1 -1
  584. package/dist/src/public/tools/define-read-file-tool.js +10 -40
  585. package/dist/src/public/tools/define-read-file-tool.js.map +1 -1
  586. package/dist/src/public/tools/define-write-file-tool.d.ts +10 -40
  587. package/dist/src/public/tools/define-write-file-tool.d.ts.map +1 -1
  588. package/dist/src/public/tools/define-write-file-tool.js +11 -40
  589. package/dist/src/public/tools/define-write-file-tool.js.map +1 -1
  590. package/dist/src/public/tools/index.d.ts +1 -2
  591. package/dist/src/public/tools/index.d.ts.map +1 -1
  592. package/dist/src/public/tools/index.js.map +1 -1
  593. package/dist/src/public/tools/internal.d.ts +1 -1
  594. package/dist/src/public/tools/internal.d.ts.map +1 -1
  595. package/dist/src/public/tools/internal.js +2 -4
  596. package/dist/src/public/tools/internal.js.map +1 -1
  597. package/dist/src/runtime/actions/types.d.ts +28 -87
  598. package/dist/src/runtime/actions/types.d.ts.map +1 -1
  599. package/dist/src/runtime/actions/types.js +15 -104
  600. package/dist/src/runtime/actions/types.js.map +1 -1
  601. package/dist/src/runtime/agent/bootstrap-model-utils.js.map +1 -1
  602. package/dist/src/runtime/agent/bootstrap.d.ts +1 -1
  603. package/dist/src/runtime/agent/bootstrap.d.ts.map +1 -1
  604. package/dist/src/runtime/agent/bootstrap.js +4 -1
  605. package/dist/src/runtime/agent/bootstrap.js.map +1 -1
  606. package/dist/src/runtime/agent/mock-model-adapter.js +16 -12
  607. package/dist/src/runtime/agent/mock-model-adapter.js.map +1 -1
  608. package/dist/src/runtime/agent/resolve-model.js.map +1 -1
  609. package/dist/src/runtime/channels/registry.d.ts +26 -0
  610. package/dist/src/runtime/channels/registry.d.ts.map +1 -0
  611. package/dist/src/runtime/channels/registry.js +72 -0
  612. package/dist/src/runtime/channels/registry.js.map +1 -0
  613. package/dist/src/runtime/connections/mcp-client.d.ts +55 -0
  614. package/dist/src/runtime/connections/mcp-client.d.ts.map +1 -0
  615. package/dist/src/runtime/connections/mcp-client.js +183 -0
  616. package/dist/src/runtime/connections/mcp-client.js.map +1 -0
  617. package/dist/src/runtime/connections/registry.d.ts +39 -0
  618. package/dist/src/runtime/connections/registry.d.ts.map +1 -0
  619. package/dist/src/runtime/connections/registry.js +62 -0
  620. package/dist/src/runtime/connections/registry.js.map +1 -0
  621. package/dist/src/runtime/connections/types.d.ts +79 -0
  622. package/dist/src/runtime/connections/types.d.ts.map +1 -0
  623. package/dist/src/runtime/connections/types.js +9 -0
  624. package/dist/src/runtime/connections/types.js.map +1 -0
  625. package/dist/src/runtime/framework-channels/index.d.ts +3 -3
  626. package/dist/src/runtime/framework-channels/index.d.ts.map +1 -1
  627. package/dist/src/runtime/framework-channels/index.js +8 -6
  628. package/dist/src/runtime/framework-channels/index.js.map +1 -1
  629. package/dist/src/runtime/framework-sandboxes/default.d.ts +2 -2
  630. package/dist/src/runtime/framework-sandboxes/default.js +2 -2
  631. package/dist/src/runtime/framework-tools/ask-question.d.ts +2 -1
  632. package/dist/src/runtime/framework-tools/ask-question.d.ts.map +1 -1
  633. package/dist/src/runtime/framework-tools/ask-question.js.map +1 -1
  634. package/dist/src/runtime/framework-tools/bash.d.ts +2 -1
  635. package/dist/src/runtime/framework-tools/bash.d.ts.map +1 -1
  636. package/dist/src/runtime/framework-tools/bash.js +1 -2
  637. package/dist/src/runtime/framework-tools/bash.js.map +1 -1
  638. package/dist/src/runtime/framework-tools/connection-search.d.ts +63 -0
  639. package/dist/src/runtime/framework-tools/connection-search.d.ts.map +1 -0
  640. package/dist/src/runtime/framework-tools/connection-search.js +163 -0
  641. package/dist/src/runtime/framework-tools/connection-search.js.map +1 -0
  642. package/dist/src/runtime/framework-tools/connection-tools.d.ts +32 -0
  643. package/dist/src/runtime/framework-tools/connection-tools.d.ts.map +1 -0
  644. package/dist/src/runtime/framework-tools/connection-tools.js +72 -0
  645. package/dist/src/runtime/framework-tools/connection-tools.js.map +1 -0
  646. package/dist/src/runtime/framework-tools/file-state.d.ts +5 -11
  647. package/dist/src/runtime/framework-tools/file-state.d.ts.map +1 -1
  648. package/dist/src/runtime/framework-tools/file-state.js +6 -13
  649. package/dist/src/runtime/framework-tools/file-state.js.map +1 -1
  650. package/dist/src/runtime/framework-tools/glob.d.ts +2 -1
  651. package/dist/src/runtime/framework-tools/glob.d.ts.map +1 -1
  652. package/dist/src/runtime/framework-tools/glob.js +1 -2
  653. package/dist/src/runtime/framework-tools/glob.js.map +1 -1
  654. package/dist/src/runtime/framework-tools/grep.d.ts +2 -1
  655. package/dist/src/runtime/framework-tools/grep.d.ts.map +1 -1
  656. package/dist/src/runtime/framework-tools/grep.js +1 -2
  657. package/dist/src/runtime/framework-tools/grep.js.map +1 -1
  658. package/dist/src/runtime/framework-tools/index.d.ts +3 -1
  659. package/dist/src/runtime/framework-tools/index.d.ts.map +1 -1
  660. package/dist/src/runtime/framework-tools/index.js +7 -1
  661. package/dist/src/runtime/framework-tools/index.js.map +1 -1
  662. package/dist/src/runtime/framework-tools/read-file.d.ts +2 -1
  663. package/dist/src/runtime/framework-tools/read-file.d.ts.map +1 -1
  664. package/dist/src/runtime/framework-tools/read-file.js +1 -2
  665. package/dist/src/runtime/framework-tools/read-file.js.map +1 -1
  666. package/dist/src/runtime/framework-tools/skill.d.ts +4 -4
  667. package/dist/src/runtime/framework-tools/skill.d.ts.map +1 -1
  668. package/dist/src/runtime/framework-tools/skill.js +18 -14
  669. package/dist/src/runtime/framework-tools/skill.js.map +1 -1
  670. package/dist/src/runtime/framework-tools/todo.d.ts.map +1 -1
  671. package/dist/src/runtime/framework-tools/todo.js +5 -7
  672. package/dist/src/runtime/framework-tools/todo.js.map +1 -1
  673. package/dist/src/runtime/framework-tools/web-fetch.js +1 -1
  674. package/dist/src/runtime/framework-tools/web-fetch.js.map +1 -1
  675. package/dist/src/runtime/framework-tools/write-file.d.ts +2 -1
  676. package/dist/src/runtime/framework-tools/write-file.d.ts.map +1 -1
  677. package/dist/src/runtime/framework-tools/write-file.js +1 -2
  678. package/dist/src/runtime/framework-tools/write-file.js.map +1 -1
  679. package/dist/src/runtime/input/types.d.ts +3 -3
  680. package/dist/src/runtime/loaders/artifact-paths.d.ts +0 -1
  681. package/dist/src/runtime/loaders/artifact-paths.d.ts.map +1 -1
  682. package/dist/src/runtime/loaders/artifact-paths.js +0 -1
  683. package/dist/src/runtime/loaders/artifact-paths.js.map +1 -1
  684. package/dist/src/runtime/loaders/bundled-artifacts.d.ts +8 -3
  685. package/dist/src/runtime/loaders/bundled-artifacts.d.ts.map +1 -1
  686. package/dist/src/runtime/loaders/bundled-artifacts.js +13 -8
  687. package/dist/src/runtime/loaders/bundled-artifacts.js.map +1 -1
  688. package/dist/src/runtime/loaders/compile-metadata.d.ts.map +1 -1
  689. package/dist/src/runtime/loaders/manifest.d.ts.map +1 -1
  690. package/dist/src/runtime/loaders/module-map.d.ts.map +1 -1
  691. package/dist/src/runtime/loaders/module-map.js +1 -40
  692. package/dist/src/runtime/loaders/module-map.js.map +1 -1
  693. package/dist/src/runtime/prompt/compose.d.ts +4 -1
  694. package/dist/src/runtime/prompt/compose.d.ts.map +1 -1
  695. package/dist/src/runtime/prompt/compose.js +17 -0
  696. package/dist/src/runtime/prompt/compose.js.map +1 -1
  697. package/dist/src/runtime/prompt/connections.d.ts +10 -0
  698. package/dist/src/runtime/prompt/connections.d.ts.map +1 -0
  699. package/dist/src/runtime/prompt/connections.js +24 -0
  700. package/dist/src/runtime/prompt/connections.js.map +1 -0
  701. package/dist/src/runtime/resolve-agent-graph.d.ts.map +1 -1
  702. package/dist/src/runtime/resolve-agent-graph.js +30 -7
  703. package/dist/src/runtime/resolve-agent-graph.js.map +1 -1
  704. package/dist/src/runtime/resolve-agent.d.ts.map +1 -1
  705. package/dist/src/runtime/resolve-agent.js +10 -11
  706. package/dist/src/runtime/resolve-agent.js.map +1 -1
  707. package/dist/src/runtime/resolve-channel.d.ts.map +1 -1
  708. package/dist/src/runtime/resolve-channel.js +1 -0
  709. package/dist/src/runtime/resolve-channel.js.map +1 -1
  710. package/dist/src/runtime/resolve-connection.d.ts +16 -0
  711. package/dist/src/runtime/resolve-connection.d.ts.map +1 -0
  712. package/dist/src/runtime/resolve-connection.js +72 -0
  713. package/dist/src/runtime/resolve-connection.js.map +1 -0
  714. package/dist/src/runtime/resolve-helpers.d.ts.map +1 -1
  715. package/dist/src/runtime/resolve-helpers.js.map +1 -1
  716. package/dist/src/runtime/resolve-tool.d.ts +7 -2
  717. package/dist/src/runtime/resolve-tool.d.ts.map +1 -1
  718. package/dist/src/runtime/resolve-tool.js +69 -27
  719. package/dist/src/runtime/resolve-tool.js.map +1 -1
  720. package/dist/src/runtime/sandboxes/keys.d.ts +8 -0
  721. package/dist/src/runtime/sandboxes/keys.d.ts.map +1 -1
  722. package/dist/src/runtime/sandboxes/keys.js +10 -2
  723. package/dist/src/runtime/sandboxes/keys.js.map +1 -1
  724. package/dist/src/runtime/sandboxes/registry.d.ts +20 -24
  725. package/dist/src/runtime/sandboxes/registry.d.ts.map +1 -1
  726. package/dist/src/runtime/sandboxes/registry.js +10 -13
  727. package/dist/src/runtime/sandboxes/registry.js.map +1 -1
  728. package/dist/src/runtime/schedules/register.d.ts.map +1 -1
  729. package/dist/src/runtime/schedules/register.js.map +1 -1
  730. package/dist/src/runtime/schedules/resolve-schedule.d.ts.map +1 -1
  731. package/dist/src/runtime/schedules/resolve-schedule.js.map +1 -1
  732. package/dist/src/runtime/sessions/auth.d.ts +3 -3
  733. package/dist/src/runtime/sessions/compiled-agent-cache.d.ts +9 -1
  734. package/dist/src/runtime/sessions/compiled-agent-cache.d.ts.map +1 -1
  735. package/dist/src/runtime/sessions/compiled-agent-cache.js +34 -13
  736. package/dist/src/runtime/sessions/compiled-agent-cache.js.map +1 -1
  737. package/dist/src/runtime/sessions/runtime-session.d.ts +75 -0
  738. package/dist/src/runtime/sessions/runtime-session.d.ts.map +1 -0
  739. package/dist/src/runtime/sessions/runtime-session.js +79 -0
  740. package/dist/src/runtime/sessions/runtime-session.js.map +1 -0
  741. package/dist/src/runtime/sessions/turn.d.ts +2 -2
  742. package/dist/src/runtime/sessions/turn.d.ts.map +1 -1
  743. package/dist/src/runtime/skills/fragment-context.d.ts +2 -2
  744. package/dist/src/runtime/skills/fragment-context.d.ts.map +1 -1
  745. package/dist/src/runtime/skills/fragment-context.js +2 -2
  746. package/dist/src/runtime/skills/fragment-context.js.map +1 -1
  747. package/dist/src/runtime/subagents/registry.js.map +1 -1
  748. package/dist/src/runtime/tools/registry.js.map +1 -1
  749. package/dist/src/runtime/types.d.ts +73 -34
  750. package/dist/src/runtime/types.d.ts.map +1 -1
  751. package/dist/src/runtime/workspace/spec.d.ts.map +1 -1
  752. package/dist/src/runtime/workspace/spec.js +4 -6
  753. package/dist/src/runtime/workspace/spec.js.map +1 -1
  754. package/dist/src/runtime/workspace/types.d.ts +7 -24
  755. package/dist/src/runtime/workspace/types.d.ts.map +1 -1
  756. package/dist/src/runtime/workspace/types.js +6 -18
  757. package/dist/src/runtime/workspace/types.js.map +1 -1
  758. package/dist/src/services/dev-client/send-message.d.ts +1 -0
  759. package/dist/src/services/dev-client/send-message.d.ts.map +1 -1
  760. package/dist/src/services/dev-client/send-message.js +4 -0
  761. package/dist/src/services/dev-client/send-message.js.map +1 -1
  762. package/dist/src/services/dev-client/session.js.map +1 -1
  763. package/dist/src/services/host.js.map +1 -1
  764. package/dist/src/{runtime → shared}/json.d.ts +15 -3
  765. package/dist/src/shared/json.d.ts.map +1 -0
  766. package/dist/src/shared/json.js +157 -0
  767. package/dist/src/shared/json.js.map +1 -0
  768. package/dist/src/shared/optional.d.ts +2 -0
  769. package/dist/src/shared/optional.d.ts.map +1 -0
  770. package/dist/src/shared/optional.js +2 -0
  771. package/dist/src/shared/optional.js.map +1 -0
  772. package/dist/src/shared/source-metadata.d.ts +16 -0
  773. package/dist/src/shared/source-metadata.d.ts.map +1 -0
  774. package/dist/src/shared/source-metadata.js +2 -0
  775. package/dist/src/shared/source-metadata.js.map +1 -0
  776. package/dist/src/shared/tool-definition.d.ts +27 -0
  777. package/dist/src/shared/tool-definition.d.ts.map +1 -0
  778. package/dist/src/shared/tool-definition.js +2 -0
  779. package/dist/src/shared/tool-definition.js.map +1 -0
  780. package/docs/external-agent-protocol.md +26 -18
  781. package/docs/internals/README.md +2 -0
  782. package/docs/internals/channels.md +33 -24
  783. package/docs/internals/compiler-and-artifacts.md +7 -2
  784. package/docs/internals/context.md +153 -57
  785. package/docs/internals/discovery.md +22 -18
  786. package/docs/internals/message-runtime.md +19 -9
  787. package/docs/internals/testing.md +238 -0
  788. package/docs/public/README.md +3 -4
  789. package/docs/public/agent-ts.md +9 -1
  790. package/docs/public/auth-and-route-protection.md +11 -7
  791. package/docs/public/channels/README.md +124 -13
  792. package/docs/public/channels/attachments.md +167 -0
  793. package/docs/public/cli-build-and-debugging.md +0 -1
  794. package/docs/public/context-control.md +11 -8
  795. package/docs/public/getting-started.md +11 -2
  796. package/docs/public/human-in-the-loop.md +9 -12
  797. package/docs/public/instrumentation.md +73 -0
  798. package/docs/public/project-layout.md +32 -31
  799. package/docs/public/runs-and-streaming.md +14 -4
  800. package/docs/public/sandboxes.md +105 -161
  801. package/docs/public/session-context.md +173 -16
  802. package/docs/public/skills.md +30 -6
  803. package/docs/public/subagents.md +28 -8
  804. package/docs/public/tools.md +107 -66
  805. package/docs/public/typescript-api.md +79 -35
  806. package/docs/public/vercel-deployment.md +11 -10
  807. package/docs/public/workspace.md +23 -42
  808. package/package.json +78 -35
  809. package/dist/src/channel/emitter-registry.d.ts +0 -34
  810. package/dist/src/channel/emitter-registry.d.ts.map +0 -1
  811. package/dist/src/channel/emitter-registry.js +0 -63
  812. package/dist/src/channel/emitter-registry.js.map +0 -1
  813. package/dist/src/channel/http-emitter.d.ts +0 -18
  814. package/dist/src/channel/http-emitter.d.ts.map +0 -1
  815. package/dist/src/channel/http-emitter.js +0 -26
  816. package/dist/src/channel/http-emitter.js.map +0 -1
  817. package/dist/src/channel/schedule-emitter.d.ts +0 -17
  818. package/dist/src/channel/schedule-emitter.d.ts.map +0 -1
  819. package/dist/src/channel/schedule-emitter.js +0 -25
  820. package/dist/src/channel/schedule-emitter.js.map +0 -1
  821. package/dist/src/channel/slack-emitter.d.ts +0 -67
  822. package/dist/src/channel/slack-emitter.d.ts.map +0 -1
  823. package/dist/src/channel/slack-emitter.js +0 -282
  824. package/dist/src/channel/slack-emitter.js.map +0 -1
  825. package/dist/src/channel/subagent-emitter.d.ts +0 -42
  826. package/dist/src/channel/subagent-emitter.d.ts.map +0 -1
  827. package/dist/src/channel/subagent-emitter.js +0 -56
  828. package/dist/src/channel/subagent-emitter.js.map +0 -1
  829. package/dist/src/compiler/runtime-api-types.d.ts +0 -14
  830. package/dist/src/compiler/runtime-api-types.d.ts.map +0 -1
  831. package/dist/src/compiler/runtime-api-types.js +0 -43
  832. package/dist/src/compiler/runtime-api-types.js.map +0 -1
  833. package/dist/src/context/state.d.ts +0 -27
  834. package/dist/src/context/state.d.ts.map +0 -1
  835. package/dist/src/context/state.js +0 -53
  836. package/dist/src/context/state.js.map +0 -1
  837. package/dist/src/harness/tool-schema.d.ts +0 -13
  838. package/dist/src/harness/tool-schema.d.ts.map +0 -1
  839. package/dist/src/harness/tool-schema.js +0 -33
  840. package/dist/src/harness/tool-schema.js.map +0 -1
  841. package/dist/src/internal/message/nitro-route-shims.d.ts +0 -6
  842. package/dist/src/internal/message/nitro-route-shims.d.ts.map +0 -1
  843. package/dist/src/internal/message/nitro-route-shims.js +0 -38
  844. package/dist/src/internal/message/nitro-route-shims.js.map +0 -1
  845. package/dist/src/internal/message/rewrite-generated-imports.d.ts +0 -15
  846. package/dist/src/internal/message/rewrite-generated-imports.d.ts.map +0 -1
  847. package/dist/src/internal/message/rewrite-generated-imports.js +0 -59
  848. package/dist/src/internal/message/rewrite-generated-imports.js.map +0 -1
  849. package/dist/src/internal/nitro/host/channel-url-matcher.d.ts +0 -35
  850. package/dist/src/internal/nitro/host/channel-url-matcher.d.ts.map +0 -1
  851. package/dist/src/internal/nitro/host/channel-url-matcher.js +0 -57
  852. package/dist/src/internal/nitro/host/channel-url-matcher.js.map +0 -1
  853. package/dist/src/internal/nitro/routes/workflow-flow.d.ts +0 -8
  854. package/dist/src/internal/nitro/routes/workflow-flow.d.ts.map +0 -1
  855. package/dist/src/internal/nitro/routes/workflow-flow.js +0 -9
  856. package/dist/src/internal/nitro/routes/workflow-flow.js.map +0 -1
  857. package/dist/src/internal/nitro/routes/workflow-generated-handler.d.ts +0 -10
  858. package/dist/src/internal/nitro/routes/workflow-generated-handler.d.ts.map +0 -1
  859. package/dist/src/internal/nitro/routes/workflow-generated-handler.js +0 -30
  860. package/dist/src/internal/nitro/routes/workflow-generated-handler.js.map +0 -1
  861. package/dist/src/internal/nitro/routes/workflow-step.d.ts +0 -8
  862. package/dist/src/internal/nitro/routes/workflow-step.d.ts.map +0 -1
  863. package/dist/src/internal/nitro/routes/workflow-step.js +0 -9
  864. package/dist/src/internal/nitro/routes/workflow-step.js.map +0 -1
  865. package/dist/src/internal/nitro/routes/workflow-webhook.d.ts +0 -8
  866. package/dist/src/internal/nitro/routes/workflow-webhook.d.ts.map +0 -1
  867. package/dist/src/internal/nitro/routes/workflow-webhook.js +0 -9
  868. package/dist/src/internal/nitro/routes/workflow-webhook.js.map +0 -1
  869. package/dist/src/internal/nitro/runtime-configuration.d.ts +0 -16
  870. package/dist/src/internal/nitro/runtime-configuration.d.ts.map +0 -1
  871. package/dist/src/internal/nitro/runtime-configuration.js +0 -23
  872. package/dist/src/internal/nitro/runtime-configuration.js.map +0 -1
  873. package/dist/src/internal/nitro/shims/runtime-configuration-plugin.d.ts +0 -10
  874. package/dist/src/internal/nitro/shims/runtime-configuration-plugin.d.ts.map +0 -1
  875. package/dist/src/internal/nitro/shims/runtime-configuration-plugin.js +0 -17
  876. package/dist/src/internal/nitro/shims/runtime-configuration-plugin.js.map +0 -1
  877. package/dist/src/runtime/framework-tools/sandbox-targeting.d.ts +0 -56
  878. package/dist/src/runtime/framework-tools/sandbox-targeting.d.ts.map +0 -1
  879. package/dist/src/runtime/framework-tools/sandbox-targeting.js +0 -88
  880. package/dist/src/runtime/framework-tools/sandbox-targeting.js.map +0 -1
  881. package/dist/src/runtime/json.d.ts.map +0 -1
  882. package/dist/src/runtime/json.js +0 -55
  883. package/dist/src/runtime/json.js.map +0 -1
package/README.md CHANGED
@@ -7,7 +7,7 @@ You author an agent as a directory on disk. The directory is the contract:
7
7
  - `system.md` and `system/` define always-on instructions
8
8
  - `skills/` define optional procedures
9
9
  - `tools/` define typed executable integrations
10
- - `sandboxes/` define isolated command environments
10
+ - `sandbox/` overrides the agent's single sandbox (optional) and seeds workspace files
11
11
  - `channels/` define message ingress and delivery
12
12
  - `subagents/` define specialist child agents
13
13
  - `schedules/` define recurring jobs
@@ -22,7 +22,7 @@ The framework package is `experimental-ash`. The CLI binary is `ash`.
22
22
  - TypeScript where typed runtime behavior matters
23
23
  - Durable message runs and follow-up turns
24
24
  - Inspectable compiled artifacts under `.ash/`
25
- - Shared workspace state plus isolated authored sandboxes
25
+ - Per-agent sandbox with optional authored overrides
26
26
  - A stable HTTP protocol with explicit `continuationToken` and `runId` contracts
27
27
  - A runtime model that keeps channels, harnesses, and workflow execution separate
28
28
 
@@ -51,7 +51,7 @@ my-agent/
51
51
  ├── system/
52
52
  ├── skills/
53
53
  ├── tools/
54
- ├── sandboxes/
54
+ ├── sandbox/
55
55
  ├── channels/
56
56
  ├── subagents/
57
57
  ├── schedules/
@@ -128,4 +128,3 @@ Start here:
128
128
  - [`packages/ash/README.md`](packages/ash/README.md) is the package-facing overview
129
129
  - [`skills/agent/SKILL.md`](skills/agent/SKILL.md) is the app-authoring skill
130
130
  - [`skills/framework/SKILL.md`](skills/framework/SKILL.md) is the internals skill
131
-
package/bin/ash.d.ts CHANGED
@@ -15,9 +15,9 @@ export interface BootstrapOptions {
15
15
  packageRoot?: string;
16
16
 
17
17
  /**
18
- * Absolute path to the TypeScript CLI entrypoint used for bootstrap builds.
18
+ * Absolute path to the tsgo CLI entrypoint used for bootstrap builds.
19
19
  */
20
- tscCliPath?: string;
20
+ tsgoCliPath?: string;
21
21
  }
22
22
 
23
23
  export interface BootstrapCommandOptions {
package/bin/ash.js CHANGED
@@ -18,7 +18,7 @@ function createBootstrapOptions(overrides = {}) {
18
18
  copyAssetsScriptPath:
19
19
  overrides.copyAssetsScriptPath ?? resolve(packageRoot, "scripts", "copy-static-assets.mjs"),
20
20
  packageRoot,
21
- tscCliPath: overrides.tscCliPath,
21
+ tsgoCliPath: overrides.tsgoCliPath,
22
22
  };
23
23
  }
24
24
 
@@ -105,8 +105,17 @@ function inputTsconfigPath({ packageRoot }) {
105
105
  return resolve(packageRoot, "tsconfig.json");
106
106
  }
107
107
 
108
- function resolveTscCliPath({ tscCliPath }) {
109
- return tscCliPath ?? require.resolve("typescript/bin/tsc");
108
+ function resolveTsgoCliPath({ tsgoCliPath }) {
109
+ if (tsgoCliPath) {
110
+ return tsgoCliPath;
111
+ }
112
+
113
+ // The `@typescript/native-preview` package only exports `./package.json`
114
+ // in its `exports` map, so `require.resolve("@typescript/native-preview/bin/tsgo.js")`
115
+ // fails with ERR_PACKAGE_PATH_NOT_EXPORTED. Resolve the package.json
116
+ // (which is exported) and join to the binary path manually.
117
+ const packageJsonPath = require.resolve("@typescript/native-preview/package.json");
118
+ return resolve(dirname(packageJsonPath), "bin", "tsgo.js");
110
119
  }
111
120
 
112
121
  async function runCommand(command, args, options) {
@@ -174,7 +183,7 @@ export async function ensureBuiltCli(overrides = {}, dependencies = {}) {
174
183
 
175
184
  await executeCommand(
176
185
  process.execPath,
177
- [resolveTscCliPath({ tscCliPath: options.tscCliPath }), "-p", "tsconfig.json"],
186
+ [resolveTsgoCliPath({ tsgoCliPath: options.tsgoCliPath }), "-p", "tsconfig.json"],
178
187
  {
179
188
  cwd: options.packageRoot,
180
189
  },
@@ -0,0 +1,178 @@
1
+ import type { ContextAccessor } from "../context/key.js";
2
+ import type { ContextProvider } from "../context/provider.js";
3
+ import type { StepInput } from "../harness/types.js";
4
+ import type { AttachmentRef } from "../internal/attachments/refs.js";
5
+ import type { HandleMessageStreamEvent } from "../protocol/message.js";
6
+ import type { DeliverPayload } from "./types.js";
7
+ /**
8
+ * Context available to every adapter handler (`deliver` and event handlers).
9
+ *
10
+ * `state` is a mutable reference to the adapter's durable state. The runtime
11
+ * auto-snapshots it at step boundaries — no manual `serialize()` needed.
12
+ *
13
+ * `ctx` provides read/write access to durable context keys (the same
14
+ * {@link ContextAccessor} that tools and providers use).
15
+ */
16
+ export interface ChannelAdapterContext<TState = Record<string, unknown>> {
17
+ /**
18
+ * Mutable adapter state. Auto-serialized at step boundaries via
19
+ * JSON snapshot. The adapter reads and writes this directly.
20
+ */
21
+ state: TState;
22
+ /**
23
+ * Read/write access to durable context keys. Seed keys here for tools
24
+ * to read during the turn.
25
+ */
26
+ readonly ctx: ContextAccessor;
27
+ }
28
+ /**
29
+ * Extracts the `data` field type from a stream event by its `type` discriminant.
30
+ * Events that carry no `data` field (e.g. `session.completed`) resolve to `undefined`.
31
+ */
32
+ type EventData<T extends HandleMessageStreamEvent["type"]> = Extract<HandleMessageStreamEvent, {
33
+ type: T;
34
+ }> extends {
35
+ data: infer D;
36
+ } ? D : undefined;
37
+ /**
38
+ * A single outbound event handler. Receives the event's `data` (not the full
39
+ * envelope) and the adapter context. Void return — side effects only.
40
+ */
41
+ type EventHandler<T extends HandleMessageStreamEvent["type"], TCtx extends ChannelAdapterContext<any> = ChannelAdapterContext> = (data: EventData<T>, ctx: TCtx) => void | Promise<void>;
42
+ /**
43
+ * Map of outbound event handlers keyed by event type. The adapter declares
44
+ * handlers for the event types it cares about. For undeclared types, the
45
+ * route's base layer (e.g. `slackRoute`) runs default behavior.
46
+ */
47
+ export type ChannelEventHandlers<TCtx extends ChannelAdapterContext<any> = ChannelAdapterContext> = {
48
+ [K in HandleMessageStreamEvent["type"]]?: EventHandler<K, TCtx>;
49
+ };
50
+ /**
51
+ * Channel-owned resolver that turns an opaque {@link AttachmentRef} back
52
+ * into raw bytes.
53
+ *
54
+ * Attachment refs are the wire format channels use to carry inbound
55
+ * file identity across step boundaries without inlining the payload
56
+ * (inline bytes trip the Vercel Queue 8 KB per-field multipart cap).
57
+ * A channel that ingests file attachments must provide a resolver so
58
+ * the staging layer can re-fetch the bytes on demand at turn time.
59
+ *
60
+ * The resolver is called once per inbound file per turn, inside a
61
+ * workflow step boundary. It has full Node access and can reach any
62
+ * credential the adapter captured at construction time via closure
63
+ * (route options, adapter state, env-derived tokens, etc.).
64
+ *
65
+ * Throw {@link import("../internal/attachments/errors.js").AshAttachmentError}
66
+ * to surface structured failures to observability. Uncategorized
67
+ * throws are wrapped as `resolver-threw` by the staging dispatch.
68
+ */
69
+ export interface AttachmentResolver {
70
+ resolve(ref: AttachmentRef): Promise<Buffer>;
71
+ }
72
+ /**
73
+ * Plain-object adapter that replaces the `Channel` abstract class.
74
+ *
75
+ * An adapter carries:
76
+ * - `kind`: stable durable identifier (like the old static `Channel.kind`)
77
+ * - `state`: initial state shape, auto-serialized at step boundaries
78
+ * - `deliver`: inbound hook (side effects + optional message transform)
79
+ * - Event handlers: outbound, keyed by event type name
80
+ * - `contextProviders`: optional per-step virtual providers
81
+ *
82
+ * Adapters are created via `defineSlackAdapter`, `defineHttpAdapter`, or
83
+ * directly as plain objects. They are NOT classes — no inheritance, no
84
+ * `serialize()`, no constructor rehydration.
85
+ */
86
+ export type ChannelAdapter<TCtx extends ChannelAdapterContext<any> = ChannelAdapterContext> = {
87
+ /**
88
+ * Stable durable identifier for serialization across step boundaries.
89
+ * Must be unique across all adapters visible to one runtime bundle.
90
+ *
91
+ * Optional — defaults to `"http"` for httpRoute, `"slack"` for slackRoute,
92
+ * or derived from the route file path.
93
+ */
94
+ readonly kind?: string;
95
+ /**
96
+ * Initial state shape. Auto-serialized at step boundaries via JSON
97
+ * snapshot. On rehydration, the runtime restores the serialized state
98
+ * and re-attaches the adapter's behavior functions from the registry.
99
+ */
100
+ readonly state?: Record<string, unknown>;
101
+ /**
102
+ * Inbound hook: fires once per delivery before the harness starts.
103
+ *
104
+ * Side effects (context seeding, thread refresh, custom interactions)
105
+ * plus optional message transformation. Return a string to override the
106
+ * message the model sees. Return void to use the original payload message.
107
+ *
108
+ * For Slack adapters, the route's base layer runs AFTER this:
109
+ * 1. Resolves HITL against the ORIGINAL payload.message (not the
110
+ * returned string). Matched inputResponses go to the harness and
111
+ * the return value is ignored.
112
+ * 2. If no HITL to resolve, uses the returned string (or
113
+ * payload.message if void), prepends user context, and produces
114
+ * the StepInput for the harness.
115
+ */
116
+ deliver?(payload: DeliverPayload, ctx: TCtx): StepInput | void | Promise<StepInput | void>;
117
+ /**
118
+ * Optional per-step virtual providers attached to this adapter.
119
+ *
120
+ * The runtime rebuilds these providers after deliver on every step for
121
+ * sessions using this adapter. Replaces the static `contextProviders`
122
+ * field on the old `ChannelClass` interface.
123
+ */
124
+ readonly contextProviders?: readonly ContextProvider<unknown>[];
125
+ /**
126
+ * Optional factory that builds the adapter context for this adapter.
127
+ *
128
+ * The runtime calls this before invoking `deliver` or event handlers.
129
+ * Default returns a bare `ChannelAdapterContext`. Slack adapters override
130
+ * this to return a `SlackAdapterContext` with `ctx.slack`.
131
+ *
132
+ * @internal — set by `createSlackBaseAdapter`, not authored by users.
133
+ */
134
+ readonly createAdapterContext?: (base: ChannelAdapterContext) => ChannelAdapterContext;
135
+ /**
136
+ * Optional resolver that turns an opaque {@link AttachmentRef}
137
+ * produced by this adapter into raw bytes.
138
+ *
139
+ * Channels that produce `FilePart`s whose `data` is an
140
+ * `ash-attachment:` URL must declare a resolver here so the
141
+ * staging layer can re-fetch the bytes at turn time. Channels that
142
+ * never emit refs (test adapters, framework `http` / `schedule` /
143
+ * `subagent` pass-throughs) omit it.
144
+ *
145
+ * Attachment resolvers are stateless handlers — all state (bot
146
+ * tokens, API credentials, cache) lives on the adapter and is
147
+ * captured by closure at construction time. Do not store
148
+ * per-resolve state on the handler.
149
+ */
150
+ readonly attachments?: AttachmentResolver;
151
+ } & ChannelEventHandlers<TCtx>;
152
+ /**
153
+ * Produces the default {@link StepInput} when no custom adapter `deliver`
154
+ * hook is defined.
155
+ *
156
+ * Passes through both `message` and `inputResponses` from the delivery
157
+ * payload so tool-approval responses (and other HITL replies) reach the
158
+ * harness even when the channel has no bespoke deliver logic.
159
+ */
160
+ export declare function defaultDeliverResult(payload: DeliverPayload): StepInput | undefined;
161
+ /**
162
+ * Returns the durable kind for an adapter, falling back to `"unknown"`.
163
+ */
164
+ export declare function getAdapterKind(adapter: ChannelAdapter): string;
165
+ /**
166
+ * Returns the adapter's context providers, defaulting to an empty array.
167
+ */
168
+ export declare function getAdapterContextProviders(adapter: ChannelAdapter): readonly ContextProvider<unknown>[];
169
+ /**
170
+ * Calls an adapter's event handler for a given event. Returns the event
171
+ * unchanged (adapters don't transform events — they perform side effects).
172
+ *
173
+ * If the adapter doesn't declare a handler for the event type, this is a
174
+ * no-op and returns the event as-is.
175
+ */
176
+ export declare function callAdapterEventHandler(adapter: ChannelAdapter, event: HandleMessageStreamEvent, ctx: ChannelAdapterContext): Promise<HandleMessageStreamEvent>;
177
+ export {};
178
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/channel/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrE;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC;CAC/B;AAMD;;;GAGG;AACH,KAAK,SAAS,CAAC,CAAC,SAAS,wBAAwB,CAAC,MAAM,CAAC,IACvD,OAAO,CAAC,wBAAwB,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,SAAS,CAAC;AAE3F;;;GAGG;AACH,KAAK,YAAY,CACf,CAAC,SAAS,wBAAwB,CAAC,MAAM,CAAC,EAC1C,IAAI,SAAS,qBAAqB,CAAC,GAAG,CAAC,GAAG,qBAAqB,IAC7D,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,IAAI,SAAS,qBAAqB,CAAC,GAAG,CAAC,GAAG,qBAAqB,IAC9F;KACG,CAAC,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC;CAChE,CAAC;AAMJ;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9C;AAMD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,cAAc,CAAC,IAAI,SAAS,qBAAqB,CAAC,GAAG,CAAC,GAAG,qBAAqB,IAAI;IAC5F;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAE3F;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;IAEhE;;;;;;;;OAQG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,qBAAqB,CAAC;IAEvF;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAC3C,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;AAM/B;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,GAAG,SAAS,CAUnF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,cAAc,GACtB,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,CAErC;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,wBAAwB,EAC/B,GAAG,EAAE,qBAAqB,GACzB,OAAO,CAAC,wBAAwB,CAAC,CAUnC"}
@@ -0,0 +1,47 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Helpers
3
+ // ---------------------------------------------------------------------------
4
+ /**
5
+ * Produces the default {@link StepInput} when no custom adapter `deliver`
6
+ * hook is defined.
7
+ *
8
+ * Passes through both `message` and `inputResponses` from the delivery
9
+ * payload so tool-approval responses (and other HITL replies) reach the
10
+ * harness even when the channel has no bespoke deliver logic.
11
+ */
12
+ export function defaultDeliverResult(payload) {
13
+ if (payload.message !== undefined) {
14
+ return { inputResponses: payload.inputResponses, message: payload.message };
15
+ }
16
+ if (payload.inputResponses !== undefined && payload.inputResponses.length > 0) {
17
+ return { inputResponses: payload.inputResponses };
18
+ }
19
+ return undefined;
20
+ }
21
+ /**
22
+ * Returns the durable kind for an adapter, falling back to `"unknown"`.
23
+ */
24
+ export function getAdapterKind(adapter) {
25
+ return adapter.kind ?? "unknown";
26
+ }
27
+ /**
28
+ * Returns the adapter's context providers, defaulting to an empty array.
29
+ */
30
+ export function getAdapterContextProviders(adapter) {
31
+ return adapter.contextProviders ?? [];
32
+ }
33
+ /**
34
+ * Calls an adapter's event handler for a given event. Returns the event
35
+ * unchanged (adapters don't transform events — they perform side effects).
36
+ *
37
+ * If the adapter doesn't declare a handler for the event type, this is a
38
+ * no-op and returns the event as-is.
39
+ */
40
+ export async function callAdapterEventHandler(adapter, event, ctx) {
41
+ const handler = adapter[event.type];
42
+ if (handler !== undefined) {
43
+ await handler("data" in event ? event.data : undefined, ctx);
44
+ }
45
+ return event;
46
+ }
47
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/channel/adapter.ts"],"names":[],"mappings":"AAqLA,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAuB;IAC1D,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;IAC9E,CAAC;IAED,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,IAAI,OAAO,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9E,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;IACpD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAuB;IACpD,OAAO,OAAO,CAAC,IAAI,IAAI,SAAS,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAuB;IAEvB,OAAO,OAAO,CAAC,gBAAgB,IAAI,EAAE,CAAC;AACxC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAuB,EACvB,KAA+B,EAC/B,GAA0B;IAE1B,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAErB,CAAC;IAEd,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,6 +1,4 @@
1
- import { ScheduleChannelEmitter } from "./schedule-emitter.js";
2
1
  import type { RunHandle, Runtime } from "./types.js";
3
- export { ScheduleChannelEmitter } from "./schedule-emitter.js";
4
2
  /**
5
3
  * Input for triggering a one-shot schedule run.
6
4
  */
@@ -9,23 +7,22 @@ export interface ScheduleTriggerInput {
9
7
  readonly scheduleId: string;
10
8
  }
11
9
  /**
12
- * Channel for one-shot scheduled task execution.
10
+ * Dispatcher for one-shot scheduled task execution.
13
11
  *
14
12
  * Each trigger generates a unique continuation token so every cron
15
13
  * invocation starts a fresh session. Schedule runs always use task
16
14
  * mode, so the runtime requires the harness to finish within the
17
15
  * current invocation instead of parking for follow-up messages.
18
16
  *
19
- * The channel never touches the compiled bundle, the {@link AshContext},
17
+ * The dispatcher never touches the compiled bundle, the {@link AshContext},
20
18
  * or any execution-layer machinery — it speaks to the runtime through
21
19
  * `run` and `deliver` only.
22
20
  */
23
- export declare class ScheduleChannel {
21
+ export declare class ScheduleDispatcher {
24
22
  private readonly runtime;
25
23
  constructor(config: {
26
24
  readonly runtime: Runtime;
27
25
  });
28
- createEmitter(): ScheduleChannelEmitter;
29
26
  trigger(input: ScheduleTriggerInput): Promise<RunHandle>;
30
27
  }
31
28
  //# sourceMappingURL=schedule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../src/channel/schedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAsB,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,MAAM,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE;IAIjD,aAAa,IAAI,sBAAsB;IAIjC,OAAO,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;CAW/D"}
1
+ {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../src/channel/schedule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAsB,MAAM,YAAY,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,YAAY,MAAM,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAEhD;IAEK,OAAO,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC,CAS7D;CACF"}
@@ -1,34 +1,28 @@
1
- import { ScheduleChannelEmitter } from "./schedule-emitter.js";
2
- export { ScheduleChannelEmitter } from "./schedule-emitter.js";
3
1
  /**
4
- * Channel for one-shot scheduled task execution.
2
+ * Dispatcher for one-shot scheduled task execution.
5
3
  *
6
4
  * Each trigger generates a unique continuation token so every cron
7
5
  * invocation starts a fresh session. Schedule runs always use task
8
6
  * mode, so the runtime requires the harness to finish within the
9
7
  * current invocation instead of parking for follow-up messages.
10
8
  *
11
- * The channel never touches the compiled bundle, the {@link AshContext},
9
+ * The dispatcher never touches the compiled bundle, the {@link AshContext},
12
10
  * or any execution-layer machinery — it speaks to the runtime through
13
11
  * `run` and `deliver` only.
14
12
  */
15
- export class ScheduleChannel {
13
+ export class ScheduleDispatcher {
16
14
  runtime;
17
15
  constructor(config) {
18
16
  this.runtime = config.runtime;
19
17
  }
20
- createEmitter() {
21
- return new ScheduleChannelEmitter();
22
- }
23
18
  async trigger(input) {
24
19
  const continuationToken = `schedule:${input.scheduleId}:${crypto.randomUUID()}`;
25
20
  return await this.runtime.run({
21
+ adapter: { kind: "schedule" },
26
22
  auth: createScheduleAuthContext(input.scheduleId),
27
- channelEmitter: this.createEmitter(),
28
23
  continuationToken,
29
24
  input: { message: input.markdown },
30
25
  mode: "task",
31
- sessionId: crypto.randomUUID(),
32
26
  });
33
27
  }
34
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../src/channel/schedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAU/D;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,eAAe;IACT,OAAO,CAAU;IAElC,YAAY,MAAqC;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,aAAa;QACX,OAAO,IAAI,sBAAsB,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAA2B;QACvC,MAAM,iBAAiB,GAAG,YAAY,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;QAChF,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;YAC5B,IAAI,EAAE,yBAAyB,CAAC,KAAK,CAAC,UAAU,CAAC;YACjD,cAAc,EAAE,IAAI,CAAC,aAAa,EAAE;YACpC,iBAAiB;YACjB,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE;YAClC,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;CACF;AAED,SAAS,yBAAyB,CAAC,UAAkB;IACnD,OAAO;QACL,UAAU,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE;QAC3C,aAAa,EAAE,UAAU;QACzB,MAAM,EAAE,iBAAiB;QACzB,WAAW,EAAE,gBAAgB,UAAU,EAAE;QACzC,aAAa,EAAE,SAAS;QACxB,OAAO,EAAE,UAAU;KACpB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../src/channel/schedule.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAkB;IACZ,OAAO,CAAU;IAElC,YAAY,MAAqC;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAA2B;QACvC,MAAM,iBAAiB,GAAG,YAAY,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;QAChF,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;YAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;YAC7B,IAAI,EAAE,yBAAyB,CAAC,KAAK,CAAC,UAAU,CAAC;YACjD,iBAAiB;YACjB,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE;YAClC,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;IACL,CAAC;CACF;AAED,SAAS,yBAAyB,CAAC,UAAkB;IACnD,OAAO;QACL,UAAU,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE;QAC3C,aAAa,EAAE,UAAU;QACzB,MAAM,EAAE,iBAAiB;QACzB,WAAW,EAAE,gBAAgB,UAAU,EAAE;QACzC,aAAa,EAAE,SAAS;QACxB,OAAO,EAAE,UAAU;KACpB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Slack adapter context, base layer, and factory.
3
+ *
4
+ * The Slack adapter context extends the generic ChannelAdapterContext with
5
+ * a `slack` handle for Slack thread operations. The base layer provides
6
+ * default Slack behaviors (typing, posting, HITL cards) that user adapters
7
+ * can override per event type.
8
+ */
9
+ import type { FilePart } from "ai";
10
+ import { type UploadPolicy } from "../public/channels/upload-policy.js";
11
+ import type { ChannelAdapter, ChannelAdapterContext } from "./adapter.js";
12
+ import type { SlackUserContext } from "./slack-state.js";
13
+ import type { SlackInteraction, SlackRenderable, SlackThreadMessage } from "./slack-types.js";
14
+ /**
15
+ * Extended adapter context for Slack adapters. Provides a `slack` handle
16
+ * for posting messages, editing messages, typing indicators, and reading
17
+ * thread history.
18
+ *
19
+ * Constructed by the slack base layer before calling user adapter handlers.
20
+ */
21
+ export interface SlackAdapterContext<TState = Record<string, unknown>> extends ChannelAdapterContext<TState> {
22
+ readonly slack: SlackHandle;
23
+ }
24
+ /**
25
+ * Platform handle for Slack operations. Injected into the adapter context
26
+ * by the slack base layer.
27
+ */
28
+ export interface SlackHandle {
29
+ /** Post a renderable (markdown or card) to the thread. */
30
+ post(renderable: SlackRenderable): Promise<void>;
31
+ /** Edit an existing message by timestamp. */
32
+ editMessage(ts: string, renderable: SlackRenderable): Promise<void>;
33
+ /** Show a typing indicator with the given status text. */
34
+ startTyping(status: string): Promise<void>;
35
+ /** Refresh thread messages from Slack. */
36
+ refresh(): Promise<void>;
37
+ /** Get recent thread messages (call refresh first). */
38
+ listRecentMessages(): Promise<readonly SlackThreadMessage[]>;
39
+ /** Slack channel ID. */
40
+ readonly channelId: string;
41
+ /** Chat SDK thread ID. */
42
+ readonly threadId: string;
43
+ /** Thread root timestamp. */
44
+ readonly threadTs?: string;
45
+ /** Workspace ID. */
46
+ readonly teamId?: string;
47
+ /** User context from the inbound mention. */
48
+ readonly userContext?: SlackUserContext;
49
+ }
50
+ /**
51
+ * Creates a Slack adapter that wraps a user adapter with default Slack
52
+ * behaviors. User handlers override defaults per event type.
53
+ *
54
+ * Default behaviors (run when user adapter doesn't declare the event):
55
+ * - turn.started: startTyping("Thinking...")
56
+ * - actions.requested: startTyping("Running tool1, tool2...")
57
+ * - message.completed: post(message) or buffer for typing status
58
+ * - session.failed: post("Something went wrong.")
59
+ * - input.requested: render HITL Block Kit cards + store pendingRequests
60
+ */
61
+ export declare function createSlackBaseAdapter(input: {
62
+ readonly userAdapter?: ChannelAdapter<any>;
63
+ readonly slackState: Record<string, unknown>;
64
+ /**
65
+ * Effective upload policy for inbound Slack attachments. The Slack
66
+ * base layer filters disallowed parts out of the `FilePart` array
67
+ * before it reaches the harness; violations are logged and dropped
68
+ * rather than surfaced as an error so the text turn still goes
69
+ * through. Defaults to {@link DEFAULT_UPLOAD_POLICY}.
70
+ */
71
+ readonly uploadPolicy?: UploadPolicy;
72
+ }): ChannelAdapter;
73
+ /**
74
+ * Creates a SlackHandle from the Chat SDK thread, lazily initialized.
75
+ *
76
+ * The Chat SDK imports happen dynamically to avoid bundler issues (same
77
+ * pattern as the old SlackChannel.getThread()).
78
+ */
79
+ export declare function createSlackHandle(input: {
80
+ readonly botToken?: string;
81
+ readonly serializedThread: unknown;
82
+ readonly userContext?: SlackUserContext;
83
+ }): SlackHandle;
84
+ /**
85
+ * Maps Slack button clicks and select menus to HITL input responses.
86
+ *
87
+ * Buttons encode `requestId` as the button `value` and `optionId` as the
88
+ * `actionId`. Selects encode `requestId` as the `actionId` (prefixed with
89
+ * `select_`) and `optionId` as the `selectedOptionId`.
90
+ *
91
+ * Returns input responses, or an empty array when no actions could be mapped.
92
+ */
93
+ export declare function deriveInputResponsesFromInteraction(interaction: SlackInteraction): readonly import("../runtime/input/types.js").InputResponse[];
94
+ /**
95
+ * Defines a Slack adapter. Validates the shape and returns the adapter
96
+ * unchanged so it can be passed to `slackRoute({ adapter })`.
97
+ *
98
+ * This is a convenience — you can also pass a plain object literal.
99
+ */
100
+ export declare function defineSlackAdapter<TState extends object = Record<string, unknown>>(adapter: ChannelAdapter<SlackAdapterContext<TState>>): ChannelAdapter<SlackAdapterContext<TState>>;
101
+ /**
102
+ * Converts attachments on the most recent non-bot thread message into
103
+ * AI SDK `FilePart`s. Audio and video parts are skipped by default;
104
+ * failed byte fetches are silently dropped so a broken upload never
105
+ * prevents the text turn from going through.
106
+ *
107
+ * `uploadPolicy` filters out parts that exceed the size cap or fall
108
+ * outside the media-type allowlist. Dropped attachments emit a warning
109
+ * so operators can observe policy rejections without the turn failing.
110
+ *
111
+ * Exported so `slackRoute`'s new-session path can inject attachments on
112
+ * the initial bot mention (which goes through `agent.run`, bypassing
113
+ * the adapter's `deliver` hook).
114
+ */
115
+ export declare function collectFilePartsFromMessages(messages: readonly SlackThreadMessage[], uploadPolicy?: UploadPolicy): Promise<FilePart[]>;
116
+ //# sourceMappingURL=slack-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slack-adapter.d.ts","sourceRoot":"","sources":["../../../src/channel/slack-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAyB,MAAM,IAAI,CAAC;AAM1D,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAEV,cAAc,EACd,qBAAqB,EAEtB,MAAM,cAAc,CAAC;AAUtB,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAO1B;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB,CAClC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAChC,SAAQ,qBAAqB,CAAC,MAAM,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,IAAI,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,6CAA6C;IAC7C,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,0DAA0D;IAC1D,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,0CAA0C;IAC1C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,uDAAuD;IACvD,kBAAkB,IAAI,OAAO,CAAC,SAAS,kBAAkB,EAAE,CAAC,CAAC;IAC7D,wBAAwB;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6BAA6B;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB;IACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,6CAA6C;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC;CACzC;AAsDD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACtC,GAAG,cAAc,CAoTjB;AAMD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC;CACzC,GAAG,WAAW,CA8Fd;AAMD;;;;;;;;GAQG;AACH,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,gBAAgB,GAC5B,SAAS,OAAO,2BAA2B,EAAE,aAAa,EAAE,CA6B9D;AAUD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChF,OAAO,EAAE,cAAc,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,GACnD,cAAc,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAE7C;AAiDD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,SAAS,kBAAkB,EAAE,EACvC,YAAY,GAAE,YAAoC,GACjD,OAAO,CAAC,QAAQ,EAAE,CAAC,CAMrB"}