toolkit: http_fetch through curl

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-23 00:14:16 -07:00
parent ac1ecacadc
commit adf6713866
4 changed files with 302 additions and 1 deletions
+9 -1
View File
@@ -1,7 +1,8 @@
//! The programs that run inside tool containers.
use proto::tools::{ReadFileArgs, ShellArgs, WriteFileArgs};
use proto::tools::{HttpFetchArgs, ReadFileArgs, ShellArgs, WriteFileArgs};
pub mod fetch;
pub mod files;
pub mod input;
pub mod shell;
@@ -85,6 +86,13 @@ pub fn run(name: &str, stdin: &mut dyn std::io::Read) -> Outcome {
};
shell::shell(&args)
}
"http_fetch" => {
let args = match input::parse::<HttpFetchArgs>(name, &text) {
Ok(a) => a,
Err(e) => return Outcome::misuse(e),
};
fetch::fetch(&args)
}
_ => Outcome::misuse(format!("toolkit: unknown tool {name:?}")),
}
}