Move API code from user/ to agent/

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2026-04-04 00:29:11 -04:00
parent 021eafe6da
commit 9bebbcb635
22 changed files with 259 additions and 251 deletions

View file

@ -5,13 +5,13 @@
// working_stack) and delegates everything else to thought::dispatch.
// Core tools
pub mod bash;
pub mod edit;
pub mod glob;
pub mod grep;
pub mod memory;
pub mod read;
pub mod write;
mod bash;
mod edit;
mod glob;
mod grep;
mod memory;
mod read;
mod write;
// Agent-specific tools
mod control;
@ -53,6 +53,19 @@ pub struct ToolDef {
pub function: FunctionDef,
}
impl ToolDef {
pub fn new(name: &str, description: &str, parameters: serde_json::Value) -> Self {
Self {
tool_type: "function".to_string(),
function: FunctionDef {
name: name.to_string(),
description: description.to_string(),
parameters,
},
}
}
}
/// A tool call requested by the model.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ToolCall {