/** * The guided form of `cotal meshes add` — a bare `cotal meshes add` on a terminal. * * It exists because the flag form asks the operator to already know four things: the broker * address, whether that broker authenticates, which space name to use, and that credentials must * be copied locally first. Three of those the machine can find out, so this asks for the ONE that * cannot be derived (the address), then probes and reports what it learned. Every question after * that is a choice between real options rather than free text: the space names come from the trust * actually on disk, and the mode is stated as a fact about the broker, never asked. * * The rules are not re-implemented here. Every decision goes through `meshes-add.ts`, so the * guided and flag forms cannot drift; this module owns presentation and recovery only — which * failures offer a way out (a wrong URL is worth retyping; a mesh that is simply down is worth * recording anyway) instead of ending the command. */ /** * The prompts, as an interface rather than direct clack calls. * * Not indirection for its own sake: the wizard's VALUE is its control flow — does a name that came * from the command line still hit the clash gate, does "point at a different folder" actually ask * for one, does a replacement still get verified — and every one of those questions was answered * wrong at least once. None of it is reachable by a test that cannot answer a prompt, so the review * that caught those bugs was doing work the suite structurally could not. With the prompts injected, * a test drives the real function with scripted answers and asserts what it asked and what it wrote. */ export interface WizardIO { intro(message: string): void; outro(message: string): void; note(body: string, title: string): void; cancel(message: string): void; log: { info(m: string): void; warn(m: string): void; error(m: string): void; }; spinner(): { start(m: string): void; stop(m: string): void; }; text(opts: { message: string; placeholder?: string; validate?: (v: string | undefined) => string | undefined; }): Promise; select(opts: { message: string; options: { value: T; label: string; hint?: string; }[]; }): Promise; confirm(opts: { message: string; initialValue?: boolean; }): Promise; } /** The real terminal, via clack. Cancellation (Ctrl-C / Esc) exits here rather than returning a * sentinel the wizard body would have to thread through every branch. */ export declare function clackIO(): WizardIO; /** Whether a guided run is possible at all: both ends of the pipe must be a real terminal. Without * this a missing flag would hang a script waiting on input nobody is there to give; the flag form * keeps failing loud instead. */ export declare function canPrompt(): boolean; /** Pre-filled from whatever the command line already supplied, so a half-typed command completes * itself rather than starting over. */ export interface WizardSeed { space?: string; server?: string; root?: string; mode?: string; force?: boolean; /** Pre-accepted overlay tunnel dependency (the flag form's `--allow-unencrypted-overlay`). */ allowUnencryptedOverlay?: boolean; } /** Run the guided registration. Returns false if the operator backed out (the caller exits 0 — * cancelling is not a failure). */ export declare function addWizard(seed: WizardSeed, cwd: string, io?: WizardIO): Promise; //# sourceMappingURL=meshes-wizard.d.ts.map