import inquirer from "inquirer"; export async function confirm(message: string): Promise { const { result } = await inquirer.prompt([ { type: "confirm", name: "result", message, default: true, }, ]); return result; } export async function input( message: string, defaultValue = "" ): Promise { const { result } = await inquirer.prompt([ { type: "input", name: "result", message, default: defaultValue, }, ]); return result; } export async function password(message: string): Promise { const { result } = await inquirer.prompt([ { type: "password", name: "result", message, }, ]); return result; } export async function select( message: string, choices: readonly T[], defaultIndex = 0 ): Promise { const { result } = await inquirer.prompt([ { type: "list", name: "result", message, choices: choices.map((c) => ({ name: c, value: c })), default: choices[defaultIndex], }, ]); return result; } export async function checkbox( message: string, choices: readonly T[] ): Promise { const { result } = await inquirer.prompt([ { type: "checkbox", name: "result", message, choices: choices.map((c) => ({ name: c, value: c })), }, ]); return result; } export async function providerSelection(): Promise<"zai" | "minimax"> { return select("Select API provider:", ["zai", "minimax"] as const, 0); } export async function modelSelection( models: readonly string[] ): Promise { return select("Select model:", models, 0); }