use crate::core::ChangeLog;
use crate::error::Result;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct HistoryRecord {
pub id: String,
pub memory_id: String,
pub old_memory: Option<String>,
pub new_memory: Option<String>,
pub event: String,
pub created_at: Option<String>,
pub updated_at: Option<String>,
pub is_deleted: bool,
pub actor_id: Option<String>,
pub role: Option<String>,
pub user_id: Option<String>,
pub agent_id: Option<String>,
pub session_id: Option<String>,
}
#[async_trait::async_trait]
pub trait HistoryStore: Send + Sync {
async fn record_change(&self, change: ChangeLog) -> Result<()>;
async fn get_history(&self, fact_id: &crate::core::FactId) -> Result<Vec<ChangeLog>>;
async fn delete_history(&self, fact_id: &crate::core::FactId) -> Result<()>;
async fn clear_all(&self) -> Result<()>;
}