Move the tools' arguments and the host rules to proto
Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//! 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,
|
||||
}
|
||||
Reference in New Issue
Block a user