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,206 +1,126 @@
1
1
  # Unified Context
2
2
 
3
- Ash uses a single `AshContext` container, bound by one `AsyncLocalStorage` instance, to carry all
4
- runtime state through the execution stack. There are no secondary `AsyncLocalStorage` bindings, no
5
- custom dehydration protocols, and no out-of-band parameter passing for contextual data.
3
+ Ash uses one `AshContext` container, bound by one `AsyncLocalStorage`, to carry all ambient runtime
4
+ data through execution. There is no second authored-state channel and no separate dehydration path
5
+ for public context.
6
6
 
7
- ## Files To Read
7
+ ## Core Model
8
8
 
9
- - `packages/ash/src/context/key.ts`
10
- - `packages/ash/src/context/container.ts`
11
- - `packages/ash/src/context/provider.ts`
12
- - `packages/ash/src/context/keys.ts`
13
- - `packages/ash/src/context/serialize.ts`
14
- - `packages/ash/src/context/run-step.ts`
15
- - `packages/ash/src/context/accessors.ts`
16
- - `packages/ash/src/context/providers/session.ts`
17
- - `packages/ash/src/context/providers/sandbox.ts`
18
- - `packages/ash/src/context/providers/skill.ts`
9
+ Ash now has two key categories:
19
10
 
20
- ## Core Primitives
11
+ - `ContextKey<T>`: public durable authored context. Values live on `session.context`.
12
+ - `RuntimeContextKey<T>`: private framework-only runtime values. These seed one step and may be
13
+ reconstructed on the next step.
21
14
 
22
- ### ContextKey
23
-
24
- A typed key identifies a value in the container. Keys that hold non-JSON-safe values declare a
25
- codec for serialization at `"use step"` boundaries.
26
-
27
- ```ts
28
- class ContextKey<T> {
29
- readonly name: string;
30
- readonly codec?: {
31
- serialize(value: T): unknown;
32
- deserialize(data: unknown): T | Promise<T>;
33
- };
34
- }
35
- ```
36
-
37
- ### AshContext
38
-
39
- The container interface. One instance per execution scope.
15
+ `AshContext` exposes a uniform API:
40
16
 
41
17
  ```ts
42
18
  interface AshContext {
43
- get<T>(key: ContextKey<T>): T;
44
- tryGet<T>(key: ContextKey<T>): T | undefined;
45
- has(key: ContextKey<unknown>): boolean;
46
- set<T>(key: ContextKey<T>, value: T): void;
19
+ get<T>(key: ContextStoreKey<T>): T;
20
+ tryGet<T>(key: ContextStoreKey<T>): T | undefined;
21
+ has<T>(key: ContextStoreKey<T>): boolean;
22
+ set<T>(key: ContextStoreKey<T>, value: T): void;
23
+ ensure<T>(key: ContextStoreKey<T>, valueOrFactory: T | (() => T)): T;
47
24
  }
48
25
  ```
49
26
 
50
- ### contextStorage
27
+ Public helpers such as `getContext`, `setContext`, `ensureContext`, `getSession`, `getSandbox`, and
28
+ `getSkill` all delegate to this container.
51
29
 
52
- The single `AsyncLocalStorage<AshContext>` instance. Only `runStep` and the runtime entry points
53
- call `contextStorage.run(...)`. Everything else reads via `requireContext()`.
30
+ ## Durable Context Lifecycle
54
31
 
55
- ### requireContext()
32
+ Durable authored context no longer piggybacks on runtime seed serialization.
56
33
 
57
- Returns the active `AshContext` from `contextStorage`, or throws. Authored code (tools, steps,
58
- model callbacks) uses this implicitly through the public accessors.
34
+ Every step now follows this flow:
59
35
 
60
- ## Key Categories
36
+ 1. Deserialize runtime seed keys with `deserializeRuntimeContext(...)`.
37
+ 2. Hydrate all registered public `ContextKey`s from `session.context`.
38
+ 3. Seed internal framework bookkeeping from `session.internal`.
39
+ 4. Apply deliver-time auth and run `channel.onDeliver(...)`.
40
+ 5. Run providers and step code inside `contextStorage.run(...)`.
41
+ 6. Commit the full durable context bag back to `session.context`.
61
42
 
