experimental-ash 0.36.0 → 0.38.0

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 (218) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +7 -7
  3. package/dist/docs/internals/README.md +1 -1
  4. package/dist/docs/internals/context.md +3 -3
  5. package/dist/docs/internals/core-beliefs.md +2 -2
  6. package/dist/docs/internals/hooks.md +4 -4
  7. package/dist/docs/internals/mechanical-invariants.md +1 -1
  8. package/dist/docs/public/README.md +10 -10
  9. package/dist/docs/public/{auth-and-route-protection.md → advanced/auth-and-route-protection.md} +1 -0
  10. package/dist/docs/public/{cli-build-and-debugging.md → advanced/cli-build-and-debugging.md} +1 -0
  11. package/dist/docs/public/{context-control.md → advanced/context-control.md} +1 -0
  12. package/dist/docs/public/{evals.md → advanced/evals.md} +1 -0
  13. package/dist/docs/public/{faqs.md → advanced/faqs.md} +1 -0
  14. package/dist/docs/public/{hooks.md → advanced/hooks.md} +1 -0
  15. package/dist/docs/public/{instrumentation.md → advanced/instrumentation.md} +1 -0
  16. package/dist/docs/public/advanced/meta.json +19 -0
  17. package/dist/docs/public/{project-layout.md → advanced/project-layout.md} +1 -0
  18. package/dist/docs/public/{runs-and-streaming.md → advanced/runs-and-streaming.md} +1 -0
  19. package/dist/docs/public/{session-context.md → advanced/session-context.md} +15 -16
  20. package/dist/docs/public/{typescript-api.md → advanced/typescript-api.md} +1 -0
  21. package/dist/docs/public/{vercel-deployment.md → advanced/vercel-deployment.md} +1 -0
  22. package/dist/docs/public/{workspace.md → advanced/workspace.md} +1 -0
  23. package/dist/docs/public/meta.json +1 -14
  24. package/dist/src/channel/compiled-channel.d.ts +2 -2
  25. package/dist/src/channel/types.d.ts +1 -1
  26. package/dist/src/compiled/.vendor-stamp.json +2 -1
  27. package/dist/src/compiled/experimental-ai-sdk-code-mode/LICENSE +21 -0
  28. package/dist/src/compiled/experimental-ai-sdk-code-mode/index.d.ts +144 -0
  29. package/dist/src/compiled/experimental-ai-sdk-code-mode/index.js +482 -0
  30. package/dist/src/compiled/experimental-ai-sdk-code-mode/package.json +7 -0
  31. package/dist/src/context/accessors.d.ts +0 -25
  32. package/dist/src/context/accessors.js +1 -1
  33. package/dist/src/context/build-callback-context.d.ts +3 -3
  34. package/dist/src/context/build-callback-context.js +1 -1
  35. package/dist/src/context/container.d.ts +5 -5
  36. package/dist/src/context/key.d.ts +1 -1
  37. package/dist/src/context/keys.d.ts +2 -2
  38. package/dist/src/context/serialize.d.ts +2 -2
  39. package/dist/src/evals/define-eval-suite.d.ts +3 -2
  40. package/dist/src/evals/types.d.ts +38 -12
  41. package/dist/src/execution/skills/types.d.ts +1 -1
  42. package/dist/src/execution/tool-compaction.d.ts +1 -1
  43. package/dist/src/execution/workflow-entry.js +1 -1
  44. package/dist/src/harness/code-mode-approval.d.ts +1 -1
  45. package/dist/src/harness/code-mode-approval.js +1 -1
  46. package/dist/src/harness/code-mode-connection-auth-state.d.ts +1 -1
  47. package/dist/src/harness/code-mode-lifecycle.d.ts +1 -1
  48. package/dist/src/harness/code-mode.d.ts +3 -6
  49. package/dist/src/harness/code-mode.js +1 -1
  50. package/dist/src/harness/step-hooks.d.ts +1 -1
  51. package/dist/src/harness/tool-loop.js +1 -1
  52. package/dist/src/internal/application/package.js +1 -1
  53. package/dist/src/internal/nitro/host/code-mode-runtime-dependency-plugin.js +1 -1
  54. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  55. package/dist/src/internal/workflow-bundle/builder.js +2 -2
  56. package/dist/src/packages/ash-scaffold/src/channels.js +1 -1
  57. package/dist/src/public/channels/discord/defaults.js +2 -2
  58. package/dist/src/public/channels/discord/discordChannel.d.ts +5 -6
  59. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  60. package/dist/src/public/channels/index.d.ts +1 -1
  61. package/dist/src/public/channels/slack/defaults.js +4 -4
  62. package/dist/src/public/channels/slack/slackChannel.d.ts +5 -6
  63. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  64. package/dist/src/public/channels/teams/defaults.js +3 -3
  65. package/dist/src/public/channels/teams/teamsChannel.d.ts +5 -6
  66. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  67. package/dist/src/public/channels/telegram/defaults.js +2 -2
  68. package/dist/src/public/channels/telegram/telegramChannel.d.ts +5 -6
  69. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  70. package/dist/src/public/channels/twilio/defaults.js +2 -2
  71. package/dist/src/public/channels/twilio/twilioChannel.d.ts +5 -6
  72. package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
  73. package/dist/src/public/context/index.d.ts +1 -1
  74. package/dist/src/public/definitions/agent.d.ts +2 -1
  75. package/dist/src/public/definitions/callback-context.d.ts +1 -1
  76. package/dist/src/public/definitions/defineChannel.d.ts +36 -17
  77. package/dist/src/public/definitions/defineChannel.js +1 -1
  78. package/dist/src/public/definitions/exact.d.ts +7 -0
  79. package/dist/src/public/definitions/exact.js +1 -0
  80. package/dist/src/public/definitions/hook.d.ts +5 -4
  81. package/dist/src/public/definitions/instructions.d.ts +2 -1
  82. package/dist/src/public/definitions/instrumentation.d.ts +2 -1
  83. package/dist/src/public/definitions/schedule.d.ts +12 -2
  84. package/dist/src/public/definitions/skill.d.ts +2 -1
  85. package/dist/src/public/definitions/tool.d.ts +8 -6
  86. package/dist/src/public/tools/approval/approval-helpers.d.ts +3 -3
  87. package/dist/src/public/tools/index.d.ts +1 -1
  88. package/dist/src/runtime/connections/authorization-tokens.d.ts +3 -3
  89. package/dist/src/runtime/connections/principal.d.ts +3 -3
  90. package/dist/src/runtime/framework-tools/code-mode-connection-auth.d.ts +1 -1
  91. package/dist/src/runtime/framework-tools/connection-search.js +1 -1
  92. package/dist/src/runtime/framework-tools/connection-tools.js +1 -1
  93. package/dist/src/runtime/framework-tools/file-state.d.ts +2 -2
  94. package/dist/src/runtime/framework-tools/skill.js +1 -1
  95. package/dist/src/runtime/governance/auth/types.d.ts +1 -1
  96. package/dist/src/runtime/resolve-connection.d.ts +1 -1
  97. package/dist/src/sandbox/state.d.ts +2 -2
  98. package/dist/src/shared/code-mode.d.ts +8 -0
  99. package/dist/src/shared/code-mode.js +1 -1
  100. package/package.json +3 -4
  101. package/dist/src/node_modules/.pnpm/@jitl_quickjs-ffi-types@0.32.0/node_modules/@jitl/quickjs-ffi-types/dist/index.js +0 -1
  102. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-debug-asyncify@0.32.0/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.js +0 -1
  103. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-debug-asyncify@0.32.0/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.js +0 -1
  104. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-debug-asyncify@0.32.0/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.js +0 -1
  105. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-debug-sync@0.32.0/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.js +0 -4
  106. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-debug-sync@0.32.0/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.js +0 -1
  107. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-debug-sync@0.32.0/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.js +0 -1
  108. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-release-asyncify@0.32.0/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.js +0 -1
  109. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-release-asyncify@0.32.0/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.js +0 -1
  110. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-release-asyncify@0.32.0/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.js +0 -1
  111. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-release-sync@0.32.0/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.js +0 -1
  112. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-release-sync@0.32.0/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +0 -1
  113. package/dist/src/node_modules/.pnpm/@jitl_quickjs-wasmfile-release-sync@0.32.0/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +0 -1
  114. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/approval-continuation.js +0 -1
  115. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/approval-response.js +0 -1
  116. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/code-mode-tool.js +0 -1
  117. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/continuation-capability.js +0 -1
  118. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/errors.js +0 -1
  119. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/fetch-policy.js +0 -1
  120. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/host-interrupt.js +0 -1
  121. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/index.js +0 -1
  122. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/interrupt-continuation.js +0 -1
  123. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/options.js +0 -1
  124. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/run-code-mode.js +0 -1
  125. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/runtime/manager.js +0 -1
  126. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/runtime/max-workers.js +0 -1
  127. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/runtime/worker-source.js +0 -408
  128. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/serialization.js +0 -1
  129. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/source-cache.js +0 -4
  130. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/telemetry.js +0 -1
  131. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/tool-invocation.js +0 -1
  132. package/dist/src/node_modules/.pnpm/experimental-ai-sdk-code-mode@1.0.10_ai@7.0.0-canary.154_zod@4.4.3_/node_modules/experimental-ai-sdk-code-mode/dist/tool-prompt.js +0 -9
  133. package/dist/src/node_modules/.pnpm/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.js +0 -1
  134. package/dist/src/node_modules/.pnpm/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.js +0 -6
  135. package/dist/src/node_modules/.pnpm/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/index.js +0 -1
  136. package/dist/src/node_modules/.pnpm/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.js +0 -1
  137. package/dist/src/node_modules/.pnpm/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/module-asyncify-2EFITU5U.js +0 -1
  138. package/dist/src/node_modules/.pnpm/quickjs-emscripten@0.32.0/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.js +0 -1
  139. package/dist/src/node_modules/.pnpm/quickjs-emscripten@0.32.0/node_modules/quickjs-emscripten/dist/index.js +0 -1
  140. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/index.js +0 -1
  141. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/checks.js +0 -1
  142. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js +0 -1
  143. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/compat.js +0 -1
  144. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js +0 -1
  145. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js +0 -1
  146. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/from-json-schema.js +0 -1
  147. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js +0 -1
  148. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js +0 -1
  149. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js +0 -1
  150. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js +0 -1
  151. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js +0 -1
  152. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js +0 -1
  153. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js +0 -3
  154. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js +0 -2
  155. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/index.js +0 -1
  156. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-generator.js +0 -1
  157. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js +0 -1
  158. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema.js +0 -1
  159. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js +0 -1
  160. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js +0 -1
  161. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js +0 -1
  162. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js +0 -60
  163. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js +0 -3
  164. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js +0 -1
  165. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js +0 -1
  166. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ar.js +0 -1
  167. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/az.js +0 -1
  168. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/be.js +0 -1
  169. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/bg.js +0 -1
  170. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ca.js +0 -1
  171. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/cs.js +0 -1
  172. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/da.js +0 -1
  173. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/de.js +0 -1
  174. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/el.js +0 -1
  175. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/en.js +0 -1
  176. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/eo.js +0 -1
  177. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/es.js +0 -1
  178. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/fa.js +0 -1
  179. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/fi.js +0 -1
  180. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/fr-CA.js +0 -1
  181. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/fr.js +0 -1
  182. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/he.js +0 -1
  183. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/hr.js +0 -1
  184. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/hu.js +0 -1
  185. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/hy.js +0 -1
  186. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/id.js +0 -1
  187. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/index.js +0 -1
  188. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/is.js +0 -1
  189. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/it.js +0 -1
  190. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ja.js +0 -1
  191. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ka.js +0 -1
  192. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/kh.js +0 -1
  193. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/km.js +0 -1
  194. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ko.js +0 -1
  195. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/lt.js +0 -1
  196. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/mk.js +0 -1
  197. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ms.js +0 -1
  198. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/nl.js +0 -1
  199. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/no.js +0 -1
  200. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ota.js +0 -1
  201. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/pl.js +0 -1
  202. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ps.js +0 -1
  203. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/pt.js +0 -1
  204. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ro.js +0 -1
  205. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ru.js +0 -1
  206. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/sl.js +0 -1
  207. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/sv.js +0 -1
  208. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ta.js +0 -1
  209. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/th.js +0 -1
  210. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/tr.js +0 -1
  211. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ua.js +0 -1
  212. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/uk.js +0 -1
  213. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ur.js +0 -1
  214. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/uz.js +0 -1
  215. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/vi.js +0 -1
  216. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/yo.js +0 -1
  217. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/zh-CN.js +0 -1
  218. package/dist/src/node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/zh-TW.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # experimental-ash
