//! # capo-tui
//!
//! Terminal UI rendering for the Capo coding agent. Built on `ratatui`
//! using an Elm-style MVU architecture:
//! - [`state`] holds the pure model;
//! - [`update`] is a pure function from `(state, event) -> Vec<Command>`;
//! - [`render`] is a pure function from `state -> frame`.
//!
//! The runtime is driven by [`run_tui`], which merges crossterm input, a
//! tick timer, and a caller-supplied `UiEvent` stream.

#![forbid(unsafe_code)]

pub mod composer_parser;
pub mod events;
pub mod file_index;
pub mod markdown;
pub mod render;
pub mod runtime;
pub mod settings_editor;
pub mod slash;
pub mod state;
pub mod theme;
pub mod update;
pub mod widgets;

// Re-export protocol types so binary code can say `use capo_tui::{UiEvent, Command};`
pub use capo_agent::{
    Command, Decision, PermissionChoice, PermissionResolution, ProgressChunk, UiEvent, UiToolResult,
};

pub use runtime::{run_tui, TuiError};
pub use state::AppState;