62
- ### Seed keys
43
+ The main files are:
63
44
 
64
- Set by the runtime entry point with live values. Serialized and deserialized at durable step
65
- boundaries via their codec.
45
+ - `packages/ash/src/context/serialize.ts`
46
+ - `packages/ash/src/context/durable-context.ts`
47
+ - `packages/ash/src/execution/step-context.ts`
48
+ - `packages/ash/src/context/run-step.ts`
66
49
 
67
- | Key | Type | Codec |
68
- |-----|------|-------|
69
- | `AuthKey` | `SessionAuthContext \| null` | none (JSON-safe) |
70
- | `InitiatorAuthKey` | `SessionAuthContext \| null` | none |
71
- | `SessionIdKey` | `string` | none |
72
- | `RunIdKey` | `string` | none |
73
- | `ContinuationTokenKey` | `string` | none |
74
- | `ModeKey` | `RunMode` | none |
75
- | `NodeSelectorKey` | `string` | none — points at the active graph node (root or a delegated subagent selector) |
76
- | `ParentSessionKey` | `SessionParent` | none — set only on delegated child contexts to carry parent lineage |
77
- | `ChannelEmitterKey` | `ChannelEmitter` | serializes kind + state, deserializes by hydrating the correct emitter class |
78
- | `BundleKey` | `CompiledBundle` | serializes to `compiledArtifactsSource`, deserializes via `getCompiledRuntimeAgentBundle` |
50
+ ## Runtime Seed Serialization
79
51
 
80
- Keys self-register in a global registry at construction time. The serialization
81
- layer uses this registry to resolve string names back to typed keys — there is no
82
- explicit seed key list.
52
+ `serializeRuntimeContext(...)` and `deserializeRuntimeContext(...)` only handle
53
+ `RuntimeContextKey`s marked `serializable: true`.
83
54
 
84
- ### Derived keys
55
+ That includes seed values such as:
85
56
 
86
- Created by providers during `runStep`. Never serialized — providers reconstruct them each step
87
- from seed keys and the harness session.
57
+ - auth and initiator auth
58
+ - session id and continuation token
59
+ - run mode
60
+ - parent lineage
61
+ - compiled bundle
62
+ - serialized channel
88
63
 
89
- | Key | Type | Provider |
90
- |-----|------|----------|
91
- | `SessionKey` | `Session` | `sessionProvider` |
92
- | `SandboxKey` | `SandboxAccess` | `sandboxProvider` |
93
- | `SkillKey` | `SkillAccess` | `skillProvider` |
64
+ Durable authored context is intentionally excluded. `assertNoDurableContextInRuntimeSeed(...)`
65
+ guards against leaking a public `ContextKey` into the runtime seed payload.
94
66
 
95
67
  ## Providers
96
68
 
97
- Providers implement `ContextProvider<T>`:
98
-
99
- ```ts
100
- interface ContextProvider<T> {
101
- readonly key: ContextKey<T>;
102
- create(ctx: AshContext, session: HarnessSession):
103
- ProviderResult<T> | undefined | Promise<ProviderResult<T> | undefined>;
104
- commit?(value: T, session: HarnessSession):
105
- HarnessSession | Promise<HarnessSession>;
106
- }
107
- ```
108
-
109
- `create` receives the context (with seed keys and earlier providers already set) and the current
110
- harness session. It returns a `ProviderResult` with the live value and optionally a modified
111
- session (e.g. skills enriching the system prompt). Returning `undefined` means the provider is not
112
- active for this step.
113
-
114
- `commit` is called after the step completes. It receives the live value (which may have been
115
- mutated during the step) and the harness session from the step result. It returns an updated
116
- session with any state changes persisted. Only providers with mutable state need this (sandbox
117
- snapshots, skill activations).
118
-
119
- Provider ordering matters. The framework providers are baked into `runStep` in dependency order:
120
-
121
- 1. `sessionProvider` — depends only on seed keys
122
- 2. `sandboxProvider` — depends on `BundleKey` and `SessionIdKey`
123
- 3. `skillProvider` — depends on `BundleKey`
124
-
125
- There is no separate provider list to import — `runStep` knows its providers internally.
126
-
127
- ## Step Runner
128
-
129
- `runStep` orchestrates the provider lifecycle around a step callback:
130
-
131
- 1. Iterates providers in order — each may set its key on the context and optionally modify the
132
- harness session.
133
- 2. Runs the callback inside `contextStorage.run(ctx, ...)` so authored code can read the context.
134
- 3. After the callback completes, iterates providers again to call `commit` hooks, persisting
135
- mutable state back onto the session.
136
-
137
- ## Serialization At Step Boundaries
138
-
139
- `serializeContext` and `deserializeContext` handle durable step boundaries generically.
140
- `serializeContext` iterates all entries in the context, calling each codec-backed key's codec
141
- when present. `deserializeContext` iterates the plain JSON record
142
- and resolves each string name back to its registered `ContextKey` via the global key registry.
143
- Keys without a codec are stored as-is (they must be JSON-safe).
69
+ Providers still reconstruct derived runtime values on each step:
144
70
 
