use std::sync::Arc;
use bamboo_agent_core::tools::ToolExecutor;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ToolSurface {
Base,
Child,
WithTask,
Root,
}
#[derive(Clone)]
pub struct ToolSurfaceFactory {
base: Arc<dyn ToolExecutor>,
with_task: Arc<dyn ToolExecutor>,
root: Arc<dyn ToolExecutor>,
}
impl ToolSurfaceFactory {
pub fn new(
base: Arc<dyn ToolExecutor>,
with_task: Arc<dyn ToolExecutor>,
root: Arc<dyn ToolExecutor>,
) -> Self {
Self {
base,
with_task,
root,
}
}
pub fn get(&self, surface: ToolSurface) -> Arc<dyn ToolExecutor> {
match surface {
ToolSurface::Base => self.base.clone(),
ToolSurface::Child => self.base.clone(),
ToolSurface::WithTask => self.with_task.clone(),
ToolSurface::Root => self.root.clone(),
}
}
}