Skip to main content

agent_storage/contracts/
run_store.rs

1//! Stores mutable
2
3use super::{StorageError, StoredRun};
4use async_trait::async_trait;
5use uuid::Uuid;
6
7/// Stores mutable run snapshots.
8///
9/// insert_run must reject an existing identifier. update_run must reject a
10/// missing identifier and must not change the record's identity. list_runs
11/// returns snapshots ordered newest-first by creation time.
12#[async_trait]
13pub trait RunStore: Send + Sync {
14    async fn insert_run(&self, run: StoredRun) -> Result<(), StorageError>;
15    async fn update_run(&self, run: StoredRun) -> Result<(), StorageError>;
16    async fn get_run(&self, id: Uuid) -> Result<Option<StoredRun>, StorageError>;
17    async fn list_runs(
18        &self,
19        conversation_id: Option<Uuid>,
20    ) -> Result<Vec<StoredRun>, StorageError>;
21}