experimental-ash 0.26.0 → 0.27.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 (748) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/docs/public/subagents.md +38 -0
  3. package/dist/src/_virtual/_rolldown/runtime.js +1 -0
  4. package/dist/src/channel/adapter-context.js +1 -24
  5. package/dist/src/channel/adapter.js +1 -62
  6. package/dist/src/channel/compiled-channel.js +1 -6
  7. package/dist/src/channel/cross-channel-receive.js +2 -108
  8. package/dist/src/channel/http.js +1 -30
  9. package/dist/src/channel/receive-args.js +1 -1
  10. package/dist/src/channel/resolve-text.js +1 -59
  11. package/dist/src/channel/routes.js +1 -15
  12. package/dist/src/channel/schedule.js +1 -81
  13. package/dist/src/channel/send.js +1 -81
  14. package/dist/src/channel/session-callback.js +1 -65
  15. package/dist/src/channel/session.js +1 -58
  16. package/dist/src/channel/types.js +1 -1
  17. package/dist/src/cli/commands/channels.js +3 -9
  18. package/dist/src/cli/commands/info.js +2 -2
  19. package/dist/src/cli/dev/environment.js +1 -1
  20. package/dist/src/cli/dev/input-requests.js +1 -1
  21. package/dist/src/cli/dev/input.js +1 -1
  22. package/dist/src/cli/dev/repl.js +2 -3
  23. package/dist/src/cli/dev/terminal.js +5 -5
  24. package/dist/src/cli/dev/url.js +1 -1
  25. package/dist/src/cli/run.js +2 -2
  26. package/dist/src/cli/ui/output.js +8 -8
  27. package/dist/src/client/client-error.js +1 -19
  28. package/dist/src/client/client.js +1 -128
  29. package/dist/src/client/index.js +1 -11
  30. package/dist/src/client/message-reducer-types.js +1 -1
  31. package/dist/src/client/message-reducer.js +1 -456
  32. package/dist/src/client/message-response.js +1 -55
  33. package/dist/src/client/ndjson.js +3 -62
  34. package/dist/src/client/open-stream.js +1 -45
  35. package/dist/src/client/reducer.js +1 -1
  36. package/dist/src/client/session-utils.js +1 -62
  37. package/dist/src/client/session.js +1 -206
  38. package/dist/src/client/types.js +1 -1
  39. package/dist/src/client/url.js +1 -34
  40. package/dist/src/compiled/.vendor-stamp.json +6 -1
  41. package/dist/src/compiled/@vercel/oidc/LICENSE +202 -0
  42. package/dist/src/compiled/@vercel/oidc/index.d.ts +21 -0
  43. package/dist/src/compiled/@vercel/oidc/index.js +2 -0
  44. package/dist/src/compiled/@vercel/oidc/package.json +7 -0
  45. package/dist/src/compiled/chokidar/LICENSE +21 -0
  46. package/dist/src/compiled/chokidar/index.d.ts +33 -0
  47. package/dist/src/compiled/chokidar/index.js +1 -0
  48. package/dist/src/compiled/chokidar/package.json +7 -0
  49. package/dist/src/compiled/commander/LICENSE +22 -0
  50. package/dist/src/compiled/commander/index.d.ts +1113 -0
  51. package/dist/src/{chunks/url-JdCGA634.js → compiled/commander/index.js} +10 -10
  52. package/dist/src/compiled/commander/package.json +7 -0
  53. package/dist/src/compiled/gray-matter/LICENSE +21 -0
  54. package/dist/src/compiled/gray-matter/index.d.ts +62 -0
  55. package/dist/src/{chunks/gray-matter-D-9jHwOT.js → compiled/gray-matter/index.js} +2 -2
  56. package/dist/src/compiled/gray-matter/package.json +7 -0
  57. package/dist/src/compiled/picocolors/LICENSE +15 -0
  58. package/dist/src/compiled/picocolors/index.d.ts +55 -0
  59. package/dist/src/compiled/picocolors/index.js +1 -0
  60. package/dist/src/compiled/picocolors/package.json +7 -0
  61. package/dist/src/compiler/artifacts.js +1 -147
  62. package/dist/src/compiler/compile-agent.js +3 -76
  63. package/dist/src/compiler/compile-from-memory.js +1 -59
  64. package/dist/src/compiler/manifest.js +1 -424
  65. package/dist/src/compiler/model-catalog.js +1 -224
  66. package/dist/src/compiler/module-map.js +5 -295
  67. package/dist/src/compiler/normalize-agent-config.js +1 -157
  68. package/dist/src/compiler/normalize-channel.js +1 -51
  69. package/dist/src/compiler/normalize-connection.js +1 -58
  70. package/dist/src/compiler/normalize-helpers.js +1 -23
  71. package/dist/src/compiler/normalize-hook.js +1 -19
  72. package/dist/src/compiler/normalize-instructions.js +1 -28
  73. package/dist/src/compiler/normalize-manifest.js +1 -79
  74. package/dist/src/compiler/normalize-sandbox.js +1 -20
  75. package/dist/src/compiler/normalize-schedule.js +1 -38
  76. package/dist/src/compiler/normalize-skill.js +1 -60
  77. package/dist/src/compiler/normalize-subagent.js +1 -174
  78. package/dist/src/compiler/normalize-tool.js +1 -40
  79. package/dist/src/compiler/remote-agent-node.js +1 -19
  80. package/dist/src/compiler/workspace-resources.js +1 -85
  81. package/dist/src/context/accessors.js +1 -93
  82. package/dist/src/context/container.js +1 -89
  83. package/dist/src/context/hook-lifecycle.js +1 -242
  84. package/dist/src/context/key.js +1 -39
  85. package/dist/src/context/keys.js +1 -43
  86. package/dist/src/context/node.js +1 -9
  87. package/dist/src/context/provider.js +1 -1
  88. package/dist/src/context/providers/connection.js +1 -17
  89. package/dist/src/context/providers/sandbox.js +1 -46
  90. package/dist/src/context/providers/session.js +1 -18
  91. package/dist/src/context/run-step.js +1 -51
  92. package/dist/src/context/seed-keys.js +1 -37
  93. package/dist/src/context/serialize.js +1 -44
  94. package/dist/src/discover/connections.js +1 -153
  95. package/dist/src/discover/diagnostics.js +1 -82
  96. package/dist/src/discover/discover-agent.js +1 -159
  97. package/dist/src/discover/discover-subagent.js +1 -223
  98. package/dist/src/discover/filesystem.js +1 -215
  99. package/dist/src/discover/grammar.js +1 -371
  100. package/dist/src/discover/lib.js +1 -34
  101. package/dist/src/discover/manifest.js +1 -136
  102. package/dist/src/discover/markdown.js +1 -17
  103. package/dist/src/discover/named-source-directory.js +1 -188
  104. package/dist/src/discover/project-source.js +1 -152
  105. package/dist/src/discover/project.js +1 -117
  106. package/dist/src/discover/sandbox.js +1 -220
  107. package/dist/src/discover/schedules.js +1 -41
  108. package/dist/src/discover/skills.js +1 -274
  109. package/dist/src/discover/slots.js +1 -68
  110. package/dist/src/evals/cli/eval.js +1 -1
  111. package/dist/src/evals/define-eval-suite.js +1 -1
  112. package/dist/src/evals/index.js +1 -1
  113. package/dist/src/evals/loaders/index.js +1 -1
  114. package/dist/src/evals/loaders/json.js +1 -1
  115. package/dist/src/evals/loaders/yaml.js +1 -1
  116. package/dist/src/evals/reporters/index.js +1 -1
  117. package/dist/src/evals/runner/artifacts.js +3 -3
  118. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  119. package/dist/src/evals/runner/discover.js +1 -1
  120. package/dist/src/evals/runner/execute-case.js +1 -1
  121. package/dist/src/evals/runner/execute-suite.js +1 -1
  122. package/dist/src/evals/runner/reporters/braintrust.js +2 -2
  123. package/dist/src/evals/runner/reporters/console.js +1 -1
  124. package/dist/src/evals/runner/resolve-git-metadata.js +1 -1
  125. package/dist/src/evals/scorers/autoevals-client.js +2 -2
  126. package/dist/src/evals/scorers/autoevals.js +1 -1
  127. package/dist/src/evals/scorers/json.js +1 -1
  128. package/dist/src/evals/scorers/run.js +1 -1
  129. package/dist/src/evals/scorers/sql.js +1 -1
  130. package/dist/src/evals/scorers/text.js +1 -1
  131. package/dist/src/evals/scores/index.js +1 -1
  132. package/dist/src/execution/authorization-challenge-defaults.js +1 -60
  133. package/dist/src/execution/await-authorization-orchestrator.js +1 -192
  134. package/dist/src/execution/await-authorization-splice.js +1 -66
  135. package/dist/src/execution/connection-auth-steps.js +1 -338
  136. package/dist/src/execution/node-step.js +1 -146
  137. package/dist/src/execution/remote-agent-dispatch.js +1 -79
  138. package/dist/src/execution/runtime-context.js +1 -26
  139. package/dist/src/execution/runtime-errors.js +1 -19
  140. package/dist/src/execution/sandbox/bash-tool.js +1 -42
  141. package/dist/src/execution/sandbox/bindings/local.js +1 -296
  142. package/dist/src/execution/sandbox/bindings/vercel.js +1 -363
  143. package/dist/src/execution/sandbox/ensure.js +1 -91
  144. package/dist/src/execution/sandbox/glob-tool.js +3 -146
  145. package/dist/src/execution/sandbox/grep-tool.js +3 -183
  146. package/dist/src/execution/sandbox/lazy-backend.js +1 -33
  147. package/dist/src/execution/sandbox/prewarm.js +1 -132
  148. package/dist/src/execution/sandbox/read-file-tool.js +3 -118
  149. package/dist/src/execution/sandbox/require-sandbox.js +1 -32
  150. package/dist/src/execution/sandbox/ripgrep-probe.js +1 -36
  151. package/dist/src/execution/sandbox/session.js +3 -158
  152. package/dist/src/execution/sandbox/shell-quote.js +1 -14
  153. package/dist/src/execution/sandbox/stream-utils.js +1 -22
  154. package/dist/src/execution/sandbox/truncate-output.js +3 -110
  155. package/dist/src/execution/sandbox/write-file-tool.js +1 -62
  156. package/dist/src/execution/session-callback-step.js +1 -72
  157. package/dist/src/execution/session.js +3 -94
  158. package/dist/src/execution/skills/instructions.js +2 -30
  159. package/dist/src/execution/skills/types.js +1 -1
  160. package/dist/src/execution/subagent-adapter.js +1 -94
  161. package/dist/src/execution/subagent-hitl-proxy.js +1 -81
  162. package/dist/src/execution/subagent-invocation.js +2 -16
  163. package/dist/src/execution/subagent-tool.js +1 -48
  164. package/dist/src/execution/tool-compaction.js +1 -54
  165. package/dist/src/execution/turn-workflow.js +1 -95
  166. package/dist/src/execution/web-fetch/html.js +7 -60
  167. package/dist/src/execution/web-fetch/tool.js +1 -90
  168. package/dist/src/execution/workflow-entry.js +1 -494
  169. package/dist/src/execution/workflow-errors.js +1 -54
  170. package/dist/src/execution/workflow-runtime.js +3 -161
  171. package/dist/src/execution/workflow-steps.js +1 -467
  172. package/dist/src/harness/action-result-helpers.js +1 -82
  173. package/dist/src/harness/attachment-staging.js +1 -303
  174. package/dist/src/harness/compaction.js +4 -221
  175. package/dist/src/harness/emission.js +1 -323
  176. package/dist/src/harness/execute-tool.js +1 -1
  177. package/dist/src/harness/input-extraction.js +1 -62
  178. package/dist/src/harness/input-requests.js +1 -306
  179. package/dist/src/harness/instrumentation-config.js +1 -42
  180. package/dist/src/harness/messages.js +1 -144
  181. package/dist/src/harness/model-call-error.js +1 -368
  182. package/dist/src/harness/otel-integration.js +1 -18
  183. package/dist/src/harness/prompt-cache.js +1 -137
  184. package/dist/src/harness/provider-tools.js +1 -137
  185. package/dist/src/harness/proxy-input-requests.js +1 -91
  186. package/dist/src/harness/runtime-actions.js +1 -321
  187. package/dist/src/harness/step-hooks.js +1 -192
  188. package/dist/src/harness/tool-loop.js +1 -877
  189. package/dist/src/harness/tool-result-pruning.js +1 -124
  190. package/dist/src/harness/tools.js +1 -98
  191. package/dist/src/harness/types.js +1 -1
  192. package/dist/src/index.js +1 -1
  193. package/dist/src/internal/application/cache-metadata.js +1 -42
  194. package/dist/src/internal/application/compiled-artifacts.js +4 -114
  195. package/dist/src/internal/application/import-specifier.js +1 -58
  196. package/dist/src/internal/application/package.js +1 -196
  197. package/dist/src/internal/application/paths.js +1 -117
  198. package/dist/src/internal/application/runtime-compiled-artifacts-source.js +1 -11
  199. package/dist/src/internal/attachments/data.js +1 -127
  200. package/dist/src/internal/attachments/errors.js +1 -26
  201. package/dist/src/internal/attachments/refs.js +1 -94
  202. package/dist/src/internal/attachments/sandbox-refs.js +1 -78
  203. package/dist/src/internal/attachments/url-refs.js +1 -20
  204. package/dist/src/internal/authored-asset-import-plugin.js +1 -141
  205. package/dist/src/internal/authored-definition/channel.js +1 -21
  206. package/dist/src/internal/authored-definition/connection.js +1 -148
  207. package/dist/src/internal/authored-definition/core.js +1 -180
  208. package/dist/src/internal/authored-definition/sandbox.js +1 -47
  209. package/dist/src/internal/authored-definition/schema-backed.js +1 -56
  210. package/dist/src/internal/authored-module-bundle.js +2 -19
  211. package/dist/src/internal/authored-module-loader.js +2 -263
  212. package/dist/src/internal/authored-module-map-loader.js +1 -53
  213. package/dist/src/internal/authored-module.js +1 -81
  214. package/dist/src/internal/authored-package-tsconfig-paths.js +1 -209
  215. package/dist/src/internal/bundler/nitro-rolldown.js +1 -42
  216. package/dist/src/internal/helpers/markdown.js +3 -174
  217. package/dist/src/internal/json-schema.js +1 -13
  218. package/dist/src/internal/logging.js +1 -226
  219. package/dist/src/internal/nitro/host/artifacts-config.js +1 -17
  220. package/dist/src/internal/nitro/host/build-application.js +1 -177
  221. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -140
  222. package/dist/src/internal/nitro/host/channel-routes.js +2 -126
  223. package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +2 -28
  224. package/dist/src/internal/nitro/host/configure-nitro-routes.js +4 -272
  225. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -491
  226. package/dist/src/internal/nitro/host/cron-handler-route.js +1 -49
  227. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -390
  228. package/dist/src/internal/nitro/host/nitro-bundler-config.js +1 -10
  229. package/dist/src/internal/nitro/host/nitro-routing-import-specifier-plugin.js +1 -28
  230. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -32
  231. package/dist/src/internal/nitro/host/schedule-task-routes.js +2 -148
  232. package/dist/src/internal/nitro/host/server-external-packages.js +1 -107
  233. package/dist/src/internal/nitro/host/start-development-server.js +1 -223
  234. package/dist/src/internal/nitro/host/types.js +1 -1
  235. package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -14
  236. package/dist/src/internal/nitro/host/vercel-build-prewarm.js +1 -30
  237. package/dist/src/internal/nitro/host.js +1 -2
  238. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +2 -180
  239. package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -46
  240. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -74
  241. package/dist/src/internal/nitro/routes/health.js +1 -17
  242. package/dist/src/internal/nitro/routes/index.js +2 -89
  243. package/dist/src/internal/nitro/routes/info.js +1 -50
  244. package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -24
  245. package/dist/src/internal/nitro/routes/runtime-stack.js +1 -23
  246. package/dist/src/internal/nitro/routes/schedule-task.js +1 -57
  247. package/dist/src/internal/nitro/routes/workflow-data.js +1 -141
  248. package/dist/src/internal/nitro/routes/workflow-route-helpers.js +1 -137
  249. package/dist/src/internal/nitro/routes/workflow-run-events.js +1 -41
  250. package/dist/src/internal/nitro/routes/workflow-run-steps.js +1 -41
  251. package/dist/src/internal/nitro/routes/workflow-run.js +1 -34
  252. package/dist/src/internal/nitro/routes/workflow-runs.js +1 -28
  253. package/dist/src/internal/node-esm-compat-banner.js +2 -65
  254. package/dist/src/internal/package-name.js +1 -8
  255. package/dist/src/internal/process/pnpm.js +1 -50
  256. package/dist/src/internal/runtime-model.js +1 -24
  257. package/dist/src/internal/runtime-registry.js +1 -93
  258. package/dist/src/internal/vercel-agent-summary.js +1 -72
  259. package/dist/src/internal/workflow/builtins.js +1 -18
  260. package/dist/src/internal/workflow/index.js +1 -9
  261. package/dist/src/internal/workflow-bundle/ash-service-route-output.js +3 -93
  262. package/dist/src/internal/workflow-bundle/builder-support.js +5 -372
  263. package/dist/src/internal/workflow-bundle/builder.js +5 -472
  264. package/dist/src/internal/workflow-bundle/nitro-step-entry.js +2 -132
  265. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +3 -494
  266. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -292
  267. package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -84
  268. package/dist/src/internal/workflow-bundle/workflow-transformer.js +5 -318
  269. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js +1 -0
  270. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +1 -0
  271. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +2 -0
  272. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +1 -0
  273. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +1 -0
  274. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +1 -0
  275. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +1 -0
  276. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +1 -0
  277. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +1 -0
  278. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +1 -0
  279. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +1 -0
  280. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +1 -0
  281. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +1 -0
  282. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +4 -0
  283. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +1 -0
  284. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +1 -0
  285. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +1 -0
  286. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +1 -0
  287. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +1 -0
  288. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +1 -0
  289. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.js +1 -0
  290. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +1 -0
  291. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +1 -0
  292. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +1 -0
  293. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +1 -0
  294. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +1 -0
  295. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +1 -0
  296. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +1 -0
  297. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +1 -0
  298. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +1 -0
  299. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +4 -0
  300. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +1 -0
  301. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -0
  302. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +1 -0
  303. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +1 -0
  304. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +1 -0
  305. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +1 -0
  306. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +1 -0
  307. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +1 -0
  308. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +1 -0
  309. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +1 -0
  310. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +1 -0
  311. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +1 -0
  312. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +1 -0
  313. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +1 -0
  314. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +1 -0
  315. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +1 -0
  316. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +1 -0
  317. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js +1 -0
  318. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +1 -0
  319. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +1 -0
  320. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +1 -0
  321. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +1 -0
  322. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +1 -0
  323. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +1 -0
  324. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +1 -0
  325. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +1 -0
  326. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +1 -0
  327. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -0
  328. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +1 -0
  329. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +1 -0
  330. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +1 -0
  331. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +1 -0
  332. package/dist/src/node_modules/.pnpm/autoevals@0.0.132_ws@8.21.0/node_modules/autoevals/jsdist/index.js +384 -0
  333. package/dist/src/node_modules/.pnpm/compute-cosine-similarity@1.1.0/node_modules/compute-cosine-similarity/lib/index.js +1 -0
  334. package/dist/src/node_modules/.pnpm/compute-dot@1.1.0/node_modules/compute-dot/lib/index.js +1 -0
  335. package/dist/src/node_modules/.pnpm/compute-l2norm@1.1.0/node_modules/compute-l2norm/lib/index.js +1 -0
  336. package/dist/src/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +1 -0
  337. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +1 -0
  338. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js +1 -0
  339. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js +1 -0
  340. package/dist/src/node_modules/.pnpm/js-levenshtein@1.1.6/node_modules/js-levenshtein/index.js +1 -0
  341. package/dist/src/node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/dist/js-yaml.js +32 -0
  342. package/dist/src/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +1 -0
  343. package/dist/src/node_modules/.pnpm/mustache@4.2.0/node_modules/mustache/mustache.js +4 -0
  344. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/_vendor/partial-json-parser/parser.js +2 -0
  345. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/auth/workload-identity-auth.js +1 -0
  346. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/azure.js +1 -0
  347. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/client.js +11 -0
  348. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/api-promise.js +1 -0
  349. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/error.js +1 -0
  350. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/pagination.js +1 -0
  351. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/resource.js +1 -0
  352. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/streaming.js +3 -0
  353. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/core/uploads.js +1 -0
  354. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/error.js +1 -0
  355. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/index.js +1 -0
  356. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/decoders/line.js +3 -0
  357. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/detect-platform.js +1 -0
  358. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/errors.js +1 -0
  359. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/headers.js +1 -0
  360. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/parse.js +1 -0
  361. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/formats.js +1 -0
  362. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/stringify.js +1 -0
  363. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/utils.js +1 -0
  364. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/request-options.js +1 -0
  365. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/shims.js +1 -0
  366. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/to-file.js +1 -0
  367. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/tslib.js +1 -0
  368. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/uploads.js +1 -0
  369. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/base64.js +1 -0
  370. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/bytes.js +1 -0
  371. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/env.js +1 -0
  372. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/log.js +1 -0
  373. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/path.js +2 -0
  374. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/query.js +1 -0
  375. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/sleep.js +1 -0
  376. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/uuid.js +1 -0
  377. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/values.js +1 -0
  378. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils.js +1 -0
  379. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.js +1 -0
  380. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/AssistantStream.js +1 -0
  381. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionRunner.js +1 -0
  382. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.js +1 -0
  383. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.js +1 -0
  384. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/EventStream.js +1 -0
  385. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ResponsesParser.js +1 -0
  386. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/RunnableFunction.js +1 -0
  387. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/Util.js +1 -0
  388. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/chatCompletionUtils.js +1 -0
  389. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/parser.js +1 -0
  390. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.js +1 -0
  391. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/admin.js +1 -0
  392. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/admin-api-keys.js +1 -0
  393. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/audit-logs.js +1 -0
  394. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/certificates.js +1 -0
  395. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/data-retention.js +1 -0
  396. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/groups.js +1 -0
  397. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/roles.js +1 -0
  398. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/users.js +1 -0
  399. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/invites.js +1 -0
  400. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/organization.js +1 -0
  401. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/api-keys.js +1 -0
  402. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/certificates.js +1 -0
  403. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/data-retention.js +1 -0
  404. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/groups/groups.js +1 -0
  405. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/groups/roles.js +1 -0
  406. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +1 -0
  407. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/model-permissions.js +1 -0
  408. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/projects.js +1 -0
  409. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/rate-limits.js +1 -0
  410. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/roles.js +1 -0
  411. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts.js +1 -0
  412. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +1 -0
  413. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/users/roles.js +1 -0
  414. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/users/users.js +1 -0
  415. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/roles.js +1 -0
  416. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/spend-alerts.js +1 -0
  417. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/usage.js +1 -0
  418. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/users/roles.js +1 -0
  419. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/users/users.js +1 -0
  420. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/audio.js +1 -0
  421. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/speech.js +1 -0
  422. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/transcriptions.js +1 -0
  423. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/translations.js +1 -0
  424. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/batches.js +1 -0
  425. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/assistants.js +1 -0
  426. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/beta.js +1 -0
  427. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/chatkit.js +1 -0
  428. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/sessions.js +1 -0
  429. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/threads.js +1 -0
  430. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/realtime.js +1 -0
  431. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/sessions.js +1 -0
  432. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/transcription-sessions.js +1 -0
  433. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/messages.js +1 -0
  434. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/runs.js +1 -0
  435. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/steps.js +1 -0
  436. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/threads.js +1 -0
  437. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/chat.js +1 -0
  438. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/completions.js +1 -0
  439. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/index.js +1 -0
  440. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/messages.js +1 -0
  441. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/index.js +1 -0
  442. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/completions.js +1 -0
  443. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/containers.js +1 -0
  444. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/files/content.js +1 -0
  445. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/files/files.js +1 -0
  446. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/conversations/conversations.js +1 -0
  447. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/conversations/items.js +1 -0
  448. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/embeddings.js +1 -0
  449. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/evals.js +1 -0
  450. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/runs/output-items.js +1 -0
  451. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/runs/runs.js +1 -0
  452. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/files.js +1 -0
  453. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/alpha.js +1 -0
  454. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/graders.js +1 -0
  455. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +1 -0
  456. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +1 -0
  457. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/fine-tuning.js +1 -0
  458. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +1 -0
  459. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/jobs.js +1 -0
  460. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/methods.js +1 -0
  461. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/graders/grader-models.js +1 -0
  462. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/graders/graders.js +1 -0
  463. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/images.js +1 -0
  464. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/index.js +1 -0
  465. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/models.js +1 -0
  466. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/moderations.js +1 -0
  467. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/calls.js +1 -0
  468. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/client-secrets.js +1 -0
  469. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/realtime.js +1 -0
  470. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/input-items.js +1 -0
  471. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/input-tokens.js +1 -0
  472. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/responses.js +1 -0
  473. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/shared.js +1 -0
  474. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/content.js +1 -0
  475. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/skills.js +1 -0
  476. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/versions/content.js +1 -0
  477. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/versions/versions.js +1 -0
  478. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/uploads/parts.js +1 -0
  479. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/uploads/uploads.js +1 -0
  480. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/file-batches.js +1 -0
  481. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/files.js +1 -0
  482. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/vector-stores.js +1 -0
  483. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/videos.js +1 -0
  484. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks/index.js +1 -0
  485. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks/webhooks.js +1 -0
  486. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks.js +1 -0
  487. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/streaming.js +1 -0
  488. package/dist/src/node_modules/.pnpm/openai@6.39.0_ws@8.21.0_zod@3.25.76/node_modules/openai/version.js +1 -0
  489. package/dist/src/node_modules/.pnpm/validate.io-array@1.0.6/node_modules/validate.io-array/lib/index.js +1 -0
  490. package/dist/src/node_modules/.pnpm/validate.io-function@1.0.2/node_modules/validate.io-function/lib/index.js +1 -0
  491. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js +1 -0
  492. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js +1 -0
  493. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +1 -0
  494. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +1 -0
  495. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/index.js +1 -0
  496. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js +1 -0
  497. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseTypes.js +1 -0
  498. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +1 -0
  499. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +1 -0
  500. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +1 -0
  501. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +1 -0
  502. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +1 -0
  503. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +1 -0
  504. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +1 -0
  505. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +1 -0
  506. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +1 -0
  507. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +1 -0
  508. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +1 -0
  509. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +1 -0
  510. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +1 -0
  511. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +1 -0
  512. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +1 -0
  513. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +1 -0
  514. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +1 -0
  515. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +1 -0
  516. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +1 -0
  517. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +1 -0
  518. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +1 -0
  519. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +1 -0
  520. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +1 -0
  521. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +1 -0
  522. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +1 -0
  523. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +3 -0
  524. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +1 -0
  525. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +1 -0
  526. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +1 -0
  527. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +1 -0
  528. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js +1 -0
  529. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +1 -0
  530. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js +1 -0
  531. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +1 -0
  532. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +1 -0
  533. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js +1 -0
  534. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +1 -0
  535. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +1 -0
  536. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  537. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +1 -0
  538. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/index.js +1 -0
  539. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +1 -0
  540. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +1 -0
  541. package/dist/src/packages/ash-scaffold/src/channels.js +7 -0
  542. package/dist/src/packages/ash-scaffold/src/files.js +1 -0
  543. package/dist/src/packages/ash-scaffold/src/index.js +1 -0
  544. package/dist/src/packages/ash-scaffold/src/module-files.js +1 -0
  545. package/dist/src/packages/ash-scaffold/src/package-json.js +1 -0
  546. package/dist/src/packages/ash-scaffold/src/project.js +1 -0
  547. package/dist/src/protocol/message.js +2 -501
  548. package/dist/src/protocol/routes.js +1 -85
  549. package/dist/src/public/agents/auth.js +1 -37
  550. package/dist/src/public/channels/ash.js +2 -346
  551. package/dist/src/public/channels/auth.js +1 -414
  552. package/dist/src/public/channels/discord/api.js +2 -167
  553. package/dist/src/public/channels/discord/defaults.js +3 -74
  554. package/dist/src/public/channels/discord/discordChannel.js +1 -402
  555. package/dist/src/public/channels/discord/hitl.js +1 -194
  556. package/dist/src/public/channels/discord/inbound.js +2 -238
  557. package/dist/src/public/channels/discord/index.js +1 -6
  558. package/dist/src/public/channels/discord/responses.js +1 -40
  559. package/dist/src/public/channels/discord/verify.js +1 -72
  560. package/dist/src/public/channels/discord/verifyInbound.js +1 -19
  561. package/dist/src/public/channels/index.js +1 -1
  562. package/dist/src/public/channels/slack/api-encoding.js +1 -40
  563. package/dist/src/public/channels/slack/api.js +1 -333
  564. package/dist/src/public/channels/slack/attachments.js +1 -156
  565. package/dist/src/public/channels/slack/blocks.js +3 -266
  566. package/dist/src/public/channels/slack/connections.js +1 -70
  567. package/dist/src/public/channels/slack/constants.js +1 -7
  568. package/dist/src/public/channels/slack/defaults.js +4 -211
  569. package/dist/src/public/channels/slack/hitl.js +1 -242
  570. package/dist/src/public/channels/slack/inbound.js +2 -149
  571. package/dist/src/public/channels/slack/index.js +1 -13
  572. package/dist/src/public/channels/slack/interactions.js +1 -315
  573. package/dist/src/public/channels/slack/limits.js +1 -75
  574. package/dist/src/public/channels/slack/mrkdwn.js +1 -89
  575. package/dist/src/public/channels/slack/slackChannel.js +1 -251
  576. package/dist/src/public/channels/slack/thread.js +1 -45
  577. package/dist/src/public/channels/slack/verify.js +1 -70
  578. package/dist/src/public/channels/twilio/api.js +1 -103
  579. package/dist/src/public/channels/twilio/defaults.js +3 -69
  580. package/dist/src/public/channels/twilio/inbound.js +2 -123
  581. package/dist/src/public/channels/twilio/index.js +1 -4
  582. package/dist/src/public/channels/twilio/twilioChannel.js +1 -316
  583. package/dist/src/public/channels/twilio/twiml.js +1 -58
  584. package/dist/src/public/channels/twilio/verify.js +1 -73
  585. package/dist/src/public/channels/upload-policy.js +1 -170
  586. package/dist/src/public/connections/errors.js +1 -53
  587. package/dist/src/public/connections/index.js +1 -6
  588. package/dist/src/public/context/index.js +1 -13
  589. package/dist/src/public/definitions/agent.js +1 -6
  590. package/dist/src/public/definitions/channel.js +1 -24
  591. package/dist/src/public/definitions/connections/mcp.js +1 -20
  592. package/dist/src/public/definitions/defineChannel.js +1 -74
  593. package/dist/src/public/definitions/hook.js +1 -11
  594. package/dist/src/public/definitions/instructions.js +1 -7
  595. package/dist/src/public/definitions/instrumentation.js +1 -13
  596. package/dist/src/public/definitions/remote-agent.js +1 -11
  597. package/dist/src/public/definitions/sandbox-backend.js +1 -13
  598. package/dist/src/public/definitions/sandbox.js +1 -6
  599. package/dist/src/public/definitions/schedule.js +1 -32
  600. package/dist/src/public/definitions/skill.js +1 -7
  601. package/dist/src/public/definitions/source.js +1 -1
  602. package/dist/src/public/definitions/state.js +1 -34
  603. package/dist/src/public/definitions/tool.js +1 -27
  604. package/dist/src/public/hooks/index.js +1 -9
  605. package/dist/src/public/index.js +1 -5
  606. package/dist/src/public/instructions/index.js +1 -4
  607. package/dist/src/public/instrumentation/index.js +1 -4
  608. package/dist/src/public/next/index.js +1 -148
  609. package/dist/src/public/next/server.js +1 -348
  610. package/dist/src/public/next/vercel-json.js +1 -77
  611. package/dist/src/public/sandbox/backends/default.js +1 -15
  612. package/dist/src/public/sandbox/backends/local.js +1 -18
  613. package/dist/src/public/sandbox/backends/vercel.js +1 -25
  614. package/dist/src/public/sandbox/index.js +1 -10
  615. package/dist/src/public/sandbox/local-sandbox.js +1 -1
  616. package/dist/src/public/sandbox/vercel-sandbox.js +1 -1
  617. package/dist/src/public/schedules/index.js +1 -4
  618. package/dist/src/public/skills/index.js +1 -5
  619. package/dist/src/public/tool-result-narrowing.js +1 -87
  620. package/dist/src/public/tools/approval/approval-helpers.js +1 -22
  621. package/dist/src/public/tools/approval/index.js +1 -4
  622. package/dist/src/public/tools/defaults.js +1 -70
  623. package/dist/src/public/tools/define-bash-tool.js +1 -14
  624. package/dist/src/public/tools/define-glob-tool.js +1 -21
  625. package/dist/src/public/tools/define-grep-tool.js +1 -21
  626. package/dist/src/public/tools/define-read-file-tool.js +1 -27
  627. package/dist/src/public/tools/define-write-file-tool.js +1 -21
  628. package/dist/src/public/tools/index.js +1 -10
  629. package/dist/src/public/tools/internal.js +1 -24
  630. package/dist/src/public/types/json.js +1 -13
  631. package/dist/src/react/index.js +1 -3
  632. package/dist/src/react/use-ash-agent.js +2 -348
  633. package/dist/src/runtime/actions/keys.js +1 -30
  634. package/dist/src/runtime/actions/types.js +1 -99
  635. package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -148
  636. package/dist/src/runtime/agent/bootstrap-model.js +1 -36
  637. package/dist/src/runtime/agent/bootstrap.js +1 -49
  638. package/dist/src/runtime/agent/mock-model-adapter.js +7 -358
  639. package/dist/src/runtime/agent/resolve-model.js +1 -48
  640. package/dist/src/runtime/cache-key.js +1 -52
  641. package/dist/src/runtime/channels/registry.js +1 -133
  642. package/dist/src/runtime/compiled-artifacts-source.js +1 -42
  643. package/dist/src/runtime/connections/authorization-complete-page.js +2 -21
  644. package/dist/src/runtime/connections/authorization-tokens.js +1 -66
  645. package/dist/src/runtime/connections/callback-route.js +1 -139
  646. package/dist/src/runtime/connections/mcp-client.js +1 -307
  647. package/dist/src/runtime/connections/principal-context.js +1 -111
  648. package/dist/src/runtime/connections/principal.js +1 -106
  649. package/dist/src/runtime/connections/registry.js +1 -61
  650. package/dist/src/runtime/connections/types.js +1 -41
  651. package/dist/src/runtime/connections/validate-authorization.js +1 -92
  652. package/dist/src/runtime/framework-channels/index.js +1 -38
  653. package/dist/src/runtime/framework-tools/ask-question.js +1 -30
  654. package/dist/src/runtime/framework-tools/bash.js +1 -40
  655. package/dist/src/runtime/framework-tools/connection-search.js +1 -224
  656. package/dist/src/runtime/framework-tools/connection-tools.js +1 -103
  657. package/dist/src/runtime/framework-tools/file-state.js +1 -71
  658. package/dist/src/runtime/framework-tools/glob.js +2 -56
  659. package/dist/src/runtime/framework-tools/grep.js +2 -75
  660. package/dist/src/runtime/framework-tools/index.js +1 -52
  661. package/dist/src/runtime/framework-tools/pending-connection-tool-calls.js +1 -63
  662. package/dist/src/runtime/framework-tools/read-file.js +2 -64
  663. package/dist/src/runtime/framework-tools/skill.js +1 -47
  664. package/dist/src/runtime/framework-tools/todo.js +3 -122
  665. package/dist/src/runtime/framework-tools/web-fetch.js +2 -42
  666. package/dist/src/runtime/framework-tools/web-search.js +1 -15
  667. package/dist/src/runtime/framework-tools/write-file.js +2 -48
  668. package/dist/src/runtime/governance/auth/http-basic.js +1 -63
  669. package/dist/src/runtime/governance/auth/jwt-ecdsa.js +1 -69
  670. package/dist/src/runtime/governance/auth/jwt-hmac.js +1 -39
  671. package/dist/src/runtime/governance/auth/oidc.js +1 -126
  672. package/dist/src/runtime/governance/auth/token-claims.js +1 -84
  673. package/dist/src/runtime/governance/auth/types.js +1 -14
  674. package/dist/src/runtime/governance/network/ip-allow-list.js +1 -66
  675. package/dist/src/runtime/graph.js +1 -17
  676. package/dist/src/runtime/hooks/registry.js +1 -55
  677. package/dist/src/runtime/input/types.js +1 -63
  678. package/dist/src/runtime/loaders/artifact-paths.js +1 -26
  679. package/dist/src/runtime/loaders/bundled-artifacts.js +1 -21
  680. package/dist/src/runtime/loaders/compile-metadata.js +1 -92
  681. package/dist/src/runtime/loaders/manifest.js +1 -56
  682. package/dist/src/runtime/loaders/module-map.js +1 -64
  683. package/dist/src/runtime/prompt/compose.js +2 -47
  684. package/dist/src/runtime/prompt/connections.js +2 -23
  685. package/dist/src/runtime/resolve-agent-graph.js +1 -287
  686. package/dist/src/runtime/resolve-agent.js +1 -134
  687. package/dist/src/runtime/resolve-channel.js +1 -62
  688. package/dist/src/runtime/resolve-connection.js +1 -72
  689. package/dist/src/runtime/resolve-helpers.js +1 -58
  690. package/dist/src/runtime/resolve-hook.js +1 -67
  691. package/dist/src/runtime/resolve-sandbox.js +1 -65
  692. package/dist/src/runtime/resolve-tool.js +1 -110
  693. package/dist/src/runtime/sandbox/keys.js +1 -72
  694. package/dist/src/runtime/sandbox/registry.js +1 -42
  695. package/dist/src/runtime/schedules/register.js +1 -62
  696. package/dist/src/runtime/schedules/resolve-schedule.js +1 -66
  697. package/dist/src/runtime/session-callback-route.js +1 -87
  698. package/dist/src/runtime/sessions/auth.js +1 -18
  699. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -125
  700. package/dist/src/runtime/sessions/runtime-session.js +1 -50
  701. package/dist/src/runtime/sessions/turn.js +1 -1
  702. package/dist/src/runtime/skills/fragment-context.js +1 -4
  703. package/dist/src/runtime/skills/sandbox-access.js +1 -85
  704. package/dist/src/runtime/subagents/registry.js +1 -62
  705. package/dist/src/runtime/tools/registry.js +1 -40
  706. package/dist/src/runtime/types.js +1 -1
  707. package/dist/src/runtime/validation.js +1 -7
  708. package/dist/src/runtime/workspace/seed-files.js +1 -42
  709. package/dist/src/runtime/workspace/spec.js +2 -22
  710. package/dist/src/runtime/workspace/types.js +1 -9
  711. package/dist/src/sandbox/state.js +1 -1
  712. package/dist/src/services/dev-client/request-headers.js +1 -197
  713. package/dist/src/services/dev-client/stream.js +1 -7
  714. package/dist/src/services/dev-client/url.js +1 -25
  715. package/dist/src/services/dev-client/vercel-auth-error.js +2 -98
  716. package/dist/src/services/dev-client.js +1 -48
  717. package/dist/src/services/inspect-application.js +1 -45
  718. package/dist/src/shared/agent-definition.js +1 -1
  719. package/dist/src/shared/errors.js +1 -66
  720. package/dist/src/shared/guards.js +1 -35
  721. package/dist/src/shared/json-schemas.js +1 -41
  722. package/dist/src/shared/json.js +1 -80
  723. package/dist/src/shared/node.js +1 -1
  724. package/dist/src/shared/optional.js +1 -1
  725. package/dist/src/shared/run-mode.js +1 -1
  726. package/dist/src/shared/sandbox-backend.js +1 -1
  727. package/dist/src/shared/sandbox-definition.js +1 -1
  728. package/dist/src/shared/sandbox-session.js +1 -1
  729. package/dist/src/shared/skill-definition.js +1 -1
  730. package/dist/src/shared/skill-package.js +1 -100
  731. package/dist/src/shared/source-ref.js +1 -1
  732. package/dist/src/shared/tool-definition.js +1 -1
  733. package/package.json +4 -4
  734. package/dist/src/chunks/authored-module-loader-DcCfCiBm.js +0 -4
  735. package/dist/src/chunks/chunk-DSjMdhoD.js +0 -1
  736. package/dist/src/chunks/client-ZqNLLMZB.js +0 -4
  737. package/dist/src/chunks/compile-agent-DrIyb818.js +0 -5
  738. package/dist/src/chunks/dev-authored-source-watcher-C1WUVv9F.js +0 -1
  739. package/dist/src/chunks/errors-HYWjHxV6.js +0 -1
  740. package/dist/src/chunks/guards-26p6sOw3.js +0 -1
  741. package/dist/src/chunks/host-CwAcCrg7.js +0 -70
  742. package/dist/src/chunks/input-requests-DJiy6dG9.js +0 -1
  743. package/dist/src/chunks/jsdist-BkeWZ7EZ.js +0 -443
  744. package/dist/src/chunks/paths-CWZN-XRX.js +0 -85
  745. package/dist/src/chunks/picocolors-aAkqW4On.js +0 -1
  746. package/dist/src/chunks/runtime-model-Dh0Nz64z.js +0 -1
  747. package/dist/src/chunks/token-YW4VSeBB.js +0 -1
  748. package/dist/src/chunks/types-BJSR0JNV.js +0 -1
