Expand description
basis’s event stream: one schema, many surfaces.
Mentra’s SessionEvent broadcast is the source of truth for what happens
during a run. This module normalizes it into a wire contract basis owns, so
that basis spawn --json (with basis run retained as an alias), the ACP
mapping (P2), and anything downstream all read the same shape — and so a
change inside mentra does not silently
become a change in basis’s output.
§Wire format
Newline-delimited JSON, one EventLine per line. The first line is
always Event::RunStarted, which carries EVENT_SCHEMA_VERSION; a
consumer reads the version before anything else and can refuse a stream it
does not understand. The last line is always Event::RunFinished.
{"seq":0,"type":"run_started","schema":1,"basis":"0.1.0","workspace":"/repo",...}
{"seq":1,"type":"assistant_delta","text":"Looking at "}
{"seq":2,"type":"run_finished","status":"ok"}Structs§
- Context
File - A context file that was in effect for the run.
- Event
Line - One line of the stream: a sequence number and the event itself, flattened so a line is a single flat JSON object.
- Jsonl
Writer - Writes
Events as JSONL, assigning sequence numbers. - Skill
Summary - A skill the run can load by name. Bodies stay out of the stream — they are
what
load_skillis for, and keeping them out is what makes skills cheap. - Template
Summary - A prompt template a client can offer as a command.
Enums§
- Event
- Everything that can appear on the stream.
- Mutability
- Whether a tool call can change anything outside the process.
- Notice
Severity - Severity of an out-of-band notice.
- Permission
Outcome - How a permission request was resolved.
- Rule
Scope - How far a remembered permission decision reaches.
- RunOutcome
- How a run ended.
- Task
Kind - What kind of concurrent work a task event describes.
- Task
Status - Where a task is in its lifecycle.
Constants§
- EVENT_
SCHEMA_ VERSION - Version of the JSONL wire format. Bumped when a change would break a consumer that reads the current shape.