2
2
 
3
+ ## 0.38.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e157d85: Tool approval callbacks now receive schema-typed `toolInput`, and raw
8
+ `defineChannel` calls can advertise typed cross-channel receive args.
9
+
10
+ ### Patch Changes
11
+
12
+ - 6563a08: Fix flaky `HookConflictError` in the driver loop by using SDK-generated hook tokens for turn completion instead of explicit deterministic tokens that could collide during handler re-entry.
13
+ - 1a962b8: Rename `AshCallbackContext` to `SessionContext` and export a new `ChannelContext<TCtx>` type from `defineChannel`. `ToolContext` and `HookContext` are unchanged aliases that now extend `SessionContext`.
14
+ - f243a3e: Vendor the code-mode runtime and only include its inline worker assets in hosted function bundles when `CODE_MODE=1`.
15
+
16
+ ## 0.37.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 25ef58e: Reject extra top-level fields passed to core `define*` helpers while preserving literal inference for valid definitions. TypeScript now also enforces documented exclusivity for schedules (`markdown` or `run`) and eval suites (`load` or `cases`, `task.prompt` or `task.messages`).
21
+
22
+ ### Patch Changes
23
+
24
+ - 8b678cc: Channel event handlers now receive `AshCallbackContext` fields — `ctx.session` (with `turn`/`parent`), `ctx.getSandbox()`, and `ctx.getSkill()`. Channel-specific `continuationToken` and `setContinuationToken` are available at the top level of the event context.
25
+
3
26
  ## 0.36.0
