baml_agent_tui/event.rs
1use crossterm::event::Event;
2
3/// Core TUI events shared across all agent apps.
4///
5/// Projects can extend this with their own events using the `Custom(T)` variant.
6pub enum AppEvent<T = ()> {
7 /// Terminal UI event (key press, mouse, resize).
8 Ui(Event),
9 /// Periodic tick for animations/spinners.
10 Tick,
11 /// Streaming text chunk from LLM (append to current message).
12 StreamChunk(String),
13 /// Complete agent response message.
14 AgentMessage(String),
15 /// Agent plan updates.
16 AgentPlan(Vec<String>),
17 /// Agent finished processing.
18 AgentDone,
19 /// A file was modified by a tool (for preview refresh, git status, etc.).
20 FileModified(String),
21 /// Project-specific custom event.
22 Custom(T),
23}