eve 0.6.0-beta.9 → 0.7.2

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 (650) hide show
  1. package/CHANGELOG.md +281 -0
  2. package/README.md +9 -6
  3. package/dist/docs/public/README.md +17 -12
  4. package/dist/docs/public/agent-config.md +10 -10
  5. package/dist/docs/public/channels/custom.mdx +4 -4
  6. package/dist/docs/public/channels/discord.mdx +1 -1
  7. package/dist/docs/public/channels/eve.mdx +10 -10
  8. package/dist/docs/public/channels/github.mdx +1 -1
  9. package/dist/docs/public/channels/overview.mdx +21 -15
  10. package/dist/docs/public/channels/slack.mdx +16 -4
  11. package/dist/docs/public/channels/teams.mdx +1 -1
  12. package/dist/docs/public/channels/telegram.mdx +1 -1
  13. package/dist/docs/public/channels/twilio.mdx +1 -1
  14. package/dist/docs/public/{advanced → concepts}/context-control.md +3 -3
  15. package/dist/docs/public/{advanced → concepts}/default-harness.md +5 -5
  16. package/dist/docs/public/{advanced → concepts}/execution-model-and-durability.md +3 -1
  17. package/dist/docs/public/concepts/meta.json +10 -0
  18. package/dist/docs/public/{advanced → concepts}/security-model.md +3 -3
  19. package/dist/docs/public/{advanced → concepts}/sessions-runs-and-streaming.md +7 -7
  20. package/dist/docs/public/connections.mdx +6 -4
  21. package/dist/docs/public/evals/assertions.mdx +108 -0
  22. package/dist/docs/public/evals/cases.mdx +143 -0
  23. package/dist/docs/public/evals/judge.mdx +94 -0
  24. package/dist/docs/public/evals/meta.json +4 -0
  25. package/dist/docs/public/evals/overview.mdx +118 -0
  26. package/dist/docs/public/evals/reporters.mdx +62 -0
  27. package/dist/docs/public/evals/running.mdx +63 -0
  28. package/dist/docs/public/evals/targets.mdx +54 -0
  29. package/dist/docs/public/getting-started.mdx +38 -33
  30. package/dist/docs/public/{advanced → guides}/auth-and-route-protection.md +5 -3
  31. package/dist/docs/public/{client → guides/client}/continuations.mdx +2 -2
  32. package/dist/docs/public/{client → guides/client}/messages.mdx +1 -1
  33. package/dist/docs/public/{client → guides/client}/meta.json +1 -1
  34. package/dist/docs/public/{client → guides/client}/output-schema.mdx +2 -2
  35. package/dist/docs/public/{client → guides/client}/overview.mdx +5 -5
  36. package/dist/docs/public/{client → guides/client}/streaming.mdx +1 -1
  37. package/dist/docs/public/{advanced → guides}/deployment.md +9 -1
  38. package/dist/docs/public/guides/dev-tui.md +50 -0
  39. package/dist/docs/public/{advanced → guides}/dynamic-capabilities.md +1 -1
  40. package/dist/docs/public/{advanced → guides}/dynamic-workflows.md +1 -1
  41. package/dist/docs/public/{frontend → guides/frontend}/nextjs.mdx +16 -7
  42. package/dist/docs/public/{frontend → guides/frontend}/nuxt.mdx +7 -7
  43. package/dist/docs/public/{frontend → guides/frontend}/overview.mdx +6 -6
  44. package/dist/docs/public/{frontend → guides/frontend}/sveltekit.mdx +5 -5
  45. package/dist/docs/public/{frontend → guides/frontend}/use-eve-agent-svelte.mdx +2 -2
  46. package/dist/docs/public/{frontend → guides/frontend}/use-eve-agent-vue.mdx +2 -2
  47. package/dist/docs/public/{advanced → guides}/hooks.md +2 -2
  48. package/dist/docs/public/{advanced → guides}/instrumentation.md +3 -1
  49. package/dist/docs/public/{advanced → guides}/meta.json +8 -12
  50. package/dist/docs/public/{advanced → guides}/session-context.md +3 -3
  51. package/dist/docs/public/{advanced → guides}/state.md +1 -1
  52. package/dist/docs/public/instructions.mdx +2 -2
  53. package/dist/docs/public/introduction.md +5 -2
  54. package/dist/docs/public/meta.json +4 -3
  55. package/dist/docs/public/reference/cli.md +35 -19
  56. package/dist/docs/public/reference/meta.json +1 -1
  57. package/dist/docs/public/reference/project-layout.md +5 -1
  58. package/dist/docs/public/reference/typescript-api.md +27 -23
  59. package/dist/docs/public/sandbox.mdx +1 -1
  60. package/dist/docs/public/schedules.mdx +2 -2
  61. package/dist/docs/public/skills.mdx +3 -3
  62. package/dist/docs/public/subagents.mdx +3 -3
  63. package/dist/docs/public/tools.mdx +4 -8
  64. package/dist/docs/public/tutorial/connect-a-warehouse.mdx +3 -3
  65. package/dist/docs/public/tutorial/first-agent.mdx +6 -3
  66. package/dist/docs/public/tutorial/guard-the-spend.mdx +1 -1
  67. package/dist/docs/public/tutorial/how-it-runs.mdx +2 -2
  68. package/dist/docs/public/tutorial/meta.json +1 -1
  69. package/dist/docs/public/tutorial/query-sample-data.mdx +1 -1
  70. package/dist/docs/public/tutorial/remember-definitions.mdx +3 -3
  71. package/dist/docs/public/tutorial/run-analysis.mdx +1 -1
  72. package/dist/docs/public/tutorial/ship-it.mdx +4 -4
  73. package/dist/docs/public/tutorial/team-playbooks.mdx +3 -3
  74. package/dist/src/chunks/{use-eve-agent-DCZbkLG7.js → use-eve-agent-DErQj5hs.js} +125 -37
  75. package/dist/src/chunks/{use-eve-agent-DoheC4_o.js → use-eve-agent-DoR8C4i6.js} +125 -37
  76. package/dist/src/cli/banner.d.ts +7 -0
  77. package/dist/src/cli/banner.js +1 -0
  78. package/dist/src/cli/commands/channel-add-conflicts.d.ts +1 -1
  79. package/dist/src/cli/commands/channels.d.ts +9 -6
  80. package/dist/src/cli/commands/channels.js +1 -1
  81. package/dist/src/cli/commands/deploy.d.ts +21 -0
  82. package/dist/src/cli/commands/deploy.js +1 -0
  83. package/dist/src/cli/commands/init-git.d.ts +15 -0
  84. package/dist/src/cli/commands/init-git.js +1 -0
  85. package/dist/src/cli/commands/init.d.ts +29 -0
  86. package/dist/src/cli/commands/init.js +1 -0
  87. package/dist/src/cli/commands/link.d.ts +21 -0
  88. package/dist/src/cli/commands/link.js +1 -0
  89. package/dist/src/cli/commands/preconditions.d.ts +7 -0
  90. package/dist/src/cli/commands/preconditions.js +1 -0
  91. package/dist/src/cli/commands/register-project-commands.d.ts +12 -0
  92. package/dist/src/cli/commands/register-project-commands.js +1 -0
  93. package/dist/src/cli/dev/tui/agent-header.d.ts +15 -9
  94. package/dist/src/cli/dev/tui/agent-header.js +1 -1
  95. package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
  96. package/dist/src/cli/dev/tui/blocks.js +3 -2
  97. package/dist/src/cli/dev/tui/command-typeahead.d.ts +47 -0
  98. package/dist/src/cli/dev/tui/command-typeahead.js +1 -0
  99. package/dist/src/cli/dev/tui/dev-rebuild-status.d.ts +21 -0
  100. package/dist/src/cli/dev/tui/dev-rebuild-status.js +1 -0
  101. package/dist/src/cli/dev/tui/errors.d.ts +18 -0
  102. package/dist/src/cli/dev/tui/errors.js +1 -1
  103. package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +14 -0
  104. package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -0
  105. package/dist/src/cli/dev/tui/prompt-commands.d.ts +54 -0
  106. package/dist/src/cli/dev/tui/prompt-commands.js +2 -0
  107. package/dist/src/cli/dev/tui/runner.d.ts +64 -7
  108. package/dist/src/cli/dev/tui/runner.js +1 -1
  109. package/dist/src/cli/dev/tui/setup-commands.d.ts +48 -0
  110. package/dist/src/cli/dev/tui/setup-commands.js +2 -0
  111. package/dist/src/cli/dev/tui/setup-flow.d.ts +35 -0
  112. package/dist/src/cli/dev/tui/setup-issues.d.ts +40 -0
  113. package/dist/src/cli/dev/tui/setup-issues.js +1 -0
  114. package/dist/src/cli/dev/tui/setup-panel.d.ts +103 -0
  115. package/dist/src/cli/dev/tui/setup-panel.js +1 -0
  116. package/dist/src/cli/dev/tui/status-line.d.ts +25 -0
  117. package/dist/src/cli/dev/tui/status-line.js +1 -0
  118. package/dist/src/cli/dev/tui/stream-format.d.ts +16 -1
  119. package/dist/src/cli/dev/tui/stream-format.js +1 -1
  120. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +32 -3
  121. package/dist/src/cli/dev/tui/terminal-renderer.js +5 -2
  122. package/dist/src/cli/dev/tui/test/index.d.ts +3 -1
  123. package/dist/src/cli/dev/tui/test/index.js +1 -1
  124. package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +1 -0
  125. package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
  126. package/dist/src/cli/dev/tui/theme.d.ts +10 -0
  127. package/dist/src/cli/dev/tui/theme.js +1 -1
  128. package/dist/src/cli/dev/tui/tui-prompter.d.ts +20 -0
  129. package/dist/src/cli/dev/tui/tui-prompter.js +1 -0
  130. package/dist/src/cli/dev/tui/tui.d.ts +6 -8
  131. package/dist/src/cli/dev/tui/tui.js +1 -1
  132. package/dist/src/cli/dev/tui/types.d.ts +4 -3
  133. package/dist/src/cli/dev/tui/vercel-status.d.ts +47 -0
  134. package/dist/src/cli/dev/tui/vercel-status.js +1 -0
  135. package/dist/src/cli/run.d.ts +9 -18
  136. package/dist/src/cli/run.js +2 -2
  137. package/dist/src/client/client.d.ts +8 -0
  138. package/dist/src/client/client.js +1 -1
  139. package/dist/src/client/file-parts.d.ts +18 -0
  140. package/dist/src/client/file-parts.js +1 -0
  141. package/dist/src/client/index.d.ts +3 -2
  142. package/dist/src/client/index.js +1 -1
  143. package/dist/src/client/message-response.js +1 -1
  144. package/dist/src/client/open-stream.d.ts +6 -0
  145. package/dist/src/client/open-stream.js +1 -1
  146. package/dist/src/client/session-utils.d.ts +5 -0
  147. package/dist/src/client/session-utils.js +1 -1
  148. package/dist/src/client/session.js +1 -1
  149. package/dist/src/client/types.d.ts +9 -2
  150. package/dist/src/compiled/.vendor-stamp.json +8 -8
  151. package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +56 -31
  152. package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
  153. package/dist/src/compiled/@ai-sdk/google/index.js +1 -1
  154. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
  155. package/dist/src/compiled/@ai-sdk/openai/index.d.ts +16 -9
  156. package/dist/src/compiled/@ai-sdk/openai/index.js +2 -2
  157. package/dist/src/compiled/@ai-sdk/otel/index.js +2 -2
  158. package/dist/src/compiled/@vercel/sandbox/index.js +1 -1
  159. package/dist/src/compiled/@workflow/core/capabilities.d.ts +19 -1
  160. package/dist/src/compiled/@workflow/core/class-serialization.d.ts +32 -0
  161. package/dist/src/compiled/@workflow/core/create-hook.d.ts +37 -0
  162. package/dist/src/compiled/@workflow/core/global.d.ts +11 -1
  163. package/dist/src/compiled/@workflow/core/index.js +2 -2
  164. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +4 -2
  165. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +6 -0
  166. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -2
  167. package/dist/src/compiled/@workflow/core/runtime/wait-continuation.d.ts +84 -0
  168. package/dist/src/compiled/@workflow/core/runtime/wait-until.d.ts +18 -0
  169. package/dist/src/compiled/@workflow/core/runtime.d.ts +3 -1
  170. package/dist/src/compiled/@workflow/core/runtime.js +28 -28
  171. package/dist/src/compiled/@workflow/core/serialization/types.d.ts +21 -0
  172. package/dist/src/compiled/@workflow/core/serialization.d.ts +113 -6
  173. package/dist/src/compiled/@workflow/core/symbols.d.ts +2 -0
  174. package/dist/src/compiled/@workflow/core/util.d.ts +0 -5
  175. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  176. package/dist/src/compiled/@workflow/core/workflow/attribute-dispatcher.d.ts +6 -0
  177. package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +3 -4
  178. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  179. package/dist/src/compiled/@workflow/world/events.d.ts +48 -0
  180. package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
  181. package/dist/src/compiled/@workflow/world/queue.d.ts +31 -2
  182. package/dist/src/compiled/@workflow/world/runs.d.ts +2 -0
  183. package/dist/src/compiled/@workflow/world/spec-version.d.ts +2 -1
  184. package/dist/src/compiled/_chunks/workflow/attribute-changes-DGVGRGfw.js +59 -0
  185. package/dist/src/compiled/_chunks/workflow/{dist-gEXVSMPU.js → dist-CkMRLaRV.js} +1 -1
  186. package/dist/src/compiled/_chunks/workflow/functions-DuPjIvMH.js +1 -0
  187. package/dist/src/compiled/_chunks/workflow/resume-hook-DMSadN9o.js +1 -0
  188. package/dist/src/compiled/_chunks/workflow/run-BRdn7zy_.js +1 -0
  189. package/dist/src/compiled/_chunks/workflow/sleep-CpXfoXLF.js +1 -0
  190. package/dist/src/compiled/just-bash/index.d.ts +4 -4
  191. package/dist/src/compiler/artifacts.js +1 -1
  192. package/dist/src/compiler/manifest.d.ts +8 -8
  193. package/dist/src/compiler/normalize-agent-config.js +1 -1
  194. package/dist/src/compiler/normalize-channel.d.ts +2 -1
  195. package/dist/src/compiler/normalize-channel.js +1 -1
  196. package/dist/src/compiler/normalize-connection.d.ts +2 -1
  197. package/dist/src/compiler/normalize-connection.js +1 -1
  198. package/dist/src/compiler/normalize-helpers.d.ts +5 -0
  199. package/dist/src/compiler/normalize-helpers.js +1 -1
  200. package/dist/src/compiler/normalize-instructions.d.ts +3 -2
  201. package/dist/src/compiler/normalize-instructions.js +1 -1
  202. package/dist/src/compiler/normalize-manifest.js +2 -2
  203. package/dist/src/compiler/normalize-sandbox.d.ts +2 -1
  204. package/dist/src/compiler/normalize-sandbox.js +1 -1
  205. package/dist/src/compiler/normalize-schedule.d.ts +2 -1
  206. package/dist/src/compiler/normalize-schedule.js +1 -1
  207. package/dist/src/compiler/normalize-skill.d.ts +2 -1
  208. package/dist/src/compiler/normalize-skill.js +1 -1
  209. package/dist/src/compiler/normalize-subagent.d.ts +4 -1
  210. package/dist/src/compiler/normalize-subagent.js +1 -1
  211. package/dist/src/compiler/normalize-tool.d.ts +2 -1
  212. package/dist/src/compiler/normalize-tool.js +1 -1
  213. package/dist/src/compiler/workspace-resources.js +1 -1
  214. package/dist/src/context/node.d.ts +1 -1
  215. package/dist/src/evals/assertions/collector.d.ts +43 -0
  216. package/dist/src/evals/assertions/collector.js +1 -0
  217. package/dist/src/evals/assertions/run.d.ts +72 -0
  218. package/dist/src/evals/assertions/run.js +2 -0
  219. package/dist/src/evals/autoevals-client.js +2 -0
  220. package/dist/src/evals/cli/eval-client.d.ts +22 -0
  221. package/dist/src/evals/cli/eval-client.js +1 -0
  222. package/dist/src/evals/cli/eval.d.ts +8 -5
  223. package/dist/src/evals/cli/eval.js +1 -1
  224. package/dist/src/evals/context.d.ts +19 -0
  225. package/dist/src/evals/context.js +1 -0
  226. package/dist/src/evals/define-eval-config.d.ts +16 -0
  227. package/dist/src/evals/define-eval-config.js +1 -0
  228. package/dist/src/evals/define-eval.d.ts +20 -0
  229. package/dist/src/evals/define-eval.js +1 -0
  230. package/dist/src/evals/expect/index.d.ts +25 -0
  231. package/dist/src/evals/expect/index.js +1 -0
  232. package/dist/src/evals/index.d.ts +6 -2
  233. package/dist/src/evals/index.js +1 -1
  234. package/dist/src/evals/judge.d.ts +20 -0
  235. package/dist/src/evals/judge.js +1 -0
  236. package/dist/src/evals/{checks/match.d.ts → match.d.ts} +17 -18
  237. package/dist/src/evals/match.js +1 -0
  238. package/dist/src/evals/reporters/index.d.ts +1 -0
  239. package/dist/src/evals/reporters/index.js +1 -1
  240. package/dist/src/evals/requirements.d.ts +3 -0
  241. package/dist/src/evals/requirements.js +1 -0
  242. package/dist/src/evals/runner/artifacts.d.ts +7 -6
  243. package/dist/src/evals/runner/artifacts.js +3 -3
  244. package/dist/src/evals/runner/discover.d.ts +31 -10
  245. package/dist/src/evals/runner/discover.js +1 -1
  246. package/dist/src/evals/runner/execute-eval.d.ts +25 -0
  247. package/dist/src/evals/runner/execute-eval.js +1 -0
  248. package/dist/src/evals/runner/execute-task.d.ts +31 -0
  249. package/dist/src/evals/runner/execute-task.js +1 -0
  250. package/dist/src/evals/runner/reporters/braintrust.d.ts +7 -5
  251. package/dist/src/evals/runner/reporters/braintrust.js +2 -2
  252. package/dist/src/evals/runner/reporters/console.d.ts +4 -4
  253. package/dist/src/evals/runner/reporters/console.js +1 -1
  254. package/dist/src/evals/runner/reporters/junit.d.ts +10 -0
  255. package/dist/src/evals/runner/reporters/junit.js +4 -0
  256. package/dist/src/evals/runner/reporters/types.d.ts +14 -8
  257. package/dist/src/evals/runner/run-evals.d.ts +38 -0
  258. package/dist/src/evals/runner/run-evals.js +1 -0
  259. package/dist/src/evals/runner/verdict.d.ts +10 -15
  260. package/dist/src/evals/runner/verdict.js +1 -1
  261. package/dist/src/evals/session.d.ts +52 -0
  262. package/dist/src/evals/session.js +1 -0
  263. package/dist/src/evals/target.d.ts +23 -0
  264. package/dist/src/evals/target.js +1 -0
  265. package/dist/src/evals/types.d.ts +294 -219
  266. package/dist/src/execution/compaction.d.ts +14 -0
  267. package/dist/src/execution/compaction.js +1 -0
  268. package/dist/src/execution/delegated-parent-notification.js +1 -1
  269. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  270. package/dist/src/execution/node-step.js +1 -1
  271. package/dist/src/execution/sandbox/bash-tool.d.ts +6 -6
  272. package/dist/src/execution/sandbox/bash-tool.js +1 -1
  273. package/dist/src/execution/sandbox/bindings/local.js +1 -1
  274. package/dist/src/execution/sandbox/bindings/vercel.d.ts +2 -6
  275. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  276. package/dist/src/execution/sandbox/glob-tool.js +3 -3
  277. package/dist/src/execution/sandbox/grep-tool.js +3 -3
  278. package/dist/src/execution/sandbox/read-file-tool.js +1 -1
  279. package/dist/src/execution/subagent-adapter.js +1 -1
  280. package/dist/src/execution/tool-auth.js +1 -1
  281. package/dist/src/execution/turn-workflow.js +1 -1
  282. package/dist/src/execution/workflow-runtime.d.ts +2 -2
  283. package/dist/src/execution/workflow-runtime.js +1 -1
  284. package/dist/src/execution/workflow-steps.js +1 -1
  285. package/dist/src/harness/action-result-helpers.js +1 -1
  286. package/dist/src/harness/authorization.d.ts +26 -0
  287. package/dist/src/harness/authorization.js +1 -1
  288. package/dist/src/harness/code-mode-lifecycle.js +1 -1
  289. package/dist/src/harness/emission.d.ts +12 -5
  290. package/dist/src/harness/emission.js +1 -1
  291. package/dist/src/harness/model-call-error.d.ts +35 -6
  292. package/dist/src/harness/model-call-error.js +1 -1
  293. package/dist/src/harness/step-hooks.d.ts +10 -4
  294. package/dist/src/harness/step-hooks.js +1 -1
  295. package/dist/src/harness/tool-loop.js +1 -1
  296. package/dist/src/harness/tools.d.ts +4 -6
  297. package/dist/src/harness/tools.js +1 -1
  298. package/dist/src/harness/turn-tag-state.d.ts +4 -0
  299. package/dist/src/harness/turn-tag-state.js +1 -1
  300. package/dist/src/harness/types.d.ts +4 -15
  301. package/dist/src/internal/application/cache-metadata.js +1 -1
  302. package/dist/src/internal/application/compiled-artifacts.js +1 -1
  303. package/dist/src/internal/application/package.js +1 -1
  304. package/dist/src/internal/application/paths.js +1 -1
  305. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  306. package/dist/src/internal/authored-module-loader.d.ts +4 -1
  307. package/dist/src/internal/authored-module-loader.js +2 -2
  308. package/dist/src/internal/authored-module-map-loader.js +1 -1
  309. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  310. package/dist/src/internal/nitro/host/build-application.js +1 -1
  311. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
  312. package/dist/src/internal/nitro/host/configure-nitro-routes.js +3 -3
  313. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  314. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  315. package/dist/src/internal/nitro/host/dev-watcher-log.d.ts +37 -0
  316. package/dist/src/internal/nitro/host/dev-watcher-log.js +1 -0
  317. package/dist/src/internal/nitro/host/ports.d.ts +8 -0
  318. package/dist/src/internal/nitro/host/ports.js +1 -0
  319. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
  320. package/dist/src/internal/nitro/host/server-external-packages.d.ts +1 -1
  321. package/dist/src/internal/nitro/host/server-external-packages.js +1 -1
  322. package/dist/src/internal/nitro/host/start-development-server.js +1 -1
  323. package/dist/src/internal/nitro/host/start-production-server.js +1 -1
  324. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +5 -0
  325. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -0
  326. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +31 -2
  327. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  328. package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.d.ts +13 -0
  329. package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -1
  330. package/dist/src/internal/nitro/routes/info.d.ts +2 -2
  331. package/dist/src/internal/nitro/routes/info.js +1 -1
  332. package/dist/src/internal/workflow/queue-namespace.d.ts +5 -0
  333. package/dist/src/internal/workflow/queue-namespace.js +1 -0
  334. package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
  335. package/dist/src/internal/workflow-bundle/builder.js +3 -5
  336. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
  337. package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +1 -1
  338. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  339. package/dist/src/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +4 -4
  340. package/dist/src/protocol/message.d.ts +15 -0
  341. package/dist/src/protocol/message.js +2 -2
  342. package/dist/src/public/channels/slack/api.d.ts +8 -0
  343. package/dist/src/public/channels/slack/api.js +1 -1
  344. package/dist/src/public/channels/slack/connections.d.ts +26 -18
  345. package/dist/src/public/channels/slack/connections.js +1 -1
  346. package/dist/src/public/channels/slack/defaults.d.ts +5 -2
  347. package/dist/src/public/channels/slack/defaults.js +1 -1
  348. package/dist/src/public/channels/slack/index.d.ts +1 -1
  349. package/dist/src/public/channels/slack/slackChannel.d.ts +65 -5
  350. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  351. package/dist/src/public/channels/teams/defaults.js +1 -1
  352. package/dist/src/public/connections/errors.d.ts +8 -0
  353. package/dist/src/public/definitions/tool.d.ts +0 -33
  354. package/dist/src/public/next/index.d.ts +7 -1
  355. package/dist/src/public/next/index.js +1 -1
  356. package/dist/src/public/next/server.d.ts +1 -0
  357. package/dist/src/public/next/server.js +1 -1
  358. package/dist/src/public/nuxt/dev-server.js +1 -1
  359. package/dist/src/public/sveltekit/dev-server.js +1 -1
  360. package/dist/src/public/sveltekit/index.d.ts +1 -1
  361. package/dist/src/public/tools/defaults.d.ts +2 -4
  362. package/dist/src/public/tools/defaults.js +1 -1
  363. package/dist/src/public/tools/define-bash-tool.d.ts +3 -3
  364. package/dist/src/public/tools/define-bash-tool.js +1 -1
  365. package/dist/src/public/tools/define-read-file-tool.d.ts +0 -6
  366. package/dist/src/public/tools/define-read-file-tool.js +1 -1
  367. package/dist/src/public/tools/index.d.ts +2 -2
  368. package/dist/src/public/tools/index.js +1 -1
  369. package/dist/src/public/tools/internal.js +1 -1
  370. package/dist/src/runtime/actions/types.d.ts +11 -11
  371. package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
  372. package/dist/src/runtime/agent/mock-model-fixtures.js +3 -2
  373. package/dist/src/runtime/agent/mock-model-skill-selection.js +3 -4
  374. package/dist/src/runtime/connections/callback-route.js +1 -1
  375. package/dist/src/runtime/connections/mcp-client.js +1 -1
  376. package/dist/src/runtime/connections/scoped-authorization.d.ts +21 -5
  377. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  378. package/dist/src/runtime/connections/types.d.ts +33 -0
  379. package/dist/src/runtime/connections/validate-authorization.js +1 -1
  380. package/dist/src/runtime/framework-tools/bash.d.ts +3 -3
  381. package/dist/src/runtime/framework-tools/bash.js +1 -1
  382. package/dist/src/runtime/framework-tools/connection-search-dynamic.d.ts +1 -1
  383. package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -1
  384. package/dist/src/runtime/framework-tools/file-state.d.ts +3 -3
  385. package/dist/src/runtime/framework-tools/index.js +1 -1
  386. package/dist/src/runtime/framework-tools/read-file.js +2 -2
  387. package/dist/src/runtime/framework-tools/todo.d.ts +7 -0
  388. package/dist/src/runtime/framework-tools/todo.js +2 -2
  389. package/dist/src/runtime/governance/auth/http-basic.js +1 -1
  390. package/dist/src/runtime/input/types.d.ts +1 -1
  391. package/dist/src/runtime/resolve-tool.d.ts +2 -2
  392. package/dist/src/runtime/resolve-tool.js +1 -1
  393. package/dist/src/runtime/sandbox/keys.js +1 -1
  394. package/dist/src/runtime/session-callback-route.js +1 -1
  395. package/dist/src/runtime/types.d.ts +1 -7
  396. package/dist/src/services/dev-client/client-options.d.ts +8 -0
  397. package/dist/src/services/dev-client/client-options.js +1 -0
  398. package/dist/src/services/dev-client/runtime-artifacts.d.ts +13 -0
  399. package/dist/src/services/dev-client/runtime-artifacts.js +1 -0
  400. package/dist/src/services/dev-client.d.ts +13 -46
  401. package/dist/src/services/dev-client.js +1 -1
  402. package/dist/src/setup/ask.d.ts +205 -0
  403. package/dist/src/setup/ask.js +1 -0
  404. package/dist/src/setup/boxes/add-channels.d.ts +100 -16
  405. package/dist/src/setup/boxes/add-channels.js +2 -1
  406. package/dist/src/setup/boxes/add-connections.d.ts +13 -23
  407. package/dist/src/setup/boxes/add-connections.js +1 -1
  408. package/dist/src/setup/boxes/apply-ai-gateway-credential.d.ts +2 -2
  409. package/dist/src/setup/boxes/apply-ai-gateway-credential.js +1 -1
  410. package/dist/src/setup/boxes/deploy-project.d.ts +46 -14
  411. package/dist/src/setup/boxes/deploy-project.js +1 -1
  412. package/dist/src/setup/boxes/detect-ai-gateway.d.ts +10 -3
  413. package/dist/src/setup/boxes/detect-ai-gateway.js +1 -1
  414. package/dist/src/setup/boxes/link-project.d.ts +3 -3
  415. package/dist/src/setup/boxes/link-project.js +1 -1
  416. package/dist/src/setup/boxes/one-shot-next-steps.d.ts +18 -0
  417. package/dist/src/setup/boxes/one-shot-next-steps.js +2 -0
  418. package/dist/src/setup/boxes/preflight.d.ts +14 -6
  419. package/dist/src/setup/boxes/preflight.js +1 -1
  420. package/dist/src/setup/boxes/resolve-provisioning.d.ts +36 -8
  421. package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
  422. package/dist/src/setup/boxes/resolve-target.d.ts +25 -8
  423. package/dist/src/setup/boxes/resolve-target.js +1 -1
  424. package/dist/src/setup/boxes/scaffold.d.ts +12 -6
  425. package/dist/src/setup/boxes/scaffold.js +1 -1
  426. package/dist/src/setup/boxes/select-channels.d.ts +38 -9
  427. package/dist/src/setup/boxes/select-channels.js +1 -1
  428. package/dist/src/setup/boxes/select-chat.d.ts +15 -11
  429. package/dist/src/setup/boxes/select-chat.js +1 -1
  430. package/dist/src/setup/boxes/select-connections.d.ts +30 -0
  431. package/dist/src/setup/boxes/select-connections.js +1 -0
  432. package/dist/src/setup/boxes/select-model.d.ts +18 -14
  433. package/dist/src/setup/boxes/select-model.js +1 -1
  434. package/dist/src/setup/boxes/select-setup-mode.d.ts +32 -0
  435. package/dist/src/setup/boxes/select-setup-mode.js +1 -0
  436. package/dist/src/setup/channel-add-conflicts.d.ts +28 -0
  437. package/dist/src/setup/channel-add-conflicts.js +1 -0
  438. package/dist/src/setup/cli/channel-setup-prompter.d.ts +23 -0
  439. package/dist/src/setup/cli/channel-setup-prompter.js +1 -0
  440. package/dist/src/setup/cli/connection-add-prompter.d.ts +8 -0
  441. package/dist/src/setup/cli/connection-add-prompter.js +1 -0
  442. package/dist/src/setup/{scaffold/cli → cli}/index.d.ts +4 -3
  443. package/dist/src/setup/cli/index.js +1 -0
  444. package/dist/src/setup/{scaffold/cli → cli}/prompt-ui.d.ts +39 -15
  445. package/dist/src/setup/cli/prompt-ui.js +5 -0
  446. package/dist/src/setup/{scaffold/cli → cli}/rail-log.d.ts +2 -0
  447. package/dist/src/setup/{scaffold/cli → cli}/rail-log.js +2 -2
  448. package/dist/src/setup/{scaffold/cli → cli}/select-component.d.ts +18 -3
  449. package/dist/src/setup/cli/select-component.js +1 -0
  450. package/dist/src/setup/cli/select-option-codec.d.ts +12 -0
  451. package/dist/src/setup/cli/select-option-codec.js +1 -0
  452. package/dist/src/setup/{scaffold/cli → cli}/select-state.d.ts +13 -1
  453. package/dist/src/setup/cli/select-state.js +1 -0
  454. package/dist/src/setup/cli/whimsy.d.ts +16 -0
  455. package/dist/src/setup/cli/whimsy.js +1 -0
  456. package/dist/src/setup/{scaffold/steps/setup-connection.d.ts → connection-connector.d.ts} +3 -2
  457. package/dist/src/setup/connection-connector.js +1 -0
  458. package/dist/src/setup/flows/channels.d.ts +43 -0
  459. package/dist/src/setup/flows/channels.js +1 -0
  460. package/dist/src/setup/flows/deploy.d.ts +40 -0
  461. package/dist/src/setup/flows/deploy.js +1 -0
  462. package/dist/src/setup/flows/in-project.d.ts +16 -0
  463. package/dist/src/setup/flows/in-project.js +1 -0
  464. package/dist/src/setup/flows/link.d.ts +43 -0
  465. package/dist/src/setup/flows/link.js +1 -0
  466. package/dist/src/setup/flows/model.d.ts +112 -0
  467. package/dist/src/setup/flows/model.js +1 -0
  468. package/dist/src/setup/flows/vercel.d.ts +31 -0
  469. package/dist/src/setup/flows/vercel.js +2 -0
  470. package/dist/src/setup/gateway-models.js +1 -1
  471. package/dist/src/setup/headless.d.ts +1 -1
  472. package/dist/src/setup/index.d.ts +10 -4
  473. package/dist/src/setup/index.js +1 -1
  474. package/dist/src/setup/onboarding.d.ts +7 -4
  475. package/dist/src/setup/onboarding.js +1 -1
  476. package/dist/src/setup/package-manager.d.ts +27 -0
  477. package/dist/src/setup/package-manager.js +1 -0
  478. package/dist/src/setup/primitives/index.d.ts +3 -0
  479. package/dist/src/setup/primitives/index.js +1 -0
  480. package/dist/src/setup/primitives/pm/bun.d.ts +10 -0
  481. package/dist/src/setup/primitives/pm/bun.js +1 -0
  482. package/dist/src/setup/primitives/pm/index.d.ts +11 -0
  483. package/dist/src/setup/primitives/pm/index.js +1 -0
  484. package/dist/src/setup/primitives/pm/npm.d.ts +10 -0
  485. package/dist/src/setup/primitives/pm/npm.js +1 -0
  486. package/dist/src/setup/primitives/pm/pnpm.d.ts +27 -0
  487. package/dist/src/setup/primitives/pm/pnpm.js +8 -0
  488. package/dist/src/setup/primitives/pm/run.d.ts +23 -0
  489. package/dist/src/setup/primitives/pm/run.js +1 -0
  490. package/dist/src/setup/primitives/pm/shared.d.ts +8 -0
  491. package/dist/src/setup/primitives/pm/shared.js +1 -0
  492. package/dist/src/setup/primitives/pm/types.d.ts +37 -0
  493. package/dist/src/setup/primitives/pm/types.js +1 -0
  494. package/dist/src/setup/primitives/pm/yarn.d.ts +10 -0
  495. package/dist/src/setup/primitives/pm/yarn.js +1 -0
  496. package/dist/src/setup/primitives/run-pnpm.d.ts +1 -0
  497. package/dist/src/setup/primitives/run-pnpm.js +1 -0
  498. package/dist/src/setup/{scaffold/primitives → primitives}/run-vercel.d.ts +7 -0
  499. package/dist/src/setup/primitives/run-vercel.js +1 -0
  500. package/dist/src/setup/project-name.d.ts +4 -0
  501. package/dist/src/setup/project-name.js +1 -0
  502. package/dist/src/setup/project-resolution.d.ts +54 -0
  503. package/dist/src/setup/project-resolution.js +1 -0
  504. package/dist/src/setup/prompter.d.ts +52 -4
  505. package/dist/src/setup/prompter.js +1 -1
  506. package/dist/src/setup/quit-guard.d.ts +1 -1
  507. package/dist/src/setup/run-vercel-link.d.ts +1 -1
  508. package/dist/src/setup/run-vercel-link.js +1 -1
  509. package/dist/src/setup/runner.d.ts +5 -4
  510. package/dist/src/setup/runner.js +1 -1
  511. package/dist/src/setup/scaffold/channels-catalog.d.ts +3 -3
  512. package/dist/src/setup/scaffold/channels-catalog.js +1 -1
  513. package/dist/src/setup/scaffold/create/add-to-project.d.ts +26 -0
  514. package/dist/src/setup/scaffold/create/add-to-project.js +1 -0
  515. package/dist/src/setup/scaffold/create/project.d.ts +54 -0
  516. package/dist/src/setup/scaffold/create/project.js +80 -0
  517. package/dist/src/setup/scaffold/index.d.ts +4 -4
  518. package/dist/src/setup/scaffold/index.js +1 -1
  519. package/dist/src/setup/scaffold/{channels.d.ts → update/channels.d.ts} +11 -0
  520. package/dist/src/setup/scaffold/update/channels.js +7 -0
  521. package/dist/src/setup/scaffold/{connections.d.ts → update/connections.d.ts} +1 -1
  522. package/dist/src/setup/scaffold/update/connections.js +21 -0
  523. package/dist/src/setup/scaffold/version-tokens.d.ts +11 -0
  524. package/dist/src/setup/scaffold/version-tokens.js +1 -0
  525. package/dist/src/setup/{scaffold/steps/setup-slackbot.d.ts → slackbot.d.ts} +24 -20
  526. package/dist/src/setup/slackbot.js +1 -0
  527. package/dist/src/setup/state.d.ts +62 -15
  528. package/dist/src/setup/state.js +1 -1
  529. package/dist/src/setup/step.d.ts +9 -18
  530. package/dist/src/setup/vercel-project.d.ts +15 -8
  531. package/dist/src/setup/vercel-project.js +1 -1
  532. package/dist/src/shared/agent-definition.d.ts +5 -3
  533. package/dist/src/shared/default-agent-model.d.ts +5 -0
  534. package/dist/src/shared/default-agent-model.js +1 -0
  535. package/dist/src/source-change/apply-model-name.d.ts +25 -0
  536. package/dist/src/source-change/apply-model-name.js +2 -0
  537. package/dist/src/source-change/static-source-change.d.ts +36 -0
  538. package/dist/src/source-change/static-source-change.js +1 -0
  539. package/dist/src/svelte/index.js +1 -1
  540. package/dist/src/svelte/use-eve-agent.js +1 -1
  541. package/dist/src/vue/index.js +1 -1
  542. package/dist/src/vue/use-eve-agent.js +1 -1
  543. package/package.json +22 -42
  544. package/dist/docs/evals-v2-plan.md +0 -939
  545. package/dist/docs/public/advanced/dev-tui.md +0 -52
  546. package/dist/docs/public/advanced/evals.md +0 -158
  547. package/dist/docs/public/reference/faqs.md +0 -48
  548. package/dist/src/cli/commands/setup.d.ts +0 -55
  549. package/dist/src/cli/commands/setup.js +0 -1
  550. package/dist/src/cli/dev/repl/input-requests.d.ts +0 -38
  551. package/dist/src/cli/dev/repl/input-requests.js +0 -1
  552. package/dist/src/cli/dev/repl/input.d.ts +0 -19
  553. package/dist/src/cli/dev/repl/input.js +0 -1
  554. package/dist/src/cli/dev/repl/repl.d.ts +0 -62
  555. package/dist/src/cli/dev/repl/repl.js +0 -2
  556. package/dist/src/cli/dev/repl/terminal.d.ts +0 -21
  557. package/dist/src/cli/dev/repl/terminal.js +0 -5
  558. package/dist/src/compiled/_chunks/workflow/resume-hook-0Zk0zSvq.js +0 -12
  559. package/dist/src/compiled/_chunks/workflow/sleep-DXZr2BgM.js +0 -1
  560. package/dist/src/compiled/_chunks/workflow/symbols-BWCAoPHE.js +0 -48
  561. package/dist/src/evals/checks/checks.d.ts +0 -66
  562. package/dist/src/evals/checks/checks.js +0 -2
  563. package/dist/src/evals/checks/index.d.ts +0 -21
  564. package/dist/src/evals/checks/index.js +0 -1
  565. package/dist/src/evals/checks/match.js +0 -1
  566. package/dist/src/evals/define-eval-suite.d.ts +0 -18
  567. package/dist/src/evals/define-eval-suite.js +0 -1
  568. package/dist/src/evals/runner/execute-case.d.ts +0 -23
  569. package/dist/src/evals/runner/execute-case.js +0 -1
  570. package/dist/src/evals/runner/execute-suite.d.ts +0 -24
  571. package/dist/src/evals/runner/execute-suite.js +0 -1
  572. package/dist/src/evals/scorers/autoevals-client.js +0 -2
  573. package/dist/src/evals/scorers/autoevals.d.ts +0 -58
  574. package/dist/src/evals/scorers/autoevals.js +0 -1
  575. package/dist/src/evals/scorers/json.d.ts +0 -10
  576. package/dist/src/evals/scorers/json.js +0 -1
  577. package/dist/src/evals/scorers/model-marker.d.ts +0 -12
  578. package/dist/src/evals/scorers/model-marker.js +0 -1
  579. package/dist/src/evals/scorers/run.d.ts +0 -24
  580. package/dist/src/evals/scorers/run.js +0 -1
  581. package/dist/src/evals/scorers/sql.d.ts +0 -9
  582. package/dist/src/evals/scorers/sql.js +0 -1
  583. package/dist/src/evals/scorers/text.d.ts +0 -18
  584. package/dist/src/evals/scorers/text.js +0 -1
  585. package/dist/src/evals/scores/index.d.ts +0 -72
  586. package/dist/src/evals/scores/index.js +0 -1
  587. package/dist/src/execution/tool-compaction.d.ts +0 -9
  588. package/dist/src/execution/tool-compaction.js +0 -1
  589. package/dist/src/services/dev-client/stream.d.ts +0 -5
  590. package/dist/src/services/dev-client/stream.js +0 -1
  591. package/dist/src/services/dev-client/url.d.ts +0 -11
  592. package/dist/src/services/dev-client/url.js +0 -1
  593. package/dist/src/setup/channel-setup-prompter.d.ts +0 -8
  594. package/dist/src/setup/channel-setup-prompter.js +0 -1
  595. package/dist/src/setup/scaffold/channels.js +0 -7
  596. package/dist/src/setup/scaffold/cli/channel-add-prompter.d.ts +0 -12
  597. package/dist/src/setup/scaffold/cli/channel-add-prompter.js +0 -1
  598. package/dist/src/setup/scaffold/cli/channel-setup-prompter.d.ts +0 -56
  599. package/dist/src/setup/scaffold/cli/connection-add-prompter.d.ts +0 -44
  600. package/dist/src/setup/scaffold/cli/connection-add-prompter.js +0 -1
  601. package/dist/src/setup/scaffold/cli/index.js +0 -1
  602. package/dist/src/setup/scaffold/cli/prompt-ui.js +0 -5
  603. package/dist/src/setup/scaffold/cli/select-component.js +0 -1
  604. package/dist/src/setup/scaffold/cli/select-state.js +0 -1
  605. package/dist/src/setup/scaffold/connections.js +0 -21
  606. package/dist/src/setup/scaffold/pnpm-workspace.d.ts +0 -3
  607. package/dist/src/setup/scaffold/pnpm-workspace.js +0 -11
  608. package/dist/src/setup/scaffold/primitives/detect-deployment.d.ts +0 -13
  609. package/dist/src/setup/scaffold/primitives/detect-deployment.js +0 -1
  610. package/dist/src/setup/scaffold/primitives/index.d.ts +0 -3
  611. package/dist/src/setup/scaffold/primitives/index.js +0 -1
  612. package/dist/src/setup/scaffold/primitives/pnpm-invocation.d.ts +0 -12
  613. package/dist/src/setup/scaffold/primitives/pnpm-invocation.js +0 -1
  614. package/dist/src/setup/scaffold/primitives/run-pnpm.d.ts +0 -17
  615. package/dist/src/setup/scaffold/primitives/run-pnpm.js +0 -1
  616. package/dist/src/setup/scaffold/primitives/run-vercel.js +0 -1
  617. package/dist/src/setup/scaffold/project.d.ts +0 -21
  618. package/dist/src/setup/scaffold/project.js +0 -80
  619. package/dist/src/setup/scaffold/steps/deploy-to-vercel.d.ts +0 -17
  620. package/dist/src/setup/scaffold/steps/deploy-to-vercel.js +0 -1
  621. package/dist/src/setup/scaffold/steps/index.d.ts +0 -4
  622. package/dist/src/setup/scaffold/steps/index.js +0 -1
  623. package/dist/src/setup/scaffold/steps/project-resolution.d.ts +0 -19
  624. package/dist/src/setup/scaffold/steps/project-resolution.js +0 -1
  625. package/dist/src/setup/scaffold/steps/run-add-connection.d.ts +0 -40
  626. package/dist/src/setup/scaffold/steps/run-add-connection.js +0 -1
  627. package/dist/src/setup/scaffold/steps/run-add-to-agent.d.ts +0 -81
  628. package/dist/src/setup/scaffold/steps/run-add-to-agent.js +0 -2
  629. package/dist/src/setup/scaffold/steps/setup-connection.js +0 -1
  630. package/dist/src/setup/scaffold/steps/setup-slackbot.js +0 -1
  631. /package/dist/docs/public/{frontend → guides/frontend}/meta.json +0 -0
  632. /package/dist/docs/public/{advanced → guides}/remote-agents.md +0 -0
  633. /package/dist/src/{setup/scaffold/cli/channel-setup-prompter.js → cli/dev/tui/setup-flow.js} +0 -0
  634. /package/dist/src/evals/{scorers/autoevals-client.d.ts → autoevals-client.d.ts} +0 -0
  635. /package/dist/src/setup/{scaffold/cli → cli}/command-output.d.ts +0 -0
  636. /package/dist/src/setup/{scaffold/cli → cli}/command-output.js +0 -0
  637. /package/dist/src/setup/{scaffold/human-action.d.ts → human-action.d.ts} +0 -0
  638. /package/dist/src/setup/{scaffold/human-action.js → human-action.js} +0 -0
  639. /package/dist/src/setup/{scaffold/primitives → primitives}/process-output.d.ts +0 -0
  640. /package/dist/src/setup/{scaffold/primitives → primitives}/process-output.js +0 -0
  641. /package/dist/src/setup/scaffold/{web-template.d.ts → create/web-template.d.ts} +0 -0
  642. /package/dist/src/setup/scaffold/{web-template.js → create/web-template.js} +0 -0
  643. /package/dist/src/setup/scaffold/{module-files.d.ts → update/module-files.d.ts} +0 -0
  644. /package/dist/src/setup/scaffold/{module-files.js → update/module-files.js} +0 -0
  645. /package/dist/src/setup/scaffold/{package-json.d.ts → update/package-json.d.ts} +0 -0
  646. /package/dist/src/setup/scaffold/{package-json.js → update/package-json.js} +0 -0
  647. /package/dist/src/setup/scaffold/{primitives → update}/update-connection-connector.d.ts +0 -0
  648. /package/dist/src/setup/scaffold/{primitives → update}/update-connection-connector.js +0 -0
  649. /package/dist/src/setup/scaffold/{primitives → update}/update-slack-channel.d.ts +0 -0
  650. /package/dist/src/setup/scaffold/{primitives → update}/update-slack-channel.js +0 -0
