Enum Event Copy item path Source #[non_exhaustive]
pub enum Event {
Init {
session_id: String ,
harness: String ,
api_schema: String ,
model: String ,
cwd: String ,
max_turns: Option <u32 >,
preamble: Vec <Message >,
tools: Vec <Value >,
},
Message {
message: Message ,
},
Result {
report: Report ,
},
Error {
message: String ,
},
}Expand description One event in the stream-json trajectory (one JSON object per line).
The stream is a self-sufficient, replayable source of the whole run : Init
carries the base prompt + tool specs + model, and each Event::Message carries a
full turn — so reconstruct_conversation rebuilds the entire history with nothing
else. (Claude Code’s stream omits system/tools, forcing a proxy capture to
recover them; Init closes that gap.) #[non_exhaustive] so events can be added
(e.g. per-turn markers) without a breaking change.
This enum is marked as non-exhaustive Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Emitted once at the start — everything needed to reconstruct context.
Fields The harness pack in use (e.g. grok).
The wire schema in use (e.g. anthropic) — the provider’s api_schema().
The max-turns ceiling; absent = unlimited (the default — ADR-0005
amendment 2026-07-18).
The base System + Developer messages (prompt + capabilities).
The tool specs offered to the model (name + JSON schema), as JSON values.
A full message appended to the history (the trace): role + content blocks.
The terminal event: the final report (identical to --output-format json).
Fields The run’s report envelope.
A non-terminal error note (e.g. a retry); terminal errors ride in Event::Result .
Fields A human-readable message.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Deserialize this value from the given Serde deserializer.
Read more Serialize this value into the given Serde serializer.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Instruments this type with the provided
Span, returning an
Instrumented wrapper.
Read more Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer.
Read more Mutably dereferences the given pointer.
Read more Drops the object pointed to by the given pointer.
Read more The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.