termcinema_engine/core/
content.rs

1/// Content specification: raw text input, unstructured.
2///
3/// This struct holds the full source text before any parsing.
4/// It's the entry point for content-level rendering.
5///
6/// Used by: tokenizer, layout generator, renderer, etc.
7pub struct ContentSpec {
8    /// Raw textual content to be rendered (unparsed).
9    pub text: String,
10}
11
12/// Logical units extracted from script-mode text input.
13///
14/// This enum represents building blocks of a CLI "story":
15///
16/// - [`Prompt`]    → e.g. `"user@host:~$"` shell prompt;
17/// - [`Command`]   → e.g. `"ls -al"` typed command;
18/// - [`Output`]    → e.g. `["file1", "file2", ...]` rendered result.
19///
20/// Used internally during parsing and grouping stages.
21#[derive(Debug)]
22pub(crate) enum ScriptBlock {
23    Prompt(String),
24    Command(String),
25    Output(Vec<String>),
26}
27
28/// Grouped command entry with associated I/O segments.
29///
30/// This struct bundles together the prompt, command, and
31/// its corresponding output lines as a single renderable block.
32///
33/// It is the core abstraction unit used in `script` mode playback.
34#[derive(Debug)]
35pub struct CommandGroup {
36    /// Shell-like prompt string (e.g. `"user@host:~$"`).
37    pub prompt: String,
38    /// Command string typed by user (e.g. `"echo hello"`).
39    pub command: String,
40    /// Output lines returned by the command.
41    pub output: Vec<String>,
42}