Skip to main content

Event

Enum Event 

Source
pub enum Event {
Show 36 variants SessionCreated { profile_revision_id: ProfileRevisionId, }, SessionForked { parent_session_id: SessionId, parent_seq: u64, }, SessionDeleted { reason: String, }, InputQueued { input_id: InputId, run_id: RunId, mode: DeliveryMode, content: Vec<ContentBlock>, explicit_skill: Option<String>, }, InputClaimed { input_id: InputId, run_id: RunId, }, InputCancelled { input_id: InputId, run_id: RunId, error_code: String, }, RunStarted { run_id: RunId, input_id: InputId, }, RunWaiting { run_id: RunId, interaction_id: InteractionId, }, RunResumed { run_id: RunId, interaction_id: InteractionId, }, RunFinished { run_id: RunId, status: RunStatus, error_code: Option<String>, }, TurnStarted { run_id: RunId, turn: u32, }, TurnFinished { run_id: RunId, turn: u32, }, StepStarted { run_id: RunId, step: u32, }, StepFinished { run_id: RunId, step: u32, }, UserMessage { run_id: RunId, content: Vec<ContentBlock>, }, AssistantDelta { run_id: RunId, step: u32, attempt: u32, content: String, }, AssistantMessage { run_id: RunId, step: u32, attempt: u32, content: Vec<ContentBlock>, }, AssistantToolCalls { run_id: RunId, step: u32, content: Option<String>, calls: Vec<RecordedToolCall>, }, ToolCall { run_id: RunId, step: u32, call_id: ToolCallId, tool: String, arguments: Value, }, ToolAuthorization { run_id: RunId, step: u32, call_id: ToolCallId, status: ToolAuthorizationStatus, reason: Option<String>, }, ToolExecutionStarted { run_id: RunId, step: u32, call_id: ToolCallId, }, ToolResult { run_id: RunId, step: u32, call_id: ToolCallId, result: Value, is_error: bool, }, UsageRecorded { run_id: RunId, operation_id: String, prompt_tokens: u64, completion_tokens: u64, cost_units: u64, }, RetryScheduled { run_id: RunId, attempt: u32, delay_ms: u64, reason: String, }, ModelRequestPrepared { run_id: RunId, step: u32, attempt: u32, provider_attempt_id: String, operation_id: String, reserved_prompt_tokens: u64, reserved_completion_tokens: u64, request: Value, prompt_sections: Value, }, ContextInjected { run_id: RunId, step: u32, contribution_id: String, source: String, version: String, authority: String, form: String, content: Vec<ContentBlock>, }, ModelAttemptFailed { run_id: RunId, step: u32, attempt: u32, error: String, retryable: bool, }, CompactionStarted { run_id: RunId, compaction_id: String, source_through_seq: u64, }, ToolResultsPruned { run_id: RunId, call_ids: Vec<ToolCallId>, }, SummaryReplaced { run_id: RunId, through_seq: u64, summary: String, compactor: String, model: String, }, CompactionFinished { run_id: RunId, compaction_id: String, status: String, error: Option<String>, }, InteractionRequested { run_id: RunId, interaction_id: InteractionId, kind: InteractionKind, payload: Value, }, InteractionResolved { run_id: RunId, interaction_id: InteractionId, resolution: InteractionResolution, payload: Value, }, ChildSessionLinked { run_id: RunId, child_session_id: SessionId, provider: String, }, Extension { run_id: RunId, plugin_id: String, event_type: String, payload: Value, }, Opaque { format_version: u32, event_type: String, ignorable: bool, payload: Value, },
}
Expand description

Every model-visible fact and lifecycle transition of a Session. The log is the source of truth; everything else is a projection.

Variants§

§

SessionCreated

First event of a Session, pinning its Profile revision.

Fields

§profile_revision_id: ProfileRevisionId

Profile revision the Session pins for its lifetime.

§

SessionForked

First event of a forked Session, citing the parent position it copied through.

Fields

§parent_session_id: SessionId

Session the fork was cut from.

§parent_seq: u64

Last parent sequence included in the fork.

§

SessionDeleted

Tombstone: active and queued Runs are closed, listing hides the Session, history stays readable.

Fields

§reason: String

Why the Session was deleted.

§

InputQueued

Input entered the inbox for run_id.

Fields

§input_id: InputId

Queued input.

§run_id: RunId

Run that will consume the input (a new Run for followup).

§mode: DeliveryMode

Delivery semantics.

§content: Vec<ContentBlock>

Submitted content.

§explicit_skill: Option<String>

Skill slug invoked explicitly with this input.

§

InputClaimed

The Run took the input out of the inbox.

Fields

§input_id: InputId

Claimed input.

§run_id: RunId

Claiming Run.

§

InputCancelled

The input was dropped before a Run consumed it.

Fields

§input_id: InputId

Cancelled input.

§run_id: RunId

Run that would have consumed it.

§error_code: String

Machine-readable cancellation code.

§

RunStarted

A Run began executing.

Fields

§run_id: RunId

The Run.

§input_id: InputId

Input that started it.

§

RunWaiting

The Run parked on an interaction.

Fields

§run_id: RunId

The Run.

§interaction_id: InteractionId

Interaction it waits for.

§

RunResumed

The Run resumed after its interaction resolved.

Fields

§run_id: RunId

The Run.

§interaction_id: InteractionId

Resolved interaction.

§

RunFinished

The Run reached a terminal status.

Fields

§run_id: RunId

The Run.

§status: RunStatus

Terminal status.

§error_code: Option<String>

Machine-readable failure code.

§

TurnStarted

A Turn opened.