145
- The workflow runtime serializes the context once at `start()` time. Each `"use step"` boundary
146
- deserializes it back, then providers reconstruct derived values.
71
+ - `SessionKey` via `sessionProvider`
72
+ - `SandboxKey` via `sandboxProvider`
73
+ - `SkillKey` via `skillProvider`
147
74
 
148
- The channel emitter codec is owned by the `ChannelEmitterKey` definition in `context/keys.ts`.
149
- Emitter classes themselves have no knowledge of serialization.
75
+ These are runtime-only values, so they use `RuntimeContextKey`, not public `ContextKey`.
150
76
 
151
- ## Integration Points
77
+ Provider-owned mutable state stays separate from authored durable context:
152
78
 
153
- ### Runtime entry (workflow)
79
+ - durable authored values live on `session.context`
80
+ - internal framework bookkeeping lives on `session.internal`
81
+ - provider snapshots such as `sandboxState` stay on their dedicated session fields
154
82
 
155
- `workflow-runtime.ts` builds an `AshContextImpl` via `createRootContext` (for `run()`) or
156
- `createDelegatedChildContext` (for `delegate()`), sets seed keys, serializes, and passes
157
- `serializedContext` to `workflowEntry` via `start()`. The ambient runtime is registered at
158
- this point so durable steps can later recover it via `tryGetAmbientWorkflowRuntime()`.
83
+ ## Channel Setup
159
84
 
160
- ### Runtime entry (continuous)
85
+ `packages/ash/src/execution/step-context.ts` owns the pre-step channel path for both runtimes:
161
86
 
162
- `continuous-runtime.ts` builds an `AshContextImpl` via the same two helpers and passes the
163
- live context directly to `runStep` (no serialization needed since there are no durable step
164
- boundaries). `RuntimeKey` is attached to the context once at run creation.
87
+ 1. rebuild the fresh step context
88
+ 2. hydrate durable context
89
+ 3. seed pending input request bookkeeping
90
+ 4. apply deliver-time auth
91
+ 5. call `channel.onDeliver(ctx, payload)`
92
+ 6. assert that serialized channel state did not change
165
93
 
166
- ### Delegation
94
+ That ordering matters. `onDeliver(...)` runs after durable context hydration, so channel-seeded
95
+ context cannot be overwritten by later hydration.
167
96
 
168
- `runtime.delegate(input)` starts a child run rooted at a non-root graph node. Its
169
- `DelegateInput` extends `RunInput` and adds `parent: SessionParent` and
170
- `target: { selector }`. `createDelegatedChildContext` seeds the child context with the
171
- forwarded initiator auth, the delegate's current auth, the parent lineage, the child node
172
- selector, and the child's own run/session identifiers. The subagent tool wrapper in
173
- `execution/subagent-tool.ts` is the sole in-tree caller of `delegate()`.
97
+ ## Channel State Rule
174
98
 
175
- ### Durable step boundary
99
+ Serialized channel state is immutable after the run starts.
176
100
 
177
- `workflow-steps.ts` deserializes the context from the serialized record, attaches the ambient
178
- workflow runtime via `RuntimeKey` (when one is registered), resolves the active graph node
179
- from `NodeSelectorKey`, and calls `runStep` with the framework providers.
101
+ The runtime snapshots `channel.serialize()` before `onDeliver(...)` and again after step execution.
102
+ If the serialized shape changes, the runtime throws with guidance to move that data into:
180
103
 