4
27
 
5
28
  ### Minor Changes
package/README.md CHANGED
@@ -61,7 +61,7 @@ Runtime accessors live on the subpath that owns the concern:
61
61
  - `getSkill(identifier)` — handle for a named skill visible to the current agent (`experimental-ash/skills`)
62
62
  - `getContext(key)`, `requireContext(key)`, `hasContext(key)`, `setContext(key)`, `ensureContext(key, factory)` — unified context helpers (`experimental-ash/context`)
63
63
 
64
- The complete API reference, including types and lower-level runtime primitives, is in [`./dist/docs/public/typescript-api.md`](./dist/docs/public/typescript-api.md).
64
+ The complete API reference, including types and lower-level runtime primitives, is in [`./dist/docs/public/advanced/typescript-api.md`](./dist/docs/public/advanced/typescript-api.md).
65
65
 
66
66
  ## Tiny Example
67
67
 
@@ -121,7 +121,7 @@ CLI commands:
121
121
 
122
122
  ## Deploying
123
123
 
124
- Ash is built for Vercel. The runtime is Nitro + Vercel Workflows. Read [`./dist/docs/public/vercel-deployment.md`](./dist/docs/public/vercel-deployment.md) for the deployment path, environment variables, and Vercel-specific configuration.
124
+ Ash is built for Vercel. The runtime is Nitro + Vercel Workflows. Read [`./dist/docs/public/advanced/vercel-deployment.md`](./dist/docs/public/advanced/vercel-deployment.md) for the deployment path, environment variables, and Vercel-specific configuration.
125
125
 