Fields

§run_id: RunId

The Run.

§turn: u32

Turn number.

§

TurnFinished

A Turn closed.

Fields

§run_id: RunId

The Run.

§turn: u32

Turn number.

§

StepStarted

A Step opened.

Fields

§run_id: RunId

The Run.

§step: u32

Step number.

§

StepFinished

A Step closed.

Fields

§run_id: RunId

The Run.

§step: u32

Step number.

§

UserMessage

User content entered the transcript.

Fields

§run_id: RunId

The Run.

§content: Vec<ContentBlock>

Content blocks.

§

AssistantDelta

Streamed assistant text fragment.

Fields

§run_id: RunId

The Run.

§step: u32

Step producing it.

§attempt: u32

Provider attempt producing it.

§content: String

Text fragment.

§

AssistantMessage

Final assistant content for a step.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§attempt: u32

Provider attempt that succeeded.

§content: Vec<ContentBlock>

Content blocks.

§

AssistantToolCalls

The model requested tool calls.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§content: Option<String>

Text accompanying the calls.

§calls: Vec<RecordedToolCall>

Requested calls in model order.

§

ToolCall

One tool call was admitted with immutable arguments.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§call_id: ToolCallId

Call identity.

§tool: String

Tool name.

§arguments: Value

Immutable arguments.

§

ToolAuthorization

Authorization outcome for a tool call.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§call_id: ToolCallId

Call identity.

§status: ToolAuthorizationStatus

Outcome.

§reason: Option<String>

Why it was denied or parked.

§

ToolExecutionStarted

Tool execution began.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§call_id: ToolCallId

Call identity.

§

ToolResult

Tool execution finished.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§call_id: ToolCallId

Call identity.

§result: Value

Result value.

§is_error: bool

Whether the result is an error.

§

UsageRecorded

Usage settled for one idempotent operation.

Fields

§run_id: RunId

The Run.

§operation_id: String

Idempotent operation identity.

§prompt_tokens: u64

Prompt tokens.

§completion_tokens: u64

Completion tokens.

§cost_units: u64

Provider-neutral cost units.

§

RetryScheduled

A model retry was scheduled.

Fields

§run_id: RunId

The Run.

§attempt: u32

Failed attempt number.

§delay_ms: u64

Backoff before the next attempt.

§reason: String

Failure reason.

§

ModelRequestPrepared

The frozen model request before it is sent; the durable attempt identity makes crashes reconcilable.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§attempt: u32

Attempt number.

§provider_attempt_id: String

Durable provider attempt identity.

§operation_id: String

Usage operation identity.

§reserved_prompt_tokens: u64

Prompt tokens reserved.

§reserved_completion_tokens: u64

Completion tokens reserved.

§request: Value

Redacted request as sent.

§prompt_sections: Value

Prompt sections the request was composed from.

§

ContextInjected

Context a contributor injected into a step.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§contribution_id: String

Contribution identity.

§source: String

Contributor source.

§version: String

Contributor version.

§authority: String

trusted or untrusted.

§form: String

Rendering form.

§content: Vec<ContentBlock>

Content blocks.

§

ModelAttemptFailed

A model attempt failed.

Fields

§run_id: RunId

The Run.

§step: u32

Step.

§attempt: u32

Attempt number.

§error: String

Failure.

§retryable: bool

Whether a retry may help.

§

CompactionStarted

Compaction began.

Fields

§run_id: RunId

The Run.

§compaction_id: String

Compaction identity.

§source_through_seq: u64

Last sequence the summary covers.

§

ToolResultsPruned

Large tool results were truncated in the transcript.

Fields

§run_id: RunId

The Run.

§call_ids: Vec<ToolCallId>

Truncated calls.

§

SummaryReplaced

A summary replaced transcript through through_seq.

Fields

§run_id: RunId

The Run.

§through_seq: u64

Last sequence replaced.

§summary: String

Summary text.

§compactor: String

Compactor name.

§model: String

Model used.

§

CompactionFinished

Compaction finished.

Fields

§run_id: RunId

The Run.

§compaction_id: String

Compaction identity.

§status: String

completed or failed.

§error: Option<String>

Failure, when failed.

§

InteractionRequested

The Run asked the user for an approval or answer.

Fields

§run_id: RunId

The Run.

§interaction_id: InteractionId

Interaction identity.

§kind: InteractionKind

Approval or question.

§payload: Value

What is being asked.

§

InteractionResolved

The user resolved an interaction.

Fields

§run_id: RunId

The Run.

§interaction_id: InteractionId

Interaction identity.

§resolution: InteractionResolution

Outcome.

§payload: Value

Answer payload.

§

ChildSessionLinked

A child Session was created for this Run.

Fields

§run_id: RunId

The Run.

§child_session_id: SessionId

Child Session.

§provider: String

Subagent provider.

§

Extension

Plugin-defined event; readers that do not know event_type treat it as data.

Fields

§run_id: RunId

The Run.

§plugin_id: String

Plugin that emitted it.

§event_type: String

Plugin event type.

§payload: Value

Plugin payload.

§

Opaque

An event this build cannot decode; ignorable decides whether replay may skip it.

Fields

§format_version: u32

Producer format version.

§event_type: String

Producer event type.

§ignorable: bool

Whether readers may skip it.

§payload: Value

Raw payload.

Implementations§

Source§

impl Event

Source

pub fn format_version(&self) -> u32

Format version of this event.

Source

pub fn event_type(&self) -> &str

Stable snake_case event type.

Source

pub fn ignorable(&self) -> bool

Whether an unknown reader may skip this event.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Event

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Event) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Event

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.