import type { ScaffoldError, ScaffoldWarning } from '../../types/index.js'; import type { OutputMode } from '../../types/index.js'; import { ExitCode } from '../../types/enums.js'; import type { TerminalError } from '../../types/errors.js'; export type SelectOption = string | { value: string; label?: string; short?: string; }; export interface OutputContext { success(message: string): void; info(message: string): void; warn(warning: ScaffoldWarning | string): void; error(error: ScaffoldError | string): void; result(data: unknown): void; /** * Terminal failure. In json mode this writes the failure envelope to stdout * so a caller always has something to parse; in interactive/auto mode it * delegates to error() so human output is unchanged. * * Required, not optional, on purpose: an optional method would let a command * silently skip emitting the envelope, which is the defect this exists to * remove. `exitCode` defaults to the first error's, then ValidationError. */ fail(errors: TerminalError[], exitCode?: ExitCode): void; supportsInteractivePrompts(): boolean; prompt(message: string, defaultValue: T, help?: { short?: string; }): Promise; confirm(message: string, defaultValue?: boolean, help?: { short?: string; }): Promise; /** Single-choice selection from a list of options. */ select(message: string, options: SelectOption[], defaultValue?: string, help?: { short?: string; long?: string; }): Promise; /** Multi-choice selection from a list of options. Returns selected items. */ multiSelect(message: string, options: SelectOption[], defaults?: string[], help?: { short?: string; long?: string; }): Promise; /** Comma-separated text input returning an array of trimmed strings. */ multiInput(message: string, defaultValue?: string[], help?: { short?: string; }): Promise; startSpinner(message: string): void; stopSpinner(success?: boolean): void; startProgress(total: number, label: string): void; updateProgress(current: number): void; stopProgress(): void; } export { type OutputMode }; export declare function createOutputContext(mode: OutputMode): OutputContext; /** * Emit the "no .scaffold/ here" failure through the envelope and exit. * * Five sites reported this by writing to stderr and calling process.exit() * BEFORE any output context existed, so `--format json` produced a non-zero * exit with empty stdout. It is the single most common failure an agent hits * (running any command outside a project), which made it the worst one to * leave unparseable. * * Sets `process.exitCode` and returns rather than calling `process.exit()`: * exiting immediately after writing can truncate buffered stdout, which would * recreate the empty-output failure this helper exists to remove. Every caller * returns straight after invoking it. */ export declare function exitNotInitialized(argv: { format?: string; auto?: boolean; }): void; //# sourceMappingURL=context.d.ts.map