Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(tools): add JSON parameter schemas for tool definitions

Steven Enamakel59d212760d55
diff --git a/crates/openhuman-core/src/flows/parameters/propose_workflow.json b/crates/openhuman-core/src/flows/parameters/propose_workflow.json
new file mode 100644
index 0000000000..614b505374
--- /dev/null
+++ b/crates/openhuman-core/src/flows/parameters/propose_workflow.json
@@ -0,0 +1,104 @@
+{
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Human-readable name for the proposed flow."
+ },
+ "graph": {
+ "type": "object",
+ "description": "A tinyflows WorkflowGraph: { name?, nodes: [...], edges: [...] }. See the tool description for node kinds and their config shapes.",
+ "properties": {
+ "nodes": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique id within the graph."
+ },
+ "kind": {
+ "type": "string",
+ "enum": [
+ "trigger",
+ "agent",
+ "tool_call",
+ "http_request",
+ "code",
+ "shell",
+ "condition",
+ "switch",
+ "merge",
+ "split_out",
+ "transform",
+ "output_parser",
+ "sub_workflow",
+ "memory",
+ "dedup",
+ "loop",
+ "spawn",
+ "gate",
+ "scatter",
+ "gather",
+ "approval",
+ "void"
+ ]
+ },
+ "name": {
+ "type": "string",
+ "description": "Human-readable node name."
+ },
+ "config": {
+ "description": "Kind-specific configuration; see tool description."
+ }
+ },
+ "required": [
+ "id",
+ "kind",
+ "name"
+ ]
+ }
+ },
+ "edges": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "from_node": {
+ "type": "string"
+ },
+ "to_node": {
+ "type": "string"
+ },
+ "from_port": {
+ "type": "string",
+ "description": "Defaults to \"main\". For a condition/switch branch, this is where the branch label (e.g. \"true\"/\"false\") goes."
+ },
+ "to_port": {
+ "type": "string",
+ "description": "Defaults to \"main\". Almost always stays \"main\" — branch labels go on from_port, not here."
+ }
+ },
+ "required": [
+ "from_node",
+ "to_node"
+ ]
+ }
+ }
+ },
+ "required": [
+ "nodes",
+ "edges"
+ ]
+ },
+ "require_approval": {
+ "type": "boolean",
+ "description": "Force a human-approval gate on every outbound tool/HTTP action this flow takes once saved. Defaults to true for agent-proposed flows."
+ }
+ },
+ "required": [
+ "name",
+ "graph"
+ ]
+}
diff --git a/crates/openhuman-core/src/flows/tools.rs b/crates/openhuman-core/src/flows/tools.rs
index 670db7edd5..dbb6caef20 100644
--- a/crates/openhuman-core/src/flows/tools.rs
+++ b/crates/openhuman-core/src/flows/tools.rs
@@ -16,6 +16,7 @@
//! `external_effect() == false` reflect that this call has no side effect —
//! it is pure validation.
+use crate::tools::schema_cache::static_schema;
use std::sync::Arc;
use async_trait::async_trait;
@@ -94,62 +95,7 @@ impl Tool for ProposeWorkflowTool {
}
fn parameters_schema(&self) -> Value {
- json!({
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "Human-readable name for the proposed flow."
- },
- "graph": {
- "type": "object",
- "description": "A tinyflows WorkflowGraph: { name?, nodes: [...], edges: [...] }. See the tool description for node kinds and their config shapes.",
- "properties": {
- "nodes": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": { "type": "string", "description": "Unique id within the graph." },
- "kind": {
- "type": "string",
- "enum": [
- "trigger", "agent", "tool_call", "http_request",
- "code", "shell", "condition", "switch", "merge", "split_out",
- "transform", "output_parser", "sub_workflow", "memory",
- "dedup", "loop", "spawn", "gate", "scatter", "gather",
- "approval", "void"
- ]
- },
- "name": { "type": "string", "description": "Human-readable node name." },
- "config": { "description": "Kind-specific configuration; see tool description." }
- },
- "required": ["id", "kind", "name"]
- }
- },
- "edges": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "from_node": { "type": "string" },
- "to_node": { "type": "string" },
- "from_port": { "type": "string", "description": "Defaults to \"main\". For a condition/switch branch, this is where the branch label (e.g. \"true\"/\"false\") goes." },
- "to_port": { "type": "string", "description": "Defaults to \"main\". Almost always stays \"main\" — branch labels go on from_port, not here." }
- },
- "required": ["from_node", "to_node"]
- }
- }
- },
- "required": ["nodes", "edges"]
- },
- "require_approval": {
- "type": "boolean",
- "description": "Force a human-approval gate on every outbound tool/HTTP action this flow takes once saved. Defaults to true for agent-proposed flows."
- }
- },
- "required": ["name", "graph"]
- })
+ static_schema!(include_str!("parameters/propose_workflow.json"))
}
fn permission_level(&self) -> PermissionLevel {
@@ -395,3 +341,7 @@ impl Tool for RunFlowTool {
#[cfg(test)]
#[path = "tools_tests.rs"]
mod tests;
+
+#[cfg(test)]
+#[path = "tools_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/flows/tools_schema_tests.rs b/crates/openhuman-core/src/flows/tools_schema_tests.rs
new file mode 100644
index 0000000000..90b84d52ff
--- /dev/null
+++ b/crates/openhuman-core/src/flows/tools_schema_tests.rs
@@ -0,0 +1,67 @@
+use super::*;
+use serde_json::json;
+
+fn expected_propose_workflow() -> serde_json::Value {
+ json!({
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Human-readable name for the proposed flow."
+ },
+ "graph": {
+ "type": "object",
+ "description": "A tinyflows WorkflowGraph: { name?, nodes: [...], edges: [...] }. See the tool description for node kinds and their config shapes.",
+ "properties": {
+ "nodes": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": { "type": "string", "description": "Unique id within the graph." },
+ "kind": {
+ "type": "string",
+ "enum": [
+ "trigger", "agent", "tool_call", "http_request",
+ "code", "shell", "condition", "switch", "merge", "split_out",
+ "transform", "output_parser", "sub_workflow", "memory",
+ "dedup", "loop", "spawn", "gate", "scatter", "gather",
+ "approval", "void"
+ ]
+ },
+ "name": { "type": "string", "description": "Human-readable node name." },
+ "config": { "description": "Kind-specific configuration; see tool description." }
+ },
+ "required": ["id", "kind", "name"]
+ }
+ },
+ "edges": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "from_node": { "type": "string" },
+ "to_node": { "type": "string" },
+ "from_port": { "type": "string", "description": "Defaults to \"main\". For a condition/switch branch, this is where the branch label (e.g. \"true\"/\"false\") goes." },
+ "to_port": { "type": "string", "description": "Defaults to \"main\". Almost always stays \"main\" — branch labels go on from_port, not here." }
+ },
+ "required": ["from_node", "to_node"]
+ }
+ }
+ },
+ "required": ["nodes", "edges"]
+ },
+ "require_approval": {
+ "type": "boolean",
+ "description": "Force a human-approval gate on every outbound tool/HTTP action this flow takes once saved. Defaults to true for agent-proposed flows."
+ }
+ },
+ "required": ["name", "graph"]
+ })
+}
+
+#[test]
+fn propose_workflow_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_propose_workflow());
+}
diff --git a/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs b/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs
index fa3514ae59..9142b0fece 100644
--- a/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs
@@ -1,5 +1,6 @@
//! The `composio_list_tools` agent tool.
+use crate::tools::schema_cache::static_schema;
use std::collections::HashSet;
use std::sync::Arc;
@@ -53,31 +54,7 @@ impl Tool for ComposioListToolsTool {
argument when calling `composio_execute`."
}
fn parameters_schema(&self) -> Value {
- json!({
- "type": "object",
- "properties": {
- "toolkits": {
- "type": "array",
- "items": { "type": "string" },
- "description": "Optional list of toolkit slugs to filter by."
- },
- "tags": {
- "type": "array",
- "items": { "type": "string" },
- "description": "Optional Composio action tags to filter by \
- (OR semantics — multiple tags broaden the result, \
- e.g. [\"readOnlyHint\"] or [\"repos\", \"stars\"]). \
- Case-insensitive."
- },
- "include_unconnected": {
- "type": "boolean",
- "description": "When true, include actions from toolkits the user \
- has not connected yet. Defaults to false (only \
- connected toolkits)."
- }
- },
- "additionalProperties": false
- })
+ static_schema!(include_str!("parameters/composio_list_tools.json"))
}
fn permission_level(&self) -> PermissionLevel {
PermissionLevel::ReadOnly
@@ -290,3 +267,7 @@ impl ComposioListToolsTool {
(live_config, outcome)
}
}
+
+#[cfg(test)]
+#[path = "list_tools_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/integrations/composio/tools/list_tools_schema_tests.rs b/crates/openhuman-core/src/integrations/composio/tools/list_tools_schema_tests.rs
new file mode 100644
index 0000000000..56036fcbbe
--- /dev/null
+++ b/crates/openhuman-core/src/integrations/composio/tools/list_tools_schema_tests.rs
@@ -0,0 +1,36 @@
+use super::*;
+use serde_json::json;
+
+fn expected_composio_list_tools() -> serde_json::Value {
+ json!({
+ "type": "object",
+ "properties": {
+ "toolkits": {
+ "type": "array",
+ "items": { "type": "string" },
+ "description": "Optional list of toolkit slugs to filter by."
+ },
+ "tags": {
+ "type": "array",
+ "items": { "type": "string" },
+ "description": "Optional Composio action tags to filter by \
+ (OR semantics — multiple tags broaden the result, \
+ e.g. [\"readOnlyHint\"] or [\"repos\", \"stars\"]). \
+ Case-insensitive."
+ },
+ "include_unconnected": {
+ "type": "boolean",
+ "description": "When true, include actions from toolkits the user \
+ has not connected yet. Defaults to false (only \
+ connected toolkits)."
+ }
+ },
+ "additionalProperties": false
+ })
+}
+
+#[test]
+fn composio_list_tools_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_composio_list_tools());
+}
diff --git a/crates/openhuman-core/src/integrations/composio/tools/parameters/composio_list_tools.json b/crates/openhuman-core/src/integrations/composio/tools/parameters/composio_list_tools.json
new file mode 100644
index 0000000000..55899a7ca7
--- /dev/null
+++ b/crates/openhuman-core/src/integrations/composio/tools/parameters/composio_list_tools.json
@@ -0,0 +1,24 @@
+{
+ "type": "object",
+ "properties": {
+ "toolkits": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Optional list of toolkit slugs to filter by."
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Optional Composio action tags to filter by (OR semantics — multiple tags broaden the result, e.g. [\"readOnlyHint\"] or [\"repos\", \"stars\"]). Case-insensitive."
+ },
+ "include_unconnected": {
+ "type": "boolean",
+ "description": "When true, include actions from toolkits the user has not connected yet. Defaults to false (only connected toolkits)."
+ }
+ },
+ "additionalProperties": false
+}
diff --git a/crates/openhuman-core/src/memory/parameters/memory.json b/crates/openhuman-core/src/memory/parameters/memory.json
new file mode 100644
index 0000000000..814a015c10
--- /dev/null
+++ b/crates/openhuman-core/src/memory/parameters/memory.json
@@ -0,0 +1,98 @@
+{
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": [
+ "recall",
+ "fetch",
+ "learn",
+ "forget"
+ ],
+ "description": "What to do."
+ },
+ "question": {
+ "type": "string",
+ "description": "recall: the question to answer from memory."
+ },
+ "query": {
+ "type": "string",
+ "description": "fetch: what to search for."
+ },
+ "mode": {
+ "type": "string",
+ "enum": [
+ "hybrid",
+ "keyword",
+ "vector"
+ ],
+ "description": "fetch: retrieval mode; only the engine's declared modes work (hybrid is always safe)."
+ },
+ "filter": {
+ "type": "object",
+ "description": "recall/fetch: metadata filter, e.g. {\"kinds\": [\"learning\"], \"workspace\": \"/path\", \"repo\": \"owner/name\"}."
+ },
+ "limit": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 100,
+ "description": "recall/fetch: most results."
+ },
+ "cursor": {
+ "type": "string",
+ "description": "fetch: next-page cursor."
+ },
+ "refers_to": {
+ "type": "object",
+ "additionalProperties": false,
+ "description": "recall/fetch: the local calendar dates the question is about, resolved against the Current Date & Time line. Set it whenever the question mentions or implies a time, in any language: \"yesterday\", \"last Saturday\", \"in March\", \"kal\", \"pichle hafte\", \"el viernes\". A single day has from == to. If a word can mean the past or the future (Hindi \"kal\"), cover both days. Prefer this over filter.observed_after/observed_before: those drop every memory recorded on another day, this only ranks the matching days first.",
+ "properties": {
+ "from": {
+ "type": "string",
+ "format": "date",
+ "description": "First local date, YYYY-MM-DD."
+ },
+ "to": {
+ "type": "string",
+ "format": "date",
+ "description": "Last local date, YYYY-MM-DD, inclusive."
+ }
+ },
+ "required": [
+ "from",
+ "to"
+ ]
+ },
+ "text": {
+ "type": "string",
+ "description": "learn: the learning, one self-contained sentence."
+ },
+ "kind": {
+ "type": "string",
+ "enum": [
+ "preference",
+ "fact",
+ "procedure",
+ "correction",
+ "other"
+ ],
+ "description": "learn: what kind of learning (default fact)."
+ },
+ "confidence": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 1,
+ "description": "learn: confidence (default 0.8)."
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "forget: item ids to remove."
+ }
+ },
+ "required": [
+ "action"
+ ]
+}
diff --git a/crates/openhuman-core/src/memory/tools.rs b/crates/openhuman-core/src/memory/tools.rs
index f562019bd3..6e8dddc280 100644
--- a/crates/openhuman-core/src/memory/tools.rs
+++ b/crates/openhuman-core/src/memory/tools.rs
@@ -17,6 +17,7 @@
//! everything under its root, never another root's (another tenant's or
//! team's). A `reach` in the model's filter is overwritten.
+use crate::tools::schema_cache::static_schema;
use std::collections::HashMap;
use std::sync::{Arc, LazyLock, Mutex};
@@ -312,37 +313,7 @@ impl Tool for MemoryTool {
}
fn parameters_schema(&self) -> Value {
- json!({
- "type": "object",
- "properties": {
- "action": {
- "type": "string",
- "enum": ["recall", "fetch", "learn", "forget"],
- "description": "What to do."
- },
- "question": {"type": "string", "description": "recall: the question to answer from memory."},
- "query": {"type": "string", "description": "fetch: what to search for."},
- "mode": {"type": "string", "enum": ["hybrid", "keyword", "vector"], "description": "fetch: retrieval mode; only the engine's declared modes work (hybrid is always safe)."},
- "filter": {"type": "object", "description": "recall/fetch: metadata filter, e.g. {\"kinds\": [\"learning\"], \"workspace\": \"/path\", \"repo\": \"owner/name\"}."},
- "limit": {"type": "integer", "minimum": 1, "maximum": 100, "description": "recall/fetch: most results."},
- "cursor": {"type": "string", "description": "fetch: next-page cursor."},
- "refers_to": {
- "type": "object",
- "additionalProperties": false,
- "description": "recall/fetch: the local calendar dates the question is about, resolved against the Current Date & Time line. Set it whenever the question mentions or implies a time, in any language: \"yesterday\", \"last Saturday\", \"in March\", \"kal\", \"pichle hafte\", \"el viernes\". A single day has from == to. If a word can mean the past or the future (Hindi \"kal\"), cover both days. Prefer this over filter.observed_after/observed_before: those drop every memory recorded on another day, this only ranks the matching days first.",
- "properties": {
- "from": {"type": "string", "format": "date", "description": "First local date, YYYY-MM-DD."},
- "to": {"type": "string", "format": "date", "description": "Last local date, YYYY-MM-DD, inclusive."}
- },
- "required": ["from", "to"]
- },
- "text": {"type": "string", "description": "learn: the learning, one self-contained sentence."},
- "kind": {"type": "string", "enum": ["preference", "fact", "procedure", "correction", "other"], "description": "learn: what kind of learning (default fact)."},
- "confidence": {"type": "number", "minimum": 0, "maximum": 1, "description": "learn: confidence (default 0.8)."},
- "ids": {"type": "array", "items": {"type": "string"}, "description": "forget: item ids to remove."}
- },
- "required": ["action"]
- })
+ static_schema!(include_str!("parameters/memory.json"))
}
fn permission_level(&self) -> PermissionLevel {
@@ -382,3 +353,7 @@ impl Tool for MemoryTool {
#[cfg(test)]
#[path = "tools_tests.rs"]
mod tests;
+
+#[cfg(test)]
+#[path = "tools_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/memory/tools_schema_tests.rs b/crates/openhuman-core/src/memory/tools_schema_tests.rs
new file mode 100644
index 0000000000..dbca508021
--- /dev/null
+++ b/crates/openhuman-core/src/memory/tools_schema_tests.rs
@@ -0,0 +1,42 @@
+use super::*;
+use serde_json::json;
+
+fn expected_memory() -> serde_json::Value {
+ json!({
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": ["recall", "fetch", "learn", "forget"],
+ "description": "What to do."
+ },
+ "question": {"type": "string", "description": "recall: the question to answer from memory."},
+ "query": {"type": "string", "description": "fetch: what to search for."},
+ "mode": {"type": "string", "enum": ["hybrid", "keyword", "vector"], "description": "fetch: retrieval mode; only the engine's declared modes work (hybrid is always safe)."},
+ "filter": {"type": "object", "description": "recall/fetch: metadata filter, e.g. {\"kinds\": [\"learning\"], \"workspace\": \"/path\", \"repo\": \"owner/name\"}."},
+ "limit": {"type": "integer", "minimum": 1, "maximum": 100, "description": "recall/fetch: most results."},
+ "cursor": {"type": "string", "description": "fetch: next-page cursor."},
+ "refers_to": {
+ "type": "object",
+ "additionalProperties": false,
+ "description": "recall/fetch: the local calendar dates the question is about, resolved against the Current Date & Time line. Set it whenever the question mentions or implies a time, in any language: \"yesterday\", \"last Saturday\", \"in March\", \"kal\", \"pichle hafte\", \"el viernes\". A single day has from == to. If a word can mean the past or the future (Hindi \"kal\"), cover both days. Prefer this over filter.observed_after/observed_before: those drop every memory recorded on another day, this only ranks the matching days first.",
+ "properties": {
+ "from": {"type": "string", "format": "date", "description": "First local date, YYYY-MM-DD."},
+ "to": {"type": "string", "format": "date", "description": "Last local date, YYYY-MM-DD, inclusive."}
+ },
+ "required": ["from", "to"]
+ },
+ "text": {"type": "string", "description": "learn: the learning, one self-contained sentence."},
+ "kind": {"type": "string", "enum": ["preference", "fact", "procedure", "correction", "other"], "description": "learn: what kind of learning (default fact)."},
+ "confidence": {"type": "number", "minimum": 0, "maximum": 1, "description": "learn: confidence (default 0.8)."},
+ "ids": {"type": "array", "items": {"type": "string"}, "description": "forget: item ids to remove."}
+ },
+ "required": ["action"]
+ })
+}
+
+#[test]
+fn memory_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_memory());
+}
diff --git a/crates/openhuman-core/src/tools/impl/browser/browser.rs b/crates/openhuman-core/src/tools/impl/browser/browser.rs
index b3ad52abbe..e80dcba8c6 100644
--- a/crates/openhuman-core/src/tools/impl/browser/browser.rs
+++ b/crates/openhuman-core/src/tools/impl/browser/browser.rs
@@ -7,6 +7,7 @@ mod pending;
mod session_pool;
#[path = "browser_task_actions.rs"]
mod task_actions;
+use crate::tools::schema_cache::static_schema;
use crate::modules::browser::BrowserClient;
use crate::security::approval::{ApprovalGate, GateOutcome};
use crate::security::SecurityPolicy;
@@ -493,10 +494,7 @@ impl Tool for BrowserTool {
)
}
fn parameters_schema(&self) -> Value {
- json!({"type":"object","properties":{
- "action":{"type":"string","enum":["open","snapshot","read_page","click","fill","type","get_text","get_title","get_url","wait","press","hover","scroll","is_visible","find","task","task_continue","task_cancel","confirm_pending","list_downloads","wait_download","close"]},
- "url":{"type":"string","description":"Starting HTTPS URL for open or an optional starting URL for task"},"selector":{"type":"string"},"value":{"type":"string"},"text":{"type":"string"},"key":{"type":"string"},"direction":{"type":"string"},"pixels":{"type":"integer"},"ms":{"type":"integer"},"timeout_ms":{"type":"integer"},"interactive_only":{"type":"boolean"},"compact":{"type":"boolean"},"depth":{"type":"integer"},"by":{"type":"string"},"find_action":{"type":"string"},"fill_value":{"type":"string"},"goal":{"type":"string"},"inputs":{"type":"object","additionalProperties":{"type":"string"}},"task_id":{"type":"string","description":"Task id returned by task, for task_continue and task_cancel"},"flow":{"type":"object","description":"Optional TinyComputer flow ({app, vars, steps}) to run instead of planning one from goal, e.g. a plan saved from an earlier successful run"},"answer":{"type":"string","description":"Free-text answer for a paused task; done after a needs_human pause"},"token":{"type":"string","description":"Token returned with the exact pending action"}
- },"required":["action"]})
+ static_schema!(include_str!("parameters/browser.json"))
}
fn external_effect_with_args(&self, args: &Value) -> bool {
// Gate direct mutations before perform; task steps pause for approval.
@@ -542,3 +540,7 @@ impl Tool for BrowserTool {
#[cfg(test)]
#[path = "browser_computer_tests.rs"]
mod tests;
+
+#[cfg(test)]
+#[path = "browser_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/tools/impl/browser/browser_schema_tests.rs b/crates/openhuman-core/src/tools/impl/browser/browser_schema_tests.rs
new file mode 100644
index 0000000000..cf5eabcd18
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/browser/browser_schema_tests.rs
@@ -0,0 +1,15 @@
+use super::*;
+use serde_json::json;
+
+fn expected_browser() -> serde_json::Value {
+ json!({"type":"object","properties":{
+ "action":{"type":"string","enum":["open","snapshot","read_page","click","fill","type","get_text","get_title","get_url","wait","press","hover","scroll","is_visible","find","task","task_continue","task_cancel","confirm_pending","list_downloads","wait_download","close"]},
+ "url":{"type":"string","description":"Starting HTTPS URL for open or an optional starting URL for task"},"selector":{"type":"string"},"value":{"type":"string"},"text":{"type":"string"},"key":{"type":"string"},"direction":{"type":"string"},"pixels":{"type":"integer"},"ms":{"type":"integer"},"timeout_ms":{"type":"integer"},"interactive_only":{"type":"boolean"},"compact":{"type":"boolean"},"depth":{"type":"integer"},"by":{"type":"string"},"find_action":{"type":"string"},"fill_value":{"type":"string"},"goal":{"type":"string"},"inputs":{"type":"object","additionalProperties":{"type":"string"}},"task_id":{"type":"string","description":"Task id returned by task, for task_continue and task_cancel"},"flow":{"type":"object","description":"Optional TinyComputer flow ({app, vars, steps}) to run instead of planning one from goal, e.g. a plan saved from an earlier successful run"},"answer":{"type":"string","description":"Free-text answer for a paused task; done after a needs_human pause"},"token":{"type":"string","description":"Token returned with the exact pending action"}
+ },"required":["action"]})
+}
+
+#[test]
+fn browser_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_browser());
+}
diff --git a/crates/openhuman-core/src/tools/impl/browser/parameters/browser.json b/crates/openhuman-core/src/tools/impl/browser/parameters/browser.json
new file mode 100644
index 0000000000..e95b31edc9
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/browser/parameters/browser.json
@@ -0,0 +1,106 @@
+{
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": [
+ "open",
+ "snapshot",
+ "read_page",
+ "click",
+ "fill",
+ "type",
+ "get_text",
+ "get_title",
+ "get_url",
+ "wait",
+ "press",
+ "hover",
+ "scroll",
+ "is_visible",
+ "find",
+ "task",
+ "task_continue",
+ "task_cancel",
+ "confirm_pending",
+ "list_downloads",
+ "wait_download",
+ "close"
+ ]
+ },
+ "url": {
+ "type": "string",
+ "description": "Starting HTTPS URL for open or an optional starting URL for task"
+ },
+ "selector": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ },
+ "direction": {
+ "type": "string"
+ },
+ "pixels": {
+ "type": "integer"
+ },
+ "ms": {
+ "type": "integer"
+ },
+ "timeout_ms": {
+ "type": "integer"
+ },
+ "interactive_only": {
+ "type": "boolean"
+ },
+ "compact": {
+ "type": "boolean"
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "by": {
+ "type": "string"
+ },
+ "find_action": {
+ "type": "string"
+ },
+ "fill_value": {
+ "type": "string"
+ },
+ "goal": {
+ "type": "string"
+ },
+ "inputs": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "task_id": {
+ "type": "string",
+ "description": "Task id returned by task, for task_continue and task_cancel"
+ },
+ "flow": {
+ "type": "object",
+ "description": "Optional TinyComputer flow ({app, vars, steps}) to run instead of planning one from goal, e.g. a plan saved from an earlier successful run"
+ },
+ "answer": {
+ "type": "string",
+ "description": "Free-text answer for a paused task; done after a needs_human pause"
+ },
+ "token": {
+ "type": "string",
+ "description": "Token returned with the exact pending action"
+ }
+ },
+ "required": [
+ "action"
+ ]
+}
diff --git a/crates/openhuman-core/src/tools/impl/system/node_exec.rs b/crates/openhuman-core/src/tools/impl/system/node_exec.rs
index 4de77a566f..07666222a5 100644
--- a/crates/openhuman-core/src/tools/impl/system/node_exec.rs
+++ b/crates/openhuman-core/src/tools/impl/system/node_exec.rs
@@ -21,6 +21,7 @@
//! extract a managed Node.js distribution if no compatible `node` is on
//! `PATH`. Subsequent calls reuse the cached install.
+use crate::tools::schema_cache::static_schema;
use crate::agent::host_runtime::RuntimeAdapter;
use crate::runtime::javascript::NodeBootstrap;
use crate::security::{CommandClass, GateDecision, SecurityPolicy};
@@ -110,28 +111,7 @@ impl Tool for NodeExecTool {
}
fn parameters_schema(&self) -> serde_json::Value {
- json!({
- "type": "object",
- "properties": {
- "inline_code": {
- "type": "string",
- "description": "JavaScript source passed to `node -e`. Mutually exclusive with script_path."
- },
- "script_path": {
- "type": "string",
- "description": "Path (relative to workspace) to a .js/.mjs/.cjs file. Mutually exclusive with inline_code."
- },
- "args": {
- "type": "array",
- "items": { "type": "string" },
- "description": "Positional arguments appended after the script. Ignored for inline_code."
- },
- "timeout_secs": {
- "type": "integer",
- "description": "Optional wall-clock timeout (seconds) before the process is killed. No timeout by default — long-running scripts run to completion. Capped at 1800s; 0 disables."
- }
- }
- })
+ static_schema!(include_str!("parameters/node_exec.json"))
}
fn permission_level(&self) -> PermissionLevel {
@@ -661,3 +641,7 @@ fn resolve_script_path(
#[cfg(test)]
#[path = "node_exec_tests.rs"]
mod tests;
+
+#[cfg(test)]
+#[path = "node_exec_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/tools/impl/system/node_exec_schema_tests.rs b/crates/openhuman-core/src/tools/impl/system/node_exec_schema_tests.rs
new file mode 100644
index 0000000000..8a0396265f
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/system/node_exec_schema_tests.rs
@@ -0,0 +1,33 @@
+use super::*;
+use serde_json::json;
+
+fn expected_node_exec() -> serde_json::Value {
+ json!({
+ "type": "object",
+ "properties": {
+ "inline_code": {
+ "type": "string",
+ "description": "JavaScript source passed to `node -e`. Mutually exclusive with script_path."
+ },
+ "script_path": {
+ "type": "string",
+ "description": "Path (relative to workspace) to a .js/.mjs/.cjs file. Mutually exclusive with inline_code."
+ },
+ "args": {
+ "type": "array",
+ "items": { "type": "string" },
+ "description": "Positional arguments appended after the script. Ignored for inline_code."
+ },
+ "timeout_secs": {
+ "type": "integer",
+ "description": "Optional wall-clock timeout (seconds) before the process is killed. No timeout by default — long-running scripts run to completion. Capped at 1800s; 0 disables."
+ }
+ }
+ })
+}
+
+#[test]
+fn node_exec_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_node_exec());
+}
diff --git a/crates/openhuman-core/src/tools/impl/system/npm_exec.rs b/crates/openhuman-core/src/tools/impl/system/npm_exec.rs
index 8db736f22d..6bcce41919 100644
--- a/crates/openhuman-core/src/tools/impl/system/npm_exec.rs
+++ b/crates/openhuman-core/src/tools/impl/system/npm_exec.rs
@@ -17,6 +17,7 @@
//! metacharacters (guarded server-side). Free-form args go through
//! POSIX-safe single-quoting.
+use crate::tools::schema_cache::static_schema;
use crate::agent::host_runtime::RuntimeAdapter;
use crate::runtime::javascript::NodeBootstrap;
use crate::security::{CommandClass, GateDecision, SecurityPolicy};
@@ -116,29 +117,7 @@ impl Tool for NpmExecTool {
}
fn parameters_schema(&self) -> serde_json::Value {
- json!({
- "type": "object",
- "properties": {
- "subcommand": {
- "type": "string",
- "description": "npm subcommand, e.g. `install`, `ci`, `run`, `test`, `exec`."
- },
- "args": {
- "type": "array",
- "items": { "type": "string" },
- "description": "Arguments appended after the subcommand (e.g. [\"build\"] for `npm run build`)."
- },
- "cwd": {
- "type": "string",
- "description": "Optional sub-directory (relative to workspace) to run npm in. Defaults to the workspace root."
- },
- "timeout_secs": {
- "type": "integer",
- "description": "Optional wall-clock timeout (seconds) before npm is killed. No timeout by default — installs/builds run to completion. Capped at 1800s; 0 disables."
- }
- },
- "required": ["subcommand"]
- })
+ static_schema!(include_str!("parameters/npm_exec.json"))
}
fn permission_level(&self) -> PermissionLevel {
@@ -537,3 +516,7 @@ fn resolve_cwd(
#[cfg(test)]
#[path = "npm_exec_tests.rs"]
mod tests;
+
+#[cfg(test)]
+#[path = "npm_exec_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/tools/impl/system/npm_exec_schema_tests.rs b/crates/openhuman-core/src/tools/impl/system/npm_exec_schema_tests.rs
new file mode 100644
index 0000000000..b577877627
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/system/npm_exec_schema_tests.rs
@@ -0,0 +1,34 @@
+use super::*;
+use serde_json::json;
+
+fn expected_npm_exec() -> serde_json::Value {
+ json!({
+ "type": "object",
+ "properties": {
+ "subcommand": {
+ "type": "string",
+ "description": "npm subcommand, e.g. `install`, `ci`, `run`, `test`, `exec`."
+ },
+ "args": {
+ "type": "array",
+ "items": { "type": "string" },
+ "description": "Arguments appended after the subcommand (e.g. [\"build\"] for `npm run build`)."
+ },
+ "cwd": {
+ "type": "string",
+ "description": "Optional sub-directory (relative to workspace) to run npm in. Defaults to the workspace root."
+ },
+ "timeout_secs": {
+ "type": "integer",
+ "description": "Optional wall-clock timeout (seconds) before npm is killed. No timeout by default — installs/builds run to completion. Capped at 1800s; 0 disables."
+ }
+ },
+ "required": ["subcommand"]
+ })
+}
+
+#[test]
+fn npm_exec_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_npm_exec());
+}
diff --git a/crates/openhuman-core/src/tools/impl/system/parameters/node_exec.json b/crates/openhuman-core/src/tools/impl/system/parameters/node_exec.json
new file mode 100644
index 0000000000..d711c166dd
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/system/parameters/node_exec.json
@@ -0,0 +1,24 @@
+{
+ "type": "object",
+ "properties": {
+ "inline_code": {
+ "type": "string",
+ "description": "JavaScript source passed to `node -e`. Mutually exclusive with script_path."
+ },
+ "script_path": {
+ "type": "string",
+ "description": "Path (relative to workspace) to a .js/.mjs/.cjs file. Mutually exclusive with inline_code."
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Positional arguments appended after the script. Ignored for inline_code."
+ },
+ "timeout_secs": {
+ "type": "integer",
+ "description": "Optional wall-clock timeout (seconds) before the process is killed. No timeout by default — long-running scripts run to completion. Capped at 1800s; 0 disables."
+ }
+ }
+}
diff --git a/crates/openhuman-core/src/tools/impl/system/parameters/npm_exec.json b/crates/openhuman-core/src/tools/impl/system/parameters/npm_exec.json
new file mode 100644
index 0000000000..4d24e3b854
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/system/parameters/npm_exec.json
@@ -0,0 +1,27 @@
+{
+ "type": "object",
+ "properties": {
+ "subcommand": {
+ "type": "string",
+ "description": "npm subcommand, e.g. `install`, `ci`, `run`, `test`, `exec`."
+ },
+ "args": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Arguments appended after the subcommand (e.g. [\"build\"] for `npm run build`)."
+ },
+ "cwd": {
+ "type": "string",
+ "description": "Optional sub-directory (relative to workspace) to run npm in. Defaults to the workspace root."
+ },
+ "timeout_secs": {
+ "type": "integer",
+ "description": "Optional wall-clock timeout (seconds) before npm is killed. No timeout by default — installs/builds run to completion. Capped at 1800s; 0 disables."
+ }
+ },
+ "required": [
+ "subcommand"
+ ]
+}
diff --git a/crates/openhuman-core/src/tools/impl/system/parameters/proxy_config.json b/crates/openhuman-core/src/tools/impl/system/parameters/proxy_config.json
new file mode 100644
index 0000000000..fe47e13ad2
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/system/parameters/proxy_config.json
@@ -0,0 +1,78 @@
+{
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": [
+ "get",
+ "set",
+ "disable",
+ "list_services",
+ "apply_env",
+ "clear_env"
+ ],
+ "default": "get"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Enable or disable proxy"
+ },
+ "scope": {
+ "type": "string",
+ "description": "Proxy scope: environment | openhuman | services"
+ },
+ "http_proxy": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "HTTP proxy URL"
+ },
+ "https_proxy": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "HTTPS proxy URL"
+ },
+ "all_proxy": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Fallback proxy URL for all protocols"
+ },
+ "no_proxy": {
+ "description": "Comma-separated string or array of NO_PROXY entries",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "services": {
+ "description": "Comma-separated string or array of service selectors used when scope=services",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "clear_env": {
+ "type": "boolean",
+ "description": "When action=disable, clear process proxy environment variables"
+ }
+ }
+}
diff --git a/crates/openhuman-core/src/tools/impl/system/parameters/schedule.json b/crates/openhuman-core/src/tools/impl/system/parameters/schedule.json
new file mode 100644
index 0000000000..f5993e7ddb
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/system/parameters/schedule.json
@@ -0,0 +1,51 @@
+{
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": [
+ "create",
+ "add",
+ "once",
+ "list",
+ "get",
+ "cancel",
+ "remove",
+ "pause",
+ "resume"
+ ],
+ "description": "Action to perform"
+ },
+ "expression": {
+ "type": "string",
+ "description": "Cron expression for recurring tasks (e.g. '*/5 * * * *')."
+ },
+ "delay": {
+ "type": "string",
+ "description": "Delay for one-shot tasks (e.g. '30m', '2h', '1d')."
+ },
+ "run_at": {
+ "type": "string",
+ "description": "Absolute RFC3339 time for one-shot tasks (e.g. '2030-01-01T00:00:00Z')."
+ },
+ "command": {
+ "type": "string",
+ "description": "Shell command to execute. Use 'command' for shell jobs OR 'prompt' for agent jobs."
+ },
+ "prompt": {
+ "type": "string",
+ "description": "Agent prompt for recurring agent tasks (e.g. reminders, briefings). Use this instead of 'command' for user-facing notifications."
+ },
+ "name": {
+ "type": "string",
+ "description": "Short human-readable name for the job (e.g. 'drink_water_reminder'). Always provide a name."
+ },
+ "id": {
+ "type": "string",
+ "description": "Task ID. Required for get/cancel/remove/pause/resume."
+ }
+ },
+ "required": [
+ "action"
+ ]
+}
diff --git a/crates/openhuman-core/src/tools/impl/system/proxy_config.rs b/crates/openhuman-core/src/tools/impl/system/proxy_config.rs
index 2185d5ff4a..30d3075aa2 100644
--- a/crates/openhuman-core/src/tools/impl/system/proxy_config.rs
+++ b/crates/openhuman-core/src/tools/impl/system/proxy_config.rs
@@ -1,3 +1,4 @@
+use crate::tools::schema_cache::static_schema;
use crate::config::{
runtime_proxy_config, set_runtime_proxy_config, Config, ProxyConfig, ProxyScope,
};
@@ -320,54 +321,7 @@ impl Tool for ProxyConfigTool {
}
fn parameters_schema(&self) -> Value {
- json!({
- "type": "object",
- "properties": {
- "action": {
- "type": "string",
- "enum": ["get", "set", "disable", "list_services", "apply_env", "clear_env"],
- "default": "get"
- },
- "enabled": {
- "type": "boolean",
- "description": "Enable or disable proxy"
- },
- "scope": {
- "type": "string",
- "description": "Proxy scope: environment | openhuman | services"
- },
- "http_proxy": {
- "type": ["string", "null"],
- "description": "HTTP proxy URL"
- },
- "https_proxy": {
- "type": ["string", "null"],
- "description": "HTTPS proxy URL"
- },
- "all_proxy": {
- "type": ["string", "null"],
- "description": "Fallback proxy URL for all protocols"
- },
- "no_proxy": {
- "description": "Comma-separated string or array of NO_PROXY entries",
- "oneOf": [
- {"type": "string"},
- {"type": "array", "items": {"type": "string"}}
- ]
- },
- "services": {
- "description": "Comma-separated string or array of service selectors used when scope=services",
- "oneOf": [
- {"type": "string"},
- {"type": "array", "items": {"type": "string"}}
- ]
- },
- "clear_env": {
- "type": "boolean",
- "description": "When action=disable, clear process proxy environment variables"
- }
- }
- })
+ static_schema!(include_str!("parameters/proxy_config.json"))
}
async fn execute(&self, args: Value) -> anyhow::Result<ToolResult> {
@@ -408,3 +362,7 @@ impl Tool for ProxyConfigTool {
#[cfg(test)]
#[path = "proxy_config_tests.rs"]
mod tests;
+
+#[cfg(test)]
+#[path = "proxy_config_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/tools/impl/system/proxy_config_schema_tests.rs b/crates/openhuman-core/src/tools/impl/system/proxy_config_schema_tests.rs
new file mode 100644
index 0000000000..291068d485
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/system/proxy_config_schema_tests.rs
@@ -0,0 +1,59 @@
+use super::*;
+use serde_json::json;
+
+fn expected_proxy_config() -> serde_json::Value {
+ json!({
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": ["get", "set", "disable", "list_services", "apply_env", "clear_env"],
+ "default": "get"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Enable or disable proxy"
+ },
+ "scope": {
+ "type": "string",
+ "description": "Proxy scope: environment | openhuman | services"
+ },
+ "http_proxy": {
+ "type": ["string", "null"],
+ "description": "HTTP proxy URL"
+ },
+ "https_proxy": {
+ "type": ["string", "null"],
+ "description": "HTTPS proxy URL"
+ },
+ "all_proxy": {
+ "type": ["string", "null"],
+ "description": "Fallback proxy URL for all protocols"
+ },
+ "no_proxy": {
+ "description": "Comma-separated string or array of NO_PROXY entries",
+ "oneOf": [
+ {"type": "string"},
+ {"type": "array", "items": {"type": "string"}}
+ ]
+ },
+ "services": {
+ "description": "Comma-separated string or array of service selectors used when scope=services",
+ "oneOf": [
+ {"type": "string"},
+ {"type": "array", "items": {"type": "string"}}
+ ]
+ },
+ "clear_env": {
+ "type": "boolean",
+ "description": "When action=disable, clear process proxy environment variables"
+ }
+ }
+ })
+}
+
+#[test]
+fn proxy_config_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_proxy_config());
+}
diff --git a/crates/openhuman-core/src/tools/impl/system/schedule.rs b/crates/openhuman-core/src/tools/impl/system/schedule.rs
index ddbc95badc..ee6d069a32 100644
--- a/crates/openhuman-core/src/tools/impl/system/schedule.rs
+++ b/crates/openhuman-core/src/tools/impl/system/schedule.rs
@@ -1,3 +1,4 @@
+use crate::tools::schema_cache::static_schema;
use crate::config::Config;
use crate::cron::job_builder::{create_agent_job, AgentJobInput};
use crate::cron::origin::{current_job_origin, current_turn_may_skip_approval};
@@ -36,45 +37,7 @@ impl Tool for ScheduleTool {
}
fn parameters_schema(&self) -> serde_json::Value {
- json!({
- "type": "object",
- "properties": {
- "action": {
- "type": "string",
- "enum": ["create", "add", "once", "list", "get", "cancel", "remove", "pause", "resume"],
- "description": "Action to perform"
- },
- "expression": {
- "type": "string",
- "description": "Cron expression for recurring tasks (e.g. '*/5 * * * *')."
- },
- "delay": {
- "type": "string",
- "description": "Delay for one-shot tasks (e.g. '30m', '2h', '1d')."
- },
- "run_at": {
- "type": "string",
- "description": "Absolute RFC3339 time for one-shot tasks (e.g. '2030-01-01T00:00:00Z')."
- },
- "command": {
- "type": "string",
- "description": "Shell command to execute. Use 'command' for shell jobs OR 'prompt' for agent jobs."
- },
- "prompt": {
- "type": "string",
- "description": "Agent prompt for recurring agent tasks (e.g. reminders, briefings). Use this instead of 'command' for user-facing notifications."
- },
- "name": {
- "type": "string",
- "description": "Short human-readable name for the job (e.g. 'drink_water_reminder'). Always provide a name."
- },
- "id": {
- "type": "string",
- "description": "Task ID. Required for get/cancel/remove/pause/resume."
- }
- },
- "required": ["action"]
- })
+ static_schema!(include_str!("parameters/schedule.json"))
}
fn permission_level(&self) -> PermissionLevel {
@@ -496,3 +459,7 @@ fn looks_like_shell_command(input: &str) -> bool {
#[cfg(test)]
#[path = "schedule_tests.rs"]
mod tests;
+
+#[cfg(test)]
+#[path = "schedule_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/tools/impl/system/schedule_schema_tests.rs b/crates/openhuman-core/src/tools/impl/system/schedule_schema_tests.rs
new file mode 100644
index 0000000000..44ad09d955
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/system/schedule_schema_tests.rs
@@ -0,0 +1,50 @@
+use super::*;
+use serde_json::json;
+
+fn expected_schedule() -> serde_json::Value {
+ json!({
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": ["create", "add", "once", "list", "get", "cancel", "remove", "pause", "resume"],
+ "description": "Action to perform"
+ },
+ "expression": {
+ "type": "string",
+ "description": "Cron expression for recurring tasks (e.g. '*/5 * * * *')."
+ },
+ "delay": {
+ "type": "string",
+ "description": "Delay for one-shot tasks (e.g. '30m', '2h', '1d')."
+ },
+ "run_at": {
+ "type": "string",
+ "description": "Absolute RFC3339 time for one-shot tasks (e.g. '2030-01-01T00:00:00Z')."
+ },
+ "command": {
+ "type": "string",
+ "description": "Shell command to execute. Use 'command' for shell jobs OR 'prompt' for agent jobs."
+ },
+ "prompt": {
+ "type": "string",
+ "description": "Agent prompt for recurring agent tasks (e.g. reminders, briefings). Use this instead of 'command' for user-facing notifications."
+ },
+ "name": {
+ "type": "string",
+ "description": "Short human-readable name for the job (e.g. 'drink_water_reminder'). Always provide a name."
+ },
+ "id": {
+ "type": "string",
+ "description": "Task ID. Required for get/cancel/remove/pause/resume."
+ }
+ },
+ "required": ["action"]
+ })
+}
+
+#[test]
+fn schedule_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_schedule());
+}
diff --git a/crates/openhuman-core/src/voice/audio_toolkit/tools/parameters/audio_generate_and_email_podcast.json b/crates/openhuman-core/src/voice/audio_toolkit/tools/parameters/audio_generate_and_email_podcast.json
new file mode 100644
index 0000000000..19a385e964
--- /dev/null
+++ b/crates/openhuman-core/src/voice/audio_toolkit/tools/parameters/audio_generate_and_email_podcast.json
@@ -0,0 +1,55 @@
+{
+ "type": "object",
+ "required": [
+ "text",
+ "to",
+ "subject",
+ "body"
+ ],
+ "properties": {
+ "text": {
+ "type": "string",
+ "description": "Text to synthesize into audio."
+ },
+ "to": {
+ "type": "string",
+ "description": "Recipient email address."
+ },
+ "subject": {
+ "type": "string",
+ "description": "Email subject line."
+ },
+ "body": {
+ "type": "string",
+ "description": "Email body text."
+ },
+ "title": {
+ "type": "string",
+ "description": "Optional title used in the default file name."
+ },
+ "output_path": {
+ "type": "string",
+ "description": "Optional workspace-relative output path."
+ },
+ "provider": {
+ "type": "string",
+ "description": "Optional TTS provider override (`cloud` or `piper`)."
+ },
+ "voice": {
+ "type": "string",
+ "description": "Optional voice id for the chosen provider."
+ },
+ "format": {
+ "type": "string",
+ "enum": [
+ "mp3",
+ "wav"
+ ],
+ "description": "Desired audio format."
+ },
+ "attachment_name": {
+ "type": "string",
+ "description": "Optional attachment file name override."
+ }
+ }
+}
diff --git a/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast.rs b/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast.rs
index d3e43c4f0c..df3a5a6872 100644
--- a/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast.rs
+++ b/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast.rs
@@ -1,3 +1,4 @@
+use crate::tools::schema_cache::static_schema;
use std::sync::Arc;
use async_trait::async_trait;
@@ -140,22 +141,7 @@ impl Tool for AudioGenerateAndEmailPodcastTool {
}
fn parameters_schema(&self) -> serde_json::Value {
- json!({
- "type": "object",
- "required": ["text", "to", "subject", "body"],
- "properties": {
- "text": { "type": "string", "description": "Text to synthesize into audio." },
- "to": { "type": "string", "description": "Recipient email address." },
- "subject": { "type": "string", "description": "Email subject line." },
- "body": { "type": "string", "description": "Email body text." },
- "title": { "type": "string", "description": "Optional title used in the default file name." },
- "output_path": { "type": "string", "description": "Optional workspace-relative output path." },
- "provider": { "type": "string", "description": "Optional TTS provider override (`cloud` or `piper`)." },
- "voice": { "type": "string", "description": "Optional voice id for the chosen provider." },
- "format": { "type": "string", "enum": ["mp3", "wav"], "description": "Desired audio format." },
- "attachment_name": { "type": "string", "description": "Optional attachment file name override." }
- }
- })
+ static_schema!(include_str!("parameters/audio_generate_and_email_podcast.json"))
}
fn permission_level(&self) -> PermissionLevel {
@@ -226,3 +212,7 @@ fn optional_format(
other => Err(anyhow::anyhow!("invalid format `{other}`")),
}
}
+
+#[cfg(test)]
+#[path = "podcast_schema_tests.rs"]
+mod schema_tests;
diff --git a/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast_schema_tests.rs b/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast_schema_tests.rs
new file mode 100644
index 0000000000..1a3c15cbd1
--- /dev/null
+++ b/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast_schema_tests.rs
@@ -0,0 +1,27 @@
+use super::*;
+use serde_json::json;
+
+fn expected_audio_generate_and_email_podcast() -> serde_json::Value {
+ json!({
+ "type": "object",
+ "required": ["text", "to", "subject", "body"],
+ "properties": {
+ "text": { "type": "string", "description": "Text to synthesize into audio." },
+ "to": { "type": "string", "description": "Recipient email address." },
+ "subject": { "type": "string", "description": "Email subject line." },
+ "body": { "type": "string", "description": "Email body text." },
+ "title": { "type": "string", "description": "Optional title used in the default file name." },
+ "output_path": { "type": "string", "description": "Optional workspace-relative output path." },
+ "provider": { "type": "string", "description": "Optional TTS provider override (`cloud` or `piper`)." },
+ "voice": { "type": "string", "description": "Optional voice id for the chosen provider." },
+ "format": { "type": "string", "enum": ["mp3", "wav"], "description": "Desired audio format." },
+ "attachment_name": { "type": "string", "description": "Optional attachment file name override." }
+ }
+ })
+}
+
+#[test]
+fn audio_generate_and_email_podcast_static_schema_matches_json_literal() {
+ let tool = todo!("construct tool");
+ assert_eq!(Tool::parameters_schema(&tool), expected_audio_generate_and_email_podcast());
+}