126
126
  ## Read Next
127
127
 
@@ -129,14 +129,14 @@ These files ship inside the installed package at `node_modules/experimental-ash/
129
129
 
130
130
  - [Full docs index](./dist/docs/public/README.md) — recommended entry point
131
131
  - [Getting Started](./dist/docs/public/getting-started.md) — install, scaffold, and run locally
132
- - [Project Layout](./dist/docs/public/project-layout.md) — every authored directory in depth
132
+ - [Project Layout](./dist/docs/public/advanced/project-layout.md) — every authored directory in depth
133
133
  - [`agent.ts`](./dist/docs/public/agent-ts.md) — agent config reference
134
- - [TypeScript API](./dist/docs/public/typescript-api.md) — complete `define*` and runtime helper reference
135
- - [Vercel Deployment](./dist/docs/public/vercel-deployment.md) — deploy to production
134
+ - [TypeScript API](./dist/docs/public/advanced/typescript-api.md) — complete `define*` and runtime helper reference
135
+ - [Vercel Deployment](./dist/docs/public/advanced/vercel-deployment.md) — deploy to production
136
136
 
137
- By authoring concern: [Tools](./dist/docs/public/tools.md) · [Channels](./dist/docs/public/channels/README.md) · [Hooks](./dist/docs/public/hooks.md) · [Skills](./dist/docs/public/skills.md) · [Sandbox](./dist/docs/public/sandbox.md) · [Workspace](./dist/docs/public/workspace.md) · [Connections](./dist/docs/public/connections.md) · [Subagents](./dist/docs/public/subagents.md) · [Schedules](./dist/docs/public/schedules.md) · [Human In The Loop](./dist/docs/public/human-in-the-loop.md) · [Evals](./dist/docs/public/evals.md)
137
+ By authoring concern: [Tools](./dist/docs/public/tools.md) · [Channels](./dist/docs/public/channels/README.md) · [Hooks](./dist/docs/public/advanced/hooks.md) · [Skills](./dist/docs/public/skills.md) · [Sandbox](./dist/docs/public/sandbox.md) · [Workspace](./dist/docs/public/advanced/workspace.md) · [Connections](./dist/docs/public/connections.md) · [Subagents](./dist/docs/public/subagents.md) · [Schedules](./dist/docs/public/schedules.md) · [Human In The Loop](./dist/docs/public/human-in-the-loop.md) · [Evals](./dist/docs/public/advanced/evals.md)
138
138
 
139
- By runtime concern: [Sessions and Streaming](./dist/docs/public/runs-and-streaming.md) · [Session Context](./dist/docs/public/session-context.md) · [Context Control](./dist/docs/public/context-control.md) · [Auth and Route Protection](./dist/docs/public/auth-and-route-protection.md) · [CLI, Build, and Debugging](./dist/docs/public/cli-build-and-debugging.md) · [Instrumentation](./dist/docs/public/instrumentation.md)
139
+ By runtime concern: [Sessions and Streaming](./dist/docs/public/advanced/runs-and-streaming.md) · [Session Context](./dist/docs/public/advanced/session-context.md) · [Context Control](./dist/docs/public/advanced/context-control.md) · [Auth and Route Protection](./dist/docs/public/advanced/auth-and-route-protection.md) · [CLI, Build, and Debugging](./dist/docs/public/advanced/cli-build-and-debugging.md) · [Instrumentation](./dist/docs/public/advanced/instrumentation.md)
140
140
 
141
141
  ## Architecture (Internals)
142
142
 
@@ -6,7 +6,7 @@ The architecture is a three-layer split:
6
6
  - **The harness** does one unit of AI work and returns `{ session, next }`.
7
7
  - **The runtime** persists state, follows `next`, streams events, and owns workflow primitives.
8
8
 
9
- All runtime state flows through a single `AshContext` bound by one `AsyncLocalStorage`. Authored code should not know anything about workflow orchestration.
9
+ All runtime state flows through a single `AlsContext` bound by one `AsyncLocalStorage`. Authored code should not know anything about workflow orchestration.
10
10
 
11
11
  ## Start Here
12
12
 
@@ -1,13 +1,13 @@
1
1
  # Unified Context
2
2
 
3
- Ash uses a single `AshContext` container bound by one `AsyncLocalStorage` instance. No secondary storage, no custom dehydration, no out-of-band parameter passing.
3
+ Ash uses a single `AlsContext` container bound by one `AsyncLocalStorage` instance. No secondary storage, no custom dehydration, no out-of-band parameter passing.
4
4
 
5
5
  ## Core Model
6
6
 
7
7
  `ContextContainer` holds a durable map and a virtual overlay. Reads check the virtual overlay first, then the durable map. Writes always target the durable map.
8
8
 
9
9
  ```ts
