eve 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/src/channel/types.d.ts +6 -0
- package/dist/src/chunks/{use-eve-agent-hdPX68_i.js → use-eve-agent-CyDt3Lny.js} +2 -0
- package/dist/src/chunks/{use-eve-agent-CZkX_ZTT.js → use-eve-agent-DaH3cf8K.js} +2 -0
- package/dist/src/cli/commands/agent-prompt/collect-intent.md +1 -1
- package/dist/src/cli/commands/channels.d.ts +0 -17
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.d.ts +29 -0
- package/dist/src/cli/commands/integration-connect.js +1 -0
- package/dist/src/cli/commands/integration-setup.d.ts +2 -3
- package/dist/src/cli/commands/integration-setup.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/registry-setup-command.d.ts +13 -3
- package/dist/src/cli/commands/registry-setup-command.js +2 -1
- package/dist/src/cli/commands/registry.d.ts +35 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/trace.js +1 -1
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.d.ts +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
- package/dist/src/cli/dev/tui/remote-auth-command.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +8 -7
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +8 -13
- package/dist/src/cli/dev/tui/setup-commands.js +3 -2
- package/dist/src/cli/dev/tui/setup-flow.d.ts +14 -5
- package/dist/src/cli/dev/tui/setup-panel.d.ts +5 -1
- package/dist/src/cli/dev/tui/setup-panel.js +2 -2
- package/dist/src/cli/dev/tui/status-line.d.ts +1 -1
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +2 -5
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.js +1 -1
- package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +2 -0
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/vercel-status.d.ts +1 -6
- package/dist/src/cli/dev/tui/vercel-status.js +1 -1
- package/dist/src/cli/option-parsers.d.ts +11 -0
- package/dist/src/cli/option-parsers.js +1 -0
- package/dist/src/cli/run.d.ts +1 -12
- package/dist/src/cli/run.js +3 -3
- package/dist/src/cli/shutdown.d.ts +2 -0
- package/dist/src/cli/shutdown.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +5 -5
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/private.d.ts +21 -5
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/world.d.ts +10 -5
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +13 -13
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DeZc2RZz.js → attribute-changes-1LmTKuTT.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{private-Cre8uYkA.js → private-BcwCGTV5.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{resume-hook-ip1hbn1b.js → resume-hook-D1_5NCZ6.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{run-CWytxfIp.js → run-C240Ctf4.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/sleep-De802yfX.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-De9yESQN.js → wait-until-z48sPUjU.js} +2 -2
- package/dist/src/compiled/shadcn-registry/index.d.ts +1 -0
- package/dist/src/evals/assertions/collector.d.ts +2 -10
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/cli/eval.d.ts +6 -2
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/cli/filter.d.ts +14 -0
- package/dist/src/evals/cli/filter.js +1 -0
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/diagnostics.d.ts +8 -0
- package/dist/src/evals/diagnostics.js +1 -0
- package/dist/src/evals/expect/index.d.ts +1 -1
- package/dist/src/evals/expect/index.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/judge.js +2 -1
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/reporters/assertion-diagnostics.d.ts +3 -0
- package/dist/src/evals/runner/reporters/assertion-diagnostics.js +3 -0
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/reporters/junit.js +2 -2
- package/dist/src/evals/types.d.ts +21 -5
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/turn-cancellation-control.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.d.ts +7 -0
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/turn-sleep.d.ts +12 -0
- package/dist/src/harness/turn-sleep.js +1 -0
- package/dist/src/internal/application/compiled-artifacts.js +7 -7
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.d.ts +4 -0
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/workflow/development-world-protocol.js +1 -1
- package/dist/src/internal/workflow/world-target.d.ts +7 -0
- package/dist/src/internal/workflow/world-target.js +1 -0
- package/dist/src/protocol/routes.d.ts +4 -0
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/tools/sleep/index.d.ts +18 -0
- package/dist/src/public/tools/sleep/index.js +1 -0
- package/dist/src/runtime/framework-tools/sleep.d.ts +15 -0
- package/dist/src/runtime/framework-tools/sleep.js +1 -0
- package/dist/src/services/dev-client/runtime-artifacts.d.ts +7 -0
- package/dist/src/services/dev-client/runtime-artifacts.js +1 -1
- package/dist/src/setup/boxes/apply-ai-gateway-credential.js +1 -1
- package/dist/src/setup/boxes/deploy-project.d.ts +3 -3
- package/dist/src/setup/flows/deploy.js +1 -1
- package/dist/src/setup/flows/ensure-vercel-project.d.ts +17 -0
- package/dist/src/setup/flows/ensure-vercel-project.js +1 -0
- package/dist/src/setup/flows/in-project.d.ts +1 -1
- package/dist/src/setup/flows/link.js +1 -1
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/provider.js +1 -1
- package/dist/src/setup/flows/registry.d.ts +20 -0
- package/dist/src/setup/flows/registry.js +1 -0
- package/dist/src/setup/index.d.ts +0 -1
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/{channel-setup-environment.d.ts → integrations/channels/environment.d.ts} +2 -2
- package/dist/src/setup/integrations/channels/environment.js +1 -0
- package/dist/src/setup/{channel-setup-integrations.d.ts → integrations/channels/index.d.ts} +3 -3
- package/dist/src/setup/integrations/channels/index.js +1 -0
- package/dist/src/setup/{channel-setup-runner.d.ts → integrations/channels/runner.d.ts} +1 -1
- package/dist/src/setup/integrations/channels/runner.js +1 -0
- package/dist/src/setup/{boxes/add-channels.d.ts → integrations/channels/setup.d.ts} +32 -22
- package/dist/src/setup/integrations/channels/setup.js +2 -0
- package/dist/src/setup/{channel-setup-slack.d.ts → integrations/channels/slack.d.ts} +1 -1
- package/dist/src/setup/integrations/channels/slack.js +1 -0
- package/dist/src/setup/{channel-setup-integration.d.ts → integrations/channels/types.d.ts} +23 -7
- package/dist/src/setup/{channel-setup-ui.d.ts → integrations/channels/ui.d.ts} +2 -2
- package/dist/src/setup/integrations/channels/ui.js +2 -0
- package/dist/src/setup/{channel-setup-web.d.ts → integrations/channels/web.d.ts} +1 -1
- package/dist/src/setup/integrations/channels/web.js +1 -0
- package/dist/src/setup/primitives/run-vercel.d.ts +1 -0
- package/dist/src/setup/primitives/run-vercel.js +1 -1
- package/dist/src/setup/prompter.d.ts +16 -3
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/registry-setup-client.d.ts +18 -0
- package/dist/src/setup/registry-setup-client.js +2 -0
- package/dist/src/setup/registry-setup-protocol.d.ts +93 -0
- package/dist/src/setup/registry-setup-protocol.js +1 -0
- package/dist/src/setup/scaffold/channels-catalog.d.ts +1 -1
- package/dist/src/setup/scaffold/create/extension.js +2 -2
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/create-in-place.d.ts +1 -0
- package/dist/src/setup/scaffold/create-in-place.js +1 -0
- package/dist/src/setup/scaffold/index.js +1 -1
- package/dist/src/setup/scaffold/update/connections.js +3 -3
- package/dist/src/setup/scaffold/update/update-connection-connector.js +1 -1
- package/dist/src/setup/vercel-project-framework.d.ts +1 -1
- package/dist/src/setup/vercel-project-framework.js +1 -1
- package/dist/src/setup/vercel-project.d.ts +17 -2
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/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/docs/channels/overview.mdx +1 -1
- package/docs/channels/slack.mdx +2 -2
- package/docs/concepts/default-harness.md +12 -0
- package/docs/evals/assertions.mdx +8 -1
- package/docs/evals/judge.mdx +11 -1
- package/docs/evals/reporters.mdx +1 -1
- package/docs/evals/running.mdx +3 -0
- package/docs/guides/dev-tui.md +9 -14
- package/docs/guides/instrumentation.md +1 -1
- package/docs/reference/cli.md +25 -38
- package/docs/reference/typescript-api.md +2 -1
- package/docs/tutorial/ship-it.mdx +2 -2
- package/package.json +11 -6
- package/dist/src/compiled/@workflow/core/runtime/world-target.d.ts +0 -11
- package/dist/src/compiled/_chunks/workflow/sleep-BjrUxUcs.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/parse-name.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/promise.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/time.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/workflow-routes.js +0 -1
- package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/world-target.js +0 -1
- package/dist/src/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +0 -1
- package/dist/src/setup/boxes/add-channels.js +0 -2
- package/dist/src/setup/boxes/add-connections.d.ts +0 -26
- package/dist/src/setup/boxes/add-connections.js +0 -1
- package/dist/src/setup/boxes/install-channel-registry-items.d.ts +0 -8
- package/dist/src/setup/boxes/install-channel-registry-items.js +0 -1
- package/dist/src/setup/boxes/one-shot-next-steps.d.ts +0 -18
- package/dist/src/setup/boxes/one-shot-next-steps.js +0 -2
- package/dist/src/setup/boxes/preflight.d.ts +0 -37
- package/dist/src/setup/boxes/preflight.js +0 -1
- package/dist/src/setup/boxes/resolve-target.d.ts +0 -58
- package/dist/src/setup/boxes/resolve-target.js +0 -1
- package/dist/src/setup/boxes/scaffold.d.ts +0 -40
- package/dist/src/setup/boxes/scaffold.js +0 -1
- package/dist/src/setup/boxes/select-channels.d.ts +0 -49
- package/dist/src/setup/boxes/select-channels.js +0 -1
- package/dist/src/setup/boxes/select-chat.d.ts +0 -38
- package/dist/src/setup/boxes/select-chat.js +0 -1
- package/dist/src/setup/boxes/select-connections.d.ts +0 -30
- package/dist/src/setup/boxes/select-connections.js +0 -1
- package/dist/src/setup/boxes/select-setup-mode.d.ts +0 -32
- package/dist/src/setup/boxes/select-setup-mode.js +0 -1
- package/dist/src/setup/channel-setup-deployment.d.ts +0 -11
- package/dist/src/setup/channel-setup-deployment.js +0 -1
- package/dist/src/setup/channel-setup-environment.js +0 -1
- package/dist/src/setup/channel-setup-integration.js +0 -1
- package/dist/src/setup/channel-setup-integrations.js +0 -1
- package/dist/src/setup/channel-setup-runner.js +0 -1
- package/dist/src/setup/channel-setup-slack.js +0 -1
- package/dist/src/setup/channel-setup-ui.js +0 -2
- package/dist/src/setup/channel-setup-web.js +0 -1
- package/dist/src/setup/flows/channels.d.ts +0 -57
- package/dist/src/setup/flows/channels.js +0 -1
- package/dist/src/setup/flows/connections.d.ts +0 -37
- package/dist/src/setup/flows/connections.js +0 -3
- package/dist/src/setup/onboarding.d.ts +0 -60
- package/dist/src/setup/onboarding.js +0 -1
- /package/dist/src/{node_modules/.pnpm/@workflow_utils@5.0.0-beta.7/node_modules/@workflow/utils/dist/pluralize.js → setup/integrations/channels/types.js} +0 -0
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { type ChannelKind } from "#setup/scaffold/index.js";
|
|
2
|
-
import type { DisabledChannelReasons } from "#setup/cli/index.js";
|
|
3
|
-
import type { Asker } from "../ask.js";
|
|
4
|
-
import { type SetupState } from "../state.js";
|
|
5
|
-
import type { SetupBox } from "../step.js";
|
|
6
|
-
/** The channel question, shared with the dev TUI's /channels action list. */
|
|
7
|
-
export declare const CHANNELS_PROMPT_MESSAGE = "Where will you chat with your agent?";
|
|
8
|
-
export interface SelectChannelsOptions {
|
|
9
|
-
/** Resolves the channels question; the composed stack decides how. */
|
|
10
|
-
asker: Asker;
|
|
11
|
-
/**
|
|
12
|
-
* Resolve to these channels without asking. Stays a factory option (not a
|
|
13
|
-
* `withAnswers` rung) so it keeps short-circuiting the picker exactly as the
|
|
14
|
-
* dual-face box did, while still passing the Slack/Vercel gate and
|
|
15
|
-
* `validateSelection` like a picked selection.
|
|
16
|
-
*/
|
|
17
|
-
presetChannels?: ChannelKind[];
|
|
18
|
-
/**
|
|
19
|
-
* Picker shape, chosen explicitly because the variants differ in whether a
|
|
20
|
-
* selection is required and whether the REPL row is shown. The
|
|
21
|
-
* "channels-add" picker allows an empty submission and keeps Slack selectable
|
|
22
|
-
* because capability planning later chooses Connect or environment credentials.
|
|
23
|
-
*/
|
|
24
|
-
variant: "onboarding" | "in-project" | "channels-add";
|
|
25
|
-
/**
|
|
26
|
-
* Reasons for channel kinds that cannot be added to this project (existing
|
|
27
|
-
* registrations); matching rows render disabled with the reason.
|
|
28
|
-
*/
|
|
29
|
-
disabledChannelReasons?: DisabledChannelReasons;
|
|
30
|
-
/**
|
|
31
|
-
* Rejects a selection before any later box runs effects. Runs on both the
|
|
32
|
-
* asked and the preset path, so a flag-driven selection is validated exactly
|
|
33
|
-
* like a picked one. A throw aborts the run.
|
|
34
|
-
*/
|
|
35
|
-
validateSelection?(channels: readonly ChannelKind[]): Promise<void> | void;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* THE CHANNELS BOX: interview-phase channel picker. Choosing channels is human
|
|
39
|
-
* input, so it runs before any filesystem work; the channels box scaffolds the
|
|
40
|
-
* chosen channels afterward from `state.channelSelection`. During onboarding
|
|
41
|
-
* the deployment decision has not been made yet, so Slack is never gated here:
|
|
42
|
-
* picking it is what makes the later provisioning box resolve to Vercel. Only
|
|
43
|
-
* the legacy in-project variant gates Slack on the detected on-disk link.
|
|
44
|
-
*
|
|
45
|
-
* The onboarding picker is required and always carries a locked, pre-selected
|
|
46
|
-
* Terminal UI row, so an empty selection is impossible: every agent can at least be
|
|
47
|
-
* chatted with locally in the terminal. Web and Slack stack on top of it.
|
|
48
|
-
*/
|
|
49
|
-
export declare function selectChannels(options: SelectChannelsOptions): SetupBox<SetupState, ChannelKind[], ChannelKind[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hasVercelProject}from"../state.js";import{SCAFFOLDABLE_CHANNELS}from"#setup/scaffold/index.js";const CHANNELS_PROMPT_MESSAGE=`Where will you chat with your agent?`;function selectChannels(n){let r=n.variant===`channels-add`,i=n.variant===`in-project`;function assertSlackHasVercel(e,t){if(e&&t.includes(`slack`))throw Error("Slack requires a Vercel project. Link this directory (`vercel link`) and re-run to add Slack.")}function slackLacksVercel(t){return i&&!hasVercelProject(t)}return{id:`select-channels`,async gather({state:e}){let i=slackLacksVercel(e);if(n.presetChannels!==void 0)return assertSlackHasVercel(i,n.presetChannels),await n.validateSelection?.(n.presetChannels),n.presetChannels;let a=SCAFFOLDABLE_CHANNELS.map(e=>{let t=n.disabledChannelReasons?.[e.kind];return t===void 0?i&&e.kind===`slack`?{id:e.kind,value:e.kind,label:e.label,disabled:!0,disabledReason:`needs a Vercel project`}:{id:e.kind,value:e.kind,label:e.label,hint:e.hint}:{id:e.kind,value:e.kind,label:e.label,hint:e.hint,disabled:!0,disabledReason:t}}),o={id:`tui`,value:`tui`,label:`Terminal UI`,locked:!0,lockedReason:`always available`},s=await n.asker.askMany({key:`channels`,message:CHANNELS_PROMPT_MESSAGE,options:r?a:[...a,o],required:!0,requireSelection:!r});assertSlackHasVercel(i,s);let c=s.filter(e=>e!==`tui`);return await n.validateSelection?.(c),c},async perform({input:e}){return e},apply(e,t){return{...e,channelSelection:t}}}}export{CHANNELS_PROMPT_MESSAGE,selectChannels};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type Asker, type SelectOption } from "../ask.js";
|
|
2
|
-
import type { ChannelKind, ChatPreference, SetupState } from "../state.js";
|
|
3
|
-
import type { SetupBox } from "../step.js";
|
|
4
|
-
/** The scaffolded facts the chat option list is derived from. */
|
|
5
|
-
export interface ChatPreferenceContext {
|
|
6
|
-
/** Channels scaffolded earlier in the flow; controls option visibility. */
|
|
7
|
-
availableChannels: ChannelKind[];
|
|
8
|
-
/** Whether the Slack app was attached to the channel route and is ready to use. */
|
|
9
|
-
slackbotAttached: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Builds the chat-preference option list. Channel-backed options come
|
|
13
|
-
* first (in the order Web -> Slack) when available, then the framework
|
|
14
|
-
* built-ins (Terminal UI, API), then the explicit skip option last. Exported
|
|
15
|
-
* for the unit test.
|
|
16
|
-
*/
|
|
17
|
-
export declare function buildChatPreferenceOptions(args: ChatPreferenceContext): SelectOption<ChatPreference>[];
|
|
18
|
-
export interface SelectChatOptions {
|
|
19
|
-
/** Resolves the chat question; the composed stack decides how. */
|
|
20
|
-
asker: Asker;
|
|
21
|
-
/**
|
|
22
|
-
* Resolve to this value without asking. The headless default ("skip") lives
|
|
23
|
-
* at the composition site, not here, so a missing headless preset fails
|
|
24
|
-
* fast. Stays a factory option (not a `withAnswers` rung) because a preset
|
|
25
|
-
* must keep bypassing the option list, which hides choices the current
|
|
26
|
-
* state did not scaffold, exactly as the dual-face box did.
|
|
27
|
-
*/
|
|
28
|
-
presetPreference?: ChatPreference;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* THE CHAT BOX: final prompt of the create flow. Asks one required "chat"
|
|
32
|
-
* select through the box's asker: where the user wants to chat with their
|
|
33
|
-
* agent. Options are dynamic on what was scaffolded earlier. Web Chat appears
|
|
34
|
-
* only if `web` is in the scaffolded channels, Slack appears only if `slack`
|
|
35
|
-
* was scaffolded AND the bot was attached during the channel setup step.
|
|
36
|
-
* REPL, API, and Skip are always present.
|
|
37
|
-
*/
|
|
38
|
-
export declare function selectChat(options: SelectChatOptions): SetupBox<SetupState, ChatPreference, ChatPreference>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{select}from"../ask.js";function buildChatPreferenceOptions(e){let option=(e,t,n)=>({id:e,label:t,value:e,hint:n}),t=[];return e.availableChannels.includes(`web`)&&t.push(option(`web`,`Web chat`,`next.js`)),e.availableChannels.includes(`slack`)&&e.slackbotAttached&&t.push(option(`slack`,`Slack`,`open workspace`)),t.push(option(`repl`,`Terminal UI`)),t.push(option(`api`,`API`)),t.push(option(`skip`,`Skip and chat later`)),t}function pickInitialPreference(e){if(e.availableChannels.includes(`web`))return`web`;if(e.availableChannels.includes(`slack`)&&e.slackbotAttached)return`slack`}function selectChat(t){return{id:`select-chat`,async gather({state:n}){if(t.presetPreference!==void 0)return t.presetPreference;let r={availableChannels:[...n.channels],slackbotAttached:n.slackbotAttached};return t.asker.ask(select({key:`chat`,message:`Start a chat with your agent now`,options:buildChatPreferenceOptions(r),recommended:pickInitialPreference(r),required:!0}))},async perform({input:e}){return e},apply(e,t){return{...e,chat:t}}}}export{buildChatPreferenceOptions,selectChat};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ConnectionSelectOption } from "#setup/cli/index.js";
|
|
2
|
-
import { type Asker } from "../ask.js";
|
|
3
|
-
import type { ConnectionPlan, SetupState } from "../state.js";
|
|
4
|
-
import type { SetupBox } from "../step.js";
|
|
5
|
-
export declare const CONNECT_REQUIRES_VERCEL = "Authenticates through Vercel Connect, which needs a Vercel project. Re-run and choose to deploy to Vercel.";
|
|
6
|
-
export interface SelectConnectionsOptions {
|
|
7
|
-
/** Resolves the picker and custom sub-questions; the composed stack decides how. */
|
|
8
|
-
asker: Asker;
|
|
9
|
-
/**
|
|
10
|
-
* Headless mode: skips the picker entirely unless `presetConnections` were
|
|
11
|
-
* requested. Fixed at composition time (the same place the asker base is
|
|
12
|
-
* chosen), since `gather` cannot read the mode off the asker.
|
|
13
|
-
*/
|
|
14
|
-
headless?: boolean;
|
|
15
|
-
/** Skip the picker and plan exactly these catalog slugs. */
|
|
16
|
-
presetConnections?: string[];
|
|
17
|
-
}
|
|
18
|
-
/** Exported for tests: the picker rows derived from the curated catalog. */
|
|
19
|
-
export declare function buildCatalogOptions(disabledReasons: Readonly<Record<string, string>>): ConnectionSelectOption[];
|
|
20
|
-
/**
|
|
21
|
-
* THE CONNECTION SELECTION BOX: part of the interview phase, before any
|
|
22
|
-
* filesystem write. Offers the connection catalog (plus a custom MCP / OpenAPI
|
|
23
|
-
* escape hatch through preset slugs) and resolves every prompt into
|
|
24
|
-
* fully-specified {@link ConnectionPlan}s recorded on the state; the
|
|
25
|
-
* add-connections box executes them after the scaffold and link. The full
|
|
26
|
-
* catalog is selectable: the deployment decision comes later in the interview,
|
|
27
|
-
* and the provisioning box resolves to Vercel when a Connect-backed selection
|
|
28
|
-
* needs a project.
|
|
29
|
-
*/
|
|
30
|
-
export declare function selectConnections(options: SelectConnectionsOptions): SetupBox<SetupState, ConnectionPlan[], ConnectionPlan[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{select,text}from"../ask.js";import{CONNECTION_CATALOG,CUSTOM_CONNECTION_SLUG,SUPPORTED_PROTOCOLS,catalogSlugs,effectiveProtocols,getCatalogEntry,isValidConnectionSlug}from"#setup/scaffold/index.js";import{connectorServiceForEntry}from"#setup/scaffold/connections/catalog.js";const CONNECT_REQUIRES_VERCEL=`Authenticates through Vercel Connect, which needs a Vercel project. Re-run and choose to deploy to Vercel.`,PROTOCOL_LABELS={mcp:`MCP`,openapi:`OpenAPI`};function buildCatalogOptions(e){return CONNECTION_CATALOG.map(t=>{let n=e[t.slug];return n===void 0?{value:t.slug,label:t.label,hint:t.hint}:{value:t.slug,label:t.label,hint:t.hint,disabled:!0,disabledReason:n}})}function unknownSlugError(e){return Error(`Unknown connection "${e}". Known: ${catalogSlugs().join(`, `)}, or pass a custom name with a definition.`)}function assertSupportedProtocols(e,t){if(e.length===0)throw Error(`No supported protocol for "${t}". Supported: ${SUPPORTED_PROTOCOLS.join(`, `)}.`)}async function resolveProtocolInteractive(t,n,r){let i=effectiveProtocols(n);return assertSupportedProtocols(i,r),i.length===1?i[0]:t.ask(select({key:`protocol:${r}`,message:`Protocol for ${r}`,options:i.map(e=>({id:e,value:e,label:PROTOCOL_LABELS[e]}))}))}function resolveProtocolHeadless(e,t){let n=effectiveProtocols(e);if(assertSupportedProtocols(n,t),n.length>1)throw Error(`Connection "${t}" supports multiple protocols (${n.join(`, `)}). Pass --protocol to choose one.`);return n[0]}function deriveProvision(e,t){if(e.auth?.kind!==`connect`)return{kind:`none`};let n=connectorServiceForEntry({mcp:e.mcp,auth:e.auth});return n===void 0?{kind:`connect-manual`}:t?{kind:`command-hint`,service:n}:{kind:`connect`,service:n}}async function promptCustomSlug(e){return e.ask(text({key:`connection-name`,message:`Connection name`,placeholder:`mycorp`,validate:e=>{let t=e.trim();return t.length===0?`A name is required.`:isValidConnectionSlug(t)?null:`Start with a lowercase letter; use only lowercase letters, digits, and hyphens (max 64 characters).`}}))}async function planCustomInteractive(e,n){let r=await resolveProtocolInteractive(e,void 0,n),i=await e.ask(text({key:`description:${n}`,message:`Description for ${n}`,placeholder:`What this connection exposes`}));if(r===`mcp`){let a={slug:n,description:i,protocols:[`mcp`],mcp:{url:(await e.ask(text({key:`mcp-url:${n}`,message:`MCP server URL for ${n}`,placeholder:`https://mcp.example.com/mcp`,validate:e=>e.trim().length===0?`A URL is required.`:null}))).trim()},auth:{kind:`connect`,connector:n}};return{slug:n,protocol:r,entry:a,provision:deriveProvision(a,!1)}}let a=await e.ask(text({key:`openapi-spec:${n}`,message:`OpenAPI spec URL for ${n}`,placeholder:`https://api.example.com/openapi.json`,validate:e=>e.trim().length===0?`A spec URL is required.`:null})),o=await e.ask(text({key:`openapi-base-url:${n}`,message:`Base URL for ${n} (optional)`,placeholder:`https://api.example.com`})),s={slug:n,description:i,protocols:[`openapi`],openapi:o.trim().length>0?{spec:a.trim(),baseUrl:o.trim()}:{spec:a.trim()},auth:{kind:`connect`,connector:n}};return{slug:n,protocol:r,entry:s,provision:deriveProvision(s,!1)}}async function planSelectionInteractive(e,t){if(t===CUSTOM_CONNECTION_SLUG)return planCustomInteractive(e,(await promptCustomSlug(e)).trim());let n=getCatalogEntry(t);if(n!==void 0)return{slug:t,protocol:await resolveProtocolInteractive(e,n.protocols,t),entry:n,provision:deriveProvision(n,!1)};if(!isValidConnectionSlug(t))throw unknownSlugError(t);return planCustomInteractive(e,t)}function planPresetHeadless(e){if(e===CUSTOM_CONNECTION_SLUG)throw Error(`Custom connection requires interactive input or a preset definition.`);let t=getCatalogEntry(e);if(t!==void 0)return{slug:e,protocol:resolveProtocolHeadless(t.protocols,e),entry:t,provision:deriveProvision(t,!0)};throw isValidConnectionSlug(e)?Error(`Custom connection "${e}" requires interactive input or a preset definition.`):unknownSlugError(e)}function selectConnections(e){return{id:`select-connections`,async gather(){let t=e.headless??!1,n=e.presetConnections??[];if(t)return n.map(e=>planPresetHeadless(e));let r;if(n.length>0)r=[...n];else{let t=buildCatalogOptions({}).map(e=>({id:String(e.value),value:String(e.value),label:e.label,hint:e.hint,disabled:e.disabled,disabledReason:e.disabledReason}));r=await e.asker.askMany({key:`connection`,message:`What should your agent connect to?`,options:t})}let i=[];for(let t of r)i.push(await planSelectionInteractive(e.asker,t));return i},async perform({input:e}){return e},apply(e,t){return{...e,connectionSelection:t}}}}export{CONNECT_REQUIRES_VERCEL,buildCatalogOptions,selectConnections};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type Asker } from "../ask.js";
|
|
2
|
-
import type { SetupMode, SetupState } from "../state.js";
|
|
3
|
-
import type { SetupBox } from "../step.js";
|
|
4
|
-
export interface SelectSetupModeOptions {
|
|
5
|
-
/** Resolves the mode question; the composed stack decides how. */
|
|
6
|
-
asker: Asker;
|
|
7
|
-
/**
|
|
8
|
-
* Skip the mode question and use this value. Stays a factory option (not a
|
|
9
|
-
* `withAnswers` rung) so it short-circuits before any ask, which is what
|
|
10
|
-
* lets a headless `--one-shot` run resolve without a terminal.
|
|
11
|
-
*/
|
|
12
|
-
presetMode?: SetupMode;
|
|
13
|
-
/**
|
|
14
|
-
* Model baked into a one-shot scaffold instead of {@link DEFAULT_AGENT_MODEL_ID}.
|
|
15
|
-
* Threaded from the same `--model` preset the model box consumes, so the
|
|
16
|
-
* flag keeps working when the model box is skipped.
|
|
17
|
-
*/
|
|
18
|
-
presetModel?: string;
|
|
19
|
-
}
|
|
20
|
-
/** The mode plus the model a one-shot run pins, since the model box is skipped. */
|
|
21
|
-
export interface SelectSetupModePayload {
|
|
22
|
-
mode: SetupMode;
|
|
23
|
-
modelId?: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* THE SETUP-MODE BOX: decide whether the run is the complete onboarding flow
|
|
27
|
-
* or a one-shot scaffold. One-shot pins the default model here because every
|
|
28
|
-
* later interview box (including the model picker) is gated off. The question
|
|
29
|
-
* is skippable, so a headless stack without a preset resolves to "complete"
|
|
30
|
-
* and current headless behavior is unchanged.
|
|
31
|
-
*/
|
|
32
|
-
export declare function selectSetupMode(options: SelectSetupModeOptions): SetupBox<SetupState, SetupMode, SelectSetupModePayload>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SkippedSignal,select}from"../ask.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";function selectSetupMode(n){return{id:`select-setup-mode`,async gather(){if(n.presetMode!==void 0)return n.presetMode;try{return await n.asker.ask(select({key:`setup-mode`,message:`How much should we set up now?`,options:[{id:`complete`,label:`Complete setup`,value:`complete`,hint:`model, channels, connections, deploy`},{id:`one-shot`,label:`One-shot`,value:`one-shot`,hint:`just write the project files`}],recommended:`complete`}))}catch(t){if(t instanceof SkippedSignal)return`complete`;throw t}},async perform({input:e}){return e===`one-shot`?{mode:e,modelId:n.presetModel??DEFAULT_AGENT_MODEL_ID}:{mode:e}},apply(e,t){return{...e,setupMode:t.mode,modelId:t.modelId??e.modelId}}}}export{selectSetupMode};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { DeployProjectDeps } from "./boxes/deploy-project.js";
|
|
2
|
-
import type { ChannelSetupUi } from "./channel-setup-ui.js";
|
|
3
|
-
import { type SetupState } from "./state.js";
|
|
4
|
-
/** Offers and, when accepted, performs deployment after channel setup completes. */
|
|
5
|
-
export declare function deployChannelSetup(input: {
|
|
6
|
-
state: SetupState;
|
|
7
|
-
ui: ChannelSetupUi;
|
|
8
|
-
signal?: AbortSignal;
|
|
9
|
-
presetDeploy?: boolean;
|
|
10
|
-
deps?: DeployProjectDeps;
|
|
11
|
-
}): Promise<SetupState>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{snapshotSetupState}from"./state.js";import{deployProject}from"./boxes/deploy-project.js";import{runInteractive}from"./runner.js";async function deployChannelSetup(t){if(!(t.presetDeploy??await t.ui.confirm({key:`deploy-channels`,message:`Deploy this project to Vercel now?`,recommended:!0})))return t.ui.nextSteps(["Run `eve deploy` to deploy when ready."]),t.state;let n=await runInteractive([deployProject({prompter:t.ui.prompter,ensureLinkedProject:`interactive-vercel-link`,deps:t.deps})],t.state,{write:e=>t.ui.prompter.log.message(e)},{snapshot:snapshotSetupState,signal:t.signal});return n.kind===`done`?n.state:t.state}export{deployChannelSetup};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function describeChannelSetupEnvironment(e){if(e.vercel.kind===`available`)switch(e.vercel.project.kind){case`deployed`:return`Found an authenticated Vercel account and deployed project (${e.vercel.project.productionUrl}).`;case`linked`:return`Found an authenticated Vercel account and linked project.`;case`unresolved`:return`Found an authenticated Vercel account; this directory is not linked to a project.`}switch(e.vercel.reason){case`logged-out`:return`No authenticated Vercel account found; using portable channel setup.`;case`cli-missing`:return`Vercel CLI not found; using portable channel setup.`;case`unavailable`:return`Could not verify the Vercel account; using portable channel setup.`}}function channelSetupEnvironment(e,t){return e===`authenticated`?{vercel:{kind:`available`,project:t}}:{vercel:{kind:`unavailable`,reason:e}}}export{channelSetupEnvironment,describeChannelSetupEnvironment};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SLACK_CHANNEL_SETUP}from"./channel-setup-slack.js";import{WEB_CHANNEL_SETUP}from"./channel-setup-web.js";import{createChannelSetupUi}from"./channel-setup-ui.js";const CHANNEL_SETUP_INTEGRATIONS=[WEB_CHANNEL_SETUP,SLACK_CHANNEL_SETUP];function channelSetupIntegration(e){let t=CHANNEL_SETUP_INTEGRATIONS.find(t=>t.kind===e);if(t===void 0)throw Error(`No channel setup integration for "${e}".`);return t}export{CHANNEL_SETUP_INTEGRATIONS,channelSetupIntegration,createChannelSetupUi};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{snapshotSetupState}from"./state.js";import{addChannels}from"./boxes/add-channels.js";import{runInteractive}from"./runner.js";async function runChannelSetup(t,n){let r=await runInteractive([addChannels({asker:t.ui.asker,prompter:t.ui.prompter,headless:t.headless,presetCreateSlackbot:t.presetCreateSlackbot,force:t.force,configureVercelServices:n.configureVercelServices,slackCredentials:n.slackCredentials,ensureLinkedProject:n.ensureLinkedProject,skipDependencyMutation:t.skipDependencyMutation,deps:t.deps})],t.state,{write:e=>t.ui.prompter.log.message(e)},{snapshot:snapshotSetupState,signal:t.signal});return r.kind===`done`?{kind:`done`,state:r.state}:{kind:`cancelled`}}export{runChannelSetup};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{WizardCancelledError}from"./step.js";import{runChannelSetup}from"./channel-setup-runner.js";async function choosePortableCredentials(t){if(t.environment.vercel.kind===`available`)return`vercel-connect`;if(t.presetPortableCredentials!==void 0)return t.presetPortableCredentials?`environment`:`vercel-connect`;try{return await t.ui.prompter.select({message:`How would you like to configure Slack?`,options:[{value:`vercel`,label:`Set up Vercel Connect`,hint:`Sign in and link this project`},{value:`portable`,label:`Use portable credentials`,hint:`Read Slack tokens from environment variables`}]})===`portable`?`environment`:`vercel-connect`}catch(t){if(t instanceof WizardCancelledError)return`cancelled`;throw t}}const SLACK_CHANNEL_SETUP={kind:`slack`,label:`Slack`,hint:`Slack app mentions and DMs`,async setup(e){let n=await choosePortableCredentials(e);if(n===`cancelled`)return{kind:`cancelled`};let r=await runChannelSetup(e,n===`environment`?{slackCredentials:`environment`}:{slackCredentials:`vercel-connect`,ensureLinkedProject:`interactive-vercel-link`});return r.kind===`done`&&n===`environment`&&r.state.channels.includes(`slack`)&&e.ui.nextSteps([`Set SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET in .env.local (listed in .env.example).`,`Configure your Slack app to send events to /eve/v1/slack on your public agent URL.`]),r}};export{SLACK_CHANNEL_SETUP};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{SkippedSignal,confirm}from"./ask.js";function createChannelSetupUi(n){return{...n,async confirm(r){try{return await n.asker.ask(confirm(r))}catch(t){if(t instanceof SkippedSignal)return!1;throw t}},nextSteps(e){e.length!==0&&n.prompter.note(e.join(`
|
|
2
|
-
`),`Next steps`,{tone:`success`})}}}export{createChannelSetupUi};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{runChannelSetup}from"./channel-setup-runner.js";const WEB_CHANNEL_SETUP={kind:`web`,label:`Web Chat`,hint:`Browser-based chat interface`,setup(e){return runChannelSetup(e,{configureVercelServices:e.environment.vercel.kind===`available`})}};export{WEB_CHANNEL_SETUP};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { AddCommandOptions } from "#cli/commands/registry.js";
|
|
2
|
-
import type { AddChannelsDeps } from "../boxes/add-channels.js";
|
|
3
|
-
import { inspectExistingChannelRegistrations } from "../channel-add-conflicts.js";
|
|
4
|
-
import { detectDeployment } from "../project-resolution.js";
|
|
5
|
-
import type { Prompter } from "../prompter.js";
|
|
6
|
-
import { getVercelAuthStatus } from "../vercel-project.js";
|
|
7
|
-
/** Injected for tests; defaults to the real detection and box effects. */
|
|
8
|
-
export interface ChannelsFlowDeps {
|
|
9
|
-
detectDeployment: typeof detectDeployment;
|
|
10
|
-
inspectExistingChannelRegistrations: typeof inspectExistingChannelRegistrations;
|
|
11
|
-
getVercelAuthStatus: typeof getVercelAuthStatus;
|
|
12
|
-
addChannels?: AddChannelsDeps;
|
|
13
|
-
installRegistryItem(appRoot: string, item: string, options?: AddCommandOptions): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export type ChannelsFlowResult = {
|
|
16
|
-
kind: "done";
|
|
17
|
-
addedChannels: readonly string[];
|
|
18
|
-
} | {
|
|
19
|
-
/**
|
|
20
|
-
* The user chose "Deploy and chat" on the post-Slack "See it live"
|
|
21
|
-
* prompt. The caller deploys, then points them at this workspace.
|
|
22
|
-
*/
|
|
23
|
-
kind: "deploy-and-chat";
|
|
24
|
-
addedChannels: readonly string[];
|
|
25
|
-
chat: {
|
|
26
|
-
chatUrl?: string;
|
|
27
|
-
workspaceName?: string;
|
|
28
|
-
};
|
|
29
|
-
} | {
|
|
30
|
-
kind: "cancelled";
|
|
31
|
-
} | {
|
|
32
|
-
kind: "failed";
|
|
33
|
-
addedChannels: readonly string[];
|
|
34
|
-
message: string;
|
|
35
|
-
};
|
|
36
|
-
/** Title for Slack's optional deploy-and-chat continuation. */
|
|
37
|
-
export declare const SEE_IT_LIVE_MESSAGE = "See it live";
|
|
38
|
-
/**
|
|
39
|
-
* THE CHANNELS FLOW for the dev TUI's `/channels`: a task list that loops.
|
|
40
|
-
* Pick an unregistered channel, run its add sub-flow (Slack provisioning
|
|
41
|
-
* included), and land back on the repainted list with that channel checked;
|
|
42
|
-
* "Done" or Esc leaves. Filesystem effects can land before the runner applies
|
|
43
|
-
* their in-memory payload, so every cancelled or failed sub-flow re-inspects
|
|
44
|
-
* authored registrations and preserves a channel that became durable. Esc on
|
|
45
|
-
* the list after something was added reports the additions exactly like Done;
|
|
46
|
-
* only an empty exit folds to cancelled.
|
|
47
|
-
*
|
|
48
|
-
* The outer loop owns only picker lifecycle, conflict validation, and durable
|
|
49
|
-
* re-inspection. Each selected integration owns its prompts, provisioning,
|
|
50
|
-
* scaffold choices, deployment continuation, and next-step guidance.
|
|
51
|
-
*/
|
|
52
|
-
export declare function runChannelsFlow(input: {
|
|
53
|
-
appRoot: string;
|
|
54
|
-
prompter: Prompter;
|
|
55
|
-
signal?: AbortSignal;
|
|
56
|
-
deps?: Partial<ChannelsFlowDeps>;
|
|
57
|
-
}): Promise<ChannelsFlowResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{interactiveAsker}from"../ask.js";import{detectDeployment,projectResolutionFromDeployment}from"../project-resolution.js";import{createDefaultSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{getVercelAuthStatus}from"../vercel-project.js";import{CHANNELS_PROMPT_MESSAGE}from"../boxes/select-channels.js";import{assertCanAddSelectedChannels,inspectExistingChannelRegistrations}from"../channel-add-conflicts.js";import{channelSetupEnvironment}from"../channel-setup-environment.js";import{createChannelSetupUi}from"../channel-setup-ui.js";import{CHANNEL_SETUP_INTEGRATIONS,channelSetupIntegration}from"../channel-setup-integrations.js";import{toErrorMessage}from"#shared/errors.js";const SEE_IT_LIVE_MESSAGE=`See it live`;async function offerDeployAndChat(e){try{return await e.select({message:SEE_IT_LIVE_MESSAGE,options:[{value:`deploy`,label:`Deploy and chat`},{value:`later`,label:`Later`}]})===`deploy`}catch(e){if(e instanceof WizardCancelledError)return!1;throw e}}function channelAlreadyAdded(e,t){return t===`web`?e.webAppPresent:e.slackOwners.length>0}function appendChannel(e,t){return e.includes(t)?[...e]:[...e,t]}async function pickChannel(e,t){let n=channelListRows(t),r=!n.some(e=>e.value!==`done`&&e.completed!==!0&&e.disabled!==!0),a={message:CHANNELS_PROMPT_MESSAGE,options:n,hintLayout:`inline`};r&&(a.initialValue=`done`);try{return{kind:`picked`,value:await e.select(a)}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}}function channelLandedDuringSubflow(e,t,n){return!channelAlreadyAdded(e,n)&&channelAlreadyAdded(t,n)}function deployAndChatDetails(e){let t={};return e.slackChatUrl!==void 0&&(t.chatUrl=e.slackChatUrl),e.slackWorkspaceName!==void 0&&(t.workspaceName=e.slackWorkspaceName),t}function channelListRows(e){let t=[{value:`repl`,label:`Terminal UI`,completed:!0,focusHint:`Already installed`}];for(let n of CHANNEL_SETUP_INTEGRATIONS){if(channelAlreadyAdded(e,n.kind)){t.push({value:n.kind,label:n.label,completed:!0,focusHint:`Already installed`});continue}let r=e.disabledChannelReasons[n.kind];if(r!==void 0){t.push({value:n.kind,label:n.label,disabled:!0,disabledReason:r});continue}let i={value:n.kind,label:n.label};n.hint!==void 0&&(i.hint=n.hint),t.push(i)}return t.push({value:`done`,label:`Done`,trailingAction:!0}),t}async function runChannelsFlow(s){let{appRoot:c,prompter:l,signal:u}=s,d={detectDeployment,inspectExistingChannelRegistrations,getVercelAuthStatus,installRegistryItem:async(e,t,n)=>{let{installOfficialRegistryItem:r}=await import(`#cli/commands/registry.js`);await r(e,t,n)},...s.deps},[f,p,m]=await withSpinner(l,`Checking the project…`,()=>Promise.all([d.detectDeployment(c,{signal:u}),d.inspectExistingChannelRegistrations(c),d.getVercelAuthStatus(c,{signal:u})]));u?.throwIfAborted();let h=p,g=channelSetupEnvironment(m,projectResolutionFromDeployment(f)),_={...createDefaultSetupState(),project:projectResolutionFromDeployment(f),projectPath:{kind:`resolved`,inPlace:!0,path:c}},v;for(;;){let t=await pickChannel(l,h);if(t.kind===`cancelled`){if(_.channels.length===0)return{kind:`cancelled`};break}let n=t.value;if(n===`done`)break;if(n===`repl`||channelAlreadyAdded(h,n))continue;assertCanAddSelectedChannels([n],h),await d.installRegistryItem(c,`channel/${n}`);let r;try{r=await channelSetupIntegration(n).setup({environment:g,state:{..._,channelSelection:[n]},ui:createChannelSetupUi({asker:interactiveAsker(l),prompter:l}),signal:u,skipDependencyMutation:!0,deps:d.addChannels})}catch(e){let t=u?.aborted===!0?await d.inspectExistingChannelRegistrations(c):await withSpinner(l,`Checking the project…`,()=>d.inspectExistingChannelRegistrations(c));if(channelLandedDuringSubflow(h,t,n)){if(_={..._,channels:appendChannel(_.channels,n)},h=t,e instanceof WizardCancelledError||(v=toErrorMessage(e)),u?.aborted===!0)break;continue}if(e instanceof WizardCancelledError){h=t;continue}throw e}r.kind===`done`&&(_=r.state);let o=u?.aborted===!0?await d.inspectExistingChannelRegistrations(c):await withSpinner(l,`Checking the project…`,()=>d.inspectExistingChannelRegistrations(c));if(channelLandedDuringSubflow(h,o,n)&&(_={..._,channels:appendChannel(_.channels,n)}),h=o,u?.aborted===!0)break;if(r.kind!==`cancelled`&&n===`slack`&&_.slackbotAttached&&await offerDeployAndChat(l))return{kind:`deploy-and-chat`,addedChannels:_.channels,chat:deployAndChatDetails(_)}}return v===void 0?{kind:`done`,addedChannels:_.channels}:{kind:`failed`,addedChannels:_.channels,message:v}}export{SEE_IT_LIVE_MESSAGE,runChannelsFlow};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ensureConnectionDependencies, listAuthoredConnections } from "#setup/scaffold/index.js";
|
|
2
|
-
import { detectPackageManager } from "#setup/package-manager.js";
|
|
3
|
-
import { runPackageManagerInstall } from "#setup/primitives/pm/run.js";
|
|
4
|
-
import { type AddConnectionsDeps } from "../boxes/add-connections.js";
|
|
5
|
-
import { detectDeployment } from "../project-resolution.js";
|
|
6
|
-
import type { Prompter } from "../prompter.js";
|
|
7
|
-
import { getVercelAuthStatus } from "../vercel-project.js";
|
|
8
|
-
import { runLinkFlow } from "./link.js";
|
|
9
|
-
export declare const CONNECTIONS_PROMPT_MESSAGE = "Select an MCP server to add to your agent through Vercel Connect";
|
|
10
|
-
export interface ConnectionsFlowDeps {
|
|
11
|
-
detectDeployment: typeof detectDeployment;
|
|
12
|
-
detectPackageManager: typeof detectPackageManager;
|
|
13
|
-
getVercelAuthStatus: typeof getVercelAuthStatus;
|
|
14
|
-
runLinkFlow: typeof runLinkFlow;
|
|
15
|
-
ensureConnectionDependencies: typeof ensureConnectionDependencies;
|
|
16
|
-
listAuthoredConnections: typeof listAuthoredConnections;
|
|
17
|
-
runPackageManagerInstall: typeof runPackageManagerInstall;
|
|
18
|
-
addConnections?: AddConnectionsDeps;
|
|
19
|
-
}
|
|
20
|
-
export type ConnectionsFlowResult = {
|
|
21
|
-
kind: "done";
|
|
22
|
-
addedConnections: readonly string[];
|
|
23
|
-
} | {
|
|
24
|
-
kind: "cancelled";
|
|
25
|
-
} | {
|
|
26
|
-
kind: "failed";
|
|
27
|
-
addedConnections: readonly string[];
|
|
28
|
-
message: string;
|
|
29
|
-
};
|
|
30
|
-
/** Runs `/connect`, linking a project on first selection when needed. */
|
|
31
|
-
export declare function runConnectionsFlow(input: {
|
|
32
|
-
appRoot: string;
|
|
33
|
-
prompter: Prompter;
|
|
34
|
-
signal?: AbortSignal;
|
|
35
|
-
disabledConnectionReasons?: Readonly<Record<string, string>>;
|
|
36
|
-
deps?: Partial<ConnectionsFlowDeps>;
|
|
37
|
-
}): Promise<ConnectionsFlowResult>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{interactiveAsker}from"../ask.js";import{detectDeployment,isProjectResolved,projectResolutionFromDeployment}from"../project-resolution.js";import{snapshotSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{getVercelAuthStatus,vercelAuthBlockerReason}from"../vercel-project.js";import{selectConnections}from"../boxes/select-connections.js";import{addConnections}from"../boxes/add-connections.js";import{runInteractive}from"../runner.js";import{inProjectSetupState,prompterSink}from"./in-project.js";import{runLinkFlow}from"./link.js";import{CONNECTION_CATALOG,ensureConnectionDependencies,listAuthoredConnections}from"#setup/scaffold/index.js";import{detectPackageManager}from"#setup/package-manager.js";import{toErrorMessage}from"#shared/errors.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";const CONNECTIONS_PROMPT_MESSAGE=`Select an MCP server to add to your agent through Vercel Connect`,CONNECT_CONNECTIONS=CONNECTION_CATALOG.filter(e=>e.auth.kind===`connect`);function connectionRows(e,t,n){let r=vercelAuthBlockerReason(t),i=CONNECT_CONNECTIONS.map(t=>{let i={value:t.slug,label:t.label};if(e.has(t.slug))return{...i,completed:!0,focusHint:`Already added`};let a=n[t.slug];return a===void 0?r===void 0?{...i,hint:t.hint}:{...i,disabled:!0,disabledReason:r,disabledReasonTone:`warning`}:{...i,disabled:!0,disabledReason:a,disabledReasonTone:`warning`}});return i.push({value:`done`,label:`Done`,trailingAction:!0}),i}async function pickConnection(e,t,n,r){let i=connectionRows(t,n,r),o={message:CONNECTIONS_PROMPT_MESSAGE,options:i,hintLayout:`inline`,search:!0,placeholder:`type to search MCP servers`};i.some(e=>e.value!==`done`&&e.disabled!==!0&&e.completed!==!0)||(o.initialValue=`done`);try{return await e.select(o)}catch(e){if(e instanceof WizardCancelledError)return;throw e}}async function runConnectionsFlow(s){let{appRoot:c,prompter:l,signal:u}=s,d={detectDeployment,detectPackageManager,ensureConnectionDependencies,getVercelAuthStatus,listAuthoredConnections,runLinkFlow,runPackageManagerInstall,...s.deps},[f,p,m]=await withSpinner(l,`Checking the project…`,()=>Promise.all([d.detectDeployment(c,{signal:u}),d.listAuthoredConnections(c),d.getVercelAuthStatus(c,{signal:u})]));u?.throwIfAborted();let h=inProjectSetupState(c,projectResolutionFromDeployment(f)),g=new Set(p),_=await pickConnection(l,g,m,s.disabledConnectionReasons??{});if(_===void 0)return{kind:`cancelled`};if(_===`done`||g.has(_))return{kind:`done`,addedConnections:[]};try{if(!isProjectResolved(h.project)){if((await d.runLinkFlow({appRoot:c,prompter:l,signal:u,projectSelection:`create-or-link`,teamSelectMessage:()=>`You need to link to a project to use Vercel Connect.
|
|
2
|
-
|
|
3
|
-
Select your team`})).kind===`cancelled`)return{kind:`cancelled`};let e=projectResolutionFromDeployment(await withSpinner(l,`Checking the project…`,()=>d.detectDeployment(c,{signal:u})));if(!isProjectResolved(e))throw Error(`Project link was not found after linking.`);h={...h,project:e}}let t=await d.detectPackageManager(c);if(await d.ensureConnectionDependencies({projectRoot:c}),!await withPhase(l.log,`Installing connection dependencies (${t.kind} install)...`,()=>d.runPackageManagerInstall(t.kind,c,{onOutput:createPromptCommandOutput(l.log),signal:u})))throw Error(`Dependency installation failed. Run \`${t.kind} install\`.`);if((await runInteractive([selectConnections({asker:interactiveAsker(l),presetConnections:[_]}),addConnections({prompter:l,signal:u,deps:d.addConnections})],h,prompterSink(l),{snapshot:snapshotSetupState,signal:u})).kind!==`done`)return{kind:`cancelled`};if(!new Set(await d.listAuthoredConnections(c)).has(_))throw Error(`Connection "${_}" was not added.`);return{kind:`done`,addedConnections:[_]}}catch(e){return e instanceof WizardCancelledError?{kind:`cancelled`}:{kind:`failed`,addedConnections:new Set(await d.listAuthoredConnections(c)).has(_)?[_]:[],message:toErrorMessage(e)}}}export{CONNECTIONS_PROMPT_MESSAGE,runConnectionsFlow};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Prompter } from "./prompter.js";
|
|
2
|
-
import type { AnySetupBox } from "./runner.js";
|
|
3
|
-
import type { EvePackageContract } from "./scaffold/index.js";
|
|
4
|
-
import type { ArgsHeadlessAiGateway, ArgsHeadlessProject, ChannelKind, ChatPreference, SetupMode, SetupState } from "./state.js";
|
|
5
|
-
/**
|
|
6
|
-
* Options for {@link composeOnboardingBoxes}. These carry exactly what the
|
|
7
|
-
* create flow's options carried: the preset answers that let each box resolve
|
|
8
|
-
* without prompting, plus the directory and headless dispatch decisions.
|
|
9
|
-
*/
|
|
10
|
-
export interface OnboardingBoxesOptions {
|
|
11
|
-
prompter: Prompter;
|
|
12
|
-
/** Skip the name prompt and use this value. */
|
|
13
|
-
presetName?: string;
|
|
14
|
-
/** Skip the setup-mode prompt and use this value. */
|
|
15
|
-
presetMode?: SetupMode;
|
|
16
|
-
/** Skip the model prompt and use this value. */
|
|
17
|
-
presetModel?: string;
|
|
18
|
-
/** Skip the channels prompt and use these kinds. */
|
|
19
|
-
presetChannels?: ChannelKind[];
|
|
20
|
-
/** Skip the connections picker and scaffold these catalog slugs. */
|
|
21
|
-
presetConnections?: string[];
|
|
22
|
-
/** Skip the "Create slackbot?" prompt inside the add-to-agent step. */
|
|
23
|
-
presetCreateSlackbot?: boolean;
|
|
24
|
-
/** Headless-only Vercel provisioning flags. Ignored on the interactive path. */
|
|
25
|
-
provisioning?: {
|
|
26
|
-
project: ArgsHeadlessProject;
|
|
27
|
-
aiGateway: ArgsHeadlessAiGateway;
|
|
28
|
-
};
|
|
29
|
-
/** Skip the chat-preference prompt and use this value. */
|
|
30
|
-
presetChatPreference?: ChatPreference;
|
|
31
|
-
/** Parent directory the project folder is created inside. Defaults to cwd. */
|
|
32
|
-
targetDirectory?: string;
|
|
33
|
-
/** Scaffold into cwd or targetDirectory instead of creating a child directory. */
|
|
34
|
-
inPlace?: boolean;
|
|
35
|
-
/** Allow the in-place scaffold to replace eve scaffold files that already exist. */
|
|
36
|
-
overwriteExisting?: boolean;
|
|
37
|
-
/** Skip the post-channel Vercel deployment entirely. */
|
|
38
|
-
presetNoDeploy?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Headless mode: never prompt or spawn an interactive Vercel command. Boxes
|
|
41
|
-
* needing a human/browser action throw `HumanActionRequiredError`. Slack
|
|
42
|
-
* setup remains an interactive/onboarding handoff, not a headless flow.
|
|
43
|
-
*/
|
|
44
|
-
headless?: boolean;
|
|
45
|
-
/** eve package metadata baked into the scaffolded `package.json`. */
|
|
46
|
-
evePackage?: EvePackageContract;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Composes the full programmatic onboarding flow.
|
|
50
|
-
*
|
|
51
|
-
* 1. The interview phase: name, then the agent itself (model, channels,
|
|
52
|
-
* connections), then where it runs (the provisioning plans).
|
|
53
|
-
* 2. Input preflight before filesystem writes.
|
|
54
|
-
* 3. The scaffold box writes or reuses the agent template.
|
|
55
|
-
* 4. Project and gateway facts are detected and executed from the plans.
|
|
56
|
-
* 5. Channel setup writes Web/Slack surfaces and returns setup facts.
|
|
57
|
-
* 6. Deploy runs once when Slack was added (the connector needs a public URL).
|
|
58
|
-
* 7. Chat preference is picked from the final channel state.
|
|
59
|
-
*/
|
|
60
|
-
export declare function composeOnboardingBoxes(options: OnboardingBoxesOptions): AnySetupBox<SetupState>[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{headlessAsker,interactiveAsker}from"./ask.js";import{addChannels}from"./boxes/add-channels.js";import{selectConnections}from"./boxes/select-connections.js";import{addConnections}from"./boxes/add-connections.js";import{detectAiGateway}from"./boxes/detect-ai-gateway.js";import{applyAiGatewayCredential}from"./boxes/apply-ai-gateway-credential.js";import{deployProject}from"./boxes/deploy-project.js";import{installChannelRegistryItems}from"./boxes/install-channel-registry-items.js";import{linkVercelProject}from"./boxes/link-project.js";import{oneShotNextSteps}from"./boxes/one-shot-next-steps.js";import{preflight}from"./boxes/preflight.js";import{resolveProvisioning}from"./boxes/resolve-provisioning.js";import{resolveTarget}from"./boxes/resolve-target.js";import{scaffold}from"./boxes/scaffold.js";import{selectChannels}from"./boxes/select-channels.js";import{selectChat}from"./boxes/select-chat.js";import{selectModel}from"./boxes/select-model.js";import{selectSetupMode}from"./boxes/select-setup-mode.js";import{resolve}from"node:path";function onlyWhen(e,t){return{...t,shouldRun:n=>e(n)&&(t.shouldRun?.(n)??!0)}}function completeSetupOnly(e){return onlyWhen(e=>e.setupMode===`complete`,e)}function composeOnboardingBoxes(r){let i=r.headless?{headless:!0,project:r.provisioning?.project??{},aiGateway:r.provisioning?.aiGateway??{}}:{headless:!1},a=r.headless?headlessAsker():interactiveAsker(r.prompter);return[resolveTarget({asker:a,notify:e=>r.prompter.note(e),presetName:r.presetName,targetDirectory:r.targetDirectory,inPlace:r.inPlace,resumeExisting:r.headless}),selectSetupMode({asker:a,presetMode:r.presetMode,presetModel:r.presetModel}),...[selectModel({asker:a,presetModel:r.presetModel}),selectChannels({asker:a,presetChannels:r.presetChannels,variant:`onboarding`}),selectConnections({asker:a,presetConnections:r.presetConnections,headless:r.headless}),resolveProvisioning({asker:a,prompter:r.prompter,targetDirectory:r.targetDirectory,mode:i})].map(completeSetupOnly),preflight({cwd:resolve(r.targetDirectory??process.cwd()),headless:r.headless}),scaffold({prompter:r.prompter,evePackage:r.evePackage,targetDirectory:r.targetDirectory,overwriteExisting:r.overwriteExisting,headless:r.headless}),...[detectAiGateway(),linkVercelProject({prompter:r.prompter,headless:r.headless}),applyAiGatewayCredential({prompter:r.prompter}),installChannelRegistryItems(),addChannels({asker:a,prompter:r.prompter,evePackage:r.evePackage,presetCreateSlackbot:r.presetCreateSlackbot,headless:r.headless,slackbotFailure:`warn-and-continue`,skipDependencyMutation:!0}),addConnections({prompter:r.prompter})].map(completeSetupOnly),completeSetupOnly(onlyWhen(e=>e.slackScaffolded,deployProject({prompter:r.prompter,skip:r.presetNoDeploy,headless:r.headless}))),completeSetupOnly(selectChat({asker:a,presetPreference:r.presetChatPreference})),oneShotNextSteps({prompter:r.prompter})]}export{composeOnboardingBoxes};
|