#[non_exhaustive]pub enum ThreadEvent {
Show 28 variants
ThreadStarted {
thread_id: String,
},
TurnStarted {
turn_number: usize,
},
TurnCompleted {
turn_number: usize,
usage: TokenUsage,
},
ItemStarted {
item: Item,
},
ItemCompleted {
item: Item,
},
ContentDelta {
delta: String,
},
ThinkingDelta {
thinking: String,
},
WaitingForInput {
prompt: String,
},
Error {
message: String,
recoverable: bool,
},
ThreadCompleted {
usage: TokenUsage,
},
ThreadCancelled,
GoalVerificationStarted {
goals: Vec<String>,
method: String,
},
GoalVerificationResult {
goal: String,
score: f64,
target: f64,
passed: bool,
duration_ms: u64,
},
GoalVerificationCompleted {
all_passed: bool,
passed_count: usize,
total_count: usize,
},
RalphIterationStarted {
iteration: u32,
max_iterations: u32,
prompt: String,
},
RalphContinuation {
reason: String,
confidence: u32,
details: String,
},
RalphCircuitBreak {
reason: String,
iteration: u32,
},
BackgroundTaskSpawned {
task_id: String,
description: String,
agent: String,
},
BackgroundTaskProgress {
task_id: String,
status: String,
message: Option<String>,
},
BackgroundTaskCompleted {
task_id: String,
success: bool,
result_preview: Option<String>,
duration_secs: f64,
},
SubagentStarted {
task_id: String,
agent_name: String,
model: String,
session_id: String,
},
SubagentCompleted {
task_id: String,
session_id: String,
success: bool,
duration_secs: f64,
},
ModelSwitched {
model: String,
provider: String,
},
PermissionEvaluated {
permission: String,
path: String,
action: String,
rule_matched: Option<String>,
},
ApprovalCached {
tool_name: String,
pattern: String,
decision: String,
},
CompactionStarted {
strategy: String,
token_count_before: usize,
},
CompactionCompleted {
token_count_before: usize,
token_count_after: usize,
messages_removed: usize,
},
TodoUpdated {
todos: Vec<TodoItem>,
},
}Expand description
Top-level event for JSONL streaming
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ThreadStarted
Thread has started
TurnStarted
A new turn has started
TurnCompleted
A turn has completed
ItemStarted
An item has started processing
ItemCompleted
An item has completed
ContentDelta
Content is being streamed
ThinkingDelta
Thinking/reasoning content is being streamed
WaitingForInput
Waiting for user input
Error
Error occurred
ThreadCompleted
Thread has completed
Fields
usage: TokenUsageThreadCancelled
Thread was cancelled
GoalVerificationStarted
Goal verification has started
GoalVerificationResult
Result of a single goal verification
GoalVerificationCompleted
All goal verifications completed
RalphIterationStarted
Ralph iteration has started
RalphContinuation
Ralph is continuing (verification failed)
RalphCircuitBreak
Ralph circuit breaker tripped
BackgroundTaskSpawned
Background task has been spawned
BackgroundTaskProgress
Background task progress update
BackgroundTaskCompleted
Background task has completed
SubagentStarted
Subagent has been started
SubagentCompleted
Subagent has completed
ModelSwitched
Model was switched at runtime
PermissionEvaluated
Permission was evaluated for a tool
ApprovalCached
Approval decision was cached
CompactionStarted
Context compaction started
CompactionCompleted
Context compaction completed
TodoUpdated
Todo list was updated
Trait Implementations§
Source§impl Clone for ThreadEvent
impl Clone for ThreadEvent
Source§fn clone(&self) -> ThreadEvent
fn clone(&self) -> ThreadEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ThreadEvent
impl Debug for ThreadEvent
Source§impl<'de> Deserialize<'de> for ThreadEvent
impl<'de> Deserialize<'de> for ThreadEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<ThreadEvent> for Event
impl From<ThreadEvent> for Event
Source§fn from(thread_event: ThreadEvent) -> Self
fn from(thread_event: ThreadEvent) -> Self
Auto Trait Implementations§
impl Freeze for ThreadEvent
impl RefUnwindSafe for ThreadEvent
impl Send for ThreadEvent
impl Sync for ThreadEvent
impl Unpin for ThreadEvent
impl UnsafeUnpin for ThreadEvent
impl UnwindSafe for ThreadEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more