eve 0.6.0-beta.9 → 0.7.2
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 +281 -0
- package/README.md +9 -6
- package/dist/docs/public/README.md +17 -12
- package/dist/docs/public/agent-config.md +10 -10
- package/dist/docs/public/channels/custom.mdx +4 -4
- package/dist/docs/public/channels/discord.mdx +1 -1
- package/dist/docs/public/channels/eve.mdx +10 -10
- package/dist/docs/public/channels/github.mdx +1 -1
- package/dist/docs/public/channels/overview.mdx +21 -15
- package/dist/docs/public/channels/slack.mdx +16 -4
- package/dist/docs/public/channels/teams.mdx +1 -1
- package/dist/docs/public/channels/telegram.mdx +1 -1
- package/dist/docs/public/channels/twilio.mdx +1 -1
- package/dist/docs/public/{advanced → concepts}/context-control.md +3 -3
- package/dist/docs/public/{advanced → concepts}/default-harness.md +5 -5
- package/dist/docs/public/{advanced → concepts}/execution-model-and-durability.md +3 -1
- package/dist/docs/public/concepts/meta.json +10 -0
- package/dist/docs/public/{advanced → concepts}/security-model.md +3 -3
- package/dist/docs/public/{advanced → concepts}/sessions-runs-and-streaming.md +7 -7
- package/dist/docs/public/connections.mdx +6 -4
- package/dist/docs/public/evals/assertions.mdx +108 -0
- package/dist/docs/public/evals/cases.mdx +143 -0
- package/dist/docs/public/evals/judge.mdx +94 -0
- package/dist/docs/public/evals/meta.json +4 -0
- package/dist/docs/public/evals/overview.mdx +118 -0
- package/dist/docs/public/evals/reporters.mdx +62 -0
- package/dist/docs/public/evals/running.mdx +63 -0
- package/dist/docs/public/evals/targets.mdx +54 -0
- package/dist/docs/public/getting-started.mdx +38 -33
- package/dist/docs/public/{advanced → guides}/auth-and-route-protection.md +5 -3
- package/dist/docs/public/{client → guides/client}/continuations.mdx +2 -2
- package/dist/docs/public/{client → guides/client}/messages.mdx +1 -1
- package/dist/docs/public/{client → guides/client}/meta.json +1 -1
- package/dist/docs/public/{client → guides/client}/output-schema.mdx +2 -2
- package/dist/docs/public/{client → guides/client}/overview.mdx +5 -5
- package/dist/docs/public/{client → guides/client}/streaming.mdx +1 -1
- package/dist/docs/public/{advanced → guides}/deployment.md +9 -1
- package/dist/docs/public/guides/dev-tui.md +50 -0
- package/dist/docs/public/{advanced → guides}/dynamic-capabilities.md +1 -1
- package/dist/docs/public/{advanced → guides}/dynamic-workflows.md +1 -1
- package/dist/docs/public/{frontend → guides/frontend}/nextjs.mdx +16 -7
- package/dist/docs/public/{frontend → guides/frontend}/nuxt.mdx +7 -7
- package/dist/docs/public/{frontend → guides/frontend}/overview.mdx +6 -6
- package/dist/docs/public/{frontend → guides/frontend}/sveltekit.mdx +5 -5
- package/dist/docs/public/{frontend → guides/frontend}/use-eve-agent-svelte.mdx +2 -2
- package/dist/docs/public/{frontend → guides/frontend}/use-eve-agent-vue.mdx +2 -2
- package/dist/docs/public/{advanced → guides}/hooks.md +2 -2
- package/dist/docs/public/{advanced → guides}/instrumentation.md +3 -1
- package/dist/docs/public/{advanced → guides}/meta.json +8 -12
- package/dist/docs/public/{advanced → guides}/session-context.md +3 -3
- package/dist/docs/public/{advanced → guides}/state.md +1 -1
- package/dist/docs/public/instructions.mdx +2 -2
- package/dist/docs/public/introduction.md +5 -2
- package/dist/docs/public/meta.json +4 -3
- package/dist/docs/public/reference/cli.md +35 -19
- package/dist/docs/public/reference/meta.json +1 -1
- package/dist/docs/public/reference/project-layout.md +5 -1
- package/dist/docs/public/reference/typescript-api.md +27 -23
- package/dist/docs/public/sandbox.mdx +1 -1
- package/dist/docs/public/schedules.mdx +2 -2
- package/dist/docs/public/skills.mdx +3 -3
- package/dist/docs/public/subagents.mdx +3 -3
- package/dist/docs/public/tools.mdx +4 -8
- package/dist/docs/public/tutorial/connect-a-warehouse.mdx +3 -3
- package/dist/docs/public/tutorial/first-agent.mdx +6 -3
- package/dist/docs/public/tutorial/guard-the-spend.mdx +1 -1
- package/dist/docs/public/tutorial/how-it-runs.mdx +2 -2
- package/dist/docs/public/tutorial/meta.json +1 -1
- package/dist/docs/public/tutorial/query-sample-data.mdx +1 -1
- package/dist/docs/public/tutorial/remember-definitions.mdx +3 -3
- package/dist/docs/public/tutorial/run-analysis.mdx +1 -1
- package/dist/docs/public/tutorial/ship-it.mdx +4 -4
- package/dist/docs/public/tutorial/team-playbooks.mdx +3 -3
- package/dist/src/chunks/{use-eve-agent-DCZbkLG7.js → use-eve-agent-DErQj5hs.js} +125 -37
- package/dist/src/chunks/{use-eve-agent-DoheC4_o.js → use-eve-agent-DoR8C4i6.js} +125 -37
- package/dist/src/cli/banner.d.ts +7 -0
- package/dist/src/cli/banner.js +1 -0
- package/dist/src/cli/commands/channel-add-conflicts.d.ts +1 -1
- package/dist/src/cli/commands/channels.d.ts +9 -6
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/deploy.d.ts +21 -0
- package/dist/src/cli/commands/deploy.js +1 -0
- package/dist/src/cli/commands/init-git.d.ts +15 -0
- package/dist/src/cli/commands/init-git.js +1 -0
- package/dist/src/cli/commands/init.d.ts +29 -0
- package/dist/src/cli/commands/init.js +1 -0
- package/dist/src/cli/commands/link.d.ts +21 -0
- package/dist/src/cli/commands/link.js +1 -0
- package/dist/src/cli/commands/preconditions.d.ts +7 -0
- package/dist/src/cli/commands/preconditions.js +1 -0
- package/dist/src/cli/commands/register-project-commands.d.ts +12 -0
- package/dist/src/cli/commands/register-project-commands.js +1 -0
- package/dist/src/cli/dev/tui/agent-header.d.ts +15 -9
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
- package/dist/src/cli/dev/tui/blocks.js +3 -2
- package/dist/src/cli/dev/tui/command-typeahead.d.ts +47 -0
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -0
- package/dist/src/cli/dev/tui/dev-rebuild-status.d.ts +21 -0
- package/dist/src/cli/dev/tui/dev-rebuild-status.js +1 -0
- package/dist/src/cli/dev/tui/errors.d.ts +18 -0
- package/dist/src/cli/dev/tui/errors.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +14 -0
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -0
- package/dist/src/cli/dev/tui/prompt-commands.d.ts +54 -0
- package/dist/src/cli/dev/tui/prompt-commands.js +2 -0
- package/dist/src/cli/dev/tui/runner.d.ts +64 -7
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +48 -0
- package/dist/src/cli/dev/tui/setup-commands.js +2 -0
- package/dist/src/cli/dev/tui/setup-flow.d.ts +35 -0
- package/dist/src/cli/dev/tui/setup-issues.d.ts +40 -0
- package/dist/src/cli/dev/tui/setup-issues.js +1 -0
- package/dist/src/cli/dev/tui/setup-panel.d.ts +103 -0
- package/dist/src/cli/dev/tui/setup-panel.js +1 -0
- package/dist/src/cli/dev/tui/status-line.d.ts +25 -0
- package/dist/src/cli/dev/tui/status-line.js +1 -0
- package/dist/src/cli/dev/tui/stream-format.d.ts +16 -1
- package/dist/src/cli/dev/tui/stream-format.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +32 -3
- package/dist/src/cli/dev/tui/terminal-renderer.js +5 -2
- package/dist/src/cli/dev/tui/test/index.d.ts +3 -1
- package/dist/src/cli/dev/tui/test/index.js +1 -1
- package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +1 -0
- package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
- package/dist/src/cli/dev/tui/theme.d.ts +10 -0
- package/dist/src/cli/dev/tui/theme.js +1 -1
- package/dist/src/cli/dev/tui/tui-prompter.d.ts +20 -0
- package/dist/src/cli/dev/tui/tui-prompter.js +1 -0
- package/dist/src/cli/dev/tui/tui.d.ts +6 -8
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/types.d.ts +4 -3
- package/dist/src/cli/dev/tui/vercel-status.d.ts +47 -0
- package/dist/src/cli/dev/tui/vercel-status.js +1 -0
- package/dist/src/cli/run.d.ts +9 -18
- package/dist/src/cli/run.js +2 -2
- package/dist/src/client/client.d.ts +8 -0
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/file-parts.d.ts +18 -0
- package/dist/src/client/file-parts.js +1 -0
- package/dist/src/client/index.d.ts +3 -2
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-response.js +1 -1
- package/dist/src/client/open-stream.d.ts +6 -0
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-utils.d.ts +5 -0
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +9 -2
- package/dist/src/compiled/.vendor-stamp.json +8 -8
- package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +56 -31
- package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/google/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/index.d.ts +16 -9
- package/dist/src/compiled/@ai-sdk/openai/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/otel/index.js +2 -2
- package/dist/src/compiled/@vercel/sandbox/index.js +1 -1
- package/dist/src/compiled/@workflow/core/capabilities.d.ts +19 -1
- package/dist/src/compiled/@workflow/core/class-serialization.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/create-hook.d.ts +37 -0
- package/dist/src/compiled/@workflow/core/global.d.ts +11 -1
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +4 -2
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +6 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -2
- package/dist/src/compiled/@workflow/core/runtime/wait-continuation.d.ts +84 -0
- package/dist/src/compiled/@workflow/core/runtime/wait-until.d.ts +18 -0
- package/dist/src/compiled/@workflow/core/runtime.d.ts +3 -1
- package/dist/src/compiled/@workflow/core/runtime.js +28 -28
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +21 -0
- package/dist/src/compiled/@workflow/core/serialization.d.ts +113 -6
- package/dist/src/compiled/@workflow/core/symbols.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/util.d.ts +0 -5
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/attribute-dispatcher.d.ts +6 -0
- package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +3 -4
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/events.d.ts +48 -0
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
- package/dist/src/compiled/@workflow/world/queue.d.ts +31 -2
- package/dist/src/compiled/@workflow/world/runs.d.ts +2 -0
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +2 -1
- package/dist/src/compiled/_chunks/workflow/attribute-changes-DGVGRGfw.js +59 -0
- package/dist/src/compiled/_chunks/workflow/{dist-gEXVSMPU.js → dist-CkMRLaRV.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/functions-DuPjIvMH.js +1 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-DMSadN9o.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-BRdn7zy_.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-CpXfoXLF.js +1 -0
- package/dist/src/compiled/just-bash/index.d.ts +4 -4
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/manifest.d.ts +8 -8
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-channel.d.ts +2 -1
- package/dist/src/compiler/normalize-channel.js +1 -1
- package/dist/src/compiler/normalize-connection.d.ts +2 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-helpers.d.ts +5 -0
- package/dist/src/compiler/normalize-helpers.js +1 -1
- package/dist/src/compiler/normalize-instructions.d.ts +3 -2
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +2 -2
- package/dist/src/compiler/normalize-sandbox.d.ts +2 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/normalize-schedule.d.ts +2 -1
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +2 -1
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +4 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +2 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/node.d.ts +1 -1
- package/dist/src/evals/assertions/collector.d.ts +43 -0
- package/dist/src/evals/assertions/collector.js +1 -0
- package/dist/src/evals/assertions/run.d.ts +72 -0
- package/dist/src/evals/assertions/run.js +2 -0
- package/dist/src/evals/autoevals-client.js +2 -0
- package/dist/src/evals/cli/eval-client.d.ts +22 -0
- package/dist/src/evals/cli/eval-client.js +1 -0
- package/dist/src/evals/cli/eval.d.ts +8 -5
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/context.d.ts +19 -0
- package/dist/src/evals/context.js +1 -0
- package/dist/src/evals/define-eval-config.d.ts +16 -0
- package/dist/src/evals/define-eval-config.js +1 -0
- package/dist/src/evals/define-eval.d.ts +20 -0
- package/dist/src/evals/define-eval.js +1 -0
- package/dist/src/evals/expect/index.d.ts +25 -0
- package/dist/src/evals/expect/index.js +1 -0
- package/dist/src/evals/index.d.ts +6 -2
- package/dist/src/evals/index.js +1 -1
- package/dist/src/evals/judge.d.ts +20 -0
- package/dist/src/evals/judge.js +1 -0
- package/dist/src/evals/{checks/match.d.ts → match.d.ts} +17 -18
- package/dist/src/evals/match.js +1 -0
- package/dist/src/evals/reporters/index.d.ts +1 -0
- package/dist/src/evals/reporters/index.js +1 -1
- package/dist/src/evals/requirements.d.ts +3 -0
- package/dist/src/evals/requirements.js +1 -0
- package/dist/src/evals/runner/artifacts.d.ts +7 -6
- package/dist/src/evals/runner/artifacts.js +3 -3
- package/dist/src/evals/runner/discover.d.ts +31 -10
- package/dist/src/evals/runner/discover.js +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +25 -0
- package/dist/src/evals/runner/execute-eval.js +1 -0
- package/dist/src/evals/runner/execute-task.d.ts +31 -0
- package/dist/src/evals/runner/execute-task.js +1 -0
- package/dist/src/evals/runner/reporters/braintrust.d.ts +7 -5
- package/dist/src/evals/runner/reporters/braintrust.js +2 -2
- package/dist/src/evals/runner/reporters/console.d.ts +4 -4
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/reporters/junit.d.ts +10 -0
- package/dist/src/evals/runner/reporters/junit.js +4 -0
- package/dist/src/evals/runner/reporters/types.d.ts +14 -8
- package/dist/src/evals/runner/run-evals.d.ts +38 -0
- package/dist/src/evals/runner/run-evals.js +1 -0
- package/dist/src/evals/runner/verdict.d.ts +10 -15
- package/dist/src/evals/runner/verdict.js +1 -1
- package/dist/src/evals/session.d.ts +52 -0
- package/dist/src/evals/session.js +1 -0
- package/dist/src/evals/target.d.ts +23 -0
- package/dist/src/evals/target.js +1 -0
- package/dist/src/evals/types.d.ts +294 -219
- package/dist/src/execution/compaction.d.ts +14 -0
- package/dist/src/execution/compaction.js +1 -0
- package/dist/src/execution/delegated-parent-notification.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/sandbox/bash-tool.d.ts +6 -6
- package/dist/src/execution/sandbox/bash-tool.js +1 -1
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +2 -6
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +3 -3
- package/dist/src/execution/sandbox/grep-tool.js +3 -3
- package/dist/src/execution/sandbox/read-file-tool.js +1 -1
- package/dist/src/execution/subagent-adapter.js +1 -1
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +2 -2
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/authorization.d.ts +26 -0
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/code-mode-lifecycle.js +1 -1
- package/dist/src/harness/emission.d.ts +12 -5
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/model-call-error.d.ts +35 -6
- package/dist/src/harness/model-call-error.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +10 -4
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/tools.d.ts +4 -6
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +4 -0
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +4 -15
- package/dist/src/internal/application/cache-metadata.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +4 -1
- package/dist/src/internal/authored-module-loader.js +2 -2
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +3 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-watcher-log.d.ts +37 -0
- package/dist/src/internal/nitro/host/dev-watcher-log.js +1 -0
- package/dist/src/internal/nitro/host/ports.d.ts +8 -0
- package/dist/src/internal/nitro/host/ports.js +1 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/server-external-packages.d.ts +1 -1
- package/dist/src/internal/nitro/host/server-external-packages.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 +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +5 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +31 -2
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.d.ts +13 -0
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -1
- package/dist/src/internal/nitro/routes/info.d.ts +2 -2
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/workflow/queue-namespace.d.ts +5 -0
- package/dist/src/internal/workflow/queue-namespace.js +1 -0
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
- package/dist/src/internal/workflow-bundle/builder.js +3 -5
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +4 -4
- package/dist/src/protocol/message.d.ts +15 -0
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/public/channels/slack/api.d.ts +8 -0
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/connections.d.ts +26 -18
- package/dist/src/public/channels/slack/connections.js +1 -1
- package/dist/src/public/channels/slack/defaults.d.ts +5 -2
- package/dist/src/public/channels/slack/defaults.js +1 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +65 -5
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/defaults.js +1 -1
- package/dist/src/public/connections/errors.d.ts +8 -0
- package/dist/src/public/definitions/tool.d.ts +0 -33
- package/dist/src/public/next/index.d.ts +7 -1
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/server.d.ts +1 -0
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/sveltekit/index.d.ts +1 -1
- package/dist/src/public/tools/defaults.d.ts +2 -4
- package/dist/src/public/tools/defaults.js +1 -1
- package/dist/src/public/tools/define-bash-tool.d.ts +3 -3
- package/dist/src/public/tools/define-bash-tool.js +1 -1
- package/dist/src/public/tools/define-read-file-tool.d.ts +0 -6
- package/dist/src/public/tools/define-read-file-tool.js +1 -1
- package/dist/src/public/tools/index.d.ts +2 -2
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/public/tools/internal.js +1 -1
- package/dist/src/runtime/actions/types.d.ts +11 -11
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.js +3 -2
- package/dist/src/runtime/agent/mock-model-skill-selection.js +3 -4
- package/dist/src/runtime/connections/callback-route.js +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +21 -5
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/connections/types.d.ts +33 -0
- package/dist/src/runtime/connections/validate-authorization.js +1 -1
- package/dist/src/runtime/framework-tools/bash.d.ts +3 -3
- package/dist/src/runtime/framework-tools/bash.js +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.d.ts +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -1
- package/dist/src/runtime/framework-tools/file-state.d.ts +3 -3
- package/dist/src/runtime/framework-tools/index.js +1 -1
- package/dist/src/runtime/framework-tools/read-file.js +2 -2
- package/dist/src/runtime/framework-tools/todo.d.ts +7 -0
- package/dist/src/runtime/framework-tools/todo.js +2 -2
- package/dist/src/runtime/governance/auth/http-basic.js +1 -1
- package/dist/src/runtime/input/types.d.ts +1 -1
- package/dist/src/runtime/resolve-tool.d.ts +2 -2
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/session-callback-route.js +1 -1
- package/dist/src/runtime/types.d.ts +1 -7
- package/dist/src/services/dev-client/client-options.d.ts +8 -0
- package/dist/src/services/dev-client/client-options.js +1 -0
- package/dist/src/services/dev-client/runtime-artifacts.d.ts +13 -0
- package/dist/src/services/dev-client/runtime-artifacts.js +1 -0
- package/dist/src/services/dev-client.d.ts +13 -46
- package/dist/src/services/dev-client.js +1 -1
- package/dist/src/setup/ask.d.ts +205 -0
- package/dist/src/setup/ask.js +1 -0
- package/dist/src/setup/boxes/add-channels.d.ts +100 -16
- package/dist/src/setup/boxes/add-channels.js +2 -1
- package/dist/src/setup/boxes/add-connections.d.ts +13 -23
- package/dist/src/setup/boxes/add-connections.js +1 -1
- package/dist/src/setup/boxes/apply-ai-gateway-credential.d.ts +2 -2
- package/dist/src/setup/boxes/apply-ai-gateway-credential.js +1 -1
- package/dist/src/setup/boxes/deploy-project.d.ts +46 -14
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/boxes/detect-ai-gateway.d.ts +10 -3
- package/dist/src/setup/boxes/detect-ai-gateway.js +1 -1
- package/dist/src/setup/boxes/link-project.d.ts +3 -3
- package/dist/src/setup/boxes/link-project.js +1 -1
- package/dist/src/setup/boxes/one-shot-next-steps.d.ts +18 -0
- package/dist/src/setup/boxes/one-shot-next-steps.js +2 -0
- package/dist/src/setup/boxes/preflight.d.ts +14 -6
- package/dist/src/setup/boxes/preflight.js +1 -1
- package/dist/src/setup/boxes/resolve-provisioning.d.ts +36 -8
- package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
- package/dist/src/setup/boxes/resolve-target.d.ts +25 -8
- package/dist/src/setup/boxes/resolve-target.js +1 -1
- package/dist/src/setup/boxes/scaffold.d.ts +12 -6
- package/dist/src/setup/boxes/scaffold.js +1 -1
- package/dist/src/setup/boxes/select-channels.d.ts +38 -9
- package/dist/src/setup/boxes/select-channels.js +1 -1
- package/dist/src/setup/boxes/select-chat.d.ts +15 -11
- package/dist/src/setup/boxes/select-chat.js +1 -1
- package/dist/src/setup/boxes/select-connections.d.ts +30 -0
- package/dist/src/setup/boxes/select-connections.js +1 -0
- package/dist/src/setup/boxes/select-model.d.ts +18 -14
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/boxes/select-setup-mode.d.ts +32 -0
- package/dist/src/setup/boxes/select-setup-mode.js +1 -0
- package/dist/src/setup/channel-add-conflicts.d.ts +28 -0
- package/dist/src/setup/channel-add-conflicts.js +1 -0
- package/dist/src/setup/cli/channel-setup-prompter.d.ts +23 -0
- package/dist/src/setup/cli/channel-setup-prompter.js +1 -0
- package/dist/src/setup/cli/connection-add-prompter.d.ts +8 -0
- package/dist/src/setup/cli/connection-add-prompter.js +1 -0
- package/dist/src/setup/{scaffold/cli → cli}/index.d.ts +4 -3
- package/dist/src/setup/cli/index.js +1 -0
- package/dist/src/setup/{scaffold/cli → cli}/prompt-ui.d.ts +39 -15
- package/dist/src/setup/cli/prompt-ui.js +5 -0
- package/dist/src/setup/{scaffold/cli → cli}/rail-log.d.ts +2 -0
- package/dist/src/setup/{scaffold/cli → cli}/rail-log.js +2 -2
- package/dist/src/setup/{scaffold/cli → cli}/select-component.d.ts +18 -3
- package/dist/src/setup/cli/select-component.js +1 -0
- package/dist/src/setup/cli/select-option-codec.d.ts +12 -0
- package/dist/src/setup/cli/select-option-codec.js +1 -0
- package/dist/src/setup/{scaffold/cli → cli}/select-state.d.ts +13 -1
- package/dist/src/setup/cli/select-state.js +1 -0
- package/dist/src/setup/cli/whimsy.d.ts +16 -0
- package/dist/src/setup/cli/whimsy.js +1 -0
- package/dist/src/setup/{scaffold/steps/setup-connection.d.ts → connection-connector.d.ts} +3 -2
- package/dist/src/setup/connection-connector.js +1 -0
- package/dist/src/setup/flows/channels.d.ts +43 -0
- package/dist/src/setup/flows/channels.js +1 -0
- package/dist/src/setup/flows/deploy.d.ts +40 -0
- package/dist/src/setup/flows/deploy.js +1 -0
- package/dist/src/setup/flows/in-project.d.ts +16 -0
- package/dist/src/setup/flows/in-project.js +1 -0
- package/dist/src/setup/flows/link.d.ts +43 -0
- package/dist/src/setup/flows/link.js +1 -0
- package/dist/src/setup/flows/model.d.ts +112 -0
- package/dist/src/setup/flows/model.js +1 -0
- package/dist/src/setup/flows/vercel.d.ts +31 -0
- package/dist/src/setup/flows/vercel.js +2 -0
- package/dist/src/setup/gateway-models.js +1 -1
- package/dist/src/setup/headless.d.ts +1 -1
- package/dist/src/setup/index.d.ts +10 -4
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/onboarding.d.ts +7 -4
- package/dist/src/setup/onboarding.js +1 -1
- package/dist/src/setup/package-manager.d.ts +27 -0
- package/dist/src/setup/package-manager.js +1 -0
- package/dist/src/setup/primitives/index.d.ts +3 -0
- package/dist/src/setup/primitives/index.js +1 -0
- package/dist/src/setup/primitives/pm/bun.d.ts +10 -0
- package/dist/src/setup/primitives/pm/bun.js +1 -0
- package/dist/src/setup/primitives/pm/index.d.ts +11 -0
- package/dist/src/setup/primitives/pm/index.js +1 -0
- package/dist/src/setup/primitives/pm/npm.d.ts +10 -0
- package/dist/src/setup/primitives/pm/npm.js +1 -0
- package/dist/src/setup/primitives/pm/pnpm.d.ts +27 -0
- package/dist/src/setup/primitives/pm/pnpm.js +8 -0
- package/dist/src/setup/primitives/pm/run.d.ts +23 -0
- package/dist/src/setup/primitives/pm/run.js +1 -0
- package/dist/src/setup/primitives/pm/shared.d.ts +8 -0
- package/dist/src/setup/primitives/pm/shared.js +1 -0
- package/dist/src/setup/primitives/pm/types.d.ts +37 -0
- package/dist/src/setup/primitives/pm/types.js +1 -0
- package/dist/src/setup/primitives/pm/yarn.d.ts +10 -0
- package/dist/src/setup/primitives/pm/yarn.js +1 -0
- package/dist/src/setup/primitives/run-pnpm.d.ts +1 -0
- package/dist/src/setup/primitives/run-pnpm.js +1 -0
- package/dist/src/setup/{scaffold/primitives → primitives}/run-vercel.d.ts +7 -0
- package/dist/src/setup/primitives/run-vercel.js +1 -0
- package/dist/src/setup/project-name.d.ts +4 -0
- package/dist/src/setup/project-name.js +1 -0
- package/dist/src/setup/project-resolution.d.ts +54 -0
- package/dist/src/setup/project-resolution.js +1 -0
- package/dist/src/setup/prompter.d.ts +52 -4
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/quit-guard.d.ts +1 -1
- package/dist/src/setup/run-vercel-link.d.ts +1 -1
- package/dist/src/setup/run-vercel-link.js +1 -1
- package/dist/src/setup/runner.d.ts +5 -4
- package/dist/src/setup/runner.js +1 -1
- package/dist/src/setup/scaffold/channels-catalog.d.ts +3 -3
- package/dist/src/setup/scaffold/channels-catalog.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +26 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -0
- package/dist/src/setup/scaffold/create/project.d.ts +54 -0
- package/dist/src/setup/scaffold/create/project.js +80 -0
- package/dist/src/setup/scaffold/index.d.ts +4 -4
- package/dist/src/setup/scaffold/index.js +1 -1
- package/dist/src/setup/scaffold/{channels.d.ts → update/channels.d.ts} +11 -0
- package/dist/src/setup/scaffold/update/channels.js +7 -0
- package/dist/src/setup/scaffold/{connections.d.ts → update/connections.d.ts} +1 -1
- package/dist/src/setup/scaffold/update/connections.js +21 -0
- package/dist/src/setup/scaffold/version-tokens.d.ts +11 -0
- package/dist/src/setup/scaffold/version-tokens.js +1 -0
- package/dist/src/setup/{scaffold/steps/setup-slackbot.d.ts → slackbot.d.ts} +24 -20
- package/dist/src/setup/slackbot.js +1 -0
- package/dist/src/setup/state.d.ts +62 -15
- package/dist/src/setup/state.js +1 -1
- package/dist/src/setup/step.d.ts +9 -18
- package/dist/src/setup/vercel-project.d.ts +15 -8
- package/dist/src/setup/vercel-project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +5 -3
- package/dist/src/shared/default-agent-model.d.ts +5 -0
- package/dist/src/shared/default-agent-model.js +1 -0
- package/dist/src/source-change/apply-model-name.d.ts +25 -0
- package/dist/src/source-change/apply-model-name.js +2 -0
- package/dist/src/source-change/static-source-change.d.ts +36 -0
- package/dist/src/source-change/static-source-change.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- 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.js +1 -1
- package/package.json +22 -42
- package/dist/docs/evals-v2-plan.md +0 -939
- package/dist/docs/public/advanced/dev-tui.md +0 -52
- package/dist/docs/public/advanced/evals.md +0 -158
- package/dist/docs/public/reference/faqs.md +0 -48
- package/dist/src/cli/commands/setup.d.ts +0 -55
- package/dist/src/cli/commands/setup.js +0 -1
- package/dist/src/cli/dev/repl/input-requests.d.ts +0 -38
- package/dist/src/cli/dev/repl/input-requests.js +0 -1
- package/dist/src/cli/dev/repl/input.d.ts +0 -19
- package/dist/src/cli/dev/repl/input.js +0 -1
- package/dist/src/cli/dev/repl/repl.d.ts +0 -62
- package/dist/src/cli/dev/repl/repl.js +0 -2
- package/dist/src/cli/dev/repl/terminal.d.ts +0 -21
- package/dist/src/cli/dev/repl/terminal.js +0 -5
- package/dist/src/compiled/_chunks/workflow/resume-hook-0Zk0zSvq.js +0 -12
- package/dist/src/compiled/_chunks/workflow/sleep-DXZr2BgM.js +0 -1
- package/dist/src/compiled/_chunks/workflow/symbols-BWCAoPHE.js +0 -48
- package/dist/src/evals/checks/checks.d.ts +0 -66
- package/dist/src/evals/checks/checks.js +0 -2
- package/dist/src/evals/checks/index.d.ts +0 -21
- package/dist/src/evals/checks/index.js +0 -1
- package/dist/src/evals/checks/match.js +0 -1
- package/dist/src/evals/define-eval-suite.d.ts +0 -18
- package/dist/src/evals/define-eval-suite.js +0 -1
- package/dist/src/evals/runner/execute-case.d.ts +0 -23
- package/dist/src/evals/runner/execute-case.js +0 -1
- package/dist/src/evals/runner/execute-suite.d.ts +0 -24
- package/dist/src/evals/runner/execute-suite.js +0 -1
- package/dist/src/evals/scorers/autoevals-client.js +0 -2
- package/dist/src/evals/scorers/autoevals.d.ts +0 -58
- package/dist/src/evals/scorers/autoevals.js +0 -1
- package/dist/src/evals/scorers/json.d.ts +0 -10
- package/dist/src/evals/scorers/json.js +0 -1
- package/dist/src/evals/scorers/model-marker.d.ts +0 -12
- package/dist/src/evals/scorers/model-marker.js +0 -1
- package/dist/src/evals/scorers/run.d.ts +0 -24
- package/dist/src/evals/scorers/run.js +0 -1
- package/dist/src/evals/scorers/sql.d.ts +0 -9
- package/dist/src/evals/scorers/sql.js +0 -1
- package/dist/src/evals/scorers/text.d.ts +0 -18
- package/dist/src/evals/scorers/text.js +0 -1
- package/dist/src/evals/scores/index.d.ts +0 -72
- package/dist/src/evals/scores/index.js +0 -1
- package/dist/src/execution/tool-compaction.d.ts +0 -9
- package/dist/src/execution/tool-compaction.js +0 -1
- package/dist/src/services/dev-client/stream.d.ts +0 -5
- package/dist/src/services/dev-client/stream.js +0 -1
- package/dist/src/services/dev-client/url.d.ts +0 -11
- package/dist/src/services/dev-client/url.js +0 -1
- package/dist/src/setup/channel-setup-prompter.d.ts +0 -8
- package/dist/src/setup/channel-setup-prompter.js +0 -1
- package/dist/src/setup/scaffold/channels.js +0 -7
- package/dist/src/setup/scaffold/cli/channel-add-prompter.d.ts +0 -12
- package/dist/src/setup/scaffold/cli/channel-add-prompter.js +0 -1
- package/dist/src/setup/scaffold/cli/channel-setup-prompter.d.ts +0 -56
- package/dist/src/setup/scaffold/cli/connection-add-prompter.d.ts +0 -44
- package/dist/src/setup/scaffold/cli/connection-add-prompter.js +0 -1
- package/dist/src/setup/scaffold/cli/index.js +0 -1
- package/dist/src/setup/scaffold/cli/prompt-ui.js +0 -5
- package/dist/src/setup/scaffold/cli/select-component.js +0 -1
- package/dist/src/setup/scaffold/cli/select-state.js +0 -1
- package/dist/src/setup/scaffold/connections.js +0 -21
- package/dist/src/setup/scaffold/pnpm-workspace.d.ts +0 -3
- package/dist/src/setup/scaffold/pnpm-workspace.js +0 -11
- package/dist/src/setup/scaffold/primitives/detect-deployment.d.ts +0 -13
- package/dist/src/setup/scaffold/primitives/detect-deployment.js +0 -1
- package/dist/src/setup/scaffold/primitives/index.d.ts +0 -3
- package/dist/src/setup/scaffold/primitives/index.js +0 -1
- package/dist/src/setup/scaffold/primitives/pnpm-invocation.d.ts +0 -12
- package/dist/src/setup/scaffold/primitives/pnpm-invocation.js +0 -1
- package/dist/src/setup/scaffold/primitives/run-pnpm.d.ts +0 -17
- package/dist/src/setup/scaffold/primitives/run-pnpm.js +0 -1
- package/dist/src/setup/scaffold/primitives/run-vercel.js +0 -1
- package/dist/src/setup/scaffold/project.d.ts +0 -21
- package/dist/src/setup/scaffold/project.js +0 -80
- package/dist/src/setup/scaffold/steps/deploy-to-vercel.d.ts +0 -17
- package/dist/src/setup/scaffold/steps/deploy-to-vercel.js +0 -1
- package/dist/src/setup/scaffold/steps/index.d.ts +0 -4
- package/dist/src/setup/scaffold/steps/index.js +0 -1
- package/dist/src/setup/scaffold/steps/project-resolution.d.ts +0 -19
- package/dist/src/setup/scaffold/steps/project-resolution.js +0 -1
- package/dist/src/setup/scaffold/steps/run-add-connection.d.ts +0 -40
- package/dist/src/setup/scaffold/steps/run-add-connection.js +0 -1
- package/dist/src/setup/scaffold/steps/run-add-to-agent.d.ts +0 -81
- package/dist/src/setup/scaffold/steps/run-add-to-agent.js +0 -2
- package/dist/src/setup/scaffold/steps/setup-connection.js +0 -1
- package/dist/src/setup/scaffold/steps/setup-slackbot.js +0 -1
- /package/dist/docs/public/{frontend → guides/frontend}/meta.json +0 -0
- /package/dist/docs/public/{advanced → guides}/remote-agents.md +0 -0
- /package/dist/src/{setup/scaffold/cli/channel-setup-prompter.js → cli/dev/tui/setup-flow.js} +0 -0
- /package/dist/src/evals/{scorers/autoevals-client.d.ts → autoevals-client.d.ts} +0 -0
- /package/dist/src/setup/{scaffold/cli → cli}/command-output.d.ts +0 -0
- /package/dist/src/setup/{scaffold/cli → cli}/command-output.js +0 -0
- /package/dist/src/setup/{scaffold/human-action.d.ts → human-action.d.ts} +0 -0
- /package/dist/src/setup/{scaffold/human-action.js → human-action.js} +0 -0
- /package/dist/src/setup/{scaffold/primitives → primitives}/process-output.d.ts +0 -0
- /package/dist/src/setup/{scaffold/primitives → primitives}/process-output.js +0 -0
- /package/dist/src/setup/scaffold/{web-template.d.ts → create/web-template.d.ts} +0 -0
- /package/dist/src/setup/scaffold/{web-template.js → create/web-template.js} +0 -0
- /package/dist/src/setup/scaffold/{module-files.d.ts → update/module-files.d.ts} +0 -0
- /package/dist/src/setup/scaffold/{module-files.js → update/module-files.js} +0 -0
- /package/dist/src/setup/scaffold/{package-json.d.ts → update/package-json.d.ts} +0 -0
- /package/dist/src/setup/scaffold/{package-json.js → update/package-json.js} +0 -0
- /package/dist/src/setup/scaffold/{primitives → update}/update-connection-connector.d.ts +0 -0
- /package/dist/src/setup/scaffold/{primitives → update}/update-connection-connector.js +0 -0
- /package/dist/src/setup/scaffold/{primitives → update}/update-slack-channel.d.ts +0 -0
- /package/dist/src/setup/scaffold/{primitives → update}/update-slack-channel.js +0 -0
|
@@ -150,6 +150,11 @@ function deriveResultStatus(events) {
|
|
|
150
150
|
if (boundary?.type === "session.failed") return "failed";
|
|
151
151
|
return "completed";
|
|
152
152
|
}
|
|
153
|
+
function extractInputRequests(events) {
|
|
154
|
+
const requests = [];
|
|
155
|
+
for (const event of events) if (event.type === "input.requested") requests.push(...event.data.requests);
|
|
156
|
+
return requests;
|
|
157
|
+
}
|
|
153
158
|
function findBoundaryEvent(events) {
|
|
154
159
|
for (let i = events.length - 1; i >= 0; i--) {
|
|
155
160
|
const event = events[i];
|
|
@@ -178,6 +183,7 @@ var MessageResponse = class {
|
|
|
178
183
|
return {
|
|
179
184
|
data: extractCompletedResult(events),
|
|
180
185
|
events,
|
|
186
|
+
inputRequests: extractInputRequests(events),
|
|
181
187
|
message: extractCompletedMessage(events),
|
|
182
188
|
sessionId: this.sessionId,
|
|
183
189
|
status: deriveResultStatus(events)
|
|
@@ -253,24 +259,28 @@ function formatSearch(searchParams) {
|
|
|
253
259
|
|
|
254
260
|
//#endregion
|
|
255
261
|
//#region src/client/open-stream.ts
|
|
262
|
+
const STREAM_OPEN_RETRY_ATTEMPTS = 12;
|
|
263
|
+
const STREAM_OPEN_RETRY_DELAY_MS = 250;
|
|
264
|
+
const STREAM_OPEN_RETRYABLE_STATUS = new Set([
|
|
265
|
+
404,
|
|
266
|
+
409,
|
|
267
|
+
425,
|
|
268
|
+
500,
|
|
269
|
+
502,
|
|
270
|
+
503,
|
|
271
|
+
504
|
|
272
|
+
]);
|
|
256
273
|
async function* openStreamIterable(input) {
|
|
257
274
|
let startIndex = input.startIndex;
|
|
258
275
|
let remainingReconnectAttempts = input.maxReconnectAttempts;
|
|
259
276
|
while (true) {
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
headers,
|
|
264
|
-
signal: input.signal ?? null
|
|
277
|
+
const body = await openStreamBody({
|
|
278
|
+
...input,
|
|
279
|
+
startIndex
|
|
265
280
|
});
|
|
266
|
-
if (!response.ok) {
|
|
267
|
-
const body = await response.text();
|
|
268
|
-
throw new ClientError(response.status, body);
|
|
269
|
-
}
|
|
270
|
-
if (!response.body) throw new ClientError(response.status, "Response body is null.");
|
|
271
281
|
let disconnected = false;
|
|
272
282
|
try {
|
|
273
|
-
for await (const event of readNdjsonStream(
|
|
283
|
+
for await (const event of readNdjsonStream(body)) {
|
|
274
284
|
startIndex += 1;
|
|
275
285
|
yield event;
|
|
276
286
|
}
|
|
@@ -278,13 +288,39 @@ async function* openStreamIterable(input) {
|
|
|
278
288
|
if (!isStreamDisconnectError(error)) throw error;
|
|
279
289
|
disconnected = true;
|
|
280
290
|
}
|
|
281
|
-
if (!disconnected || remainingReconnectAttempts <= 0) return;
|
|
291
|
+
if (!disconnected || input.signal?.aborted || remainingReconnectAttempts <= 0) return;
|
|
282
292
|
remainingReconnectAttempts -= 1;
|
|
283
293
|
}
|
|
284
294
|
}
|
|
295
|
+
async function openStreamBody(input) {
|
|
296
|
+
let lastStatus;
|
|
297
|
+
let lastBody;
|
|
298
|
+
for (let attempt = 0; attempt < STREAM_OPEN_RETRY_ATTEMPTS; attempt += 1) {
|
|
299
|
+
const url = createClientUrl(input.host, createEveMessageStreamRoutePath(input.sessionId), input.startIndex > 0 ? { startIndex: String(input.startIndex) } : void 0);
|
|
300
|
+
const headers = await input.resolveHeaders();
|
|
301
|
+
const response = await fetch(url, {
|
|
302
|
+
headers,
|
|
303
|
+
signal: input.signal ?? null
|
|
304
|
+
});
|
|
305
|
+
if (response.ok) {
|
|
306
|
+
if (!response.body) throw new ClientError(response.status, "Response body is null.");
|
|
307
|
+
return response.body;
|
|
308
|
+
}
|
|
309
|
+
lastStatus = response.status;
|
|
310
|
+
lastBody = await response.text();
|
|
311
|
+
if (!STREAM_OPEN_RETRYABLE_STATUS.has(response.status)) throw new ClientError(response.status, lastBody);
|
|
312
|
+
if (attempt < STREAM_OPEN_RETRY_ATTEMPTS - 1) await sleep$1(STREAM_OPEN_RETRY_DELAY_MS);
|
|
313
|
+
}
|
|
314
|
+
throw new ClientError(lastStatus ?? 0, lastBody ?? "Failed to open message stream.");
|
|
315
|
+
}
|
|
316
|
+
async function sleep$1(ms) {
|
|
317
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
318
|
+
}
|
|
285
319
|
|
|
286
320
|
//#endregion
|
|
287
321
|
//#region src/client/session.ts
|
|
322
|
+
const DELIVER_RETRY_ATTEMPTS = 10;
|
|
323
|
+
const DELIVER_RETRY_DELAY_MS = 200;
|
|
288
324
|
var ClientSession = class {
|
|
289
325
|
#context;
|
|
290
326
|
#state;
|
|
@@ -308,14 +344,7 @@ var ClientSession = class {
|
|
|
308
344
|
stream(options) {
|
|
309
345
|
const sessionId = this.#state.sessionId;
|
|
310
346
|
if (!sessionId) throw new Error("Session has no session ID. Send a message first.");
|
|
311
|
-
return
|
|
312
|
-
host: this.#context.host,
|
|
313
|
-
maxReconnectAttempts: this.#context.maxReconnectAttempts,
|
|
314
|
-
resolveHeaders: () => this.#context.resolveHeaders(),
|
|
315
|
-
sessionId,
|
|
316
|
-
signal: options?.signal,
|
|
317
|
-
startIndex: options?.startIndex ?? this.#state.streamIndex
|
|
318
|
-
});
|
|
347
|
+
return this.#streamAndAdvance(sessionId, options);
|
|
319
348
|
}
|
|
320
349
|
async #postTurn(input, session) {
|
|
321
350
|
const routePath = session.sessionId ? createEveContinueSessionRoutePath(session.sessionId) : EVE_CREATE_SESSION_ROUTE_PATH;
|
|
@@ -328,16 +357,13 @@ var ClientSession = class {
|
|
|
328
357
|
session
|
|
329
358
|
});
|
|
330
359
|
if (body === null) throw new Error("Session.send requires a non-empty message, inputResponses, or both.");
|
|
331
|
-
const response = await
|
|
360
|
+
const response = await postTurnWithRetry({
|
|
332
361
|
body: JSON.stringify(body),
|
|
333
362
|
headers,
|
|
334
|
-
|
|
335
|
-
signal: input.signal
|
|
363
|
+
mustDeliver: (input.inputResponses?.length ?? 0) > 0,
|
|
364
|
+
signal: input.signal,
|
|
365
|
+
url
|
|
336
366
|
});
|
|
337
|
-
if (!response.ok) {
|
|
338
|
-
const responseBody = await response.text();
|
|
339
|
-
throw new ClientError(response.status, responseBody);
|
|
340
|
-
}
|
|
341
367
|
const payload = await response.json();
|
|
342
368
|
const sessionId = (typeof payload.sessionId === "string" ? payload.sessionId : void 0) ?? response.headers.get("x-eve-session-id")?.trim() ?? session.sessionId;
|
|
343
369
|
if (!sessionId) throw new Error("Message route did not return a session id.");
|
|
@@ -368,6 +394,7 @@ var ClientSession = class {
|
|
|
368
394
|
if (!isStreamDisconnectError(error)) throw error;
|
|
369
395
|
}
|
|
370
396
|
if (foundBoundary) break;
|
|
397
|
+
if (input.signal?.aborted) break;
|
|
371
398
|
if (remainingReconnectAttempts <= 0) break;
|
|
372
399
|
remainingReconnectAttempts -= 1;
|
|
373
400
|
}
|
|
@@ -381,20 +408,69 @@ var ClientSession = class {
|
|
|
381
408
|
}
|
|
382
409
|
}
|
|
383
410
|
async #openStreamBody(sessionId, startIndex, signal, headers) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
signal
|
|
411
|
+
return await openStreamBody({
|
|
412
|
+
host: this.#context.host,
|
|
413
|
+
resolveHeaders: () => this.#context.resolveHeaders(headers),
|
|
414
|
+
sessionId,
|
|
415
|
+
signal,
|
|
416
|
+
startIndex
|
|
389
417
|
});
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
418
|
+
}
|
|
419
|
+
async *#streamAndAdvance(sessionId, options) {
|
|
420
|
+
const initialState = this.#state;
|
|
421
|
+
const streamIndex = options?.startIndex ?? initialState.streamIndex;
|
|
422
|
+
const events = [];
|
|
423
|
+
try {
|
|
424
|
+
for await (const event of openStreamIterable({
|
|
425
|
+
host: this.#context.host,
|
|
426
|
+
maxReconnectAttempts: this.#context.maxReconnectAttempts,
|
|
427
|
+
resolveHeaders: () => this.#context.resolveHeaders(),
|
|
428
|
+
sessionId,
|
|
429
|
+
signal: options?.signal,
|
|
430
|
+
startIndex: streamIndex
|
|
431
|
+
})) {
|
|
432
|
+
events.push(event);
|
|
433
|
+
yield event;
|
|
434
|
+
}
|
|
435
|
+
} finally {
|
|
436
|
+
this.#state = advanceSession({
|
|
437
|
+
continuationToken: initialState.continuationToken,
|
|
438
|
+
events,
|
|
439
|
+
session: {
|
|
440
|
+
...initialState,
|
|
441
|
+
sessionId,
|
|
442
|
+
streamIndex
|
|
443
|
+
},
|
|
444
|
+
sessionId
|
|
445
|
+
});
|
|
393
446
|
}
|
|
394
|
-
if (!response.body) throw new ClientError(response.status, "Response body is null.");
|
|
395
|
-
return response.body;
|
|
396
447
|
}
|
|
397
448
|
};
|
|
449
|
+
async function postTurnWithRetry(input) {
|
|
450
|
+
const attempts = input.mustDeliver ? DELIVER_RETRY_ATTEMPTS : 1;
|
|
451
|
+
let lastStatus;
|
|
452
|
+
let lastBody;
|
|
453
|
+
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
454
|
+
const response = await fetch(input.url, {
|
|
455
|
+
body: input.body,
|
|
456
|
+
headers: input.headers,
|
|
457
|
+
method: "POST",
|
|
458
|
+
signal: input.signal ?? null
|
|
459
|
+
});
|
|
460
|
+
if (response.ok) return response;
|
|
461
|
+
lastStatus = response.status;
|
|
462
|
+
lastBody = await response.text();
|
|
463
|
+
if (!isRetryableDeliveryFailure(response.status, lastBody)) throw new ClientError(response.status, lastBody);
|
|
464
|
+
if (attempt < attempts - 1) await sleep(DELIVER_RETRY_DELAY_MS);
|
|
465
|
+
}
|
|
466
|
+
throw new ClientError(lastStatus ?? 0, lastBody ?? "Failed to deliver session turn.");
|
|
467
|
+
}
|
|
468
|
+
function isRetryableDeliveryFailure(status, body) {
|
|
469
|
+
return status === 500 && /target session was not found/i.test(body);
|
|
470
|
+
}
|
|
471
|
+
async function sleep(ms) {
|
|
472
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
473
|
+
}
|
|
398
474
|
function normalizeSendTurnInput(input) {
|
|
399
475
|
return typeof input === "string" ? { message: input } : input;
|
|
400
476
|
}
|
|
@@ -444,6 +520,14 @@ var Client = class {
|
|
|
444
520
|
}
|
|
445
521
|
return await response.json();
|
|
446
522
|
}
|
|
523
|
+
async fetch(path, init = {}) {
|
|
524
|
+
const url = createClientUrl(this.#host, path);
|
|
525
|
+
const headers = await this.#resolveHeaders(headersInitToRecord(init.headers));
|
|
526
|
+
return await fetch(url, {
|
|
527
|
+
...init,
|
|
528
|
+
headers
|
|
529
|
+
});
|
|
530
|
+
}
|
|
447
531
|
session(state) {
|
|
448
532
|
let resolved;
|
|
449
533
|
if (typeof state === "string") resolved = {
|
|
@@ -488,6 +572,10 @@ async function resolveHeadersValue(value) {
|
|
|
488
572
|
if (value === void 0) return {};
|
|
489
573
|
return typeof value === "function" ? await value() : value;
|
|
490
574
|
}
|
|
575
|
+
function headersInitToRecord(headers) {
|
|
576
|
+
if (headers === void 0) return {};
|
|
577
|
+
return Object.fromEntries(new Headers(headers).entries());
|
|
578
|
+
}
|
|
491
579
|
function encodeBasicCredentials(username, password) {
|
|
492
580
|
const bytes = new TextEncoder().encode(`${username}:${password}`);
|
|
493
581
|
const binaryString = Array.from(bytes, (byte) => String.fromCodePoint(byte)).join("");
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const EVE_WORDMARK = "\uD835\uDC1E\uD835\uDC2F\uD835\uDC1E";
|
|
2
|
+
/**
|
|
3
|
+
* The one-line boot banner shared by every CLI command that announces itself:
|
|
4
|
+
* the 𝐞𝐯𝐞 badge plus the installed version, dimmed. Printed only by the CLI
|
|
5
|
+
* program's pre-action hook so commands never compose their own variant.
|
|
6
|
+
*/
|
|
7
|
+
export declare function eveCliBanner(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__toESM}from"../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";var import_picocolors=__toESM(require_picocolors(),1);const EVE_WORDMARK=`𝐞𝐯𝐞`;function eveCliBanner(){let{version:e}=resolveInstalledPackageInfo();return`${import_picocolors.default.bgBlack(import_picocolors.default.white(` ${EVE_WORDMARK} `))} ${import_picocolors.default.dim(`v${e}`)}`}export{EVE_WORDMARK,eveCliBanner};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChannelKind } from "#setup/scaffold/index.js";
|
|
2
|
-
import type { DisabledChannelReasons } from "#setup/
|
|
2
|
+
import type { DisabledChannelReasons } from "#setup/cli/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Existing authored registrations that affect the scaffolded channel picker
|
|
5
5
|
* or would conflict with a generated channel module.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
import { type DeploymentInfo } from "#setup/
|
|
1
|
+
import { type AddChannelsDeps } from "#setup/boxes/add-channels.js";
|
|
2
|
+
import { type DeployProjectDeps } from "#setup/boxes/deploy-project.js";
|
|
3
|
+
import { type DeploymentInfo } from "#setup/project-resolution.js";
|
|
4
|
+
import { type Prompter } from "#setup/prompter.js";
|
|
4
5
|
export interface CliLogger {
|
|
5
6
|
error(message: string): void;
|
|
6
7
|
log(message: string): void;
|
|
@@ -11,10 +12,12 @@ export interface AddChannelCommandOptions {
|
|
|
11
12
|
yes?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export interface ChannelsAddDependencies {
|
|
14
|
-
createPrompter?: () =>
|
|
15
|
+
createPrompter?: () => Prompter;
|
|
15
16
|
detectDeployment(projectPath: string): Promise<DeploymentInfo>;
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/** Test seam into the add-channels box's scaffold/Connect/Vercel effects. */
|
|
18
|
+
addChannelsDeps?: AddChannelsDeps;
|
|
19
|
+
/** Test seam into the deploy box's subprocess effects. */
|
|
20
|
+
deployProjectDeps?: DeployProjectDeps;
|
|
18
21
|
}
|
|
19
22
|
export declare function runChannelsAddCommand(logger: CliLogger, appRoot: string, args: {
|
|
20
23
|
kind?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{assertCanAddSelectedChannels,inspectExistingChannelRegistrations}from"./channel-add-conflicts.js";import{isEveProject,listAuthoredChannels}from"#setup/scaffold/index.js";import{
|
|
1
|
+
import{assertCanAddSelectedChannels,inspectExistingChannelRegistrations}from"./channel-add-conflicts.js";import{NOT_AN_AGENT_MESSAGE}from"./preconditions.js";import{isEveProject,listAuthoredChannels}from"#setup/scaffold/index.js";import{interactiveAsker}from"#setup/ask.js";import{addChannels}from"#setup/boxes/add-channels.js";import{deployProject}from"#setup/boxes/deploy-project.js";import{selectChannels}from"#setup/boxes/select-channels.js";import{detectDeployment,projectResolutionFromDeployment}from"#setup/project-resolution.js";import{createPrompter}from"#setup/prompter.js";import{runInteractive}from"#setup/runner.js";import{createDefaultSetupState,snapshotSetupState}from"#setup/state.js";const KNOWN_CHANNEL_KINDS=[`slack`,`web`];function isChannelKind(e){return KNOWN_CHANNEL_KINDS.includes(e)}function parseChannelKind(e){if(!isChannelKind(e))throw Error(`Unknown channel kind "${e}". Known: ${KNOWN_CHANNEL_KINDS.join(`, `)}.`);return e}const defaultChannelsAddDependencies={detectDeployment};async function runAddChannelsFlow(n,r,i,s){if(r===void 0&&(i.yes||!process.stdin.isTTY||!process.stdout.isTTY))throw Error(`Pass a channel kind: \`eve channels add <${KNOWN_CHANNEL_KINDS.join(`|`)}>\`.`);let c=s.createPrompter?.()??createPrompter();c.intro(`Add channels to your Eve agent`),c.log.message(`Checking the current Vercel project...`);let l={...createDefaultSetupState(),project:projectResolutionFromDeployment(await s.detectDeployment(n)),projectPath:{kind:`resolved`,inPlace:!0,path:n}},u;function inspectRegistrations(){return u===void 0&&(c.log.message(`Inspecting existing channel registrations...`),u=inspectExistingChannelRegistrations(n)),u}let d=r===void 0?(await inspectRegistrations()).disabledChannelReasons:void 0,f=await runInteractive([selectChannels({asker:interactiveAsker(c),variant:`channels-add`,presetChannels:r===void 0?void 0:[r],disabledChannelReasons:d,validateSelection:async t=>{!t.includes(`web`)&&!t.includes(`slack`)||assertCanAddSelectedChannels(t,await inspectRegistrations())}}),addChannels({asker:interactiveAsker(c),prompter:c,presetCreateSlackbot:i.yes?!0:void 0,force:i.force,configureVercelServices:!0,ensureLinkedProject:`interactive-vercel-link`,deps:s.addChannelsDeps}),deployProject({prompter:c,ensureLinkedProject:`interactive-vercel-link`,deps:s.deployProjectDeps})],l,{write:e=>c.log.message(e)},{snapshot:snapshotSetupState});f.kind!==`cancelled`&&c.outro(f.state.channels.length===0?`No channels added.`:`Channels added.`)}async function runChannelsAddCommand(e,t,i,a=defaultChannelsAddDependencies){if(!await isEveProject(t)){e.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}try{await runAddChannelsFlow(t,i.kind===void 0?void 0:parseChannelKind(i.kind),i.options,a)}catch(t){e.error(t instanceof Error?t.message:String(t)),process.exitCode=1}}async function runChannelsListCommand(e,t,a){if(!await isEveProject(t)){e.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}let o=await listAuthoredChannels(t);if(a.json){e.log(JSON.stringify({channels:o},null,2));return}if(o.length===0){e.log("No channels defined. Run `eve channels add` to add one.");return}for(let t of o)e.log(t)}export{runChannelsAddCommand,runChannelsListCommand};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type DeployFlowDeps } from "#setup/flows/deploy.js";
|
|
2
|
+
import { type Prompter } from "#setup/prompter.js";
|
|
3
|
+
export interface DeployCliLogger {
|
|
4
|
+
error(message: string): void;
|
|
5
|
+
log(message: string): void;
|
|
6
|
+
}
|
|
7
|
+
export interface DeployCommandDependencies {
|
|
8
|
+
createPrompter?: () => Prompter;
|
|
9
|
+
isEveProject(projectPath: string): Promise<boolean>;
|
|
10
|
+
hasInteractiveTerminal(): boolean;
|
|
11
|
+
/** Test seam into the flow's detection and box effects. */
|
|
12
|
+
flowDeps?: Partial<DeployFlowDeps>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `eve deploy`: deploy the agent to Vercel production. An already-linked
|
|
16
|
+
* project deploys straight away (interactively or not); an unlinked one walks
|
|
17
|
+
* the same team/project pickers as onboarding when a terminal is present, and
|
|
18
|
+
* refuses with `eve link` guidance otherwise. The flow itself is
|
|
19
|
+
* {@link runDeployFlow}, shared with the dev TUI's `/deploy`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function runDeployCommand(logger: DeployCliLogger, appRoot: string, dependencies?: DeployCommandDependencies): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal}from"./preconditions.js";import{isEveProject}from"#setup/scaffold/index.js";import{createPrompter}from"#setup/prompter.js";import{runDeployFlow}from"#setup/flows/deploy.js";const defaultDependencies={isEveProject,hasInteractiveTerminal};async function runDeployCommand(t,n,r=defaultDependencies){if(!await r.isEveProject(n)){t.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}let i=r.createPrompter?.()??createPrompter();i.intro(`Deploy your Eve agent to Vercel`);try{let e=await runDeployFlow({appRoot:n,prompter:i,interactive:r.hasInteractiveTerminal(),deps:r.flowDeps});if(e.kind===`needs-link`){t.error("This directory is not linked to a Vercel project. Run `eve link` first (or `vercel link --project <name> --yes` in CI), then re-run `eve deploy`."),process.exitCode=1;return}i.outro(e.kind===`cancelled`?`Cancelled.`:e.productionUrl===void 0?`Deployed.`:`Deployed: ${e.productionUrl}`)}catch(e){t.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}export{runDeployCommand};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type GitInitResult = {
|
|
2
|
+
kind: "initialized";
|
|
3
|
+
} | {
|
|
4
|
+
kind: "skipped";
|
|
5
|
+
} | {
|
|
6
|
+
kind: "failed";
|
|
7
|
+
reason: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Initializes a Git repository and records the generated files in an initial
|
|
11
|
+
* commit. Missing Git and parent repositories are skips. A failed partial
|
|
12
|
+
* initialization is removed and returned as a `failed` result; presenting the
|
|
13
|
+
* failure (without failing `eve init`) is the caller's job.
|
|
14
|
+
*/
|
|
15
|
+
export declare function tryInitializeGit(projectPath: string): GitInitResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{join}from"node:path";import{execSync}from"node:child_process";import{rmSync}from"node:fs";const GIT_TIMEOUT_MS=5e3;function isGitAvailable(){try{return execSync(`git --version`,{stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function isInsideExistingRepository(e){try{return execSync(`git rev-parse --is-inside-work-tree`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{}try{return execSync(`hg --cwd . root`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function hasConfiguredDefaultBranch(e){try{return execSync(`git config init.defaultBranch`,{cwd:e,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),!0}catch{return!1}}function tryInitializeGit(n){if(!isGitAvailable()||isInsideExistingRepository(n))return{kind:`skipped`};let r=!1;try{return execSync(`git init`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),r=!0,hasConfiguredDefaultBranch(n)||execSync(`git checkout -b main`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),execSync(`git add -A`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),execSync(`git commit -m "Initial commit from Eve"`,{cwd:n,stdio:`ignore`,timeout:GIT_TIMEOUT_MS}),{kind:`initialized`}}catch(t){if(r)try{rmSync(join(n,`.git`),{recursive:!0,force:!0})}catch{}return{kind:`failed`,reason:t instanceof Error?t.message:String(t)}}}export{tryInitializeGit};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { detectInvokingPackageManager, detectPackageManager } from "#setup/package-manager.js";
|
|
2
|
+
import { runPackageManagerInstall, spawnPackageManager } from "#setup/primitives/index.js";
|
|
3
|
+
import { addAgentToProject } from "#setup/scaffold/create/add-to-project.js";
|
|
4
|
+
import { ensureChannel, scaffoldBaseProject } from "#setup/scaffold/index.js";
|
|
5
|
+
import { tryInitializeGit } from "./init-git.js";
|
|
6
|
+
export interface InitCliLogger {
|
|
7
|
+
error(message: string): void;
|
|
8
|
+
log(message: string): void;
|
|
9
|
+
}
|
|
10
|
+
export interface InitCommandOptions {
|
|
11
|
+
/** Add the Web Chat channel (a Next.js app). Set by `--channel-web-nextjs`. */
|
|
12
|
+
channelWebNextjs?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface InitCommandDependencies {
|
|
15
|
+
addAgentToProject: typeof addAgentToProject;
|
|
16
|
+
detectInvokingPackageManager: typeof detectInvokingPackageManager;
|
|
17
|
+
detectPackageManager: typeof detectPackageManager;
|
|
18
|
+
ensureChannel: typeof ensureChannel;
|
|
19
|
+
runPackageManagerInstall: typeof runPackageManagerInstall;
|
|
20
|
+
scaffoldBaseProject: typeof scaffoldBaseProject;
|
|
21
|
+
spawnPackageManager: typeof spawnPackageManager;
|
|
22
|
+
tryInitializeGit: typeof tryInitializeGit;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new Eve agent (`target` is a project name), or adds one to an
|
|
26
|
+
* existing project (`target` is a directory), without prompts or external
|
|
27
|
+
* provisioning.
|
|
28
|
+
*/
|
|
29
|
+
export declare function runInitCommand(logger: InitCliLogger, parentDirectory: string, target: string, options: InitCommandOptions, dependencies?: InitCommandDependencies): Promise<void>;
|
|
@@ -0,0 +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{tryInitializeGit}from"./init-git.js";import{join,resolve}from"node:path";import{ensureChannel,scaffoldBaseProject}from"#setup/scaffold/index.js";import{mkdtemp,rename,rm,stat}from"node:fs/promises";import{EVE_WORDMARK}from"#cli/banner.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{SPINNER_FRAMES,SPINNER_FRAME_MS}from"#setup/cli/rail-log.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{addAgentToProject}from"#setup/scaffold/create/add-to-project.js";var import_picocolors=__toESM(require_picocolors(),1);const defaultDependencies={addAgentToProject,detectInvokingPackageManager,detectPackageManager,ensureChannel,runPackageManagerInstall,scaffoldBaseProject,spawnPackageManager,tryInitializeGit};async function resolveTargetDirectory(e,t){let n=resolve(e,t);return(await stat(n).catch(()=>void 0))?.isDirectory()?n:void 0}async function addToExistingProject(e,t,n){if(t.channelWebNextjs===!0)throw Error("`--channel-web-nextjs` is not supported when adding an agent to an existing project. Run `eve channels add web` from the project afterwards instead.");let r=await n.detectPackageManager(e);return await n.addAgentToProject({projectRoot:e,model:DEFAULT_AGENT_MODEL_ID,packageManager:r.kind}),r.kind}function resolveScaffoldPackageManager(e){return e.detectInvokingPackageManager()??`pnpm`}const EVE_INIT_PACKAGE_VERSION=`latest`;async function scaffoldProject(e,t,n,a,o){let u=resolve(e),d=join(u,t);if(await pathExists(d))throw Error(`Cannot create project because "${d}" already exists.`);let f=await mkdtemp(join(u,`.eve-init-`));try{let e=await o.scaffoldBaseProject({projectName:t,model:DEFAULT_AGENT_MODEL_ID,packageManager:n,targetDirectory:f,evePackageVersion:EVE_INIT_PACKAGE_VERSION});return a.channelWebNextjs===!0&&await o.ensureChannel({projectRoot:e,kind:`web`,packageManager:n,configureVercelServices:!1,webPackageVersions:{evePackageVersion:EVE_INIT_PACKAGE_VERSION}}),await rename(e,d),d}finally{await rm(f,{recursive:!0,force:!0})}}function startSpinner(e,t){if(process.stdout.isTTY!==!0)return e.log(t),{stop(){}};let row=e=>`${import_picocolors.default.green(e)} ${t}`;process.stdout.write(row(SPINNER_FRAMES[0]));let n=0,r=setInterval(()=>{n+=1;let e=SPINNER_FRAMES[n%SPINNER_FRAMES.length]??SPINNER_FRAMES[0];process.stdout.write(`\r\u001B[K${row(e)}`)},SPINNER_FRAME_MS);r.unref?.();let i=!1;return{stop(){i||(i=!0,clearInterval(r),process.stdout.write(`\r\x1B[K`))}}}async function runInitCommand(e,t,n,r,i=defaultDependencies){let a=await resolveTargetDirectory(t,n),o,s;a===void 0?(o=resolveScaffoldPackageManager(i),s=await scaffoldProject(t,parseProjectName(n),o,r,i),e.log(`${import_picocolors.default.green(`✓`)} Created an ${EVE_WORDMARK} agent in ${import_picocolors.default.bold(s)}`)):(o=await addToExistingProject(a,r,i),s=a,e.log(`${import_picocolors.default.green(`✓`)} Added an ${EVE_WORDMARK} agent to ${import_picocolors.default.bold(s)}`));let c=[],l=startSpinner(e,`Installing dependencies...`),u;try{u=await i.runPackageManagerInstall(o,s,{bypassMinimumReleaseAge:!0,onOutput:e=>c.push(e.text)})}finally{l.stop()}if(!u){for(let t of c)e.error(t);throw Error(`Failed to install dependencies in "${s}".`)}if(e.log(`${import_picocolors.default.green(`✓`)} Installed dependencies`),a===void 0){let t=i.tryInitializeGit(s);t.kind===`failed`&&e.error(import_picocolors.default.yellow(`Git initialization failed: ${t.reason}`))}if(e.log(import_picocolors.default.dim(`$ eve dev`)),!await i.spawnPackageManager(o,s,eveDevArguments(o)))throw Error(`Development server exited unsuccessfully in "${s}".`)}export{runInitCommand};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type LinkFlowDeps } from "#setup/flows/link.js";
|
|
2
|
+
import { type Prompter } from "#setup/prompter.js";
|
|
3
|
+
export interface LinkCliLogger {
|
|
4
|
+
error(message: string): void;
|
|
5
|
+
log(message: string): void;
|
|
6
|
+
}
|
|
7
|
+
export interface LinkCommandDependencies {
|
|
8
|
+
createPrompter?: () => Prompter;
|
|
9
|
+
isEveProject(projectPath: string): Promise<boolean>;
|
|
10
|
+
hasInteractiveTerminal(): boolean;
|
|
11
|
+
/** Test seam into the flow's detection and box effects. */
|
|
12
|
+
flowDeps?: Partial<LinkFlowDeps>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `eve link`: pick a Vercel team and project (re-linking when one is already
|
|
16
|
+
* linked), run `vercel link`, then pull env so the AI Gateway credential lands
|
|
17
|
+
* in `.env.local`. The flow itself is {@link runLinkFlow}, shared with the dev
|
|
18
|
+
* TUI `/model` menu's provider row. Interactive only: the pickers are the point of the command,
|
|
19
|
+
* so a non-TTY run refuses with guidance instead of guessing a project.
|
|
20
|
+
*/
|
|
21
|
+
export declare function runLinkCommand(logger: LinkCliLogger, appRoot: string, dependencies?: LinkCommandDependencies): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NOT_AN_AGENT_MESSAGE,hasInteractiveTerminal}from"./preconditions.js";import{isEveProject}from"#setup/scaffold/index.js";import{createPrompter}from"#setup/prompter.js";import{runLinkFlow}from"#setup/flows/link.js";const defaultDependencies={isEveProject,hasInteractiveTerminal};async function runLinkCommand(t,n,r=defaultDependencies){if(!await r.isEveProject(n)){t.error(NOT_AN_AGENT_MESSAGE),process.exitCode=1;return}if(!r.hasInteractiveTerminal()){t.error("`eve link` needs an interactive terminal to pick the team and project. In CI, run `vercel link --project <name> --yes` instead."),process.exitCode=1;return}let i=r.createPrompter?.()??createPrompter();i.intro(`Link your Eve agent to Vercel`);try{let e=await runLinkFlow({appRoot:n,prompter:i,deps:r.flowDeps});i.outro(e.kind===`cancelled`?`Cancelled.`:`Project linked.`)}catch(e){t.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}export{runLinkCommand};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refusal shown by agent-scoped commands (`eve link`, `eve deploy`,
|
|
3
|
+
* `eve channels …`) when the working directory holds no Eve agent.
|
|
4
|
+
*/
|
|
5
|
+
export declare const NOT_AN_AGENT_MESSAGE = "No Eve agent in this directory. Run `eve init <name>`, then run this command from inside the new project.";
|
|
6
|
+
/** True when stdin and stdout are both TTYs — the default interactivity gate. */
|
|
7
|
+
export declare function hasInteractiveTerminal(): boolean;
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Command } from "#compiled/commander/index.js";
|
|
2
|
+
interface ProjectCommandLogger {
|
|
3
|
+
error(message: string): void;
|
|
4
|
+
log(message: string): void;
|
|
5
|
+
}
|
|
6
|
+
/** Registers project-level Vercel commands without eagerly loading their flows. */
|
|
7
|
+
export declare function registerProjectCommands(input: {
|
|
8
|
+
program: Command;
|
|
9
|
+
logger: ProjectCommandLogger;
|
|
10
|
+
appRoot: string;
|
|
11
|
+
}): void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function registerProjectCommands(e){e.program.command(`link`).description(`Link this directory to a Vercel project and pull AI Gateway credentials.`).action(async()=>{let{runLinkCommand:t}=await import(`./link.js`);await t(e.logger,e.appRoot)}),e.program.command(`deploy`).description(`Deploy the agent to Vercel production (links first if needed).`).action(async()=>{let{runDeployCommand:t}=await import(`./deploy.js`);await t(e.logger,e.appRoot)})}export{registerProjectCommands};
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Builds the startup header the dev TUI commits to scrollback before the
|
|
3
|
-
* prompt
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* server banner.
|
|
2
|
+
* Builds the startup header the dev TUI commits to scrollback before the
|
|
3
|
+
* first prompt: one `▲ eve <agent name>` brand line, a discovery-diagnostics
|
|
4
|
+
* line when the compiler reported problems, and a rotating tip for local
|
|
5
|
+
* sessions. The resolved model is not repeated here — it lives on the
|
|
6
|
+
* persistent status line at the bottom.
|
|
8
7
|
*/
|
|
9
8
|
import type { AgentInfoResult } from "#client/index.js";
|
|
10
9
|
import type { Theme } from "./theme.js";
|
|
11
10
|
export interface AgentHeaderInput {
|
|
12
|
-
/** Resolved display name (e.g. "
|
|
11
|
+
/** Resolved display name (e.g. "weather-agent"). */
|
|
13
12
|
name: string;
|
|
14
|
-
/** Server URL the TUI is connected to. */
|
|
15
|
-
serverUrl: string;
|
|
16
13
|
/** Agent inspection payload, or `undefined` when it could not be fetched. */
|
|
17
14
|
info?: AgentInfoResult;
|
|
18
15
|
theme: Theme;
|
|
19
16
|
/** Available terminal width. */
|
|
20
17
|
width: number;
|
|
18
|
+
/** Message-of-the-day line rendered under the brand line, when present. */
|
|
19
|
+
tip?: string;
|
|
21
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* The header's message-of-the-day pool. All entries reference local-only
|
|
23
|
+
* slash commands, so callers only attach a tip to local `eve dev` sessions.
|
|
24
|
+
*/
|
|
25
|
+
export declare const AGENT_HEADER_TIPS: readonly string[];
|
|
26
|
+
/** Picks one tip; `random` is a test seam over Math.random. */
|
|
27
|
+
export declare function pickAgentHeaderTip(random?: () => number): string;
|
|
22
28
|
/**
|
|
23
29
|
* Returns the styled rows of the startup header (no trailing blank line is
|
|
24
30
|
* added by callers other than the one separating it from the transcript).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{truncate}from"./tool-format.js";function buildAgentHeader(t){let{theme:n,info:r,name:i,
|
|
1
|
+
import{truncate}from"./tool-format.js";const AGENT_HEADER_TIPS=[`Use /channels to add more ways to reach your agent.`,`Use /deploy to see your agent go live.`,`Type /help to see every command.`];function pickAgentHeaderTip(e=Math.random){return AGENT_HEADER_TIPS[Math.min(AGENT_HEADER_TIPS.length-1,Math.floor(e()*AGENT_HEADER_TIPS.length))]}function buildAgentHeader(t){let{theme:n,info:r,name:i,width:a}=t,o=n.colors,s=[],c=o.bold(`${n.glyph.brand} eve`);if(s.push(` ${c} ${o.dim(truncate(i,Math.max(8,a-8)))}`),r&&(r.diagnostics.discoveryErrors>0||r.diagnostics.discoveryWarnings>0)){let e=[];r.diagnostics.discoveryErrors>0&&e.push(o.red(`${r.diagnostics.discoveryErrors} error${plural(r.diagnostics.discoveryErrors)}`)),r.diagnostics.discoveryWarnings>0&&e.push(o.yellow(`${r.diagnostics.discoveryWarnings} warning${plural(r.diagnostics.discoveryWarnings)}`)),s.push(` ${o.dim(n.glyph.warning)} ${e.join(o.dim(` · `))}`)}return t.tip!==void 0&&s.push(` ${o.dim(truncate(t.tip,Math.max(8,a-2)))}`),s}function plural(e){return e===1?``:`s`}export{AGENT_HEADER_TIPS,buildAgentHeader,pickAgentHeaderTip};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { Theme } from "./theme.js";
|
|
13
13
|
export type ToolStatus = "running" | "done" | "error" | "denied" | "approval";
|
|
14
|
-
export type BlockKind = "user" | "assistant" | "reasoning" | "tool" | "error" | "notice" | "question" | "subagent" | "subagent-step" | "subagent-tool" | "connection-auth" | "log";
|
|
14
|
+
export type BlockKind = "user" | "assistant" | "reasoning" | "tool" | "error" | "notice" | "warning" | "result" | "flow" | "command" | "question" | "subagent" | "subagent-step" | "subagent-tool" | "connection-auth" | "log" | "agent-header";
|
|
15
15
|
/**
|
|
16
16
|
* One renderable transcript unit. Fields are interpreted per `kind`; unset
|
|
17
17
|
* fields are simply omitted from the rendered output.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import{formatValuePretty,truncate}from"./tool-format.js";import{sliceVisible,visibleLength,wrapVisibleLine}from"./terminal-text.js";import{renderMarkdown}from"./markdown.js";function renderBlockLines(e,t,n,i){let a=nestingPrefix(e.depth??0,n);return renderBody(e,Math.max(8,t-visibleLength(a)),n,i).map(e=>`${a}${e}`)}function nestingPrefix(e,t){return e<=0?``:`${t.colors.orange(t.glyph.rule)} `.repeat(e)}function renderBody(e,t,n,r){switch(e.kind){case`user`:return renderUser(e,t,n);case`assistant`:case`subagent-step`:return renderProse(e,t,n);case`reasoning`:return renderReasoning(e,t,n);case`tool`:case`subagent-tool`:return renderTool(e,t,n,r);case`error`:return renderError(e,t,n);case`notice`:return renderNotice(e,t,n);case`
|
|
1
|
+
import{formatValuePretty,truncate}from"./tool-format.js";import{sliceVisible,visibleLength,wrapVisibleLine}from"./terminal-text.js";import{renderMarkdown}from"./markdown.js";import{isPromptControlCommand}from"./prompt-commands.js";function renderBlockLines(e,t,n,i){let a=nestingPrefix(e.depth??0,n);return renderBody(e,Math.max(8,t-visibleLength(a)),n,i).map(e=>`${a}${e}`)}function nestingPrefix(e,t){return e<=0?``:`${t.colors.orange(t.glyph.rule)} `.repeat(e)}function renderBody(e,t,n,r){switch(e.kind){case`user`:return renderUser(e,t,n);case`assistant`:case`subagent-step`:return renderProse(e,t,n);case`reasoning`:return renderReasoning(e,t,n);case`tool`:case`subagent-tool`:return renderTool(e,t,n,r);case`error`:return renderError(e,t,n);case`notice`:return renderNotice(e,t,n);case`warning`:return renderWarning(e,t,n);case`result`:return renderResult(e,t,n);case`flow`:return renderFlow(e,t,n);case`command`:return renderCommand(e,n);case`question`:case`connection-auth`:return renderPreformatted(e,t,n);case`log`:return renderLog(e,t,n,r);case`subagent`:return renderSubagentHeader(e,t,n);case`agent-header`:return(e.body??``).split(`
|
|
2
|
+
`)}}function renderUser(e,t,n){let r=n.colors.cyan(n.glyph.user);return wrap(e.body??``,t-2).map(e=>`${r} ${e}`)}function renderProse(e,t,n){let r=[],o=e.kind===`subagent-step`,s=o?``:`${n.colors.bold(n.colors.white(n.glyph.brand))} `,c=o?``:` `;e.reasoning&&e.reasoning.trim().length>0&&r.push(...renderReasoningLines(e.reasoning,t,n));let l=(e.body??``).trim();return l.length===0&&r.length===0?[`${s}${n.colors.dim(`thinking${n.glyph.ellipsis}`)}`]:(l.length>0&&renderMarkdown(l).split(`
|
|
2
3
|
`).flatMap(e=>wrapVisibleLine(e,t-c.length)).forEach((e,t)=>{t===0&&!o&&r.length===0?r.push(`${s}${e}`):r.push(`${c}${e}`)}),r.length>0?r:[`${s}`])}function renderReasoning(e,t,n){return e.collapsed?[`${n.colors.gray(n.glyph.reasoning)} ${n.colors.dim(`thinking`)}`]:renderReasoningLines(e.body??``,t,n,n.glyph.reasoning)}function renderReasoningLines(e,t,n,r){let i=r?2:0,a=wrap(e.trim(),t-i);return a.length===0?[]:a.map((e,t)=>`${r?t===0?`${n.colors.gray(r)} `:` `:``}${n.colors.dim(n.colors.italic(e))}`)}function renderTool(e,n,r,i){let{icon:a,accent:o}=toolGlyph(e.status??`running`,r,i),s=e.title??`tool`,c=n-2,l=truncatePlain(s,c),u=`${a} ${r.colors.bold(l)}`,d=c-l.length-2,f=e.subtitle??``;f.length>0&&d>=6&&(u+=` ${r.colors.gray(truncate(f,d))}`);let p=[u];return e.expanded?p.push(...renderToolExpanded(e,n,r)):e.status===`done`&&e.result&&e.result.length>0?p.push(resultLine(r.glyph.arrow,e.result,n,r,o)):e.status===`error`&&e.result?p.push(resultLine(r.glyph.arrow,e.result,n,r,r.colors.red)):e.status===`denied`&&p.push(resultLine(r.glyph.arrow,`denied`,n,r,r.colors.yellow)),p}function renderToolExpanded(t,n,r){let i=[],push=(t,a,o)=>{if(a!==void 0){i.push(` ${r.colors.dim(t)}`);for(let t of wrap(formatValuePretty(a),n-4))i.push(` ${o(t)}`)}};return push(`input`,t.toolInput,r.colors.gray),t.status===`error`&&t.result?push(`error`,t.result,r.colors.red):push(`output`,t.toolOutput,r.colors.gray),i}function resultLine(e,n,r,i,a){let o=r-4;return` ${i.colors.dim(e)} ${a(truncate(n,o))}`}function toolGlyph(e,t,n){switch(e){case`done`:return{icon:t.colors.green(t.glyph.success),accent:t.colors.gray};case`error`:return{icon:t.colors.red(t.glyph.error),accent:t.colors.red};case`denied`:return{icon:t.colors.yellow(t.glyph.warning),accent:t.colors.yellow};case`approval`:return{icon:t.colors.yellow(t.glyph.question),accent:t.colors.yellow};default:return{icon:t.colors.yellow(n.spinner),accent:t.colors.gray}}}function renderError(e,t,n){let r=n.colors.red(n.colors.bold(n.glyph.error)),i=e.title??`Error`,a=[`${r} ${n.colors.red(n.colors.bold(i))}`];for(let r of wrap(e.body??``,t-2))a.push(` ${colorizeError(r,n)}`);return a.push(...renderErrorDetail(e.detail,t,n)),a}function renderErrorDetail(e,t,n){if(e===void 0||e.trim().length===0)return[];let r=e.split(`
|
|
3
|
-
`),i=r.slice(0,12),a=i.map(e=>` ${n.colors.dim(truncatePlain(e,Math.max(1,t-2)))}`),o=r.length-i.length;return o>0&&a.push(` ${n.colors.dim(`${n.glyph.ellipsis} +${o} more line${o===1?``:`s`}`)}`),a}const URL_PATTERN=/(https?:\/\/\S+)/u;function colorizeError(e,t){return URL_PATTERN.test(e)?e.split(URL_PATTERN).map((e,n)=>n%2==1?t.colors.cyan(e):t.colors.red(e)).join(``):t.colors.red(e)}function renderNotice(e,t,n){let r=n.colors.dim(n.glyph.dot),i=wrap(e.body??``,t-2);return i.length===0?[r]:i.map(e=>`${r} ${n.colors.dim(e)}`)}function renderPreformatted(e,t,n){let r=e.kind===`connection-auth`?n.colors.yellow(n.glyph.connection):n.colors.yellow(n.colors.bold(n.glyph.question)),a=e.title??``,o=[`${r} ${n.colors.bold(a)}`];for(let n of(e.body??``).split(`
|
|
4
|
+
`),i=r.slice(0,12),a=i.map(e=>` ${n.colors.dim(truncatePlain(e,Math.max(1,t-2)))}`),o=r.length-i.length;return o>0&&a.push(` ${n.colors.dim(`${n.glyph.ellipsis} +${o} more line${o===1?``:`s`}`)}`),a}const URL_PATTERN=/(https?:\/\/\S+)/u;function colorizeError(e,t){return URL_PATTERN.test(e)?e.split(URL_PATTERN).map((e,n)=>n%2==1?t.colors.cyan(e):t.colors.red(e)).join(``):t.colors.red(e)}function renderNotice(e,t,n){let r=n.colors.dim(n.glyph.dot),i=wrap(e.body??``,t-2);return i.length===0?[r]:i.map(e=>`${r} ${n.colors.dim(e)}`)}function renderWarning(e,t,n){let r=n.colors.yellow(n.glyph.warning);return wrap(e.body??``,t-2).map((e,t)=>`${t===0?r:` `} ${paintCommands(e,n)}`)}function paintCommands(e,t){return e.replace(/\/[a-z-]+/g,e=>isPromptControlCommand(e)?t.colors.blue(e):e)}function renderCommand(e,t){let n=t.colors;return[`${n.cyan(t.glyph.user)} ${n.blue(e.body??``)}`]}function renderFlow(e,t,n){let r=n.colors,i=e.title??`info`,a=i===`success`?r.green(n.glyph.success):i===`warning`?r.yellow(n.glyph.warning):i===`error`?r.red(n.glyph.error):r.dim(n.glyph.dot),o=wrap(e.body??``,t-2),paint=e=>i===`info`?r.dim(e):e;return o.map((e,t)=>`${t===0?a:` `} ${paint(e)}`)}function renderResult(e,t,n){let r=n.colors.dim(n.glyph.elbow),i=wrap(e.body??``,t-7);return i.length===0?[` ${r}`]:i.map((e,t)=>t===0?` ${r} ${n.colors.dim(e)}`:` ${n.colors.dim(e)}`)}function renderPreformatted(e,t,n){let r=e.kind===`connection-auth`?n.colors.yellow(n.glyph.connection):n.colors.yellow(n.colors.bold(n.glyph.question)),a=e.title??``,o=[`${r} ${n.colors.bold(a)}`];for(let n of(e.body??``).split(`
|
|
4
5
|
`))for(let e of wrapVisibleLine(n,t-2))o.push(` ${e}`);return o}function renderLog(e,t,n,a){let o=e.title===`stderr`,s=o?n.colors.red:n.colors.gray,c=n.colors.dim(n.glyph.rule),l=o?`stderr`:`stdout`,u=n.colors.dim(`${l} ${n.glyph.dot} `),d=visibleLength(u),f=` `.repeat(d),p=a.previous?.kind===`log`&&a.previous.title===e.title,m=(e.body??``).split(`
|
|
5
6
|
`),h=[];for(let e of m){let r=wrapVisibleLine(e,Math.max(1,t-2-d));for(let e of r){let t=h.length===0&&!p?u:f;h.push(`${c} ${t}${n.colors.dim(s(e))}`)}}return h.length>0?h:[`${c}`]}function renderSubagentHeader(e,t,n){let r=truncatePlain(e.title??`subagent`,Math.max(8,t-14));return[`${n.colors.orange(n.glyph.subagent)} ${n.colors.bold(r)} ${n.colors.dim(`subagent`)}`]}function wrap(e,t){return e.trim().length===0?[]:e.split(`
|
|
6
7
|
`).flatMap(e=>wrapVisibleLine(e,Math.max(1,t)))}function truncatePlain(e,t){return visibleLength(e)<=t?e:sliceVisible(e,t)}export{renderBlockLines};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure state and rendering for the prompt's slash-command typeahead: the
|
|
3
|
+
* filtered suggestion list shown above the input while the draft looks like
|
|
4
|
+
* the start of a command. The renderer owns keys and lifecycle; this module
|
|
5
|
+
* owns which commands match, which row is highlighted, and what the rows
|
|
6
|
+
* look like — so the whole interaction is unit-testable without a TTY.
|
|
7
|
+
*/
|
|
8
|
+
import type { PromptCommandSpec } from "./prompt-commands.js";
|
|
9
|
+
import type { Theme } from "./theme.js";
|
|
10
|
+
export interface CommandTypeaheadState {
|
|
11
|
+
/** The prompt text the matches were derived from. */
|
|
12
|
+
readonly query: string;
|
|
13
|
+
readonly matches: readonly PromptCommandSpec[];
|
|
14
|
+
readonly selectedIndex: number;
|
|
15
|
+
/** Esc pressed; the list stays hidden until the query text changes. */
|
|
16
|
+
readonly dismissed: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Derives the typeahead for `text`, carrying the highlight and dismissal
|
|
20
|
+
* over from `previous`. Commands match while the draft is a lone `/`-token
|
|
21
|
+
* (no whitespace yet) prefixing a name or alias; an exact match stays in the
|
|
22
|
+
* list so the highlight confirms what Enter will run. The previous highlight
|
|
23
|
+
* survives narrowing by identity, not index; dismissal survives only while
|
|
24
|
+
* the text is unchanged, so caret moves keep it and any edit reopens.
|
|
25
|
+
*/
|
|
26
|
+
export declare function typeaheadFor(commands: readonly PromptCommandSpec[], text: string, previous?: CommandTypeaheadState): CommandTypeaheadState;
|
|
27
|
+
/** True when the list should render and own the up/down/tab/enter keys. */
|
|
28
|
+
export declare function isTypeaheadOpen(state: CommandTypeaheadState): boolean;
|
|
29
|
+
/** Moves the highlight one row, wrapping at both ends. */
|
|
30
|
+
export declare function moveTypeaheadSelection(state: CommandTypeaheadState, delta: 1 | -1): CommandTypeaheadState;
|
|
31
|
+
/** Hides the list until the input text changes. */
|
|
32
|
+
export declare function dismissTypeahead(state: CommandTypeaheadState): CommandTypeaheadState;
|
|
33
|
+
/** The highlighted command, when the list has one. */
|
|
34
|
+
export declare function selectedTypeaheadCommand(state: CommandTypeaheadState): PromptCommandSpec | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The editor text accepting `spec` produces: the canonical invocation, plus
|
|
37
|
+
* a trailing space when the command takes an argument so the caret lands
|
|
38
|
+
* ready for typing it.
|
|
39
|
+
*/
|
|
40
|
+
export declare function typeaheadCompletion(spec: PromptCommandSpec): string;
|
|
41
|
+
/**
|
|
42
|
+
* Paints the suggestion rows (the select-question grammar): the highlight
|
|
43
|
+
* carries the cursor glyph and a blue name, every row shows its argument
|
|
44
|
+
* hint, aliases, and description dim, and overflow windows around the
|
|
45
|
+
* highlight.
|
|
46
|
+
*/
|
|
47
|
+
export declare function renderCommandSuggestions(state: CommandTypeaheadState, theme: Theme, width: number): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{sliceVisible,visibleLength}from"./terminal-text.js";function typeaheadFor(e,t,n){let r=matchingCommands(e,t),i=n===void 0?void 0:n.matches[n.selectedIndex],a=i===void 0?-1:r.indexOf(i);return{query:t,matches:r,selectedIndex:a>=0?a:0,dismissed:n!==void 0&&n.dismissed&&n.query===t}}function matchingCommands(e,t){if(!t.startsWith(`/`)||/\s/.test(t))return[];let n=t.slice(1);return e.filter(e=>[e.name,...e.aliases].some(e=>e.startsWith(n)))}function isTypeaheadOpen(e){return e.matches.length>0&&!e.dismissed}function moveTypeaheadSelection(e,t){let n=e.matches.length;if(n===0)return e;let r=(e.selectedIndex+t+n)%n;return{...e,selectedIndex:r}}function dismissTypeahead(e){return e.dismissed?e:{...e,dismissed:!0}}function selectedTypeaheadCommand(e){return e.matches[e.selectedIndex]}function typeaheadCompletion(e){return`/${e.name}${e.takesArgument?` `:``}`}function renderCommandSuggestions(n,r,i){let a=r.colors,o=n.matches.length,s=Math.min(o,6),c=Math.max(0,Math.min(n.selectedIndex-Math.floor(s/2),o-s)),l=Math.min(c+s,o),u=n.matches.slice(c,l),invocation=e=>{let t=e.argumentHint===void 0?``:` ${e.argumentHint}`,n=e.aliases.map(e=>` (/${e})`).join(``);return`/${e.name}${t}${n}`},d=Math.max(...u.map(e=>invocation(e).length))+2;return u.map((e,t)=>{let i=c+t===n.selectedIndex,o=i?a.cyan(r.glyph.prompt):` `,s=i?a.blue(`/${e.name}`):`/${e.name}`,l=invocation(e).slice(`/${e.name}`.length),u=` `.repeat(d-invocation(e).length);return`${o} ${s}${a.dim(l)}${u}${a.dim(e.description)}`}).map(n=>visibleLength(n)>i?sliceVisible(n,i):n)}export{dismissTypeahead,isTypeaheadOpen,moveTypeaheadSelection,renderCommandSuggestions,selectedTypeaheadCommand,typeaheadCompletion,typeaheadFor};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Condensed display form of the dev server's rebuild lifecycle. The renderer
|
|
3
|
+
* cycles these strings through one in-place status block instead of stacking
|
|
4
|
+
* the watcher's full log lines: changed paths shrink to their last two
|
|
5
|
+
* components and each lifecycle phase renders as one short clause.
|
|
6
|
+
*/
|
|
7
|
+
import type { WatcherChangeEvent } from "#internal/nitro/host/dev-watcher-log.js";
|
|
8
|
+
export type DevRebuildPhase = "rebuilding" | "rebuilt" | "reloading";
|
|
9
|
+
/**
|
|
10
|
+
* Summarizes one batch of watcher change events as `<paths> <verb>` — e.g.
|
|
11
|
+
* `tui/setup-panel.ts changed`. Paths shrink to their last two components,
|
|
12
|
+
* duplicates collapse, and everything past {@link MAX_SUMMARY_PATHS} folds
|
|
13
|
+
* into a `+N more` (combined with `more`, the count the watcher already
|
|
14
|
+
* truncated from its own log line).
|
|
15
|
+
*/
|
|
16
|
+
export declare function summarizeChangedFiles(events: readonly WatcherChangeEvent[], more: number): string;
|
|
17
|
+
/**
|
|
18
|
+
* Renders the status line body for one lifecycle phase, e.g.
|
|
19
|
+
* `tui/setup-panel.ts changed · rebuilding…`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatDevRebuildStatus(summary: string, phase: DevRebuildPhase): string;
|