eve 0.38.3 → 0.39.1
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 +36 -0
- package/dist/src/channel/channel-address.d.ts +1 -1
- package/dist/src/channel/channel-operations.d.ts +4 -3
- package/dist/src/channel/channel-operations.js +1 -1
- package/dist/src/chunks/{use-eve-agent-BbSsu99c.js → use-eve-agent-CTI9fHaO.js} +32 -0
- package/dist/src/chunks/{use-eve-agent-Dt8Y5QtW.js → use-eve-agent-DlkXRQVo.js} +32 -0
- package/dist/src/cli/application-command.d.ts +2 -0
- package/dist/src/cli/application-root.d.ts +3 -1
- package/dist/src/cli/application-root.js +1 -1
- package/dist/src/cli/commands/agent-instructions.d.ts +2 -0
- package/dist/src/cli/commands/agent-instructions.js +4 -3
- package/dist/src/cli/commands/channels.d.ts +2 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/deploy.d.ts +7 -5
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/init-git.d.ts +5 -3
- package/dist/src/cli/commands/init-git.js +1 -1
- package/dist/src/cli/commands/init-target.d.ts +2 -3
- package/dist/src/cli/commands/init-target.js +2 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.js +1 -1
- package/dist/src/cli/commands/integration-setup.js +1 -1
- package/dist/src/cli/commands/link.d.ts +4 -4
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/register-project-commands.js +1 -1
- package/dist/src/cli/commands/registry-recovery.d.ts +1 -1
- package/dist/src/cli/commands/registry-recovery.js +1 -1
- package/dist/src/cli/commands/set.d.ts +0 -2
- package/dist/src/cli/commands/set.js +1 -1
- package/dist/src/cli/commands/vercel-non-interactive.d.ts +25 -0
- package/dist/src/cli/commands/vercel-non-interactive.js +1 -0
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/provider-picker.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +2 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +2 -0
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/setup-issues.d.ts +1 -1
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +3 -3
- package/dist/src/cli/run.d.ts +3 -4
- package/dist/src/cli/run.js +2 -2
- package/dist/src/cli/ui/alt-screen.d.ts +9 -3
- package/dist/src/cli/ui/alt-screen.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +12 -0
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/index.d.ts +1 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +14 -14
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +4 -0
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-helpers.js +1 -1
- package/dist/src/compiler/normalize-sandbox.d.ts +1 -0
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/context/keys.d.ts +2 -0
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/providers/sandbox.js +1 -1
- package/dist/src/discover/connections.js +1 -1
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/discover-subagent.js +1 -1
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/grammar.js +1 -1
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/discover/named-source-directory.js +1 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/discover/sandbox.js +1 -1
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/evals/mock-model.d.ts +3 -3
- package/dist/src/evals/mock-model.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +2 -0
- package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +7 -5
- package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -2
- package/dist/src/execution/sandbox/bindings/local.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/local.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/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/subagent-event-proxy-step.js +1 -1
- package/dist/src/execution/subagent-start-local.d.ts +1 -0
- package/dist/src/execution/subagent-start-local.js +1 -1
- package/dist/src/execution/subagent-tool.d.ts +22 -0
- package/dist/src/execution/subagent-tool.js +1 -1
- package/dist/src/execution/tasks/parent/agent-views.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/hitl/approval-prompt.d.ts +11 -0
- package/dist/src/harness/hitl/approval-prompt.js +2 -0
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/materialized-authored-modules.d.ts +19 -1
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.d.ts +3 -11
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +2 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/resolve-model-endpoint-status.d.ts +6 -14
- package/dist/src/internal/resolve-model-endpoint-status.js +1 -1
- package/dist/src/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +4 -4
- package/dist/src/protocol/message.d.ts +31 -2
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/public/channels/slack/defaults.js +2 -2
- package/dist/src/public/channels/slack/hitl.d.ts +1 -0
- package/dist/src/public/channels/slack/hitl.js +1 -1
- package/dist/src/public/channels/slack/input-response.d.ts +5 -1
- package/dist/src/public/channels/slack/input-response.js +1 -1
- package/dist/src/public/channels/slack/interactions.d.ts +3 -17
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/privacy.d.ts +8 -0
- package/dist/src/public/channels/slack/privacy.js +1 -0
- package/dist/src/public/channels/slack/session-operations.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +5 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/definitions/hook.d.ts +1 -0
- package/dist/src/public/definitions/sandbox.d.ts +23 -4
- package/dist/src/public/definitions/sandbox.js +1 -1
- package/dist/src/public/models/openai/chatgpt/auth.d.ts +2 -67
- package/dist/src/public/models/openai/chatgpt/auth.js +1 -1
- package/dist/src/public/models/openai/chatgpt/codex-app-server.d.ts +40 -0
- package/dist/src/public/models/openai/chatgpt/codex-app-server.js +1 -0
- package/dist/src/public/models/openai/chatgpt/token-broker.d.ts +33 -0
- package/dist/src/public/models/openai/chatgpt/token-broker.js +1 -0
- package/dist/src/public/models/openai/chatgpt/transport.d.ts +5 -14
- package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
- package/dist/src/public/models/openai/index.d.ts +5 -8
- package/dist/src/public/models/openai/index.js +1 -1
- package/dist/src/public/sandbox/backends/default.d.ts +1 -1
- package/dist/src/public/sandbox/backends/default.js +1 -1
- package/dist/src/public/sandbox/index.d.ts +1 -1
- package/dist/src/runtime/framework-tools/glob.js +1 -1
- package/dist/src/runtime/framework-tools/grep.js +1 -1
- package/dist/src/runtime/framework-tools/index.d.ts +2 -0
- package/dist/src/runtime/framework-tools/index.js +1 -1
- package/dist/src/runtime/framework-tools/read-file.js +1 -1
- package/dist/src/runtime/framework-tools/skill.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/registry.d.ts +6 -0
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +1 -0
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/flows/chatgpt-auth.d.ts +2 -0
- package/dist/src/setup/flows/chatgpt-auth.js +1 -0
- package/dist/src/setup/flows/deploy.d.ts +4 -0
- package/dist/src/setup/flows/deploy.js +1 -1
- package/dist/src/setup/flows/install-vercel-cli.js +1 -1
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/flows/model.d.ts +18 -28
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/provider.d.ts +18 -32
- package/dist/src/setup/flows/provider.js +4 -4
- package/dist/src/setup/integrations/shared/scaffold.js +1 -1
- package/dist/src/setup/primitives/index.d.ts +2 -1
- package/dist/src/setup/primitives/index.js +1 -1
- package/dist/src/setup/primitives/pm/process-result.d.ts +34 -0
- package/dist/src/setup/primitives/pm/process-result.js +1 -0
- package/dist/src/setup/primitives/pm/run.d.ts +24 -21
- package/dist/src/setup/primitives/pm/run.js +1 -1
- package/dist/src/setup/provider-settings.d.ts +12 -0
- package/dist/src/setup/provider-settings.js +1 -0
- package/dist/src/setup/run-vercel-link.d.ts +1 -1
- package/dist/src/setup/run-vercel-link.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +1 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +77 -12
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +45 -14
- package/dist/src/setup/scaffold/update/channels.d.ts +1 -1
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/shared/chatgpt-model.d.ts +9 -0
- package/dist/src/shared/chatgpt-model.js +1 -0
- package/dist/src/shared/model-endpoint-status.d.ts +5 -0
- package/dist/src/source-change/apply-agent-model-settings.js +1 -1
- package/dist/src/source-change/apply-model-selection.d.ts +12 -0
- package/dist/src/source-change/apply-model-selection.js +2 -0
- package/dist/src/source-change/static-source-change.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tracing/agent-action-instrumentation.d.ts +1 -7
- package/dist/src/tracing/agent-action-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/otel-declaration.d.ts +1 -1
- package/dist/src/tracing/otel-registration.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +1 -1
- package/docs/channels/mcp.mdx +33 -19
- package/docs/channels/slack.mdx +3 -4
- package/docs/concepts/built-in-tools.md +215 -0
- package/docs/concepts/default-harness.md +6 -113
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/meta.json +1 -0
- package/docs/concepts/security-model.md +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +1 -0
- package/docs/guides/client/messages.mdx +2 -0
- package/docs/guides/client/streaming.mdx +1 -0
- package/docs/guides/dynamic-capabilities.md +1 -1
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/remote-agents.md +1 -1
- package/docs/reference/cli.md +9 -3
- package/docs/reference/typescript-api.md +47 -33
- package/docs/sandbox.mdx +21 -4
- package/docs/subagents/index.mdx +2 -2
- package/docs/subagents/meta.json +1 -1
- package/docs/tools/human-in-the-loop.md +3 -3
- package/docs/tools/overview.mdx +1 -1
- package/docs/tutorial/query-sample-data.mdx +25 -1
- package/package.json +1 -1
- package/dist/src/source-change/apply-model-name.d.ts +0 -25
- package/dist/src/source-change/apply-model-name.js +0 -1
- package/docs/subagents/workflow-tool.md +0 -88
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.39.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9965cfc: Use `@vercel/otel`'s automatic context propagators when no custom propagators are configured.
|
|
8
|
+
- 1d857ca: Report agent files, dependencies, and configuration files changed when `eve init` adds an agent to an existing project, including when dependency installation later fails.
|
|
9
|
+
- c9d3e25: Wait for tool approval settlement before marking Slack approval cards as answered, so rejected approval responses leave the shared card open.
|
|
10
|
+
- 075dc1f: Tell coding agents that content-only instruction edits do not require reading the framework docs, while preserving docs-first guidance for eve framework changes.
|
|
11
|
+
- c6d6b3e: Add non-interactive `eve link` and `eve deploy` options for linking a named Vercel project and deploying from CI or coding agents without terminal prompts.
|
|
12
|
+
- e739c28: Coding-agent `eve init` runs now report the selected model and generated instructions file without changing the interactive human flow.
|
|
13
|
+
- 8a3288d: Parent `agent.action` OpenTelemetry spans to their replay-stable `agent.step` boundary instead of directly to the turn.
|
|
14
|
+
- 69c6f12: Let parent agents process background-task notifications without requiring a user-visible channel message. Human messages and input responses remain required delivery.
|
|
15
|
+
- 7995d57: Add `ctx.isDMOrPrivateChannel()` to Slack message handlers so agents can detect DMs, group DMs, and private channels without parsing raw events or implementing their own Slack API fallback.
|
|
16
|
+
- 8180633: Use `Private message` as the Slack run title for DMs and private channels so sensitive message text never appears in run titles.
|
|
17
|
+
- 822dbff: Dev runtime generations now retain the compiled authored module graph instead of recursively copying the app and workspace source trees. Local rebuilds keep immutable runtime behavior while using substantially less disk space.
|
|
18
|
+
- 1473e2a: Capture package-manager command identity, termination, bounded in-memory output, and workspace probes as structured process results for consistent setup diagnostics.
|
|
19
|
+
- 97d166a: New eve projects now give coding agents direct documentation routes and a bounded authoring loop, including a local recipe for routine typed tools. This reduces redundant project and package discovery while preserving deeper guidance for approvals and other advanced behavior.
|
|
20
|
+
- e1ebb53: Emit durable `input.resolved` stream events with server-accepted human-input outcomes and responses so clients can persist and replay HITL state.
|
|
21
|
+
- f02bc3d: Keep pending tool approvals visible across follow-up turns and prevent those turns from issuing duplicate tool calls.
|
|
22
|
+
|
|
23
|
+
## 0.39.0
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- 00c0a26: Promote ChatGPT subscription models to the stable `chatgpt()` API with Codex-owned authentication, automatic token refresh, `eve dev` recovery through `codex login` or `/model`, setup/source-authoring support, and local-only deployment safeguards. The deprecated `experimental_chatgpt()` alias remains available.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 267a59a: Align the Sign in with Vercel Web Chat screen with eve's default status page while keeping the generated app name primary and Vercel branding confined to the authentication button.
|
|
32
|
+
- 7a140d4: Carry the one-run pnpm minimum-release-age bypass from dependency installation into the `eve init` development handoff so onboarding starts without a redundant policy failure.
|
|
33
|
+
- e8da571: Allow a child to return `parent.sandbox` from a `defineSandbox` callback, reusing the dispatching parent's live sandbox across agent sessions. Parent and child see the same files, processes, workspace, and sandbox home. A child that selects `parent.sandbox` cannot also declare managed workspace or skill resources; eve rejects that configuration before execution and requires either removing those resources or giving the child its own sandbox.
|
|
34
|
+
- 24f6c06: Eve now emits `workflow.stream.follow.read` spans while following newly created runs, measuring each event from its durable write timestamp to the reader without counting replayed events.
|
|
35
|
+
- 7a8f43b: Treat `eve init` targets as filesystem paths and classify non-empty targets before writing. When the generated initial Git commit fails, retain the repository and staged files and print the command to retry it.
|
|
36
|
+
- 4c1bd80: Remove `glob` and `grep` from the default agent tool set. Agents can opt into either sandbox search tool by exporting `defineGlobTool()` or `defineGrepTool()` from the corresponding tool file.
|
|
37
|
+
- 4af3b1e: Use canonical project discovery for project-scoped CLI commands, including instructions-only agents and commands invoked from descendant directories.
|
|
38
|
+
|
|
3
39
|
## 0.38.3
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -15,7 +15,7 @@ interface BaseChannelAddressDeliveryOptions {
|
|
|
15
15
|
}
|
|
16
16
|
/** Delivery options for a channel address whose continuation token is already bound. */
|
|
17
17
|
export type ChannelAddressDeliveryOptions<TState = undefined> = [TState] extends [undefined] ? BaseChannelAddressDeliveryOptions : BaseChannelAddressDeliveryOptions & {
|
|
18
|
-
readonly state?: TState
|
|
18
|
+
readonly state?: Partial<TState>;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Dynamic handle for whichever durable session currently owns one channel-local address.
|
|
@@ -22,19 +22,20 @@ interface BaseChannelSendOptions {
|
|
|
22
22
|
export type ChannelSendOptions<TState = undefined> = [TState] extends [undefined] ? BaseChannelSendOptions : BaseChannelSendOptions & {
|
|
23
23
|
readonly state: TState;
|
|
24
24
|
};
|
|
25
|
-
interface BaseChannelRespondOptions {
|
|
25
|
+
interface BaseChannelRespondOptions<TState = undefined> {
|
|
26
26
|
readonly auth: SessionAuthContext | null;
|
|
27
27
|
readonly context?: readonly string[];
|
|
28
28
|
readonly outputSchema?: JsonObject;
|
|
29
|
+
readonly state?: Partial<TState>;
|
|
29
30
|
}
|
|
30
31
|
/** Options for answering pending input requests at an existing continuation address. */
|
|
31
|
-
export type ChannelRespondOptions = BaseChannelRespondOptions
|
|
32
|
+
export type ChannelRespondOptions<TState = undefined> = BaseChannelRespondOptions<TState>;
|
|
32
33
|
/** Dynamic handle for whichever session currently owns one channel-local address. */
|
|
33
34
|
export interface ChannelSource<TState = undefined> {
|
|
34
35
|
/** Starts or resumes a turn with a user message. May create a session. */
|
|
35
36
|
send(message: string | UserContent, options: ChannelSendOptions<TState>): Promise<Session>;
|
|
36
37
|
/** Answers pending input requests. Never creates a session. */
|
|
37
|
-
respond(inputResponses: readonly InputResponse[], options: ChannelRespondOptions): Promise<Session>;
|
|
38
|
+
respond(inputResponses: readonly InputResponse[], options: ChannelRespondOptions<TState>): Promise<Session>;
|
|
38
39
|
/** Cooperatively cancels the active turn without creating a session. */
|
|
39
40
|
cancel(options?: {
|
|
40
41
|
readonly turnId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createChannelAddressFn}from"#channel/channel-address.js";const INTERNAL_CHANNEL_DELIVER=Symbol(`eve.internal.channel-deliver`);function createChannelOperations(n){let r=createChannelAddressFn(n);return{from(e){let n=r(e);return{async send(e,t){return await n.deliver({context:t.context,message:e,outputSchema:t.outputSchema},t)},async respond(e,t){if(e.length===0)throw Error(`respond() requires at least one input response.`);return await n.deliver({context:t.context,inputResponses:e,outputSchema:t.outputSchema},t)},async cancel(e){return await n.cancel(e)},async compact(){return await n.compact()},async clear(){return await n.clear()},async reset(e){return await n.reset(e)},async[INTERNAL_CHANNEL_DELIVER](e,t){return await n.deliver(e,t)}}},async resolveSession(e){return await r(e).resolveSession()}}}export{INTERNAL_CHANNEL_DELIVER,createChannelOperations};
|
|
1
|
+
import{createChannelAddressFn}from"#channel/channel-address.js";const INTERNAL_CHANNEL_DELIVER=Symbol(`eve.internal.channel-deliver`);function createChannelOperations(n){let r=createChannelAddressFn(n);return{from(e){let n=r(e);return{async send(e,t){return await n.deliver({context:t.context,message:e,outputSchema:t.outputSchema},t)},async respond(e,t){if(e.length===0)throw Error(`respond() requires at least one input response.`);return await n.deliver({context:t.context,inputResponses:e,outputSchema:t.outputSchema,state:t.state},t)},async cancel(e){return await n.cancel(e)},async compact(){return await n.compact()},async clear(){return await n.clear()},async reset(e){return await n.reset(e)},async[INTERNAL_CHANNEL_DELIVER](e,t){return await n.deliver(e,t)}}},async resolveSession(e){return await r(e).resolveSession()}}}export{INTERNAL_CHANNEL_DELIVER,createChannelOperations};
|
|
@@ -84,6 +84,17 @@ const modelEndpoint = z.union([
|
|
|
84
84
|
kind: z.literal("external"),
|
|
85
85
|
provider: z.string()
|
|
86
86
|
}),
|
|
87
|
+
z.object({
|
|
88
|
+
kind: z.literal("chatgpt"),
|
|
89
|
+
state: z.enum([
|
|
90
|
+
"checking",
|
|
91
|
+
"ready",
|
|
92
|
+
"signed-out",
|
|
93
|
+
"reauth-required",
|
|
94
|
+
"unavailable"
|
|
95
|
+
]),
|
|
96
|
+
accountLabel: z.string().optional()
|
|
97
|
+
}),
|
|
87
98
|
z.object({
|
|
88
99
|
kind: z.literal("gateway"),
|
|
89
100
|
connected: z.literal(true),
|
|
@@ -137,6 +148,7 @@ const frameworkTool = tool.extend({
|
|
|
137
148
|
status: z.enum([
|
|
138
149
|
"active",
|
|
139
150
|
"disabled",
|
|
151
|
+
"opt-in",
|
|
140
152
|
"replaced"
|
|
141
153
|
])
|
|
142
154
|
});
|
|
@@ -1791,6 +1803,11 @@ function reduceMessageData(data, event) {
|
|
|
1791
1803
|
for (const response of event.data.responses) next = respondToInputRequest(next, response);
|
|
1792
1804
|
return next;
|
|
1793
1805
|
}
|
|
1806
|
+
case "input.resolved": {
|
|
1807
|
+
let next = data;
|
|
1808
|
+
for (const resolution of event.data.resolutions) next = resolveInputRequest(next, resolution);
|
|
1809
|
+
return next;
|
|
1810
|
+
}
|
|
1794
1811
|
case "message.received": return upsertMessage(data, {
|
|
1795
1812
|
id: `${event.data.turnId}:user`,
|
|
1796
1813
|
metadata: {
|
|
@@ -1993,6 +2010,21 @@ function respondToInputRequest(data, response) {
|
|
|
1993
2010
|
type: "dynamic-tool"
|
|
1994
2011
|
});
|
|
1995
2012
|
}
|
|
2013
|
+
function resolveInputRequest(data, resolution) {
|
|
2014
|
+
if (resolution.response !== void 0) return respondToInputRequest(data, resolution.response);
|
|
2015
|
+
const existing = findToolPartByApprovalId(data, resolution.requestId);
|
|
2016
|
+
if (!existing) return data;
|
|
2017
|
+
return updateToolPart(data, existing.toolCallId, {
|
|
2018
|
+
input: existing.input,
|
|
2019
|
+
output: { status: resolution.outcome },
|
|
2020
|
+
state: "output-available",
|
|
2021
|
+
stepIndex: existing.stepIndex,
|
|
2022
|
+
toolCallId: existing.toolCallId,
|
|
2023
|
+
toolMetadata: existing.toolMetadata,
|
|
2024
|
+
toolName: existing.toolName,
|
|
2025
|
+
type: "dynamic-tool"
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
1996
2028
|
function updateAssistantMessage(data, turnId, update) {
|
|
1997
2029
|
return upsertMessage(data, update(data.messages.find((message) => message.role === "assistant" && message.metadata?.turnId === turnId) ?? createAssistantMessage(turnId)));
|
|
1998
2030
|
}
|
|
@@ -84,6 +84,17 @@ const modelEndpoint = z.union([
|
|
|
84
84
|
kind: z.literal("external"),
|
|
85
85
|
provider: z.string()
|
|
86
86
|
}),
|
|
87
|
+
z.object({
|
|
88
|
+
kind: z.literal("chatgpt"),
|
|
89
|
+
state: z.enum([
|
|
90
|
+
"checking",
|
|
91
|
+
"ready",
|
|
92
|
+
"signed-out",
|
|
93
|
+
"reauth-required",
|
|
94
|
+
"unavailable"
|
|
95
|
+
]),
|
|
96
|
+
accountLabel: z.string().optional()
|
|
97
|
+
}),
|
|
87
98
|
z.object({
|
|
88
99
|
kind: z.literal("gateway"),
|
|
89
100
|
connected: z.literal(true),
|
|
@@ -137,6 +148,7 @@ const frameworkTool = tool.extend({
|
|
|
137
148
|
status: z.enum([
|
|
138
149
|
"active",
|
|
139
150
|
"disabled",
|
|
151
|
+
"opt-in",
|
|
140
152
|
"replaced"
|
|
141
153
|
])
|
|
142
154
|
});
|
|
@@ -1791,6 +1803,11 @@ function reduceMessageData(data, event) {
|
|
|
1791
1803
|
for (const response of event.data.responses) next = respondToInputRequest(next, response);
|
|
1792
1804
|
return next;
|
|
1793
1805
|
}
|
|
1806
|
+
case "input.resolved": {
|
|
1807
|
+
let next = data;
|
|
1808
|
+
for (const resolution of event.data.resolutions) next = resolveInputRequest(next, resolution);
|
|
1809
|
+
return next;
|
|
1810
|
+
}
|
|
1794
1811
|
case "message.received": return upsertMessage(data, {
|
|
1795
1812
|
id: `${event.data.turnId}:user`,
|
|
1796
1813
|
metadata: {
|
|
@@ -1993,6 +2010,21 @@ function respondToInputRequest(data, response) {
|
|
|
1993
2010
|
type: "dynamic-tool"
|
|
1994
2011
|
});
|
|
1995
2012
|
}
|
|
2013
|
+
function resolveInputRequest(data, resolution) {
|
|
2014
|
+
if (resolution.response !== void 0) return respondToInputRequest(data, resolution.response);
|
|
2015
|
+
const existing = findToolPartByApprovalId(data, resolution.requestId);
|
|
2016
|
+
if (!existing) return data;
|
|
2017
|
+
return updateToolPart(data, existing.toolCallId, {
|
|
2018
|
+
input: existing.input,
|
|
2019
|
+
output: { status: resolution.outcome },
|
|
2020
|
+
state: "output-available",
|
|
2021
|
+
stepIndex: existing.stepIndex,
|
|
2022
|
+
toolCallId: existing.toolCallId,
|
|
2023
|
+
toolMetadata: existing.toolMetadata,
|
|
2024
|
+
toolName: existing.toolName,
|
|
2025
|
+
type: "dynamic-tool"
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
1996
2028
|
function updateAssistantMessage(data, turnId, update) {
|
|
1997
2029
|
return upsertMessage(data, update(data.messages.find((message) => message.role === "assistant" && message.metadata?.turnId === turnId) ?? createAssistantMessage(turnId)));
|
|
1998
2030
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Command } from "#compiled/commander/index.js";
|
|
2
|
+
import type { ResolvedDiscoveryProject } from "#discover/project.js";
|
|
2
3
|
export interface CliApplicationContext {
|
|
3
4
|
root: string;
|
|
5
|
+
project?: ResolvedDiscoveryProject;
|
|
4
6
|
resolve(): Promise<void>;
|
|
5
7
|
}
|
|
6
8
|
export type CliApplicationRootRequirement = (command: Command) => boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { resolveDiscoveryProject } from "#discover/project.js";
|
|
1
|
+
import { resolveDiscoveryProject, type ResolvedDiscoveryProject } from "#discover/project.js";
|
|
2
2
|
export interface ResolveCliApplicationRootDependencies {
|
|
3
3
|
readonly resolveDiscoveryProject: typeof resolveDiscoveryProject;
|
|
4
4
|
}
|
|
5
|
+
/** Resolves the nearest enclosing eve application and agent roots. */
|
|
6
|
+
export declare function resolveCliApplicationProject(cwd?: string, dependencies?: ResolveCliApplicationRootDependencies): Promise<ResolvedDiscoveryProject>;
|
|
5
7
|
/** Finds the nearest enclosing eve application. */
|
|
6
8
|
export declare function findCliApplicationRoot(cwd?: string, dependencies?: ResolveCliApplicationRootDependencies): Promise<string | undefined>;
|
|
7
9
|
/** Uses the nearest enclosing eve application, or preserves cwd when none exists. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve}from"node:path";import{DiscoveryProjectResolutionError,resolveDiscoveryProject}from"#discover/project.js";const defaultDependencies={resolveDiscoveryProject};async function findCliApplicationRoot(e=process.cwd(),n=defaultDependencies){try{return(await n.resolveDiscoveryProject(e)).appRoot}catch(e){if(e instanceof DiscoveryProjectResolutionError)return;throw e}}async function resolveCliApplicationRoot(t=process.cwd(),n=defaultDependencies){return await findCliApplicationRoot(t,n)??resolve(t)}export{findCliApplicationRoot,resolveCliApplicationRoot};
|
|
1
|
+
import{resolve}from"node:path";import{DiscoveryProjectResolutionError,resolveDiscoveryProject}from"#discover/project.js";const defaultDependencies={resolveDiscoveryProject};async function resolveCliApplicationProject(e=process.cwd(),t=defaultDependencies){return t.resolveDiscoveryProject(e)}async function findCliApplicationRoot(e=process.cwd(),n=defaultDependencies){try{return(await n.resolveDiscoveryProject(e)).appRoot}catch(e){if(e instanceof DiscoveryProjectResolutionError)return;throw e}}async function resolveCliApplicationRoot(t=process.cwd(),n=defaultDependencies){return await findCliApplicationRoot(t,n)??resolve(t)}export{findCliApplicationRoot,resolveCliApplicationProject,resolveCliApplicationRoot};
|
|
@@ -8,6 +8,8 @@ export declare const HANDOFF_SECTIONS: readonly ["intro-handoff.md", "collect-in
|
|
|
8
8
|
* than a launcher-specific command.
|
|
9
9
|
*/
|
|
10
10
|
export declare function initAgentInstructions(): string;
|
|
11
|
+
/** Concise scaffold facts printed only when a coding agent launched `eve init`. */
|
|
12
|
+
export declare function initAgentReadySummary(model: string | undefined, projectPath: string): string;
|
|
11
13
|
/** The post-scaffold handoff printed after a coding agent runs `eve init`. */
|
|
12
14
|
export declare function initAgentDevHandoff(options: {
|
|
13
15
|
projectPath: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import{readFileSync}from"node:fs";const SETUP_SECTIONS=[`intro-setup.md`,`collect-intent.md`,`vercel-connect.md`,`scaffold.md`,`build-and-verify.md`],HANDOFF_SECTIONS=[`intro-handoff.md`,`collect-intent.md`,`vercel-connect.md`,`build-and-verify.md`];function compose(t
|
|
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{join}from"node:path";import{readFileSync}from"node:fs";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";var import_picocolors=__toESM(require_picocolors(),1);const SETUP_SECTIONS=[`intro-setup.md`,`collect-intent.md`,`vercel-connect.md`,`scaffold.md`,`build-and-verify.md`],HANDOFF_SECTIONS=[`intro-handoff.md`,`collect-intent.md`,`vercel-connect.md`,`build-and-verify.md`];function compose(e,t){let n=e.map(e=>readFileSync(new URL(`./agent-prompt/${e}`,import.meta.url),`utf8`).trim()).join(`
|
|
2
2
|
|
|
3
|
-
`).replaceAll(`{{devCommand}}`,()=>
|
|
3
|
+
`).replaceAll(`{{devCommand}}`,()=>t.devCommand),{workingDirectory:i}=t;return i===void 0?n:n.replaceAll(`{{workingDirectory}}`,()=>i)}function initAgentInstructions(){return compose(SETUP_SECTIONS,{devCommand:`npx eve dev`})}function initAgentReadySummary(e,t){let r=e??DEFAULT_AGENT_MODEL_ID,a=e===void 0?import_picocolors.default.dim(` (eve default)`):``;return[`${import_picocolors.default.green(`✓`)} Model ${import_picocolors.default.bold(r)}${a}`,`${import_picocolors.default.green(`✓`)} Instructions ${import_picocolors.default.bold(join(t,`agent/instructions.md`))}`].join(`
|
|
4
|
+
`)}function initAgentDevHandoff(e){return compose(HANDOFF_SECTIONS,{devCommand:e.devCommand,workingDirectory:e.projectPath})}function initAgentReplPrompt(e){return compose(HANDOFF_SECTIONS,{devCommand:e.devCommand,workingDirectory:`.`})}function initExtensionInstructions(){return[`You are scaffolding an eve extension package (a reusable package of tools,`,`connections, skills, and hooks that a consuming agent mounts under`,`agent/extensions/).`,``,`Ask the user for a package directory name, then run:`,``,` npx eve@latest extension init <name>`,``,`That creates the package, installs dependencies, and initializes Git. It`,`prints what was set up and how to author, build, and mount the extension —`,`it does not start eve dev (extensions are not standalone agents).`,``,"Build with `eve extension build` (or the package `build` script)."].join(`
|
|
4
5
|
`)}function initExtensionHandoff(e){return[``,`What we set up:`,` - package.json with eve.extension source/dist roots, peer+dev eve, and zod`,` - extension/extension.ts (config schema via defineExtension)`,` - build/prepare scripts → eve extension build`,``,`Next:`,` - Add tools, skills, hooks, or connections under extension/`,` (see AGENTS.md and node_modules/eve/docs/extensions.md)`,` - ${`${e.packageManager} run build`} # builds dist/extension and package exports`,` - Mount from a consumer agent:`,` // agent/extensions/${e.packageName}.ts`,` import ext from "${e.packageName}";`,` export default ext({ apiKey: process.env.API_KEY });`,``,`Working directory: ${e.projectPath}`].join(`
|
|
5
|
-
`)}export{HANDOFF_SECTIONS,SETUP_SECTIONS,initAgentDevHandoff,initAgentInstructions,initAgentReplPrompt,initExtensionHandoff,initExtensionInstructions};
|
|
6
|
+
`)}export{HANDOFF_SECTIONS,SETUP_SECTIONS,initAgentDevHandoff,initAgentInstructions,initAgentReadySummary,initAgentReplPrompt,initExtensionHandoff,initExtensionInstructions};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ResolvedDiscoveryProject } from "#discover/project.js";
|
|
1
2
|
export interface CliLogger {
|
|
2
3
|
error(message: string): void;
|
|
3
4
|
log(message: string): void;
|
|
@@ -5,4 +6,4 @@ export interface CliLogger {
|
|
|
5
6
|
export interface ListChannelsCommandOptions {
|
|
6
7
|
json?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function runChannelsListCommand(logger: CliLogger,
|
|
9
|
+
export declare function runChannelsListCommand(logger: CliLogger, project: ResolvedDiscoveryProject, options: ListChannelsCommandOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{listAuthoredChannels}from"#setup/scaffold/index.js";async function runChannelsListCommand(t,n,r){let i=await listAuthoredChannels(n.agentRoot);if(r.json){t.log(JSON.stringify({channels:i},null,2));return}if(i.length===0){t.log("No channels defined. Run `eve add <channel>` to add one.");return}for(let e of i)t.log(e)}export{runChannelsListCommand};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { type DeployFlowDeps } from "#setup/flows/deploy.js";
|
|
2
2
|
import { type Prompter } from "#setup/prompter.js";
|
|
3
|
+
import { type VercelProjectCliOptions } from "./vercel-non-interactive.js";
|
|
3
4
|
export interface DeployCliLogger {
|
|
4
5
|
error(message: string): void;
|
|
5
6
|
log(message: string): void;
|
|
6
7
|
}
|
|
7
8
|
export interface DeployCommandDependencies {
|
|
8
9
|
createPrompter?: () => Prompter;
|
|
9
|
-
isEveProject(projectPath: string): Promise<boolean>;
|
|
10
10
|
hasInteractiveTerminal(): boolean;
|
|
11
11
|
/** Test seam into the flow's detection and box effects. */
|
|
12
12
|
flowDeps?: Partial<DeployFlowDeps>;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* `eve deploy`: deploy the agent to Vercel production. An already-linked
|
|
16
|
-
* project deploys straight away (interactively or not); an unlinked
|
|
17
|
-
* the same team/project pickers as onboarding
|
|
18
|
-
*
|
|
16
|
+
* project deploys straight away (interactively or not); an unlinked interactive
|
|
17
|
+
* run walks the same team/project pickers as onboarding. A non-interactive
|
|
18
|
+
* caller can name a project to link before deployment. The flow itself is
|
|
19
19
|
* {@link runDeployFlow}, shared with the dev TUI's `/deploy`.
|
|
20
20
|
*/
|
|
21
|
-
export declare function runDeployCommand(logger: DeployCliLogger, appRoot: string, dependencies?: DeployCommandDependencies
|
|
21
|
+
export declare function runDeployCommand(logger: DeployCliLogger, appRoot: string, dependencies?: DeployCommandDependencies, options?: VercelProjectCliOptions & {
|
|
22
|
+
yes?: boolean;
|
|
23
|
+
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{hasInteractiveTerminal}from"./preconditions.js";import{isNonInteractiveProjectCommand,runNonInteractiveLink}from"./vercel-non-interactive.js";import{runDeployFlow}from"#setup/flows/deploy.js";import{createPrompter}from"#setup/prompter.js";const defaultDependencies={hasInteractiveTerminal};async function runDeployCommand(e,r,i=defaultDependencies,a={}){if(isNonInteractiveProjectCommand(a)){if(a.yes!==!0){e.error("`eve deploy --non-interactive` requires `--yes` to confirm production deployment."),process.exitCode=1;return}if(a.project!==void 0&&!await runNonInteractiveLink({logger:e,appRoot:r,options:a}))return}let o=i.createPrompter?.()??createPrompter();o.intro(`Deploy your eve agent to Vercel`);try{let n=await runDeployFlow({appRoot:r,prompter:o,interactive:!isNonInteractiveProjectCommand(a)&&i.hasInteractiveTerminal(),deps:i.flowDeps});if(n.kind===`needs-link`){e.error("This directory is not linked to a Vercel project. Run `eve link` first (or `vercel link --project <name> --yes --non-interactive` in CI), then re-run `eve deploy`."),process.exitCode=1;return}if(n.kind===`local-model`){e.error("ChatGPT subscription models use local Codex credentials and cannot be deployed. Switch to an AI Gateway or server-authenticated model before running `eve deploy`."),process.exitCode=1;return}o.outro(n.kind===`cancelled`?`Cancelled.`:n.productionUrl===void 0?`Deployed.`:`Deployed: ${n.productionUrl}`)}catch(t){e.error(t instanceof Error?t.message:String(t)),process.exitCode=1}}export{runDeployCommand};
|
|
@@ -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{initExtensionHandoff,initExtensionInstructions}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{mkdtemp,readdir,rename,rm,stat}from"node:fs/promises";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{scaffoldExtensionProject}from"#setup/scaffold/index.js";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{parseProjectName}from"#setup/project-name.js";import{
|
|
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{initExtensionHandoff,initExtensionInstructions}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{mkdtemp,readdir,rename,rm,stat}from"node:fs/promises";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{scaffoldExtensionProject}from"#setup/scaffold/index.js";import{packageManagerInstallFailureMessage,packageManagerInstallSucceeded,runPackageManagerInstall}from"#setup/primitives/index.js";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{parseProjectName}from"#setup/project-name.js";import{blockingCreateInPlaceEntries}from"#setup/scaffold/create-in-place.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={detectInvokingPackageManager,detectPackageManager,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldExtensionProject,tryInitializeGit},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`extension-init`);function isCurrentDirectoryTarget(e){return/^\.(?:[/\\]+\.?)*$/u.test(e.trim())}async function resolveTargetDirectory(e,t){let n=resolve(e,t);return(await stat(n).catch(()=>void 0))?.isDirectory()?n:void 0}async function assertCanScaffoldInPlace(e){let t=blockingCreateInPlaceEntries(await readdir(e));if(t.length===0)return;let n=t.slice(0,5).join(`, `),r=t.length>5?`, and ${t.length-5} more`:``;throw Error(`Cannot create project in current directory because it is not empty. Found: ${n}${r}. Use an empty directory.`)}async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}function formatWorkspaceRootMutationWarning(e){let t=e.kind===`package-json`?`package.json`:`configuration`,n=e.nodeEngineOverride===void 0?``:` (${formatNodeEngineOverrideWarning(e.nodeEngineOverride)})`;return`Updated workspace root ${t} at ${e.path}${n}`}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldExtension(e,t,n,r,i){let o=resolve(e),l=t===`.`,u=l?o:join(o,t);if(l)await assertCanScaffoldInPlace(u);else if(await pathExists(u))throw Error(`Cannot create project because "${u}" already exists.`);let d=await mkdtemp(join(o,`.eve-extension-init-`)),p=[];try{let e=l?basename(u):t,a=await r.scaffoldExtensionProject({projectName:e,evePackage:i,targetDirectory:d,workspaceProbeDirectory:u,packageManager:n,onWorkspaceRootMutation:e=>{p.push(e)}});return l?await moveDirectoryContents(a,u):await rename(a,u),{projectPath:u,workspaceRootMutations:uniqueWorkspaceRootMutations(p)}}finally{await rm(d,{recursive:!0,force:!0})}}function installProgressDetail(e,t){let n=t.text.trim();if(n===``||e!==`npm`)return n||void 0;let r=/^npm silly fetch manifest (.+)$/u.exec(n);if(r!==null)return`Resolving ${r[1]}`;let i=/^npm http fetch \S+ \S+ attempt (\d+) failed with (\S+)$/u.exec(n);if(i!==null)return`npm registry · attempt ${i[1]} failed: ${i[2]}`;if(t.stream===`stdout`||/^npm (?:error|warn)\b/u.test(n))return n}const NPM_NOISE_LINE=/^\s*npm (?:silly|verbose|http|timing)\b/u;function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(!(e===void 0||e.length===0))return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}async function runExtensionInitCommand(e,t,i,a=defaultDependencies){if(i===void 0&&await a.isCodingAgentLaunch()){e.log(initExtensionInstructions());return}let o=isLogLevelEnabled(`debug`),s=startCliLiveRow(e);s.update(`Preparing project`);let c,l,u=[],p,m,h;try{let n=i??`.`,r=isCurrentDirectoryTarget(n),d=r?await pathExists(join(resolve(t),`package.json`))?resolve(t):void 0:await resolveTargetDirectory(t,n),f=resolveInitEvePackageOverride();if(d!==void 0)throw Error("`eve extension init` creates a new extension package and cannot add to an existing project. Pass a new directory name, or run from an empty directory with `eve extension init .`.");s.update(`Creating extension`),initLog.debug(`creating extension`);let g=a.now(),_=r?`.`:parseProjectName(n),v=resolve(t);l=await resolveScaffoldPackageManager(_===`.`?v:join(v,_),a);let y=await scaffoldExtension(t,_,l,a,f);c=y.projectPath,u=y.workspaceRootMutations,p=a.now()-g,initLog.debug(`creating extension done`,{ms:p}),s.update(`Installing dependencies`,`${l} install`),initLog.debug(`installing dependencies with ${l}`);let b=a.now(),x=[],S=[],C=await a.runPackageManagerInstall(l,c,{bypassMinimumReleaseAge:!0,progressDetails:process.stdout.isTTY===!0&&!o,onOutput:e=>{e.text.trim()!==``&&(S.push(e.text),S.length>20&&S.shift(),NPM_NOISE_LINE.test(e.text)||x.push(e.text)),o&&initLog.debug(e.text);let t=installProgressDetail(l,e);t!==void 0&&s.update(`Installing dependencies`,t)}});if(m=a.now()-b,!packageManagerInstallSucceeded(C)){initLog.debug(`dependency installation failed`,{ms:m}),s.stop();let t=x.length>0?x:S;for(let n of t)e.error(n);if(t.length===0){let t=packageManagerInstallFailureMessage(C);t!==void 0&&e.error(t)}throw Error(`Failed to install dependencies in "${c}".`)}initLog.debug(`dependencies installed`,{ms:m}),s.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),h=await a.tryInitializeGit(c)}finally{s.stop()}e.log(`${import_picocolors.default.green(`✓`)} Created an ${EVE_WORDMARK} extension in ${import_picocolors.default.bold(c)} ${import_picocolors.default.dim(`in ${formatElapsed(p)}`)}`);for(let t of u)e.log(import_picocolors.default.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`));e.log(`${import_picocolors.default.green(`✓`)} Installed dependencies ${import_picocolors.default.dim(`in ${formatElapsed(m)}`)}`),h.kind===`failed`?e.error(import_picocolors.default.yellow(`Git initialization failed: ${h.reason}`)):h.kind===`initialized`&&e.log(`${import_picocolors.default.green(`✓`)} Initialized Git repository`),e.log(initExtensionHandoff({packageManager:l,packageName:basename(c),projectPath:c}))}export{EVE_INIT_PACKAGE_SPEC_ENV,runExtensionInitCommand};
|
|
@@ -2,14 +2,16 @@ export type GitInitResult = {
|
|
|
2
2
|
kind: "initialized";
|
|
3
3
|
} | {
|
|
4
4
|
kind: "skipped";
|
|
5
|
+
reason: "existing-metadata" | "git-unavailable" | "parent-repository";
|
|
5
6
|
} | {
|
|
6
7
|
kind: "failed";
|
|
8
|
+
repositoryInitialized: boolean;
|
|
7
9
|
reason: string;
|
|
10
|
+
stage: "initialize" | "default-branch" | "stage" | "commit";
|
|
8
11
|
};
|
|
9
12
|
/**
|
|
10
13
|
* Initializes a Git repository and records the generated files in an initial
|
|
11
|
-
* commit. Missing Git and parent repositories are skips.
|
|
12
|
-
*
|
|
13
|
-
* failure (without failing `eve init`) is the caller's job.
|
|
14
|
+
* commit. Missing Git and parent repositories are skips. Repository metadata
|
|
15
|
+
* is retained when a later step fails so eve never destroys useful Git state.
|
|
14
16
|
*/
|
|
15
17
|
export declare function tryInitializeGit(projectPath: string): Promise<GitInitResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{stat}from"node:fs/promises";import{join}from"node:path";import{execFile}from"node:child_process";import{promisify}from"node:util";const GIT_TIMEOUT_MS=5e3,runFile=promisify(execFile);async function commandSucceeds(e,t,n){try{let r={timeout:GIT_TIMEOUT_MS,windowsHide:!0};return n!==void 0&&(r.cwd=n),await runFile(e,[...t],r),!0}catch{return!1}}function isGitAvailable(){return commandSucceeds(`git`,[`--version`])}async function isInsideExistingRepository(e){return await commandSucceeds(`git`,[`rev-parse`,`--is-inside-work-tree`],e)||await commandSucceeds(`hg`,[`--cwd`,`.`,`root`],e)}function hasConfiguredDefaultBranch(e){return commandSucceeds(`git`,[`config`,`init.defaultBranch`],e)}async function runGit(e,t){await runFile(`git`,[...t],{cwd:e,timeout:GIT_TIMEOUT_MS,windowsHide:!0})}async function runGitStage(e,t,n,r){try{await runGit(e,n);return}catch(e){return{kind:`failed`,repositoryInitialized:r,reason:e instanceof Error?e.message:String(e),stage:t}}}async function tryInitializeGit(n){if(await stat(join(n,`.git`)).then(()=>!0,e=>{if(e.code===`ENOENT`)return!1;throw e}))return{kind:`skipped`,reason:`existing-metadata`};if(!await isGitAvailable())return{kind:`skipped`,reason:`git-unavailable`};if(await isInsideExistingRepository(n))return{kind:`skipped`,reason:`parent-repository`};let r=await runGitStage(n,`initialize`,[`init`],!1);if(r!==void 0)return r;if(!await hasConfiguredDefaultBranch(n)){let e=await runGitStage(n,`default-branch`,[`checkout`,`-b`,`main`],!0);if(e!==void 0)return e}let i=await runGitStage(n,`stage`,[`add`,`-A`],!0);return i===void 0?await runGitStage(n,`commit`,[`commit`,`-m`,`Initial commit from eve`],!0)??{kind:`initialized`}:i}export{tryInitializeGit};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { InitNonEmptyDirectoryTarget } from "./init-confirm.js";
|
|
2
1
|
import type { InitFailurePolicy } from "./init-recovery.js";
|
|
3
2
|
export type InitTarget = {
|
|
4
3
|
kind: "existing";
|
|
5
4
|
projectPath: string;
|
|
6
5
|
} | {
|
|
6
|
+
createInPlace: boolean;
|
|
7
7
|
failurePolicy: InitFailurePolicy;
|
|
8
8
|
kind: "fresh";
|
|
9
9
|
overwriteExisting: boolean;
|
|
@@ -12,10 +12,9 @@ export type InitTarget = {
|
|
|
12
12
|
projectPath: string;
|
|
13
13
|
};
|
|
14
14
|
interface ResolveInitTargetInput {
|
|
15
|
-
agentLaunched: boolean;
|
|
16
|
-
confirmInitInNonEmptyDirectory(entries: readonly string[]): Promise<InitNonEmptyDirectoryTarget>;
|
|
17
15
|
parentDirectory: string;
|
|
18
16
|
target: string | undefined;
|
|
19
17
|
}
|
|
18
|
+
/** Classifies the target itself without walking ancestor projects. */
|
|
20
19
|
export declare function resolveInitTarget(input: ResolveInitTargetInput): Promise<InitTarget>;
|
|
21
20
|
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{readdir,stat}from"node:fs/promises";import{
|
|
1
|
+
import{readdir,stat}from"node:fs/promises";import{basename,resolve}from"node:path";import{parseProjectName}from"#setup/project-name.js";import{classifyAgentRootEntry,getDirectoryEntryType}from"#discover/filesystem.js";const ENVIRONMENT_ONLY_ENTRIES=new Set([`.DS_Store`,`.editorconfig`,`.gitattributes`,`.gitignore`,`.git`,`.idea`,`.vscode`]);async function pathKind(e){let n=await stat(e).catch(e=>{if(e.code!==`ENOENT`)throw e});return n===void 0?`missing`:n.isDirectory()?`directory`:`other`}function isEnvironmentOnly(e){return e.every(e=>ENVIRONMENT_ONLY_ENTRIES.has(e))}async function isAgentRoot(t){return(await readdir(t,{withFileTypes:!0}).catch(()=>[])).some(e=>{let t=classifyAgentRootEntry(e.name,getDirectoryEntryType(e));return t!==`unknown`&&t!==`ignored-directory`&&t!==`lib-directory`})}async function isExistingEveProject(e,t){return await isAgentRoot(e)?!0:(t.includes(`package.json`)||t.includes(`vercel.json`))&&t.includes(`agent`)&&await isAgentRoot(resolve(e,`agent`))}function listEntries(e){return e.map(e=>` - ${e}`).join(`
|
|
2
|
+
`)}async function resolveInitTarget(t){let r=resolve(t.parentDirectory),i=t.target!==void 0,a=resolve(r,t.target??`.`),o=a===r,s=await pathKind(a);if(s===`other`)throw Error(`Cannot initialize an agent because "${a}" is not a directory.`);if(s===`missing`)return{createInPlace:!1,failurePolicy:`remove`,kind:`fresh`,overwriteExisting:!1,preservedEntries:[],projectName:parseProjectName(basename(a)),projectPath:a};let c=(await readdir(a)).sort();if(c.length===0||isEnvironmentOnly(c)){let e=o?`.`:parseProjectName(basename(a));return{createInPlace:o||c.length>0,failurePolicy:`clear`,kind:`fresh`,overwriteExisting:!1,preservedEntries:c,projectName:e,projectPath:a}}if(await isExistingEveProject(a,c))throw Error(`An eve project already exists at "${a}". Run an existing-project command from that directory instead.`);if(c.includes(`package.json`)){if(!i||t.target!==`.`)throw Error(`Adding eve to an existing package requires an explicit \`eve init .\` from "${a}".`);return{kind:`existing`,projectPath:a}}throw Error(`Cannot initialize an agent in the non-empty directory "${a}". Move or remove these entries, or choose an empty target:\n${listEntries(c)}`)}export{resolveInitTarget};
|
|
@@ -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{initAgentDevHandoff,initAgentReplPrompt}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{confirmInitInNonEmptyDirectory}from"./init-confirm.js";import{cleanupFreshInitTarget,workspaceFailureNote}from"./init-recovery.js";import{selectInitHandoff,spawnCodingAgentRepl}from"./init-repl.js";import{resolveInitTarget}from"./init-target.js";import{mkdtemp,readdir,rename,rm}from"node:fs/promises";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{eveDevArguments,runPackageManagerInstall,spawnPackageManager}from"#setup/primitives/index.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";import{validateModelSlug}from"#setup/flows/model-source-change.js";import{isPackageManagerWorkspaceMember}from"#setup/scaffold/workspace-root.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={addAgentToProject,confirmInitInNonEmptyDirectory,detectInvokingPackageManager,detectPackageManager,ensureChannel,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldBaseProject,selectInitHandoff,spawnCodingAgentRepl,spawnPackageManager,tryInitializeGit,validateModelSlug},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`init`);async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}function formatWorkspaceRootMutationWarning(e){let t=e.kind===`package-json`?`package.json`:`configuration`,n=e.nodeEngineOverride===void 0?``:` (${formatNodeEngineOverrideWarning(e.nodeEngineOverride)})`;return`Updated workspace root ${t} at ${e.path}${n}`}async function addToExistingProject(e,t,n,r){if(t.channelWebNextjs===!0)throw Error("`--channel-web-nextjs` is not supported when adding an agent to an existing project. Run `eve add channel/web` from the project afterwards instead.");if(t.model!==void 0){let r=await n.validateModelSlug(e,t.model);if(r!==null)throw Error(r)}let i=await n.detectPackageManager(e),a=await n.addAgentToProject({projectRoot:e,model:t.model??DEFAULT_AGENT_MODEL_ID,reasoning:t.reasoning,packageManager:i.kind,evePackage:r});return{packageManager:i.kind,nodeEngineOverride:a.nodeEngineOverride}}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldProject(e,t,n,r,i,a,o){let s=resolve(e),c=t===`.`,l=c?s:join(s,t),u=!c&&await pathExists(l)&&(await readdir(l)).length===0;if(!c&&await pathExists(l)&&!u)throw Error(`Cannot create project because "${l}" already exists.`);let h=c&&o?void 0:await mkdtemp(join(s,`.eve-init-`)),g=[];try{let e=h??l;if(r.model!==void 0){let t=await i.validateModelSlug(e,r.model);if(t!==null)throw Error(t)}let s={projectName:h===void 0?`.`:c?basename(l):t,model:r.model??DEFAULT_AGENT_MODEL_ID,reasoning:r.reasoning,evePackage:a,targetDirectory:e,overwriteExisting:o,workspaceProbeDirectory:l,packageManager:n,onWorkspaceRootMutation:e=>{g.push(e)}},d=await i.scaffoldBaseProject(s);return r.channelWebNextjs===!0&&await i.ensureChannel({projectRoot:d,kind:`web`,packageManager:n,force:o,workspaceProbeDirectory:l,configureVercelServices:!1,onWorkspaceRootMutation:e=>{g.push(e)}}),h!==void 0&&(c||u?await moveDirectoryContents(d,l):await rename(d,l)),{projectPath:l,workspaceRootMutations:uniqueWorkspaceRootMutations(g)}}finally{h!==void 0&&await rm(h,{recursive:!0,force:!0})}}function installProgressDetail(e,t){let n=t.text.trim();if(n===``||e!==`npm`)return n||void 0;let r=/^npm silly fetch manifest (.+)$/u.exec(n);if(r!==null)return`Resolving ${r[1]}`;let i=/^npm http fetch \S+ \S+ attempt (\d+) failed with (\S+)$/u.exec(n);if(i!==null)return`npm registry · attempt ${i[1]} failed: ${i[2]}`;if(t.stream===`stdout`||/^npm (?:error|warn)\b/u.test(n))return n}const NPM_NOISE_LINE=/^\s*npm (?:silly|verbose|http|timing)\b/u;async function runInitSteps(e){let{dependencies:t,logger:n,options:r,parentDirectory:i,target:a}=e,c=isLogLevelEnabled(`debug`),l=await t.isCodingAgentLaunch(),d=await resolveInitTarget({agentLaunched:l,confirmInitInNonEmptyDirectory:t.confirmInitInNonEmptyDirectory,parentDirectory:i,target:a}),f=resolveInitEvePackageOverride(),p=startCliLiveRow(n);p.update(`Preparing project`);try{let e=d.kind===`fresh`?`creating agent`:`adding agent`;p.update(d.kind===`fresh`?`Creating agent`:`Adding agent`),initLog.debug(e);let a=t.now(),u;if(d.kind===`fresh`){let e=await resolveScaffoldPackageManager(d.projectPath,t),n=isPackageManagerWorkspaceMember(e,d.projectPath),a;try{a=await scaffoldProject(i,d.projectName,e,r,t,f,d.overwriteExisting)}catch(e){if(d.failurePolicy===`clear`){let t=await cleanupFreshInitTarget(d.projectPath,d.failurePolicy,d.preservedEntries),r=e instanceof Error?e.message:String(e),i=t?`eve restored "${d.projectPath}" to its original state.`:`eve could not completely clean "${d.projectPath}".`;throw Error(`${r}\n\n${i}${workspaceFailureNote(n)}`)}if(d.failurePolicy===`remove`&&n){let t=e instanceof Error?e.message:String(e);throw Error(`${t}${workspaceFailureNote(!0)}`)}throw e}u={failurePolicy:d.failurePolicy,kind:`created`,packageManager:e,preservedTargetEntries:d.preservedEntries,projectPath:a.projectPath,retryCommand:`eve init ${d.projectName}`,workspaceMember:n,workspaceRootMutations:a.workspaceRootMutations}}else{let e=await addToExistingProject(d.projectPath,r,t,f);u=e.nodeEngineOverride===void 0?{failurePolicy:`preserve`,kind:`added`,packageManager:e.packageManager,projectPath:d.projectPath}:{failurePolicy:`preserve`,kind:`added`,nodeEngineOverride:e.nodeEngineOverride,packageManager:e.packageManager,projectPath:d.projectPath}}let m=t.now()-a;initLog.debug(`${e} done`,{ms:m}),p.update(`Installing dependencies`,`${u.packageManager} install`),initLog.debug(`installing dependencies with ${u.packageManager}`);let h=t.now(),g=[],_=[],v=await t.runPackageManagerInstall(u.packageManager,u.projectPath,{bypassMinimumReleaseAge:!0,progressDetails:process.stdout.isTTY===!0&&!c,onOutput:e=>{e.text.trim()!==``&&(_.push(e.text),_.length>20&&_.shift(),NPM_NOISE_LINE.test(e.text)||g.push(e.text)),c&&initLog.debug(e.text);let t=installProgressDetail(u.packageManager,e);t!==void 0&&p.update(`Installing dependencies`,t)}}),y=t.now()-h;if(!v){initLog.debug(`dependency installation failed`,{ms:y}),p.stop();let e=g.length>0?g:_;for(let t of e)n.error(t);if(u.failurePolicy!==`preserve`){if(await cleanupFreshInitTarget(u.projectPath,u.failurePolicy,u.preservedTargetEntries)){let e=u.failurePolicy===`remove`?`eve removed the incomplete project at "${u.projectPath}".`:`eve restored "${u.projectPath}" to its original state.`,t=u.workspaceMember||u.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies.\n\n${e}\n\nResolve the package-manager error above, then retry:\n ${u.retryCommand}${workspaceFailureNote(t)}`)}let e=u.workspaceMember||u.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies, and eve could not completely clean "${u.projectPath}".\n\nResolve the package-manager error above, then install dependencies with ${u.packageManager} in that directory. Or clean the target manually before rerunning eve init.${workspaceFailureNote(e)}`)}throw Error(`The eve agent was added, but dependency installation failed.\n\nResolve the package-manager error above, then install dependencies with ${u.packageManager} in "${u.projectPath}".\n\nDo not rerun eve init; the agent is already configured.`)}return initLog.debug(`dependencies installed`,{ms:y}),u.kind===`created`?(p.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),{...u,agentElapsedMs:m,agentLaunched:l,gitResult:await t.tryInitializeGit(u.projectPath),installElapsedMs:y}):{...u,agentElapsedMs:m,agentLaunched:l,installElapsedMs:y}}finally{p.stop()}}async function runInitCommand(e,t,i,a,o=defaultDependencies){let s;try{s=await runInitSteps({dependencies:o,logger:e,options:a,parentDirectory:t,target:i})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(s.kind===`created`){e.log(`${import_picocolors.default.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${import_picocolors.default.bold(s.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(s.agentElapsedMs)}`)}`);for(let t of s.workspaceRootMutations)e.log(import_picocolors.default.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`))}else e.log(`${import_picocolors.default.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${import_picocolors.default.bold(s.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(s.agentElapsedMs)}`)}`),s.nodeEngineOverride!==void 0&&e.log(import_picocolors.default.yellow(`⚠ ${formatNodeEngineOverrideWarning(s.nodeEngineOverride)}`));e.log(`${import_picocolors.default.green(`✓`)} Installed dependencies ${import_picocolors.default.dim(`in ${formatElapsed(s.installElapsedMs)}`)}`),s.kind===`created`&&s.gitResult.kind===`failed`&&e.error(import_picocolors.default.yellow(`Git initialization failed: ${s.gitResult.reason}`));let c=[s.packageManager,...eveDevArguments(s.packageManager)].join(` `),l=initAgentDevHandoff({projectPath:s.projectPath,devCommand:c});if(s.agentLaunched){e.log(l);return}let u;try{u=await o.selectInitHandoff({agentName:basename(s.projectPath)})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(u===`exit`)return;if(u!==`eve-dev`){if(e.log(import_picocolors.default.dim(`$ ${u}`)),!await o.spawnCodingAgentRepl({command:u,cwd:s.projectPath,prompt:initAgentReplPrompt({devCommand:c}),onPromptUnseeded:t=>{e.log(import_picocolors.default.yellow(`Could not seed ${u} automatically. Paste this prompt into it:`)),e.log(t)}}))throw Error(`Coding-agent REPL exited unsuccessfully in "${s.projectPath}".`);return}let d=s.kind===`created`,f=d?[...eveDevArguments(s.packageManager),`--input`,`/model`]:eveDevArguments(s.packageManager);if(e.log(import_picocolors.default.dim(d?`$ eve dev --input /model`:`$ eve dev`)),!await o.spawnPackageManager(s.packageManager,s.projectPath,f))throw Error(`Development server exited unsuccessfully in "${s.projectPath}".`)}function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(!(e===void 0||e.length===0))return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}export{EVE_INIT_PACKAGE_SPEC_ENV,runInitCommand};
|
|
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{initAgentDevHandoff,initAgentReadySummary,initAgentReplPrompt}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{confirmInitInNonEmptyDirectory}from"./init-confirm.js";import{cleanupFreshInitTarget,workspaceFailureNote}from"./init-recovery.js";import{selectInitHandoff,spawnCodingAgentRepl}from"./init-repl.js";import{resolveInitTarget}from"./init-target.js";import{mkdtemp,readdir,rename,rm}from"node:fs/promises";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,relative,resolve}from"node:path";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{eveDevArguments,packageManagerInstallFailureMessage,packageManagerInstallSucceeded,resultSucceeded,runPackageManagerInstall,spawnPackageManager}from"#setup/primitives/index.js";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";import{validateModelSlug}from"#setup/flows/model-source-change.js";import{isPackageManagerWorkspaceMember}from"#setup/scaffold/workspace-root.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={addAgentToProject,confirmInitInNonEmptyDirectory,detectInvokingPackageManager,detectPackageManager,ensureChannel,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldBaseProject,selectInitHandoff,spawnCodingAgentRepl,spawnPackageManager,tryInitializeGit,validateModelSlug},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`init`);async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}function formatWorkspaceRootMutationWarning(e){let t=e.kind===`package-json`?`package.json`:`configuration`,n=e.nodeEngineOverride===void 0?``:` (${formatNodeEngineOverrideWarning(e.nodeEngineOverride)})`;return`Updated workspace root ${t} at ${e.path}${n}`}function initDevArguments(e){let t=[...eveDevArguments(e)];return e===`pnpm`?[`--config.minimum-release-age=0`,...t]:t}async function addToExistingProject(e,t,n,r){if(t.channelWebNextjs===!0)throw Error("`--channel-web-nextjs` is not supported when adding an agent to an existing project. Run `eve add channel/web` from the project afterwards instead.");if(t.model!==void 0){let r=await n.validateModelSlug(e,t.model);if(r!==null)throw Error(r)}let i=await n.detectPackageManager(e),a=await n.addAgentToProject({projectRoot:e,model:t.model??DEFAULT_AGENT_MODEL_ID,reasoning:t.reasoning,packageManager:i.kind,evePackage:r});return{configurationFilesChanged:a.configurationFilesChanged,dependenciesAdded:a.dependenciesAdded,filesWritten:a.filesWritten,packageManager:i.kind,nodeEngineOverride:a.nodeEngineOverride}}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldProject(e,t,n,r,i,a,o,s){let c=resolve(e,`..`),l=!n&&await pathExists(e)&&(await readdir(e)).length===0;if(!n&&await pathExists(e)&&!l)throw Error(`Cannot create project because "${e}" already exists.`);let u=n&&s?void 0:await mkdtemp(join(c,`.eve-init-`)),d=[];try{let c=u??e;if(i.model!==void 0){let e=await a.validateModelSlug(c,i.model);if(e!==null)throw Error(e)}let f={projectName:u===void 0?`.`:n?basename(e):t,model:i.model??DEFAULT_AGENT_MODEL_ID,reasoning:i.reasoning,evePackage:o,targetDirectory:c,overwriteExisting:s,workspaceProbeDirectory:e,packageManager:r,onWorkspaceRootMutation:e=>{d.push(e)}},p=await a.scaffoldBaseProject(f);return i.channelWebNextjs===!0&&await a.ensureChannel({projectRoot:p,kind:`web`,packageManager:r,force:s,workspaceProbeDirectory:e,configureVercelServices:!1,onWorkspaceRootMutation:e=>{d.push(e)}}),u!==void 0&&(n||l?await moveDirectoryContents(p,e):await rename(p,e)),{projectPath:e,workspaceRootMutations:uniqueWorkspaceRootMutations(d)}}finally{u!==void 0&&await rm(u,{recursive:!0,force:!0})}}function installProgressDetail(e,t){let n=t.text.trim();if(n===``||e!==`npm`)return n||void 0;let r=/^npm silly fetch manifest (.+)$/u.exec(n);if(r!==null)return`Resolving ${r[1]}`;let i=/^npm http fetch \S+ \S+ attempt (\d+) failed with (\S+)$/u.exec(n);if(i!==null)return`npm registry · attempt ${i[1]} failed: ${i[2]}`;if(t.stream===`stdout`||/^npm (?:error|warn)\b/u.test(n))return n}const NPM_NOISE_LINE=/^\s*npm (?:silly|verbose|http|timing)\b/u;function reportExistingProjectChanges(e,t){e.log(`Updated existing project:`);for(let n of t.filesWritten)e.log(` Created ${relative(t.projectPath,n).replaceAll(`\\`,`/`)}`);t.dependenciesAdded.length>0&&e.log(` Added dependencies: ${t.dependenciesAdded.join(`, `)}`);for(let n of t.configurationFilesChanged)e.log(` Updated ${n}`);t.nodeEngineOverride!==void 0&&e.log(import_picocolors.default.yellow(` ⚠ ${formatNodeEngineOverrideWarning(t.nodeEngineOverride)}`))}async function runInitSteps(e){let{dependencies:t,logger:n,options:r,parentDirectory:i,target:a}=e,o=isLogLevelEnabled(`debug`),l=await t.isCodingAgentLaunch(),u=await resolveInitTarget({parentDirectory:i,target:a}),f=resolveInitEvePackageOverride(),p=startCliLiveRow(n);p.update(`Preparing project`);try{let e=u.kind===`fresh`?`creating agent`:`adding agent`;p.update(u.kind===`fresh`?`Creating agent`:`Adding agent`),initLog.debug(e);let i=t.now(),a;if(u.kind===`fresh`){let e=await resolveScaffoldPackageManager(u.projectPath,t),n=isPackageManagerWorkspaceMember(e,u.projectPath),i;try{i=await scaffoldProject(u.projectPath,u.projectName,u.createInPlace,e,r,t,f,u.overwriteExisting)}catch(e){if(u.failurePolicy===`clear`){let t=await cleanupFreshInitTarget(u.projectPath,u.failurePolicy,u.preservedEntries),r=e instanceof Error?e.message:String(e),i=t?`eve restored "${u.projectPath}" to its original state.`:`eve could not completely clean "${u.projectPath}".`;throw Error(`${r}\n\n${i}${workspaceFailureNote(n)}`)}if(u.failurePolicy===`remove`&&n){let t=e instanceof Error?e.message:String(e);throw Error(`${t}${workspaceFailureNote(!0)}`)}throw e}a={failurePolicy:u.failurePolicy,kind:`created`,packageManager:e,preservedTargetEntries:u.preservedEntries,projectPath:i.projectPath,retryCommand:`eve init ${u.projectPath}`,workspaceMember:n,workspaceRootMutations:i.workspaceRootMutations}}else{let e=await addToExistingProject(u.projectPath,r,t,f);a=e.nodeEngineOverride===void 0?{configurationFilesChanged:e.configurationFilesChanged,dependenciesAdded:e.dependenciesAdded,failurePolicy:`preserve`,filesWritten:e.filesWritten,kind:`added`,packageManager:e.packageManager,projectPath:u.projectPath}:{configurationFilesChanged:e.configurationFilesChanged,dependenciesAdded:e.dependenciesAdded,failurePolicy:`preserve`,filesWritten:e.filesWritten,kind:`added`,nodeEngineOverride:e.nodeEngineOverride,packageManager:e.packageManager,projectPath:u.projectPath}}let d=t.now()-i;initLog.debug(`${e} done`,{ms:d}),a.kind===`added`&&(p.stop(),reportExistingProjectChanges(n,a),p=startCliLiveRow(n)),p.update(`Installing dependencies`,`${a.packageManager} install`),initLog.debug(`installing dependencies with ${a.packageManager}`);let m=t.now(),h=[],g=[],_=await t.runPackageManagerInstall(a.packageManager,a.projectPath,{bypassMinimumReleaseAge:!0,progressDetails:process.stdout.isTTY===!0&&!o,onOutput:e=>{e.text.trim()!==``&&(g.push(e.text),g.length>20&&g.shift(),NPM_NOISE_LINE.test(e.text)||h.push(e.text)),o&&initLog.debug(e.text);let t=installProgressDetail(a.packageManager,e);t!==void 0&&p.update(`Installing dependencies`,t)}}),v=t.now()-m;if(!packageManagerInstallSucceeded(_)){initLog.debug(`dependency installation failed`,{ms:v}),p.stop();let e=h.length>0?h:g;for(let t of e)n.error(t);if(e.length===0){let e=packageManagerInstallFailureMessage(_);e!==void 0&&n.error(e)}if(a.failurePolicy!==`preserve`){if(await cleanupFreshInitTarget(a.projectPath,a.failurePolicy,a.preservedTargetEntries)){let e=a.failurePolicy===`remove`?`eve removed the incomplete project at "${a.projectPath}".`:`eve restored "${a.projectPath}" to its original state.`,t=a.workspaceMember||a.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies.\n\n${e}\n\nResolve the package-manager error above, then retry:\n ${a.retryCommand}${workspaceFailureNote(t)}`)}let e=a.workspaceMember||a.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies, and eve could not completely clean "${a.projectPath}".\n\nResolve the package-manager error above, then install dependencies with ${a.packageManager} in that directory. Or clean the target manually before rerunning eve init.${workspaceFailureNote(e)}`)}throw Error(`The eve agent was added, but dependency installation failed.\n\nResolve the package-manager error above, then install dependencies with ${a.packageManager} in "${a.projectPath}".\n\nDo not rerun eve init; the agent is already configured.`)}return initLog.debug(`dependencies installed`,{ms:v}),a.kind===`created`?(p.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),{...a,agentElapsedMs:d,agentLaunched:l,gitResult:await t.tryInitializeGit(a.projectPath),installElapsedMs:v}):{...a,agentElapsedMs:d,agentLaunched:l,installElapsedMs:v}}finally{p.stop()}}async function runInitCommand(e,t,a,o,s=defaultDependencies){let c;try{c=await runInitSteps({dependencies:s,logger:e,options:o,parentDirectory:t,target:a})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(c.kind===`created`){e.log(`${import_picocolors.default.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${import_picocolors.default.bold(c.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(c.agentElapsedMs)}`)}`);for(let t of c.workspaceRootMutations)e.log(import_picocolors.default.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`))}else e.log(`${import_picocolors.default.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${import_picocolors.default.bold(c.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(c.agentElapsedMs)}`)}`);e.log(`${import_picocolors.default.green(`✓`)} Installed dependencies ${import_picocolors.default.dim(`in ${formatElapsed(c.installElapsedMs)}`)}`),c.kind===`created`&&c.gitResult.kind===`failed`&&(e.error(import_picocolors.default.yellow(`Git initialization failed during ${c.gitResult.stage}: ${c.gitResult.reason}`)),c.gitResult.stage===`commit`&&e.error(import_picocolors.default.yellow(`The Git repository and staged files were preserved at "${c.projectPath}".\n\nResolve the Git error above, then retry:\n git -C ${JSON.stringify(c.projectPath)} commit -m "Initial commit from eve"`)));let l=initDevArguments(c.packageManager),u=[c.packageManager,...l].join(` `),d=initAgentDevHandoff({projectPath:c.projectPath,devCommand:u});if(c.agentLaunched){e.log(initAgentReadySummary(o.model,c.projectPath)),e.log(d);return}let f;try{f=await s.selectInitHandoff({agentName:basename(c.projectPath)})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(f===`exit`)return;if(f!==`eve-dev`){if(e.log(import_picocolors.default.dim(`$ ${f}`)),!await s.spawnCodingAgentRepl({command:f,cwd:c.projectPath,prompt:initAgentReplPrompt({devCommand:u}),onPromptUnseeded:t=>{e.log(import_picocolors.default.yellow(`Could not seed ${f} automatically. Paste this prompt into it:`)),e.log(t)}}))throw Error(`Coding-agent REPL exited unsuccessfully in "${c.projectPath}".`);return}let p=c.kind===`created`,m=p?[...l,`--input`,`/model`]:l;if(e.log(import_picocolors.default.dim(p?`$ eve dev --input /model`:`$ eve dev`)),!resultSucceeded(await s.spawnPackageManager(c.packageManager,c.projectPath,m)))throw Error(`Development server exited unsuccessfully in "${c.projectPath}".`)}function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(!(e===void 0||e.length===0))return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}export{EVE_INIT_PACKAGE_SPEC_ENV,runInitCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{join}from"node:path";import{createPrompter}from"#setup/prompter.js";import{WizardCancelledError}from"#setup/step.js";import{cleanupCreatedConnectionConnector,setupConnectionConnector}from"#setup/connection-connector.js";import{ensureVercelProject}from"#setup/flows/ensure-vercel-project.js";import{createHeadlessPrompter}from"#setup/headless.js";import{SetupPrerequisiteRequired}from"#setup/integrations/shared/prerequisite.js";import{resolveIntegrationVercelProject}from"#setup/integrations/shared/vercel-project.js";import{readProjectLink}from"#setup/project-resolution.js";import{createRegistrySetupClient}from"#setup/registry-setup-client.js";import{updateConnectionConnectorUid}from"#setup/scaffold/update/update-connection-connector.js";const defaultDependencies={ensureVercelProject,readProjectLink,setupConnectionConnector,cleanupCreatedConnectionConnector,updateConnectionConnectorUid};async function runIntegrationConnect(e){let i={...defaultDependencies,...e.dependencies},a=e.options?.nonInteractive===!0,o=i.createPrompter?.()??(a?createHeadlessPrompter(()=>{}):createPrompter()),s=e.options?.signal;o.intro(`Set up ${e.slug}`);let l=await i.readProjectLink(e.appRoot);if(l===void 0)if(a)l=await resolveIntegrationVercelProject({appRoot:e.appRoot,integration:e.slug,signal:s,deps:{readProjectLink:i.readProjectLink}});else try{l=await i.ensureVercelProject({appRoot:e.appRoot,prompter:o,signal:s,teamSelectMessage:()=>`You need to link to a project to use ${e.slug} through Vercel Connect.\n\nSelect your team`,deps:i.ensureVercelProjectDeps})}catch(e){if(e instanceof WizardCancelledError)return;throw e}let u={log:o.log,prompter:o,projectRoot:e.appRoot,slug:e.slug,service:e.service,canonicalConnectorName:e.canonicalConnectorName??e.slug,project:l,signal:s},d=await i.setupConnectionConnector(u),f=join(e.appRoot,`agent`,`connections`,`${e.slug}.ts`);if(!(await i.updateConnectionConnectorUid(f,d.connectorUid)).patched)throw d.kind===`created`&&await i.cleanupCreatedConnectionConnector({log:o.log,projectRoot:e.appRoot,connectorId:d.connectorId,orgId:l.orgId}),Error(`Could not update the connector in agent/connections/${e.slug}.ts.`);o.outro(`Connection ${e.slug} set up.`)}async function runIntegrationConnectCommand(t,r,i,a,o,c={},l=defaultDependencies){let d=createRegistrySetupClient({signal:c.signal});try{await runIntegrationConnect({appRoot:r,slug:i,service:a,canonicalConnectorName:o,options:c,dependencies:{...l,createPrompter:()=>d?.prompter??(c.nonInteractive?createHeadlessPrompter(()=>{}):l.createPrompter?.()??createPrompter())}}),d?.complete()}catch(n){if(d?.fail(n),d!==void 0)return;if(c.nonInteractive&&n instanceof SetupPrerequisiteRequired){t.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`prerequisite_required`,prerequisite:n.prerequisite})),process.exitCode=2;return}t.error(n instanceof Error?n.message:String(n)),process.exitCode=1}}export{runIntegrationConnect,runIntegrationConnectCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{createPrompter}from"#setup/prompter.js";import{ensureVercelProject}from"#setup/flows/ensure-vercel-project.js";import{createHeadlessPrompter}from"#setup/headless.js";import{SetupPrerequisiteRequired}from"#setup/integrations/shared/prerequisite.js";import{createRegistrySetupClient}from"#setup/registry-setup-client.js";import{InteractionRequired,InvalidAnswerError,headlessAsker,interactiveAsker,withAnswers,withPolicy}from"#setup/ask.js";import{runIntegrationSetup}from"#setup/integrations/runner.js";import{setupQuestionToWire}from"#setup/setup-question-wire.js";const defaultIntegrationSetupDependencies={};async function runIntegrationSetupCommand(s,c,l,u={},d=defaultIntegrationSetupDependencies){let f=createRegistrySetupClient({process:d.setupProcess,signal:u.signal});try{let n=u.nonInteractive===!0,r=f?.prompter??d.createPrompter?.()??(n?createHeadlessPrompter(()=>{}):createPrompter()),i=n?headlessAsker():interactiveAsker(r),a=u.yes?withPolicy(`assume`)(i):i,o=await runIntegrationSetup(l,{appRoot:c,prompter:r,asker:withAnswers(u.answers??{})(a),resolveVercelProject:n?void 0:()=>ensureVercelProject({appRoot:c,prompter:r,signal:f?.signal??u.signal}),signal:f?.signal??u.signal,beginExternalAction:n?e=>{let t=`external-action-${crypto.randomUUID()}`;return s.log(serializeHeadlessSetupEvent({version:1,type:`external_action`,id:t,blocking:!0,...e})),{complete(){s.log(serializeHeadlessSetupEvent({version:1,type:`external_action_resolved`,id:t}))}}}:void 0},d.runnerDeps);if(o.kind===`cancelled`){f?.cancel(),process.env.EVE_SETUP===`1`?process.exitCode=130:n&&s.error(serializeHeadlessSetupEvent({version:1,type:`cancelled`,item:l}));return}r.outro(`Integration set up.`),f?.complete(o.completion),n&&f===void 0&&s.log(serializeHeadlessSetupEvent({version:1,type:`completed`,item:l}))}catch(e){if(f?.fail(e),f!==void 0)return;u.nonInteractive&&e instanceof InteractionRequired?(s.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`input_required`,question:setupQuestionToWire(e.question)})),process.exitCode=2):u.nonInteractive&&e instanceof InvalidAnswerError?(s.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`input_required`,question:setupQuestionToWire(e.question),issue:{code:`invalid_answer`,message:e.message}})),process.exitCode=2):u.nonInteractive&&e instanceof SetupPrerequisiteRequired?(s.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`prerequisite_required`,prerequisite:e.prerequisite})),process.exitCode=2):(s.error(e instanceof Error?e.message:String(e)),process.exitCode=1)}}export{runIntegrationSetupCommand};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type LinkFlowDeps } from "#setup/flows/link.js";
|
|
2
2
|
import { type Prompter } from "#setup/prompter.js";
|
|
3
|
+
import { type VercelProjectCliOptions } from "./vercel-non-interactive.js";
|
|
3
4
|
export interface LinkCliLogger {
|
|
4
5
|
error(message: string): void;
|
|
5
6
|
log(message: string): void;
|
|
6
7
|
}
|
|
7
8
|
export interface LinkCommandDependencies {
|
|
8
9
|
createPrompter?: () => Prompter;
|
|
9
|
-
isEveProject(projectPath: string): Promise<boolean>;
|
|
10
10
|
hasInteractiveTerminal(): boolean;
|
|
11
11
|
/** Test seam into the flow's detection and box effects. */
|
|
12
12
|
flowDeps?: Partial<LinkFlowDeps>;
|
|
@@ -16,7 +16,7 @@ export interface LinkCommandDependencies {
|
|
|
16
16
|
* when one is already linked), run `vercel link` for the resolved project,
|
|
17
17
|
* then pull env so the AI Gateway credential lands in `.env.local`. The flow
|
|
18
18
|
* itself is {@link runLinkFlow}, shared with the dev TUI `/model` menu's
|
|
19
|
-
* provider row.
|
|
20
|
-
*
|
|
19
|
+
* provider row. Non-interactive callers name the Vercel project explicitly;
|
|
20
|
+
* interactive callers use the eve-owned pickers.
|
|
21
21
|
*/
|
|
22
|
-
export declare function runLinkCommand(logger: LinkCliLogger, appRoot: string, dependencies?: LinkCommandDependencies): Promise<void>;
|
|
22
|
+
export declare function runLinkCommand(logger: LinkCliLogger, appRoot: string, dependencies?: LinkCommandDependencies, options?: VercelProjectCliOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{hasInteractiveTerminal}from"./preconditions.js";import{isNonInteractiveProjectCommand,runNonInteractiveLink}from"./vercel-non-interactive.js";import{createPrompter}from"#setup/prompter.js";import{runLinkFlow}from"#setup/flows/link.js";const defaultDependencies={hasInteractiveTerminal};async function runLinkCommand(e,n,r=defaultDependencies,i={}){if(isNonInteractiveProjectCommand(i)){await runNonInteractiveLink({logger:e,appRoot:n,options:i});return}if(!r.hasInteractiveTerminal()){e.error("`eve link` needs an interactive terminal to pick the team and project. In CI, run `vercel link --project <name> --yes --non-interactive` instead."),process.exitCode=1;return}let a=r.createPrompter?.()??createPrompter();a.intro(`Link your eve agent to Vercel`);try{let e=await runLinkFlow({appRoot:n,prompter:a,projectSelection:`create-or-link`,deps:r.flowDeps});a.outro(e.kind===`cancelled`?`Cancelled.`:`Project linked.`)}catch(t){e.error(t instanceof Error?t.message:String(t)),process.exitCode=1}}export{runLinkCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applicationCommand}from"#cli/application-command.js";function registerProjectCommands(t){applicationCommand(t.program.command(`link`),t.applicationContext).description(`Link this directory to a Vercel project and pull AI Gateway credentials.`).action(async
|
|
1
|
+
import{applicationCommand}from"#cli/application-command.js";function registerProjectCommands(t){applicationCommand(t.program.command(`link`),t.applicationContext).description(`Link this directory to a Vercel project and pull AI Gateway credentials.`).option(`--non-interactive`,`Run without interactive prompts`).option(`--project <name-or-id>`,`Vercel project name or ID`).option(`--team <team-id-or-slug>`,`Vercel team ID or slug`).action(async e=>{let{runLinkCommand:n}=await import(`./link.js`);await n(t.logger,t.applicationContext.root,void 0,e)}),applicationCommand(t.program.command(`deploy`),t.applicationContext).description(`Deploy the agent to Vercel production (links first if needed).`).option(`--non-interactive`,`Run without interactive prompts`).option(`--project <name-or-id>`,`Vercel project name or ID`).option(`--team <team-id-or-slug>`,`Vercel team ID or slug`).option(`-y, --yes`,`Confirm a non-interactive production deployment`).action(async e=>{let{runDeployCommand:n}=await import(`./deploy.js`);await n(t.logger,t.applicationContext.root,void 0,e)})}export{registerProjectCommands};
|
|
@@ -3,7 +3,7 @@ export interface RegistryCommandLogger {
|
|
|
3
3
|
log(message: string): void;
|
|
4
4
|
}
|
|
5
5
|
export declare function errorMessage(error: unknown): string;
|
|
6
|
-
export declare function runRegistryAction<T>(logger: RegistryCommandLogger,
|
|
6
|
+
export declare function runRegistryAction<T>(logger: RegistryCommandLogger, _appRoot: string, action: () => Promise<T>): Promise<T | undefined>;
|
|
7
7
|
export declare function resolveRegistryItemForAdd<T>(logger: RegistryCommandLogger, loadItem: () => Promise<T>, printSuggestions: () => Promise<void>): Promise<{
|
|
8
8
|
found: true;
|
|
9
9
|
item: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{WizardCancelledError}from"#setup/step.js";function errorMessage(e){return e instanceof Error?e.message:String(e)}function isRegistryNotFoundError(e){return e instanceof Error&&`code`in e&&e.code===`NOT_FOUND`}async function runRegistryAction(t,n,r){try{return await r()}catch(n){if(n instanceof WizardCancelledError)return;t.error(errorMessage(n)),process.exitCode=1;return}}async function resolveRegistryItemForAdd(e,t,n){try{return{found:!0,item:await t()}}catch(t){if(!isRegistryNotFoundError(t))throw t;return e.error(errorMessage(t)),await n(),process.exitCode=1,{found:!1}}}function setupResumeCommand(e){return`eve add ${/^[\w@./:-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`} --skip-install`}function setupReminder(e,t){return`${t===`cancelled`?`Setup cancelled.`:`Setup skipped.`} Run \`${setupResumeCommand(e)}\` when you're ready.`}export{errorMessage,resolveRegistryItemForAdd,runRegistryAction,setupReminder,setupResumeCommand};
|