pub struct StreamEventRequest {Show 21 fields
pub protocol_version: u32,
pub tool: Option<String>,
pub event_type: StreamEventType,
pub session_id: String,
pub timestamp: DateTime<Utc>,
pub hook_event_name: Option<String>,
pub tool_name: Option<String>,
pub tool_use_id: Option<String>,
pub tool_input: Option<Value>,
pub tool_response: Option<Value>,
pub tool_is_error: Option<bool>,
pub event_index: Option<i32>,
pub event_uuid: Option<Uuid>,
pub transcript_lines: Option<Vec<Value>>,
pub transcript_offset: Option<i64>,
pub model: Option<String>,
pub cwd: Option<String>,
pub final_stats: Option<SessionFinalStats>,
pub flow_id: Option<String>,
pub labels: Option<Vec<String>>,
pub params: Option<HashMap<String, String>>,
}Fields§
§protocol_version: u32§tool: Option<String>§event_type: StreamEventType§session_id: String§timestamp: DateTime<Utc>§hook_event_name: Option<String>§tool_name: Option<String>§tool_use_id: Option<String>§tool_input: Option<Value>§tool_response: Option<Value>§tool_is_error: Option<bool>§event_index: Option<i32>Legacy per-session ordering counter (from the CLI’s .event_counter).
Superseded by event_uuid; still accepted from older clients and used as
an ordering fallback. New clients send None.
event_uuid: Option<Uuid>Client-minted UUIDv7 stamped at hook-fire time. Time-ordered, so it is the
ordering key for events; absent (None) from older clients, which fall
back to event_index.
transcript_lines: Option<Vec<Value>>§transcript_offset: Option<i64>§model: Option<String>§cwd: Option<String>§final_stats: Option<SessionFinalStats>§flow_id: Option<String>Optional flow identifier grouping this event into a named flow.
None when the client does not send this field.
labels: Option<Vec<String>>Ad-hoc string labels for categorisation.
None when the client does not send this field; defaults to empty vec.
params: Option<HashMap<String, String>>Arbitrary key/value metadata as a JSONB object.
None when the client does not send this field; defaults to empty object.
Implementations§
Source§impl StreamEventRequest
impl StreamEventRequest
Sourcepub fn truncate_large_fields(&mut self)
pub fn truncate_large_fields(&mut self)
Drop optional fields largest-first until the serialized payload is under 512 KB. Prevents 413 errors on both real-time sends and flush.
Trait Implementations§
Source§impl Clone for StreamEventRequest
impl Clone for StreamEventRequest
Source§fn clone(&self) -> StreamEventRequest
fn clone(&self) -> StreamEventRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more