use crate::{AgentConfig, AgentEvent, agent::tool::ToolRegistry, model::Message};
use std::future::Future;
pub trait Hook: Send + Sync {
fn on_build_agent(&self, config: AgentConfig) -> AgentConfig {
config
}
fn on_event(&self, _agent: &str, _session_id: u64, _event: &AgentEvent) {}
fn on_register_tools(&self, _tools: &mut ToolRegistry) -> impl Future<Output = ()> + Send {
async {}
}
fn preprocess(&self, _agent: &str, content: &str) -> String {
content.to_owned()
}
fn on_before_run(&self, _agent: &str, _session_id: u64, _history: &[Message]) -> Vec<Message> {
Vec::new()
}
}
impl Hook for () {}