@@ -0,0 +1,26 @@
1
+ import type { PackageManagerKind } from "../../package-manager.js";
2
+ export interface AddAgentToProjectOptions {
3
+ projectRoot: string;
4
+ model: string;
5
+ /**
6
+ * The host project's package manager, which owns any manager-specific
7
+ * generated project configuration. Defaults to pnpm.
8
+ */
9
+ packageManager?: PackageManagerKind;
10
+ evePackageVersion?: string;
11
+ aiPackageVersion?: string;
12
+ zodPackageVersion?: string;
13
+ }
14
+ export interface AddAgentToProjectResult {
15
+ filesWritten: string[];
16
+ /** Dependencies added to package.json; ones the project already declares anywhere are left untouched. */
17
+ dependenciesAdded: string[];
18
+ }
19
+ /**
20
+ * Adds an Eve agent to an existing package: writes the `agent/` files, adds
21
+ * the runtime dependencies the project does not already declare, and applies
22
+ * the selected package manager's project configuration. The host project owns
23
+ * everything else (tsconfig, scripts, ignore files), so this mode never
24
+ * touches it. All conflicts are gathered and reported before anything is written.
25
+ */
26
+ export declare function addAgentToProject(options: AddAgentToProjectOptions): Promise<AddAgentToProjectResult>;
@@ -0,0 +1 @@
1
+ import{getPackageManagerStrategy}from"../../primitives/pm/index.js";import{pathExists,writeTextFile}from"../files.js";import{patchPackageJson}from"../update/package-json.js";import{resolveVersionToken}from"../version-tokens.js";import{agentTemplateFiles,formatEveDependencySpecifier}from"./project.js";import{join}from"node:path";import{readFile}from"node:fs/promises";const DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`];function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hasDeclaredDependency(e,t){if(!isJsonObject(e))return!1;for(let n of DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function addAgentToProject(i){let a=join(i.projectRoot,`package.json`);if(!await pathExists(a))throw Error(`Cannot add an Eve agent to "${i.projectRoot}" because it has no package.json. Run \`eve init <name>\` to create a new project instead.`);let o=agentTemplateFiles(i.model),s=[];for(let e of Object.keys(o))await pathExists(join(i.projectRoot,e))&&s.push(e);if(s.length===0&&await pathExists(join(i.projectRoot,`agent`))&&s.push(`agent/`),s.length>0)throw Error(`Cannot add an Eve agent to "${i.projectRoot}" because it already has: ${s.join(`, `)}. Move them aside first.`);let c=resolveVersionToken(`evePackageVersion`,i.evePackageVersion??`0.7.2`),l=resolveVersionToken(`aiPackageVersion`,i.aiPackageVersion??`7.0.0-canary.171`),u=resolveVersionToken(`zodPackageVersion`,i.zodPackageVersion??`4.4.3`),d=[];for(let[e,t]of Object.entries(o)){let r=join(i.projectRoot,e);await writeTextFile(r,t),d.push(r)}let f=JSON.parse(await readFile(a,`utf8`)),p={ai:l,eve:formatEveDependencySpecifier(c),zod:u},m={};for(let[e,t]of Object.entries(p))hasDeclaredDependency(f,e)||(m[e]=t);return Object.keys(m).length>0&&await patchPackageJson(a,{dependencies:m}),await getPackageManagerStrategy(i.packageManager??`pnpm`).applyProjectConfiguration(i.projectRoot),{filesWritten:d,dependenciesAdded:Object.keys(m).sort()}}export{addAgentToProject};
@@ -0,0 +1,54 @@
1
+ import type { PackageManagerKind } from "../../package-manager.js";
2
+ export declare const CURRENT_DIRECTORY_PROJECT_NAME = ".";
3
+ export declare const DEFAULT_EVE_PACKAGE_VERSION = "__EVE_PACKAGE_VERSION__";
4
+ export declare const DEFAULT_AI_PACKAGE_VERSION = "__AI_SDK_VERSION__";
5
+ export declare const DEFAULT_ZOD_PACKAGE_VERSION = "__ZOD_VERSION__";
6
+ /**
7
+ * Provider slug a gateway model id routes through: the segment before the
8
+ * first "/" (e.g. `anthropic/claude-sonnet-4.6` → `anthropic`). The slug is
9
+ * injected into generated source, so characters outside the catalog's slug
10
+ * alphabet are dropped; an id without a usable prefix falls back to
11
+ * `anthropic`.
12
+ */
13
+ export declare function modelProviderSlug(modelId: string): string;
14
+ /**
15
+ * Env var the byok scaffold reads the provider API key from, derived from the
16
+ * model's provider slug (e.g. `anthropic/...` → `ANTHROPIC_API_KEY`). The name
17
+ * is the scaffold's convention: the key is passed to the gateway `byok` block
18
+ * explicitly, so users can rename it freely. Non-alphanumerics fold to `_`
19
+ * and a leading digit is prefixed, keeping `process.env.<name>` valid source.
20
+ */
21
+ export declare function byokProviderEnvVar(modelId: string): string;
22
+ /**
23
+ * The files that define the agent itself, rendered for `model`. This is the
24
+ * subset `eve init` writes when adding an agent to an existing project, where
25
+ * everything outside `agent/` belongs to the host app.
26
+ */
27
+ export declare function agentTemplateFiles(model: string): Record<string, string>;
28
+ export declare function formatEveDependencySpecifier(versionOrSpecifier: string): string;
29
+ export interface ScaffoldBaseProjectOptions {
30
+ projectName: string;
31
+ model: string;
32
+ /**
33
+ * The manager that owns command execution and manager-specific generated
34
+ * project files for this scaffold.
35
+ * Defaults to pnpm.
36
+ */
37
+ packageManager?: PackageManagerKind;
38
+ targetDirectory?: string;
39
+ overwriteExisting?: boolean;
40
+ onOverwriteFile?: (filePath: string) => void | Promise<void>;
41
+ evePackageVersion?: string;
42
+ aiPackageVersion?: string;
43
+ zodPackageVersion?: string;
44
+ tsgoPackageVersion?: string;
45
+ typesNodePackageVersion?: string;
46
+ /**
47
+ * Scaffold an inline provider `byok` block in `agent.ts` that reads the
48
+ * provider key from `process.env` instead of relying on the managed Vercel
49
+ * AI Gateway. Adds `@types/node` to the project so `process` is typed.
50
+ */
51
+ byokProvider?: boolean;
52
+ }
53
+ export declare function scaffoldBaseProject(options: ScaffoldBaseProjectOptions): Promise<string>;
54
+ export declare function isEveProject(projectRoot: string): Promise<boolean>;
@@ -0,0 +1,80 @@
1
+ import{getPackageManagerStrategy}from"../../primitives/pm/index.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_EVE_PACKAGE_VERSION=`0.7.2`,DEFAULT_AI_PACKAGE_VERSION=`7.0.0-canary.171`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`;function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e){return{"agent/agent.ts":BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.evePackageVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TSGO_VERSION__`,t.tsgoPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.typesNodePackageVersion)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
2
+
3
+ export default defineAgent({
4
+ model: "__EVE_INIT_MODEL__",
5
+ });
6
+ `;function packageJsonTemplate(e){return`{
7
+ "name": "__EVE_INIT_APP_NAME__",
8
+ "version": "0.0.0",
9
+ "type": "module",
10
+ "imports": {
11
+ "#*": "./agent/*",
12
+ "#evals/*": "./evals/*"
13
+ },
14
+ "scripts": {
15
+ "build": "eve build",
16
+ "dev": "eve dev",
17
+ "start": "eve start",
18
+ "typecheck": "tsgo"
19
+ },
20
+ "dependencies": {
21
+ "ai": "__EVE_INIT_AI_SDK_VERSION__",
22
+ "eve": "__EVE_INIT_PACKAGE_VERSION__",
23
+ "zod": "__EVE_INIT_ZOD_VERSION__"
24
+ },
25
+ "devDependencies": {
26
+ ${e?` "@types/node": "__EVE_INIT_TYPES_NODE_VERSION__",
27
+ "@typescript/native-preview": "__EVE_INIT_TSGO_VERSION__"`:` "@typescript/native-preview": "__EVE_INIT_TSGO_VERSION__"`}
28
+ }
29
+ }
30
+ `}const AGENT_INSTRUCTIONS_TEMPLATE=`# Identity
31
+
32
+ You are a helpful assistant.
33
+ `,SHARED_TEMPLATE_FILES={"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE,"tsconfig.json":`{
34
+ "compilerOptions": {
35
+ "target": "ES2022",
36
+ "module": "NodeNext",
37
+ "moduleResolution": "NodeNext",
38
+ "strict": true,
39
+ "esModuleInterop": true,
40
+ "skipLibCheck": true,
41
+ "noEmit": true
42
+ },
43
+ "include": ["agent/**/*.ts", "evals/**/*.ts", ".eve/**/*.d.ts"]
44
+ }
45
+ `,".gitignore":`node_modules
46
+ .env*
47
+ .eve
48
+ .vercel
49
+ .workflow-data
50
+ .next
51
+ .output
52
+ .nitro
53
+ dist
54
+ .DS_Store
55
+ *.tsbuildinfo
56
+ `,".vercelignore":`node_modules
57
+ .eve
58
+ .next
59
+ .output
60
+ .nitro
61
+ dist
62
+ `,"AGENTS.md":`# Eve Agent App
63
+
64
+ This project uses the Eve framework. Before writing code, always read the relevant guide in \`node_modules/eve/dist/docs/public/\`.
65
+ `,"CLAUDE.md":`@AGENTS.md
66
+ `};function templateFiles(t,n){return{"agent/agent.ts":t?`import { defineAgent } from "eve";
67
+
68
+ export default defineAgent({
69
+ model: "__EVE_INIT_MODEL__",
70
+ modelOptions: {
71
+ providerOptions: {
72
+ gateway: {
73
+ byok: {
74
+ "__EVE_INIT_BYOK_PROVIDER__": [{ apiKey: process.env.__EVE_INIT_BYOK_ENV_VAR__! }],
75
+ },
76
+ },
77
+ },
78
+ },
79
+ });
80
+ `:BASE_AGENT_TEMPLATE,...SHARED_TEMPLATE_FILES,"package.json":packageJsonTemplate(t),...getPackageManagerStrategy(n).scaffoldFiles}}async function assertCanCreateInPlace(e,n){if(!await pathExists(e))return;let r=(await readdir(e)).filter(e=>!ALLOWED_CREATE_IN_PLACE_ENTRIES.has(e));if(r.length>0&&!n){let e=r.slice(0,5).join(`, `),t=r.length>5?`, and ${r.length-5} more`:``;throw Error(`Cannot create project in current directory because it is not empty. Found: ${e}${t}. Use an empty directory.`)}}async function scaffoldBaseProject(e){let i=resolve(e.targetDirectory??process.cwd(),e.projectName),a=e.projectName===`.`,s=e.overwriteExisting??!1,u=e.byokProvider??!1,d=e.packageManager??`pnpm`;if(a)await assertCanCreateInPlace(i,s);else if(await pathExists(i))throw Error(`Cannot create project because "${i}" already exists.`);let f=e.typesNodePackageVersion??`25.9.1`,p={appName:basename(i),model:e.model,evePackageVersion:resolveVersionToken(`evePackageVersion`,e.evePackageVersion??`0.7.2`),aiPackageVersion:resolveVersionToken(`aiPackageVersion`,e.aiPackageVersion??`7.0.0-canary.171`),zodPackageVersion:resolveVersionToken(`zodPackageVersion`,e.zodPackageVersion??`4.4.3`),tsgoPackageVersion:resolveVersionToken(`tsgoPackageVersion`,e.tsgoPackageVersion??`7.0.0-dev.20260523.1`),typesNodePackageVersion:u?resolveVersionToken(`typesNodePackageVersion`,f):f};await mkdir(i,{recursive:!0});for(let[r,o]of Object.entries(templateFiles(u,d))){let c=`${i}/${r}`,l=await pathExists(c);await writeTextFile(c,renderTemplate(o,p),{force:a&&s}),l&&await e.onOverwriteFile?.(c)}return i}async function isEveProject(e){for(let t of SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS)try{return await stat(join(e,`agent`,`agent${t}`)),!0}catch{}return!1}export{CURRENT_DIRECTORY_PROJECT_NAME,DEFAULT_AI_PACKAGE_VERSION,DEFAULT_EVE_PACKAGE_VERSION,DEFAULT_ZOD_PACKAGE_VERSION,agentTemplateFiles,byokProviderEnvVar,formatEveDependencySpecifier,isEveProject,modelProviderSlug,scaffoldBaseProject};
@@ -1,7 +1,7 @@
1
- export { CURRENT_DIRECTORY_PROJECT_NAME, isEveProject, scaffoldBaseProject, type ScaffoldBaseProjectOptions, } from "./project.js";
2
- export { DEFAULT_SLACK_CONNECTOR_SLUG, SLACK_CHANNEL_DEFAULT_ROUTE, deriveSlackConnectorSlug, ensureChannel, listAuthoredChannels, normalizeSlackConnectorSlug, type ChannelKind, type ChannelMutationResult, type EnsureChannelOptions, type SlackConnectorSlug, type WebPackageVersions, } from "./channels.js";
1
+ export { byokProviderEnvVar, CURRENT_DIRECTORY_PROJECT_NAME, isEveProject, scaffoldBaseProject, type ScaffoldBaseProjectOptions, } from "./create/project.js";
2
+ export { DEFAULT_SLACK_CONNECTOR_SLUG, SLACK_CHANNEL_DEFAULT_ROUTE, deriveSlackConnectorSlug, ensureChannel, isNextJsProject, listAuthoredChannels, normalizeSlackConnectorSlug, type ChannelKind, type ChannelMutationResult, type EnsureChannelOptions, type SlackConnectorSlug, type WebPackageVersions, } from "./update/channels.js";
3
3
  export { SCAFFOLDABLE_CHANNELS, type ScaffoldableChannel } from "./channels-catalog.js";
