pub enum Event {
Show 21 variants
RunStarted {Show 13 fields
schema: u32,
basis: String,
session_id: String,
workspace: PathBuf,
model: String,
provider: String,
context_files: Vec<ContextFile>,
skills_dirs: Vec<PathBuf>,
skills: Vec<SkillSummary>,
templates_dirs: Vec<PathBuf>,
templates: Vec<TemplateSummary>,
mcp_files: Vec<ContextFile>,
mcp_servers: Vec<String>,
},
UserMessage {
text: String,
},
AssistantDelta {
text: String,
},
AssistantReasoningDelta {
text: String,
},
AssistantMessage {
text: String,
},
ToolQueued {
tool_call_id: String,
tool_name: String,
summary: String,
mutability: Mutability,
input: Value,
},
ToolStarted {
tool_call_id: String,
tool_name: String,
},
ToolProgress {
tool_call_id: String,
tool_name: String,
progress: String,
},
ToolCompleted {
tool_call_id: String,
tool_name: String,
summary: String,
is_error: bool,
},
PermissionRequested {
request_id: String,
tool_call_id: String,
tool_name: String,
description: String,
preview: Value,
},
PermissionResolved {
request_id: String,
tool_call_id: String,
tool_name: String,
outcome: PermissionOutcome,
rule_scope: Option<RuleScope>,
},
TaskUpdated {
task_id: String,
kind: TaskKind,
status: TaskStatus,
title: String,
detail: Option<String>,
},
CompactionStarted {
agent_id: String,
},
CompactionCompleted {
agent_id: String,
replaced_items: usize,
preserved_items: usize,
transcript_len: usize,
extracted_facts: usize,
summary_preview: String,
},
MemoryUpdated {
agent_id: String,
stored_records: usize,
},
Usage {
agent_id: String,
input_tokens: u64,
output_tokens: u64,
cache_read_tokens: u64,
cache_creation_tokens: u64,
},
Notice {
severity: NoticeSeverity,
message: String,
},
Retry {
agent_id: String,
error: String,
attempt: u32,
max_attempts: u32,
next_delay_ms: u64,
},
Error {
message: String,
recoverable: bool,
},
Branched {
entry_id: String,
abandoned_entries: usize,
},
RunFinished {
outcome: RunOutcome,
stopped_by: Option<Bound>,
},
}Expand description
Everything that can appear on the stream.
RunStarted and RunFinished are basis’s own bookends; the rest are
normalized from mentra’s SessionEvent.
Variants§
RunStarted
Always the first line. Carries the schema version.
Fields
context_files: Vec<ContextFile>Context files discovered for this run, weakest precedence first.
skills_dirs: Vec<PathBuf>Skills directories in effect, most specific first. Omitted rather than empty so a stream without skills stays quiet about them.
skills: Vec<SkillSummary>The skills those directories produced, after layering — what the model can actually load by name.
templates: Vec<TemplateSummary>The templates those directories produced, after layering — what a client can offer as commands.
mcp_files: Vec<ContextFile>MCP configuration files in effect, weakest precedence first.
Named for the same reason context files are, and more urgently: an
.mcp.json says which programs to spawn and carries the
credentials to spawn them with, so it is the last thing that should
take effect without appearing anywhere.
UserMessage
AssistantDelta
AssistantReasoningDelta
AssistantMessage
ToolQueued
Fields
mutability: MutabilityToolStarted
ToolProgress
ToolCompleted
PermissionRequested
Fields
PermissionResolved
Fields
outcome: PermissionOutcomeTaskUpdated
CompactionStarted
CompactionCompleted
Fields
MemoryUpdated
Usage
Fields
Notice
Retry
Error
Branched
The session returned to an earlier entry; later turns continue from there along a different path.
Fields
RunFinished
Always the last line.
Fields
outcome: RunOutcomeImplementations§
Source§impl Event
impl Event
Sourcepub fn from_session_event(event: &SessionEvent) -> Option<Self>
pub fn from_session_event(event: &SessionEvent) -> Option<Self>
Normalizes a mentra session event, or None when basis’s stream already
carries the information some other way.