Crate ailloli_ui_terminal_core

Source
Expand description

Pure terminal parsing, state, diagnostics, snapshot, and replay model.

The crate incrementally parses a supported VT subset into an inspectable grid, tracks shell/command metadata, classifies common output diagnostics, and produces bounded agent-facing snapshots. It intentionally performs no PTY or process I/O, clipboard I/O, rendering, window integration, or application- specific orchestration.

Constructors establish nonzero rectangular grids and bounded scrollback, but most model fields are public and several types deserialize without validation. Treat untrusted serialized state as data to validate before mutation. Snapshot redaction is best-effort and has explicitly documented coverage gaps.

§Examples

use ailloli_ui_terminal_core::{TerminalParser, TerminalState, VteTerminalParser};

let mut state = TerminalState::new();
let mut parser = VteTerminalParser::new();
parser.advance(&mut state, b"hello \x1b[31mworld");
assert!(state.screen.lines[0].plain_text().starts_with("hello world"));

Re-exports§

pub use cell::CellWidth;
pub use cell::TerminalCell;
pub use cursor::TerminalCursor;
pub use cursor::TerminalCursorShape;
pub use damage::TerminalDamage;
pub use diagnostics::terminal_visual_line_global_indices;
pub use diagnostics::TerminalDiagnostic;
pub use diagnostics::TerminalDiagnosticEvent;
pub use diagnostics::TerminalDiagnosticId;
pub use diagnostics::TerminalDiagnosticKind;
pub use diagnostics::TerminalDiagnosticSeverity;
pub use diagnostics::TerminalFileLocation;
pub use diagnostics::TerminalOutputClassification;
pub use diagnostics::TerminalOutputClassifier;
pub use diagnostics::TerminalSourceRange;
pub use hyperlink::TerminalHyperlinkId;
pub use line::TerminalLine;
pub use mode::TerminalModes;
pub use mode::TerminalMouseTrackingMode;
pub use parser::TerminalParser;
pub use parser::VteTerminalParser;
pub use screen::TerminalScreen;
pub use scrollback::TerminalScrollback;
pub use security::TerminalSecurityPolicy;
pub use shell::shell_integration_script;
pub use shell::CommandExecution;
pub use shell::CommandId;
pub use shell::CommandOutputRange;
pub use shell::CommandStatus;
pub use shell::PromptDetector;
pub use shell::ShellEvent;
pub use shell::ShellExecutionState;
pub use shell::ShellKind;
pub use shell::TerminalProcessStatus;
pub use shell::TerminalShellSnapshot;
pub use size::TerminalSize;
pub use snapshot::CommandSummary;
pub use snapshot::TerminalEventKind;
pub use snapshot::TerminalEventLog;
pub use snapshot::TerminalEventRecord;
pub use snapshot::TerminalRedactionPolicy;
pub use snapshot::TerminalRedactionRule;
pub use snapshot::TerminalReplayResult;
pub use snapshot::TerminalSnapshot;
pub use snapshot::TerminalSnapshotCell;
pub use snapshot::TerminalSnapshotConfig;
pub use snapshot::TerminalSnapshotCursor;
pub use snapshot::TerminalSnapshotLine;
pub use state::ActiveScreen;
pub use state::TerminalConfig;
pub use state::TerminalResizePolicy;
pub use state::TerminalState;
pub use style::TerminalColor;
pub use style::TerminalStyle;
pub use warning::TerminalWarning;
pub use warning::TerminalWarningKind;

Modules§

cell
Styled terminal grid cells and wide-character occupancy markers.
cursor
Terminal cursor position, visibility, and presentation shape.
damage
Renderer-facing terminal damage tracking.
diagnostics
Deterministic heuristic classification of terminal output into IDE diagnostics.
hyperlink
OSC 8 terminal hyperlink identities and payloads.
line
Fixed-width terminal rows and in-row editing primitives.
mode
DEC/ANSI terminal input and rendering mode flags.
parser
Incremental VT byte parsing into TerminalState.
screen
Rectangular terminal screen buffer and bounded editing operations.
scrollback
Bounded FIFO storage for terminal history lines.
security
Explicit allow/deny policy for terminal-originated side effects.
shell
Pure shell prompt, process, command-history, and integration-event state.
size
Terminal grid dimensions in rows and columns.
snapshot
Bounded, serializable terminal snapshots and replayable event logs.
state
Mutable terminal model, cursor operations, screen switching, and reflow.
style
Provider-neutral terminal colors and SGR text attributes.
warning
Non-fatal parser, policy, encoding, and sizing warnings.