4
- export { ensureConnection, listAuthoredConnections, type ConnectionInput, type ConnectionMutationAction, type ConnectionMutationResult, type EnsureConnectionOptions, } from "./connections.js";
4
+ export { ensureConnection, listAuthoredConnections, type ConnectionInput, type ConnectionMutationAction, type ConnectionMutationResult, type EnsureConnectionOptions, } from "./update/connections.js";
5
5
  export { catalogSlugs, CONNECTION_CATALOG, CUSTOM_CONNECTION_SLUG, effectiveProtocols, endpointForProtocol, getCatalogEntry, isValidConnectionSlug, SUPPORTED_PROTOCOLS, type ConnectionAuthSpec, type ConnectionCatalogEntry, type ConnectionProtocol, type CustomConnectionInput, type EnvHeader, type McpEndpoint, type OpenApiEndpoint, } from "./connections/catalog.js";
6
6
  export { WriteFileExistsError } from "./files.js";
7
- export { HumanActionRequiredError, type HumanAction } from "./human-action.js";
7
+ export { HumanActionRequiredError, type HumanAction } from "../human-action.js";
@@ -1 +1 @@
1
- import{SCAFFOLDABLE_CHANNELS}from"./channels-catalog.js";import{WriteFileExistsError}from"./files.js";import{CURRENT_DIRECTORY_PROJECT_NAME,isEveProject,scaffoldBaseProject}from"./project.js";import{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,listAuthoredChannels,normalizeSlackConnectorSlug}from"./channels.js";import{CONNECTION_CATALOG,CUSTOM_CONNECTION_SLUG,SUPPORTED_PROTOCOLS,catalogSlugs,effectiveProtocols,endpointForProtocol,getCatalogEntry,isValidConnectionSlug}from"./connections/catalog.js";import{ensureConnection,listAuthoredConnections}from"./connections.js";import{HumanActionRequiredError}from"./human-action.js";export{CONNECTION_CATALOG,CURRENT_DIRECTORY_PROJECT_NAME,CUSTOM_CONNECTION_SLUG,DEFAULT_SLACK_CONNECTOR_SLUG,HumanActionRequiredError,SCAFFOLDABLE_CHANNELS,SLACK_CHANNEL_DEFAULT_ROUTE,SUPPORTED_PROTOCOLS,WriteFileExistsError,catalogSlugs,deriveSlackConnectorSlug,effectiveProtocols,endpointForProtocol,ensureChannel,ensureConnection,getCatalogEntry,isEveProject,isValidConnectionSlug,listAuthoredChannels,listAuthoredConnections,normalizeSlackConnectorSlug,scaffoldBaseProject};
1
+ import{HumanActionRequiredError}from"../human-action.js";import{SCAFFOLDABLE_CHANNELS}from"./channels-catalog.js";import{CONNECTION_CATALOG,CUSTOM_CONNECTION_SLUG,SUPPORTED_PROTOCOLS,catalogSlugs,effectiveProtocols,endpointForProtocol,getCatalogEntry,isValidConnectionSlug}from"./connections/catalog.js";import{WriteFileExistsError}from"./files.js";import{CURRENT_DIRECTORY_PROJECT_NAME,byokProviderEnvVar,isEveProject,scaffoldBaseProject}from"./create/project.js";import{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug}from"./update/channels.js";import{ensureConnection,listAuthoredConnections}from"./update/connections.js";export{CONNECTION_CATALOG,CURRENT_DIRECTORY_PROJECT_NAME,CUSTOM_CONNECTION_SLUG,DEFAULT_SLACK_CONNECTOR_SLUG,HumanActionRequiredError,SCAFFOLDABLE_CHANNELS,SLACK_CHANNEL_DEFAULT_ROUTE,SUPPORTED_PROTOCOLS,WriteFileExistsError,byokProviderEnvVar,catalogSlugs,deriveSlackConnectorSlug,effectiveProtocols,endpointForProtocol,ensureChannel,ensureConnection,getCatalogEntry,isEveProject,isNextJsProject,isValidConnectionSlug,listAuthoredChannels,listAuthoredConnections,normalizeSlackConnectorSlug,scaffoldBaseProject};
@@ -1,3 +1,4 @@
1
+ import type { PackageManagerKind } from "../../package-manager.js";
1
2
  export declare const SLACK_CHANNEL_DEFAULT_ROUTE = "/eve/v1/slack";
