Expand description
*messages* transcript types – one historical record per
editor echo, a bounded ring of them, and a typed
MessagePushed event published whenever a new record
lands.
Lives in lattice-runtime so any host-side crate that
cares about message stream events (TUI, GPU renderer,
plugin host, telemetry) can subscribe without taking a
dependency on the renderer crate. The wire-typed
lattice_grammar::EchoLevel rides through unchanged so
grammar / runtime / plugin code all read the same severity
enum without round-tripping through a display-typed clone.
Plugins via the WASM Component Model subscribe through the
plugin host’s WIT bridge – the host wires
event_bus.subscribe_typed::<MessagePushed>(...) and
marshals each record into the plugin’s WIT struct. The
Rust type’s location here is purely for in-process Rust
consumers; plugins never import this module directly.
Structs§
- Message
Pushed - Typed event published on the editor’s event bus whenever
set_messageruns. Carries the appended record (cloned from the ring). Subscribers see every echo in arrival order; the renderer’s*messages*buffer live tail, the plugin host’s WIT bridge, future telemetry hooks, etc. are all peer subscribers with no privileged path. - Message
Record - One historical minibuffer echo. The renderer’s
*messages*buffer renders these in chronological order; eachset_messagecall appends one record. Cheap to clone (bounded text) – producers fan the same record out to every subscriber on the typed event bus. - Messages
Ring - Bounded chronological ring of every echo the editor has
emitted. Push on every
set_message; snapshot on demand for:messagesopen and live refresh. Capacity is fixed at construction; once full, the oldest entry drops to make room for the newest.