Message store for virtualized chat history.
This module provides data structures and management for message virtualization, allowing the CLI to handle large message histories efficiently by keeping only a sliding window of widgets in the DOM while storing all message data as lightweight dataclasses.
The approach is inspired by Textual's Log widget, which only keeps N lines
in the DOM and recreates older ones on demand.
Types of messages in the chat.
Status of a tool call.
In-memory message data for virtualization.
This dataclass holds all information needed to recreate a message widget. It is designed to be lightweight so that thousands of messages can be stored without meaningful memory overhead.
Manages message data and widget window for virtualization.
This class stores all messages as data and manages a sliding window of widgets that are actually mounted in the DOM.