1use serde::Deserialize;
7use wcore::{
8 agent::{AsTool, ToolDescription},
9 model::Tool,
10};
11
12#[derive(Deserialize, schemars::JsonSchema)]
13pub struct Delegate {
14 pub tasks: Vec<DelegateTask>,
16}
17
18#[derive(Deserialize, schemars::JsonSchema)]
19pub struct DelegateTask {
20 pub agent: String,
22 pub message: String,
24}
25
26impl ToolDescription for Delegate {
27 const DESCRIPTION: &'static str = "Delegate tasks to other agents. Runs all tasks in parallel, blocks until all complete, and returns their results.";
28}
29
30pub fn tools() -> Vec<Tool> {
31 vec![Delegate::as_tool()]
32}