Skip to main content

Module interactive

Module interactive 

Source
Expand description

Phase 4 interactive mode view-model.

Stateless presentation layer for the interactive terminal product. Owns no live agent-session handle and performs no session I/O. Consumes a pure data snapshot (ViewState) and composes pi-tui components into a Ratatui buffer in the exact order required by the reference interactive mode:

header → resources → chat → pending → status
       → widgets above → editor → widgets below → footer

The runtime event loop (a later phase) owns a ViewState, feeds [ViewAction]s back into it, and calls compose / render_view to paint. Everything here is terminal-free and stdout-free so it is fully testable against golden buffer snapshots.

Re-exports§

pub use theme::ColorMode;
pub use theme::ResolvedTheme;
pub use theme::ThemeBg;
pub use theme::ThemeColor;
pub use theme::ThemeError;
pub use theme::ThemeJson;
pub use tool_renderer::CustomToolRenderer;
pub use tool_renderer::ToolCallView;
pub use tool_renderer::ToolRenderError;
pub use tool_renderer::ToolResultView;
pub use tool_renderer::ToolState;
pub use input::DoubleEscapeAction;
pub use input::InputMapper;
pub use input::InputState;
pub use runtime::BACKGROUND_COALESCE_WINDOW;
pub use runtime::DRAW_TIMEOUT;
pub use runtime::EVENT_CHANNEL_CAPACITY;
pub use runtime::EventSubscription;
pub use runtime::InteractiveExit;
pub use runtime::InteractiveRuntime;
pub use runtime::InteractiveRuntimeOptions;
pub use runtime::SessionHost;
pub use runtime::SessionSnapshot;
pub use runtime::SharedWriter;
pub use runtime::mock_input;

Modules§

footer
Footer status-bar view-model.
header
Header view-model (logo + key hints).
input
App-level input dispatch: maps UiEvents into [ViewAction]s.
messages
Chat message view-models and component builders.
progress
Progress view-models: OAuth login progress, compaction/retry/bash progress, and the pending (steering/follow-up) queue.
runtime
Live interactive runtime: owns the Tui writer, the TerminalInput reader, a SessionHost, and the ViewState projection.
selectors
Selector view-models (model / session / tree / settings / config / auth / scoped).
startup
Startup surfaces: loaded resources summary, diagnostics, first-time setup, shortcut overlay, and release-notes/changelog.
status
Status indicator view-model (working / retry / compaction / branch).
theme
Product theme: resolved colors, built-in defaults, JSON loading, and conversion to pi-tui component themes.
tool_renderer
Custom tool renderer adapter.

Structs§

ComposedSection
One composed section: a label + the boxed component.
ComposedView
The full composed view: ordered sections + optional overlay.
ViewState
Top-level interactive view-model state (the data behind one paint).

Enums§

EventResult
Re-export of the pi-tui component contract for downstream callers. Result of dispatching a UiEvent to a component.
UiEvent
Re-export of the pi-tui component contract for downstream callers. Closed UI event set consumed by components and the terminal event loop.

Traits§

Component
Re-export of the pi-tui component contract for downstream callers. Height-for-width terminal component.

Functions§

compose
Compose the full view-model into ordered sections for state.
render_view
Render the composed view into a fresh buffer of width × height.
render_view_with_height
Render into a buffer sized to exactly the measured content height (no fixed height cap). Useful for golden snapshots that want the full content.