eve 0.11.2 → 0.11.4
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 +17 -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/info.js +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
|
@@ -177,7 +177,7 @@ interface AuthorizationDefinitionBase {
|
|
|
177
177
|
* Optional metadata marker attached by `connect()` from
|
|
178
178
|
* `@vercel/connect/eve` so downstream tooling can detect Vercel
|
|
179
179
|
* Connect-backed connections at compile time without inspecting
|
|
180
|
-
* `getToken`'s closure state. Examples: a future
|
|
180
|
+
* `getToken`'s closure state. Examples: a future eve compiler step
|
|
181
181
|
* that surfaces connector identifiers in build output, or the Vercel
|
|
182
182
|
* dashboard rendering deep links to a connector's settings page.
|
|
183
183
|
*
|
|
@@ -205,13 +205,13 @@ interface AuthorizationDefinitionBase {
|
|
|
205
205
|
readonly displayName?: string;
|
|
206
206
|
/**
|
|
207
207
|
* Optional best-effort invalidation of any token cache the strategy
|
|
208
|
-
* owns *below*
|
|
208
|
+
* owns *below* eve's per-step cache, for the given `principal`.
|
|
209
209
|
*
|
|
210
|
-
*
|
|
210
|
+
* eve always drops its own per-step entry when a resolved bearer is
|
|
211
211
|
* rejected (a downstream `401` mapped to `ctx.requireAuth()`, or the
|
|
212
212
|
* MCP server rejecting the token). But a strategy frequently sits on a
|
|
213
213
|
* second, longer-lived cache — most notably the `@vercel/connect`
|
|
214
|
-
* in-process token cache — that
|
|
214
|
+
* in-process token cache — that eve cannot see. Without this hook the
|
|
215
215
|
* re-authorization re-reads the same revoked-but-unexpired credential
|
|
216
216
|
* from that lower layer and the tool keeps failing.
|
|
217
217
|
*
|
|
@@ -9,6 +9,6 @@ export declare const FINAL_OUTPUT_TOOL_NAME = "final_output";
|
|
|
9
9
|
*
|
|
10
10
|
* The tool has no `execute`: calling it is the terminal signal the harness
|
|
11
11
|
* intercepts to surface the structured result. Its input is provider-constrained
|
|
12
|
-
* to the schema during generation, exactly like every other
|
|
12
|
+
* to the schema during generation, exactly like every other eve tool input.
|
|
13
13
|
*/
|
|
14
14
|
export declare function buildFinalOutputTool(schema: JsonObject): Tool;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ResolvedHttpBasicAuthStrategy, RouteStrategyAuthenticationResult } from "#runtime/governance/auth/types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Verifies one HTTP Basic credential against a resolved
|
|
3
|
+
* Verifies one HTTP Basic credential against a resolved eve strategy.
|
|
4
4
|
*/
|
|
5
5
|
export declare function authenticateHttpBasicStrategy(input: {
|
|
6
6
|
readonly authorization: string;
|
|
@@ -6,7 +6,7 @@ import type { AuthenticatedCallerPrincipal, ResolvedTokenClaimMatchers } from "#
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function areTokenClaimMatchersSatisfied(payload: JWTPayload, matchers: ResolvedTokenClaimMatchers): boolean;
|
|
8
8
|
/**
|
|
9
|
-
* Creates a normalized JWT-backed
|
|
9
|
+
* Creates a normalized JWT-backed eve principal from a verified payload.
|
|
10
10
|
*/
|
|
11
11
|
export declare function createJwtAuthenticatedCallerPrincipal(input: {
|
|
12
12
|
readonly authenticator: AuthenticatedCallerPrincipal["authenticator"];
|
|
@@ -4,7 +4,7 @@ import type { RuntimeSessionAuthAttributes, RuntimeSessionAuthContext, RuntimeSe
|
|
|
4
4
|
*/
|
|
5
5
|
export type RouteAuthAttributes = RuntimeSessionAuthAttributes;
|
|
6
6
|
/**
|
|
7
|
-
* One authenticated caller normalized into
|
|
7
|
+
* One authenticated caller normalized into eve-owned runtime metadata.
|
|
8
8
|
*/
|
|
9
9
|
export interface AuthenticatedCallerPrincipal {
|
|
10
10
|
readonly attributes: RouteAuthAttributes;
|
|
@@ -12,7 +12,7 @@ export interface RuntimeCompilerArtifactPaths {
|
|
|
12
12
|
readonly moduleMapPath: string;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Resolves the stable
|
|
15
|
+
* Resolves the stable eve artifact paths for one application root without
|
|
16
16
|
* depending on Node path helpers.
|
|
17
17
|
*/
|
|
18
18
|
export declare function resolveRuntimeCompilerArtifactPaths(appRoot: string): RuntimeCompilerArtifactPaths;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION}from"#compiler/artifacts.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{formatValidationError}from"#runtime/validation.js";const compileArtifactDigestSchema=z.object({path:z.string(),sha256:z.string()}).strict(),compileMetadataSchema=z.object({compile:z.object({moduleMap:compileArtifactDigestSchema}).strict(),discovery:z.object({diagnostics:compileArtifactDigestSchema,manifest:compileArtifactDigestSchema,sourceGraphHash:z.string(),summary:z.object({errors:z.number().finite(),warnings:z.number().finite()}).strict()}).strict(),generator:z.object({name:z.string(),version:z.string()}).strict(),kind:z.literal(COMPILE_METADATA_KIND),status:z.union([z.literal(`failed`),z.literal(`ready`)]),version:z.literal(COMPILE_METADATA_VERSION)}).strict();var LoadCompileMetadataError=class extends Error{metadataPath;constructor(e,t){super(e),this.name=`LoadCompileMetadataError`,t!==void 0&&(this.metadataPath=t)}};async function loadCompileMetadata(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compileMetadataPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompileMetadataError(formatLoadErrorMessage(e),t)}return parseCompileMetadata(n,t)}let n=readBundledCompiledArtifacts()?.metadata;return n===void 0?null:parseCompileMetadata(n,`bundled compile metadata`)}function parseCompileMetadata(e,t){let n=compileMetadataSchema.safeParse(e);if(!n.success)throw new LoadCompileMetadataError(`Expected "${t}" to contain valid
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION}from"#compiler/artifacts.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{formatValidationError}from"#runtime/validation.js";const compileArtifactDigestSchema=z.object({path:z.string(),sha256:z.string()}).strict(),compileMetadataSchema=z.object({compile:z.object({moduleMap:compileArtifactDigestSchema}).strict(),discovery:z.object({diagnostics:compileArtifactDigestSchema,manifest:compileArtifactDigestSchema,sourceGraphHash:z.string(),summary:z.object({errors:z.number().finite(),warnings:z.number().finite()}).strict()}).strict(),generator:z.object({name:z.string(),version:z.string()}).strict(),kind:z.literal(COMPILE_METADATA_KIND),status:z.union([z.literal(`failed`),z.literal(`ready`)]),version:z.literal(COMPILE_METADATA_VERSION)}).strict();var LoadCompileMetadataError=class extends Error{metadataPath;constructor(e,t){super(e),this.name=`LoadCompileMetadataError`,t!==void 0&&(this.metadataPath=t)}};async function loadCompileMetadata(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compileMetadataPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompileMetadataError(formatLoadErrorMessage(e),t)}return parseCompileMetadata(n,t)}let n=readBundledCompiledArtifacts()?.metadata;return n===void 0?null:parseCompileMetadata(n,`bundled compile metadata`)}function parseCompileMetadata(e,t){let n=compileMetadataSchema.safeParse(e);if(!n.success)throw new LoadCompileMetadataError(`Expected "${t}" to contain valid eve compile metadata. ${formatValidationError(n.error)}`,t);return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown compile metadata load failure.`}export{loadCompileMetadata};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compiledAgentManifestSchema}from"#compiler/manifest.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{formatValidationError}from"#runtime/validation.js";const BUNDLED_MANIFEST_SOURCE=`bundled compiled manifest`;var LoadCompiledManifestError=class extends Error{manifestPath;constructor(e,t){super(e),this.name=`LoadCompiledManifestError`,t!==void 0&&(this.manifestPath=t)}};async function loadCompiledManifest(e){let r=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compiledManifestPath:void 0;if(r!==void 0){let{readFile:e}=await import(`node:fs/promises`),t;try{t=JSON.parse(await e(r,`utf8`))}catch(e){throw new LoadCompiledManifestError(formatLoadErrorMessage(e),r)}return parseCompiledManifest(t,r)}let a=readBundledCompiledArtifacts();if(a!==null)return parseCompiledManifest(a.manifest,BUNDLED_MANIFEST_SOURCE);throw new LoadCompiledManifestError(`Compiled manifest is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MANIFEST_SOURCE)}function parseCompiledManifest(t,n){let i=compiledAgentManifestSchema.safeParse(t);if(!i.success)throw new LoadCompiledManifestError(`Expected "${n}" to contain a valid compiled
|
|
1
|
+
import{compiledAgentManifestSchema}from"#compiler/manifest.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{formatValidationError}from"#runtime/validation.js";const BUNDLED_MANIFEST_SOURCE=`bundled compiled manifest`;var LoadCompiledManifestError=class extends Error{manifestPath;constructor(e,t){super(e),this.name=`LoadCompiledManifestError`,t!==void 0&&(this.manifestPath=t)}};async function loadCompiledManifest(e){let r=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compiledManifestPath:void 0;if(r!==void 0){let{readFile:e}=await import(`node:fs/promises`),t;try{t=JSON.parse(await e(r,`utf8`))}catch(e){throw new LoadCompiledManifestError(formatLoadErrorMessage(e),r)}return parseCompiledManifest(t,r)}let a=readBundledCompiledArtifacts();if(a!==null)return parseCompiledManifest(a.manifest,BUNDLED_MANIFEST_SOURCE);throw new LoadCompiledManifestError(`Compiled manifest is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MANIFEST_SOURCE)}function parseCompiledManifest(t,n){let i=compiledAgentManifestSchema.safeParse(t);if(!i.success)throw new LoadCompiledManifestError(`Expected "${n}" to contain a valid compiled eve agent manifest. ${formatValidationError(i.error)}`,n);return i.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown manifest load failure.`}export{LoadCompiledManifestError,loadCompiledManifest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compiledModuleMapSchema}from"#compiler/module-map.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{formatValidationError}from"#runtime/validation.js";const BUNDLED_MODULE_MAP_SOURCE=`bundled compiled module map`;var LoadCompiledModuleMapError=class extends Error{moduleMapPath;constructor(e,t){super(e),this.name=`LoadCompiledModuleMapError`,t!==void 0&&(this.moduleMapPath=t)}};async function loadCompiledModuleMap(e){let r=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).moduleMapPath:void 0;if(r!==void 0){let e=createFileImportSpecifier(r);try{let t=await import(e);return parseCompiledModuleMap(t.moduleMap??t.default,r)}catch(e){throw new LoadCompiledModuleMapError(formatLoadErrorMessage(e),r)}}let a=readBundledCompiledArtifacts();if(a!==null)return parseCompiledModuleMap(a.moduleMap,BUNDLED_MODULE_MAP_SOURCE);throw new LoadCompiledModuleMapError(`Compiled module map is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MODULE_MAP_SOURCE)}function parseCompiledModuleMap(t,n){let i=compiledModuleMapSchema.safeParse(t);if(!i.success)throw new LoadCompiledModuleMapError(`Expected "${n}" to export a valid compiled
|
|
1
|
+
import{compiledModuleMapSchema}from"#compiler/module-map.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{formatValidationError}from"#runtime/validation.js";const BUNDLED_MODULE_MAP_SOURCE=`bundled compiled module map`;var LoadCompiledModuleMapError=class extends Error{moduleMapPath;constructor(e,t){super(e),this.name=`LoadCompiledModuleMapError`,t!==void 0&&(this.moduleMapPath=t)}};async function loadCompiledModuleMap(e){let r=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).moduleMapPath:void 0;if(r!==void 0){let e=createFileImportSpecifier(r);try{let t=await import(e);return parseCompiledModuleMap(t.moduleMap??t.default,r)}catch(e){throw new LoadCompiledModuleMapError(formatLoadErrorMessage(e),r)}}let a=readBundledCompiledArtifacts();if(a!==null)return parseCompiledModuleMap(a.moduleMap,BUNDLED_MODULE_MAP_SOURCE);throw new LoadCompiledModuleMapError(`Compiled module map is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MODULE_MAP_SOURCE)}function parseCompiledModuleMap(t,n){let i=compiledModuleMapSchema.safeParse(t);if(!i.success)throw new LoadCompiledModuleMapError(`Expected "${n}" to export a valid compiled eve module map. ${formatValidationError(i.error)}`,n);return i.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown module-map load failure.`}function createFileImportSpecifier(e){let t=e.replaceAll(`\\`,`/`);return/^[A-Za-z]:\//.test(t)?`file:///${encodeURI(t)}`:t.startsWith(`/`)?`file://${encodeURI(t)}`:t}export{LoadCompiledModuleMapError,loadCompiledModuleMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{formatAvailableSkillsSection}from"#execution/skills/instructions.js";import{createWorkspacePromptSection}from"#runtime/workspace/spec.js";import{formatConnectionsSection}from"#runtime/prompt/connections.js";function composeRuntimeBasePrompt(e){return[...createInstructionsPromptBlocks(e.instructions),...createWorkspacePromptBlocks(e.workspaceSpec),...e.toolsAvailable?[`Tool execution
|
|
2
|
-
A single tool or subagent call runs as one serial action. If you call multiple independent tools or subagents in one response,
|
|
2
|
+
A single tool or subagent call runs as one serial action. If you call multiple independent tools or subagents in one response, eve treats that batch as parallel work. Only batch work that is independent and does not rely on another call in the same response.`]:[],...createConnectionsPromptBlocks(e.connections),...createSkillsPromptBlocks(e.skills)]}function createInstructionsPromptBlocks(e){if(e===void 0)return[];let t=e.markdown.trim();return t.length===0?[]:[`Instructions (${e.name})\n${t}`]}function createWorkspacePromptBlocks(e){if(e===void 0)return[];let n=createWorkspacePromptSection(e);return n===void 0?[]:[n]}function createConnectionsPromptBlocks(e){return!e||e.length===0?[]:[formatConnectionsSection(e)]}function createSkillsPromptBlocks(t){if(!t||t.length===0)return[];let n=formatAvailableSkillsSection(t);return n===null?[]:[n]}export{composeRuntimeBasePrompt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setChannelInstrumentationKind}from"#channel/compiled-channel.js";import{toErrorMessage}from"#shared/errors.js";import{normalizeChannelDefinition}from"#internal/authored-definition/channel.js";import{ResolveAgentError,createResolvedModuleSourceRef,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{HTTP_ADAPTER_KIND}from"#channel/http.js";import{isHttpRouteDefinition,isWebSocketRouteDefinition}from"#channel/routes.js";async function resolveChannelDefinition(r,i,a){try{let t=normalizeChannelDefinition(await loadResolvedModuleExport({definition:r,kindLabel:`channel`,moduleMap:i,nodeId:a}),`Expected the channel export "${r.exportName??`default`}" from "${r.logicalPath}" to match the public
|
|
1
|
+
import{setChannelInstrumentationKind}from"#channel/compiled-channel.js";import{toErrorMessage}from"#shared/errors.js";import{normalizeChannelDefinition}from"#internal/authored-definition/channel.js";import{ResolveAgentError,createResolvedModuleSourceRef,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{HTTP_ADAPTER_KIND}from"#channel/http.js";import{isHttpRouteDefinition,isWebSocketRouteDefinition}from"#channel/routes.js";async function resolveChannelDefinition(r,i,a){try{let t=normalizeChannelDefinition(await loadResolvedModuleExport({definition:r,kindLabel:`channel`,moduleMap:i,nodeId:a}),`Expected the channel export "${r.exportName??`default`}" from "${r.logicalPath}" to match the public eve shape.`),n=createResolvedModuleSourceRef({exportName:r.exportName,logicalPath:r.logicalPath,sourceId:r.sourceId}),o=t.routes.find(e=>e.method.toUpperCase()===r.method.toUpperCase()&&e.path===r.urlPath),s=`channel:${r.name}`;setChannelInstrumentationKind(t,s);let c=t.adapter;c&&c.kind!==HTTP_ADAPTER_KIND&&(c.kind=s);let l=resolveHttpRoute(r,o),u=resolveWebSocketRoute(r,o);return{name:r.name,method:r.method,urlPath:r.urlPath,fetch:async(e,t)=>l?l.handler(e,t):Response.json({error:`No matching route handler.`,ok:!1},{status:404}),handler:l?.handler,websocket:u?.handler,receive:t.receive,definition:t,adapter:c,...n}}catch(e){throw e instanceof ResolveAgentError?e:new ResolveAgentError(`Failed to attach the channel definition from "${r.logicalPath}": ${toErrorMessage(e)}`,{logicalPath:r.logicalPath,sourceId:r.sourceId})}}function resolveHttpRoute(e,t){if(!(t===void 0||e.method===`WEBSOCKET`||!isHttpRouteDefinition(t)))return t}function resolveWebSocketRoute(e,t){if(!(t===void 0||e.method!==`WEBSOCKET`||!isWebSocketRouteDefinition(t)))return t}export{resolveChannelDefinition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const EVE_SCHEDULE_TASK_NAME_PREFIX=`eve.schedule.`;var ScheduleRegistrationError=class extends Error{scheduleId;sourceId;taskName;constructor(e,t={}){super(e),this.name=`ScheduleRegistrationError`,t.scheduleId!==void 0&&(this.scheduleId=t.scheduleId),t.sourceId!==void 0&&(this.sourceId=t.sourceId),t.taskName!==void 0&&(this.taskName=t.taskName)}};function createScheduleRegistrations(e){let t=e.map(e=>({cron:e.cron,description:`Run
|
|
1
|
+
const EVE_SCHEDULE_TASK_NAME_PREFIX=`eve.schedule.`;var ScheduleRegistrationError=class extends Error{scheduleId;sourceId;taskName;constructor(e,t={}){super(e),this.name=`ScheduleRegistrationError`,t.scheduleId!==void 0&&(this.scheduleId=t.scheduleId),t.sourceId!==void 0&&(this.sourceId=t.sourceId),t.taskName!==void 0&&(this.taskName=t.taskName)}};function createScheduleRegistrations(e){let t=e.map(e=>({cron:e.cron,description:`Run eve schedule "${e.name}" from "${e.logicalPath}".`,logicalPath:e.logicalPath,scheduleId:e.name,sourceId:e.sourceId,taskName:createScheduleTaskName(e.sourceId)})).sort((e,t)=>e.sourceId.localeCompare(t.sourceId));return assertUniqueScheduleIds(t),t}function assertUniqueScheduleIds(e){let t=new Map;for(let n of e){let e=t.get(n.scheduleId);if(e===void 0){t.set(n.scheduleId,n);continue}throw new ScheduleRegistrationError(`Duplicate authored schedule id "${n.scheduleId}" found in "${e.logicalPath}" and "${n.logicalPath}".`,{scheduleId:n.scheduleId,sourceId:n.sourceId,taskName:n.taskName})}}function createScheduleTaskName(t){return`${EVE_SCHEDULE_TASK_NAME_PREFIX}${Buffer.from(t,`utf8`).toString(`base64url`)}`}export{EVE_SCHEDULE_TASK_NAME_PREFIX,ScheduleRegistrationError,createScheduleRegistrations};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "#compiled/zod/index.js";
|
|
2
2
|
/**
|
|
3
|
-
* Runtime-owned authenticator kinds projected into
|
|
3
|
+
* Runtime-owned authenticator kinds projected into eve session auth metadata.
|
|
4
4
|
*/
|
|
5
5
|
export type RuntimeSessionAuthenticator = "http-basic" | "jwt-hmac" | "jwt-ecdsa" | "oidc";
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BundledCompiledArtifacts } from "#runtime/loaders/bundled-artifacts.js";
|
|
2
2
|
import type { CompiledRuntimeAgentBundle } from "#runtime/sessions/compiled-agent-cache.js";
|
|
3
3
|
/**
|
|
4
|
-
* Process-scoped container for mutable runtime state owned by one
|
|
4
|
+
* Process-scoped container for mutable runtime state owned by one eve
|
|
5
5
|
* deployment.
|
|
6
6
|
*
|
|
7
7
|
* Holds installed compiled artifacts and compiled-agent bundle caches.
|
|
@@ -117,7 +117,7 @@ export type ResolvedSandboxDefinition = ResolvedModuleSourceRef & {
|
|
|
117
117
|
};
|
|
118
118
|
/**
|
|
119
119
|
* Runtime-owned authored tool definition resolved from a compiled module map.
|
|
120
|
-
* A tool without `execute` is surfaced to the client and never executed by
|
|
120
|
+
* A tool without `execute` is surfaced to the client and never executed by eve.
|
|
121
121
|
*/
|
|
122
122
|
export type ResolvedToolDefinition = Readonly<Optional<InternalToolDefinitionWithExecuteFn<unknown, unknown>, "execute">> & ResolvedModuleSourceRef & {
|
|
123
123
|
/**
|
|
@@ -37,12 +37,12 @@ export declare const VERCEL_TRUSTED_OIDC_IDP_TOKEN_HEADER = "x-vercel-trusted-oi
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const VERCEL_OIDC_TOKEN_HEADER = "x-vercel-oidc-token";
|
|
39
39
|
/**
|
|
40
|
-
* Header values accepted by
|
|
40
|
+
* Header values accepted by eve's development client helpers.
|
|
41
41
|
*/
|
|
42
42
|
export type DevelopmentRequestHeaders = Headers | ReadonlyArray<readonly [string, string]> | Record<string, string>;
|
|
43
43
|
/**
|
|
44
44
|
* Creates request headers for one service-issued development request and
|
|
45
|
-
* opportunistically refreshes a linked local Vercel OIDC token for
|
|
45
|
+
* opportunistically refreshes a linked local Vercel OIDC token for eve-owned
|
|
46
46
|
* routes when no explicit authorization header is present.
|
|
47
47
|
*/
|
|
48
48
|
export declare function createDevelopmentRequestHeadersAsync(input: {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* "Authentication Required" challenge that fronts protected previews and
|
|
4
4
|
* production deployments.
|
|
5
5
|
*
|
|
6
|
-
* When the
|
|
6
|
+
* When the eve development client (`eve dev --url …`) targets a deployment
|
|
7
7
|
* that has Deployment Protection enabled and no valid bypass header is
|
|
8
8
|
* attached, Vercel returns an HTML SSO challenge instead of routing the
|
|
9
9
|
* request to the function. The raw HTML body is unhelpful in a CLI
|
|
@@ -18,6 +18,6 @@ export interface ApplicationInspection {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Resolves application details, compile artifacts, and the active message
|
|
21
|
-
* contract for one
|
|
21
|
+
* contract for one eve application root.
|
|
22
22
|
*/
|
|
23
23
|
export declare function inspectApplication(appRoot: string): Promise<ApplicationInspection>;
|
|
@@ -35,7 +35,7 @@ export interface AddChannelsOptions {
|
|
|
35
35
|
*/
|
|
36
36
|
headless?: boolean;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* eve package metadata for the scaffolded web `package.json`. When omitted,
|
|
39
39
|
* every package value comes from the build-stamped defaults.
|
|
40
40
|
*/
|
|
41
41
|
evePackage?: EvePackageContract;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{SkippedSignal,confirm}from"../ask.js";import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployment}from"../project-resolution.js";import{provisionSlackbot,reconcileSlackUid}from"../slackbot.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{WizardCancelledError}from"../step.js";import{deriveSlackConnectorSlug,ensureChannel}from"#setup/scaffold/index.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectPackageManager}from"#setup/package-manager.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";import{runVercel}from"#setup/primitives/run-vercel.js";const SLACKBOT_NOT_ATTACHED_ERROR=`Slackbot provisioning did not attach this project. Slack channel was not added.`;function slackbotFailureCopy(e){switch(e.state){case`not-installed`:return{reason:`Slackbot is not connected to a Slack workspace. Slack channel was not added.`,followUp:"Continuing without Slack — the install timed out and was cleaned up; re-run `eve channels add slack` to try again."};case`cleanup-failed`:return{reason:`The abandoned Slack connector could not be removed. Slack channel was not added.`,followUp:`Continuing without Slack — resolve the cleanup warning above before trying again.`};case`connector-lookup-failed`:return{reason:`Existing Slack connectors could not be inspected. Slack channel was not added.`,followUp:"Continuing without Slack — restore Vercel CLI access, then re-run `eve channels add slack`."};case`installation-check-failed`:return{reason:`Slack workspace installation could not be verified. Slack channel was not added.`,followUp:"Continuing without Slack — verify Vercel Connect is reachable, then re-run `eve channels add slack`."};case`existing-not-installed`:return{reason:`The existing Slack connector is not connected to a Slack workspace. Slack channel was not added.`,followUp:`Continuing without Slack — resolve the existing connector warning above before trying again.`};case`detach-failed`:return{reason:`Slackbot provisioning could not replace the existing trigger destination. Slack channel was not added.`,followUp:"Continuing without Slack — run the `vercel connect detach` and `vercel connect attach` commands above."};case`attach-failed`:return{reason:SLACKBOT_NOT_ATTACHED_ERROR,followUp:"Continuing without Slack — finish event delivery with the `vercel connect attach` command above."};case`create-failed`:return{reason:`Slackbot creation failed.`,followUp:"Continuing without Slack — add it later with `eve channels add slack`."}}}function warnOverwrittenFiles(e,t){for(let n of t??[])e.warning(`Overwrote ${n}`)}function warnCompetingNextConfigFiles(e,t){for(let n of t??[])e.warning(`Found competing Next.js config at ${n}; merge any needed settings into next.config.ts and remove it before starting the preview, or Next.js may ignore the generated
|
|
1
|
+
import{SkippedSignal,confirm}from"../ask.js";import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployment}from"../project-resolution.js";import{provisionSlackbot,reconcileSlackUid}from"../slackbot.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{WizardCancelledError}from"../step.js";import{deriveSlackConnectorSlug,ensureChannel}from"#setup/scaffold/index.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectPackageManager}from"#setup/package-manager.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";import{runVercel}from"#setup/primitives/run-vercel.js";const SLACKBOT_NOT_ATTACHED_ERROR=`Slackbot provisioning did not attach this project. Slack channel was not added.`;function slackbotFailureCopy(e){switch(e.state){case`not-installed`:return{reason:`Slackbot is not connected to a Slack workspace. Slack channel was not added.`,followUp:"Continuing without Slack — the install timed out and was cleaned up; re-run `eve channels add slack` to try again."};case`cleanup-failed`:return{reason:`The abandoned Slack connector could not be removed. Slack channel was not added.`,followUp:`Continuing without Slack — resolve the cleanup warning above before trying again.`};case`connector-lookup-failed`:return{reason:`Existing Slack connectors could not be inspected. Slack channel was not added.`,followUp:"Continuing without Slack — restore Vercel CLI access, then re-run `eve channels add slack`."};case`installation-check-failed`:return{reason:`Slack workspace installation could not be verified. Slack channel was not added.`,followUp:"Continuing without Slack — verify Vercel Connect is reachable, then re-run `eve channels add slack`."};case`existing-not-installed`:return{reason:`The existing Slack connector is not connected to a Slack workspace. Slack channel was not added.`,followUp:`Continuing without Slack — resolve the existing connector warning above before trying again.`};case`detach-failed`:return{reason:`Slackbot provisioning could not replace the existing trigger destination. Slack channel was not added.`,followUp:"Continuing without Slack — run the `vercel connect detach` and `vercel connect attach` commands above."};case`attach-failed`:return{reason:SLACKBOT_NOT_ATTACHED_ERROR,followUp:"Continuing without Slack — finish event delivery with the `vercel connect attach` command above."};case`create-failed`:return{reason:`Slackbot creation failed.`,followUp:"Continuing without Slack — add it later with `eve channels add slack`."}}}function warnOverwrittenFiles(e,t){for(let n of t??[])e.warning(`Overwrote ${n}`)}function warnCompetingNextConfigFiles(e,t){for(let n of t??[])e.warning(`Found competing Next.js config at ${n}; merge any needed settings into next.config.ts and remove it before starting the preview, or Next.js may ignore the generated eve rewrite.`)}function addChannels(l){let u=l.deps??{ensureChannel,deriveSlackConnectorSlug,provisionSlackbot,reconcileSlackUid,detectPackageManager,runPackageManagerInstall,runVercel,detectDeployment};async function scaffoldSlackChannel(e,t,n,r,i,a){let o=!1;if(!t.slackScaffolded){let t=await u.ensureChannel({projectRoot:n,kind:`slack`,slackConnectorUid:a,slackConnectorSlug:r,force:l.force});warnOverwrittenFiles(e,t.filesOverwritten),t.action===`created`||t.action===`overwritten`?e.success(`Scaffolded channel: slack`):e.info(`Channel "slack" already exists. Skipping file creation.`),o=t.action!==`skipped`,i.slackScaffolded=!0}return i.channelsAdded.push(`slack`),o}async function linkProjectForSlackbot(e,t,n,o,s){if(o)throw new HumanActionRequiredError({kind:`vercel-link`,command:`vercel link`,reason:`Slackbot creation needs this directory linked to a Vercel project.`});if(e.message(`Linking this directory to a Vercel project...`),!await u.runVercel([`link`],{cwd:t,signal:s}))throw s?.throwIfAborted(),Error(`Vercel project linking failed. Slackbot creation did not start.`);let c=mergeProjectResolution(n,projectResolutionFromDeployment(await u.detectDeployment(t,{signal:s})));if(!isProjectResolved(c))throw Error(`Vercel project linking failed. Slackbot creation did not start.`);return c}async function addWebChannelToPayload(e,t,n,r,i,a){if(!t.channelSelection.includes(`web`))return;if(t.webScaffolded){i.channelsAdded.push(`web`);return}e.message(`Scaffolding Web Chat channel files...`);let o={projectRoot:n,kind:`web`,packageManager:r,force:l.force,configureVercelServices:l.configureVercelServices??hasVercelProject(t)};l.evePackage!==void 0&&(o.webPackageVersions={evePackage:l.evePackage});let s=await u.ensureChannel(o);if(a?.throwIfAborted(),warnOverwrittenFiles(e,s.filesOverwritten),s.kind===`web`&&s.action!==`skipped`&&s.nodeEngineOverride!==void 0&&e.warning(formatNodeEngineOverrideWarning(s.nodeEngineOverride)),warnCompetingNextConfigFiles(e,`competingNextConfigFiles`in s?s.competingNextConfigFiles:void 0),s.action===`created`||s.action===`overwritten`){e.success(`Scaffolded channel: web`),i.webScaffolded=!0,i.channelsAdded.push(`web`);return}e.info(`Next.js project detected. Skipping Web Chat scaffolding.`)}function assertSlackProjectReady(e){if(l.ensureLinkedProject===void 0){if(!hasVercelProject(e))throw Error(`Slack requires a Vercel project. Re-run and choose to deploy to Vercel to add Slack.`);if(!isProjectResolved(e.project))throw Error(`Expected a linked Vercel project for Slack, but none was resolved.`)}}async function provisionSlackbotWithControls(e,t,n,r){if(r===void 0&&l.prompter.awaitChoice===void 0)return u.provisionSlackbot(e,t,n);let i={};return r!==void 0&&(i.signal=r),l.prompter.awaitChoice!==void 0&&(i.awaitChoice=l.prompter.awaitChoice),u.provisionSlackbot(e,t,n,void 0,i)}async function scaffoldAttachedSlackChannel(e,t,n,r,i,a){if(!await scaffoldSlackChannel(e,t,n,r,i,a.connectorUid)&&!await u.reconcileSlackUid(e,n,a,`slack/${r}`))throw Error(`Slack connector UID update is required before deployment.`)}async function addSlackChannelToPayload(e,t,n,i,a,o){if(!t.channelSelection.includes(`slack`))return;assertSlackProjectReady(t);let s=await u.deriveSlackConnectorSlug(i,t.agentName);if(t.slackbotCreated){if(!t.slackbotAttached)throw Error(SLACKBOT_NOT_ATTACHED_ERROR);if(!t.deploymentPending)return;let n=t.slackConnectorUid;if(n===void 0)throw Error(`Slack connector UID was not resolved. Slack deployment did not start.`);await scaffoldAttachedSlackChannel(e,t,i,s,a,{state:`attached`,connectorUid:n});return}if(n.createSlackbot!==!0){e.info(`Slack channel was not added because Slackbot setup was skipped.`);return}isProjectResolved(a.project)||(a.project=await linkProjectForSlackbot(e,i,a.project,n.headless,o));let c=await provisionSlackbotWithControls(e,i,s,o);if(o?.throwIfAborted(),c.state===`cancelled`)throw new WizardCancelledError;if(c.state!==`attached`){let t=slackbotFailureCopy(c);if(l.slackbotFailure!==`warn-and-continue`)throw Error(t.reason);e.warning(`${t.reason} ${t.followUp}`);return}a.slackbot={connectorUid:c.connectorUid,chatUrl:c.chatUrl,workspaceName:c.workspaceName},await scaffoldAttachedSlackChannel(e,t,i,s,a,c)}async function installChannelDependencies(e,t,n,r,i){if(r.channelsAdded.length!==0){if(await withPhase(e,`Installing channel dependencies (${n} install)...`,()=>u.runPackageManagerInstall(n,t,{onOutput:createPromptCommandOutput(e),signal:i}))){r.dependenciesInstalled=!0;return}e.warning(`Dependency installation failed. The new channels stay unloadable until \`${n} install\` or a deploy succeeds.`)}}async function performAddChannels(e,t,n){n?.throwIfAborted();let r=l.prompter.log,i=requireProjectPath(e),a={channelsAdded:[],webScaffolded:e.webScaffolded,slackScaffolded:e.slackScaffolded,dependenciesInstalled:!1,project:e.project},o=await u.detectPackageManager(i);return await addWebChannelToPayload(r,e,i,o.kind,a,n),await addSlackChannelToPayload(r,e,t,i,a,n),await installChannelDependencies(r,i,o.kind,a,n),a}return{id:`add-channels`,async gather({state:n}){let r=l.headless??!1;if(r&&n.channelSelection.includes(`slack`))throw Error("Slack setup is interactive. Run `eve channels add slack` from an interactive terminal.");if(!n.channelSelection.includes(`slack`)||l.presetCreateSlackbot!==void 0||n.slackbotCreated)return{headless:r,createSlackbot:l.presetCreateSlackbot};try{return{headless:r,createSlackbot:await l.asker.ask(confirm({key:`create-slackbot`,message:`Do you want to create your slackbot?`}))}}catch(t){if(t instanceof SkippedSignal)return{headless:r,createSlackbot:!1};throw t}},async perform({state:e,input:t,signal:n}){try{return await performAddChannels(e,t,n)}catch(e){if(!(e instanceof WizardCancelledError)){let t=e instanceof Error?e.message:String(e),n=t.split(`
|
|
2
2
|
`)[0]?.trim()??t;l.prompter.log.error(n)}throw e}},apply(e,t){let n=[...e.channels];for(let e of t.channelsAdded)n.includes(e)||n.push(e);let r={...e,channels:n,webScaffolded:t.webScaffolded,slackScaffolded:t.slackScaffolded,deploymentPending:e.deploymentPending||t.channelsAdded.length>0,deploymentDependenciesInstalled:t.channelsAdded.length>0?t.dependenciesInstalled:e.deploymentDependenciesInstalled,project:mergeProjectResolution(e.project,t.project)};return t.slackbot===void 0?r:{...r,slackbotCreated:!0,slackbotAttached:!0,slackConnectorUid:t.slackbot.connectorUid,slackChatUrl:t.slackbot.chatUrl,slackWorkspaceName:t.slackbot.workspaceName}}}}export{addChannels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployResult,projectResolutionFromDeployment}from"../project-resolution.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{detectPackageManager}from"#setup/package-manager.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";import{runVercel}from"#setup/primitives/run-vercel.js";const VERCEL_DEPLOY_ENV={VERCEL_USE_EXPERIMENTAL_FRAMEWORKS:`1`};function deployProject(o){let s=o.deps??{runVercel,detectPackageManager,runPackageManagerInstall,detectDeployment};return{id:`deploy-project`,shouldRun(e){return o.skip||!e.deploymentPending?!1:hasVercelProject(e)||o.ensureLinkedProject===`interactive-vercel-link`},async gather(){return{headless:o.headless??!1}},async perform({state:e,input:n,signal:r}){let i=requireProjectPath(e),{log:a}=o.prompter,c=createPromptCommandOutput(a),l=e.project;if(!isProjectResolved(l)){if(n.headless)throw new HumanActionRequiredError({kind:`vercel-link`,command:`vercel link`,reason:`Deployment needs this directory linked to a Vercel project.`});if(a.message(`Linking this directory to a Vercel project before deployment...`),!await s.runVercel([`link`],{cwd:i,signal:r}))throw r?.throwIfAborted(),Error(`Vercel project linking failed. Deployment did not start.`);if(l=mergeProjectResolution(l,projectResolutionFromDeployment(await s.detectDeployment(i,{signal:r}))),!isProjectResolved(l))throw Error(`Vercel project linking failed. Deployment did not start.`)}if(!e.deploymentDependenciesInstalled){let e=await s.detectPackageManager(i);if(!await withPhase(a,`Installing project dependencies before deployment (${e.kind} install)...`,()=>s.runPackageManagerInstall(e.kind,i,{onOutput:c,signal:r})))throw r?.throwIfAborted(),Error(`Dependency installation failed. Deployment did not start.`)}let u=n.headless?[`deploy`,`--prod`,`--yes`,`--non-interactive`]:[`deploy`,`--prod`,`--yes`],d=await withPhase(a,`Deploying the agent to Vercel production...`,()=>s.runVercel(u,{cwd:i,extraEnv:VERCEL_DEPLOY_ENV,nonInteractive:n.headless,onOutput:c,signal:r}));if(r?.throwIfAborted(),!d)throw a.error("`vercel deploy --prod` failed. The deploy output above shows the cause; fix it, then run `vercel deploy --prod` to retry."),Error(`Deployment failed after channel setup.`);let f=await withPhase(a,`Pulling Vercel environment variables into .env.local...`,()=>s.runVercel([`env`,`pull`,`--yes`],{cwd:i,nonInteractive:n.headless,onOutput:c,signal:r}));r?.throwIfAborted(),f||a.warning(`Deployment succeeded, but pulling Vercel environment variables did not complete.`);let p=await s.detectDeployment(i,{signal:r}),m=p.state===`deployed`?p.productionUrl:void 0;return m===void 0?a.warning(`Deployment succeeded, but
|
|
1
|
+
import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployResult,projectResolutionFromDeployment}from"../project-resolution.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{detectPackageManager}from"#setup/package-manager.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";import{runVercel}from"#setup/primitives/run-vercel.js";const VERCEL_DEPLOY_ENV={VERCEL_USE_EXPERIMENTAL_FRAMEWORKS:`1`};function deployProject(o){let s=o.deps??{runVercel,detectPackageManager,runPackageManagerInstall,detectDeployment};return{id:`deploy-project`,shouldRun(e){return o.skip||!e.deploymentPending?!1:hasVercelProject(e)||o.ensureLinkedProject===`interactive-vercel-link`},async gather(){return{headless:o.headless??!1}},async perform({state:e,input:n,signal:r}){let i=requireProjectPath(e),{log:a}=o.prompter,c=createPromptCommandOutput(a),l=e.project;if(!isProjectResolved(l)){if(n.headless)throw new HumanActionRequiredError({kind:`vercel-link`,command:`vercel link`,reason:`Deployment needs this directory linked to a Vercel project.`});if(a.message(`Linking this directory to a Vercel project before deployment...`),!await s.runVercel([`link`],{cwd:i,signal:r}))throw r?.throwIfAborted(),Error(`Vercel project linking failed. Deployment did not start.`);if(l=mergeProjectResolution(l,projectResolutionFromDeployment(await s.detectDeployment(i,{signal:r}))),!isProjectResolved(l))throw Error(`Vercel project linking failed. Deployment did not start.`)}if(!e.deploymentDependenciesInstalled){let e=await s.detectPackageManager(i);if(!await withPhase(a,`Installing project dependencies before deployment (${e.kind} install)...`,()=>s.runPackageManagerInstall(e.kind,i,{onOutput:c,signal:r})))throw r?.throwIfAborted(),Error(`Dependency installation failed. Deployment did not start.`)}let u=n.headless?[`deploy`,`--prod`,`--yes`,`--non-interactive`]:[`deploy`,`--prod`,`--yes`],d=await withPhase(a,`Deploying the agent to Vercel production...`,()=>s.runVercel(u,{cwd:i,extraEnv:VERCEL_DEPLOY_ENV,nonInteractive:n.headless,onOutput:c,signal:r}));if(r?.throwIfAborted(),!d)throw a.error("`vercel deploy --prod` failed. The deploy output above shows the cause; fix it, then run `vercel deploy --prod` to retry."),Error(`Deployment failed after channel setup.`);let f=await withPhase(a,`Pulling Vercel environment variables into .env.local...`,()=>s.runVercel([`env`,`pull`,`--yes`],{cwd:i,nonInteractive:n.headless,onOutput:c,signal:r}));r?.throwIfAborted(),f||a.warning(`Deployment succeeded, but pulling Vercel environment variables did not complete.`);let p=await s.detectDeployment(i,{signal:r}),m=p.state===`deployed`?p.productionUrl:void 0;return m===void 0?a.warning(`Deployment succeeded, but eve could not verify its production URL.`):a.info(`Production URL: ${m}`),{project:projectResolutionFromDeployResult(l,{deployed:!0,productionUrl:m}),deploymentPending:!1,deploymentDependenciesInstalled:!0}},apply(e,t){return{...e,project:t.project,deploymentPending:t.deploymentPending,deploymentDependenciesInstalled:t.deploymentDependenciesInstalled}}}}export{deployProject};
|
|
@@ -28,7 +28,7 @@ export interface ResolveTargetOptions {
|
|
|
28
28
|
/** Force scaffolding into the target directory instead of a `./<name>` child. */
|
|
29
29
|
inPlace?: boolean;
|
|
30
30
|
/**
|
|
31
|
-
* Treat an existing `./<name>` that is already an
|
|
31
|
+
* Treat an existing `./<name>` that is already an eve project as resumable
|
|
32
32
|
* instead of refusing it. Composed on for headless runs so re-runs converge;
|
|
33
33
|
* interactive runs keep refusing so a human notices the collision.
|
|
34
34
|
*/
|
|
@@ -52,7 +52,7 @@ export interface ResolveTargetPayload {
|
|
|
52
52
|
* place or into a new `./<name>` child. The current-vs-new question only fires
|
|
53
53
|
* when the target directory already looks like a project; otherwise creating a
|
|
54
54
|
* new directory is the announced default. A headless re-run resumes an
|
|
55
|
-
* existing
|
|
55
|
+
* existing eve project directory instead of refusing it (composed via
|
|
56
56
|
* `resumeExisting`), so re-runs converge.
|
|
57
57
|
*/
|
|
58
58
|
export declare function resolveTarget(options: ResolveTargetOptions): SetupBox<SetupState, ResolveTargetInput, ResolveTargetPayload>;
|
|
@@ -13,10 +13,10 @@ export interface ScaffoldOptions {
|
|
|
13
13
|
evePackage?: EvePackageContract;
|
|
14
14
|
/** Parent directory the project folder is created inside. Defaults to cwd. */
|
|
15
15
|
targetDirectory?: string;
|
|
16
|
-
/** Allow the in-place scaffold to replace
|
|
16
|
+
/** Allow the in-place scaffold to replace eve scaffold files that already exist. */
|
|
17
17
|
overwriteExisting?: boolean;
|
|
18
18
|
/**
|
|
19
|
-
* Headless mode: a headless re-run over an existing
|
|
19
|
+
* Headless mode: a headless re-run over an existing eve project skips
|
|
20
20
|
* scaffolding (idempotent re-entry); an interactive run always scaffolds and
|
|
21
21
|
* lets `scaffoldBaseProject` own the in-place conflict rules. The box prompts
|
|
22
22
|
* for nothing, so this dispatch comes from the composition site.
|
|
@@ -25,7 +25,7 @@ export interface ScaffoldOptions {
|
|
|
25
25
|
deps?: ScaffoldDeps;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Whether the run is headless. A headless re-run over an existing
|
|
28
|
+
* Whether the run is headless. A headless re-run over an existing eve project
|
|
29
29
|
* skips scaffolding (idempotent re-entry); an interactive run always scaffolds.
|
|
30
30
|
*/
|
|
31
31
|
export interface ScaffoldInput {
|
|
@@ -34,7 +34,7 @@ export interface ScaffoldInput {
|
|
|
34
34
|
/**
|
|
35
35
|
* THE SCAFFOLD BOX: writes the base agent template into the path resolved by
|
|
36
36
|
* the target box. It prompts for nothing; the gather only records which mode
|
|
37
|
-
* ran, because a headless re-run on an already-scaffolded
|
|
37
|
+
* ran, because a headless re-run on an already-scaffolded eve project skips the
|
|
38
38
|
* write and continues setup instead of failing.
|
|
39
39
|
*/
|
|
40
40
|
export declare function scaffold(options: ScaffoldOptions): SetupBox<SetupState, ScaffoldInput, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CURRENT_DIRECTORY_PROJECT_NAME,requireProjectPath}from"../state.js";import{isEveProject,scaffoldBaseProject}from"#setup/scaffold/index.js";function scaffold(i){let a=i.deps??{scaffoldBaseProject,isEveProject};return{id:`scaffold`,async gather(){return{headless:i.headless??!1}},async perform({state:n,input:r}){let{prompter:o}=i,s=n.projectPath.inPlace?CURRENT_DIRECTORY_PROJECT_NAME:n.agentName,c=requireProjectPath(n);if(r.headless&&!i.overwriteExisting&&await a.isEveProject(c))return o.log.message(`Existing
|
|
1
|
+
import{CURRENT_DIRECTORY_PROJECT_NAME,requireProjectPath}from"../state.js";import{isEveProject,scaffoldBaseProject}from"#setup/scaffold/index.js";function scaffold(i){let a=i.deps??{scaffoldBaseProject,isEveProject};return{id:`scaffold`,async gather(){return{headless:i.headless??!1}},async perform({state:n,input:r}){let{prompter:o}=i,s=n.projectPath.inPlace?CURRENT_DIRECTORY_PROJECT_NAME:n.agentName,c=requireProjectPath(n);if(r.headless&&!i.overwriteExisting&&await a.isEveProject(c))return o.log.message(`Existing eve project detected; continuing setup...`),c;o.log.message(`Scaffolding project files...`);let l=await a.scaffoldBaseProject({projectName:s,model:n.modelId,byokProvider:n.modelWiring===`self`,targetDirectory:i.targetDirectory,overwriteExisting:i.overwriteExisting,onOverwriteFile:e=>o.log.warning(`Overwrote ${e}`),evePackage:i.evePackage});return o.log.success(`Scaffolded project at ${l}`),l},apply(e,t){return{...e,projectPath:{kind:`resolved`,inPlace:e.projectPath.inPlace,path:t}}}}}export{scaffold};
|
|
@@ -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";import{isNextJsProject}from"#setup/scaffold/index.js";const SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH=`channels/eve.ts`;async function inspectExistingChannelRegistrations(a){let o=join(a,`agent`),[{manifest:s},c]=await Promise.all([discoverAgent({agentRoot:o,appRoot:a}),isNextJsProject(a)]),l=new Set,u=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&&l.add(t.logicalPath),n.adapterKind===`slack`&&u.add(t.logicalPath))}let d={};return[...l].some(e=>e!==SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH)&&(d.web=`POST ${EVE_CREATE_SESSION_ROUTE_PATH} already registered`),u.size>0&&(d.slack=`Slack channel already registered`),{disabledChannelReasons:d,webRouteOwners:[...l],slackOwners:[...u],webAppPresent:c}}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";import{isNextJsProject}from"#setup/scaffold/index.js";const SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH=`channels/eve.ts`;async function inspectExistingChannelRegistrations(a){let o=join(a,`agent`),[{manifest:s},c]=await Promise.all([discoverAgent({agentRoot:o,appRoot:a}),isNextJsProject(a)]),l=new Set,u=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&&l.add(t.logicalPath),n.adapterKind===`slack`&&u.add(t.logicalPath))}let d={};return[...l].some(e=>e!==SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH)&&(d.web=`POST ${EVE_CREATE_SESSION_ROUTE_PATH} already registered`),u.size>0&&(d.slack=`Slack channel already registered`),{disabledChannelReasons:d,webRouteOwners:[...l],slackOwners:[...u],webAppPresent:c}}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};
|
|
@@ -38,7 +38,7 @@ export interface RailLog extends ChannelSetupLog {
|
|
|
38
38
|
spinner(message: string): RailSpinner;
|
|
39
39
|
settle(): void;
|
|
40
40
|
}
|
|
41
|
-
/** Options for the shared live rail log used by both
|
|
41
|
+
/** Options for the shared live rail log used by both eve onboarding entry points. */
|
|
42
42
|
export interface RailLogOptions {
|
|
43
43
|
colors: PromptColors;
|
|
44
44
|
output: PromptOutput;
|
|
@@ -37,7 +37,7 @@ export interface ModelFlowDeps {
|
|
|
37
37
|
* How the agent's model is backed right now, as far as the local directory
|
|
38
38
|
* shows: a linked Vercel project, a gateway credential in an env file, or
|
|
39
39
|
* nothing detectable. An external provider (own ANTHROPIC_API_KEY etc.)
|
|
40
|
-
* leaves no marker
|
|
40
|
+
* leaves no marker eve owns, so it reads as `unset`.
|
|
41
41
|
*/
|
|
42
42
|
export type ModelProviderStatus = {
|
|
43
43
|
kind: "unset";
|
|
@@ -88,10 +88,8 @@ export declare function detectModelProviderStatus(appRoot: string, options?: Pro
|
|
|
88
88
|
* choice into `agent.ts` (activation is the dev server's HMR watcher).
|
|
89
89
|
* The provider row runs {@link runVercelFlow} — the provider gate (AI
|
|
90
90
|
* Gateway or your own), then link-or-paste-a-key.
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* reports it exactly like the channels flow (the effects already happened);
|
|
94
|
-
* only an empty exit folds to cancelled.
|
|
91
|
+
* Completed model and provider changes return to the prompt with their result.
|
|
92
|
+
* Cancelled flows and external-provider instructions return to the menu.
|
|
95
93
|
*/
|
|
96
94
|
export declare function runModelFlow(input: {
|
|
97
95
|
appRoot: string;
|
|
@@ -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{interactiveAsker}from"../ask.js";import{detectProjectIdentity}from"../project-resolution.js";import{snapshotSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{fetchGatewayCatalog,selectModel}from"../boxes/select-model.js";import{runInteractive}from"../runner.js";import{inProjectSetupState,prompterSink}from"./in-project.js";import{runVercelFlow}from"./vercel.js";import{join}from"node:path";import{discoverAgent}from"#discover/discover-agent.js";import{inspectApplication}from"#services/inspect-application.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{createStaticSourceChange}from"#source-change/static-source-change.js";var import_picocolors=__toESM(require_picocolors(),1);const MODEL_MENU_MESSAGE=``;function providerStatusHint(e,t=e=>e){return e.kind===`gateway-project`?`AI Gateway (Linked to ${e.teamName===void 0?t(e.projectName):`${t(e.projectName)} in ${t(e.teamName)}`})`:`AI Gateway (${e.envKey} in ${e.envFile})`}function modelMenuRows(e,t,n,r){let i;r?(i={value:`model`,label:`Change model`},e!==null&&(i.hint=e)):i={value:`model`,label:`Change model`,disabled:!0,description:`Set via an SDK model call in agent.ts; edit the source to change it`};let a;return a=n?.kind===`external`?{value:`provider`,label:`Change provider`,disabled:!0,description:`Disabled in external endpoint mode`}:t.kind===`unset`?{value:`provider`,label:import_picocolors.default.bold(import_picocolors.default.yellow(`Configure provider`)),hint:`Required to enable the agent`,accent:`warning`}:{value:`provider`,label:`Change provider`,hint:providerStatusHint(t,import_picocolors.default.bold)},[i,a,{value:`done`,label:`Done`}]}
|
|
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{interactiveAsker}from"../ask.js";import{detectProjectIdentity}from"../project-resolution.js";import{snapshotSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{fetchGatewayCatalog,selectModel}from"../boxes/select-model.js";import{runInteractive}from"../runner.js";import{inProjectSetupState,prompterSink}from"./in-project.js";import{runVercelFlow}from"./vercel.js";import{join}from"node:path";import{discoverAgent}from"#discover/discover-agent.js";import{inspectApplication}from"#services/inspect-application.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{createStaticSourceChange}from"#source-change/static-source-change.js";var import_picocolors=__toESM(require_picocolors(),1);const MODEL_MENU_MESSAGE=``;function providerStatusHint(e,t=e=>e){return e.kind===`gateway-project`?`AI Gateway (Linked to ${e.teamName===void 0?t(e.projectName):`${t(e.projectName)} in ${t(e.teamName)}`})`:`AI Gateway (${e.envKey} in ${e.envFile})`}function modelMenuRows(e,t,n,r){let i;r?(i={value:`model`,label:`Change model`},e!==null&&(i.hint=e)):i={value:`model`,label:`Change model`,disabled:!0,description:`Set via an SDK model call in agent.ts; edit the source to change it`};let a;return a=n?.kind===`external`?{value:`provider`,label:`Change provider`,disabled:!0,description:`Disabled in external endpoint mode`}:t.kind===`unset`?{value:`provider`,label:import_picocolors.default.bold(import_picocolors.default.yellow(`Configure provider`)),hint:`Required to enable the agent`,accent:`warning`}:{value:`provider`,label:`Change provider`,hint:providerStatusHint(t,import_picocolors.default.bold)},[i,a,{value:`done`,label:`Done`}]}async function detectModelProviderStatus(e,t={}){let[n,i,a]=await Promise.all([detectProjectIdentity(e,t),findEnvFileWithKey(e,`AI_GATEWAY_API_KEY`),findEnvFileWithKey(e,`VERCEL_OIDC_TOKEN`)]);if(n!==void 0){let e={kind:`gateway-project`,projectName:n.projectName};return n.teamName!==void 0&&(e.teamName=n.teamName),e}return i===void 0?a===void 0?{kind:`unset`}:{kind:`gateway-key`,envKey:`VERCEL_OIDC_TOKEN`,envFile:a}:{kind:`gateway-key`,envKey:`AI_GATEWAY_API_KEY`,envFile:i}}async function runModelFlow(e){let{appRoot:t,prompter:n,signal:r}=e,i={readCurrentModel:readCurrentAgentModel,applyModel:changeAgentModel,detectProviderStatus:detectModelProviderStatus,runVercelFlow,...e.deps};async function checkProject(e){let t=n.log.spinner?.(`Checking the project…`);try{return await e()}finally{t?.stop()}}let detectProvider=()=>i.detectProviderStatus(t,{signal:r}),[{id:o,routing:s,editable:c},l]=await checkProject(()=>Promise.all([i.readCurrentModel(t),detectProvider()]));r?.throwIfAborted();let u,d,p=s?.kind===`external`?{tone:`warning`,text:"`agent.ts` specifies a model provider directly. In-TUI configuration is restricted to AI Gateway endpoints."}:void 0,m=l.kind===`unset`&&s?.kind!==`external`?`provider`:c?`model`:s?.kind===`external`?`done`:`provider`;for(;;){let e;try{e=await n.select({message:``,options:modelMenuRows(o,l,s,c),hintLayout:`stacked`,initialValue:m,notices:p===void 0?[]:[p]})}catch(e){if(!(e instanceof WizardCancelledError))throw e;break}if(e===`done`)break;if(e===`model`){let e=await pickModelFromCatalog({appRoot:t,prompter:n,current:o,signal:r,deps:i.selectModel});if(e===void 0){m=`model`;continue}r?.throwIfAborted(),u=await i.applyModel({appRoot:t,slug:e}),r?.throwIfAborted();break}let f=await i.runVercelFlow({appRoot:t,prompter:n,signal:r});if(r?.throwIfAborted(),f.kind===`cancelled`){m=`provider`;continue}if(`outcome`in f){m=`done`;continue}l=await checkProject(detectProvider),r?.throwIfAborted(),d={status:l},f.credential!==void 0&&(d.credential=f.credential);break}if(u===void 0&&d===void 0)return{kind:`cancelled`};let h={kind:`done`};return u!==void 0&&(h.modelMessage=formatApplyModelOutcome(u)),d!==void 0&&(h.providerOutcome=d),h}async function pickModelFromCatalog(e){let{appRoot:t,prompter:r,current:a,signal:o}=e,f=e.deps?.fetchModels??fetchGatewayCatalog,p={asker:interactiveAsker(r),deps:{fetchModels:async e=>{let t=r.log.spinner?.(`Loading the model catalog...`);try{return await f(e)}finally{t?.stop()}}}};a!==null&&(p.defaultModel=a);let m=await runInteractive([selectModel(p)],inProjectSetupState(t,{kind:`unresolved`}),prompterSink(r),{snapshot:snapshotSetupState,signal:o});return m.kind===`cancelled`?void 0:m.state.modelId}function formatApplyModelOutcome(e){switch(e.kind){case`changed`:return`Model changed to ${import_picocolors.default.bold(e.to)}. Live on your next prompt.`;case`unchanged`:return`Model is already \`${e.model}\`.`;case`rejected`:return e.message}}async function changeAgentModel(e){let{appRoot:t,slug:n}=e,r=await validateModelSlug(t,n);if(r!==null)return{kind:`rejected`,message:r};let{manifest:i}=await discoverAgent({agentRoot:join(t,`agent`),appRoot:t}),a=await createStaticSourceChange(i).updateModelName(n);return a.kind===`bail`?{kind:`rejected`,message:`Couldn't edit ${a.at.logicalPath}: ${a.reason}. Change \`model\` by hand.`}:a.from===a.to?{kind:`unchanged`,model:a.to}:{kind:`changed`,to:a.to}}async function validateModelSlug(e,t){if(!t.includes(`/`))return`\`${t}\` isn't a provider/model id (e.g. anthropic/claude-sonnet-4.6).`;let n=createCompiledRuntimeModelCatalogLoader(e);try{if(await n.getModelLimits(formatLanguageModelGatewayId(t))===null)return`I couldn't confirm \`${t}\` in the AI Gateway model catalog, so I didn't change agent.ts.`}catch{return null}return null}async function readCurrentAgentModel(e){try{let{compiledState:t}=await inspectApplication(e),n=t?.manifest.config.model;return{id:n?.id??null,routing:n?.routing??null,editable:n!==void 0&&n.source===void 0}}catch{return{id:null,routing:null,editable:!1}}}async function modelChangeRefusalForUneditableModel(e){let{editable:t,routing:n}=await readCurrentAgentModel(e);return t?null:`Model is set via ${n?.kind===`external`?`the external provider \`${n.provider}\``:`an SDK model call`} in agent.ts, not a string literal; /model can't rewrite it. Edit \`model\` in agent.ts.`}export{MODEL_MENU_MESSAGE,changeAgentModel,detectModelProviderStatus,formatApplyModelOutcome,modelChangeRefusalForUneditableModel,runModelFlow};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** An authored Node.js engine value replaced by
|
|
1
|
+
/** An authored Node.js engine value replaced by eve's selected scaffold major. */
|
|
2
2
|
export interface NodeEngineOverride {
|
|
3
3
|
previous: unknown;
|
|
4
4
|
next: string;
|
|
@@ -13,19 +13,19 @@ export type NodeEngineReconciliation = {
|
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* The single-major `engines.node` value a generated project should declare,
|
|
16
|
-
* derived from
|
|
16
|
+
* derived from eve's required range — e.g. `">=24"` → `"24.x"`. A scaffolded
|
|
17
17
|
* app is a deployment artifact, not a library: Vercel reads `engines.node` to
|
|
18
18
|
* pick the build's Node and resolves an open range to the newest *supported*
|
|
19
19
|
* major, so `">=24"` would float onto a future major as Vercel widens its set,
|
|
20
20
|
* whereas `"24.x"` stays on major 24 while still taking minor/patch updates.
|
|
21
|
-
*
|
|
21
|
+
* eve's own package keeps the open range; only generated apps pin.
|
|
22
22
|
*/
|
|
23
23
|
export declare function pinnedNodeEngineMajor(requiredRange: string): string;
|
|
24
24
|
/**
|
|
25
25
|
* Reconciles an authored `engines.node` value with the single Node.js major
|
|
26
|
-
* selected for scaffolded
|
|
26
|
+
* selected for scaffolded eve projects. Existing ranges are preserved only
|
|
27
27
|
* when every version they permit remains inside that selected major.
|
|
28
28
|
*/
|
|
29
29
|
export declare function reconcileNodeEngine(existingValue: unknown, requiredRange: string): NodeEngineReconciliation;
|
|
30
|
-
/** Formats the warning shown when
|
|
30
|
+
/** Formats the warning shown when eve replaces an incompatible Node.js engine value. */
|
|
31
31
|
export declare function formatNodeEngineOverrideWarning(override: NodeEngineOverride): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import semver from"#compiled/semver/index.js";const{Range,intersects,minVersion,subset,validRange}=semver;function isNonEmptySubset(e,t){let r=validRange(e);return r!==null&&intersects(r,t)&&subset(r,t)}function nextAllowedMajor(e,n){let i=`>=${n+1}.0.0`,a;for(let n of new Range(e).set){let e=minVersion([...n.map(e=>e.value).filter(Boolean),i].join(` `));e!==null&&(a===void 0||e.major<a)&&(a=e.major)}return a}function pinnedNodeEngineMajor(e){let t=validRange(e);if(t===null)throw Error(`
|
|
1
|
+
import semver from"#compiled/semver/index.js";const{Range,intersects,minVersion,subset,validRange}=semver;function isNonEmptySubset(e,t){let r=validRange(e);return r!==null&&intersects(r,t)&&subset(r,t)}function nextAllowedMajor(e,n){let i=`>=${n+1}.0.0`,a;for(let n of new Range(e).set){let e=minVersion([...n.map(e=>e.value).filter(Boolean),i].join(` `));e!==null&&(a===void 0||e.major<a)&&(a=e.major)}return a}function pinnedNodeEngineMajor(e){let t=validRange(e);if(t===null)throw Error(`eve declares an invalid Node.js engine range: "${e}".`);let n=minVersion(t);if(n===null)throw Error(`eve declares an empty Node.js engine range: "${e}".`);let i=n.major;for(;i!==void 0;){let e=`${i}.x`;if(isNonEmptySubset(e,t))return e;i=nextAllowedMajor(t,i)}throw Error(`eve's Node.js engine range "${e}" cannot be represented by a major pin without widening it.`)}function reconcileNodeEngine(e,t){let n=pinnedNodeEngineMajor(t);return e===void 0?{kind:`added`,next:n}:typeof e==`string`&&isNonEmptySubset(e,n)?{kind:`unchanged`}:{kind:`overridden`,previous:e,next:n}}function formatPackageJsonValue(e){return JSON.stringify(e)??String(e)}function formatNodeEngineOverrideWarning(e){return`Overrode package.json engines.node from ${formatPackageJsonValue(e.previous)} to "${e.next}" because the previous value was not confined to the Node.js major selected by eve.`}export{formatNodeEngineOverrideWarning,pinnedNodeEngineMajor,reconcileNodeEngine};
|
|
@@ -32,7 +32,7 @@ export interface OnboardingBoxesOptions {
|
|
|
32
32
|
targetDirectory?: string;
|
|
33
33
|
/** Scaffold into cwd or targetDirectory instead of creating a child directory. */
|
|
34
34
|
inPlace?: boolean;
|
|
35
|
-
/** Allow the in-place scaffold to replace
|
|
35
|
+
/** Allow the in-place scaffold to replace eve scaffold files that already exist. */
|
|
36
36
|
overwriteExisting?: boolean;
|
|
37
37
|
/** Skip the post-channel Vercel deployment entirely. */
|
|
38
38
|
presetNoDeploy?: boolean;
|
|
@@ -42,7 +42,7 @@ export interface OnboardingBoxesOptions {
|
|
|
42
42
|
* setup remains an interactive/onboarding handoff, not a headless flow.
|
|
43
43
|
*/
|
|
44
44
|
headless?: boolean;
|
|
45
|
-
/**
|
|
45
|
+
/** eve package metadata baked into the scaffolded `package.json`. */
|
|
46
46
|
evePackage?: EvePackageContract;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export declare function parseWebUrl(candidate: string): string | undefined;
|
|
7
7
|
/**
|
|
8
8
|
* Opens a URL in the user's default browser, best-effort and fire-and-forget.
|
|
9
|
-
* Used where
|
|
9
|
+
* Used where eve owns the hand-off (e.g. pointing the user at their Slack
|
|
10
10
|
* workspace after a deploy) rather than relying on a child CLI to open it. A
|
|
11
11
|
* missing or failing opener is never fatal: callers still print the URL for the
|
|
12
12
|
* user to open by hand.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pathExists}from"../../path-exists.js";import{existsSync,realpathSync}from"node:fs";import{dirname,extname,join,resolve}from"node:path";import{readFile,writeFile}from"node:fs/promises";const PNPM_WORKSPACE_PATH=`pnpm-workspace.yaml`,PNPM_WORKSPACE_MEMBERSHIP_ARGUMENTS=[`list`,`--depth`,`-1`,`--json`],PNPM_WORKSPACE_CONTENT=[`minimumReleaseAgeExclude:`,` - eve`,`allowBuilds:`,` sharp: false`,`# Compatibility for
|
|
1
|
+
import{pathExists}from"../../path-exists.js";import{existsSync,realpathSync}from"node:fs";import{dirname,extname,join,resolve}from"node:path";import{readFile,writeFile}from"node:fs/promises";const PNPM_WORKSPACE_PATH=`pnpm-workspace.yaml`,PNPM_WORKSPACE_MEMBERSHIP_ARGUMENTS=[`list`,`--depth`,`-1`,`--json`],PNPM_WORKSPACE_CONTENT=[`minimumReleaseAgeExclude:`,` - eve`,`allowBuilds:`,` sharp: false`,`# Compatibility for eve releases with an incomplete runtime manifest.`,`packageExtensions:`,` "eve@>=0.6.0-beta.13 <=0.7.0":`,` dependencies:`,` oxc-parser: 0.134.0`,``].join(`
|
|
2
2
|
`),EVE_RELEASE_AGE_EXCLUSION=` - eve`,SHARP_BUILD_POLICY=` sharp: false`;function findYamlBlockEnd(e,t){let n=t+1;for(;n<e.length;){let t=e[n]??``;if(t.length>0&&!t.startsWith(` `)&&!t.startsWith(` `))break;n+=1}return n}function withSharpBuildPolicy(e){let t=e.endsWith(`
|
|
3
3
|
`)?e:`${e}\n`,n=t.split(`
|
|
4
4
|
`),r=n.findIndex(e=>e===`allowBuilds:`);if(r<0)return`${t.trim().length===0?``:`${t}\n`}allowBuilds:\n${SHARP_BUILD_POLICY}\n`;let i=findYamlBlockEnd(n,r);if(n.slice(r+1,i).some(e=>/^\s+sharp:/.test(e)))return e;let a=i;for(;a>r+1&&n[a-1]===``;)--a;return n.splice(a,0,SHARP_BUILD_POLICY),n.join(`
|
|
@@ -29,7 +29,7 @@ export interface RunInstallOptions extends RunPackageManagerOptions, PackageMana
|
|
|
29
29
|
* before installation, so exactly one correctly scoped install runs.
|
|
30
30
|
*/
|
|
31
31
|
export declare function runPackageManagerInstall(kind: PackageManagerKind, projectRoot: string, options?: RunInstallOptions): Promise<boolean>;
|
|
32
|
-
/** The argv that runs the locally installed
|
|
32
|
+
/** The argv that runs the locally installed eve binary's `dev` command. */
|
|
33
33
|
export declare function eveDevArguments(kind: PackageManagerKind): readonly string[];
|
|
34
34
|
/** Compatibility wrapper for callers that still explicitly require pnpm. */
|
|
35
35
|
export declare function spawnPnpm(projectRoot: string, args: readonly string[], options?: RunPackageManagerOptions): Promise<boolean>;
|
|
@@ -29,7 +29,7 @@ export interface PackageManagerStrategy {
|
|
|
29
29
|
readonly scaffoldFiles: Readonly<Record<string, string>>;
|
|
30
30
|
/** Adds or reconciles manager-owned configuration in an existing project. */
|
|
31
31
|
applyProjectConfiguration(projectRoot: string): Promise<PackageManagerConfigurationResult>;
|
|
32
|
-
/** Arguments that run the project-local
|
|
32
|
+
/** Arguments that run the project-local eve development command. */
|
|
33
33
|
devArguments(): readonly string[];
|
|
34
34
|
/** Arguments that install project dependencies. */
|
|
35
35
|
installArguments(options: PackageManagerInstallOptions): readonly string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Build-time catalog of known
|
|
2
|
+
* Build-time catalog of known eve connections. Each entry drives both the
|
|
3
3
|
* `eve connections add` picker and the per-entry scaffold template.
|
|
4
4
|
*
|
|
5
5
|
* Connection *identity* (slug, label, transport, description) is owned by
|
|
@@ -22,8 +22,8 @@ export interface AddAgentToProjectResult {
|
|
|
22
22
|
nodeEngineOverride?: NodeEngineOverride;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Adds an
|
|
26
|
-
* missing runtime dependencies, reconciles `engines.node` with
|
|
25
|
+
* Adds an eve agent to an existing package: writes the `agent/` files, adds
|
|
26
|
+
* missing runtime dependencies, reconciles `engines.node` with eve's
|
|
27
27
|
* requirement, and applies the selected package manager's project
|
|
28
28
|
* configuration. Other host configuration (tsconfig, scripts, ignore files)
|
|
29
29
|
* remains untouched. All conflicts are gathered and reported before anything
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getPackageManagerStrategy}from"../../primitives/pm/index.js";import{pathExists,writeTextFile}from"../files.js";import{patchPackageJson}from"../update/package-json.js";import{resolveVersionToken}from"../version-tokens.js";import{agentTemplateFiles,formatEveDependencySpecifier,resolveEvePackageContract}from"./project.js";import{join}from"node:path";import{readFile}from"node:fs/promises";const DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`];function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hasDeclaredDependency(e,t){if(!isJsonObject(e))return!1;for(let n of DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function addAgentToProject(i){let a=join(i.projectRoot,`package.json`);if(!await pathExists(a))throw Error(`Cannot add an
|
|
1
|
+
import{getPackageManagerStrategy}from"../../primitives/pm/index.js";import{pathExists,writeTextFile}from"../files.js";import{patchPackageJson}from"../update/package-json.js";import{resolveVersionToken}from"../version-tokens.js";import{agentTemplateFiles,formatEveDependencySpecifier,resolveEvePackageContract}from"./project.js";import{join}from"node:path";import{readFile}from"node:fs/promises";const DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`];function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hasDeclaredDependency(e,t){if(!isJsonObject(e))return!1;for(let n of DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function addAgentToProject(i){let a=join(i.projectRoot,`package.json`);if(!await pathExists(a))throw Error(`Cannot add an eve agent to "${i.projectRoot}" because it has no package.json. Run \`eve init <name>\` to create a new project instead.`);let o=agentTemplateFiles(i.model),s=[];for(let e of Object.keys(o))await pathExists(join(i.projectRoot,e))&&s.push(e);if(s.length===0&&await pathExists(join(i.projectRoot,`agent`))&&s.push(`agent/`),s.length>0)throw Error(`Cannot add an eve agent to "${i.projectRoot}" because it already has: ${s.join(`, `)}. Move them aside first.`);let c=resolveEvePackageContract(i.evePackage),l=resolveVersionToken(`aiPackageVersion`,i.aiPackageVersion??`7.0.0-beta.178`),u=resolveVersionToken(`connectPackageVersion`,i.connectPackageVersion??`0.2.2`),d=resolveVersionToken(`zodPackageVersion`,i.zodPackageVersion??`4.4.3`),f=[];for(let[e,t]of Object.entries(o)){let r=join(i.projectRoot,e);await writeTextFile(r,t),f.push(r)}let p=JSON.parse(await readFile(a,`utf8`)),m={"@vercel/connect":u,ai:l,eve:formatEveDependencySpecifier(c.version),zod:d},h={};for(let[e,t]of Object.entries(m))hasDeclaredDependency(p,e)||(h[e]=t);let g={nodeEngineRequirement:c.nodeEngine};Object.keys(h).length>0&&(g.dependencies=h);let _=await patchPackageJson(a,g);return await getPackageManagerStrategy(i.packageManager??`pnpm`).applyProjectConfiguration(i.projectRoot),{filesWritten:f,dependenciesAdded:Object.keys(h).sort(),nodeEngineOverride:_.nodeEngineOverride}}export{addAgentToProject};
|
|
@@ -4,19 +4,19 @@ export declare const DEFAULT_AI_PACKAGE_VERSION = "__AI_SDK_VERSION__";
|
|
|
4
4
|
export declare const DEFAULT_CONNECT_PACKAGE_VERSION = "__VERCEL_CONNECT_VERSION__";
|
|
5
5
|
export declare const DEFAULT_ZOD_PACKAGE_VERSION = "__ZOD_VERSION__";
|
|
6
6
|
/**
|
|
7
|
-
* The
|
|
7
|
+
* The eve package metadata that generated projects consume together. Keeping
|
|
8
8
|
* the dependency version and Node.js requirement in one value prevents a
|
|
9
|
-
* scaffold from installing one
|
|
9
|
+
* scaffold from installing one eve release while declaring another release's
|
|
10
10
|
* runtime contract.
|
|
11
11
|
*/
|
|
12
12
|
export interface EvePackageContract {
|
|
13
|
-
/**
|
|
13
|
+
/** eve dependency version or npm specifier written to the generated package. */
|
|
14
14
|
version: string;
|
|
15
|
-
/** The matching
|
|
15
|
+
/** The matching eve release's authored `package.json` `engines.node` value. */
|
|
16
16
|
nodeEngine: string;
|
|
17
17
|
}
|
|
18
18
|
export declare const DEFAULT_EVE_PACKAGE_CONTRACT: EvePackageContract;
|
|
19
|
-
/** Resolves a stamped or explicitly supplied
|
|
19
|
+
/** Resolves a stamped or explicitly supplied eve package contract. */
|
|
20
20
|
export declare function resolveEvePackageContract(contract?: EvePackageContract): EvePackageContract;
|
|
21
21
|
/**
|
|
22
22
|
* Provider slug a gateway model id routes through: the segment before the
|