Skip to main content

AppEvent

Enum AppEvent 

Source
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).

Fields

§col: u16
§row: u16
§

MouseDrag

Mouse dragged to (col, row) while button held.

Fields

§col: u16
§row: u16
§

MouseUp

Mouse button released at (col, row).

Fields

§col: u16
§row: u16
§

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.

Fields

§tool_id: String
§tool_name: String
§

ToolOutput

A tool produced output.

Fields

§tool_id: String
§output: String
§

ToolResult

A tool produced its final result.

Fields

§tool_id: String
§tool_name: String
§output: String
§success: bool
§

ToolFinished

A tool execution completed.

Fields

§tool_id: String
§success: bool
§

ToolApprovalRequired

Tool requires user approval (legacy, no channel — kept for recording compatibility).

Fields

§tool_id: String
§tool_name: String
§description: String
§

ToolApprovalRequested

Tool approval request with bidirectional channel.

Fields

§command: String
§working_dir: String
§

AskUserRequested

Ask-user request with bidirectional channel.

Fields

§question: String
§options: Vec<String>
§default: Option<String>
§response_tx: Sender<String>
§

SubagentStarted

A subagent started executing.

Fields

§subagent_id: String
§subagent_name: String
§task: String
§

SubagentToolCall

A subagent made a tool call (for nested display).

Fields

§subagent_id: String
§subagent_name: String
§tool_name: String
§tool_id: String
§

SubagentToolComplete

A subagent tool call completed.

Fields

§subagent_id: String
§subagent_name: String
§tool_name: String
§tool_id: String
§success: bool
§

SubagentFinished

A subagent finished its task.

Fields

§subagent_id: String
§subagent_name: String
§success: bool
§result_summary: String
§tool_call_count: usize
§shallow_warning: Option<String>
§

SubagentTokenUpdate

Token usage update from a subagent’s LLM call.

Fields

§subagent_id: String
§subagent_name: String
§input_tokens: u64
§output_tokens: u64
§

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).

Fields

§description: String
§

TaskProgressFinished

Agent finished the current task (hides progress bar).

§

BudgetExhausted

Session cost budget has been exhausted. The agent loop should pause.

Fields

§cost_usd: f64
§budget_usd: f64
§

FileChangeSummary

File change summary after a query completes.

Fields

§files: usize
§additions: u64
§deletions: u64
§

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).

Fields

§success: bool
§message: String
§

PlanApprovalRequested

Plan approval request arrived from the PresentPlanTool. Contains the plan content to display and the oneshot sender for the decision.

Fields

§plan_content: String
§response_tx: Sender<PlanDecision>
§

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.

Fields

§task_id: String
§query_summary: String
§

BackgroundAgentCompleted

A background agent completed its work.

Fields

§task_id: String
§success: bool
§result_summary: String
§full_result: String
§cost_usd: f64
§tool_call_count: usize
§

BackgroundAgentProgress

Progress update from a background agent.

Fields

§task_id: String
§tool_name: String
§tool_count: usize
§

BackgroundAgentKilled

A background agent was killed.

Fields

§task_id: String
§

BackgroundNudge

LLM-generated nudge message after backgrounding agents.

Fields

§content: String
§

BackgroundAgentActivity

Activity line from a background agent (tool call, reasoning, etc.).

Fields

§task_id: String
§line: String
§

SetBackgroundAgentToken

Register a background agent task with its interrupt token (sent from tui_runner).

Fields

§task_id: String
§query: String
§session_id: String
§interrupt_token: InterruptToken
§

SnapshotTaken

Snapshot was taken (stores tree hash for undo stack).

Fields

§hash: String
§

UndoResult

Undo result from the runtime.

Fields

§success: bool
§message: String
§

RedoResult

Redo result from the runtime.

Fields

§success: bool
§message: String
§

ShareResult

Share result from the runtime.

Fields

§path: String
§

FileChanged

File watcher detected changes.

Fields

§paths: Vec<String>
§

SessionTitleUpdated(String)

Session title was auto-detected by the topic detector.

§

Quit

Quit the application.

Trait Implementations§

Source§

impl Debug for AppEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more