@@ -1,85 +0,0 @@
1
- import{c as e,d as t,f as n,l as r,o as i,p as a,s as o,t as s,u as c}from"./authored-module-loader-DcCfCiBm.js";import{n as l,t as u}from"./guards-26p6sOw3.js";import{t as d}from"./errors-HYWjHxV6.js";import{_ as f,a as p,b as m,f as h,i as g,l as _,n as ee,o as te,r as ne,s as re,t as ie,u as ae,x as oe}from"./types-BJSR0JNV.js";import{t as se}from"./runtime-model-Dh0Nz64z.js";import{createRequire as ce}from"node:module";import{basename as le,dirname as v,join as y,posix as ue,relative as de,resolve as b,sep as fe}from"node:path";import{access as pe,cp as me,mkdir as x,readFile as he,rm as ge,writeFile as S}from"node:fs/promises";import{z as C}from"#compiled/zod/index.js";import{createHash as _e}from"node:crypto";import{existsSync as ve,readFileSync as ye,readdirSync as be,realpathSync as xe,rmSync as Se}from"node:fs";import{fileURLToPath as Ce,pathToFileURL as we}from"node:url";import{Buffer as Te}from"node:buffer";import"#compiled/@workflow/errors/index.js";import{resumeHook as Ee}from"#compiled/@workflow/core/runtime.js";import{AsyncLocalStorage as De}from"node:async_hooks";import{SpanStatusCode as Oe,trace as ke}from"#compiled/@opentelemetry/api/index.js";import{getErrorMessage as Ae}from"#compiled/@ai-sdk/provider/index.js";import{inspect as je}from"node:util";import{fromError as Me}from"#compiled/zod-validation-error/index.js";import{createRemoteJWKSet as Ne,decodeJwt as Pe,jwtVerify as Fe}from"#compiled/jose/index.js";import"ai";import Ie from"#compiled/turndown/index.js";const Le=C.union([C.literal(`error`),C.literal(`warning`)]);C.object({code:C.string(),message:C.string(),severity:Le,sourcePath:C.string()}).strict();const Re=C.object({errors:C.number().finite(),warnings:C.number().finite()}).strict(),ze=`discover/project-not-found`;function Be(e){return{...e,severity:`error`}}function Ve(e){return{...e,severity:`warning`}}function He(e){return e.reduce((e,t)=>(t.severity===`error`?e.errors+=1:e.warnings+=1,e),{errors:0,warnings:0})}function Ue(e){return e.some(e=>e.severity===`error`)}const We=[`.cts`,`.mts`,`.cjs`,`.mjs`,`.ts`,`.js`],Ge=new Set([`package.json`,`vercel.json`]);function Ke(e){return e.isDirectory()?`directory`:e.isFile()?`file`:`other`}function qe(e,t){return t===`file`&&Ge.has(e)}function Je(e,t){if(t===`file`)return T(e,`agent`)?`agent-config-module`:e===`instructions.md`?`instructions-markdown`:T(e,`instructions`)?`instructions-module`:e===`system.md`?`system-markdown`:T(e,`system`)?`system-module`:`unknown`;if(t===`directory`){if(e===`channels`)return`channels-directory`;if(e===`connections`)return`connections-directory`;if(e===`hooks`)return`hooks-directory`;if(e===`lib`)return`lib-directory`;if(e===`skills`)return`skills-directory`;if(e===`sandbox`)return`sandbox-directory`;if(e===`tools`)return`tools-directory`;if(e===`schedules`)return`schedules-directory`;if(e===`subagents`)return`subagents-directory`}return`unknown`}function Ye(e,t){if(t===`file`)return T(e,`agent`)?`agent-config-module`:e===`instructions.md`?`instructions-markdown`:T(e,`instructions`)?`instructions-module`:e===`system.md`?`system-markdown`:T(e,`system`)?`system-module`:`unknown`;if(t===`directory`){if(e===`connections`)return`connections-directory`;if(e===`hooks`)return`hooks-directory`;if(e===`lib`)return`lib-directory`;if(e===`sandbox`)return`sandbox-directory`;if(e===`skills`)return`skills-directory`;if(e===`tools`)return`tools-directory`;if(e===`subagents`)return`subagents-directory`;if(e===`schedules`)return`invalid-schedules-directory`}return`unknown`}function Xe(e,t){if(t===`file`)return e===`SKILL.md`?`skill-markdown`:`skill-resource`;if(t===`directory`){if(e===`scripts`)return`skill-scripts-directory`;if(e===`references`)return`skill-references-directory`;if(e===`assets`)return`skill-assets-directory`}return`skill-resource`}function Ze(e,t){if(t===`directory`)return`skill-package-directory`;if(t===`file`){if(e.endsWith(`.md`))return`flat-skill-markdown`;if(Qe(e)!==null)return`flat-skill-module`}return`unknown`}function w(e){return e.replaceAll(fe,`/`).replace(/^\.\//,``).replace(/^\/+/,``)}function Qe(e){for(let t of We)if(e.endsWith(t)&&e.length>t.length)return e.slice(0,-t.length);return null}function T(e,t){return Qe(e)===t}function E(e){let t=w(e),n=t.lastIndexOf(`/`),r=t.lastIndexOf(`.`);return r===-1||r<n?t:t.slice(0,r)}function $e(t,r){let i=o(t,r);if(e(i,[`build`,`compaction`,`description`,`metadata`,`model`,`modelContextWindowTokens`,`modelOptions`],r),i.model===void 0)throw Error(`${r} The "model" field is required.`);let a={model:i.model};i.description!==void 0&&(a.description=c(i.description,r));let s=n(i,`metadata`,r);return s!==void 0&&(a.metadata=s),i.compaction!==void 0&&(a.compaction=rt(i.compaction,r)),i.build!==void 0&&(a.build=tt(i.build,r)),i.modelOptions!==void 0&&(a.modelOptions=nt(i.modelOptions,r)),i.modelContextWindowTokens!==void 0&&(a.modelContextWindowTokens=et(i.modelContextWindowTokens,r)),a}function et(e,t){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw Error(t);return e}function tt(t,n){let r=o(t,n);e(r,[`externalDependencies`],n);let i={};if(r.externalDependencies!==void 0){if(!Array.isArray(r.externalDependencies))throw Error(n);i.externalDependencies=Object.freeze(r.externalDependencies.map(e=>c(e,n)))}return i}function nt(t,n){let i=o(t,n);e(i,[`providerOptions`],n);let a=i.providerOptions;return a===void 0?{}:{providerOptions:r(a,n)}}function rt(t,n){let r=o(t,n);e(r,[`model`,`modelContextWindowTokens`,`thresholdPercent`],n);let i={};if(r.model!==void 0&&(i.model=r.model),r.modelContextWindowTokens!==void 0&&(i.modelContextWindowTokens=et(r.modelContextWindowTokens,n)),r.thresholdPercent!==void 0){let e=r.thresholdPercent;if(typeof e!=`number`||!Number.isFinite(e)||e<0||e>1)throw Error(n);i.thresholdPercent=e}return i}function it(t,n){let r=o(t,n);return e(r,[`markdown`],n),{markdown:c(r.markdown,n)}}function at(t,r){let i=o(t,r);e(i,[`description`,`files`,`license`,`markdown`,`metadata`],r);let a={description:c(i.description,r),markdown:c(i.markdown,r)},s=i.license,l=n(i,`metadata`,r);return s!==void 0&&(a.license=c(s,r)),l!==void 0&&(a.metadata=l),i.files!==void 0&&(a.files=ot(i.files,r)),a}function ot(e,t){let n=o(e,t),r={};for(let[e,i]of Object.entries(n)){if(typeof i==`string`||i instanceof Uint8Array){r[e]=i;continue}throw Error(`${t} Expected skill file "${e}" to be a string or Uint8Array.`)}return r}function st(t,n){let r=o(t,n);e(r,[`cron`,`markdown`,`run`],n);let a=c(r.cron,n),s=r.markdown!==void 0,l=r.run!==void 0;if(s&&l)throw Error(`${n} Pass either "markdown" (fire-and-forget) or "run" (handler) — not both.`);if(!s&&!l)throw Error(`${n} Must provide either "markdown" (fire-and-forget) or "run" (handler).`);let u={cron:a};return s?u.markdown=c(r.markdown,n):u.run=i(r.run,n),u}function ct(e){let t=b(e.appRoot),n=b(e.agentRoot),r={agentId:e.agentId??lt(t,n,e.packageName),agentRoot:n,appRoot:t,channels:[...e.channels??[]],connections:[...e.connections??[]],diagnosticsSummary:He(e.diagnostics??[]),hooks:[...e.hooks??[]],lib:[...e.lib??[]],kind:`ash-agent-discovery-manifest`,sandbox:e.sandbox??null,sandboxWorkspaces:[...e.sandboxWorkspaces??[]],schedules:[...e.schedules??[]],skills:[...e.skills??[]],tools:[...e.tools??[]],version:12,subagents:[...e.subagents??[]]};return e.configModule!==void 0&&(r.configModule=e.configModule),e.instructions!==void 0&&(r.instructions=e.instructions),r}function lt(e,t,n){let r=w(de(e,t));return r===``||r===`.`||r===`agent`?n??le(e):le(t)}function ut(e){return w(e)}function dt(e){let t=w(e.logicalPath),n={sourceKind:`module`,logicalPath:t,sourceId:e.sourceId??ut(t)};return e.exportName!==void 0&&(n.exportName=e.exportName),n}function ft(e){return{...dt(e),connectionName:e.connectionName}}function pt(e){let t=w(e.logicalPath);return{entryPath:e.entryPath,logicalPath:t,manifest:e.manifest,rootPath:e.rootPath,sourceId:e.sourceId??ut(t),subagentId:e.subagentId}}function mt(e){let t={description:e.description,sourceKind:`skill-package`,logicalPath:w(e.logicalPath),markdown:e.markdown,name:e.name,rootPath:e.rootPath,skillFilePath:e.skillFilePath,skillId:e.skillId,sourceId:e.sourceId};return e.assetsPath!==void 0&&(t.assetsPath=e.assetsPath),e.license!==void 0&&(t.license=e.license),e.metadata!==void 0&&(t.metadata={...e.metadata}),e.referencesPath!==void 0&&(t.referencesPath=e.referencesPath),e.scriptsPath!==void 0&&(t.scriptsPath=e.scriptsPath),t}const D=`experimental-ash`;let O;const ht={"workflow/api":`src/compiled/@workflow/core/runtime.js`,"workflow/errors":`src/compiled/@workflow/errors/index.js`,"workflow/internal/private":`src/compiled/@workflow/core/private.js`,"workflow/runtime":`src/compiled/@workflow/core/runtime.js`};function gt(){return`0.26.0`}const _t={name:D,version:gt()};function vt(){return typeof __filename==`string`?__filename:yt()}function yt(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error().stack?.[0]?.getFileName();if(typeof e!=`string`||e.length===0)throw Error(`Failed to resolve the current module path from the stack trace.`);return e.startsWith(`file:`)?Ce(e):e}finally{Error.prepareStackTrace=e}}const bt=ce(vt());function xt(e){return le(e)===`dist`&&ve(y(v(e),`package.json`))}function St(){let e=v(xe(vt()));for(;;){if(xt(e))return e;let t=v(e);if(t===e)return null;e=t}}function Ct(e){let t=e;for(;;){if(ve(y(t,`package.json`))&&!xt(t))return t;let n=v(t);if(n===t)throw Error(`Failed to resolve package root from "${e}".`);t=n}}function k(){return Ct(v(xe(vt())))}function wt(){try{return k()}catch{return}}function Tt(e){return e.replace(/\.[cm]?tsx?$/,`.js`)}function Et(e){let t=St();return t===null?y(k(),e):y(t,Tt(e))}function Dt(e){let t=St();return y(t===null?k():t,e)}function Ot(e){let t=St();return t===null?y(k(),`.generated`,`compiled`,e.replace(/^src\/compiled\//,``)):y(t,e)}function kt(e){let t=e;if(!(typeof t.name!=`string`||typeof t.version!=`string`))return{name:t.name,version:t.version}}function At(e,t){let n=kt(JSON.parse(ye(e,`utf8`)));if(n?.name===t)return n}function jt(){if(O)return O;let e=wt(),t=e===void 0?void 0:At(y(e,`package.json`),D);if(t)return O=t,O;try{let e=At(bt.resolve(`${D}/package.json`),D);if(e)return O=e,O}catch{}return O={..._t},O}function Mt(e){if(e===`workflow`)return Et(`src/internal/workflow/index.ts`);if(e===`workflow/internal/builtins`)return Et(`src/internal/workflow/builtins.ts`);let t=ht[e];return t===void 0?bt.resolve(e):Ot(t)}const Nt=C.object({description:C.string(),entryPath:C.string(),exportName:C.string().optional(),logicalPath:C.string(),name:C.string(),nodeId:C.string(),path:C.string(),rootPath:C.string(),sourceId:C.string(),sourceKind:C.literal(`module`),url:C.string()}).strict(),Pt=`ash-agent-compiled-manifest`,A=`__root__`,Ft=C.object({exportName:C.string().optional(),sourceKind:C.literal(`module`),logicalPath:C.string(),sourceId:C.string()}).strict(),It=C.union([C.literal(`GET`),C.literal(`POST`),C.literal(`PUT`),C.literal(`PATCH`),C.literal(`DELETE`)]),Lt=C.object({kind:C.literal(`channel`),name:C.string(),logicalPath:C.string(),method:It,urlPath:C.string(),sourceId:C.string(),sourceKind:C.literal(`module`),exportName:C.string().optional(),adapterKind:C.string().optional()}).strict(),Rt=C.object({kind:C.literal(`disabled`),name:C.string(),logicalPath:C.string()}).strict(),zt=C.union([Lt,Rt]),Bt=C.object({contextWindowTokens:C.number().int().positive().optional(),id:C.string(),source:Ft.optional(),providerOptions:C.record(C.string(),m).optional()}).strict(),Vt=C.object({externalDependencies:C.array(C.string()).optional()}).strict(),Ht=C.object({model:Bt.optional(),thresholdPercent:C.number().finite().min(0).max(1).optional()}).strict(),Ut=C.object({build:Vt.optional(),compaction:Ht.optional(),description:C.string().optional(),metadata:C.record(C.string(),C.string()),model:Bt,name:C.string(),source:Ft.optional()}).strict(),Wt=C.object({name:C.string(),logicalPath:C.string(),markdown:C.string(),sourceId:C.string(),sourceKind:C.union([C.literal(`markdown`),C.literal(`module`)])}).strict(),Gt={name:C.string(),description:C.string(),license:C.string().optional(),markdown:C.string(),metadata:C.record(C.string(),C.string()).optional(),sourceId:C.string(),logicalPath:C.string()},Kt=C.discriminatedUnion(`sourceKind`,[C.object({...Gt,sourceKind:C.literal(`markdown`)}).strict(),C.object({...Gt,sourceKind:C.literal(`module`),exportName:C.string().optional()}).strict(),C.object({...Gt,sourceKind:C.literal(`skill-package`),skillId:C.string(),skillFilePath:C.string(),rootPath:C.string(),assetsPath:C.string().optional(),referencesPath:C.string().optional(),scriptsPath:C.string().optional()}).strict()]),qt=C.object({cron:C.string(),hasRun:C.boolean(),name:C.string(),logicalPath:C.string(),markdown:C.string().optional(),sourceId:C.string(),sourceKind:C.union([C.literal(`markdown`),C.literal(`module`)])}).strict(),Jt=C.object({description:C.string().optional(),exportName:C.string().optional(),logicalPath:C.string(),sourceId:C.string(),sourceKind:C.literal(`module`)}).strict(),Yt=C.object({logicalPath:C.string(),rootEntries:C.array(C.string()).readonly(),sourceId:C.string(),sourcePath:C.string()}).strict(),Xt=C.object({logicalPath:C.string(),rootEntries:C.array(C.string()).readonly()}).strict(),Zt=C.object({connectionName:C.string(),description:C.string(),exportName:C.string().optional(),logicalPath:C.string(),sourceId:C.string(),sourceKind:C.literal(`module`),url:C.string(),vercelConnect:C.object({connector:C.string()}).strict().optional()}).strict(),Qt=C.object({description:C.string(),exportName:C.string().optional(),inputSchema:m.nullable(),logicalPath:C.string(),name:C.string(),sourceId:C.string(),sourceKind:C.literal(`module`)}).strict(),$t=C.object({exportName:C.string().optional(),logicalPath:C.string(),slug:C.string(),sourceId:C.string(),sourceKind:C.literal(`module`)}).strict(),en=C.object({agentRoot:C.string(),appRoot:C.string(),channels:C.array(zt),config:Ut,connections:C.array(Zt),diagnosticsSummary:Re,disabledFrameworkTools:C.array(C.string()).readonly(),hooks:C.array($t),sandbox:Jt.nullable(),sandboxWorkspaces:C.array(Yt),schedules:C.array(qt),remoteAgents:C.array(Nt),skills:C.array(Kt).readonly(),instructions:Wt.optional(),tools:C.array(Qt),workspaceResourceRoot:Xt}).strict(),tn=C.object({agent:en,description:C.string(),entryPath:C.string(),logicalPath:C.string(),name:C.string(),nodeId:C.string(),rootPath:C.string(),sourceId:C.string(),sourceKind:C.literal(`module`),exportName:C.string().optional()}).strict(),nn=C.object({childNodeId:C.string(),parentNodeId:C.string()}).strict(),rn=C.object({agentRoot:C.string(),appRoot:C.string(),channels:C.array(zt),config:Ut,connections:C.array(Zt),diagnosticsSummary:Re,disabledFrameworkTools:C.array(C.string()).readonly(),hooks:C.array($t),kind:C.literal(Pt),remoteAgents:C.array(Nt),sandbox:Jt.nullable(),sandboxWorkspaces:C.array(Yt),schedules:C.array(qt),skills:C.array(Kt).readonly(),subagentEdges:C.array(nn),subagents:C.array(tn),instructions:Wt.optional(),tools:C.array(Qt),version:C.literal(24),workspaceResourceRoot:Xt}).strict();function an(e){let t={agentRoot:e.agentRoot,appRoot:e.appRoot,channels:[...e.channels??[]],connections:[...e.connections??[]],config:{build:e.config.build===void 0?void 0:{externalDependencies:e.config.build.externalDependencies===void 0?void 0:[...e.config.build.externalDependencies]},compaction:{model:e.config.compaction?.model===void 0?void 0:ln(e.config.compaction.model),thresholdPercent:e.config.compaction?.thresholdPercent},description:e.config.description,metadata:{...e.config.metadata},model:ln(e.config.model),name:e.config.name,source:e.config.source===void 0?void 0:{...e.config.source}},diagnosticsSummary:e.diagnosticsSummary??{errors:0,warnings:0},disabledFrameworkTools:[...e.disabledFrameworkTools??[]],hooks:[...e.hooks??[]],remoteAgents:[...e.remoteAgents??[]],sandbox:e.sandbox??null,sandboxWorkspaces:[...e.sandboxWorkspaces??[]],schedules:[...e.schedules??[]],skills:[...e.skills??[]],tools:[...e.tools??[]],workspaceResourceRoot:e.workspaceResourceRoot??{logicalPath:``,rootEntries:on({sandboxWorkspaces:e.sandboxWorkspaces,skills:e.skills})}};return e.instructions!==void 0&&(t.instructions=e.instructions),t}function on(e){let t=new Set;(e.skills??[]).length>0&&t.add(`skills/`);for(let n of e.sandboxWorkspaces??[])for(let e of n.rootEntries)t.add(e);return[...t].sort((e,t)=>e.localeCompare(t))}function sn(e,t){return e===`__root__`?t:`${e}::${t}`}function cn(e){return{...an(e),kind:Pt,subagentEdges:[...e.subagentEdges??[]],subagents:[...e.subagents??[]],version:24}}function ln(e){return e.contextWindowTokens===void 0&&e.source===void 0&&e.providerOptions===void 0?{id:e.id}:e.source===void 0?e.providerOptions===void 0?{contextWindowTokens:e.contextWindowTokens,id:e.id}:{contextWindowTokens:e.contextWindowTokens,id:e.id,providerOptions:{...e.providerOptions}}:e.contextWindowTokens===void 0&&e.providerOptions===void 0?{id:e.id,source:{...e.source}}:{contextWindowTokens:e.contextWindowTokens,id:e.id,providerOptions:e.providerOptions===void 0?void 0:{...e.providerOptions},source:{...e.source}}}const un=/^\/?[A-Za-z]:[\\/]/,dn=/^\\\\[^\\]/,fn=/(\b(?:from|import)\s*(?:\(\s*)?)(["'])([A-Za-z]:[\\/][^"'\n\r]*)\2/g;function pn(e){return un.test(e)||dn.test(e)}function mn(e){let t=e.replaceAll(`\\`,`/`);return t.startsWith(`//`)?new URL(`file:${t}`).href:(/^\/[A-Za-z]:\//.test(t)&&(t=t.slice(1)),new URL(`file:///${t}`).href)}function hn(e){let t=e.indexOf(`?`),n=e.indexOf(`#`),r=t===-1?n:n===-1?t:Math.min(t,n);return r===-1?{path:e,suffix:``}:{path:e.slice(0,r),suffix:e.slice(r)}}function j(e){if(e.startsWith(`file://`))return e;let{path:t,suffix:n}=hn(e);return pn(t)?`${mn(t)}${n}`:e.replaceAll(`\\`,`/`)}function gn(e){return JSON.stringify(j(e))}function _n(e){return e.replace(fn,(e,t,n,r)=>`${t}${n}${j(r)}${n}`)}const vn=C.object({modules:C.record(C.string(),C.object({}).passthrough())}).strict(),yn=C.object({nodes:C.record(C.string(),vn)}).strict();function bn(e){let t=Tn(e.moduleMapPath),n=e.importSpecifierStyle??`relative`,r=0,i=[xn({agentRoot:e.manifest.agentRoot,importSpecifierStyle:n,manifest:e.manifest,moduleMapDirectory:t,nextBindingName(){return`module_${r++}`},nodeId:A}),...[...e.manifest.subagents].sort((e,t)=>e.nodeId.localeCompare(t.nodeId)).map(e=>xn({agentRoot:e.agent.agentRoot,importSpecifierStyle:n,manifest:e.agent,moduleMapDirectory:t,nextBindingName(){return`module_${r++}`},nodeId:e.nodeId}))],a=i.flatMap(e=>e.modules.map(e=>`import * as ${e.bindingName} from ${JSON.stringify(e.importSpecifier)};`));return[`// Generated by Ash. Do not edit by hand.`,``,...a,...a.length>0?[``]:[],`export const moduleMap = ${wn(i)};`,``,`export default moduleMap;`,``].join(`
2
- `)}function xn(e){return{modules:Sn(e.manifest).sort((e,t)=>e.sourceId.localeCompare(t.sourceId)).map(t=>({bindingName:e.nextBindingName(),importSpecifier:Cn({fromDirectory:e.moduleMapDirectory,importSpecifierStyle:e.importSpecifierStyle,targetPath:En(e.agentRoot,t.logicalPath)}),sourceId:t.sourceId})),nodeId:e.nodeId}}function Sn(e){let t=new Map;e.config.source!==void 0&&t.set(e.config.source.sourceId,e.config.source),e.config.model.source!==void 0&&t.set(e.config.model.source.sourceId,e.config.model.source);for(let n of e.channels)n.kind!==`disabled`&&t.set(n.sourceId,{exportName:n.exportName,sourceKind:`module`,logicalPath:n.logicalPath,sourceId:n.sourceId});for(let n of e.connections)t.set(n.sourceId,{exportName:n.exportName,sourceKind:`module`,logicalPath:n.logicalPath,sourceId:n.sourceId});for(let n of e.tools)t.set(n.sourceId,{exportName:n.exportName,sourceKind:`module`,logicalPath:n.logicalPath,sourceId:n.sourceId});for(let n of e.remoteAgents)t.set(n.sourceId,{exportName:n.exportName,sourceKind:`module`,logicalPath:n.logicalPath,sourceId:n.sourceId});for(let n of e.hooks)t.set(n.sourceId,{exportName:n.exportName,sourceKind:`module`,logicalPath:n.logicalPath,sourceId:n.sourceId});for(let n of e.schedules)n.sourceKind!==`module`||!n.hasRun||t.set(n.sourceId,{sourceKind:`module`,logicalPath:n.logicalPath,sourceId:n.sourceId});return e.sandbox!==null&&t.set(e.sandbox.sourceId,{exportName:e.sandbox.exportName,sourceKind:`module`,logicalPath:e.sandbox.logicalPath,sourceId:e.sandbox.sourceId}),[...t.values()]}function Cn(e){if(e.importSpecifierStyle===`absolute`)return j(On(e.targetPath));let t=Dn(e.fromDirectory,e.targetPath);return t.startsWith(`.`)?t:`./${t}`}function wn(e){return M([{key:`nodes`,value:M(e.map(e=>({key:e.nodeId,value:M([{key:`modules`,value:M(e.modules.map(e=>({key:e.sourceId,value:e.bindingName})))}],3)})))}],0)}function M(e,t=1){if(e.length===0)return`Object.freeze({})`;let n=` `.repeat(t),r=` `.repeat(t+1);return[`Object.freeze({`,e.map(e=>`${r}${JSON.stringify(e.key)}: ${e.value.replaceAll(`
3
- `,`\n${r}`)}`).join(`,
4
- `),`${n}})`].join(`
5
- `)}function Tn(e){let t=N(e);return t.segments.length===0?t.root.length===0?`.`:t.root:P(t.root,t.segments.slice(0,-1))}function En(e,t){let n=N(e),r=N(t);return r.root.length>0?P(r.root,r.segments):P(n.root,[...n.segments,...r.segments])}function Dn(e,t){let n=N(e),r=N(t);if(n.root!==r.root)return On(t);let i=0;for(;i<n.segments.length&&i<r.segments.length&&n.segments[i]===r.segments[i];)i+=1;let a=[...Array.from({length:n.segments.length-i},()=>`..`),...r.segments.slice(i)];return a.length===0?`.`:a.join(`/`)}function On(e){let t=N(e);return P(t.root,t.segments)}function N(e){let t=e.replaceAll(`\\`,`/`),n=``,r=t,i=t.match(/^[A-Za-z]:/);i===null?t.startsWith(`/`)&&(n=`/`,r=t.slice(1)):(n=i[0],r=t.slice(n.length),r.startsWith(`/`)&&(n=`${n}/`,r=r.slice(1)));let a=[];for(let e of r.split(`/`))if(!(e.length===0||e===`.`)){if(e===`..`){if(a.length>0&&a[a.length-1]!==`..`){a.pop();continue}n.length===0&&a.push(e);continue}a.push(e)}return{root:n,segments:a}}function P(e,t){return e===`/`?t.length===0?`/`:`/${t.join(`/`)}`:e.endsWith(`/`)?t.length===0?e:`${e}${t.join(`/`)}`:e.length>0?t.length===0?e:`${e}/${t.join(`/`)}`:t.length===0?`.`:t.join(`/`)}const kn=`ash-model-catalog-cache`,An=C.object({provider:C.string().min(1),providerModelId:C.string().min(1),contextWindowTokens:C.number().int().nonnegative().optional(),maxOutputTokens:C.number().int().nonnegative().optional()}).passthrough(),jn=C.object({slug:C.string().min(1),providers:C.array(An).min(1)}).passthrough(),Mn=C.object({models:C.array(jn),providerAliases:C.record(C.string(),C.string())}).passthrough();C.object({contextWindowTokens:C.number().int().positive(),maxOutputTokens:C.number().int().positive().optional()}).strict();const Nn=C.object({fetchedAt:C.string(),kind:C.literal(kn),models:C.array(jn),providerAliases:C.record(C.string(),C.string()),version:C.literal(2)}).strict(),Pn=new Map([[`anthropic/claude-opus-4.7`,{contextWindowTokens:2e5,maxOutputTokens:32e3}],[`openai/gpt-5.4`,{contextWindowTokens:4e5,maxOutputTokens:128e3}],[`openai/gpt-5.4-mini`,{contextWindowTokens:4e5,maxOutputTokens:128e3}]]);function Fn(e){return y(e,`.ash`,`cache`,`model-catalog.json`)}function In(e){let t=null,n=null,r=null,i=async()=>(t??=Rn(e),await t),a=async()=>{if(n!==null)throw n;if(r!==null)return await r;r=Ln(e).then(e=>(t=Promise.resolve(e),e));try{return await r}catch(e){throw n=e,e}},o=async()=>{let e=await i();if(e!==null&&Vn(e))return e;try{return await a()}catch{return e===null?null:e}};return{async getModelLimits(e){let t=Hn(e),n=await o();if(n!==null){let e=zn(n.models,t);if(e)for(let t of e.providers){let e=Bn(t);if(e!==null)return e}}return Pn.get(t)??null},async getByProviderModelId(e,t){let n=await o();if(n===null)return null;let r=e.split(`.`)[0],i=n.providerAliases[r]??r,a=Hn(t);for(let e of n.models)for(let t of e.providers)if(t.provider===i&&Hn(t.providerModelId)===a){let n=Bn(t);if(n!==null)return{slug:e.slug,limits:n}}return null}}}async function Ln(e){let t=await fetch(`https://ai-gateway.vercel.sh/v1/models/catalog`);if(!t.ok)throw Error(`AI Gateway model catalog request failed with HTTP ${t.status} ${t.statusText}.`);let n=Mn.safeParse(await t.json());if(!n.success)throw Error(`AI Gateway model catalog response did not match the expected schema.`);let r={fetchedAt:new Date().toISOString(),kind:kn,models:n.data.models,providerAliases:n.data.providerAliases,version:2};try{let t=Fn(e);await x(y(e,`.ash`,`cache`),{recursive:!0}),await S(t,`${JSON.stringify(r,null,2)}\n`,`utf8`)}catch{}return r}async function Rn(e){try{let t=await he(Fn(e),`utf8`),n=Nn.safeParse(JSON.parse(t));return n.success?n.data:null}catch(e){return e instanceof Error&&`code`in e&&typeof e.code==`string`&&e.code,null}}function zn(e,t){return e.find(e=>e.slug===t)}function Bn(e){return e.contextWindowTokens===void 0||e.contextWindowTokens<=0?null:{contextWindowTokens:e.contextWindowTokens,...e.maxOutputTokens!==void 0&&e.maxOutputTokens>0&&{maxOutputTokens:e.maxOutputTokens}}}function Vn(e){let t=Date.parse(e.fetchedAt);return Number.isFinite(t)?Date.now()-t<=864e5:!1}function Hn(e){return e.endsWith(`-thinking`)?e.slice(0,-9):e}async function F(e){let n=t(await s(y(e.agentRoot,e.source.logicalPath)),e.source);try{return await a(n)}catch(t){throw Error(`Failed to execute the ${e.kind} export "${e.source.exportName??`default`}" from "${e.source.logicalPath}": ${d(t)}`)}}var Un=class extends Error{agentId;constructor(e){super(`Agent "${e}" does not have an agent.ts config module. The "model" field is required.`),this.name=`MissingAgentConfigModuleError`,this.agentId=e}};async function Wn(e,t){if(e.configModule===void 0)throw new Un(e.agentId);let n=$e(await F({agentRoot:e.agentRoot,kind:`agent config`,source:e.configModule}),`Expected the agent config export "${e.configModule.exportName??`default`}" from "${e.configModule.logicalPath}" to match the public Ash shape.`),r=await Gn({modelCatalog:t.modelCatalog,purpose:`the primary compaction trigger model`,contextWindowTokens:n.modelContextWindowTokens,providerOptions:n.modelOptions?.providerOptions,source:e.configModule,value:n.model}),i={},a={compaction:i,metadata:n.metadata??{},model:r,name:e.agentId};return n.description!==void 0&&(a.description=n.description),n.build!==void 0&&(a.build={externalDependencies:n.build.externalDependencies===void 0?void 0:[...n.build.externalDependencies]}),a.source={exportName:e.configModule.exportName,sourceKind:`module`,logicalPath:e.configModule.logicalPath,sourceId:e.configModule.sourceId},n.compaction?.model!==void 0&&(i.model=await Gn({modelCatalog:t.modelCatalog,purpose:`the compaction summary model`,contextWindowTokens:n.compaction.modelContextWindowTokens,providerOptions:n.modelOptions?.providerOptions,source:e.configModule,value:n.compaction.model})),n.compaction?.thresholdPercent!==void 0&&(i.thresholdPercent=n.compaction.thresholdPercent),a}async function Gn(e){if(typeof e.value==`string`)return await Kn({id:se(e.value),providerOptions:qn(e.providerOptions)},e);let t=e.source;if(t===void 0)throw Error(`Expected ${e.purpose} to provide a valid AI SDK language model reference.`);let n=e.value,r=n.specificationVersion;if(r!==`v2`&&r!==`v3`&&r!==`v4`||typeof n.provider!=`string`||typeof n.modelId!=`string`||typeof n.doGenerate!=`function`||typeof n.doStream!=`function`)throw Error(`Expected the authored agent config export "${t.exportName??`default`}" from "${t.logicalPath}" to provide a valid AI SDK language model.`);let i={id:se(n),source:{exportName:t.exportName,sourceKind:`module`,logicalPath:t.logicalPath,sourceId:t.sourceId},providerOptions:qn(e.providerOptions)};if(e.contextWindowTokens===void 0){let t=await e.modelCatalog.getByProviderModelId(n.provider,n.modelId);if(t)return{...i,id:t.slug,contextWindowTokens:t.limits.contextWindowTokens}}return await Kn(i,e)}async function Kn(e,t){if(t.contextWindowTokens!==void 0)return{...e,contextWindowTokens:t.contextWindowTokens};let n;try{n=await t.modelCatalog.getModelLimits(e.id)}catch(n){throw Error(`Failed to load AI Gateway model metadata for ${t.purpose} "${e.id}". ${d(n)}`)}if(n===null)throw Error(`Cannot compile agent compaction because ${t.purpose} "${e.id}" does not have known AI Gateway context window metadata.`);return{...e,contextWindowTokens:n.contextWindowTokens}}function qn(e){if(e===void 0)return;let t={};for(let[n,r]of Object.entries(e))t[n]=oe(r);return t}function Jn(e){return typeof e==`object`&&!!e&&e.__kind===`ash:channel`}function Yn(e,t){if(!Jn(e))throw Error(`${t} Use \`defineChannel({ routes, ... })\` (or a wrapper like \`slackChannel\` / \`ashChannel\`) — bare \`{ fetch, receive? }\` channel objects are no longer supported.`);return e}function Xn(e){return typeof e==`object`&&!!e&&e.kind===`ash:disabled-channel`}async function Zn(e,t){let n=await F({agentRoot:e,kind:`channel`,source:t}),r=E(t.logicalPath).replace(/^channels\//,``);if(Xn(n))return{kind:`disabled`,name:r,logicalPath:t.logicalPath};let i=Yn(n,`Expected the channel export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public Ash shape.`);return i.routes.map(e=>({kind:`channel`,name:r,logicalPath:t.logicalPath,method:e.method.toUpperCase(),urlPath:e.path,sourceId:t.sourceId,sourceKind:`module`,exportName:t.exportName,adapterKind:Qn(i.adapter)}))}function Qn(e){if(typeof e!=`object`||!e)return;let t=e.kind;return typeof t==`string`&&t.length>0?t:void 0}function $n(e,t=`auth`){if(typeof e!=`object`||!e)return`The "${t}" field must be an object with a "getToken" method.`;let n=e;if(typeof n.getToken!=`function`)return`The "${t}.getToken" field must be a function returning Promise<{ token }>.`;let r=n.startAuthorization!==void 0,i=n.completeAuthorization!==void 0;if(!r&&!i&&n.principalType!==void 0&&n.principalType!==`app`&&n.principalType!==`user`)return`The "${t}.principalType" field must be "app" or "user".`;if(r!==i)return`The "${t}" field must provide either both "startAuthorization" and "completeAuthorization" (interactive OAuth) or neither (getToken-only). Got only "${r?`startAuthorization`:`completeAuthorization`}".`;if(r&&typeof n.startAuthorization!=`function`)return`The "${t}.startAuthorization" field must be a function when provided.`;if(i&&typeof n.completeAuthorization!=`function`)return`The "${t}.completeAuthorization" field must be a function when provided.`;if(r&&n.principalType!==`user`)return`Interactive authorization (startAuthorization + completeAuthorization) is restricted to "principalType": "user" in v1. See D10 of research/connections/connection-principal-model.md for the rationale.`}function er(e,t,n=`auth`){let r=$n(e,n);if(r!==void 0)throw Error(`${t} ${r}`);let i=e,a=tr(i.vercelConnect);if(i.startAuthorization!==void 0&&i.completeAuthorization!==void 0){let e={completeAuthorization:i.completeAuthorization,getToken:i.getToken,principalType:`user`,startAuthorization:i.startAuthorization};return a===void 0?e:{...e,vercelConnect:a}}let o={getToken:i.getToken,principalType:i.principalType??`app`};return a===void 0?o:{...o,vercelConnect:a}}function tr(e){if(typeof e!=`object`||!e)return;let t=e.connector;if(!(typeof t!=`string`||t.length===0))return{connector:t}}const nr=[`approval`,`auth`,`description`,`headers`,`tools`,`url`],rr=[`completeAuthorization`,`getToken`,`principalType`,`startAuthorization`,`vercelConnect`];function ir(t,n){let r=o(t,n);e(r,nr,n),ar(r,n),or(r,n);let i=sr(r,n),a=cr(r,n),s=lr(r,n);if(i!==void 0&&a!==void 0&&typeof a!=`function`&&Object.keys(a).some(e=>e.toLowerCase()===`authorization`))throw Error(`${n} "headers" must not include an "Authorization" key when "auth" is also provided.`);let c={description:r.description,url:r.url};if(i!==void 0&&(c.auth=i),a!==void 0&&(c.headers=a),s!==void 0&&(c.tools=s),r.approval!==void 0){if(typeof r.approval!=`function`)throw Error(`${n} The "approval" field must be a function when provided.`);c.approval=r.approval}return c}function ar(e,t){if(typeof e.url!=`string`||!URL.canParse(e.url))throw Error(`${t} The "url" field must be a valid URL.`);let n=new URL(e.url);if(n.protocol!==`https:`&&n.protocol!==`http:`)throw Error(`${t} The "url" field must use the http or https protocol, got "${n.protocol}".`)}function or(e,t){if(typeof e.description!=`string`||e.description.length===0)throw Error(`${t} The "description" field must be a non-empty string.`)}function sr(t,n){if(t.auth===void 0)return;let r=o(t.auth,`${n} The "auth" field must be an object with a "getToken" method.`);return e(r,rr,`${n} The "auth" field`),er(r,n)}function cr(e,t){if(e.headers===void 0)return;if(typeof e.headers==`function`)return e.headers;if(typeof e.headers!=`object`||e.headers===null||Array.isArray(e.headers))throw Error(`${t} The "headers" field must be a plain object or a function.`);let n=e.headers;for(let[e,r]of Object.entries(n)){let n=typeof r;if(n!==`string`&&n!==`function`&&n!==`object`||n===`object`&&(r===null||typeof r.then!=`function`))throw Error(`${t} The "headers.${e}" value must be a string, Promise, or function.`)}return n}function lr(e,t){if(e.tools===void 0)return;if(typeof e.tools!=`object`||e.tools===null||Array.isArray(e.tools))throw Error(`${t} The "tools" field must specify either "allow" or "block".`);let n=e.tools,r=`allow`in n,i=`block`in n;if(r&&i)throw Error(`${t} The "tools" field must specify either "allow" or "block", not both.`);if(!r&&!i)throw Error(`${t} The "tools" field must specify either "allow" or "block".`);return r?(ur(n.allow,`${t} The "tools.allow"`),{allow:n.allow}):(ur(n.block,`${t} The "tools.block"`),{block:n.block})}function ur(e,t){if(!Array.isArray(e))throw Error(`${t} field must be an array of strings.`);for(let n=0;n<e.length;n++)if(typeof e[n]!=`string`)throw Error(`${t}[${n}] must be a string.`)}async function dr(e,t){let n=ir(await F({agentRoot:e,kind:`connection`,source:t}),`Expected the connection export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public Ash shape.`),r={connectionName:t.connectionName,description:n.description,exportName:t.exportName,logicalPath:t.logicalPath,sourceId:t.sourceId,sourceKind:`module`,url:n.url},i=fr(n.auth);return i!==void 0&&(r.vercelConnect=i),r}function fr(e){if(typeof e!=`object`||!e)return;let t=e.vercelConnect;if(typeof t!=`object`||!t)return;let n=t.connector;if(!(typeof n!=`string`||n.length===0))return{connector:n}}function pr(e){return{exportName:e.exportName,logicalPath:e.logicalPath,slug:E(e.logicalPath).replace(/^hooks\//,``),sourceId:e.sourceId,sourceKind:`module`}}function mr(e){let t;function n(){return t===void 0&&(t=e()),t}return{get name(){return n().name},create(e){return n().create(e)},async prewarm(e){await n().prewarm(e)}}}function hr(t,n){let r=o(t,n);e(r,[`backend`,`bootstrap`,`description`,`onSession`],n);let a={};if(r.backend!==void 0&&(a.backend=gr(r.backend,n)),r.description!==void 0){if(typeof r.description!=`string`)throw Error(`${n} The "description" field must be a string when set.`);a.description=r.description}return r.bootstrap!==void 0&&(a.bootstrap=i(r.bootstrap,n)),r.onSession!==void 0&&(a.onSession=i(r.onSession,n)),a}function gr(e,t){if(typeof e==`function`)return mr(e);let n=o(e,`${t} The "backend" field must be a SandboxBackend value (use vercelBackend(), localBackend(), or your own factory) or a zero-arg function returning one.`);if(typeof n.name!=`string`||n.name.length===0)throw Error(`${t} The "backend" value must expose a non-empty string "name" identifier.`);if(typeof n.create!=`function`)throw Error(`${t} The "backend" value must expose a "create" function.`);if(n.prewarm!==void 0&&typeof n.prewarm!=`function`)throw Error(`${t} The "backend.prewarm" property must be a function when set.`);return n}async function _r(e,t){return{description:hr(await F({agentRoot:e,kind:`sandbox`,source:t}),`Expected the sandbox export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public Ash shape.`).description,exportName:t.exportName,logicalPath:t.logicalPath,sourceId:t.sourceId,sourceKind:`module`}}async function vr(e,t){let n=t.sourceKind===`markdown`?it(t.definition,`Expected the compiled instructions definition at "${t.logicalPath}" to match the public Ash shape.`):it(await F({agentRoot:e,kind:`instructions`,source:t}),`Expected the instructions export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public Ash shape.`);return{name:E(t.logicalPath),logicalPath:t.logicalPath,markdown:n.markdown,sourceId:t.sourceId,sourceKind:t.sourceKind}}async function yr(e,t){let n=t.sourceKind===`markdown`?st(t.definition,`Expected the compiled schedule definition at "${t.logicalPath}" to match the public Ash shape.`):st(await F({agentRoot:e,kind:`schedule`,source:t}),`Expected the schedule export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public Ash shape.`),r={cron:n.cron,hasRun:n.run!==void 0,logicalPath:t.logicalPath,name:br(t.logicalPath),sourceId:t.sourceId,sourceKind:t.sourceKind};return n.markdown===void 0?r:{...r,markdown:n.markdown.trim()}}function br(e){return E(e).replace(/^schedules\//,``)}async function xr(e,t){if(t.sourceKind===`skill-package`)return Sr(t);let n=t.sourceKind===`markdown`?at(t.definition,`Expected the compiled skill definition at "${t.logicalPath}" to match the public Ash shape.`):at(await F({agentRoot:e,kind:`skill`,source:t}),`Expected the skill export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public Ash shape.`),r={description:n.description,license:n.license,logicalPath:t.logicalPath,markdown:n.markdown,metadata:n.metadata===void 0?void 0:{...n.metadata},name:E(t.logicalPath).replace(/^skills\//,``),sourceId:t.sourceId,sourceKind:t.sourceKind};return n.files!==void 0&&(r.files=n.files),r}function Sr(e){return{assetsPath:e.assetsPath,description:e.description,license:e.license,logicalPath:e.logicalPath,markdown:e.markdown,metadata:e.metadata===void 0?void 0:{...e.metadata},name:e.name,referencesPath:e.referencesPath,rootPath:e.rootPath,scriptsPath:e.scriptsPath,skillId:e.skillId,skillFilePath:e.skillFilePath,sourceId:e.sourceId,sourceKind:`skill-package`}}async function Cr(e){let t=[],n=[],r=[];for(let i of e.subagents){let a=await wr({appRoot:e.appRoot,compileAgentNodeManifest:e.compileAgentNodeManifest,context:e.context,parentNodeId:e.parentNodeId,source:i});if(a.kind===`remote`){r.push(a.node);continue}t.push(a.node,...a.descendants.nodes),n.push({childNodeId:a.node.nodeId,parentNodeId:e.parentNodeId},...a.descendants.edges)}return{edges:n,nodes:t,remoteAgents:r}}async function wr(e){let t=e.source.manifest.configModule;if(t===void 0)throw Error(`Subagent "${e.source.logicalPath}" is missing an agent config module.`);let n=await F({agentRoot:e.source.manifest.agentRoot,kind:`subagent config`,source:t});return kr(n)===`remote`?{kind:`remote`,node:Dr({source:e.source,value:n})}:{kind:`local`,...await Er(e)}}async function Tr(e){let t=sn(e.parentNodeId,e.source.sourceId),n=e.source.subagentId,r=await e.compileAgentNodeManifest({...e.source.manifest,appRoot:e.appRoot},e.context),i=r.config.description;if(!i)throw Error(`Local subagent "${e.source.logicalPath}" is missing a "description" field on its agent config. Add \`description\` to \`defineAgent({ ... })\` so the parent agent can decide when to delegate to this subagent.`);let a=await Cr({appRoot:e.appRoot,compileAgentNodeManifest:e.compileAgentNodeManifest,context:e.context,parentNodeId:t,subagents:e.source.manifest.subagents});return{descendants:a,node:{agent:{...r,remoteAgents:[...a.remoteAgents]},description:i,entryPath:e.source.entryPath,logicalPath:e.source.logicalPath,name:n,nodeId:t,rootPath:e.source.rootPath,sourceId:e.source.sourceId,sourceKind:`module`}}}const Er=Tr;function Dr(e){let t=e.source.manifest.configModule;if(t===void 0)throw Error(`Remote agent "${e.source.logicalPath}" is missing a config module.`);jr(e.source);let n=Ar(e.value,`Expected the remote agent config export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public Ash shape.`);return{...Or(e.source,t),description:n.description,entryPath:e.source.entryPath,name:e.source.subagentId,nodeId:e.source.sourceId,path:n.path,rootPath:e.source.rootPath,url:n.url}}function Or(e,t){let n=e.logicalPath===t.logicalPath?t.logicalPath:`${e.logicalPath}/${t.logicalPath}`,r={logicalPath:n,sourceId:ut(n),sourceKind:`module`};return t.exportName!==void 0&&(r.exportName=t.exportName),r}function kr(e){return typeof e!=`object`||!e?`local`:e.kind===`remote`?`remote`:`local`}function Ar(t,n){let r=o(t,n);if(e(r,[`auth`,`description`,`headers`,`kind`,`path`,`url`],n),r.kind!==`remote`)throw Error(`${n} Expected "kind" to be "remote".`);return{description:c(r.description,n),path:r.path===void 0?h:c(r.path,n),url:c(r.url,n)}}function jr(e){let t=e.manifest,n=[t.connections.length>0?`connections/`:void 0,t.hooks.length>0?`hooks/`:void 0,t.instructions===void 0?void 0:`instructions`,t.lib.length>0?`lib/`:void 0,t.sandbox===null?void 0:`sandbox/`,t.sandboxWorkspaces.length>0?`sandbox/workspace/`:void 0,t.schedules.length>0?`schedules/`:void 0,t.skills.length>0?`skills/`:void 0,t.subagents.length>0?`subagents/`:void 0,t.tools.length>0?`tools/`:void 0].filter(e=>e!==void 0);if(n.length!==0)throw Error(`Remote subagent definition "${e.logicalPath}" cannot include local package entries. Remove unsupported entries: ${n.join(`, `)}.`)}const Mr=Symbol.for(`experimental-ash.definition-source-registry`),Nr=globalThis;Nr[Mr]===void 0&&(Nr[Mr]=new Map);const Pr=Nr[Mr];function Fr(e,t){Pr.set(e,t)}function Ir(e){return typeof e==`object`&&!!e&&e.kind===`ash:disabled-tool`}function Lr(e){return e&&typeof e==`object`&&`~standard`in e?e[`~standard`].jsonSchema.input({target:`draft-07`}):JSON.parse(JSON.stringify(e))}function Rr(t,n){if(Ir(t))return{kind:`disabled`};let r=o(t,n);e(r,[`description`,`execute`,`inputSchema`,`needsApproval`,`onCompact`,`retentionPolicy`,`toModelOutput`],n);let a=r.inputSchema===void 0?null:Lr(r.inputSchema),s={description:c(r.description,n),execute:i(r.execute,n),inputSchema:a};if(r.onCompact!==void 0&&i(r.onCompact,n),r.needsApproval!==void 0&&i(r.needsApproval,n),r.retentionPolicy!==void 0){let e=r.retentionPolicy;if(e!==`auto`&&e!==`keep`&&typeof e!=`function`)throw Error(`${n} Expected \`retentionPolicy\` to be "auto", "keep", or a function.`)}return r.toModelOutput!==void 0&&i(r.toModelOutput,n),{kind:`tool`,definition:s}}async function zr(e,t){let n=Rr(await F({agentRoot:e,kind:`tool`,source:t}),`Expected the tool export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public Ash shape.`),r=E(t.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`);return n.kind===`disabled`?{kind:`disabled`,name:r}:{kind:`tool`,definition:{description:n.definition.description,exportName:t.exportName,inputSchema:n.definition.inputSchema??null,logicalPath:t.logicalPath,name:r,sourceId:t.sourceId,sourceKind:`module`}}}async function Br(e){let t={modelCatalog:In(e.appRoot)},[n,r]=await Promise.all([Vr(e,t),Cr({appRoot:e.appRoot,compileAgentNodeManifest:Vr,context:t,parentNodeId:A,subagents:e.subagents})]);return cn({...n,remoteAgents:r.remoteAgents,subagentEdges:r.edges,subagents:r.nodes})}async function Vr(e,t){let n=await Promise.all(e.tools.map(t=>zr(e.agentRoot,t))),r=[],i=[];for(let e of n)e.kind===`tool`?r.push(e.definition):i.push(e.name);let a=(await Promise.all(e.channels.map(t=>Zn(e.agentRoot,t)))).flat();return an({agentRoot:e.agentRoot,appRoot:e.appRoot,channels:a,config:await Wn(e,t),connections:await Promise.all(e.connections.map(t=>dr(e.agentRoot,t))),diagnosticsSummary:e.diagnosticsSummary,disabledFrameworkTools:i,hooks:e.hooks.map(e=>pr(e)),sandbox:e.sandbox===null?null:await _r(e.agentRoot,e.sandbox),sandboxWorkspaces:e.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:await Promise.all(e.schedules.map(t=>yr(e.agentRoot,t))),skills:await Promise.all(e.skills.map(t=>xr(e.agentRoot,t))),instructions:e.instructions===void 0?void 0:await vr(e.agentRoot,e.instructions),tools:r})}function Hr(e){Wr(e.name);let t=[{content:Te.from(e.markdown,`utf8`),relativePath:`SKILL.md`}];for(let[n,r]of Object.entries(e.files??{}))Gr(n),t.push({content:Kr(r),relativePath:n});return t.sort((e,t)=>qr(e.relativePath,t.relativePath)),{description:e.description,files:t,license:e.license,markdown:e.markdown,metadata:e.metadata===void 0?void 0:{...e.metadata},name:e.name}}async function Ur(e){for(let t of e.skill.files){let n=y(e.rootPath,`skills`,e.skill.name,t.relativePath);await x(v(n),{recursive:!0}),await S(n,t.content)}}function Wr(e){if(e.length===0||e.trim()!==e||e.startsWith(`.`)||e.includes(`/`)||e.includes(`\\`)||e.includes(`..`)||/^[A-Za-z]:/.test(e))throw Error(`Expected skill name to be a non-empty safe path segment without whitespace, separators, "." prefix, or "..".`)}function Gr(e){if(e===`SKILL.md`)throw Error(`Skill package files must not include "SKILL.md"; Ash generates it.`);if(e.length===0||e.startsWith(`/`)||e.includes(`\\`)||/^[A-Za-z]:/.test(e)||e.split(`/`).some(e=>e.length===0||e===`.`||e===`..`))throw Error(`Expected skill package file paths to be relative POSIX paths.`)}function Kr(e){return typeof e==`string`?Te.from(e,`utf8`):Te.from(e)}function qr(e,t){return e<t?-1:+(e>t)}const Jr=`workspace-resources`;async function Yr(e){let t=y(e.compileDirectoryPath,Jr);await ge(t,{force:!0,recursive:!0});let n=await Zr({nodeId:A,resourcesRoot:t,manifest:e.manifest}),r=await Promise.all(e.manifest.subagents.map(async e=>({...e,agent:await Zr({nodeId:e.nodeId,resourcesRoot:t,manifest:e.agent})})));return{...n,kind:e.manifest.kind,subagentEdges:e.manifest.subagentEdges,subagents:r,version:e.manifest.version}}function Xr(e,t){return{logicalPath:w(y(Jr,t)),rootEntries:on({sandboxWorkspaces:e.sandboxWorkspaces,skills:e.skills})}}async function Zr(e){for(let t of e.manifest.sandboxWorkspaces)if(t.rootEntries.some(e=>e===`skills/`||e===`skills`))throw Error(`Sandbox workspace "${t.logicalPath}" cannot define "skills" because Ash manages that workspace entry.`);let t=y(e.resourcesRoot,e.nodeId);await x(t,{recursive:!0});for(let n of e.manifest.sandboxWorkspaces)await me(n.sourcePath,t,{recursive:!0});for(let n of e.manifest.skills)await Qr({nodeRoot:t,skill:n});return{...e.manifest,skills:e.manifest.skills.map($r),workspaceResourceRoot:Xr(e.manifest,e.nodeId)}}async function Qr(e){let t=y(e.nodeRoot,`skills`,e.skill.name);if(e.skill.sourceKind===`skill-package`){await me(e.skill.rootPath,t,{recursive:!0});return}await Ur({rootPath:e.nodeRoot,skill:Hr(e.skill)})}function $r(e){let{files:t,...n}=e;return n}const ei=`ash-compile-metadata`;function ti(e){let t=b(e),n=y(t,`.ash`,`discovery`),r=y(t,`.ash`,`compile`);return{appRoot:t,compiledManifestPath:y(r,`compiled-agent-manifest.json`),compileDirectoryPath:r,compileMetadataPath:y(r,`compile-metadata.json`),diagnosticsPath:y(n,`diagnostics.json`),discoveryManifestPath:y(n,`agent-discovery-manifest.json`),discoveryDirectoryPath:n,moduleMapPath:y(r,`module-map.mjs`)}}function ni(e){return{diagnostics:[...e],kind:`ash-discovery-diagnostics`,summary:He(e),version:1}}function ri(e){let t=jt(),n=I(e.discoveryManifestJson),r=I(e.diagnosticsArtifactJson),i=I(e.moduleMapSource);return{compile:{moduleMap:{path:oi(e.appRoot,e.paths.moduleMapPath),sha256:i}},discovery:{diagnostics:{path:oi(e.appRoot,e.paths.diagnosticsPath),sha256:r},manifest:{path:oi(e.appRoot,e.paths.discoveryManifestPath),sha256:n},sourceGraphHash:I(`${n}:${r}:${i}`),summary:e.diagnosticsSummary},generator:{name:t.name,version:t.version},kind:ei,status:e.diagnosticsSummary.errors>0?`failed`:`ready`,version:5}}async function ii(e){let t=ti(e.appRoot),n=ni(e.diagnostics),r=await Yr({compileDirectoryPath:t.compileDirectoryPath,manifest:await Br(e.manifest)}),i=ai(r),a=ai(e.manifest),o=ai(n),s=bn({manifest:r,moduleMapPath:t.moduleMapPath}),c=ri({appRoot:e.appRoot,diagnosticsArtifactJson:o,diagnosticsSummary:n.summary,discoveryManifestJson:a,moduleMapSource:s,paths:t}),l=ai(c);return await x(t.discoveryDirectoryPath,{recursive:!0}),await x(t.compileDirectoryPath,{recursive:!0}),await Promise.all([S(t.compiledManifestPath,i),S(t.diagnosticsPath,o),S(t.discoveryManifestPath,a),S(t.moduleMapPath,s),S(t.compileMetadataPath,l)]),{compiledManifest:r,diagnosticsArtifact:n,metadata:c,moduleMapSource:s,paths:t}}function I(e){return _e(`sha256`).update(e).digest(`hex`)}function ai(e){return`${JSON.stringify(e,null,2)}\n`}function oi(e,t){return w(de(b(e),t))}const si=Symbol.for(`experimental-ash.context-key-registry`),ci=globalThis;ci[si]===void 0&&(ci[si]=new Map);const li=ci[si];var L=class{name;codec;constructor(e,t={}){this.name=e,this.codec=t.codec,li.set(e,this)}};const ui=Symbol.for(`experimental-ash.context-storage`),di=globalThis;di[ui]===void 0&&(di[ui]=new De);const fi=di[ui];function R(){let e=fi.getStore();if(e===void 0)throw Error(`No active Ash context. Call this function only from authored runtime code such as tools, steps, and model callbacks.`);return e}function pi(e){return{debug(t,n){yi(`debug`,e,t,n)},info(t,n){yi(`info`,e,t,n)},warn(t,n){yi(`warn`,e,t,n)},error(t,n){yi(`error`,e,t,n),xi(t,n)}}}function mi(){return crypto.randomUUID()}function hi(e,t){let n={errorId:t??mi(),message:_i(e)},r=gi(e);return r!==void 0&&(n.name=r),n.detail=Si(e),n}function gi(e){if(e instanceof Error)return e.name===`Error`?void 0:e.name;if(l(e)&&u(e.name)&&e.name!==`Error`)return e.name}function _i(e){return l(e)&&!(e instanceof Error)&&typeof e.message==`string`?e.message:Ae(e)}function vi(e,t){let n=t instanceof Error?t.message:Ae(t),r=t instanceof Error?t.name:`Error`;e.setStatus({code:Oe.ERROR,message:n}),e.recordException({message:n,name:r,stack:Si(t)})}function yi(e,t,n,r){let i=e===`error`?console.error:e===`warn`?console.warn:console.log,a=`[ash:${t}] ${n}`;if(r===void 0){i(a);return}i(a,bi(r))}function bi(e){let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(r instanceof Error){t[n]=hi(r);continue}t[n]=r}return t}function xi(e,t){let n=ke.getActiveSpan();if(n===void 0)return;let r=t?.error;if(r instanceof Error){vi(n,r);return}n.addEvent(e,t?bi(t):void 0)}function Si(e){return Ci(je(e,{breakLength:1/0,compact:!1,depth:10,maxStringLength:8192}),16384)}function Ci(e,t){if(Buffer.byteLength(e,`utf8`)<=t)return e;let n=e.slice(0,t);for(;Buffer.byteLength(n,`utf8`)>t&&n.length>0;)n=n.slice(0,-1);return`${n}<…truncated>`}function wi(e){if(e.message!==void 0)return{inputResponses:e.inputResponses,message:e.message,modelContext:e.modelContext};if(e.inputResponses!==void 0&&e.inputResponses.length>0)return{inputResponses:e.inputResponses,modelContext:e.modelContext};if(e.modelContext!==void 0&&e.modelContext.length>0)return{modelContext:e.modelContext}}function Ti(e){return e.kind}const Ei={kind:`http`};new L(`ash.auth`),new L(`ash.initiatorAuth`);const Di=new L(`ash.sessionId`),Oi=new L(`ash.continuationToken`);new L(`ash.mode`),new L(`ash.parentSession`),new L(`ash.capabilities`),new L(`ash.sessionCallback`),new L(`ash.sessionPrepared`);const ki={kind:`schedule`},Ai=pi(`execution.subagent-adapter`);function ji(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.callId==`string`&&t.callId.length>0&&typeof t.parentContinuationToken==`string`&&t.parentContinuationToken.length>0&&typeof t.parentSessionId==`string`&&typeof t.subagentName==`string`&&t.subagentName.length>0}const Mi={kind:`subagent`,async"input.requested"(e,t){let n=t.state;ji(n)&&await Ni({hookPayload:{callId:n.callId,childContinuationToken:t.ctx.require(Oi),childSessionId:t.ctx.require(Di),event:{requests:e.requests,sequence:e.sequence,stepIndex:e.stepIndex,turnId:e.turnId},kind:`subagent-input-request`,subagentName:n.subagentName},parentContinuationToken:n.parentContinuationToken})}};async function Ni(e){"use step";try{await Ee(e.parentContinuationToken,e.hookPayload)}catch(t){let n=mi();throw Ai.warn(`failed to forward proxied HITL batch to parent`,{callId:e.hookPayload.callId,childContinuationToken:e.hookPayload.childContinuationToken,childSessionId:e.hookPayload.childSessionId,errorId:n,parentContinuationToken:e.parentContinuationToken,subagentName:e.hookPayload.subagentName,error:t}),t}}var z=class extends Error{registry;entryName;logicalPath;sourceId;constructor(e,t,n={}){super(t),this.name=`RuntimeRegistryError`,this.registry=e,n.entryName!==void 0&&(this.entryName=n.entryName),n.logicalPath!==void 0&&(this.logicalPath=n.logicalPath),n.sourceId!==void 0&&(this.sourceId=n.sourceId)}},Pi=class{registry;_entries=new Map;_reserved;constructor(e,t=[]){this.registry=e,this._reserved=new Set(t)}get size(){return this._entries.size}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)??null}asMap(){return this._entries}register(e,t,n={}){if(this._entries.has(e))throw new z(this.registry,n.duplicateMessage??`Duplicate ${this.registry} name "${e}".`,{...n.location,entryName:e});if(this._reserved.has(e))throw new z(this.registry,n.reservedMessage??`${Fi(this.registry)} "${e}" collides with another runtime-visible name.`,{...n.location,entryName:e});this._entries.set(e,t),this._reserved.add(e)}set(e,t){this._entries.set(e,t),this._reserved.add(e)}};function Fi(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}const Ii=[Ei,Mi,ki],Li=new Set([`kind`,`state`,`deliver`,`createAdapterContext`,`fetchFile`]);function Ri(e){let t=new Map,n=new Set;for(let e of Ii){let r=Bi(e);n.add(r),t.set(r,e)}for(let r of e.channels){if(r.adapter===void 0)continue;let e={logicalPath:r.logicalPath,sourceId:r.sourceId},i=r.adapter,a=Bi(i,e);if(n.has(a)){if(Vi(i))throw new z(`adapter`,`Channel adapter kind "${a}" is reserved by the framework. A route-declared adapter may share a framework kind only as a pass-through with no \`deliver\` hook, event handlers, \`attachments\` resolver, or \`createAdapterContext\` factory. Use a custom \`kind\` to add channel-specific behavior.`,{...e,entryName:a});continue}t.set(a,i)}return{adaptersByKind:t}}function zi(e,t){let n=t,r=e.adaptersByKind.get(n.kind);if(r===void 0)throw Error(`Unknown adapter kind: "${n.kind}". Declare the adapter on the route that starts this session so the runtime can rehydrate it.`);return{...r,state:n.state}}function Bi(e,t){let n=Ti(e);if(typeof n!=`string`||n.length===0)throw new z(`adapter`,"Adapters must declare a non-empty `kind` field.",{entryName:`unknown`,logicalPath:t?.logicalPath,sourceId:t?.sourceId});return n}function Vi(e){if(e.deliver!==void 0||e.fetchFile!==void 0||e.createAdapterContext!==void 0)return!0;for(let[t,n]of Object.entries(e))if(!Li.has(t)&&typeof n==`function`)return!0;return!1}function Hi(e,t={}){return t.moduleMapLoaderPath===void 0?{appRoot:e,kind:`disk`}:{appRoot:e,kind:`disk`,moduleMapLoaderPath:t.moduleMapLoaderPath}}function Ui(e){return e.kind===`disk`?e.appRoot:void 0}function Wi(e){return e.kind===`disk`?e.moduleMapLoaderPath===void 0?`disk:${e.appRoot}`:`disk:${e.appRoot}:authored-source:${e.moduleMapLoaderPath}`:`bundled`}function B(e){let t=Gi(e),n=`${t}/.ash/discovery`,r=`${t}/.ash/compile`;return{appRoot:t,compiledManifestPath:`${r}/compiled-agent-manifest.json`,compileDirectoryPath:r,compileMetadataPath:`${r}/compile-metadata.json`,diagnosticsPath:`${n}/diagnostics.json`,discoveryDirectoryPath:n,discoveryManifestPath:`${n}/agent-discovery-manifest.json`,moduleMapPath:`${r}/module-map.mjs`}}function Gi(e){let t=e.replaceAll(`\\`,`/`);return t===`/`?t:t.replace(/\/+$/,``)}function Ki(e){return Me(e,{prefix:void 0}).message}function qi(e=`test-session`){return{bundleCache:new Map,bundleCacheKeyBySourceKey:new Map,compiledArtifacts:null,id:e}}const Ji=Symbol.for(`experimental-ash.runtime-session-storage`),Yi=Symbol.for(`experimental-ash.runtime-session-default`),V=globalThis;V[Ji]===void 0&&(V[Ji]=new De);const Xi=V[Ji];function Zi(){return V[Yi]===void 0&&(V[Yi]=qi(`process-default`)),V[Yi]}function Qi(){return Xi.getStore()??Zi()}function $i(){return Qi().compiledArtifacts}const ea=C.object({path:C.string(),sha256:C.string()}).strict(),ta=C.object({compile:C.object({moduleMap:ea}).strict(),discovery:C.object({diagnostics:ea,manifest:ea,sourceGraphHash:C.string(),summary:C.object({errors:C.number().finite(),warnings:C.number().finite()}).strict()}).strict(),generator:C.object({name:C.string(),version:C.string()}).strict(),kind:C.literal(ei),status:C.union([C.literal(`failed`),C.literal(`ready`)]),version:C.literal(5)}).strict();var na=class extends Error{metadataPath;constructor(e,t){super(e),this.name=`LoadCompileMetadataError`,t!==void 0&&(this.metadataPath=t)}};async function ra(e){let t=e.compiledArtifactsSource.kind===`disk`?B(e.compiledArtifactsSource.appRoot).compileMetadataPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new na(aa(e),t)}return ia(n,t)}let n=$i()?.metadata;return n===void 0?null:ia(n,`bundled compile metadata`)}function ia(e,t){let n=ta.safeParse(e);if(!n.success)throw new na(`Expected "${t}" to contain valid Ash compile metadata. ${Ki(n.error)}`,t);return n.data}function aa(e){return e instanceof Error?e.message:`Unknown compile metadata load failure.`}async function oa(e){let t=Wi(e),n=await sa(e);try{let r=(await ra({compiledArtifactsSource:e}))?.discovery.sourceGraphHash;return r===void 0||r.length===0?n===void 0?t:`${t}:mtime-${ca(n)}`:n===void 0?`${t}:${r}`:`${t}:${r}:mtime-${ca(n)}`}catch{return n===void 0?t:`${t}:mtime-${ca(n)}`}}async function sa(e){if(e.kind!==`disk`)return;let{stat:t}=await import(`node:fs/promises`),{compileMetadataPath:n}=B(e.appRoot);try{return(await t(n)).mtimeMs}catch{return}}function ca(e){return Math.floor(e).toString(36)}const la=`__root__`;function ua(e,t){if(t===void 0||t===`__root__`)return e.root;let n=e.nodesByNodeId.get(t);if(n===void 0)throw Error(`Missing runtime agent node for node id "${t}".`);return n}const da=`bundled compiled manifest`;var fa=class extends Error{manifestPath;constructor(e,t){super(e),this.name=`LoadCompiledManifestError`,t!==void 0&&(this.manifestPath=t)}};async function pa(e){let t=e.compiledArtifactsSource.kind===`disk`?B(e.compiledArtifactsSource.appRoot).compiledManifestPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new fa(ha(e),t)}return ma(n,t)}let n=$i();if(n!==null)return ma(n.manifest,da);throw new fa(`Compiled manifest is unavailable without an app root or bundled compiled artifacts.`,da)}function ma(e,t){let n=rn.safeParse(e);if(!n.success)throw new fa(`Expected "${t}" to contain a valid compiled Ash agent manifest. ${Ki(n.error)}`,t);return n.data}function ha(e){return e instanceof Error?e.message:`Unknown manifest load failure.`}const ga=`bundled compiled module map`;var _a=class extends Error{moduleMapPath;constructor(e,t){super(e),this.name=`LoadCompiledModuleMapError`,t!==void 0&&(this.moduleMapPath=t)}};async function va(e){let t=e.compiledArtifactsSource.kind===`disk`?B(e.compiledArtifactsSource.appRoot).moduleMapPath:void 0;if(t!==void 0){let e=xa(t);try{let n=await import(e);return ya(n.moduleMap??n.default,t)}catch(e){throw new _a(ba(e),t)}}let n=$i();if(n!==null)return ya(n.moduleMap,ga);throw new _a(`Compiled module map is unavailable without an app root or bundled compiled artifacts.`,ga)}function ya(e,t){let n=yn.safeParse(e);if(!n.success)throw new _a(`Expected "${t}" to export a valid compiled Ash module map. ${Ki(n.error)}`,t);return n.data}function ba(e){return e instanceof Error?e.message:`Unknown module-map load failure.`}function xa(e){let t=e.replaceAll(`\\`,`/`);return/^[A-Za-z]:\//.test(t)?`file:///${encodeURI(t)}`:t.startsWith(`/`)?`file://${encodeURI(t)}`:t}const H=`/workspace`;function Sa(e){return e.length===0?null:[`Available skills`,`Listed skills are available in this run. Do not claim a listed skill is inaccessible unless activation or workspace inspection actually fails.`,`If the user names a skill or the request clearly matches one of the descriptions below, call load_skill before proceeding.`,`If multiple skills match, activate the minimal set that covers the task. After activation, follow the returned instructions instead of improvising around them.`,`If activation fails, say so briefly and continue with the best fallback. Packaged sibling files under a skill path can be inspected with bash or read_file when needed.`,...e.map(e=>Ca(e))].join(`
6
- `)}function Ca(e){return`- ${e.name}: ${e.description} (path: ${H}/skills/${e.name}/SKILL.md)`}function wa(e){if(e.rootEntries.length!==0)return[`Workspace`,`- You have access to authored files mounted at the workspace root for this run.`,`- The live workspace root visible to \`bash\` in this run is \`${H}\`.`,`- Root entries under ${H}/:`,...e.rootEntries.map(e=>` - ${e}`),`- Treat \`${H}\` as the workspace root for this run unless a \`bash\` call shows otherwise.`,"- For questions about workspace paths or file availability, verify with `bash` first using commands like `pwd`, `ls`, and `find`.","- Use the `bash` tool with `ls`, `find`, and `rg` to inspect deeper contents when needed.",`- Do not claim these files are unavailable unless a workspace or tool call actually fails.`].join(`
7
- `)}function Ta(e){return e instanceof Error&&e.name===`ConnectionAuthorizationRequiredError`}function Ea(e){return e instanceof Error&&e.name===`ConnectionAuthorizationFailedError`}function Da(e){return e?.startAuthorization!==void 0}const Oa=Object.freeze({__ashPlaceholder:`connection-authorization`}),ka=new L(`ash.pendingConnectionToolCalls`);function Aa(e,t){if(t.length===0)return e??[];let n=new Set,r=e??[];for(let e of r)n.add(e.toolCallId);let i=[...r];for(let e of t)n.has(e.toolCallId)||(n.add(e.toolCallId),i.push(e));return i}function ja(e,t){return`${e}__${t}`}const Ma=pi(`framework.connection-search`),Na=new L(`ash.connectionRegistry`),Pa=new L(`ash.discoveredConnectionTools`),Fa={description:`Search for tools across your connections. Discovered tools become directly callable by their qualified name (e.g. linear__list_issues) in your next response.`,execute:async(e,t)=>{let n=typeof t==`object`&&t&&`toolCallId`in t?t.toolCallId:void 0;return Ia(e,{toolCallId:typeof n==`string`?n:void 0})},inputSchema:{additionalProperties:!1,properties:{connection:{description:`Optional: limit search to a specific connection name.`,type:`string`},limit:{description:`Max results to return. Default 10.`,type:`number`},keywords:{description:`Search keywords and expanded aliases. Distill intent into keywords; avoid stop words like 'a', 'the', 'in'.`,type:`string`}},required:[`keywords`],type:`object`},logicalPath:`ash:framework/connection-search`,name:`connection_search`,onCompact({ctx:e}){return e.set(Pa,{byConnection:{}}),e.set(ka,[]),{}},sourceId:`ash:connection-search-tool`,sourceKind:`module`};async function Ia(e,t){let n=R(),r=n.get(Na);if(r===void 0)return[];let i=e.limit??10,a=La(e.keywords),o=[],s=[],c=e.connection!==void 0&&e.connection!==``?r.getConnections().filter(t=>t.connectionName===e.connection):r.getConnections(),l={...n.get(Pa)?.byConnection},u=[];for(let e of c){let t;try{t=await r.getClient(e.connectionName).getToolMetadata()}catch(t){if(Ta(t)){u.push(e.connectionName),s.push({connection:e.connectionName,description:e.description,needsAuthorization:!0});continue}if(Ea(t)){Ma.warn(`connection authorization failed`,{connection:e.connectionName,reason:t.reason,retryable:t.retryable,error:t}),s.push({connection:e.connectionName,description:e.description,error:`Authorization failed for ${e.connectionName}: ${t.message}`});continue}let n=t instanceof Error?t.message:`unknown error`;Ma.warn(`failed to load connection tools`,{connection:e.connectionName,error:t instanceof Error?t:Error(n)}),s.push({connection:e.connectionName,description:e.description,error:`Failed to load tools for "${e.connectionName}": ${n}`});continue}l[e.connectionName]=t;for(let n of t){let t=Ra(a,n);t>0&&o.push({item:{connection:e.connectionName,description:n.description,inputSchema:n.inputSchema,qualifiedName:ja(e.connectionName,n.name),tool:n.name},score:t})}}n.set(Pa,{byConnection:l});let d=u.filter(e=>za(r,e));if(d.length>0&&t?.toolCallId!==void 0){let r=n.get(ka);return n.set(ka,Aa(r,[{args:e,connectionNames:d,kind:`connection-discover`,toolCallId:t.toolCallId,toolName:`connection_search`}])),Oa}o.sort((e,t)=>t.score-e.score);let f=o.slice(0,i).map(e=>e.item);return f.length>0?[...f,...s]:c.map(e=>s.find(t=>t.connection===e.connectionName)||{connection:e.connectionName,description:e.description})}function La(e){return e.toLowerCase().split(/[\s_\-./]+/).filter(e=>e.length>1)}function Ra(e,t){let n=La(t.name),r=La(t.description),i=0;for(let t of e){for(let e of n)(e.includes(t)||t.includes(e))&&(i+=3);for(let e of r)(e.includes(t)||t.includes(e))&&(i+=1)}return i}function za(e,t){return e===void 0?!1:Da(e.getConnections().find(e=>e.connectionName===t)?.authorization)}const Ba=Fa.name;function Va(e){return[`## Connections`,``,`You have direct access to the following external services through connected MCP servers.`,`When the user's request relates to any of these services, use them instead of web search or general knowledge.`,``,`Available connections:`,...e.map(e=>`- ${e.connectionName}: ${e.description}`),``,`Use ${Ba} to discover specific tools within a connection. Discovered tools become directly callable by their qualified name (e.g. linear__list_issues) in your next response.`].join(`
8
- `)}function Ha(e){return[...Ua(e.instructions),...Wa(e.workspaceSpec),...e.toolsAvailable?[`Tool execution
9
- A single tool or subagent call runs as one serial action. If you call multiple independent tools or subagents in one response, Ash treats that batch as parallel work. Only batch work that is independent and does not rely on another call in the same response.`]:[],...Ga(e.connections),...Ka(e.skills)]}function Ua(e){if(e===void 0)return[];let t=e.markdown.trim();return t.length===0?[]:[`Instructions (${e.name})\n${t}`]}function Wa(e){if(e===void 0)return[];let t=wa(e);return t===void 0?[]:[t]}function Ga(e){return!e||e.length===0?[]:[Va(e)]}function Ka(e){if(!e||e.length===0)return[];let t=Sa(e);return t===null?[]:[t]}function qa(e){let t=e.agent,n=Ja(t);return{id:t.config.name,instructions:Ha({connections:t.connections,instructions:t.instructions,skills:t.skills,toolsAvailable:e.tools.length>0,workspaceSpec:t.workspaceSpec}),compactionModel:t.config.compaction?.model,model:t.config.model,nodeId:e.nodeId,turnMetadata:n,tools:[...e.tools],workspaceSpec:t.workspaceSpec}}function Ja(e){let t={};return Object.keys(e.config.metadata).length>0&&(t.configMetadata={...e.config.metadata}),e.instructions!==void 0&&(t.instructionsName=e.instructions.name),e.skills.length>0&&(t.skillNames=e.skills.map(e=>e.name)),Object.keys(t).length>0?t:void 0}const Ya=new Set([`aud`,`exp`,`iat`,`iss`,`jti`,`nbf`,`sub`]);function Xa(e){let t={};for(let[n,r]of Object.entries(e)){if(typeof r==`string`){t[n]=r;continue}Array.isArray(r)&&r.every(e=>typeof e==`string`)&&(t[n]=Object.freeze([...r]))}return Object.freeze(t)}function Za(e){let t=Xa(e);return Object.freeze(Object.fromEntries(Object.entries(t).filter(([e])=>!Ya.has(e))))}function Qa(e,t){let n=Xa(e);if(t.subjects!==void 0){let n=typeof e.sub==`string`?e.sub:null;if(n===null||!t.subjects.some(e=>eo(e,n)))return!1}return t.claims===void 0?!0:Object.entries(t.claims).every(([e,t])=>{let r=n[e];return r===void 0?!1:typeof r==`string`?t.includes(r):r.some(e=>t.includes(e))})}function $a(e){let t=typeof e.payload.iss==`string`?e.payload.iss:void 0,n=typeof e.payload.sub==`string`?e.payload.sub:void 0;if(t===void 0||n===void 0)throw Error(`Expected verified JWT payloads to include string iss and sub claims.`);let r=Xa(e.payload);return{attributes:Za(e.payload),authenticator:e.authenticator,claims:r,issuer:t,principalId:`${t}:${n}`,principalType:e.principalType,subject:n}}function eo(e,t){if(!e.includes(`*`))return e===t;let n=e.replaceAll(/[.+?^${}()|[\]\\]/g,`\\$&`).replaceAll(`*`,`.*`);return RegExp(`^${n}$`).test(t)}const to=C.object({issuer:C.string().optional(),jwks_uri:C.string().url()}).passthrough(),no=new Map,ro=new Map;async function io(e){let t;try{t=await ao(e.strategy)}catch(e){return{kind:`misconfigured`,message:`Failed to load OIDC discovery metadata. ${e instanceof Error?e.message:`Unknown discovery failure.`}`}}try{let n=await Fe(e.token,t,{audience:[...e.strategy.audiences],clockTolerance:e.strategy.clockSkewSeconds,issuer:e.strategy.issuer});if(typeof n.payload.sub!=`string`||n.payload.sub.length===0)return{kind:`not-authenticated`};let r=e.strategy.acceptCurrentVercelProject&&so({issuer:e.strategy.issuer,payload:n.payload}),i=r&&co({payload:n.payload});return!r&&!Qa(n.payload,e.strategy)?{kind:`caller-not-allowed`}:{kind:`authenticated`,principal:$a({authenticator:`oidc`,payload:n.payload,principalType:i?`runtime`:`service`})}}catch{return{kind:`not-authenticated`}}}async function ao(e){let t=await oo(e.discoveryUrl),n=ro.get(t.jwks_uri);if(n!==void 0)return n;let r=Ne(new URL(t.jwks_uri));return ro.set(t.jwks_uri,r),r}async function oo(e){let t=no.get(e);if(t!==void 0)return await t;let n=fetch(e,{headers:{accept:`application/json`}}).then(async e=>{if(!e.ok)throw Error(`Discovery route returned HTTP ${e.status}.`);return to.parse(await e.json())}).catch(t=>{throw no.delete(e),t});return no.set(e,n),await n}function so(e){if(!e.issuer.startsWith(`https://oidc.vercel.com`))return!1;let t=process.env.VERCEL_PROJECT_ID?.trim();return t===void 0||t.length===0?!1:typeof e.payload.project_id==`string`&&e.payload.project_id===t}function co(e){let t=(process.env.VERCEL_TARGET_ENV?.trim()??process.env.VERCEL_ENV?.trim())?.trim();return t===void 0||t.length===0?!1:typeof e.payload.environment==`string`&&e.payload.environment===t}function lo(e){return{attributes:e.attributes,authenticator:e.authenticator,issuer:e.issuer,principalId:e.principalId,principalType:e.principalType,subject:e.subject}}const U=pi(`auth.vercel-oidc`);async function uo(e,t){return e===null||e.length===0?{kind:`not-authenticated`}:await io({strategy:{acceptCurrentVercelProject:t.acceptCurrentVercelProject,audiences:[...t.audiences],clockSkewSeconds:t.clockSkewSeconds??30,discoveryUrl:t.discoveryUrl??`${t.issuer.replace(/\/$/,``)}/.well-known/openid-configuration`,issuer:t.issuer,kind:`oidc`,...t.claims===void 0?{}:{claims:t.claims},...t.subjects===void 0?{}:{subjects:t.subjects}},token:e})}function fo(e){if(e===null)return null;let t=/^Bearer\s+(.+)$/i.exec(e)?.[1]?.trim();return t===void 0||t.length===0?null:t}function po(e={}){let t=e.status??401,n=e.code??(t===403?`forbidden`:`unauthorized`),r=e.message??(t===403?`Forbidden.`:`Authorization is required for this route.`),i=e.challenges??[],a=new Headers({"cache-control":`no-store`});for(let e of i)a.append(`www-authenticate`,mo(e));return Response.json({code:n,error:r,ok:!1},{headers:a,status:t})}function mo(e){if(e.parameters===void 0||Object.keys(e.parameters).length===0)return e.scheme;let t=Object.entries(e.parameters).map(([e,t])=>`${e}="${ho(t)}"`).join(`, `);return`${e.scheme} ${t}`}function ho(e){return e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}function go(){return()=>void 0}async function _o(e,t={}){if(e===null||e.length===0)return U.debug(`Rejected request without a bearer token.`),{ok:!1};let n=yo(e);if(n===null)return U.debug(`Rejected token that failed to decode as a JWT.`),{ok:!1};if(!n.issuer.startsWith(`https://oidc.vercel.com/`))return U.debug(`Rejected token whose issuer is not a Vercel OIDC issuer.`,{issuer:n.issuer}),{ok:!1};if(n.audiences.length===0)return U.debug(`Rejected token with no audience claim.`,{issuer:n.issuer}),{ok:!1};let r=await uo(e,{acceptCurrentVercelProject:!0,audiences:n.audiences,issuer:n.issuer,subjects:t.subjects??[]});return r.kind===`authenticated`?(U.debug(`Accepted Vercel OIDC token.`,{issuer:n.issuer,principalType:r.principal.principalType,subject:r.principal.subject}),{ok:!0,sessionAuth:lo(r.principal)}):(U.debug(`Rejected Vercel OIDC token after verification.`,{audiences:n.audiences,issuer:n.issuer,reason:r.kind,subjectsConfigured:(t.subjects??[]).length>0,...r.kind===`misconfigured`?{detail:r.message}:{}}),{ok:!1})}function vo(e={}){return async t=>{let n=await _o(fo(t.headers.get(`authorization`)),e);return n.ok?n.sessionAuth:null}}function yo(e){let t;try{t=Pe(e)}catch{return null}return typeof t.iss!=`string`||t.iss.length===0?null:{audiences:typeof t.aud==`string`?[t.aud]:Array.isArray(t.aud)?t.aud.filter(e=>typeof e==`string`):[],issuer:t.iss}}const bo=C.object({callId:C.string().min(1),subagentName:C.string().min(1),token:C.string().min(1),url:C.string().min(1)}).strict().superRefine((e,t)=>{let n;try{n=new URL(e.url)}catch{t.addIssue({code:`custom`,message:`Callback url must be absolute.`,path:[`url`]});return}So(n)!==e.token&&t.addIssue({code:`custom`,message:`Callback url token must match callback token.`,path:[`url`]})});function xo(e){let t=bo.safeParse(e);return t.success?{callback:t.data,ok:!0}:{cause:t.error,message:Co(t.error),ok:!1}}function So(e){let t=f(``);if(!e.pathname.startsWith(t))return null;let n=e.pathname.slice(t.length);if(n.length===0||n.includes(`/`))return null;try{return decodeURIComponent(n)}catch{return null}}function Co(e){return`Invalid callback metadata: ${e.issues.map(e=>`${e.path.length===0?`callback`:`callback.${e.path.join(`.`)}`}: ${e.message}`).join(`; `)}`}function wo(e){return Number.isFinite(e)&&Number.isInteger(e)&&e>=0}function To(e){if(e.protocol!==`ash-attachment:`)throw Error(`AttachmentRef URL must use scheme "ash-attachment:". Got: "${e.protocol}".`);let t=e.searchParams.get(`v`);if(t!==`1`)throw Error(`AttachmentRef wire format version must be "1". Got: ${t===null?`missing`:JSON.stringify(t)}.`);let n=e.searchParams.get(`p`);if(n===null||n===``)throw Error(`AttachmentRef URL is missing the required "p" payload query param.`);let r;try{let e=Buffer.from(n,`base64url`).toString(`utf8`);r=JSON.parse(e)}catch(e){throw Error(`AttachmentRef payload is not valid base64url-encoded JSON: ${d(e)}`)}if(typeof r!=`object`||!r||Array.isArray(r))throw Error(`AttachmentRef payload must decode to a JSON object.`);let i=r;if(!(`params`in i))throw Error(`AttachmentRef payload is missing the required "params" field.`);let a=i.params;if(!(`size`in i))return{params:a};let o=i.size;if(typeof o!=`number`||!wo(o))throw Error(`AttachmentRef payload "size" must be a non-negative integer. Got: ${JSON.stringify(o)}.`);return{params:a,size:o}}function Eo(e){return e instanceof URL&&e.protocol===`ash-attachment:`}function Do(e){return typeof Buffer<`u`&&Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer?e.byteLength:typeof e==`string`?Oo(e):Eo(e)?To(e).size??null:e instanceof URL&&e.protocol===`data:`?Oo(e.href):null}function Oo(e){if(e.startsWith(`data:`)){let t=e.indexOf(`,`);if(t===-1)return null;let n=e.slice(5,t),r=e.slice(t+1);if(n.endsWith(`;base64`))return ko(r);try{return Buffer.byteLength(decodeURIComponent(r),`utf8`)}catch{return Buffer.byteLength(r,`utf8`)}}return/^https?:\/\//.test(e)?null:ko(e)}function ko(e){let t=e.trimEnd();if(t.length===0)return 0;let n=0;return t.endsWith(`==`)?n=2:t.endsWith(`=`)&&(n=1),Math.max(0,Math.floor(t.length*3/4)-n)}const Ao=Object.freeze({allowedMediaTypes:`*`,maxBytes:25*1024*1024});function jo(e,t=Ao){if(e===`disabled`)return`disabled`;if(e===void 0)return t;let n=e.maxBytes??t.maxBytes,r=e.allowedMediaTypes??t.allowedMediaTypes;if(n<0||!Number.isFinite(n))throw RangeError(`UploadPolicy.maxBytes must be a non-negative finite number. Received: ${String(n)}.`);return{allowedMediaTypes:r,maxBytes:n}}function Mo(e,t){if(t===`disabled`)return!1;if(t.allowedMediaTypes===`*`)return!0;let n=e.toLowerCase();for(let e of t.allowedMediaTypes){let t=e.toLowerCase();if(t===n)return!0;if(t.endsWith(`/*`)){let e=t.slice(0,-1);if(n.startsWith(e))return!0}}return!1}function No(e,t){if(t===`disabled`||!Mo(e.mediaType,t)){let n={allowedMediaTypes:t===`disabled`||t.allowedMediaTypes===`*`?[]:[...t.allowedMediaTypes],kind:`disallowed-media-type`,mediaType:e.mediaType};return e.filename===void 0?n:{...n,filename:e.filename}}let n=Do(e.data);if(n!==null&&n>t.maxBytes){let r={byteLength:n,kind:`too-large`,limit:t.maxBytes,mediaType:e.mediaType};return e.filename===void 0?r:{...r,filename:e.filename}}return null}function Po(e,t){if(typeof e==`string`)return[];let n=[];for(let r of e){if(r.type!==`file`)continue;let e=No(r,t);e!==null&&n.push(e)}return n}function Fo(e){let t=e.filename??e.mediaType;if(e.kind===`too-large`)return`${t} (${e.byteLength} bytes) exceeds the ${e.limit}-byte upload limit.`;let n=e.allowedMediaTypes.length>0?` Allowed: ${e.allowedMediaTypes.join(`, `)}.`:``;return`${t} has media type "${e.mediaType}" which is not allowed by this route.${n}`}function Io(e,t){return{method:`GET`,path:e,handler:t}}function Lo(e,t){return{method:`POST`,path:e,handler:t}}function Ro(e){let t=zo(e);return{__kind:`ash:channel`,routes:e.routes,adapter:t,receive:e.receive}}function zo(e){let t=e.state!=null,n=e.context!=null,r=e.fetchFile!==void 0,i=t||n,a={},o=!1,s=[`turn.started`,`actions.requested`,`action.result`,`message.completed`,`message.appended`,`input.requested`,`turn.failed`,`turn.completed`,`session.failed`,`session.completed`,`session.waiting`,`connection.authorization_required`,`connection.authorization_pending`,`connection.authorization_completed`],c=e.events;for(let e of s){let t=c?.[e];t&&(o=!0,a[e]=(e,n)=>t(e,n))}return!i&&!o&&!r?{kind:e.kindHint??`http`}:{kind:e.kindHint??`defineChannel`,state:t?{...e.state}:{},fetchFile:e.fetchFile,createAdapterContext(t){let r=t.state,i=t.session;return{...n?e.context(r,i):{},state:r,ctx:t.ctx,session:i}},deliver(e){return wi(e)},...a}}function Bo(e){let t=jo(e.uploadPolicy);return Ro({routes:[Lo(`/ash/v1/session`,async(n,{send:r})=>{let i=await Vo(e.auth,n);if(i instanceof Response)return i;let a=i,o;try{o=await n.json()}catch{return Response.json({error:`Invalid JSON body.`,ok:!1},{status:400})}if(typeof o!=`object`||!o)return Response.json({error:`Expected a JSON object.`,ok:!1},{status:400});let s=Ho(o);if(s instanceof Response)return s;let c=Yo(s,t);if(c!==null)return c;let l=`ash:${crypto.randomUUID()}`,u=await r(Wo(s),{auth:a,callback:s.callback,continuationToken:l,mode:s.mode});return Response.json({continuationToken:u.continuationToken,ok:!0,sessionId:u.id},{headers:{"cache-control":`no-store`,[p]:u.id},status:202})}),Lo(`/ash/v1/session/:sessionId`,async(n,{send:r,getSession:i,params:a})=>{let o=await Vo(e.auth,n);if(o instanceof Response)return o;let s=o,c=a.sessionId;if(!c)return Response.json({error:`Missing session id.`,ok:!1},{status:400});try{i(c)}catch{return Response.json({error:`Session not found.`,ok:!1},{status:404})}let l;try{l=await n.json()}catch{return Response.json({error:`Invalid JSON body.`,ok:!1},{status:400})}if(typeof l!=`object`||!l)return Response.json({error:`Expected a JSON object.`,ok:!1},{status:400});let u=Uo(l);if(u instanceof Response)return u;let d=Yo(u,t);if(d!==null)return d;let f=await r({inputResponses:u.inputResponses,message:u.message,modelContext:u.modelContext},{auth:s,continuationToken:u.continuationToken});return Response.json({ok:!0,sessionId:f.id},{headers:{"cache-control":`no-store`,[p]:f.id},status:200})}),Io(`/ash/v1/session/:sessionId/stream`,async(t,{getSession:n,params:r})=>{let i=await Vo(e.auth,t);if(i instanceof Response)return i;let a=r.sessionId;if(!a)return Response.json({error:`Missing session id.`,ok:!1},{status:400});let o=$o(t);if(o instanceof Response)return o;try{let e=es(await n(a).getEventStream({startIndex:o}));return new Response(e,{headers:{"cache-control":`no-store`,"content-type":ne,[p]:a,[te]:g,[re]:`14`}})}catch{return Response.json({error:`Session not found.`,ok:!1},{status:404})}})]})}async function Vo(e,t){let n=await e(t);return n===null?po({challenges:[{scheme:`Bearer`}]}):n??null}function Ho(e){let t=qo(e.message);if(t instanceof Response)return t;let n=Zo(e.clientContext);if(n instanceof Response)return n;let r=Go(e.callback);if(r instanceof Response)return r;let i=Ko(e.mode);return i instanceof Response?i:t===void 0?Response.json({error:`Missing or empty 'message' field.`,ok:!1},{status:400}):{callback:r,message:t,mode:i,modelContext:n}}function Uo(e){let t=typeof e.continuationToken==`string`&&e.continuationToken.length>0?e.continuationToken:void 0;if(t===void 0)return Response.json({error:`Missing or empty 'continuationToken' field.`,ok:!1},{status:400});let n=qo(e.message);if(n instanceof Response)return n;let r=Xo(e.inputResponses);if(r instanceof Response)return r;let i=Zo(e.clientContext);return i instanceof Response?i:n===void 0&&r===void 0?Response.json({error:`Expected a non-empty 'message', a non-empty 'inputResponses' array, or both.`,ok:!1},{status:400}):{message:n,continuationToken:t,inputResponses:r,modelContext:i}}function Wo(e){return e.modelContext===void 0?e.message:{message:e.message,modelContext:e.modelContext}}function Go(e){if(e===void 0)return;let t=xo(e);return t.ok?t.callback:Response.json({error:t.message,ok:!1},{status:400})}function Ko(e){if(e!==void 0)return e===`conversation`||e===`task`?e:Response.json({error:`Expected 'mode' to be either 'conversation' or 'task'.`,ok:!1},{status:400})}function qo(e){if(e===void 0)return;if(typeof e==`string`)return e.length>0?e:void 0;if(!Array.isArray(e))return Response.json({error:`Expected 'message' to be a string or an array of text/file parts.`,ok:!1},{status:400});if(e.length===0)return;let t=[];for(let n of e){let e=Jo(n);if(e instanceof Response)return e;t.push(e)}return t}function Jo(e){if(typeof e!=`object`||!e)return Response.json({error:`Expected each message part to be an object.`,ok:!1},{status:400});let t=e;if(t.type===`text`)return typeof t.text!=`string`||t.text.length===0?Response.json({error:`Text parts require a non-empty 'text' string.`,ok:!1},{status:400}):{type:`text`,text:t.text};if(t.type===`file`){if(typeof t.mediaType!=`string`||t.mediaType.length===0)return Response.json({error:`File parts require a non-empty 'mediaType' string.`,ok:!1},{status:400});if(typeof t.data!=`string`)return Response.json({error:`File parts require a 'data' string (base64, data URL, or URL).`,ok:!1},{status:400});let e={type:`file`,mediaType:t.mediaType,data:t.data};return typeof t.filename==`string`&&t.filename.length>0&&(e.filename=t.filename),e}return Response.json({error:`Unsupported message part type "${String(t.type)}". Use 'text' or 'file'.`,ok:!1},{status:400})}function Yo(e,t){if(!e.message)return null;let n=Po(e.message,t);if(n.length===0)return null;let[r]=n;if(!r)return null;let i=r.kind===`too-large`?413:415;return Response.json({error:Fo(r),ok:!1,violations:n.map(e=>e.kind===`too-large`?{byteLength:e.byteLength,filename:e.filename,kind:e.kind,limit:e.limit,mediaType:e.mediaType}:{allowedMediaTypes:e.allowedMediaTypes,filename:e.filename,kind:e.kind,mediaType:e.mediaType})},{status:i})}function Xo(e){if(e===void 0)return;if(!Array.isArray(e)||e.length===0)return Response.json({error:`Expected 'inputResponses' to be a non-empty array.`,ok:!1},{status:400});let t=e.filter(ee);return t.length===e.length?t:Response.json({error:`Expected every 'inputResponses' entry to match the HITL response schema.`,ok:!1},{status:400})}function Zo(e){if(e!==void 0){if(typeof e==`string`)return e.length>0?[Qo(e)]:void 0;if(Array.isArray(e))return e.length===0?void 0:e.every(e=>typeof e==`string`&&e.length>0)?e.map(e=>Qo(e)):Response.json({error:`Expected 'clientContext' array entries to be non-empty strings.`,ok:!1},{status:400});if(typeof e!=`object`||!e)return Response.json({error:`Expected 'clientContext' to be a string, string array, or JSON object.`,ok:!1},{status:400});try{let t=oe(e);return[Qo(JSON.stringify(t))]}catch{return Response.json({error:`Expected 'clientContext' to be a JSON-serializable object.`,ok:!1},{status:400})}}}function Qo(e){return{role:`user`,content:`Ephemeral client context:
10
- ${e}`}}function $o(e){let t=new URL(e.url).searchParams.get(`startIndex`);if(t===null)return;let n=Number.parseInt(t,10);return!Number.isSafeInteger(n)||n<0?Response.json({error:`Expected startIndex to be a non-negative integer.`,ok:!1},{status:400}):n}function es(e){let t=new TextEncoder;return e.pipeThrough(new TransformStream({transform(e,n){n.enqueue(t.encode(`${JSON.stringify(e)}\n`))}}))}function ts(){return new Response(`<!doctype html>
11
- <html lang="en">
12
- <head>
13
- <meta charset="utf-8" />
14
- <meta name="viewport" content="width=device-width, initial-scale=1" />
15
- <title>Authorization complete</title>
16
- <style>
17
- :root {
18
- color-scheme: light dark;
19
- --bg: #fafafa;
20
- --fg: #111111;
21
- --muted: #525252;
22
- --card-bg: #ffffff;
23
- --card-border: #e5e5e5;
24
- }
25
- @media (prefers-color-scheme: dark) {
26
- :root {
27
- --bg: #0a0a0a;
28
- --fg: #fafafa;
29
- --muted: #a3a3a3;
30
- --card-bg: #171717;
31
- --card-border: #262626;
32
- }
33
- }
34
- body {
35
- margin: 0;
36
- min-height: 100vh;
37
- display: grid;
38
- place-items: center;
39
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
40
- background: var(--bg);
41
- color: var(--fg);
42
- }
43
- .card {
44
- max-width: 28rem;
45
- padding: 2rem 2.25rem;
46
- border: 1px solid var(--card-border);
47
- border-radius: 12px;
48
- background: var(--card-bg);
49
- color: var(--fg);
50
- text-align: center;
51
- }
52
- h1 { font-size: 1.25rem; margin: 0 0 0.5rem; color: var(--fg); }
53
- p { margin: 0; color: var(--muted); line-height: 1.5; }
54
- </style>
55
- </head>
56
- <body>
57
- <main class="card">
58
- <h1>Authorization complete</h1>
59
- <p>You can close this tab and return to your app.</p>
60
- </main>
61
- </body>
62
- </html>`,{headers:{"cache-control":`no-store`,"content-type":`text/html; charset=utf-8`},status:200})}const ns=[`GET`,`POST`];function rs(){return ns.map(e=>as(e))}function is(){return new Set(ns.map(os))}function as(e){let t=os(e);return{name:t,method:e,urlPath:ae,fetch:ss,logicalPath:`framework://channels/${t}`,sourceId:`ash:framework:connection-callback-${e.toLowerCase()}`,sourceKind:`module`}}function os(e){return`ash/v1/connections/callback/${e.toLowerCase()}`}async function ss(e,t){let n=t.params.name,r=t.params.token;if(typeof n!=`string`||n.length===0)return Response.json({error:`Missing connection name.`,ok:!1},{status:400});if(typeof r!=`string`||r.length===0)return Response.json({error:`Missing callback token.`,ok:!1},{status:400});let i=await cs(e);try{await Ee(r,i)}catch{return Response.json({error:`Connection callback not pending.`,ok:!1},{status:404})}return ts()}async function cs(e){let t={};e.headers.forEach((e,n)=>{t[n]=e});let n=``;if(e.method!==`GET`&&e.method!==`HEAD`)try{n=await e.text()}catch{n=``}return{body:n,headers:t,method:e.method,url:e.url}}const ls=[`POST`];function us(){return ls.map(e=>fs(e))}function ds(){return new Set(ls.map(ps))}function fs(e){let t=ps(e);return{name:t,method:e,urlPath:_,fetch:ms,logicalPath:`framework://channels/${t}`,sourceId:`ash:framework:session-callback-${e.toLowerCase()}`,sourceKind:`module`}}function ps(e){return`ash/v1/callback/${e.toLowerCase()}`}async function ms(e,t){let n=t.params.token;if(typeof n!=`string`||n.length===0)return Response.json({error:`Missing callback token.`,ok:!1},{status:400});let r;try{r=await e.json()}catch{return Response.json({error:`Invalid JSON body.`,ok:!1},{status:400})}let i=hs(r);if(i instanceof Response)return i;try{await Ee(n,{kind:`runtime-action-result`,results:[i]})}catch{return Response.json({error:`Session callback not pending.`,ok:!1},{status:404})}return Response.json({ok:!0},{status:202})}function hs(e){if(typeof e!=`object`||!e)return Response.json({error:`Expected a JSON object.`,ok:!1},{status:400});let t=e;return typeof t.callId!=`string`||t.callId.length===0?Response.json({error:`Missing callback callId.`,ok:!1},{status:400}):typeof t.subagentName!=`string`||t.subagentName.length===0?Response.json({error:`Missing callback subagentName.`,ok:!1},{status:400}):t.kind===`session.completed`?{callId:t.callId,kind:`subagent-result`,output:typeof t.output==`string`?t.output:``,subagentName:t.subagentName}:t.kind===`session.failed`?{callId:t.callId,isError:!0,kind:`subagent-result`,output:t.error===void 0?{code:`REMOTE_AGENT_FAILED`,message:`Remote agent failed.`}:t.error,subagentName:t.subagentName}:Response.json({error:`Unsupported callback kind.`,ok:!1},{status:400})}function gs(){let e=Bo({auth:vs()}),t=[];for(let n of e.routes)t.push({name:`ash`,method:n.method.toUpperCase(),urlPath:n.path,fetch:async(e,t)=>n.handler(e,t),handler:n.handler,adapter:e.adapter,logicalPath:`framework://channels/${n.path}`,sourceId:`ash:framework:${n.method.toLowerCase()}-${n.path}`,sourceKind:`module`});return t.push(...rs(),...us()),t}function _s(){return new Set([`ash`,...is(),...ds()])}function vs(){return process.env.VERCEL?vo():go()}const ys=ie.omit({action:!0,display:!0,requestId:!0}),{$schema:bs,...xs}=C.toJSONSchema(ys),Ss={description:`Ask the user a question and wait for their response before continuing. Use this when you need clarification or a choice from the user.`,inputSchema:xs,logicalPath:`ash:framework/ask-question`,name:`ask_question`,sourceId:`ash:ask-question-tool`,sourceKind:`module`};async function W(){let e=R().get(gu);if(e===void 0)throw Error(`This tool requires sandbox access on the runtime context. Ensure the step is running inside a managed runtime context with sandbox support.`);let t=await e.get();if(t===null)throw Error(`The sandbox is not available in the current runtime context.`);return t}function Cs(e){if(!e.startsWith(`/`))throw Error(`filePath must be an absolute path. Received: "${e}". Use an absolute path such as /workspace/foo.ts.`)}function ws(e){return Es(e,`head`)}function Ts(e){return Es(e,`tail`)}function Es(e,t){let n=e.split(`
63
- `),r=Os(n),i=t===`head`,a=[],o=0,s=i?0:n.length-1,c=i?1:-1;for(let e=s;e>=0&&e<n.length&&a.length<2e3;e+=c){let t=Ds(n[e]??``),r=Buffer.byteLength(t,`utf8`)+1;if(o+r>51200&&a.length>0)break;a.push(t),o+=r}return i||a.reverse(),{output:a.join(`
64
- `),outputLines:a.length,totalLines:r,truncated:a.length<r}}function Ds(e){return e.length<=2e3?e:e.slice(0,2e3)+` [truncated]`}function Os(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}async function ks(e){let t=await(await W()).runCommand({command:e.command}),n=Ts(t.stdout),r=Ts(t.stderr),i=n.truncated||r.truncated,a=n.output;n.truncated&&(a=`[stdout truncated: showing last ${n.outputLines} of ${n.totalLines} lines]\n`+a);let o=r.output;return r.truncated&&(o=`[stderr truncated: showing last ${r.outputLines} of ${r.totalLines} lines]\n`+o),{exitCode:t.exitCode,stderr:o,stdout:a,truncated:i}}const As={additionalProperties:!1,properties:{command:{description:`The shell command to execute.`,type:`string`}},required:[`command`],type:`object`};async function js(e){return ks(e)}const Ms={description:`Execute a shell command in the shared workspace environment.`,execute:js,inputSchema:As,logicalPath:`ash:framework/bash`,name:`bash`,sourceId:`ash:bash-tool`,sourceKind:`module`},Ns=new L(`ash.readFile`);function G(e){return ue.normalize(e)}function Ps(e){return e}function Fs(e){let t=_e(`sha256`).update(e.content,`utf8`).digest(`hex`);return{byteLength:Buffer.byteLength(e.content,`utf8`),contentHash:t,filePath:e.filePath}}function Is(e,t,n){let r=e.ensure(Ns,()=>({byTarget:{}}));e.set(Ns,{byTarget:{...r.byTarget,[t]:n}})}function Ls(e){e.set(Ns,{byTarget:{}})}const Rs=new Map;async function zs(e){let t=Rs.get(e.id);if(t!==void 0)return t;let n=Bs(e);Rs.set(e.id,n);try{return await n}catch{return Rs.delete(e.id),!1}}async function Bs(e){return(await e.runCommand({command:`command -v rg >/dev/null 2>&1`})).exitCode===0}function K(e){return`'${e.replace(/'/g,`'\\''`)}'`}async function Vs(e){let t=e.path??`/workspace`;Cs(t);let n=G(t),r=Math.min(Math.max(1,e.limit??100),1e3),i=await W(),a=await zs(i)?Hs({normalizedPath:n,pattern:e.pattern}):Us({normalizedPath:n,pattern:e.pattern}),o=await i.runCommand({command:a});if(o.exitCode!==0&&o.exitCode!==1)throw Gs(a,o.exitCode,o.stderr);let s=o.stdout.split(`
65
- `).filter(e=>e.length>0),c=s.length>r,l=c?s.slice(0,r):s,u=[],d=0,f=!1;for(let e of l){let t=G(e),n=Buffer.byteLength(t,`utf8`)+1;if(d+n>51200&&u.length>0){f=!0;break}u.push(t),d+=n}if(u.length===0)return{content:`No files found`,count:0,path:n,truncated:!1};let p=c||f,m=[...u];return p&&(m.push(``),m.push(`(Results truncated: showing first ${u.length} results out of more. Use a more specific path or pattern to narrow results.)`)),{content:m.join(`
66
- `),count:u.length,path:n,truncated:p}}function Hs(e){return[`rg --files --hidden`,`--glob '!.git/*'`,`--glob ${K(e.pattern)}`,`-- ${K(e.normalizedPath)}`].join(` `)}function Us(e){let t=Ws(e.pattern),n=t.includes(`/`)?`-path ${K(`*/${t}`)}`:`-name ${K(t)}`;return[`find ${K(e.normalizedPath)}`,`-type f`,`-not -path '*/.git/*'`,n].join(` `)}function Ws(e){let t=e.replaceAll(`**`,`*`);for(;t.startsWith(`*/`);)t=t.slice(2);return t}function Gs(e,t,n){let r=n.trim(),i=r.length>0?r:`no stderr output`;return Error(`glob failed (exit ${t}): ${i}\nCommand: ${e}`)}const Ks={additionalProperties:!1,properties:{limit:{description:`Maximum number of results to return. Defaults to 100.`,maximum:1e3,minimum:1,type:`integer`},path:{description:`The directory to search in. Defaults to /workspace. Must be an absolute path. Omit to use the default.`,type:`string`},pattern:{description:`The glob pattern to match files against (e.g. "**/*.ts", "src/**/*.js").`,type:`string`}},required:[`pattern`],type:`object`};async function qs(e){return Vs(e)}const Js={description:[`Fast file pattern matching tool that works with any codebase size.`,``,`Usage:`,`- Supports glob patterns like "**/*.js" or "src/**/*.ts".`,`- Returns matching file paths.`,`- Use this tool when you need to find files by name patterns.`,`- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.`,`- Use the grep tool instead if you need to search file contents.`,`- Call this tool in parallel when you know there are multiple patterns to search for.`].join(`
67
- `),execute:qs,inputSchema:Ks,logicalPath:`ash:framework/glob`,name:`glob`,sourceId:`ash:glob-tool`,sourceKind:`module`};async function Ys(e){let t=e.path??`/workspace`;Cs(t);let n=G(t),r=Math.min(Math.max(1,e.limit??100),1e3),i=e.context!==void 0&&e.context>0?e.context:0,a=await W(),o=await zs(a)?Xs({contextLines:i,effectiveLimit:r,glob:e.glob,ignoreCase:e.ignoreCase??!1,literal:e.literal??!1,normalizedPath:n,pattern:e.pattern}):Zs({contextLines:i,effectiveLimit:r,glob:e.glob,ignoreCase:e.ignoreCase??!1,literal:e.literal??!1,normalizedPath:n,pattern:e.pattern}),s=await a.runCommand({command:o});if(s.exitCode!==0&&s.exitCode!==1)throw $s(o,s.exitCode,s.stderr);let c=s.stdout;return c.trim().length===0?{content:`No matches found`,matchCount:0,path:n,truncated:!1}:Qs({effectiveLimit:r,normalizedPath:n,stdout:c})}function Xs(e){let t=[`rg`,`--line-number`,`--color=never`,`--hidden`,`--glob '!.git/*'`];return e.ignoreCase&&t.push(`--ignore-case`),e.literal&&t.push(`--fixed-strings`),e.glob!==void 0&&t.push(`--glob ${K(e.glob)}`),e.contextLines>0&&t.push(`--context ${e.contextLines}`),t.push(`--max-count ${e.effectiveLimit}`),t.push(`--`),t.push(K(e.pattern)),t.push(K(e.normalizedPath)),t.join(` `)}function Zs(e){let t=[`grep`,`-r`,`-n`,`--color=never`,`--exclude-dir=.git`];return e.ignoreCase&&t.push(`-i`),e.literal?t.push(`-F`):t.push(`-E`),e.glob!==void 0&&t.push(`--include=${K(e.glob)}`),e.contextLines>0&&t.push(`-C ${e.contextLines}`),t.push(`-m ${e.effectiveLimit}`),t.push(`--`),t.push(K(e.pattern)),t.push(K(e.normalizedPath)),t.join(` `)}function Qs(e){let t=e.stdout.split(`
68
- `),n=[],r=0,i=0,a=!1;for(let e of t){if(e.length===0&&t.indexOf(e)===t.length-1)continue;e!==`--`&&e.length>0&&/^.+:\d+:/.test(e)&&i++;let o=Ds(e),s=Buffer.byteLength(o,`utf8`)+1;if(r+s>51200&&n.length>0){a=!0;break}n.push(o),r+=s}let o=a||i>=e.effectiveLimit,s=n.join(`
69
- `);if(o){let t=[];i>=e.effectiveLimit&&t.push(`Match limit reached (${e.effectiveLimit}). Use a larger limit or more specific pattern.`),a&&t.push(`Output truncated due to size. Use a more specific path or pattern.`),s+=`\n\n[${t.join(` `)}]`}return{content:s,matchCount:i,path:e.normalizedPath,truncated:o}}function $s(e,t,n){let r=n.trim(),i=r.length>0?r:`no stderr output`;return Error(`grep failed (exit ${t}): ${i}\nCommand: ${e}`)}const ec={additionalProperties:!1,properties:{context:{description:`Number of surrounding context lines to include before and after each match. Defaults to 0.`,minimum:0,type:`integer`},glob:{description:`Filter files by glob pattern (e.g. "*.ts", "*.{ts,tsx}").`,type:`string`},ignoreCase:{description:`Perform case-insensitive search. Defaults to false.`,type:`boolean`},limit:{description:`Maximum number of matches to return per file. Defaults to 100.`,maximum:1e3,minimum:1,type:`integer`},literal:{description:`Treat the pattern as a literal string instead of a regular expression. Defaults to false.`,type:`boolean`},path:{description:`The directory or file to search in. Defaults to /workspace. Must be an absolute path. Omit to use the default.`,type:`string`},pattern:{description:`The regex pattern to search for in file contents (e.g. "log.*Error", "function\\s+\\w+").`,type:`string`}},required:[`pattern`],type:`object`};async function tc(e){return Ys(e)}const nc={description:[`Fast content search tool that works with any codebase size.`,``,`Usage:`,`- Searches file contents using regular expressions.`,`- Supports full regex syntax (e.g. "log.*Error", "function\\s+\\w+").`,`- Filter files by pattern with the glob parameter (e.g. "*.js", "*.{ts,tsx}").`,`- Returns matching lines with file paths and line numbers.`,`- Use this tool when you need to find files containing specific patterns.`,`- Use the glob tool instead if you only need to find files by name.`,`- Call this tool in parallel when you have multiple independent searches.`,`- Any line longer than 2000 characters is truncated.`].join(`
70
- `),execute:tc,inputSchema:ec,logicalPath:`ash:framework/grep`,name:`grep`,sourceId:`ash:grep-tool`,sourceKind:`module`};async function rc(e){let{filePath:t,offset:n,limit:r}=e;Cs(t);let i=await W(),a=G(t),o=n??1,s=r??2e3;if(o<1)throw Error(`offset must be >= 1. Received: ${o}.`);let c=await i.readTextFile({path:t});if(c===null)throw Error(`File not found: ${t}. Verify the path exists and is accessible in the sandbox.`);if(c.includes(`\0`))throw Error(`File "${t}" contains NUL bytes and appears to be a binary file. read_file only supports text files.`);let l=c.split(`
71
- `),u=l.length>0&&l[l.length-1]===``?l.length-1:l.length;if(u===0){if(o>1)throw Error(`offset ${o} is past the end of the file (0 lines). Use the default offset to read an empty file.`);return{content:``,path:a,totalLines:0,truncated:!1}}if(o>u)throw Error(`offset ${o} is past the end of the file (${u} lines).`);let d=Fs({content:c,filePath:a}),f=Ps(a);Is(R(),f,d);let p=o-1,m=Math.min(p+s,u),h=l.slice(p,m),g=[],_=0,ee=!1;for(let e=0;e<h.length;e++){let t=`${o+e}: ${Ds(h[e]??``)}`,n=Buffer.byteLength(t,`utf8`)+1;if(_+n>51200&&g.length>0){ee=!0;break}g.push(t),_+=n}let te=g.join(`
72
- `),ne=o+g.length-1;return ne<u||ee?{content:te,nextOffset:ne+1,path:a,totalLines:u,truncated:!0}:{content:te,path:a,totalLines:u,truncated:!1}}const ic={additionalProperties:!1,properties:{filePath:{description:`The absolute path to the file to read.`,type:`string`},limit:{description:`Maximum number of lines to return. Defaults to 2000.`,minimum:1,type:`integer`},offset:{description:`1-based line number to start from. Defaults to 1.`,minimum:1,type:`integer`}},required:[`filePath`],type:`object`};async function ac(e){return rc(e)}const oc={description:[`Read a file from the local filesystem. If the path does not exist, an error is returned.`,``,`Usage:`,`- The filePath parameter should be an absolute path.`,`- By default, this tool returns up to 2000 lines from the start of the file.`,`- The offset parameter is the line number to start from (1-indexed).`,`- To read later sections, call this tool again with a larger offset.`,`- Use the grep tool to find specific content in large files or files with long lines.`,`- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.`,'- Contents are returned with each line prefixed by its line number as `<line>: <content>`. For example, if a file has contents "foo\\n", you will receive "1: foo\\n".',`- Any line longer than 2000 characters is truncated.`,`- Call this tool in parallel when you know there are multiple files you want to read.`,`- Avoid tiny repeated slices (30 line chunks). If you need more context, read a larger window.`].join(`
73
- `),execute:ac,inputSchema:ic,logicalPath:`ash:framework/read-file`,name:`read_file`,onCompact({ctx:e}){return Ls(e),{}},sourceId:`ash:read-file-tool`,sourceKind:`module`},sc=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/;function cc(e){if(e.length===0||e.trim()!==e||e.startsWith(`.`)||e.includes(`/`)||e.includes(`\\`)||e.includes(`..`)||/^[A-Za-z]:/.test(e))throw Error(`Expected skill id to be a non-empty safe path segment without whitespace, separators, "." prefix, or "..".`)}async function lc(e,t){cc(t);let n=await uc(e),r=dc(t,`SKILL.md`),i=await n.readTextFile({path:r});if(i===null)throw Error(`No skill named "${t}" at ${r}.`);return i.replace(sc,``)}async function uc(e){let t=await e.get();if(t===null)throw Error(`The sandbox is not available in the current authored runtime context.`);return t}function dc(e,t){return`${H}/skills/${e}/${t}`}async function fc(e){let t=R().get(gu);if(t===void 0)throw Error(`The load_skill tool requires sandbox access on the runtime context. Ensure the step is running inside a managed runtime context with sandbox support.`);let{skill:n}=e;return await lc(t,n)}const pc={description:[`Load the full instructions for one available skill by name or id.`,`Use this tool when the request clearly matches a listed skill description or when the user explicitly asks for that skill.`,`Loading adds the skill instructions to the current turn.`,`Choose the "skill" value from the Available skills block.`].join(` `),execute:e=>fc(e),inputSchema:{additionalProperties:!1,properties:{skill:{description:`Available skill name or id.`,type:`string`}},required:[`skill`],type:`object`},logicalPath:`ash:framework/load-skill`,name:`load_skill`,retentionPolicy:`keep`,sourceId:`ash:load-skill-tool`,sourceKind:`module`},mc=new L(`ash.todo`);function hc(e){if(e.items.length!==0)return`[Your task list was preserved across context compaction]\n${e.items.map(e=>`- [${e.status===`completed`?`x`:e.status===`cancelled`?`-`:` `}] [${e.priority}] ${e.content}`).join(`
74
- `)}`}function gc(e){let{items:t}=e,n={cancelled:0,completed:0,in_progress:0,pending:0,total:t.length};for(let e of t)n[e.status]++;return{counts:n,todos:t}}function _c(e){let t=R(),{todos:n}=e??{};if(n!==void 0){let e={items:[...n]};return t.set(mc,e),gc(e)}return gc(t.ensure(mc,()=>({items:[]})))}const vc={description:[`Use this tool to create and manage a structured task list for the current session.`,`This helps you track progress, organize complex tasks, and demonstrate thoroughness.`,``,`When to use:`,`- Complex multistep tasks requiring 3 or more distinct steps`,`- When the user provides multiple tasks or a numbered list`,`- After receiving new instructions, to capture requirements`,`- After completing a task, to mark it complete and add follow-ups`,``,`When NOT to use:`,`- Single, straightforward tasks that need no tracking`,`- Purely conversational or informational requests`,``,`Usage:`,"- Call with `todos` to replace the entire list (full replacement write)","- Call without `todos` to read the current list",`- Both return the full current list with status counts`,`- Mark tasks in_progress when you start, completed when done`,`- Only have ONE task in_progress at a time`].join(`
75
- `),execute:async e=>_c(e??{}),inputSchema:{additionalProperties:!1,properties:{todos:{description:`The updated todo list. Omit to read the current list without modifying it.`,items:{additionalProperties:!1,properties:{content:{description:`Brief description of the task.`,type:`string`},priority:{description:`Priority level of the task.`,enum:[`high`,`medium`,`low`],type:`string`},status:{description:`Current status of the task.`,enum:[`pending`,`in_progress`,`completed`,`cancelled`],type:`string`}},required:[`content`,`status`,`priority`],type:`object`},type:`array`}},type:`object`},logicalPath:`ash:framework/todo`,name:`todo`,onCompact({ctx:e}){let t=e.get(mc);if(t===void 0||t.items.length===0)return{};let n=hc(t);return n===void 0?{}:{messages:[{content:n,role:`user`}]}},sourceId:`ash:todo-tool`,sourceKind:`module`};function yc(e){let t=new Ie({bulletListMarker:`-`,codeBlockStyle:`fenced`,emDelimiter:`*`,headingStyle:`atx`,hr:`---`});return t.remove([`script`,`style`,`meta`,`link`]),t.turndown(e)}function bc(e){let t=e;return t=t.replace(/<(script|style|noscript)\b[^>]*>[\s\S]*?<\/\1>/gi,``),t=t.replace(/<\/(p|div|br|h[1-6]|li|tr|blockquote|pre|section|article|header|footer|nav|aside|main|figure|figcaption|details|summary)>/gi,`
76
- `),t=t.replace(/<br\s*\/?>/gi,`
77
- `),t=t.replace(/<[^>]+>/g,``),t=Cc(t),t=t.split(`
78
- `).map(e=>e.replace(/[ \t]+/g,` `).trim()).join(`
79
- `).replace(/\n{3,}/g,`
80
-
81
- `).trim(),t}const xc={"&amp;":`&`,"&gt;":`>`,"&lt;":`<`,"&nbsp;":` `,"&quot;":`"`,"&#39;":`'`,"&#x27;":`'`,"&#x2F;":`/`},Sc=new RegExp(Object.keys(xc).join(`|`),`gi`);function Cc(e){return e.replace(Sc,e=>xc[e.toLowerCase()]??e)}const wc=5*1024*1024;async function Tc(e){let{url:t,format:n=`markdown`,timeout:r}=e;if(!t.startsWith(`http://`)&&!t.startsWith(`https://`))throw Error(`URL must start with http:// or https://`);let i=Math.min(r===void 0?3e4:r*1e3,12e4),a=AbortSignal.timeout(i),o=Ec(n),s=await fetch(t,{headers:o,signal:a}),c=s.status===403&&s.headers.get(`cf-mitigated`)===`challenge`?await fetch(t,{headers:{...o,"User-Agent":D},signal:a}):s;if(!c.ok)throw Error(`Request failed with status code: ${c.status}`);let l=c.headers.get(`content-length`);if(l!==null&&parseInt(l,10)>wc)throw Error(`Response too large (exceeds 5 MB limit).`);let u=await c.arrayBuffer();if(u.byteLength>wc)throw Error(`Response too large (exceeds 5 MB limit).`);let d=c.headers.get(`content-type`)??``,f=d.includes(`text/html`),p=new TextDecoder().decode(u),m;m=n===`markdown`&&f?yc(p):n===`text`&&f?bc(p):p;let{output:h,truncated:g}=ws(m);return{content:h,contentType:d,truncated:g,url:t}}function Ec(e){let t;return t=e===`markdown`?`text/markdown;q=1.0, text/x-markdown;q=0.9, text/plain;q=0.8, text/html;q=0.7, */*;q=0.1`:e===`text`?`text/plain;q=1.0, text/markdown;q=0.9, text/html;q=0.8, */*;q=0.1`:`text/html;q=1.0, application/xhtml+xml;q=0.9, text/plain;q=0.8, text/markdown;q=0.7, */*;q=0.1`,{Accept:t,"Accept-Language":`en-US,en;q=0.9`,"User-Agent":`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36`}}async function Dc(e){return Tc(e)}const Oc={description:[`Fetch a webpage and return its content in the requested format. Use this to retrieve and analyze content from URLs.`,``,`Usage notes:`,`- The URL must be a fully-formed valid URL starting with http:// or https://`,`- HTML responses are automatically converted to markdown or plain text based on the requested format`,`- Format options: "markdown" (default), "text", or "html"`,`- Default timeout is 30 seconds (max 120 seconds)`,`- Maximum response size is 5 MB; content is further capped at the shared tool-output budget (50 KB / 2000 lines)`,`- This tool is read-only and does not modify any files`].join(`
82
- `),execute:Dc,inputSchema:{additionalProperties:!1,properties:{format:{description:`The format to return the content in (text, markdown, or html). HTML responses are automatically converted to the requested format. Defaults to "markdown".`,enum:[`markdown`,`text`,`html`],type:`string`},timeout:{description:`Optional timeout in seconds. Defaults to 30, max 120.`,type:`number`},url:{description:`The fully-formed URL to fetch content from. Must start with http:// or https://.`,type:`string`}},required:[`url`],type:`object`},logicalPath:`ash:framework/web-fetch`,name:`web_fetch`,sourceId:`ash:web-fetch-tool`,sourceKind:`module`},kc={description:`Search the web for real-time information. Use this to find up-to-date information about current events, recent developments, or topics that may have changed since the knowledge cutoff.`,inputSchema:null,logicalPath:`ash:framework/web-search`,name:`web_search`,sourceId:`ash:web-search-tool`,sourceKind:`module`};async function Ac(e){let{filePath:t,content:n}=e;Cs(t);let r=await W(),i=R(),a=G(t),o=Ps(a),s=await r.readTextFile({path:t});if(s===null)return await r.writeTextFile({content:n,path:t}),Is(i,o,Fs({content:n,filePath:a})),{existed:!1,path:a};let c=i.ensure(Ns,()=>({byTarget:{}})).byTarget[o];if(c===void 0)throw Error(`You must read file ${t} before overwriting it. Use the read_file tool first.`);let l=Fs({content:s,filePath:a});if(l.contentHash!==c.contentHash||l.byteLength!==c.byteLength)throw Error(`File ${t} has been modified since it was last read. Please read the file again before modifying it.`);return await r.writeTextFile({content:n,path:t}),Is(i,o,Fs({content:n,filePath:a})),{existed:!0,path:a}}const jc={additionalProperties:!1,properties:{content:{description:`Complete replacement file contents.`,type:`string`},filePath:{description:`The absolute path to the file to write (must be absolute, not relative).`,type:`string`}},required:[`filePath`,`content`],type:`object`};async function Mc(e){return Ac(e)}const Nc=[Ss,Ms,Js,nc,oc,{description:[`Writes a file to the local filesystem.`,``,`Usage:`,`- This tool will overwrite the existing file if there is one at the provided path.`,`- If this is an existing file, you MUST use the read_file tool first to read the file's contents. This tool will fail if you did not read the file first.`,`- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.`,`- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.`,`- Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.`].join(`
83
- `),execute:Mc,inputSchema:jc,logicalPath:`ash:framework/write-file`,name:`write_file`,sourceId:`ash:write-file-tool`,sourceKind:`module`},vc,Oc,kc,pc,Fa],Pc=new Map([[Fa,e=>e.hasConnections]]);function Fc(e){return Nc.filter(t=>{let n=Pc.get(t);return n===void 0||n(e)})}function Ic(){return new Set(Nc.map(e=>e.name))}function Lc(e){let t=[],n=[],r=new Map,i=[];for(let a of e){let e=a.lifecycle.session;e!==void 0&&t.push({slug:a.slug,handler:e});let o=a.lifecycle.turn;o!==void 0&&n.push({slug:a.slug,handler:o});for(let[e,t]of Object.entries(a.events)){let n={slug:a.slug,handler:t,eventType:e};if(e===`*`)i.push(n);else{let t=r.get(e)??[];t.push(n),r.set(e,t)}}}return{session:t,turn:n,streamEventsByType:r,streamEventsWildcard:i}}var q=class extends Error{logicalPath;sourceId;constructor(e,t={}){super(e),this.name=`ResolveAgentError`,t.logicalPath!==void 0&&(this.logicalPath=t.logicalPath),t.sourceId!==void 0&&(this.sourceId=t.sourceId)}};function Rc(e){return{exportName:e.exportName,logicalPath:e.logicalPath,sourceId:e.sourceId,sourceKind:`module`}}async function J(e){let n=e.nodeId??`__root__`,r=e.moduleMap.nodes[n]?.modules[e.definition.sourceId];if(r===void 0)throw new q(`Missing compiled module namespace for ${e.kindLabel} source "${e.definition.sourceId}" in node "${n}".`,{logicalPath:e.definition.logicalPath,sourceId:e.definition.sourceId});return await a(t(o(r,`Missing compiled module namespace for ${e.kindLabel} source "${e.definition.sourceId}" in node "${n}".`),{exportName:e.definition.exportName,logicalPath:e.definition.logicalPath}))}async function zc(e,t,n){try{let r=Yn(await J({definition:e,kindLabel:`channel`,moduleMap:t,nodeId:n}),`Expected the channel export "${e.exportName??`default`}" from "${e.logicalPath}" to match the public Ash shape.`),i=Rc({exportName:e.exportName,logicalPath:e.logicalPath,sourceId:e.sourceId}),a=r.routes.find(t=>t.method.toUpperCase()===e.method.toUpperCase()&&t.path===e.urlPath),o=r.adapter;return o&&o.kind!==`http`&&(o.kind=`channel:${e.name}`),{name:e.name,method:e.method,urlPath:e.urlPath,fetch:async(e,t)=>a?a.handler(e,t):Response.json({error:`No matching route handler.`,ok:!1},{status:404}),handler:a?.handler,receive:r.receive,definition:r,adapter:o,...i}}catch(t){throw t instanceof q?t:new q(`Failed to attach the channel definition from "${e.logicalPath}": ${d(t)}`,{logicalPath:e.logicalPath,sourceId:e.sourceId})}}async function Bc(e,t,n){try{let r=o(await J({definition:e,kindLabel:`connection`,moduleMap:t,nodeId:n}),`Expected the connection export "${e.exportName??`default`}" from "${e.logicalPath}" to return an object.`);Fr(`connection:${r.url}`,{kind:`connection`,name:e.connectionName});let i=r.auth!==void 0,a=r.headers!==void 0,s={connectionName:e.connectionName,description:e.description,exportName:e.exportName,logicalPath:e.logicalPath,sourceId:e.sourceId,sourceKind:`module`,url:e.url};if(i)try{s.authorization=er(r.auth,`Connection "${e.connectionName}" at "${e.logicalPath}":`)}catch(t){throw new q(d(t),{logicalPath:e.logicalPath,sourceId:e.sourceId})}return a&&(s.headers=r.headers),r.tools!==void 0&&(s.tools=r.tools),typeof r.approval==`function`&&(s.approval=r.approval),s}catch(t){throw t instanceof q?t:new q(`Failed to resolve connection "${e.connectionName}" from "${e.logicalPath}": ${d(t)}`,{logicalPath:e.logicalPath,sourceId:e.sourceId})}}async function Vc(e,t,n){try{let r=o(await J({definition:e,kindLabel:`hook`,moduleMap:t,nodeId:n}),Y(e,`to return an object`)),a={},s={},c=r.lifecycle;if(c!==void 0){let t=o(c,Y(e,"to expose `lifecycle` as an object"));for(let n of[`session`,`turn`]){let r=t[n];r!==void 0&&(a[n]=i(r,Y(e,`to provide a function for "lifecycle.${n}"`)))}}let l=r.events;if(l!==void 0){let t=o(l,Y(e,"to expose `events` as an object"));for(let[n,r]of Object.entries(t))r!==void 0&&(s[n]=i(r,Y(e,`to provide a function for "events.${n}"`)))}return{events:s,exportName:e.exportName,lifecycle:a,logicalPath:e.logicalPath,slug:e.slug,sourceId:e.sourceId,sourceKind:`module`}}catch(t){throw t instanceof q?t:new q(`Failed to attach hook handlers from "${e.logicalPath}": ${d(t)}`,{logicalPath:e.logicalPath,sourceId:e.sourceId})}}function Y(e,t){return`Expected the hook export "${e.exportName??`default`}" from "${e.logicalPath}" ${t}.`}var Hc=class e extends Error{backendName;templateKey;constructor(e){super(`Sandbox template "${e.templateKey}" is not provisioned for backend "${e.backendName}". Run \`ash build\` or invoke \`prewarmAppSandboxes()\` before serving traffic.`),this.name=`SandboxTemplateNotProvisionedError`,this.backendName=e.backendName,this.templateKey=e.templateKey}static is(t){return t instanceof e}};async function X(e){let t=[];for await(let n of e)t.push(n);return Buffer.concat(t)}function Uc(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}function Z(e){return{id:e.id,resolvePath(t){return e.resolvePath(t)},async runCommand(t){return await e.runCommand(t)},async readFile(t){return await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)})},async readBinaryFile(t){let n=await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)});return n===null?null:await X(n)},async readTextFile(t){Wc(t);let n=await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)});return n===null?null:Kc(qc(await X(n),t.encoding??`utf-8`),t)},async writeFile(t){await e.writeFile({abortSignal:t.abortSignal,content:t.content,path:e.resolvePath(t.path)})},async writeBinaryFile(t){await e.writeFile({abortSignal:t.abortSignal,content:Uc(t.content),path:e.resolvePath(t.path)})},async writeTextFile(t){let n=Jc(t.content,t.encoding??`utf-8`);await e.writeFile({abortSignal:t.abortSignal,content:Uc(n),path:e.resolvePath(t.path)})}}}function Wc(e){let{startLine:t,endLine:n}=e;if(t!==void 0&&(!Number.isInteger(t)||t<1))throw Error(`startLine must be a positive integer (1-based).`);if(n!==void 0&&(!Number.isInteger(n)||n<1))throw Error(`endLine must be a positive integer (1-based).`);if(t!==void 0&&n!==void 0&&t>n)throw Error(`startLine must not be greater than endLine.`)}function Gc(e){let t=[],n=0;for(let r=0;r<e.length;r++)e[r]===`\r`?r+1<e.length&&e[r+1]===`
84
- `?(t.push(e.slice(n,r+2)),n=r+2,r++):(t.push(e.slice(n,r+1)),n=r+1):e[r]===`
85
- `&&(t.push(e.slice(n,r+1)),n=r+1);return n<e.length&&t.push(e.slice(n)),t}function Kc(e,t){if(t.startLine===void 0&&t.endLine===void 0)return e;let n=Gc(e),r=n.length,i=t.startLine??1,a=Math.min(t.endLine??r,r);return i>r?``:n.slice(i-1,a).join(``)}function qc(e,t){return t===`utf-8`||t===`utf8`?new TextDecoder(`utf-8`,{fatal:!0}).decode(e):Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(t)}function Jc(e,t){return t===`utf-8`||t===`utf8`?new TextEncoder().encode(e):Buffer.from(e,t)}function Yc(e={}){return{name:`local`,async prewarm(e){let t=tl(ku(e.runtimeContext.appRoot),e.templateKey);if(await ll(t))return;let n=await Xc({sessionKey:e.templateKey,snapshotPath:t}),r=Z(Qc(n));try{e.bootstrap!==void 0&&await e.bootstrap({use:async()=>r});for(let t of e.seedFiles)typeof t.content==`string`?await r.writeTextFile({content:t.content,path:t.path}):await r.writeBinaryFile({content:t.content,path:t.path});if(await n.captureSnapshot()===null)throw Error(`Failed to capture local sandbox template state for "${e.templateKey}".`)}finally{await n.dispose()}},async create(e){let t=ku(e.runtimeContext.appRoot),n=await sl(tl(t,e.templateKey));if(n===null)throw new Hc({backendName:`local`,templateKey:e.templateKey});let r=ul(e.existingMetadata)??nl(t,e.sessionKey);return await ll(r)||await cl(r,n),Zc(await Xc({sessionKey:e.sessionKey,snapshotPath:r}))}}}async function Xc(e){let{Bash:t,InMemoryFs:n}=await import(`#compiled/just-bash/index.js`),r=await sl(e.snapshotPath),i=new n(rl(r));await il(i),await al(i,r?.entries??[]);let a=new t({cwd:H,env:r?.env,fs:i,network:{dangerouslyAllowFullInternetAccess:!0}});return{async captureSnapshot(){let t=await ol({filesystem:i,sandbox:a});return await cl(e.snapshotPath,t),{snapshotPath:e.snapshotPath}},async dispose(){await a.dispose?.()},async executeCommand(e){if(e.abortSignal?.aborted)throw new DOMException(`The operation was aborted.`,`AbortError`);let t=e.workingDirectory===void 0?e.command:`( cd ${K(e.workingDirectory)} && ${e.command} )`,n=a.exec(t),r=e.abortSignal?await $c(n,e.abortSignal):await n;return{exitCode:r.exitCode,stderr:r.stderr,stdout:r.stdout}},async readFileBytes(e){let t;try{t=await i.readFileBuffer(e)}catch{return null}return Buffer.from(t)},async readFileText(e){let t;try{t=await i.readFileBuffer(e)}catch{return null}return new TextDecoder(`utf-8`,{fatal:!0}).decode(t)},sessionKey:e.sessionKey,snapshotPath:e.snapshotPath,async writeFiles(e){for(let t of e){let e=v(t.path);await i.mkdir(e,{recursive:!0}),await i.writeFile(t.path,t.content)}}}}function Zc(e){let t=Z(Qc(e));return{session:t,useSessionFn:async()=>t,async captureState(){return{backendName:`local`,metadata:await e.captureSnapshot()??{},sessionKey:e.sessionKey}},async dispose(){await e.dispose()}}}function Qc(e){return{id:e.sessionKey,resolvePath:el,async runCommand(t){return await e.executeCommand(t)},async readFile(t){let n=await e.readFileBytes(t.path);return n===null?null:Uc(n)},async writeFile(t){let n=await X(t.content);await e.writeFiles([{content:n,path:t.path}])}}}async function $c(e,t){return await new Promise((n,r)=>{let i=()=>{r(new DOMException(`The operation was aborted.`,`AbortError`))};if(t.aborted){i();return}t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{t.removeEventListener(`abort`,i),n(e)},e=>{t.removeEventListener(`abort`,i),r(e)})})}function el(e){return e.startsWith(`/`)?e:`${H}/${e}`}function tl(e,t){return y(e,`local`,`templates`,`${t}.json`)}function nl(e,t){return y(e,`local`,`sessions`,`${t}.json`)}function rl(e){let t={};for(let n of e?.entries??[])n.kind===`file`&&(t[n.path]=Buffer.from(n.contentBase64,`base64`));return t}async function il(e){await e.mkdir(H,{recursive:!0})}async function al(e,t){let n=t.filter(e=>e.kind===`directory`).map(e=>e.path).sort((e,t)=>e.localeCompare(t));for(let t of n)t!==`/workspace`&&await e.mkdir(t,{recursive:!0})}async function ol(e){let t=[],n=e.filesystem.getAllPaths().sort((e,t)=>e.localeCompare(t));for(let r of n){let n=await e.filesystem.stat(r);if(n.isSymbolicLink)continue;if(n.isDirectory){t.push({kind:`directory`,path:r});continue}if(!n.isFile)continue;let i=await e.filesystem.readFileBuffer(r);t.push({contentBase64:Buffer.from(i).toString(`base64`),kind:`file`,path:r})}return{entries:t,env:{...e.sandbox.getEnv()},version:1}}async function sl(e){if(!await ll(e))return null;let t=JSON.parse(await he(e,`utf8`));return t.version===1?t:null}async function cl(e,t){await x(v(e),{recursive:!0}),await S(e,`${JSON.stringify(t,null,2)}\n`)}async function ll(e){try{return await pe(e),!0}catch{return!1}}function ul(e){let t=e?.snapshotPath;return typeof t==`string`?t:void 0}function dl(e){return Yc({createOptions:e})}function fl(e={}){let t=e.loadSandboxModule??(async()=>await import(`#compiled/@vercel/sandbox/index.js`)),n={timeout:Al,...e.createOptions},r=new Map;return{name:`vercel`,async create(e){let i=El(n.tags,e.tags),a;try{a=await pl({loadSandboxModule:t,prewarmedTemplates:r,templateKey:e.templateKey})}catch(t){throw Hc.is(t)?t:Error(`Failed to read sandbox template "${e.templateKey}": ${kl(t)}`,{cause:t})}let o;try{o=await hl({createOptions:n,existingMetadata:e.existingMetadata,sandboxModule:await t(),sessionKey:e.sessionKey,snapshotId:a.snapshotId,tags:i})}catch(t){throw Error(`Failed to create sandbox session "${e.sessionKey}": ${kl(t)}`,{cause:t})}return gl(o,e.sessionKey)},async prewarm(e){let i;try{i=await ml({bootstrap:e.bootstrap,createOptions:n,loadSandboxModule:t,seedFiles:e.seedFiles,templateKey:e.templateKey})}catch(t){throw Error(`Failed to prewarm Vercel sandbox template "${e.templateKey}": ${kl(t)}. Run \`vercel login\` and \`vercel link\` so the SDK can authenticate, or set VERCEL_TOKEN.`,{cause:t})}r.set(e.templateKey,i)}}}async function pl(e){let t=e.prewarmedTemplates.get(e.templateKey);if(t!==void 0)return t;let n=await Sl(await e.loadSandboxModule(),e.templateKey);if(n===null||typeof n.currentSnapshotId!=`string`)throw new Hc({backendName:`vercel`,templateKey:e.templateKey});return{sandboxName:n.name,snapshotId:n.currentSnapshotId,templateKey:e.templateKey}}async function ml(e){let t=await e.loadSandboxModule(),n=await Sl(t,e.templateKey),r=El(e.createOptions.tags,e.tags);if(n===null){let i={...e.createOptions,name:e.templateKey,persistent:!1};r!==void 0&&(i.tags=r),n=await t.Sandbox.create(i)}else await Dl(n,r);let i=wl(e.createOptions);if(typeof n.currentSnapshotId==`string`&&n.currentSnapshotId.length>0&&n.currentSnapshotId!==i)return{sandboxName:n.name,snapshotId:n.currentSnapshotId,templateKey:e.templateKey};await yl(n,e.createOptions);let a=Z(_l(n,e.templateKey));e.bootstrap!==void 0&&await e.bootstrap({use:async e=>(e!==void 0&&await n.update(e),a)});for(let t of e.seedFiles)typeof t.content==`string`?await a.writeTextFile({content:t.content,path:t.path}):await a.writeBinaryFile({content:t.content,path:t.path});let o=await n.snapshot();return{sandboxName:n.name,snapshotId:o.snapshotId,templateKey:e.templateKey}}async function hl(e){let t=Tl(e.existingMetadata)??e.sessionKey,n=await Sl(e.sandboxModule,t);if(n!==null)return await Dl(n,e.tags),n;let{runtime:r,source:i,...a}=e.createOptions,o={...a,name:t,persistent:!0,source:{snapshotId:e.snapshotId,type:`snapshot`}};return e.tags!==void 0&&(o.tags=e.tags),await e.sandboxModule.Sandbox.create(o)}function gl(e,t){return{session:Z(_l(e,t)),useSessionFn:async n=>(n!==void 0&&await e.update(n),Z(_l(e,t))),async captureState(){return{backendName:`vercel`,metadata:{sandboxName:e.name},sessionKey:t}},async dispose(){}}}function _l(e,t){return{id:t,resolvePath:vl,async runCommand(t){let n=await e.runCommand({args:[`-lc`,t.command],cmd:`bash`,cwd:t.workingDirectory??`/workspace`,signal:t.abortSignal}),[r,i]=await Promise.all([n.stdout(),n.stderr()]);return{exitCode:n.exitCode,stderr:i,stdout:r}},async readFile(t){return await e.readFile({path:t.path})??null},async writeFile(t){let n=await X(t.content);await e.writeFiles([{content:n,path:t.path}])}}}function vl(e){return e.startsWith(`/`)?e:`${H}/${e}`}async function yl(e,t){await bl(e,{failureMessage:`Failed to initialize Vercel sandbox workspace.`,script:`mkdir -p ${H} && chown ${xl}:${xl} ${H}`}),t.networkPolicy!==`deny-all`&&await bl(e,{failureMessage:`Failed to install ripgrep in Vercel sandbox.`,script:`command -v rg >/dev/null 2>&1 || { dnf install -y spal-release && dnf install -y ripgrep; }`})}async function bl(e,t){let n=await e.runCommand({args:[`-lc`,t.script],cmd:`bash`,sudo:!0});if(n.exitCode!==0){let e=await n.stderr();throw Error(`${t.failureMessage} ${e}`.trim())}}const xl=`vercel-sandbox`;async function Sl(e,t){try{return await e.Sandbox.get({name:t})}catch(e){if(Cl(e))return null;throw Error(`Failed to look up Vercel sandbox "${t}": ${kl(e)}`,{cause:e})}}function Cl(e){return e instanceof Error?(e.response?.status??e.cause?.response?.status)===404:!1}function wl(e){let t=e.source;if(t?.type===`snapshot`&&typeof t.snapshotId==`string`)return t.snapshotId}function Tl(e){let t=e?.sandboxName;return typeof t==`string`?t:void 0}function El(e,t){let n={};if(e!==void 0)for(let[t,r]of Object.entries(e))n[t]=r;if(t!==void 0)for(let[e,r]of Object.entries(t))n[e]=r;let r=Object.keys(n).length;if(r!==0){if(r>jl)throw Error(`Vercel Sandbox supports at most ${jl} tags. Ash reserves "agent", "channel", and "sessionId"; remove or consolidate custom tags passed to vercelBackend().`);return n}}async function Dl(e,t){t===void 0||Ol(e.tags,t)||await e.update({tags:t})}function Ol(e,t){let n=e??{},r=Object.entries(n),i=Object.entries(t);return r.length===i.length?i.every(([e,t])=>n[e]===t):!1}function kl(e){return e instanceof Error?e.message:String(e)}const Al=1800*1e3,jl=5;function Ml(e){return fl({createOptions:e})}function Nl(e){return mr(()=>process.env.VERCEL?Ml(e?.vercel):dl(e?.local))}async function Pl(e,t,n){try{let r=o(await J({definition:e,kindLabel:`sandbox`,moduleMap:t,nodeId:n}),`Expected the sandbox export "${e.exportName??`default`}" from "${e.logicalPath}" to return an object.`);return{backend:Fl(r.backend,e.logicalPath),bootstrap:r.bootstrap,description:e.description,exportName:e.exportName,logicalPath:e.logicalPath,onSession:r.onSession,sourceId:e.sourceId,sourceKind:`module`}}catch(t){throw t instanceof q?t:new q(`Failed to attach the sandbox lifecycle handlers from "${e.logicalPath}": ${d(t)}`,{logicalPath:e.logicalPath,sourceId:e.sourceId})}}function Fl(e,t){if(e===void 0)return Nl();if(typeof e==`function`)return mr(e);if(typeof e!=`object`||!e)throw new q(`Sandbox "${t}" exposed a non-object "backend" field. Use vercelBackend(), localBackend(), another factory that returns a SandboxBackend value, or a zero-arg callback returning one.`,{logicalPath:t});let n=e;if(typeof n.name!=`string`||n.name.length===0)throw new q(`Sandbox "${t}" backend is missing a non-empty string "name" identifier.`,{logicalPath:t});if(typeof n.create!=`function`)throw new q(`Sandbox "${t}" backend is missing a "create" function.`,{logicalPath:t});return n}async function Il(e,t,n){try{let r=o(await J({definition:e,kindLabel:`tool`,moduleMap:t,nodeId:n}),Q(e,`to return an object`));Fr(`tool:${r.description}`,{kind:`tool`,name:e.name});let a=i(r.execute,Q(e,`to provide an execute function`));return{description:e.description,execute:a,exportName:e.exportName,inputSchema:e.inputSchema,logicalPath:e.logicalPath,name:e.name,sourceId:e.sourceId,sourceKind:`module`,...Ll(r,e)}}catch(t){throw t instanceof q?t:new q(`Failed to attach the tool execute function from "${e.logicalPath}": ${d(t)}`,{logicalPath:e.logicalPath,sourceId:e.sourceId})}}function Ll(e,t){let n={};e.onCompact!==void 0&&(n.onCompact=i(e.onCompact,Q(t,`to provide an onCompact function`))),e.needsApproval!==void 0&&(n.needsApproval=i(e.needsApproval,Q(t,`to provide a needsApproval function`)));let r=Rl(e,t);return r!==void 0&&(n.retentionPolicy=r),e.toModelOutput!==void 0&&(n.toModelOutput=i(e.toModelOutput,Q(t,`to provide a toModelOutput function`))),e.inputSchema!==void 0&&zl(e.inputSchema)&&(n.inputStandardSchema=e.inputSchema),n}function Rl(e,t){let n=e.retentionPolicy;if(n!==void 0){if(n===`auto`||n===`keep`||typeof n==`function`)return n;throw new q(Q(t,`to set retentionPolicy to "auto", "keep", or a function`),{logicalPath:t.logicalPath,sourceId:t.sourceId})}}function Q(e,t){return`Expected the tool export "${e.exportName??`default`}" from "${e.logicalPath}" ${t}.`}function zl(e){return typeof e==`object`&&!!e&&`~standard`in e&&typeof e[`~standard`]==`object`}async function Bl(e){let t=e.manifest.skills.map(e=>({...e,metadata:e.metadata===void 0?void 0:{...e.metadata}})),n=[],r=[];for(let t of e.manifest.channels){if(t.kind===`disabled`){r.push(t.name);continue}n.push(await zc(t,e.moduleMap,e.nodeId))}let i=await Promise.all(e.manifest.tools.map(t=>Il(t,e.moduleMap,e.nodeId))),a=await Promise.all(e.manifest.hooks.map(t=>Vc(t,e.moduleMap,e.nodeId))),o=await Promise.all(e.manifest.connections.map(t=>Bc(t,e.moduleMap,e.nodeId))),s=e.manifest.sandbox===null?null:await Pl(e.manifest.sandbox,e.moduleMap,e.nodeId),c=Vl(e.manifest.instructions),l=e.manifest.workspaceResourceRoot,u={channels:n,config:Hl(e.manifest),connections:o,disabledFrameworkChannels:r,disabledFrameworkTools:[...e.manifest.disabledFrameworkTools],hooks:a,metadata:{agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,diagnosticsSummary:e.manifest.diagnosticsSummary},sandbox:s,workspaceResourceRoot:l,skills:t,tools:i,workspaceSpec:{rootEntries:[...l.rootEntries]}};return c===void 0?u:{...u,instructions:c}}function Vl(e){if(e!==void 0)return{name:e.name,logicalPath:e.logicalPath,markdown:e.markdown,sourceId:e.sourceId,sourceKind:e.sourceKind}}function Hl(e){let t={metadata:{...e.config.metadata},model:e.config.model.source===void 0?{id:e.config.model.id,contextWindowTokens:e.config.model.contextWindowTokens,providerOptions:e.config.model.providerOptions}:{contextWindowTokens:e.config.model.contextWindowTokens,id:e.config.model.id,providerOptions:e.config.model.providerOptions,source:{exportName:e.config.model.source.exportName,sourceKind:`module`,logicalPath:e.config.model.source.logicalPath,sourceId:e.config.model.source.sourceId}},name:e.config.name};if(e.config.compaction!==void 0){let n={};e.config.compaction.model!==void 0&&(n.model=e.config.compaction.model.source===void 0?{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,providerOptions:e.config.compaction.model.providerOptions}:{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,providerOptions:e.config.compaction.model.providerOptions,source:{exportName:e.config.compaction.model.source.exportName,sourceKind:`module`,logicalPath:e.config.compaction.model.source.logicalPath,sourceId:e.config.compaction.model.source.sourceId}}),e.config.compaction.thresholdPercent!==void 0&&(n.thresholdPercent=e.config.compaction.thresholdPercent),t.compaction=n}return e.config.source!==void 0&&(t.source=Rc(e.config.source)),t}function Ul(e){return{sandbox:{definition:e.authoredSandbox??Wl(),workspaceResourceRoot:e.workspaceResourceRoot}}}function Wl(){return{backend:Nl(),logicalPath:`ash:framework/default-sandbox`,sourceId:`ash:default-sandbox`,sourceKind:`module`}}const Gl=`load_skill`,Kl=Object.freeze({type:`object`,properties:Object.freeze({message:Object.freeze({type:`string`,description:`The message to send to the subagent. Provide all context the subagent needs to complete the task; the subagent does not see the parent's history.`})}),required:Object.freeze([`message`]),additionalProperties:!1});function ql(e){let t=[],n=new Pi(`subagent`,e.reservedToolNames??[]),r=new Map;for(let i of e.subagents){let e={logicalPath:i.logicalPath,sourceId:i.sourceId};if(r.has(i.nodeId))throw new z(`subagent`,`Found multiple runtime subagents mapped to node id "${i.nodeId}".`,{...e,entryName:i.name});let a=Jl(i),o={definition:i,prepared:a};n.register(i.name,o,{location:e,duplicateMessage:`Found multiple subagents named "${i.name}". Subagent names must be unique at runtime.`,reservedMessage:`Subagent "${i.name}" collides with another runtime-visible tool name.`}),t.push(a),r.set(i.nodeId,o)}return{preparedTools:t,subagentsByName:n.asMap(),subagentsByNodeId:r}}function Jl(e){return{description:e.description,inputSchema:Kl,kind:e.kind,logicalPath:e.logicalPath,name:e.name,nodeId:e.nodeId,sourceId:e.sourceId}}async function Yl(e,t={}){let n=[],r=new Pi(`tool`,t.reservedToolNames??[]);for(let t of e.tools){let e=await Xl(t);r.register(t.name,{definition:t,prepared:e},{location:{logicalPath:t.logicalPath,sourceId:t.sourceId},duplicateMessage:`Found multiple authored tools named "${t.name}". Tool names must be unique at runtime.`,reservedMessage:`Tool "${t.name}" collides with another runtime-visible tool name.`}),n.push(e)}return{preparedTools:n,toolsByName:r.asMap()}}async function Xl(e){return{description:e.description,inputSchema:e.inputSchema,kind:`authored-tool`,logicalPath:e.logicalPath,name:e.name,sourceId:e.sourceId}}var Zl=class extends Error{logicalPath;nodeId;sourceId;constructor(e,t={}){super(e),this.name=`ResolveRuntimeAgentGraphError`,t.logicalPath!==void 0&&(this.logicalPath=t.logicalPath),t.nodeId!==void 0&&(this.nodeId=t.nodeId),t.sourceId!==void 0&&(this.sourceId=t.sourceId)}};async function Ql(e){let t=new Map,n=iu(e.manifest),r=new Map(e.manifest.subagents.map(e=>[e.nodeId,e]));return{nodesByNodeId:t,root:await $l({childNodeIdsByParentNodeId:n,manifest:e.manifest,moduleMap:e.moduleMap,nodeId:A,nodesByNodeId:t,subagentNodesById:r})}}async function $l(e){let t=$(e.nodeId);if(e.nodesByNodeId.has(t))throw new Zl(`Found multiple runtime agent nodes for node id "${t}".`,{nodeId:t,sourceId:e.sourceId});let n=await Bl({manifest:e.manifest,moduleMap:e.moduleMap,nodeId:e.nodeId}),r=n.connections.length>0,i=Fc({hasConnections:r}),a=r?ou(i,n.connections):i,o=new Set(a.map(e=>e.name)),s=Ic(),c=new Set(n.tools.map(e=>e.name));for(let r of n.disabledFrameworkTools)if(!s.has(r))throw new Zl(`agent/tools/${r}.ts exports disableTool() but "${r}" is not a framework tool. Rename the file to one of: ${[...s].sort().join(`, `)}.`,{nodeId:t,sourceId:e.sourceId});let l=new Set(n.disabledFrameworkTools),u=await Yl({tools:[...a.filter(e=>!c.has(e.name)&&!l.has(e.name)),...n.tools]},{reservedToolNames:o.has(`load_skill`)||c.has(`load_skill`)?[]:[Gl]}),d=new Set(n.channels.map(e=>e.name)),f=_s();for(let r of n.disabledFrameworkChannels)if(!f.has(r))throw new Zl(`agent/channels/${r}.ts exports disableRoute() but "${r}" is not a framework channel. Rename the file to one of: ${[...f].sort().join(`, `)}.`,{nodeId:t,sourceId:e.sourceId});let p=new Set(n.disabledFrameworkChannels),m=[...gs().filter(e=>!d.has(e.name)&&!p.has(e.name)),...n.channels],h=Ul({authoredSandbox:n.sandbox,workspaceResourceRoot:n.workspaceResourceRoot}),g=ql({reservedToolNames:[Gl,...u.preparedTools.map(e=>e.name)],subagents:await eu({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.manifest,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,parentNodeId:e.nodeId,subagentNodesById:e.subagentNodesById})}),_={agent:n,channels:m,hookRegistry:Lc(n.hooks),nodeId:t,sandboxRegistry:h,sourceId:e.sourceId,subagentRegistry:g,toolRegistry:u,turnAgent:qa({agent:n,nodeId:t,tools:[...u.preparedTools,...g.preparedTools]})};return e.nodesByNodeId.set(t,_),_}async function eu(e){let t=[],n=e.childNodeIdsByParentNodeId.get(e.parentNodeId)??[];for(let r of n){let n=e.subagentNodesById.get(r);if(n===void 0)throw new Zl(`Missing compiled subagent node "${r}" while resolving runtime subagents.`,{nodeId:$(e.parentNodeId),sourceId:r});t.push(await tu({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,sourceRef:n,subagentNodesById:e.subagentNodesById}))}for(let n of e.manifest.remoteAgents)t.push(await nu({moduleMap:e.moduleMap,nodeScopeId:e.parentNodeId,sourceRef:n}));return t}async function tu(e){let t={description:e.sourceRef.description,kind:`subagent`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:$(e.sourceRef.nodeId),sourceId:e.sourceRef.sourceId,sourceKind:`module`};return await $l({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.sourceRef.agent,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId,nodesByNodeId:e.nodesByNodeId,sourceId:e.sourceRef.sourceId,subagentNodesById:e.subagentNodesById}),t}async function nu(e){let t=o(await J({definition:e.sourceRef,kindLabel:`remote agent`,moduleMap:e.moduleMap,nodeId:e.nodeScopeId}),`Expected remote agent source "${e.sourceRef.logicalPath}" to export an object.`),n={description:e.sourceRef.description,kind:`remote`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:$(e.sourceRef.nodeId),path:e.sourceRef.path,sourceId:e.sourceRef.sourceId,sourceKind:`module`,url:e.sourceRef.url};typeof t.auth==`function`&&(n.auth=t.auth);let r=ru(t.headers);return r!==void 0&&(n.headers=r),n}function ru(e){if(e===void 0)return;if(typeof e==`function`)return e;if(typeof e!=`object`||!e||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function iu(e){let t=new Map;for(let n of e.subagentEdges){let e=t.get(n.parentNodeId);if(e===void 0){t.set(n.parentNodeId,[n.childNodeId]);continue}e.push(n.childNodeId)}return t}function $(e){return e===`__root__`?la:e}const au=Fa.name;function ou(e,t){let n=t.map(e=>e.connectionName).join(`, `);return e.map(e=>e.name===au?{...e,description:`${e.description} Available connections: ${n}.`}:e)}const su=process.env.ASH_DISABLE_AGENT_CACHE===`1`;async function cu(e){let[t,n]=await Promise.all([pa({compiledArtifactsSource:e}),lu(e)]),r=await Ql({manifest:t,moduleMap:n}),i=r.root;return{adapterRegistry:Ri({channels:mu(r)}),compiledArtifactsSource:e,graph:r,hookRegistry:i.hookRegistry,moduleMap:n,resolvedAgent:i.agent,subagentRegistry:i.subagentRegistry,toolRegistry:i.toolRegistry,turnAgent:i.turnAgent}}async function lu(e){return e.kind===`disk`&&e.moduleMapLoaderPath!==void 0?await uu(e):await va({compiledArtifactsSource:e})}async function uu(e){if(e.moduleMapLoaderPath===void 0)throw Error(`Authored-source module map loading requires "moduleMapLoaderPath" in the compiled artifacts source.`);return await(await import(we(e.moduleMapLoaderPath).href)).loadCompiledModuleMapFromAuthoredSource({compiledArtifactsSource:e})}async function du(e){if(su)return cu(e);let t=Qi(),n=Wi(e),r=await oa(e),i=t.bundleCacheKeyBySourceKey.get(n);i!==void 0&&i!==r&&t.bundleCache.delete(i),t.bundleCacheKeyBySourceKey.set(n,r);let a=t.bundleCache.get(r);if(a!==void 0)return a;let o=cu(e).catch(e=>{throw t.bundleCache.delete(r),t.bundleCacheKeyBySourceKey.get(n)===r&&t.bundleCacheKeyBySourceKey.delete(n),e});return t.bundleCache.set(r,o),o}async function fu(e){let t=await du(e.compiledArtifactsSource);if(e.nodeId===void 0)return t;let n=ua(t.graph,e.nodeId);return{adapterRegistry:t.adapterRegistry,compiledArtifactsSource:t.compiledArtifactsSource,graph:{nodesByNodeId:t.graph.nodesByNodeId,root:n},hookRegistry:n.hookRegistry,moduleMap:t.moduleMap,nodeId:e.nodeId,resolvedAgent:n.agent,subagentRegistry:n.subagentRegistry,toolRegistry:n.toolRegistry,turnAgent:n.turnAgent}}function pu(){let e=Qi();e.bundleCache.clear(),e.bundleCacheKeyBySourceKey.clear()}function mu(e){let t=new Map;for(let n of e.nodesByNodeId.values())for(let e of n.channels)t.set(`${e.sourceId}:${e.name}`,e);return[...t.values()]}new L(`ash.channel`,{codec:{serialize(e){return{kind:Ti(e),state:e.state?{...e.state}:{}}},deserialize(e,t){let n=t.get(hu);if(n===void 0)throw Error(`Cannot deserialize "ash.channel" before "ash.bundle". The runtime bundle must be present in context.`);return zi(n.adapterRegistry,e)}}});const hu=new L(`ash.bundle`,{codec:{serialize:e=>({nodeId:e.nodeId,source:e.compiledArtifactsSource}),deserialize:e=>{let{source:t,nodeId:n}=e;return fu({compiledArtifactsSource:t,nodeId:n})}}});new L(`ash.session`);const gu=new L(`ash.sandbox`),_u=`workflowEntry`,vu=jt(),yu=new Set([_u,`turnWorkflow`]),bu=vu.name,xu={workflowId:`workflow//${bu}//${_u}`};`${bu}`;function Su(e=process.cwd()){return b(e)}function Cu(e){return _e(`sha256`).update(e).digest(`hex`).slice(0,12)}function wu(){return!!process.env.VERCEL}function Tu(e,t=`all`){let n=y(e,`.ash`,`nitro`);return t===`all`?n:y(n,t)}function Eu(e,t){return y(e,`.ash`,`nitro-output`,t)}function Du(e){let t=y(k(),`.ash`,`workflow-cache`);return Ou(t),y(t,Cu(e))}function Ou(e){if(!ve(e))return;let t=jt().version,n;try{n=be(e)}catch{return}for(let r of n){let n=y(e,r),i=y(n,`ash-cache.json`);if(ve(i))try{let e=JSON.parse(ye(i,`utf8`));typeof e.ashVersion==`string`&&e.ashVersion!==t&&Se(n,{force:!0,recursive:!0})}catch{}}}function ku(e){return y(e,`.ash`,`sandbox-cache`)}function Au(e){return wu()?y(e,`.vercel`,`output`):y(e,`.output`)}function ju(e){return{appRoot:e,outputDir:Au(e),workflowId:xu.workflowId,workflowBuildDir:Du(e),workflowSourceDir:Dt(`src/execution`)}}export{Ve as $,Et as A,st as B,j as C,jt as D,A as E,pt as F,Ze as G,Je as H,dt as I,qe as J,Ke as K,ut as L,D as M,ct as N,k as O,ft as P,Be as Q,mt as R,bn as S,gn as T,Ye as U,at as V,Xe as W,E as X,w as Y,ze as Z,Ui as _,Du as a,Un as b,Ql as c,H as d,Ue as et,pa as f,Hi as g,B as h,Eu as i,Mt as j,Dt as k,_s as l,ra as m,Su as n,yu as o,la as p,Qe as q,Tu as r,pu as s,ju as t,He as tt,gs as u,Wi as v,_n as w,Sn as x,ii as y,it as z};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-DSjMdhoD.js";var t=e(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}));export{t};
@@ -1 +0,0 @@
1
- function e(e){return typeof e==`string`?e:`${e.provider.split(`.`)[0]}/${e.modelId.replace(/^(claude-[a-z]+-\d+)-(\d+)$/,`$1.$2`)}`}export{e as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./chunk-DSjMdhoD.js";import{c as t,l as n}from"./client-ZqNLLMZB.js";var r=e(((e,r)=>{var i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of o(t))!s.call(e,c)&&c!==n&&i(e,c,{get:()=>t[c],enumerable:!(r=a(t,c))||r.enumerable});return e},u=e=>l(i({},`__esModule`,{value:!0}),e),d={};c(d,{refreshToken:()=>m}),r.exports=u(d);var f=n(),p=t();async function m(e){let t=e?.project,n=e?.team;if(!t&&!n){let e=(0,p.findProjectInfo)();t=e.projectId,n=e.teamId}else if(!t||!n){let e=(0,p.findProjectInfo)();t??=e.projectId,n??=e.teamId}if(!t)throw new f.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let r=(0,p.loadToken)(t);if(!r||(0,p.isExpired)((0,p.getTokenPayload)(r.token),e?.expirationBufferMs)){let i=await(0,p.getVercelToken)({expirationBufferMs:e?.expirationBufferMs});if(r=await(0,p.getVercelOidcToken)(i,t,n),!r)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token`);(0,p.saveToken)(r,t)}process.env.VERCEL_OIDC_TOKEN=r.token}}));export default r();export{};
@@ -1 +0,0 @@
1
- import{z as e}from"#compiled/zod/index.js";const t=Symbol(`invalid-json-value-candidate`);function n(e){let n=i(e);if(n===t)throw TypeError(`Expected a JSON-serializable value.`);return n}function r(e){let t=n(e);if(!a(t))throw TypeError(`Expected a JSON-serializable object.`);return t}function i(e,n=new WeakSet){if(e===null||typeof e==`boolean`||typeof e==`string`)return e;if(typeof e==`number`)return Number.isFinite(e)?e:t;if(Array.isArray(e)){let r=[];for(let a of e){let e=i(a,n);if(e===t)return t;r.push(e)}return r}if(typeof e!=`object`||e===void 0||!o(e)||n.has(e))return t;n.add(e);let r={};for(let[a,o]of Object.entries(e)){if(o===void 0)continue;let e=i(o,n);if(e===t)return t;r[a]=e}return n.delete(e),r}function a(e){return e!==null&&!Array.isArray(e)&&typeof e==`object`}function o(e){let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}const s=e.unknown().transform((t,r)=>{try{return n(t)}catch(t){return r.addIssue({code:`custom`,message:l(t,`Expected a JSON-serializable value.`)}),e.NEVER}}),c=e.unknown().transform((t,n)=>{try{return r(t)}catch(t){return n.addIssue({code:`custom`,message:l(t,`Expected a JSON-serializable object.`)}),e.NEVER}});function l(e,t){return e instanceof Error?e.message:t}const u=`/ash/v1`,d=`${u}/health`,f=`${u}/info`,p=`${u}/session`,m=`${u}/session/:sessionId`,h=`${u}/session/:sessionId/stream`,g=`${u}/connections/:name/callback/:token`,_=`${u}/callback/:token`;function v(e){return`${u}/session/${encodeURIComponent(e)}/stream`}function y(e){return`${u}/session/${encodeURIComponent(e)}`}function b(e){return`${u}/callback/${encodeURIComponent(e)}`}const x=`x-ash-session-id`,S=`x-ash-stream-format`,C=`x-ash-stream-version`,w=`application/x-ndjson; charset=utf-8`,T=`ndjson`;new TextEncoder;function E(e){return e.type===`session.completed`||e.type===`session.failed`||e.type===`session.waiting`}const D=e.object({callId:e.string(),input:c,kind:e.literal(`tool-call`),toolName:e.string()}).strict(),O=e.object({callId:e.string(),description:e.string(),input:c,kind:e.literal(`subagent-call`),name:e.string(),nodeId:e.string(),subagentName:e.string()}).strict(),k=e.object({callId:e.string(),description:e.string(),input:c,kind:e.literal(`remote-agent-call`),name:e.string(),nodeId:e.string(),remoteAgentName:e.string()}).strict(),A=e.object({callId:e.string(),input:c,kind:e.literal(`load-skill`)}).strict();e.discriminatedUnion(`kind`,[A,k,O,D]),e.object({callId:e.string(),isError:e.boolean().optional(),kind:e.literal(`tool-result`),output:s,toolName:e.string()}).strict(),e.object({callId:e.string(),isError:e.boolean().optional(),kind:e.literal(`subagent-result`),output:s,subagentName:e.string()}).strict(),e.object({callId:e.string(),isError:e.boolean().optional(),kind:e.literal(`load-skill-result`),output:s,name:e.string().optional()}).strict();const j=e.object({description:e.string().describe(`Optional additional context for this option.`).optional(),id:e.string().describe(`Stable identifier for the option.`),label:e.string().describe(`User-facing label for the option.`),style:e.enum([`primary`,`danger`,`default`]).describe(`Visual treatment hint for the option.`).optional()}).strict(),M=e.object({action:D,allowFreeform:e.boolean().describe(`Whether the user may answer with freeform text instead of selecting one of the provided options.`).optional(),display:e.enum([`confirmation`,`select`,`text`]).describe(`Rendering hint — the channel uses this to pick a UX treatment.`).optional(),options:e.array(j).describe(`Selectable answer options to present to the user.`).optional(),prompt:e.string().describe(`The prompt to present to the user.`),requestId:e.string().describe(`Stable identifier for this request.`)}).strict(),N=e.object({optionId:e.string().optional(),requestId:e.string(),text:e.string().optional()}).strict();function P(e){return N.safeParse(e).success}export{b as _,x as a,c as b,E as c,m as d,p as f,u as g,h,T as i,_ as l,f as m,P as n,S as o,d as p,w as r,C as s,M as t,g as u,y as v,r as x,v as y};