pub enum StreamFrame {
System {
subtype: String,
},
StreamEvent {
delta: Option<String>,
},
Assistant {
text: String,
},
Result {
subtype: String,
result: Option<String>,
is_error: bool,
},
UserEcho,
ControlRequest {
request_id: String,
subtype: String,
tool_name: String,
input: Value,
},
Other {
type_name: String,
},
Malformed,
}Expand description
One parsed stream-json frame. Serializes with a kind tag for the wire so a
consumer (the switchboard, Group 2) discriminates without re-parsing.
Variants§
System
type:system (e.g. subtype:init). The session announces itself.
StreamEvent
type:stream_event — a partial token from --include-partial-messages.
delta carries the incremental text when present (for live streaming).
Assistant
type:assistant — the assistant’s message; text is the concatenated
text blocks. THIS is the reply to mirror.
Result
type:result — the turn is complete. result is the final text;
is_error/subtype carry the terminal status.
UserEcho
type:user — the --replay-user-messages echo: a DELIVERY RECEIPT, not
a reply. Never mirror this as B’s answer.
ControlRequest
type:control_request — the headless permission gate (ab-28feac77). The
child emits this and BLOCKS until a matching control_response is written
to its stdin, so the worker must answer every one or the turn hangs
forever. request_id echoes back in the response; subtype is
can_use_tool for the permission ask; tool_name/input drive the
posture decision.
Other
A well-formed JSON line with an unrecognized type.
Malformed
A line that was not valid JSON (skipped, never fatal).
Trait Implementations§
Source§impl Clone for StreamFrame
impl Clone for StreamFrame
Source§fn clone(&self) -> StreamFrame
fn clone(&self) -> StreamFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more