pub enum Event {
Show 26 variants
RunStarted {
run: RunId,
task: String,
agent: String,
},
RouteSelected {
run: RunId,
chain: Vec<String>,
context_window: u64,
},
ModelSwitched {
run: RunId,
from: String,
to: String,
reason: String,
},
ThinkingDelta {
run: RunId,
text: String,
},
ReasoningDelta {
run: RunId,
text: String,
},
Message {
run: RunId,
role: String,
text: String,
},
ToolUseProposed {
run: RunId,
id: String,
name: String,
args: Value,
risk: RiskLevel,
},
ApprovalRequested {
run: RunId,
id: String,
summary: String,
tool: Option<String>,
risk: Option<String>,
},
ApprovalResolved {
run: RunId,
id: String,
decision: Decision,
},
ToolUseStarted {
run: RunId,
id: String,
},
ToolOutput {
run: RunId,
id: String,
blocks: Vec<Block>,
is_error: bool,
},
DiffProposed {
run: RunId,
file: String,
patch: String,
plus: u32,
minus: u32,
},
DiffApplied {
run: RunId,
file: String,
},
TestResult {
run: RunId,
passed: u32,
failed: u32,
detail: String,
},
AgentSpawned {
run: RunId,
role: String,
model: String,
},
AgentStatus {
run: RunId,
role: String,
status: AgentStatus,
note: String,
},
CheckpointCreated {
run: RunId,
id: CheckpointId,
label: String,
},
SkillLearned {
run: RunId,
name: String,
},
CostUpdate {
run: RunId,
usd: f64,
},
TokenUsage {
run: RunId,
input: u64,
output: u64,
},
TokenUsageEstimated {
run: RunId,
input: u64,
output: u64,
reason: String,
},
AutonomyChanged {
run: RunId,
level: AutonomyLevel,
},
RunFinished {
run: RunId,
outcome: OutcomeSummary,
},
Error {
run: RunId,
message: String,
},
Compacted {
run: RunId,
before_chars: usize,
after_chars: usize,
handoff_path: Option<String>,
},
UpdateAvailable {
current: String,
latest: String,
download_url: Option<String>,
crate_url: String,
release_url: String,
install_cmd: String,
},
}Expand description
Every surface renders from this stream; replay records from it. This enum is the contract that connects runtime ↔ surfaces ↔ replay.
Variants§
RunStarted
RouteSelected
ModelSwitched
ThinkingDelta
ReasoningDelta
Opaque provider reasoning state. Surfaces should not render this as
assistant-visible text, but session persistence must keep it so
reasoning-mode providers can receive reasoning_content on the next
turn when they require it.
Message
ToolUseProposed
ApprovalRequested
ApprovalResolved
ToolUseStarted
ToolOutput
Fields
DiffProposed
DiffApplied
TestResult
AgentSpawned
AgentStatus
CheckpointCreated
SkillLearned
CostUpdate
TokenUsage
TokenUsageEstimated
AutonomyChanged
RunFinished
Error
Compacted
A compaction pass has just completed. Surfaces the before/after sizes (in chars) and the path of the handoff doc, if any.
UpdateAvailable
A newer version of Sparrow is available. Surfaces should show a non-intrusive notification with update instructions.
Implementations§
Source§impl Event
impl Event
Sourcepub fn is_public(&self) -> bool
pub fn is_public(&self) -> bool
Returns true for events that may be streamed to user-facing feeds.
ReasoningDelta is provider-internal continuity state: the engine and
session stores consume it so reasoning-mode providers can receive the
required reasoning_content on the next turn, but exposing every delta
as NDJSON/WebSocket output floods users with opaque token fragments.