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 { runRegistryFlow } from "#setup/flows/registry.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"; }; add: { 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; 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"; /** Suspends development runtime artifacts while registry installation and setup mutate them. */ withExclusiveTerminal?(task: () => Promise): Promise; /** 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; } /** The flow entry points the commands dispatch to, injectable for tests. */ export interface TuiSetupFlows { runInstallVercelCliFlow: typeof runInstallVercelCliFlow; runLoginFlow: typeof runLoginFlow; runModelFlow: typeof runModelFlow; runRegistryFlow: typeof runRegistryFlow; runDeployFlow: typeof runDeployFlow; } export interface TuiSetupCommandResult { message: string; /** Promotes an outcome to a top-level status. */ tone?: "success" | "error"; /** Keep warning/error lines after the bordered panel closes. */ preserveFlowDiagnostics: boolean; /** Status refresh required after the command settles. */ effect?: VercelStatusEffect | { kind: "model-access-changed"; }; } /** * Runs one TUI setup command (/model, /add, /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;