eve 0.50.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/types.d.ts +12 -19
- package/dist/src/chunks/{use-eve-agent-DUMU6dap.js → use-eve-agent-B4xN7-fK.js} +4 -4
- package/dist/src/chunks/{use-eve-agent-B5I-k6Ek.js → use-eve-agent-C3vUG5g2.js} +4 -4
- package/dist/src/cli/acp/command.d.ts +1 -1
- package/dist/src/cli/acp/command.js +2 -2
- package/dist/src/cli/agent-command.d.ts +5 -0
- package/dist/src/cli/agent-command.js +1 -0
- package/dist/src/cli/application-command.d.ts +2 -0
- package/dist/src/cli/commands/build.d.ts +1 -1
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/deploy.d.ts +2 -0
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.d.ts +14 -0
- package/dist/src/cli/commands/init-agent-workspace.js +1 -0
- package/dist/src/cli/commands/init-repl.js +1 -1
- package/dist/src/cli/commands/init.d.ts +2 -13
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.js +1 -1
- package/dist/src/cli/commands/link.d.ts +2 -0
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/preconditions.d.ts +15 -0
- package/dist/src/cli/commands/preconditions.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.d.ts +1 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/register-registry-commands.js +2 -2
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +1 -1
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/invoke/command.d.ts +1 -1
- package/dist/src/cli/invoke/command.js +1 -1
- package/dist/src/cli/option-parsers.d.ts +1 -0
- package/dist/src/cli/option-parsers.js +1 -1
- package/dist/src/cli/run.js +3 -3
- package/dist/src/client/agent-info-schema.d.ts +0 -1
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +18 -18
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/context/keys.d.ts +0 -3
- package/dist/src/context/keys.js +1 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/mock-model.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/execution/activity-work-id.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/channel-context.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +103 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -0
- package/dist/src/execution/coordination-dispatch-step.d.ts +7 -0
- package/dist/src/execution/coordination-dispatch-step.js +1 -0
- package/dist/src/execution/create-session-step.d.ts +1 -2
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/dispatch-action-failures.d.ts +5 -5
- package/dist/src/execution/dispatch-action-failures.js +1 -1
- package/dist/src/execution/dispatch-start-operation.d.ts +1 -1
- package/dist/src/execution/dispatch-start-operation.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +1 -1
- package/dist/src/execution/inline-turn.js +1 -1
- package/dist/src/execution/next-driver-action.d.ts +7 -10
- package/dist/src/execution/node-step.d.ts +1 -2
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/pending-turn-state.d.ts +1 -2
- package/dist/src/execution/pending-turn-state.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/session-command-inbox.d.ts +2 -3
- package/dist/src/execution/session.d.ts +1 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +1 -1
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/task-event-callback.js +1 -1
- package/dist/src/execution/tasks/child/steps.d.ts +18 -18
- package/dist/src/execution/tasks/child/steps.js +1 -1
- package/dist/src/execution/tasks/child/update-step.d.ts +6 -0
- package/dist/src/execution/tasks/child/update-step.js +1 -0
- package/dist/src/execution/tasks/child/update.d.ts +7 -10
- package/dist/src/execution/tasks/child/update.js +1 -1
- package/dist/src/execution/tasks/child/workflow.d.ts +21 -29
- package/dist/src/execution/tasks/child/workflow.js +1 -1
- package/dist/src/execution/tasks/parent/control-shared.d.ts +6 -17
- package/dist/src/execution/tasks/parent/control-shared.js +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +15 -50
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.d.ts +19 -34
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +5 -15
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/run-parent.d.ts +2 -2
- package/dist/src/execution/tasks/parent/task-cancel.d.ts +11 -0
- package/dist/src/execution/tasks/parent/task-cancel.js +1 -0
- package/dist/src/execution/tasks/parent/tool-execution.d.ts +2 -3
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/subagent/accept-event-step.d.ts +7 -0
- package/dist/src/execution/tools/subagent/accept-event-step.js +1 -0
- package/dist/src/execution/tools/subagent/emit-called-step.d.ts +9 -0
- package/dist/src/execution/tools/subagent/emit-called-step.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-agent.d.ts +51 -0
- package/dist/src/execution/tools/subagent/invoke-agent.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +37 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-step.d.ts +55 -0
- package/dist/src/execution/tools/subagent/invoke-step.js +1 -0
- package/dist/src/execution/tools/subagent/receipt-identity.d.ts +11 -0
- package/dist/src/execution/tools/subagent/receipt-identity.js +1 -0
- package/dist/src/execution/{dispatch-runtime-actions-start.d.ts → tools/subagent/start.d.ts} +17 -5
- package/dist/src/execution/tools/subagent/start.js +1 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +24 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -0
- package/dist/src/execution/tools/subagent/task-cancel.d.ts +10 -0
- package/dist/src/execution/tools/subagent/task-cancel.js +1 -0
- package/dist/src/execution/tools/tasks.d.ts +10 -0
- package/dist/src/execution/tools/tasks.js +1 -0
- package/dist/src/execution/{tool-run → tools/workflow}/answer.d.ts +1 -1
- package/dist/src/execution/tools/workflow/answer.js +1 -0
- package/dist/src/execution/tools/workflow/ask.d.ts +22 -0
- package/dist/src/execution/tools/workflow/ask.js +1 -0
- package/dist/src/execution/tools/workflow/background.d.ts +18 -0
- package/dist/src/execution/tools/workflow/background.js +1 -0
- package/dist/src/execution/tools/workflow/body.d.ts +25 -0
- package/dist/src/execution/tools/workflow/body.js +1 -0
- package/dist/src/execution/tools/workflow/cancel.d.ts +11 -0
- package/dist/src/execution/tools/workflow/cancel.js +1 -0
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +7 -0
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -0
- package/dist/src/execution/tools/workflow/messages.d.ts +88 -0
- package/dist/src/execution/tools/workflow/messages.js +1 -0
- package/dist/src/execution/tools/workflow/owner-inbox.d.ts +13 -0
- package/dist/src/execution/tools/workflow/owner-inbox.js +1 -0
- package/dist/src/execution/tools/workflow/owner.d.ts +13 -0
- package/dist/src/execution/tools/workflow/owner.js +1 -0
- package/dist/src/execution/tools/workflow/run-control.d.ts +18 -0
- package/dist/src/execution/tools/workflow/run-control.js +1 -0
- package/dist/src/execution/tools/workflow/start.d.ts +33 -0
- package/dist/src/execution/tools/workflow/start.js +1 -0
- package/dist/src/execution/tools/workflow/types.d.ts +26 -0
- package/dist/src/execution/tools/workflow/types.js +1 -0
- package/dist/src/execution/tools/workflow/workflow.d.ts +3 -0
- package/dist/src/execution/tools/workflow/workflow.js +1 -0
- package/dist/src/execution/turn-workflow-tool-run.d.ts +16 -0
- package/dist/src/execution/turn-workflow-tool-run.js +1 -0
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/wire/session-inbox-contract.d.ts +2 -2
- package/dist/src/execution/wire/session-inbox-contract.js +1 -1
- package/dist/src/execution/wire/session-inbox-encoder.d.ts +6 -2
- package/dist/src/execution/wire/session-inbox-encoder.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.d.ts +3 -3
- package/dist/src/execution/wire/session-inbox-wire.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v1.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v4.d.ts +267 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +1 -0
- package/dist/src/execution/workflow-entry-finalization.d.ts +6 -0
- package/dist/src/execution/workflow-entry-finalization.js +1 -1
- package/dist/src/execution/workflow-entry.d.ts +2 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +1 -7
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/background-tools.d.ts +8 -2
- package/dist/src/harness/{runtime-actions.d.ts → coordination.d.ts} +40 -27
- package/dist/src/harness/coordination.js +1 -0
- package/dist/src/harness/emission.d.ts +9 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +52 -0
- package/dist/src/harness/hitl/session-limit-input-requests.js +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +6 -2
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +1 -2
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-action.js +1 -1
- package/dist/src/harness/tool-call-input-errors.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +3 -1
- package/dist/src/harness/types.d.ts +4 -7
- package/dist/src/harness/workflow-interrupt-state.js +1 -1
- package/dist/src/harness/workflow-lifecycle.d.ts +10 -0
- package/dist/src/harness/workflow-lifecycle.js +1 -1
- package/dist/src/harness/workflow-sandbox.d.ts +1 -1
- package/dist/src/harness/workflow-sandbox.js +2 -2
- package/dist/src/harness/workflow-subagent-limit.d.ts +7 -7
- package/dist/src/harness/workflow-subagent-limit.js +1 -1
- package/dist/src/harness/workflow-task-state.d.ts +9 -0
- package/dist/src/harness/workflow-task-state.js +1 -0
- package/dist/src/harness/workflow-tool-runs.d.ts +27 -0
- package/dist/src/harness/workflow-tool-runs.js +1 -0
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/parent-lineage.js +1 -1
- package/dist/src/internal/agent-name.d.ts +4 -0
- package/dist/src/internal/agent-name.js +1 -0
- package/dist/src/internal/agent-workspace.d.ts +15 -0
- package/dist/src/internal/agent-workspace.js +1 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/project-context.d.ts +26 -0
- package/dist/src/internal/project-context.js +1 -0
- package/dist/src/internal/vercel/assemble-eve-services.d.ts +17 -0
- package/dist/src/internal/vercel/assemble-eve-services.js +1 -0
- package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -0
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -0
- package/dist/src/internal/vercel/build-command.d.ts +4 -0
- package/dist/src/internal/vercel/build-command.js +1 -0
- package/dist/src/internal/vercel/eve-service-contribution.d.ts +27 -0
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -0
- package/dist/src/internal/vercel/vercel-service-config-operations.d.ts +18 -0
- package/dist/src/internal/vercel/vercel-service-config-operations.js +1 -0
- package/dist/src/internal/vercel/vercel-service-name.d.ts +6 -0
- package/dist/src/internal/vercel/vercel-service-name.js +1 -0
- package/dist/src/internal/vercel/vercel-services-config.d.ts +53 -0
- package/dist/src/internal/vercel/vercel-services-config.js +1 -0
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/message.d.ts +2 -0
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/memory/file/backends/vercel-blob.js +1 -1
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/workflow/index.d.ts +3 -1
- package/dist/src/public/workflow/index.js +1 -1
- package/dist/src/runtime/actions/results.d.ts +3 -3
- package/dist/src/runtime/actions/results.js +1 -1
- package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +1 -0
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/channels/registry.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +0 -1
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/sessions/turn.d.ts +16 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/subagents/workflow-reference.d.ts +5 -0
- package/dist/src/runtime/subagents/workflow-reference.js +1 -0
- package/dist/src/runtime/subagents/workflow.d.ts +8 -0
- package/dist/src/runtime/subagents/workflow.js +1 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/setup/integrations/discord/setup.js +1 -1
- package/dist/src/setup/integrations/file-memory/vercel.js +1 -1
- package/dist/src/setup/integrations/linear/setup.js +1 -1
- package/dist/src/setup/integrations/linq/setup.js +3 -3
- package/dist/src/setup/integrations/shopify/setup.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/update/channels.d.ts +4 -12
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/shared/action-types.d.ts +74 -14
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/json.js +1 -1
- package/dist/src/shared/workflow-sandbox.d.ts +1 -1
- package/dist/src/{execution/subagent-adapter-state.d.ts → subagents/adapter-state.d.ts} +2 -0
- package/dist/src/{execution/subagent-adapter-state.js → subagents/adapter-state.js} +1 -1
- package/dist/src/subagents/adapter.js +1 -0
- package/dist/src/{harness → subagents}/agent-handle-errors.d.ts +6 -0
- package/dist/src/subagents/agent-handle-errors.js +1 -0
- package/dist/src/subagents/callback-route.js +1 -0
- package/dist/src/subagents/callback-step.js +1 -0
- package/dist/src/{execution/agent-continuation-bundle.d.ts → subagents/continuation-bundle.d.ts} +1 -1
- package/dist/src/subagents/continuation-bundle.js +1 -0
- package/dist/src/{execution/subagent-event-proxy-step.d.ts → subagents/event-proxy-step.d.ts} +2 -8
- package/dist/src/subagents/event-proxy-step.js +1 -0
- package/dist/src/subagents/handle-dispatch.d.ts +54 -0
- package/dist/src/subagents/handle-dispatch.js +1 -0
- package/dist/src/{harness → subagents}/handles/prompt.d.ts +4 -4
- package/dist/src/{harness → subagents}/handles/prompt.js +1 -1
- package/dist/src/{harness → subagents}/handles/query.d.ts +8 -2
- package/dist/src/subagents/handles/query.js +1 -0
- package/dist/src/subagents/handles/rebase.d.ts +4 -0
- package/dist/src/subagents/handles/rebase.js +1 -0
- package/dist/src/{harness → subagents}/handles/store.d.ts +90 -15
- package/dist/src/subagents/handles/store.js +1 -0
- package/dist/src/subagents/handles/transitions.d.ts +103 -0
- package/dist/src/subagents/handles/transitions.js +1 -0
- package/dist/src/{execution/delegated-parent-notification.d.ts → subagents/parent-notification.d.ts} +1 -7
- package/dist/src/subagents/parent-notification.js +1 -0
- package/dist/src/subagents/parent-result.js +1 -0
- package/dist/src/{execution/remote-agent-dispatch.d.ts → subagents/remote-dispatch.d.ts} +3 -2
- package/dist/src/subagents/remote-dispatch.js +1 -0
- package/dist/src/{execution/subagent-start-local.d.ts → subagents/start-local.d.ts} +5 -6
- package/dist/src/subagents/start-local.js +1 -0
- package/dist/src/{execution/subagent-start-remote.d.ts → subagents/start-remote.d.ts} +5 -5
- package/dist/src/subagents/start-remote.js +1 -0
- package/dist/src/{execution/subagent-tool.d.ts → subagents/tool.d.ts} +5 -3
- package/dist/src/subagents/tool.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/json.js +1 -1
- package/dist/src/tasks/session-index.d.ts +2 -3
- package/dist/src/tasks/session-index.js +1 -1
- package/dist/src/tasks/task-id.d.ts +3 -4
- package/dist/src/tasks/task-id.js +1 -1
- package/dist/src/tasks/transitions.d.ts +3 -47
- package/dist/src/tasks/transitions.js +1 -1
- package/dist/src/tasks/types.d.ts +69 -247
- package/dist/src/tasks/types.js +1 -1
- package/dist/src/tools/dynamic.d.ts +3 -1
- package/dist/src/tools/framework/agent.d.ts +18 -2
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/framework/task-cancel.d.ts +2 -6
- package/dist/src/tools/framework/task-contract.d.ts +44 -65
- package/dist/src/tools/framework/task-contract.js +1 -1
- package/dist/src/tools/framework/task-update.d.ts +1 -0
- package/dist/src/tools/framework/task-update.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/concepts/built-in-tools.md +9 -90
- package/docs/concepts/context-control.md +2 -2
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +3 -3
- package/docs/guides/deployment/vercel.mdx +20 -2
- package/docs/guides/dynamic-capabilities.md +2 -2
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/instrumentation-providers.md +242 -0
- package/docs/guides/instrumentation.md +2 -0
- package/docs/guides/meta.json +1 -0
- package/docs/guides/remote-agents.md +8 -9
- package/docs/reference/cli.md +5 -2
- package/docs/sandbox.mdx +2 -0
- package/docs/subagents/index.mdx +9 -8
- package/docs/tools/overview.mdx +11 -10
- package/docs/tools/workflows.mdx +52 -18
- package/package.json +1 -1
- package/dist/src/execution/agent-continuation-bundle.js +0 -1
- package/dist/src/execution/agent-handle-dispatch.d.ts +0 -79
- package/dist/src/execution/agent-handle-dispatch.js +0 -1
- package/dist/src/execution/delegated-parent-notification.js +0 -1
- package/dist/src/execution/delegated-parent-result.js +0 -1
- package/dist/src/execution/delegation-tool.d.ts +0 -10
- package/dist/src/execution/delegation-tool.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +0 -165
- package/dist/src/execution/dispatch-runtime-actions-shared.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-start.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-step.d.ts +0 -18
- package/dist/src/execution/dispatch-runtime-actions-step.js +0 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +0 -18
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +0 -1
- package/dist/src/execution/finalize-terminal-session.d.ts +0 -17
- package/dist/src/execution/finalize-terminal-session.js +0 -1
- package/dist/src/execution/prepared-agent-action.d.ts +0 -7
- package/dist/src/execution/prepared-agent-action.js +0 -1
- package/dist/src/execution/remote-agent-dispatch.js +0 -1
- package/dist/src/execution/session-callback-route.js +0 -1
- package/dist/src/execution/session-callback-step.js +0 -1
- package/dist/src/execution/subagent-adapter.js +0 -1
- package/dist/src/execution/subagent-event-proxy-step.js +0 -1
- package/dist/src/execution/subagent-start-local.js +0 -1
- package/dist/src/execution/subagent-start-remote.js +0 -1
- package/dist/src/execution/subagent-tool.js +0 -1
- package/dist/src/execution/tasks/child/instructions.d.ts +0 -3
- package/dist/src/execution/tasks/child/instructions.js +0 -1
- package/dist/src/execution/tasks/parent/agent-identity.d.ts +0 -13
- package/dist/src/execution/tasks/parent/agent-identity.js +0 -1
- package/dist/src/execution/tasks/parent/agent-views.d.ts +0 -7
- package/dist/src/execution/tasks/parent/agent-views.js +0 -1
- package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +0 -43
- package/dist/src/execution/tasks/parent/continuation-dispatch.js +0 -1
- package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +0 -19
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +0 -1
- package/dist/src/execution/tool-run/answer.js +0 -1
- package/dist/src/execution/tool-run/background.d.ts +0 -14
- package/dist/src/execution/tool-run/background.js +0 -1
- package/dist/src/execution/tool-run/cancel.d.ts +0 -7
- package/dist/src/execution/tool-run/cancel.js +0 -1
- package/dist/src/execution/tool-run/dispatch.d.ts +0 -24
- package/dist/src/execution/tool-run/dispatch.js +0 -1
- package/dist/src/execution/tool-run/emit-run-report-step.d.ts +0 -7
- package/dist/src/execution/tool-run/emit-run-report-step.js +0 -1
- package/dist/src/execution/tool-run/messages.d.ts +0 -70
- package/dist/src/execution/tool-run/messages.js +0 -1
- package/dist/src/execution/tool-run/owner-inbox.d.ts +0 -11
- package/dist/src/execution/tool-run/owner-inbox.js +0 -1
- package/dist/src/execution/tool-run/owner.d.ts +0 -13
- package/dist/src/execution/tool-run/owner.js +0 -1
- package/dist/src/execution/tool-run/run-control.d.ts +0 -18
- package/dist/src/execution/tool-run/run-control.js +0 -1
- package/dist/src/execution/tool-run/start.d.ts +0 -11
- package/dist/src/execution/tool-run/start.js +0 -1
- package/dist/src/execution/tool-run/types.d.ts +0 -21
- package/dist/src/execution/tool-run/types.js +0 -1
- package/dist/src/execution/tool-run/workflow.d.ts +0 -9
- package/dist/src/execution/tool-run/workflow.js +0 -1
- package/dist/src/execution/tools/subagent/local.d.ts +0 -40
- package/dist/src/execution/tools/subagent/local.js +0 -1
- package/dist/src/execution/tools/subagent/remote.d.ts +0 -26
- package/dist/src/execution/tools/subagent/remote.js +0 -1
- package/dist/src/harness/agent-handle-errors.js +0 -1
- package/dist/src/harness/handles/query.js +0 -1
- package/dist/src/harness/handles/store.js +0 -1
- package/dist/src/harness/handles/transitions.d.ts +0 -167
- package/dist/src/harness/handles/transitions.js +0 -1
- package/dist/src/harness/runtime-actions.js +0 -1
- package/dist/src/harness/subagent-depth.d.ts +0 -10
- package/dist/src/harness/subagent-depth.js +0 -1
- package/dist/src/harness/tool-runs.d.ts +0 -21
- package/dist/src/harness/tool-runs.js +0 -1
- package/dist/src/harness/workflow-runtime-action-state.d.ts +0 -9
- package/dist/src/harness/workflow-runtime-action-state.js +0 -1
- package/dist/src/runtime/actions/keys.d.ts +0 -14
- package/dist/src/runtime/actions/keys.js +0 -1
- package/dist/src/tasks/wire.d.ts +0 -25
- package/dist/src/tasks/wire.js +0 -1
- /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.js +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.js +0 -0
- /package/dist/src/{execution/subagent-adapter.d.ts → subagents/adapter.d.ts} +0 -0
- /package/dist/src/{execution/session-callback-route.d.ts → subagents/callback-route.d.ts} +0 -0
- /package/dist/src/{execution/session-callback-step.d.ts → subagents/callback-step.d.ts} +0 -0
- /package/dist/src/{harness → subagents}/handles/operation-id.d.ts +0 -0
- /package/dist/src/{harness → subagents}/handles/operation-id.js +0 -0
- /package/dist/src/{harness → subagents}/handles/state-key.d.ts +0 -0
- /package/dist/src/{harness → subagents}/handles/state-key.js +0 -0
- /package/dist/src/{execution/subagent-hitl-proxy.d.ts → subagents/hitl-proxy.d.ts} +0 -0
- /package/dist/src/{execution/subagent-hitl-proxy.js → subagents/hitl-proxy.js} +0 -0
- /package/dist/src/{execution/subagent-invocation.d.ts → subagents/invocation.d.ts} +0 -0
- /package/dist/src/{execution/subagent-invocation.js → subagents/invocation.js} +0 -0
- /package/dist/src/{execution/delegated-parent-result.d.ts → subagents/parent-result.d.ts} +0 -0
- /package/dist/src/{execution/remote-agent-route-url.d.ts → subagents/remote-route-url.d.ts} +0 -0
- /package/dist/src/{execution/remote-agent-route-url.js → subagents/remote-route-url.js} +0 -0
- /package/dist/src/{harness/subagent-token-budget.d.ts → subagents/token-budget.d.ts} +0 -0
- /package/dist/src/{harness/subagent-token-budget.js → subagents/token-budget.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.51.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- aae2631: Background workflow tools now execute as their task's durable workflow run, subagents can be invoked directly from waiting workflow tools and workflow sandboxes, and workflow `agent()` calls require a replay-stable `key`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- fc123f4: Discover multi-agent projects from their `agents/` directory, add consistent `--agent` selection to agent-scoped CLI commands, and let `eve init --agents <name,...>` create or extend an agent workspace.
|
|
12
|
+
- b03290a: Preserve background execution for durable dynamic tools so replayed callbacks receive their task runtime.
|
|
13
|
+
- 6e630b4: Deploy conventional `agents/<name>/agent/` workspaces as inferred peer Vercel services at `/<name>/eve/v1/*`, with no generated `vercel.json` step.
|
|
14
|
+
- ecf0b6a: Prevent Vercel Blob file memory from receiving compressed responses with weak ETags that cannot be used for conditional writes. Blob reads now request identity encoding so memory documents continue saving as they grow.
|
|
15
|
+
- 4c45d2f: Fix file-memory setup failing after it creates a Vercel Blob store when the project uses Vercel CLI 57. Setup now connects the store without passing that release an unsupported output flag, so retrying repairs the partial setup normally.
|
|
16
|
+
- bad0813: Fix the sandbox base image so a non-interactive `bash -lc` login shell exits cleanly as `vercel-sandbox`. Ubuntu's default `.bash_logout` ran `clear_console` on exit, which wrote `TERM environment variable not set.` to stderr and, under `set -e`, turned a successful `exit 0` into exit 1 on Vercel Sandbox. `sudo` no longer warns about unresolvable sandbox hostnames, `$HOME/.local/bin` exists on `PATH` for user-scoped installs, and Node is root-owned on every architecture.
|
|
17
|
+
- f9b760a: Ignore unrelated ancestor `agents/` directories when resolving standalone projects so local CLI commands do not misclassify neighboring repositories as agent workspaces.
|
|
18
|
+
- 3cccd71: Preserve inherited channel audience metadata when local subagents persist adapter state. Public parent traces now continue capturing local child inputs and outputs while destination-specific redaction remains independent.
|
|
19
|
+
- 29b9056: Run approved background tool calls even when the AI SDK skips its input callback during resume.
|
|
20
|
+
|
|
3
21
|
## 0.50.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/src/acp/adapter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomUUID}from"node:crypto";import{realpath}from"node:fs/promises";import{PROTOCOL_VERSION,RequestError,methods}from"#compiled/@agentclientprotocol/sdk/index.js";import{Client,ClientError}from"#client/index.js";const ANSWER_FIELD=`answer`,ERROR_CODE_EVE=-32002;var EveAcpAdapter=class{#e;#t;#n;#r=!1;#i=new Map;constructor(e){this.#t=e.eveVersion,this.#n=e.workspaceRoot,this.#e=e.client??new Client({auth:e.auth,headers:e.headers,host:e.serverUrl,redirect:`manual`})}initialize(e){return this.#r=e.clientCapabilities?.elicitation?.form!==void 0,{protocolVersion:PROTOCOL_VERSION,agentCapabilities:{loadSession:!1,promptCapabilities:{},sessionCapabilities:{close:{}}},agentInfo:{name:`eve`,title:`eve`,version:this.#t},authMethods:[]}}async newSession(t){if(t.mcpServers.length>0)throw unsupported(`Client-provided MCP servers are not supported by eve ACP mode.`);if((t.additionalDirectories?.length??0)>0)throw unsupported(`Additional workspace directories are not supported by eve ACP mode.`);if(this.#n!==void 0){let e=await normalizedRealpath(t.cwd,`session/new.cwd`),n=await normalizedRealpath(this.#n,`the eve application root`);if(e!==n)throw RequestError.invalidParams({cwd:t.cwd,workspaceRoot:n},`ACP cwd must be the eve application root`)}let n=randomUUID();return this.#i.set(n,{tools:new Map}),{sessionId:n}}async prompt(e,t,n){let i=this.#s(e.sessionId);if(i.active!==void 0)throw new RequestError(-32001,`ACP session ${e.sessionId} already has an active prompt.`);let a=promptContent(e);i.tools.clear();let o=Promise.withResolvers(),s={cancelRequested:!1,protocolCancelled:!1,outboundController:new AbortController,settled:o.promise,resolveSettled:o.resolve};i.active=s;let onProtocolCancel=()=>{s.protocolCancelled=!0,this.#o(i).catch(()=>void 0)};n.aborted?onProtocolCancel():n.addEventListener(`abort`,onProtocolCancel,{once:!0});try{if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});let o={message:a};for(;;){let a;if(i.client===void 0){if(o.message===void 0)throw Error(`ACP session has not started.`);let e=await this.#e.sessions.create({...o,message:o.message});i.client=e.session,a=e.response}else a=o.inputResponses===void 0?await i.client.send(o.message):await i.client.respond(o.inputResponses);(s.cancelRequested||s.protocolCancelled)&&await this.#o(i);let c=[],l=!1,u,d;for await(let n of a){let r=`data`in n&&`turnId`in n.data?n.data.turnId:void 0;typeof r==`string`&&(s.turnId=r),n.type===`input.requested`&&c.push(...n.data.requests),n.type===`authorization.required`&&(d=unsupported(`Connection authorization cannot be completed through eve ACP mode.`)),n.type===`turn.cancelled`&&(l=!0),(n.type===`turn.failed`||n.type===`session.failed`)&&(u=n),await this.#c(e.sessionId,i,n,t)}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(l||s.cancelRequested)return{stopReason:`cancelled`};if(u!==void 0)throw eveFailure(u);if(d!==void 0)throw d;if(c.length===0)return{stopReason:`end_turn`};let f;try{f=await Promise.all(c.map(r=>this.#l(e.sessionId,i,r,t,n)))}catch(t){if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};throw t}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};o={inputResponses:f}}}catch(e){throw acpRequestError(e)}finally{n.removeEventListener(`abort`,onProtocolCancel),i.tools.clear(),s.resolveSettled(),i.active===s&&(i.active=void 0)}}async cancel(e){let t=this.#i.get(e);t===void 0||t.active===void 0||(t.active.cancelRequested=!0,await this.#o(t))}async closeSession(e){let t=this.#s(e);this.#i.delete(e),await this.#a(t)}async close(){let e=[...this.#i.values()];this.#i.clear(),await Promise.allSettled(e.map(e=>this.#a(e)))}async#a(e){let t;if(e.active!==void 0){let n=e.active;n.cancelRequested=!0;try{await this.#o(e)}catch(e){t=e}await n.settled}try{await e.client?.reset()}catch(e){throw t===void 0?e:AggregateError([t,e],`Could not cancel or reset the eve session`)}if(t!==void 0)throw t}async#o(e){e.active?.outboundController.abort(),e.client!==void 0&&await e.client.cancel(e.active?.turnId===void 0?void 0:{turnId:e.active.turnId})}#s(e){let t=this.#i.get(e);if(t===void 0)throw RequestError.invalidParams({sessionId:e},`Unknown or closed ACP session`);return t}async#c(e,t,n,r){switch(n.type){case`message.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:n.data.messageDelta},messageId:`${n.data.turnId}:message:${n.data.stepIndex}`});return;case`reasoning.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:n.data.reasoningDelta},messageId:`${n.data.turnId}:thought:${n.data.stepIndex}`});return;case`actions.requested`:for(let i of n.data.actions){let n=toolCallForAction(i);t.tools.set(i.callId,n),await notifyUpdate(r,e,{sessionUpdate:`tool_call`,...n})}return;case`action.result`:{let t=n.data.result,i=n.data.status!==`completed`||t.isError?`failed`:`completed`;await notifyUpdate(r,e,{sessionUpdate:`tool_call_update`,toolCallId:t.callId,status:i,content:[{type:`content`,content:{type:`text`,text:stringifyOutput(t.output)}}],rawOutput:t.output});return}default:return}}async#l(e,t,n,a,o){let c=AbortSignal.any([o,t.active.outboundController.signal]);if(n.display===`confirmation`){let o=`${n.requestId}:approve`,s=`${n.requestId}:deny`,l=t.tools.get(n.action.callId)??toolCallForAction(n.action),u=await a.request(methods.client.session.requestPermission,{sessionId:e,toolCall:l,options:[{kind:`allow_once`,name:`Approve`,optionId:o},{kind:`reject_once`,name:`Deny`,optionId:s}]},{cancellationSignal:c});if(u.outcome.outcome===`cancelled`)return this.#u(t),{requestId:n.requestId};if(u.outcome.optionId===o)return{requestId:n.requestId,optionId:`approve`};if(u.outcome.optionId===s)return{requestId:n.requestId,optionId:`deny`};throw RequestError.invalidParams({optionId:u.outcome.optionId},`Unknown ACP permission option`)}if(!this.#r)throw unsupported(`The ACP client does not support form elicitation required by this eve question.`);let l=elicitationProperty(n),u=await a.request(methods.client.elicitation.create,{mode:`form`,sessionId:e,message:n.prompt,requestedSchema:{type:`object`,properties:{[ANSWER_FIELD]:l},required:[ANSWER_FIELD]}},{cancellationSignal:c});if(u.action!==`accept`)return this.#u(t),{requestId:n.requestId};let d=u.content?.[ANSWER_FIELD];if(typeof d!=`string`)throw RequestError.invalidParams(u.content,`ACP elicitation response must contain a string answer`);if(n.display===`select`){if(!n.options?.some(e=>e.id===d))throw RequestError.invalidParams({answer:d},`Unknown eve question option`);return{requestId:n.requestId,optionId:d}}return{requestId:n.requestId,text:d}}#u(e){let t=e.active;t.cancelRequested=!0,t.outboundController.abort()}};async function normalizedRealpath(e,n){try{return await realpath(e)}catch(t){throw RequestError.invalidParams({path:e},`Could not resolve ${n}: ${errorMessage(t)}`)}}function promptContent(e){let t=e.prompt.map(e=>{if(e.type!==`text`)throw unsupported(`ACP prompt content type ${JSON.stringify(e.type)} is not supported.`);return{type:`text`,text:e.text}});if(t.every(e=>e.text.length===0))throw RequestError.invalidParams(e.prompt,`ACP prompt must contain at least one non-empty text block`);return t}function toolCallForAction(e){let t=e.kind===`tool-call`?e.toolName:e.kind===`load-skill`?`Load skill`:e.name;return{toolCallId:e.callId,title:t,kind:`other`,status:`pending`,rawInput:e.input}}function elicitationProperty(e){if(e.display===`select`&&e.allowFreeform!==!0&&e.options?.length)return{type:`string`,title:e.prompt,oneOf:e.options.map(e=>({const:e.id,title:e.label,description:e.description}))};if(e.display===`text`&&e.allowFreeform!==!1)return{type:`string`,title:e.prompt,minLength:1};throw unsupported(`This eve question shape cannot be represented by ACP form elicitation.`)}async function notifyUpdate(e,t,n){await e.notify(methods.client.session.update,{sessionId:t,update:n})}function stringifyOutput(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function unsupported(e){return new RequestError(-32003,e)}function eveFailure(e){return new RequestError(ERROR_CODE_EVE,e.data.message,{code:e.data.code,details:e.data.details})}function acpRequestError(e){return e instanceof RequestError?e:e instanceof ClientError?new RequestError(ERROR_CODE_EVE,e.message,{httpStatus:e.status}):new RequestError(ERROR_CODE_EVE,errorMessage(e))}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{EveAcpAdapter};
|
|
1
|
+
import{randomUUID}from"node:crypto";import{realpath}from"node:fs/promises";import{PROTOCOL_VERSION,RequestError,methods}from"#compiled/@agentclientprotocol/sdk/index.js";import{Client,ClientError}from"#client/index.js";const ANSWER_FIELD=`answer`,ERROR_CODE_EVE=-32002;var EveAcpAdapter=class{#e;#t;#n;#r=!1;#i=new Map;constructor(e){this.#t=e.eveVersion,this.#n=e.workspaceRoot,this.#e=e.client??new Client({auth:e.auth,headers:e.headers,host:e.serverUrl,redirect:`manual`})}initialize(e){return this.#r=e.clientCapabilities?.elicitation?.form!==void 0,{protocolVersion:PROTOCOL_VERSION,agentCapabilities:{loadSession:!1,promptCapabilities:{},sessionCapabilities:{close:{}}},agentInfo:{name:`eve`,title:`eve`,version:this.#t},authMethods:[]}}async newSession(t){if(t.mcpServers.length>0)throw unsupported(`Client-provided MCP servers are not supported by eve ACP mode.`);if((t.additionalDirectories?.length??0)>0)throw unsupported(`Additional workspace directories are not supported by eve ACP mode.`);if(this.#n!==void 0){let e=await normalizedRealpath(t.cwd,`session/new.cwd`),n=await normalizedRealpath(this.#n,`the eve application root`);if(e!==n)throw RequestError.invalidParams({cwd:t.cwd,workspaceRoot:n},`ACP cwd must be the eve application root`)}let n=randomUUID();return this.#i.set(n,{tools:new Map}),{sessionId:n}}async prompt(e,t,n){let i=this.#s(e.sessionId);if(i.active!==void 0)throw new RequestError(-32001,`ACP session ${e.sessionId} already has an active prompt.`);let a=promptContent(e);i.tools.clear();let o=Promise.withResolvers(),s={cancelRequested:!1,protocolCancelled:!1,outboundController:new AbortController,settled:o.promise,resolveSettled:o.resolve};i.active=s;let onProtocolCancel=()=>{s.protocolCancelled=!0,this.#o(i).catch(()=>void 0)};n.aborted?onProtocolCancel():n.addEventListener(`abort`,onProtocolCancel,{once:!0});try{if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});let o={message:a};for(;;){let a;if(i.client===void 0){if(o.message===void 0)throw Error(`ACP session has not started.`);let e=await this.#e.sessions.create({...o,message:o.message});i.client=e.session,a=e.response}else a=o.inputResponses===void 0?await i.client.send(o.message):await i.client.respond(o.inputResponses);(s.cancelRequested||s.protocolCancelled)&&await this.#o(i);let c=[],l=!1,u,d;for await(let n of a){let r=`data`in n&&`turnId`in n.data?n.data.turnId:void 0;typeof r==`string`&&(s.turnId=r),n.type===`input.requested`&&c.push(...n.data.requests),n.type===`authorization.required`&&(d=unsupported(`Connection authorization cannot be completed through eve ACP mode.`)),n.type===`turn.cancelled`&&(l=!0),(n.type===`turn.failed`||n.type===`session.failed`)&&(u=n),await this.#c(e.sessionId,i,n,t)}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(l||s.cancelRequested)return{stopReason:`cancelled`};if(u!==void 0)throw eveFailure(u);if(d!==void 0)throw d;if(c.length===0)return{stopReason:`end_turn`};let f;try{f=await Promise.all(c.map(r=>this.#l(e.sessionId,i,r,t,n)))}catch(t){if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};throw t}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};o={inputResponses:f}}}catch(e){throw acpRequestError(e)}finally{n.removeEventListener(`abort`,onProtocolCancel),i.tools.clear(),s.resolveSettled(),i.active===s&&(i.active=void 0)}}async cancel(e){let t=this.#i.get(e);t===void 0||t.active===void 0||(t.active.cancelRequested=!0,await this.#o(t))}async closeSession(e){let t=this.#s(e);this.#i.delete(e),await this.#a(t)}async close(){let e=[...this.#i.values()];this.#i.clear(),await Promise.allSettled(e.map(e=>this.#a(e)))}async#a(e){let t;if(e.active!==void 0){let n=e.active;n.cancelRequested=!0;try{await this.#o(e)}catch(e){t=e}await n.settled}try{await e.client?.reset()}catch(e){throw t===void 0?e:AggregateError([t,e],`Could not cancel or reset the eve session`)}if(t!==void 0)throw t}async#o(e){e.active?.outboundController.abort(),e.client!==void 0&&await e.client.cancel(e.active?.turnId===void 0?void 0:{turnId:e.active.turnId})}#s(e){let t=this.#i.get(e);if(t===void 0)throw RequestError.invalidParams({sessionId:e},`Unknown or closed ACP session`);return t}async#c(e,t,n,r){switch(n.type){case`message.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:n.data.messageDelta},messageId:`${n.data.turnId}:message:${n.data.stepIndex}`});return;case`reasoning.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:n.data.reasoningDelta},messageId:`${n.data.turnId}:thought:${n.data.stepIndex}`});return;case`actions.requested`:for(let i of n.data.actions){let n=toolCallForAction(i);t.tools.set(i.callId,n),await notifyUpdate(r,e,{sessionUpdate:`tool_call`,...n})}return;case`action.result`:{let t=n.data.result,i=n.data.status!==`completed`||t.isError?`failed`:`completed`;await notifyUpdate(r,e,{sessionUpdate:`tool_call_update`,toolCallId:t.callId,status:i,content:[{type:`content`,content:{type:`text`,text:stringifyOutput(t.output)}}],rawOutput:t.output});return}default:return}}async#l(e,t,n,a,o){let c=AbortSignal.any([o,t.active.outboundController.signal]);if(n.display===`confirmation`){let o=`${n.requestId}:approve`,s=`${n.requestId}:deny`,l=t.tools.get(n.action.callId)??toolCallForAction(n.action),u=await a.request(methods.client.session.requestPermission,{sessionId:e,toolCall:l,options:[{kind:`allow_once`,name:`Approve`,optionId:o},{kind:`reject_once`,name:`Deny`,optionId:s}]},{cancellationSignal:c});if(u.outcome.outcome===`cancelled`)return this.#u(t),{requestId:n.requestId};if(u.outcome.optionId===o)return{requestId:n.requestId,optionId:`approve`};if(u.outcome.optionId===s)return{requestId:n.requestId,optionId:`deny`};throw RequestError.invalidParams({optionId:u.outcome.optionId},`Unknown ACP permission option`)}if(!this.#r)throw unsupported(`The ACP client does not support form elicitation required by this eve question.`);let l=elicitationProperty(n),u=await a.request(methods.client.elicitation.create,{mode:`form`,sessionId:e,message:n.prompt,requestedSchema:{type:`object`,properties:{[ANSWER_FIELD]:l},required:[ANSWER_FIELD]}},{cancellationSignal:c});if(u.action!==`accept`)return this.#u(t),{requestId:n.requestId};let d=u.content?.[ANSWER_FIELD];if(typeof d!=`string`)throw RequestError.invalidParams(u.content,`ACP elicitation response must contain a string answer`);if(n.display===`select`){if(!n.options?.some(e=>e.id===d))throw RequestError.invalidParams({answer:d},`Unknown eve question option`);return{requestId:n.requestId,optionId:d}}return{requestId:n.requestId,text:d}}#u(e){let t=e.active;t.cancelRequested=!0,t.outboundController.abort()}};async function normalizedRealpath(e,n){try{return await realpath(e)}catch(t){throw RequestError.invalidParams({path:e},`Could not resolve ${n}: ${errorMessage(t)}`)}}function promptContent(e){let t=e.prompt.map(e=>{if(e.type!==`text`)throw unsupported(`ACP prompt content type ${JSON.stringify(e.type)} is not supported.`);return{type:`text`,text:e.text}});if(t.every(e=>e.text.length===0))throw RequestError.invalidParams(e.prompt,`ACP prompt must contain at least one non-empty text block`);return t}function toolCallForAction(e){let t=e.kind===`tool-call`||e.kind===`workflow-tool-call`?e.toolName:e.kind===`load-skill`?`Load skill`:e.name;return{toolCallId:e.callId,title:t,kind:`other`,status:`pending`,rawInput:e.input}}function elicitationProperty(e){if(e.display===`select`&&e.allowFreeform!==!0&&e.options?.length)return{type:`string`,title:e.prompt,oneOf:e.options.map(e=>({const:e.id,title:e.label,description:e.description}))};if(e.display===`text`&&e.allowFreeform!==!1)return{type:`string`,title:e.prompt,minLength:1};throw unsupported(`This eve question shape cannot be represented by ACP form elicitation.`)}async function notifyUpdate(e,t,n){await e.notify(methods.client.session.update,{sessionId:t,update:n})}function stringifyOutput(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function unsupported(e){return new RequestError(-32003,e)}function eveFailure(e){return new RequestError(ERROR_CODE_EVE,e.data.message,{code:e.data.code,details:e.data.details})}function acpRequestError(e){return e instanceof RequestError?e:e instanceof ClientError?new RequestError(ERROR_CODE_EVE,e.message,{httpStatus:e.status}):new RequestError(ERROR_CODE_EVE,errorMessage(e))}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{EveAcpAdapter};
|
|
@@ -2,14 +2,14 @@ import type { UserContent } from "ai";
|
|
|
2
2
|
import type { MessageStreamEvent, UnstampedMessageStreamEvent } from "#protocol/message.js";
|
|
3
3
|
import type { CancelTurnResult as ProtocolCancelTurnResult } from "#protocol/cancel-turn.js";
|
|
4
4
|
import type { RunMode } from "#shared/run-mode.js";
|
|
5
|
-
import type { RuntimeSubagentChildResult, RuntimeToolResultActionResult } from "#shared/action-types.js";
|
|
5
|
+
import type { RuntimeSubagentChildResult, RuntimeSubagentDispatchFailure, RuntimeToolResultActionResult } from "#shared/action-types.js";
|
|
6
6
|
import type { InputRequest, InputResponse } from "#shared/input.js";
|
|
7
7
|
import type { ChannelAdapter } from "#channel/adapter.js";
|
|
8
8
|
import type { AgentLimitsDefinition } from "#shared/agent-definition.js";
|
|
9
9
|
import type { JsonObject } from "#shared/json.js";
|
|
10
10
|
import type { InstrumentationDecision } from "#shared/instrumentation-decision.js";
|
|
11
11
|
import type { ForwardedTraceAssertion } from "#shared/forwarded-trace-policy.js";
|
|
12
|
-
import type { TaskView } from "#tasks/types.js";
|
|
12
|
+
import type { TaskAgentRequestDelivery, TaskAuthorizationEventDelivery, TaskInputRequestDelivery, TaskView } from "#tasks/types.js";
|
|
13
13
|
export type { ContextAccessor } from "#context/key.js";
|
|
14
14
|
export type { ChannelInstrumentationProjection } from "#channel/instrumentation.js";
|
|
15
15
|
import type { ChannelInstrumentationProjection } from "#channel/instrumentation.js";
|
|
@@ -150,15 +150,11 @@ export interface DeliverPayload {
|
|
|
150
150
|
/** Framework-only task envelopes consumed before adapter/model delivery. */
|
|
151
151
|
readonly task?: {
|
|
152
152
|
/** Task HITL input-request batches for the parent's pre-model router. */
|
|
153
|
-
readonly inputRequests?: readonly
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
readonly authorizationEvents?: readonly {
|
|
159
|
-
readonly hookPayload: SubagentAuthorizationEventHookPayload;
|
|
160
|
-
readonly taskId: string;
|
|
161
|
-
}[];
|
|
153
|
+
readonly inputRequests?: readonly TaskInputRequestDelivery[];
|
|
154
|
+
/** Agent spawn/settlement requests a task-owned workflow run needs the parent to apply. */
|
|
155
|
+
readonly agentRequests?: readonly TaskAgentRequestDelivery[];
|
|
156
|
+
/** Task child authorization events re-emitted through the parent channel. */
|
|
157
|
+
readonly authorizationEvents?: readonly TaskAuthorizationEventDelivery[];
|
|
162
158
|
/** Terminal views cached before task-run retention expires. */
|
|
163
159
|
readonly views?: readonly TaskView[];
|
|
164
160
|
};
|
|
@@ -265,11 +261,12 @@ export interface ClearSessionHookPayload {
|
|
|
265
261
|
/**
|
|
266
262
|
* Results resumed back into a parked parent workflow by the work it
|
|
267
263
|
* dispatched: child-produced subagent results and authored workflow tool
|
|
268
|
-
* results.
|
|
264
|
+
* results. Workflow-owner dispatch failures use the same private reply hook so
|
|
265
|
+
* `agent()` can settle instead of waiting forever.
|
|
269
266
|
*/
|
|
270
267
|
export interface RuntimeActionResultHookPayload {
|
|
271
268
|
readonly kind: "runtime-action-result";
|
|
272
|
-
readonly results: readonly (RuntimeSubagentChildResult | RuntimeToolResultActionResult)[];
|
|
269
|
+
readonly results: readonly (RuntimeSubagentChildResult | RuntimeSubagentDispatchFailure | RuntimeToolResultActionResult)[];
|
|
273
270
|
}
|
|
274
271
|
/**
|
|
275
272
|
* Event coordinates attached to a proxied `input.requested` batch.
|
|
@@ -376,6 +373,8 @@ export interface SessionCapabilities {
|
|
|
376
373
|
*/
|
|
377
374
|
export interface RunInput {
|
|
378
375
|
readonly adapter: ChannelAdapter<any>;
|
|
376
|
+
/** Framework task that owns this run, when the run is a task executor. */
|
|
377
|
+
readonly taskId?: string;
|
|
379
378
|
/**
|
|
380
379
|
* Registered channel name for root sessions started from an authored
|
|
381
380
|
* channel route. Framework runs omit this and use their framework
|
|
@@ -457,12 +456,6 @@ export interface RunInput {
|
|
|
457
456
|
* for that axis.
|
|
458
457
|
*/
|
|
459
458
|
readonly limits?: RunSessionLimits;
|
|
460
|
-
/**
|
|
461
|
-
* Framework-owned depth of delegated local subagent sessions. Root sessions
|
|
462
|
-
* omit this and are treated as depth 0; each local child receives
|
|
463
|
-
* parent depth + 1.
|
|
464
|
-
*/
|
|
465
|
-
readonly subagentDepth?: number;
|
|
466
459
|
/** Framework-owned metadata for a protocol-neutral external invocation. */
|
|
467
460
|
readonly externalInvocation?: {
|
|
468
461
|
readonly continuationToken: string;
|
|
@@ -322,8 +322,7 @@ const kernelEffect = z.object({
|
|
|
322
322
|
audience: z.array(z.enum([
|
|
323
323
|
"root-session",
|
|
324
324
|
"delegated-task-child",
|
|
325
|
-
"requires-request-input"
|
|
326
|
-
"below-subagent-depth"
|
|
325
|
+
"requires-request-input"
|
|
327
326
|
])),
|
|
328
327
|
kind: z.enum([
|
|
329
328
|
"request-input",
|
|
@@ -1343,7 +1342,7 @@ function isJsonObjectValue(value) {
|
|
|
1343
1342
|
}
|
|
1344
1343
|
function isPlainObject(value) {
|
|
1345
1344
|
const prototype = Object.getPrototypeOf(value);
|
|
1346
|
-
return prototype === null || prototype ===
|
|
1345
|
+
return prototype === null || Object.getPrototypeOf(prototype) === null;
|
|
1347
1346
|
}
|
|
1348
1347
|
|
|
1349
1348
|
//#endregion
|
|
@@ -2309,7 +2308,8 @@ function normalizeActionRequest(action) {
|
|
|
2309
2308
|
name: "load_skill",
|
|
2310
2309
|
toolName: "eve:load-skill"
|
|
2311
2310
|
};
|
|
2312
|
-
case "tool-call":
|
|
2311
|
+
case "tool-call":
|
|
2312
|
+
case "workflow-tool-call": return {
|
|
2313
2313
|
kind: "tool-call",
|
|
2314
2314
|
name: action.toolName,
|
|
2315
2315
|
toolName: action.toolName
|
|
@@ -322,8 +322,7 @@ const kernelEffect = z.object({
|
|
|
322
322
|
audience: z.array(z.enum([
|
|
323
323
|
"root-session",
|
|
324
324
|
"delegated-task-child",
|
|
325
|
-
"requires-request-input"
|
|
326
|
-
"below-subagent-depth"
|
|
325
|
+
"requires-request-input"
|
|
327
326
|
])),
|
|
328
327
|
kind: z.enum([
|
|
329
328
|
"request-input",
|
|
@@ -1343,7 +1342,7 @@ function isJsonObjectValue(value) {
|
|
|
1343
1342
|
}
|
|
1344
1343
|
function isPlainObject(value) {
|
|
1345
1344
|
const prototype = Object.getPrototypeOf(value);
|
|
1346
|
-
return prototype === null || prototype ===
|
|
1345
|
+
return prototype === null || Object.getPrototypeOf(prototype) === null;
|
|
1347
1346
|
}
|
|
1348
1347
|
|
|
1349
1348
|
//#endregion
|
|
@@ -2309,7 +2308,8 @@ function normalizeActionRequest(action) {
|
|
|
2309
2308
|
name: "load_skill",
|
|
2310
2309
|
toolName: "eve:load-skill"
|
|
2311
2310
|
};
|
|
2312
|
-
case "tool-call":
|
|
2311
|
+
case "tool-call":
|
|
2312
|
+
case "workflow-tool-call": return {
|
|
2313
2313
|
kind: "tool-call",
|
|
2314
2314
|
name: action.toolName,
|
|
2315
2315
|
toolName: action.toolName
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "#compiled/commander/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { CliApplicationContext } from "#cli/application-command.js";
|
|
3
3
|
import type { ClientOptions } from "#client/types.js";
|
|
4
4
|
import type { DevelopmentServer, DevelopmentServerOptions } from "#internal/nitro/host/types.js";
|
|
5
5
|
export type RunAcpServer = (input: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"#compiled/commander/index.js";import{
|
|
1
|
+
import"#compiled/commander/index.js";import{agentCommand}from"#cli/agent-command.js";import{loadDevelopmentEnvironmentFiles}from"#cli/dev/environment.js";import{parseDevelopmentHeaderOption,resolveDevelopmentUrlTarget}from"#cli/dev/url-target.js";import{parseDevelopmentServerUrl}from"#cli/dev/url.js";import{FORCED_EXIT_BACKSTOP_MS,installShutdownSignal}from"#cli/shutdown.js";function registerAcpCommand(s){agentCommand(s.program.command(`acp`),s.applicationContext,e=>resolveDevelopmentUrlTarget(e.opts(),e.processedArgs[0])===void 0).description(`Serve an eve agent through stable ACP v1 over stdio.`).argument(`[url]`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`-u, --url <url>`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`--scope <team>`,`Vercel team that owns the URL target`).option(`-H, --header <header>`,`Request header for a URL target, in "Name: value" form (repeatable)`,parseDevelopmentHeaderOption).addHelpText(`after`,`
|
|
2
2
|
Without a URL, eve supervises a local development server. You can also pass a bare URL, for example: eve acp https://example.com
|
|
3
3
|
ACP does not grant the agent access to the client's workspace or terminal.
|
|
4
|
-
`).action(async(e,n)=>{let i=resolveDevelopmentUrlTarget(n,e);loadDevelopmentEnvironmentFiles(s.applicationContext.root);let c=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS});if(i!==void 0){try{await runAcp(s,{headers:i.headers,serverUrl:i.serverUrl,signal:c.signal,vercelScope:n.scope??process.env.EVE_VERCEL_SCOPE})}finally{c.dispose()}return}let l,u,closeServer=()=>l===void 0?Promise.resolve():(u??=l.close(),u.catch(()=>void 0),u);c.signal.addEventListener(`abort`,()=>void closeServer(),{once:!0});try{l=(s.startHost??await loadStartHost())(s.applicationContext.root,{existing:`reject`,host:`127.0.0.1`,output:`stderr`,port:0});let e=await Promise.race([l.start(),c.stopped.then(()=>void 0)]);if(e===void 0)return;await runAcp(s,{serverUrl:e.url,signal:c.signal,workspaceRoot:e.appRoot}),c.requestStop()}finally{await closeServer(),c.dispose()}})}async function runAcp(e,t){let n=e.runAcpServer??(await import(`#acp/server.js`)).runAcpServer,{vercelScope:r,...i}=t,a=typeof i.headers==`function`?void 0:i.headers,o=Object.keys(a??{}).some(e=>e.toLowerCase()===`authorization`);if(i.workspaceRoot!==void 0||o){await n({eveVersion:e.eveVersion,...i});return}let{options:s}=await(e.resolveVerifiedRemoteDevelopmentClient??(await import(`#setup/verified-remote-client.js`)).resolveVerifiedRemoteDevelopmentClient)({headers:a,serverUrl:i.serverUrl,signal:i.signal,vercelScope:r,workspaceRoot:e.applicationContext.root});await n({auth:s.auth,eveVersion:e.eveVersion,headers:s.headers,serverUrl:i.serverUrl,signal:i.signal})}async function loadStartHost(){return(await import(`#cli/dev/local-server-process.js`)).createDevelopmentServer}export{registerAcpCommand};
|
|
4
|
+
`).action(async(e,n)=>{let i=resolveDevelopmentUrlTarget(n,e);await loadDevelopmentEnvironmentFiles(s.applicationContext.root);let c=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS});if(i!==void 0){try{await runAcp(s,{headers:i.headers,serverUrl:i.serverUrl,signal:c.signal,vercelScope:n.scope??process.env.EVE_VERCEL_SCOPE})}finally{c.dispose()}return}let l,u,closeServer=()=>l===void 0?Promise.resolve():(u??=l.close(),u.catch(()=>void 0),u);c.signal.addEventListener(`abort`,()=>void closeServer(),{once:!0});try{l=(s.startHost??await loadStartHost())(s.applicationContext.root,{existing:`reject`,host:`127.0.0.1`,output:`stderr`,port:0});let e=await Promise.race([l.start(),c.stopped.then(()=>void 0)]);if(e===void 0)return;await runAcp(s,{serverUrl:e.url,signal:c.signal,workspaceRoot:e.appRoot}),c.requestStop()}finally{await closeServer(),c.dispose()}})}async function runAcp(e,t){let n=e.runAcpServer??(await import(`#acp/server.js`)).runAcpServer,{vercelScope:r,...i}=t,a=typeof i.headers==`function`?void 0:i.headers,o=Object.keys(a??{}).some(e=>e.toLowerCase()===`authorization`);if(i.workspaceRoot!==void 0||o){await n({eveVersion:e.eveVersion,...i});return}let{options:s}=await(e.resolveVerifiedRemoteDevelopmentClient??(await import(`#setup/verified-remote-client.js`)).resolveVerifiedRemoteDevelopmentClient)({headers:a,serverUrl:i.serverUrl,signal:i.signal,vercelScope:r,workspaceRoot:e.applicationContext.root});await n({auth:s.auth,eveVersion:e.eveVersion,headers:s.headers,serverUrl:i.serverUrl,signal:i.signal})}async function loadStartHost(){return(await import(`#cli/dev/local-server-process.js`)).createDevelopmentServer}export{registerAcpCommand};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Command } from "#compiled/commander/index.js";
|
|
2
|
+
import type { CliApplicationContext } from "./application-command.js";
|
|
3
|
+
export type AgentCommandRequirement = (command: Command) => boolean;
|
|
4
|
+
/** Adds consistent workspace-agent selection to an agent-scoped command. */
|
|
5
|
+
export declare function agentCommand(command: Command, applicationContext: CliApplicationContext, requirement?: AgentCommandRequirement): Command;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createPrompter}from"#setup/prompter.js";async function selectWorkspaceAgent(t,n){let r=t.members.map(e=>e.name);if(n!==void 0){let e=t.members.find(e=>e.name===n);if(e===void 0)throw Error(`Unknown agent ${JSON.stringify(n)}. Available agents: ${r.join(`, `)}.`);return e.appRoot}if(t.members.length===1)return t.members[0].appRoot;if(!(process.stdin.isTTY&&process.stdout.isTTY))throw Error(`This command requires a specific agent. Pass --agent <name>. Available agents: ${r.join(`, `)}.`);let i=await createPrompter().select({message:`Select an agent`,options:t.members.map(e=>({label:e.name,value:e.name})),search:t.members.length>8});return t.members.find(e=>e.name===i).appRoot}function agentCommand(e,t,n=()=>!0){return e.option(`--agent <name>`,`Select an agent from an agents/ workspace`),e.hook(`preAction`,async(e,r)=>{let i=r.opts().agent;if(!n(r)){if(i!==void 0)throw Error(`--agent cannot be combined with a remote URL target.`);return}let a=await t.resolveAgent();if(a.kind===`workspace`){t.root=await selectWorkspaceAgent(a.workspace,i),await t.resolve();return}await t.resolve();let o=await t.resolveAgent();if(i!==void 0&&(o.kind!==`workspace-member`||o.member.name!==i))throw Error(`--agent can only select a member of the enclosing agents/ workspace.`)})}export{agentCommand};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Command } from "#compiled/commander/index.js";
|
|
2
2
|
import type { ResolvedDiscoveryProject } from "#discover/project.js";
|
|
3
|
+
import type { EveProjectContext } from "#internal/project-context.js";
|
|
3
4
|
export interface CliApplicationContext {
|
|
4
5
|
root: string;
|
|
5
6
|
project?: ResolvedDiscoveryProject;
|
|
6
7
|
resolve(): Promise<void>;
|
|
8
|
+
resolveAgent(): Promise<EveProjectContext>;
|
|
7
9
|
}
|
|
8
10
|
export type CliApplicationRootRequirement = (command: Command) => boolean;
|
|
9
11
|
/** Adds application-root resolution to a project-scoped CLI command. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "#compiled/commander/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { CliApplicationContext } from "#cli/application-command.js";
|
|
3
3
|
import type { ApplicationBuildOptions } from "#internal/nitro/host/types.js";
|
|
4
4
|
export type BuildHost = (appRoot: string, options: ApplicationBuildOptions) => Promise<string>;
|
|
5
5
|
interface BuildCommandLogger {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{resolve}from"node:path";import{resolveInternalVercelServiceOutput}from"#cli/vercel-service-output.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{resolveEveProjectContext}from"#internal/project-context.js";import{EVE_PUBLIC_ROUTE_PREFIX_ENV,normalizePublicRoutePrefix}from"#shared/public-route-prefix.js";function registerBuildCommand(r){let i=createCliTheme();r.program.command(`build`).hook(`preAction`,async()=>{(await resolveEveProjectContext(r.applicationContext.root)).kind!==`workspace`&&await r.applicationContext.resolve()}).description(`Build the current eve application.`).option(`--profile <path>`,`Write best-effort timing and output-size profile JSON to a file`).option(`--skip-sandbox-prewarm`,`Skip sandbox template prewarm for a Vercel build; output may not be deployable`).action(async n=>{let{loadDevelopmentEnvironmentFiles:a}=await import(`#cli/dev/environment.js`);await a(r.applicationContext.root);let o=await resolveEveProjectContext(r.applicationContext.root);if(o.kind===`workspace`){if(n.profile!==void 0||n.skipSandboxPrewarm===!0)throw Error(`Workspace builds do not support --profile or --skip-sandbox-prewarm. Run those options from an individual agent directory.`);let{buildAgentWorkspace:e}=await import(`#internal/vercel/build-agent-workspace.js`),t=await e(o.workspace);r.logger.log(renderCliTaggedLine(i,{message:`built output at ${t}`,tag:`build`,tone:`success`}));return}let s=r.buildHost??(await import(`#internal/nitro/host.js`)).buildApplication,c=n.profile===void 0?void 0:resolve(r.applicationContext.root,n.profile),l={publicRoutePrefix:normalizePublicRoutePrefix(process.env[EVE_PUBLIC_ROUTE_PREFIX_ENV]),skipVercelSandboxPrewarm:n.skipSandboxPrewarm===!0,vercelServiceOutput:resolveInternalVercelServiceOutput(r.applicationContext.root)};c!==void 0&&(l.profileOutputPath=c);let u=await s(r.applicationContext.root,l);r.logger.log(renderCliTaggedLine(i,{message:`built output at ${u}`,tag:`build`,tone:`success`}))})}export{registerBuildCommand};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isEveProject } from "#setup/scaffold/index.js";
|
|
1
2
|
import { type DeployFlowDeps } from "#setup/flows/deploy.js";
|
|
2
3
|
import { type Prompter } from "#setup/prompter.js";
|
|
3
4
|
import { type VercelProjectCliOptions } from "./vercel-non-interactive.js";
|
|
@@ -8,6 +9,7 @@ export interface DeployCliLogger {
|
|
|
8
9
|
export interface DeployCommandDependencies {
|
|
9
10
|
createPrompter?: () => Prompter;
|
|
10
11
|
hasInteractiveTerminal(): boolean;
|
|
12
|
+
isEveProject?: typeof isEveProject;
|
|
11
13
|
/** Test seam into the flow's detection and box effects. */
|
|
12
14
|
flowDeps?: Partial<DeployFlowDeps>;
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasInteractiveTerminal}from"./preconditions.js";import{isNonInteractiveProjectCommand,runNonInteractiveLink}from"./vercel-non-interactive.js";import{
|
|
1
|
+
import{hasInteractiveTerminal,validateWorkspaceProjectCommand}from"./preconditions.js";import{isNonInteractiveProjectCommand,runNonInteractiveLink}from"./vercel-non-interactive.js";import{createPrompter}from"#setup/prompter.js";import{isEveProject}from"#setup/scaffold/index.js";import{runDeployFlow}from"#setup/flows/deploy.js";const defaultDependencies={hasInteractiveTerminal,isEveProject};async function runDeployCommand(e,n,r=defaultDependencies,i={}){if(!await validateWorkspaceProjectCommand({appRoot:n,isEveProject:r.isEveProject,logger:e,workspaceMemberMessage:e=>`This agent belongs to the workspace at ${e.root}. Run \`eve deploy\` from the workspace root to deploy every peer agent together.`}))return;if(isNonInteractiveProjectCommand(i)){if(i.yes!==!0){e.error("`eve deploy --non-interactive` requires `--yes` to confirm production deployment."),process.exitCode=1;return}if(i.project!==void 0&&!await runNonInteractiveLink({logger:e,appRoot:n,options:i}))return}let a=r.createPrompter?.()??createPrompter();a.intro(`Deploy your eve agent to Vercel`);try{let t=await runDeployFlow({appRoot:n,prompter:a,interactive:!isNonInteractiveProjectCommand(i)&&r.hasInteractiveTerminal(),deps:r.flowDeps});if(t.kind===`needs-link`){e.error("This directory is not linked to a Vercel project. Run `eve link` first, or name the project on the deploy itself: `eve deploy --project <name-or-id> --non-interactive --yes`."),process.exitCode=1;return}if(t.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}a.outro(t.kind===`cancelled`?`Cancelled.`:t.productionUrl===void 0?`Deployed.`:`Deployed: ${t.productionUrl}`)}catch(t){e.error(t instanceof Error?t.message:String(t)),process.exitCode=1}}export{runDeployCommand};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentReasoningDefinition } from "#shared/agent-definition.js";
|
|
2
|
+
import { validateModelSlug } from "#setup/flows/model-source-change.js";
|
|
3
|
+
export interface InitCommandOptions {
|
|
4
|
+
agents?: readonly string[];
|
|
5
|
+
channelWebNextjs?: boolean;
|
|
6
|
+
model?: string;
|
|
7
|
+
reasoning?: AgentReasoningDefinition;
|
|
8
|
+
}
|
|
9
|
+
export interface InitCliLogger {
|
|
10
|
+
error(message: string): void;
|
|
11
|
+
log(message: string): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function convertScaffoldToAgentWorkspace(projectRoot: string, names: readonly string[], options: InitCommandOptions): Promise<void>;
|
|
14
|
+
export declare function addAgentsToWorkspace(logger: InitCliLogger, workspaceRoot: string, target: string | undefined, options: InitCommandOptions, validateModel?: typeof validateModelSlug): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mkdir,readFile,rename}from"node:fs/promises";import{createPrompter}from"#setup/prompter.js";import{join}from"node:path";import pc from"#compiled/picocolors/index.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{pathExists}from"#setup/path-exists.js";import{agentTemplateFiles}from"#setup/scaffold/create/project.js";import{assertValidPublicAgentName}from"#internal/agent-name.js";import{resolveAgentWorkspace}from"#internal/agent-workspace.js";import{validateModelSlug}from"#setup/flows/model-source-change.js";import{writeTextFile}from"#setup/scaffold/files.js";function validateAgentNames(e){if(e.length===0)throw Error(`--agents requires at least one agent name.`);let t=new Set;for(let n of e){if(assertValidPublicAgentName(n,`Agent`),t.has(n))throw Error(`Agent name ${JSON.stringify(n)} is repeated.`);t.add(n)}}async function writeWorkspaceAgent(e,t,n){let r=join(e,`agents`,t);if(await pathExists(r))throw Error(`Cannot create agent ${JSON.stringify(t)} because ${r} already exists.`);let a=agentTemplateFiles(n.model??DEFAULT_AGENT_MODEL_ID,n.reasoning);await Promise.all(Object.entries(a).map(([e,t])=>writeTextFile(join(r,e),t)))}async function convertScaffoldToAgentWorkspace(r,a,o){if(validateAgentNames(a),o.channelWebNextjs===!0)throw Error(`--channel-web-nextjs cannot be combined with --agents.`);let[s,...c]=a;await mkdir(join(r,`agents`,s),{recursive:!0}),await rename(join(r,`agent`),join(r,`agents`,s,`agent`));let l=join(r,`tsconfig.json`);await writeTextFile(l,(await readFile(l,`utf8`)).replace(`"agent/**/*.ts"`,`"agents/**/*.ts"`),{force:!0});for(let e of c)await writeWorkspaceAgent(r,e,o)}async function addAgentsToWorkspace(e,t,n,i,o=validateModelSlug){if(await resolveAgentWorkspace(t)===void 0)return!1;if(i.channelWebNextjs===!0)throw Error(`--channel-web-nextjs is not supported when adding a workspace agent.`);let s=i.agents;if(n!==void 0&&s!==void 0)throw Error(`Pass either an agent name or --agents, not both.`);if(s===void 0&&n!==void 0&&(s=[n]),s===void 0){if(!(process.stdin.isTTY&&process.stdout.isTTY))throw Error(`This directory is an eve agent workspace. Pass an agent name, for example: eve init billing.`);s=[await createPrompter().text({message:`Name the new agent`})]}if(validateAgentNames(s),i.model!==void 0){let e=await o(t,i.model);if(e!==null)throw Error(e)}for(let e of s)await writeWorkspaceAgent(t,e,i);return e.log(`${pc.green(`✓`)} Added ${s.length===1?`agent`:`agents`} ${s.map(e=>pc.bold(e)).join(`, `)}`),e.log(pc.dim(`$ eve dev --agent <name>`)),!0}export{addAgentsToWorkspace,convertScaffoldToAgentWorkspace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasInteractiveTerminal}from"./preconditions.js";import{access,stat}from"node:fs/promises";import{delimiter,extname,join}from"node:path";import{constants}from"node:fs";import{
|
|
1
|
+
import{hasInteractiveTerminal}from"./preconditions.js";import{access,stat}from"node:fs/promises";import{createPrompter}from"#setup/prompter.js";import{delimiter,extname,join}from"node:path";import{constants}from"node:fs";import{spawn}from"node:child_process";const positional=e=>[e],CODING_AGENT_REPLS=[{command:`claude`,label:`Claude Code`,promptArgs:positional},{command:`codex`,label:`Codex`,promptArgs:positional},{command:`cursor-agent`,label:`Cursor`,promptArgs:positional},{command:`droid`,label:`Droid`,promptArgs:positional},{command:`gemini`,label:`Gemini CLI`,promptArgs:e=>[`-i`,e]},{command:`opencode`,label:`opencode`,promptArgs:e=>[`--prompt`,e]},{command:`pi`,label:`Pi`,promptArgs:positional}],WINDOWS_EXECUTABLE_EXTENSIONS=[`.COM`,`.EXE`,`.BAT`,`.CMD`],defaultDependencies={createPrompter,hasInteractiveTerminal,isCodingAgentReplAvailable};function executableNames(e){if(process.platform!==`win32`)return[e];let t=process.env.PATHEXT?.split(`;`).filter(Boolean);return(t&&t.length>0?t:WINDOWS_EXECUTABLE_EXTENSIONS).map(t=>`${e}${t}`)}async function isExecutable(e){try{return(await stat(e)).isFile()?(await access(e,constants.X_OK),!0):!1}catch{return!1}}async function resolveCodingAgentRepl(e){let t=process.env.PATH;if(t===void 0||t.length===0)return null;for(let n of t.split(delimiter))if(n.length!==0)for(let t of executableNames(e)){let e=join(n,t);if(await isExecutable(e))return e}return null}async function isCodingAgentReplAvailable(e){return await resolveCodingAgentRepl(e)!==null}function handoffOptions(e,t){return[{value:`eve-dev`,label:`Start eve dev`,focusHint:`talk to '${t}' in your terminal`},...e.map(e=>({value:e.command,label:`Open ${e.label}`,focusHint:`build '${t}' using ${e.label}`})),{value:`exit`,label:`Exit`,focusHint:`return to your terminal`}]}async function selectInitHandoff(e){let t={...defaultDependencies,...e.deps};if(!t.hasInteractiveTerminal())return`eve-dev`;let n=await Promise.all(CODING_AGENT_REPLS.map(({command:e})=>t.isCodingAgentReplAvailable(e))),r=CODING_AGENT_REPLS.filter((e,t)=>n[t]);return r.length===0?`eve-dev`:t.createPrompter().select({message:`How would you like to continue?`,options:handoffOptions(r,e.agentName),initialValue:`eve-dev`})}function codingAgentRepl(e){let t=CODING_AGENT_REPLS.find(t=>t.command===e);if(t===void 0)throw Error(`Unsupported coding-agent REPL "${e}".`);return t}function isDirectlySpawnable(e,t){if(t!==`win32`)return!0;let n=extname(e).toLowerCase();return n===`.exe`||n===`.com`}function replSpawnPlan(e,t,n,r=process.platform){return t!==null&&isDirectlySpawnable(t,r)?{file:t,args:codingAgentRepl(e).promptArgs(n),shell:!1,seeded:!0}:{file:e,args:[],shell:r===`win32`,seeded:!1}}async function spawnCodingAgentRepl(e){let t=e.resolvePath??resolveCodingAgentRepl,n=replSpawnPlan(e.command,await t(e.command),e.prompt);return n.seeded||e.onPromptUnseeded?.(e.prompt),new Promise(t=>{let r=spawn(n.file,n.args,{cwd:e.cwd,shell:n.shell,stdio:`inherit`}),i=!1,settle=e=>{i||(i=!0,t(e))};r.once(`error`,()=>settle(!1)),r.once(`close`,e=>settle(e===0))})}export{isCodingAgentReplAvailable,replSpawnPlan,resolveCodingAgentRepl,selectInitHandoff,spawnCodingAgentRepl};
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
import { isCodingAgentLaunch } from "#cli/agent-detection.js";
|
|
2
|
-
import type { AgentReasoningDefinition } from "#shared/agent-definition.js";
|
|
3
2
|
import { detectInvokingPackageManager, detectPackageManager } from "#setup/package-manager.js";
|
|
4
3
|
import { runPackageManagerInstall, spawnPackageManager } from "#setup/primitives/index.js";
|
|
5
4
|
import { addAgentToProject } from "#setup/scaffold/create/add-to-project.js";
|
|
6
5
|
import { ensureChannel, scaffoldBaseProject } from "#setup/scaffold/index.js";
|
|
7
6
|
import { validateModelSlug } from "#setup/flows/model-source-change.js";
|
|
7
|
+
import { type InitCliLogger, type InitCommandOptions } from "./init-agent-workspace.js";
|
|
8
8
|
import { confirmInitInNonEmptyDirectory } from "./init-confirm.js";
|
|
9
9
|
import { tryInitializeGit } from "./init-git.js";
|
|
10
10
|
import { selectInitHandoff, spawnCodingAgentRepl } from "./init-repl.js";
|
|
11
|
-
export
|
|
12
|
-
error(message: string): void;
|
|
13
|
-
log(message: string): void;
|
|
14
|
-
}
|
|
15
|
-
export interface InitCommandOptions {
|
|
16
|
-
/** Add the Web Chat channel (a Next.js app). Set by `--channel-web-nextjs`. */
|
|
17
|
-
channelWebNextjs?: boolean;
|
|
18
|
-
/** Model id written to the root agent config. Set by `--model`. */
|
|
19
|
-
model?: string;
|
|
20
|
-
/** Reasoning effort written to the root agent config. Set by `--reasoning`. */
|
|
21
|
-
reasoning?: AgentReasoningDefinition;
|
|
22
|
-
}
|
|
11
|
+
export type { InitCliLogger, InitCommandOptions } from "./init-agent-workspace.js";
|
|
23
12
|
export interface InitCommandDependencies {
|
|
24
13
|
addAgentToProject: typeof addAgentToProject;
|
|
25
14
|
confirmInitInNonEmptyDirectory: typeof confirmInitInNonEmptyDirectory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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 pc from"#compiled/picocolors/index.js";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";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{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 m=n&&s?void 0:await mkdtemp(join(c,`.eve-init-`)),h=[];try{let c=m??e;if(i.model!==void 0){let e=await a.validateModelSlug(c,i.model);if(e!==null)throw Error(e)}let u={projectName:m===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=>{h.push(e)}},d=await a.scaffoldBaseProject(u);return i.channelWebNextjs===!0&&await a.ensureChannel({projectRoot:d,kind:`web`,packageManager:r,force:s,workspaceProbeDirectory:e,configureVercelServices:!1,onWorkspaceRootMutation:e=>{h.push(e)}}),m!==void 0&&(n||l?await moveDirectoryContents(d,e):await rename(d,e)),{projectPath:e,workspaceRootMutations:uniqueWorkspaceRootMutations(h)}}finally{m!==void 0&&await rm(m,{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(pc.yellow(` ⚠ ${formatNodeEngineOverrideWarning(t.nodeEngineOverride)}`))}async function runInitSteps(e){let{dependencies:t,logger:n,options:r,parentDirectory:i,target:s}=e,c=isLogLevelEnabled(`debug`),u=await t.isCodingAgentLaunch(),d=await resolveInitTarget({parentDirectory:i,target:s}),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 i=t.now(),s;if(d.kind===`fresh`){let e=await resolveScaffoldPackageManager(d.projectPath,t),n=isPackageManagerWorkspaceMember(e,d.projectPath),i;try{i=await scaffoldProject(d.projectPath,d.projectName,d.createInPlace,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}s={failurePolicy:d.failurePolicy,kind:`created`,packageManager:e,preservedTargetEntries:d.preservedEntries,projectPath:i.projectPath,retryCommand:`eve init ${d.projectPath}`,workspaceMember:n,workspaceRootMutations:i.workspaceRootMutations}}else{let e=await addToExistingProject(d.projectPath,r,t,f);s=e.nodeEngineOverride===void 0?{configurationFilesChanged:e.configurationFilesChanged,dependenciesAdded:e.dependenciesAdded,failurePolicy:`preserve`,filesWritten:e.filesWritten,kind:`added`,packageManager:e.packageManager,projectPath:d.projectPath}:{configurationFilesChanged:e.configurationFilesChanged,dependenciesAdded:e.dependenciesAdded,failurePolicy:`preserve`,filesWritten:e.filesWritten,kind:`added`,nodeEngineOverride:e.nodeEngineOverride,packageManager:e.packageManager,projectPath:d.projectPath}}let l=t.now()-i;initLog.debug(`${e} done`,{ms:l}),s.kind===`added`&&(p.stop(),reportExistingProjectChanges(n,s),p=startCliLiveRow(n)),p.update(`Installing dependencies`,`${s.packageManager} install`),initLog.debug(`installing dependencies with ${s.packageManager}`);let m=t.now(),h=[],g=[],_=await t.runPackageManagerInstall(s.packageManager,s.projectPath,{progressDetails:process.stdout.isTTY===!0&&!c,onOutput:e=>{e.text.trim()!==``&&(g.push(e.text),g.length>20&&g.shift(),NPM_NOISE_LINE.test(e.text)||h.push(e.text)),c&&initLog.debug(e.text);let t=installProgressDetail(s.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(s.failurePolicy!==`preserve`){if(await cleanupFreshInitTarget(s.projectPath,s.failurePolicy,s.preservedTargetEntries)){let e=s.failurePolicy===`remove`?`eve removed the incomplete project at "${s.projectPath}".`:`eve restored "${s.projectPath}" to its original state.`,t=s.workspaceMember||s.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies.\n\n${e}\n\nResolve the package-manager error above, then retry:\n ${s.retryCommand}${workspaceFailureNote(t)}`)}let e=s.workspaceMember||s.workspaceRootMutations.length>0;throw Error(`Failed to install dependencies, and eve could not completely clean "${s.projectPath}".\n\nResolve the package-manager error above, then install dependencies with ${s.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 ${s.packageManager} in "${s.projectPath}".\n\nDo not rerun eve init; the agent is already configured.`)}return initLog.debug(`dependencies installed`,{ms:v}),s.kind===`created`?(p.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),{...s,agentElapsedMs:l,agentLaunched:u,gitResult:await t.tryInitializeGit(s.projectPath),installElapsedMs:v}):{...s,agentElapsedMs:l,agentLaunched:u,installElapsedMs:v}}finally{p.stop()}}async function runInitCommand(r,i,a,o,s=defaultDependencies){let c;try{c=await runInitSteps({dependencies:s,logger:r,options:o,parentDirectory:i,target:a})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(c.kind===`created`){r.log(`${pc.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${pc.bold(c.projectPath)} ${pc.dim(`in ${formatElapsed(c.agentElapsedMs)}`)}`);for(let e of c.workspaceRootMutations)r.log(pc.yellow(`⚠ ${formatWorkspaceRootMutationWarning(e)}`))}else r.log(`${pc.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${pc.bold(c.projectPath)} ${pc.dim(`in ${formatElapsed(c.agentElapsedMs)}`)}`);r.log(`${pc.green(`✓`)} Installed dependencies ${pc.dim(`in ${formatElapsed(c.installElapsedMs)}`)}`),c.kind===`created`&&c.gitResult.kind===`failed`&&(r.error(pc.yellow(`Git initialization failed during ${c.gitResult.stage}: ${c.gitResult.reason}`)),c.gitResult.stage===`commit`&&r.error(pc.yellow(`The eve agent was created successfully. Git repository metadata and staged files were preserved at "${c.projectPath}"; the initial commit is optional.\n\nTo create it later, configure Git identity and run:\n git -C ${JSON.stringify(c.projectPath)} commit -m "Initial commit from eve"`)));let l=[...eveDevArguments(c.packageManager)],u=[c.packageManager,...l].join(` `),d=initAgentDevHandoff({projectPath:c.projectPath,devCommand:u});if(c.agentLaunched){r.log(initAgentReadySummary(o.model,c.projectPath)),r.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(r.log(pc.dim(`$ ${f}`)),!await s.spawnCodingAgentRepl({command:f,cwd:c.projectPath,prompt:initAgentReplPrompt({devCommand:u}),onPromptUnseeded:e=>{r.log(pc.yellow(`Could not seed ${f} automatically. Paste this prompt into it:`)),r.log(e)}}))throw Error(`Coding-agent REPL exited unsuccessfully in "${c.projectPath}".`);return}let p=c.kind===`created`?[...l,`--onboard`]:l;if(r.log(pc.dim(`$ eve dev`)),!resultSucceeded(await s.spawnPackageManager(c.packageManager,c.projectPath,p)))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
|
+
import{initAgentDevHandoff,initAgentReadySummary,initAgentReplPrompt}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{addAgentsToWorkspace,convertScaffoldToAgentWorkspace}from"./init-agent-workspace.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 pc from"#compiled/picocolors/index.js";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{validateModelSlug}from"#setup/flows/model-source-change.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";import{isPackageManagerWorkspaceMember}from"#setup/scaffold/workspace-root.js";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{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,o,s,c){let l=resolve(e,`..`),u=!n&&await pathExists(e)&&(await readdir(e)).length===0;if(!n&&await pathExists(e)&&!u)throw Error(`Cannot create project because "${e}" already exists.`);let d=n&&c?void 0:await mkdtemp(join(l,`.eve-init-`)),g=[];try{let l=d??e;if(i.model!==void 0){let e=await o.validateModelSlug(l,i.model);if(e!==null)throw Error(e)}let f={projectName:d===void 0?`.`:n?basename(e):t,model:i.model??DEFAULT_AGENT_MODEL_ID,reasoning:i.reasoning,evePackage:s,targetDirectory:l,overwriteExisting:c,workspaceProbeDirectory:e,packageManager:r,onWorkspaceRootMutation:e=>{g.push(e)}},p=await o.scaffoldBaseProject(f);return i.agents!==void 0&&await convertScaffoldToAgentWorkspace(p,i.agents,i),i.channelWebNextjs===!0&&await o.ensureChannel({projectRoot:p,kind:`web`,packageManager:r,force:c,workspaceProbeDirectory:e,configureVercelServices:!1,onWorkspaceRootMutation:e=>{g.push(e)}}),d!==void 0&&(n||u?await moveDirectoryContents(p,e):await rename(p,e)),{projectPath:e,workspaceRootMutations:uniqueWorkspaceRootMutations(g)}}finally{d!==void 0&&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 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(pc.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,{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(r,a,o,s,c=defaultDependencies){if(await addAgentsToWorkspace(r,a,o,s,c.validateModelSlug))return;let l;try{l=await runInitSteps({dependencies:c,logger:r,options:s,parentDirectory:a,target:o})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(l.kind===`created`){r.log(`${pc.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${pc.bold(l.projectPath)} ${pc.dim(`in ${formatElapsed(l.agentElapsedMs)}`)}`);for(let e of l.workspaceRootMutations)r.log(pc.yellow(`⚠ ${formatWorkspaceRootMutationWarning(e)}`))}else r.log(`${pc.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${pc.bold(l.projectPath)} ${pc.dim(`in ${formatElapsed(l.agentElapsedMs)}`)}`);r.log(`${pc.green(`✓`)} Installed dependencies ${pc.dim(`in ${formatElapsed(l.installElapsedMs)}`)}`),l.kind===`created`&&l.gitResult.kind===`failed`&&(r.error(pc.yellow(`Git initialization failed during ${l.gitResult.stage}: ${l.gitResult.reason}`)),l.gitResult.stage===`commit`&&r.error(pc.yellow(`The eve agent was created successfully. Git repository metadata and staged files were preserved at "${l.projectPath}"; the initial commit is optional.\n\nTo create it later, configure Git identity and run:\n git -C ${JSON.stringify(l.projectPath)} commit -m "Initial commit from eve"`)));let u=s.agents?.[0]?[`--agent`,s.agents[0]]:[],d=[...eveDevArguments(l.packageManager),...u],f=[l.packageManager,...d].join(` `),p=initAgentDevHandoff({projectPath:l.projectPath,devCommand:f});if(l.agentLaunched){r.log(initAgentReadySummary(s.model,l.projectPath)),r.log(p);return}let m;try{m=await c.selectInitHandoff({agentName:basename(l.projectPath)})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(m===`exit`)return;if(m!==`eve-dev`){if(r.log(pc.dim(`$ ${m}`)),!await c.spawnCodingAgentRepl({command:m,cwd:l.projectPath,prompt:initAgentReplPrompt({devCommand:f}),onPromptUnseeded:e=>{r.log(pc.yellow(`Could not seed ${m} automatically. Paste this prompt into it:`)),r.log(e)}}))throw Error(`Coding-agent REPL exited unsuccessfully in "${l.projectPath}".`);return}let h=l.kind===`created`?[...d,`--onboard`]:d;if(r.log(pc.dim(`$ eve dev${u.length>0?` --agent ${u[1]}`:``}`)),!resultSucceeded(await c.spawnPackageManager(l.packageManager,l.projectPath,h)))throw Error(`Development server exited unsuccessfully in "${l.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{serializeHeadlessSetupEvent}from"./setup-headless.js";import{
|
|
1
|
+
import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{createPrompter}from"#setup/prompter.js";import{join}from"node:path";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,creationType:e.options?.creationType,connectionMethod:e.options?.connectionMethod,principalType:e.options?.principalType,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(n,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(t){if(d?.fail(t),d!==void 0)return;if(c.nonInteractive&&t instanceof SetupPrerequisiteRequired){n.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`prerequisite_required`,prerequisite:t.prerequisite})),process.exitCode=2;return}n.error(t instanceof Error?t.message:String(t)),process.exitCode=1}}export{runIntegrationConnect,runIntegrationConnectCommand};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isEveProject } from "#setup/scaffold/index.js";
|
|
1
2
|
import { type LinkFlowDeps } from "#setup/flows/link.js";
|
|
2
3
|
import { type Prompter } from "#setup/prompter.js";
|
|
3
4
|
import { type VercelProjectCliOptions } from "./vercel-non-interactive.js";
|
|
@@ -8,6 +9,7 @@ export interface LinkCliLogger {
|
|
|
8
9
|
export interface LinkCommandDependencies {
|
|
9
10
|
createPrompter?: () => Prompter;
|
|
10
11
|
hasInteractiveTerminal(): boolean;
|
|
12
|
+
isEveProject?: typeof isEveProject;
|
|
11
13
|
/** Test seam into the flow's detection and box effects. */
|
|
12
14
|
flowDeps?: Partial<LinkFlowDeps>;
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
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. Name the project instead: `eve link --project <name-or-id> --non-interactive`."),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
|
+
import{hasInteractiveTerminal,validateWorkspaceProjectCommand}from"./preconditions.js";import{isNonInteractiveProjectCommand,runNonInteractiveLink}from"./vercel-non-interactive.js";import{createPrompter}from"#setup/prompter.js";import{isEveProject}from"#setup/scaffold/index.js";import{runLinkFlow}from"#setup/flows/link.js";const defaultDependencies={hasInteractiveTerminal,isEveProject};async function runLinkCommand(e,n,r=defaultDependencies,i={}){if(!await validateWorkspaceProjectCommand({appRoot:n,isEveProject:r.isEveProject,logger:e,workspaceMemberMessage:e=>`This agent belongs to the workspace at ${e.root}. Run \`eve link\` from the workspace root.`}))return;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. Name the project instead: `eve link --project <name-or-id> --non-interactive`."),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,7 +1,22 @@
|
|
|
1
|
+
import type { EveProjectContext } from "#internal/project-context.js";
|
|
2
|
+
import { isEveProject } from "#setup/scaffold/index.js";
|
|
1
3
|
/**
|
|
2
4
|
* Refusal shown by agent-scoped commands (`eve link`, `eve deploy`,
|
|
3
5
|
* `eve channels …`) when the working directory holds no eve agent.
|
|
4
6
|
*/
|
|
5
7
|
export declare const NOT_AN_AGENT_MESSAGE = "No eve agent in this directory. Run `eve init <name>`, then run this command from inside the new project.";
|
|
8
|
+
interface ProjectCommandLogger {
|
|
9
|
+
error(message: string): void;
|
|
10
|
+
}
|
|
11
|
+
/** Validate that a Vercel project command targets a workspace root or an eve app. */
|
|
12
|
+
export declare function validateWorkspaceProjectCommand(input: {
|
|
13
|
+
readonly appRoot: string;
|
|
14
|
+
readonly isEveProject?: typeof isEveProject;
|
|
15
|
+
readonly logger: ProjectCommandLogger;
|
|
16
|
+
readonly workspaceMemberMessage: (workspace: Extract<EveProjectContext, {
|
|
17
|
+
kind: "workspace";
|
|
18
|
+
}>["workspace"]) => string;
|
|
19
|
+
}): Promise<boolean>;
|
|
6
20
|
/** True when stdin and stdout are both TTYs — the default interactivity gate. */
|
|
7
21
|
export declare function hasInteractiveTerminal(): boolean;
|
|
22
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const NOT_AN_AGENT_MESSAGE="No eve agent in this directory. Run `eve init <name>`, then run this command from inside the new project.";function hasInteractiveTerminal(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}export{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal};
|
|
1
|
+
import{resolveEveProjectContext}from"#internal/project-context.js";import{isEveProject}from"#setup/scaffold/index.js";const NOT_AN_AGENT_MESSAGE="No eve agent in this directory. Run `eve init <name>`, then run this command from inside the new project.";async function validateWorkspaceProjectCommand(e){let t=await resolveEveProjectContext(e.appRoot);return t.kind===`workspace-member`?(e.logger.error(e.workspaceMemberMessage(t.workspace)),process.exitCode=1,!1):t.kind===`standalone`&&!await(e.isEveProject??isEveProject)(e.appRoot)?(e.logger.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1,!1):!0}function hasInteractiveTerminal(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}export{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal,validateWorkspaceProjectCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Command } from "#compiled/commander/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { CliApplicationContext } from "#cli/application-command.js";
|
|
3
3
|
import type { ConnectPrincipalType } from "#setup/connection-connector.js";
|
|
4
4
|
interface IntegrationCommandLogger {
|
|
5
5
|
error(message: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseSetupAnswer}from"./setup-answers.js";import{InvalidArgumentError}from"#compiled/commander/index.js";import{
|
|
1
|
+
import{parseSetupAnswer}from"./setup-answers.js";import{InvalidArgumentError}from"#compiled/commander/index.js";import{agentCommand}from"#cli/agent-command.js";function parseConnectPrincipalType(e){if(e===`app`||e===`user`)return e;throw new InvalidArgumentError(`Expected principal type "app" or "user".`)}function registerIntegrationCommands(t){let{applicationContext:r,logger:i,program:a}=t,o=a.command(`integration`).description(`Set up an eve integration`);agentCommand(o.command(`setup <kind>`),r).description(`Run a built-in integration setup flow`).option(`-y, --yes`).option(`--force`,`Overwrite files created by setup.`).option(`--non-interactive`,`Run without interactive prompts, instead emit structured NDJSON when further input is required`).option(`--answer <key=value>`,`Answer a setup question; requires --non-interactive.`,parseSetupAnswer,{}).action(async(e,t)=>{let{runIntegrationSetupCommand:n}=await import(`./integration-setup.js`);await n(i,r.root,e,{yes:t.yes,force:t.force,nonInteractive:t.nonInteractive,answers:t.answer})}),agentCommand(o.command(`connect <slug> <service> [canonical-name]`,{hidden:!0}),r).option(`-y, --yes`).option(`--creation-type <type>`,`Select the Vercel Connect creation type.`).option(`--connection-method <method>`,`Select the Vercel Connect connection method.`).option(`--principal-type <type>`,`Require app- or user-scoped Vercel Connect credentials.`,parseConnectPrincipalType).option(`--non-interactive`,`Run without interactive prompts, instead emit structured NDJSON when further input is required`).action(async(e,t,n,a)=>{let{runIntegrationConnectCommand:o}=await import(`./integration-connect.js`);await o(i,r.root,e,t,n,a)})}export{parseConnectPrincipalType,registerIntegrationCommands};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{parseSetupAnswer}from"./setup-answers.js";import{InvalidArgumentError}from"#compiled/commander/index.js";import{applicationCommand}from"#cli/application-command.js";function parseSearchLimit(e){if(!/^\d+$/u.test(e))throw new InvalidArgumentError(`Expected a positive integer, received "${e}".`);let n=Number(e);if(n<1||n>100)throw new InvalidArgumentError(`Expected a limit between 1 and 100, received "${e}".`);return n}function registerRegistryCommands(
|
|
1
|
+
import{parseSetupAnswer}from"./setup-answers.js";import{InvalidArgumentError}from"#compiled/commander/index.js";import{agentCommand}from"#cli/agent-command.js";import{applicationCommand}from"#cli/application-command.js";function parseSearchLimit(e){if(!/^\d+$/u.test(e))throw new InvalidArgumentError(`Expected a positive integer, received "${e}".`);let n=Number(e);if(n<1||n>100)throw new InvalidArgumentError(`Expected a limit between 1 and 100, received "${e}".`);return n}function registerRegistryCommands(i){let{applicationContext:a,logger:o,program:s}=i,c=agentCommand(s.command(`add [item]`),a).description(`Install a registry item; relative paths use the official eve registry.`).option(`-o, --overwrite`,`Overwrite existing files.`).option(`--skip-install`,`Run the item's setup flow without installing it.`).option(`--skip-setup`,`Skip the item's setup flow.`).option(`--non-interactive`,`Run without interactive prompts, instead emit structured NDJSON when further input is required`).option(`--answer <key=value>`,`Answer a setup question with JSON; requires --non-interactive; repeat for multiple answers.`,parseSetupAnswer).option(`-y, --yes`,`Run setup and accept its recommended defaults.`).addHelpText(`after`,`
|
|
2
2
|
Search the registry:
|
|
3
3
|
$ eve registry search <query>
|
|
4
|
-
`).action(async(e,n)=>{if(e===void 0){
|
|
4
|
+
`).action(async(e,n)=>{if(e===void 0){c.outputHelp();return}if(n.answer!==void 0&&!n.nonInteractive)throw new InvalidArgumentError(`--answer requires --non-interactive.`);let{runAddCommand:r}=await import(`./registry.js`);await r(o,a.root,e,{...n,answers:n.answer})}),l=s.command(`registry`).description(`Configure and browse extension and agent registry catalogs.`);applicationCommand(l.command(`add <registries...>`),a).description(`Add registry namespace mappings to package.json.`).action(async e=>{let{runRegistryAddCommand:t}=await import(`./registry.js`);await t(o,a.root,e)}),applicationCommand(l.command(`list`),a).description(`List items from all registries or one source.`).option(`-r, --registry <source>`,`List items from one registry.`).option(`--json`,`Output as JSON`).action(async e=>{let{runRegistryListCommand:t}=await import(`./registry.js`);await t(o,a.root,e.registry,e)}),applicationCommand(l.command(`search <query>`),a).description(`Search all registries or one source.`).option(`-r, --registry <source>`,`Search one registry.`).option(`--limit <count>`,`Maximum results to return (default: 10).`,parseSearchLimit,10).option(`--json`,`Output as JSON`).action(async(e,t)=>{let{runRegistrySearchCommand:n}=await import(`./registry.js`);await n(o,a.root,e,t.registry,t)}),applicationCommand(l.command(`view <item>`),a).description(`Inspect one registry item.`).option(`--json`,`Output the raw registry item as JSON.`).action(async(e,t)=>{let{runRegistryViewCommand:n}=await import(`./registry.js`);await n(o,a.root,e,t)})}export{registerRegistryCommands};
|