pub enum PiMsg {
Show 25 variants
AgentStart,
RunPending,
EnqueuePendingInput(PendingInput),
UiShutdown,
AutocompleteRefresh,
TextDelta(String),
ThinkingDelta(String),
ToolStart {
name: String,
tool_id: String,
},
ToolUpdate {
name: String,
tool_id: String,
content: Vec<ContentBlock>,
details: Option<Value>,
},
ToolEnd {
name: String,
tool_id: String,
is_error: bool,
},
AgentDone {
usage: Option<Usage>,
stop_reason: StopReason,
error_message: Option<String>,
},
AgentError(String),
CredentialUpdated {
provider: String,
},
System(String),
SystemNote(String),
UpdateLastUserMessage(String),
BashResult {
display: String,
content_for_agent: Option<Vec<ContentBlock>>,
},
OAuthDeviceFlowStarted {
provider: String,
device_code: String,
user_code: String,
verification_uri: String,
expires_in: u64,
},
ConversationReset {
messages: Vec<ConversationMessage>,
usage: Usage,
status: Option<String>,
},
SetEditorText(String),
OpenTree {
initial_selected_id: Option<String>,
label: Option<String>,
},
ResourcesReloaded {
resources: ResourceLoader,
status: String,
diagnostics: Option<String>,
},
ExtensionUiRequest(ExtensionUiRequest),
ExtensionCommandDone {
command: String,
display: String,
is_error: bool,
},
OAuthCallbackReceived(String),
}Expand description
Custom message types for async agent events.
Variants§
AgentStart
Agent started processing.
RunPending
Trigger processing of the next queued input (CLI startup messages).
EnqueuePendingInput(PendingInput)
Enqueue a pending input (extensions may inject while idle).
UiShutdown
Internal: shut down the async→UI message bridge (used for clean exit).
AutocompleteRefresh
Periodic autocomplete refresh tick (background file index).
TextDelta(String)
Text delta from assistant.
ThinkingDelta(String)
Thinking delta from assistant.
ToolStart
Tool execution started.
ToolUpdate
Tool execution update (streaming output).
ToolEnd
Tool execution ended.
AgentDone
Agent finished with final message.
AgentError(String)
Agent error.
CredentialUpdated
Credentials changed for a provider; refresh in-memory provider auth state.
System(String)
Non-error system message.
SystemNote(String)
System note that does not mutate agent state (safe during streaming).
UpdateLastUserMessage(String)
Update last user message content (input transform/redaction).
BashResult
Bash command result (non-agent).
OAuthDeviceFlowStarted
Async OAuth device flow start
Fields
ConversationReset
Replace conversation state from session (compaction/fork).
SetEditorText(String)
Set the editor contents (used by /tree selection of user/custom messages).
OpenTree
Open the session tree selector (async from extension hooks).
ResourcesReloaded
Reloaded skills/prompts/themes/extensions.
ExtensionUiRequest(ExtensionUiRequest)
Extension UI request (select/confirm/input/editor/custom/notify).
ExtensionCommandDone
Extension command finished execution.
OAuthCallbackReceived(String)
OAuth callback server received the browser redirect.
The string is the full callback URL (e.g. http://localhost:1455/auth/callback?code=abc&state=xyz).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PiMsg
impl RefUnwindSafe for PiMsg
impl Send for PiMsg
impl Sync for PiMsg
impl Unpin for PiMsg
impl UnsafeUnpin for PiMsg
impl UnwindSafe for PiMsg
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
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