toolkit: http_fetch through curl
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
@@ -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:?}")),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user