pub struct EventStore { /* private fields */ }Implementations§
Source§impl EventStore
impl EventStore
pub fn open(path: impl AsRef<Path>) -> Result<Self, EventError>
pub fn open_memory() -> Result<Self, EventError>
pub fn path(&self) -> Option<&Path>
Monotonic durable authority generation. It is incremented in the same SQLite transaction as every event, lifecycle, trusted-state, or replacement mutation, so a publication fence can use it as a real mutation-time token rather than inferring change from a later read.
pub fn append( &mut self, session_id: &str, kind: EventKind, payload: &Value, ) -> Result<Event, EventError>
Sourcepub fn start_genui_action(
&mut self,
session_id: &str,
action_id: &str,
identity: &Value,
requires_confirmation: bool,
) -> Result<Event, EventError>
pub fn start_genui_action( &mut self, session_id: &str, action_id: &str, identity: &Value, requires_confirmation: bool, ) -> Result<Event, EventError>
Atomically transition a confirmed GenUI action into execution. The transition is kept in the append-only session history so concurrent processes and restarts observe the same lifecycle.
pub fn events(&self, session_id: &str) -> Result<Vec<Event>, EventError>
Sourcepub fn reconcile_genui_actions(
&mut self,
session_id: &str,
) -> Result<usize, EventError>
pub fn reconcile_genui_actions( &mut self, session_id: &str, ) -> Result<usize, EventError>
Convert any in-flight GenUI execution to an explicit unknown outcome after a process restart. An external MCP side effect must never be retried blindly when its prior outcome is not durable.
pub fn replacement_for_session( &self, replacement_session_id: &str, ) -> Result<Option<SessionReplacementRecord>, EventError>
pub fn replacement_for_predecessor( &self, predecessor_session_id: &str, ) -> Result<Option<SessionReplacementRecord>, EventError>
Sourcepub fn session_ids_by_recency(&self) -> Result<Vec<String>, EventError>
pub fn session_ids_by_recency(&self) -> Result<Vec<String>, EventError>
Return known session IDs from most recently active to least recently active.
This is intentionally a small event-store query rather than a mutable “current session” pointer. Resume selection can therefore be rebuilt from the same append-only history used by the authority boundary.