2
3
  export declare const DEFAULT_SLACK_CONNECTOR_SLUG = "my-agent";
3
4
  declare const slackConnectorSlugBrand: unique symbol;
@@ -50,11 +51,21 @@ interface WebChannelSkippedResult {
50
51
  packageJsonUpdated: [];
51
52
  }
52
53
  type WebChannelMutationResult = WebChannelWrittenResult | WebChannelSkippedResult;
54
+ /**
55
+ * Whether the project already carries a Next.js app: `package.json` declares a
56
+ * `next` dependency in any dependency field. This is the exact predicate the
57
+ * web scaffold skips on (`skipReason: "nextjs-project"`), so pickers can mark
58
+ * Web Chat as already present precisely when scaffolding would be a no-op.
59
+ * A missing `package.json` reads as "no app".
60
+ */
61
+ export declare function isNextJsProject(projectRoot: string): Promise<boolean>;
53
62
  export declare function normalizeSlackConnectorSlug(input: string): SlackConnectorSlug;
54
63
  export declare function deriveSlackConnectorSlug(projectRoot: string, projectNameHint?: string): Promise<SlackConnectorSlug>;
55
64
  export interface EnsureChannelOptions {
56
65
  projectRoot: string;
57
66
  kind: ChannelKind;
67
+ /** Manager that owns generated project configuration. Defaults to pnpm. */
68
+ packageManager?: PackageManagerKind;
58
69
  force?: boolean;
59
70
  slackConnectorSlug?: SlackConnectorSlug;
60
71
  connectPackageVersion?: string;
@@ -0,0 +1,7 @@
1
+ import{getPackageManagerStrategy}from"../../primitives/pm/index.js";import{pathExists,writeTextFile}from"../files.js";import{patchPackageJson}from"./package-json.js";import{resolveVersionToken}from"../version-tokens.js";import{getSupportedModuleBaseName,matchesSupportedModuleBaseName}from"./module-files.js";import{WEB_APP_TEMPLATE_FILES,WEB_APP_TEMPLATE_PACKAGE_JSON}from"../create/web-template.js";import"../create/project.js";import{basename,join,resolve}from"node:path";import{readFile,readdir,writeFile}from"node:fs/promises";const SLACK_CHANNEL_DEFAULT_ROUTE=`/eve/v1/slack`,DEFAULT_SLACK_CONNECTOR_SLUG=`my-agent`,PACKAGE_DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],WEB_NEXT_CONFIG_PATH=`next.config.ts`,WEB_VERCEL_JSON_PATH=`vercel.json`,WEB_VERCEL_JSON_SCHEMA=`https://openapi.vercel.sh/vercel.json`,WEB_COMPETING_NEXT_CONFIG_PATHS=[`next.config.js`,`next.config.mjs`,WEB_NEXT_CONFIG_PATH,`next.config.mts`].filter(e=>e!==WEB_NEXT_CONFIG_PATH),WEB_DEFAULT_VERCEL_SERVICES={web:{entrypoint:`.`,framework:`nextjs`,routePrefix:`/`},eve:{buildCommand:`eve build`,entrypoint:`.`,framework:`eve`,routePrefix:`/_eve_internal/eve`}};function toSlackConnectorSlug(e){return e}function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function readDependencyVersion(e,t){let n=JSON.parse(await readFile(e,`utf8`));if(!isJsonObject(n)||!isJsonObject(n.dependencies))return;let r=n.dependencies[t];return typeof r==`string`?r:void 0}function packageJsonHasDependency(e,t){for(let n of PACKAGE_DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function hasPackageDependency(e,n){if(!await pathExists(e))return!1;let r=JSON.parse(await readFile(e,`utf8`));return isJsonObject(r)&&packageJsonHasDependency(r,n)}async function isNextJsProject(e){return hasPackageDependency(join(e,`package.json`),`next`)}async function ensurePackageDependency(e,n,i){return!await pathExists(e)||await readDependencyVersion(e,n)===i?[]:(await patchPackageJson(e,{dependencies:{[n]:i}}),[{path:e,dependencies:[n],devDependencies:[],scripts:[]}])}function resolveWebPackageVersions(e){return{evePackageVersion:e?.evePackageVersion??`0.7.2`,aiPackageVersion:e?.aiPackageVersion??`7.0.0-canary.171`,nextPackageVersion:e?.nextPackageVersion??`16.2.6`,reactPackageVersion:e?.reactPackageVersion??`19.2.6`,reactDomPackageVersion:e?.reactDomPackageVersion??`19.2.6`,streamdownPackageVersion:e?.streamdownPackageVersion??`2.5.0`,zodPackageVersion:e?.zodPackageVersion??`4.4.3`,tsgoPackageVersion:e?.tsgoPackageVersion??`7.0.0-dev.20260523.1`,typesNodePackageVersion:e?.typesNodePackageVersion??`25.9.1`,typesReactPackageVersion:e?.typesReactPackageVersion??`19.2.15`,typesReactDomPackageVersion:e?.typesReactDomPackageVersion??`19.2.3`}}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}async function patchWebPackageJson(e,n){if(!await pathExists(e))return[];let a={...WEB_APP_TEMPLATE_PACKAGE_JSON.dependencies,ai:resolveVersionToken(`aiPackageVersion`,n.aiPackageVersion),eve:formatEveDependencySpecifier(resolveVersionToken(`evePackageVersion`,n.evePackageVersion)),next:resolveVersionToken(`nextPackageVersion`,n.nextPackageVersion),react:resolveVersionToken(`reactPackageVersion`,n.reactPackageVersion),"react-dom":resolveVersionToken(`reactDomPackageVersion`,n.reactDomPackageVersion),streamdown:resolveVersionToken(`streamdownPackageVersion`,n.streamdownPackageVersion),zod:resolveVersionToken(`zodPackageVersion`,n.zodPackageVersion)},o={...WEB_APP_TEMPLATE_PACKAGE_JSON.devDependencies,"@types/node":resolveVersionToken(`typesNodePackageVersion`,n.typesNodePackageVersion),"@types/react":resolveVersionToken(`typesReactPackageVersion`,n.typesReactPackageVersion),"@types/react-dom":resolveVersionToken(`typesReactDomPackageVersion`,n.typesReactDomPackageVersion),"@typescript/native-preview":resolveVersionToken(`tsgoPackageVersion`,n.tsgoPackageVersion)},s=WEB_APP_TEMPLATE_PACKAGE_JSON.scripts;return await patchPackageJson(e,{dependencies:a,devDependencies:o,scripts:s}),[{path:e,dependencies:Object.keys(a),devDependencies:Object.keys(o),scripts:Object.keys(s)}]}function normalizeSlackConnectorSlug(e){return toSlackConnectorSlug((e.trim().replace(/^@/,``).split(`/`).at(-1)??``).toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^[^a-z0-9]+/,``).replace(/[^a-z0-9]+$/,``).slice(0,100).replace(/[^a-z0-9]+$/,``)||`my-agent`)}async function deriveSlackConnectorSlug(e,t){if(t!==void 0&&t.length>0&&t!==`.`)return normalizeSlackConnectorSlug(t);try{let t=await readFile(join(e,`package.json`),`utf8`),n=JSON.parse(t);if(typeof n.name==`string`&&n.name.length>0)return normalizeSlackConnectorSlug(n.name)}catch{}return normalizeSlackConnectorSlug(basename(resolve(e))||`my-agent`)}function buildSlackTemplate(e){return`import { connectSlackCredentials } from "@vercel/connect/eve";
2
+ import { slackChannel } from "eve/channels/slack";
3
+
4
+ export default slackChannel({
5
+ credentials: connectSlackCredentials("slack/${e}"),
6
+ });
7
+ `}function renderWebAppTemplate(e,t,n){let r=n?``:`, { configureVercelOutput: false }`;return e.replaceAll(`__EVE_INIT_APP_NAME__`,t).replaceAll(`__EVE_INIT_WITH_EVE_OPTIONS__`,r)}function withWebVercelServices(e){let t=JSON.parse(e);if(!isJsonObject(t))throw Error(`${WEB_VERCEL_JSON_PATH} must contain a JSON object.`);let n=t.experimentalServices;if(n!==void 0&&!isJsonObject(n))throw Error(`${WEB_VERCEL_JSON_PATH} experimentalServices must contain a JSON object.`);let r={...t,$schema:typeof t.$schema==`string`?t.$schema:WEB_VERCEL_JSON_SCHEMA,experimentalServices:{...n,web:n?.web??WEB_DEFAULT_VERCEL_SERVICES.web,eve:n?.eve??WEB_DEFAULT_VERCEL_SERVICES.eve}};return JSON.stringify(t)===JSON.stringify(r)?e:`${JSON.stringify(r,null,2)}\n`}async function ensureWebVercelServices(e){if(!await pathExists(e))return await writeTextFile(e,`${JSON.stringify({$schema:WEB_VERCEL_JSON_SCHEMA,experimentalServices:WEB_DEFAULT_VERCEL_SERVICES},null,2)}\n`,{force:!0}),`written`;let r=await readFile(e,`utf8`),i=withWebVercelServices(r);return i===r?`skipped`:(await writeFile(e,i,`utf8`),`written`)}async function findCompetingNextConfigFiles(e){let n=[];for(let r of WEB_COMPETING_NEXT_CONFIG_PATHS){let i=join(e,r);await pathExists(i)&&n.push(i)}return n}async function ensureChannel(e){switch(e.kind){case`slack`:return ensureSlackChannel({...e,kind:`slack`});case`web`:return ensureWebChannel({...e,kind:`web`})}}async function ensureWebChannel(r){let i=join(r.projectRoot,`package.json`),a=await pathExists(join(r.projectRoot,`app/page.tsx`));if(!r.force&&await isNextJsProject(r.projectRoot))return{kind:`web`,action:`skipped`,skipReason:`nextjs-project`,filesWritten:[],filesSkipped:[i],packageJsonUpdated:[]};let o=await patchWebPackageJson(i,resolveWebPackageVersions(r.webPackageVersions)),c=[],u=[],d=[],f=[],p=basename(resolve(r.projectRoot)),m=r.configureVercelServices??!0;if(m){let e=join(r.projectRoot,WEB_VERCEL_JSON_PATH);await ensureWebVercelServices(e)===`written`?c.push(e):f.push(e)}let h=await getPackageManagerStrategy(r.packageManager??`pnpm`).applyProjectConfiguration(r.projectRoot);c.push(...h.filesWritten),f.push(...h.filesSkipped);for(let[e,i]of Object.entries(WEB_APP_TEMPLATE_FILES)){let a=join(r.projectRoot,e);if(e===`agent/channels/eve.ts`&&!r.force&&await pathExists(a)){f.push(a);continue}let o=await pathExists(a);await writeTextFile(a,renderWebAppTemplate(i,p,m),{force:!0}),c.push(a),o&&u.push(a)}d.push(...await findCompetingNextConfigFiles(r.projectRoot));let g={kind:`web`,action:a?`overwritten`:`created`,filesWritten:c,filesSkipped:f,packageJsonUpdated:o};return u.length>0&&(g.filesOverwritten=u),d.length>0&&(g.competingNextConfigFiles=d),g}async function ensureSlackChannel(e){let r=join(e.projectRoot,`agent/channels/slack.ts`),a=await pathExists(r);if(!e.force&&a)return{kind:`slack`,action:`skipped`,filesWritten:[],filesSkipped:[r],packageJsonUpdated:[]};let o=resolveVersionToken(`connectPackageVersion`,e.connectPackageVersion??`0.2.2`),s=await ensurePackageDependency(join(e.projectRoot,`package.json`),`@vercel/connect`,o),c=e.slackConnectorSlug??await deriveSlackConnectorSlug(e.projectRoot);await writeTextFile(r,buildSlackTemplate(c),{force:e.force});let l={kind:`slack`,action:a?`overwritten`:`created`,filesWritten:[r],filesSkipped:[],packageJsonUpdated:s,slackConnectorSlug:c};return a&&(l.filesOverwritten=[r]),l}async function listAuthoredChannels(e){let t=join(e,`agent/channels`),n;try{n=await readdir(t,{withFileTypes:!0})}catch(e){if(e.code===`ENOENT`)return[];throw e}let r=[];for(let e of n){if(e.isFile()){let t=getSupportedModuleBaseName(e.name);t!==null&&r.push(t);continue}if(e.isDirectory())try{(await readdir(join(t,e.name))).some(e=>matchesSupportedModuleBaseName(e,`connection`))&&r.push(e.name)}catch{}}return r.sort()}export{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug};
@@ -1,4 +1,4 @@
1
- import { type ConnectionCatalogEntry, type ConnectionProtocol, type CustomConnectionInput } from "./connections/catalog.js";
1
+ import { type ConnectionCatalogEntry, type ConnectionProtocol, type CustomConnectionInput } from "../connections/catalog.js";
2
2
  import type { PackageJsonMutation } from "./channels.js";
