eve 0.11.2 → 0.11.3
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 +11 -2
- package/README.md +11 -11
- package/bin/eve.d.ts +1 -1
- package/bin/eve.js +6 -6
- package/dist/src/channel/routes.d.ts +4 -4
- package/dist/src/channel/types.d.ts +2 -2
- package/dist/src/channel/websocket-upgrade-server.d.ts +3 -3
- package/dist/src/chunks/{use-eve-agent-CdETo3qQ.js → use-eve-agent-D9ZhQhyV.js} +2 -2
- package/dist/src/chunks/{use-eve-agent-ClyM-_UT.js → use-eve-agent-DFI0POM9.js} +2 -2
- package/dist/src/cli/banner.d.ts +1 -1
- package/dist/src/cli/banner.js +1 -1
- package/dist/src/cli/commands/channel-add-conflicts.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/init-agent-instructions.md +1 -1
- package/dist/src/cli/commands/init-git.js +1 -1
- package/dist/src/cli/commands/init.d.ts +1 -1
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/preconditions.d.ts +2 -2
- package/dist/src/cli/commands/preconditions.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-issues.d.ts +2 -0
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +2 -2
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +1 -1
- package/dist/src/cli/dev/url.d.ts +1 -1
- package/dist/src/cli/run.d.ts +1 -1
- package/dist/src/cli/run.js +2 -2
- package/dist/src/cli/ui/output.d.ts +1 -1
- package/dist/src/client/client-error.d.ts +1 -1
- package/dist/src/client/client.d.ts +3 -3
- package/dist/src/client/eve-agent-store.d.ts +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/message-reducer-types.d.ts +3 -3
- package/dist/src/client/message-reducer.d.ts +3 -3
- package/dist/src/client/output-schema.d.ts +1 -1
- package/dist/src/client/reducer.d.ts +5 -5
- package/dist/src/client/session.d.ts +1 -1
- package/dist/src/client/types.d.ts +1 -1
- package/dist/src/client/url.d.ts +2 -2
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiled/@vercel/detect-agent/index.d.ts +1 -1
- package/dist/src/compiler/channel-instrumentation-types.js +1 -1
- package/dist/src/compiler/model-catalog.d.ts +1 -1
- package/dist/src/compiler/module-map.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-channel.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/container.d.ts +4 -4
- package/dist/src/context/container.js +1 -1
- package/dist/src/discover/diagnostics.d.ts +1 -1
- package/dist/src/discover/project.d.ts +2 -2
- package/dist/src/discover/project.js +1 -1
- package/dist/src/evals/cli/eval-client.d.ts +1 -1
- package/dist/src/evals/define-eval.d.ts +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +1 -1
- package/dist/src/evals/types.d.ts +6 -6
- package/dist/src/execution/durable-session-migrations/chain.js +1 -1
- package/dist/src/execution/sandbox/bash-tool.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-options.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/development-prewarm.js +1 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/session-callback-step.d.ts +1 -1
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/harness/code-mode-lifecycle.d.ts +1 -1
- package/dist/src/harness/emission.d.ts +1 -1
- package/dist/src/harness/runtime-actions.d.ts +1 -1
- package/dist/src/internal/application/cache-metadata.d.ts +2 -2
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/package.d.ts +7 -7
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-module-bundle.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/instrumentation.d.ts +1 -1
- package/dist/src/internal/nitro/host/build-application.d.ts +1 -1
- package/dist/src/internal/nitro/host/channel-routes.d.ts +3 -3
- package/dist/src/internal/nitro/host/configure-nitro-routes.d.ts +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +1 -1
- package/dist/src/internal/nitro/host/cron-handler-route.d.ts +3 -3
- package/dist/src/internal/nitro/host/nitro-bundler-config.d.ts +1 -1
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.d.ts +2 -2
- package/dist/src/internal/nitro/host/schedule-task-routes.d.ts +2 -2
- package/dist/src/internal/nitro/host/start-development-server.d.ts +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/host/start-production-server.d.ts +1 -1
- package/dist/src/internal/nitro/host/start-production-server.js +2 -2
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -1
- package/dist/src/internal/nitro/routes/health.d.ts +1 -1
- package/dist/src/internal/nitro/routes/info.d.ts +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.d.ts +1 -1
- package/dist/src/internal/package-name.d.ts +1 -1
- package/dist/src/internal/vercel-agent-summary.d.ts +6 -6
- package/dist/src/internal/workflow/builtins.d.ts +3 -3
- package/dist/src/internal/workflow-bundle/nitro-step-entry.js +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +7 -7
- package/dist/src/internal/workflow-bundle/workflow-core-shim.d.ts +4 -4
- package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -1
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/protocol/message.d.ts +2 -2
- package/dist/src/protocol/routes.d.ts +3 -3
- package/dist/src/public/agents/auth.d.ts +1 -1
- package/dist/src/public/channels/auth.d.ts +1 -1
- package/dist/src/public/channels/discord/api.d.ts +2 -2
- package/dist/src/public/channels/discord/discordChannel.d.ts +2 -2
- package/dist/src/public/channels/discord/hitl.d.ts +4 -4
- package/dist/src/public/channels/discord/verify.d.ts +1 -1
- package/dist/src/public/channels/eve.d.ts +5 -5
- package/dist/src/public/channels/github/api.d.ts +1 -1
- package/dist/src/public/channels/github/defaults.d.ts +1 -1
- package/dist/src/public/channels/github/inbound.d.ts +1 -1
- package/dist/src/public/channels/index.d.ts +2 -2
- package/dist/src/public/channels/linear/auth.d.ts +1 -1
- package/dist/src/public/channels/linear/hitl.d.ts +4 -4
- package/dist/src/public/channels/linear/inbound.d.ts +1 -1
- package/dist/src/public/channels/linear/verify.d.ts +1 -1
- package/dist/src/public/channels/slack/constants.d.ts +1 -1
- package/dist/src/public/channels/teams/api.d.ts +4 -4
- package/dist/src/public/channels/teams/hitl.d.ts +4 -4
- package/dist/src/public/channels/teams/limits.d.ts +3 -3
- package/dist/src/public/channels/teams/verify.d.ts +2 -2
- package/dist/src/public/channels/telegram/api.d.ts +1 -1
- package/dist/src/public/channels/telegram/hitl.d.ts +3 -3
- package/dist/src/public/channels/telegram/verify.d.ts +1 -1
- package/dist/src/public/channels/twilio/api.d.ts +1 -1
- package/dist/src/public/context/index.d.ts +1 -1
- package/dist/src/public/definitions/defineChannel.d.ts +2 -2
- package/dist/src/public/definitions/hook.d.ts +1 -1
- package/dist/src/public/definitions/remote-agent.d.ts +5 -5
- package/dist/src/public/definitions/sandbox.d.ts +1 -1
- package/dist/src/public/definitions/source.d.ts +2 -2
- package/dist/src/public/definitions/state.d.ts +2 -2
- package/dist/src/public/definitions/state.js +1 -1
- package/dist/src/public/instrumentation/index.d.ts +3 -3
- package/dist/src/public/next/index.d.ts +12 -12
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/nuxt/dev-server.d.ts +2 -2
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/nuxt/module.d.ts +10 -10
- package/dist/src/public/nuxt/routing.d.ts +6 -6
- package/dist/src/public/nuxt/routing.js +1 -1
- package/dist/src/public/nuxt/vercel-json.d.ts +2 -2
- package/dist/src/public/sandbox/backends/just-bash.d.ts +1 -1
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +1 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +3 -3
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +2 -2
- package/dist/src/public/sveltekit/dev-server.d.ts +2 -2
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/sveltekit/index.d.ts +11 -11
- package/dist/src/public/sveltekit/routing.d.ts +5 -5
- package/dist/src/public/sveltekit/routing.js +1 -1
- package/dist/src/public/sveltekit/vercel-json.d.ts +2 -2
- package/dist/src/public/tool-result-narrowing.js +1 -1
- package/dist/src/public/types/json.d.ts +1 -1
- package/dist/src/react/use-eve-agent.d.ts +8 -8
- package/dist/src/runtime/agent/bootstrap-model.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/attributes/emit.d.ts +2 -2
- package/dist/src/runtime/connections/callback-route.d.ts +1 -1
- package/dist/src/runtime/connections/principal.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +1 -1
- package/dist/src/runtime/connections/types.d.ts +4 -4
- package/dist/src/runtime/framework-tools/final-output.d.ts +1 -1
- package/dist/src/runtime/governance/auth/http-basic.d.ts +1 -1
- package/dist/src/runtime/governance/auth/token-claims.d.ts +1 -1
- package/dist/src/runtime/governance/auth/types.d.ts +1 -1
- package/dist/src/runtime/loaders/artifact-paths.d.ts +1 -1
- package/dist/src/runtime/loaders/compile-metadata.js +1 -1
- package/dist/src/runtime/loaders/manifest.js +1 -1
- package/dist/src/runtime/loaders/module-map.js +1 -1
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-channel.js +1 -1
- package/dist/src/runtime/schedules/register.js +1 -1
- package/dist/src/runtime/sessions/auth.d.ts +1 -1
- package/dist/src/runtime/sessions/runtime-session.d.ts +1 -1
- package/dist/src/runtime/types.d.ts +1 -1
- package/dist/src/runtime/workspace/types.d.ts +1 -1
- package/dist/src/services/dev-client/request-headers.d.ts +2 -2
- package/dist/src/services/dev-client/vercel-auth-error.d.ts +1 -1
- package/dist/src/services/inspect-application.d.ts +1 -1
- package/dist/src/setup/boxes/add-channels.d.ts +1 -1
- package/dist/src/setup/boxes/add-channels.js +1 -1
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/boxes/resolve-target.d.ts +2 -2
- package/dist/src/setup/boxes/scaffold.d.ts +4 -4
- package/dist/src/setup/boxes/scaffold.js +1 -1
- package/dist/src/setup/channel-add-conflicts.js +1 -1
- package/dist/src/setup/cli/rail-log.d.ts +1 -1
- package/dist/src/setup/flows/model.d.ts +3 -5
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/node-engine.d.ts +5 -5
- package/dist/src/setup/node-engine.js +1 -1
- package/dist/src/setup/onboarding.d.ts +2 -2
- package/dist/src/setup/primitives/open-url.d.ts +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +1 -1
- package/dist/src/setup/primitives/pm/run.d.ts +1 -1
- package/dist/src/setup/primitives/pm/types.d.ts +1 -1
- package/dist/src/setup/scaffold/connections/catalog.d.ts +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +2 -2
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.d.ts +5 -5
- package/dist/src/setup/scaffold/create/project.js +3 -3
- package/dist/src/setup/scaffold/create/web-template.d.ts +2 -2
- package/dist/src/setup/scaffold/create/web-template.js +2 -2
- package/dist/src/setup/scaffold/update/package-json.d.ts +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +2 -2
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slackbot.d.ts +1 -1
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/setup/validate-gateway-key.d.ts +1 -1
- package/dist/src/setup/vercel-project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +15 -15
- package/dist/src/shared/code-mode.d.ts +3 -3
- package/dist/src/shared/json-schema.d.ts +1 -1
- package/dist/src/shared/model-endpoint-status.d.ts +2 -2
- package/dist/src/shared/sandbox-backend.d.ts +4 -4
- package/dist/src/shared/sandbox-definition.d.ts +3 -3
- package/dist/src/shared/sandbox-network-policy.d.ts +1 -1
- package/dist/src/shared/sandbox-session.d.ts +2 -2
- package/dist/src/shared/skill-package.d.ts +1 -1
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/tool-definition.d.ts +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +7 -7
- 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.d.ts +7 -7
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +10 -10
- package/docs/agent-config.md +2 -2
- package/docs/channels/custom.mdx +5 -5
- package/docs/channels/discord.mdx +3 -3
- package/docs/channels/eve.mdx +7 -7
- package/docs/channels/linear.mdx +6 -6
- package/docs/channels/overview.mdx +11 -11
- package/docs/channels/slack.mdx +4 -4
- package/docs/channels/teams.mdx +2 -2
- package/docs/channels/telegram.mdx +3 -3
- package/docs/channels/twilio.mdx +1 -1
- package/docs/concepts/context-control.md +5 -5
- package/docs/concepts/default-harness.md +2 -2
- package/docs/concepts/execution-model-and-durability.md +9 -9
- package/docs/concepts/security-model.md +9 -9
- package/docs/concepts/sessions-runs-and-streaming.md +3 -3
- package/docs/connections.mdx +11 -11
- package/docs/evals/judge.mdx +2 -2
- package/docs/evals/overview.mdx +2 -2
- package/docs/evals/reporters.mdx +2 -2
- package/docs/getting-started.mdx +10 -10
- package/docs/guides/auth-and-route-protection.md +6 -6
- package/docs/guides/client/continuations.mdx +3 -3
- package/docs/guides/client/output-schema.mdx +1 -1
- package/docs/guides/client/overview.mdx +5 -5
- package/docs/guides/client/streaming.mdx +1 -1
- package/docs/guides/deployment.md +7 -7
- package/docs/guides/dev-tui.md +2 -2
- package/docs/guides/frontend/nextjs.mdx +13 -13
- package/docs/guides/frontend/nuxt.mdx +7 -7
- package/docs/guides/frontend/overview.mdx +12 -12
- package/docs/guides/frontend/sveltekit.mdx +7 -7
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +6 -6
- package/docs/guides/frontend/use-eve-agent-vue.mdx +6 -6
- package/docs/guides/hooks.md +2 -2
- package/docs/guides/instrumentation.md +12 -12
- package/docs/guides/remote-agents.md +4 -4
- package/docs/guides/session-context.md +4 -4
- package/docs/guides/state.md +1 -1
- package/docs/instructions.mdx +4 -4
- package/docs/introduction.mdx +12 -12
- package/docs/reference/cli.md +5 -5
- package/docs/reference/project-layout.md +4 -4
- package/docs/responsible-use.md +3 -3
- package/docs/sandbox.mdx +8 -8
- package/docs/schedules.mdx +1 -1
- package/docs/skills.mdx +4 -4
- package/docs/subagents.mdx +3 -3
- package/docs/tools/human-in-the-loop.md +10 -10
- package/docs/tools/overview.mdx +10 -10
- package/docs/tutorial/connect-a-warehouse.mdx +3 -3
- package/docs/tutorial/first-agent.mdx +2 -2
- package/docs/tutorial/how-it-runs.mdx +2 -2
- package/docs/tutorial/query-sample-data.mdx +1 -1
- package/docs/tutorial/ship-it.mdx +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1e2e8ef: Standardize the product name as `eve` across documentation, CLI output, diagnostics, generated text, and runtime messages.
|
|
8
|
+
- ea35d0e: Changing a model or configuring its provider in `/model` now returns to the prompt and prints the result there. Cancelling or choosing an external provider still returns to the menu.
|
|
9
|
+
- ea35d0e: The dev TUI now shows `/vc` or `/login` before `/model` when Vercel authentication is blocking model setup.
|
|
10
|
+
- 29e27b8: Run `vercel link` non-interactively when connecting a project via the dev TUI `/model` menu (and `eve link`). The link is already fully specified by the team and project picked in the TUI, so the CLI no longer inherits a TTY and can no longer surface its interactive prompts (such as the agent/MCP setup question), which previously corrupted the TUI.
|
|
11
|
+
|
|
3
12
|
## 0.11.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -10,7 +19,7 @@
|
|
|
10
19
|
|
|
11
20
|
### Patch Changes
|
|
12
21
|
|
|
13
|
-
- e7cdefd: Handle missing sandbox template and session state more gracefully across Vercel, Microsandbox, and Docker backends.
|
|
22
|
+
- e7cdefd: Handle missing sandbox template and session state more gracefully across Vercel, Microsandbox, and Docker backends. eve now treats stale Vercel template references, missing Microsandbox session/template snapshots, and Docker template image races as recoverable provisioning misses so the runtime can rebuild or create a fresh sandbox automatically.
|
|
14
23
|
|
|
15
24
|
## 0.11.0
|
|
16
25
|
|
|
@@ -27,4 +36,4 @@
|
|
|
27
36
|
|
|
28
37
|
### Minor Changes
|
|
29
38
|
|
|
30
|
-
- c2ac540: Initial public release of the
|
|
39
|
+
- c2ac540: Initial public release of the eve framework
|
package/README.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# eve
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
eve is a filesystem-first framework for durable backend agents on Vercel.
|
|
4
4
|
|
|
5
5
|
You author an agent as a directory on disk. The directory is the contract — markdown for the parts a human should read like a spec, TypeScript for the parts that benefit from real types and runtime behavior.
|
|
6
6
|
|
|
7
|
-
The framework is called
|
|
7
|
+
The framework is called eve. The published npm package is `eve`. The CLI binary is `eve`.
|
|
8
8
|
|
|
9
9
|
## Preview Terms and Safeguards
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
eve is currently a preview and subject to the Vercel beta terms; the framework, APIs, documentation, and behavior may change before general availability.
|
|
12
12
|
|
|
13
13
|
As the deployer, it is your responsibility to ensure your agent complies with applicable laws.
|
|
14
14
|
|
|
15
15
|
You are responsible for configuring approval policies, tool restrictions, connection scopes, route/session authorization, sandbox controls, telemetry exports, and other safeguards appropriate for your use case.
|
|
16
16
|
|
|
17
|
-
Before using
|
|
17
|
+
Before using eve with non-public, sensitive, regulated, or production data, review which default tools, custom tools, MCP tools, shell/file/web tools, connected services, subagents, schedules, and external actions are available to the agent.
|
|
18
18
|
|
|
19
19
|
Require human approval or other safeguards for sensitive, irreversible, regulated, financial, healthcare, employment, housing, legal, safety-impacting, user-impacting, or external side-effecting actions.
|
|
20
20
|
|
|
21
|
-
Unless you configure stricter controls,
|
|
21
|
+
Unless you configure stricter controls, eve agents may operate with permissive settings, including tool execution without human approval where approval is omitted and sandbox network egress that is not deny-all. Do not rely on model behavior alone to prevent sensitive or irreversible actions.
|
|
22
22
|
|
|
23
|
-
## What
|
|
23
|
+
## What eve Prioritizes
|
|
24
24
|
|
|
25
25
|
- Markdown-first authoring for instructions and procedures
|
|
26
26
|
- TypeScript where typed runtime behavior matters
|
|
@@ -122,7 +122,7 @@ export default defineAgent({
|
|
|
122
122
|
npx eve@latest init my-agent
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
`eve init` writes a new agent with
|
|
125
|
+
`eve init` writes a new agent with eve's default model. Pass `--channel-web-nextjs` to add the
|
|
126
126
|
Web Chat application. It installs dependencies, initializes Git, and starts the
|
|
127
127
|
development server. Targeting an existing project directory (`eve init .`) adds
|
|
128
128
|
the agent files and missing dependencies instead. It does not create a Vercel
|
|
@@ -138,7 +138,7 @@ CLI commands:
|
|
|
138
138
|
|
|
139
139
|
## Deploying
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
eve is built for Vercel. The runtime is Nitro + Vercel Workflows. Read [`./docs/guides/deployment.md`](./docs/guides/deployment.md) for the deployment path, environment variables, and Vercel-specific configuration.
|
|
142
142
|
|
|
143
143
|
## Read Next
|
|
144
144
|
|
|
@@ -157,9 +157,9 @@ By runtime concern: [Sessions and Streaming](./docs/concepts/sessions-runs-and-s
|
|
|
157
157
|
|
|
158
158
|
## Architecture (Internals)
|
|
159
159
|
|
|
160
|
-
You do not need this section to author an
|
|
160
|
+
You do not need this section to author an eve agent — it documents the public HTTP protocol contracts so eve composes predictably with other systems.
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
eve's internal split is:
|
|
163
163
|
|
|
164
164
|
- the **channel** normalizes inbound transport, applies auth and delivery policy, and owns `continuationToken`
|
|
165
165
|
- the **harness** does one unit of AI work and returns `{ session, next }`
|
package/bin/eve.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export function ensureBuiltCli(
|
|
|
71
71
|
): Promise<string>;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* Runs the compiled
|
|
74
|
+
* Runs the compiled eve CLI, building the workspace package on demand when needed.
|
|
75
75
|
*/
|
|
76
76
|
export function runEveCli(
|
|
77
77
|
argv?: string[],
|
package/bin/eve.js
CHANGED
|
@@ -164,7 +164,7 @@ async function loadVendoredSemver(options, dependencies = {}) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
if (!(await exists(semverPath))) {
|
|
167
|
-
throw new Error(`Building
|
|
167
|
+
throw new Error(`Building eve's vendored dependencies did not produce ${semverPath}.`);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
const module = await importModule(pathToFileURL(semverPath).href);
|
|
@@ -183,7 +183,7 @@ async function assertSupportedNodeVersion(
|
|
|
183
183
|
const semver = await loadVendoredSemver(options, dependencies);
|
|
184
184
|
|
|
185
185
|
if (semver.validRange(requiredRange) === null) {
|
|
186
|
-
throw new Error(`
|
|
186
|
+
throw new Error(`eve declares an invalid Node.js engine range: "${requiredRange}".`);
|
|
187
187
|
}
|
|
188
188
|
if (semver.satisfies(version, requiredRange)) {
|
|
189
189
|
return;
|
|
@@ -191,7 +191,7 @@ async function assertSupportedNodeVersion(
|
|
|
191
191
|
|
|
192
192
|
throw new Error(
|
|
193
193
|
[
|
|
194
|
-
`
|
|
194
|
+
`eve requires Node.js ${requiredRange}.`,
|
|
195
195
|
`You are running ${version}.`,
|
|
196
196
|
"Please install a compatible Node.js version and try again.",
|
|
197
197
|
].join(" "),
|
|
@@ -270,7 +270,7 @@ export async function ensureBuiltCli(overrides = {}, dependencies = {}) {
|
|
|
270
270
|
|
|
271
271
|
if (!packageCanBuildCli) {
|
|
272
272
|
throw new Error(
|
|
273
|
-
`
|
|
273
|
+
`eve package at ${options.packageRoot} does not include the sources required to rebuild the CLI.`,
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -295,7 +295,7 @@ export async function ensureBuiltCli(overrides = {}, dependencies = {}) {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
|
-
* Runs the compiled
|
|
298
|
+
* Runs the compiled eve CLI, building the workspace package on demand when needed.
|
|
299
299
|
*/
|
|
300
300
|
export async function runEveCli(argv = process.argv.slice(2), overrides = {}, dependencies = {}) {
|
|
301
301
|
const options = createBootstrapOptions(overrides);
|
|
@@ -311,7 +311,7 @@ export async function runEveCli(argv = process.argv.slice(2), overrides = {}, de
|
|
|
311
311
|
const cliModule = await importModule(pathToFileURL(cliEntrypointPath).href);
|
|
312
312
|
|
|
313
313
|
if (typeof cliModule.runCli !== "function") {
|
|
314
|
-
throw new Error(`The
|
|
314
|
+
throw new Error(`The eve CLI module at ${cliEntrypointPath} does not export runCli().`);
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
await cliModule.runCli(argv);
|
|
@@ -32,14 +32,14 @@ export interface SendPayload {
|
|
|
32
32
|
readonly message?: string | UserContent;
|
|
33
33
|
readonly inputResponses?: readonly InputResponse[];
|
|
34
34
|
/**
|
|
35
|
-
* Context strings contributed by the channel.
|
|
35
|
+
* Context strings contributed by the channel. eve appends each entry
|
|
36
36
|
* as a `role: "user"` message to `session.history` before the delivery
|
|
37
37
|
* message and persists it across the session.
|
|
38
38
|
*/
|
|
39
39
|
readonly context?: readonly string[];
|
|
40
40
|
/**
|
|
41
41
|
* Run-scoped JSON schema the turn's result must match. Orthogonal to
|
|
42
|
-
* {@link BaseSendOptions.mode}:
|
|
42
|
+
* {@link BaseSendOptions.mode}: eve enforces the schema in either mode; mode
|
|
43
43
|
* only decides the failure behavior. A conversation run parks recoverably and
|
|
44
44
|
* waits for more input; a task run (which cannot wait) finishes as an error.
|
|
45
45
|
*/
|
|
@@ -208,8 +208,8 @@ export declare function DELETE<TState = undefined>(path: string, handler: RouteH
|
|
|
208
208
|
* Declares a WebSocket channel route.
|
|
209
209
|
*
|
|
210
210
|
* The handler runs once per upgrade request and returns lifecycle hooks for
|
|
211
|
-
* that connection. The hooks are
|
|
212
|
-
* can use CrossWS-compatible helpers without
|
|
211
|
+
* that connection. The hooks are eve-owned structural types so channel authors
|
|
212
|
+
* can use CrossWS-compatible helpers without eve exposing CrossWS directly.
|
|
213
213
|
*/
|
|
214
214
|
export declare function WS<TState = undefined>(path: string, handler: WebSocketRouteHandler<TState>): WebSocketRouteDefinition<TState>;
|
|
215
215
|
export declare function isHttpRouteDefinition<TState>(route: RouteDefinition<TState>): route is HttpRouteDefinition<TState>;
|
|
@@ -19,7 +19,7 @@ export interface SessionTurn {
|
|
|
19
19
|
readonly sequence: number;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Lineage metadata for the
|
|
22
|
+
* Lineage metadata for the eve parent execution that delegated this session.
|
|
23
23
|
*
|
|
24
24
|
* `sessionId` and `turn` describe the **immediate** parent that dispatched
|
|
25
25
|
* this child. `rootSessionId` denormalizes the top of the dispatch chain so
|
|
@@ -143,7 +143,7 @@ export interface SessionCallback {
|
|
|
143
143
|
readonly url: string;
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
146
|
-
* Runtime capabilities granted to one
|
|
146
|
+
* Runtime capabilities granted to one eve session.
|
|
147
147
|
*
|
|
148
148
|
* Capabilities describe what the session may do mid-turn: a session-level
|
|
149
149
|
* contract, orthogonal to {@link RunInput.mode} which decides done-vs-park on
|
|
@@ -2,12 +2,12 @@ import { type Server } from "node:http";
|
|
|
2
2
|
import type { WebSocketRouteHandler } from "#channel/routes.js";
|
|
3
3
|
/**
|
|
4
4
|
* Escape hatch for SDKs and frameworks that need a Node HTTP server-shaped
|
|
5
|
-
* upgrade target inside an
|
|
5
|
+
* upgrade target inside an eve `WS()` route.
|
|
6
6
|
*
|
|
7
|
-
* Prefer normal `WS()` lifecycle hooks for
|
|
7
|
+
* Prefer normal `WS()` lifecycle hooks for eve-owned websocket behavior. Use
|
|
8
8
|
* this bridge only when an integration expects to register
|
|
9
9
|
* `httpServer.on("upgrade", ...)` handlers itself. The server is intentionally
|
|
10
|
-
* not listening on a port;
|
|
10
|
+
* not listening on a port; eve forwards only the matched route's raw Node
|
|
11
11
|
* upgrade into it.
|
|
12
12
|
*/
|
|
13
13
|
export interface WebSocketUpgradeServerBridge {
|
|
@@ -663,7 +663,7 @@ var EveAgentStore = class {
|
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
665
|
async send(input) {
|
|
666
|
-
if (this.#status === "streaming" || this.#status === "submitted") throw new Error("
|
|
666
|
+
if (this.#status === "streaming" || this.#status === "submitted") throw new Error("eve session is already processing a turn.");
|
|
667
667
|
const operationId = this.#startOperation();
|
|
668
668
|
const abortController = new AbortController();
|
|
669
669
|
this.#abortController = abortController;
|
|
@@ -733,7 +733,7 @@ var EveAgentStore = class {
|
|
|
733
733
|
this.#publish();
|
|
734
734
|
}
|
|
735
735
|
#createOwnedSession() {
|
|
736
|
-
if (!this.#createSession) throw new Error("Cannot create an owned
|
|
736
|
+
if (!this.#createSession) throw new Error("Cannot create an owned eve session from an external session.");
|
|
737
737
|
return this.#createSession();
|
|
738
738
|
}
|
|
739
739
|
#startOperation() {
|
|
@@ -663,7 +663,7 @@ var EveAgentStore = class {
|
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
665
|
async send(input) {
|
|
666
|
-
if (this.#status === "streaming" || this.#status === "submitted") throw new Error("
|
|
666
|
+
if (this.#status === "streaming" || this.#status === "submitted") throw new Error("eve session is already processing a turn.");
|
|
667
667
|
const operationId = this.#startOperation();
|
|
668
668
|
const abortController = new AbortController();
|
|
669
669
|
this.#abortController = abortController;
|
|
@@ -733,7 +733,7 @@ var EveAgentStore = class {
|
|
|
733
733
|
this.#publish();
|
|
734
734
|
}
|
|
735
735
|
#createOwnedSession() {
|
|
736
|
-
if (!this.#createSession) throw new Error("Cannot create an owned
|
|
736
|
+
if (!this.#createSession) throw new Error("Cannot create an owned eve session from an external session.");
|
|
737
737
|
return this.#createSession();
|
|
738
738
|
}
|
|
739
739
|
#startOperation() {
|
package/dist/src/cli/banner.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const EVE_WORDMARK = "eve";
|
|
2
2
|
export declare const EVE_BETA_TERMS_URL = "https://vercel.com/docs/release-phases/public-beta-agreement";
|
|
3
|
-
export declare const EVE_PREVIEW_NOTICE = "
|
|
3
|
+
export declare const EVE_PREVIEW_NOTICE = "eve is currently a preview and subject to the Vercel beta terms; the framework, APIs, documentation, and behavior may change before general availability.";
|
|
4
4
|
/**
|
|
5
5
|
* The boot banner shared by every CLI command that announces itself: the eve
|
|
6
6
|
* badge plus the installed version, followed by the preview notice. Printed
|
package/dist/src/cli/banner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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{resolveInstalledPackageInfo}from"#internal/application/package.js";var import_picocolors=__toESM(require_picocolors(),1);const EVE_WORDMARK=`eve`,EVE_BETA_TERMS_URL=`https://vercel.com/docs/release-phases/public-beta-agreement`,EVE_PREVIEW_NOTICE=`
|
|
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{resolveInstalledPackageInfo}from"#internal/application/package.js";var import_picocolors=__toESM(require_picocolors(),1);const EVE_WORDMARK=`eve`,EVE_BETA_TERMS_URL=`https://vercel.com/docs/release-phases/public-beta-agreement`,EVE_PREVIEW_NOTICE=`eve is currently a preview and subject to the Vercel beta terms; the framework, APIs, documentation, and behavior may change before general availability.`;function eveCliBanner(){let{version:e}=resolveInstalledPackageInfo();return`${import_picocolors.default.bgBlack(import_picocolors.default.white(` eve `))} ${import_picocolors.default.dim(`v${e}`)}\n${import_picocolors.default.dim(EVE_PREVIEW_NOTICE)}`}export{EVE_BETA_TERMS_URL,EVE_PREVIEW_NOTICE,EVE_WORDMARK,eveCliBanner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_CREATE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{join}from"node:path";import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{discoverAgent}from"#discover/discover-agent.js";const SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH=`channels/eve.ts`;async function inspectExistingChannelRegistrations(a){let o=join(a,`agent`),{manifest:s}=await discoverAgent({agentRoot:o,appRoot:a}),c=new Set,l=new Set;for(let t of s.channels){let r=await compileChannelDefinition(o,t),i=Array.isArray(r)?r:[r];for(let n of i)n.kind===`channel`&&(n.method===`POST`&&n.urlPath===EVE_CREATE_SESSION_ROUTE_PATH&&c.add(t.logicalPath),n.adapterKind===`slack`&&l.add(t.logicalPath))}let u={};return[...c].some(e=>e!==SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH)&&(u.web=`POST ${EVE_CREATE_SESSION_ROUTE_PATH} already registered`),l.size>0&&(u.slack=`Slack channel already registered`),{disabledChannelReasons:u,webRouteOwners:[...c],slackOwners:[...l]}}function assertCanAddSelectedChannels(t,n){if(t.includes(`web`)){let t=n.webRouteOwners.find(e=>e!==SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH);if(t!==void 0)throw Error(`Cannot scaffold Web Chat because agent/${t} already defines POST ${EVE_CREATE_SESSION_ROUTE_PATH}. Web Chat scaffolds the same
|
|
1
|
+
import{EVE_CREATE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{join}from"node:path";import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{discoverAgent}from"#discover/discover-agent.js";const SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH=`channels/eve.ts`;async function inspectExistingChannelRegistrations(a){let o=join(a,`agent`),{manifest:s}=await discoverAgent({agentRoot:o,appRoot:a}),c=new Set,l=new Set;for(let t of s.channels){let r=await compileChannelDefinition(o,t),i=Array.isArray(r)?r:[r];for(let n of i)n.kind===`channel`&&(n.method===`POST`&&n.urlPath===EVE_CREATE_SESSION_ROUTE_PATH&&c.add(t.logicalPath),n.adapterKind===`slack`&&l.add(t.logicalPath))}let u={};return[...c].some(e=>e!==SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH)&&(u.web=`POST ${EVE_CREATE_SESSION_ROUTE_PATH} already registered`),l.size>0&&(u.slack=`Slack channel already registered`),{disabledChannelReasons:u,webRouteOwners:[...c],slackOwners:[...l]}}function assertCanAddSelectedChannels(t,n){if(t.includes(`web`)){let t=n.webRouteOwners.find(e=>e!==SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH);if(t!==void 0)throw Error(`Cannot scaffold Web Chat because agent/${t} already defines POST ${EVE_CREATE_SESSION_ROUTE_PATH}. Web Chat scaffolds the same eve session routes.`)}if(t.includes(`slack`)){let e=n.slackOwners.find(e=>e!==`channels/slack.ts`);if(e!==void 0)throw Error(`Cannot scaffold Slack because agent/${e} already defines a Slack channel. Slack scaffolding would register the channel again.`)}}export{assertCanAddSelectedChannels,inspectExistingChannelRegistrations};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{assertCanAddSelectedChannels,inspectExistingChannelRegistrations}from"./channel-add-conflicts.js";import{NOT_AN_AGENT_MESSAGE}from"./preconditions.js";import{isEveProject,listAuthoredChannels}from"#setup/scaffold/index.js";import{interactiveAsker}from"#setup/ask.js";import{addChannels}from"#setup/boxes/add-channels.js";import{deployProject}from"#setup/boxes/deploy-project.js";import{selectChannels}from"#setup/boxes/select-channels.js";import{detectDeployment,projectResolutionFromDeployment}from"#setup/project-resolution.js";import{createPrompter}from"#setup/prompter.js";import{runInteractive}from"#setup/runner.js";import{createDefaultSetupState,snapshotSetupState}from"#setup/state.js";const KNOWN_CHANNEL_KINDS=[`slack`,`web`];function isChannelKind(e){return KNOWN_CHANNEL_KINDS.includes(e)}function parseChannelKind(e){if(!isChannelKind(e))throw Error(`Unknown channel kind "${e}". Known: ${KNOWN_CHANNEL_KINDS.join(`, `)}.`);return e}const defaultChannelsAddDependencies={detectDeployment};async function runAddChannelsFlow(n,r,i,s){if(r===void 0&&(i.yes||!process.stdin.isTTY||!process.stdout.isTTY))throw Error(`Pass a channel kind: \`eve channels add <${KNOWN_CHANNEL_KINDS.join(`|`)}>\`.`);let c=s.createPrompter?.()??createPrompter();c.intro(`Add channels to your
|
|
1
|
+
import{assertCanAddSelectedChannels,inspectExistingChannelRegistrations}from"./channel-add-conflicts.js";import{NOT_AN_AGENT_MESSAGE}from"./preconditions.js";import{isEveProject,listAuthoredChannels}from"#setup/scaffold/index.js";import{interactiveAsker}from"#setup/ask.js";import{addChannels}from"#setup/boxes/add-channels.js";import{deployProject}from"#setup/boxes/deploy-project.js";import{selectChannels}from"#setup/boxes/select-channels.js";import{detectDeployment,projectResolutionFromDeployment}from"#setup/project-resolution.js";import{createPrompter}from"#setup/prompter.js";import{runInteractive}from"#setup/runner.js";import{createDefaultSetupState,snapshotSetupState}from"#setup/state.js";const KNOWN_CHANNEL_KINDS=[`slack`,`web`];function isChannelKind(e){return KNOWN_CHANNEL_KINDS.includes(e)}function parseChannelKind(e){if(!isChannelKind(e))throw Error(`Unknown channel kind "${e}". Known: ${KNOWN_CHANNEL_KINDS.join(`, `)}.`);return e}const defaultChannelsAddDependencies={detectDeployment};async function runAddChannelsFlow(n,r,i,s){if(r===void 0&&(i.yes||!process.stdin.isTTY||!process.stdout.isTTY))throw Error(`Pass a channel kind: \`eve channels add <${KNOWN_CHANNEL_KINDS.join(`|`)}>\`.`);let c=s.createPrompter?.()??createPrompter();c.intro(`Add channels to your eve agent`),c.log.message(`Checking the current Vercel project...`);let l={...createDefaultSetupState(),project:projectResolutionFromDeployment(await s.detectDeployment(n)),projectPath:{kind:`resolved`,inPlace:!0,path:n}},u;function inspectRegistrations(){return u===void 0&&(c.log.message(`Inspecting existing channel registrations...`),u=inspectExistingChannelRegistrations(n)),u}let d=r===void 0?(await inspectRegistrations()).disabledChannelReasons:void 0,f=await runInteractive([selectChannels({asker:interactiveAsker(c),variant:`channels-add`,presetChannels:r===void 0?void 0:[r],disabledChannelReasons:d,validateSelection:async t=>{!t.includes(`web`)&&!t.includes(`slack`)||assertCanAddSelectedChannels(t,await inspectRegistrations())}}),addChannels({asker:interactiveAsker(c),prompter:c,presetCreateSlackbot:i.yes?!0:void 0,force:i.force,configureVercelServices:!0,ensureLinkedProject:`interactive-vercel-link`,deps:s.addChannelsDeps}),deployProject({prompter:c,ensureLinkedProject:`interactive-vercel-link`,deps:s.deployProjectDeps})],l,{write:e=>c.log.message(e)},{snapshot:snapshotSetupState});f.kind!==`cancelled`&&c.outro(f.state.channels.length===0?`No channels added.`:`Channels added.`)}async function runChannelsAddCommand(e,t,i,a=defaultChannelsAddDependencies){if(!await isEveProject(t)){e.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}try{await runAddChannelsFlow(t,i.kind===void 0?void 0:parseChannelKind(i.kind),i.options,a)}catch(t){e.error(t instanceof Error?t.message:String(t)),process.exitCode=1}}async function runChannelsListCommand(e,t,a){if(!await isEveProject(t)){e.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}let o=await listAuthoredChannels(t);if(a.json){e.log(JSON.stringify({channels:o},null,2));return}if(o.length===0){e.log("No channels defined. Run `eve channels add` to add one.");return}for(let t of o)e.log(t)}export{runChannelsAddCommand,runChannelsListCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal}from"./preconditions.js";import{isEveProject}from"#setup/scaffold/index.js";import{createPrompter}from"#setup/prompter.js";import{runDeployFlow}from"#setup/flows/deploy.js";const defaultDependencies={isEveProject,hasInteractiveTerminal};async function runDeployCommand(t,n,r=defaultDependencies){if(!await r.isEveProject(n)){t.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}let i=r.createPrompter?.()??createPrompter();i.intro(`Deploy your
|
|
1
|
+
import{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal}from"./preconditions.js";import{isEveProject}from"#setup/scaffold/index.js";import{createPrompter}from"#setup/prompter.js";import{runDeployFlow}from"#setup/flows/deploy.js";const defaultDependencies={isEveProject,hasInteractiveTerminal};async function runDeployCommand(t,n,r=defaultDependencies){if(!await r.isEveProject(n)){t.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}let i=r.createPrompter?.()??createPrompter();i.intro(`Deploy your eve agent to Vercel`);try{let e=await runDeployFlow({appRoot:n,prompter:i,interactive:r.hasInteractiveTerminal(),deps:r.flowDeps});if(e.kind===`needs-link`){t.error("This directory is not linked to a Vercel project. Run `eve link` first (or `vercel link --project <name> --yes` in CI), then re-run `eve deploy`."),process.exitCode=1;return}i.outro(e.kind===`cancelled`?`Cancelled.`:e.productionUrl===void 0?`Deployed.`:`Deployed: ${e.productionUrl}`)}catch(e){t.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}export{runDeployCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{inspectApplication}from"#services/inspect-application.js";import{createCliTheme,renderCliBanner,renderCliSection}from"#cli/ui/output.js";function buildApplicationInfoJson(e){let{application:t,compiledState:n,messaging:r}=e;return{appRoot:t.appRoot,agentRoot:n?.project.agentRoot??null,layout:n?.project.layout??null,status:n?.metadata.status??`unavailable`,diagnostics:n?{errors:n.metadata.discovery.summary.errors,warnings:n.metadata.discovery.summary.warnings}:null,model:n?.manifest.config.model.id??null,instructions:n?.manifest.instructions?.logicalPath??null,skills:(n?.manifest.skills??[]).map(e=>e.name),tools:(n?.manifest.tools??[]).map(e=>e.name),channels:(n?.manifest.channels??[]).map(e=>e.kind===`channel`?{name:e.name,kind:e.adapterKind??null,method:e.method,urlPath:e.urlPath}:{name:e.name,kind:`disabled`,method:null,urlPath:null}),messaging:{create:r.createSessionRoutePath,continue:r.continueSessionRoutePattern,stream:r.streamRoutePattern},artifacts:n?{compiledManifest:n.paths.compiledManifestPath,discoveryManifest:n.paths.discoveryManifestPath,diagnostics:n.paths.diagnosticsPath,moduleMap:n.paths.moduleMapPath,metadata:n.paths.compileMetadataPath}:null}}function pluralize(e,t){return`${e} ${t}${e===1?``:`s`}`}function formatDiscoverySummary(e,t){return`${pluralize(e,`error`)}, ${pluralize(t,`warning`)}`}function resolveCompileTone(e){switch(e){case`ready`:return`success`;case`failed`:return`danger`;default:return`warning`}}async function printApplicationInfo(i,a,o={}){let s=await inspectApplication(a);if(o.json){i.log(JSON.stringify(buildApplicationInfoJson(s),null,2));return}let c=s.compiledState,l=s.application,u=createCliTheme(),d=[{label:`App Root`,value:l.appRoot}],f=[{label:`Workflow Build`,value:l.workflowBuildDir},{label:`Output`,value:l.outputDir}],p=[];c===null?d.push({label:`Compile`,tone:`warning`,value:`unavailable`}):(d.push({label:`Agent Root`,value:c.project.agentRoot},{label:`Layout`,value:c.project.layout},{label:`Compile`,tone:resolveCompileTone(c.metadata.status),value:c.metadata.status},{label:`Diagnostics`,tone:c.metadata.discovery.summary.errors>0?`danger`:c.metadata.discovery.summary.warnings>0?`warning`:`success`,value:formatDiscoverySummary(c.metadata.discovery.summary.errors,c.metadata.discovery.summary.warnings)},{label:`Instructions`,value:c.manifest.instructions?.logicalPath??`none`},{label:`Skills`,value:pluralize(c.manifest.skills.length,`skill`)}),f.unshift({label:`Compiled Manifest`,value:c.paths.compiledManifestPath},{label:`Discovery Manifest`,value:c.paths.discoveryManifestPath},{label:`Diagnostics`,value:c.paths.diagnosticsPath},{label:`Module Map`,value:c.paths.moduleMapPath},{label:`Metadata`,value:c.paths.compileMetadataPath}),p.push(c.manifest.instructions===void 0?{label:`Instructions`,value:`No instructions prompt discovered.`}:{label:`Instructions`,value:c.manifest.instructions.logicalPath})),i.log([renderCliBanner(u,{subtitle:`Resolved application paths and the active message contract.`,title:`
|
|
1
|
+
import{inspectApplication}from"#services/inspect-application.js";import{createCliTheme,renderCliBanner,renderCliSection}from"#cli/ui/output.js";function buildApplicationInfoJson(e){let{application:t,compiledState:n,messaging:r}=e;return{appRoot:t.appRoot,agentRoot:n?.project.agentRoot??null,layout:n?.project.layout??null,status:n?.metadata.status??`unavailable`,diagnostics:n?{errors:n.metadata.discovery.summary.errors,warnings:n.metadata.discovery.summary.warnings}:null,model:n?.manifest.config.model.id??null,instructions:n?.manifest.instructions?.logicalPath??null,skills:(n?.manifest.skills??[]).map(e=>e.name),tools:(n?.manifest.tools??[]).map(e=>e.name),channels:(n?.manifest.channels??[]).map(e=>e.kind===`channel`?{name:e.name,kind:e.adapterKind??null,method:e.method,urlPath:e.urlPath}:{name:e.name,kind:`disabled`,method:null,urlPath:null}),messaging:{create:r.createSessionRoutePath,continue:r.continueSessionRoutePattern,stream:r.streamRoutePattern},artifacts:n?{compiledManifest:n.paths.compiledManifestPath,discoveryManifest:n.paths.discoveryManifestPath,diagnostics:n.paths.diagnosticsPath,moduleMap:n.paths.moduleMapPath,metadata:n.paths.compileMetadataPath}:null}}function pluralize(e,t){return`${e} ${t}${e===1?``:`s`}`}function formatDiscoverySummary(e,t){return`${pluralize(e,`error`)}, ${pluralize(t,`warning`)}`}function resolveCompileTone(e){switch(e){case`ready`:return`success`;case`failed`:return`danger`;default:return`warning`}}async function printApplicationInfo(i,a,o={}){let s=await inspectApplication(a);if(o.json){i.log(JSON.stringify(buildApplicationInfoJson(s),null,2));return}let c=s.compiledState,l=s.application,u=createCliTheme(),d=[{label:`App Root`,value:l.appRoot}],f=[{label:`Workflow Build`,value:l.workflowBuildDir},{label:`Output`,value:l.outputDir}],p=[];c===null?d.push({label:`Compile`,tone:`warning`,value:`unavailable`}):(d.push({label:`Agent Root`,value:c.project.agentRoot},{label:`Layout`,value:c.project.layout},{label:`Compile`,tone:resolveCompileTone(c.metadata.status),value:c.metadata.status},{label:`Diagnostics`,tone:c.metadata.discovery.summary.errors>0?`danger`:c.metadata.discovery.summary.warnings>0?`warning`:`success`,value:formatDiscoverySummary(c.metadata.discovery.summary.errors,c.metadata.discovery.summary.warnings)},{label:`Instructions`,value:c.manifest.instructions?.logicalPath??`none`},{label:`Skills`,value:pluralize(c.manifest.skills.length,`skill`)}),f.unshift({label:`Compiled Manifest`,value:c.paths.compiledManifestPath},{label:`Discovery Manifest`,value:c.paths.discoveryManifestPath},{label:`Diagnostics`,value:c.paths.diagnosticsPath},{label:`Module Map`,value:c.paths.moduleMapPath},{label:`Metadata`,value:c.paths.compileMetadataPath}),p.push(c.manifest.instructions===void 0?{label:`Instructions`,value:`No instructions prompt discovered.`}:{label:`Instructions`,value:c.manifest.instructions.logicalPath})),i.log([renderCliBanner(u,{subtitle:`Resolved application paths and the active message contract.`,title:`eve Info`}),``,renderCliSection(u,{rows:d,title:`Application`}),``,renderCliSection(u,{rows:f,title:`Artifacts`}),...c===null?[]:[``,renderCliSection(u,{rows:p,title:`Instructions`})],``,renderCliSection(u,{rows:[{label:`Workflow ID`,value:l.workflowId},{label:`Source Dir`,value:l.workflowSourceDir},{label:`Create`,tone:`info`,value:`POST ${s.messaging.createSessionRoutePath}`},{label:`Continue`,tone:`info`,value:`POST ${s.messaging.continueSessionRoutePattern}`},{label:`Stream`,tone:`info`,value:`GET ${s.messaging.streamRoutePattern}`}],title:`Messaging`})].join(`
|
|
2
2
|
`))}export{buildApplicationInfoJson,printApplicationInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{rmSync}from"node:fs";import{join}from"node:path";import{execSync}from"node:child_process";const GIT_TIMEOUT_MS=5e3;function isGitAvailable(){try{return execSync(`git --version`,{stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function isInsideExistingRepository(e){try{return execSync(`git rev-parse --is-inside-work-tree`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{}try{return execSync(`hg --cwd . root`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function hasConfiguredDefaultBranch(e){try{return execSync(`git config init.defaultBranch`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function tryInitializeGit(n){if(!isGitAvailable()||isInsideExistingRepository(n))return{kind:`skipped`};let r=!1;try{return execSync(`git init`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),r=!0,hasConfiguredDefaultBranch(n)||execSync(`git checkout -b main`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),execSync(`git add -A`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),execSync(`git commit -m "Initial commit from
|
|
1
|
+
import{rmSync}from"node:fs";import{join}from"node:path";import{execSync}from"node:child_process";const GIT_TIMEOUT_MS=5e3;function isGitAvailable(){try{return execSync(`git --version`,{stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function isInsideExistingRepository(e){try{return execSync(`git rev-parse --is-inside-work-tree`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{}try{return execSync(`hg --cwd . root`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function hasConfiguredDefaultBranch(e){try{return execSync(`git config init.defaultBranch`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function tryInitializeGit(n){if(!isGitAvailable()||isInsideExistingRepository(n))return{kind:`skipped`};let r=!1;try{return execSync(`git init`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),r=!0,hasConfiguredDefaultBranch(n)||execSync(`git checkout -b main`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),execSync(`git add -A`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),execSync(`git commit -m "Initial commit from eve"`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),{kind:`initialized`}}catch(t){if(r)try{rmSync(join(n,`.git`),{recursive:!0,force:!0})}catch{}return{kind:`failed`,reason:t instanceof Error?t.message:String(t)}}}export{tryInitializeGit};
|
|
@@ -24,7 +24,7 @@ export interface InitCommandDependencies {
|
|
|
24
24
|
tryInitializeGit: typeof tryInitializeGit;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Creates a new
|
|
27
|
+
* Creates a new eve agent (`target` is a project name), or adds one to an
|
|
28
28
|
* existing project (`target` is a directory), without prompts or external
|
|
29
29
|
* provisioning.
|
|
30
30
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal}from"./preconditions.js";import{isEveProject}from"#setup/scaffold/index.js";import{createPrompter}from"#setup/prompter.js";import{runLinkFlow}from"#setup/flows/link.js";const defaultDependencies={isEveProject,hasInteractiveTerminal};async function runLinkCommand(t,n,r=defaultDependencies){if(!await r.isEveProject(n)){t.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}if(!r.hasInteractiveTerminal()){t.error("`eve link` needs an interactive terminal to pick the team and project. In CI, run `vercel link --project <name> --yes` instead."),process.exitCode=1;return}let i=r.createPrompter?.()??createPrompter();i.intro(`Link your
|
|
1
|
+
import{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal}from"./preconditions.js";import{isEveProject}from"#setup/scaffold/index.js";import{createPrompter}from"#setup/prompter.js";import{runLinkFlow}from"#setup/flows/link.js";const defaultDependencies={isEveProject,hasInteractiveTerminal};async function runLinkCommand(t,n,r=defaultDependencies){if(!await r.isEveProject(n)){t.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}if(!r.hasInteractiveTerminal()){t.error("`eve link` needs an interactive terminal to pick the team and project. In CI, run `vercel link --project <name> --yes` instead."),process.exitCode=1;return}let i=r.createPrompter?.()??createPrompter();i.intro(`Link your eve agent to Vercel`);try{let e=await runLinkFlow({appRoot:n,prompter:i,deps:r.flowDeps});i.outro(e.kind===`cancelled`?`Cancelled.`:`Project linked.`)}catch(e){t.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}export{runLinkCommand};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Refusal shown by agent-scoped commands (`eve link`, `eve deploy`,
|
|
3
|
-
* `eve channels …`) when the working directory holds no
|
|
3
|
+
* `eve channels …`) when the working directory holds no eve agent.
|
|
4
4
|
*/
|
|
5
|
-
export declare const NOT_AN_AGENT_MESSAGE = "No
|
|
5
|
+
export declare const NOT_AN_AGENT_MESSAGE = "No eve agent in this directory. Run `eve init <name>`, then run this command from inside the new project.";
|
|
6
6
|
/** True when stdin and stdout are both TTYs — the default interactivity gate. */
|
|
7
7
|
export declare function hasInteractiveTerminal(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const NOT_AN_AGENT_MESSAGE="No
|
|
1
|
+
const NOT_AN_AGENT_MESSAGE="No eve agent in this directory. Run `eve init <name>`, then run this command from inside the new project.";function hasInteractiveTerminal(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}export{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const DEVELOPMENT_ENV_FILE_NAMES: readonly [".env.development.local", ".env.local", ".env.development", ".env"];
|
|
7
7
|
/**
|
|
8
|
-
* Returns the local development environment files
|
|
8
|
+
* Returns the local development environment files eve loads from an
|
|
9
9
|
* application root, ordered from highest to lowest precedence.
|
|
10
10
|
*/
|
|
11
11
|
export declare function getDevelopmentEnvironmentFilePaths(appRoot: string): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pickAgentHeaderTip}from"./agent-header.js";import{formatPromptCommandHelp,parsePromptCommand}from"./prompt-commands.js";import{failureKey,formatFailureDetail,formatFailureMessage,formatGatewayAuthFailureNotice,isAbortLikeError,isGatewayAuthFailure,isInterruptedError}from"./errors.js";import{parseLogDisplayMode}from"./log-display-mode.js";import{BOOT_DETECTIONS,CLI_MISSING_SETUP_ISSUE,LOGIN_SETUP_ISSUE,detectSetupIssues,formatSetupIssuesLine}from"./setup-issues.js";import{TerminalRenderer}from"./terminal-renderer.js";import{createVercelStatusTracker}from"./vercel-status.js";import{toErrorMessage}from"#shared/errors.js";import{isCurrentTurnBoundaryEvent}from"#client/index.js";import{subscribeDevelopmentSandboxPrewarmLogs}from"#execution/sandbox/development-prewarm.js";import{createDevelopmentRuntimeArtifactSessionRefresher}from"#services/dev-client.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";function authIssueForStatus(e){if(e===`logged-out`)return LOGIN_SETUP_ISSUE;if(e===`cli-missing`)return CLI_MISSING_SETUP_ISSUE}var EveTUIRunner=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v=!1;#y=new AbortController;#b=!1;#x=[];#S;#C;#w=pickAgentHeaderTip();#T;#E=new Map;#D=new Map;#O=new Map;#k=new Map;#A=new Set;#j=!1;#M;constructor(e){if(this.#e=e.session,e.client!==void 0&&(this.#t=e.client),this.#n=createRenderer(e),this.#r=e.name??`Eve`,this.#i=e.tools??`full`,this.#a=e.reasoning??`full`,this.#o=e.subagents??`full`,this.#s=e.connectionAuth??`full`,this.#c=e.assistantResponseStats??`tokensPerSecond`,this.#l=e.contextSize,this.#u=e.formatTransportError??toErrorMessage,e.initialInput!==void 0&&(this.#m=e.initialInput),e.appRoot!==void 0){this.#p=e.appRoot;let t={appRoot:e.appRoot,onChange:e=>this.#n.setVercelStatus?.(e)};e.detectProjectIdentity!==void 0&&(t.detectIdentity=e.detectProjectIdentity),this.#C=createVercelStatusTracker(t)}e.promptCommandHandler!==void 0&&(this.#h=e.promptCommandHandler),this.#g=e.bootDetections??BOOT_DETECTIONS,this.#_=e.getVercelAuthStatus??getVercelAuthStatus,e.serverUrl!==void 0&&(this.#f=e.serverUrl,this.#d=createDevelopmentRuntimeArtifactSessionRefresher({serverUrl:e.serverUrl}))}async#N(){let e=this.#f;if(e===void 0){await this.#R(void 0);return}let t;try{t=await this.#t?.info()}catch{t=void 0}this.#T=t;let n={name:this.#r,serverUrl:e};t!==void 0&&(n.info=t),this.#p!==void 0&&(n.tip=this.#w),this.#n.renderAgentHeader?.(n),await this.#R(t)}async run(){try{await this.#P()}finally{this.#v=!0,this.#y.abort(),this.#M?.(),this.#M=void 0,this.#n.shutdown?.(),this.#C?.dispose()}}async#P(){let e=this.#r,r,i,a=!1,o=!1,s=this.#m;for(await this.#N(),this.#H(),this.#C?.refreshIdentity();;){if(!o){if(r==null){if(!this.#n.readPrompt){if(a)return;throw Error(`No prompt was provided and the renderer does not support prompt input.`)}let t={title:e};s!==void 0&&(t.initialDraft=s,s=void 0);try{r=await this.#I(t)}catch(e){if(isInterruptedError(e))return;throw e}if(r==null)return}let c=parsePromptCommand(r);if(c?.type===`exit`)return;if(c?.type===`new`){this.#F(),i=void 0,o=!1,r=void 0,this.#n.reset?.();continue}if(c?.type===`help`){this.#U(formatPromptCommandHelp()),i=void 0,o=!1,r=void 0;continue}if(c?.type===`loglevel`){this.#U(this.#W(c.argument)),i=void 0,o=!1,r=void 0;continue}if(c?.type===`extension`){try{let t=this.#h===void 0?{message:`/${c.name} is not available in this session.`}:await this.#h.handle(c,{renderer:this.#n,title:e});t?.message!==void 0&&this.#U(t.message),t?.vercelEffect!==void 0&&(this.#C?.applyEffect(t.vercelEffect),this.#b=!0,this.#V())}catch(e){if(isInterruptedError(e))return;throw e}i=void 0,r=void 0,o=!1;continue}a=!0}let c=await this.#L({prompt:o?void 0:r,inputResponses:i});try{await this.#n.renderStream(c,{title:e,submittedPrompt:r,continueSession:!!this.#n.readPrompt,tools:this.#i,reasoning:this.#a,subagents:this.#o,connectionAuth:this.#s,assistantResponseStats:this.#c,contextSize:this.#l});let t=c.turnState?.pendingApprovals??[],n=c.turnState?.pendingQuestions??[];if(t.length>0||n.length>0){let a=[];if(t.length>0){if(!this.#n.readToolApproval)throw Error(`Tool approval was requested, but the renderer does not support tool approval input.`);for(let n of t){let t=await this.#n.readToolApproval(n,{title:e});a.push({requestId:n.approvalId,optionId:t.approved?`approve`:`deny`}),this.#E.delete(n.approvalId)}}if(n.length>0){if(!this.#n.readInputQuestion)throw Error(`An interactive question was requested, but the renderer does not support input questions.`);for(let t of n){let n=toAgentTUIInputQuestion(t),r=await this.#n.readInputQuestion(n,{title:e});if(r===void 0)continue;let i={requestId:t.requestId};r.optionId!==void 0&&(i.optionId=r.optionId),r.text!==void 0&&(i.text=r.text),a.push(i),this.#E.delete(t.requestId)}}o=!0,i=a,r=void 0;continue}c.turnState&&c.turnState.boundaryEvent===void 0&&(this.#j=!0)}catch(e){if(isInterruptedError(e))return;throw e}o=!1,i=void 0,r=void 0,this.#j&&(this.#j=!1,this.#F(),this.#n.renderNotice?.(`Session ended — started a new session. Earlier context was cleared.`))}}#F(){for(let e of this.#O.values())e.abort();this.#O.clear(),this.#D.clear(),this.#E.clear(),this.#k.clear(),this.#A.clear(),this.#t&&(this.#e=this.#t.session()),this.#d?.clear()}async#I(e){if(!this.#n.readPrompt)return;let t=this.#n.readPrompt(e),n=this.#t,r=this.#d;if(n===void 0||r===void 0)return await t;let i=!1,a=!1,o,refresh=async()=>{if(!(i||a)){a=!0;try{this.#e=await r.refreshIdle({createSession:()=>n.session(),onRuntimeArtifactsChanged:()=>this.#G(),session:this.#e})}finally{a=!1}}},startRefresh=()=>{if(i||a)return;let e=refresh().finally(()=>{o===e&&(o=void 0)});o=e};startRefresh();let s=setInterval(()=>{startRefresh()},500);s.unref?.();try{return await t}finally{i=!0,clearInterval(s),await o}}async#L(e){let t=new AbortController,n={signal:t.signal};e.prompt!==void 0&&(n.message=e.prompt),e.inputResponses!==void 0&&e.inputResponses.length>0&&(n.inputResponses=e.inputResponses);let r;try{let e=this.#t;e!==void 0&&this.#d!==void 0&&(this.#e=await this.#d.refresh({createSession:()=>e.session(),inputResponses:n.inputResponses,message:n.message,onRuntimeArtifactsChanged:()=>this.#G(),session:this.#e})),n.message!==void 0&&(n.inputResponses?.length??0)===0&&this.#n.flushDelayedDevBuildErrors?.(),r=await this.#e.send(n)}catch(e){if(isInterruptedError(e))throw e;return this.#j=!0,{events:errorOnlyTUIStream({errorText:this.#u(e)}),turnState:createTurnState()}}let i=createTurnState();return{abort:()=>t.abort(),events:eveEventsToTUIStream({events:r,pendingInputRequests:this.#E,subagentRuns:this.#D,turnState:i,onSubagentCalled:e=>this.#Y(e),onSubagentCompleted:e=>this.#Z(e),onConnectionAuthRequired:e=>this.#K(e),onConnectionAuthCompleted:e=>this.#q(e),onTerminalFailure:()=>{this.#j=!0},failureOverride:this.#p===void 0?void 0:e=>isGatewayAuthFailure(e)?formatGatewayAuthFailureNotice(e):void 0}),turnState:i}}async#R(e){if(this.#p===void 0||this.#n.renderSetupWarning===void 0)return;let t={appRoot:this.#p,env:process.env};e!==void 0&&(t.info=e),this.#x=await detectSetupIssues(t,this.#g),this.#z(),this.#B()}#z(){let e=[...this.#x,...this.#S?[this.#S]:[]];e.length>0?this.#n.renderSetupWarning?.(formatSetupIssuesLine(e)):this.#n.clearSetupWarning?.()}async#B(){let e=this.#p;if(e===void 0)return;let t;try{t=await this.#_(e,{signal:this.#y.signal})}catch{return}this.#v||this.#b||(this.#S=authIssueForStatus(t),this.#z())}async#V(){let e=this.#p;if(e===void 0||this.#n.renderSetupWarning===void 0)return;let t={appRoot:e,env:process.env};this.#T!==void 0&&(t.info=this.#T);try{this.#x=await detectSetupIssues(t,this.#g);let n=await this.#_(e,{signal:this.#y.signal});this.#S=authIssueForStatus(n)}catch{return}this.#v||this.#z()}#H(){this.#p===void 0||this.#n.renderSandboxLog===void 0||this.#M===void 0&&(this.#M=subscribeDevelopmentSandboxPrewarmLogs({appRoot:this.#p,log:e=>this.#n.renderSandboxLog?.(e)}))}#U(e){if(this.#n.renderCommandResult!==void 0){this.#n.renderCommandResult(e);return}this.#n.renderNotice?.(e)}#W(e){let t=this.#n;if(t.logDisplayMode===void 0||t.setLogDisplayMode===void 0)return`/loglevel is not available in this session.`;if(e===``)return`Logs: ${t.logDisplayMode()}. Use /loglevel all|stderr|sandbox|none — logs stay buffered, so switching also hides or restores past lines.`;let n=parseLogDisplayMode(e);if(n===void 0)return`Unknown log level "${e}". Use all, stderr, sandbox, or none.`;if(n===t.logDisplayMode())return`Logs already set to ${n}.`;switch(t.setLogDisplayMode(n),n){case`none`:return`Logs hidden. Output stays buffered — /loglevel all restores it.`;case`stderr`:return`Showing stderr logs only.`;case`sandbox`:return`Showing sandbox logs only.`;case`all`:return`Showing all logs.`}}async#G(){let e=this.#T,t;try{t=await this.#t?.info()}catch{t=void 0}if(t!==void 0&&(this.#T=t,this.#f!==void 0)){let e={info:t,name:this.#r,serverUrl:this.#f};this.#p!==void 0&&(e.tip=this.#w),this.#n.renderAgentHeader?.(e)}(!this.#n.renderAgentHeader||t===void 0)&&this.#n.renderNotice?.(formatAgentUpdateNotice(e,t))}#K(e){let t={name:e.data.name,description:e.data.description,state:`required`};e.data.authorization!==void 0&&(t.challenge=e.data.authorization),e.data.webhookUrl!==void 0&&(t.webhookUrl=e.data.webhookUrl),this.#k.set(e.data.name,t),this.#J(t)}#q(e){let t=this.#k.get(e.data.name)??{name:e.data.name,description:``,state:e.data.outcome};t.state=e.data.outcome,e.data.reason!==void 0&&(t.reason=e.data.reason),this.#k.set(e.data.name,t),this.#A.delete(e.data.name),this.#J(t),this.#n.setConnectionAuthPendingCount?.(this.#A.size)}#J(e){let t={name:e.name,description:e.description,state:e.state};e.challenge!==void 0&&(t.challenge=e.challenge),e.reason!==void 0&&(t.reason=e.reason),this.#n.upsertConnectionAuth?.(t)}#Y(e){let t=e.data.callId;if(this.#O.has(t))return;let n=this.#t;if(!n)return;let r=new AbortController;this.#O.set(t,r),(async()=>{try{let i=n.session({sessionId:e.data.childSessionId,streamIndex:0}).stream({signal:r.signal});for await(let e of i)if(r.signal.aborted||(this.#Q(t,e),isCurrentTurnBoundaryEvent(e)))break}catch(e){if(!isAbortLikeError(e)){let n=toErrorMessage(e),r=this.#D.get(t);if(r){let{key:e,step:i}=openCurrentSubagentSection(r);i.message=i.message?`${i.message}\n\nstream error: ${n}`:`stream error: ${n}`,i.finalized=!0,r.currentSectionKey=null,this.#n.upsertSubagentStep?.({callId:t,subagentName:r.name,sectionKey:e,reasoning:i.reasoning,message:i.message,finalized:!0})}}}finally{this.#O.delete(t)}})()}#X(e,t,n){let r=t.tools.get(n.childCallId),i=r??{toolName:n.toolName,input:n.input,status:n.status};if(r){let e={"approval-requested":0,executing:1,done:2,failed:2};e[n.status]>e[r.status]&&(r.status=n.status),r.input=n.input}else t.tools.set(n.childCallId,i);this.#n.markChildToolCallId?.(n.childCallId),this.#n.upsertSubagentTool?.({callId:e,subagentName:t.name,childCallId:n.childCallId,toolName:i.toolName,input:i.input,status:i.status})}#Z(e){let t=this.#D.get(e);if(t){for(let[n,r]of t.steps)r.finalized||(r.finalized=!0,this.#n.upsertSubagentStep?.({callId:e,subagentName:t.name,sectionKey:n,reasoning:r.reasoning,message:r.message,finalized:!0}));t.currentSectionKey=null}}#Q(e,t){let n=this.#D.get(e);if(!n)return;let r=this.#n,emit=(t,i)=>{r.upsertSubagentStep?.({callId:e,subagentName:n.name,sectionKey:t,reasoning:i.reasoning,message:i.message,finalized:i.finalized})},finalizeCurrent=()=>{if(n.currentSectionKey===null)return;let e=n.steps.get(n.currentSectionKey);e&&(e.finalized=!0,emit(n.currentSectionKey,e)),n.currentSectionKey=null};switch(t.type){case`reasoning.appended`:{let{key:e,step:r}=openCurrentSubagentSection(n);r.reasoning+=t.data.reasoningDelta,emit(e,r);break}case`reasoning.completed`:break;case`message.appended`:{let{key:e,step:r}=openCurrentSubagentSection(n);r.message+=t.data.messageDelta,emit(e,r);break}case`message.completed`:{let{key:e,step:r}=openCurrentSubagentSection(n);t.data.message!==null&&r.message.length===0&&(r.message=t.data.message),r.finalized=!0,emit(e,r),n.currentSectionKey=null;break}case`step.completed`:finalizeCurrent();break;case`actions.requested`:finalizeCurrent();for(let r of t.data.actions)r.kind===`tool-call`&&this.#X(e,n,{childCallId:r.callId,toolName:r.toolName,input:r.input,status:`executing`});break;case`input.requested`:finalizeCurrent();for(let r of t.data.requests)r.action.kind===`tool-call`&&this.#X(e,n,{childCallId:r.action.callId,toolName:r.action.toolName,input:r.action.input,status:`approval-requested`});break;case`action.result`:{let i=t.data.result;if(i.kind!==`tool-result`)break;let a=n.tools.get(i.callId);if(!a)break;t.data.status===`failed`?(a.status=`failed`,a.errorText=formatActionResultError(t)):(a.status=`done`,a.output=i.output);let o={callId:e,subagentName:n.name,childCallId:i.callId,toolName:a.toolName,input:a.input,status:a.status};a.output!==void 0&&(o.output=a.output),a.errorText!==void 0&&(o.errorText=a.errorText),r.upsertSubagentTool?.(o);break}default:break}}};function createRenderer(e){return e.renderer?e.renderer:new TerminalRenderer({tools:e.tools,reasoning:e.reasoning,subagents:e.subagents,connectionAuth:e.connectionAuth,assistantResponseStats:e.assistantResponseStats,contextSize:e.contextSize,logs:e.logs,input:e.userInput,output:e.screen})}function formatAgentUpdateNotice(e,t){let n=e?.agent.model.id,r=t?.agent.model.id;return n!==void 0&&r!==void 0&&n!==r?`Agent updated: Model ${n} -> ${r}`:`Agent updated.`}async function*eveEventsToTUIStream(e){let{events:t,pendingInputRequests:n,subagentRuns:r,turnState:i,onSubagentCalled:a,onSubagentCompleted:o,onConnectionAuthRequired:s,onConnectionAuthCompleted:c,onTerminalFailure:l,failureOverride:u}=e,d=new Map,f=new Map,p=0,m=new Set,h=new Set,g=new Set,_=new Set,v=!1,y=!1,b;for await(let e of t)if(!(y&&isPostTurnVisibleEvent(e)))switch(e.type){case`session.started`:case`turn.started`:case`message.received`:break;case`step.started`:p+=1,yield{type:`step-start`};break;case`step.completed`:{let t=e;b=t.data.usage,yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p),yield{type:`step-finish`,usage:t.data.usage};break}case`message.appended`:{let t=e,n=textPartId(t.data.turnId,t.data.stepIndex),r=partStateFor(d,n),i=t.data.messageSoFar;if(r.completed){if(r.text.startsWith(i)||p<=r.completedEpoch)break;r.generation+=1,r.text=``,r.completed=!1}if(!i.startsWith(r.text)||i.length<=r.text.length)break;let a=i.slice(r.text.length);r.text=i,yield{type:`assistant-delta`,id:partGenerationId(n,r.generation),delta:a};break}case`message.completed`:{let t=textPartId(e.data.turnId,e.data.stepIndex),n=partStateFor(d,t),r=e.data.message;if(n.completed){if(r===null||r===n.text||p<=n.completedEpoch)break;n.generation+=1,n.text=r,n.completedEpoch=p,yield{type:`assistant-complete`,id:partGenerationId(t,n.generation),text:r};break}let i=partGenerationId(t,n.generation);if(r!==null){if(n.text.length===0)n.text=r,n.completed=!0,n.completedEpoch=p,yield{type:`assistant-complete`,id:i,text:r};else if(r.startsWith(n.text)){let e=r.slice(n.text.length);e.length>0&&(yield{type:`assistant-delta`,id:i,delta:e}),n.text=r,n.completed=!0,n.completedEpoch=p,yield{type:`assistant-complete`,id:i}}}else n.text.length>0&&(n.completed=!0,n.completedEpoch=p,yield{type:`assistant-complete`,id:i});break}case`reasoning.appended`:{let t=e,n=reasoningPartId(t.data.turnId,t.data.stepIndex),r=partStateFor(f,n),i=t.data.reasoningSoFar;if(r.completed){if(r.text.startsWith(i)||p<=r.completedEpoch)break;r.generation+=1,r.text=``,r.completed=!1}if(!i.startsWith(r.text)||i.length<=r.text.length)break;let a=i.slice(r.text.length);r.text=i,yield{type:`reasoning-delta`,id:partGenerationId(n,r.generation),delta:a};break}case`reasoning.completed`:{let t=reasoningPartId(e.data.turnId,e.data.stepIndex),n=partStateFor(f,t),r=e.data.reasoning;if(n.completed){if(r.length===0||r===n.text||n.text.startsWith(r)||p<=n.completedEpoch)break;n.generation+=1,n.text=r,n.completedEpoch=p;let e=partGenerationId(t,n.generation);yield{type:`reasoning-delta`,id:e,delta:r},yield{type:`reasoning-complete`,id:e};break}let i=partGenerationId(t,n.generation);if(n.text.length===0&&r.length>0)n.text=r,yield{type:`reasoning-delta`,id:i,delta:r};else if(r.length>0&&!r.startsWith(n.text))break;n.completed=!0,n.completedEpoch=p,yield{type:`reasoning-complete`,id:i};break}case`actions.requested`:{let t=e.data,n=t.actions.filter(e=>e.kind===`tool-call`);if(n.length===0)break;let r=toolBatchKey(`actions.requested`,t.turnId,t.stepIndex,n);if(g.has(r)){for(let e of n)m.has(e.callId)||h.add(e.callId);break}g.add(r);for(let e of n)m.has(e.callId)||(m.add(e.callId),yield{type:`tool-call`,toolCallId:e.callId,toolName:e.toolName,input:e.input});break}case`input.requested`:{let t=e.data,r=t.requests.filter(e=>e.action.kind===`tool-call`);if(r.length===0)break;let a=inputRequestBatchKey(t.turnId,t.stepIndex,r);if(g.has(a)){for(let e of r)m.has(e.action.callId)||h.add(e.action.callId);break}g.add(a);for(let e of r){let t=e.action.callId;if(m.has(t)||(m.add(t),yield{type:`tool-call`,toolCallId:t,toolName:e.action.toolName,input:e.action.input}),n.set(e.requestId,e),isQuestionRequest(e)){upsertPendingQuestion(i,e);continue}upsertPendingApproval(i,e),yield{type:`tool-approval-request`,approvalId:e.requestId,toolCallId:t}}break}case`action.result`:{let t=e;if(t.data.result.kind!==`tool-result`)break;let n=t.data.result.callId;if(h.has(n)||!m.has(n))break;t.data.status===`failed`?yield{type:`tool-error`,toolCallId:n,errorText:formatActionResultError(t)}:yield{type:`tool-result`,toolCallId:n,output:t.data.result.output};break}case`step.failed`:case`turn.failed`:{let t=toFailureEvent(e,_,u);t&&(yield t);break}case`session.failed`:{i.sawSessionFailure=!0,l?.(e);let t=toFailureEvent(e,_,u);t&&(yield t),i.boundaryEvent=e.type,yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p),yield{type:`finish`,usage:b},v=!0;return}case`session.waiting`:case`session.completed`:i.boundaryEvent=e.type,yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p),yield{type:`finish`,usage:b},v=!0;return;case`turn.completed`:y=!0,yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p);break;case`subagent.called`:{let t=e;if(!r.has(t.data.callId))r.set(t.data.callId,{name:t.data.name,steps:new Map,currentSectionKey:null,nextSectionKey:0,tools:new Map});else{let e=r.get(t.data.callId);e&&(e.name=t.data.name)}a?.(t);break}case`subagent.started`:case`subagent.event`:break;case`subagent.completed`:o?.(e.data.callId);break;case`authorization.required`:s?.(e);break;case`authorization.completed`:c?.(e);break;default:break}v||(yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p),yield{type:`finish`,usage:b})}async function*errorOnlyTUIStream(e){yield{type:`error`,errorText:e.errorText},yield{type:`finish`}}function createTurnState(){return{pendingApprovals:[],pendingQuestions:[],sawSessionFailure:!1}}function upsertPendingApproval(e,t){let n=toAgentTUIToolApprovalRequest(t),r=e.pendingApprovals.findIndex(e=>e.approvalId===n.approvalId);r===-1?e.pendingApprovals.push(n):e.pendingApprovals[r]=n}function toAgentTUIToolApprovalRequest(e){return{approvalId:e.requestId,toolCallId:e.action.callId,toolName:e.action.toolName,input:e.action.input}}function upsertPendingQuestion(e,t){let n=e.pendingQuestions.findIndex(e=>e.requestId===t.requestId);n===-1?e.pendingQuestions.push(t):e.pendingQuestions[n]=t}function textPartId(e,t){return`text:${e}:${t}`}function reasoningPartId(e,t){return`reasoning:${e}:${t}`}function partStateFor(e,t){let n=e.get(t);return n===void 0&&(n={generation:0,text:``,completed:!1,completedEpoch:0},e.set(t,n)),n}function partGenerationId(e,t){return t===0?e:`${e}#${t}`}function*closeOpenParts(e,t,n){for(let[r,i]of e)i.completed||i.text.length===0||(i.completed=!0,i.completedEpoch=n,yield{type:t,id:partGenerationId(r,i.generation)})}function isPostTurnVisibleEvent(e){switch(e.type){case`actions.requested`:case`authorization.completed`:case`authorization.required`:case`input.requested`:case`message.appended`:case`message.completed`:case`reasoning.appended`:case`reasoning.completed`:case`result.completed`:case`step.completed`:case`step.failed`:case`step.started`:case`subagent.called`:case`subagent.completed`:case`subagent.event`:case`subagent.started`:case`turn.completed`:case`turn.failed`:return!0;default:return!1}}function toolBatchKey(e,t,n,r){return`${e}:${t}:${String(n)}:${stableStringify(r.map(e=>({input:e.input,toolName:e.toolName})))}`}function inputRequestBatchKey(e,t,n){return toolBatchKey(`input.requested`,e,t,n.map(e=>({input:e.action.input,toolName:e.action.toolName})))}function stableStringify(e){return JSON.stringify(toStableJson(e))??`undefined`}function toStableJson(e,t=new WeakSet){if(typeof e!=`object`||!e)return e;if(t.has(e))return`[Circular]`;if(t.add(e),Array.isArray(e))return e.map(e=>toStableJson(e,t));let n=e,r={};for(let e of Object.keys(n).sort())r[e]=toStableJson(n[e],t);return r}function formatActionResultError(e){if(e.data.error?.message)return e.data.error.message;let t=e.data.result.output;if(typeof t==`string`)return t;try{return JSON.stringify(t)}catch{return`Tool execution failed.`}}function toFailureEvent(e,t,n){let o=failureKey(e);if(t.has(o))return;t.add(o);let s=n?.(e),c={type:`error`,errorText:s??formatFailureMessage(e)};if(s!==void 0)return c;let l=formatFailureDetail(e);return l!==void 0&&(c.detail=l),c}function isQuestionRequest(e){return e.display===`select`||e.display===`text`?!0:e.display===`confirmation`?!1:e.options!==void 0&&e.options.length>0}function toAgentTUIInputQuestion(e){let t=e.display===`text`?`text`:e.display===`select`||e.options!==void 0&&e.options.length>0?`select`:`text`,n={requestId:e.requestId,prompt:e.prompt,display:t};return e.options!==void 0&&(n.options=e.options.map(e=>{let t={id:e.id,label:e.label};return e.description!==void 0&&(t.description=e.description),e.style!==void 0&&(t.style=e.style),t})),e.allowFreeform!==void 0&&(n.allowFreeform=e.allowFreeform),n}function openCurrentSubagentSection(e){e.currentSectionKey===null&&(e.currentSectionKey=e.nextSectionKey++,e.steps.set(e.currentSectionKey,{reasoning:``,message:``,finalized:!1}));let t=e.steps.get(e.currentSectionKey);if(!t)throw Error(`invariant: subagent section state missing for current key`);return{key:e.currentSectionKey,step:t}}export{EveTUIRunner,parsePromptCommand};
|
|
1
|
+
import{pickAgentHeaderTip}from"./agent-header.js";import{formatPromptCommandHelp,parsePromptCommand}from"./prompt-commands.js";import{failureKey,formatFailureDetail,formatFailureMessage,formatGatewayAuthFailureNotice,isAbortLikeError,isGatewayAuthFailure,isInterruptedError}from"./errors.js";import{parseLogDisplayMode}from"./log-display-mode.js";import{BOOT_DETECTIONS,CLI_MISSING_SETUP_ISSUE,LOGIN_SETUP_ISSUE,detectSetupIssues,formatSetupIssuesLine,orderedSetupIssues}from"./setup-issues.js";import{TerminalRenderer}from"./terminal-renderer.js";import{createVercelStatusTracker}from"./vercel-status.js";import{toErrorMessage}from"#shared/errors.js";import{isCurrentTurnBoundaryEvent}from"#client/index.js";import{subscribeDevelopmentSandboxPrewarmLogs}from"#execution/sandbox/development-prewarm.js";import{createDevelopmentRuntimeArtifactSessionRefresher}from"#services/dev-client.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";function authIssueForStatus(e){if(e===`logged-out`)return LOGIN_SETUP_ISSUE;if(e===`cli-missing`)return CLI_MISSING_SETUP_ISSUE}var EveTUIRunner=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v=!1;#y=new AbortController;#b=!1;#x=[];#S;#C;#w=pickAgentHeaderTip();#T;#E=new Map;#D=new Map;#O=new Map;#k=new Map;#A=new Set;#j=!1;#M;constructor(e){if(this.#e=e.session,e.client!==void 0&&(this.#t=e.client),this.#n=createRenderer(e),this.#r=e.name??`eve`,this.#i=e.tools??`full`,this.#a=e.reasoning??`full`,this.#o=e.subagents??`full`,this.#s=e.connectionAuth??`full`,this.#c=e.assistantResponseStats??`tokensPerSecond`,this.#l=e.contextSize,this.#u=e.formatTransportError??toErrorMessage,e.initialInput!==void 0&&(this.#m=e.initialInput),e.appRoot!==void 0){this.#p=e.appRoot;let t={appRoot:e.appRoot,onChange:e=>this.#n.setVercelStatus?.(e)};e.detectProjectIdentity!==void 0&&(t.detectIdentity=e.detectProjectIdentity),this.#C=createVercelStatusTracker(t)}e.promptCommandHandler!==void 0&&(this.#h=e.promptCommandHandler),this.#g=e.bootDetections??BOOT_DETECTIONS,this.#_=e.getVercelAuthStatus??getVercelAuthStatus,e.serverUrl!==void 0&&(this.#f=e.serverUrl,this.#d=createDevelopmentRuntimeArtifactSessionRefresher({serverUrl:e.serverUrl}))}async#N(){let e=this.#f;if(e===void 0){await this.#R(void 0);return}let t;try{t=await this.#t?.info()}catch{t=void 0}this.#T=t;let n={name:this.#r,serverUrl:e};t!==void 0&&(n.info=t),this.#p!==void 0&&(n.tip=this.#w),this.#n.renderAgentHeader?.(n),await this.#R(t)}async run(){try{await this.#P()}finally{this.#v=!0,this.#y.abort(),this.#M?.(),this.#M=void 0,this.#n.shutdown?.(),this.#C?.dispose()}}async#P(){let e=this.#r,r,i,a=!1,o=!1,s=this.#m;for(await this.#N(),this.#H(),this.#C?.refreshIdentity();;){if(!o){if(r==null){if(!this.#n.readPrompt){if(a)return;throw Error(`No prompt was provided and the renderer does not support prompt input.`)}let t={title:e};s!==void 0&&(t.initialDraft=s,s=void 0);try{r=await this.#I(t)}catch(e){if(isInterruptedError(e))return;throw e}if(r==null)return}let c=parsePromptCommand(r);if(c?.type===`exit`)return;if(c?.type===`new`){this.#F(),i=void 0,o=!1,r=void 0,this.#n.reset?.();continue}if(c?.type===`help`){this.#U(formatPromptCommandHelp()),i=void 0,o=!1,r=void 0;continue}if(c?.type===`loglevel`){this.#U(this.#W(c.argument)),i=void 0,o=!1,r=void 0;continue}if(c?.type===`extension`){try{let t=this.#h===void 0?{message:`/${c.name} is not available in this session.`}:await this.#h.handle(c,{renderer:this.#n,title:e});t?.message!==void 0&&this.#U(t.message),t?.vercelEffect!==void 0&&(this.#C?.applyEffect(t.vercelEffect),this.#b=!0,this.#V())}catch(e){if(isInterruptedError(e))return;throw e}i=void 0,r=void 0,o=!1;continue}a=!0}let c=await this.#L({prompt:o?void 0:r,inputResponses:i});try{await this.#n.renderStream(c,{title:e,submittedPrompt:r,continueSession:!!this.#n.readPrompt,tools:this.#i,reasoning:this.#a,subagents:this.#o,connectionAuth:this.#s,assistantResponseStats:this.#c,contextSize:this.#l});let t=c.turnState?.pendingApprovals??[],n=c.turnState?.pendingQuestions??[];if(t.length>0||n.length>0){let a=[];if(t.length>0){if(!this.#n.readToolApproval)throw Error(`Tool approval was requested, but the renderer does not support tool approval input.`);for(let n of t){let t=await this.#n.readToolApproval(n,{title:e});a.push({requestId:n.approvalId,optionId:t.approved?`approve`:`deny`}),this.#E.delete(n.approvalId)}}if(n.length>0){if(!this.#n.readInputQuestion)throw Error(`An interactive question was requested, but the renderer does not support input questions.`);for(let t of n){let n=toAgentTUIInputQuestion(t),r=await this.#n.readInputQuestion(n,{title:e});if(r===void 0)continue;let i={requestId:t.requestId};r.optionId!==void 0&&(i.optionId=r.optionId),r.text!==void 0&&(i.text=r.text),a.push(i),this.#E.delete(t.requestId)}}o=!0,i=a,r=void 0;continue}c.turnState&&c.turnState.boundaryEvent===void 0&&(this.#j=!0)}catch(e){if(isInterruptedError(e))return;throw e}o=!1,i=void 0,r=void 0,this.#j&&(this.#j=!1,this.#F(),this.#n.renderNotice?.(`Session ended — started a new session. Earlier context was cleared.`))}}#F(){for(let e of this.#O.values())e.abort();this.#O.clear(),this.#D.clear(),this.#E.clear(),this.#k.clear(),this.#A.clear(),this.#t&&(this.#e=this.#t.session()),this.#d?.clear()}async#I(e){if(!this.#n.readPrompt)return;let t=this.#n.readPrompt(e),n=this.#t,r=this.#d;if(n===void 0||r===void 0)return await t;let i=!1,a=!1,o,refresh=async()=>{if(!(i||a)){a=!0;try{this.#e=await r.refreshIdle({createSession:()=>n.session(),onRuntimeArtifactsChanged:()=>this.#G(),session:this.#e})}finally{a=!1}}},startRefresh=()=>{if(i||a)return;let e=refresh().finally(()=>{o===e&&(o=void 0)});o=e};startRefresh();let s=setInterval(()=>{startRefresh()},500);s.unref?.();try{return await t}finally{i=!0,clearInterval(s),await o}}async#L(e){let t=new AbortController,n={signal:t.signal};e.prompt!==void 0&&(n.message=e.prompt),e.inputResponses!==void 0&&e.inputResponses.length>0&&(n.inputResponses=e.inputResponses);let r;try{let e=this.#t;e!==void 0&&this.#d!==void 0&&(this.#e=await this.#d.refresh({createSession:()=>e.session(),inputResponses:n.inputResponses,message:n.message,onRuntimeArtifactsChanged:()=>this.#G(),session:this.#e})),n.message!==void 0&&(n.inputResponses?.length??0)===0&&this.#n.flushDelayedDevBuildErrors?.(),r=await this.#e.send(n)}catch(e){if(isInterruptedError(e))throw e;return this.#j=!0,{events:errorOnlyTUIStream({errorText:this.#u(e)}),turnState:createTurnState()}}let i=createTurnState();return{abort:()=>t.abort(),events:eveEventsToTUIStream({events:r,pendingInputRequests:this.#E,subagentRuns:this.#D,turnState:i,onSubagentCalled:e=>this.#Y(e),onSubagentCompleted:e=>this.#Z(e),onConnectionAuthRequired:e=>this.#K(e),onConnectionAuthCompleted:e=>this.#q(e),onTerminalFailure:()=>{this.#j=!0},failureOverride:this.#p===void 0?void 0:e=>isGatewayAuthFailure(e)?formatGatewayAuthFailureNotice(e):void 0}),turnState:i}}async#R(e){if(this.#p===void 0||this.#n.renderSetupWarning===void 0)return;let t={appRoot:this.#p,env:process.env};e!==void 0&&(t.info=e),this.#x=await detectSetupIssues(t,this.#g),this.#z(),this.#B()}#z(){let e=orderedSetupIssues(this.#x,this.#S);e.length>0?this.#n.renderSetupWarning?.(formatSetupIssuesLine(e)):this.#n.clearSetupWarning?.()}async#B(){let e=this.#p;if(e===void 0)return;let t;try{t=await this.#_(e,{signal:this.#y.signal})}catch{return}this.#v||this.#b||(this.#S=authIssueForStatus(t),this.#z())}async#V(){let e=this.#p;if(e===void 0||this.#n.renderSetupWarning===void 0)return;let t={appRoot:e,env:process.env};this.#T!==void 0&&(t.info=this.#T);try{this.#x=await detectSetupIssues(t,this.#g);let n=await this.#_(e,{signal:this.#y.signal});this.#S=authIssueForStatus(n)}catch{return}this.#v||this.#z()}#H(){this.#p===void 0||this.#n.renderSandboxLog===void 0||this.#M===void 0&&(this.#M=subscribeDevelopmentSandboxPrewarmLogs({appRoot:this.#p,log:e=>this.#n.renderSandboxLog?.(e)}))}#U(e){if(this.#n.renderCommandResult!==void 0){this.#n.renderCommandResult(e);return}this.#n.renderNotice?.(e)}#W(e){let t=this.#n;if(t.logDisplayMode===void 0||t.setLogDisplayMode===void 0)return`/loglevel is not available in this session.`;if(e===``)return`Logs: ${t.logDisplayMode()}. Use /loglevel all|stderr|sandbox|none — logs stay buffered, so switching also hides or restores past lines.`;let n=parseLogDisplayMode(e);if(n===void 0)return`Unknown log level "${e}". Use all, stderr, sandbox, or none.`;if(n===t.logDisplayMode())return`Logs already set to ${n}.`;switch(t.setLogDisplayMode(n),n){case`none`:return`Logs hidden. Output stays buffered — /loglevel all restores it.`;case`stderr`:return`Showing stderr logs only.`;case`sandbox`:return`Showing sandbox logs only.`;case`all`:return`Showing all logs.`}}async#G(){let e=this.#T,t;try{t=await this.#t?.info()}catch{t=void 0}if(t!==void 0&&(this.#T=t,this.#f!==void 0)){let e={info:t,name:this.#r,serverUrl:this.#f};this.#p!==void 0&&(e.tip=this.#w),this.#n.renderAgentHeader?.(e)}(!this.#n.renderAgentHeader||t===void 0)&&this.#n.renderNotice?.(formatAgentUpdateNotice(e,t))}#K(e){let t={name:e.data.name,description:e.data.description,state:`required`};e.data.authorization!==void 0&&(t.challenge=e.data.authorization),e.data.webhookUrl!==void 0&&(t.webhookUrl=e.data.webhookUrl),this.#k.set(e.data.name,t),this.#J(t)}#q(e){let t=this.#k.get(e.data.name)??{name:e.data.name,description:``,state:e.data.outcome};t.state=e.data.outcome,e.data.reason!==void 0&&(t.reason=e.data.reason),this.#k.set(e.data.name,t),this.#A.delete(e.data.name),this.#J(t),this.#n.setConnectionAuthPendingCount?.(this.#A.size)}#J(e){let t={name:e.name,description:e.description,state:e.state};e.challenge!==void 0&&(t.challenge=e.challenge),e.reason!==void 0&&(t.reason=e.reason),this.#n.upsertConnectionAuth?.(t)}#Y(e){let t=e.data.callId;if(this.#O.has(t))return;let n=this.#t;if(!n)return;let r=new AbortController;this.#O.set(t,r),(async()=>{try{let i=n.session({sessionId:e.data.childSessionId,streamIndex:0}).stream({signal:r.signal});for await(let e of i)if(r.signal.aborted||(this.#Q(t,e),isCurrentTurnBoundaryEvent(e)))break}catch(e){if(!isAbortLikeError(e)){let n=toErrorMessage(e),r=this.#D.get(t);if(r){let{key:e,step:i}=openCurrentSubagentSection(r);i.message=i.message?`${i.message}\n\nstream error: ${n}`:`stream error: ${n}`,i.finalized=!0,r.currentSectionKey=null,this.#n.upsertSubagentStep?.({callId:t,subagentName:r.name,sectionKey:e,reasoning:i.reasoning,message:i.message,finalized:!0})}}}finally{this.#O.delete(t)}})()}#X(e,t,n){let r=t.tools.get(n.childCallId),i=r??{toolName:n.toolName,input:n.input,status:n.status};if(r){let e={"approval-requested":0,executing:1,done:2,failed:2};e[n.status]>e[r.status]&&(r.status=n.status),r.input=n.input}else t.tools.set(n.childCallId,i);this.#n.markChildToolCallId?.(n.childCallId),this.#n.upsertSubagentTool?.({callId:e,subagentName:t.name,childCallId:n.childCallId,toolName:i.toolName,input:i.input,status:i.status})}#Z(e){let t=this.#D.get(e);if(t){for(let[n,r]of t.steps)r.finalized||(r.finalized=!0,this.#n.upsertSubagentStep?.({callId:e,subagentName:t.name,sectionKey:n,reasoning:r.reasoning,message:r.message,finalized:!0}));t.currentSectionKey=null}}#Q(e,t){let n=this.#D.get(e);if(!n)return;let r=this.#n,emit=(t,i)=>{r.upsertSubagentStep?.({callId:e,subagentName:n.name,sectionKey:t,reasoning:i.reasoning,message:i.message,finalized:i.finalized})},finalizeCurrent=()=>{if(n.currentSectionKey===null)return;let e=n.steps.get(n.currentSectionKey);e&&(e.finalized=!0,emit(n.currentSectionKey,e)),n.currentSectionKey=null};switch(t.type){case`reasoning.appended`:{let{key:e,step:r}=openCurrentSubagentSection(n);r.reasoning+=t.data.reasoningDelta,emit(e,r);break}case`reasoning.completed`:break;case`message.appended`:{let{key:e,step:r}=openCurrentSubagentSection(n);r.message+=t.data.messageDelta,emit(e,r);break}case`message.completed`:{let{key:e,step:r}=openCurrentSubagentSection(n);t.data.message!==null&&r.message.length===0&&(r.message=t.data.message),r.finalized=!0,emit(e,r),n.currentSectionKey=null;break}case`step.completed`:finalizeCurrent();break;case`actions.requested`:finalizeCurrent();for(let r of t.data.actions)r.kind===`tool-call`&&this.#X(e,n,{childCallId:r.callId,toolName:r.toolName,input:r.input,status:`executing`});break;case`input.requested`:finalizeCurrent();for(let r of t.data.requests)r.action.kind===`tool-call`&&this.#X(e,n,{childCallId:r.action.callId,toolName:r.action.toolName,input:r.action.input,status:`approval-requested`});break;case`action.result`:{let i=t.data.result;if(i.kind!==`tool-result`)break;let a=n.tools.get(i.callId);if(!a)break;t.data.status===`failed`?(a.status=`failed`,a.errorText=formatActionResultError(t)):(a.status=`done`,a.output=i.output);let o={callId:e,subagentName:n.name,childCallId:i.callId,toolName:a.toolName,input:a.input,status:a.status};a.output!==void 0&&(o.output=a.output),a.errorText!==void 0&&(o.errorText=a.errorText),r.upsertSubagentTool?.(o);break}default:break}}};function createRenderer(e){return e.renderer?e.renderer:new TerminalRenderer({tools:e.tools,reasoning:e.reasoning,subagents:e.subagents,connectionAuth:e.connectionAuth,assistantResponseStats:e.assistantResponseStats,contextSize:e.contextSize,logs:e.logs,input:e.userInput,output:e.screen})}function formatAgentUpdateNotice(e,t){let n=e?.agent.model.id,r=t?.agent.model.id;return n!==void 0&&r!==void 0&&n!==r?`Agent updated: Model ${n} -> ${r}`:`Agent updated.`}async function*eveEventsToTUIStream(e){let{events:t,pendingInputRequests:n,subagentRuns:r,turnState:i,onSubagentCalled:a,onSubagentCompleted:o,onConnectionAuthRequired:s,onConnectionAuthCompleted:c,onTerminalFailure:l,failureOverride:u}=e,d=new Map,f=new Map,p=0,m=new Set,h=new Set,g=new Set,_=new Set,v=!1,y=!1,b;for await(let e of t)if(!(y&&isPostTurnVisibleEvent(e)))switch(e.type){case`session.started`:case`turn.started`:case`message.received`:break;case`step.started`:p+=1,yield{type:`step-start`};break;case`step.completed`:{let t=e;b=t.data.usage,yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p),yield{type:`step-finish`,usage:t.data.usage};break}case`message.appended`:{let t=e,n=textPartId(t.data.turnId,t.data.stepIndex),r=partStateFor(d,n),i=t.data.messageSoFar;if(r.completed){if(r.text.startsWith(i)||p<=r.completedEpoch)break;r.generation+=1,r.text=``,r.completed=!1}if(!i.startsWith(r.text)||i.length<=r.text.length)break;let a=i.slice(r.text.length);r.text=i,yield{type:`assistant-delta`,id:partGenerationId(n,r.generation),delta:a};break}case`message.completed`:{let t=textPartId(e.data.turnId,e.data.stepIndex),n=partStateFor(d,t),r=e.data.message;if(n.completed){if(r===null||r===n.text||p<=n.completedEpoch)break;n.generation+=1,n.text=r,n.completedEpoch=p,yield{type:`assistant-complete`,id:partGenerationId(t,n.generation),text:r};break}let i=partGenerationId(t,n.generation);if(r!==null){if(n.text.length===0)n.text=r,n.completed=!0,n.completedEpoch=p,yield{type:`assistant-complete`,id:i,text:r};else if(r.startsWith(n.text)){let e=r.slice(n.text.length);e.length>0&&(yield{type:`assistant-delta`,id:i,delta:e}),n.text=r,n.completed=!0,n.completedEpoch=p,yield{type:`assistant-complete`,id:i}}}else n.text.length>0&&(n.completed=!0,n.completedEpoch=p,yield{type:`assistant-complete`,id:i});break}case`reasoning.appended`:{let t=e,n=reasoningPartId(t.data.turnId,t.data.stepIndex),r=partStateFor(f,n),i=t.data.reasoningSoFar;if(r.completed){if(r.text.startsWith(i)||p<=r.completedEpoch)break;r.generation+=1,r.text=``,r.completed=!1}if(!i.startsWith(r.text)||i.length<=r.text.length)break;let a=i.slice(r.text.length);r.text=i,yield{type:`reasoning-delta`,id:partGenerationId(n,r.generation),delta:a};break}case`reasoning.completed`:{let t=reasoningPartId(e.data.turnId,e.data.stepIndex),n=partStateFor(f,t),r=e.data.reasoning;if(n.completed){if(r.length===0||r===n.text||n.text.startsWith(r)||p<=n.completedEpoch)break;n.generation+=1,n.text=r,n.completedEpoch=p;let e=partGenerationId(t,n.generation);yield{type:`reasoning-delta`,id:e,delta:r},yield{type:`reasoning-complete`,id:e};break}let i=partGenerationId(t,n.generation);if(n.text.length===0&&r.length>0)n.text=r,yield{type:`reasoning-delta`,id:i,delta:r};else if(r.length>0&&!r.startsWith(n.text))break;n.completed=!0,n.completedEpoch=p,yield{type:`reasoning-complete`,id:i};break}case`actions.requested`:{let t=e.data,n=t.actions.filter(e=>e.kind===`tool-call`);if(n.length===0)break;let r=toolBatchKey(`actions.requested`,t.turnId,t.stepIndex,n);if(g.has(r)){for(let e of n)m.has(e.callId)||h.add(e.callId);break}g.add(r);for(let e of n)m.has(e.callId)||(m.add(e.callId),yield{type:`tool-call`,toolCallId:e.callId,toolName:e.toolName,input:e.input});break}case`input.requested`:{let t=e.data,r=t.requests.filter(e=>e.action.kind===`tool-call`);if(r.length===0)break;let a=inputRequestBatchKey(t.turnId,t.stepIndex,r);if(g.has(a)){for(let e of r)m.has(e.action.callId)||h.add(e.action.callId);break}g.add(a);for(let e of r){let t=e.action.callId;if(m.has(t)||(m.add(t),yield{type:`tool-call`,toolCallId:t,toolName:e.action.toolName,input:e.action.input}),n.set(e.requestId,e),isQuestionRequest(e)){upsertPendingQuestion(i,e);continue}upsertPendingApproval(i,e),yield{type:`tool-approval-request`,approvalId:e.requestId,toolCallId:t}}break}case`action.result`:{let t=e;if(t.data.result.kind!==`tool-result`)break;let n=t.data.result.callId;if(h.has(n)||!m.has(n))break;t.data.status===`failed`?yield{type:`tool-error`,toolCallId:n,errorText:formatActionResultError(t)}:yield{type:`tool-result`,toolCallId:n,output:t.data.result.output};break}case`step.failed`:case`turn.failed`:{let t=toFailureEvent(e,_,u);t&&(yield t);break}case`session.failed`:{i.sawSessionFailure=!0,l?.(e);let t=toFailureEvent(e,_,u);t&&(yield t),i.boundaryEvent=e.type,yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p),yield{type:`finish`,usage:b},v=!0;return}case`session.waiting`:case`session.completed`:i.boundaryEvent=e.type,yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p),yield{type:`finish`,usage:b},v=!0;return;case`turn.completed`:y=!0,yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p);break;case`subagent.called`:{let t=e;if(!r.has(t.data.callId))r.set(t.data.callId,{name:t.data.name,steps:new Map,currentSectionKey:null,nextSectionKey:0,tools:new Map});else{let e=r.get(t.data.callId);e&&(e.name=t.data.name)}a?.(t);break}case`subagent.started`:case`subagent.event`:break;case`subagent.completed`:o?.(e.data.callId);break;case`authorization.required`:s?.(e);break;case`authorization.completed`:c?.(e);break;default:break}v||(yield*closeOpenParts(d,`assistant-complete`,p),yield*closeOpenParts(f,`reasoning-complete`,p),yield{type:`finish`,usage:b})}async function*errorOnlyTUIStream(e){yield{type:`error`,errorText:e.errorText},yield{type:`finish`}}function createTurnState(){return{pendingApprovals:[],pendingQuestions:[],sawSessionFailure:!1}}function upsertPendingApproval(e,t){let n=toAgentTUIToolApprovalRequest(t),r=e.pendingApprovals.findIndex(e=>e.approvalId===n.approvalId);r===-1?e.pendingApprovals.push(n):e.pendingApprovals[r]=n}function toAgentTUIToolApprovalRequest(e){return{approvalId:e.requestId,toolCallId:e.action.callId,toolName:e.action.toolName,input:e.action.input}}function upsertPendingQuestion(e,t){let n=e.pendingQuestions.findIndex(e=>e.requestId===t.requestId);n===-1?e.pendingQuestions.push(t):e.pendingQuestions[n]=t}function textPartId(e,t){return`text:${e}:${t}`}function reasoningPartId(e,t){return`reasoning:${e}:${t}`}function partStateFor(e,t){let n=e.get(t);return n===void 0&&(n={generation:0,text:``,completed:!1,completedEpoch:0},e.set(t,n)),n}function partGenerationId(e,t){return t===0?e:`${e}#${t}`}function*closeOpenParts(e,t,n){for(let[r,i]of e)i.completed||i.text.length===0||(i.completed=!0,i.completedEpoch=n,yield{type:t,id:partGenerationId(r,i.generation)})}function isPostTurnVisibleEvent(e){switch(e.type){case`actions.requested`:case`authorization.completed`:case`authorization.required`:case`input.requested`:case`message.appended`:case`message.completed`:case`reasoning.appended`:case`reasoning.completed`:case`result.completed`:case`step.completed`:case`step.failed`:case`step.started`:case`subagent.called`:case`subagent.completed`:case`subagent.event`:case`subagent.started`:case`turn.completed`:case`turn.failed`:return!0;default:return!1}}function toolBatchKey(e,t,n,r){return`${e}:${t}:${String(n)}:${stableStringify(r.map(e=>({input:e.input,toolName:e.toolName})))}`}function inputRequestBatchKey(e,t,n){return toolBatchKey(`input.requested`,e,t,n.map(e=>({input:e.action.input,toolName:e.action.toolName})))}function stableStringify(e){return JSON.stringify(toStableJson(e))??`undefined`}function toStableJson(e,t=new WeakSet){if(typeof e!=`object`||!e)return e;if(t.has(e))return`[Circular]`;if(t.add(e),Array.isArray(e))return e.map(e=>toStableJson(e,t));let n=e,r={};for(let e of Object.keys(n).sort())r[e]=toStableJson(n[e],t);return r}function formatActionResultError(e){if(e.data.error?.message)return e.data.error.message;let t=e.data.result.output;if(typeof t==`string`)return t;try{return JSON.stringify(t)}catch{return`Tool execution failed.`}}function toFailureEvent(e,t,n){let o=failureKey(e);if(t.has(o))return;t.add(o);let s=n?.(e),c={type:`error`,errorText:s??formatFailureMessage(e)};if(s!==void 0)return c;let l=formatFailureDetail(e);return l!==void 0&&(c.detail=l),c}function isQuestionRequest(e){return e.display===`select`||e.display===`text`?!0:e.display===`confirmation`?!1:e.options!==void 0&&e.options.length>0}function toAgentTUIInputQuestion(e){let t=e.display===`text`?`text`:e.display===`select`||e.options!==void 0&&e.options.length>0?`select`:`text`,n={requestId:e.requestId,prompt:e.prompt,display:t};return e.options!==void 0&&(n.options=e.options.map(e=>{let t={id:e.id,label:e.label};return e.description!==void 0&&(t.description=e.description),e.style!==void 0&&(t.style=e.style),t})),e.allowFreeform!==void 0&&(n.allowFreeform=e.allowFreeform),n}function openCurrentSubagentSection(e){e.currentSectionKey===null&&(e.currentSectionKey=e.nextSectionKey++,e.steps.set(e.currentSectionKey,{reasoning:``,message:``,finalized:!1}));let t=e.steps.get(e.currentSectionKey);if(!t)throw Error(`invariant: subagent section state missing for current key`);return{key:e.currentSectionKey,step:t}}export{EveTUIRunner,parsePromptCommand};
|
|
@@ -47,6 +47,8 @@ export declare const CLI_MISSING_SETUP_ISSUE: SetupIssue;
|
|
|
47
47
|
* the prompt.
|
|
48
48
|
*/
|
|
49
49
|
export declare function detectSetupIssues(context: BootDetectionContext, detections?: readonly BootDetection[]): Promise<SetupIssue[]>;
|
|
50
|
+
/** Places the auth issue before boot-time setup issues. */
|
|
51
|
+
export declare function orderedSetupIssues(bootIssues: readonly SetupIssue[], authIssue: SetupIssue | undefined): SetupIssue[];
|
|
50
52
|
/**
|
|
51
53
|
* The attention line's body, mirroring Claude Code's
|
|
52
54
|
* `1 setup issue: MCP · /doctor` shape; the renderer prefixes the warning
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join}from"node:path";import{pathExists}from"#setup/path-exists.js";const BOOT_DETECTIONS=[{id:`model-provider`,async detect({appRoot:n,env:r,info:i}){return i?.agent.model.routing?.kind===`external`||r.AI_GATEWAY_API_KEY||r.VERCEL_OIDC_TOKEN?[]:await pathExists(join(n,`.vercel`,`project.json`))?[{label:`AI Gateway credentials missing`,command:`/model`}]:[{label:`model provider not linked`,command:`/model`}]}}],LOGIN_SETUP_ISSUE={label:`not logged in`,command:`/login`},CLI_MISSING_SETUP_ISSUE={label:`Vercel CLI not found`,command:`/vc`};async function detectSetupIssues(e,t=BOOT_DETECTIONS){return(await Promise.all(t.map(async t=>{try{return await t.detect(e)}catch{return[]}}))).flat()}function formatSetupIssuesLine(e){let t=e.length===1?`setup issue`:`setup issues`,n=e.map(e=>`${e.label} · ${e.command}`).join(`, `);return`${e.length} ${t}: ${n}`}export{BOOT_DETECTIONS,CLI_MISSING_SETUP_ISSUE,LOGIN_SETUP_ISSUE,detectSetupIssues,formatSetupIssuesLine};
|
|
1
|
+
import{join}from"node:path";import{pathExists}from"#setup/path-exists.js";const BOOT_DETECTIONS=[{id:`model-provider`,async detect({appRoot:n,env:r,info:i}){return i?.agent.model.routing?.kind===`external`||r.AI_GATEWAY_API_KEY||r.VERCEL_OIDC_TOKEN?[]:await pathExists(join(n,`.vercel`,`project.json`))?[{label:`AI Gateway credentials missing`,command:`/model`}]:[{label:`model provider not linked`,command:`/model`}]}}],LOGIN_SETUP_ISSUE={label:`not logged in`,command:`/login`},CLI_MISSING_SETUP_ISSUE={label:`Vercel CLI not found`,command:`/vc`};async function detectSetupIssues(e,t=BOOT_DETECTIONS){return(await Promise.all(t.map(async t=>{try{return await t.detect(e)}catch{return[]}}))).flat()}function orderedSetupIssues(e,t){return t===void 0?[...e]:[t,...e]}function formatSetupIssuesLine(e){let t=e.length===1?`setup issue`:`setup issues`,n=e.map(e=>`${e.label} · ${e.command}`).join(`, `);return`${e.length} ${t}: ${n}`}export{BOOT_DETECTIONS,CLI_MISSING_SETUP_ISSUE,LOGIN_SETUP_ISSUE,detectSetupIssues,formatSetupIssuesLine,orderedSetupIssues};
|