use serde::Deserialize;
use wcore::{
agent::{AsTool, ToolDescription},
model::Tool,
};
#[derive(Deserialize, schemars::JsonSchema)]
pub struct Delegate {
pub tasks: Vec<DelegateTask>,
}
#[derive(Deserialize, schemars::JsonSchema)]
pub struct DelegateTask {
pub agent: String,
pub message: String,
}
impl ToolDescription for Delegate {
const DESCRIPTION: &'static str = "Delegate tasks to other agents. Runs all tasks in parallel, blocks until all complete, and returns their results.";
}
pub fn tools() -> Vec<Tool> {
vec![Delegate::as_tool()]
}