toolkit: shell

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-23 00:06:44 -07:00
parent 5e55fe4c66
commit ac1ecacadc
4 changed files with 192 additions and 1 deletions
+9 -1
View File
@@ -1,9 +1,10 @@
//! The programs that run inside tool containers.
use proto::tools::{ReadFileArgs, WriteFileArgs};
use proto::tools::{ReadFileArgs, ShellArgs, WriteFileArgs};
pub mod files;
pub mod input;
pub mod shell;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Exit {
@@ -77,6 +78,13 @@ pub fn run(name: &str, stdin: &mut dyn std::io::Read) -> Outcome {
};
files::write_file(&args)
}
"shell" => {
let args = match input::parse::<ShellArgs>(name, &text) {
Ok(a) => a,
Err(e) => return Outcome::misuse(e),
};
shell::shell(&args)
}
_ => Outcome::misuse(format!("toolkit: unknown tool {name:?}")),
}
}