181
- ### Tool executors
104
+ - durable context when authored code needs it across turns
105
+ - internal `session.internal` when only framework bookkeeping needs it
182
106
 
183
- Tool executors read from the container via `requireContext()`. Sandbox tools read `SandboxKey`;
184
- the `activate_skill` action reads `SkillKey`. Authored tools access context through the public
185
- accessors (`getSession`, `getSandbox`, etc.).
107
+ This keeps channel responsibilities narrow:
186
108
 
187
- ### Public API
109
+ - transport normalization
110
+ - continuation token ownership
111
+ - per-turn context seeding
112
+ - delivery policy
188
113
 
189
- The public accessors in `context/accessors.ts` delegate to `requireContext()`:
114
+ It prevents channels from becoming an untracked second session storage system.
190
115
 
191
- - `getSession()` reads `SessionKey`
192
- - `getSandbox(name)` reads `SandboxKey`
193
- - `getSkill(identifier)` reads `SkillKey`
116
+ ## Runtime Split
194
117
 
195
- ## What Was Removed
118
+ Both runtime flavors now use the same context story:
196
119
 
197
- The unified context replaced these six prior mechanisms:
120
+ - workflow runtime stores runtime seed keys once, then rebuilds a fresh step context on every
121
+ durable step
122
+ - continuous runtime also rebuilds a fresh step context on every step, even though the process is
123
+ still live
198
124
 
199
- - `execution/runtime-context.ts` execution-layer `AsyncLocalStorage` and `RuntimeContext`
200
- - `runtime/session-context.ts` — runtime-layer `AsyncLocalStorage` and `AuthoredRuntimeContext`
201
- - `execution/framework-context.ts` — `FrameworkContext`, `Dehydratable`, channel emitter
202
- dehydration
203
- - `execution/context.ts` — `StepExecutionContext`, `ManagedRuntimeContext`, incremental context
204
- assembly
205
- - The `Dehydratable` interface on channel emitters (replaced by key codecs)
206
- - Separate `session` parameter threading through tool executors and action handlers
125
+ That removes the old semantic split where in-memory runs behaved differently from durable workflow
126
+ runs.
@@ -5,10 +5,8 @@ channel-harness-runtime path. The old message-workflow and runtime-harness stack
5
5
 
6
6
  ## Files To Read
7
7
 
8
- - `packages/ash/src/internal/nitro/routes/message.ts`
9
- - `packages/ash/src/internal/nitro/routes/run-stream.ts`
8
+ - `packages/ash/src/public/channels/http.ts`
10
9
  - `packages/ash/src/runtime/governance/auth/route-auth.ts`
11
- - `packages/ash/src/channel/http.ts`
12
10
  - `packages/ash/src/channel/types.ts`
13
11
  - `packages/ash/src/harness/tool-loop.ts`
14
12
  - `packages/ash/src/harness/types.ts`
@@ -21,7 +19,7 @@ channel-harness-runtime path. The old message-workflow and runtime-harness stack
21
19
 
22
20
  - `GET /.well-known/ash/v1/health`
23
21
  - `POST /.well-known/ash/v1/message`
24
- - `GET /.well-known/ash/v1/runs/:runId/stream`
22
+ - `GET /.well-known/ash/v1/sessions/:sessionId/stream`
25
23
 
26
24
  The route prefix stays `v1`. What changed is the runtime behind it.
27
25
 
@@ -44,12 +42,12 @@ See [`context.md`](./context.md) for the full model.
44
42
 
45
43
  1. Nitro route auth validates the caller in `route-auth.ts`.
46
44
  2. `message.ts` parses either `{ message }` or `{ continuationToken, message }`.
47
- 3. `channel/http.ts` derives a continuation token and provides an `EventHandler`.
45
+ 3. The HTTP channel derives a continuation token and owns event delivery via `onEvent`.
48
46
  4. The channel calls `runtime.run(...)` or `runtime.deliver(...)`.
49
47
  5. The runtime creates or reloads the durable session and invokes the shared harness step.
50
48
  6. The harness returns `{ session, next }`.
