use std::collections::HashMap;
use std::sync::Arc;
use async_trait::async_trait;
use crate::cm_config::AgentConfig;
use crate::cm_types::ToolCall;
use crate::tool_registry::{DispatchToolParams, HandlerLookupTable, WebToolRuntime};
pub type ParallelPrefetchFailureKey = (String, String);
pub type ParallelPrefetchFailures = HashMap<ParallelPrefetchFailureKey, String>;
pub struct ParallelPrefetchParams<'a> {
pub tool_calls: &'a [ToolCall],
pub cfg: &'a Arc<AgentConfig>,
pub web_tool_ctx: Option<&'a WebToolRuntime>,
pub handler_lookup: &'a HandlerLookupTable,
}
#[async_trait]
pub trait ToolExecutionHost: Send + Sync {
async fn dispatch_tool_call(
&mut self,
name: &str,
p: DispatchToolParams<'_>,
) -> (String, Option<serde_json::Value>);
async fn prefetch_parallel_approval_failures(
&self,
params: ParallelPrefetchParams<'_>,
) -> ParallelPrefetchFailures;
}