#[non_exhaustive]pub enum EventKind {
PromptStarted {
model: String,
messages_in: usize,
},
PromptCompleted {
model: String,
tokens_in: Option<u64>,
tokens_out: Option<u64>,
response_id: Option<String>,
},
ToolInvoked {
tool_name: String,
provider_call_id: Option<String>,
call_id: String,
args_json: String,
truncated: bool,
},
ToolCompleted {
tool_name: String,
provider_call_id: Option<String>,
call_id: String,
result: String,
truncated: bool,
},
ToolSkipped {
tool_name: String,
call_id: String,
reason: String,
},
ToolTerminated {
tool_name: String,
call_id: String,
reason: String,
},
ContextSampled {
message_count: usize,
byte_size: usize,
token_estimate: Option<u64>,
},
ContextCompacted {
evicted_count: usize,
evicted_bytes: usize,
carry_over: bool,
summary_bytes: usize,
},
MemoryDemoted {
demoted_count: usize,
tags: Vec<String>,
},
MemoryFrameWritten {
frame_kind: String,
frame_count_after: Option<u64>,
bytes_written: usize,
},
}Expand description
Payload variants. Tagged on the wire as "kind": "<dotted.name>".
New variants are additive; rename or remove is a breaking change requiring
a bump of SCHEMA_VERSION.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PromptStarted
A prompt is about to be sent to the model provider.
Fields
PromptCompleted
A prompt finished; the model returned a completion response.
Fields
ToolInvoked
A tool is about to be invoked.
Fields
truncated: booltrue if args_json was truncated to
PAYLOAD_TRUNCATE_BYTES.
ToolCompleted
A tool finished executing.
Fields
truncated: booltrue if result was truncated to PAYLOAD_TRUNCATE_BYTES.
ToolSkipped
A previously-ToolInvoked call was skipped by a gating hook before
the tool body ran. Pairs by call_id and closes the
tool.invoked/tool.completed gap that would otherwise leave the
invoke event orphaned.
Fields
ToolTerminated
A previously-ToolInvoked call triggered a hook-driven termination
of the agent loop. Pairs by call_id.
Fields
ContextSampled
The active context was sampled (typically on ConversationMemory::load).
Fields
ContextCompacted
A compactor fired, replacing some evicted history with a summary artifact.
Fields
MemoryDemoted
A demotion hook moved messages to long-term storage.
MemoryFrameWritten
A frame was written to the long-term store.
Implementations§
Source§impl EventKind
impl EventKind
Sourcepub fn discriminant(&self) -> &'static str
pub fn discriminant(&self) -> &'static str
Returns the wire kind discriminant for this event.
Returns true if the event is part of the prompt lifecycle (prompt.started, prompt.completed).
Returns true if the event is part of the tool lifecycle (tool.invoked, tool.completed, tool.skipped, tool.terminated).
Returns true if the event is related to memory and context management.
Sourcepub fn tool_call_id(&self) -> Option<&str>
pub fn tool_call_id(&self) -> Option<&str>
Extacts the stable call_id for tool events, if present.