51
- 7. The runtime persists the updated session, follows `next`, and streams events under the run id.
52
- 8. Clients read the durable run through `GET /.well-known/ash/v1/runs/:runId/stream`.
49
+ 7. The runtime persists the updated session, follows `next`, and streams events under the session id.
50
+ 8. Clients read the durable session through `GET /.well-known/ash/v1/sessions/:sessionId/stream`.
53
51
 
54
52
  ## Start And Follow-Up Requests
55
53
 
@@ -69,22 +67,22 @@ Important behavior:
69
67
 
70
68
  - New starts return `202 Accepted`.
71
69
  - Start responses include `sessionId` and `continuationToken` in the JSON body.
72
- - Start responses also include `x-ash-run-id` and `location` headers so clients know which run to
73
- stream.
70
+ - Start responses also include `x-ash-session-id` and `location` headers so clients know which
71
+ session to stream.
74
72
  - Follow-up requests return `200 OK` with the same `continuationToken`.
75
- - `runId` remains the stream handle, but it is no longer the resume handle.
73
+ - `sessionId` is the stream handle; `continuationToken` is the resume handle.
76
74
 
77
75
  ## Stream Contract
78
76
 
79
- `run-stream.ts` reads the durable workflow run directly from the workflow runtime and returns the
80
- canonical NDJSON stream.
77
+ The stream channel reads the durable workflow session directly from the workflow runtime and returns
78
+ the canonical NDJSON stream.
81
79
 
82
80
  Important behavior:
83
81
 
84
82
  - `startIndex` reconnects by event count.
85
- - Stream headers always include `x-ash-run-id`, `x-ash-stream-format`, `x-ash-stream-version`, and
83
+ - Stream headers always include `x-ash-session-id`, `x-ash-stream-format`, `x-ash-stream-version`, and
86
84
  `x-ash-workflow-id`.
87
- - The stream route does not know about continuation tokens. It only needs the durable `runId`.
85
+ - The stream route does not know about continuation tokens. It only needs the durable `sessionId`.
88
86
 
89
87
  ## Event Delivery
90
88
 
@@ -93,8 +91,8 @@ The runtime owns stream plumbing, but the channel owns delivery policy.
93
91
  Important behavior:
94
92
 
95
93
  - the runtime composes a raw stream writer from `getWritable()`
96
- - the channel contributes `EventHandler.onEvent(event, emit)`
97
- - the composed `emit` function is injected into the harness
94
+ - the runtime calls `channel.onEvent(event)` for each lifecycle event; the channel returns the
95
+ (possibly transformed) event and may perform platform side effects before returning
98
96
  - the harness emits lifecycle events without knowing whether they go to HTTP, Slack, both, or
99
97
  neither
100
98
 
@@ -105,9 +103,10 @@ format.
105
103
 
106
104
  The current stream surface is:
107
105
 
108
- - `run.started`
106
+ - `session.started`
109
107
  - `turn.started`
110
108
  - `message.received`
109
+ - `step.started`
111
110
  - `sandbox.initialized`
112
111
  - `sandbox.restored`
113
112
  - `sandbox.command`
@@ -116,18 +115,21 @@ The current stream surface is:
116
115
  - `subagent.started`
117
116
  - `subagent.event`
118
117
  - `subagent.completed`
119
- - `thinking.completed`
118
+ - `reasoning.completed`
120
119
  - `message.completed`
120
+ - `step.completed`
121
121
  - `turn.completed`
122
+ - `step.failed`
123
+ - `turn.failed`
122
124
  - `session.waiting`
123
- - `run.completed`
124
- - `run.failed`
125
+ - `session.completed`
126
+ - `session.failed`
125
127
 
126
- `message.completed.data.finishReason` carries the assistant step outcome.
127
- `tool-calls` means the turn is continuing through tool execution; other values
128
- are terminal for the current turn.
128
+ `message.completed.data.finishReason` remains available for message-level
129
+ consumers. `step.completed.data.finishReason` mirrors the model-step outcome,
130
+ and `tool-calls` means the turn is continuing through tool execution.
129
131
 
130
- Subagent activity is now inline on the parent run stream. There is no separate legacy child-workflow
132
+ Subagent activity is now inline on the parent session stream. There is no separate legacy child-workflow
131
133
  stream path.
