Files
boxmaker/crates/proto/src/tools.rs
T
kyle f095cca1ee Move the tools' arguments and the host rules to proto
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
2026-09-22 22:59:40 -07:00

37 lines
1.1 KiB
Rust

//! The four tools' arguments, decoded from the model's JSON then re-serialised. Shared by
//! `brokerd` (which validates them) and `toolkit` (inside the container, which runs them), so the
//! two must agree on one definition.
use serde::{Deserialize, Serialize};
/// The arguments for `read_file`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ReadFileArgs {
pub path: String,
}
/// The arguments for `write_file`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct WriteFileArgs {
pub path: String,
pub content: String,
}
/// The arguments for `shell`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ShellArgs {
pub command: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cwd: Option<String>,
}
/// The arguments for `http_fetch`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct HttpFetchArgs {
pub url: String,
}