eve 0.27.13 → 0.29.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 +38 -0
- package/dist/src/channel/adapter.d.ts +5 -5
- package/dist/src/channel/session.d.ts +2 -2
- package/dist/src/channel/types.d.ts +16 -6
- package/dist/src/chunks/{use-eve-agent-CWYe-vqE.js → use-eve-agent-CyDt3Lny.js} +92 -1
- package/dist/src/chunks/{use-eve-agent-CsSQOKnp.js → use-eve-agent-DaH3cf8K.js} +92 -1
- package/dist/src/cli/commands/agent-prompt/collect-intent.md +1 -1
- package/dist/src/cli/commands/channels.d.ts +0 -17
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.d.ts +29 -0
- package/dist/src/cli/commands/integration-connect.js +1 -0
- package/dist/src/cli/commands/integration-setup.d.ts +2 -3
- package/dist/src/cli/commands/integration-setup.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/registry-setup-command.d.ts +13 -3
- package/dist/src/cli/commands/registry-setup-command.js +2 -1
- package/dist/src/cli/commands/registry.d.ts +35 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/trace.js +1 -1
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.d.ts +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
- package/dist/src/cli/dev/tui/remote-auth-command.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +8 -7
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +8 -13
- package/dist/src/cli/dev/tui/setup-commands.js +3 -2
- package/dist/src/cli/dev/tui/setup-flow.d.ts +14 -5
- package/dist/src/cli/dev/tui/setup-panel.d.ts +5 -1
- package/dist/src/cli/dev/tui/setup-panel.js +2 -2
- package/dist/src/cli/dev/tui/status-line.d.ts +1 -1
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.d.ts +8 -2
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +2 -5
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.js +1 -1
- package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +2 -0
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/vercel-status.d.ts +1 -6
- package/dist/src/cli/dev/tui/vercel-status.js +1 -1
- package/dist/src/cli/invoke/result.d.ts +15 -0
- package/dist/src/cli/invoke/result.js +1 -1
- package/dist/src/cli/option-parsers.d.ts +11 -0
- package/dist/src/cli/option-parsers.js +1 -0
- package/dist/src/cli/run.d.ts +1 -12
- package/dist/src/cli/run.js +3 -3
- package/dist/src/cli/shutdown.d.ts +2 -0
- package/dist/src/cli/shutdown.js +1 -1
- package/dist/src/client/eve-agent-store.d.ts +7 -4
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/index.d.ts +3 -3
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/client/message-reducer-types.d.ts +5 -3
- package/dist/src/client/message-response.d.ts +4 -4
- package/dist/src/client/ndjson.d.ts +3 -3
- package/dist/src/client/open-stream.d.ts +2 -2
- package/dist/src/client/output-schema.d.ts +2 -2
- package/dist/src/client/reducer.d.ts +2 -2
- package/dist/src/client/session-utils.d.ts +5 -5
- package/dist/src/client/session.d.ts +2 -2
- package/dist/src/client/types.d.ts +2 -2
- package/dist/src/compiled/.vendor-stamp.json +5 -5
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/private.d.ts +21 -5
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/world.d.ts +10 -5
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +13 -13
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DeZc2RZz.js → attribute-changes-1LmTKuTT.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{private-Cre8uYkA.js → private-BcwCGTV5.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{resume-hook-ip1hbn1b.js → resume-hook-D1_5NCZ6.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{run-CWytxfIp.js → run-C240Ctf4.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/sleep-De802yfX.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-De9yESQN.js → wait-until-z48sPUjU.js} +2 -2
- package/dist/src/compiled/shadcn-registry/index.d.ts +1 -0
- package/dist/src/compiler/compile-from-memory.d.ts +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +8 -8
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +2 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/context/dynamic-instruction-lifecycle.d.ts +2 -2
- package/dist/src/context/dynamic-model-lifecycle.d.ts +2 -2
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -2
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +2 -2
- package/dist/src/context/hook-lifecycle.d.ts +2 -2
- package/dist/src/evals/assertions/collector.d.ts +2 -10
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/assertions/run.d.ts +3 -3
- package/dist/src/evals/cli/eval.d.ts +6 -2
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/cli/filter.d.ts +14 -0
- package/dist/src/evals/cli/filter.js +1 -0
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/diagnostics.d.ts +8 -0
- package/dist/src/evals/diagnostics.js +1 -0
- package/dist/src/evals/expect/index.d.ts +1 -1
- package/dist/src/evals/expect/index.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/judge.js +2 -1
- package/dist/src/evals/match.d.ts +4 -4
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/derive-run-facts.d.ts +2 -2
- package/dist/src/evals/runner/reporters/assertion-diagnostics.d.ts +3 -0
- package/dist/src/evals/runner/reporters/assertion-diagnostics.js +3 -0
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/reporters/junit.js +2 -2
- package/dist/src/evals/session.d.ts +3 -3
- package/dist/src/evals/types.d.ts +33 -17
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/route-child-delivery.d.ts +4 -3
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/session-delivery-hook.d.ts +1 -0
- package/dist/src/execution/session-delivery-hook.js +1 -1
- package/dist/src/execution/session-timeout-control.d.ts +9 -0
- package/dist/src/execution/session-timeout-control.js +1 -0
- package/dist/src/execution/session-timeout-steps.d.ts +13 -0
- package/dist/src/execution/session-timeout-steps.js +1 -0
- package/dist/src/execution/session-timeout-workflow.d.ts +6 -0
- package/dist/src/execution/session-timeout-workflow.js +1 -0
- package/dist/src/execution/session-timeout.d.ts +2 -0
- package/dist/src/execution/session-timeout.js +1 -0
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/subagent-event-proxy-step.js +1 -1
- package/dist/src/execution/subagent-hitl-proxy.d.ts +5 -1
- package/dist/src/execution/subagent-hitl-proxy.js +1 -1
- package/dist/src/execution/terminal-session-completion-step.d.ts +5 -0
- package/dist/src/execution/terminal-session-completion-step.js +1 -0
- package/dist/src/execution/terminal-session-failure-step.js +1 -1
- package/dist/src/execution/turn-cancellation-control.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-entry.d.ts +1 -0
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +4 -0
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.d.ts +12 -2
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/agent-otel-provider.js +1 -1
- package/dist/src/harness/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-class.d.ts +23 -0
- package/dist/src/harness/input-request-class.js +1 -0
- package/dist/src/harness/input-requests.d.ts +20 -9
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/instrumentation-lifecycle.d.ts +12 -1
- package/dist/src/harness/proxy-input-requests.d.ts +10 -4
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/session-limit-continuation.d.ts +0 -11
- package/dist/src/harness/session-limit-continuation.js +1 -1
- package/dist/src/harness/session-limit-enforcement.d.ts +3 -2
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/session-token-limits.d.ts +41 -0
- package/dist/src/harness/session-token-limits.js +1 -0
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/subagent-token-budget.d.ts +6 -4
- package/dist/src/harness/subagent-token-budget.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/turn-sleep.d.ts +12 -0
- package/dist/src/harness/turn-sleep.js +1 -0
- package/dist/src/harness/turn-tag-state.d.ts +26 -17
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +4 -4
- package/dist/src/harness/workflow-lifecycle.d.ts +2 -2
- package/dist/src/internal/application/compiled-artifacts.js +7 -7
- 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/dev-authored-source-watcher.d.ts +4 -0
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/workflow/development-world-protocol.js +1 -1
- package/dist/src/internal/workflow/world-target.d.ts +7 -0
- package/dist/src/internal/workflow/world-target.js +1 -0
- package/dist/src/internal/workflow-bundle/workflow-core-shim.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -1
- package/dist/src/protocol/event-dedupe.d.ts +25 -0
- package/dist/src/protocol/event-dedupe.js +1 -0
- package/dist/src/protocol/event-id.d.ts +16 -0
- package/dist/src/protocol/event-id.js +1 -0
- package/dist/src/protocol/message.d.ts +39 -23
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/protocol/routes.d.ts +4 -0
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/channels/discord/discordChannel.d.ts +3 -3
- package/dist/src/public/channels/github/githubChannel.d.ts +3 -3
- package/dist/src/public/channels/linear/linearChannel.d.ts +3 -3
- package/dist/src/public/channels/slack/hitl.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +3 -3
- package/dist/src/public/channels/teams/hitl.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +3 -3
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +3 -3
- package/dist/src/public/channels/twilio/twilioChannel.d.ts +3 -3
- package/dist/src/public/definitions/channel.d.ts +4 -4
- package/dist/src/public/definitions/hook.d.ts +2 -2
- package/dist/src/public/tools/sleep/index.d.ts +18 -0
- package/dist/src/public/tools/sleep/index.js +1 -0
- package/dist/src/react/use-eve-agent.d.ts +3 -2
- package/dist/src/runtime/framework-tools/ask-question.js +1 -1
- package/dist/src/runtime/framework-tools/sleep.d.ts +15 -0
- package/dist/src/runtime/framework-tools/sleep.js +1 -0
- package/dist/src/runtime/hooks/registry.d.ts +2 -2
- package/dist/src/runtime/input/types.d.ts +19 -4
- package/dist/src/runtime/input/types.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/types.d.ts +2 -2
- package/dist/src/services/dev-client/runtime-artifacts.d.ts +7 -0
- package/dist/src/services/dev-client/runtime-artifacts.js +1 -1
- package/dist/src/setup/boxes/apply-ai-gateway-credential.js +1 -1
- package/dist/src/setup/boxes/deploy-project.d.ts +3 -3
- package/dist/src/setup/flows/deploy.js +1 -1
- package/dist/src/setup/flows/ensure-vercel-project.d.ts +17 -0
- package/dist/src/setup/flows/ensure-vercel-project.js +1 -0
- package/dist/src/setup/flows/in-project.d.ts +1 -1
- package/dist/src/setup/flows/link.js +1 -1
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/provider.js +1 -1
- package/dist/src/setup/flows/registry.d.ts +20 -0
- package/dist/src/setup/flows/registry.js +1 -0
- package/dist/src/setup/index.d.ts +0 -1
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/{channel-setup-environment.d.ts → integrations/channels/environment.d.ts} +2 -2
- package/dist/src/setup/integrations/channels/environment.js +1 -0
- package/dist/src/setup/{channel-setup-integrations.d.ts → integrations/channels/index.d.ts} +3 -3
- package/dist/src/setup/integrations/channels/index.js +1 -0
- package/dist/src/setup/{channel-setup-runner.d.ts → integrations/channels/runner.d.ts} +1 -1
- package/dist/src/setup/integrations/channels/runner.js +1 -0
- package/dist/src/setup/{boxes/add-channels.d.ts → integrations/channels/setup.d.ts} +32 -22
- package/dist/src/setup/integrations/channels/setup.js +2 -0
- package/dist/src/setup/{channel-setup-slack.d.ts → integrations/channels/slack.d.ts} +1 -1
- package/dist/src/setup/integrations/channels/slack.js +1 -0
- package/dist/src/setup/{channel-setup-integration.d.ts → integrations/channels/types.d.ts} +23 -7
- package/dist/src/setup/{channel-setup-ui.d.ts → integrations/channels/ui.d.ts} +2 -2
- package/dist/src/setup/integrations/channels/ui.js +2 -0
- package/dist/src/setup/{channel-setup-web.d.ts → integrations/channels/web.d.ts} +1 -1
- package/dist/src/setup/integrations/channels/web.js +1 -0
- package/dist/src/setup/primitives/run-vercel.d.ts +1 -0
- package/dist/src/setup/primitives/run-vercel.js +1 -1
- package/dist/src/setup/prompter.d.ts +16 -3
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/registry-setup-client.d.ts +18 -0
- package/dist/src/setup/registry-setup-client.js +2 -0
- package/dist/src/setup/registry-setup-protocol.d.ts +93 -0
- package/dist/src/setup/registry-setup-protocol.js +1 -0
- package/dist/src/setup/scaffold/channels-catalog.d.ts +1 -1
- package/dist/src/setup/scaffold/create/extension.js +2 -2
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +2 -2
- package/dist/src/setup/scaffold/create-in-place.d.ts +1 -0
- package/dist/src/setup/scaffold/create-in-place.js +1 -0
- package/dist/src/setup/scaffold/index.js +1 -1
- package/dist/src/setup/scaffold/update/connections.js +3 -3
- package/dist/src/setup/scaffold/update/update-connection-connector.js +1 -1
- package/dist/src/setup/vercel-project-framework.d.ts +1 -1
- package/dist/src/setup/vercel-project-framework.js +1 -1
- package/dist/src/setup/vercel-project.d.ts +17 -2
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/agent-definition.d.ts +12 -0
- package/dist/src/shared/dynamic-tool-definition.d.ts +2 -2
- package/dist/src/shared/ulid.d.ts +39 -0
- package/dist/src/shared/ulid.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +4 -4
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +4 -4
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +28 -16
- package/docs/channels/overview.mdx +1 -1
- package/docs/channels/slack.mdx +2 -2
- package/docs/concepts/default-harness.md +12 -0
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +61 -0
- package/docs/evals/assertions.mdx +8 -1
- package/docs/evals/judge.mdx +11 -1
- package/docs/evals/reporters.mdx +1 -1
- package/docs/evals/running.mdx +3 -0
- package/docs/guides/client/streaming.mdx +9 -3
- package/docs/guides/dev-tui.md +9 -14
- package/docs/guides/frontend/overview.mdx +4 -2
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +1 -1
- package/docs/guides/frontend/use-eve-agent-vue.mdx +10 -10
- package/docs/guides/hooks.md +40 -2
- package/docs/guides/instrumentation.md +5 -1
- package/docs/reference/cli.md +25 -38
- package/docs/reference/typescript-api.md +2 -1
- package/docs/tools/human-in-the-loop.md +5 -0
- package/docs/tutorial/ship-it.mdx +2 -2
- package/package.json +11 -6
- package/dist/src/compiled/@workflow/core/runtime/world-target.d.ts +0 -11
- package/dist/src/compiled/_chunks/workflow/sleep-BjrUxUcs.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/parse-name.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/promise.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/time.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/workflow-routes.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/world-target.js +0 -1
- package/dist/src/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +0 -1
- package/dist/src/setup/boxes/add-channels.js +0 -2
- package/dist/src/setup/boxes/add-connections.d.ts +0 -26
- package/dist/src/setup/boxes/add-connections.js +0 -1
- package/dist/src/setup/boxes/install-channel-registry-items.d.ts +0 -8
- package/dist/src/setup/boxes/install-channel-registry-items.js +0 -1
- package/dist/src/setup/boxes/one-shot-next-steps.d.ts +0 -18
- package/dist/src/setup/boxes/one-shot-next-steps.js +0 -2
- package/dist/src/setup/boxes/preflight.d.ts +0 -37
- package/dist/src/setup/boxes/preflight.js +0 -1
- package/dist/src/setup/boxes/resolve-target.d.ts +0 -58
- package/dist/src/setup/boxes/resolve-target.js +0 -1
- package/dist/src/setup/boxes/scaffold.d.ts +0 -40
- package/dist/src/setup/boxes/scaffold.js +0 -1
- package/dist/src/setup/boxes/select-channels.d.ts +0 -49
- package/dist/src/setup/boxes/select-channels.js +0 -1
- package/dist/src/setup/boxes/select-chat.d.ts +0 -38
- package/dist/src/setup/boxes/select-chat.js +0 -1
- package/dist/src/setup/boxes/select-connections.d.ts +0 -30
- package/dist/src/setup/boxes/select-connections.js +0 -1
- package/dist/src/setup/boxes/select-setup-mode.d.ts +0 -32
- package/dist/src/setup/boxes/select-setup-mode.js +0 -1
- package/dist/src/setup/channel-setup-deployment.d.ts +0 -11
- package/dist/src/setup/channel-setup-deployment.js +0 -1
- package/dist/src/setup/channel-setup-environment.js +0 -1
- package/dist/src/setup/channel-setup-integration.js +0 -1
- package/dist/src/setup/channel-setup-integrations.js +0 -1
- package/dist/src/setup/channel-setup-runner.js +0 -1
- package/dist/src/setup/channel-setup-slack.js +0 -1
- package/dist/src/setup/channel-setup-ui.js +0 -2
- package/dist/src/setup/channel-setup-web.js +0 -1
- package/dist/src/setup/flows/channels.d.ts +0 -57
- package/dist/src/setup/flows/channels.js +0 -1
- package/dist/src/setup/flows/connections.d.ts +0 -37
- package/dist/src/setup/flows/connections.js +0 -3
- package/dist/src/setup/onboarding.d.ts +0 -60
- package/dist/src/setup/onboarding.js +0 -1
- /package/dist/src/{node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/pluralize.js → setup/integrations/channels/types.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.29.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2b09840: Remove the `/channels` dev TUI command, `eve channels add`, and the unused programmatic onboarding API. Channel integrations install through `eve add`, run isolated integration setup without deploying, and leave deployment as an explicit `eve deploy` step.
|
|
8
|
+
- 38cdff8: Renames the `eve trace` CLI command to `eve traces` so it matches the `/traces` TUI command and the plural `eve logs` command. `eve traces ls` and `eve traces <trace>` work as before; the old singular form is removed.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 6dd3006: Cancelling a parent turn now delivers descendant cancellations more reliably: the cancel request retries with exponential backoff (~8s budget instead of 3s), `no_active_turn` results carry the error class that marked the target inactive, and every previously silent drop path (missing pending batch, missing child session ids, exhausted retries) now logs a warning so an uncancelled child no longer runs to completion without a trace.
|
|
13
|
+
- 255027e: Add an opt-in durable `sleep` tool from `eve/tools/sleep`. Agents can export `sleep()` from `agent/tools/sleep.ts` to let the model pause a turn before checking progress or status again without holding an application runtime open.
|
|
14
|
+
- 01ed80d: `eve eval` gains a repeatable `--exclude-tag <tag...>` flag that skips evals carrying a tag. Exclusion applies after `--tag` inclusion, and a run where exclusion removes every matching eval now exits successfully with nothing executed. `--list` reports the post-filter selection — `--list --json` prints `[]` when exclusion removes everything — so suite runners can probe whether anything would run.
|
|
15
|
+
- f09a399: Allow `eve init .` to scaffold in directories that already contain common, source-controlled toolchain and development-environment manifests. Existing mise configs and lockfiles, Node version selectors, proto, Devbox, Nix flake, and devenv configuration are preserved.
|
|
16
|
+
- 2b09840: Remove the `/connect` dev TUI command. Add connections through `eve add` or `/add`; official Connect-backed connection items now configure and patch their Vercel connector during registry setup.
|
|
17
|
+
- 0179111: Report concise, actionable diagnostics for failed value and LLM judge assertions, including actual and expected values, schema issues, evaluated prompts, and judge rationale. Add assertion labels, preserve structured evidence in artifacts, and prevent duplicate Braintrust score names from overwriting each other.
|
|
18
|
+
- 2b09840: Add a `/add` dev TUI command with categorized registry browsing, manifest inspection, and integration installation without leaving the interactive session. Fresh `eve init` sessions open this next-steps hub after model setup.
|
|
19
|
+
- 6dd3006: A turn cancellation observed while a durable turn step is returning now settles the turn as cancelled instead of losing the race to an ordinary completion. Previously the step could miss the abort signal and finish `done`, leaving the session in a completed state after the user had already cancelled. The cancel signal also now aborts in the same microtask that consumes the cancel payload, so a cancel replayed alongside a completed step can no longer lose the settle check by one task-queue hop.
|
|
20
|
+
- 6dd3006: Upgrade the vendored Workflow DevKit to `@workflow/core@5.0.0-beta.38`. This picks up the upstream fix for runs going dormant after an accepted hook resume (vercel/workflow#3183): a session cancelled while parked on subagents could previously hold the accepted cancel indefinitely — its turn only settling as cancelled when unrelated traffic happened to wake the run. beta.38 also restored runtime world selection in core's `createWorld()`, which statically imports both first-party worlds; eve stubs those imports at vendor time so hosted Vercel bundles keep excluding local-world infrastructure.
|
|
21
|
+
|
|
22
|
+
## 0.28.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- 98d17c7: Input requests now include a required `kind` discriminator so clients can route tool approvals, questions, and session-limit decisions without inferring behavior from tool names or request IDs. Descendant session-limit Stop responses now let the parent own turn cancellation, avoiding a parent-child wait cycle.
|
|
27
|
+
- 7ff4f77: Every session stream event now carries a stable, `evt_`-prefixed ULID in `meta.id`, and stream consumers use it to drop re-delivery without collapsing distinct events. Retried steps re-emit under new ids, while reconnects, rewinds, and saved-log overlap preserve the original id.
|
|
28
|
+
|
|
29
|
+
**Breaking:** `MessageStreamEvent` is now the canonical public type for events read from a stream, with `meta.id` and `meta.at` required. `HandleMessageStreamEvent` remains as a deprecated alias, so existing imports continue to compile; code that constructs unstamped events under that type must add the envelope. Client, channel, hook, frontend, and eval APIs carry `MessageStreamEvent` end to end, so consumers can read `meta.id` without guards. Events persisted by an earlier version carry `meta.at` but no `meta.id`, so rewinding into a session that started before this release yields events whose id is absent despite the type. eve passes those through rather than dropping them, and they cannot be deduplicated; the exposure ends when those sessions do.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 28417c4: Declining a session token-limit prompt no longer leaves a stale copy of the prompt in the parked session. Previously the cancelled turn settled with a snapshot that resurrected the already-answered prompt, so every follow-up message was queued behind it and never re-raised the prompt; follow-ups now reach the budget gate, which re-raises a fresh prompt while the session is over budget.
|
|
34
|
+
- 33ea372: Records Vercel AI Gateway cost on local trace spans: `agent.step` spans now carry `gen_ai.usage.cost`, `gen_ai.usage.gateway_cost`, `gen_ai.usage.input_cost`/`output_cost`, and `gen_ai.generation.id` when the gateway reports them. The attributes only exist for gateway-served calls — other providers emit nothing.
|
|
35
|
+
- 28417c4: Session token limits are now tracked as a runtime limit — an absolute lifetime-usage ceiling that each approved continuation re-anchors to `usage + configured limit` — replacing the window-baseline bookkeeping. Behavior is unchanged except the continuation prompt's `usedTokens` now reports the absolute session total instead of the window-relative amount.
|
|
36
|
+
- feac858: Complete durable sessions after 30 days by default, and add `limits.sessionTimeoutMs` to configure or disable the lifetime for each agent. Once an expired session settles, the next qualifying channel message for its continuation starts a fresh session.
|
|
37
|
+
- 28417c4: Keep one session token-limit prompt pending while concurrent input queues behind it. Approving restores the configured budget window, delegated sessions inherit from the fresh window, and zero-quota child tasks no longer raise continuation prompts that cannot grant tokens.
|
|
38
|
+
- dbc8eae: Splits token usage on local trace spans: model and step spans now record `gen_ai.usage.cache_read.input_tokens` and `gen_ai.usage.cache_creation.input_tokens` (OTel GenAI semantic-convention names) alongside the input/output totals when the provider reports detailed usage — cached tokens price differently, so the split makes cost attribution exact. Providers without detailed usage emit only the totals.
|
|
39
|
+
- 46c6ce3: The dev TUI now renders the session token-limit continuation prompt as a proper question — prompt copy and labeled Approve/Stop options in the question pane — instead of a generic y/n tool-approval line, and answers every confirmation prompt with the request's own option ids instead of hardcoded `approve`/`deny`. Previously, approving the continuation prompt in the TUI submitted an option the server did not recognize, so the same prompt was re-raised indefinitely.
|
|
40
|
+
|
|
3
41
|
## 0.27.13
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ContextAccessor } from "#context/key.js";
|
|
2
2
|
import type { StepInput } from "#harness/types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { UnstampedMessageStreamEvent } from "#protocol/message.js";
|
|
4
4
|
import type { SessionHandle } from "#channel/session.js";
|
|
5
5
|
import type { DeliverPayload } from "#channel/types.js";
|
|
6
6
|
import type { FetchFileResult, FetchFileFunction } from "#shared/channel-definition.js";
|
|
@@ -44,7 +44,7 @@ type StateOf<TCtx> = TCtx extends ChannelAdapterContext<infer S> ? S : Record<st
|
|
|
44
44
|
* Extracts the `data` field type from a stream event by its `type` discriminant.
|
|
45
45
|
* Events that carry no `data` field (e.g. `session.completed`) resolve to `undefined`.
|
|
46
46
|
*/
|
|
47
|
-
type EventData<T extends
|
|
47
|
+
type EventData<T extends UnstampedMessageStreamEvent["type"]> = Extract<UnstampedMessageStreamEvent, {
|
|
48
48
|
type: T;
|
|
49
49
|
}> extends {
|
|
50
50
|
data: infer D;
|
|
@@ -53,14 +53,14 @@ type EventData<T extends HandleMessageStreamEvent["type"]> = Extract<HandleMessa
|
|
|
53
53
|
* A single outbound event handler. Receives the event's `data` (not the full
|
|
54
54
|
* envelope) and the adapter context. Void return — side effects only.
|
|
55
55
|
*/
|
|
56
|
-
type EventHandler<T extends
|
|
56
|
+
type EventHandler<T extends UnstampedMessageStreamEvent["type"], TCtx extends ChannelAdapterContext<any> = ChannelAdapterContext> = (data: EventData<T>, ctx: TCtx) => void | Promise<void>;
|
|
57
57
|
/**
|
|
58
58
|
* Map of outbound event handlers keyed by event type. The adapter declares
|
|
59
59
|
* handlers for the event types it cares about. For undeclared types, the
|
|
60
60
|
* framework's default handlers run.
|
|
61
61
|
*/
|
|
62
62
|
export type ChannelEventHandlers<TCtx extends ChannelAdapterContext<any> = ChannelAdapterContext> = {
|
|
63
|
-
[K in
|
|
63
|
+
[K in UnstampedMessageStreamEvent["type"]]?: EventHandler<K, TCtx>;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
66
|
* Enriched return shape from a channel's {@link ChannelAdapter.fetchFile}
|
|
@@ -155,4 +155,4 @@ export declare function getAdapterKind(adapter: ChannelAdapter): string;
|
|
|
155
155
|
* Throwing handlers are logged and swallowed so a downstream delivery
|
|
156
156
|
* failure does not corrupt the event stream write path.
|
|
157
157
|
*/
|
|
158
|
-
export declare function callAdapterEventHandler(adapter: ChannelAdapter, event:
|
|
158
|
+
export declare function callAdapterEventHandler(adapter: ChannelAdapter, event: UnstampedMessageStreamEvent, ctx: ChannelAdapterContext): Promise<UnstampedMessageStreamEvent>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContextAccessor } from "#context/key.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { MessageStreamEvent } from "#protocol/message.js";
|
|
3
3
|
import type { CancelTurnResult, Runtime } from "#channel/types.js";
|
|
4
4
|
import type { SessionAuth } from "#context/keys.js";
|
|
5
5
|
/**
|
|
@@ -29,7 +29,7 @@ export interface Session {
|
|
|
29
29
|
*/
|
|
30
30
|
getEventStream(options?: {
|
|
31
31
|
startIndex?: number;
|
|
32
|
-
}): Promise<ReadableStream<
|
|
32
|
+
}): Promise<ReadableStream<MessageStreamEvent>>;
|
|
33
33
|
/**
|
|
34
34
|
* Resolves the durable tail of the event stream: the zero-based index of
|
|
35
35
|
* the last recorded event, or `-1` before the first.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UserContent } from "ai";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnstampedMessageStreamEvent, MessageStreamEvent } from "#protocol/message.js";
|
|
3
3
|
import type { CancelTurnStatus } from "#protocol/cancel-turn.js";
|
|
4
4
|
import type { RunMode } from "#shared/run-mode.js";
|
|
5
5
|
import type { RuntimeActionResult } from "#runtime/actions/types.js";
|
|
@@ -20,6 +20,12 @@ export interface CancelTurnInput {
|
|
|
20
20
|
/** Result of requesting turn cancellation. Both statuses are successful. */
|
|
21
21
|
export interface CancelTurnResult {
|
|
22
22
|
readonly status: CancelTurnStatus;
|
|
23
|
+
/**
|
|
24
|
+
* For `no_active_turn`: the error class that classified the target as
|
|
25
|
+
* inactive, distinguishing "already finished" (`HookNotFoundError`) from a
|
|
26
|
+
* transiently unreachable cancel hook (`EntityConflictError`).
|
|
27
|
+
*/
|
|
28
|
+
readonly reason?: string;
|
|
23
29
|
}
|
|
24
30
|
/** Identifies a session to transition permanently to a terminal state. */
|
|
25
31
|
export interface TerminateSessionInput {
|
|
@@ -83,7 +89,7 @@ export interface SessionAuthContext {
|
|
|
83
89
|
* Backed by `getWritable()` in the workflow runtime. Not part of the adapter
|
|
84
90
|
* interface: the runtime always writes events itself.
|
|
85
91
|
*/
|
|
86
|
-
export type EventEmitFn = (event:
|
|
92
|
+
export type EventEmitFn = (event: UnstampedMessageStreamEvent) => Promise<void>;
|
|
87
93
|
/**
|
|
88
94
|
* Base deliver payload crossing the runtime boundary.
|
|
89
95
|
*
|
|
@@ -117,6 +123,10 @@ export interface DeliverHookPayload {
|
|
|
117
123
|
readonly kind: "deliver";
|
|
118
124
|
readonly payloads: readonly DeliverPayload[];
|
|
119
125
|
}
|
|
126
|
+
/** Internal deadline signal sent through the session's delivery hook. */
|
|
127
|
+
export interface SessionTimeoutHookPayload {
|
|
128
|
+
readonly kind: "session-timeout";
|
|
129
|
+
}
|
|
120
130
|
/**
|
|
121
131
|
* Runtime-action results resumed back into a parked parent workflow.
|
|
122
132
|
*/
|
|
@@ -153,7 +163,7 @@ export interface SubagentInputRequestHookPayload {
|
|
|
153
163
|
readonly subagentName: string;
|
|
154
164
|
}
|
|
155
165
|
/** Authorization lifecycle event forwarded from a delegated child. */
|
|
156
|
-
export type SubagentAuthorizationEvent = Extract<
|
|
166
|
+
export type SubagentAuthorizationEvent = Extract<UnstampedMessageStreamEvent, {
|
|
157
167
|
type: "authorization.required" | "authorization.completed";
|
|
158
168
|
}>;
|
|
159
169
|
/**
|
|
@@ -172,7 +182,7 @@ export interface SubagentAuthorizationEventHookPayload {
|
|
|
172
182
|
/**
|
|
173
183
|
* Serializable payload sent through the workflow `resumeHook`.
|
|
174
184
|
*/
|
|
175
|
-
export type HookPayload = DeliverHookPayload | RuntimeActionResultHookPayload | SubagentAuthorizationEventHookPayload | SubagentInputRequestHookPayload;
|
|
185
|
+
export type HookPayload = DeliverHookPayload | RuntimeActionResultHookPayload | SessionTimeoutHookPayload | SubagentAuthorizationEventHookPayload | SubagentInputRequestHookPayload;
|
|
176
186
|
/**
|
|
177
187
|
* Terminal callback metadata attached to a session at creation.
|
|
178
188
|
*
|
|
@@ -318,7 +328,7 @@ export type RunResult = {
|
|
|
318
328
|
*/
|
|
319
329
|
export interface RunHandle {
|
|
320
330
|
readonly continuationToken: string;
|
|
321
|
-
readonly events: ReadableStream<
|
|
331
|
+
readonly events: ReadableStream<MessageStreamEvent>;
|
|
322
332
|
/**
|
|
323
333
|
* Runtime-owned identifier for this session. Stream and inspection APIs
|
|
324
334
|
* key on it: workflow-backed runs expose the workflow run id.
|
|
@@ -367,7 +377,7 @@ export interface Runtime {
|
|
|
367
377
|
* The framework HTTP session-stream route forwards the `startIndex` query
|
|
368
378
|
* parameter unchanged.
|
|
369
379
|
*/
|
|
370
|
-
getEventStream(sessionId: string, options?: GetEventStreamOptions): Promise<ReadableStream<
|
|
380
|
+
getEventStream(sessionId: string, options?: GetEventStreamOptions): Promise<ReadableStream<MessageStreamEvent>>;
|
|
371
381
|
/**
|
|
372
382
|
* Resolves the durable tail of a session's event stream: the zero-based
|
|
373
383
|
* index of the last recorded event, or `-1` before the first. Callers use
|
|
@@ -13,6 +13,8 @@ const EVE_CANCEL_TURN_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/session/:sessionId/ca
|
|
|
13
13
|
const EVE_DEV_DISPATCH_SCHEDULE_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/dev/schedules/:scheduleId`;
|
|
14
14
|
const EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/dev/runtime-artifacts`;
|
|
15
15
|
const EVE_DEV_RUNTIME_ARTIFACTS_REBUILD_ROUTE_PATH = `${EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH}/rebuild`;
|
|
16
|
+
const EVE_DEV_RUNTIME_ARTIFACTS_SUSPEND_ROUTE_PATH = `${EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH}/suspend`;
|
|
17
|
+
const EVE_DEV_RUNTIME_ARTIFACTS_RESUME_ROUTE_PATH = `${EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH}/resume`;
|
|
16
18
|
const EVE_CONNECTION_CALLBACK_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/connections/:name/callback/:token`;
|
|
17
19
|
const EVE_CALLBACK_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/callback/:token`;
|
|
18
20
|
function createEveMessageStreamRoutePath(sessionId) {
|
|
@@ -296,6 +298,71 @@ function safeJsonStringify(value) {
|
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
300
|
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/shared/ulid.ts
|
|
303
|
+
const ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
304
|
+
const TIME_CHARS = 10;
|
|
305
|
+
const TIME_MAX = 2 ** 48 - 1;
|
|
306
|
+
const RANDOM_BYTES = 10;
|
|
307
|
+
function createUlidFactory() {
|
|
308
|
+
let lastTimeMs = -1;
|
|
309
|
+
const lastRandom = new Uint8Array(RANDOM_BYTES);
|
|
310
|
+
return function createUlidFromFactory() {
|
|
311
|
+
const now = Date.now();
|
|
312
|
+
if (!Number.isInteger(now) || now < 0 || now > TIME_MAX) throw new Error(`Cannot mint a ULID: timestamp must be an integer from 0 to ${TIME_MAX}.`);
|
|
313
|
+
if (now > lastTimeMs) {
|
|
314
|
+
lastTimeMs = now;
|
|
315
|
+
randomFill(lastRandom);
|
|
316
|
+
} else if (!incrementRandom(lastRandom)) {
|
|
317
|
+
if (lastTimeMs === TIME_MAX) throw new Error("Cannot mint a ULID: random component overflowed at the maximum timestamp.");
|
|
318
|
+
lastTimeMs += 1;
|
|
319
|
+
randomFill(lastRandom);
|
|
320
|
+
}
|
|
321
|
+
return `${encodeTime(lastTimeMs)}${encodeRandom(lastRandom)}`;
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const createUlid = createUlidFactory();
|
|
325
|
+
function randomFill(target) {
|
|
326
|
+
const webCrypto = globalThis.crypto;
|
|
327
|
+
if (typeof webCrypto?.getRandomValues !== "function") throw new Error("Cannot mint a ULID: globalThis.crypto.getRandomValues is unavailable.");
|
|
328
|
+
webCrypto.getRandomValues(target);
|
|
329
|
+
}
|
|
330
|
+
function encodeTime(timeMs) {
|
|
331
|
+
let remaining = timeMs;
|
|
332
|
+
let encoded = "";
|
|
333
|
+
for (let index = 0; index < TIME_CHARS; index += 1) {
|
|
334
|
+
encoded = ENCODING[remaining % 32] + encoded;
|
|
335
|
+
remaining = Math.floor(remaining / 32);
|
|
336
|
+
}
|
|
337
|
+
return encoded;
|
|
338
|
+
}
|
|
339
|
+
function encodeRandom(bytes) {
|
|
340
|
+
let buffer = 0;
|
|
341
|
+
let bufferedBits = 0;
|
|
342
|
+
let encoded = "";
|
|
343
|
+
for (const byte of bytes) {
|
|
344
|
+
buffer = buffer << 8 | byte;
|
|
345
|
+
bufferedBits += 8;
|
|
346
|
+
while (bufferedBits >= 5) {
|
|
347
|
+
bufferedBits -= 5;
|
|
348
|
+
encoded += ENCODING[buffer >>> bufferedBits & 31];
|
|
349
|
+
}
|
|
350
|
+
buffer &= (1 << bufferedBits) - 1;
|
|
351
|
+
}
|
|
352
|
+
return encoded;
|
|
353
|
+
}
|
|
354
|
+
function incrementRandom(bytes) {
|
|
355
|
+
for (let index = bytes.length - 1; index >= 0; index -= 1) {
|
|
356
|
+
const byte = bytes[index] ?? 0;
|
|
357
|
+
if (byte < 255) {
|
|
358
|
+
bytes[index] = byte + 1;
|
|
359
|
+
bytes.fill(0, index + 1);
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
|
|
299
366
|
//#endregion
|
|
300
367
|
//#region src/protocol/message.ts
|
|
301
368
|
const EVE_SESSION_ID_HEADER = "x-eve-session-id";
|
|
@@ -1081,6 +1148,24 @@ function withRedirectPolicy(init, redirect) {
|
|
|
1081
1148
|
};
|
|
1082
1149
|
}
|
|
1083
1150
|
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region src/protocol/event-dedupe.ts
|
|
1153
|
+
function createEventDeduper() {
|
|
1154
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1155
|
+
return {
|
|
1156
|
+
admit(event) {
|
|
1157
|
+
const id = event.meta?.id;
|
|
1158
|
+
if (id === void 0) return true;
|
|
1159
|
+
if (seen.has(id)) return false;
|
|
1160
|
+
seen.add(id);
|
|
1161
|
+
return true;
|
|
1162
|
+
},
|
|
1163
|
+
get size() {
|
|
1164
|
+
return seen.size;
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1084
1169
|
//#endregion
|
|
1085
1170
|
//#region src/client/eve-agent-store.ts
|
|
1086
1171
|
var EveAgentStore = class {
|
|
@@ -1088,6 +1173,7 @@ var EveAgentStore = class {
|
|
|
1088
1173
|
#optimistic;
|
|
1089
1174
|
#reducer;
|
|
1090
1175
|
#subscribers = /* @__PURE__ */ new Set();
|
|
1176
|
+
#seenEvents = createEventDeduper();
|
|
1091
1177
|
#abortController;
|
|
1092
1178
|
#callbacks = {};
|
|
1093
1179
|
#data;
|
|
@@ -1105,7 +1191,9 @@ var EveAgentStore = class {
|
|
|
1105
1191
|
headers: init.headers,
|
|
1106
1192
|
host: init.host ?? ""
|
|
1107
1193
|
}).session(init.initialSession);
|
|
1108
|
-
|
|
1194
|
+
const initialEvents = [];
|
|
1195
|
+
for (const event of init.initialEvents ?? []) if (this.#seenEvents.admit(event)) initialEvents.push(event);
|
|
1196
|
+
this.#events = initialEvents;
|
|
1109
1197
|
this.#projectionEvents = [...this.#events];
|
|
1110
1198
|
this.#optimistic = init.optimistic ?? true;
|
|
1111
1199
|
this.#reducer = init.reducer;
|
|
@@ -1150,6 +1238,7 @@ var EveAgentStore = class {
|
|
|
1150
1238
|
sawEvent = true;
|
|
1151
1239
|
this.#status = "streaming";
|
|
1152
1240
|
}
|
|
1241
|
+
if (!this.#seenEvents.admit(event)) continue;
|
|
1153
1242
|
this.#events = [...this.#events, event];
|
|
1154
1243
|
this.#applyServerEvent(event);
|
|
1155
1244
|
this.#callbacks.onEvent?.(event);
|
|
@@ -1187,6 +1276,7 @@ var EveAgentStore = class {
|
|
|
1187
1276
|
this.#abortController = void 0;
|
|
1188
1277
|
this.#session = this.#createSession?.() ?? this.#session;
|
|
1189
1278
|
this.#events = [];
|
|
1279
|
+
this.#seenEvents = createEventDeduper();
|
|
1190
1280
|
this.#pendingMessageSubmission = void 0;
|
|
1191
1281
|
this.#projectionEvents = [];
|
|
1192
1282
|
this.#data = this.#reducer.initial();
|
|
@@ -1403,6 +1493,7 @@ function toMessageInputRequest(request) {
|
|
|
1403
1493
|
return {
|
|
1404
1494
|
allowFreeform: request.allowFreeform,
|
|
1405
1495
|
display: request.display,
|
|
1496
|
+
kind: request.kind,
|
|
1406
1497
|
options: request.options,
|
|
1407
1498
|
prompt: request.prompt,
|
|
1408
1499
|
requestId: request.requestId
|
|
@@ -13,6 +13,8 @@ const EVE_CANCEL_TURN_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/session/:sessionId/ca
|
|
|
13
13
|
const EVE_DEV_DISPATCH_SCHEDULE_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/dev/schedules/:scheduleId`;
|
|
14
14
|
const EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/dev/runtime-artifacts`;
|
|
15
15
|
const EVE_DEV_RUNTIME_ARTIFACTS_REBUILD_ROUTE_PATH = `${EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH}/rebuild`;
|
|
16
|
+
const EVE_DEV_RUNTIME_ARTIFACTS_SUSPEND_ROUTE_PATH = `${EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH}/suspend`;
|
|
17
|
+
const EVE_DEV_RUNTIME_ARTIFACTS_RESUME_ROUTE_PATH = `${EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH}/resume`;
|
|
16
18
|
const EVE_CONNECTION_CALLBACK_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/connections/:name/callback/:token`;
|
|
17
19
|
const EVE_CALLBACK_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/callback/:token`;
|
|
18
20
|
function createEveMessageStreamRoutePath(sessionId) {
|
|
@@ -296,6 +298,71 @@ function safeJsonStringify(value) {
|
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
300
|
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/shared/ulid.ts
|
|
303
|
+
const ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
304
|
+
const TIME_CHARS = 10;
|
|
305
|
+
const TIME_MAX = 2 ** 48 - 1;
|
|
306
|
+
const RANDOM_BYTES = 10;
|
|
307
|
+
function createUlidFactory() {
|
|
308
|
+
let lastTimeMs = -1;
|
|
309
|
+
const lastRandom = new Uint8Array(RANDOM_BYTES);
|
|
310
|
+
return function createUlidFromFactory() {
|
|
311
|
+
const now = Date.now();
|
|
312
|
+
if (!Number.isInteger(now) || now < 0 || now > TIME_MAX) throw new Error(`Cannot mint a ULID: timestamp must be an integer from 0 to ${TIME_MAX}.`);
|
|
313
|
+
if (now > lastTimeMs) {
|
|
314
|
+
lastTimeMs = now;
|
|
315
|
+
randomFill(lastRandom);
|
|
316
|
+
} else if (!incrementRandom(lastRandom)) {
|
|
317
|
+
if (lastTimeMs === TIME_MAX) throw new Error("Cannot mint a ULID: random component overflowed at the maximum timestamp.");
|
|
318
|
+
lastTimeMs += 1;
|
|
319
|
+
randomFill(lastRandom);
|
|
320
|
+
}
|
|
321
|
+
return `${encodeTime(lastTimeMs)}${encodeRandom(lastRandom)}`;
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const createUlid = createUlidFactory();
|
|
325
|
+
function randomFill(target) {
|
|
326
|
+
const webCrypto = globalThis.crypto;
|
|
327
|
+
if (typeof webCrypto?.getRandomValues !== "function") throw new Error("Cannot mint a ULID: globalThis.crypto.getRandomValues is unavailable.");
|
|
328
|
+
webCrypto.getRandomValues(target);
|
|
329
|
+
}
|
|
330
|
+
function encodeTime(timeMs) {
|
|
331
|
+
let remaining = timeMs;
|
|
332
|
+
let encoded = "";
|
|
333
|
+
for (let index = 0; index < TIME_CHARS; index += 1) {
|
|
334
|
+
encoded = ENCODING[remaining % 32] + encoded;
|
|
335
|
+
remaining = Math.floor(remaining / 32);
|
|
336
|
+
}
|
|
337
|
+
return encoded;
|
|
338
|
+
}
|
|
339
|
+
function encodeRandom(bytes) {
|
|
340
|
+
let buffer = 0;
|
|
341
|
+
let bufferedBits = 0;
|
|
342
|
+
let encoded = "";
|
|
343
|
+
for (const byte of bytes) {
|
|
344
|
+
buffer = buffer << 8 | byte;
|
|
345
|
+
bufferedBits += 8;
|
|
346
|
+
while (bufferedBits >= 5) {
|
|
347
|
+
bufferedBits -= 5;
|
|
348
|
+
encoded += ENCODING[buffer >>> bufferedBits & 31];
|
|
349
|
+
}
|
|
350
|
+
buffer &= (1 << bufferedBits) - 1;
|
|
351
|
+
}
|
|
352
|
+
return encoded;
|
|
353
|
+
}
|
|
354
|
+
function incrementRandom(bytes) {
|
|
355
|
+
for (let index = bytes.length - 1; index >= 0; index -= 1) {
|
|
356
|
+
const byte = bytes[index] ?? 0;
|
|
357
|
+
if (byte < 255) {
|
|
358
|
+
bytes[index] = byte + 1;
|
|
359
|
+
bytes.fill(0, index + 1);
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
|
|
299
366
|
//#endregion
|
|
300
367
|
//#region src/protocol/message.ts
|
|
301
368
|
const EVE_SESSION_ID_HEADER = "x-eve-session-id";
|
|
@@ -1081,6 +1148,24 @@ function withRedirectPolicy(init, redirect) {
|
|
|
1081
1148
|
};
|
|
1082
1149
|
}
|
|
1083
1150
|
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region src/protocol/event-dedupe.ts
|
|
1153
|
+
function createEventDeduper() {
|
|
1154
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1155
|
+
return {
|
|
1156
|
+
admit(event) {
|
|
1157
|
+
const id = event.meta?.id;
|
|
1158
|
+
if (id === void 0) return true;
|
|
1159
|
+
if (seen.has(id)) return false;
|
|
1160
|
+
seen.add(id);
|
|
1161
|
+
return true;
|
|
1162
|
+
},
|
|
1163
|
+
get size() {
|
|
1164
|
+
return seen.size;
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1084
1169
|
//#endregion
|
|
1085
1170
|
//#region src/client/eve-agent-store.ts
|
|
1086
1171
|
var EveAgentStore = class {
|
|
@@ -1088,6 +1173,7 @@ var EveAgentStore = class {
|
|
|
1088
1173
|
#optimistic;
|
|
1089
1174
|
#reducer;
|
|
1090
1175
|
#subscribers = /* @__PURE__ */ new Set();
|
|
1176
|
+
#seenEvents = createEventDeduper();
|
|
1091
1177
|
#abortController;
|
|
1092
1178
|
#callbacks = {};
|
|
1093
1179
|
#data;
|
|
@@ -1105,7 +1191,9 @@ var EveAgentStore = class {
|
|
|
1105
1191
|
headers: init.headers,
|
|
1106
1192
|
host: init.host ?? ""
|
|
1107
1193
|
}).session(init.initialSession);
|
|
1108
|
-
|
|
1194
|
+
const initialEvents = [];
|
|
1195
|
+
for (const event of init.initialEvents ?? []) if (this.#seenEvents.admit(event)) initialEvents.push(event);
|
|
1196
|
+
this.#events = initialEvents;
|
|
1109
1197
|
this.#projectionEvents = [...this.#events];
|
|
1110
1198
|
this.#optimistic = init.optimistic ?? true;
|
|
1111
1199
|
this.#reducer = init.reducer;
|
|
@@ -1150,6 +1238,7 @@ var EveAgentStore = class {
|
|
|
1150
1238
|
sawEvent = true;
|
|
1151
1239
|
this.#status = "streaming";
|
|
1152
1240
|
}
|
|
1241
|
+
if (!this.#seenEvents.admit(event)) continue;
|
|
1153
1242
|
this.#events = [...this.#events, event];
|
|
1154
1243
|
this.#applyServerEvent(event);
|
|
1155
1244
|
this.#callbacks.onEvent?.(event);
|
|
@@ -1187,6 +1276,7 @@ var EveAgentStore = class {
|
|
|
1187
1276
|
this.#abortController = void 0;
|
|
1188
1277
|
this.#session = this.#createSession?.() ?? this.#session;
|
|
1189
1278
|
this.#events = [];
|
|
1279
|
+
this.#seenEvents = createEventDeduper();
|
|
1190
1280
|
this.#pendingMessageSubmission = void 0;
|
|
1191
1281
|
this.#projectionEvents = [];
|
|
1192
1282
|
this.#data = this.#reducer.initial();
|
|
@@ -1403,6 +1493,7 @@ function toMessageInputRequest(request) {
|
|
|
1403
1493
|
return {
|
|
1404
1494
|
allowFreeform: request.allowFreeform,
|
|
1405
1495
|
display: request.display,
|
|
1496
|
+
kind: request.kind,
|
|
1406
1497
|
options: request.options,
|
|
1407
1498
|
prompt: request.prompt,
|
|
1408
1499
|
requestId: request.requestId
|
|
@@ -7,7 +7,7 @@ the coding harness's prompt tools when available, and do not guess.
|
|
|
7
7
|
2. Where should it be reachable? Every agent ships the built-in HTTP channel. On
|
|
8
8
|
top of that:
|
|
9
9
|
- **Web Chat** (a Next.js app): add it at init with `--channel-web-nextjs`.
|
|
10
|
-
- **Slack** and other platforms: add after deploy with `eve
|
|
10
|
+
- **Slack** and other platforms: add after deploy with `eve add channel/slack`.
|
|
11
11
|
Credentials run through **Vercel Connect**, which provisions the bot token
|
|
12
12
|
and verifies inbound webhooks, so there is no `SLACK_BOT_TOKEN` or signing
|
|
13
13
|
secret to manage.
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
import { type Prompter } from "#setup/prompter.js";
|
|
2
|
-
import type { runChannelsFlow } from "#setup/flows/channels.js";
|
|
3
|
-
import type { runAddCommand } from "./registry.js";
|
|
4
1
|
export interface CliLogger {
|
|
5
2
|
error(message: string): void;
|
|
6
3
|
log(message: string): void;
|
|
7
4
|
}
|
|
8
|
-
export interface AddChannelCommandOptions {
|
|
9
|
-
force?: boolean;
|
|
10
|
-
yes?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface ChannelsAddDependencies {
|
|
13
|
-
createPrompter(): Prompter;
|
|
14
|
-
loadAddCommand(): Promise<typeof runAddCommand>;
|
|
15
|
-
loadChannelsFlow(): Promise<typeof runChannelsFlow>;
|
|
16
|
-
}
|
|
17
|
-
/** Compatibility adapter from `eve channels add` to registry-backed installation. */
|
|
18
|
-
export declare function runChannelsAddCompatibilityCommand(logger: CliLogger, appRoot: string, args: {
|
|
19
|
-
kind?: string;
|
|
20
|
-
options: AddChannelCommandOptions;
|
|
21
|
-
}, dependencies?: ChannelsAddDependencies): Promise<void>;
|
|
22
5
|
export interface ListChannelsCommandOptions {
|
|
23
6
|
json?: boolean;
|
|
24
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NOT_AN_AGENT_MESSAGE}from"./preconditions.js";import{isEveProject,listAuthoredChannels}from"#setup/scaffold/index.js";
|
|
1
|
+
import{NOT_AN_AGENT_MESSAGE}from"./preconditions.js";import{isEveProject,listAuthoredChannels}from"#setup/scaffold/index.js";async function runChannelsListCommand(t,n,r){if(!await isEveProject(n)){t.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}let i=await listAuthoredChannels(n);if(r.json){t.log(JSON.stringify({channels:i},null,2));return}if(i.length===0){t.log("No channels defined. Run `eve add <channel>` to add one.");return}for(let e of i)t.log(e)}export{runChannelsListCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal}from"./preconditions.js";import{isEveProject}from"#setup/scaffold/index.js";import{
|
|
1
|
+
import{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal}from"./preconditions.js";import{isEveProject}from"#setup/scaffold/index.js";import{runDeployFlow}from"#setup/flows/deploy.js";import{createPrompter}from"#setup/prompter.js";const defaultDependencies={isEveProject,hasInteractiveTerminal};async function runDeployCommand(t,n,r=defaultDependencies){if(!await r.isEveProject(n)){t.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}let i=r.createPrompter?.()??createPrompter();i.intro(`Deploy your eve agent to Vercel`);try{let e=await runDeployFlow({appRoot:n,prompter:i,interactive:r.hasInteractiveTerminal(),deps:r.flowDeps});if(e.kind===`needs-link`){t.error("This directory is not linked to a Vercel project. Run `eve link` first (or `vercel link --project <name> --yes --non-interactive` in CI), then re-run `eve deploy`."),process.exitCode=1;return}i.outro(e.kind===`cancelled`?`Cancelled.`:e.productionUrl===void 0?`Deployed.`:`Deployed: ${e.productionUrl}`)}catch(e){t.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}export{runDeployCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{initExtensionHandoff,initExtensionInstructions}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{scaffoldExtensionProject}from"#setup/scaffold/index.js";import{mkdtemp,readdir,rename,rm,stat}from"node:fs/promises";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{parseProjectName}from"#setup/project-name.js";import{runPackageManagerInstall}from"#setup/primitives/index.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={detectInvokingPackageManager,detectPackageManager,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldExtensionProject,tryInitializeGit},
|
|
1
|
+
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{initExtensionHandoff,initExtensionInstructions}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{scaffoldExtensionProject}from"#setup/scaffold/index.js";import{mkdtemp,readdir,rename,rm,stat}from"node:fs/promises";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{parseProjectName}from"#setup/project-name.js";import{runPackageManagerInstall}from"#setup/primitives/index.js";import{blockingCreateInPlaceEntries}from"#setup/scaffold/create-in-place.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={detectInvokingPackageManager,detectPackageManager,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldExtensionProject,tryInitializeGit},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`extension-init`);function isCurrentDirectoryTarget(e){return/^\.(?:[/\\]+\.?)*$/u.test(e.trim())}async function resolveTargetDirectory(e,t){let n=resolve(e,t);return(await stat(n).catch(()=>void 0))?.isDirectory()?n:void 0}async function assertCanScaffoldInPlace(e){let t=blockingCreateInPlaceEntries(await readdir(e));if(t.length===0)return;let n=t.slice(0,5).join(`, `),r=t.length>5?`, and ${t.length-5} more`:``;throw Error(`Cannot create project in current directory because it is not empty. Found: ${n}${r}. Use an empty directory.`)}async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}function formatWorkspaceRootMutationWarning(e){let t=e.kind===`package-json`?`package.json`:`configuration`,n=e.nodeEngineOverride===void 0?``:` (${formatNodeEngineOverrideWarning(e.nodeEngineOverride)})`;return`Updated workspace root ${t} at ${e.path}${n}`}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldExtension(e,t,n,r,i){let a=resolve(e),o=t===`.`,c=o?a:join(a,t);if(o)await assertCanScaffoldInPlace(c);else if(await pathExists(c))throw Error(`Cannot create project because "${c}" already exists.`);let u=await mkdtemp(join(a,`.eve-extension-init-`)),p=[];try{let e=o?basename(c):t,a=await r.scaffoldExtensionProject({projectName:e,evePackage:i,targetDirectory:u,workspaceProbeDirectory:c,packageManager:n,onWorkspaceRootMutation:e=>{p.push(e)}});return o?await moveDirectoryContents(a,c):await rename(a,c),{projectPath:c,workspaceRootMutations:uniqueWorkspaceRootMutations(p)}}finally{await rm(u,{recursive:!0,force:!0})}}function installProgressDetail(e,t){let n=t.text.trim();if(n===``||e!==`npm`)return n||void 0;let r=/^npm silly fetch manifest (.+)$/u.exec(n);if(r!==null)return`Resolving ${r[1]}`;let i=/^npm http fetch \S+ \S+ attempt (\d+) failed with (\S+)$/u.exec(n);if(i!==null)return`npm registry · attempt ${i[1]} failed: ${i[2]}`;if(t.stream===`stdout`||/^npm (?:error|warn)\b/u.test(n))return n}const NPM_NOISE_LINE=/^\s*npm (?:silly|verbose|http|timing)\b/u;function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(!(e===void 0||e.length===0))return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}async function runExtensionInitCommand(e,t,i,a=defaultDependencies){if(i===void 0&&await a.isCodingAgentLaunch()){e.log(initExtensionInstructions());return}let c=isLogLevelEnabled(`debug`),l=startCliLiveRow(e);l.update(`Preparing project`);let u,d,f=[],p,m,h;try{let n=i??`.`,r=isCurrentDirectoryTarget(n),o=r?await pathExists(join(resolve(t),`package.json`))?resolve(t):void 0:await resolveTargetDirectory(t,n),s=resolveInitEvePackageOverride();if(o!==void 0)throw Error("`eve extension init` creates a new extension package and cannot add to an existing project. Pass a new directory name, or run from an empty directory with `eve extension init .`.");l.update(`Creating extension`),initLog.debug(`creating extension`);let g=a.now(),_=r?`.`:parseProjectName(n),v=resolve(t);d=await resolveScaffoldPackageManager(_===`.`?v:join(v,_),a);let y=await scaffoldExtension(t,_,d,a,s);u=y.projectPath,f=y.workspaceRootMutations,p=a.now()-g,initLog.debug(`creating extension done`,{ms:p}),l.update(`Installing dependencies`,`${d} install`),initLog.debug(`installing dependencies with ${d}`);let b=a.now(),x=[],S=[],C=await a.runPackageManagerInstall(d,u,{bypassMinimumReleaseAge:!0,progressDetails:process.stdout.isTTY===!0&&!c,onOutput:e=>{e.text.trim()!==``&&(S.push(e.text),S.length>20&&S.shift(),NPM_NOISE_LINE.test(e.text)||x.push(e.text)),c&&initLog.debug(e.text);let t=installProgressDetail(d,e);t!==void 0&&l.update(`Installing dependencies`,t)}});if(m=a.now()-b,!C){initLog.debug(`dependency installation failed`,{ms:m}),l.stop();let t=x.length>0?x:S;for(let n of t)e.error(n);throw Error(`Failed to install dependencies in "${u}".`)}initLog.debug(`dependencies installed`,{ms:m}),l.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),h=await a.tryInitializeGit(u)}finally{l.stop()}e.log(`${import_picocolors.default.green(`✓`)} Created an ${EVE_WORDMARK} extension in ${import_picocolors.default.bold(u)} ${import_picocolors.default.dim(`in ${formatElapsed(p)}`)}`);for(let t of f)e.log(import_picocolors.default.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`));e.log(`${import_picocolors.default.green(`✓`)} Installed dependencies ${import_picocolors.default.dim(`in ${formatElapsed(m)}`)}`),h.kind===`failed`?e.error(import_picocolors.default.yellow(`Git initialization failed: ${h.reason}`)):h.kind===`initialized`&&e.log(`${import_picocolors.default.green(`✓`)} Initialized Git repository`),e.log(initExtensionHandoff({packageManager:d,packageName:basename(u),projectPath:u}))}export{EVE_INIT_PACKAGE_SPEC_ENV,runExtensionInitCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{initAgentDevHandoff,initAgentInstructions,initAgentReplPrompt}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{selectInitHandoff,spawnCodingAgentRepl}from"./init-repl.js";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{mkdtemp,readdir,rename,rm,stat}from"node:fs/promises";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{parseProjectName}from"#setup/project-name.js";import{eveDevArguments,runPackageManagerInstall,spawnPackageManager}from"#setup/primitives/index.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={addAgentToProject,detectInvokingPackageManager,detectPackageManager,ensureChannel,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldBaseProject,selectInitHandoff,spawnCodingAgentRepl,spawnPackageManager,tryInitializeGit},
|
|
1
|
+
import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{initAgentDevHandoff,initAgentInstructions,initAgentReplPrompt}from"./agent-instructions.js";import{tryInitializeGit}from"./init-git.js";import{selectInitHandoff,spawnCodingAgentRepl}from"./init-repl.js";import{createLogger,isLogLevelEnabled}from"#internal/logging.js";import{basename,join,resolve}from"node:path";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{mkdtemp,readdir,rename,rm,stat}from"node:fs/promises";import{performance}from"node:perf_hooks";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{EVE_WORDMARK}from"#cli/banner.js";import{formatElapsed}from"#cli/format-elapsed.js";import{startCliLiveRow}from"#cli/ui/live-row.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectInvokingPackageManager,detectPackageManager}from"#setup/package-manager.js";import{pathExists}from"#setup/path-exists.js";import{parseProjectName}from"#setup/project-name.js";import{eveDevArguments,runPackageManagerInstall,spawnPackageManager}from"#setup/primitives/index.js";import{blockingCreateInPlaceEntries}from"#setup/scaffold/create-in-place.js";import{DEFAULT_EVE_PACKAGE_CONTRACT}from"#setup/scaffold/create/project.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";import{WizardCancelledError}from"#setup/step.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={addAgentToProject,detectInvokingPackageManager,detectPackageManager,ensureChannel,isCodingAgentLaunch,now:()=>performance.now(),runPackageManagerInstall,scaffoldBaseProject,selectInitHandoff,spawnCodingAgentRepl,spawnPackageManager,tryInitializeGit},EVE_INIT_PACKAGE_SPEC_ENV=`EVE_INIT_PACKAGE_SPEC`,initLog=createLogger(`init`);async function resolveTargetDirectory(e,t){let n=resolve(e,t);return(await stat(n).catch(()=>void 0))?.isDirectory()?n:void 0}function isCurrentDirectoryTarget(e){return/^\.(?:[/\\]+\.?)*$/u.test(e.trim())}async function assertCanScaffoldInPlace(e){let t=blockingCreateInPlaceEntries(await readdir(e));if(t.length===0)return;let n=t.slice(0,5).join(`, `),r=t.length>5?`, and ${t.length-5} more`:``;throw Error(`Cannot create project in current directory because it is not empty. Found: ${n}${r}. Use an empty directory.`)}async function moveDirectoryContents(e,t){for(let n of await readdir(e))await rename(join(e,n),join(t,n))}function uniqueWorkspaceRootMutations(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.path}`,r=t.get(e);t.set(e,{...n,nodeEngineOverride:n.nodeEngineOverride??r?.nodeEngineOverride})}return[...t.values()]}function formatWorkspaceRootMutationWarning(e){let t=e.kind===`package-json`?`package.json`:`configuration`,n=e.nodeEngineOverride===void 0?``:` (${formatNodeEngineOverrideWarning(e.nodeEngineOverride)})`;return`Updated workspace root ${t} at ${e.path}${n}`}async function 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.");let i=await n.detectPackageManager(e),a=await n.addAgentToProject({projectRoot:e,model:DEFAULT_AGENT_MODEL_ID,packageManager:i.kind,evePackage:r});return{packageManager:i.kind,nodeEngineOverride:a.nodeEngineOverride}}async function resolveScaffoldPackageManager(e,t){let n=await t.detectPackageManager(e);return n.source==="default"?t.detectInvokingPackageManager()??`pnpm`:n.kind}async function scaffoldProject(e,t,n,r,i,a){let o=resolve(e),s=t===`.`,c=s?o:join(o,t);if(s)await assertCanScaffoldInPlace(c);else if(await pathExists(c))throw Error(`Cannot create project because "${c}" already exists.`);let l=await mkdtemp(join(o,`.eve-init-`)),p=[];try{let e={projectName:s?basename(c):t,model:DEFAULT_AGENT_MODEL_ID,evePackage:a,targetDirectory:l,workspaceProbeDirectory:c,packageManager:n,onWorkspaceRootMutation:e=>{p.push(e)}},o=await i.scaffoldBaseProject(e);return r.channelWebNextjs===!0&&await i.ensureChannel({projectRoot:o,kind:`web`,packageManager:n,workspaceProbeDirectory:c,configureVercelServices:!1,onWorkspaceRootMutation:e=>{p.push(e)}}),s?await moveDirectoryContents(o,c):await rename(o,c),{projectPath:c,workspaceRootMutations:uniqueWorkspaceRootMutations(p)}}finally{await rm(l,{recursive:!0,force:!0})}}function installProgressDetail(e,t){let n=t.text.trim();if(n===``||e!==`npm`)return n||void 0;let r=/^npm silly fetch manifest (.+)$/u.exec(n);if(r!==null)return`Resolving ${r[1]}`;let i=/^npm http fetch \S+ \S+ attempt (\d+) failed with (\S+)$/u.exec(n);if(i!==null)return`npm registry · attempt ${i[1]} failed: ${i[2]}`;if(t.stream===`stdout`||/^npm (?:error|warn)\b/u.test(n))return n}const NPM_NOISE_LINE=/^\s*npm (?:silly|verbose|http|timing)\b/u;async function runInitSteps(e){let{dependencies:t,logger:n,options:r,parentDirectory:i,target:a}=e,o=isLogLevelEnabled(`debug`),s=startCliLiveRow(n);s.update(`Preparing project`);try{let e=await t.isCodingAgentLaunch(),c=a??`.`,l=isCurrentDirectoryTarget(c),u=l?await pathExists(join(resolve(i),`package.json`))?resolve(i):void 0:await resolveTargetDirectory(i,c),p=resolveInitEvePackageOverride(),m=u===void 0?`creating agent`:`adding agent`;s.update(u===void 0?`Creating agent`:`Adding agent`),initLog.debug(m);let h=t.now(),g;if(u===void 0){let e=l?`.`:parseProjectName(c),n=resolve(i),a=await resolveScaffoldPackageManager(e===`.`?n:join(n,e),t),o=await scaffoldProject(i,e,a,r,t,p);g={kind:`created`,packageManager:a,projectPath:o.projectPath,workspaceRootMutations:o.workspaceRootMutations}}else{let e=await addToExistingProject(u,r,t,p);g=e.nodeEngineOverride===void 0?{kind:`added`,packageManager:e.packageManager,projectPath:u}:{kind:`added`,nodeEngineOverride:e.nodeEngineOverride,packageManager:e.packageManager,projectPath:u}}let _=t.now()-h;initLog.debug(`${m} done`,{ms:_}),s.update(`Installing dependencies`,`${g.packageManager} install`),initLog.debug(`installing dependencies with ${g.packageManager}`);let v=t.now(),y=[],b=[],x=await t.runPackageManagerInstall(g.packageManager,g.projectPath,{bypassMinimumReleaseAge:!0,progressDetails:process.stdout.isTTY===!0&&!o,onOutput:e=>{e.text.trim()!==``&&(b.push(e.text),b.length>20&&b.shift(),NPM_NOISE_LINE.test(e.text)||y.push(e.text)),o&&initLog.debug(e.text);let t=installProgressDetail(g.packageManager,e);t!==void 0&&s.update(`Installing dependencies`,t)}}),S=t.now()-v;if(!x){initLog.debug(`dependency installation failed`,{ms:S}),s.stop();let e=y.length>0?y:b;for(let t of e)n.error(t);throw Error(`Failed to install dependencies in "${g.projectPath}".`)}return initLog.debug(`dependencies installed`,{ms:S}),g.kind===`created`?(s.update(`Initializing Git repository`),initLog.debug(`initializing git repository`),{...g,agentElapsedMs:_,agentLaunched:e,gitResult:await t.tryInitializeGit(g.projectPath),installElapsedMs:S}):{...g,agentElapsedMs:_,agentLaunched:e,installElapsedMs:S}}finally{s.stop()}}async function runInitCommand(e,t,a,o,s=defaultDependencies){if(a===void 0&&await s.isCodingAgentLaunch()){e.log(initAgentInstructions());return}let c=await runInitSteps({dependencies:s,logger:e,options:o,parentDirectory:t,target:a});if(c.kind===`created`){e.log(`${import_picocolors.default.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${import_picocolors.default.bold(c.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(c.agentElapsedMs)}`)}`);for(let t of c.workspaceRootMutations)e.log(import_picocolors.default.yellow(`⚠ ${formatWorkspaceRootMutationWarning(t)}`))}else e.log(`${import_picocolors.default.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${import_picocolors.default.bold(c.projectPath)} ${import_picocolors.default.dim(`in ${formatElapsed(c.agentElapsedMs)}`)}`),c.nodeEngineOverride!==void 0&&e.log(import_picocolors.default.yellow(`⚠ ${formatNodeEngineOverrideWarning(c.nodeEngineOverride)}`));e.log(`${import_picocolors.default.green(`✓`)} Installed dependencies ${import_picocolors.default.dim(`in ${formatElapsed(c.installElapsedMs)}`)}`),c.kind===`created`&&c.gitResult.kind===`failed`&&e.error(import_picocolors.default.yellow(`Git initialization failed: ${c.gitResult.reason}`));let l=[c.packageManager,...eveDevArguments(c.packageManager)].join(` `),d=initAgentDevHandoff({projectPath:c.projectPath,devCommand:l});if(c.agentLaunched){e.log(d);return}let f;try{f=await s.selectInitHandoff({agentName:basename(c.projectPath)})}catch(e){if(e instanceof WizardCancelledError)return;throw e}if(f!==`eve-dev`){if(e.log(import_picocolors.default.dim(`$ ${f}`)),!await s.spawnCodingAgentRepl({command:f,cwd:c.projectPath,prompt:initAgentReplPrompt({devCommand:l}),onPromptUnseeded:t=>{e.log(import_picocolors.default.yellow(`Could not seed ${f} automatically. Paste this prompt into it:`)),e.log(t)}}))throw Error(`Coding-agent REPL exited unsuccessfully in "${c.projectPath}".`);return}let p=c.kind===`created`,m=p?[...eveDevArguments(c.packageManager),`--input`,`/model`]:eveDevArguments(c.packageManager);if(e.log(import_picocolors.default.dim(p?`$ eve dev --input /model`:`$ eve dev`)),!await s.spawnPackageManager(c.packageManager,c.projectPath,m))throw Error(`Development server exited unsuccessfully in "${c.projectPath}".`)}function resolveInitEvePackageOverride(){let e=process.env[EVE_INIT_PACKAGE_SPEC_ENV]?.trim();if(!(e===void 0||e.length===0))return{nodeEngine:DEFAULT_EVE_PACKAGE_CONTRACT.nodeEngine,version:e}}export{EVE_INIT_PACKAGE_SPEC_ENV,runInitCommand};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cleanupCreatedConnectionConnector, setupConnectionConnector } from "#setup/connection-connector.js";
|
|
2
|
+
import { runLinkFlow, type LinkFlowDeps } from "#setup/flows/link.js";
|
|
3
|
+
import { readProjectLink } from "#setup/project-resolution.js";
|
|
4
|
+
import { type Prompter } from "#setup/prompter.js";
|
|
5
|
+
import { updateConnectionConnectorUid } from "#setup/scaffold/update/update-connection-connector.js";
|
|
6
|
+
import type { RegistryCommandLogger } from "./registry.js";
|
|
7
|
+
export interface IntegrationConnectOptions {
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export interface IntegrationConnectDependencies {
|
|
11
|
+
createPrompter?: () => Prompter;
|
|
12
|
+
readProjectLink: typeof readProjectLink;
|
|
13
|
+
runLinkFlow: typeof runLinkFlow;
|
|
14
|
+
linkFlowDeps?: Partial<LinkFlowDeps>;
|
|
15
|
+
setupConnectionConnector: typeof setupConnectionConnector;
|
|
16
|
+
cleanupCreatedConnectionConnector: typeof cleanupCreatedConnectionConnector;
|
|
17
|
+
updateConnectionConnectorUid: typeof updateConnectionConnectorUid;
|
|
18
|
+
}
|
|
19
|
+
/** Configures the Vercel Connect connector referenced by an installed connection item. */
|
|
20
|
+
export declare function runIntegrationConnect(input: {
|
|
21
|
+
appRoot: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
service: string;
|
|
24
|
+
canonicalConnectorName?: string;
|
|
25
|
+
options?: IntegrationConnectOptions;
|
|
26
|
+
dependencies?: Partial<IntegrationConnectDependencies>;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
/** CLI adapter for the hidden integration command used by trusted registry items. */
|
|
29
|
+
export declare function runIntegrationConnectCommand(logger: RegistryCommandLogger, appRoot: string, slug: string, service: string, canonicalConnectorName: string | undefined, options?: IntegrationConnectOptions, dependencies?: IntegrationConnectDependencies): Promise<void>;
|