/** * Terminal IO for interactive commands (GUIDELINES §3) — the ONE place the prompting contract * lives: TTY gate (piped/headless stdin must opt into --ci), loud EOF failure (never a silent * exit 0), Ctrl-C → exit 130. Every interactive command builds its WizardIO here; domain * modules only ever see the injected interface. */ import { type Interface } from "node:readline/promises"; import type { PublishIO } from "../hosting/publish"; import type { WizardIO } from "../hosting/wizard"; /** * The prompting contract, attachable to ANY readline this package creates (createPromptIO here, * interactiveLogin in login.ts): stdin closing mid-flow fails loudly (never a silent exit 0), * and Ctrl-C — which readline raw mode otherwise swallows — exits 130. Returns a release() * for callers that deliberately rl.close() on success (a released guard must not fire). */ export declare function attachPromptGuards(rl: Interface, kind: string, doing: string): () => void; /** * Hidden-input prompt (secret values — GUIDELINES §3: never argv, never echoed). Raw-mode * character read with no echo; Enter resolves, Ctrl-C exits 130, backspace edits. Pass the * active readline (if any) so it is paused around the raw read and the two never contend * for stdin. Non-TTY stdin (CI pipes) falls back to a plain line read — nothing to echo. */ export declare function askHidden(question: string, rl?: Interface): Promise; export declare function createPromptIO(kind: string, ci: boolean): WizardIO; /** * `clustly destroy`'s confirmation gate — irreversible (unlists + tears down hosting), so it * deliberately does NOT reuse the shared `confirm()` contract: `CONFIRM_YES` treats a bare * Enter as yes, which is exactly the accidental-double-Enter failure mode a destructive * command must not have. The operator must type the literal word `destroy` (Heroku/Terraform * convention) — anything else, including empty input, declines. Same TTY gate / loud-EOF / * Ctrl-C contract as every other prompting IO; `--yes` bypasses this entirely (never a * default — the caller must ask for it explicitly). */ export declare function createDestroyConfirmIO(skipConfirm: boolean): { confirmDestroy: () => Promise; done: () => void; }; /** * The typed-confirmation gate, for ANY one-way command — `destroy` above, and `identity * claim`, which moves an NFT out of Clustly custody permanently. Reusing the shared * `confirm()` there was the review's finding (2026-08-29): its bare-Enter default is yes, * the exact accidental-double-Enter failure this contract exists to prevent. */ export declare function createTypedConfirmIO(command: string, word: string, skipConfirm: boolean): { confirmDestroy: () => Promise; done: () => void; }; /** * The publish command's prompting IO — same contract as createPromptIO (TTY gate, loud EOF, * Ctrl-C 130), plus a plain `ask` with a visible default. `done()` releases the guards and * closes the readline (a released guard must not fire on the deliberate success-close). */ export declare function createPublishIO(ci: boolean): { io: PublishIO; done: () => void; };