pub enum Evt {
Show 29 variants
SessionStart(Box<SessionInfo>),
SessionUpdated(Box<SessionInfo>),
ExtensionRefreshed(Box<ExtensionRefreshed>),
SessionEnd {
session_id: Id,
reason: SessionEndReason,
usage: Usage,
},
UserInput(String),
ShellOutput {
command: String,
stdout: String,
stderr: String,
exit_code: Option<i32>,
},
AgentMessage(String),
Thinking(String),
MessageDelta(String),
ThinkingDelta(String),
Info(Notice),
Error(Notice),
ToolStart(ToolUse),
ToolUpdate(ToolUpdate),
ToolEnd(ToolEnd),
TaskEnd {
tool_use_id: String,
exit_code: Option<i32>,
},
CompactStart,
CompactEnd {
summary: Option<String>,
},
TurnStart {
turn_id: Id,
},
TurnPause {
turn_id: Id,
reason: TurnPauseReason,
},
TurnResume {
turn_id: Id,
},
TurnEnd {
turn_id: Id,
status: TurnEndStatus,
steps: usize,
},
Progress {
message: String,
percent: Option<u8>,
},
UsageUpdate {
usage: Usage,
context: Option<ContextWindow>,
},
ContextReport(ContextBreakdown),
SessionRewound {
to: Id,
},
SessionForked {
forked_from: Id,
session_id: Id,
at: Option<Id>,
},
Ambient {
kind: AmbientKind,
req_id: u64,
text: String,
},
Goodbye,
}Variants§
SessionStart(Box<SessionInfo>)
SessionUpdated(Box<SessionInfo>)
ExtensionRefreshed(Box<ExtensionRefreshed>)
SessionEnd
The session ended; usage is its final accounting.
UserInput(String)
ShellOutput
AgentMessage(String)
Thinking(String)
MessageDelta(String)
ThinkingDelta(String)
Info(Notice)
Error(Notice)
ToolStart(ToolUse)
ToolUpdate(ToolUpdate)
ToolEnd(ToolEnd)
TaskEnd
Work a tool call handed off ended: a Bash job that outlived its wait
window. tool_use_id is the call whose ToolEnd reported the hand-off.
exit_code is the process exit code, 128 + signal for a signal
death, absent only when the exit could not be observed.
CompactStart
CompactEnd
Compaction finished. A present summary is the text that replaced
the compacted history and carries forward as the session’s context.
None means no history replacement was committed. A session started
by a rollover opens with one whose summary is the handoff it starts
from.
TurnStart
TurnPause
TurnResume
The turn resumed after a TurnPause (e.g. the approval was answered
or a steer arrived). Closes the pause bracket so clients never have to
infer resumption from the next tool event.
TurnEnd
Fields
status: TurnEndStatusProgress
The turn is in a step that has no output to show yet, such as the
model reading a long prompt. message names the step; percent
(0–100) is how far along it is, absent while that is not known. Each
one replaces the last. A percent of 100 ends the step, and so does
the turn’s next message, thinking or tool event, or TurnEnd. Never
part of a resume replay; a client may ignore it.
UsageUpdate
Fields
context: Option<ContextWindow>Context-window occupancy for the root session. None carries no
context update, including for subagent usage or an unverified model
limit. Clients retain the last snapshot until the session or model changes.
ContextReport(ContextBreakdown)
Answer to Op::ContextReport: a per-category breakdown of the
session’s context-window occupancy at the time of the request.
SessionRewound
Answer to Op::RewindSession: the session’s conversation, and the
history a resume of it replays, now stand as they did just before
input to. Never part of a resume replay.
SessionForked
Answer to Op::ForkSession: session session_id was forked from
session forked_from: from its conversation at input at, or from
its current conversation when absent. It is saved, not started;
resuming it switches to it.
Ambient
An ephemeral hint outside the conversation (see AmbientKind),
never persisted. req_id echoes the request’s so clients can drop
superseded results.