AgentSessionStore

Trait AgentSessionStore 

Source
pub trait AgentSessionStore {
    // Required methods
    fn save(&self, session: &AgentSession) -> Result<(), AppError>;
    fn load(&self, id: &str) -> Result<AgentSession, AppError>;
    fn delete(&self, id: &str) -> Result<bool, AppError>;
    fn list(&self, filter: SessionFilter) -> Result<Vec<SessionInfo>, AppError>;
    fn load_last(&self) -> Result<Option<AgentSession>, AppError>;
    fn find_by_prefix(&self, prefix: &str) -> Result<Option<String>, AppError>;
}
Expand description

A storage abstraction for agent sessions.

Required Methods§

Source

fn save(&self, session: &AgentSession) -> Result<(), AppError>

Save a session.

Source

fn load(&self, id: &str) -> Result<AgentSession, AppError>

Load a session by id.

Source

fn delete(&self, id: &str) -> Result<bool, AppError>

Delete a session by id.

Source

fn list(&self, filter: SessionFilter) -> Result<Vec<SessionInfo>, AppError>

List sessions matching a filter.

Source

fn load_last(&self) -> Result<Option<AgentSession>, AppError>

Load the most recently active session.

Source

fn find_by_prefix(&self, prefix: &str) -> Result<Option<String>, AppError>

Find a session id by prefix (used for CLI convenience).

Implementors§