pub enum AppEvent {
Show 57 variants
Terminal(Event),
Key(KeyEvent),
Resize(u16, u16),
ScrollUp,
ScrollDown,
MouseDown {
col: u16,
row: u16,
},
MouseDrag {
col: u16,
row: u16,
},
MouseUp {
col: u16,
row: u16,
},
FocusGained,
Tick,
AgentStarted,
AgentChunk(String),
AgentMessage(ChatMessage),
AgentFinished,
AgentError(String),
ToolStarted {
tool_id: String,
tool_name: String,
args: HashMap<String, Value>,
},
ToolOutput {
tool_id: String,
output: String,
},
ToolResult {
tool_id: String,
tool_name: String,
output: String,
success: bool,
args: HashMap<String, Value>,
},
ToolFinished {
tool_id: String,
success: bool,
},
ToolApprovalRequired {
tool_id: String,
tool_name: String,
description: String,
},
ToolApprovalRequested {
command: String,
working_dir: String,
response_tx: Sender<ToolApprovalDecision>,
},
AskUserRequested {
question: String,
options: Vec<String>,
default: Option<String>,
response_tx: Sender<String>,
},
SubagentStarted {
subagent_id: String,
subagent_name: String,
task: String,
cancel_token: Option<CancellationToken>,
},
SubagentToolCall {
subagent_id: String,
subagent_name: String,
tool_name: String,
tool_id: String,
args: HashMap<String, Value>,
},
SubagentToolComplete {
subagent_id: String,
subagent_name: String,
tool_name: String,
tool_id: String,
success: bool,
},
SubagentFinished {
subagent_id: String,
subagent_name: String,
success: bool,
result_summary: String,
tool_call_count: usize,
shallow_warning: Option<String>,
},
SubagentTokenUpdate {
subagent_id: String,
subagent_name: String,
input_tokens: u64,
output_tokens: u64,
},
ReasoningContent(String),
ReasoningBlockStart,
TaskProgressStarted {
description: String,
},
TaskProgressFinished,
BudgetExhausted {
cost_usd: f64,
budget_usd: f64,
},
FileChangeSummary {
files: usize,
additions: u64,
deletions: u64,
},
ContextUsage(f64),
CompactionStarted,
CompactionFinished {
success: bool,
message: String,
},
PlanApprovalRequested {
plan_content: String,
response_tx: Sender<PlanDecision>,
},
UserSubmit(String),
Interrupt,
SetInterruptToken(InterruptToken),
AgentInterrupted,
ModeChanged(String),
KillTask(String),
AgentBackgrounded {
task_id: String,
query_summary: String,
},
BackgroundAgentCompleted {
task_id: String,
success: bool,
result_summary: String,
full_result: String,
cost_usd: f64,
tool_call_count: usize,
},
BackgroundAgentProgress {
task_id: String,
tool_name: String,
tool_count: usize,
},
BackgroundAgentKilled {
task_id: String,
},
BackgroundNudge {
content: String,
},
BackgroundAgentActivity {
task_id: String,
line: String,
},
SetBackgroundAgentToken {
task_id: String,
query: String,
session_id: String,
interrupt_token: InterruptToken,
},
SnapshotTaken {
hash: String,
},
UndoResult {
success: bool,
message: String,
},
RedoResult {
success: bool,
message: String,
},
ShareResult {
path: String,
},
FileChanged {
paths: Vec<String>,
},
SessionTitleUpdated(String),
Quit,
}Expand description
Application-level events consumed by the main event loop.
Variants§
Terminal(Event)
Raw terminal event from crossterm.
Key(KeyEvent)
Key press (extracted from terminal event for convenience).
Resize(u16, u16)
Terminal resize.
ScrollUp
Mouse-wheel scroll up.
ScrollDown
Mouse-wheel scroll down.
MouseDown
Mouse button pressed at (col, row).
MouseDrag
Mouse dragged to (col, row) while button held.
MouseUp
Mouse button released at (col, row).
FocusGained
Terminal regained focus (user switched back to this tab/window).
Tick
Tick for periodic UI updates (spinner animation, etc.).
AgentStarted
Assistant started generating a response.
AgentChunk(String)
Streaming text chunk from the assistant.
AgentMessage(ChatMessage)
Complete assistant message received.
AgentFinished
Agent finished the current turn.
AgentError(String)
Agent encountered an error.
ToolStarted
A tool execution started.
ToolOutput
A tool produced output.
ToolResult
A tool produced its final result.
ToolFinished
A tool execution completed.
ToolApprovalRequired
Tool requires user approval (legacy, no channel — kept for recording compatibility).
ToolApprovalRequested
Tool approval request with bidirectional channel.
AskUserRequested
Ask-user request with bidirectional channel.
SubagentStarted
A subagent started executing.
Fields
cancel_token: Option<CancellationToken>SubagentToolCall
A subagent made a tool call (for nested display).
Fields
SubagentToolComplete
A subagent tool call completed.
SubagentFinished
A subagent finished its task.
Fields
SubagentTokenUpdate
Token usage update from a subagent’s LLM call.
ReasoningContent(String)
Native reasoning content from LLM response (inline thinking).
ReasoningBlockStart
A new reasoning/thinking block started (separator between interleaved blocks).
TaskProgressStarted
Agent started working on a task (shows progress bar).
TaskProgressFinished
Agent finished the current task (hides progress bar).
BudgetExhausted
Session cost budget has been exhausted. The agent loop should pause.
FileChangeSummary
File change summary after a query completes.
ContextUsage(f64)
Context window usage percentage updated (0.0–100.0).
CompactionStarted
Manual compaction started (shows compaction spinner).
CompactionFinished
Manual compaction finished (hides compaction spinner, shows result).
PlanApprovalRequested
Plan approval request arrived from the PresentPlanTool. Contains the plan content to display and the oneshot sender for the decision.
UserSubmit(String)
User submitted a message.
Interrupt
User requested interrupt (Escape).
SetInterruptToken(InterruptToken)
Set the interrupt token for the current query (sent by agent backend).
AgentInterrupted
Agent run was interrupted (sent by agent backend after cancellation).
ModeChanged(String)
Mode changed (normal/plan).
KillTask(String)
Kill a background task by ID.
AgentBackgrounded
An agent was moved to the background via Ctrl+B.
BackgroundAgentCompleted
A background agent completed its work.
Fields
BackgroundAgentProgress
Progress update from a background agent.
BackgroundAgentKilled
A background agent was killed.
BackgroundNudge
LLM-generated nudge message after backgrounding agents.
BackgroundAgentActivity
Activity line from a background agent (tool call, reasoning, etc.).
SetBackgroundAgentToken
Register a background agent task with its interrupt token (sent from tui_runner).
SnapshotTaken
Snapshot was taken (stores tree hash for undo stack).
UndoResult
Undo result from the runtime.
RedoResult
Redo result from the runtime.
Share result from the runtime.
FileChanged
File watcher detected changes.
SessionTitleUpdated(String)
Session title was auto-detected by the topic detector.
Quit
Quit the application.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppEvent
impl !RefUnwindSafe for AppEvent
impl Send for AppEvent
impl Sync for AppEvent
impl Unpin for AppEvent
impl UnsafeUnpin for AppEvent
impl !UnwindSafe for AppEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more