eve 0.7.4 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +11 -11
- package/dist/src/chunks/{use-eve-agent-DErQj5hs.js → use-eve-agent-BSXZSn-R.js} +6 -1
- package/dist/src/chunks/{use-eve-agent-DoR8C4i6.js → use-eve-agent-Dlut2Qzt.js} +6 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
- package/dist/src/cli/dev/tui/blocks.js +4 -3
- package/dist/src/cli/dev/tui/command-typeahead.d.ts +13 -3
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
- package/dist/src/cli/dev/tui/line-editor.d.ts +6 -0
- package/dist/src/cli/dev/tui/line-editor.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +2 -0
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +15 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +11 -7
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/setup-flow.d.ts +72 -10
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +91 -39
- package/dist/src/cli/dev/tui/setup-panel.js +3 -1
- package/dist/src/cli/dev/tui/setup-selection-input.d.ts +48 -0
- package/dist/src/cli/dev/tui/setup-selection-input.js +1 -0
- package/dist/src/cli/dev/tui/status-line.d.ts +13 -7
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +2 -0
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +5 -2
- package/dist/src/cli/dev/tui/terminal-renderer.js +6 -5
- package/dist/src/cli/dev/tui/theme.d.ts +3 -1
- package/dist/src/cli/dev/tui/theme.js +1 -1
- package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +6 -0
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/vercel-status.d.ts +4 -4
- package/dist/src/cli/dev/tui/vercel-status.js +1 -1
- package/dist/src/cli/run.d.ts +4 -3
- package/dist/src/cli/run.js +2 -2
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/session-utils.d.ts +1 -0
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.d.ts +1 -0
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +19 -0
- package/dist/src/compiled/.vendor-stamp.json +1 -2
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/manifest.d.ts +28 -7
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/evals/cli/eval-client.js +1 -1
- package/dist/src/execution/sandbox/bash-tool.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-base-setup.d.ts +9 -0
- package/dist/src/execution/sandbox/bindings/docker-base-setup.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +77 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-container.d.ts +16 -0
- package/dist/src/execution/sandbox/bindings/docker-container.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-network.d.ts +8 -0
- package/dist/src/execution/sandbox/bindings/docker-network.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-options.d.ts +21 -0
- package/dist/src/execution/sandbox/bindings/docker-options.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-session.d.ts +7 -0
- package/dist/src/execution/sandbox/bindings/docker-session.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-templates.d.ts +35 -0
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-utils.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/docker-utils.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker.d.ts +33 -0
- package/dist/src/execution/sandbox/bindings/docker.js +1 -0
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +30 -0
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -0
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +33 -0
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -0
- package/dist/src/execution/sandbox/bindings/local-backend-utils.d.ts +23 -0
- package/dist/src/execution/sandbox/bindings/local-backend-utils.js +1 -0
- package/dist/src/execution/sandbox/bindings/local-template-prune.d.ts +16 -0
- package/dist/src/execution/sandbox/bindings/local-template-prune.js +1 -0
- package/dist/src/execution/sandbox/bindings/local.d.ts +16 -25
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +16 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +21 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +18 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-network.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +34 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +22 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +178 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +3 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-process.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +75 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +13 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +22 -0
- package/dist/src/execution/sandbox/bindings/microsandbox.js +1 -0
- package/dist/src/execution/sandbox/bindings/vercel-create-api.d.ts +20 -0
- package/dist/src/execution/sandbox/bindings/vercel-create-api.js +1 -0
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +7 -8
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/development-cleanup.d.ts +4 -0
- package/dist/src/execution/sandbox/development-cleanup.js +1 -0
- package/dist/src/execution/sandbox/development-prewarm.d.ts +15 -0
- package/dist/src/execution/sandbox/development-prewarm.js +1 -0
- package/dist/src/execution/sandbox/development-run.d.ts +8 -0
- package/dist/src/execution/sandbox/development-run.js +1 -0
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/lazy-backend.d.ts +1 -1
- package/dist/src/execution/sandbox/logging-session.d.ts +5 -0
- package/dist/src/execution/sandbox/logging-session.js +1 -0
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/sandbox/template-prewarm-lock.d.ts +8 -0
- package/dist/src/execution/sandbox/template-prewarm-lock.js +1 -0
- package/dist/src/internal/application/optional-package-install.d.ts +40 -0
- package/dist/src/internal/application/optional-package-install.js +1 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/sandbox.d.ts +1 -1
- package/dist/src/internal/authored-definition/sandbox.js +1 -1
- package/dist/src/internal/authored-module-loader.js +2 -2
- package/dist/src/internal/classify-model-routing.d.ts +24 -0
- package/dist/src/internal/classify-model-routing.js +1 -0
- package/dist/src/internal/nitro/host/channel-routes.js +2 -2
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.d.ts +5 -2
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +10 -0
- 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-live-virtual-modules.d.ts +15 -0
- package/dist/src/internal/nitro/host/dev-live-virtual-modules.js +1 -0
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.d.ts +28 -0
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -0
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +2 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +4 -0
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
- package/dist/src/internal/resolve-model-endpoint-status.d.ts +23 -0
- package/dist/src/internal/resolve-model-endpoint-status.js +1 -0
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/public/definitions/sandbox-backend.js +1 -1
- package/dist/src/public/sandbox/backends/default.d.ts +37 -10
- package/dist/src/public/sandbox/backends/default.js +1 -1
- package/dist/src/public/sandbox/backends/docker.d.ts +14 -0
- package/dist/src/public/sandbox/backends/docker.js +1 -0
- package/dist/src/public/sandbox/backends/just-bash.d.ts +17 -0
- package/dist/src/public/sandbox/backends/just-bash.js +1 -0
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +17 -0
- package/dist/src/public/sandbox/backends/microsandbox.js +1 -0
- package/dist/src/public/sandbox/backends/vercel.d.ts +5 -2
- package/dist/src/public/sandbox/backends/vercel.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +45 -0
- package/dist/src/public/sandbox/index.d.ts +8 -4
- package/dist/src/public/sandbox/index.js +1 -1
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +17 -0
- package/dist/src/public/sandbox/just-bash-sandbox.js +1 -0
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +54 -0
- package/dist/src/public/sandbox/microsandbox-sandbox.js +1 -0
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +1 -1
- package/dist/src/runtime/compiled-artifacts-source.d.ts +11 -0
- package/dist/src/runtime/compiled-artifacts-source.js +1 -1
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/sandbox/registry.d.ts +2 -2
- package/dist/src/runtime/types.d.ts +1 -1
- package/dist/src/runtime/workspace/spec.js +1 -1
- package/dist/src/setup/boxes/add-channels.d.ts +3 -2
- package/dist/src/setup/boxes/add-channels.js +2 -2
- package/dist/src/setup/boxes/apply-ai-gateway-credential.js +1 -1
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/boxes/link-project.js +1 -1
- package/dist/src/setup/boxes/resolve-provisioning.d.ts +6 -0
- package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
- package/dist/src/setup/boxes/select-model.d.ts +2 -2
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/channel-setup-prompter.d.ts +28 -0
- package/dist/src/setup/cli/channel-setup-prompter.js +1 -1
- package/dist/src/setup/cli/index.d.ts +2 -2
- package/dist/src/setup/cli/index.js +1 -1
- package/dist/src/setup/cli/option-row.d.ts +89 -0
- package/dist/src/setup/cli/option-row.js +1 -0
- package/dist/src/setup/cli/prompt-ui.d.ts +15 -29
- package/dist/src/setup/cli/prompt-ui.js +2 -2
- package/dist/src/setup/cli/select-component.d.ts +4 -3
- package/dist/src/setup/cli/select-component.js +1 -1
- package/dist/src/setup/cli/select-state.d.ts +3 -3
- package/dist/src/setup/cli/select-state.js +1 -1
- package/dist/src/setup/flows/channels.d.ts +29 -14
- package/dist/src/setup/flows/channels.js +1 -1
- package/dist/src/setup/flows/deploy.d.ts +1 -0
- package/dist/src/setup/flows/deploy.js +1 -1
- package/dist/src/setup/flows/link.d.ts +1 -0
- package/dist/src/setup/flows/link.js +1 -1
- package/dist/src/setup/flows/model.d.ts +30 -6
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/vercel.d.ts +4 -1
- package/dist/src/setup/flows/vercel.js +2 -2
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/primitives/open-url.d.ts +14 -0
- package/dist/src/setup/primitives/open-url.js +1 -0
- package/dist/src/setup/primitives/pm/pnpm.d.ts +9 -0
- package/dist/src/setup/primitives/pm/pnpm.js +2 -2
- package/dist/src/setup/primitives/pm/run.d.ts +12 -4
- package/dist/src/setup/primitives/pm/run.js +1 -1
- package/dist/src/setup/primitives/pm/types.d.ts +3 -0
- package/dist/src/setup/primitives/process-abort.d.ts +7 -0
- package/dist/src/setup/primitives/process-abort.js +1 -0
- package/dist/src/setup/primitives/run-vercel.d.ts +2 -0
- package/dist/src/setup/primitives/run-vercel.js +1 -1
- package/dist/src/setup/project-resolution.d.ts +6 -3
- package/dist/src/setup/project-resolution.js +1 -1
- package/dist/src/setup/prompter.d.ts +63 -6
- package/dist/src/setup/prompter.js +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 +2 -0
- package/dist/src/setup/runner.js +1 -1
- package/dist/src/setup/scaffold/channels-catalog.d.ts +2 -0
- package/dist/src/setup/scaffold/channels-catalog.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +1 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.d.ts +2 -0
- package/dist/src/setup/scaffold/create/project.js +6 -3
- package/dist/src/setup/scaffold/update/channels.d.ts +2 -0
- package/dist/src/setup/scaffold/update/channels.js +3 -3
- package/dist/src/setup/slack-connect-lifecycle.d.ts +97 -0
- package/dist/src/setup/slack-connect-lifecycle.js +1 -0
- package/dist/src/setup/slack-connect.d.ts +51 -0
- package/dist/src/setup/slack-connect.js +1 -0
- package/dist/src/setup/slackbot.d.ts +60 -47
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/setup/state.d.ts +2 -1
- package/dist/src/setup/state.js +1 -1
- package/dist/src/setup/step.d.ts +4 -0
- package/dist/src/setup/validate-gateway-key.d.ts +30 -0
- package/dist/src/setup/validate-gateway-key.js +1 -0
- package/dist/src/setup/vercel-project.d.ts +19 -12
- package/dist/src/setup/vercel-project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +26 -0
- package/dist/src/shared/model-endpoint-status.d.ts +27 -0
- package/dist/src/shared/model-endpoint-status.js +1 -0
- package/dist/src/shared/sandbox-backend.d.ts +8 -2
- package/dist/src/shared/sandbox-definition.d.ts +4 -3
- package/dist/src/shared/sandbox-network-policy.d.ts +4 -2
- package/dist/src/shared/sandbox-session.d.ts +3 -2
- 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/{dist/docs/public → docs}/getting-started.mdx +14 -4
- package/{dist/docs/public → docs}/guides/deployment.md +3 -3
- package/{dist/docs/public → docs}/guides/dev-tui.md +2 -2
- package/{dist/docs/public → docs}/reference/cli.md +2 -1
- package/{dist/docs/public → docs}/sandbox.mdx +39 -15
- package/package.json +11 -1
- package/dist/src/compiled/just-bash/LICENSE +0 -201
- package/dist/src/compiled/just-bash/index.d.ts +0 -139
- package/dist/src/compiled/just-bash/index.js +0 -2200
- package/dist/src/compiled/just-bash/network/types.d.ts +0 -155
- package/dist/src/public/sandbox/backends/local.d.ts +0 -16
- package/dist/src/public/sandbox/backends/local.js +0 -1
- package/dist/src/public/sandbox/local-sandbox.d.ts +0 -7
- /package/dist/src/public/sandbox/{local-sandbox.js → docker-sandbox.js} +0 -0
- /package/{dist/docs/public → docs}/README.md +0 -0
- /package/{dist/docs/public → docs}/agent-config.md +0 -0
- /package/{dist/docs/public → docs}/channels/custom.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/discord.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/eve.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/github.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/linear.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/meta.json +0 -0
- /package/{dist/docs/public → docs}/channels/overview.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/slack.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/teams.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/telegram.mdx +0 -0
- /package/{dist/docs/public → docs}/channels/twilio.mdx +0 -0
- /package/{dist/docs/public → docs}/concepts/context-control.md +0 -0
- /package/{dist/docs/public → docs}/concepts/default-harness.md +0 -0
- /package/{dist/docs/public → docs}/concepts/execution-model-and-durability.md +0 -0
- /package/{dist/docs/public → docs}/concepts/meta.json +0 -0
- /package/{dist/docs/public → docs}/concepts/security-model.md +0 -0
- /package/{dist/docs/public → docs}/concepts/sessions-runs-and-streaming.md +0 -0
- /package/{dist/docs/public → docs}/connections.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/assertions.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/cases.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/judge.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/meta.json +0 -0
- /package/{dist/docs/public → docs}/evals/overview.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/reporters.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/running.mdx +0 -0
- /package/{dist/docs/public → docs}/evals/targets.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/auth-and-route-protection.md +0 -0
- /package/{dist/docs/public → docs}/guides/client/continuations.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/client/messages.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/client/meta.json +0 -0
- /package/{dist/docs/public → docs}/guides/client/output-schema.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/client/overview.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/client/streaming.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/dynamic-capabilities.md +0 -0
- /package/{dist/docs/public → docs}/guides/dynamic-workflows.md +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/meta.json +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/nextjs.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/nuxt.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/overview.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/sveltekit.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/use-eve-agent-svelte.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/frontend/use-eve-agent-vue.mdx +0 -0
- /package/{dist/docs/public → docs}/guides/hooks.md +0 -0
- /package/{dist/docs/public → docs}/guides/instrumentation.md +0 -0
- /package/{dist/docs/public → docs}/guides/meta.json +0 -0
- /package/{dist/docs/public → docs}/guides/remote-agents.md +0 -0
- /package/{dist/docs/public → docs}/guides/session-context.md +0 -0
- /package/{dist/docs/public → docs}/guides/state.md +0 -0
- /package/{dist/docs/public → docs}/instructions.mdx +0 -0
- /package/{dist/docs/public → docs}/introduction.md +0 -0
- /package/{dist/docs/public → docs}/meta.json +0 -0
- /package/{dist/docs/public → docs}/reference/meta.json +0 -0
- /package/{dist/docs/public → docs}/reference/project-layout.md +0 -0
- /package/{dist/docs/public → docs}/reference/typescript-api.md +0 -0
- /package/{dist/docs/public → docs}/schedules.mdx +0 -0
- /package/{dist/docs/public → docs}/skills.mdx +0 -0
- /package/{dist/docs/public → docs}/subagents.mdx +0 -0
- /package/{dist/docs/public → docs}/tools.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/connect-a-warehouse.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/first-agent.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/guard-the-spend.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/how-it-runs.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/meta.json +0 -0
- /package/{dist/docs/public → docs}/tutorial/query-sample-data.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/remember-definitions.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/run-analysis.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/ship-it.mdx +0 -0
- /package/{dist/docs/public → docs}/tutorial/team-playbooks.mdx +0 -0
|
@@ -1,35 +1,97 @@
|
|
|
1
|
+
import type { ChannelSetupChoice, ChannelSetupChoiceOptions } from "#setup/cli/index.js";
|
|
1
2
|
import type { SelectNotice } from "#setup/prompter.js";
|
|
2
3
|
import type { SetupPanelOption } from "./setup-panel.js";
|
|
4
|
+
export type SetupEditableSelectResult = {
|
|
5
|
+
kind: "selected";
|
|
6
|
+
value: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "edited";
|
|
9
|
+
value: string;
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
interface SetupSelectRequestBase {
|
|
13
|
+
message: string;
|
|
14
|
+
options: readonly SetupPanelOption[];
|
|
15
|
+
notices?: readonly SelectNotice[];
|
|
16
|
+
}
|
|
17
|
+
interface SetupSingleSelectRequest extends SetupSelectRequestBase {
|
|
18
|
+
kind: "single" | "stacked" | "task-list";
|
|
19
|
+
initialValue?: string;
|
|
20
|
+
}
|
|
21
|
+
interface SetupSearchSelectRequest extends SetupSelectRequestBase {
|
|
22
|
+
kind: "search";
|
|
23
|
+
initialValue?: string;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
}
|
|
26
|
+
interface SetupMultiSelectRequest extends SetupSelectRequestBase {
|
|
27
|
+
kind: "multi";
|
|
28
|
+
initialValues?: readonly string[];
|
|
29
|
+
required: boolean;
|
|
30
|
+
}
|
|
31
|
+
interface SetupSearchableMultiSelectRequest extends SetupSelectRequestBase {
|
|
32
|
+
kind: "searchable-multi";
|
|
33
|
+
initialValues?: readonly string[];
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A setup select's complete interaction grammar. The discriminant prevents
|
|
39
|
+
* callers from combining incompatible modes such as multi-select plus a
|
|
40
|
+
* single-select layout.
|
|
41
|
+
*/
|
|
42
|
+
export type SetupSelectRequest = SetupSingleSelectRequest | SetupSearchSelectRequest | SetupMultiSelectRequest | SetupSearchableMultiSelectRequest;
|
|
3
43
|
export interface SetupFlowRenderer {
|
|
4
44
|
begin(title: string): void;
|
|
5
45
|
end(options?: {
|
|
6
46
|
preserveDiagnostics?: boolean;
|
|
7
47
|
}): void;
|
|
8
|
-
readSelect(options:
|
|
48
|
+
readSelect(options: SetupSelectRequest): Promise<readonly string[] | undefined>;
|
|
49
|
+
readEditableSelect(options: {
|
|
9
50
|
message: string;
|
|
10
51
|
options: readonly SetupPanelOption[];
|
|
11
|
-
multiple: boolean;
|
|
12
|
-
search: boolean;
|
|
13
|
-
required: boolean;
|
|
14
52
|
initialValue?: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
53
|
+
editable: {
|
|
54
|
+
value: string;
|
|
55
|
+
defaultValue: string;
|
|
56
|
+
formatHint: (value: string) => string;
|
|
57
|
+
validate?: (value: string) => string | undefined;
|
|
58
|
+
};
|
|
59
|
+
}): Promise<SetupEditableSelectResult | undefined>;
|
|
20
60
|
readText(options: {
|
|
21
61
|
message: string;
|
|
22
62
|
placeholder?: string;
|
|
23
63
|
defaultValue?: string;
|
|
24
64
|
mask?: boolean;
|
|
25
65
|
validate?: (value: string) => string | undefined;
|
|
66
|
+
notices?: readonly SelectNotice[];
|
|
26
67
|
}): Promise<string | undefined>;
|
|
27
68
|
readAcknowledge(options: {
|
|
28
69
|
message: string;
|
|
29
70
|
lines: readonly string[];
|
|
30
71
|
}): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Presents an inert context row and a separate action menu beside the live
|
|
74
|
+
* flow spinner. Returns the choice plus a `close()` that dismisses the menu
|
|
75
|
+
* when a concurrent wait resolves first. Used by the Slack install wait for
|
|
76
|
+
* "Try again" / "Cancel": the poll keeps running while the prompt is up, and
|
|
77
|
+
* whichever settles first wins.
|
|
78
|
+
*/
|
|
79
|
+
readChoice(options: ChannelSetupChoiceOptions): ChannelSetupChoice;
|
|
31
80
|
setStatus(text: string | undefined): void;
|
|
32
81
|
renderLine(text: string, tone: "info" | "success" | "warning" | "error"): void;
|
|
33
82
|
renderOutput(text: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Arms a key trap for the flow's working state — the status spinner between
|
|
85
|
+
* questions, where no prompt is consuming keys. Ctrl-C or Esc resolves the
|
|
86
|
+
* promise so the command can abandon an in-flight flow (e.g. a parked
|
|
87
|
+
* `vercel connect create` browser OAuth). Open questions own their keys; the
|
|
88
|
+
* trap covers only the gaps. `dispose` releases the trap; the promise then
|
|
89
|
+
* never resolves.
|
|
90
|
+
*/
|
|
91
|
+
waitForInterrupt(): {
|
|
92
|
+
promise: Promise<void>;
|
|
93
|
+
dispose(): void;
|
|
94
|
+
};
|
|
34
95
|
}
|
|
35
|
-
export type SetupFlowPrompterRenderer = Pick<SetupFlowRenderer, "readSelect" | "readText" | "readAcknowledge" | "setStatus" | "renderLine" | "renderOutput">;
|
|
96
|
+
export type SetupFlowPrompterRenderer = Pick<SetupFlowRenderer, "readSelect" | "readEditableSelect" | "readText" | "readAcknowledge" | "readChoice" | "setStatus" | "renderLine" | "renderOutput">;
|
|
97
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join}from"node:path";import{pathExists}from"#setup/path-exists.js";const BOOT_DETECTIONS=[{id:`model-provider`,async detect({appRoot:n,env:r}){return r.AI_GATEWAY_API_KEY||r.VERCEL_OIDC_TOKEN?[]:await pathExists(join(n,`.vercel`,`project.json`))?[{label:`AI Gateway credentials missing`,command:`/model`}]:[{label:`model provider not linked`,command:`/model`}]}}];async function detectSetupIssues(e,t=BOOT_DETECTIONS){return(await Promise.all(t.map(async t=>{try{return await t.detect(e)}catch{return[]}}))).flat()}function formatSetupIssuesLine(e){let t=e.length===1?`setup issue`:`setup issues`,n=e.map(e=>`${e.label} · ${e.command}`).join(`, `);return`${e.length} ${t}: ${n}`}export{BOOT_DETECTIONS,detectSetupIssues,formatSetupIssuesLine};
|
|
1
|
+
import{join}from"node:path";import{pathExists}from"#setup/path-exists.js";const BOOT_DETECTIONS=[{id:`model-provider`,async detect({appRoot:n,env:r,info:i}){return i?.agent.model.routing?.kind===`external`||r.AI_GATEWAY_API_KEY||r.VERCEL_OIDC_TOKEN?[]:await pathExists(join(n,`.vercel`,`project.json`))?[{label:`AI Gateway credentials missing`,command:`/model`}]:[{label:`model provider not linked`,command:`/model`}]}}];async function detectSetupIssues(e,t=BOOT_DETECTIONS){return(await Promise.all(t.map(async t=>{try{return await t.detect(e)}catch{return[]}}))).flat()}function formatSetupIssuesLine(e){let t=e.length===1?`setup issue`:`setup issues`,n=e.map(e=>`${e.label} · ${e.command}`).join(`, `);return`${e.length} ${t}: ${n}`}export{BOOT_DETECTIONS,detectSetupIssues,formatSetupIssuesLine};
|
|
@@ -9,38 +9,79 @@
|
|
|
9
9
|
* assert on strings.
|
|
10
10
|
*
|
|
11
11
|
* Column grammar: the panel adds a one-space left margin to every row under
|
|
12
|
-
* the rule,
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* {@link renderFlowPanel}, so every question variant lines up by
|
|
16
|
-
* construction.
|
|
12
|
+
* the rule, while each section contributes two more spaces. Titles, spinners,
|
|
13
|
+
* notices, filter prompts, and option-state glyphs therefore all begin at
|
|
14
|
+
* column 3.
|
|
17
15
|
*/
|
|
18
|
-
import type { PromptOption } from "#setup/cli/index.js";
|
|
16
|
+
import type { ChannelSetupAction, PromptOption } from "#setup/cli/index.js";
|
|
19
17
|
import { type SelectState } from "#setup/cli/select-state.js";
|
|
20
18
|
import type { SelectNotice } from "#setup/prompter.js";
|
|
21
19
|
import { type LineState } from "./line-editor.js";
|
|
22
20
|
import type { Theme } from "./theme.js";
|
|
23
21
|
/** One row of a setup select panel; the shared prompt-option shape. */
|
|
24
22
|
export type SetupPanelOption = PromptOption<string>;
|
|
25
|
-
|
|
23
|
+
interface SetupQuestionPanelBase {
|
|
26
24
|
message: string;
|
|
27
|
-
options: readonly SetupPanelOption[];
|
|
28
|
-
multiple: boolean;
|
|
29
|
-
search: boolean;
|
|
30
|
-
placeholder?: string;
|
|
31
|
-
select: SelectState;
|
|
32
25
|
error?: string;
|
|
33
|
-
/** "stacked" puts each hint on its own line with blank rows between options. */
|
|
34
|
-
layout?: "stacked";
|
|
35
26
|
/** Outcome lines from earlier menu laps, shown beneath the options. */
|
|
36
27
|
notices?: readonly SelectNotice[];
|
|
37
28
|
}
|
|
29
|
+
interface SetupSelectPanelBase extends SetupQuestionPanelBase {
|
|
30
|
+
options: readonly SetupPanelOption[];
|
|
31
|
+
select: SelectState;
|
|
32
|
+
}
|
|
33
|
+
interface SetupEditableRow {
|
|
34
|
+
/**
|
|
35
|
+
* The row whose hint is a live rename field. Hovering it (cursor on the row)
|
|
36
|
+
* makes it editable directly — typing and backspace edit the name in place —
|
|
37
|
+
* so the editor's text and a blinking caret render only on that row.
|
|
38
|
+
*/
|
|
39
|
+
optionValue: string;
|
|
40
|
+
editor: LineState;
|
|
41
|
+
defaultValue: string;
|
|
42
|
+
formatHint: (value: string) => string;
|
|
43
|
+
caretVisible: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Select presentation variants. The discriminant owns the interaction grammar
|
|
47
|
+
* so feature combinations are deliberate rather than resolved by conditional
|
|
48
|
+
* precedence inside the renderer.
|
|
49
|
+
*/
|
|
50
|
+
type SetupOptionSelectPanelState = (SetupSelectPanelBase & {
|
|
51
|
+
kind: "single";
|
|
52
|
+
}) | (SetupSelectPanelBase & {
|
|
53
|
+
kind: "search";
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
}) | (SetupSelectPanelBase & {
|
|
56
|
+
kind: "multi";
|
|
57
|
+
}) | (SetupSelectPanelBase & {
|
|
58
|
+
kind: "searchable-multi";
|
|
59
|
+
placeholder?: string;
|
|
60
|
+
}) | (SetupSelectPanelBase & {
|
|
61
|
+
kind: "stacked";
|
|
62
|
+
}) | (SetupSelectPanelBase & {
|
|
63
|
+
kind: "task-list";
|
|
64
|
+
}) | (SetupSelectPanelBase & {
|
|
65
|
+
kind: "editable";
|
|
66
|
+
edit: SetupEditableRow;
|
|
67
|
+
});
|
|
68
|
+
interface SetupActionsPanelState {
|
|
69
|
+
kind: "actions";
|
|
70
|
+
/** Inert explanation rendered above, and separately from, the action group. */
|
|
71
|
+
context: string;
|
|
72
|
+
actions: readonly ChannelSetupAction[];
|
|
73
|
+
/** No action is focused until the user moves into the action group. */
|
|
74
|
+
cursor: number | undefined;
|
|
75
|
+
}
|
|
76
|
+
export type SetupSelectPanelState = SetupOptionSelectPanelState | SetupActionsPanelState;
|
|
38
77
|
export interface SetupTextPanelState {
|
|
39
78
|
message: string;
|
|
40
79
|
editor: LineState;
|
|
41
80
|
placeholder?: string;
|
|
42
81
|
mask: boolean;
|
|
43
82
|
error?: string;
|
|
83
|
+
/** Context lines shown above the message; gone once the question settles. */
|
|
84
|
+
notices?: readonly SelectNotice[];
|
|
44
85
|
}
|
|
45
86
|
export interface SetupAcknowledgePanelState {
|
|
46
87
|
message: string;
|
|
@@ -50,27 +91,43 @@ export interface SetupAcknowledgePanelState {
|
|
|
50
91
|
export interface FlowPanelLine {
|
|
51
92
|
text: string;
|
|
52
93
|
tone: "info" | "success" | "warning" | "error";
|
|
94
|
+
/**
|
|
95
|
+
* Subprocess output a warning/error settle pulled in as its evidence.
|
|
96
|
+
* Renders like any info line in the panel, but survives the panel close
|
|
97
|
+
* alongside the diagnostic it explains (a plain info line does not).
|
|
98
|
+
*/
|
|
99
|
+
evidence?: boolean;
|
|
53
100
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
lines: readonly FlowPanelLine[];
|
|
59
|
-
/** Ephemeral status shown when no question is active. */
|
|
101
|
+
export type FlowPanelContent = {
|
|
102
|
+
kind: "question";
|
|
103
|
+
rows: readonly string[];
|
|
104
|
+
/** The install wait keeps its spinner above the concurrent actions. */
|
|
60
105
|
status?: {
|
|
61
106
|
text: string;
|
|
62
107
|
frame: string;
|
|
63
108
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
109
|
+
} | {
|
|
110
|
+
kind: "status";
|
|
111
|
+
status: {
|
|
112
|
+
text: string;
|
|
113
|
+
frame: string;
|
|
114
|
+
};
|
|
115
|
+
/** Latest child-process output shown transiently beneath the status. */
|
|
69
116
|
preview?: string;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
117
|
+
} | {
|
|
118
|
+
kind: "preview";
|
|
119
|
+
text: string;
|
|
120
|
+
frame: string;
|
|
121
|
+
} | {
|
|
122
|
+
kind: "idle";
|
|
123
|
+
frame: string;
|
|
124
|
+
};
|
|
125
|
+
/** The whole bordered section: title, recent progress, and one explicit mode. */
|
|
126
|
+
export interface FlowPanelState {
|
|
127
|
+
/** The invoked command, e.g. "/deploy". Empty renders no title row. */
|
|
128
|
+
title: string;
|
|
129
|
+
lines: readonly FlowPanelLine[];
|
|
130
|
+
content: FlowPanelContent;
|
|
74
131
|
}
|
|
75
132
|
/**
|
|
76
133
|
* Paints the bordered flow panel. Everything a running command produces lives
|
|
@@ -80,18 +137,12 @@ export interface FlowPanelState {
|
|
|
80
137
|
*/
|
|
81
138
|
export declare function renderFlowPanel(state: FlowPanelState, theme: Theme, width: number): string[];
|
|
82
139
|
/**
|
|
83
|
-
* Paints a
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
140
|
+
* Paints a selection section for the flow panel. Ordinary selects use the
|
|
141
|
+
* shared option reducer; concurrent actions render an explicit context row and
|
|
142
|
+
* independent action group. A searchable select windows the option list around
|
|
143
|
+
* the cursor and advertises the rest with a count footer.
|
|
87
144
|
*/
|
|
88
145
|
export declare function renderSelectQuestion(state: SetupSelectPanelState, theme: Theme, width: number): string[];
|
|
89
|
-
/** True when a select question numbers its rows (and accepts digit jumps). */
|
|
90
|
-
export declare function numbersSelectRows(state: {
|
|
91
|
-
multiple: boolean;
|
|
92
|
-
search: boolean;
|
|
93
|
-
options: readonly SetupPanelOption[];
|
|
94
|
-
}): boolean;
|
|
95
146
|
/** Paints a text question section: message, a caret-bearing input line, hints. */
|
|
96
147
|
export declare function renderTextQuestion(state: SetupTextPanelState, theme: Theme, width: number, caretVisible: boolean): string[];
|
|
97
148
|
/**
|
|
@@ -101,3 +152,4 @@ export declare function renderTextQuestion(state: SetupTextPanelState, theme: Th
|
|
|
101
152
|
* footer advertises only enter.
|
|
102
153
|
*/
|
|
103
154
|
export declare function renderAcknowledgeQuestion(state: SetupAcknowledgePanelState, theme: Theme, width: number): string[];
|
|
155
|
+
export {};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import{sliceVisible,visibleLength}from"./terminal-text.js";import{visibleLine}from"./line-editor.js";import{filterOptions,submitRowIndex}from"#setup/cli/select-state.js";function clip(n,r){
|
|
1
|
+
import{sliceVisible,visibleLength,wrapVisibleLine}from"./terminal-text.js";import{visibleLine}from"./line-editor.js";import{renderOptionRow,resolveOptionRowState}from"#setup/cli/option-row.js";import{filterOptions,submitRowIndex}from"#setup/cli/select-state.js";function clip(n,r){if(visibleLength(n)<=r)return n;let i=sliceVisible(n,r);return i.includes(`\x1B[`)?`${i}\x1b[0m`:i}function questionFooter(e,t){let n=t.colors;return[``,` ${n.dim(n.italic(e.join(` ${t.glyph.dot} `)))}`]}const BOLD_OR_DIM_CLOSE=`\x1B[22m`;function dimWithEmphasis(e,t){return t.colors.dim(e.replaceAll(BOLD_OR_DIM_CLOSE,`${BOLD_OR_DIM_CLOSE}[2m`))}function toneGlyph(e,t){let n=t.colors;switch(e){case`success`:return n.green(t.glyph.success);case`warning`:return n.yellow(t.glyph.warning);case`error`:return n.red(t.glyph.error);case`info`:return n.dim(t.glyph.dot)}}function renderFlowPanel(e,t,n){let r=t.colors,i=[r.dim(t.glyph.hrule.repeat(Math.max(1,n)))];e.title.length>0&&i.push(` ${r.bold(e.title)}`),i.push(``);let a=e.lines.slice(-6);for(let e of a){let n=e.tone===`info`?r.dim(e.text):e.text;i.push(` ${toneGlyph(e.tone,t)} ${n}`)}switch(a.length>0&&i.push(``),e.content.kind){case`question`:e.content.status!==void 0&&i.push(` ${r.yellow(e.content.status.frame)} ${r.dim(e.content.status.text)}`,``),i.push(...e.content.rows);break;case`status`:i.push(` ${r.yellow(e.content.status.frame)} ${r.dim(e.content.status.text)}`),e.content.preview!==void 0&&i.push(` ${r.dim(e.content.preview)}`);break;case`preview`:i.push(` ${r.yellow(e.content.frame)} ${r.dim(e.content.text)}`);break;case`idle`:i.push(` ${r.yellow(e.content.frame)} ${r.dim(`Working…`)}`);break}return i.map((e,t)=>t===0||e.length===0?clip(e,n):clip(` ${e}`,n))}function optionRow(e){let{option:t,theme:n}=e;return renderOptionRow({colors:n.colors,glyphs:{pointer:n.glyph.pointer,success:n.glyph.success,placeholder:n.glyph.option,dot:n.glyph.dot},label:t.label,hint:t.hint,focusHint:t.focusHint,accent:t.accent,isCursor:e.isCursor,state:resolveOptionRowState(t,e.isChecked),placeholder:e.placeholder,hintPadding:e.hintPadding})}function selectPresentation(e){switch(e.kind){case`single`:return{selection:`single`,filter:void 0,layout:`plain`,edit:void 0};case`search`:return{selection:`single`,filter:{placeholder:e.placeholder},layout:`plain`,edit:void 0};case`multi`:return{selection:`multiple`,filter:void 0,layout:`plain`,edit:void 0};case`searchable-multi`:return{selection:`multiple`,filter:{placeholder:e.placeholder},layout:`plain`,edit:void 0};case`stacked`:return{selection:`single`,filter:void 0,layout:`stacked`,edit:void 0};case`task-list`:return{selection:`single`,filter:void 0,layout:`task-list`,edit:void 0};case`editable`:return{selection:`single`,filter:void 0,layout:`task-list`,edit:e.edit}}}function selectMessageRows(e,t,n){if(e===``)return[];let r=e.split(`
|
|
2
|
+
`).map((e,r)=>` ${t===`stacked`||r>0?n.colors.bold(e):e}`);return r.push(``),r}function searchFilter(e,t,n){return e.length>0?e+n.colors.dim(n.glyph.caret):t===void 0?n.colors.dim(n.glyph.caret):n.colors.dim(`> ${t}`)}function selectViewSize(e){return e.search?e.filter===``&&e.featuredLead>0?Math.min(e.featuredLead,8):8:e.optionCount}function noticeBody(e,t,n){return e.tone===`info`?n.colors.dim(e.text):e.tone===`success`&&t===`task-list`?n.colors.bold(e.text):e.text}function editableOption(e,t,n,r){if(!t||n?.optionValue!==e.value)return e;let i=n.editor.text||n.defaultValue,a=n.editor.text.length===0?i.length:n.editor.cursor,o=n.caretVisible?r.colors.cyan(r.glyph.caret):``,s=`${i.slice(0,a)}${o}${i.slice(a)}`;return{...e,hint:n.formatHint(s)}}function optionWithoutStackedHint(e,t){if(t!==`stacked`||e.hint===void 0)return{option:e,stackedHint:void 0};let{hint:n,...r}=e;return{option:r,stackedHint:n}}function optionUsesPlaceholder(e,t,n){let r=e.filter!==void 0,i=e.layout===`task-list`&&t===n-1,a=e.selection===`multiple`,o=e.layout!==`plain`;return!r&&!i&&(a||o)}function appendSelectOptionRows(e){let{rows:t,state:n,presentation:r,visible:i,start:a,end:o,cursor:s,visibleLabelWidth:c,theme:l}=e,u=l.colors;for(let e=a;e<o;e+=1){let d=i[e],f=e===s;r.layout===`task-list`&&e===o-1&&e>a&&t.push(``);let{option:p,stackedHint:m}=optionWithoutStackedHint(editableOption(d,f,r.edit,l),r.layout);t.push(` ${optionRow({option:p,isCursor:f,isChecked:r.selection===`multiple`&&n.select.selected.has(d.value),placeholder:optionUsesPlaceholder(r,e,i.length),hintPadding:c-d.label.length,theme:l})}`),m!==void 0&&t.push(`${` `.repeat(4)}${dimWithEmphasis(m,l)}`),d.description!==void 0&&(d.disabled===!0||f)&&t.push(` ${u.dim(d.description)}`),r.layout===`stacked`&&e<o-1&&t.push(``)}}function appendSubmitRow(e,t,n,r){if(n<0)return;let i=t===n,a=i?r.colors.cyan(r.glyph.pointer):` `,o=i?r.colors.cyan(r.colors.bold(`Submit`)):`Submit`;e.push(``,` ${a} ${o}`)}function appendSelectNotices(e,r,i,a,o){if(!(r===void 0||r.length===0)){e.push(``);for(let s of r){let r=toneGlyph(s.tone,a),c=` `.repeat(visibleLength(r)+1),l=Math.max(1,o-2-visibleLength(r)-1),u=wrapVisibleLine(s.text,l);for(let[t,n]of u.entries()){let o=noticeBody({...s,text:n},i,a);e.push(t===0?` ${r} ${o}`:` ${c}${o}`)}}}}function selectFooterHints(e,t,n){let r=[];return e.edit!==void 0&&t[n]?.value===e.edit.optionValue&&r.push(`type to rename`),e.filter!==void 0&&r.push(`type to filter`),r.push(`↑/↓ move`),r.push(e.selection===`multiple`?`space to toggle`:`enter to select`),e.selection===`multiple`&&r.push(`enter on Submit to confirm`),r.push(`esc to cancel`),r}function renderActionQuestion(e,t,n){let r=[` ${t.colors.dim(`${t.glyph.dot} ${e.context}`)}`,``];for(let[n,i]of e.actions.entries())r.push(` ${optionRow({option:i,isCursor:n===e.cursor,isChecked:!1,placeholder:!0,hintPadding:0,theme:t})}`);return r.push(...questionFooter([`↑/↓ move`,`enter to select`,`esc to cancel`],t)),r.map(e=>clip(e,n))}function renderSelectQuestion(e,t,n){if(e.kind===`actions`)return renderActionQuestion(e,t,n);let r=t.colors,i=selectPresentation(e),a=i.filter?filterOptions(e.options,e.select.filter):e.options,c=i.selection===`multiple`?submitRowIndex(a):-1,l=e.select.cursor,u=selectMessageRows(e.message,i.layout,t);i.filter!==void 0&&u.push(` ${searchFilter(e.select.filter,i.filter.placeholder,t)}`);let d=0;for(;a[d]?.featured;)d+=1;let f=selectViewSize({search:i.filter!==void 0,filter:e.select.filter,featuredLead:d,optionCount:a.length}),p=Math.max(0,Math.min(l-Math.floor(f/2),Math.max(0,a.length-f))),m=Math.min(p+f,a.length),h=a.slice(p,m).filter(e=>e.hint!==void 0||e.focusHint!==void 0).reduce((e,t)=>Math.max(e,t.label.length),0);return a.length===0&&u.push(` ${r.dim(`(no matches)`)}`),appendSelectOptionRows({rows:u,state:e,presentation:i,visible:a,start:p,end:m,cursor:l,visibleLabelWidth:h,theme:t}),appendSubmitRow(u,l,c,t),a.length>m-p&&u.push(` ${r.dim(`↑↓ ${a.length} options, showing ${p+1}–${m}`)}`),appendSelectNotices(u,e.notices,i.layout,t,n),e.error!==void 0&&u.push(``,` ${r.red(e.error)}`),u.push(...questionFooter(selectFooterHints(i,a,l),t)),u.map(e=>clip(e,n))}function renderTextQuestion(e,t,n,i){let a=t.colors,o=[];for(let n of e.notices??[]){let e=n.tone===`info`?a.dim(n.text):n.text;o.push(`${toneGlyph(n.tone,t)} ${e}`)}o.push(...e.message.split(`
|
|
3
|
+
`).map(e=>` ${a.bold(e)}`));let s=Math.max(4,n-4),{before:c,after:l}=visibleLine(e.mask?{text:`•`.repeat(e.editor.text.length),cursor:e.editor.cursor}:{text:e.editor.text,cursor:e.editor.cursor},s,t.glyph.ellipsis),u=i?a.cyan(t.glyph.caret):` `,d=e.editor.text.length===0&&e.placeholder!==void 0?`${u}${a.dim(e.placeholder)}`:`${c}${u}${l}`;return o.push(` ${d}`),e.error!==void 0&&o.push(``,` ${a.red(e.error)}`),o.push(...questionFooter([`enter to submit`,`esc to cancel`],t)),o.map(e=>clip(e,n))}function renderAcknowledgeQuestion(e,t,n){let r=t.colors,i=[` ${r.bold(e.message)}`];if(e.lines.length>0){i.push(``);for(let t of e.lines)i.push(` ${r.dim(t)}`)}return i.push(...questionFooter([`enter to continue`],t)),i.map(e=>clip(e,n))}export{renderAcknowledgeQuestion,renderFlowPanel,renderSelectQuestion,renderTextQuestion};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PromptOption } from "#setup/cli/index.js";
|
|
2
|
+
import { type SelectState } from "#setup/cli/select-state.js";
|
|
3
|
+
import type { TerminalKey } from "./stream-format.js";
|
|
4
|
+
/** Shared navigation grammar for setup selects, actions, and editable selects. */
|
|
5
|
+
export type SetupSelectionIntent = {
|
|
6
|
+
kind: "cancel";
|
|
7
|
+
} | {
|
|
8
|
+
kind: "move";
|
|
9
|
+
direction: "up" | "down";
|
|
10
|
+
} | {
|
|
11
|
+
kind: "repaint";
|
|
12
|
+
} | {
|
|
13
|
+
kind: "submit";
|
|
14
|
+
};
|
|
15
|
+
/** Maps terminal keys to the intents every setup selection surface shares. */
|
|
16
|
+
export declare function setupSelectionIntent(key: TerminalKey): SetupSelectionIntent | undefined;
|
|
17
|
+
export type SetupSelectInputResult = {
|
|
18
|
+
kind: "cancel";
|
|
19
|
+
} | {
|
|
20
|
+
kind: "repaint";
|
|
21
|
+
} | {
|
|
22
|
+
kind: "update";
|
|
23
|
+
select: SelectState;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "submit";
|
|
26
|
+
values: readonly string[];
|
|
27
|
+
} | {
|
|
28
|
+
kind: "error";
|
|
29
|
+
message: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "ignore";
|
|
32
|
+
};
|
|
33
|
+
interface SetupSelectInput {
|
|
34
|
+
key: TerminalKey;
|
|
35
|
+
options: readonly PromptOption<string>[];
|
|
36
|
+
select: SelectState;
|
|
37
|
+
}
|
|
38
|
+
type SetupSingleSelectInput = SetupSelectInput & {
|
|
39
|
+
kind: "single" | "stacked" | "task-list" | "search";
|
|
40
|
+
};
|
|
41
|
+
type SetupMultiSelectInput = SetupSelectInput & {
|
|
42
|
+
kind: "multi" | "searchable-multi";
|
|
43
|
+
required: boolean;
|
|
44
|
+
};
|
|
45
|
+
type SetupSelectInputState = SetupSingleSelectInput | SetupMultiSelectInput;
|
|
46
|
+
/** Pure key transition for a setup select; rendering and lifecycle stay outside. */
|
|
47
|
+
export declare function reduceSetupSelectInput(input: SetupSelectInputState): SetupSelectInputResult;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{filterOptions,orderedSelection,reduceSelect,selectValueAtCursor,submitRowIndex}from"#setup/cli/select-state.js";function setupSelectionIntent(e){switch(e.type){case`ctrl-c`:case`escape`:return{kind:`cancel`};case`up`:return{kind:`move`,direction:`up`};case`down`:return{kind:`move`,direction:`down`};case`ctrl-r`:return{kind:`repaint`};case`enter`:return{kind:`submit`};default:return}}function isMultiSelect(e){return e.kind===`multi`||e.kind===`searchable-multi`}function isSearchableSelect(e){return e.kind===`search`||e.kind===`searchable-multi`}function updatedSelect(e,t){return{kind:`update`,select:reduceSelect(e.select,t,{options:e.options,submitRow:isMultiSelect(e)})}}function submitSetupSelect(n){let a=isSearchableSelect(n)?filterOptions(n.options,n.select.filter):[...n.options];if(isMultiSelect(n))return n.select.cursor===submitRowIndex(a)?n.required&&n.select.selected.size===0?{kind:`error`,message:`Select at least one option, then submit.`}:{kind:`submit`,values:orderedSelection(n.options,n.select.selected)}:updatedSelect(n,{type:`toggle`});let o=selectValueAtCursor(a,n.select.cursor);return o===void 0?a[n.select.cursor]?.completed?{kind:`ignore`}:{kind:`error`,message:`Type to match an option, then press enter.`}:{kind:`submit`,values:[o]}}function editSetupSelect(e){switch(e.key.type){case`backspace`:return isSearchableSelect(e)?updatedSelect(e,{type:`backspace`}):{kind:`ignore`};case`character`:{if(isMultiSelect(e)&&e.key.value===` `)return updatedSelect(e,{type:`toggle`});if(!isSearchableSelect(e))return{kind:`ignore`};let t=e.select,r={options:e.options,submitRow:isMultiSelect(e)};for(let i of e.key.value)i>=` `&&i!==``&&(t=reduceSelect(t,{type:`char`,char:i},r));return{kind:`update`,select:t}}default:return{kind:`ignore`}}}function reduceSetupSelectInput(e){let t=setupSelectionIntent(e.key);switch(t?.kind){case`cancel`:return{kind:`cancel`};case`repaint`:return{kind:`repaint`};case`move`:return updatedSelect(e,{type:t.direction});case`submit`:return submitSetupSelect(e);case void 0:return editSetupSelect(e)}}export{reduceSetupSelectInput,setupSelectionIntent};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Theme } from "./theme.js";
|
|
2
2
|
import type { VercelStatusSnapshot } from "./vercel-status.js";
|
|
3
|
+
import type { ModelEndpointStatus } from "#shared/model-endpoint-status.js";
|
|
3
4
|
export interface StatusLineInput {
|
|
4
5
|
/** Resolved model slug, e.g. "anthropic/claude-sonnet-4-6"; absent when `/eve/v1/info` failed. */
|
|
5
6
|
model?: string;
|
|
6
7
|
/** Preformatted token-flow segment (formatTokenFlow output), e.g. `⁕ ↑ 394.4K ↓ 4.3K`. */
|
|
7
8
|
tokens?: string;
|
|
9
|
+
/** Model endpoint readiness: external, or AI Gateway connected/not-connected. */
|
|
10
|
+
endpoint?: ModelEndpointStatus;
|
|
8
11
|
/** Workspace-scoped Vercel state; identity absent while unlinked or still resolving. */
|
|
9
12
|
vercel?: VercelStatusSnapshot;
|
|
10
13
|
theme: Theme;
|
|
@@ -13,13 +16,16 @@ export interface StatusLineInput {
|
|
|
13
16
|
/**
|
|
14
17
|
* Builds the dev TUI's persistent one-row status line:
|
|
15
18
|
*
|
|
16
|
-
* `model · tokens ·
|
|
19
|
+
* `model · tokens · AI Gateway (project) · /deploy pending`
|
|
17
20
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* The model-endpoint segment folds in the linked project name when connected
|
|
22
|
+
* (`AI Gateway (project)`), drops to a bare `AI Gateway` when connected without
|
|
23
|
+
* a linked project, and goes yellow with a `⚠` when the gateway has no usable
|
|
24
|
+
* credential. Everything else renders dim except the yellow action signals (a
|
|
25
|
+
* pending deploy, the not-connected gateway). On narrow widths segments degrade
|
|
26
|
+
* in order, the endpoint first and then the model, keeping tokens and the
|
|
27
|
+
* pending-deploy marker longest. Both stay recoverable from the agent header in
|
|
28
|
+
* scrollback. Returns undefined when no segment has content so callers skip the
|
|
29
|
+
* row.
|
|
24
30
|
*/
|
|
25
31
|
export declare function buildStatusLine(input: StatusLineInput): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sliceVisible,visibleLength}from"./terminal-text.js";function buildStatusLine(t){let{theme:n,width:r}=t,i=n.colors,a=t.model===void 0?void 0:i.dim(t.model),o=t.tokens===void 0?void 0:i.dim(t.tokens),s=t.vercel?.pendingDeploy?i.yellow(
|
|
1
|
+
import{sliceVisible,visibleLength}from"./terminal-text.js";function buildStatusLine(t){let{theme:n,width:r}=t,i=n.colors,a=t.model===void 0?void 0:i.dim(t.model),o=t.tokens===void 0?void 0:i.dim(t.tokens),s=t.vercel?.pendingDeploy?i.yellow(`/deploy pending`):void 0,c=t.vercel?.identity?.projectName,l=t.endpoint===void 0?void 0:t.endpoint.kind===`external`?i.dim(`External endpoint`):t.endpoint.connected?i.dim(c===void 0?`AI Gateway`:`AI Gateway (${c})`):i.yellow(`${n.glyph.warning} AI Gateway`),u=` ${i.dim(n.glyph.dot)} `,compose=e=>e.filter(e=>e!==void 0).join(u),d=[compose([a,o,l,s]),compose([a,o,s]),compose([o,s])];if(d[0].length!==0){for(let e of d)if(e.length>0&&visibleLength(e)<=r)return e;return sliceVisible(d.findLast(e=>e.length>0),r)}}export{buildStatusLine};
|
|
@@ -57,6 +57,8 @@ export interface KeyToken {
|
|
|
57
57
|
/** The buffer ends mid-sequence; wait for more bytes before decoding. */
|
|
58
58
|
incomplete?: boolean;
|
|
59
59
|
}
|
|
60
|
+
/** Removes C0 control characters and DEL from text intended for the prompt. */
|
|
61
|
+
export declare function stripPromptControlCharacters(text: string): string;
|
|
60
62
|
/**
|
|
61
63
|
* Decodes the next key from a raw input buffer, returning how many characters
|
|
62
64
|
* it consumed so a caller can reassemble escape sequences that arrive split
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const CSI_FINAL=/[\u0040-\u007e]/u;function nextKey(t){let n=t[0];if(n===void 0)return{consumed:0,incomplete:!0};if(n===`\x1B`){if(t.length===1)return{consumed:0,incomplete:!0};let n=t[1];if(n===`O`)return t.length<3?{consumed:0,incomplete:!0}:{key:parseKey(Buffer.from(t.slice(0,3))),consumed:3};if(n===`[`){for(let n=2;n<t.length;n+=1)if(CSI_FINAL.test(t[n]))return{key:parseKey(Buffer.from(t.slice(0,n+1))),consumed:n+1};return{consumed:0,incomplete:!0}}return{key:{type:`escape`},consumed:1}}if(n<` `||n===``)return{key:parseKey(Buffer.from(n)),consumed:1};let r=1;for(;r<t.length;){let e=t[r];if(e===`\x1B`||e<` `||e===``)break;r+=1}return{key:parseKey(Buffer.from(t.slice(0,r))),consumed:r}}function parseKey(e){let t=e.toString(`utf8`);switch(t){case``:return{type:`ctrl-a`};case``:return{type:`ctrl-e`};case``:return{type:`ctrl-d`};case`\v`:return{type:`ctrl-k`};case`\f`:return{type:`ctrl-l`};case``:return{type:`ctrl-r`};case``:return{type:`ctrl-u`};case``:return{type:`ctrl-w`};case``:return{type:`ctrl-c`};case`\r`:case`
|
|
2
|
-
`:return{type:`enter`};case``:case`\b`:return{type:`backspace`};case`\x1B[A`:case`\x1BOA`:return{type:`up`};case`\x1B[B`:case`\x1BOB`:return{type:`down`};case`\x1B[C`:case`\x1BOC`:return{type:`right`};case`\x1B[D`:case`\x1BOD`:return{type:`left`};case`\x1B[H`:case`\x1BOH`:case`\x1B[1~`:return{type:`home`};case`\x1B[F`:case`\x1BOF`:case`\x1B[4~`:return{type:`end`};case`\x1B[3~`:return{type:`delete`};case` `:return{type:`tab`};case`\x1B`:return{type:`escape`};default:{let e
|
|
1
|
+
const CSI_FINAL=/[\u0040-\u007e]/u;function stripPromptControlCharacters(e){let t=``;for(let n of e)n>=` `&&n!==``&&(t+=n);return t}function nextKey(t){let n=t[0];if(n===void 0)return{consumed:0,incomplete:!0};if(n===`\x1B`){if(t.length===1)return{consumed:0,incomplete:!0};let n=t[1];if(n===`O`)return t.length<3?{consumed:0,incomplete:!0}:{key:parseKey(Buffer.from(t.slice(0,3))),consumed:3};if(n===`[`){for(let n=2;n<t.length;n+=1)if(CSI_FINAL.test(t[n]))return{key:parseKey(Buffer.from(t.slice(0,n+1))),consumed:n+1};return{consumed:0,incomplete:!0}}return{key:{type:`escape`},consumed:1}}if(n<` `||n===``)return{key:parseKey(Buffer.from(n)),consumed:1};let r=1;for(;r<t.length;){let e=t[r];if(e===`\x1B`||e<` `||e===``)break;r+=1}return{key:parseKey(Buffer.from(t.slice(0,r))),consumed:r}}function parseKey(e){let t=e.toString(`utf8`);switch(t){case``:return{type:`ctrl-a`};case``:return{type:`ctrl-e`};case``:return{type:`ctrl-d`};case`\v`:return{type:`ctrl-k`};case`\f`:return{type:`ctrl-l`};case``:return{type:`ctrl-r`};case``:return{type:`ctrl-u`};case``:return{type:`ctrl-w`};case``:return{type:`ctrl-c`};case`\r`:case`
|
|
2
|
+
`:return{type:`enter`};case``:case`\b`:return{type:`backspace`};case`\x1B[A`:case`\x1BOA`:return{type:`up`};case`\x1B[B`:case`\x1BOB`:return{type:`down`};case`\x1B[C`:case`\x1BOC`:return{type:`right`};case`\x1B[D`:case`\x1BOD`:return{type:`left`};case`\x1B[H`:case`\x1BOH`:case`\x1B[1~`:return{type:`home`};case`\x1B[F`:case`\x1BOF`:case`\x1B[4~`:return{type:`end`};case`\x1B[3~`:return{type:`delete`};case` `:return{type:`tab`};case`\x1B`:return{type:`escape`};default:{let e=stripPromptControlCharacters(t);return e.length>0?{type:`character`,value:e}:{type:`ignore`}}}}async function*takeUntil(e,t){let n=e[Symbol.asyncIterator](),r=t.then(()=>({done:!0,value:void 0}));try{for(;;){let e=n.next();e.catch(()=>{});let t=await Promise.race([e,r]);if(t.done)break;yield t.value}}finally{n.return?.()?.catch(()=>{})}}function formatCompactTokenCount(e){if(e<1e3)return`${e}`;let t=e<1e6?e/1e3:e/1e6,n=e<1e6?`K`:`M`;return`${t.toFixed(1).replace(/\.0$/,``)}${n}`}function formatTokenFlow(e,t){let n=formatCompactTokenCount(e.inputTokens),r=formatCompactTokenCount(e.outputTokens),i=`${t.tokens} ${t.arrowUp} ${n} ${t.arrowDown} ${r}`,a=formatContextPercentage(e.inputTokens,e.contextSize);return a==null?i:`${i} ${a}`}function formatContextPercentage(e,t){if(!(t==null||t<=0||!Number.isFinite(t)))return`${Math.round(e/t*100).toLocaleString()}%`}function formatAssistantResponseStats(e,t){if(t===`tokensPerSecond`)return formatTokensPerSecond(e.tokensPerSecond);if(e.outputTokens!=null)return`${e.outputTokens.toLocaleString()} output tokens`}function formatTokensPerSecond(e){if(e!=null)return`${formatNumber(e)} tok/s`}function formatNumber(e){return Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:1})}export{formatAssistantResponseStats,formatCompactTokenCount,formatTokenFlow,nextKey,parseKey,stripPromptControlCharacters,takeUntil};
|
|
@@ -47,8 +47,10 @@ export declare class TerminalRenderer implements AgentTUIRenderer {
|
|
|
47
47
|
/**
|
|
48
48
|
* Commits the startup agent header (brand mark + resolved configuration) to
|
|
49
49
|
* scrollback before the first prompt. Later calls (dev HMR refreshing fields
|
|
50
|
-
* such as the
|
|
51
|
-
* transcript
|
|
50
|
+
* such as the agent name) commit a fresh header beneath the existing
|
|
51
|
+
* transcript only when the rendered header actually changed — every source
|
|
52
|
+
* reload re-sends it, and an identical banner repeated per reload is noise.
|
|
53
|
+
* Committed scrollback is never cleared or replayed.
|
|
52
54
|
*/
|
|
53
55
|
renderAgentHeader(options: AgentHeaderOptions): void;
|
|
54
56
|
readPrompt(options?: AgentTUISessionOptions): Promise<string>;
|
|
@@ -68,6 +70,7 @@ export declare class TerminalRenderer implements AgentTUIRenderer {
|
|
|
68
70
|
* text is blank.
|
|
69
71
|
*/
|
|
70
72
|
renderNotice(text: string): void;
|
|
73
|
+
renderSandboxLog(text: string): void;
|
|
71
74
|
/**
|
|
72
75
|
* Commits the boot-time setup attention line (yellow `⚠`, commands blue),
|
|
73
76
|
* shown once after the agent header when boot detection finds issues.
|