#[non_exhaustive]pub enum EventKind {
Show 16 variants
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,
},
ComposeKernelStart {
kernel_id: String,
skills_registered: Option<usize>,
tools_registered: Option<usize>,
},
ComposeKernelShutdown {
kernel_id: String,
reason: String,
},
ComposeLoopIteration {
kernel_id: String,
iteration: u64,
skill_id: Option<String>,
confidence: Option<f64>,
},
ComposeSkillResolved {
kernel_id: String,
skill_id: String,
applies: bool,
delta: Option<f64>,
confidence: Option<f64>,
},
ComposeRetryAttempt {
kernel_id: String,
target: String,
attempt: u64,
classification: String,
},
ComposeRecovery {
kernel_id: String,
reason: String,
recovered: bool,
},
}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.
Fields
ComposeKernelStart
A rig-compose kernel became active for a conversation.
Fields
ComposeKernelShutdown
A rig-compose kernel stopped processing.
Fields
ComposeLoopIteration
One iteration of a rig-compose agent/kernel loop began.
Fields
ComposeSkillResolved
A rig-compose skill resolution completed.
Fields
ComposeRetryAttempt
A retry attempt occurred in a rig-compose dispatch or recovery path.
rig-tap does not emit this variant itself: the
[crate::DispatchObserveHook] only observes the lifecycle hooks
surfaced by rig-compose and rig-compose does not currently expose
a per-tool retry hook. Producers with their own retry policy (custom
skills, transports, or higher-level orchestrators) should emit this
variant directly via crate::emit_kind so consumers receive a
consistent shape.
Fields
ComposeRecovery
A rig-compose recovery path completed.
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.
Sourcepub fn scalar_fields(&self) -> ScalarFields<'_>
pub fn scalar_fields(&self) -> ScalarFields<'_>
Extract the per-variant scalar correlation fields that
crate::emit() surfaces directly on the tracing event so that
OpenTelemetry collectors and log indexers can route on them without
parsing the JSON event blob.
Absent fields are returned as "" rather than Option<&str>
because tracing 0.1’s static-field model does not accept
Option<&str> as a Value. Consumers should filter
rig_tap.<field> != "" to detect presence.
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.
Returns true if the event is related to a rig-compose kernel or agent loop.
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.