Skip to main content

UiLine

Enum UiLine 

Source
pub enum UiLine {
Show 28 variants Welcome { model: String, working_dir: String, }, User(String), AssistantText(String), ReasoningText(String), AssistantLineBreak, ToolCall { name: String, detail: String, }, ToolCallInFlight { id: String, name: String, detail: String, }, ToolCallCommit { call_id: Option<String>, }, ToolGroupRender { batch_id: String, header: String, children: Vec<ToolGroupChild>, }, ToolGroupChildUpdate { batch_id: String, call_id: String, new_text: String, }, ToolGroupSummary { text: String, }, ToolResult { success: bool, summary: String, }, DiffLine { added: bool, text: String, }, DiffBlock(Vec<DiffEntry>), ApprovalPrompt { tool: String, detail: String, }, Error(String), Warning(String), TurnCancelled, TurnComplete, Spinner { frame: &'static str, label: String, }, ClearTransient, InputPrompt { buf: String, cursor_byte: usize, menu: Option<MenuPayload>, status: StatusLine, attachments: Vec<usize>, }, StreamingBox { buf: String, cursor_byte: usize, frame: &'static str, label: String, status: StatusLine, menu: Option<MenuPayload>, attachments: Vec<usize>, }, InputCommit, CommandOutput(String), ImageAttachment(usize), VisionPreprocessSuccess { msg: String, model: String, }, TurnSeparator { label: String, },
}
Expand description

Semantic line to render. Renderer implementations translate this to bytes.

Permanent lines (User, Assistant, ToolCall, ToolResult, Diff, Approval, Error, Blank) all enter scrollback. Spinner and InputPrompt are transient.

Variants§

§

Welcome

Fields

§model: String
§working_dir: String
§

User(String)

§

AssistantText(String)

§

ReasoningText(String)

LLM reasoning/thinking content (displayed in gray/dimmed style)

§

AssistantLineBreak

§

ToolCall

Fields

§name: String
§detail: String
§

ToolCallInFlight

Animated tool-call line. Pushed on AgentEvent::ToolCallStarted instead of the static ToolCall, so the user sees the call land the moment the model commits to it AND its leading icon ticks in lockstep with the footer spinner via the live-row mechanism (see RetainedRenderer::push_or_update_inflight_tool). Switched to a static icon by ToolCallCommit once the matching result lands, freeing the live-row slot for the spinner to resume.

Fields

§name: String
§detail: String
§

ToolCallCommit

Freeze the most recent ToolCallInFlight row to its final static icon. Emitted right before ToolResult so the bottom body row stops animating exactly when the result is about to be appended below it. If call_id is provided, only commits if the inflight_tool matches.

Fields

§call_id: Option<String>
§

ToolGroupRender

Push a parallel-tool batch as a live multi-row group: one header line + N child rows (one per tool call), all visible from the start. Subsequent ToolGroupChildUpdate events find child rows by call_id and update them in place (CC-style ✓ light-up). The group is “live” only as long as it remains the bottom of body_lines; any other body push freezes it (in place forever, but no further child updates take effect).

Fields

§batch_id: String
§header: String
§

ToolGroupChildUpdate

Update one child row inside an active live-group. Renderer finds the row keyed by call_id and CUPs to its terminal position to rewrite. Falls back to no-op if the group has been frozen (other content was pushed below it).

Fields

§batch_id: String
§call_id: String
§new_text: String
§

ToolGroupSummary

One-shot summary line for a completed tool batch — rendered with bold + brand-color emphasis so it stands out as the “this is what happened” anchor (mirrors CC’s task-completion summary visual). Used by both ToolBatchCompleted and SubAgentDispatchEnd.

Fields

§text: String
§

ToolResult

Fields

§success: bool
§summary: String
§

DiffLine

Fields

§added: bool
§text: String
§

DiffBlock(Vec<DiffEntry>)

A batch of diff lines emitted in a single render call. Use this instead of N individual DiffLine renders when a tool result carries many changed lines — each DiffLine triggers a full erase_footer + redraw_footer cycle, so 50 diff lines translate into 50 footer redraws and tens of KB of ANSI, blocking the event loop long enough to freeze the spinner. DiffBlock does one erase + N writes + one redraw.

§

ApprovalPrompt

Fields

§tool: String
§detail: String
§

Error(String)

§

Warning(String)

Non-fatal advisory line (yellow). Visually distinct from Error so the user can tell “we saw something fishy and want you to know” apart from “the turn died.” Currently used by the OpenAI provider’s truncation detector.

§

TurnCancelled

§

TurnComplete

§

Spinner

Legacy single-line spinner (kept for tests / PlainRenderer fallback). During Streaming the event loop emits StreamingBox instead so the spinner sits ABOVE the input box rather than inside it.

Fields

§frame: &'static str
§label: String
§

ClearTransient

Clear the current transient line (prepares for a permanent write).

§

InputPrompt

Draw the input prompt “> “ + current buffer (transient, idle). When menu is Some, a command palette is drawn above the box. cursor_byte is a byte offset into buf — the renderer wraps buf to the available input width and derives the 2D cursor position (row, col) itself so the input box can grow multi-line when the user exceeds a single row.

Fields

§cursor_byte: usize
§status: StatusLine
§attachments: Vec<usize>

Marker numbers (N from [Image #N]) that actually have image bytes ready to ship — either freshly attached this turn or recalled from cache via arrow-up. Renderers cross- reference each marker against buf and draw a └ [Image #N] preview row for the intersection right under the input box, so users can tell “real attachment” from “literal text” at a glance, before submit. Empty means no preview rows. Only the main idle / streaming compose paths populate this; modal flows that reuse InputPrompt for text entry pass Vec::new().

§

StreamingBox

Streaming chrome: spinner line above a (possibly multi-line) input box. Same cursor_byte semantics as InputPrompt. When menu is Some (user typed / into the type-ahead buffer mid-stream), the slash-command palette is drawn above the box in place of the spinner — same rendering path as InputPrompt.

Fields

§cursor_byte: usize
§frame: &'static str
§label: String
§status: StatusLine
§attachments: Vec<usize>

Same semantics as InputPrompt::attachments — type-ahead during streaming can carry pasted attachments too, so the preview path needs to fire here as well.

§

InputCommit

User pressed Enter: commit the current InputPrompt to scrollback.

§

CommandOutput(String)

Slash-command output (arbitrary text, already sanitised by caller).

§

ImageAttachment(usize)

Image-attachment echo (└ [Image #N]). Emitted right after the UiLine::User row that contains the matching [Image #N] marker, so each renderer can align the glyph at the same column as the [ of the marker in the user message above (col 2). A dedicated variant rather than CommandOutput so alignment stays consistent across renderers — retained’s push_body_text auto-prefixes PAD_COL (2 spaces) but alt-screen’s push_command_output does not, so the same CommandOutput payload would land at col 2 in one and col 4 (or col 0) in the other.

§

VisionPreprocessSuccess

One-line success notice for vision-preprocessor OCR. Renders as {msg} {model} where msg uses the default text style and model uses the Muted (gray) role — visually distinct from failure (yellow ! ...) and from arbitrary command output. The actual VL description is intentionally NOT shown in the UI; it still rides into conversation history for the main model.

Fields

§model: String
§

TurnSeparator

A visible separator between turns: ────── {label} ──────.

Fields

§label: String

Trait Implementations§

Source§

impl Clone for UiLine

Source§

fn clone(&self) -> UiLine

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UiLine

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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<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