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.
- package/CHANGELOG.md +281 -0
- package/README.md +9 -6
- package/dist/docs/public/README.md +17 -12
- package/dist/docs/public/agent-config.md +10 -10
- package/dist/docs/public/channels/custom.mdx +4 -4
- package/dist/docs/public/channels/discord.mdx +1 -1
- package/dist/docs/public/channels/eve.mdx +10 -10
- package/dist/docs/public/channels/github.mdx +1 -1
- package/dist/docs/public/channels/overview.mdx +21 -15
- package/dist/docs/public/channels/slack.mdx +16 -4
- package/dist/docs/public/channels/teams.mdx +1 -1
- package/dist/docs/public/channels/telegram.mdx +1 -1
- package/dist/docs/public/channels/twilio.mdx +1 -1
- package/dist/docs/public/{advanced → concepts}/context-control.md +3 -3
- package/dist/docs/public/{advanced → concepts}/default-harness.md +5 -5
- package/dist/docs/public/{advanced → concepts}/execution-model-and-durability.md +3 -1
- package/dist/docs/public/concepts/meta.json +10 -0
- package/dist/docs/public/{advanced → concepts}/security-model.md +3 -3
- package/dist/docs/public/{advanced → concepts}/sessions-runs-and-streaming.md +7 -7
- package/dist/docs/public/connections.mdx +6 -4
- package/dist/docs/public/evals/assertions.mdx +108 -0
- package/dist/docs/public/evals/cases.mdx +143 -0
- package/dist/docs/public/evals/judge.mdx +94 -0
- package/dist/docs/public/evals/meta.json +4 -0
- package/dist/docs/public/evals/overview.mdx +118 -0
- package/dist/docs/public/evals/reporters.mdx +62 -0
- package/dist/docs/public/evals/running.mdx +63 -0
- package/dist/docs/public/evals/targets.mdx +54 -0
- package/dist/docs/public/getting-started.mdx +38 -33
- package/dist/docs/public/{advanced → guides}/auth-and-route-protection.md +5 -3
- package/dist/docs/public/{client → guides/client}/continuations.mdx +2 -2
- package/dist/docs/public/{client → guides/client}/messages.mdx +1 -1
- package/dist/docs/public/{client → guides/client}/meta.json +1 -1
- package/dist/docs/public/{client → guides/client}/output-schema.mdx +2 -2
- package/dist/docs/public/{client → guides/client}/overview.mdx +5 -5
- package/dist/docs/public/{client → guides/client}/streaming.mdx +1 -1
- package/dist/docs/public/{advanced → guides}/deployment.md +9 -1
- package/dist/docs/public/guides/dev-tui.md +50 -0
- package/dist/docs/public/{advanced → guides}/dynamic-capabilities.md +1 -1
- package/dist/docs/public/{advanced → guides}/dynamic-workflows.md +1 -1
- package/dist/docs/public/{frontend → guides/frontend}/nextjs.mdx +16 -7
- package/dist/docs/public/{frontend → guides/frontend}/nuxt.mdx +7 -7
- package/dist/docs/public/{frontend → guides/frontend}/overview.mdx +6 -6
- package/dist/docs/public/{frontend → guides/frontend}/sveltekit.mdx +5 -5
- package/dist/docs/public/{frontend → guides/frontend}/use-eve-agent-svelte.mdx +2 -2
- package/dist/docs/public/{frontend → guides/frontend}/use-eve-agent-vue.mdx +2 -2
- package/dist/docs/public/{advanced → guides}/hooks.md +2 -2
- package/dist/docs/public/{advanced → guides}/instrumentation.md +3 -1
- package/dist/docs/public/{advanced → guides}/meta.json +8 -12
- package/dist/docs/public/{advanced → guides}/session-context.md +3 -3
- package/dist/docs/public/{advanced → guides}/state.md +1 -1
- package/dist/docs/public/instructions.mdx +2 -2
- package/dist/docs/public/introduction.md +5 -2
- package/dist/docs/public/meta.json +4 -3
- package/dist/docs/public/reference/cli.md +35 -19
- package/dist/docs/public/reference/meta.json +1 -1
- package/dist/docs/public/reference/project-layout.md +5 -1
- package/dist/docs/public/reference/typescript-api.md +27 -23
- package/dist/docs/public/sandbox.mdx +1 -1
- package/dist/docs/public/schedules.mdx +2 -2
- package/dist/docs/public/skills.mdx +3 -3
- package/dist/docs/public/subagents.mdx +3 -3
- package/dist/docs/public/tools.mdx +4 -8
- package/dist/docs/public/tutorial/connect-a-warehouse.mdx +3 -3
- package/dist/docs/public/tutorial/first-agent.mdx +6 -3
- package/dist/docs/public/tutorial/guard-the-spend.mdx +1 -1
- package/dist/docs/public/tutorial/how-it-runs.mdx +2 -2
- package/dist/docs/public/tutorial/meta.json +1 -1
- package/dist/docs/public/tutorial/query-sample-data.mdx +1 -1
- package/dist/docs/public/tutorial/remember-definitions.mdx +3 -3
- package/dist/docs/public/tutorial/run-analysis.mdx +1 -1
- package/dist/docs/public/tutorial/ship-it.mdx +4 -4
- package/dist/docs/public/tutorial/team-playbooks.mdx +3 -3
- package/dist/src/chunks/{use-eve-agent-DCZbkLG7.js → use-eve-agent-DErQj5hs.js} +125 -37
- package/dist/src/chunks/{use-eve-agent-DoheC4_o.js → use-eve-agent-DoR8C4i6.js} +125 -37
- package/dist/src/cli/banner.d.ts +7 -0
- package/dist/src/cli/banner.js +1 -0
- package/dist/src/cli/commands/channel-add-conflicts.d.ts +1 -1
- package/dist/src/cli/commands/channels.d.ts +9 -6
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/deploy.d.ts +21 -0
- package/dist/src/cli/commands/deploy.js +1 -0
- package/dist/src/cli/commands/init-git.d.ts +15 -0
- package/dist/src/cli/commands/init-git.js +1 -0
- package/dist/src/cli/commands/init.d.ts +29 -0
- package/dist/src/cli/commands/init.js +1 -0
- package/dist/src/cli/commands/link.d.ts +21 -0
- package/dist/src/cli/commands/link.js +1 -0
- package/dist/src/cli/commands/preconditions.d.ts +7 -0
- package/dist/src/cli/commands/preconditions.js +1 -0
- package/dist/src/cli/commands/register-project-commands.d.ts +12 -0
- package/dist/src/cli/commands/register-project-commands.js +1 -0
- package/dist/src/cli/dev/tui/agent-header.d.ts +15 -9
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
- package/dist/src/cli/dev/tui/blocks.js +3 -2
- package/dist/src/cli/dev/tui/command-typeahead.d.ts +47 -0
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -0
- package/dist/src/cli/dev/tui/dev-rebuild-status.d.ts +21 -0
- package/dist/src/cli/dev/tui/dev-rebuild-status.js +1 -0
- package/dist/src/cli/dev/tui/errors.d.ts +18 -0
- package/dist/src/cli/dev/tui/errors.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +14 -0
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -0
- package/dist/src/cli/dev/tui/prompt-commands.d.ts +54 -0
- package/dist/src/cli/dev/tui/prompt-commands.js +2 -0
- package/dist/src/cli/dev/tui/runner.d.ts +64 -7
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +48 -0
- package/dist/src/cli/dev/tui/setup-commands.js +2 -0
- package/dist/src/cli/dev/tui/setup-flow.d.ts +35 -0
- package/dist/src/cli/dev/tui/setup-issues.d.ts +40 -0
- package/dist/src/cli/dev/tui/setup-issues.js +1 -0
- package/dist/src/cli/dev/tui/setup-panel.d.ts +103 -0
- package/dist/src/cli/dev/tui/setup-panel.js +1 -0
- package/dist/src/cli/dev/tui/status-line.d.ts +25 -0
- package/dist/src/cli/dev/tui/status-line.js +1 -0
- package/dist/src/cli/dev/tui/stream-format.d.ts +16 -1
- package/dist/src/cli/dev/tui/stream-format.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +32 -3
- package/dist/src/cli/dev/tui/terminal-renderer.js +5 -2
- package/dist/src/cli/dev/tui/test/index.d.ts +3 -1
- package/dist/src/cli/dev/tui/test/index.js +1 -1
- package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +1 -0
- package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
- package/dist/src/cli/dev/tui/theme.d.ts +10 -0
- package/dist/src/cli/dev/tui/theme.js +1 -1
- package/dist/src/cli/dev/tui/tui-prompter.d.ts +20 -0
- package/dist/src/cli/dev/tui/tui-prompter.js +1 -0
- package/dist/src/cli/dev/tui/tui.d.ts +6 -8
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/types.d.ts +4 -3
- package/dist/src/cli/dev/tui/vercel-status.d.ts +47 -0
- package/dist/src/cli/dev/tui/vercel-status.js +1 -0
- package/dist/src/cli/run.d.ts +9 -18
- package/dist/src/cli/run.js +2 -2
- package/dist/src/client/client.d.ts +8 -0
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/file-parts.d.ts +18 -0
- package/dist/src/client/file-parts.js +1 -0
- package/dist/src/client/index.d.ts +3 -2
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-response.js +1 -1
- package/dist/src/client/open-stream.d.ts +6 -0
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-utils.d.ts +5 -0
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +9 -2
- package/dist/src/compiled/.vendor-stamp.json +8 -8
- package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +56 -31
- package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/google/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/index.d.ts +16 -9
- package/dist/src/compiled/@ai-sdk/openai/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/otel/index.js +2 -2
- package/dist/src/compiled/@vercel/sandbox/index.js +1 -1
- package/dist/src/compiled/@workflow/core/capabilities.d.ts +19 -1
- package/dist/src/compiled/@workflow/core/class-serialization.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/create-hook.d.ts +37 -0
- package/dist/src/compiled/@workflow/core/global.d.ts +11 -1
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +4 -2
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +6 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -2
- package/dist/src/compiled/@workflow/core/runtime/wait-continuation.d.ts +84 -0
- package/dist/src/compiled/@workflow/core/runtime/wait-until.d.ts +18 -0
- package/dist/src/compiled/@workflow/core/runtime.d.ts +3 -1
- package/dist/src/compiled/@workflow/core/runtime.js +28 -28
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +21 -0
- package/dist/src/compiled/@workflow/core/serialization.d.ts +113 -6
- package/dist/src/compiled/@workflow/core/symbols.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/util.d.ts +0 -5
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/attribute-dispatcher.d.ts +6 -0
- package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +3 -4
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/events.d.ts +48 -0
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
- package/dist/src/compiled/@workflow/world/queue.d.ts +31 -2
- package/dist/src/compiled/@workflow/world/runs.d.ts +2 -0
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +2 -1
- package/dist/src/compiled/_chunks/workflow/attribute-changes-DGVGRGfw.js +59 -0
- package/dist/src/compiled/_chunks/workflow/{dist-gEXVSMPU.js → dist-CkMRLaRV.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/functions-DuPjIvMH.js +1 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-DMSadN9o.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-BRdn7zy_.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-CpXfoXLF.js +1 -0
- package/dist/src/compiled/just-bash/index.d.ts +4 -4
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/manifest.d.ts +8 -8
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-channel.d.ts +2 -1
- package/dist/src/compiler/normalize-channel.js +1 -1
- package/dist/src/compiler/normalize-connection.d.ts +2 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-helpers.d.ts +5 -0
- package/dist/src/compiler/normalize-helpers.js +1 -1
- package/dist/src/compiler/normalize-instructions.d.ts +3 -2
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +2 -2
- package/dist/src/compiler/normalize-sandbox.d.ts +2 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/normalize-schedule.d.ts +2 -1
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +2 -1
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +4 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +2 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/node.d.ts +1 -1
- package/dist/src/evals/assertions/collector.d.ts +43 -0
- package/dist/src/evals/assertions/collector.js +1 -0
- package/dist/src/evals/assertions/run.d.ts +72 -0
- package/dist/src/evals/assertions/run.js +2 -0
- package/dist/src/evals/autoevals-client.js +2 -0
- package/dist/src/evals/cli/eval-client.d.ts +22 -0
- package/dist/src/evals/cli/eval-client.js +1 -0
- package/dist/src/evals/cli/eval.d.ts +8 -5
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/context.d.ts +19 -0
- package/dist/src/evals/context.js +1 -0
- package/dist/src/evals/define-eval-config.d.ts +16 -0
- package/dist/src/evals/define-eval-config.js +1 -0
- package/dist/src/evals/define-eval.d.ts +20 -0
- package/dist/src/evals/define-eval.js +1 -0
- package/dist/src/evals/expect/index.d.ts +25 -0
- package/dist/src/evals/expect/index.js +1 -0
- package/dist/src/evals/index.d.ts +6 -2
- package/dist/src/evals/index.js +1 -1
- package/dist/src/evals/judge.d.ts +20 -0
- package/dist/src/evals/judge.js +1 -0
- package/dist/src/evals/{checks/match.d.ts → match.d.ts} +17 -18
- package/dist/src/evals/match.js +1 -0
- package/dist/src/evals/reporters/index.d.ts +1 -0
- package/dist/src/evals/reporters/index.js +1 -1
- package/dist/src/evals/requirements.d.ts +3 -0
- package/dist/src/evals/requirements.js +1 -0
- package/dist/src/evals/runner/artifacts.d.ts +7 -6
- package/dist/src/evals/runner/artifacts.js +3 -3
- package/dist/src/evals/runner/discover.d.ts +31 -10
- package/dist/src/evals/runner/discover.js +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +25 -0
- package/dist/src/evals/runner/execute-eval.js +1 -0
- package/dist/src/evals/runner/execute-task.d.ts +31 -0
- package/dist/src/evals/runner/execute-task.js +1 -0
- package/dist/src/evals/runner/reporters/braintrust.d.ts +7 -5
- package/dist/src/evals/runner/reporters/braintrust.js +2 -2
- package/dist/src/evals/runner/reporters/console.d.ts +4 -4
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/reporters/junit.d.ts +10 -0
- package/dist/src/evals/runner/reporters/junit.js +4 -0
- package/dist/src/evals/runner/reporters/types.d.ts +14 -8
- package/dist/src/evals/runner/run-evals.d.ts +38 -0
- package/dist/src/evals/runner/run-evals.js +1 -0
- package/dist/src/evals/runner/verdict.d.ts +10 -15
- package/dist/src/evals/runner/verdict.js +1 -1
- package/dist/src/evals/session.d.ts +52 -0
- package/dist/src/evals/session.js +1 -0
- package/dist/src/evals/target.d.ts +23 -0
- package/dist/src/evals/target.js +1 -0
- package/dist/src/evals/types.d.ts +294 -219
- package/dist/src/execution/compaction.d.ts +14 -0
- package/dist/src/execution/compaction.js +1 -0
- package/dist/src/execution/delegated-parent-notification.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/sandbox/bash-tool.d.ts +6 -6
- package/dist/src/execution/sandbox/bash-tool.js +1 -1
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +2 -6
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +3 -3
- package/dist/src/execution/sandbox/grep-tool.js +3 -3
- package/dist/src/execution/sandbox/read-file-tool.js +1 -1
- package/dist/src/execution/subagent-adapter.js +1 -1
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +2 -2
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/authorization.d.ts +26 -0
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/code-mode-lifecycle.js +1 -1
- package/dist/src/harness/emission.d.ts +12 -5
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/model-call-error.d.ts +35 -6
- package/dist/src/harness/model-call-error.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +10 -4
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/tools.d.ts +4 -6
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +4 -0
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +4 -15
- package/dist/src/internal/application/cache-metadata.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +4 -1
- package/dist/src/internal/authored-module-loader.js +2 -2
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +3 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-watcher-log.d.ts +37 -0
- package/dist/src/internal/nitro/host/dev-watcher-log.js +1 -0
- package/dist/src/internal/nitro/host/ports.d.ts +8 -0
- package/dist/src/internal/nitro/host/ports.js +1 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/server-external-packages.d.ts +1 -1
- package/dist/src/internal/nitro/host/server-external-packages.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/host/start-production-server.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +5 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +31 -2
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.d.ts +13 -0
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -1
- package/dist/src/internal/nitro/routes/info.d.ts +2 -2
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/workflow/queue-namespace.d.ts +5 -0
- package/dist/src/internal/workflow/queue-namespace.js +1 -0
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
- package/dist/src/internal/workflow-bundle/builder.js +3 -5
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +4 -4
- package/dist/src/protocol/message.d.ts +15 -0
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/public/channels/slack/api.d.ts +8 -0
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/connections.d.ts +26 -18
- package/dist/src/public/channels/slack/connections.js +1 -1
- package/dist/src/public/channels/slack/defaults.d.ts +5 -2
- package/dist/src/public/channels/slack/defaults.js +1 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +65 -5
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/defaults.js +1 -1
- package/dist/src/public/connections/errors.d.ts +8 -0
- package/dist/src/public/definitions/tool.d.ts +0 -33
- package/dist/src/public/next/index.d.ts +7 -1
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/server.d.ts +1 -0
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/sveltekit/index.d.ts +1 -1
- package/dist/src/public/tools/defaults.d.ts +2 -4
- package/dist/src/public/tools/defaults.js +1 -1
- package/dist/src/public/tools/define-bash-tool.d.ts +3 -3
- package/dist/src/public/tools/define-bash-tool.js +1 -1
- package/dist/src/public/tools/define-read-file-tool.d.ts +0 -6
- package/dist/src/public/tools/define-read-file-tool.js +1 -1
- package/dist/src/public/tools/index.d.ts +2 -2
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/public/tools/internal.js +1 -1
- package/dist/src/runtime/actions/types.d.ts +11 -11
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.js +3 -2
- package/dist/src/runtime/agent/mock-model-skill-selection.js +3 -4
- package/dist/src/runtime/connections/callback-route.js +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +21 -5
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/connections/types.d.ts +33 -0
- package/dist/src/runtime/connections/validate-authorization.js +1 -1
- package/dist/src/runtime/framework-tools/bash.d.ts +3 -3
- package/dist/src/runtime/framework-tools/bash.js +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.d.ts +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -1
- package/dist/src/runtime/framework-tools/file-state.d.ts +3 -3
- package/dist/src/runtime/framework-tools/index.js +1 -1
- package/dist/src/runtime/framework-tools/read-file.js +2 -2
- package/dist/src/runtime/framework-tools/todo.d.ts +7 -0
- package/dist/src/runtime/framework-tools/todo.js +2 -2
- package/dist/src/runtime/governance/auth/http-basic.js +1 -1
- package/dist/src/runtime/input/types.d.ts +1 -1
- package/dist/src/runtime/resolve-tool.d.ts +2 -2
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/session-callback-route.js +1 -1
- package/dist/src/runtime/types.d.ts +1 -7
- package/dist/src/services/dev-client/client-options.d.ts +8 -0
- package/dist/src/services/dev-client/client-options.js +1 -0
- package/dist/src/services/dev-client/runtime-artifacts.d.ts +13 -0
- package/dist/src/services/dev-client/runtime-artifacts.js +1 -0
- package/dist/src/services/dev-client.d.ts +13 -46
- package/dist/src/services/dev-client.js +1 -1
- package/dist/src/setup/ask.d.ts +205 -0
- package/dist/src/setup/ask.js +1 -0
- package/dist/src/setup/boxes/add-channels.d.ts +100 -16
- package/dist/src/setup/boxes/add-channels.js +2 -1
- package/dist/src/setup/boxes/add-connections.d.ts +13 -23
- package/dist/src/setup/boxes/add-connections.js +1 -1
- package/dist/src/setup/boxes/apply-ai-gateway-credential.d.ts +2 -2
- package/dist/src/setup/boxes/apply-ai-gateway-credential.js +1 -1
- package/dist/src/setup/boxes/deploy-project.d.ts +46 -14
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/boxes/detect-ai-gateway.d.ts +10 -3
- package/dist/src/setup/boxes/detect-ai-gateway.js +1 -1
- package/dist/src/setup/boxes/link-project.d.ts +3 -3
- package/dist/src/setup/boxes/link-project.js +1 -1
- package/dist/src/setup/boxes/one-shot-next-steps.d.ts +18 -0
- package/dist/src/setup/boxes/one-shot-next-steps.js +2 -0
- package/dist/src/setup/boxes/preflight.d.ts +14 -6
- package/dist/src/setup/boxes/preflight.js +1 -1
- package/dist/src/setup/boxes/resolve-provisioning.d.ts +36 -8
- package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
- package/dist/src/setup/boxes/resolve-target.d.ts +25 -8
- package/dist/src/setup/boxes/resolve-target.js +1 -1
- package/dist/src/setup/boxes/scaffold.d.ts +12 -6
- package/dist/src/setup/boxes/scaffold.js +1 -1
- package/dist/src/setup/boxes/select-channels.d.ts +38 -9
- package/dist/src/setup/boxes/select-channels.js +1 -1
- package/dist/src/setup/boxes/select-chat.d.ts +15 -11
- package/dist/src/setup/boxes/select-chat.js +1 -1
- package/dist/src/setup/boxes/select-connections.d.ts +30 -0
- package/dist/src/setup/boxes/select-connections.js +1 -0
- package/dist/src/setup/boxes/select-model.d.ts +18 -14
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/boxes/select-setup-mode.d.ts +32 -0
- package/dist/src/setup/boxes/select-setup-mode.js +1 -0
- package/dist/src/setup/channel-add-conflicts.d.ts +28 -0
- package/dist/src/setup/channel-add-conflicts.js +1 -0
- package/dist/src/setup/cli/channel-setup-prompter.d.ts +23 -0
- package/dist/src/setup/cli/channel-setup-prompter.js +1 -0
- package/dist/src/setup/cli/connection-add-prompter.d.ts +8 -0
- package/dist/src/setup/cli/connection-add-prompter.js +1 -0
- package/dist/src/setup/{scaffold/cli → cli}/index.d.ts +4 -3
- package/dist/src/setup/cli/index.js +1 -0
- package/dist/src/setup/{scaffold/cli → cli}/prompt-ui.d.ts +39 -15
- package/dist/src/setup/cli/prompt-ui.js +5 -0
- package/dist/src/setup/{scaffold/cli → cli}/rail-log.d.ts +2 -0
- package/dist/src/setup/{scaffold/cli → cli}/rail-log.js +2 -2
- package/dist/src/setup/{scaffold/cli → cli}/select-component.d.ts +18 -3
- package/dist/src/setup/cli/select-component.js +1 -0
- package/dist/src/setup/cli/select-option-codec.d.ts +12 -0
- package/dist/src/setup/cli/select-option-codec.js +1 -0
- package/dist/src/setup/{scaffold/cli → cli}/select-state.d.ts +13 -1
- package/dist/src/setup/cli/select-state.js +1 -0
- package/dist/src/setup/cli/whimsy.d.ts +16 -0
- package/dist/src/setup/cli/whimsy.js +1 -0
- package/dist/src/setup/{scaffold/steps/setup-connection.d.ts → connection-connector.d.ts} +3 -2
- package/dist/src/setup/connection-connector.js +1 -0
- package/dist/src/setup/flows/channels.d.ts +43 -0
- package/dist/src/setup/flows/channels.js +1 -0
- package/dist/src/setup/flows/deploy.d.ts +40 -0
- package/dist/src/setup/flows/deploy.js +1 -0
- package/dist/src/setup/flows/in-project.d.ts +16 -0
- package/dist/src/setup/flows/in-project.js +1 -0
- package/dist/src/setup/flows/link.d.ts +43 -0
- package/dist/src/setup/flows/link.js +1 -0
- package/dist/src/setup/flows/model.d.ts +112 -0
- package/dist/src/setup/flows/model.js +1 -0
- package/dist/src/setup/flows/vercel.d.ts +31 -0
- package/dist/src/setup/flows/vercel.js +2 -0
- package/dist/src/setup/gateway-models.js +1 -1
- package/dist/src/setup/headless.d.ts +1 -1
- package/dist/src/setup/index.d.ts +10 -4
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/onboarding.d.ts +7 -4
- package/dist/src/setup/onboarding.js +1 -1
- package/dist/src/setup/package-manager.d.ts +27 -0
- package/dist/src/setup/package-manager.js +1 -0
- package/dist/src/setup/primitives/index.d.ts +3 -0
- package/dist/src/setup/primitives/index.js +1 -0
- package/dist/src/setup/primitives/pm/bun.d.ts +10 -0
- package/dist/src/setup/primitives/pm/bun.js +1 -0
- package/dist/src/setup/primitives/pm/index.d.ts +11 -0
- package/dist/src/setup/primitives/pm/index.js +1 -0
- package/dist/src/setup/primitives/pm/npm.d.ts +10 -0
- package/dist/src/setup/primitives/pm/npm.js +1 -0
- package/dist/src/setup/primitives/pm/pnpm.d.ts +27 -0
- package/dist/src/setup/primitives/pm/pnpm.js +8 -0
- package/dist/src/setup/primitives/pm/run.d.ts +23 -0
- package/dist/src/setup/primitives/pm/run.js +1 -0
- package/dist/src/setup/primitives/pm/shared.d.ts +8 -0
- package/dist/src/setup/primitives/pm/shared.js +1 -0
- package/dist/src/setup/primitives/pm/types.d.ts +37 -0
- package/dist/src/setup/primitives/pm/types.js +1 -0
- package/dist/src/setup/primitives/pm/yarn.d.ts +10 -0
- package/dist/src/setup/primitives/pm/yarn.js +1 -0
- package/dist/src/setup/primitives/run-pnpm.d.ts +1 -0
- package/dist/src/setup/primitives/run-pnpm.js +1 -0
- package/dist/src/setup/{scaffold/primitives → primitives}/run-vercel.d.ts +7 -0
- package/dist/src/setup/primitives/run-vercel.js +1 -0
- package/dist/src/setup/project-name.d.ts +4 -0
- package/dist/src/setup/project-name.js +1 -0
- package/dist/src/setup/project-resolution.d.ts +54 -0
- package/dist/src/setup/project-resolution.js +1 -0
- package/dist/src/setup/prompter.d.ts +52 -4
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/quit-guard.d.ts +1 -1
- package/dist/src/setup/run-vercel-link.d.ts +1 -1
- package/dist/src/setup/run-vercel-link.js +1 -1
- package/dist/src/setup/runner.d.ts +5 -4
- package/dist/src/setup/runner.js +1 -1
- package/dist/src/setup/scaffold/channels-catalog.d.ts +3 -3
- package/dist/src/setup/scaffold/channels-catalog.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +26 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -0
- package/dist/src/setup/scaffold/create/project.d.ts +54 -0
- package/dist/src/setup/scaffold/create/project.js +80 -0
- package/dist/src/setup/scaffold/index.d.ts +4 -4
- package/dist/src/setup/scaffold/index.js +1 -1
- package/dist/src/setup/scaffold/{channels.d.ts → update/channels.d.ts} +11 -0
- package/dist/src/setup/scaffold/update/channels.js +7 -0
- package/dist/src/setup/scaffold/{connections.d.ts → update/connections.d.ts} +1 -1
- package/dist/src/setup/scaffold/update/connections.js +21 -0
- package/dist/src/setup/scaffold/version-tokens.d.ts +11 -0
- package/dist/src/setup/scaffold/version-tokens.js +1 -0
- package/dist/src/setup/{scaffold/steps/setup-slackbot.d.ts → slackbot.d.ts} +24 -20
- package/dist/src/setup/slackbot.js +1 -0
- package/dist/src/setup/state.d.ts +62 -15
- package/dist/src/setup/state.js +1 -1
- package/dist/src/setup/step.d.ts +9 -18
- package/dist/src/setup/vercel-project.d.ts +15 -8
- package/dist/src/setup/vercel-project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +5 -3
- package/dist/src/shared/default-agent-model.d.ts +5 -0
- package/dist/src/shared/default-agent-model.js +1 -0
- package/dist/src/source-change/apply-model-name.d.ts +25 -0
- package/dist/src/source-change/apply-model-name.js +2 -0
- package/dist/src/source-change/static-source-change.d.ts +36 -0
- package/dist/src/source-change/static-source-change.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/package.json +22 -42
- package/dist/docs/evals-v2-plan.md +0 -939
- package/dist/docs/public/advanced/dev-tui.md +0 -52
- package/dist/docs/public/advanced/evals.md +0 -158
- package/dist/docs/public/reference/faqs.md +0 -48
- package/dist/src/cli/commands/setup.d.ts +0 -55
- package/dist/src/cli/commands/setup.js +0 -1
- package/dist/src/cli/dev/repl/input-requests.d.ts +0 -38
- package/dist/src/cli/dev/repl/input-requests.js +0 -1
- package/dist/src/cli/dev/repl/input.d.ts +0 -19
- package/dist/src/cli/dev/repl/input.js +0 -1
- package/dist/src/cli/dev/repl/repl.d.ts +0 -62
- package/dist/src/cli/dev/repl/repl.js +0 -2
- package/dist/src/cli/dev/repl/terminal.d.ts +0 -21
- package/dist/src/cli/dev/repl/terminal.js +0 -5
- package/dist/src/compiled/_chunks/workflow/resume-hook-0Zk0zSvq.js +0 -12
- package/dist/src/compiled/_chunks/workflow/sleep-DXZr2BgM.js +0 -1
- package/dist/src/compiled/_chunks/workflow/symbols-BWCAoPHE.js +0 -48
- package/dist/src/evals/checks/checks.d.ts +0 -66
- package/dist/src/evals/checks/checks.js +0 -2
- package/dist/src/evals/checks/index.d.ts +0 -21
- package/dist/src/evals/checks/index.js +0 -1
- package/dist/src/evals/checks/match.js +0 -1
- package/dist/src/evals/define-eval-suite.d.ts +0 -18
- package/dist/src/evals/define-eval-suite.js +0 -1
- package/dist/src/evals/runner/execute-case.d.ts +0 -23
- package/dist/src/evals/runner/execute-case.js +0 -1
- package/dist/src/evals/runner/execute-suite.d.ts +0 -24
- package/dist/src/evals/runner/execute-suite.js +0 -1
- package/dist/src/evals/scorers/autoevals-client.js +0 -2
- package/dist/src/evals/scorers/autoevals.d.ts +0 -58
- package/dist/src/evals/scorers/autoevals.js +0 -1
- package/dist/src/evals/scorers/json.d.ts +0 -10
- package/dist/src/evals/scorers/json.js +0 -1
- package/dist/src/evals/scorers/model-marker.d.ts +0 -12
- package/dist/src/evals/scorers/model-marker.js +0 -1
- package/dist/src/evals/scorers/run.d.ts +0 -24
- package/dist/src/evals/scorers/run.js +0 -1
- package/dist/src/evals/scorers/sql.d.ts +0 -9
- package/dist/src/evals/scorers/sql.js +0 -1
- package/dist/src/evals/scorers/text.d.ts +0 -18
- package/dist/src/evals/scorers/text.js +0 -1
- package/dist/src/evals/scores/index.d.ts +0 -72
- package/dist/src/evals/scores/index.js +0 -1
- package/dist/src/execution/tool-compaction.d.ts +0 -9
- package/dist/src/execution/tool-compaction.js +0 -1
- package/dist/src/services/dev-client/stream.d.ts +0 -5
- package/dist/src/services/dev-client/stream.js +0 -1
- package/dist/src/services/dev-client/url.d.ts +0 -11
- package/dist/src/services/dev-client/url.js +0 -1
- package/dist/src/setup/channel-setup-prompter.d.ts +0 -8
- package/dist/src/setup/channel-setup-prompter.js +0 -1
- package/dist/src/setup/scaffold/channels.js +0 -7
- package/dist/src/setup/scaffold/cli/channel-add-prompter.d.ts +0 -12
- package/dist/src/setup/scaffold/cli/channel-add-prompter.js +0 -1
- package/dist/src/setup/scaffold/cli/channel-setup-prompter.d.ts +0 -56
- package/dist/src/setup/scaffold/cli/connection-add-prompter.d.ts +0 -44
- package/dist/src/setup/scaffold/cli/connection-add-prompter.js +0 -1
- package/dist/src/setup/scaffold/cli/index.js +0 -1
- package/dist/src/setup/scaffold/cli/prompt-ui.js +0 -5
- package/dist/src/setup/scaffold/cli/select-component.js +0 -1
- package/dist/src/setup/scaffold/cli/select-state.js +0 -1
- package/dist/src/setup/scaffold/connections.js +0 -21
- package/dist/src/setup/scaffold/pnpm-workspace.d.ts +0 -3
- package/dist/src/setup/scaffold/pnpm-workspace.js +0 -11
- package/dist/src/setup/scaffold/primitives/detect-deployment.d.ts +0 -13
- package/dist/src/setup/scaffold/primitives/detect-deployment.js +0 -1
- package/dist/src/setup/scaffold/primitives/index.d.ts +0 -3
- package/dist/src/setup/scaffold/primitives/index.js +0 -1
- package/dist/src/setup/scaffold/primitives/pnpm-invocation.d.ts +0 -12
- package/dist/src/setup/scaffold/primitives/pnpm-invocation.js +0 -1
- package/dist/src/setup/scaffold/primitives/run-pnpm.d.ts +0 -17
- package/dist/src/setup/scaffold/primitives/run-pnpm.js +0 -1
- package/dist/src/setup/scaffold/primitives/run-vercel.js +0 -1
- package/dist/src/setup/scaffold/project.d.ts +0 -21
- package/dist/src/setup/scaffold/project.js +0 -80
- package/dist/src/setup/scaffold/steps/deploy-to-vercel.d.ts +0 -17
- package/dist/src/setup/scaffold/steps/deploy-to-vercel.js +0 -1
- package/dist/src/setup/scaffold/steps/index.d.ts +0 -4
- package/dist/src/setup/scaffold/steps/index.js +0 -1
- package/dist/src/setup/scaffold/steps/project-resolution.d.ts +0 -19
- package/dist/src/setup/scaffold/steps/project-resolution.js +0 -1
- package/dist/src/setup/scaffold/steps/run-add-connection.d.ts +0 -40
- package/dist/src/setup/scaffold/steps/run-add-connection.js +0 -1
- package/dist/src/setup/scaffold/steps/run-add-to-agent.d.ts +0 -81
- package/dist/src/setup/scaffold/steps/run-add-to-agent.js +0 -2
- package/dist/src/setup/scaffold/steps/setup-connection.js +0 -1
- package/dist/src/setup/scaffold/steps/setup-slackbot.js +0 -1
- /package/dist/docs/public/{frontend → guides/frontend}/meta.json +0 -0
- /package/dist/docs/public/{advanced → guides}/remote-agents.md +0 -0
- /package/dist/src/{setup/scaffold/cli/channel-setup-prompter.js → cli/dev/tui/setup-flow.js} +0 -0
- /package/dist/src/evals/{scorers/autoevals-client.d.ts → autoevals-client.d.ts} +0 -0
- /package/dist/src/setup/{scaffold/cli → cli}/command-output.d.ts +0 -0
- /package/dist/src/setup/{scaffold/cli → cli}/command-output.js +0 -0
- /package/dist/src/setup/{scaffold/human-action.d.ts → human-action.d.ts} +0 -0
- /package/dist/src/setup/{scaffold/human-action.js → human-action.js} +0 -0
- /package/dist/src/setup/{scaffold/primitives → primitives}/process-output.d.ts +0 -0
- /package/dist/src/setup/{scaffold/primitives → primitives}/process-output.js +0 -0
- /package/dist/src/setup/scaffold/{web-template.d.ts → create/web-template.d.ts} +0 -0
- /package/dist/src/setup/scaffold/{web-template.js → create/web-template.js} +0 -0
- /package/dist/src/setup/scaffold/{module-files.d.ts → update/module-files.d.ts} +0 -0
- /package/dist/src/setup/scaffold/{module-files.js → update/module-files.js} +0 -0
- /package/dist/src/setup/scaffold/{package-json.d.ts → update/package-json.d.ts} +0 -0
- /package/dist/src/setup/scaffold/{package-json.js → update/package-json.js} +0 -0
- /package/dist/src/setup/scaffold/{primitives → update}/update-connection-connector.d.ts +0 -0
- /package/dist/src/setup/scaffold/{primitives → update}/update-connection-connector.js +0 -0
- /package/dist/src/setup/scaffold/{primitives → update}/update-slack-channel.d.ts +0 -0
- /package/dist/src/setup/scaffold/{primitives → update}/update-slack-channel.js +0 -0
|
@@ -1,33 +1,117 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { deriveSlackConnectorSlug, ensureChannel, type ChannelKind } from "#setup/scaffold/index.js";
|
|
2
|
+
import { detectPackageManager } from "#setup/package-manager.js";
|
|
3
|
+
import { runPackageManagerInstall } from "#setup/primitives/pm/run.js";
|
|
4
|
+
import { runVercel } from "#setup/primitives/run-vercel.js";
|
|
5
|
+
import { detectDeployment, type ProjectResolution } from "../project-resolution.js";
|
|
6
|
+
import { type Asker } from "../ask.js";
|
|
2
7
|
import type { Prompter } from "../prompter.js";
|
|
8
|
+
import { provisionSlackbot, reconcileSlackUid } from "../slackbot.js";
|
|
3
9
|
import { type SetupState } from "../state.js";
|
|
4
10
|
import type { SetupBox } from "../step.js";
|
|
5
|
-
/** Injected for tests; defaults to the real
|
|
11
|
+
/** Injected for tests; defaults to the real scaffold, Connect, and Vercel effects. */
|
|
6
12
|
export interface AddChannelsDeps {
|
|
7
|
-
|
|
13
|
+
ensureChannel: typeof ensureChannel;
|
|
14
|
+
deriveSlackConnectorSlug: typeof deriveSlackConnectorSlug;
|
|
15
|
+
provisionSlackbot: typeof provisionSlackbot;
|
|
16
|
+
reconcileSlackUid: typeof reconcileSlackUid;
|
|
17
|
+
detectPackageManager: typeof detectPackageManager;
|
|
18
|
+
runPackageManagerInstall: typeof runPackageManagerInstall;
|
|
19
|
+
runVercel: typeof runVercel;
|
|
20
|
+
detectDeployment: typeof detectDeployment;
|
|
8
21
|
}
|
|
9
22
|
export interface AddChannelsOptions {
|
|
10
|
-
/**
|
|
23
|
+
/** Resolves the slackbot question; the composed stack decides how. */
|
|
24
|
+
asker: Asker;
|
|
25
|
+
/**
|
|
26
|
+
* Logs through `prompter.log` in `perform`, and owns the interactive
|
|
27
|
+
* `vercel link` fallback. The slackbot question itself now travels the asker,
|
|
28
|
+
* not this prompter.
|
|
29
|
+
*/
|
|
11
30
|
prompter: Prompter;
|
|
12
|
-
|
|
13
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Headless mode: gates the interactive `vercel link` fallback inside `perform`
|
|
33
|
+
* and refuses Slack up front. Fixed at composition time (the same place the
|
|
34
|
+
* asker base is chosen), since `gather` cannot read the mode off the asker.
|
|
35
|
+
*/
|
|
36
|
+
headless?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The `eve` dependency version for the scaffolded web `package.json`. When
|
|
39
|
+
* omitted (the `eve channels add` composition), `ensureChannel` receives no
|
|
40
|
+
* `webPackageVersions` at all, so every version comes from its build-stamped
|
|
41
|
+
* defaults.
|
|
42
|
+
*/
|
|
43
|
+
evePackageVersion?: string;
|
|
44
|
+
/** Skip the "Create slackbot?" prompt and use this answer. */
|
|
14
45
|
presetCreateSlackbot?: boolean;
|
|
46
|
+
/** Overwrite existing channel files (`eve channels add --force`). */
|
|
47
|
+
force?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Override for the web scaffold's Vercel services config. Defaults to
|
|
50
|
+
* `hasVercelProject(state)`; `eve channels add` pins it to true so an
|
|
51
|
+
* unlinked directory still gets the config, matching the dissolved engine.
|
|
52
|
+
*/
|
|
53
|
+
configureVercelServices?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Opt-in fallback when Slack is chosen interactively but `state.project` is
|
|
56
|
+
* unresolved: run the interactive bare `vercel link` before provisioning the
|
|
57
|
+
* slackbot. Only the `eve channels add` composition sets this; onboarding
|
|
58
|
+
* resolves the project up front via the link box and keeps the hard gate.
|
|
59
|
+
*/
|
|
60
|
+
ensureLinkedProject?: "interactive-vercel-link";
|
|
61
|
+
/**
|
|
62
|
+
* What a failed slackbot provision (create or attach) does to the run. The
|
|
63
|
+
* default, "abort", fails the whole box — right for `eve channels add slack`,
|
|
64
|
+
* where Slack is the point. Onboarding passes "warn-and-continue": the agent
|
|
65
|
+
* still scaffolds, deploys, and chats without Slack (recorded as nothing, so
|
|
66
|
+
* a later `eve channels add slack` starts clean).
|
|
67
|
+
*/
|
|
68
|
+
slackbotFailure?: "abort" | "warn-and-continue";
|
|
15
69
|
deps?: AddChannelsDeps;
|
|
16
70
|
}
|
|
17
71
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* faces record it instead of taking a factory option.
|
|
72
|
+
* What the user (or the preset) decided before `perform` runs effects.
|
|
73
|
+
* `createSlackbot` is only consulted when Slack is in the channel selection.
|
|
21
74
|
*/
|
|
22
75
|
export interface AddChannelsInput {
|
|
23
76
|
headless: boolean;
|
|
77
|
+
createSlackbot: boolean | undefined;
|
|
78
|
+
}
|
|
79
|
+
/** Slackbot facts resolved by a successful Connect provision. */
|
|
80
|
+
export interface AddChannelsSlackbotFacts {
|
|
81
|
+
connectorUid: string;
|
|
82
|
+
workspaceUrl?: string;
|
|
83
|
+
workspaceName?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* What `perform` actually did. `channelsAdded` lists the channels recorded this
|
|
87
|
+
* run (web before slack); a skipped Web scaffold (Next.js detected) records
|
|
88
|
+
* nothing, deliberately. `slackbot` is present only after a fresh, fully
|
|
89
|
+
* attached provision; every failure mode either throws or (under
|
|
90
|
+
* `slackbotFailure: "warn-and-continue"`) skips Slack entirely, so a failed
|
|
91
|
+
* Slack setup records nothing (atomicity).
|
|
92
|
+
*/
|
|
93
|
+
export interface AddChannelsPayload {
|
|
94
|
+
channelsAdded: ChannelKind[];
|
|
95
|
+
webScaffolded: boolean;
|
|
96
|
+
slackScaffolded: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether the post-scaffold dependency install succeeded. False both when no
|
|
99
|
+
* channels were recorded (nothing ran) and when the install failed; only a
|
|
100
|
+
* success lets `apply` mark the deploy-time install as already done.
|
|
101
|
+
*/
|
|
102
|
+
dependenciesInstalled: boolean;
|
|
103
|
+
project: ProjectResolution;
|
|
104
|
+
slackbot?: AddChannelsSlackbotFacts;
|
|
24
105
|
}
|
|
25
106
|
/**
|
|
26
|
-
* THE CHANNEL SCAFFOLD BOX.
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
107
|
+
* THE CHANNEL SCAFFOLD BOX. Scaffolds the channels chosen up front by the
|
|
108
|
+
* select-channels box (`state.channelSelection`): writes the Web Chat files,
|
|
109
|
+
* provisions the Slackbot through Vercel Connect, writes the Slack channel
|
|
110
|
+
* definition, reconciles a Connect-assigned connector UID, and installs the
|
|
111
|
+
* dependencies the scaffold added to `package.json` so a running `eve dev`
|
|
112
|
+
* can load the new channel modules right away. The only prompt
|
|
113
|
+
* (the slackbot question) travels the asker in `gather`; `perform` is promptless
|
|
114
|
+
* and reads `state.project` directly, resolved earlier by the link box or the
|
|
115
|
+
* in-project seed.
|
|
32
116
|
*/
|
|
33
|
-
export declare function addChannels(options: AddChannelsOptions): SetupBox<SetupState, AddChannelsInput,
|
|
117
|
+
export declare function addChannels(options: AddChannelsOptions): SetupBox<SetupState, AddChannelsInput, AddChannelsPayload>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{SkippedSignal,confirm}from"../ask.js";import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployment}from"../project-resolution.js";import{provisionSlackbot,reconcileSlackUid}from"../slackbot.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{deriveSlackConnectorSlug,ensureChannel}from"#setup/scaffold/index.js";import{detectPackageManager}from"#setup/package-manager.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";import{runVercel}from"#setup/primitives/run-vercel.js";const SLACKBOT_NOT_ATTACHED_ERROR=`Slackbot provisioning did not attach this project. Slack channel was not added.`;function warnOverwrittenFiles(e,t){for(let n of t??[])e.warning(`Overwrote ${n}`)}function warnCompetingNextConfigFiles(e,t){for(let n of t??[])e.warning(`Found competing Next.js config at ${n}; merge any needed settings into next.config.ts and remove it before starting the preview, or Next.js may ignore the generated Eve rewrite.`)}function addChannels(l){let u=l.deps??{ensureChannel,deriveSlackConnectorSlug,provisionSlackbot,reconcileSlackUid,detectPackageManager,runPackageManagerInstall,runVercel,detectDeployment};async function scaffoldSlackChannel(e,t,n,r,i){if(!t.slackScaffolded){e.message(`Scaffolding Slack channel files...`);let t=await u.ensureChannel({projectRoot:n,kind:`slack`,slackConnectorSlug:r,force:l.force});warnOverwrittenFiles(e,t.filesOverwritten),t.action===`created`||t.action===`overwritten`?e.success(`Scaffolded channel: slack`):e.info(`Channel "slack" already exists. Skipping file creation.`),i.slackScaffolded=!0}i.channelsAdded.push(`slack`)}async function linkProjectForSlackbot(e,t,n,o){if(o)throw new HumanActionRequiredError({kind:`vercel-link`,command:`vercel link`,reason:`Slackbot creation needs this directory linked to a Vercel project.`});if(e.message(`Linking this directory to a Vercel project...`),!await u.runVercel([`link`],{cwd:t}))throw Error(`Vercel project linking failed. Slackbot creation did not start.`);let s=mergeProjectResolution(n,projectResolutionFromDeployment(await u.detectDeployment(t)));if(!isProjectResolved(s))throw Error(`Vercel project linking failed. Slackbot creation did not start.`);return s}async function performAddChannels(e,t){let n=l.prompter.log,i=requireProjectPath(e),a=e.channelSelection,o={channelsAdded:[],webScaffolded:e.webScaffolded,slackScaffolded:e.slackScaffolded,dependenciesInstalled:!1,project:e.project},s=await u.detectPackageManager(i);if(a.includes(`web`))if(e.webScaffolded)o.channelsAdded.push(`web`);else{n.message(`Scaffolding Web Chat channel files...`);let t={projectRoot:i,kind:`web`,packageManager:s.kind,force:l.force,configureVercelServices:l.configureVercelServices??hasVercelProject(e)};l.evePackageVersion!==void 0&&(t.webPackageVersions={evePackageVersion:l.evePackageVersion});let r=await u.ensureChannel(t);warnOverwrittenFiles(n,r.filesOverwritten),warnCompetingNextConfigFiles(n,`competingNextConfigFiles`in r?r.competingNextConfigFiles:void 0),r.action===`created`||r.action===`overwritten`?(n.success(`Scaffolded channel: web`),o.webScaffolded=!0,o.channelsAdded.push(`web`)):n.info(`Next.js project detected. Skipping Web Chat scaffolding.`)}if(a.includes(`slack`)){if(l.ensureLinkedProject===void 0){if(!hasVercelProject(e))throw Error(`Slack requires a Vercel project. Re-run and choose to deploy to Vercel to add Slack.`);if(!isProjectResolved(e.project))throw Error(`Expected a linked Vercel project for Slack, but none was resolved.`)}let a=await u.deriveSlackConnectorSlug(i,e.agentName),s=`slack/${a}`;if(e.slackbotCreated){if(!e.slackbotAttached)throw Error(SLACKBOT_NOT_ATTACHED_ERROR);if(e.deploymentPending){await scaffoldSlackChannel(n,e,i,a,o);let t=e.slackConnectorUid;if(t===void 0)throw Error(`Slack connector UID was not resolved. Slack deployment did not start.`);if(!await u.reconcileSlackUid(n,i,{kind:`attached`,created:!0,attached:!0,connectorUid:t},s))throw Error(`Slack connector UID update is required before deployment.`)}}else if(t.createSlackbot!==!0)n.info(`Slack channel was not added because Slackbot setup was skipped.`);else{isProjectResolved(o.project)||(o.project=await linkProjectForSlackbot(n,i,o.project,t.headless));let c=await u.provisionSlackbot(n,i,a);if(c.kind!==`attached`){let e=c.created?SLACKBOT_NOT_ATTACHED_ERROR:`Slackbot creation failed.`;if(l.slackbotFailure!==`warn-and-continue`)throw Error(e);let t=c.created?"Continuing without Slack — finish event delivery with the `vercel connect attach` command above.":"Continuing without Slack — add it later with `eve channels add slack`.";n.warning(`${e} ${t}`)}else if(o.slackbot={connectorUid:c.connectorUid,workspaceUrl:c.workspaceUrl,workspaceName:c.workspaceName},await scaffoldSlackChannel(n,e,i,a,o),!await u.reconcileSlackUid(n,i,c,s))throw Error(`Slack connector UID update is required before deployment.`)}}return o.channelsAdded.length>0&&(n.message(`Installing channel dependencies (${s.kind} install)...`),await u.runPackageManagerInstall(s.kind,i,{onOutput:createPromptCommandOutput(n)})?o.dependenciesInstalled=!0:n.warning(`Dependency installation failed. The new channels stay unloadable until \`${s.kind} install\` or a deploy succeeds.`)),o}return{id:`add-channels`,async gather({state:n}){let r=l.headless??!1;if(r&&n.channelSelection.includes(`slack`))throw Error("Slack setup is interactive. Run `eve channels add slack` from an interactive terminal.");if(!n.channelSelection.includes(`slack`)||l.presetCreateSlackbot!==void 0||n.slackbotCreated)return{headless:r,createSlackbot:l.presetCreateSlackbot};try{return{headless:r,createSlackbot:await l.asker.ask(confirm({key:`create-slackbot`,message:`Do you want to create your slackbot?`}))}}catch(t){if(t instanceof SkippedSignal)return{headless:r,createSlackbot:!1};throw t}},async perform({state:e,input:t}){try{return await performAddChannels(e,t)}catch(e){let t=e instanceof Error?e.message:String(e),n=t.split(`
|
|
2
|
+
`)[0]?.trim()??t;throw l.prompter.log.error(n),e}},apply(e,t){let n=[...e.channels];for(let e of t.channelsAdded)n.includes(e)||n.push(e);let r={...e,channels:n,webScaffolded:t.webScaffolded,slackScaffolded:t.slackScaffolded,deploymentPending:e.deploymentPending||t.channelsAdded.length>0,deploymentDependenciesInstalled:t.channelsAdded.length>0?t.dependenciesInstalled:e.deploymentDependenciesInstalled,project:mergeProjectResolution(e.project,t.project)};return t.slackbot===void 0?r:{...r,slackbotCreated:!0,slackbotAttached:!0,slackConnectorUid:t.slackbot.connectorUid,slackWorkspaceUrl:t.slackbot.workspaceUrl,slackWorkspaceName:t.slackbot.workspaceName}}}}export{addChannels};
|
|
@@ -1,34 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ensureConnection } from "#setup/scaffold/index.js";
|
|
2
|
+
import { setupConnectionConnector } from "../connection-connector.js";
|
|
3
|
+
import { type ProjectResolution } from "../project-resolution.js";
|
|
2
4
|
import type { Prompter } from "../prompter.js";
|
|
3
5
|
import { type SetupState } from "../state.js";
|
|
4
6
|
import type { SetupBox } from "../step.js";
|
|
5
|
-
/** Injected for tests; defaults to the real
|
|
7
|
+
/** Injected for tests; defaults to the real scaffold and Connect effects. */
|
|
6
8
|
export interface AddConnectionsDeps {
|
|
7
|
-
|
|
9
|
+
ensureConnection: typeof ensureConnection;
|
|
10
|
+
setupConnectionConnector: typeof setupConnectionConnector;
|
|
8
11
|
}
|
|
9
12
|
export interface AddConnectionsOptions {
|
|
10
|
-
/**
|
|
13
|
+
/** Carries the follow-up log lines and `perform`'s progress output. The box never prompts. */
|
|
11
14
|
prompter: Prompter;
|
|
12
|
-
/** Skip the picker and scaffold exactly these catalog slugs. */
|
|
13
|
-
presetConnections?: string[];
|
|
14
15
|
deps?: AddConnectionsDeps;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* THE CONNECTIONS BOX: executes the {@link ConnectionPlan}s the
|
|
19
|
+
* select-connections box recorded during the interview. Prompts for nothing —
|
|
20
|
+
* every decision (slug, protocol, entry, provisioning mode) was resolved at
|
|
21
|
+
* selection time — and only runs effects: the file scaffold, the follow-up log
|
|
22
|
+
* lines, and the Connect connector provisioning against the linked project.
|
|
21
23
|
*/
|
|
22
|
-
export
|
|
23
|
-
headless: boolean;
|
|
24
|
-
skip: boolean;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* THE CONNECTIONS BOX. Offers the connection catalog (plus a custom MCP /
|
|
28
|
-
* OpenAPI escape hatch) and scaffolds the selected `agent/connections/*.ts`.
|
|
29
|
-
* Shares the same flow as `eve connections add`: the engine `runAddConnection`
|
|
30
|
-
* owns the picker and custom sub-prompts, so this box is a documented exception
|
|
31
|
-
* to "gather prompts, perform executes" like the add-channels box. Skipped in
|
|
32
|
-
* headless mode unless explicit `presetConnections` were requested.
|
|
33
|
-
*/
|
|
34
|
-
export declare function addConnections(options: AddConnectionsOptions): SetupBox<SetupState, AddConnectionsInput, ProjectResolution>;
|
|
24
|
+
export declare function addConnections(options: AddConnectionsOptions): SetupBox<SetupState, null, ProjectResolution>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasVercelProject,requireProjectPath}from"../state.js";import{projectIdFromResolution}from"../vercel-project.js";import{
|
|
1
|
+
import{isProjectResolved,mergeProjectResolution}from"../project-resolution.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{setupConnectionConnector}from"../connection-connector.js";import{projectIdFromResolution}from"../vercel-project.js";import{CONNECT_REQUIRES_VERCEL}from"./select-connections.js";import{ensureConnection}from"#setup/scaffold/index.js";function logFollowUp(e,t){if(t.action===`skipped`){e.warning(`Skipped ${t.slug} (already exists; pass --force to overwrite).`);return}e.success(`Added agent/connections/${t.slug}.ts`),t.envKeysAdded.length>0?e.info(`Set ${t.envKeysAdded.join(`, `)} in .env.local`):t.envKeysRequired.length>0&&e.info(`Set ${t.envKeysRequired.join(`, `)} in your environment`)}function addConnections(a){let o=a.deps??{ensureConnection,setupConnectionConnector};return{id:`add-connections`,shouldRun(e){return e.connectionSelection.length>0},async gather(){return null},async perform({state:t}){let r=a.prompter.log,i=requireProjectPath(t),s=!hasVercelProject(t),c=t.project;for(let n of t.connectionSelection){let t=await o.ensureConnection({projectRoot:i,slug:n.slug,protocol:n.protocol,entry:n.entry});if(logFollowUp(r,t),t.action!==`skipped`)switch(n.provision.kind){case`connect`:await o.setupConnectionConnector({log:r,projectRoot:i,slug:t.slug,service:n.provision.service,connectionFilePath:t.filePath,linkProject:async()=>{if(s)throw Error(CONNECT_REQUIRES_VERCEL);if(!isProjectResolved(c))throw Error(`Expected a linked Vercel project for Connect, but none was resolved.`);return projectIdFromResolution(c)}});break;case`command-hint`:r.info(`Run \`vercel connect create ${n.provision.service} --name ${t.slug}\`, then set the connector UID in agent/connections/${t.slug}.ts.`);break;case`connect-manual`:r.warning(`Could not determine a Connect service for ${t.slug}. Create the connector manually and set its UID in agent/connections/${t.slug}.ts.`);break;case`none`:break}}return c},apply(e,n){return{...e,project:mergeProjectResolution(e.project,n)}}}}export{addConnections};
|
|
@@ -20,8 +20,8 @@ export interface ApplyAiGatewayCredentialOptions {
|
|
|
20
20
|
* after the project link is settled. It carries nothing about the project
|
|
21
21
|
* decision: whether a project is linked is read from `state.project` (set by
|
|
22
22
|
* the link box), and the credential choice is read from `state.aiGateway`
|
|
23
|
-
* (set by the resolve-provisioning box).
|
|
24
|
-
* owns all the work: `byok` writes a pasted AI Gateway key, `inherit` pulls the
|
|
23
|
+
* (set by the resolve-provisioning box). The gather prompts for nothing;
|
|
24
|
+
* `perform` owns all the work: `byok` writes a pasted AI Gateway key, `inherit` pulls the
|
|
25
25
|
* linked project's OIDC gateway, and `byop` leaves provider credentials to the
|
|
26
26
|
* scaffolded provider block.
|
|
27
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{appendEnv}from"../append-env.js";import{requireProjectPath}from"../state.js";import{runVercelEnvPull}from"../run-vercel-link.js";import{detectAiGatewayResolution}from"./detect-ai-gateway.js";import{join}from"node:path";import{
|
|
1
|
+
import{appendEnv}from"../append-env.js";import{isProjectResolved}from"../project-resolution.js";import{requireProjectPath}from"../state.js";import{withNetworkSpinner}from"../vercel-project.js";import{runVercelEnvPull}from"../run-vercel-link.js";import{detectAiGatewayResolution}from"./detect-ai-gateway.js";import{join}from"node:path";import{createPromptCommandOutput}from"#setup/cli/index.js";const AI_GATEWAY_ENV_KEY=`AI_GATEWAY_API_KEY`,ENV_FILE_NAME=`.env.local`;function applyAiGatewayCredential(s){let c=s.deps??{appendEnv,runVercelEnvPull,detectAiGatewayResolution};async function writeAiGatewayApiKey(e,t){let n=join(e,ENV_FILE_NAME);await c.appendEnv(n,{[AI_GATEWAY_ENV_KEY]:t.trim()},{force:!0}),s.prompter.log.success(`Wrote ${AI_GATEWAY_ENV_KEY} to ${n}`)}return{id:`apply-ai-gateway-credential`,shouldRun(e){let{aiGateway:n,project:r}=e;return n.kind===`byok`||n.kind===`inherit`&&isProjectResolved(r)},async gather(){return null},async perform({state:e}){let{prompter:i}=s,a=requireProjectPath(e),o=e.aiGateway,l=isProjectResolved(e.project);if(o.kind===`byop`)return{kind:`unresolved`};if(o.kind===`byok`)return await writeAiGatewayApiKey(a,o.apiGatewayKey),{kind:`api-key`,envFile:ENV_FILE_NAME};if(!l)return i.log.warning(`No Vercel project linked and no API key provided. The agent will not reach a model until you set ${AI_GATEWAY_ENV_KEY} in ${ENV_FILE_NAME} or link a project.`),{kind:`unresolved`};let u=createPromptCommandOutput(i.log);return await withNetworkSpinner(i,`Pulling Vercel environment variables into .env.local...`,()=>c.runVercelEnvPull(a,u))?i.log.success(`Connected the agent to the Vercel AI Gateway.`):i.log.warning(`Linked the project, but pulling environment variables did not complete.`),c.detectAiGatewayResolution(a)},apply(e,t){return{...e,aiGatewayCredentials:t}}}}export{applyAiGatewayCredential};
|
|
@@ -1,30 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { type ChannelSetupLog } from "#setup/cli/index.js";
|
|
2
|
+
import { detectPackageManager } from "#setup/package-manager.js";
|
|
3
|
+
import { runPackageManagerInstall } from "#setup/primitives/pm/run.js";
|
|
4
|
+
import { runVercel } from "#setup/primitives/run-vercel.js";
|
|
5
|
+
import { detectDeployment, type ProjectResolution } from "../project-resolution.js";
|
|
3
6
|
import { type SetupState } from "../state.js";
|
|
4
7
|
import type { SetupBox } from "../step.js";
|
|
5
|
-
/** Injected for tests; defaults to the real
|
|
8
|
+
/** Injected for tests; defaults to the real subprocess primitives. */
|
|
6
9
|
export interface DeployProjectDeps {
|
|
7
|
-
|
|
10
|
+
runVercel: typeof runVercel;
|
|
11
|
+
detectPackageManager: typeof detectPackageManager;
|
|
12
|
+
runPackageManagerInstall: typeof runPackageManagerInstall;
|
|
13
|
+
detectDeployment: typeof detectDeployment;
|
|
8
14
|
}
|
|
9
15
|
export interface DeployProjectOptions {
|
|
10
|
-
/**
|
|
11
|
-
prompter:
|
|
16
|
+
/** Deploy progress and command output stream through this log (rail styling preserved). */
|
|
17
|
+
prompter: {
|
|
18
|
+
log: ChannelSetupLog;
|
|
19
|
+
};
|
|
12
20
|
/** Skip the post-channel Vercel deployment entirely (`--no-deploy`). */
|
|
13
21
|
skip?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Run even without a planned or detected project, linking interactively from
|
|
24
|
+
* inside `perform` (the `eve channels add` composition; onboarding always has
|
|
25
|
+
* a plan or skips deploy with the channels).
|
|
26
|
+
*/
|
|
27
|
+
ensureLinkedProject?: "interactive-vercel-link";
|
|
28
|
+
/**
|
|
29
|
+
* Headless mode: gates interactive `vercel` commands inside `perform`. The box
|
|
30
|
+
* asks no questions, so the dispatch decision the gather faces used to encode
|
|
31
|
+
* comes from the composition site (the same place that picks the asker base),
|
|
32
|
+
* not from a prompt.
|
|
33
|
+
*/
|
|
34
|
+
headless?: boolean;
|
|
14
35
|
deps?: DeployProjectDeps;
|
|
15
36
|
}
|
|
16
37
|
/**
|
|
17
|
-
*
|
|
18
|
-
* inside `perform
|
|
19
|
-
*
|
|
38
|
+
* What `perform` consumes. The headless flag gates interactive `vercel`
|
|
39
|
+
* commands inside `perform`; it is fixed at composition time (the box prompts
|
|
40
|
+
* for nothing) and passed straight through {@link DeployProjectOptions.headless}.
|
|
20
41
|
*/
|
|
21
42
|
export interface DeployProjectInput {
|
|
22
43
|
headless: boolean;
|
|
23
44
|
}
|
|
45
|
+
/** The deploy facts `apply` records: the (re)deployed project and the cleared flags. */
|
|
46
|
+
export interface DeployProjectPayload {
|
|
47
|
+
project: ProjectResolution;
|
|
48
|
+
deploymentPending: boolean;
|
|
49
|
+
deploymentDependenciesInstalled: boolean;
|
|
50
|
+
}
|
|
24
51
|
/**
|
|
25
|
-
* THE DEPLOY BOX.
|
|
26
|
-
* marked deployment work pending
|
|
27
|
-
*
|
|
28
|
-
*
|
|
52
|
+
* THE DEPLOY BOX. Owns the post-channel `vercel deploy --prod` once channel
|
|
53
|
+
* setup has marked deployment work pending: dependency install (once per
|
|
54
|
+
* state), the production deploy, the env pull, and the deployment probe.
|
|
55
|
+
*
|
|
56
|
+
* The project was linked up front by the link box, so `perform` reuses
|
|
57
|
+
* `state.project` and never triggers a second interactive `vercel link` (the
|
|
58
|
+
* #1020 deadlock). When no resolution exists (no link box ran, e.g. the
|
|
59
|
+
* `eve channels add` composition), it falls back to the interactive bare
|
|
60
|
+
* `vercel link`, or throws {@link HumanActionRequiredError} headlessly.
|
|
29
61
|
*/
|
|
30
|
-
export declare function deployProject(options: DeployProjectOptions): SetupBox<SetupState, DeployProjectInput,
|
|
62
|
+
export declare function deployProject(options: DeployProjectOptions): SetupBox<SetupState, DeployProjectInput, DeployProjectPayload>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployResult,projectResolutionFromDeployment}from"../project-resolution.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{detectPackageManager}from"#setup/package-manager.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";import{runVercel}from"#setup/primitives/run-vercel.js";const VERCEL_DEPLOY_ENV={VERCEL_USE_EXPERIMENTAL_FRAMEWORKS:`1`};function deployProject(o){let s=o.deps??{runVercel,detectPackageManager,runPackageManagerInstall,detectDeployment};return{id:`deploy-project`,shouldRun(e){return o.skip||!e.deploymentPending?!1:hasVercelProject(e)||o.ensureLinkedProject===`interactive-vercel-link`},async gather(){return{headless:o.headless??!1}},async perform({state:e,input:n}){let r=requireProjectPath(e),{log:i}=o.prompter,a=createPromptCommandOutput(i),c=e.project;if(!isProjectResolved(c)){if(n.headless)throw new HumanActionRequiredError({kind:`vercel-link`,command:`vercel link`,reason:`Deployment needs this directory linked to a Vercel project.`});if(i.message(`Linking this directory to a Vercel project before deployment...`),!await s.runVercel([`link`],{cwd:r})||(c=mergeProjectResolution(c,projectResolutionFromDeployment(await s.detectDeployment(r))),!isProjectResolved(c)))throw Error(`Vercel project linking failed. Deployment did not start.`)}if(!e.deploymentDependenciesInstalled){let e=await s.detectPackageManager(r);if(i.message(`Installing project dependencies before deployment (${e.kind} install)...`),!await s.runPackageManagerInstall(e.kind,r,{onOutput:a}))throw Error(`Dependency installation failed. Deployment did not start.`)}i.message(`Deploying the agent to Vercel production...`);let l=n.headless?[`deploy`,`--prod`,`--yes`,`--non-interactive`]:[`deploy`,`--prod`,`--yes`];if(!await s.runVercel(l,{cwd:r,extraEnv:VERCEL_DEPLOY_ENV,nonInteractive:n.headless,onOutput:a}))throw i.error("`vercel deploy --prod` failed. The deploy output above shows the cause; fix it, then run `vercel deploy --prod` to retry."),Error(`Deployment failed after channel setup.`);i.message(`Pulling Vercel environment variables into .env.local...`),await s.runVercel([`env`,`pull`,`--yes`],{cwd:r,nonInteractive:n.headless,onOutput:a})||i.warning(`Deployment succeeded, but pulling Vercel environment variables did not complete.`);let u=await s.detectDeployment(r),d=u.state===`deployed`?u.productionUrl:void 0;return d===void 0?i.warning(`Deployment succeeded, but Eve could not verify its production URL.`):i.info(`Production URL: ${d}`),{project:projectResolutionFromDeployResult(c,{deployed:!0,productionUrl:d}),deploymentPending:!1,deploymentDependenciesInstalled:!0}},apply(e,t){return{...e,project:t.project,deploymentPending:t.deploymentPending,deploymentDependenciesInstalled:t.deploymentDependenciesInstalled}}}}export{deployProject};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { type ResolvedAiGatewayCredentials, type SetupState } from "../state.js";
|
|
1
|
+
import { type AiGatewayEnvFile, type ResolvedAiGatewayCredentials, type SetupState } from "../state.js";
|
|
2
2
|
import type { SetupBox } from "../step.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the first env file (`.env.local`, then `.env`) defining a non-empty
|
|
5
|
+
* value for `key`, or `undefined` when neither does. Exported for flows that
|
|
6
|
+
* verify credentials landed after a `vercel env pull` (the `eve link` flow
|
|
7
|
+
* checks both `VERCEL_OIDC_TOKEN` and `AI_GATEWAY_API_KEY`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function findEnvFileWithKey(projectRoot: string, key: string): Promise<AiGatewayEnvFile | undefined>;
|
|
3
10
|
export declare function detectAiGatewayResolution(projectRoot: string): Promise<ResolvedAiGatewayCredentials>;
|
|
4
11
|
/**
|
|
5
12
|
* THE AI GATEWAY DETECTION BOX: reads the scaffolded project's `.env.local` and
|
|
6
13
|
* `.env` for an existing `AI_GATEWAY_API_KEY` so the credential step can skip
|
|
7
|
-
* work already done. Pure detection: it prompts for nothing
|
|
8
|
-
*
|
|
14
|
+
* work already done. Pure detection: it prompts for nothing, so the single
|
|
15
|
+
* gather produces an empty input in every mode.
|
|
9
16
|
*/
|
|
10
17
|
export declare function detectAiGateway(): SetupBox<SetupState, null, ResolvedAiGatewayCredentials>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{requireProjectPath}from"../state.js";import{join}from"node:path";import{readFile}from"node:fs/promises";const ENV_FILE_CANDIDATES=[`.env.local`,`.env`];function readEnvValue(e,t){let n=e.trim();if(n.length===0||n.startsWith(`#`)||!n.startsWith(`${t}=`))return;let r=n.slice(t.length+1);if(r.length===0)return;let i=r.length>=2&&r.startsWith(`"`)&&r.endsWith(`"`)?r.slice(1,-1):r;return i.length===0?void 0:i}async function hasApiKeyInFile(e,t){let r;try{r=await readFile(e,`utf8`)}catch{return!1}for(let e of r.split(`
|
|
2
|
-
`))if(readEnvValue(e,t)!==void 0)return!0;return!1}async function
|
|
2
|
+
`))if(readEnvValue(e,t)!==void 0)return!0;return!1}async function findEnvFileWithKey(e,n){for(let i of ENV_FILE_CANDIDATES)if(await hasApiKeyInFile(join(e,i),n))return i}async function detectAiGatewayResolution(e){let t=await findEnvFileWithKey(e,`AI_GATEWAY_API_KEY`);return t===void 0?{kind:`unresolved`}:{kind:`api-key`,envFile:t}}function detectAiGateway(){return{id:`detect-ai-gateway`,shouldRun(e){return e.projectPath.kind===`resolved`},async gather(){return null},async perform({state:t}){return detectAiGatewayResolution(requireProjectPath(t))},apply(e,t){return{...e,aiGatewayCredentials:t}}}}export{detectAiGateway,detectAiGatewayResolution,findEnvFileWithKey};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type ProjectResolution } from "
|
|
1
|
+
import { detectProjectResolution, type ProjectResolution } from "../project-resolution.js";
|
|
2
2
|
import type { Prompter } from "../prompter.js";
|
|
3
3
|
import { type SetupState } from "../state.js";
|
|
4
4
|
import type { SetupBox } from "../step.js";
|
|
5
|
-
import {
|
|
5
|
+
import { linkProject, resolveProjectByNameOrId, unresolvedProject } from "../vercel-project.js";
|
|
6
6
|
/** Injected for tests; defaults to the real Vercel project helpers. */
|
|
7
7
|
export interface LinkProjectDeps {
|
|
8
8
|
linkProject: typeof linkProject;
|
|
@@ -18,7 +18,7 @@ export interface LinkProjectOptions {
|
|
|
18
18
|
/**
|
|
19
19
|
* THE PROJECT BOX. Executes the resolved Vercel project plan after scaffolding,
|
|
20
20
|
* once the project directory exists (so `vercel link` can write `.vercel/`).
|
|
21
|
-
*
|
|
21
|
+
* The gather prompts for nothing: every decision was made up front by the
|
|
22
22
|
* resolve-provisioning box, so `perform` owns all the work.
|
|
23
23
|
*
|
|
24
24
|
* The plan is authoritative. The box always re-links to the planned project so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requireProjectPath}from"../state.js";import{
|
|
1
|
+
import{detectProjectResolution,mergeProjectResolution}from"../project-resolution.js";import{requireProjectPath}from"../state.js";import{linkProject,resolveProjectByNameOrId,unresolvedProject}from"../vercel-project.js";import{createPromptCommandOutput}from"#setup/cli/index.js";function linkVercelProject(o){let s=o.deps??{linkProject,detectProjectResolution,resolveProjectByNameOrId,unresolvedProject};return{id:`link-project`,shouldRun(e){return e.vercelProject.kind!==`none`},async gather(){return null},async perform({state:e}){let t=e.vercelProject;if(t.kind===`none`)return s.unresolvedProject();let r=requireProjectPath(e),i=createPromptCommandOutput(o.prompter.log);if(!await s.linkProject(o.prompter,r,t,i))throw Error("Vercel project provisioning did not complete. Run `vercel link` manually, or re-run and choose not to deploy to Vercel.");let a=await s.detectProjectResolution(r);if(a.kind===`unresolved`)throw Error(`Linked the directory, but could not resolve the Vercel project from .vercel/project.json.`);let c=await s.resolveProjectByNameOrId(r,t.team,t.project);if(c===null||a.projectId!==c.id)throw Error(`Linked project identity did not match the planned Vercel project "${t.project}".`);return a},apply(e,n){return{...e,project:mergeProjectResolution(e.project,n)}}}}export{linkVercelProject};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { detectPackageManager } from "../package-manager.js";
|
|
2
|
+
import type { Prompter } from "../prompter.js";
|
|
3
|
+
import { type SetupState } from "../state.js";
|
|
4
|
+
import type { SetupBox } from "../step.js";
|
|
5
|
+
export interface OneShotNextStepsOptions {
|
|
6
|
+
/** Reports the next-steps note. The box never prompts. */
|
|
7
|
+
prompter: Prompter;
|
|
8
|
+
/** Test seam for the package manager that owns generated commands. */
|
|
9
|
+
detectPackageManager?: typeof detectPackageManager;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* THE ONE-SHOT EPILOGUE BOX: a one-shot run skips every post-scaffold box, so
|
|
13
|
+
* it ends here with exactly the commands that take the scaffold to a running
|
|
14
|
+
* agent. No project or team was resolved, so `vercel link` is the credential
|
|
15
|
+
* step: a logged-in CLI plus the link lets the runtime mint an AI Gateway
|
|
16
|
+
* token, and pasting a key into `.env.local` is the manual alternative.
|
|
17
|
+
*/
|
|
18
|
+
export declare function oneShotNextSteps(options: OneShotNextStepsOptions): SetupBox<SetupState, null, null>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{requireProjectPath}from"../state.js";import{detectPackageManager}from"../package-manager.js";import{relative}from"node:path";var import_picocolors=__toESM(require_picocolors(),1);function cdTarget(e){let t=relative(process.cwd(),e);return t.length===0||t.startsWith(`..`)?e:t}function step(e,t){return` ${import_picocolors.default.bold(e)}${t===void 0?``:` ${import_picocolors.default.dim(`# ${t}`)}`}`}function oneShotNextSteps(e){return{id:`one-shot-next-steps`,shouldRun(e){return e.setupMode===`one-shot`},async gather(){return null},async perform({state:t}){let n=requireProjectPath(t),r=await(e.detectPackageManager??detectPackageManager)(n),i=[`Your agent is scaffolded but not deployed or connected yet.`,...t.projectPath.inPlace?[]:[step(`cd ${cdTarget(n)}`)],step(`${r.kind} install`),step(`vercel link`,`or set AI_GATEWAY_API_KEY in .env.local manually`),step(`eve dev`)];return e.prompter.note(i.join(`
|
|
2
|
+
`),`Next steps`,{tone:`success`}),null},apply(e){return e}}}export{oneShotNextSteps};
|
|
@@ -2,9 +2,8 @@ import { fetchGatewayModelIds } from "../gateway-models.js";
|
|
|
2
2
|
import type { SetupState } from "../state.js";
|
|
3
3
|
import type { SetupBox } from "../step.js";
|
|
4
4
|
/**
|
|
5
|
-
* What the
|
|
6
|
-
* validate: interactive runs pick from the gateway-backed catalog
|
|
7
|
-
* self-managed provider wiring never routes through the Gateway.
|
|
5
|
+
* What the gather decided to validate. `model: null` means nothing to
|
|
6
|
+
* validate: interactive runs pick from the gateway-backed catalog already.
|
|
8
7
|
*/
|
|
9
8
|
export interface PreflightInput {
|
|
10
9
|
/** Model id to validate against the AI Gateway catalog, or null to skip. */
|
|
@@ -17,13 +16,22 @@ export interface PreflightDeps {
|
|
|
17
16
|
export interface PreflightOptions {
|
|
18
17
|
/** Directory to run `vercel` from: the project's parent (it does not exist yet). */
|
|
19
18
|
cwd: string;
|
|
19
|
+
/**
|
|
20
|
+
* Headless mode: only a headless `--model` needs catalog validation, so the
|
|
21
|
+
* gather derives a model to check from state. Interactive runs pick from the
|
|
22
|
+
* gateway-backed catalog and validate nothing. The box prompts for nothing,
|
|
23
|
+
* so this dispatch comes from the composition site, not from a question.
|
|
24
|
+
*/
|
|
25
|
+
headless?: boolean;
|
|
20
26
|
deps?: PreflightDeps;
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
23
29
|
* THE PREFLIGHT BOX: fails fast on an unknown `--model` BEFORE any filesystem
|
|
24
30
|
* scaffolding, so a bad flag never leaves a half-provisioned project on disk.
|
|
25
|
-
* Only a headless `--model` needs the gateway round-trip
|
|
26
|
-
*
|
|
27
|
-
*
|
|
31
|
+
* Only a headless `--model` needs the gateway round-trip, so the interactive
|
|
32
|
+
* gather yields a no-op input. The scaffold bakes a gateway-format model id
|
|
33
|
+
* on every wiring (the `byok` block routes through the Gateway too), so the
|
|
34
|
+
* check applies regardless of how credentials are wired. Team validation
|
|
35
|
+
* lives in the resolve-provisioning box.
|
|
28
36
|
*/
|
|
29
37
|
export declare function preflight(options: PreflightOptions): SetupBox<SetupState, PreflightInput, null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fetchGatewayModelIds}from"../gateway-models.js";function preflight(t){let n=t.deps??{fetchGatewayModelIds};return{id:`preflight`,async
|
|
1
|
+
import{fetchGatewayModelIds}from"../gateway-models.js";function preflight(t){let n=t.deps??{fetchGatewayModelIds};return{id:`preflight`,async gather({state:e}){return t.headless?{model:e.modelId.length>0?e.modelId:null}:{model:null}},async perform({input:e}){return e.model!==null&&await validateModel(n,e.model,t.cwd),null},apply(e){return e}}}async function validateModel(e,t,n){let r=await e.fetchGatewayModelIds(n);if(!(r===null||r.has(t)))throw Error(`Model "${t}" is not in the AI Gateway catalog. Pass a model id from https://ai-gateway.vercel.sh/v1/models (e.g. anthropic/claude-sonnet-4.6).`)}export{preflight};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { type Asker } from "../ask.js";
|
|
2
|
+
import { pathExists } from "../path-exists.js";
|
|
3
|
+
import { detectProjectResolution, type ProjectResolution } from "../project-resolution.js";
|
|
1
4
|
import type { Prompter } from "../prompter.js";
|
|
2
5
|
import type { ProvisioningMode, ResolvedAiGateway, ResolvedVercelProject, SetupState, WiringMode } from "../state.js";
|
|
3
6
|
import type { SetupBox } from "../step.js";
|
|
4
|
-
import { assertNewProjectNameAvailable, pickNewProjectName, pickProject, pickTeam, requireAuth, resolveTeam, validateTeam } from "../vercel-project.js";
|
|
5
|
-
/** Injected for tests; defaults to the real Vercel project helpers. */
|
|
7
|
+
import { assertNewProjectNameAvailable, isVercelAuthenticated, pickNewProjectName, pickProject, pickTeam, requireAuth, resolveTeam, validateTeam } from "../vercel-project.js";
|
|
8
|
+
/** Injected for tests; defaults to the real Vercel project and fs helpers. */
|
|
6
9
|
export interface ResolveProvisioningDeps {
|
|
7
10
|
requireAuth: typeof requireAuth;
|
|
11
|
+
isVercelAuthenticated: typeof isVercelAuthenticated;
|
|
12
|
+
detectProjectResolution: typeof detectProjectResolution;
|
|
13
|
+
pathExists: typeof pathExists;
|
|
8
14
|
validateTeam: typeof validateTeam;
|
|
9
15
|
resolveTeam: typeof resolveTeam;
|
|
10
16
|
pickTeam: typeof pickTeam;
|
|
@@ -13,12 +19,26 @@ export interface ResolveProvisioningDeps {
|
|
|
13
19
|
assertNewProjectNameAvailable: typeof assertNewProjectNameAvailable;
|
|
14
20
|
}
|
|
15
21
|
export interface ResolveProvisioningOptions {
|
|
16
|
-
/**
|
|
22
|
+
/** Resolves the provisioning-tree questions; the composed stack decides how. */
|
|
23
|
+
asker: Asker;
|
|
24
|
+
/**
|
|
25
|
+
* Still drives the Vercel reads that validate a decision (team/project
|
|
26
|
+
* pickers, auth, name availability) and carries the spinner/progress log. The
|
|
27
|
+
* deploy-tree questions themselves now travel the asker.
|
|
28
|
+
*/
|
|
17
29
|
prompter: Prompter;
|
|
18
30
|
/** Parent directory the project folder is created inside. Defaults to cwd. */
|
|
19
31
|
targetDirectory?: string;
|
|
20
32
|
/** Headless flags vs interactive prompts. The args are read only when headless. */
|
|
21
33
|
mode: ProvisioningMode;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a detected on-disk link short-circuits the interview. Defaults to
|
|
36
|
+
* true — an in-place setup adopts the link it finds. False skips adoption so
|
|
37
|
+
* the team/project pickers always run: the re-link path's whole point is
|
|
38
|
+
* choosing a different project, so re-adopting the current link would be a
|
|
39
|
+
* dead end.
|
|
40
|
+
*/
|
|
41
|
+
adoptExistingLink?: boolean;
|
|
22
42
|
deps?: ResolveProvisioningDeps;
|
|
23
43
|
}
|
|
24
44
|
/** Both provisioning plans plus the model wiring they imply. Input and payload. */
|
|
@@ -26,12 +46,20 @@ export interface ResolvedProvisioning {
|
|
|
26
46
|
vercelProject: ResolvedVercelProject;
|
|
27
47
|
aiGateway: ResolvedAiGateway;
|
|
28
48
|
modelWiring: WiringMode;
|
|
49
|
+
/**
|
|
50
|
+
* The detected on-disk link when the target directory is already linked to
|
|
51
|
+
* a Vercel project. Adopted instead of planning a project: the link is the
|
|
52
|
+
* source of truth, so the project plan stays `none` (nothing to create or
|
|
53
|
+
* link) and this resolution seeds `state.project`, exactly as in-project
|
|
54
|
+
* setup models the same fact.
|
|
55
|
+
*/
|
|
56
|
+
project?: ProjectResolution;
|
|
29
57
|
}
|
|
30
58
|
/**
|
|
31
|
-
* THE PROVISIONING BOX
|
|
32
|
-
*
|
|
33
|
-
* before any filesystem writes or `vercel link` side
|
|
34
|
-
* decision (and the Vercel reads validating it);
|
|
35
|
-
* through untouched so `apply` can record it.
|
|
59
|
+
* THE PROVISIONING BOX: the last interview decision — where the agent runs —
|
|
60
|
+
* made after the agent itself is described (name, model, channels,
|
|
61
|
+
* connections) and before any filesystem writes or `vercel link` side
|
|
62
|
+
* effects. Gather owns every decision (and the Vercel reads validating it);
|
|
63
|
+
* `perform` passes the plan through untouched so `apply` can record it.
|
|
36
64
|
*/
|
|
37
65
|
export declare function resolveProvisioning(options: ResolveProvisioningOptions): SetupBox<SetupState, ResolvedProvisioning, ResolvedProvisioning>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{assertNewProjectNameAvailable,pickNewProjectName,pickProject,pickTeam,requireAuth,resolveTeam,validateTeam}from"../vercel-project.js";import{resolve}from"node:path";function resolveProvisioning(
|
|
1
|
+
import{select,text}from"../ask.js";import{detectProjectResolution,isProjectResolved,mergeProjectResolution}from"../project-resolution.js";import{assertNewProjectNameAvailable,isVercelAuthenticated,pickNewProjectName,pickProject,pickTeam,requireAuth,resolveTeam,validateTeam,withNetworkSpinner}from"../vercel-project.js";import{pathExists}from"../path-exists.js";import{join,resolve}from"node:path";import{byokProviderEnvVar}from"#setup/scaffold/index.js";import{whimsyFor}from"#setup/cli/index.js";function vercelDemands(e){return{slack:e.channelSelection.includes(`slack`),connectSlugs:e.connectionSelection.filter(e=>e.entry.auth?.kind===`connect`).map(e=>e.slug)}}function connectClause(e){let t=e.length===1?`authenticates`:`authenticate`;return`${e.join(`, `)} ${t} through Vercel Connect`}function vercelRequirements(e){let t=[];return e.slack&&t.push(`Slack needs a public URL`),e.connectSlugs.length>0&&t.push(connectClause(e.connectSlugs)),t}function resolveProvisioning(c){let l=c.deps??{requireAuth,isVercelAuthenticated,detectProjectResolution,pathExists,validateTeam,resolveTeam,pickTeam,pickProject,pickNewProjectName,assertNewProjectNameAvailable},parent=()=>resolve(c.targetDirectory??process.cwd());async function detectAdoptableLink(e){if(e.projectPath.kind!==`resolved`)return;let t=e.projectPath.path;if(await l.pathExists(join(t,`.vercel`,`project.json`)))return withNetworkSpinner(c.prompter,whimsyFor(`project-detect`),async()=>{let e=await l.detectProjectResolution(t);if(isProjectResolved(e)&&await l.isVercelAuthenticated(t))return e})}async function plansFromFlags(e,t,n){if(t.skipVercel)return n.apiKey===void 0?{vercelProject:{kind:`none`},aiGateway:{kind:`byop`},modelWiring:`self`}:{vercelProject:{kind:`none`},aiGateway:{kind:`byok`,apiGatewayKey:n.apiKey},modelWiring:`gateway`};if(t.team===void 0||t.team.length===0)throw Error(`Headless Vercel provisioning requires --team <slug> or --scope <slug> so the current CLI scope is not applied silently.`);await l.requireAuth(parent()),await l.validateTeam(c.prompter,parent(),t.team);let r=await l.resolveTeam(parent(),t.team),i=n.apiKey===void 0?{kind:`inherit`}:{kind:`byok`,apiGatewayKey:n.apiKey},a=t.project===void 0?{kind:`new`,project:e,team:r}:{kind:`existing`,project:t.project,team:r};return a.kind===`new`&&await l.assertNewProjectNameAvailable(parent(),r,a.project),{vercelProject:a,aiGateway:i,modelWiring:`gateway`}}async function promptPlans(n){let r=c.prompter,i=n.agentName,a=c.adoptExistingLink===!1?void 0:await detectAdoptableLink(n);if(a!==void 0)return r.log.info(`This directory is already linked to a Vercel project, so your agent will run there — the AI Gateway authenticates through your Vercel login.`),{vercelProject:{kind:`none`},aiGateway:{kind:`inherit`},modelWiring:`gateway`,project:a};let o=vercelRequirements(vercelDemands(n)),s=!0;if(o.length>0?r.log.info(`${o.join(` and `)}, so your agent will run on Vercel.`):s=await c.asker.ask(select({key:`deploy`,message:`Where should your agent run?`,options:[{id:`vercel`,value:!0,label:`On Vercel`,hint:`AI Gateway, Durable Workflow, Sandbox, and more`},{id:`local`,value:!1,label:`Locally for now`,hint:`run with eve dev, deploy any time later`}],recommended:!0,required:!0})),s){await l.requireAuth(parent(),r);let t=await l.pickTeam(r,parent(),void 0);if(await c.asker.ask(select({key:`vercel-project`,message:`Vercel project`,options:[{id:`new`,value:`new`,label:`Create a new project`,hint:`Named '${i}'`},{id:`link`,value:`link`,label:`Link an existing project`}],recommended:`new`,required:!0}))===`new`)return{vercelProject:{kind:`new`,project:await l.pickNewProjectName(r,parent(),t,i),team:t},aiGateway:{kind:`inherit`},modelWiring:`gateway`};let n=await l.pickProject(r,parent(),t);return{vercelProject:{kind:n.exists?`existing`:`new`,project:n.project,team:t},aiGateway:{kind:`inherit`},modelWiring:`gateway`}}return await c.asker.ask(select({key:`credential`,message:`How should your agent reach the model?`,options:[{id:`api-key`,value:`api-key`,label:`Use my own AI Gateway API key`,hint:`AI_GATEWAY_API_KEY`},{id:`local`,value:`local`,label:`Use my own provider API key`,hint:byokProviderEnvVar(n.modelId)}],recommended:`api-key`,required:!0}))===`api-key`?{vercelProject:{kind:`none`},aiGateway:{kind:`byok`,apiGatewayKey:await c.asker.ask(text({key:`gateway-api-key`,message:`Enter your AI_GATEWAY_API_KEY`,sensitive:!0,validate:e=>e.trim().length===0?`API key cannot be empty.`:null,required:!0}))},modelWiring:`gateway`}:{vercelProject:{kind:`none`},aiGateway:{kind:`byop`},modelWiring:`self`}}return{id:`resolve-provisioning`,async gather({state:e}){if(c.mode.headless){let t=await plansFromFlags(e.agentName,c.mode.project,c.mode.aiGateway);if(t.vercelProject.kind===`none`){let t=vercelDemands(e);if(t.slack)throw Error(`Slack requires a Vercel project. Remove --skip-vercel to add Slack.`);if(t.connectSlugs.length>0)throw Error(`${connectClause(t.connectSlugs)}, which needs a Vercel project. Remove --skip-vercel to add ${t.connectSlugs.length===1?`it`:`them`}.`)}return t}return promptPlans(e)},async perform({input:e}){return e},apply(e,t){return{...e,vercelProject:t.vercelProject,aiGateway:t.aiGateway,modelWiring:t.modelWiring,project:t.project===void 0?e.project:mergeProjectResolution(e.project,t.project)}}}}export{resolveProvisioning};
|