3
3
  export type ConnectionMutationAction = "created" | "overwritten" | "skipped";
4
4
  export interface ConnectionMutationResult {
@@ -0,0 +1,21 @@
1
+ import{endpointForProtocol}from"../connections/catalog.js";import{pathExists,writeTextFile}from"../files.js";import{patchPackageJson}from"./package-json.js";import{resolveVersionToken}from"../version-tokens.js";import{getSupportedModuleBaseName,matchesSupportedModuleBaseName}from"./module-files.js";import{join}from"node:path";import{readFile,readdir,writeFile}from"node:fs/promises";const CONNECT_PACKAGE_NAME=`@vercel/connect`,USER_AUTHORED_CONNECTION_DIR=`agent/connections`;function resolveAuth(e){return e.auth??{kind:`none`}}function envKeysForAuth(e){switch(e.kind){case`bearer-env`:return[e.envVar];case`header`:return e.headers.map(e=>e.envVar);case`connect`:case`none`:return[]}}function authBlock(e){switch(e.kind){case`connect`:return` auth: connect("${e.connector}"),\n`;case`bearer-env`:return` auth: { getToken: async () => ({ token: process.env.${e.envVar}! }) },\n`;case`header`:return` headers: () => ({\n${e.headers.map(e=>` "${e.header}": process.env.${e.envVar}!,`).join(`
2
+ `)}\n }),\n`;case`none`:return``}}function renderMcpTemplate(e,t,n){return`${n.kind===`connect`?`import { connect } from "@vercel/connect/eve";
3
+ import { defineMcpClientConnection } from "eve/connections";
4
+ `:`import { defineMcpClientConnection } from "eve/connections";
5
+ `}
6
+ export default defineMcpClientConnection({
7
+ url: "${e.url}",
8
+ description: "${t}",
9
+ ${authBlock(n)}});
10
+ `}function renderOpenApiTemplate(e,t,n){let r=n.kind===`connect`?`import { connect } from "@vercel/connect/eve";
11
+ import { defineOpenAPIConnection } from "eve/connections";
12
+ `:`import { defineOpenAPIConnection } from "eve/connections";
13
+ `,i=e.baseUrl?` baseUrl: "${e.baseUrl}",\n`:``;return`${r}
14
+ export default defineOpenAPIConnection({
15
+ spec: "${e.spec}",
16
+ ${i} description: "${t}",
17
+ ${authBlock(n)}});
18
+ `}function renderTemplate(e,t,n,r){return e===`mcp`?renderMcpTemplate(t,n,r):renderOpenApiTemplate(t,n,r)}function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function ensureConnectDependency(e,n){if(!await pathExists(e))return[];let i=JSON.parse(await readFile(e,`utf8`));return(isJsonObject(i)&&isJsonObject(i.dependencies)?i.dependencies[CONNECT_PACKAGE_NAME]:void 0)===n?[]:(await patchPackageJson(e,{dependencies:{[CONNECT_PACKAGE_NAME]:n}}),[{path:e,dependencies:[CONNECT_PACKAGE_NAME],devDependencies:[],scripts:[]}])}function envKeyPresent(e,t){return RegExp(`^\\s*(?:export\\s+)?${t}\\s*=`,`m`).test(e)}async function seedEnvPlaceholders(e,n){if(n.length===0)return[];let r=``;await pathExists(e)&&(r=await readFile(e,`utf8`));let i=n.filter(e=>!envKeyPresent(r,e));if(i.length===0)return[];let a=`${r.length>0&&!r.endsWith(`
19
+ `)?`
20
+ `:``}${i.map(e=>`${e}=`).join(`
21
+ `)}\n`;return await writeFile(e,r+a,`utf8`),i}async function ensureConnection(r){let a=r.slug??r.entry.slug,o=resolveAuth(r.entry),s=endpointForProtocol(r.entry,r.protocol);if(s===null)throw Error(`Connection "${a}" is missing a ${r.protocol===`mcp`?`mcp.url`:`openapi.spec`} endpoint for protocol "${r.protocol}".`);let c=join(r.projectRoot,USER_AUTHORED_CONNECTION_DIR,`${a}.ts`),l=envKeysForAuth(o),u=await pathExists(c);if(!r.force&&u)return{slug:a,protocol:r.protocol,action:`skipped`,filePath:c,filesWritten:[],filesSkipped:[c],packageJsonUpdated:[],envKeysAdded:[],envKeysRequired:l};let d=[];if(o.kind===`connect`){let e=resolveVersionToken(`connectPackageVersion`,r.connectPackageVersion??`0.2.2`);d.push(...await ensureConnectDependency(join(r.projectRoot,`package.json`),e))}await writeTextFile(c,renderTemplate(r.protocol,s,r.entry.description,o),{force:!0});let f=await seedEnvPlaceholders(join(r.projectRoot,`.env.local`),l),p={slug:a,protocol:r.protocol,action:u?`overwritten`:`created`,filePath:c,filesWritten:[c],filesSkipped:[],packageJsonUpdated:d,envKeysAdded:f,envKeysRequired:l};return u&&(p.filesOverwritten=[c]),p}async function listAuthoredConnections(e){let t=join(e,USER_AUTHORED_CONNECTION_DIR),n;try{n=await readdir(t,{withFileTypes:!0})}catch(e){if(e.code===`ENOENT`)return[];throw e}let r=[];for(let e of n){if(e.isFile()){let t=getSupportedModuleBaseName(e.name);t!==null&&r.push(t);continue}if(e.isDirectory())try{(await readdir(join(t,e.name))).some(e=>matchesSupportedModuleBaseName(e,`connection`))&&r.push(e.name)}catch{}}return r.sort()}export{ensureConnection,listAuthoredConnections};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Returns a scaffold version value, resolving a build-stamp token at the point
3
+ * of need when the running code is unstamped. The published package is stamped
4
+ * by the build (`scripts/stamp-version-tokens.mjs`), so the fallback only ever
5
+ * fires in a dev tree — tsgo watch emits and tests running from `src` — where
6
+ * the live workspace catalog *is* the truth the stamp would have captured.
7
+ * Outside a dev tree an unstamped token still throws, because writing the
8
+ * literal token into a scaffolded package.json would break the generated
9
+ * project.
10
+ */
11
+ export declare function resolveVersionToken(field: string, value: string): string;
@@ -0,0 +1 @@
1
+ import{dirname,join}from"node:path";import{existsSync,readFileSync,realpathSync}from"node:fs";import{fileURLToPath}from"node:url";function versionToken(e){return`__${e}_VERSION__`}const TOKEN_SOURCES={[versionToken(`EVE_PACKAGE`)]:{kind:`eve-version`},[versionToken(`AI_SDK`)]:{kind:`catalog`,packageName:`ai`},[versionToken(`VERCEL_CONNECT`)]:{kind:`catalog`,packageName:`@vercel/connect`},[versionToken(`NEXT`)]:{kind:`catalog`,packageName:`next`},[versionToken(`REACT`)]:{kind:`catalog`,packageName:`react`},[versionToken(`REACT_DOM`)]:{kind:`catalog`,packageName:`react-dom`},[versionToken(`STREAMDOWN`)]:{kind:`catalog`,packageName:`streamdown`},[versionToken(`ZOD`)]:{kind:`catalog`,packageName:`zod`},[versionToken(`TSGO`)]:{kind:`catalog`,packageName:`@typescript/native-preview`},[versionToken(`TYPES_NODE`)]:{kind:`catalog`,packageName:`@types/node`},[versionToken(`TYPES_REACT`)]:{kind:`catalog`,packageName:`@types/react`},[versionToken(`TYPES_REACT_DOM`)]:{kind:`catalog`,packageName:`@types/react-dom`}},resolvedTokens=new Map;function findEvePackageRoot(){let o=dirname(realpathSync(fileURLToPath(import.meta.url)));for(;;){let i=join(o,`package.json`);if(existsSync(i)&&JSON.parse(readFileSync(i,`utf8`)).name===`eve`)return o;let a=dirname(o);if(a===o)return;o=a}}function findWorkspaceManifest(r){let i=r;for(;;){let r=join(i,`pnpm-workspace.yaml`);if(existsSync(r))return r;let a=dirname(i);if(a===i)return;i=a}}function readCatalogVersion(e,t){let n=readFileSync(e,`utf8`).split(/\r?\n/),i=!1;for(let e of n){if(/^catalog:\s*$/.test(e)){i=!0;continue}if(!i)continue;if(/^\S/.test(e))break;let n=e.match(/^\s+(?:"([^"]+)"|([\w@/.-]+)):\s*"([^"]+)"/);if(n&&(n[1]??n[2])===t)return n[3]}}function resolveTokenFromDevTree(e){let i=TOKEN_SOURCES[e];if(i!==void 0)try{let e=findEvePackageRoot();if(e===void 0||!existsSync(join(e,`scripts/stamp-version-tokens.mjs`)))return;if(i.kind===`eve-version`){let n=JSON.parse(readFileSync(join(e,`package.json`),`utf8`));return typeof n.version==`string`?n.version:void 0}let a=findWorkspaceManifest(e);return a===void 0?void 0:readCatalogVersion(a,i.packageName)}catch{return}}function resolveVersionToken(e,t){if(!t.startsWith(`__`))return t;let n=resolvedTokens.get(t);if(n!==void 0)return n;let r=resolveTokenFromDevTree(t);if(r===void 0)throw Error(`Scaffold received unstamped version token (${e}=${t}). Build eve before using its dist entrypoint.`);return resolvedTokens.set(t,r),r}export{resolveVersionToken};
@@ -1,17 +1,13 @@
1
- import type { ChannelSetupPrompter } from "../cli/channel-setup-prompter.js";
2
- /** Controls prompting and connector naming while creating a Slackbot. */
3
- export interface SetupSlackbotOptions {
4
- /** Skip the prompt and run the create flow when true. */
5
- presetCreate?: boolean;
6
- /** Connector short-name passed to `vercel connect create slack --name`. */
7
- slackbotName?: string;
1
+ import { type ChannelSetupLog } from "#setup/cli/index.js";
2
+ import { captureVercel, runVercel, runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";
3
+ /** Injected for tests; defaults to the real Vercel CLI subprocess primitives. */
4
+ export interface SlackbotProvisionDeps {
5
+ captureVercel: typeof captureVercel;
6
+ runVercel: typeof runVercel;
7
+ runVercelCaptureStdout: typeof runVercelCaptureStdout;
8
8
  }
9
9
  /** Outcome of the Connect create-and-attach sequence for a Slackbot. */
10
- export type SetupSlackbotResult = {
11
- kind: "skipped";
12
- created: false;
13
- attached: false;
14
- } | {
10
+ export type ProvisionSlackbotResult = {
15
11
  kind: "create-failed";
16
12
  created: false;
17
13
  attached: false;
@@ -32,17 +28,17 @@ export type SetupSlackbotResult = {
32
28
  workspaceUrl?: string;
33
29
  workspaceName?: string;
34
30
  };
31
+ /** Identifiers returned by Vercel Connect for a Slack connector. */
32
+ export interface SlackConnectorRef {
33
+ uid: string;
34
+ id: string;
35
+ }
35
36
  /**
36
37
  * Reads the connector identifiers from `vercel connect create … -F json`
37
38
  * stdout, the authoritative source for the just-created connector's UID.
38
39
  * Returns `undefined` when stdout is empty or not the expected JSON.
39
40
  */
40
41
  export declare function parseCreatedSlackConnector(stdout: string): SlackConnectorRef | undefined;
41
- /** Identifiers returned by Vercel Connect for a Slack connector. */
42
- export interface SlackConnectorRef {
43
- uid: string;
44
- id: string;
45
- }
46
42
  /**
47
43
  * Finds the expected connector, or the newest Slack connector already attached to this project.
48
44
  */
@@ -54,10 +50,18 @@ export declare function parseInstallation(body: unknown): {
54
50
  } | undefined;
55
51
  /**
56
52
  * Creates a Slack Connect client, replaces its default trigger destination with the Eve route,
57
- * and resolves workspace details when Connect reports them.
53
+ * and resolves workspace details when Connect reports them. Promptless: progress streams
54
+ * through the rail-styled `log`, and the result union carries every failure mode for the
55
+ * caller to act on.
56
+ *
57
+ * Known quirk, preserved deliberately: a `connector-unresolved` result reports
58
+ * `created: true`, but callers discard that fact (nothing is recorded), so a rerun
59
+ * creates a second connector instead of adopting the unresolved one.
58
60
  */
59
- export declare function setupSlackbot(prompter: ChannelSetupPrompter, projectRoot: string, options?: SetupSlackbotOptions): Promise<SetupSlackbotResult>;
61
+ export declare function provisionSlackbot(log: ChannelSetupLog, projectRoot: string,
62
+ /** Connector short-name passed to `vercel connect create slack --name`. */
63
+ slug: string, deps?: SlackbotProvisionDeps): Promise<ProvisionSlackbotResult>;
60
64
  /**
61
65
  * Patches a connector UID chosen by Connect before the caller deploys the channel definition.
62
66
  */
63
- export declare function reconcileSlackUid(prompter: ChannelSetupPrompter, projectRoot: string, slackbot: SetupSlackbotResult, expectedUid: string): Promise<boolean>;
67
+ export declare function reconcileSlackUid(log: ChannelSetupLog, projectRoot: string, slackbot: ProvisionSlackbotResult, expectedUid: string): Promise<boolean>;
@@ -0,0 +1 @@
1
+ import{join}from"node:path";import{SLACK_CHANNEL_DEFAULT_ROUTE}from"#setup/scaffold/index.js";import{readFile}from"node:fs/promises";import{createPromptCommandOutput}from"#setup/cli/index.js";import{captureVercel,runVercel,runVercelCaptureStdout}from"#setup/primitives/run-vercel.js";import{updateSlackChannelConnectorUid}from"#setup/scaffold/update/update-slack-channel.js";const defaultDeps={captureVercel,runVercel,runVercelCaptureStdout},LOOKUP_TIMEOUT_MS=6e4,ATTACH_TIMEOUT_MS=2*6e4;function parseCreatedSlackConnector(e){let t=e.trim();if(!t)return;let n;try{n=JSON.parse(t)}catch{return}if(typeof n!=`object`||!n)return;let{uid:r,id:i}=n;if(!(typeof r!=`string`||typeof i!=`string`))return{uid:r,id:i}}async function readProjectId(t){try{let r=await readFile(join(t,`.vercel`,`project.json`),`utf8`),i=JSON.parse(r);return typeof i.projectId==`string`?i.projectId:void 0}catch{return}}function pickSlackConnector(e,t,n){if(typeof e!=`object`||!e)return;let r=e,i=r.connectors??r.clients;if(!Array.isArray(i))return;let a;for(let e of i){if(e.type!==`slack`||typeof e.uid!=`string`||typeof e.id!=`string`)continue;let r={uid:e.uid,id:e.id};if(n!==void 0&&r.uid===n)return r;let i=typeof e.createdAt==`number`?e.createdAt:0;t!==void 0&&Array.isArray(e.projects)&&e.projects.some(e=>typeof e==`object`&&!!e&&e.id===t)&&(!a||i>a.createdAt)&&(a={ref:r,createdAt:i})}return a?.ref}function parseInstallation(e){if(typeof e!=`object`||!e)return;let t=e.installations;if(!Array.isArray(t)||t.length===0)return;let n=t[0];if(typeof n.tenantUrl==`string`)return{workspaceUrl:n.tenantUrl,workspaceName:typeof n.tenantName==`string`?n.tenantName:void 0}}async function findSlackConnector(e,t,n,r,i){let a=await e.captureVercel([`connect`,`list`,`-F`,`json`,`--all-projects`],{cwd:t,onOutput:i,timeoutMs:LOOKUP_TIMEOUT_MS});if(a.ok)try{return pickSlackConnector(JSON.parse(a.stdout),n,r)}catch{return}}async function fetchInstallationInfo(e,t,n,r){let i=await e.captureVercel([`api`,`/v1/connex/clients/${n}/installations`],{cwd:t,onOutput:r,timeoutMs:LOOKUP_TIMEOUT_MS});if(i.ok)try{return parseInstallation(JSON.parse(i.stdout))}catch{return}}async function withPhase(e,t,n){let r=e.spinner?.(t);r||e.message(t);try{return await n()}finally{r?.stop()}}async function provisionSlackbot(e,n,i,a=defaultDeps){let o=createPromptCommandOutput(e),s=await readProjectId(n),c=`slack/${i}`,l=await withPhase(e,`Creating a Slackbot through Vercel Connect...`,()=>a.runVercelCaptureStdout([`connect`,`create`,`slack`,`--triggers`,`--name`,i,`-F`,`json`],{cwd:n,onOutput:o,timeoutMs:6e5}));if(!l.ok)return{kind:`create-failed`,created:!1,attached:!1};e.success(`Slackbot created via Vercel Connect.`);let u=parseCreatedSlackConnector(l.stdout);if(u||=await withPhase(e,`Locating the Slack connector...`,()=>findSlackConnector(a,n,s,c,o)),!u)return e.warning("Could not locate the Slack connector. Run `vercel connect list --all-projects` to find its UID."),{kind:`connector-unresolved`,created:!0,attached:!1};let d=u;if(e.info(`Slack connector: ${d.uid}`),!await withPhase(e,`Configuring Slack event delivery for this agent...`,async()=>(await a.runVercel([`connect`,`detach`,d.uid,`--yes`],{cwd:n,onOutput:o,timeoutMs:ATTACH_TIMEOUT_MS}),a.runVercel([`connect`,`attach`,d.uid,`--triggers`,`--trigger-path`,SLACK_CHANNEL_DEFAULT_ROUTE,`--yes`],{cwd:n,onOutput:o,timeoutMs:ATTACH_TIMEOUT_MS}))))return e.warning(`Could not register this project as a trigger destination. Run \`vercel connect attach ${d.uid} --triggers --trigger-path ${SLACK_CHANNEL_DEFAULT_ROUTE} --yes\` to enable event delivery.`),{kind:`attach-failed`,created:!0,attached:!1,connectorUid:d.uid};let f=await withPhase(e,`Reading Slack workspace details...`,()=>fetchInstallationInfo(a,n,d.id,o));return f?{kind:`attached`,created:!0,attached:!0,connectorUid:d.uid,workspaceUrl:f.workspaceUrl,workspaceName:f.workspaceName}:{kind:`attached`,created:!0,attached:!0,connectorUid:d.uid}}async function reconcileSlackUid(t,n,r,i){if(r.kind!==`attached`||r.connectorUid===i)return!0;t.info(`Connect assigned UID ${r.connectorUid} (expected ${i}). Updating agent/channels/slack.ts before deployment...`);let{patched:a}=await updateSlackChannelConnectorUid(join(n,`agent/channels/slack.ts`),r.connectorUid);return a?!0:(t.warning(`Could not patch agent/channels/slack.ts automatically. Update \`connectSlackCredentials("...")\` to \`"${r.connectorUid}"\` and run \`vercel deploy --prod\`.`),!1)}export{parseCreatedSlackConnector,parseInstallation,pickSlackConnector,provisionSlackbot,reconcileSlackUid};
@@ -1,5 +1,5 @@
1
- import type { ChannelKind } from "#setup/scaffold/index.js";
2
- import { type AddToAgentState } from "#setup/scaffold/steps/index.js";
1
+ import type { ChannelKind, ConnectionInput, ConnectionProtocol } from "#setup/scaffold/index.js";
2
+ import { type ProjectResolution } from "./project-resolution.js";
3
3
  export { CURRENT_DIRECTORY_PROJECT_NAME } from "#setup/scaffold/index.js";
4
4
  export type { ChannelKind };
5
5
  /** Where the user wants to chat with the agent after scaffolding finishes. */
@@ -97,22 +97,55 @@ export type ResolvedAiGateway = {
97
97
  /**
98
98
  * How the scaffolded agent reaches a model. `"gateway"` routes through the
99
99
  * Vercel AI Gateway (OIDC, or a pasted gateway key). `"self"` scaffolds an
100
- * inline provider `byok` block reading `process.env`, and skips the model
101
- * prompt. Decided by the resolve-provisioning box.
100
+ * inline provider `byok` block reading `process.env`, derived from the model
101
+ * picked earlier in the interview. Decided by the resolve-provisioning box.
102
102
  */
103
103
  export type WiringMode = "gateway" | "self";
104
104
  /**
105
- * The in-memory state threaded through every setup box. One state serves both
106
- * the create wizard and `eve setup`: greenfield onboarding populates every
107
- * field, while in-project setup starts from the detected on-disk facts and
108
- * leaves the onboarding-only plans at their defaults.
105
+ * How much of the onboarding flow runs. `"complete"` is the full interview and
106
+ * provisioning sequence; `"one-shot"` scaffolds the base template with the
107
+ * default model and skips everything after the scaffold (provisioning, model,
108
+ * channels, linking, credentials, connections, deploy, chat). Decided by the
109
+ * select-setup-mode box right after the target is resolved.
109
110
  */
110
- export interface SetupState extends AddToAgentState {
111
+ export type SetupMode = "complete" | "one-shot";
112
+ /**
113
+ * One fully-specified connection to scaffold. The select-connections box
114
+ * resolves everything a prompt could decide (slug, protocol, the entry
115
+ * definition, and how the connector gets provisioned) during the interview,
116
+ * so the add-connections box runs effects without prompting.
117
+ */
118
+ export interface ConnectionPlan {
119
+ slug: string;
120
+ protocol: ConnectionProtocol;
121
+ entry: ConnectionInput;
122
+ provision: {
123
+ kind: "connect";
124
+ service: string;
125
+ } | {
126
+ kind: "connect-manual";
127
+ } | {
128
+ kind: "command-hint";
129
+ service: string;
130
+ } | {
131
+ kind: "none";
132
+ };
133
+ }
134
+ /**
135
+ * The in-memory state threaded through every setup box. Greenfield onboarding
136
+ * populates every field, while in-project setup starts from the detected
137
+ * on-disk facts and leaves the onboarding-only plans at their defaults.
138
+ */
139
+ export interface SetupState {
111
140
  agentName: string;
141
+ /** Decided by the select-setup-mode box; gates every post-scaffold box. */
142
+ setupMode: SetupMode;
112
143
  modelId: string;
113
144
  modelWiring: WiringMode;
114
145
  /** Channels chosen in the interview phase; scaffolded later by the channels box. */
115
146
  channelSelection: ChannelKind[];
147
+ /** Connections planned in the interview phase; scaffolded later by the connections box. */
148
+ connectionSelection: ConnectionPlan[];
116
149
  /** Decided once by the resolve-provisioning box; executed later by the link box. */
117
150
  vercelProject: ResolvedVercelProject;
118
151
  /** Decided once by the resolve-provisioning box; executed by the AI Gateway credential box. */
@@ -120,16 +153,30 @@ export interface SetupState extends AddToAgentState {
120
153
  projectPath: ResolvedProjectPath;
121
154
  aiGatewayCredentials: ResolvedAiGatewayCredentials;
122
155
  chat: ChatPreference | null;
156
+ /** Channels scaffolded so far in this run. */
157
+ channels: ChannelKind[];
158
+ webScaffolded: boolean;
159
+ slackScaffolded: boolean;
160
+ deploymentDependenciesInstalled: boolean;
161
+ /** The linked Vercel project facts, from the link box or the on-disk `.vercel` link. */
162
+ project: ProjectResolution;
163
+ deploymentPending: boolean;
164
+ slackbotCreated: boolean;
165
+ slackbotAttached: boolean;
166
+ slackConnectorUid: string | undefined;
167
+ slackWorkspaceUrl: string | undefined;
168
+ slackWorkspaceName: string | undefined;
123
169
  }
124
170
  export declare function createDefaultSetupState(): SetupState;
125
171
  /**
126
172
  * Whether this run has a Vercel project available, planned or already linked.
127
- * During onboarding the resolve-provisioning box records the plan before any
128
- * link exists, so the first disjunct drives the channel/connection/deploy
129
- * gating. During in-project setup there is no plan, but the detected on-disk
130
- * link resolves `state.project`, so the second disjunct fires instead. In the
131
- * create flow `state.project` stays unresolved until the link box runs, so the
132
- * second disjunct only fires when a real link exists.
173
+ * During onboarding the resolve-provisioning box records the plan at the end
174
+ * of the interview (after channels and connections), so the first disjunct
175
+ * drives the post-scaffold deploy gating. During in-project setup there is no
176
+ * plan, but the detected on-disk link resolves `state.project`, so the second
177
+ * disjunct fires instead. In the create flow `state.project` stays unresolved
178
+ * until the link box runs, so the second disjunct only fires when a real link
179
+ * exists.
133
180
  */
134
181
  export declare function hasVercelProject(state: Pick<SetupState, "vercelProject" | "project">): boolean;
135
182
  export declare function requireProjectPath(state: Pick<SetupState, "projectPath">): string;
@@ -1 +1 @@
1
- import{CURRENT_DIRECTORY_PROJECT_NAME}from"#setup/scaffold/index.js";import{createAddToAgentState,isProjectResolved}from"#setup/scaffold/steps/index.js";function createDefaultSetupState(){return{...createAddToAgentState(),agentName:``,modelId:``,modelWiring:`gateway`,channelSelection:[],vercelProject:{kind:`none`},aiGateway:{kind:`inherit`},projectPath:{kind:`unresolved`,inPlace:!1},aiGatewayCredentials:{kind:`unresolved`},chat:null}}function hasVercelProject(e){return e.vercelProject.kind!==`none`||isProjectResolved(e.project)}function requireProjectPath(e){if(e.projectPath.kind===`resolved`)return e.projectPath.path;throw Error(`Project path has not been resolved.`)}function snapshotSetupState(e){return Object.freeze({...e,aiGatewayCredentials:Object.freeze({...e.aiGatewayCredentials}),aiGateway:Object.freeze({...e.aiGateway}),channelSelection:Object.freeze([...e.channelSelection]),channels:Object.freeze([...e.channels]),project:Object.freeze({...e.project}),projectPath:Object.freeze({...e.projectPath}),vercelProject:Object.freeze({...e.vercelProject})})}export{CURRENT_DIRECTORY_PROJECT_NAME,createDefaultSetupState,hasVercelProject,requireProjectPath,snapshotSetupState};
1
+ import{isProjectResolved}from"./project-resolution.js";import{CURRENT_DIRECTORY_PROJECT_NAME}from"#setup/scaffold/index.js";function createDefaultSetupState(){return{channels:[],webScaffolded:!1,slackScaffolded:!1,deploymentDependenciesInstalled:!1,project:{kind:`unresolved`},deploymentPending:!1,slackbotCreated:!1,slackbotAttached:!1,slackConnectorUid:void 0,slackWorkspaceUrl:void 0,slackWorkspaceName:void 0,agentName:``,setupMode:`complete`,modelId:``,modelWiring:`gateway`,channelSelection:[],connectionSelection:[],vercelProject:{kind:`none`},aiGateway:{kind:`inherit`},projectPath:{kind:`unresolved`,inPlace:!1},aiGatewayCredentials:{kind:`unresolved`},chat:null}}function hasVercelProject(t){return t.vercelProject.kind!==`none`||isProjectResolved(t.project)}function requireProjectPath(e){if(e.projectPath.kind===`resolved`)return e.projectPath.path;throw Error(`Project path has not been resolved.`)}function snapshotSetupState(e){return Object.freeze({...e,aiGatewayCredentials:Object.freeze({...e.aiGatewayCredentials}),aiGateway:Object.freeze({...e.aiGateway}),channelSelection:Object.freeze([...e.channelSelection]),connectionSelection:Object.freeze([...e.connectionSelection]),channels:Object.freeze([...e.channels]),project:Object.freeze({...e.project}),projectPath:Object.freeze({...e.projectPath}),vercelProject:Object.freeze({...e.vercelProject})})}export{CURRENT_DIRECTORY_PROJECT_NAME,createDefaultSetupState,hasVercelProject,requireProjectPath,snapshotSetupState};
@@ -2,13 +2,6 @@
2
2
  export interface OutputSink {
3
3
  write(line: string): void;
4
4
  }
5
- /** Result of the interactive gather face: an input to perform, or a user cancel. */
6
- export type InteractiveOutcome<Input> = {
7
- kind: "done";
8
- input: Input;
9
- } | {
10
- kind: "cancelled";
11
- };
12
5
  /**
13
6
  * Thrown by the interactive prompter when the user cancels (Ctrl-C, or the
14
7
  * two-stage Escape quit). The runner converts it into a cancelled run, so a
@@ -18,11 +11,13 @@ export declare class WizardCancelledError extends Error {
18
11
  constructor();
19
12
  }
20
13
  /**
21
- * A unit of setup work reusable by both the create wizard and a future
22
- * `eve setup`. Only the two gather faces are mode-specific; `perform` owns the
23
- * side effects once and `apply` records the result once, so interactive and
24
- * headless execution cannot drift. See
25
- * `research/active/onboarding-step-unification.md`.
14
+ * A unit of work reusable by programmatic setup and channel-management flows.
15
+ * Every box has ONE gather for every mode: it asks its questions through an
16
+ * injected `Asker`, whose composed stack (interactive base, headless base,
17
+ * answer/policy decorators) decides how each question resolves; a user cancel
18
+ * propagates as {@link WizardCancelledError} for the runner to fold. `perform`
19
+ * owns the side effects once and `apply` records the result once, so
20
+ * interactive and headless execution cannot drift.
26
21
  *
27
22
  * `Input` is what a user/preset chooses; `Payload` is what `perform` actually
28
23
  * did (which may differ from what was requested, e.g. a skipped channel).
@@ -33,14 +28,10 @@ export interface SetupBox<State, Input, Payload> {
33
28
  shouldRun?(state: Readonly<State>): boolean;
34
29
  /** One-line status for a menu-driven runner (unused by the linear wizard). */
35
30
  summary?(state: Readonly<State>): string;
36
- /** Interactive face: prompt for the input, or report a cancel. */
37
- gatherInteractive(ctx: {
31
+ /** Mode-agnostic face: resolve the input, asking through the box's asker. */
32
+ gather(ctx: {
38
33
  state: Readonly<State>;
39
34
  initial?: Input;
40
- }): Promise<InteractiveOutcome<Input>>;
41
- /** Non-interactive face: derive the input from the box's options and state. */
42
- gatherHeadless(ctx: {
43
- state: Readonly<State>;
44
35
  }): Promise<Input>;
45
36
  /** The only side-effecting step. Must be idempotent: detect current files,
46
37
  * link state, and connectors before mutating, so a rerun converges. */
@@ -1,7 +1,7 @@
1
- import { createPromptCommandOutput } from "#setup/scaffold/cli/index.js";
2
- import { type VercelCaptureFailure } from "#setup/scaffold/primitives/index.js";
3
- import { type ProjectResolution } from "#setup/scaffold/steps/index.js";
1
+ import { createPromptCommandOutput } from "#setup/cli/index.js";
2
+ import { type VercelCaptureFailure } from "#setup/primitives/index.js";
4
3
  import { z } from "zod";
4
+ import type { ProjectResolution } from "./project-resolution.js";
5
5
  import type { Prompter } from "./prompter.js";
6
6
  import type { ResolvedVercelProjectSpec } from "./state.js";
7
7
  declare const VercelTeamListEntrySchema: z.ZodObject<{
@@ -21,6 +21,12 @@ declare const VercelProjectReferenceSchema: z.ZodObject<{
21
21
  }, z.core.$strip>;
22
22
  type VercelProjectReference = z.infer<typeof VercelProjectReferenceSchema>;
23
23
  export declare function unresolvedProject(): ProjectResolution;
24
+ /**
25
+ * Runs a network reach behind a section-like spinner so the user sees the CLI
26
+ * is working, not hung. The spinner clears whether the work resolves or throws,
27
+ * and degrades to nothing when the prompter has no spinner (headless/test).
28
+ */
29
+ export declare function withNetworkSpinner<T>(prompter: Prompter, message: string, task: () => Promise<T>): Promise<T>;
24
30
  /** Resolves the linked project id from a resolution, if any. */
25
31
  export declare function projectIdFromResolution(project: ProjectResolution): string | undefined;
26
32
  /** Lists the Vercel scopes available to the current CLI user. */
@@ -43,6 +49,12 @@ export declare function requireVercelLogin(failure?: VercelCaptureFailure): neve
43
49
  * API error) is surfaced verbatim rather than mislabeled as a login problem.
44
50
  */
45
51
  export declare function requireAuth(projectRoot: string, prompter?: Prompter): Promise<void>;
52
+ /**
53
+ * Non-throwing auth probe: whether the Vercel CLI has a logged-in user. Used
54
+ * where authentication changes a decision (e.g. adopting an existing link)
55
+ * rather than being a precondition to enforce.
56
+ */
57
+ export declare function isVercelAuthenticated(projectRoot: string): Promise<boolean>;
46
58
  /**
47
59
  * Resolves a passed team slug, or the current scope when unset, to a concrete
48
60
  * slug so every provisioning command can pass an explicit `--scope`.
@@ -81,11 +93,6 @@ export interface ArgsPickedProject {
81
93
  export declare function pickProject(prompter: Prompter, projectRoot: string, team: string): Promise<ArgsPickedProject>;
82
94
  /** Returns a project name for a new Vercel project, prompting when the default exists. */
83
95
  export declare function pickNewProjectName(prompter: Prompter, projectRoot: string, team: string, defaultProjectName: string): Promise<string>;
84
- /**
85
- * Side-effect-free fact gathering after a link: reads `.vercel/project.json`
86
- * to resolve the project. The on-disk link is the single source of truth.
87
- */
88
- export declare function detectProjectResolution(projectRoot: string): Promise<ProjectResolution>;
89
96
  /**
90
97
  * Ensures the concrete project exists (creating it for a `new` plan) and links
91
98
  * this directory to it. Pure executor: it acts on a fully-resolved spec and