use serde_json::Value;
use std::time::Duration;
use super::{ToolExecutionRecord, ToolRegistry};
impl ToolRegistry {
pub fn get_recent_tool_records(&self, count: usize) -> Vec<ToolExecutionRecord> {
self.execution_history.get_recent_records(count)
}
pub fn get_recent_tool_failures(&self, count: usize) -> Vec<ToolExecutionRecord> {
self.execution_history.get_recent_failures(count)
}
pub fn find_recent_spooled_output(
&self,
tool_name: &str,
args: &Value,
max_age: Duration,
) -> Option<Value> {
self.execution_history
.find_recent_spooled_result(tool_name, args, max_age)
}
pub fn find_recent_successful_output(
&self,
tool_name: &str,
args: &Value,
max_age: Duration,
) -> Option<Value> {
self.execution_history
.find_recent_successful_result(tool_name, args, max_age)
}
pub fn find_recent_read_file_spool_progress(
&self,
path: &str,
max_age: Duration,
) -> Option<(usize, usize)> {
self.execution_history
.find_recent_read_file_spool_progress(path, max_age)
}
pub fn clear_execution_history(&self) {
self.execution_history.clear();
}
pub fn execution_history_len(&self) -> usize {
self.execution_history.len()
}
}