UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

89 lines (88 loc) 3.62 kB
import { runChannelsFlow } from "#setup/flows/channels.js"; import { runConnectionsFlow } from "#setup/flows/connections.js"; import { runDeployFlow } from "#setup/flows/deploy.js"; import { runInstallVercelCliFlow } from "#setup/flows/install-vercel-cli.js"; import { runLoginFlow } from "#setup/flows/login.js"; import { runModelFlow } from "#setup/flows/model.js"; import type { Prompter } from "#setup/prompter.js"; import { type TuiPrompterRenderer } from "./tui-prompter.js"; import type { PromptCommandExtensionName } from "./prompt-commands.js"; import type { SetupFlowRenderer } from "./setup-flow.js"; import type { VercelStatusEffect } from "./vercel-status.js"; export type TuiSetupCommand = PromptCommandExtensionName; /** * Panel title and loading indicator per command. The bordered panel never * repeats the echoed command verbatim, but it keeps a constant title as flows * move past their opening question. */ export declare const SETUP_FLOW_CONFIG: { "vc:install": { title: string; indicator: "pulse"; }; "vc:login": { title: string; indicator: "pulse"; }; model: { title: string; indicator: "pulse"; }; channels: { title: string; indicator: "pulse"; }; connect: { title: string; indicator: "pulse"; }; deploy: { title: string; indicator: "spinner"; }; }; /** The prompter surface plus the working-state interrupt trap a command races against. */ export type TuiSetupCommandRenderer = TuiPrompterRenderer & Pick<SetupFlowRenderer, "readProviderPicker" | "readModelEditor" | "waitForInterrupt">; export interface TuiSetupCommandInput { command: TuiSetupCommand; /** The local project the in-process dev server is running. */ appRoot: string; /** The renderer surface the TUI-native prompter drives. */ renderer: TuiSetupCommandRenderer; /** Initial model-flow step authorized by the runner's boot evidence. */ initialModelStep?: "provider"; disabledConnectionReasons?: Readonly<Record<string, string>>; /** Test seam; defaults to the real TUI-native prompter over `renderer`. */ createPrompter?: (renderer: TuiPrompterRenderer) => Prompter; /** Test seam; defaults to the real setup flows. */ flows?: Partial<TuiSetupFlows>; } /** The flow entry points the commands dispatch to, injectable for tests. */ export interface TuiSetupFlows { runInstallVercelCliFlow: typeof runInstallVercelCliFlow; runLoginFlow: typeof runLoginFlow; runModelFlow: typeof runModelFlow; runChannelsFlow: typeof runChannelsFlow; runConnectionsFlow: typeof runConnectionsFlow; runDeployFlow: typeof runDeployFlow; } export interface TuiSetupCommandResult { message: string; /** Keep warning/error lines after the bordered panel closes. */ preserveFlowDiagnostics: boolean; /** Status refresh required after the command settles. */ effect?: VercelStatusEffect | { kind: "connection-added"; } | { kind: "model-access-changed"; }; } /** * Runs one TUI setup command (/model, /channels, /connect, /deploy) over the * shared setup flows, asking through the TUI's own bordered panel. Never throws: * every outcome — done, cancelled, failed — folds into the returned command * result. Ctrl-C or Esc on the working indicator (no question open) aborts the * active flow, then keeps command ownership until its subprocesses and setup * stack have unwound. */ export declare function runTuiSetupCommand(input: TuiSetupCommandInput): Promise<TuiSetupCommandResult>;