132
134
 
133
135
  ## Auth Boundary
@@ -139,7 +141,7 @@ Important behavior:
139
141
  - If both `auth` and `network` are omitted, the routes are open.
140
142
  - If only `network` is configured, the caller must pass the IP allow list.
141
143
  - If `auth` is configured, the caller must satisfy one configured strategy.
142
- - There is still no separate per-run ownership ACL after route auth succeeds.
144
+ - There is still no separate per-session ownership ACL after route auth succeeds.
143
145
 
144
146
  The runtime stores both `auth.current` and `auth.initiator`. A later authenticated follow-up message
145
147
  may replace `auth.current` without rewriting the original initiator snapshot.
@@ -153,5 +155,5 @@ The current ownership split is:
153
155
  - The harness owns model/tool work and the `next` decision.
154
156
  - Execution/runtime owns durable workflow entry, persistence, and event-stream plumbing.
155
157
  - Clients keep both identifiers:
156
- - `runId` for streaming
158
+ - `sessionId` for streaming
157
159
  - `continuationToken` for the next user message
@@ -19,21 +19,22 @@ Read in this order:
19
19
  2. [project-layout.md](./project-layout.md)
20
20
  3. [agent-ts.md](./agent-ts.md)
21
21
  4. [typescript-api.md](./typescript-api.md)
22
- 5. [context-control.md](./context-control.md)
23
- 6. [skills.md](./skills.md)
24
- 7. [tools.md](./tools.md)
25
- 8. [workspace.md](./workspace.md)
26
- 9. [sandboxes.md](./sandboxes.md)
27
- 10. [channels/README.md](./channels/README.md)
28
- 11. [human-in-the-loop.md](./human-in-the-loop.md)
29
- 12. [session-context.md](./session-context.md)
30
- 13. [runs-and-streaming.md](./runs-and-streaming.md)
31
- 14. [subagents.md](./subagents.md)
32
- 15. [schedules.md](./schedules.md)
33
- 16. [evals.md](./evals.md)
34
- 17. [auth-and-route-protection.md](./auth-and-route-protection.md)
35
- 18. [vercel-deployment.md](./vercel-deployment.md)
36
- 19. [cli-build-and-debugging.md](./cli-build-and-debugging.md)
22
+ 5. [migration-guide.md](./migration-guide.md)
23
+ 6. [context-control.md](./context-control.md)
24
+ 7. [skills.md](./skills.md)
25
+ 8. [tools.md](./tools.md)
26
+ 9. [workspace.md](./workspace.md)
27
+ 10. [sandboxes.md](./sandboxes.md)
28
+ 11. [channels/README.md](./channels/README.md)
29
+ 12. [human-in-the-loop.md](./human-in-the-loop.md)
30
+ 13. [session-context.md](./session-context.md)
31
+ 14. [runs-and-streaming.md](./runs-and-streaming.md)
32
+ 15. [subagents.md](./subagents.md)
33
+ 16. [schedules.md](./schedules.md)
34
+ 17. [evals.md](./evals.md)
35
+ 18. [auth-and-route-protection.md](./auth-and-route-protection.md)
36
+ 19. [vercel-deployment.md](./vercel-deployment.md)
37
+ 20. [cli-build-and-debugging.md](./cli-build-and-debugging.md)
37
38
 
38
39
  ## The Public Mental Model
39
40
 
@@ -55,11 +56,12 @@ Ash then gives you:
55
56
 
56
57
  - a stable HTTP message route
57
58
  - optional channel webhook routes
58
- - a reconnectable run stream
59
- - durable session state across turns
59
+ - a reconnectable session stream
60
+ - durable session context across turns
60
61
  - a shared runtime workspace
61
62
  - optional isolated sandboxes
62
- - typed runtime helpers such as `getSession()`, `getSandbox()`, and `getSkill()`
63
+ - typed runtime helpers such as `getSession()`, `getContext()`, `setContext()`, `ensureContext()`,
64
+ `getSandbox()`, and `getSkill()`
63
65
 
64
66
  ## The Runtime Shape
65
67
 
@@ -73,13 +75,13 @@ know:
73
75
  That is why Ash exposes two identifiers:
