use uuid::Uuid;
use crate::model::event::{AgentEvent, EventType};
use crate::query::MnemoEngine;
pub async fn build_event(
_engine: &MnemoEngine,
agent_id: &str,
event_type: EventType,
payload: serde_json::Value,
content_for_hash: &str,
thread_id: Option<String>,
) -> AgentEvent {
let now = chrono::Utc::now().to_rfc3339();
let event_content_hash = crate::hash::compute_content_hash(content_for_hash, agent_id, &now);
AgentEvent {
id: Uuid::now_v7(),
agent_id: agent_id.to_string(),
thread_id,
run_id: None,
parent_event_id: None,
event_type,
payload,
trace_id: None,
span_id: None,
model: None,
tokens_input: None,
tokens_output: None,
latency_ms: None,
cost_usd: None,
timestamp: now.clone(),
logical_clock: 0,
content_hash: event_content_hash,
prev_hash: None,
embedding: None,
}
}