pub enum WorkerEvent {
Message(String),
Token(String),
Thinking(String),
Reading(String),
Editing(String),
ToolUse(String),
Raw(String),
SessionOpened {
worker: String,
model: Option<String>,
backend: String,
},
Done,
}Expand description
A single streamed event from a running worker.
Variants§
Message(String)
A line of human-readable narration (“reading src/, editing app.ts”).
Token(String)
A raw streaming text delta from a token-streaming worker (API/HTTP, Grok). Consumers concatenate these verbatim — fragments are often mid-word, so no separator is inserted between them. This is what lets the UI reconstruct and markdown-render any streamed model output regardless of the worker.
Thinking(String)
A reasoning (“thinking”) delta from a reasoning model (e.g. DeepSeek-R1,
o-series). Streamed separately from [Token] content and never part of
the final answer, so the UI can show it dimmed without polluting the
result passed to the next node.
Reading(String)
The worker began reading a file/path.
Editing(String)
The worker edited a file/path.
ToolUse(String)
The worker invoked a tool/command.
Raw(String)
Raw stdout/stderr passthrough, used when no richer structure exists.
SessionOpened
A visible Harness Stage session opened (PTY / Stage UI). backend is
pty or headless (or future external-terminal).
Done
Terminal marker: the worker finished emitting events.