use async_trait::async_trait;
use crate::message::ToolCall;
use crate::tool::{ToolContext, ToolOutput};
#[derive(Debug, Clone, PartialEq)]
pub enum PreToolUseDecision {
Allow,
Deny {
reason: String,
},
}
#[async_trait]
pub trait PreToolUseHook: Send + Sync {
async fn before_tool_use(&self, call: &ToolCall, context: &ToolContext) -> PreToolUseDecision;
}
#[async_trait]
pub trait PostToolExecHook: Send + Sync {
async fn after_tool_exec(
&self,
call: &ToolCall,
output: ToolOutput,
context: &ToolContext,
) -> ToolOutput;
}