Skip to main content
MobKit produces a unified event stream that merges agent events from Meerkat with module events from MobKit’s operational subsystems. Every event is wrapped in an EventEnvelope with a unique ID, source tag, and millisecond timestamp.

Event envelope

Unified event types

The UnifiedEvent enum distinguishes agent events from module events:

Agent events

Agent events originate from Meerkat’s agent loop. MobKit does not generate agent events — it receives them from the Meerkat runtime and merges them into the unified stream.

Module events

Module events originate from MobKit’s operational subsystems. Common module event types:

Event merging

The unified runtime merges events from both sources into a single merged_events vector, ordered by timestamp_ms. When timestamps collide, agent events sort before module events to preserve causal ordering from the agent’s perspective.

Normalization

Raw event lines from modules are normalized before entering the merged stream. Normalization ensures:
  • Event IDs are present and unique
  • Timestamps are monotonically increasing
  • Source tags are consistent
  • Malformed events produce NormalizationError rather than silent corruption

Structural mob events (durable)

In addition to the lossy UnifiedEvent::Agent projection, mobkit exposes the structural event surface — typed envelopes preserving every meerkat MobEventKind (25 variants — flow_started, step_dispatched, members_wired, supervisor_escalation, …) with their mob_id, run_id, step_id, and agent_identity context intact.

Durable cursors

cursor is the meerkat ledger cursor — the same monotonic id the upstream store uses. Mobkit’s subscription task streams events from MobEventsView::subscribe_after(cursor) and writes the last-projected cursor to a PersistentMetadataStore after each projection. On restart, the runtime resumes from that cursor — events written while mobkit was down are replayed, not skipped.
  • .persistent_state(path) builds auto-install a SQLite metadata store at <path>/mobkit_metadata.sqlite. No caller action required.
  • Ephemeral builds use the in-memory store (no durable resume — the ledger isn’t persistent either).

Access surfaces

See SSE API for the SSE shape and JSON-RPC API for the snapshot RPCs and error codes.

Lifecycle events

The runtime emits lifecycle events at key milestones: These are available through runtime.lifecycle_events() for observability and readiness checks.

See also