Skip to main content

AgentEvent

Enum AgentEvent 

Source
pub enum AgentEvent {
Show 15 variants Chunk(String), FullMessage(String), Flush, Typing, Status(String), ToolStart { tool_name: ToolName, command: String, }, ToolOutputChunk { tool_name: ToolName, command: String, chunk: String, }, ToolOutput { tool_name: ToolName, command: String, output: String, success: bool, diff: Option<DiffData>, filter_stats: Option<String>, kept_lines: Option<Vec<usize>>, }, ConfirmRequest { prompt: String, response_tx: Sender<bool>, }, ElicitationRequest { request: ElicitationRequest, response_tx: Sender<ElicitationResponse>, }, QueueCount(usize), DiffReady(DiffData), CommandResult { command_id: String, output: String, }, SetCancelSignal(Arc<Notify>), SetMetricsRx(Receiver<MetricsSnapshot>),
}
Expand description

Events produced by the agent and forwarded to the TUI via crate::TuiChannel.

Each variant corresponds to a distinct phase or signal in the agent lifecycle (streaming output, tool execution, user confirmation, etc.).

§Examples

use zeph_tui::event::AgentEvent;

let ev = AgentEvent::Chunk("partial response".to_string());
assert!(matches!(ev, AgentEvent::Chunk(_)));

Variants§

§

Chunk(String)

A streaming text chunk from the LLM — appended to the current message.

§

FullMessage(String)

A complete (non-streaming) assistant message.

§

Flush

Signals that streaming is complete; the chat widget stops the cursor.

§

Typing

The agent is waiting for an LLM response (drives the throbber).

§

Status(String)

A short status string to display in the activity bar (e.g. "Searching memory…").

§

ToolStart

A tool call has started; the TUI should display a spinner with the tool name.

Fields

§tool_name: ToolName

Canonical tool name (e.g. "bash", "read_file").

§command: String

The primary command or argument string shown in the status bar.

§

ToolOutputChunk

An incremental output chunk from a long-running tool (e.g. streaming shell output).

Fields

§tool_name: ToolName

Tool that produced the chunk.

§command: String

Command argument associated with the tool call.

§chunk: String

The chunk text to append.

§

ToolOutput

Final tool output, replacing any in-progress chunks for this call.

Fields

§tool_name: ToolName

Tool that produced the output.

§command: String

Command argument associated with the tool call.

§output: String

Full rendered output body.

§success: bool

true if the tool succeeded, false on error.

§diff: Option<DiffData>

Optional diff to display inline in the chat.

§filter_stats: Option<String>

Human-readable filter summary, if output was filtered.

§kept_lines: Option<Vec<usize>>

Indices of lines retained by the filter.

§

ConfirmRequest

The agent requests a boolean confirmation from the user.

Fields

§prompt: String

Prompt text shown in the confirmation dialog.

§response_tx: Sender<bool>

One-shot channel to send the user’s true/false response.

§

ElicitationRequest

The agent requests structured input via an elicitation dialog.

Fields

§request: ElicitationRequest

The elicitation schema and prompt.

§response_tx: Sender<ElicitationResponse>

One-shot channel to send the user’s response.

§

QueueCount(usize)

Updated count of messages queued for the agent (shown in the input bar).

§

DiffReady(DiffData)

A diff is ready for immediate display in the diff panel.

§

CommandResult

Result from a slash-command dispatched to the agent.

Fields

§command_id: String

The slash-command identifier that produced this result.

§output: String

Formatted command output to display.

§

SetCancelSignal(Arc<Notify>)

Wire a cancel signal into the TUI App after early startup (Phase 2).

§

SetMetricsRx(Receiver<MetricsSnapshot>)

Wire a metrics receiver into the TUI App after early startup (Phase 2).

Trait Implementations§

Source§

impl Debug for AgentEvent

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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
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> Same for T

Source§

type Output = T

Should always be Self
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