pub enum TuiAgentEvent {
Show 16 variants
StreamingStarted,
StreamingText(String),
StreamingThinking(String),
StreamingDone,
Error(String),
ToolCall {
name: String,
args_summary: String,
},
ToolResult {
name: String,
content: String,
is_error: bool,
},
ModeChanged(String),
ModelChanged(String),
TokenUpdate {
count: u64,
limit: Option<u64>,
},
StatsUpdate {
tool_calls: u64,
total_tokens: u64,
},
ContextWarning {
percentage: f64,
critical: bool,
},
SystemMessage(String),
ConfirmTool {
name: String,
args_summary: String,
needs_approval: bool,
diff_preview: Option<String>,
},
Question {
question: String,
answers: Vec<String>,
},
Done,
}Expand description
Events sent FROM the background agent task TO the TUI.
These drive UI updates: streaming text, tool call notifications, status changes, etc.
Variants§
StreamingStarted
The agent started streaming a response.
StreamingText(String)
A chunk of assistant text arrived during streaming.
StreamingThinking(String)
A chunk of thinking/reasoning text arrived during streaming.
StreamingDone
The agent finished streaming a response.
Error(String)
The agent encountered an error.
ToolCall
A tool call was made by the assistant.
ToolResult
A tool produced a result.
ModeChanged(String)
The agent mode changed.
ModelChanged(String)
The model name changed.
TokenUpdate
Token usage was updated.
StatsUpdate
Cumulative session stats updated (tool calls, total tokens).
ContextWarning
Context window warning triggered (70%+ or 90%+).
SystemMessage(String)
A system/info message to display.
ConfirmTool
The agent is requesting user confirmation for a tool call.
The TUI should show a confirmation prompt.
diff_preview contains a plain-text unified diff to display (for edit/write).
Question
The agent is asking a question (from the question signal tool).
Done
The agent loop has exited (clean shutdown).
Trait Implementations§
Source§impl Clone for TuiAgentEvent
impl Clone for TuiAgentEvent
Source§fn clone(&self) -> TuiAgentEvent
fn clone(&self) -> TuiAgentEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more