pub enum SseEvent {
Message {
role: String,
content: Vec<SseContentBlock>,
},
PartialMessage {
text: String,
step: usize,
},
ToolCall {
name: String,
step: usize,
},
ToolResult {
name: String,
success: bool,
},
Done {
finish_reason: String,
total_steps: usize,
},
Error {
message: String,
},
PlanProposed {
plan: String,
},
GoalContinuing {
reason: String,
turns: u32,
},
GoalAchieved {
condition: String,
turns: u32,
},
ToolProgress {
tool_use_id: String,
tool_name: String,
elapsed_ms: u64,
},
}Expand description
Server-Sent Event payload emitted during an agent session run.
Variants§
Message
A full role-tagged message, with content broken into typed blocks.
Modeled on Claude Agent SDK’s AssistantMessage / UserMessage
streaming shape so the TS / Python SDKs can yield typed messages
without falling back to the session detail endpoint.
PartialMessage
A partial text delta during streaming. Concatenate text deltas
keyed by step to reconstruct the eventual Message::Text block.
ToolCall
A tool is being called.
ToolResult
A tool call completed.
Done
The agent run completed.
Error
An error occurred.
PlanProposed
Agent proposed a plan and is waiting for human review.
GoalContinuing
Goal-168: judge found condition not yet met; loop continues.
GoalAchieved
Goal-168: judge confirmed condition met.
ToolProgress
SDK Phase B: a tool call just completed; elapsed_ms is wall-clock time
from when the ToolCall event was received to when ToolResult arrived.
Emitted in addition to (and after) the tool_result event.