eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
80 lines (79 loc) • 3.26 kB
TypeScript
import { runChannelsFlow } from "#setup/flows/channels.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: {
title: string;
indicator: "spinner";
};
login: {
title: string;
indicator: "spinner";
};
model: {
title: string;
indicator: "pulse";
};
channels: {
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, "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";
/** 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;
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: "model-access-changed";
};
}
/**
* Runs one TUI setup command (/model, /channels, /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>;