import type { AgentDependencies } from "./agents.js"; import { type SelectOption, type TextOptions } from "./clack-theme.js"; export declare class InteractiveCancelled extends Error { constructor(); } /** * There is no terminal, so a question cannot be asked. Every one of these names * the flags that would have answered it, and the command exits 2 (Stripe's and * eas's shape: say the next step, never print a usage block). */ export declare class HeadlessPrompt extends Error { readonly flags: readonly string[]; private readonly step?; constructor(message: string, flags: readonly string[], step?: string | undefined); /** The one thing to run next: the flags, or the sentence a caller gave instead. */ get nextStep(): string; } export interface InteractiveSpinner { start(message: string): void; stop(message: string): void; } export type { SelectOption, TextOptions } from "./clack-theme.js"; /** * Every question is a single choice or a yes/no with a highlighted default, * and Enter takes the default (the sixteen CLIs walked on 2026-09-12, * _artifacts/cli-connect-design-20260912.md: "Nobody multi-selects"). */ export interface InteractivePrompts { /** `initialValue` is the option Enter takes; the first one when absent. */ select(message: string, options: SelectOption[], initialValue?: string): Promise; /** `hint` is one dim line under the question (Hermes: "Add later with `hermes mcp add`"). */ confirm(message: string, options?: { initialValue?: boolean; hint?: string; }): Promise; password(message: string): Promise; /** Enter with nothing typed answers "" (the placeholder is what that means); `validate` refuses a typed answer with one line. */ text(message: string, initialValue: string, options?: TextOptions): Promise; info(message: string): void; /** The opening and closing bars of one Clack session. */ intro(message: string): void; outro(message: string): void; /** A finished step: the same diamond the prompts leave behind. */ step(message: string): void; /** A sentence inside the gutter that is neither a question nor a step. */ message(message: string): void; spinner(): InteractiveSpinner; } export declare function clackPrompts(info: (message: string) => void): InteractivePrompts; /** * The terminal and the flags decide, and nothing else. All 27 command-line tools * measured on 2026-09-09 ignore `CI` and its relatives and key on whether stdin * is a terminal, so a person on a machine that happens to export `CI` still gets * the menus, and a script that owns a terminal still gets none when it says so. */ export declare function interactiveAllowed(argv: readonly string[], tty: boolean): boolean; /** Named the flag, in either spelling. */ export declare const nonInteractiveRequested: (argv: readonly string[]) => boolean; export type InteractiveEntry = "root" | "agents" | "auth"; export declare function interactiveEntry(argv: readonly string[]): { entry: InteractiveEntry; prefix: string[]; } | undefined; export declare function chooseInteractiveCommand(entry: InteractiveEntry, prefix: string[], deps: AgentDependencies, ui: InteractivePrompts): Promise; //# sourceMappingURL=interactive.d.ts.map