1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Interactive prompts for guided CLI flows.
//!
//! A cohesive input layer beside [`crate::render`] and [`crate::theme`]: it asks
//! a question plus a fixed set of [`Choice`]s and returns a typed answer, reusing
//! the resolved [`Palette`](crate::theme::Palette) and [`Glyphs`](crate::theme::Glyphs)
//! so styling honours `NO_COLOR`, TTY, and UTF-8 detection exactly like the rest
//! of the CLI layer.
//!
//! Prompts speak through a [`Terminal`] seam rather than raw stdio, so the same
//! question renders as a numbered list over a pipe, as a live arrow-key widget on
//! a TTY, or as a scripted sequence in a test — without the calling code changing.
//!
//! # Modules
//!
//! - [`choice`] — [`Choice`] and its stable [`ChoiceId`].
//! - [`mode`] — [`PromptMode`] interactive/non-interactive resolution.
//! - [`key`] — the [`Key`] keystroke vocabulary for key-driven terminals.
//! - [`validate`] — the [`Validator`] trait for re-asking on invalid input.
//! - [`terminal`] — the [`Terminal`] seam: line, rich (raw-mode), and scripted media.
//! - [`render`] — shared choice/frame rendering used by every terminal.
//! - [`kinds`] — one behavioural module per question type.
//! - [`prompter`] — the [`Prompter`] driver and its question methods.
//!
//! # Interaction models
//!
//! One set of prompt-kind logic drives three realities, chosen automatically:
//!
//! - a **line** terminal (cooked stdio) prints a numbered list and reads a typed
//! answer — always available, dependency-free, and pipe-friendly;
//! - a **rich** terminal (raw mode, behind the `interactive` feature) reads
//! arrow keys and space to drive live radio and checkbox lists;
//! - a **scripted** terminal replays canned keys or lines for deterministic tests.
//!
//! [`Prompter::from_env`] selects rich when a TTY is present and the feature is
//! compiled, else line; tests bind a
//! [`ScriptedTerminal`] directly.
//!
//! # Non-interactive fallback
//!
//! The driver resolves its behaviour once, up front, from a [`PromptMode`]:
//!
//! - [`PromptMode::Interactive`] — render prompts and read answers.
//! - [`PromptMode::NonInteractive`] — never block: each question resolves to its
//! declared default (the `recommended` [`Choice`] for a selection, the supplied
//! default for a confirm/text). A required question with no default is a typed
//! [`AppError`](rskit_errors::AppError) rather than an invented answer or a hang.
pub use ;
pub use Key;
pub use PromptMode;
pub use Prompter;
pub use ;
pub use ;
pub use RichTerminal;