eve 0.7.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +11 -11
- package/dist/src/chunks/{use-eve-agent-DErQj5hs.js → use-eve-agent-BSXZSn-R.js} +6 -1
- package/dist/src/chunks/{use-eve-agent-DoR8C4i6.js → use-eve-agent-Dlut2Qzt.js} +6 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
- package/dist/src/cli/dev/tui/blocks.js +4 -3
- package/dist/src/cli/dev/tui/command-typeahead.d.ts +13 -3
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
- package/dist/src/cli/dev/tui/line-editor.d.ts +6 -0
- package/dist/src/cli/dev/tui/line-editor.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +2 -0
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +10 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +11 -7
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/setup-flow.d.ts +72 -10
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +91 -39
- package/dist/src/cli/dev/tui/setup-panel.js +3 -1
- package/dist/src/cli/dev/tui/setup-selection-input.d.ts +48 -0
- package/dist/src/cli/dev/tui/setup-selection-input.js +1 -0
- package/dist/src/cli/dev/tui/status-line.d.ts +13 -7
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +2 -0
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +4 -2
- package/dist/src/cli/dev/tui/terminal-renderer.js +6 -5
- package/dist/src/cli/dev/tui/theme.d.ts +3 -1
- package/dist/src/cli/dev/tui/theme.js +1 -1
- package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +6 -0
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/vercel-status.d.ts +4 -4
- package/dist/src/cli/dev/tui/vercel-status.js +1 -1
- package/dist/src/cli/run.d.ts +4 -3
- package/dist/src/cli/run.js +2 -2
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/session-utils.d.ts +1 -0
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.d.ts +1 -0
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +19 -0
- package/dist/src/compiled/.vendor-stamp.json +1 -2
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/manifest.d.ts +28 -7
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/evals/cli/eval-client.js +1 -1
- package/dist/src/execution/sandbox/bash-tool.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-base-setup.d.ts +9 -0
- package/dist/src/execution/sandbox/bindings/docker-base-setup.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +77 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-container.d.ts +16 -0
- package/dist/src/execution/sandbox/bindings/docker-container.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-network.d.ts +8 -0
- package/dist/src/execution/sandbox/bindings/docker-network.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-options.d.ts +21 -0
- package/dist/src/execution/sandbox/bindings/docker-options.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-session.d.ts +7 -0
- package/dist/src/execution/sandbox/bindings/docker-session.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-templates.d.ts +35 -0
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-utils.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/docker-utils.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker.d.ts +33 -0
- package/dist/src/execution/sandbox/bindings/docker.js +1 -0
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +30 -0
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -0
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +33 -0
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -0
- package/dist/src/execution/sandbox/bindings/local-backend-utils.d.ts +23 -0
- package/dist/src/execution/sandbox/bindings/local-backend-utils.js +1 -0
- package/dist/src/execution/sandbox/bindings/local-template-prune.d.ts +16 -0
- package/dist/src/execution/sandbox/bindings/local-template-prune.js +1 -0
- package/dist/src/execution/sandbox/bindings/local.d.ts +16 -25
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +16 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +21 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +18 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-network.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +34 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +22 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +178 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +3 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-process.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +75 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +13 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +22 -0
- package/dist/src/execution/sandbox/bindings/microsandbox.js +1 -0
- package/dist/src/execution/sandbox/bindings/vercel-create-api.d.ts +20 -0
- package/dist/src/execution/sandbox/bindings/vercel-create-api.js +1 -0
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +7 -8
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/development-cleanup.d.ts +4 -0
- package/dist/src/execution/sandbox/development-cleanup.js +1 -0
- package/dist/src/execution/sandbox/development-prewarm.d.ts +11 -0
- package/dist/src/execution/sandbox/development-prewarm.js +1 -0
- package/dist/src/execution/sandbox/development-run.d.ts +8 -0
- package/dist/src/execution/sandbox/development-run.js +1 -0
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/lazy-backend.d.ts +1 -1
- package/dist/src/execution/sandbox/logging-session.d.ts +5 -0
- package/dist/src/execution/sandbox/logging-session.js +1 -0
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/sandbox/template-prewarm-lock.d.ts +8 -0
- package/dist/src/execution/sandbox/template-prewarm-lock.js +1 -0
- package/dist/src/internal/application/optional-package-install.d.ts +40 -0
- package/dist/src/internal/application/optional-package-install.js +1 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/sandbox.d.ts +1 -1
- package/dist/src/internal/authored-definition/sandbox.js +1 -1
- package/dist/src/internal/authored-module-loader.js +2 -2
- package/dist/src/internal/classify-model-routing.d.ts +24 -0
- package/dist/src/internal/classify-model-routing.js +1 -0
- package/dist/src/internal/nitro/host/channel-routes.js +2 -2
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.d.ts +5 -2
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +10 -0
- 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-live-virtual-modules.d.ts +15 -0
- package/dist/src/internal/nitro/host/dev-live-virtual-modules.js +1 -0
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.d.ts +28 -0
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -0
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +2 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +4 -0
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
- package/dist/src/internal/resolve-model-endpoint-status.d.ts +23 -0
- package/dist/src/internal/resolve-model-endpoint-status.js +1 -0
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/public/definitions/sandbox-backend.js +1 -1
- package/dist/src/public/sandbox/backends/default.d.ts +37 -10
- package/dist/src/public/sandbox/backends/default.js +1 -1
- package/dist/src/public/sandbox/backends/docker.d.ts +14 -0
- package/dist/src/public/sandbox/backends/docker.js +1 -0
- package/dist/src/public/sandbox/backends/just-bash.d.ts +17 -0
- package/dist/src/public/sandbox/backends/just-bash.js +1 -0
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +17 -0
- package/dist/src/public/sandbox/backends/microsandbox.js +1 -0
- package/dist/src/public/sandbox/backends/vercel.d.ts +5 -2
- package/dist/src/public/sandbox/backends/vercel.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +45 -0
- package/dist/src/public/sandbox/index.d.ts +8 -4
- package/dist/src/public/sandbox/index.js +1 -1
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +17 -0
- package/dist/src/public/sandbox/just-bash-sandbox.js +1 -0
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +54 -0
- package/dist/src/public/sandbox/microsandbox-sandbox.js +1 -0
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +1 -1
- package/dist/src/runtime/compiled-artifacts-source.d.ts +11 -0
- package/dist/src/runtime/compiled-artifacts-source.js +1 -1
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/sandbox/registry.d.ts +2 -2
- package/dist/src/runtime/types.d.ts +1 -1
- package/dist/src/runtime/workspace/spec.js +1 -1
- package/dist/src/setup/boxes/add-channels.d.ts +3 -2
- package/dist/src/setup/boxes/add-channels.js +2 -2
- package/dist/src/setup/boxes/apply-ai-gateway-credential.js +1 -1
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/boxes/link-project.js +1 -1
- package/dist/src/setup/boxes/resolve-provisioning.d.ts +6 -0
- package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
- package/dist/src/setup/boxes/select-model.d.ts +2 -2
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/channel-setup-prompter.d.ts +28 -0
- package/dist/src/setup/cli/channel-setup-prompter.js +1 -1
- package/dist/src/setup/cli/index.d.ts +2 -2
- package/dist/src/setup/cli/index.js +1 -1
- package/dist/src/setup/cli/option-row.d.ts +89 -0
- package/dist/src/setup/cli/option-row.js +1 -0
- package/dist/src/setup/cli/prompt-ui.d.ts +15 -29
- package/dist/src/setup/cli/prompt-ui.js +2 -2
- package/dist/src/setup/cli/select-component.d.ts +4 -3
- package/dist/src/setup/cli/select-component.js +1 -1
- package/dist/src/setup/cli/select-state.d.ts +3 -3
- package/dist/src/setup/cli/select-state.js +1 -1
- package/dist/src/setup/flows/channels.d.ts +29 -14
- package/dist/src/setup/flows/channels.js +1 -1
- package/dist/src/setup/flows/deploy.d.ts +1 -0
- package/dist/src/setup/flows/deploy.js +1 -1
- package/dist/src/setup/flows/link.d.ts +1 -0
- package/dist/src/setup/flows/link.js +1 -1
- package/dist/src/setup/flows/model.d.ts +30 -6
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/vercel.d.ts +4 -1
- package/dist/src/setup/flows/vercel.js +2 -2
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/primitives/open-url.d.ts +14 -0
- package/dist/src/setup/primitives/open-url.js +1 -0
- package/dist/src/setup/primitives/pm/pnpm.d.ts +9 -0
- package/dist/src/setup/primitives/pm/pnpm.js +2 -2
- package/dist/src/setup/primitives/pm/run.d.ts +12 -4
- package/dist/src/setup/primitives/pm/run.js +1 -1
- package/dist/src/setup/primitives/pm/types.d.ts +3 -0
- package/dist/src/setup/primitives/process-abort.d.ts +7 -0
- package/dist/src/setup/primitives/process-abort.js +1 -0
- package/dist/src/setup/primitives/run-vercel.d.ts +2 -0
- package/dist/src/setup/primitives/run-vercel.js +1 -1
- package/dist/src/setup/project-resolution.d.ts +6 -3
- package/dist/src/setup/project-resolution.js +1 -1
- package/dist/src/setup/prompter.d.ts +63 -6
- package/dist/src/setup/prompter.js +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 +2 -0
- package/dist/src/setup/runner.js +1 -1
- package/dist/src/setup/scaffold/channels-catalog.d.ts +2 -0
- package/dist/src/setup/scaffold/channels-catalog.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +1 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.d.ts +2 -0
- package/dist/src/setup/scaffold/create/project.js +6 -3
- package/dist/src/setup/scaffold/update/channels.d.ts +2 -0
- package/dist/src/setup/scaffold/update/channels.js +3 -3
- package/dist/src/setup/slack-connect-lifecycle.d.ts +97 -0
- package/dist/src/setup/slack-connect-lifecycle.js +1 -0
- package/dist/src/setup/slack-connect.d.ts +51 -0
- package/dist/src/setup/slack-connect.js +1 -0
- package/dist/src/setup/slackbot.d.ts +60 -47
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/setup/state.d.ts +2 -1
- package/dist/src/setup/state.js +1 -1
- package/dist/src/setup/step.d.ts +4 -0
- package/dist/src/setup/validate-gateway-key.d.ts +30 -0
- package/dist/src/setup/validate-gateway-key.js +1 -0
- package/dist/src/setup/vercel-project.d.ts +19 -12
- package/dist/src/setup/vercel-project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +26 -0
- package/dist/src/shared/model-endpoint-status.d.ts +27 -0
- package/dist/src/shared/model-endpoint-status.js +1 -0
- package/dist/src/shared/sandbox-backend.d.ts +8 -2
- package/dist/src/shared/sandbox-definition.d.ts +4 -3
- package/dist/src/shared/sandbox-network-policy.d.ts +4 -2
- package/dist/src/shared/sandbox-session.d.ts +3 -2
- 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/{dist/docs/public → docs}/getting-started.mdx +14 -4
- package/{dist/docs/public → docs}/guides/deployment.md +3 -3
- package/{dist/docs/public → docs}/guides/dev-tui.md +2 -2
- package/{dist/docs/public → docs}/reference/cli.md +2 -1
- package/{dist/docs/public → docs}/sandbox.mdx +39 -15
- package/package.json +11 -1
- package/dist/src/compiled/just-bash/LICENSE +0 -201
- package/dist/src/compiled/just-bash/index.d.ts +0 -139
- package/dist/src/compiled/just-bash/index.js +0 -2200
- package/dist/src/compiled/just-bash/network/types.d.ts +0 -155
- package/dist/src/public/sandbox/backends/local.d.ts +0 -16
- package/dist/src/public/sandbox/backends/local.js +0 -1
- package/dist/src/public/sandbox/local-sandbox.d.ts +0 -7
- /package/dist/src/public/sandbox/{local-sandbox.js → docker-sandbox.js} +0 -0
- /package/{dist/docs/public → docs}/README.md +0 -0
- /package/{dist/docs/public → docs}/agent-config.md +0 -0
- /package/{dist/docs/public → docs}/channels/custom.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/discord.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/eve.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/github.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/linear.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/meta.json +0 -0
- /package/{dist/docs/public → docs}/channels/overview.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/slack.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/teams.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/telegram.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/twilio.mdx +0 -0
- /package/{dist/docs/public → docs}/concepts/context-control.md +0 -0
- /package/{dist/docs/public → docs}/concepts/default-harness.md +0 -0
- /package/{dist/docs/public → docs}/concepts/execution-model-and-durability.md +0 -0
- /package/{dist/docs/public → docs}/concepts/meta.json +0 -0
- /package/{dist/docs/public → docs}/concepts/security-model.md +0 -0
- /package/{dist/docs/public → docs}/concepts/sessions-runs-and-streaming.md +0 -0
- /package/{dist/docs/public → docs}/connections.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/assertions.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/cases.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/judge.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/meta.json +0 -0
- /package/{dist/docs/public → docs}/evals/overview.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/reporters.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/running.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/targets.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/auth-and-route-protection.md +0 -0
- /package/{dist/docs/public → docs}/guides/client/continuations.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/client/messages.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/client/meta.json +0 -0
- /package/{dist/docs/public → docs}/guides/client/output-schema.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/client/overview.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/client/streaming.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/dynamic-capabilities.md +0 -0
- /package/{dist/docs/public → docs}/guides/dynamic-workflows.md +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/meta.json +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/nextjs.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/nuxt.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/overview.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/sveltekit.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/use-eve-agent-svelte.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/use-eve-agent-vue.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/hooks.md +0 -0
- /package/{dist/docs/public → docs}/guides/instrumentation.md +0 -0
- /package/{dist/docs/public → docs}/guides/meta.json +0 -0
- /package/{dist/docs/public → docs}/guides/remote-agents.md +0 -0
- /package/{dist/docs/public → docs}/guides/session-context.md +0 -0
- /package/{dist/docs/public → docs}/guides/state.md +0 -0
- /package/{dist/docs/public → docs}/instructions.mdx +0 -0
- /package/{dist/docs/public → docs}/introduction.md +0 -0
- /package/{dist/docs/public → docs}/meta.json +0 -0
- /package/{dist/docs/public → docs}/reference/meta.json +0 -0
- /package/{dist/docs/public → docs}/reference/project-layout.md +0 -0
- /package/{dist/docs/public → docs}/reference/typescript-api.md +0 -0
- /package/{dist/docs/public → docs}/schedules.mdx +0 -0
- /package/{dist/docs/public → docs}/skills.mdx +0 -0
- /package/{dist/docs/public → docs}/subagents.mdx +0 -0
- /package/{dist/docs/public → docs}/tools.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/connect-a-warehouse.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/first-agent.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/guard-the-spend.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/how-it-runs.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/meta.json +0 -0
- /package/{dist/docs/public → docs}/tutorial/query-sample-data.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/remember-definitions.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/run-analysis.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/ship-it.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/team-playbooks.mdx +0 -0
|
@@ -1,66 +1,79 @@
|
|
|
1
|
-
import { type ChannelSetupLog } from "#setup/cli/index.js";
|
|
2
|
-
import {
|
|
1
|
+
import { type ChannelSetupAwaitChoice, type ChannelSetupLog } from "#setup/cli/index.js";
|
|
2
|
+
import { runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";
|
|
3
|
+
import { readProjectId, type SlackConnectLifecycleDeps } from "./slack-connect-lifecycle.js";
|
|
4
|
+
export { parseCreatedSlackConnector, parseInstallation, pickSlackConnector, type SlackConnectorRef, } from "./slack-connect.js";
|
|
3
5
|
/** Injected for tests; defaults to the real Vercel CLI subprocess primitives. */
|
|
4
|
-
export interface SlackbotProvisionDeps {
|
|
5
|
-
captureVercel: typeof captureVercel;
|
|
6
|
-
runVercel: typeof runVercel;
|
|
6
|
+
export interface SlackbotProvisionDeps extends SlackConnectLifecycleDeps {
|
|
7
7
|
runVercelCaptureStdout: typeof runVercelCaptureStdout;
|
|
8
|
+
/** Test seam for the linked-project lookup. */
|
|
9
|
+
readProjectId?: typeof readProjectId;
|
|
10
|
+
/** Test seam for the installation poll's pacing; defaults to a real sleep. */
|
|
11
|
+
delay?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
12
|
+
/** Monotonic-enough clock for enforcing the installation deadline. */
|
|
13
|
+
now?: () => number;
|
|
8
14
|
}
|
|
9
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Outcome of the Connect create-and-attach sequence for a Slackbot. The
|
|
17
|
+
* discriminant is the complete lifecycle state: `attached` means a connector
|
|
18
|
+
* exists, this project is registered as the trigger destination, and the app
|
|
19
|
+
* is installed into a Slack workspace.
|
|
20
|
+
* `not-installed` means the workspace-install deadline elapsed and any connector
|
|
21
|
+
* created by this attempt was removed. `cleanup-failed` means it may remain and
|
|
22
|
+
* callers must stop rather than create another connector. Attachment setup
|
|
23
|
+
* reports detach and attach failures separately because attach must not run
|
|
24
|
+
* while an old trigger destination may still exist.
|
|
25
|
+
*/
|
|
10
26
|
export type ProvisionSlackbotResult = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
27
|
+
state: "connector-lookup-failed";
|
|
28
|
+
} | {
|
|
29
|
+
state: "create-failed";
|
|
30
|
+
} | {
|
|
31
|
+
state: "cancelled";
|
|
32
|
+
} | {
|
|
33
|
+
state: "existing-not-installed";
|
|
34
|
+
connectorUid: string;
|
|
35
|
+
} | {
|
|
36
|
+
state: "cleanup-failed";
|
|
37
|
+
connectorUids: readonly string[];
|
|
38
|
+
} | {
|
|
39
|
+
state: "detach-failed";
|
|
40
|
+
connectorUid: string;
|
|
14
41
|
} | {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
42
|
+
state: "attach-failed";
|
|
43
|
+
connectorUid: string;
|
|
44
|
+
} | {
|
|
45
|
+
state: "not-installed";
|
|
18
46
|
} | {
|
|
19
|
-
|
|
20
|
-
created: true;
|
|
21
|
-
attached: false;
|
|
47
|
+
state: "installation-check-failed";
|
|
22
48
|
connectorUid: string;
|
|
23
49
|
} | {
|
|
24
|
-
|
|
25
|
-
created: true;
|
|
26
|
-
attached: true;
|
|
50
|
+
state: "attached";
|
|
27
51
|
connectorUid: string;
|
|
28
|
-
|
|
52
|
+
/** Deep link that opens a DM compose with the bot ("chat with your agent"). */
|
|
53
|
+
chatUrl?: string;
|
|
29
54
|
workspaceName?: string;
|
|
30
55
|
};
|
|
31
|
-
/** Identifiers returned by Vercel Connect for a Slack connector. */
|
|
32
|
-
export interface SlackConnectorRef {
|
|
33
|
-
uid: string;
|
|
34
|
-
id: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Reads the connector identifiers from `vercel connect create … -F json`
|
|
38
|
-
* stdout, the authoritative source for the just-created connector's UID.
|
|
39
|
-
* Returns `undefined` when stdout is empty or not the expected JSON.
|
|
40
|
-
*/
|
|
41
|
-
export declare function parseCreatedSlackConnector(stdout: string): SlackConnectorRef | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Finds the expected connector, or the newest Slack connector already attached to this project.
|
|
44
|
-
*/
|
|
45
|
-
export declare function pickSlackConnector(listJson: unknown, projectId: string | undefined, expectedUid: string | undefined): SlackConnectorRef | undefined;
|
|
46
|
-
/** Extracts Slack workspace information from a Connect installations response. */
|
|
47
|
-
export declare function parseInstallation(body: unknown): {
|
|
48
|
-
workspaceUrl: string;
|
|
49
|
-
workspaceName?: string;
|
|
50
|
-
} | undefined;
|
|
51
56
|
/**
|
|
52
57
|
* Creates a Slack Connect client, replaces its default trigger destination with the Eve route,
|
|
53
|
-
* and
|
|
54
|
-
* through the rail-styled `log`, and the result union carries every
|
|
55
|
-
* caller to act on.
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* creates a second connector instead of adopting the unresolved one.
|
|
58
|
+
* and waits for the app's Slack workspace installation. Promptless: progress streams
|
|
59
|
+
* through the rail-styled `log`, and the result union carries every completed provisioning
|
|
60
|
+
* outcome for the caller to act on. `attached` is only returned once an installation exists. An
|
|
61
|
+
* attempt that times out is abandoned: its connector is removed and the result
|
|
62
|
+
* is `not-installed`, so callers never treat an unfinished browser OAuth as a
|
|
63
|
+
* working Slack connection — and no orphaned connector is left behind.
|
|
60
64
|
*/
|
|
65
|
+
export interface ProvisionSlackbotOptions {
|
|
66
|
+
/**
|
|
67
|
+
* Cancels the caller's whole operation. The promise rejects after attempting
|
|
68
|
+
* cleanup; only the explicit interactive Cancel action returns `cancelled`.
|
|
69
|
+
*/
|
|
70
|
+
signal?: AbortSignal;
|
|
71
|
+
/** Concurrent retry/cancel controls supplied by an interactive prompter. */
|
|
72
|
+
awaitChoice?: ChannelSetupAwaitChoice;
|
|
73
|
+
}
|
|
61
74
|
export declare function provisionSlackbot(log: ChannelSetupLog, projectRoot: string,
|
|
62
75
|
/** Connector short-name passed to `vercel connect create slack --name`. */
|
|
63
|
-
slug: string, deps?: SlackbotProvisionDeps): Promise<ProvisionSlackbotResult>;
|
|
76
|
+
slug: string, deps?: SlackbotProvisionDeps, options?: ProvisionSlackbotOptions): Promise<ProvisionSlackbotResult>;
|
|
64
77
|
/**
|
|
65
78
|
* Patches a connector UID chosen by Connect before the caller deploys the channel definition.
|
|
66
79
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join}from"node:path";import{SLACK_CHANNEL_DEFAULT_ROUTE}from"#setup/scaffold/index.js";import{
|
|
1
|
+
import{parseCreatedSlackConnector,parseInstallation,pickSlackConnector}from"./slack-connect.js";import{CONNECT_LOOKUP_TIMEOUT_MS,attachSlackConnector,cleanupCreatedAttempt,fetchInstallationInfo,findSlackConnector,listSlackConnectors,readProjectId}from"./slack-connect-lifecycle.js";import{join}from"node:path";import{SLACK_CHANNEL_DEFAULT_ROUTE}from"#setup/scaffold/index.js";import{setTimeout}from"node:timers/promises";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{captureVercel,runVercel,runVercelCaptureStdout}from"#setup/primitives/run-vercel.js";import{performance}from"node:perf_hooks";import{updateSlackChannelConnectorUid}from"#setup/scaffold/update/update-slack-channel.js";const defaultDeps={captureVercel,runVercel,runVercelCaptureStdout},realDelay=(e,t)=>setTimeout(e,void 0,{signal:t}),monotonicNow=()=>performance.now();async function pollInstallation(e,t,n,i,a){let s=e.delay??realDelay,c=e.now??monotonicNow,l=c()+3e5;for(;;){a?.throwIfAborted();let u=l-c();if(u<=0)return{state:`timed-out`};let d=await fetchInstallationInfo(e,t,n,i,Math.min(CONNECT_LOOKUP_TIMEOUT_MS,u),a);if(a?.throwIfAborted(),d.state!==`pending`)return d;let f=l-c();if(f<=0)return{state:`timed-out`};await s(Math.min(3e3,f),a)}}function isAbortFromSignal(e,t){return t?.aborted===!0&&(e===t.reason||e instanceof Error&&e.name===`AbortError`)}function cleanupFailureResult(e){return{state:`cleanup-failed`,connectorUids:e.connectorUids}}async function runAttempt(t){let{log:n,deps:r,projectRoot:a,onOutput:o,signal:s,phase:c}=t,l;if(t.source.state===`existing`)l=t.source.ref;else{let i=await c(`Creating a Slackbot through Vercel Connect...`,()=>r.runVercelCaptureStdout([`connect`,`create`,`slack`,`--triggers`,`--name`,t.slug,`-F`,`json`],{cwd:a,nonInteractive:!0,onOutput:o,timeoutMs:6e5,signal:s})),u=parseCreatedSlackConnector(i.stdout);if(u&&t.onCreated(u),!i.ok)return s?.throwIfAborted(),{state:`create-failed`};if(s?.throwIfAborted(),!u)return n.warning(`Vercel did not return an exact Slack connector UID for this request, so Eve cannot attach or remove it safely.`),{state:`unresolved`};l=u}let u=await c(`Configuring Slack event delivery for this agent...`,()=>attachSlackConnector(r,a,l,o,s));if(s?.throwIfAborted(),u.state!==`attached`)return{state:u.state,ref:l};let d=await c(`Waiting for the Slack workspace connection...`,()=>pollInstallation(r,a,l.id,o,s));return d.state===`installed`?{state:`installed`,ref:l,info:d.info}:d.state===`timed-out`?{state:`timed-out`,ref:l}:{state:`failed`,ref:l,message:d.message}}async function raceAttemptAgainstChoice(e){let t=new AbortController,n=e.outerSignal?AbortSignal.any([e.outerSignal,t.signal]):t.signal,r=e.run(n);try{let i=await Promise.race([r.then(e=>({via:`work`,outcome:e})),e.prompt.choice.then(e=>({via:`choice`,choice:e}))]);if(i.via===`work`)return i;t.abort();let a;try{a=await r}catch(e){if(!isAbortFromSignal(e,n))throw e}return{via:`choice`,choice:i.choice,settled:a}}catch(e){t.abort();try{await r}catch{}throw e}finally{e.prompt.close()}}async function provisionSlackbot(e,t,n,r=defaultDeps,i={}){i.signal?.throwIfAborted();let o=createPromptCommandOutput(e),u={log:e,deps:r,projectRoot:t,onOutput:o},f=await(r.readProjectId??readProjectId)(t),p=`slack/${n}`,m=await withPhase(e,`Checking for an existing Slackbot...`,()=>findSlackConnector(r,t,f,p,o,i.signal));if(i.signal?.throwIfAborted(),m.state===`failed`)return e.warning(`Could not inspect existing Slack connectors, so Eve did not create another one. ${m.message}`),{state:`connector-lookup-failed`};if(f===void 0&&m.connectorUids.size>0)return e.warning("Could not verify which Slack connectors belong to this Vercel project, so Eve did not create another one. Restore `.vercel/project.json`, then try again."),{state:`connector-lookup-failed`};let finishOutcome=async(t,n,r)=>{let i=n.state===`new`;switch(t.state){case`create-failed`:if(i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return{state:`create-failed`};case`unresolved`:if(i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return{state:`create-failed`};case`detach-failed`:return e.warning(`Could not remove the connector's existing trigger destination. Run \`vercel connect detach ${t.ref.uid} --yes\`, then \`vercel connect attach ${t.ref.uid} --triggers --trigger-path ${SLACK_CHANNEL_DEFAULT_ROUTE} --yes\`.`),{state:`detach-failed`,connectorUid:t.ref.uid};case`attach-failed`:return e.warning(`Could not register this project as a trigger destination. Run \`vercel connect attach ${t.ref.uid} --triggers --trigger-path ${SLACK_CHANNEL_DEFAULT_ROUTE} --yes\` to enable event delivery.`),{state:`attach-failed`,connectorUid:t.ref.uid};case`installed`:return{state:`attached`,connectorUid:t.ref.uid,chatUrl:t.info.workspaceUrl,workspaceName:t.info.workspaceName};case`failed`:return e.warning(`Could not verify the Slack workspace installation. ${t.message}`),{state:`installation-check-failed`,connectorUid:t.ref.uid};case`timed-out`:if(e.warning(`The Slackbot did not connect to a Slack workspace in time.`),i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return{state:`not-installed`}}},cleanupNewAttempt=async(e,t)=>cleanupCreatedAttempt(u,{expectedUid:p,baselineConnectorUids:e.baselineConnectorUids,createdRef:t});function attemptInput(i,a){return{log:e,deps:r,projectRoot:t,slug:n,source:i,onOutput:o,onCreated:a}}async function runExistingConnector(t){let cleanupCurrentAttempt=async()=>({state:`clean`}),notInstalled=()=>(e.warning(`The existing Slack connector \`${t.ref.uid}\` has no Slack workspace installation. Eve did not remove it because this run did not create it. If its original browser request is still open, complete it; otherwise run \`vercel connect remove ${t.ref.uid} --disconnect-all --yes\` before trying again.`),{state:`existing-not-installed`,connectorUid:t.ref.uid}),finishExistingOutcome=async e=>e.state===`timed-out`?notInstalled():finishOutcome(e,t,cleanupCurrentAttempt);if(i.awaitChoice!==void 0){let e=await raceAttemptAgainstChoice({prompt:i.awaitChoice({status:`Waiting for the existing Slack workspace connection...`,context:`Complete the original setup in the browser`,actions:[{value:`cancel`,label:`Stop waiting`}]}),outerSignal:i.signal,run:e=>runAttempt({...attemptInput(t,()=>{}),signal:e,phase:(e,t)=>t()})});return e.via===`work`?finishExistingOutcome(e.outcome):e.settled?.state===`installed`?finishExistingOutcome(e.settled):notInstalled()}return finishExistingOutcome(await runAttempt({...attemptInput(t,()=>{}),signal:i.signal,phase:(t,n)=>withPhase(e,t,n)}))}async function runUncontrolledAttempt(t){let n,cleanupCurrentAttempt=()=>cleanupNewAttempt(t,n),r=runAttempt({...attemptInput(t,e=>{n=e}),signal:i.signal,phase:(t,n)=>withPhase(e,t,n)});try{return await finishOutcome(await r,t,cleanupCurrentAttempt)}catch(e){throw i.signal?.aborted===!0&&await cleanupCurrentAttempt(),e}}async function runInteractiveAttempt(n,a){let s,cleanupCurrentAttempt=()=>cleanupNewAttempt(n,s),l=a({status:`Creating a Slackbot through Vercel Connect...`,context:`Waiting for you to complete setup in the browser`,actions:[{value:`retry`,label:`Did your browser not open? Try again`},{value:`cancel`,label:`Cancel`}]}),u;try{u=await raceAttemptAgainstChoice({prompt:l,outerSignal:i.signal,run:e=>runAttempt({...attemptInput(n,e=>{s=e}),signal:e,phase:(e,t)=>t()})})}catch(e){throw await cleanupCurrentAttempt(),e}if(u.via===`work`)return{state:`finished`,result:await finishOutcome(u.outcome,n,cleanupCurrentAttempt)};if(u.settled?.state===`installed`)return{state:`finished`,result:await finishOutcome(u.settled,n,cleanupCurrentAttempt)};let d=await cleanupCurrentAttempt();if(d.state===`failed`)return{state:`finished`,result:cleanupFailureResult(d)};if(u.choice===`retry`){let n=await withPhase(e,`Checking existing Slack connectors...`,()=>listSlackConnectors(r,t,o,i.signal));return i.signal?.throwIfAborted(),n.state===`failed`?(e.warning(`Could not inspect existing Slack connectors, so Eve did not create another one. ${n.message}`),{state:`finished`,result:{state:`connector-lookup-failed`}}):{state:`retry`,source:{state:`new`,baselineConnectorUids:new Set(n.connectors.map(e=>e.uid))}}}return{state:`finished`,result:{state:`cancelled`}}}if(m.state===`found`)return runExistingConnector({state:`existing`,ref:m.connector});let h={state:`new`,baselineConnectorUids:m.connectorUids};if(i.awaitChoice===void 0)return runUncontrolledAttempt(h);for(;;){let e=await runInteractiveAttempt(h,i.awaitChoice);if(e.state===`finished`)return e.result;h=e.source}}async function reconcileSlackUid(e,t,n,r){if(n.state!==`attached`||n.connectorUid===r)return!0;let{patched:i}=await updateSlackChannelConnectorUid(join(t,`agent/channels/slack.ts`),n.connectorUid);return i?!0:(e.warning(`Could not patch agent/channels/slack.ts automatically. Update \`connectSlackCredentials("...")\` to \`"${n.connectorUid}"\` and run \`vercel deploy --prod\`.`),!1)}export{parseCreatedSlackConnector,parseInstallation,pickSlackConnector,provisionSlackbot,reconcileSlackUid};
|
|
@@ -164,7 +164,8 @@ export interface SetupState {
|
|
|
164
164
|
slackbotCreated: boolean;
|
|
165
165
|
slackbotAttached: boolean;
|
|
166
166
|
slackConnectorUid: string | undefined;
|
|
167
|
-
|
|
167
|
+
/** Deep link that opens a DM compose with the bot ("chat with your agent"). */
|
|
168
|
+
slackChatUrl: string | undefined;
|
|
168
169
|
slackWorkspaceName: string | undefined;
|
|
169
170
|
}
|
|
170
171
|
export declare function createDefaultSetupState(): SetupState;
|
package/dist/src/setup/state.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,slackChatUrl: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};
|
package/dist/src/setup/step.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export interface SetupBox<State, Input, Payload> {
|
|
|
32
32
|
gather(ctx: {
|
|
33
33
|
state: Readonly<State>;
|
|
34
34
|
initial?: Input;
|
|
35
|
+
/** Parent flow cancellation, when this box runs under an interruptible UI. */
|
|
36
|
+
signal?: AbortSignal;
|
|
35
37
|
}): Promise<Input>;
|
|
36
38
|
/** The only side-effecting step. Must be idempotent: detect current files,
|
|
37
39
|
* link state, and connectors before mutating, so a rerun converges. */
|
|
@@ -39,6 +41,8 @@ export interface SetupBox<State, Input, Payload> {
|
|
|
39
41
|
state: Readonly<State>;
|
|
40
42
|
input: Input;
|
|
41
43
|
sink: OutputSink;
|
|
44
|
+
/** Parent flow cancellation, when this box runs under an interruptible UI. */
|
|
45
|
+
signal?: AbortSignal;
|
|
42
46
|
}): Promise<Payload>;
|
|
43
47
|
/** The only in-memory state transition. Pure: no I/O. */
|
|
44
48
|
apply(state: State, payload: Payload): State;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outcome of round-tripping an `AI_GATEWAY_API_KEY` against the Vercel AI
|
|
3
|
+
* Gateway.
|
|
4
|
+
*
|
|
5
|
+
* - `valid`: the gateway accepted the key.
|
|
6
|
+
* - `invalid`: the gateway rejected the key (authentication failure).
|
|
7
|
+
* - `inconclusive`: the check itself failed (offline, timeout). The caller can
|
|
8
|
+
* save the key anyway rather than block on a flaky network. Only an explicit
|
|
9
|
+
* rejection counts as a wrong key.
|
|
10
|
+
*/
|
|
11
|
+
export type GatewayKeyValidation = {
|
|
12
|
+
kind: "valid";
|
|
13
|
+
} | {
|
|
14
|
+
kind: "invalid";
|
|
15
|
+
message: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "inconclusive";
|
|
18
|
+
message: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Confirms an `AI_GATEWAY_API_KEY` authenticates before Eve saves it, by making
|
|
22
|
+
* one account-scoped request to the gateway (`getCredits`). That endpoint
|
|
23
|
+
* rejects a bad key with a 401; the model catalog (`getAvailableModels`) is
|
|
24
|
+
* public and would accept any key, so it cannot validate.
|
|
25
|
+
*
|
|
26
|
+
* Aborts with the caller's `signal` (so the dev TUI's Esc/Ctrl-C interrupt
|
|
27
|
+
* cancels it like any other loading state); a user-initiated abort is rethrown,
|
|
28
|
+
* while a timeout or network failure resolves to `inconclusive`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function validateGatewayApiKey(apiKey: string, signal?: AbortSignal): Promise<GatewayKeyValidation>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toErrorMessage}from"#shared/errors.js";import{createGateway}from"ai";function isGatewayAuthRejection(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`authentication_error`||t.name===`GatewayAuthenticationError`||t.statusCode===401}async function validateGatewayApiKey(n,r){let i=AbortSignal.timeout(1e4),a=r===void 0?i:AbortSignal.any([r,i]);try{return await createGateway({apiKey:n,fetch:(e,t)=>globalThis.fetch(e,{...t,signal:a})}).getCredits(),{kind:`valid`}}catch(t){if(r?.aborted===!0)throw t;return isGatewayAuthRejection(t)?{kind:`invalid`,message:`The AI Gateway rejected this key.`}:{kind:`inconclusive`,message:toErrorMessage(t)}}}export{validateGatewayApiKey};
|
|
@@ -20,6 +20,13 @@ declare const VercelProjectReferenceSchema: z.ZodObject<{
|
|
|
20
20
|
name: z.ZodString;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
22
|
type VercelProjectReference = z.infer<typeof VercelProjectReferenceSchema>;
|
|
23
|
+
export interface VercelProjectOperationOptions {
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
export interface PickProjectOptions extends VercelProjectOperationOptions {
|
|
27
|
+
/** Whether an empty project list may fall back to entering a name to create. */
|
|
28
|
+
allowCreateWhenEmpty?: boolean;
|
|
29
|
+
}
|
|
23
30
|
export declare function unresolvedProject(): ProjectResolution;
|
|
24
31
|
/**
|
|
25
32
|
* Runs a network reach behind a section-like spinner so the user sees the CLI
|
|
@@ -30,12 +37,12 @@ export declare function withNetworkSpinner<T>(prompter: Prompter, message: strin
|
|
|
30
37
|
/** Resolves the linked project id from a resolution, if any. */
|
|
31
38
|
export declare function projectIdFromResolution(project: ProjectResolution): string | undefined;
|
|
32
39
|
/** Lists the Vercel scopes available to the current CLI user. */
|
|
33
|
-
export declare function listTeams(projectRoot: string): Promise<VercelTeamListEntry[]>;
|
|
40
|
+
export declare function listTeams(projectRoot: string, options?: VercelProjectOperationOptions): Promise<VercelTeamListEntry[]>;
|
|
34
41
|
/** Lists Vercel projects available under an explicit team or personal scope. */
|
|
35
|
-
export declare function listProjects(projectRoot: string, team: string): Promise<VercelProjectListEntry[]>;
|
|
42
|
+
export declare function listProjects(projectRoot: string, team: string, options?: VercelProjectOperationOptions): Promise<VercelProjectListEntry[]>;
|
|
36
43
|
/** Resolves one project by exact name or id through the Vercel API. */
|
|
37
|
-
export declare function resolveProjectByNameOrId(projectRoot: string, team: string, projectNameOrId: string): Promise<VercelProjectReference | null>;
|
|
38
|
-
export declare function assertNewProjectNameAvailable(projectRoot: string, team: string, projectName: string): Promise<void>;
|
|
44
|
+
export declare function resolveProjectByNameOrId(projectRoot: string, team: string, projectNameOrId: string, options?: VercelProjectOperationOptions): Promise<VercelProjectReference | null>;
|
|
45
|
+
export declare function assertNewProjectNameAvailable(projectRoot: string, team: string, projectName: string, options?: VercelProjectOperationOptions): Promise<void>;
|
|
39
46
|
/**
|
|
40
47
|
* Throws the login action. When the underlying `vercel whoami` failure is
|
|
41
48
|
* known, its diagnostic is folded into the reason: without it the agent only
|
|
@@ -48,18 +55,18 @@ export declare function requireVercelLogin(failure?: VercelCaptureFailure): neve
|
|
|
48
55
|
* non-zero when not logged in; any other failure (a missing CLI, a transient
|
|
49
56
|
* API error) is surfaced verbatim rather than mislabeled as a login problem.
|
|
50
57
|
*/
|
|
51
|
-
export declare function requireAuth(projectRoot: string, prompter?: Prompter): Promise<void>;
|
|
58
|
+
export declare function requireAuth(projectRoot: string, prompter?: Prompter, options?: VercelProjectOperationOptions): Promise<void>;
|
|
52
59
|
/**
|
|
53
60
|
* Non-throwing auth probe: whether the Vercel CLI has a logged-in user. Used
|
|
54
61
|
* where authentication changes a decision (e.g. adopting an existing link)
|
|
55
62
|
* rather than being a precondition to enforce.
|
|
56
63
|
*/
|
|
57
|
-
export declare function isVercelAuthenticated(projectRoot: string): Promise<boolean>;
|
|
64
|
+
export declare function isVercelAuthenticated(projectRoot: string, options?: VercelProjectOperationOptions): Promise<boolean>;
|
|
58
65
|
/**
|
|
59
66
|
* Resolves a passed team slug, or the current scope when unset, to a concrete
|
|
60
67
|
* slug so every provisioning command can pass an explicit `--scope`.
|
|
61
68
|
*/
|
|
62
|
-
export declare function resolveTeam(projectRoot: string, team: string | undefined): Promise<string>;
|
|
69
|
+
export declare function resolveTeam(projectRoot: string, team: string | undefined, options?: VercelProjectOperationOptions): Promise<string>;
|
|
63
70
|
/**
|
|
64
71
|
* Validates a passed team slug against the account's teams, failing fast.
|
|
65
72
|
*
|
|
@@ -71,13 +78,13 @@ export declare function resolveTeam(projectRoot: string, team: string | undefine
|
|
|
71
78
|
* `prompter` is accepted so callers can pass it uniformly across the team
|
|
72
79
|
* resolution helpers; it is unused now that an invalid slug throws.
|
|
73
80
|
*/
|
|
74
|
-
export declare function validateTeam(prompter: Prompter, projectRoot: string, team: string | undefined): Promise<void>;
|
|
81
|
+
export declare function validateTeam(prompter: Prompter, projectRoot: string, team: string | undefined, options?: VercelProjectOperationOptions): Promise<void>;
|
|
75
82
|
/**
|
|
76
83
|
* Picks the Vercel team (scope). A passed slug is validated and resolved; with
|
|
77
84
|
* zero or one team the current scope is used without prompting; otherwise the
|
|
78
85
|
* user filters and chooses from the list with a single-selection picker.
|
|
79
86
|
*/
|
|
80
|
-
export declare function pickTeam(prompter: Prompter, projectRoot: string, presetTeam: string | undefined): Promise<string>;
|
|
87
|
+
export declare function pickTeam(prompter: Prompter, projectRoot: string, presetTeam: string | undefined, options?: VercelProjectOperationOptions): Promise<string>;
|
|
81
88
|
/**
|
|
82
89
|
* A picked Vercel project. `exists` distinguishes a project the user selected
|
|
83
90
|
* from the existing list (link it) from a name they typed because none exist
|
|
@@ -90,13 +97,13 @@ export interface ArgsPickedProject {
|
|
|
90
97
|
exists: boolean;
|
|
91
98
|
}
|
|
92
99
|
/** Picks an existing project under a team, or a name to create when none exist. */
|
|
93
|
-
export declare function pickProject(prompter: Prompter, projectRoot: string, team: string): Promise<ArgsPickedProject>;
|
|
100
|
+
export declare function pickProject(prompter: Prompter, projectRoot: string, team: string, options?: PickProjectOptions): Promise<ArgsPickedProject>;
|
|
94
101
|
/** Returns a project name for a new Vercel project, prompting when the default exists. */
|
|
95
|
-
export declare function pickNewProjectName(prompter: Prompter, projectRoot: string, team: string, defaultProjectName: string): Promise<string>;
|
|
102
|
+
export declare function pickNewProjectName(prompter: Prompter, projectRoot: string, team: string, defaultProjectName: string, options?: VercelProjectOperationOptions): Promise<string>;
|
|
96
103
|
/**
|
|
97
104
|
* Ensures the concrete project exists (creating it for a `new` plan) and links
|
|
98
105
|
* this directory to it. Pure executor: it acts on a fully-resolved spec and
|
|
99
106
|
* never prompts for a team or project. Returns whether the link succeeded.
|
|
100
107
|
*/
|
|
101
|
-
export declare function linkProject(prompter: Prompter, projectRoot: string, spec: ResolvedVercelProjectSpec, onOutput: ReturnType<typeof createPromptCommandOutput
|
|
108
|
+
export declare function linkProject(prompter: Prompter, projectRoot: string, spec: ResolvedVercelProjectSpec, onOutput: ReturnType<typeof createPromptCommandOutput>, options?: VercelProjectOperationOptions): Promise<boolean>;
|
|
102
109
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{boolean,object,record,string,unknown}from"../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js";import"../node_modules/.pnpm/zod@4.4.3/node_modules/zod/index.js";import{captureVercel,runVercel}from"#setup/primitives/index.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{whimsyFor}from"#setup/cli/index.js";const JsonObjectSchema=record(string(),unknown()),VercelTeamListEntrySchema=object({name:string(),slug:string(),current:boolean()}),VercelProjectListEntrySchema=object({name:string(),id:string()}),VercelProjectReferenceSchema=object({id:string(),name:string()}),VercelApiErrorSchema=object({error:object({code:string().optional(),message:string().optional()}).optional()});function unresolvedProject(){return{kind:`unresolved`}}async function withNetworkSpinner(e,t,n){let r=e.log.spinner?.(t);try{return await n()}finally{r?.stop()}}function projectIdFromResolution(e){return e.kind===`unresolved`?void 0:e.projectId}function parseJson(e,t){try{return JSON.parse(e)}catch{throw Error(`Could not parse ${t} JSON from Vercel CLI output.`)}}function parseVercelJsonList(e,t,n){let r=parseJson(e,t),i=JsonObjectSchema.safeParse(r);if(!i.success)throw Error(`Could not read ${t} from Vercel CLI JSON output.`);let a=i.data[t];if(!Array.isArray(a))throw Error(`Vercel CLI JSON output did not include ${t}.`);let o=[];for(let e of a){let t=n.safeParse(e);t.success&&o.push(t.data)}return o}function parseTeamList(e){return e===void 0?[]:parseVercelJsonList(e,`teams`,VercelTeamListEntrySchema)}async function listTeams(e){let
|
|
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{boolean,object,record,string,unknown}from"../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js";import"../node_modules/.pnpm/zod@4.4.3/node_modules/zod/index.js";import{captureVercel,runVercel}from"#setup/primitives/index.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{whimsyFor}from"#setup/cli/index.js";var import_picocolors=__toESM(require_picocolors(),1);const JsonObjectSchema=record(string(),unknown()),VercelTeamListEntrySchema=object({name:string(),slug:string(),current:boolean()}),VercelProjectListEntrySchema=object({name:string(),id:string()}),VercelProjectReferenceSchema=object({id:string(),name:string()}),VercelApiErrorSchema=object({error:object({code:string().optional(),message:string().optional()}).optional()});function unresolvedProject(){return{kind:`unresolved`}}async function withNetworkSpinner(e,t,n){let r=e.log.spinner?.(t);try{return await n()}finally{r?.stop()}}function projectIdFromResolution(e){return e.kind===`unresolved`?void 0:e.projectId}function parseJson(e,t){try{return JSON.parse(e)}catch{throw Error(`Could not parse ${t} JSON from Vercel CLI output.`)}}function parseVercelJsonList(e,t,n){let r=parseJson(e,t),i=JsonObjectSchema.safeParse(r);if(!i.success)throw Error(`Could not read ${t} from Vercel CLI JSON output.`);let a=i.data[t];if(!Array.isArray(a))throw Error(`Vercel CLI JSON output did not include ${t}.`);let o=[];for(let e of a){let t=n.safeParse(e);t.success&&o.push(t.data)}return o}function parseTeamList(e){return e===void 0?[]:parseVercelJsonList(e,`teams`,VercelTeamListEntrySchema)}async function listTeams(e,t={}){let n=await captureVercel([`teams`,`ls`,`--format`,`json`],{cwd:e,signal:t.signal});if(!n.ok)throw Error(`Could not list Vercel teams. ${n.failure.message}`);return parseTeamList(n.stdout)}function parseProjectList(e){return e===void 0?[]:parseVercelJsonList(e,`projects`,VercelProjectListEntrySchema)}async function listProjects(e,t,n={}){let r=await captureVercel([`project`,`ls`,`--format`,`json`,`--scope`,t],{cwd:e,signal:n.signal});if(!r.ok)throw Error(`Could not list Vercel projects in ${t}. ${r.failure.message}`);return parseProjectList(r.stdout)}function isNotFoundApiFailure(e){if(e.code===404)return!0;let t=VercelApiErrorSchema.safeParse(safeParseJson(e.stdout)),n=t.success?t.data.error:void 0,r=`${n?.code??``} ${n?.message??``} ${e.stderr}`.toLowerCase();return r.includes(`not_found`)||r.includes(`not found`)||r.includes(`404`)}function isConflictApiFailure(e){let t=VercelApiErrorSchema.safeParse(safeParseJson(e.stdout)),n=t.success?t.data.error:void 0,r=`${n?.code??``} ${n?.message??``} ${e.stdout} ${e.stderr}`.toLowerCase();return r.includes(`409`)||r.includes(`conflict`)||r.includes(`already exists`)}function safeParseJson(e){try{return JSON.parse(e)}catch{return}}function parseProjectReference(e,t){let n=VercelProjectReferenceSchema.safeParse(parseJson(e,t));if(!n.success)throw Error(`Could not read Vercel project identity from ${t}.`);return n.data}async function resolveProjectByNameOrId(e,t,n,r={}){let i=await captureVercel([`api`,`/v9/projects/${encodeURIComponent(n)}`,`--scope`,t,`--raw`],{cwd:e,signal:r.signal});if(i.ok)return parseProjectReference(i.stdout,`project ${n}`);if(isNotFoundApiFailure(i.failure))return null;throw Error(`Could not resolve project "${n}" in ${t}. ${i.failure.message}`)}async function createProject(e,t,n,r,i){let a=await captureVercel([`api`,`/v10/projects`,`--scope`,t,`--method`,`POST`,`--raw-field`,`name=${n}`,`--raw`],{cwd:e,onOutput:r,signal:i.signal});if(a.ok)return parseProjectReference(a.stdout,`created project ${n}`);throw isConflictApiFailure(a.failure)?Error(projectNameCollisionMessage(n,t)):Error(`Could not create Vercel project "${n}" in ${t}. ${a.failure.message}`)}function projectNameCollisionMessage(e,t){return`Vercel project "${e}" already exists in ${t}. Pass --project ${e} to link it, or choose a different project name.`}async function assertNewProjectNameAvailable(e,t,n,r={}){if(await resolveProjectByNameOrId(e,t,n,r)!==null)throw Error(projectNameCollisionMessage(n,t))}function requireVercelLogin(e){let t=`Provisioning a Vercel project requires you to be logged in to Vercel.`,n=e?.stderr.trim();throw new HumanActionRequiredError({kind:`vercel-login`,command:`vercel login`,reason:e?`${t} The Vercel CLI check did not succeed: ${e.message}${n?` ${n}`:``}`:t})}async function requireAuth(e,t,n={}){let check=async()=>{let t=await captureVercel([`whoami`],{cwd:e,signal:n.signal});n.signal?.throwIfAborted(),t.ok||requireVercelLogin(t.failure)};if(t===void 0){await check();return}await withNetworkSpinner(t,whimsyFor(`auth`),check)}async function isVercelAuthenticated(e,t={}){let n=await captureVercel([`whoami`],{cwd:e,signal:t.signal});return t.signal?.throwIfAborted(),n.ok}async function whoamiScope(e,t){let n=await captureVercel([`whoami`],{cwd:e,signal:t.signal});return t.signal?.throwIfAborted(),n.ok||requireVercelLogin(n.failure),n.stdout.trim()}async function resolveTeam(e,t,n={}){return t===void 0?(await listTeams(e,n)).find(e=>e.current)?.slug??await whoamiScope(e,n):t}async function validateTeam(e,t,n,r={}){if(n===void 0)return;let i=await listTeams(t,r);if(i.length>0&&!i.some(e=>e.slug===n))throw Error(`Team "${n}" was not found in \`vercel teams ls\`. Pass a valid team slug or omit --team.`)}async function pickTeam(e,t,n,r={}){if(n!==void 0)return await validateTeam(e,t,n,r),resolveTeam(t,n,r);let i=await withNetworkSpinner(e,whimsyFor(`teams`),()=>listTeams(t,r));return i.length<=1?i.find(e=>e.current)?.slug??await whoamiScope(t,r):e.select({message:`Select your team`,search:!0,placeholder:`type to search teams`,options:i.map(e=>({value:e.slug,label:e.current?`${e.name} (current)`:e.name})),initialValue:i.find(e=>e.current)?.slug})}async function pickProject(e,t,n,r={}){let i=await withNetworkSpinner(e,whimsyFor(`projects`,n),()=>listProjects(t,n,r));if(i.length===0){if(r.allowCreateWhenEmpty===!1)throw Error(`No existing Vercel projects found in ${n}. Create one in Vercel, then try again.`);return{project:await e.text({message:`No projects found in ${n}. Enter a project name to create`,validate:e=>e.trim().length===0?`Project name cannot be empty.`:void 0}),exists:!1}}return{project:await e.select({message:`Project to link`,search:!0,placeholder:`type to filter projects`,options:i.map(e=>({value:e.name,label:e.name}))}),exists:!0}}async function pickNewProjectName(e,t,n,r,i={}){let a=await withNetworkSpinner(e,whimsyFor(`project-name`,n),()=>resolveProjectByNameOrId(t,n,r.trim(),i)),o=r.trim();for(;a!==null;)o=(await e.text({message:`New project name`,defaultValue:`${o}-2`,notices:[{tone:`warning`,text:`${import_picocolors.default.yellow(`Project named`)} '${import_picocolors.default.blue(o)}' ${import_picocolors.default.yellow(`already exists in`)} '${import_picocolors.default.blue(n)}'`}],validate:e=>{if(e.trim().length===0)return`Project name cannot be empty.`}})).trim(),a=await resolveProjectByNameOrId(t,n,o,i);return o}async function linkProject(e,t,n,r,i={}){let a=[`--scope`,n.team],o;if(n.kind===`new`)o=await withNetworkSpinner(e,`Creating Vercel project "${n.project}" in ${n.team}...`,async()=>(await assertNewProjectNameAvailable(t,n.team,n.project,i),createProject(t,n.team,n.project,r,i)));else{let e=await resolveProjectByNameOrId(t,n.team,n.project,i);if(e===null)throw Error(`Vercel project "${n.project}" was not found in ${n.team}.`);o=e}return withNetworkSpinner(e,`Linking this directory to Vercel project "${o.name}"...`,()=>runVercel([`link`,`--project`,o.id,...a,`--yes`],{cwd:t,onOutput:r,signal:i.signal}))}export{assertNewProjectNameAvailable,isVercelAuthenticated,linkProject,listProjects,listTeams,pickNewProjectName,pickProject,pickTeam,projectIdFromResolution,requireAuth,requireVercelLogin,resolveProjectByNameOrId,resolveTeam,unresolvedProject,validateTeam,withNetworkSpinner};
|
|
@@ -9,6 +9,32 @@ import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
|
9
9
|
export interface AgentModelOptionsDefinition {
|
|
10
10
|
readonly providerOptions?: Record<string, JsonObject>;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* How an agent's model is reached at runtime, decided at compile time from the
|
|
14
|
+
* authored model value.
|
|
15
|
+
*
|
|
16
|
+
* - `gateway`: routed through the Vercel AI Gateway. This covers a bare model
|
|
17
|
+
* id string (resolved via the AI SDK global default provider), a
|
|
18
|
+
* `gateway(...)` instance, and a gateway id whose provider key is forwarded
|
|
19
|
+
* to the gateway via `providerOptions.gateway.byok`. `target` is the upstream
|
|
20
|
+
* provider slug carried in the model id (e.g. `"anthropic"`), best-effort.
|
|
21
|
+
* `byok` is set to that provider slug when a `providerOptions.gateway.byok`
|
|
22
|
+
* block is present.
|
|
23
|
+
* - `external`: a direct provider instance (e.g. `anthropic(...)`) that bypasses
|
|
24
|
+
* the gateway and talks to the provider's own endpoint. `provider` is the AI
|
|
25
|
+
* SDK provider name (e.g. `"anthropic"`).
|
|
26
|
+
*
|
|
27
|
+
* This is a routing fact, not a model-existence check; it does not assert the
|
|
28
|
+
* model id names a real model.
|
|
29
|
+
*/
|
|
30
|
+
export type ModelRouting = {
|
|
31
|
+
kind: "gateway";
|
|
32
|
+
target: string;
|
|
33
|
+
byok?: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "external";
|
|
36
|
+
provider: string;
|
|
37
|
+
};
|
|
12
38
|
export type InternalAgentModelDefinition = {
|
|
13
39
|
id: string;
|
|
14
40
|
contextWindowTokens?: number;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the agent reaches its model and whether it's ready: the build-time
|
|
3
|
+
* {@link ModelRouting} composed with runtime credential presence. A client (the
|
|
4
|
+
* dev TUI status bar, or any other consumer of `/eve/v1/info`) shows and gates
|
|
5
|
+
* on three states:
|
|
6
|
+
*
|
|
7
|
+
* - `external`: a direct provider endpoint, not the gateway. Eve makes no
|
|
8
|
+
* connectedness claim, since the provider key lives in the agent's own code
|
|
9
|
+
* rather than the gateway's credentials, and model selection is disabled
|
|
10
|
+
* because Eve cannot rewrite the authored source.
|
|
11
|
+
* - `gateway` + `connected: true`: routed through the Vercel AI Gateway with a
|
|
12
|
+
* resolvable credential (`api-key` from `AI_GATEWAY_API_KEY`, else `oidc`).
|
|
13
|
+
* - `gateway` + `connected: false`: routed through the gateway with neither a
|
|
14
|
+
* gateway API key nor an OIDC token. This is the "no provider connected" state
|
|
15
|
+
* that gates the "provider required" setup prompt.
|
|
16
|
+
*/
|
|
17
|
+
export type ModelEndpointStatus = {
|
|
18
|
+
kind: "external";
|
|
19
|
+
provider: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "gateway";
|
|
22
|
+
connected: true;
|
|
23
|
+
credential: "api-key" | "oidc";
|
|
24
|
+
} | {
|
|
25
|
+
kind: "gateway";
|
|
26
|
+
connected: false;
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -88,6 +88,10 @@ export interface SandboxBackendCreateInput {
|
|
|
88
88
|
export interface SandboxBackendPrewarmInput<BO = Record<string, never>> {
|
|
89
89
|
readonly templateKey: string;
|
|
90
90
|
readonly bootstrap?: (input: SandboxBootstrapContext<BO>) => void | Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Optional progress logger for backend-specific prewarm phases.
|
|
93
|
+
*/
|
|
94
|
+
readonly log?: (message: string) => void;
|
|
91
95
|
readonly runtimeContext: SandboxBackendRuntimeContext;
|
|
92
96
|
readonly seedFiles: ReadonlyArray<SandboxSeedFile>;
|
|
93
97
|
}
|
|
@@ -110,8 +114,10 @@ export interface SandboxBackendPrewarmResult {
|
|
|
110
114
|
*
|
|
111
115
|
* A `SandboxBackend` is a value an author attaches to a
|
|
112
116
|
* {@link SandboxDefinition} to choose which underlying runtime hosts the
|
|
113
|
-
* sandbox. Eve ships
|
|
114
|
-
* `
|
|
117
|
+
* sandbox. Eve ships built-in backends (`dockerBackend()`,
|
|
118
|
+
* `justBashBackend()`, `microsandboxBackend()`,
|
|
119
|
+
* `vercelSandboxBackend()`, and the availability-aware
|
|
120
|
+
* `defaultBackend()`), but the interface is public so authors can write
|
|
115
121
|
* their own.
|
|
116
122
|
*
|
|
117
123
|
* A backend implements the full two-phase lifecycle:
|
|
@@ -69,13 +69,14 @@ interface SandboxDefinitionBase<BO = Record<string, never>, SO = Record<string,
|
|
|
69
69
|
*
|
|
70
70
|
* ```ts
|
|
71
71
|
* defineSandbox({
|
|
72
|
-
* backend: () =>
|
|
72
|
+
* backend: () => vercelSandboxBackend({ env: { TOKEN: process.env.TOKEN ?? "" } }),
|
|
73
73
|
* });
|
|
74
74
|
* ```
|
|
75
75
|
*
|
|
76
76
|
* When this field is omitted, Eve substitutes `defaultBackend()` at
|
|
77
|
-
* runtime, which
|
|
78
|
-
* (where `process.env.VERCEL` is set)
|
|
77
|
+
* runtime, which picks the best available backend: `vercelSandboxBackend()`
|
|
78
|
+
* on hosted Vercel (where `process.env.VERCEL` is set), then Docker,
|
|
79
|
+
* microsandbox, or just-bash
|
|
79
80
|
* everywhere else. Set `backend` explicitly to pin the sandbox to a
|
|
80
81
|
* specific backend regardless of environment.
|
|
81
82
|
*/
|
|
@@ -17,7 +17,9 @@ import type { NetworkPolicy } from "#compiled/@vercel/sandbox/index.js";
|
|
|
17
17
|
* });
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
|
-
* The
|
|
21
|
-
*
|
|
20
|
+
* The Docker backend honors only the coarse `"allow-all"` and
|
|
21
|
+
* `"deny-all"` policies; the just-bash backend rejects `setNetworkPolicy`
|
|
22
|
+
* entirely (its network policy is fixed at sandbox creation and it runs
|
|
23
|
+
* no binaries to govern).
|
|
22
24
|
*/
|
|
23
25
|
export type SandboxNetworkPolicy = NetworkPolicy;
|
|
@@ -107,8 +107,9 @@ export interface SandboxSession extends Pick<AiSdkSandbox, "run" | "spawn" | "re
|
|
|
107
107
|
*
|
|
108
108
|
* When the policy is known at session start, prefer configuring it up
|
|
109
109
|
* front in the sandbox backend factory or `onSession`'s `use()`. The
|
|
110
|
-
*
|
|
111
|
-
*
|
|
110
|
+
* Docker backend honors only `"allow-all"` and `"deny-all"`;
|
|
111
|
+
* the just-bash backend rejects this call entirely (its network policy
|
|
112
|
+
* is fixed at sandbox creation and it runs no binaries to govern).
|
|
112
113
|
*/
|
|
113
114
|
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
114
115
|
/**
|
package/dist/src/svelte/index.js
CHANGED
package/dist/src/vue/index.js
CHANGED
|
@@ -26,7 +26,17 @@ You also need a model credential. Set the provider or gateway key your model str
|
|
|
26
26
|
|
|
27
27
|
The quick start uses `eve init` for a guided scaffold. The target can also be an existing project directory (`eve init .`): the project must have a `package.json`, the `agent/` files must not exist yet, and the missing `eve`, `ai`, and `zod` dependencies are added without touching anything else the project owns. Either way the final handoff runs the `eve dev` binary through the project's package manager, never the project's own `dev` script.
|
|
28
28
|
|
|
29
|
-
To wire Eve into an existing app yourself instead,
|
|
29
|
+
To wire Eve into an existing app yourself instead, make sure the app declares a compatible Node runtime in `package.json`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=24"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then add only the dependency and author the two files the runtime needs:
|
|
30
40
|
|
|
31
41
|
```bash
|
|
32
42
|
npm install eve@latest
|
|
@@ -157,8 +167,8 @@ See [Sessions, runs & streaming](./concepts/sessions-runs-and-streaming) for the
|
|
|
157
167
|
|
|
158
168
|
If a coding agent (Claude Code, Cursor, and the like) is doing the setup, hand it this prompt:
|
|
159
169
|
|
|
160
|
-
<CopyPrompt text="Set up an Eve agent for the user. Eve is a filesystem-first TypeScript framework for durable agents, published as the npm package eve. Read its docs: once eve is installed they are bundled in the package at node_modules/eve/
|
|
161
|
-
Set up an Eve agent: read the Eve docs (bundled at node_modules/eve/
|
|
170
|
+
<CopyPrompt text="Set up an Eve agent for the user. Eve is a filesystem-first TypeScript framework for durable agents, published as the npm package eve. Read its docs: once eve is installed they are bundled in the package at node_modules/eve/docs; before eve is installed, read the published Introduction and Getting Started pages. If the project has no Eve app, scaffold one with `npx eve@latest init <name>`; add `--channel-web-nextjs` only when the user wants Web Chat. The init command installs dependencies, initializes Git, and starts the dev server, so run it in a controllable process and stop it before editing. To add Eve to an existing app, run `npm install eve@latest`. Make sure agent/agent.ts and agent/instructions.md exist, then add a first typed tool at agent/tools/get_weather.ts using defineTool from eve/tools with a Zod inputSchema and an inline execute. Start the dev server again, then exercise the HTTP API: create a session with POST /eve/v1/session, attach to GET /eve/v1/session/:id/stream, and send a follow-up with the returned continuationToken. Verify with the project's typecheck, adapt model and provider choices to the project, and do not commit unless the user asks.">
|
|
171
|
+
Set up an Eve agent: read the Eve docs (bundled at node_modules/eve/docs once eve is
|
|
162
172
|
installed), scaffold with `npx eve@latest init <name>` (or `npm install eve@latest` in an existing app), add
|
|
163
173
|
a typed tool at agent/tools/get_weather.ts, run it with `npm run dev`, then create a session, stream
|
|
164
174
|
it, and send a follow-up.
|
|
@@ -166,7 +176,7 @@ If a coding agent (Claude Code, Cursor, and the like) is doing the setup, hand i
|
|
|
166
176
|
|
|
167
177
|
Once `eve` is a dependency, the full docs are bundled in the package, so the agent can read them locally without fetching anything:
|
|
168
178
|
|
|
169
|
-
- Docs: `node_modules/eve/
|
|
179
|
+
- Docs: `node_modules/eve/docs/`
|
|
170
180
|
|
|
171
181
|
`eve init <name>` creates the base agent; `eve init .` adds one to an existing project. Add `--channel-web-nextjs` for Web Chat, or run
|
|
172
182
|
`eve channels add slack` later from an interactive terminal.
|
|
@@ -29,10 +29,10 @@ Route-auth secrets never get serialized into the compiled discovery or module-ma
|
|
|
29
29
|
On Vercel, the [sandbox](../sandbox) runs on hosted [Vercel Sandbox](https://vercel.com/docs/sandbox) infrastructure. Attach the backend on the sandbox definition:
|
|
30
30
|
|
|
31
31
|
```ts title="agent/sandbox/sandbox.ts"
|
|
32
|
-
import { defineSandbox,
|
|
32
|
+
import { defineSandbox, vercelSandboxBackend } from "eve/sandbox";
|
|
33
33
|
|
|
34
34
|
export default defineSandbox({
|
|
35
|
-
backend:
|
|
35
|
+
backend: vercelSandboxBackend(),
|
|
36
36
|
});
|
|
37
37
|
```
|
|
38
38
|
|
|
@@ -110,7 +110,7 @@ Agent Runs is separate from the OpenTelemetry exporters configured in [`instrume
|
|
|
110
110
|
|
|
111
111
|
- [ ] `eve build` succeeds and writes `.vercel/output`.
|
|
112
112
|
- [ ] Provider keys and route-auth secrets are set in Vercel env vars.
|
|
113
|
-
- [ ] The sandbox backend matches the environment (`
|
|
113
|
+
- [ ] The sandbox backend matches the environment (`vercelSandboxBackend()` or `defaultBackend()`).
|
|
114
114
|
- [ ] Build-time prewarm reused or built templates without failing.
|
|
115
115
|
- [ ] `placeholderAuth()` is replaced with your real policy.
|
|
116
116
|
|