10
- interface AshContext {
10
+ interface AlsContext {
11
11
  get<T>(key: ContextKey<T>): T | undefined;
12
12
  require<T>(key: ContextKey<T>): T;
13
13
  has<T>(key: ContextKey<T>): boolean;
@@ -26,7 +26,7 @@ ContextReader { get, require, has }
26
26
  ↑ extends
27
27
  ContextAccessor { set, ensure }
28
28
  ↑ extends
29
- AshContext { entries() }
29
+ AlsContext { entries() }
30
30
  ```
31
31
 
32
32
  ## Seed Keys
@@ -14,7 +14,7 @@ That is why authored identifiers are derived from paths. A file path is a single
14
14
  source of truth; a repeated `name` field is a second source that can drift.
15
15
 
16
16
  The hooks surface (`agent/hooks/`) deliberately reuses the unified
17
- `AshContext` rather than introducing a parallel state-patch channel:
17
+ `AlsContext` rather than introducing a parallel state-patch channel:
18
18
  hooks read and write through `ctx` like every other authored function.
19
19
  One context, one set of keys, one place to look when debugging.
20
20
 
@@ -36,7 +36,7 @@ and easier to fork accidentally.
36
36
 
37
37
  ## Context Is A Single Ambient Contract
38
38
 
39
- Ash uses one `AshContext` container for runtime state. Seed keys carry
39
+ Ash uses one `AlsContext` container for runtime state. Seed keys carry
40
40
  serializable values across step boundaries; providers derive values for the
41
41
  current step. Additional `AsyncLocalStorage` instances or hidden dehydration
42
42
  protocols create parallel contracts that agents and humans must rediscover.
@@ -17,10 +17,10 @@ inside the agent" and "extension contributed by a plugin": both flow
17
17
  through one runtime registry, one `HookContext`, one set of ordering
18
18
  rules.
19
19
 
20
- The hooks surface deliberately reuses the unified `AshContext`:
21
- `HookContext` extends `AshCallbackContext`, giving hooks the same
20
+ The hooks surface deliberately reuses the unified `AlsContext`:
21
+ `HookContext` extends `SessionContext`, giving hooks the same
22
22
  context surface tools, providers, and channels get. There is no
23
- parallel state-patch channel — one `AshContext`, one set of keys, one
23
+ parallel state-patch channel — one `AlsContext`, one set of keys, one
24
24
  place to look when debugging.
25
25
 
26
26
  `HookContext` carries `agent`, `channel`, and `session` (which includes
@@ -200,5 +200,5 @@ documented expectations:
200
200
 
201
201
  - [Hooks](../public/hooks.md) — author-facing reference
202
202
  - [Discovery](./discovery.md) — discovery layout and the unified slot walker
203
- - [Unified Context](./context.md) — `AshContext` surface shared by hooks
203
+ - [Unified Context](./context.md) — `AlsContext` surface shared by hooks
204
204
  - [Message Runtime](./message-runtime.md) — runtime stream events
@@ -88,7 +88,7 @@ invariant is enforced structurally by the `runStep` ALS-scope split
88
88
  ### One Ambient Context Contract
89
89
 
90
90
  Do not introduce additional `new AsyncLocalStorage()` instances for Ash runtime
91
- state. Ambient state should flow through the single `AshContext` container and
91
+ state. Ambient state should flow through the single `AlsContext` container and
92
92
  its provider/seed model.
93
93
 
94
94
  Enforcement target: a source-shape test that allowlists the context storage
@@ -16,25 +16,25 @@ Important naming note:
16
16
  Read in this order:
17
17
 
18
18
  1. [Getting Started](./getting-started.md)
19
- 2. [Project Layout](./project-layout.md)
19
+ 2. [Project Layout](./advanced/project-layout.md)
20
20
  3. [`agent.ts`](./agent-ts.md)
21
- 4. [TypeScript API](./typescript-api.md)
22
- 5. [Context Control](./context-control.md)
21
+ 4. [TypeScript API](./advanced/typescript-api.md)
22
+ 5. [Context Control](./advanced/context-control.md)
23
23
  6. [Skills](./skills.md)
24
24
  7. [Tools](./tools.md)
25
25
  8. [Connections](./connections.md)
26
- 9. [Workspace](./workspace.md)
26
+ 9. [Workspace](./advanced/workspace.md)
27
27
  10. [Sandboxes](./sandbox.md)
28
28
  11. [Channels](./channels/README.md)
29
29
  12. [Human In The Loop](./human-in-the-loop.md)
30
- 13. [Session Context](./session-context.md)
31
- 14. [Sessions And Streaming](./runs-and-streaming.md)
30
+ 13. [Session Context](./advanced/session-context.md)
31
+ 14. [Sessions And Streaming](./advanced/runs-and-streaming.md)
32
32
  15. [Subagents](./subagents.md)
33
33
  16. [Schedules](./schedules.md)
34
- 17. [Evals](./evals.md)
35
- 18. [Auth And Route Protection](./auth-and-route-protection.md)
36
- 19. [Vercel Deployment](./vercel-deployment.md)
37
- 20. [CLI, Build, And Debugging](./cli-build-and-debugging.md)
34
+ 17. [Evals](./advanced/evals.md)
35
+ 18. [Auth And Route Protection](./advanced/auth-and-route-protection.md)
36
+ 19. [Vercel Deployment](./advanced/vercel-deployment.md)
37
+ 20. [CLI, Build, And Debugging](./advanced/cli-build-and-debugging.md)
38
38
 
39
39
  ## The Public Mental Model
40
40
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Auth And Route Protection"
3
3
  description: "Protect agent routes with HTTP Basic, JWT, OIDC, and Vercel OIDC."
4
+ url: /auth-and-route-protection
4
5
  ---
5
6
 
6
7
  Ash protects its own HTTP routes through the channel layer.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "CLI, Build, And Debugging"
3
3
  description: "CLI commands: dev, build, info, eval. Debugging techniques."
4
+ url: /cli-build-and-debugging
4
5
  ---
5
6
 
6
7
  Ash's CLI gives you the normal day-to-day workflow for authoring, inspecting, and shipping an app.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Context Control"
3
3
  description: "Author always-on instructions with instructions.md or instructions.ts."
4
+ url: /context-control
4
5
  ---
5
6
 
6
7
  Ash gives you a few different levers for controlling what the model sees and when it sees it.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Evals"
3
3
  description: "Define eval suites with test cases, scoring rubrics, and automated runs."
4
+ url: /evals
4
5
  ---
5
6
 
6
7
  Evals let you define repeatable checks for an Ash agent and run them with the `ash eval` CLI
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "FAQs"
3
3
  description: "Frequently asked questions about Ash."
4
+ url: /faqs
4
5
  ---
5
6
 
6
7
  # FAQs
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Hooks"
3
3
  description: "Subscribe to lifecycle moments and runtime stream events from agent/hooks/."
4
+ url: /hooks
4
5
  ---
5
6
 
6
7
  Hooks are Ash's authored extension points for the per-turn lifecycle and
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "instrumentation.ts"
3
3
  description: "Configure OpenTelemetry exporters and AI SDK span behavior for your agent."
4
+ url: /instrumentation
4
5
  ---
5
6
 
6
7
  `instrumentation.ts` is the single place to configure OpenTelemetry for an Ash agent. It controls
@@ -0,0 +1,19 @@
1
+ {
2
+ "title": "Advanced",
3
+ "pages": [
4
+ "project-layout",
5
+ "context-control",
6
+ "hooks",
7
+ "auth-and-route-protection",
8
+ "vercel-deployment",
9
+ "runs-and-streaming",
10
+ "session-context",
11
+ "workspace",
12
+ "evals",
13
+ "instrumentation",
14
+ "cli-build-and-debugging",
15
+ "typescript-api",
16
+ "...",
17
+ "faqs"
18
+ ]
19
+ }
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Project Layout"
3
3
  description: "Directory structure and filesystem conventions."
4
+ url: /project-layout
4
5
  ---
5
6
 
6
7
  Ash supports two layouts:
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Sessions And Streaming"
3
3
  description: "The HTTP API, NDJSON event stream, and session lifecycle."
4
+ url: /runs-and-streaming
4
5
  ---
5
6
 
6
7
  Ash is durable and session-based by default.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Session Context"
3
3
  description: "Runtime helpers: ctx.session, ctx.getSandbox, ctx.getSkill, and defineState."
4
+ url: /session-context
4
5
  ---
5
6
 
6
7
  Ash exposes runtime state through the `ctx` parameter passed to tool `execute`, hook handlers,
@@ -164,10 +165,10 @@ export default defineHook({
164
165
 
165
166
  ### API
166
167
 
167
- | Method | Description |
168
- | ------------ | -------------------------------------------------------------------------------- |
169
- | `get()` | Read the current value. Returns `initial()` on first access. Throws outside ALS. |
170
- | `update(fn)` | Apply a function to the current value. Throws outside ALS. |
168
+ | Method | Description |
169
+ | ------------ | ------------------------------------------------------------------------------------------ |
170
+ | `get()` | Read the current value. Returns `initial()` on first access. Throws outside managed scope. |
171
+ | `update(fn)` | Apply a function to the current value. Throws outside managed scope. |
171
172
 
172
173
  ## Where These APIs Work
173
174
 
@@ -188,20 +189,18 @@ explaining the required scope.
188
189
 
189
190
  ## How It Works
190
191
 
191
- All runtime accessors read from the same `AshContext` container bound by a single `AsyncLocalStorage`.
192
- The framework sets up this context before invoking authored code:
192
+ The framework sets up a context container before invoking authored code:
193
193
 
194
- 1. The runtime entry point creates an `AshContext` and populates durable seed keys (auth, session
195
- ID, compiled bundle).
196
- 2. Before each step, providers create virtual step-local values (session metadata, sandbox access,
197
- skill access) from the current context.
198
- 3. The step callback runs inside the `AsyncLocalStorage` scope, making the context available to
199
- all authored code in the call chain.
200
- 4. After the step, framework providers with provider-owned mutable state (for example the sandbox)
201
- commit those changes back onto the harness session.
194
+ 1. The runtime populates durable seed values (auth, session ID, compiled bundle).
195
+ 2. Before each step, the framework derives step-local values (session metadata, sandbox access,
196
+ skill access) from the durable state.
197
+ 3. Authored code runs inside the managed scope, so `ctx` and `defineState` accessors resolve
198
+ automatically.
199
+ 4. After the step, the framework commits mutable state (for example sandbox changes) back to
200
+ the durable session.
202
201
 
203
- This lifecycle is fully managed by the framework. Authored code only needs to call the public
204
- accessors.
202
+ This lifecycle is fully managed by the framework. Authored code only needs to use `ctx` and
203
+ the public accessors.
205
204
 
206
205
  ## What To Read Next
207
206
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "TypeScript API"
3
3
  description: "TypeScript API: defineAgent, defineTool, defineSandbox, and all runtime helpers."
4
+ url: /typescript-api
4
5
  ---
5
6
 
6
7
  This page is the quick reference for Ash's public TypeScript surface.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Vercel Deployment"
3
3
  description: "Deploy your agent to Vercel."
4
+ url: /vercel-deployment
4
5
  ---
5
6
 
6
7
  Ash is designed to run locally and on Vercel.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: "Workspace"
3
3
  description: "Shared filesystem state and the default workspace."
4
+ url: /workspace
4
5
  ---
5
6
 
6
7
  Every Ash session gets a shared runtime workspace exposed to the model as the `bash` tool.
@@ -12,20 +12,7 @@
12
12
  "schedules",
13
13
  "connections",
14
14
  "---",
15
- "project-layout",
16
- "context-control",
17
- "hooks",
18
- "auth-and-route-protection",
19
- "vercel-deployment",
20
- "runs-and-streaming",
21
- "session-context",
22
- "workspace",
23
- "evals",
24
- "instrumentation",
25
- "cli-build-and-debugging",
26
- "typescript-api",
27
- "...",
28
- "faqs",
15
+ "advanced",
29
16
  "---",
30
17
  "research"
31
18
  ]
@@ -3,7 +3,7 @@ import type { RouteHandler, SendFn } from "#channel/routes.js";
3
3
  import type { Session } from "#channel/session.js";
4
4
  import type { SessionAuthContext } from "#channel/types.js";
5
5
  export declare const CHANNEL_SENTINEL: "ash:channel";
6
- export interface CompiledChannel<TState = undefined> {
6
+ export interface CompiledChannel<TState = undefined, TReceiveArgs = Record<string, unknown>> {
7
7
  readonly __kind: typeof CHANNEL_SENTINEL;
8
8
  readonly routes: readonly {
9
9
  method: string;
@@ -13,7 +13,7 @@ export interface CompiledChannel<TState = undefined> {
13
13
  readonly adapter: ChannelAdapter<any>;
14
14
  readonly receive?: (input: {
15
15
  readonly message: string;
16
- readonly args: Readonly<Record<string, unknown>>;
16
+ readonly args: Readonly<TReceiveArgs>;
17
17
  readonly auth: SessionAuthContext | null;
18
18
  }, args: {
19
19
  send: SendFn<TState>;
@@ -248,7 +248,7 @@ export interface Runtime {
248
248
  * Starts a new run from a flat platform-shape input.
249
249
  *
250
250
  * The runtime loads the compiled bundle (using the node id
251
- * baked in at construction time), builds the seeded {@link AshContext},
251
+ * baked in at construction time), builds the seeded {@link AlsContext},
252
252
  * and drives the step loop to completion.
253
253
  */
254
254
  run(input: RunInput): Promise<RunHandle>;
@@ -6,6 +6,7 @@
6
6
  "@chat-adapter/state-memory": "4.29.0",
7
7
  "chokidar": "5.0.0",
8
8
  "commander": "14.0.3",
9
+ "experimental-ai-sdk-code-mode": "1.0.10",
9
10
  "@ai-sdk/google": "4.0.0-canary.73",
10
11
  "gray-matter": "4.0.3",
11
12
  "jose": "6.2.3",
@@ -26,5 +27,5 @@
26
27
  "zod": "4.4.3",
27
28
  "zod-validation-error": "5.0.0"
28
29
  },
29
- "scriptHash": "de60e990328c8664beec98bc5e81625ecdc0cdace1ba8bd8aa267bf9bea29af4"
30
+ "scriptHash": "6a2fa642d99a77617cbfb4e0dc7bbbd774c22d880ea5726a09069c812896bfdd"
30
31
  }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vercel Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,144 @@
1
+ import type { ModelMessage, ToolSet } from "ai";
2
+
3
+ export interface CodeModeInterruptPayload {
4
+ readonly kind?: string;
5
+ readonly [key: string]: unknown;
6
+ }
7
+
8
+ export interface CodeModeContinuation {
9
+ readonly outerToolCallId: string;
10
+ readonly [key: string]: unknown;
11
+ }
12
+
13
+ export interface CodeModePendingContinuation<
14
+ Payload extends CodeModeInterruptPayload = CodeModeInterruptPayload,
15
+ > {
16
+ readonly continuation: CodeModeContinuation;
17
+ readonly interrupt: CodeModeInterruptCore<Payload>;
18
+ readonly type: "code-mode-pending-continuation";
19
+ readonly [key: string]: unknown;
20
+ }
21
+
22
+ export interface CodeModeInterruptCore<
23
+ Payload extends CodeModeInterruptPayload = CodeModeInterruptPayload,
24
+ > {
25
+ readonly continuation: CodeModeContinuation;
26
+ readonly interruptId: string;
27
+ readonly payload: Payload;
28
+ readonly type: "code-mode-interrupt";
29
+ }
30
+
31
+ export interface CodeModeInterrupt<
32
+ Payload extends CodeModeInterruptPayload = CodeModeInterruptPayload,
33
+ > extends CodeModeInterruptCore<Payload> {
34
+ readonly pendingContinuation: CodeModePendingContinuation<Payload>;
35
+ }
36
+
37
+ export interface CodeModeApprovalInterrupt {
38
+ readonly approvalId: string;
39
+ readonly continuation: CodeModeContinuation;
40
+ readonly toolCallId: string;
41
+ readonly toolName: string;
42
+ readonly type: "code-mode-approval-required";
43
+ }
44
+
45
+ export interface CodeModeInterruptExecutionContext<
46
+ Payload extends CodeModeInterruptPayload = CodeModeInterruptPayload,
47
+ Resolution = unknown,
48
+ > {
49
+ readonly interruptId: string;
50
+ readonly payload: Payload;
51
+ readonly resolution: Resolution;
52
+ }
53
+
54
+ export interface CodeModeNestedToolCallEvent {
55
+ readonly bridgeIndex: number;
56
+ readonly input: unknown;
57
+ readonly inputBytes: number;
58
+ readonly invocationId: string;
59
+ readonly outerToolCallId: string;
60
+ readonly replayed?: boolean;
61
+ readonly startedAtMs: number;
62
+ readonly toolCallId: string;
63
+ readonly toolName: string;
64
+ }
65
+
66
+ export interface CodeModeNestedToolResultEvent {
67
+ readonly bridgeIndex: number;
68
+ readonly completedAtMs: number;
69
+ readonly durationMs: number;
70
+ readonly error?: unknown;
71
+ readonly input: unknown;
72
+ readonly inputBytes: number;
73
+ readonly invocationId: string;
74
+ readonly outerToolCallId: string;
75
+ readonly output?: unknown;
76
+ readonly outputBytes?: number;
77
+ readonly replayed?: boolean;
78
+ readonly startedAtMs: number;
79
+ readonly status: "fulfilled" | "rejected" | "interrupted" | "approval-required";
80
+ readonly toolCallId: string;
81
+ readonly toolName: string;
82
+ }
83
+
84
+ export interface CodeModeLifecycleHookErrorEvent {
85
+ readonly event: unknown;
86
+ readonly hook: string;
87
+ }
88
+
89
+ export interface CodeModeOptions {
90
+ readonly approval?: {
91
+ readonly mode: "interrupt";
92
+ };
93
+ readonly lifecycle?: {
94
+ readonly onHookError?: (
95
+ error: unknown,
96
+ event: CodeModeLifecycleHookErrorEvent,
97
+ ) => void | Promise<void>;
98
+ readonly onInterrupt?: (event: unknown) => void | Promise<void>;
99
+ readonly onNestedToolCall?: (event: CodeModeNestedToolCallEvent) => void | Promise<void>;
100
+ readonly onNestedToolResult?: (event: CodeModeNestedToolResultEvent) => void | Promise<void>;
101
+ };
102
+ }
103
+
104
+ export interface CodeModeUnwrappedResult {
105
+ readonly interrupt?: CodeModeInterrupt | CodeModeApprovalInterrupt;
106
+ readonly output?: unknown;
107
+ readonly status: "completed" | "interrupted";
108
+ }
109
+
110
+ export class CodeModeProtocolError extends Error {
111
+ readonly code: "CODE_MODE_PROTOCOL_ERROR";
112
+ readonly details?: unknown;
113
+ constructor(message: string, details?: unknown);
114
+ }
115
+
116
+ export function createCodeModeTool(tools: ToolSet, options?: CodeModeOptions): unknown;
117
+ export function continueCodeModeApproval(input: {
118
+ readonly approvalResponse: unknown;
119
+ readonly interrupt: CodeModeApprovalInterrupt;
120
+ readonly options?: CodeModeOptions;
121
+ readonly tools: ToolSet;
122
+ }): Promise<unknown>;
123
+ export function continueCodeModeInterrupt(input: {
124
+ readonly interrupt: CodeModeInterrupt;
125
+ readonly resolution: unknown;
126
+ readonly options?: CodeModeOptions;
127
+ readonly tools: ToolSet;
128
+ }): Promise<unknown>;
129
+ export function getCodeModeApprovalResponse(
130
+ messages: readonly ModelMessage[],
131
+ interrupt: CodeModeApprovalInterrupt,
132
+ ): unknown | undefined;
133
+ export function getCodeModeInterrupt(value: unknown): CodeModeInterrupt | undefined;
134
+ export function isCodeModeApprovalInterrupt(value: unknown): value is CodeModeApprovalInterrupt;
135
+ export function replaceCodeModeInterruptResult(
136
+ messages: readonly ModelMessage[],
137
+ pending: CodeModePendingContinuation,
138
+ finalOutput: unknown,
139
+ ): ModelMessage[];
140
+ export function requestCodeModeInterrupt(payload: CodeModeInterruptPayload): never;
141
+ export function toCodeModeApprovalMessages(
142
+ interrupt: CodeModeApprovalInterrupt,
143
+ ): readonly ModelMessage[];
144
+ export function unwrapCodeModeResult(value: unknown): CodeModeUnwrappedResult;