pub enum UiMessage {
TextChunk {
session_id: i64,
turn_id: Option<TurnId>,
text: String,
input_tokens: i64,
output_tokens: i64,
},
Display {
session_id: i64,
turn_id: Option<TurnId>,
message: String,
},
ToolExecuting {
session_id: i64,
turn_id: Option<TurnId>,
tool_use_id: String,
display_name: String,
display_title: String,
},
ToolCompleted {
session_id: i64,
turn_id: Option<TurnId>,
tool_use_id: String,
status: ToolResultStatus,
error: Option<String>,
},
Complete {
session_id: i64,
turn_id: Option<TurnId>,
input_tokens: i64,
output_tokens: i64,
stop_reason: Option<String>,
},
TokenUpdate {
session_id: i64,
turn_id: Option<TurnId>,
input_tokens: i64,
output_tokens: i64,
context_limit: i32,
},
Error {
session_id: i64,
turn_id: Option<TurnId>,
error: String,
},
System {
session_id: i64,
message: String,
},
CommandComplete {
session_id: i64,
command: ControlCmd,
success: bool,
message: Option<String>,
},
UserInteractionRequired {
session_id: i64,
tool_use_id: String,
request: AskUserQuestionsRequest,
turn_id: Option<TurnId>,
},
PermissionRequired {
session_id: i64,
tool_use_id: String,
request: PermissionRequest,
turn_id: Option<TurnId>,
},
}Expand description
Messages sent from the controller to the TUI for display
Variants§
TextChunk
Streaming text chunk from LLM response
Display
General display message (tool status, info, etc.)
ToolExecuting
Tool execution has started
Fields
ToolCompleted
Tool execution has completed
Fields
§
status: ToolResultStatusComplete
LLM response is complete
Fields
TokenUpdate
Real-time token count update
Fields
Error
Error from the controller
System
System message (TUI-local, not from controller)
CommandComplete
Control command completed
UserInteractionRequired
Tool is blocked waiting for user interaction (e.g., AskUserQuestions)
PermissionRequired
Tool is blocked waiting for permission (e.g., AskForPermissions)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UiMessage
impl RefUnwindSafe for UiMessage
impl Send for UiMessage
impl Sync for UiMessage
impl Unpin for UiMessage
impl UnwindSafe for UiMessage
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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