Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aegis-runtime-mv/blob/main/src/sessions/store.rs # aegis-runtime-mv Native Rust agent runtime: Axum WebSocket/SSE/REST gateway, heartbeat scheduler, dependency-aware task workflow, SQLite storage. Attachment of AienOS. Pre-alpha. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aegis-runtime-mv / src / sessions / store.rs` 53 lines ยท 2309 bytes Raw Blame History 1 use super::id::{ActionId, ApprovalId, MessageId, RunId, SessionId}; 2 use super::message::Message; 3 use super::session::Session; 4 use crate::defense::Approval; 5 use crate::execution::Action; 6 use crate::orchestration::Run; 7 use crate::persistence::PersistenceError; 8 use async_trait::async_trait; 9 10 #[async_trait] 11 pub trait SessionStore: Send + Sync { 12 async fn create(&self, session: &Session) -> Result<(), PersistenceError>; 13 async fn get(&self, id: &SessionId) -> Result, PersistenceError>; 14 async fn update(&self, session: &Session) -> Result<(), PersistenceError>; 15 async fn list(&self, limit: usize, offset: usize) -> Result, PersistenceError>; 16 } 17 18 #[async_trait] 19 pub trait MessageStore: Send + Sync { 20 async fn append( 21 &self, 22 session_id: &SessionId, 23 message: &Message, 24 ) -> Result<(), PersistenceError>; 25 async fn list(&self, session_id: &SessionId) -> Result, PersistenceError>; 26 async fn get(&self, message_id: &MessageId) -> Result, PersistenceError>; 27 } 28 29 #[async_trait] 30 pub trait RunStore: Send + Sync { 31 async fn create(&self, run: &Run) -> Result<(), PersistenceError>; 32 async fn get(&self, id: &RunId) -> Result, PersistenceError>; 33 async fn update(&self, run: &Run) -> Result<(), PersistenceError>; 34 async fn list_by_session(&self, session_id: &SessionId) -> Result, PersistenceError>; 35 async fn get_active_run(&self, session_id: &SessionId) 36 -> Result, PersistenceError>; 37 } 38 39 #[async_trait] 40 pub trait ActionStore: Send + Sync { 41 async fn create(&self, action: &Action) -> Result<(), PersistenceError>; 42 async fn get(&self, id: &ActionId) -> Result, PersistenceError>; 43 async fn update(&self, action: &Action) -> Result<(), PersistenceError>; 44 async fn list_by_run(&self, run_id: &RunId) -> Result, PersistenceError>; 45 } 46 47 #[async_trait] 48 pub trait ApprovalStore: Send + Sync { 49 async fn create(&self, approval: &Approval) -> Result<(), PersistenceError>; 50 async fn get(&self, id: &ApprovalId) -> Result, PersistenceError>; 51 async fn update(&self, approval: &Approval) -> Result<(), PersistenceError>; 52 async fn list_pending(&self) -> Result, PersistenceError>; 53 }