74
76
 
75
77
  - `continuationToken` for the next user message
76
- - `runId` for streaming and inspection
78
+ - `sessionId` for streaming and inspection
77
79
 
78
80
  ## How To Use These Docs
79
81
 
80
82
  - Start with the authored filesystem shape and `agent.ts`.
81
83
  - Then add runtime surfaces in this order: skills, tools, workspace, sandboxes, channels.
82
- - Then learn the durable runtime model: HITL, session context, runs, streaming, and
84
+ - Then learn the durable runtime model: HITL, session context, sessions, streaming, and
83
85
  continuation-token follow-ups.
84
86
  - Then add advanced features: subagents, schedules, route protection, deployment.
85
87
 
@@ -9,16 +9,16 @@ These settings apply to:
9
9
 
10
10
  - `GET /.well-known/ash/v1/health`
11
11
  - `POST /.well-known/ash/v1/message`
12
- - `GET /.well-known/ash/v1/runs/:runId/stream`
12
+ - `GET /.well-known/ash/v1/sessions/:sessionId/stream`
13
13
 
14
14
  ## The Main API
15
15
 
16
16
  ```ts
17
17
  // agent/channels/.well-known/ash/v1/message.ts
18
- import { httpMessageChannel } from "experimental-ash/channels/http";
18
+ import { httpRoute } from "experimental-ash/channels/http";
19
19
  import { vercelOidc } from "experimental-ash/channels/auth";
20
20
 
21
- export default httpMessageChannel({
21
+ export default httpRoute({
22
22
  auth: vercelOidc(),
23
23
  });
24
24
  ```
