use async_trait::async_trait;
use super::error::A2aStorageError;
use crate::streaming::StreamEvent;
#[async_trait]
pub trait A2aEventStore: Send + Sync {
fn backend_name(&self) -> &'static str;
async fn append_event(
&self,
tenant: &str,
task_id: &str,
event: StreamEvent,
) -> Result<u64, A2aStorageError>;
async fn get_events_after(
&self,
tenant: &str,
task_id: &str,
after_sequence: u64,
) -> Result<Vec<(u64, StreamEvent)>, A2aStorageError>;
async fn latest_sequence(&self, tenant: &str, task_id: &str) -> Result<u64, A2aStorageError>;
async fn cleanup_expired(&self) -> Result<u64, A2aStorageError>;
}