pub enum EventMsg {
Show 48 variants
Error(ErrorEvent),
Warning(WarningEvent),
TaskStarted(TaskStartedEvent),
TaskComplete(TaskCompleteEvent),
TokenCount(TokenCountEvent),
AgentMessage(AgentMessageEvent),
UserMessage(UserMessageEvent),
AgentMessageDelta(AgentMessageDeltaEvent),
AgentReasoning(AgentReasoningEvent),
AgentReasoningDelta(AgentReasoningDeltaEvent),
AgentReasoningRawContent(AgentReasoningRawContentEvent),
AgentReasoningRawContentDelta(AgentReasoningRawContentDeltaEvent),
AgentReasoningSectionBreak(AgentReasoningSectionBreakEvent),
SessionConfigured(SessionConfiguredEvent),
McpStartupUpdate(McpStartupUpdateEvent),
McpStartupComplete(McpStartupCompleteEvent),
McpToolCallBegin(McpToolCallBeginEvent),
McpToolCallEnd(McpToolCallEndEvent),
WebSearchBegin(WebSearchBeginEvent),
WebSearchEnd(WebSearchEndEvent),
ExecCommandBegin(ExecCommandBeginEvent),
ExecCommandOutputDelta(ExecCommandOutputDeltaEvent),
ExecCommandEnd(ExecCommandEndEvent),
ViewImageToolCall(ViewImageToolCallEvent),
ExecApprovalRequest(ExecApprovalRequestEvent),
ApplyPatchApprovalRequest(ApplyPatchApprovalRequestEvent),
DeprecationNotice(DeprecationNoticeEvent),
BackgroundEvent(BackgroundEventEvent),
UndoStarted(UndoStartedEvent),
UndoCompleted(UndoCompletedEvent),
StreamError(StreamErrorEvent),
PatchApplyBegin(PatchApplyBeginEvent),
PatchApplyEnd(PatchApplyEndEvent),
TurnDiff(TurnDiffEvent),
GetHistoryEntryResponse(GetHistoryEntryResponseEvent),
McpListToolsResponse(McpListToolsResponseEvent),
ListCustomPromptsResponse(ListCustomPromptsResponseEvent),
PlanUpdate(UpdatePlanArgs),
TurnAborted(TurnAbortedEvent),
ShutdownComplete,
EnteredReviewMode(ReviewRequest),
ExitedReviewMode(ExitedReviewModeEvent),
RawResponseItem(RawResponseItemEvent),
ItemStarted(ItemStartedEvent),
ItemCompleted(ItemCompletedEvent),
AgentMessageContentDelta(AgentMessageContentDeltaEvent),
ReasoningContentDelta(ReasoningContentDeltaEvent),
ReasoningRawContentDelta(ReasoningRawContentDeltaEvent),
}Expand description
Response event from the agent NOTE: Make sure none of these values have optional types, as it will mess up the extension code-gen.
Variants§
Error(ErrorEvent)
Error while executing a submission
Warning(WarningEvent)
Warning issued while processing a submission. Unlike Error, this
indicates the task continued but the user should still be notified.
TaskStarted(TaskStartedEvent)
Agent has started a task
TaskComplete(TaskCompleteEvent)
Agent has completed all actions
TokenCount(TokenCountEvent)
Usage update for the current session, including totals and last turn.
Optional means unknown — UIs should not display when None.
AgentMessage(AgentMessageEvent)
Agent text output message
UserMessage(UserMessageEvent)
User/system input message (what was sent to the model)
AgentMessageDelta(AgentMessageDeltaEvent)
Agent text output delta message
AgentReasoning(AgentReasoningEvent)
Reasoning event from agent.
AgentReasoningDelta(AgentReasoningDeltaEvent)
Agent reasoning delta event from agent.
AgentReasoningRawContent(AgentReasoningRawContentEvent)
Raw chain-of-thought from agent.
AgentReasoningRawContentDelta(AgentReasoningRawContentDeltaEvent)
Agent reasoning content delta event from agent.
AgentReasoningSectionBreak(AgentReasoningSectionBreakEvent)
Signaled when the model begins a new reasoning summary section (e.g., a new titled block).
SessionConfigured(SessionConfiguredEvent)
Ack the client’s configure message.
McpStartupUpdate(McpStartupUpdateEvent)
Incremental MCP startup progress updates.
McpStartupComplete(McpStartupCompleteEvent)
Aggregate MCP startup completion summary.
McpToolCallBegin(McpToolCallBeginEvent)
McpToolCallEnd(McpToolCallEndEvent)
WebSearchBegin(WebSearchBeginEvent)
WebSearchEnd(WebSearchEndEvent)
ExecCommandBegin(ExecCommandBeginEvent)
Notification that the server is about to execute a command.
ExecCommandOutputDelta(ExecCommandOutputDeltaEvent)
Incremental chunk of output from a running command.
ExecCommandEnd(ExecCommandEndEvent)
ViewImageToolCall(ViewImageToolCallEvent)
Notification that the agent attached a local image via the view_image tool.
ExecApprovalRequest(ExecApprovalRequestEvent)
ApplyPatchApprovalRequest(ApplyPatchApprovalRequestEvent)
DeprecationNotice(DeprecationNoticeEvent)
Notification advising the user that something they are using has been deprecated and should be phased out.
BackgroundEvent(BackgroundEventEvent)
UndoStarted(UndoStartedEvent)
UndoCompleted(UndoCompletedEvent)
StreamError(StreamErrorEvent)
Notification that a model stream experienced an error or disconnect and the system is handling it (e.g., retrying with backoff).
PatchApplyBegin(PatchApplyBeginEvent)
Notification that the agent is about to apply a code patch. Mirrors
ExecCommandBegin so front‑ends can show progress indicators.
PatchApplyEnd(PatchApplyEndEvent)
Notification that a patch application has finished.
TurnDiff(TurnDiffEvent)
GetHistoryEntryResponse(GetHistoryEntryResponseEvent)
Response to GetHistoryEntryRequest.
McpListToolsResponse(McpListToolsResponseEvent)
List of MCP tools available to the agent.
ListCustomPromptsResponse(ListCustomPromptsResponseEvent)
List of custom prompts available to the agent.
PlanUpdate(UpdatePlanArgs)
TurnAborted(TurnAbortedEvent)
ShutdownComplete
Notification that the agent is shutting down.
EnteredReviewMode(ReviewRequest)
Entered review mode.
ExitedReviewMode(ExitedReviewModeEvent)
Exited review mode with an optional final result to apply.
RawResponseItem(RawResponseItemEvent)
ItemStarted(ItemStartedEvent)
ItemCompleted(ItemCompletedEvent)
AgentMessageContentDelta(AgentMessageContentDeltaEvent)
ReasoningContentDelta(ReasoningContentDeltaEvent)
ReasoningRawContentDelta(ReasoningRawContentDeltaEvent)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EventMsg
impl<'de> Deserialize<'de> for EventMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl HasLegacyEvent for EventMsg
impl HasLegacyEvent for EventMsg
Source§impl JsonSchema for EventMsg
impl JsonSchema for EventMsg
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl TS for EventMsg
impl TS for EventMsg
Source§type WithoutGenerics = EventMsg
type WithoutGenerics = EventMsg
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§type OptionInnerType = EventMsg
type OptionInnerType = EventMsg
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
Source§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read more