@@ -26,10 +26,10 @@ export default httpMessageChannel({
26
26
  For open routes, use `none()` explicitly:
27
27
 
28
28
  ```ts
29
- import { httpMessageChannel } from "experimental-ash/channels/http";
29
+ import { httpRoute } from "experimental-ash/channels/http";
30
30
  import { none } from "experimental-ash/channels/auth";
31
31
 
32
- export default httpMessageChannel({
32
+ export default httpRoute({
33
33
  auth: none(),
34
34
  });
35
35
  ```
@@ -96,27 +96,31 @@ Inside runtime code, `getSession().auth` gives you the caller snapshot.
96
96
  Important behavior:
97
97
 
98
98
  - `auth.current` is the caller for the active inbound turn
99
- - `auth.initiator` is the caller that started the durable run
100
- - authenticated follow-up messages can change `auth.current` without changing `auth.initiator`
99
+ - `auth.initiator` is the caller that started the durable session
100
+ - follow-up messages update `auth.current` without changing `auth.initiator`
101
101
  - unprotected agents expose both as `null`
102
102
 
103
+ Auth on follow-up messages (`deliver()`) is honored by both the workflow and continuous runtimes.
104
+ When a different user sends a follow-up to the same session, `session.auth.current` reflects the
105
+ new caller on that turn while `session.auth.initiator` stays the same.
106
+
103
107
  ## What Ash Does Not Do
104
108
 
105
- Ash does not add a second run-ownership ACL layer on top of route auth.
109
+ Ash does not add a second session-ownership ACL layer on top of route auth.
106
110
 
107
111
  In practice that means:
108
112
 
109
113
  - route access is governed at the HTTP boundary
110
114
  - the durable session keeps the caller snapshot for authored runtime use
111
- - there is no separate per-run ownership list you manage later
115
+ - there is no separate per-session ownership list you manage later
112
116
 
113
117
  ## Example: Basic Auth Request
114
118
 
115
119
  ```ts
116
- import { httpMessageChannel } from "experimental-ash/channels/http";
120
+ import { httpRoute } from "experimental-ash/channels/http";
117
121
  import { httpBasic } from "experimental-ash/channels/auth";
118
122
 
119
- export default httpMessageChannel({
123
+ export default httpRoute({
120
124
  auth: httpBasic({
121
125
  username: "ops",
122
126
  password: process.env.ROUTE_AUTH_BASIC_PASSWORD,
@@ -129,4 +133,3 @@ export default httpMessageChannel({
129
133
  - [`agent-ts.md`](./agent-ts.md)
130
134
  - [`session-context.md`](./session-context.md)
131
135
  - [`vercel-deployment.md`](./vercel-deployment.md)
132
-
@@ -9,6 +9,7 @@ Channels are the transport layer in Ash's channel-harness-runtime split. A chann
9
9
  - deriving or resuming the stable `continuationToken`
10
10
  - applying route auth and network policy
11
11
  - deciding how runtime events are delivered back to the platform
12
+ - seeding per-turn durable context inside `onDeliver(...)`
12
13
 
13
14
  The runtime and harness still own the model turn, tool execution, compaction, and session
14
15
  persistence.
@@ -17,8 +18,8 @@ persistence.
17
18
 
18
19
  Ash ships the public HTTP protocol as channels:
19
20
 
20
- - `httpMessageChannel()` for `POST /.well-known/ash/v1/message`
21
- - `httpRunStreamChannel()` for `GET /.well-known/ash/v1/runs/:runId/stream`
21
+ - `httpRoute()` for `POST /.well-known/ash/v1/message`
22
+ - `httpRunStreamRoute()` for `GET /.well-known/ash/v1/sessions/:sessionId/stream`
22
23
 
23
24
  Ash also supports authored channels under `agent/channels/` for platform-specific integrations such
24
25
  as Slack or custom webhooks.
@@ -43,9 +44,9 @@ Rules that matter:
43
44
  ## The Main API
44
45
 
45
46
  ```ts
46
- import { defineChannel } from "experimental-ash";
47
+ import { defineRoute } from "experimental-ash";
47
48
 
48
- export default defineChannel({
49
+ export default defineRoute({
49
50
  method: "POST",
50
51
  async fetch() {
51
52
  return new Response("ok");
@@ -53,30 +54,32 @@ export default defineChannel({
53
54
  });
54
55
  ```
55
56
 
56
- `defineChannel(...)` keeps the public surface Ash-owned and platform-specific only where necessary.
57
+ `defineRoute(...)` defines a route — the HTTP request handler that receives webhooks and calls
58
+ `agent.run()` or `agent.deliver()`. The route constructs a `Channel` (the conduit that owns auth,
59
+ events, delivery, context, and serialization) and passes it to the runtime.
57
60
 
58
61
  ## HTTP Channels
59
62
 
60
63
  The framework ships two HTTP helpers on `experimental-ash/channels/http`:
61
64
 
62
- - `httpMessageChannel({ auth })`
63
- - `httpRunStreamChannel({ auth })`
65
+ - `httpRoute({ auth })`
66
+ - `httpRunStreamRoute({ auth })`
64
67
 
65
68
  Both require an auth function. Use `experimental-ash/channels/auth` for the common helpers such as
66
69
  `vercelOidc()`, `httpBasic()`, and `none()`.
67
70
 
68
71
  ```ts
69
- import { httpMessageChannel } from "experimental-ash/channels/http";
72
+ import { httpRoute } from "experimental-ash/channels/http";
70
73
  import { vercelOidc } from "experimental-ash/channels/auth";
71
74
 
72
- export default httpMessageChannel({
75
+ export default httpRoute({
73
76
  auth: vercelOidc(),
74
77
  });
75
78
  ```
76
79
 
77
80
  ## Slack And Other Authored Channels
78
81
 
79
- Authored channels can wrap those helpers or build custom transport flows with `defineChannel(...)`.
82
+ Authored channels can wrap those helpers or build custom transport flows with `defineRoute(...)`.
80
83
 
81
84
  Use a custom channel when you want:
82
85
 
@@ -84,10 +87,12 @@ Use a custom channel when you want:
84
87
  - transport-specific delivery behavior
85
88
  - custom request parsing before the runtime turn starts
86
89
 
90
+ Channel constructor state is for stable serialized transport identity only. Once a run starts, keep
91
+ that state immutable and move mutable per-session data into durable context or `session.internal`.
92
+
87
93
  ## What To Read Next
88
94
 
89
95
  - [`../project-layout.md`](../project-layout.md)
90
96
  - [`../typescript-api.md`](../typescript-api.md)
91
97
  - [`../auth-and-route-protection.md`](../auth-and-route-protection.md)
92
98
  - [`../../external-agent-protocol.md`](../../external-agent-protocol.md)
93
-