eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
98 lines (97 loc) • 4.34 kB
TypeScript
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, type RegistryPlannerContext } 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";
};
};
export type TuiSetupCommandRenderer = TuiPrompterRenderer & Pick<SetupFlowRenderer, "readProviderPicker" | "readModelEditor" | "setNavigation" | "waitForInterrupt">;
export type OnboardingScreenEvent = {
screen: "model_provider" | "model_settings" | "registry_channels" | "registry_integrations" | "registry_review" | "registry_install";
registrySelectedCount?: number;
};
export interface TuiSetupCommandInput {
command: TuiSetupCommand;
/** Project root for setup that changes shared dependencies, links, or environment files. */
appRoot: string;
/** Selected agent root whose authored settings are changed by `/model`. */
agentRoot?: string;
/** The renderer surface the TUI-native prompter drives. */
renderer: TuiSetupCommandRenderer;
/** Initial model-flow step authorized by the runner's boot evidence. */
initialModelStep?: "provider";
/** Registry address supplied by `/add <item>`, confirmed and installed directly. */
initialRegistryAddress?: string;
/** Presentation and navigation supplied by an enclosing setup journey. */
registryPlannerContext?: RegistryPlannerContext;
onOnboardingScreen?: (input: OnboardingScreenEvent) => void;
/** Live ChatGPT identity shown only inside model configuration UI. */
chatGptAccountLabel?: string;
/** Suspends development runtime artifacts while registry installation and setup mutate them. */
withExclusiveTerminal?<T>(task: () => Promise<T>): Promise<T>;
createPrompter?: (renderer: TuiPrompterRenderer) => Prompter;
/** Test seam; defaults to the real setup flows. */
flows?: Partial<TuiSetupFlows>;
}
export interface TuiSetupFlows {
runInstallVercelCliFlow: typeof runInstallVercelCliFlow;
runLoginFlow: typeof runLoginFlow;
runModelFlow: typeof runModelFlow;
runRegistryFlow: typeof runRegistryFlow;
runDeployFlow: typeof runDeployFlow;
}
export interface TuiSetupCommandResult {
message: string;
/** The user dismissed this setup step without completing it. */
cancelled?: true;
/** Keep settled batch results instead of replacing them with an interrupt notice. */
partial?: true;
/** 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<TuiSetupCommandResult>;