forked from kent/consciousness
tools: add Tool registry with handlers
Tool struct wraps ToolDef + async handler function. tools() returns the complete registry — single source of truth for definitions and dispatch. Handler signature: fn(Option<Arc<Mutex<Agent>>>, Value) -> BoxFuture<Result<String>> All tools registered: file ops, bash, web, vision, memory (15 tools), channels (4 tools), control (3 tools). Working stack removed from registry (will be replaced). Old dispatch functions remain for now — next step is to route dispatch through the registry. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
1a13534946
commit
3e6c77e31e
2 changed files with 62 additions and 17 deletions
|
|
@ -48,6 +48,12 @@ pub(super) fn definition() -> ToolDef {
|
|||
)
|
||||
}
|
||||
|
||||
/// Text-only version for the Tool registry.
|
||||
pub fn view_image_text(args: &serde_json::Value) -> anyhow::Result<String> {
|
||||
let output = view_image(args)?;
|
||||
Ok(output.text)
|
||||
}
|
||||
|
||||
/// View an image file or capture a tmux pane.
|
||||
pub(super) fn view_image(args: &serde_json::Value) -> Result<ToolOutput> {
|
||||
let a: Args = serde_json::from_value(args.clone())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue