tools: delete dispatch_shared, use dispatch everywhere
dispatch_shared was a legacy wrapper — replaced by dispatch() which goes through the unified Tool registry. One dispatch path for all callers (interactive agent, subconscious agents, MCP server). Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
51e632c997
commit
1554d88694
2 changed files with 1 additions and 22 deletions
|
|
@ -144,23 +144,6 @@ pub async fn dispatch_with_agent(
|
|||
}
|
||||
}
|
||||
|
||||
/// Dispatch shared tools — used by subconscious agents.
|
||||
pub async fn dispatch_shared(
|
||||
name: &str,
|
||||
args: &serde_json::Value,
|
||||
_provenance: Option<&str>,
|
||||
) -> Option<String> {
|
||||
for tool in tools() {
|
||||
if tool.name == name {
|
||||
return Some(match (tool.handler)(None, args.clone()).await {
|
||||
Ok(s) => s,
|
||||
Err(e) => format!("Error: {}", e),
|
||||
});
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
/// Return all registered tools with definitions + handlers.
|
||||
pub fn tools() -> Vec<Tool> {
|
||||
let mut all = vec![
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue