/** * Tiny, dependency-free terminal-UI kit for the interactive install flow. * * The install wizard is the one place a plugin talks to a human at a real * terminal, so it's worth making it look the part: colored status glyphs, * a framed intro banner, aligned key/value summaries, and highlighted menus. * Everything here degrades gracefully — colors and Unicode glyphs are emitted * only when the output is an interactive TTY that opts in, and collapse to * plain ASCII otherwise. That keeps the output copy-paste-clean in logs and, * crucially, byte-for-byte stable under test (where stdout isn't a TTY), so * the wizard's plain-text content can still be asserted on. * * No external dependency: adding a prompt/print library to `@ory/argus` would * push that weight onto every harness plugin that depends on core. A handful * of ANSI escapes is all this needs. */ /** * Whether ANSI color/style codes should be emitted. Honors the `NO_COLOR` * convention and `FORCE_COLOR`, treats `TERM=dumb` as uncolored, and otherwise * follows whether stdout is an interactive TTY. Evaluated per call so tests and * piped output (no TTY) stay plain without any global setup. */ export declare function colorEnabled(): boolean; /** * Color depth the terminal can render, used to pick the best representation of * the brand palette (see {@link brand}): * * 3 — 24-bit truecolor (`COLORTERM=truecolor|24bit`, or `FORCE_COLOR=3`): the * exact Ory hex values are emitted. * 2 — 256-color (`TERM` contains `256`, or `FORCE_COLOR=2`): the nearest * xterm-256 index. * 1 — basic 16-color: the nearest ANSI SGR code. * 0 — color disabled (see {@link colorEnabled}). * * Apple Terminal, for instance, advertises `xterm-256color` but not truecolor, * so it lands on level 2 and still gets a recognizably-indigo accent. */ export declare function colorLevel(): 0 | 1 | 2 | 3; /** ANSI text stylers. Each is a no-op passthrough when color is disabled. */ export declare const style: { bold: (s: string) => string; dim: (s: string) => string; italic: (s: string) => string; underline: (s: string) => string; red: (s: string) => string; green: (s: string) => string; yellow: (s: string) => string; blue: (s: string) => string; magenta: (s: string) => string; cyan: (s: string) => string; gray: (s: string) => string; }; /** * The Ory brand palette (from the 09/25 brand guidelines) as terminal stylers. * `indigo` (#4F46E5) is the primary accent used for the banner frame, menu * keys, prompts, and copyable commands; the others tint status lines. Values * are the guideline hex codes with hand-picked xterm-256 / ANSI-16 fallbacks. */ export declare const brand: { /** Ory Indigo #4F46E5 — primary accent. */ indigo: (s: string) => string; /** Green #22C55E — success. */ green: (s: string) => string; /** Yellow #FACC15 — warning. */ yellow: (s: string) => string; /** Rose #F43F5E — error. */ rose: (s: string) => string; }; /** Status/decoration glyphs, with ASCII fallbacks for legacy terminals. */ export declare const glyph: { success: string; warning: string; error: string; info: string; pending: string; bullet: string; arrow: string; pointer: string; gutter: string; }; /** Print a blank line. */ export declare function blank(): void; /** * Ring the terminal bell (BEL) to pull the user's attention back to the * terminal — e.g. right after a browser step, when their focus is still on the * browser and the next action is in the terminal. Most terminals turn this into * a dock bounce, tab badge, or attention flag. Written to stderr and only when * stderr is an interactive TTY, so it's a no-op when piped or under test. */ export declare function bell(): void; /** * Print a framed intro banner with a bold title and optional dim subtitle. * The frame width tracks the longest line's *plain* length so color codes * never throw off the alignment. */ export declare function banner(title: string, subtitle?: string): void; /** A bold section heading, preceded by a blank line to separate steps. */ export declare function heading(text: string): void; /** A success line in Ory green (task completed). */ export declare function success(text: string): void; /** An informational line accented in Ory indigo. */ export declare function info(text: string): void; /** A dim "work in progress" line. */ export declare function step(text: string): void; /** A warning line in Ory yellow, routed to stderr via console.warn. */ export declare function warning(text: string): void; /** A continuation/detail warning line indented under a preceding warning. */ export declare function warnDetail(text: string): void; /** An indented bullet under the current section. */ export declare function bullet(text: string): void; /** An indented, dimmed hint line. */ export declare function hint(text: string): void; /** An indented, indigo-highlighted shell command the user can copy-paste. */ export declare function command(text: string): void; /** Inline indigo style for a command referenced mid-sentence. */ export declare function inlineCommand(text: string): string; /** * Print an aligned key/value summary. Labels are dimmed and right-padded to a * common width (measured on plain text); values are emphasized. Skips pairs * whose value is null/undefined so callers can pass optional rows inline. */ export declare function summary(pairs: Array<[string, string | undefined | null]>): void; export interface MenuItem { /** The value the user types to pick this item (e.g. "1"). */ key: string; /** Short bold label. */ label: string; /** Dim one-line description shown after the label. */ description?: string; } /** * Print a numbered menu. The typed key is highlighted, the label bold, and the * description dimmed — the choice itself is still made by the caller's prompt, * so this only renders the options. */ export declare function menu(items: MenuItem[]): void; /** * Build a styled prompt string for readline. The question is bold, preceded by * a pointer glyph, and an optional default/hint is dimmed. Callers keep full * control of the answer parsing — this only affects presentation. */ export declare function promptLine(question: string, opts?: { hint?: string; }): string;