The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor: import canonical tinyagents APIs
Steven Enamakel0ebf1b831d46
diff --git a/Cargo.lock b/Cargo.lockindex 7c18026529..d2d8ae908c 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -4150,6 +4150,7 @@ dependencies = ["tar","tempfile","thiserror 2.0.20",+ "tinyagents-definition","tinyagents-graph","tinyagents-harness","tinyagents-language",@@ -4182,6 +4183,7 @@ dependencies = ["tinyruntime-bus","tinyskills","tinytools",+ "tinytools-agent","tinyvoice-bus","tinywallet","tinywallet-bus",@@ -6438,10 +6440,19 @@ dependencies = ["time-core",]+[[package]]+name = "tinyagents-definition"+version = "2.1.2"+dependencies = [+ "async-trait",+ "serde",+]+[[package]]name = "tinyagents-graph"version = "2.1.2"dependencies = [+ "anyhow","async-trait","chrono","futures",@@ -6479,6 +6490,7 @@ dependencies = ["sha2 0.11.0","tempfile","thiserror 2.0.20",+ "tinyagents-definition","tinyagents-tracing","tinyinference-embeddings","tinyinference-llm",@@ -6502,8 +6514,10 @@ dependencies = [name = "tinyagents-registry"version = "2.1.2"dependencies = [+ "anyhow","serde","serde_json",+ "tinyagents-definition","tinyagents-graph","tinyagents-harness","tinyagents-language",diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.tomlindex 0bdd03a2e7..f6838b29e8 100644--- a/crates/openhuman-core/Cargo.toml+++ b/crates/openhuman-core/Cargo.toml@@ -413,6 +413,7 @@ tinyagents-harness = { path = "../../vendor/tinyagents/crates/tinyagents-harness"sqlite","multimodal",] }+tinyagents-definition = { path = "../../vendor/tinyagents/crates/tinyagents-definition" }tinyagents-graph = { path = "../../vendor/tinyagents/crates/tinyagents-graph", features = ["sqlite",] }@@ -441,6 +442,7 @@ tinyinference-voice = { path = "../../vendor/tinyagents/vendor/tinyinference/cra# whole address — the same arrangement as `tinyhumans-sdk` and the `-bus`# crates. After cloning: `git submodule update --init --recursive vendor/`.tinytools = { path = "../../vendor/tinyagents/vendor/tinytools/crates/tinytools" }+tinytools-agent = { path = "../../vendor/tinyagents/vendor/tinytools/crates/tinytools-agent" }# The memory *contract* — value types, the thirteen capability families, the# `MemoryProvider` driver trait, and the null reference driver. A direct path# dependency rather than a re-export, because `tinycortex::memory` aliases backdiff --git a/crates/openhuman-core/src/agent/agent_tests.rs b/crates/openhuman-core/src/agent/agent_tests.rsindex aaef9bf22c..1f7d5f02a6 100644--- a/crates/openhuman-core/src/agent/agent_tests.rs+++ b/crates/openhuman-core/src/agent/agent_tests.rs@@ -32,11 +32,11 @@ use crate::agent::messages::{ChatMessage, ConversationMessage, ToolResultMessageuse crate::config::AgentConfig;use crate::inference::provider::{ChatResponse, ToolCall};use crate::memory::Memory;-use crate::tools::{Tool, ToolResult};use anyhow::Result;use async_trait::async_trait;use std::sync::{Arc, Mutex};use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};+use tinytools::{Tool, ToolResult};// ═══════════════════════════════════════════════════════════════════════════// Test Helpers — Mock Provider, Mock Tool, Mock Memorydiff --git a/crates/openhuman-core/src/agent/agent_turn_loop_packed_tool_tests.rs b/crates/openhuman-core/src/agent/agent_turn_loop_packed_tool_tests.rsindex 125d490efd..cc4a2dd70d 100644--- a/crates/openhuman-core/src/agent/agent_turn_loop_packed_tool_tests.rs+++ b/crates/openhuman-core/src/agent/agent_turn_loop_packed_tool_tests.rs@@ -106,8 +106,8 @@ impl Tool for WritePackedTool {Ok(ToolResult::success("installed"))}- fn permission_level(&self) -> crate::tools::PermissionLevel {- crate::tools::PermissionLevel::Write+ fn permission_level(&self) -> tinytools::PermissionLevel {+ tinytools::PermissionLevel::Write}}diff --git a/crates/openhuman-core/src/agent/artifacts/ops.rs b/crates/openhuman-core/src/agent/artifacts/ops.rsindex 8e188b26ce..d8887d4bb3 100644--- a/crates/openhuman-core/src/agent/artifacts/ops.rs+++ b/crates/openhuman-core/src/agent/artifacts/ops.rs@@ -10,9 +10,9 @@ use crate::security::approval::{ApprovalChatContext, APPROVAL_CHAT_CONTEXT};#[cfg(feature = "documents")]use crate::security::SecurityPolicy;#[cfg(feature = "documents")]-use crate::tools::traits::Tool;-#[cfg(feature = "documents")]use crate::tools::PresentationTool;+#[cfg(feature = "documents")]+use tinytools::Tool;use super::store;use super::types::ArtifactKind;diff --git a/crates/openhuman-core/src/agent/artifacts/tools.rs b/crates/openhuman-core/src/agent/artifacts/tools.rsindex 5cc75ebb65..f7b04ce3ff 100644--- a/crates/openhuman-core/src/agent/artifacts/tools.rs+++ b/crates/openhuman-core/src/agent/artifacts/tools.rs@@ -20,7 +20,7 @@ use serde_json::json;use crate::agent::artifacts::ops;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Read `offset` / `limit` as optional `usize` from tool args.fn read_opt_usize(args: &serde_json::Value, key: &str) -> Option<usize> {diff --git a/crates/openhuman-core/src/agent/artifacts/tools_tests.rs b/crates/openhuman-core/src/agent/artifacts/tools_tests.rsindex 3948ca657c..90d0129b59 100644--- a/crates/openhuman-core/src/agent/artifacts/tools_tests.rs+++ b/crates/openhuman-core/src/agent/artifacts/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolScope;+use tinytools::ToolScope;fn test_config() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/agent/bus.rs b/crates/openhuman-core/src/agent/bus.rsindex 4189842169..003a86868c 100644--- a/crates/openhuman-core/src/agent/bus.rs+++ b/crates/openhuman-core/src/agent/bus.rs@@ -31,7 +31,7 @@ use crate::core::bus::BUS;use crate::security::prompt_injection::{enforce_prompt_input, PromptEnforcementAction, PromptEnforcementContext,};-use crate::tools::Tool;+use tinytools::Tool;use super::harness::definition::{AgentDefinitionRegistry, SandboxMode};use super::harness::{run_channel_turn_via_graph, with_current_sandbox_mode};diff --git a/crates/openhuman-core/src/agent/context/mod.rs b/crates/openhuman-core/src/agent/context/mod.rsindex bfb85c7b2c..4ec8d3576d 100644--- a/crates/openhuman-core/src/agent/context/mod.rs+++ b/crates/openhuman-core/src/agent/context/mod.rs@@ -21,16 +21,10 @@pub mod channels_prompt;pub mod manager;-pub mod prompt;pub mod session_memory;pub mod stats;pub use manager::{ContextManager, ContextStats};-pub use prompt::{- ArchetypePromptSection, DateTimeSection, IdentitySection, LearnedContextData, PromptContext,- PromptSection, PromptTool, RuntimeSection, SafetySection, SystemPromptBuilder, ToolsSection,- WorkspaceSection,-};pub use session_memory::{SessionMemoryConfig, SessionMemoryState, ARCHIVIST_EXTRACTION_PROMPT, DEFAULT_MIN_TOKEN_GROWTH,DEFAULT_MIN_TOOL_CALLS, DEFAULT_MIN_TURNS_BETWEEN,diff --git a/crates/openhuman-core/src/agent/context/prompt.rs b/crates/openhuman-core/src/agent/context/prompt.rsdeleted file mode 100644index 3996a76135..0000000000--- a/crates/openhuman-core/src/agent/context/prompt.rs+++ /dev/null@@ -1,11 +0,0 @@-//! Compat shim — prompt plumbing has moved to [`crate::agent::prompts`].-//!-//! This file used to hold the full prompt rendering pipeline (type-//! definitions, section builders, `SystemPromptBuilder`,-//! `render_subagent_system_prompt`). All of that now lives under-//! `agent::prompts` so prompt logic sits next to the agents that-//! consume it. This module stays around as a stable import path for-//! the rest of the tree — `use crate::agent::context::prompt::...`-//! keeps working unchanged.--pub use crate::agent::prompts::*;diff --git a/crates/openhuman-core/src/agent/debug/mod.rs b/crates/openhuman-core/src/agent/debug/mod.rsindex abfab3b92c..1ced95337a 100644--- a/crates/openhuman-core/src/agent/debug/mod.rs+++ b/crates/openhuman-core/src/agent/debug/mod.rs@@ -30,14 +30,12 @@ pub mod wire;pub use dump_writer::{write_prompt_dumps, DumpWriteSummary};pub use wire::render as render_wire_dump;-use crate::agent::context::prompt::{- LearnedContextData, PromptContext, PromptTool, ToolCallFormat,-};use crate::agent::harness::definition::{AgentDefinition, AgentDefinitionRegistry, PromptSource};use crate::agent::harness::session::Agent;+use crate::agent::prompts::{LearnedContextData, PromptContext, PromptTool, ToolCallFormat};use crate::config::Config;use crate::integrations::composio::ComposioActionTool;-use crate::tools::{Tool, ToolCategory};+use tinytools::{Tool, ToolCategory};// ---------------------------------------------------------------------------// Public API@@ -577,10 +575,10 @@ impl Tool for PromptProxyTool {fn category(&self) -> ToolCategory {self.category}- fn permission_level(&self) -> crate::tools::PermissionLevel {- crate::tools::PermissionLevel::None+ fn permission_level(&self) -> tinytools::PermissionLevel {+ tinytools::PermissionLevel::None}- async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<crate::tools::ToolResult> {+ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {Err(anyhow!("PromptProxyTool (`{}`) is a render-only stub — execute is not callable",self.namediff --git a/crates/openhuman-core/src/agent/dispatcher.rs b/crates/openhuman-core/src/agent/dispatcher.rsindex 8615bd1cb6..a28c6d2aea 100644--- a/crates/openhuman-core/src/agent/dispatcher.rs+++ b/crates/openhuman-core/src/agent/dispatcher.rs@@ -1,5 +1,5 @@//! Tool dialects — OpenHuman's adapter over-//! [`tinyagents_harness::tool_calling::dialect`].+//! [`tinytools_agent::dialect`].//!//! The dialects themselves moved to the crate: how a model is told to ask for a//! tool, how it is parsed when it does, how results are rendered back, and how@@ -15,7 +15,7 @@//! named and shaped for ~190 call sites across the harness, and//! [`ConversationMessage`] is the durable JSONL record existing installations//! already have on disk. The crate speaks its own thin-//! [`TranscriptEntry`](tinyagents_harness::tool_calling::dialect::TranscriptEntry)+//! [`TranscriptEntry`](tinytools_agent::dialect::TranscriptEntry)//! instead, so the conversions below are the seam — a handful of field-wise//! maps that keep the wire bytes identical while the logic lives upstream.//!@@ -33,16 +33,16 @@//! never decides what is *allowed to happen*, only what the model reads and//! writes. That line is what keeps the policy auditable in one place.-use crate::agent::context::prompt::ToolCallFormat;use crate::agent::messages::{ChatMessage, ConversationMessage, ToolResultMessage};-use crate::agent::pformat::PFormatRegistry;+use crate::agent::prompts::ToolCallFormat;use crate::inference::provider::{ChatResponse, ToolCall};-use crate::tools::{Tool, ToolSpec};use serde_json::Value;-use tinyagents_harness::tool_calling::dialect::{+use tinytools::{Tool, ToolSpec};+use tinytools_agent::dialect::{DialectMessage, DialectResponse, DialectRole, NativeDialect, NativeToolCall, PFormatDialect,ToolDialect, ToolOutcome, ToolResultEntry, TranscriptEntry, XmlDialect,};+use tinytools_agent::PFormatRegistry;/// A parsed tool call representation after being extracted from an LLM response.#[derive(Debug, Clone)]@@ -141,9 +141,7 @@ fn from_native_call(call: &NativeToolCall) -> ToolCall {}}-fn from_parsed_calls(- calls: Vec<tinyagents_harness::tool_calling::ParsedToolCall>,-) -> Vec<ParsedToolCall> {+fn from_parsed_calls(calls: Vec<tinytools_agent::ParsedToolCall>) -> Vec<ParsedToolCall> {calls.into_iter().map(|call| ParsedToolCall {@@ -256,10 +254,8 @@ fn specs_from_tools(tools: &[Box<dyn Tool>]) -> Vec<ToolSpec> {tools.iter().map(|tool| tool.spec()).collect()}-fn from_format(- format: tinyagents_harness::tool_calling::dialect::ToolCallFormat,-) -> ToolCallFormat {- use tinyagents_harness::tool_calling::dialect::ToolCallFormat as Crate;+fn from_format(format: tinytools_agent::dialect::ToolCallFormat) -> ToolCallFormat {+ use tinytools_agent::dialect::ToolCallFormat as Crate;match format {Crate::PFormat => ToolCallFormat::PFormat,Crate::Json => ToolCallFormat::Json,@@ -423,7 +419,7 @@ impl ToolDispatcher for PFormatToolDispatcher {/// models that might "forget" to use the structured API, and drops half-finished/// tool cycles while serializing so a bisected transcript cannot trip the/// provider's 400 (TAURI-RUST-7) — see-/// [`pair_tool_cycles`](tinyagents_harness::tool_calling::dialect::pair_tool_cycles).+/// [`pair_tool_cycles`](tinytools_agent::dialect::pair_tool_cycles).pub struct NativeToolDispatcher;impl ToolDispatcher for NativeToolDispatcher {diff --git a/crates/openhuman-core/src/agent/dispatcher_tests.rs b/crates/openhuman-core/src/agent/dispatcher_tests.rsindex b84198e88f..abdf6064cb 100644--- a/crates/openhuman-core/src/agent/dispatcher_tests.rs+++ b/crates/openhuman-core/src/agent/dispatcher_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::pformat::PFormatToolParams;+use tinytools_agent::PFormatToolParams;#[test]fn xml_dispatcher_parses_tool_calls() {@@ -220,11 +220,8 @@ fn pformat_dispatcher_instructions_are_protocol_only() {fn parameters_schema(&self) -> serde_json::Value {serde_json::json!({})}- async fn execute(- &self,- _args: serde_json::Value,- ) -> anyhow::Result<crate::tools::ToolResult> {- Ok(crate::tools::ToolResult::success("ok"))+ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("ok"))}}let tools: Vec<Box<dyn Tool>> = vec![Box::new(DummyTool)];diff --git a/crates/openhuman-core/src/agent/goals/tools.rs b/crates/openhuman-core/src/agent/goals/tools.rsindex 3ac44bc204..1133944643 100644--- a/crates/openhuman-core/src/agent/goals/tools.rs+++ b/crates/openhuman-core/src/agent/goals/tools.rs@@ -20,7 +20,7 @@ use serde_json::json;use super::store;use super::ThreadGoal;use crate::agent::tinyagents::thread_context::current_thread_id;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Render a goal as a compact, model-readable block.fn render_goal(goal: &ThreadGoal) -> String {diff --git a/crates/openhuman-core/src/agent/harness/agent_graph.rs b/crates/openhuman-core/src/agent/harness/agent_graph.rsindex 9e4ab4b0fc..746e12c179 100644--- a/crates/openhuman-core/src/agent/harness/agent_graph.rs+++ b/crates/openhuman-core/src/agent/harness/agent_graph.rs@@ -30,7 +30,7 @@ use crate::agent::harness::subagent_runner::SubagentRunError;use crate::agent::messages::ChatMessage;use crate::agent::progress::AgentProgress;use crate::agent::tinyagents::TurnModelSource;-use crate::tools::{Tool, ToolSpec};+use tinytools::{Tool, ToolSpec};/// The assembled inputs for one sub-agent turn, handed to a custom/// [`AgentGraph::Custom`] runner.diff --git a/crates/openhuman-core/src/agent/harness/definition/agent_definition.rs b/crates/openhuman-core/src/agent/harness/definition/agent_definition.rsindex ac46b5f4ec..21275ba78c 100644--- a/crates/openhuman-core/src/agent/harness/definition/agent_definition.rs+++ b/crates/openhuman-core/src/agent/harness/definition/agent_definition.rs@@ -111,7 +111,7 @@ pub struct AgentDefinition {/// mid-session do not retroactively update the in-flight prompt —/// they are picked up on the next session. This matches the/// byte-stability invariant documented on- /// [`crate::agent::context::prompt::render_subagent_system_prompt`].+ /// [`crate::agent::prompts::render_subagent_system_prompt`].#[serde(default = "defaults::true_")]pub omit_memory_md: bool,diff --git a/crates/openhuman-core/src/agent/harness/definition/prompt_source.rs b/crates/openhuman-core/src/agent/harness/definition/prompt_source.rsindex 64dbd834f3..84591856ca 100644--- a/crates/openhuman-core/src/agent/harness/definition/prompt_source.rs+++ b/crates/openhuman-core/src/agent/harness/definition/prompt_source.rs@@ -5,14 +5,13 @@ use serde::ser::SerializeMap;use serde::{Deserialize, Serialize};/// Builder function signature for [`PromptSource::Dynamic`]. Takes the-/// full runtime [`crate::agent::context::prompt::PromptContext`]+/// full runtime [`crate::agent::prompts::PromptContext`]/// (tools, skills, memory, connected integrations, dispatcher, model,/// …) and returns the final system prompt body — typically assembled/// by calling the `render_*` section helpers in-/// [`crate::agent::context::prompt`] in the order the builder+/// [`crate::agent::prompts`] in the order the builder/// wants.-pub type PromptBuilder =- fn(&crate::agent::context::prompt::PromptContext<'_>) -> anyhow::Result<String>;+pub type PromptBuilder = fn(&crate::agent::prompts::PromptContext<'_>) -> anyhow::Result<String>;/// Where the sub-agent's core system prompt comes from.#[derive(Clone)]@@ -24,7 +23,7 @@ pub enum PromptSource {/// at spawn time.File { path: String },/// Function-driven prompt: the builder is invoked at spawn time with- /// a [`crate::agent::context::prompt::PromptContext`] so the returned body can depend on runtime+ /// a [`crate::agent::prompts::PromptContext`] so the returned body can depend on runtime/// state (available tools, user profile, connected skills, etc.).////// Only constructed in-process (by built-in agent loaders). Notdiff --git a/crates/openhuman-core/src/agent/harness/fork_context.rs b/crates/openhuman-core/src/agent/harness/fork_context.rsindex a465218bda..17ba165931 100644--- a/crates/openhuman-core/src/agent/harness/fork_context.rs+++ b/crates/openhuman-core/src/agent/harness/fork_context.rs@@ -1,6 +1,6 @@//! Task-local plumbing that lets `SpawnSubagentTool` reach the parent//! agent's runtime context (provider, tools, model, …) without widening-//! the [`crate::tools::Tool`] trait.+//! the [`tinytools::Tool`] trait.//!//! [`PARENT_CONTEXT`] is set by the parent//! [`crate::agent::Agent`] around its `turn` so that any tool@@ -15,11 +15,11 @@ use crate::agent::tinyagents::TurnModelSource;use crate::config::AgentConfig;use crate::memory::Memory;use crate::skills::Workflow;-use crate::tools::{Tool, ToolSpec};use std::collections::HashSet;use std::path::PathBuf;use std::sync::Arc;use tinyagents_harness::workspace::WorkspaceDescriptor;+use tinytools::{Tool, ToolSpec};// ─────────────────────────────────────────────────────────────────────────────// Parent execution context@@ -119,7 +119,7 @@ pub struct ParentExecutionContext {pub channel: String,/// Active Composio integrations the parent has fetched.- pub connected_integrations: Vec<crate::agent::context::prompt::ConnectedIntegration>,+ pub connected_integrations: Vec<crate::agent::prompts::ConnectedIntegration>,/// The parent's active tool-call format (Native / PFormat / Json)./// Sub-agents render their system prompts with this format so the@@ -128,7 +128,7 @@ pub struct ParentExecutionContext {/// this, sub-agents inherit a hardcoded PFormat default while the/// runtime uses native function-calling, and the model emits/// uncallable P-Format tool_call blocks.- pub tool_call_format: crate::agent::context::prompt::ToolCallFormat,+ pub tool_call_format: crate::agent::prompts::ToolCallFormat,/// Parent's own session-transcript key, formatted as/// `"{unix_ts}_{agent_id}"`. Sub-agents chain this (plus anydiff --git a/crates/openhuman-core/src/agent/harness/graph.rs b/crates/openhuman-core/src/agent/harness/graph.rsindex 0be58e9e6f..0b30160786 100644--- a/crates/openhuman-core/src/agent/harness/graph.rs+++ b/crates/openhuman-core/src/agent/harness/graph.rs@@ -37,7 +37,7 @@ use crate::agent::progress::AgentProgress;use crate::agent::tinyagents::run_turn_via_tinyagents_shared;use crate::agent::tinyagents::TurnModelSource;use crate::config::{MultimodalConfig, MultimodalFileConfig};-use crate::tools::Tool;+use tinytools::Tool;/// Drive a channel/CLI turn on the graph engine. Returns the final assistant/// text. When `on_progress` is `Some`, the run streams and mirrors progressdiff --git a/crates/openhuman-core/src/agent/harness/graph_tests.rs b/crates/openhuman-core/src/agent/harness/graph_tests.rsindex 5cc5b00473..77cd7429a0 100644--- a/crates/openhuman-core/src/agent/harness/graph_tests.rs+++ b/crates/openhuman-core/src/agent/harness/graph_tests.rs@@ -1,10 +1,10 @@use super::*;-use crate::tools::ToolResult;use async_trait::async_trait;use tinyagents_harness::testkit::ScriptedModel;use tinyinference_llm::message::AssistantMessage;use tinyinference_llm::model::{ChatModel, ModelProfile, ModelResponse};use tinyinference_llm::tool::ToolCall;+use tinytools::ToolResult;struct PingTool;#[async_trait]diff --git a/crates/openhuman-core/src/agent/harness/harness_gap_tests.rs b/crates/openhuman-core/src/agent/harness/harness_gap_tests.rsindex 9e9736c9cc..51906bc48f 100644--- a/crates/openhuman-core/src/agent/harness/harness_gap_tests.rs+++ b/crates/openhuman-core/src/agent/harness/harness_gap_tests.rs@@ -43,7 +43,7 @@ use crate::tools::timeout::parse_tool_timeout_secs;#[test]fn parse_tool_calls_invoke_tag_with_json_body() {- use crate::agent::harness::parse::parse_tool_calls;+ use tinytools_agent::parse_tool_calls;// The <invoke> tag is listed in TOOL_CALL_OPEN_TAGS and must parse the// JSON body identically to <tool_call>.@@ -74,7 +74,7 @@ fn parse_tool_calls_invoke_tag_with_json_body() {#[test]fn parse_tool_calls_invoke_attribute_form_single_param() {- use crate::agent::harness::parse::parse_tool_calls;+ use tinytools_agent::parse_tool_calls;let input ="Sure.\n<invoke name=\"echo\">\n<parameter name=\"value\">hi</parameter>\n</invoke>\ndone";@@ -102,7 +102,7 @@ fn parse_tool_calls_invoke_attribute_form_single_param() {#[test]fn parse_tool_calls_invoke_attribute_form_multiple_params_scalar_policy() {- use crate::agent::harness::parse::parse_tool_calls;+ use tinytools_agent::parse_tool_calls;// Multiple <parameter> children. Scalar policy: a value that parses as JSON// (number, bool) becomes that JSON type; anything else stays a string. A@@ -127,7 +127,7 @@ fn parse_tool_calls_invoke_attribute_form_multiple_params_scalar_policy() {#[test]fn parse_tool_calls_invoke_attribute_form_missing_close_tag_is_text() {- use crate::agent::harness::parse::parse_tool_calls;+ use tinytools_agent::parse_tool_calls;// No closing </invoke>: nothing to dispatch. The block is left as text// rather than silently dropped.@@ -144,7 +144,7 @@ fn parse_tool_calls_invoke_attribute_form_missing_close_tag_is_text() {#[test]fn parse_tool_calls_invoke_attribute_form_missing_name_is_text() {- use crate::agent::harness::parse::parse_tool_calls;+ use tinytools_agent::parse_tool_calls;// Attribute form without a `name` attribute cannot name a tool → no call.let input = "<invoke foo=\"bar\">\n<parameter name=\"v\">hi</parameter>\n</invoke>";@@ -155,7 +155,7 @@ fn parse_tool_calls_invoke_attribute_form_missing_name_is_text() {#[test]fn parse_tool_calls_mixed_tool_call_json_and_invoke_attribute() {- use crate::agent::harness::parse::parse_tool_calls;+ use tinytools_agent::parse_tool_calls;// A canonical <tool_call>{json} block and a Claude-native attribute-form// <invoke> block in the same response are both recovered, earliest first.@@ -174,7 +174,7 @@ fn parse_tool_calls_mixed_tool_call_json_and_invoke_attribute() {#[test]fn parse_tool_calls_markdown_fence_yaml_like_json_body() {- use crate::agent::harness::parse::parse_tool_calls;+ use tinytools_agent::parse_tool_calls;// The markdown fence regex accepts ```tool_call\n…\n```.// The body must be valid JSON (the parser calls extract_json_valuesdiff --git a/crates/openhuman-core/src/agent/harness/harness_tests.rs b/crates/openhuman-core/src/agent/harness/harness_tests.rsindex 5f54691ee0..dbe1e3da41 100644--- a/crates/openhuman-core/src/agent/harness/harness_tests.rs+++ b/crates/openhuman-core/src/agent/harness/harness_tests.rs@@ -1,11 +1,16 @@use super::credentials::scrub_credentials;-use super::instructions::build_tool_instructions;-use super::parse::{- extract_json_values, parse_arguments_value, parse_glm_style_tool_calls, parse_tool_call_value,- parse_tool_calls, parse_tool_calls_from_json_value, tools_to_openai_format,-};+use super::parse_tests::tools_to_openai_format;use crate::tools;use std::sync::Arc;+use tinytools_agent::{+ extract_json_values, parse_arguments_value, parse_glm_style_tool_calls, parse_tool_call_value,+ parse_tool_calls, parse_tool_calls_from_json_value,+};++fn build_tool_instructions(tools: &[Box<dyn tinytools::Tool>]) -> String {+ let specs = tools.iter().map(|tool| tool.spec()).collect::<Vec<_>>();+ tinytools_agent::dialect::XmlDialect::instructions(&specs)+}#[path = "harness_tool_call_parsing_edge_case_tests.rs"]mod harness_tool_call_parsing_edge_case_tests;diff --git a/crates/openhuman-core/src/agent/harness/instructions.rs b/crates/openhuman-core/src/agent/harness/instructions.rsdeleted file mode 100644index 805809faf6..0000000000--- a/crates/openhuman-core/src/agent/harness/instructions.rs+++ /dev/null@@ -1,49 +0,0 @@-use crate::tools::Tool;-use std::fmt::Write;--fn tool_instructions_preamble() -> String {- let mut s = String::new();- s.push_str("\n## Tool Use Protocol\n\n");- s.push_str("To use a tool, wrap a JSON object in <tool_call></tool_call> tags:\n\n");- s.push_str("```\n<tool_call>\n{\"name\": \"tool_name\", \"arguments\": {\"param\": \"value\"}}\n</tool_call>\n```\n\n");- s.push_str(- "CRITICAL: Output actual <tool_call> tags—never describe steps or give examples.\n\n",- );- s.push_str("Example: User says \"what's the date?\". You MUST respond with:\n<tool_call>\n{\"name\":\"shell\",\"arguments\":{\"command\":\"date\"}}\n</tool_call>\n\n");- s.push_str("You may use multiple tool calls in a single response. ");- s.push_str("After tool execution, results appear in <tool_result> tags. ");- s.push_str("Continue reasoning with the results until you can give a final answer.\n\n");- s.push_str("### Available Tools\n\n");- s-}--fn append_tool_entry(instructions: &mut String, tool: &dyn Tool) {- let _ = writeln!(- instructions,- "**{}**: {}\nParameters: `{}`\n",- tool.name(),- tool.description(),- tool.parameters_schema()- );-}--/// Build the tool instruction block for the system prompt so the LLM knows-/// how to invoke tools.-pub(crate) fn build_tool_instructions(tools_registry: &[Box<dyn Tool>]) -> String {- let mut instructions = tool_instructions_preamble();- for tool in tools_registry {- append_tool_entry(&mut instructions, tool.as_ref());- }- instructions-}--/// Same as [`build_tool_instructions`] but accepts a pre-filtered slice-/// of trait-object references (used by channel startup to exclude-/// Workflow-category tools from the main agent prompt).-pub(crate) fn build_tool_instructions_filtered(tools: &[&dyn Tool]) -> String {- let mut instructions = tool_instructions_preamble();- for tool in tools {- append_tool_entry(&mut instructions, *tool);- }- instructions-}diff --git a/crates/openhuman-core/src/agent/harness/mod.rs b/crates/openhuman-core/src/agent/harness/mod.rsindex f04d14130c..8b520f8a26 100644--- a/crates/openhuman-core/src/agent/harness/mod.rs+++ b/crates/openhuman-core/src/agent/harness/mod.rs@@ -30,11 +30,9 @@ pub mod definition;pub(crate) mod definition_loader;pub mod fork_context;pub(crate) mod graph;-mod instructions;pub(crate) mod memory_context;pub(crate) mod memory_context_safety;pub(crate) mod memory_protocol;-pub(crate) mod parse;pub(crate) mod required_output;pub mod run_queue;pub mod sandbox_context;@@ -67,15 +65,12 @@ pub use task_recency_context::{current_task_recency_window, with_task_recency_wipub use turn_subagent_usage::{LastTurnUsage, SubagentUsageEntry};pub(crate) use graph::run_channel_turn_via_graph;-#[cfg(feature = "channels")]-pub(crate) use instructions::build_tool_instructions_filtered;-pub(crate) use parse::parse_tool_calls_with_pformat;-// No `parse_tool_calls` re-export: the dispatcher reaches the bare text parser-// through `tinyagents`' dialect layer now, and the tests that still use it name-// `parse::parse_tool_calls` directly.#[cfg(test)]mod harness_gap_tests;#[cfg(test)]+#[path = "parse.rs"]+mod parse_tests;+#[cfg(test)]#[path = "harness_tests.rs"]mod tests;diff --git a/crates/openhuman-core/src/agent/harness/parse.rs b/crates/openhuman-core/src/agent/harness/parse.rsindex 0e28f2b263..fddf8a7ce6 100644--- a/crates/openhuman-core/src/agent/harness/parse.rs+++ b/crates/openhuman-core/src/agent/harness/parse.rs@@ -1,5 +1,5 @@//! Tool-call parsing — OpenHuman's adapter over-//! [`tinyagents_harness::tool_calling`].+//! [`tinytools_agent`].//!//! The parsers themselves moved to the crate: `<tool_call>` tags in their//! several spellings, fenced blocks, bare JSON, Anthropic-style `<invoke>` XML,@@ -12,7 +12,7 @@//! fixtures its own tests assert against, and they never compiled into a//! production build even before the move.-pub(crate) use tinyagents_harness::tool_calling::{+pub(crate) use tinytools_agent::{extract_json_values, parse_tool_calls, parse_tool_calls_with_pformat,};@@ -21,7 +21,7 @@ pub(crate) use tinyagents_harness::tool_calling::{// site — gated so a non-test build doesn't warn (and fail `-D warnings`) on// them.#[cfg(test)]-pub(crate) use tinyagents_harness::tool_calling::{+pub(crate) use tinytools_agent::{parse_arguments_value, parse_glm_style_tool_calls, parse_tool_call_value,parse_tool_calls_from_json_value,};@@ -29,9 +29,9 @@ pub(crate) use tinyagents_harness::tool_calling::{#[cfg(test)]use crate::inference::provider::ToolCall;#[cfg(test)]-use crate::tools::Tool;+use tinytools::Tool;#[cfg(test)]-use tinyagents_harness::tool_calling::ParsedToolCall;+use tinytools_agent::ParsedToolCall;#[cfg(test)]pub(crate) fn parse_structured_tool_calls(tool_calls: &[ToolCall]) -> Vec<ParsedToolCall> {diff --git a/crates/openhuman-core/src/agent/harness/parse_tests.rs b/crates/openhuman-core/src/agent/harness/parse_tests.rsindex d90eb558f4..a2e8053876 100644--- a/crates/openhuman-core/src/agent/harness/parse_tests.rs+++ b/crates/openhuman-core/src/agent/harness/parse_tests.rs@@ -1,14 +1,14 @@//! Tests for the OpenHuman-specific half of tool-call parsing.//!//! The parser tests moved with the parsers, to-//! `tinyagents_harness::tool_calling`. What is exercised here is the wire+//! `tinytools_agent`. What is exercised here is the wire//! vocabulary that stayed: OpenHuman's `ToolCall`, its native-history JSON//! (including the Gemini `thought_signature` round-trip), and its OpenAI//! function-calling payload.use super::*;-use crate::tools::ToolResult;use async_trait::async_trait;+use tinytools::ToolResult;struct StubTool(&'static str);diff --git a/crates/openhuman-core/src/agent/harness/sandbox_context.rs b/crates/openhuman-core/src/agent/harness/sandbox_context.rsindex fd381cf4e5..ffedb231ee 100644--- a/crates/openhuman-core/src/agent/harness/sandbox_context.rs+++ b/crates/openhuman-core/src/agent/harness/sandbox_context.rs@@ -1,6 +1,6 @@//! Task-local carrier for the **calling agent's `sandbox_mode`** so tool//! implementations can enforce sandbox semantics at execution time without-//! widening the [`crate::tools::Tool`] trait signature.+//! widening the [`tinytools::Tool`] trait signature.//!//! Sibling of the existing [`super::fork_context`] task-local but serves//! a different concept: `PARENT_CONTEXT` carries the *parent agent's*diff --git a/crates/openhuman-core/src/agent/harness/session/builder/builder_build.rs b/crates/openhuman-core/src/agent/harness/session/builder/builder_build.rsindex ae6734a650..fa84621b11 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/builder_build.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/builder_build.rs@@ -4,9 +4,9 @@ use super::{dedup_visible_tool_specs, visible_tool_specs_for_policy};use crate::agent::context::ContextManager;use crate::agent::harness::session::types::{Agent, AgentBuilder};use crate::tools::agent_policy::ToolPolicyEngine;-use crate::tools::{Tool, ToolSpec};use anyhow::Result;use std::sync::Arc;+use tinytools::{Tool, ToolSpec};impl AgentBuilder {/// Validates the configuration and constructs a new `Agent` instance.@@ -207,7 +207,7 @@ impl AgentBuilder {let prompt_builder = self.prompt_builder- .unwrap_or_else(crate::agent::context::prompt::SystemPromptBuilder::with_defaults);+ .unwrap_or_else(crate::agent::prompts::SystemPromptBuilder::with_defaults);let model_name = self.model_namediff --git a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests.rs b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests.rsindex b3633352fb..3213b6be20 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests.rs@@ -4,8 +4,8 @@ use super::{dedup_visible_tool_specs, ensure_recovery_tool_visible, should_synthesize_delegation_tools,visible_tool_specs_for_policy,};-use crate::tools::ToolSpec;use serde_json::json;+use tinytools::ToolSpec;fn spec(name: &str) -> ToolSpec {ToolSpec {@@ -79,7 +79,7 @@ mod tool_spec_views_tests;use crate::tools::agent_policy::{TaskProfile, TaskRiskLevel, ToolPolicyAction, ToolPolicyDecision, ToolPolicySession,};-use crate::tools::traits::PermissionLevel;+use tinytools::PermissionLevel;fn session_allowing(names: &[&str]) -> ToolPolicySession {ToolPolicySession {@@ -112,7 +112,7 @@ fn session_allowing(names: &[&str]) -> ToolPolicySession {}fn use_skill_spec_from_registry() -> ToolSpec {- let mut tools: Vec<Box<dyn crate::tools::traits::Tool>> = Vec::new();+ let mut tools: Vec<Box<dyn tinytools::Tool>> = Vec::new();crate::tools::toolpacks::append_pack_tools(&mut tools);let tool = tools.iter()@@ -199,7 +199,7 @@ fn a_realistic_withheld_session_keeps_its_packs_advertised() {struct Fake(&'static str);#[async_trait::async_trait]- impl crate::tools::traits::Tool for Fake {+ impl tinytools::Tool for Fake {fn name(&self) -> &str {self.0}@@ -209,15 +209,12 @@ fn a_realistic_withheld_session_keeps_its_packs_advertised() {fn parameters_schema(&self) -> serde_json::Value {json!({ "type": "object" })}- async fn execute(- &self,- _a: serde_json::Value,- ) -> anyhow::Result<crate::tools::traits::ToolResult> {- Ok(crate::tools::traits::ToolResult::success("ok"))+ async fn execute(&self, _a: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("ok"))}}- let mut tools: Vec<Box<dyn crate::tools::traits::Tool>> =+ let mut tools: Vec<Box<dyn tinytools::Tool>> =vec![Box::new(Fake("goal_set")), Box::new(Fake("goal_get"))];append_pack_tools(&mut tools);diff --git a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_memory_write_instruction_tests.rs b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_memory_write_instruction_tests.rsindex 1964869731..ab78c1c8a4 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_memory_write_instruction_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_memory_write_instruction_tests.rs@@ -9,8 +9,8 @@ use super::*;#[tokio::test]async fn memory_write_instruction_is_present_with_learning_disabled() {- use crate::agent::context::prompt::LearnedContextData;use crate::agent::harness::session::types::Agent;+ use crate::agent::prompts::LearnedContextData;let tmp = tempfile::TempDir::new().unwrap();let config = test_config(&tmp);@@ -40,8 +40,8 @@ async fn memory_write_instruction_is_present_with_learning_disabled() {#[tokio::test]async fn memory_write_instruction_is_absent_when_no_write_tool_is_visible() {- use crate::agent::context::prompt::LearnedContextData;use crate::agent::harness::session::types::Agent;+ use crate::agent::prompts::LearnedContextData;let tmp = tempfile::TempDir::new().unwrap();let config = test_config(&tmp);@@ -77,8 +77,8 @@ async fn memory_write_instruction_is_absent_when_no_write_tool_is_visible() {/// exists to prevent.#[tokio::test]async fn memory_write_instruction_names_only_the_write_tool_a_scoped_agent_holds() {- use crate::agent::context::prompt::LearnedContextData;use crate::agent::harness::session::types::Agent;+ use crate::agent::prompts::LearnedContextData;let tmp = tempfile::TempDir::new().unwrap();let config = test_config(&tmp);diff --git a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_profile_soul_prompt_tests.rs b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_profile_soul_prompt_tests.rsindex e3a361a3ee..85c880dc59 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_profile_soul_prompt_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_profile_soul_prompt_tests.rs@@ -4,8 +4,8 @@ use super::*;async fn build_session_agent_injects_default_profile_soul_into_prompt() {// Building a session agent constructs a memory store, which reaches// the embedding seam; before the extraction this needed no setup.- use crate::agent::context::prompt::LearnedContextData;use crate::agent::harness::session::types::Agent;+ use crate::agent::prompts::LearnedContextData;let tmp = tempfile::TempDir::new().unwrap();let config = test_config(&tmp);@@ -41,8 +41,8 @@ async fn build_session_agent_injects_default_profile_soul_into_prompt() {async fn build_session_agent_profile_less_prompt_has_no_personality_soul() {// Building a session agent constructs a memory store, which reaches// the embedding seam; before the extraction this needed no setup.- use crate::agent::context::prompt::LearnedContextData;use crate::agent::harness::session::types::Agent;+ use crate::agent::prompts::LearnedContextData;let tmp = tempfile::TempDir::new().unwrap();let config = test_config(&tmp);diff --git a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_session_agent_profile_tests.rs b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_session_agent_profile_tests.rsindex a870962cba..484dd5f491 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_session_agent_profile_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests_session_agent_profile_tests.rs@@ -460,8 +460,8 @@ async fn build_session_agent_profile_less_uses_shared_memory_subtree() {async fn build_session_agent_injects_profile_soul_into_prompt() {// Building a session agent constructs a memory store, which reaches// the embedding seam; before the extraction this needed no setup.- use crate::agent::context::prompt::LearnedContextData;use crate::agent::harness::session::types::Agent;+ use crate::agent::prompts::LearnedContextData;let tmp = tempfile::TempDir::new().unwrap();let config = test_config(&tmp);@@ -503,8 +503,8 @@ async fn build_session_agent_injects_profile_soul_into_prompt() {async fn build_session_agent_uses_profile_memory_instead_of_root_memory() {// Building a session agent constructs a memory store, which reaches// the embedding seam; before the extraction this needed no setup.- use crate::agent::context::prompt::LearnedContextData;use crate::agent::harness::session::types::Agent;+ use crate::agent::prompts::LearnedContextData;let tmp = tempfile::TempDir::new().unwrap();let config = test_config(&tmp);@@ -561,9 +561,9 @@ async fn build_session_agent_uses_profile_memory_instead_of_root_memory() {/// it already supplied `builtin_def("orchestrator")`.#[tokio::test]async fn memory_access_instruction_is_present_with_learning_disabled() {- use crate::agent::context::prompt::LearnedContextData;use crate::agent::harness::session::types::Agent;use crate::agent::learning::MEMORY_ACCESS_INSTRUCTION;+ use crate::agent::prompts::LearnedContextData;let tmp = tempfile::TempDir::new().unwrap();let mut config = test_config(&tmp);diff --git a/crates/openhuman-core/src/agent/harness/session/builder/factory.rs b/crates/openhuman-core/src/agent/harness/session/builder/factory.rsindex 7e2d972081..347ee6d764 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/factory.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/factory.rs@@ -3,20 +3,21 @@use super::helpers::prefetch_tool_memory_rules_blocking;use super::should_synthesize_delegation_tools;-use crate::agent::context::prompt::SystemPromptBuilder;use crate::agent::dispatcher::{NativeToolDispatcher, PFormatToolDispatcher, XmlToolDispatcher};use crate::agent::harness::definition::NO_TOOLS_SENTINEL;use crate::agent::harness::definition::{AgentDefinitionRegistry, PromptSource, ToolScope};use crate::agent::harness::session::types::Agent;use crate::agent::host_runtime;+use crate::agent::prompts::SystemPromptBuilder;use crate::config::Config;use crate::inference::provider;use crate::memory::tool_memory::capture::ToolMemoryCaptureHook;use crate::memory::Memory;use crate::security::SecurityPolicy;-use crate::tools::{self, Tool};+use crate::tools;use anyhow::Result;use std::sync::Arc;+use tinytools::Tool;impl Agent {/// Constructs an `Agent` instance from a global system configuration.@@ -586,7 +587,7 @@ impl Agent {prompt_builder = prompt_builder.insert_section_before("user_memory",- Box::new(crate::agent::context::prompt::UserReflectionsSection),+ Box::new(crate::agent::prompts::UserReflectionsSection),).add_section(Box::new(crate::agent::learning::LearnedContextSection::new(memory.clone()),@@ -838,7 +839,7 @@ impl Agent {// and dispatchable for a replayed transcript or a saved// skill that names it — exactly like a packed tool.for t in &synthed {- if t.exposure() == crate::tools::traits::ToolExposure::Hidden {+ if t.exposure() == tinytools::ToolExposure::Hidden {continue;}set.insert(t.name().to_string());@@ -938,7 +939,7 @@ impl Agent {Some(set) => set,None => delegation_tools.iter()- .filter(|t| t.exposure() != crate::tools::traits::ToolExposure::Hidden)+ .filter(|t| t.exposure() != tinytools::ToolExposure::Hidden).map(|t| t.name().to_string()).collect(),};@@ -962,9 +963,7 @@ impl Agent {.chain(delegation_tools.iter()- .filter(|t| {- t.exposure() != crate::tools::traits::ToolExposure::Hidden- })+ .filter(|t| t.exposure() != tinytools::ToolExposure::Hidden).map(|t| t.name().to_string()),).filter(|name| !definition_disallows_tool(&def.disallowed_tools, name))@@ -1055,11 +1054,11 @@ impl Agent {// (including orchestrator tools) so every tool gets a signature// entry. The registry is self-contained — it doesn't hold a// reference back into the tools Vec.- let pformat_registry = crate::agent::pformat::build_registry_from_refs(+ let pformat_registry = tinytools_agent::build_registry(tools.iter().chain(delegation_tools.iter())- .map(|t| t.as_ref()),+ .map(|tool| (tool.name(), tool.parameters_schema())),);let dispatcher_kind =resolve_dispatcher_kind(&dispatcher_choice, supports_native, agent_id);diff --git a/crates/openhuman-core/src/agent/harness/session/builder/helpers.rs b/crates/openhuman-core/src/agent/harness/session/builder/helpers.rsindex 66f47b80ce..8b1b03d3fe 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/helpers.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/helpers.rs@@ -23,9 +23,9 @@ use crate::memory::tool_memory::{tool_memory_store, ToolMemoryRule};use crate::memory::Memory;use std::sync::Arc;-use crate::agent::context::prompt::SystemPromptBuilder;-use crate::tools::traits::Tool;+use crate::agent::prompts::SystemPromptBuilder;use std::collections::HashSet;+use tinytools::Tool;/// Binds this session's memory subtree once and hands back the two handles/// the factory takes from it: the raw provider the archivist writes through,diff --git a/crates/openhuman-core/src/agent/harness/session/builder/mod.rs b/crates/openhuman-core/src/agent/harness/session/builder/mod.rsindex e1b25c16b6..0e8d05527e 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/mod.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/mod.rs@@ -18,8 +18,8 @@ mod builder_tests;use crate::agent::harness::definition::{AgentDefinition, ToolScope};use crate::tools::agent_policy::ToolPolicySession;-use crate::tools::{Tool, ToolSpec};use std::sync::Arc;+use tinytools::{Tool, ToolSpec};/// Drop entries with duplicate `name` fields, first occurrence wins.///diff --git a/crates/openhuman-core/src/agent/harness/session/builder/setters.rs b/crates/openhuman-core/src/agent/harness/session/builder/setters.rsindex 6662b0c87f..d26dc40c8f 100644--- a/crates/openhuman-core/src/agent/harness/session/builder/setters.rs+++ b/crates/openhuman-core/src/agent/harness/session/builder/setters.rs@@ -5,8 +5,8 @@ use crate::agent::harness::session::types::AgentBuilder;use crate::agent::harness::TriggerMemoryAgent;use crate::config::ContextConfig;use crate::memory::Memory;-use crate::tools::Tool;use std::sync::Arc;+use tinytools::Tool;impl AgentBuilder {/// Creates a new `AgentBuilder` with default values.@@ -137,7 +137,7 @@ impl AgentBuilder {/// Sets the system prompt builder for the agent.pub fn prompt_builder(mut self,- prompt_builder: crate::agent::context::prompt::SystemPromptBuilder,+ prompt_builder: crate::agent::prompts::SystemPromptBuilder,) -> Self {self.prompt_builder = Some(prompt_builder);selfdiff --git a/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs b/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rsindex 1040bfad6c..9d48d729d9 100644--- a/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs+++ b/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs@@ -6,9 +6,9 @@ use super::super::types::{Agent, AgentBuilder};use crate::agent::messages::ConversationMessage;use crate::memory::Memory;use crate::tools::agent_policy::ToolPolicyEngine;-use crate::tools::{Tool, ToolSpec};use std::collections::HashSet;use std::sync::Arc;+use tinytools::{Tool, ToolSpec};impl Agent {// ─────────────────────────────────────────────────────────────────@@ -244,7 +244,7 @@ impl Agent {}/// Active Composio integrations fetched at session start.- pub fn connected_integrations(&self) -> &[crate::agent::context::prompt::ConnectedIntegration] {+ pub fn connected_integrations(&self) -> &[crate::agent::prompts::ConnectedIntegration] {&self.connected_integrations}@@ -267,7 +267,7 @@ impl Agent {/// fetch result when the agent was built outside the normal turn loop).pub fn set_connected_integrations(&mut self,- integrations: Vec<crate::agent::context::prompt::ConnectedIntegration>,+ integrations: Vec<crate::agent::prompts::ConnectedIntegration>,) {self.connected_integrations = integrations;self.connected_integrations_initialized = true;diff --git a/crates/openhuman-core/src/agent/harness/session/session_builder_and_listener_tests.rs b/crates/openhuman-core/src/agent/harness/session/session_builder_and_listener_tests.rsindex 8ffcc00a05..e06208ca7a 100644--- a/crates/openhuman-core/src/agent/harness/session/session_builder_and_listener_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/session_builder_and_listener_tests.rs@@ -62,7 +62,7 @@ fn set_connected_integrations_marks_session_initialized_and_updates_hash() {"fresh builder-built agents should start with placeholder integration state");- agent.set_connected_integrations(vec![crate::agent::context::prompt::ConnectedIntegration {+ agent.set_connected_integrations(vec![crate::agent::prompts::ConnectedIntegration {toolkit: "gmail".into(),description: "Email".into(),tools: vec![],@@ -87,7 +87,7 @@ fn refresh_delegation_tools_updates_schema_even_when_tool_arc_is_shared() {AgentDefinitionRegistry::init_global_builtins().unwrap();let mut agent = build_minimal_agent_with_definition_name(Some("orchestrator"));- agent.set_connected_integrations(vec![crate::agent::context::prompt::ConnectedIntegration {+ agent.set_connected_integrations(vec![crate::agent::prompts::ConnectedIntegration {toolkit: "gmail".into(),description: "Email".into(),tools: vec![],@@ -106,7 +106,7 @@ fn refresh_delegation_tools_updates_schema_even_when_tool_arc_is_shared() {// Simulate an in-flight turn holding a shared Arc clone.let _shared_tools = agent.tools_arc();agent.set_connected_integrations(vec![- crate::agent::context::prompt::ConnectedIntegration {+ crate::agent::prompts::ConnectedIntegration {toolkit: "gmail".into(),description: "Email".into(),tools: vec![],@@ -115,7 +115,7 @@ fn refresh_delegation_tools_updates_schema_even_when_tool_arc_is_shared() {connections: Vec::new(),non_active_status: None,},- crate::agent::context::prompt::ConnectedIntegration {+ crate::agent::prompts::ConnectedIntegration {toolkit: "notion".into(),description: "Docs".into(),tools: vec![],@@ -152,7 +152,7 @@ fn refresh_delegation_tools_no_duplicate_specs_across_shared_arc_connects() {AgentDefinitionRegistry::init_global_builtins().unwrap();let mut agent = build_minimal_agent_with_definition_name(Some("orchestrator"));- let conn = |slug: &str, desc: &str| crate::agent::context::prompt::ConnectedIntegration {+ let conn = |slug: &str, desc: &str| crate::agent::prompts::ConnectedIntegration {toolkit: slug.into(),description: desc.into(),tools: vec![],@@ -631,7 +631,7 @@ fn newly_synthesized_delegate_is_executable_while_tool_arc_is_shared() {// what used to break the instance reconcile.let _shared_tools = agent.tools_arc();- agent.set_connected_integrations(vec![crate::agent::context::prompt::ConnectedIntegration {+ agent.set_connected_integrations(vec![crate::agent::prompts::ConnectedIntegration {toolkit: "gmail".into(),description: "Email".into(),tools: vec![],diff --git a/crates/openhuman-core/src/agent/harness/session/session_dispatch_and_resume_tests.rs b/crates/openhuman-core/src/agent/harness/session/session_dispatch_and_resume_tests.rsindex a8bedc2344..f4c24d387e 100644--- a/crates/openhuman-core/src/agent/harness/session/session_dispatch_and_resume_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/session_dispatch_and_resume_tests.rs@@ -520,14 +520,14 @@ impl Tool for NamedTool {}/// Returns a fixed success; dispatch itself is not under test here.- async fn execute(&self, _args: serde_json::Value) -> Result<crate::tools::ToolResult> {- Ok(crate::tools::ToolResult::success("durable"))+ async fn execute(&self, _args: serde_json::Value) -> Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("durable"))}}/// A connected Composio toolkit with the given slug, for driving refreshes.-fn connected(slug: &str) -> crate::agent::context::prompt::ConnectedIntegration {- crate::agent::context::prompt::ConnectedIntegration {+fn connected(slug: &str) -> crate::agent::prompts::ConnectedIntegration {+ crate::agent::prompts::ConnectedIntegration {toolkit: slug.into(),description: slug.into(),tools: vec![],@@ -641,7 +641,7 @@ fn a_durable_tool_owning_a_delegate_name_wins_everywhere_across_refreshes() {.any(|tool| tool.name() == DELEGATE),"the colliding delegate must not be synthesised beside the durable tool");- let specs: Vec<&std::sync::Arc<crate::tools::ToolSpec>> = agent+ let specs: Vec<&std::sync::Arc<tinytools::ToolSpec>> = agent.tool_specs().iter().filter(|spec| spec.name == DELEGATE)diff --git a/crates/openhuman-core/src/agent/harness/session/session_prefix_stability_tests.rs b/crates/openhuman-core/src/agent/harness/session/session_prefix_stability_tests.rsindex 767ff78889..861de6e8c9 100644--- a/crates/openhuman-core/src/agent/harness/session/session_prefix_stability_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/session_prefix_stability_tests.rs@@ -9,7 +9,7 @@ fn superseded_synthesized_instances_are_released_when_readers_drop() {AgentDefinitionRegistry::init_global_builtins().unwrap();let mut agent = build_minimal_agent_with_definition_name(Some("orchestrator"));- let conn = |slug: &str, desc: &str| crate::agent::context::prompt::ConnectedIntegration {+ let conn = |slug: &str, desc: &str| crate::agent::prompts::ConnectedIntegration {toolkit: slug.into(),description: desc.into(),tools: vec![],@@ -76,7 +76,7 @@ fn an_unchanged_integration_set_leaves_the_tool_block_byte_stable() {let integrations = || {vec![- crate::agent::context::prompt::ConnectedIntegration {+ crate::agent::prompts::ConnectedIntegration {toolkit: "gmail".into(),description: "Email".into(),tools: vec![],@@ -85,7 +85,7 @@ fn an_unchanged_integration_set_leaves_the_tool_block_byte_stable() {connections: Vec::new(),non_active_status: None,},- crate::agent::context::prompt::ConnectedIntegration {+ crate::agent::prompts::ConnectedIntegration {toolkit: "notion".into(),description: "Docs".into(),tools: vec![],diff --git a/crates/openhuman-core/src/agent/harness/session/session_tests.rs b/crates/openhuman-core/src/agent/harness/session/session_tests.rsindex b23b25eeeb..7ee4878266 100644--- a/crates/openhuman-core/src/agent/harness/session/session_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/session_tests.rs@@ -11,7 +11,6 @@ use crate::agent::messages::ConversationMessage;use crate::core::events::DomainEvent;use crate::inference::provider::ChatResponse;use crate::memory::Memory;-use crate::tools::Tool;use anyhow::Result;use async_trait::async_trait;use parking_lot::Mutex;@@ -20,6 +19,7 @@ use tinyinference_llm::message::Message;use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse, ModelStream, ModelStreamItem,};+use tinytools::Tool;struct MockProvider {responses: Mutex<Vec<ChatResponse>>,@@ -146,8 +146,8 @@ impl Tool for MockTool {serde_json::json!({"type": "object"})}- async fn execute(&self, _args: serde_json::Value) -> Result<crate::tools::ToolResult> {- Ok(crate::tools::ToolResult::success("tool-out"))+ async fn execute(&self, _args: serde_json::Value) -> Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("tool-out"))}}diff --git a/crates/openhuman-core/src/agent/harness/session/session_thread_resume_tests.rs b/crates/openhuman-core/src/agent/harness/session/session_thread_resume_tests.rsindex 9c206c2d99..e4a0bdd2fa 100644--- a/crates/openhuman-core/src/agent/harness/session/session_thread_resume_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/session_thread_resume_tests.rs@@ -430,8 +430,8 @@ fn hide_tools_seeds_allowlist_when_no_filter_present() {serde_json::json!({"type": "object"})}- async fn execute(&self, _args: serde_json::Value) -> Result<crate::tools::ToolResult> {- Ok(crate::tools::ToolResult::success("kept"))+ async fn execute(&self, _args: serde_json::Value) -> Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("kept"))}}diff --git a/crates/openhuman-core/src/agent/harness/session/turn/context.rs b/crates/openhuman-core/src/agent/harness/session/turn/context.rsindex 152944f1f7..b2208cad96 100644--- a/crates/openhuman-core/src/agent/harness/session/turn/context.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn/context.rs@@ -3,11 +3,11 @@use super::super::turn_checkpoint::assistant_message_has_tool_calls;use super::super::types::Agent;use super::{collect_tree_root_summaries, sanitize_learned_entry};-use crate::agent::context::prompt::{LearnedContextData, PromptContext, PromptTool};use crate::agent::messages::{ChatMessage, ConversationMessage};+use crate::agent::prompts::{LearnedContextData, PromptContext, PromptTool};use crate::memory::MemoryCategory;use crate::tools::agent_policy::render_tool_policy_boundary;-use crate::tools::Tool;+use tinytools::Tool;use anyhow::Result;@@ -287,7 +287,7 @@ impl Agent {// `&[ToolSpec]`. Materialise a borrow-slice for the call: this is one// transient copy per system-prompt build, not a per-agent resident one,// and keeping it here is what lets the trait stay source-compatible.- let visible_specs_owned: Vec<crate::tools::ToolSpec> = self+ let visible_specs_owned: Vec<tinytools::ToolSpec> = self.visible_tool_specs.iter().map(|spec| spec.as_ref().clone())diff --git a/crates/openhuman-core/src/agent/harness/session/turn/graph.rs b/crates/openhuman-core/src/agent/harness/session/turn/graph.rsindex cc8e42b57c..4a0f155987 100644--- a/crates/openhuman-core/src/agent/harness/session/turn/graph.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn/graph.rs@@ -37,7 +37,7 @@ use crate::agent::tinyagents::{run_turn_via_tinyagents_shared, TinyagentsTurnOutcome, TurnContextMiddleware,};use crate::inference::provider::AGENT_TURN_MAX_OUTPUT_TOKENS;-use crate::tools::Tool;+use tinytools::Tool;/// Inputs for a single chat-turn graph dispatch. Grouped into a struct so the/// thin entry point stays readable (the shared seam takes 14 positional args);diff --git a/crates/openhuman-core/src/agent/harness/session/turn/mod.rs b/crates/openhuman-core/src/agent/harness/session/turn/mod.rsindex ed60e45af9..32180cead3 100644--- a/crates/openhuman-core/src/agent/harness/session/turn/mod.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn/mod.rs@@ -189,7 +189,7 @@ pub(super) async fn collect_tree_root_summaries(memory_subdir: &str,per_namespace_cap: usize,total_cap: usize,-) -> Vec<crate::agent::context::prompt::NamespaceSummary> {+) -> Vec<crate::agent::prompts::NamespaceSummary> {let rows = if memory_subdir == "memory" {driver_tree_root_summaries(per_namespace_cap, total_cap).await} else {@@ -201,7 +201,7 @@ pub(super) async fn collect_tree_root_summaries(};rows.into_iter().map(- |(namespace, body, updated_at)| crate::agent::context::prompt::NamespaceSummary {+ |(namespace, body, updated_at)| crate::agent::prompts::NamespaceSummary {namespace,body,updated_at,@@ -472,7 +472,7 @@ pub(crate) use super::turn_checkpoint::assistant_message_has_tool_calls;#[cfg(test)]pub(crate) use super::types::Agent;#[cfg(test)]-pub(crate) use crate::agent::context::prompt::LearnedContextData;+pub(crate) use crate::agent::prompts::LearnedContextData;#[cfg(test)]pub(crate) use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/harness/session/turn/tools.rs b/crates/openhuman-core/src/agent/harness/session/turn/tools.rsindex ae3914e5d5..d1e43b5167 100644--- a/crates/openhuman-core/src/agent/harness/session/turn/tools.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn/tools.rs@@ -10,8 +10,8 @@ use std::sync::Arc;/// One turn's tool inputs: the durable registry, the synthesised delegation/// set, and the callable-name allowlist. See [`Agent::turn_tool_sets`].type TurnToolSets = (- Arc<Vec<Box<dyn crate::tools::Tool>>>,- Arc<Vec<Box<dyn crate::tools::Tool>>>,+ Arc<Vec<Box<dyn tinytools::Tool>>>,+ Arc<Vec<Box<dyn tinytools::Tool>>>,std::collections::HashSet<String>,);@@ -595,7 +595,7 @@ impl Agent {);let synthed_names: std::collections::HashSet<String> =synthed.iter().map(|t| t.name().to_string()).collect();- let synthed_specs: Vec<Arc<crate::tools::ToolSpec>> =+ let synthed_specs: Vec<Arc<tinytools::ToolSpec>> =synthed.iter().map(|t| Arc::new(t.spec())).collect();// Skip mutation when neither the previous nor the next synthesisdiff --git a/crates/openhuman-core/src/agent/harness/session/turn_checkpoint_and_wrapup_tests.rs b/crates/openhuman-core/src/agent/harness/session/turn_checkpoint_and_wrapup_tests.rsindex 3eab29c104..5fa3541918 100644--- a/crates/openhuman-core/src/agent/harness/session/turn_checkpoint_and_wrapup_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn_checkpoint_and_wrapup_tests.rs@@ -39,7 +39,7 @@ async fn turn_synthesizes_required_output_when_reprompt_call_fails() {let response = agent.turn("hello").await.expect("turn should succeed");// Deterministic fallback: a synthesized block leads, original prose kept.- let first_block = crate::agent::harness::parse::extract_json_values(&response)+ let first_block = tinytools_agent::extract_json_values(&response).into_iter().next();assert!(@@ -217,7 +217,11 @@ async fn turn_checkpoint_rejects_pformat_wrapup_without_streaming_it() {tool_counts: AsyncMutex::new(Vec::new()),});let tools: Vec<Box<dyn Tool>> = vec![Box::new(EchoTool)];- let registry = crate::agent::pformat::build_registry(&tools);+ let registry = tinytools_agent::build_registry(+ tools+ .iter()+ .map(|tool| (tool.name(), tool.parameters_schema())),+ );let mut agent = make_agent_with_builder_and_dispatcher(provider,tools,diff --git a/crates/openhuman-core/src/agent/harness/session/turn_required_output_tests.rs b/crates/openhuman-core/src/agent/harness/session/turn_required_output_tests.rsindex 453e9fbd4a..d5c2ab72f1 100644--- a/crates/openhuman-core/src/agent/harness/session/turn_required_output_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn_required_output_tests.rs@@ -332,7 +332,7 @@ async fn turn_synthesizes_required_output_when_reprompt_also_omits() {// The synthesized block is prepended to the ORIGINAL turn reply// ("Working on it."), not the failed corrective re-prompt — so the leading// JSON object carries the block and the original prose is preserved.- let first_block = crate::agent::harness::parse::extract_json_values(&response)+ let first_block = tinytools_agent::extract_json_values(&response).into_iter().next();assert!(diff --git a/crates/openhuman-core/src/agent/harness/session/turn_tests.rs b/crates/openhuman-core/src/agent/harness/session/turn_tests.rsindex 9691ed0b9a..af62156378 100644--- a/crates/openhuman-core/src/agent/harness/session/turn_tests.rs+++ b/crates/openhuman-core/src/agent/harness/session/turn_tests.rs@@ -11,8 +11,6 @@ use crate::agent::tool_policy::{};use crate::inference::provider::{ChatResponse, UsageInfo};use crate::memory::Memory;-use crate::tools::ToolResult;-use crate::tools::{PermissionLevel, Tool};use async_trait::async_trait;use std::collections::HashSet;use std::sync::atomic::{AtomicUsize, Ordering};@@ -21,6 +19,8 @@ use tinyinference_llm::message::Message;use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse, ModelStream, ModelStreamItem,};+use tinytools::ToolResult;+use tinytools::{PermissionLevel, Tool};use tokio::sync::Mutex as AsyncMutex;use tokio::sync::Notify;use tokio::time::{timeout, Duration};diff --git a/crates/openhuman-core/src/agent/harness/session/types.rs b/crates/openhuman-core/src/agent/harness/session/types.rsindex e860e6d266..dca2ec9a49 100644--- a/crates/openhuman-core/src/agent/harness/session/types.rs+++ b/crates/openhuman-core/src/agent/harness/session/types.rs@@ -6,7 +6,6 @@//! `impl Agent`/`impl AgentBuilder` can see them without the whole//! crate gaining field access.-use crate::agent::context::prompt::SystemPromptBuilder;use crate::agent::context::ContextManager;use crate::agent::dispatcher::ToolDispatcher;use crate::agent::harness::archivist::ArchivistHook;@@ -14,13 +13,14 @@ use crate::agent::harness::definition::TriggerMemoryAgent;use crate::agent::hooks::PostTurnHook;use crate::agent::messages::{ChatMessage, ConversationMessage};use crate::agent::progress::AgentProgress;+use crate::agent::prompts::SystemPromptBuilder;use crate::agent::tinyagents::TurnModelSource;use crate::agent::tool_policy::ToolPolicy;use crate::memory::Memory;use crate::tools::agent_policy::ToolPolicySession;-use crate::tools::{Tool, ToolSpec};use std::path::PathBuf;use std::sync::Arc;+use tinytools::{Tool, ToolSpec};/// Per-turn behaviour overrides applied to a **single** [`Agent::turn`] call.///@@ -357,7 +357,7 @@ pub struct Agent {/// agent build time and threaded into each agent's `prompt.rs` so/// the delegator / skill-executor voices can render their own/// integration blocks.- pub(super) connected_integrations: Vec<crate::agent::context::prompt::ConnectedIntegration>,+ pub(super) connected_integrations: Vec<crate::agent::prompts::ConnectedIntegration>,/// Whether `connected_integrations` is an authoritative session-start/// snapshot (prewarmed from the shared Composio cache or fetched/// explicitly) versus the default empty placeholder installed bydiff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/extract_tool.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/extract_tool.rsindex a2c04495d9..25d91d9dfe 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/extract_tool.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/extract_tool.rs@@ -34,9 +34,9 @@ use crate::agent::harness::session::transcript::{};use crate::agent::messages::ChatMessage;use crate::agent::tinyagents::TurnModelSource;-use crate::tools::{Tool, ToolCategory, ToolResult};use tinyinference_llm::message::Message;use tinyinference_llm::model::ModelRequest;+use tinytools::{Tool, ToolCategory, ToolResult};// ── Tunables ──────────────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph.rsindex ac549b75a4..0e0c61f257 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph.rs@@ -56,12 +56,12 @@ use crate::agent::progress::AgentProgress;#[cfg(test)]use crate::inference::tokenjuice::AgentTokenjuiceCompression;#[cfg(test)]-use crate::tools::Tool;-#[cfg(test)]use std::collections::HashSet;#[cfg(test)]use std::sync::Arc;#[cfg(test)]+use tinytools::Tool;+#[cfg(test)]use worker_mirror::{mirror_worker_thread, mirror_worker_thread_from_history};#[cfg(test)]diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph/dispatch.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph/dispatch.rsindex 15d6567573..a95520ce72 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph/dispatch.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph/dispatch.rs@@ -12,8 +12,8 @@ use crate::agent::messages::{ChatMessage, ConversationMessage};use crate::agent::progress::AgentProgress;use crate::agent::tinyagents::{run_turn_via_tinyagents_shared, SubagentScope};use crate::inference::tokenjuice::AgentTokenjuiceCompression;-use crate::tools::{Tool, ToolSpec};use tinyagents_harness::workspace::WorkspaceDescriptor;+use tinytools::{Tool, ToolSpec};use super::transcript::persist_subagent_transcript;use super::worker_mirror::mirror_worker_thread;diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph_tests.rsindex 3786fe4224..326d701461 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph_tests.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph_tests.rs@@ -1,5 +1,4 @@use super::*;-use crate::tools::ToolResult;use async_trait::async_trait;use std::sync::atomic::{AtomicUsize, Ordering};use tinyinference_llm::message::{AssistantMessage, MessageDelta};@@ -7,6 +6,7 @@ use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse, ModelStream, ModelStreamItem,};use tinyinference_llm::tool::ToolCall;+use tinytools::ToolResult;fn native_tool_profile() -> &'static ModelProfile {static PROFILE: std::sync::LazyLock<ModelProfile> = std::sync::LazyLock::new(|| ModelProfile {diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/mod.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/mod.rsindex a9145f02a1..6ad02ad3c4 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/mod.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/mod.rs@@ -72,7 +72,7 @@ pub(super) use crate::agent::harness::turn_dispatch_guard;#[cfg(test)]pub(super) use crate::agent::harness::{current_spawn_depth, with_spawn_depth, MAX_SPAWN_DEPTH};#[cfg(test)]-pub(super) use crate::tools::{Tool, ToolSpec};+pub(super) use tinytools::{Tool, ToolSpec};// Test companion modules — path references relative to their original location.#[cfg(test)]diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/prompt.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/prompt.rsindex 4742ede5d3..306831d9f7 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/prompt.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/prompt.rs@@ -6,8 +6,8 @@use crate::agent::harness::artifact_offload::{render_artifact_offload_contract, should_render_offload_contract, ARTIFACT_OFFLOAD_HEADING,};-use crate::tools::ToolSpec;use std::collections::HashSet;+use tinytools::ToolSpec;// ─────────────────────────────────────────────────────────────────────────────// Sub-agent role contractdiff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/provider.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/provider.rsindex bbd825e5df..f61861aef8 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/provider.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/provider.rs@@ -133,13 +133,13 @@ pub(crate) fn user_is_signed_in_to_composio(config: &crate::config::Config) -> b/// safety net that handles the re-delegation pattern even without caching.pub(crate) struct LazyToolkitResolver {pub(super) config: std::sync::Arc<crate::config::Config>,- pub(super) actions: Vec<crate::agent::context::prompt::ConnectedIntegrationTool>,+ pub(super) actions: Vec<crate::agent::prompts::ConnectedIntegrationTool>,/// Cache of resolved tools keyed by action slug. Once a tool is built/// for a slug, subsequent `resolve()` calls for the same slug reuse the/// cached instance — sharing its [`ContractGate`] state (#5119).#[allow(dead_code)] // used via pub(super) from testspub(super) resolved:- std::sync::Mutex<std::collections::HashMap<String, std::sync::Arc<dyn crate::tools::Tool>>>,+ std::sync::Mutex<std::collections::HashMap<String, std::sync::Arc<dyn tinytools::Tool>>>,}/// Minimum normalized-slug length before the prefix/superstring tier in@@ -166,7 +166,7 @@ impl LazyToolkitResolver {/// safety net that fires when too many fresh gate instances have all/// surfaced the same contract without executing (#5119). This handles/// the cross-spawn re-delegation pattern even when caching is bypassed.- pub(super) fn resolve(&self, name: &str) -> Option<std::sync::Arc<dyn crate::tools::Tool>> {+ pub(super) fn resolve(&self, name: &str) -> Option<std::sync::Arc<dyn tinytools::Tool>> {// Check cache first — returns the same Arc (and therefore the same// ContractGate) for repeated resolve calls on the same slug.{@@ -185,7 +185,7 @@ impl LazyToolkitResolver {}let action = self.find_action(name)?;- let tool: std::sync::Arc<dyn crate::tools::Tool> =+ let tool: std::sync::Arc<dyn tinytools::Tool> =std::sync::Arc::new(crate::integrations::composio::ComposioActionTool::new(self.config.clone(),action.name.clone(),@@ -213,10 +213,7 @@ impl LazyToolkitResolver {/// resolve to the wrong action — those still fall through to the/// "tool not available" error, which lists `known_slugs` for the model/// to self-correct).- fn find_action(- &self,- name: &str,- ) -> Option<&crate::agent::context::prompt::ConnectedIntegrationTool> {+ fn find_action(&self, name: &str) -> Option<&crate::agent::prompts::ConnectedIntegrationTool> {if let Some(action) = self.actions.iter().find(|a| a.name == name) {return Some(action);}diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner.rsindex f49c6684c2..bfe2b34be3 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner.rs@@ -10,9 +10,6 @@ use std::collections::HashSet;use std::sync::Arc;use std::time::Instant;-use crate::agent::context::prompt::{- render_subagent_system_prompt_with_format, PromptContext, PromptTool, SubagentRenderOptions,-};use crate::agent::file_state::with_file_state_agent_id;use crate::agent::harness::agent_graph::{AgentTurnRequest, AgentTurnUsage};use crate::agent::harness::artifact_offload::{@@ -43,11 +40,14 @@ use crate::agent::harness::turn_dispatch_guard;use crate::agent::harness::{current_spawn_depth, with_current_sandbox_mode, with_spawn_depth, MAX_SPAWN_DEPTH,};+use crate::agent::prompts::{+ render_subagent_system_prompt_with_format, PromptContext, PromptTool, SubagentRenderOptions,+};use crate::inference::provider::AGENT_TURN_MAX_OUTPUT_TOKENS;use crate::memory::api::provider::retrieval::{FastRetrieveQuery, RetrievalResponse};use crate::memory::source_scope::as_bus_scope;-use crate::tools::{Tool, ToolCategory, ToolSpec};use tinyagents_harness::tool::SandboxMode as TinyagentsSandboxMode;+use tinytools::{Tool, ToolCategory, ToolSpec};use tinyagents_harness::workspace::WorkspaceDescriptor;@@ -864,7 +864,7 @@ async fn run_typed_mode(// once the OAuth handshake reaches ACTIVE/CONNECTED, so this call// returns the fresh list almost for free on the warm path. Fall back// to the parent's frozen list when the live fetch returns empty.- let live_integrations: Vec<crate::agent::context::prompt::ConnectedIntegration> = {+ let live_integrations: Vec<crate::agent::prompts::ConnectedIntegration> = {let signed_in = config.as_ref().ok()@@ -1074,7 +1074,7 @@ async fn run_typed_mode(}}};- let integration = crate::agent::context::prompt::ConnectedIntegration {+ let integration = crate::agent::prompts::ConnectedIntegration {toolkit: cached_integration.toolkit.clone(),description: cached_integration.description.clone(),tools: fresh_actions,@@ -1090,43 +1090,40 @@ async fn run_typed_mode(&integration.tools,top_k,);- let selected: Vec<&crate::agent::context::prompt::ConnectedIntegrationTool> =- if filter_hits.len() >= super::super::super::tool_filter::MIN_CONFIDENT_HITS {- // The ranker's verb gate can drop every content-returning- // action for a find/search prompt, so the toolkit's- // essentials are reserved inside the same budget (#6033).- let kept_idx = select_actions_with_essentials(- tk,- &integration.tools,- &filter_hits,- top_k,- );- let kept: Vec<_> =- kept_idx.iter().map(|&i| &integration.tools[i]).collect();- tracing::info!(- agent_id = %definition.id,- toolkit = %tk,- total = integration.tools.len(),- kept = kept.len(),- top_k = top_k,- kept_actions = %kept- .iter()- .map(|a| a.name.as_str())- .collect::<Vec<_>>()- .join(","),- "[subagent_runner:typed] fuzzy tool filter narrowed toolkit"- );- kept- } else {- tracing::info!(- agent_id = %definition.id,- toolkit = %tk,- total = integration.tools.len(),- filter_hits = filter_hits.len(),- "[subagent_runner:typed] fuzzy filter thin; falling back to full toolkit"- );- integration.tools.iter().collect()- };+ let selected: Vec<&crate::agent::prompts::ConnectedIntegrationTool> = if filter_hits+ .len()+ >= super::super::super::tool_filter::MIN_CONFIDENT_HITS+ {+ // The ranker's verb gate can drop every content-returning+ // action for a find/search prompt, so the toolkit's+ // essentials are reserved inside the same budget (#6033).+ let kept_idx =+ select_actions_with_essentials(tk, &integration.tools, &filter_hits, top_k);+ let kept: Vec<_> = kept_idx.iter().map(|&i| &integration.tools[i]).collect();+ tracing::info!(+ agent_id = %definition.id,+ toolkit = %tk,+ total = integration.tools.len(),+ kept = kept.len(),+ top_k = top_k,+ kept_actions = %kept+ .iter()+ .map(|a| a.name.as_str())+ .collect::<Vec<_>>()+ .join(","),+ "[subagent_runner:typed] fuzzy tool filter narrowed toolkit"+ );+ kept+ } else {+ tracing::info!(+ agent_id = %definition.id,+ toolkit = %tk,+ total = integration.tools.len(),+ filter_hits = filter_hits.len(),+ "[subagent_runner:typed] fuzzy filter thin; falling back to full toolkit"+ );+ integration.tools.iter().collect()+ };for action in selected {dynamic_tools.push(Box::new(@@ -1301,7 +1298,7 @@ async fn run_typed_mode(definition.omit_memory_md,);- let narrowed_integrations: Vec<crate::agent::context::prompt::ConnectedIntegration> =+ let narrowed_integrations: Vec<crate::agent::prompts::ConnectedIntegration> =match toolkit_filter {Some(tk) => live_integrations.iter()@@ -1371,7 +1368,7 @@ async fn run_typed_mode(tools: &prompt_tools,workflows: &parent.workflows,dispatcher_instructions: &dispatcher_instructions,- learned: crate::agent::context::prompt::LearnedContextData::default(),+ learned: crate::agent::prompts::LearnedContextData::default(),visible_tool_names: &visible_tool_names,tool_call_format: prompt_tool_call_format,connected_integrations: &narrowed_integrations,diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner/toolkit_scope_filter.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner/toolkit_scope_filter.rsindex 0e24489d39..3375fbd25e 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner/toolkit_scope_filter.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/runner/toolkit_scope_filter.rs@@ -10,8 +10,8 @@ pub(super) async fn filter_cached_toolkit_actions_with_current_scope(agent_id: &str,toolkit: &str,config: &crate::config::Config,- actions: &[crate::agent::context::prompt::ConnectedIntegrationTool],-) -> Vec<crate::agent::context::prompt::ConnectedIntegrationTool> {+ actions: &[crate::agent::prompts::ConnectedIntegrationTool],+) -> Vec<crate::agent::prompts::ConnectedIntegrationTool> {let pref = crate::integrations::composio::ops::load_user_scope_pref(config, toolkit).await;let before = actions.len();let filtered: Vec<_> = actionsdiff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests.rsindex d52775174e..345480c3d2 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests.rs@@ -40,8 +40,8 @@ struct StubTool {name: &'static str,}-use crate::tools::{PermissionLevel, ToolResult};use async_trait::async_trait;+use tinytools::{PermissionLevel, ToolResult};#[async_trait]impl Tool for StubTool {@@ -239,7 +239,7 @@ fn make_parent(provider: Arc<dyn ChatModel<()>>,tools: Vec<Box<dyn Tool>>,) -> ParentExecutionContext {- let tool_specs: Vec<Arc<crate::tools::ToolSpec>> =+ let tool_specs: Vec<Arc<tinytools::ToolSpec>> =tools.iter().map(|t| Arc::new(t.spec())).collect();ParentExecutionContext {workspace_descriptor: None,@@ -263,7 +263,7 @@ fn make_parent(session_id: "test-session".into(),channel: "test".into(),connected_integrations: vec![],- tool_call_format: crate::agent::context::prompt::ToolCallFormat::PFormat,+ tool_call_format: crate::agent::prompts::ToolCallFormat::PFormat,session_key: "0_test".into(),session_parent_prefix: None,on_progress: None,diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_model_resolution_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_model_resolution_tests.rsindex 286c981365..be63bcc939 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_model_resolution_tests.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_model_resolution_tests.rs@@ -611,7 +611,7 @@ fn nested_subagent_dispatch_runs_on_a_constrained_worker_stack() {// by `lazy_resolver_tolerates_near_miss_slugs`).#[test]fn repro_3152_near_miss_write_slug_resolves_uniquely() {- use crate::agent::context::prompt::ConnectedIntegrationTool;+ use crate::agent::prompts::ConnectedIntegrationTool;let mk = |name: &str| ConnectedIntegrationTool {name: name.into(),description: "d".into(),diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rsindex 0ecd96ce1d..904c12c941 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs@@ -2,7 +2,7 @@ use super::*;#[test]fn lazy_resolver_tolerates_near_miss_slugs() {- use crate::agent::context::prompt::ConnectedIntegrationTool;+ use crate::agent::prompts::ConnectedIntegrationTool;let mk = |name: &str| ConnectedIntegrationTool {name: name.into(),description: "d".into(),diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_tier_gate_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_tier_gate_tests.rsindex f6f69ad8a4..a944c8cea8 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_tier_gate_tests.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_tier_gate_tests.rs@@ -8,7 +8,7 @@ use super::*;// the length gate: a too-short request never fans out.#[test]fn prefix_tier_refuses_ambiguous_and_short_slugs() {- use crate::agent::context::prompt::ConnectedIntegrationTool;+ use crate::agent::prompts::ConnectedIntegrationTool;let mk = |name: &str| ConnectedIntegrationTool {name: name.into(),description: "d".into(),diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep.rsindex 4533bd7747..d0563c4054 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep.rs@@ -9,8 +9,8 @@use super::super::definition::{PromptSource, ToolScope};use super::types::SubagentRunError;-use crate::agent::context::prompt::PromptContext;-use crate::tools::Tool;+use crate::agent::prompts::PromptContext;+use tinytools::Tool;// ── Heavy-schema toolkit accounting ─────────────────────────────────────@@ -113,7 +113,7 @@ pub(super) fn essential_actions_for_toolkit(toolkit: &str) -> &'static [&'static/// call site did before the essentials existed.pub(super) fn select_actions_with_essentials(toolkit: &str,- actions: &[crate::agent::context::prompt::ConnectedIntegrationTool],+ actions: &[crate::agent::prompts::ConnectedIntegrationTool],filter_hits: &[usize],top_k: usize,) -> Vec<usize> {@@ -229,14 +229,14 @@ pub(crate) fn build_text_mode_tool_instructions() -> String {/// Its protocol block is empty because the runner appends/// [`build_text_mode_tool_instructions`] itself.pub(crate) fn subagent_prompt_protocol(- parent_format: crate::agent::context::prompt::ToolCallFormat,+ parent_format: crate::agent::prompts::ToolCallFormat,text_mode: bool,-) -> (crate::agent::context::prompt::ToolCallFormat, String) {- use crate::agent::context::prompt::ToolCallFormat;+) -> (crate::agent::prompts::ToolCallFormat, String) {use crate::agent::dispatcher::{NativeToolDispatcher, PFormatToolDispatcher, ToolDispatcher, XmlToolDispatcher,};- use crate::agent::pformat::PFormatRegistry;+ use crate::agent::prompts::ToolCallFormat;+ use tinytools_agent::PFormatRegistry;if text_mode {return (ToolCallFormat::PFormat, String::new());}diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_recovery_visibility_tests_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_recovery_visibility_tests_tests.rsindex 2ee0dd72a7..5fdc45d249 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_recovery_visibility_tests_tests.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_recovery_visibility_tests_tests.rs@@ -2,14 +2,14 @@ use super::*;use crate::inference::tokenjuice::LEGACY_RETRIEVE_TOOL_NAME as RECOVERY_TOOL_NAME;use crate::tools::{CurrentTimeTool, RetrieveToolOutputTool};-fn tools() -> Vec<Box<dyn crate::tools::Tool>> {+fn tools() -> Vec<Box<dyn tinytools::Tool>> {vec![Box::new(CurrentTimeTool::new()),Box::new(RetrieveToolOutputTool::new()),]}-fn names(idx: &[usize], tools: &[Box<dyn crate::tools::Tool>]) -> Vec<String> {+fn names(idx: &[usize], tools: &[Box<dyn tinytools::Tool>]) -> Vec<String> {idx.iter().map(|&i| tools[i].name().to_string()).collect()}diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_tests.rsindex 113cd495f5..129e66e5b5 100644--- a/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_tests.rs+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/tool_prep_tests.rs@@ -57,7 +57,7 @@ fn unprefixed_delegate_name_overrides_are_treated_as_spawn_tools() {// ── Essential-action reservation (#6033) ────────────────────────────────-use crate::agent::context::prompt::ConnectedIntegrationTool;+use crate::agent::prompts::ConnectedIntegrationTool;fn action(name: &str) -> ConnectedIntegrationTool {ConnectedIntegrationTool {@@ -311,8 +311,8 @@ fn every_essential_action_is_read_only() {// ── Dynamic-tool spawn strip (#6157) ────────────────────────────────────-use crate::tools::Tool;use async_trait::async_trait;+use tinytools::Tool;/// A tool that is nothing but its name — the strip reads no other field.struct NamedTool(&'static str);@@ -335,11 +335,8 @@ impl Tool for NamedTool {}/// Never called: the strip only inspects names.- async fn execute(- &self,- _args: serde_json::Value,- ) -> anyhow::Result<crate::tools::traits::ToolResult> {- Ok(crate::tools::traits::ToolResult::success(String::new()))+ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success(String::new()))}}@@ -414,11 +411,8 @@ fn a_dynamic_tool_list_without_spawn_tools_is_untouched() {}/// Render the `## Tools` section the way a sub-agent prompt does, at `format`.-fn render_tools_at(- format: crate::agent::context::prompt::ToolCallFormat,- instructions: &str,-) -> String {- use crate::agent::context::prompt::{LearnedContextData, PromptTool};+fn render_tools_at(format: crate::agent::prompts::ToolCallFormat, instructions: &str) -> String {+ use crate::agent::prompts::{LearnedContextData, PromptTool};let tools = [PromptTool {name: "composio_execute",description: "Run one Composio action.",@@ -457,7 +451,7 @@ fn render_tools_at(/// happen: no catalogue at all, plus the native JSON protocol.#[test]fn text_mode_child_of_a_native_parent_renders_its_tool_catalogue() {- use crate::agent::context::prompt::ToolCallFormat;+ use crate::agent::prompts::ToolCallFormat;let (format, instructions) = subagent_prompt_protocol(ToolCallFormat::Native, true);assert_eq!(format, ToolCallFormat::PFormat);@@ -480,7 +474,7 @@ fn text_mode_child_of_a_native_parent_renders_its_tool_catalogue() {#[test]fn native_child_keeps_the_parents_protocol() {- use crate::agent::context::prompt::ToolCallFormat;+ use crate::agent::prompts::ToolCallFormat;for parent in [ToolCallFormat::Native,diff --git a/crates/openhuman-core/src/agent/harness/task_recency_context.rs b/crates/openhuman-core/src/agent/harness/task_recency_context.rsindex 5e50fc1275..7a23c230e3 100644--- a/crates/openhuman-core/src/agent/harness/task_recency_context.rs+++ b/crates/openhuman-core/src/agent/harness/task_recency_context.rs@@ -1,6 +1,6 @@//! Task-local carrier for a **task-recency window** so the Composio tool//! surface can restrict task-fetch results to "recently created/changed"-//! without widening the [`crate::tools::Tool`] trait signature.+//! without widening the [`tinytools::Tool`] trait signature.//!//! Sibling of [`super::sandbox_context`]: same task-local pattern, different//! concept. `CURRENT_AGENT_SANDBOX_MODE` carries the calling agent's sandboxdiff --git a/crates/openhuman-core/src/agent/harness/tool_filter.rs b/crates/openhuman-core/src/agent/harness/tool_filter.rsindex c9cbc5f1d7..a870ac7edb 100644--- a/crates/openhuman-core/src/agent/harness/tool_filter.rs+++ b/crates/openhuman-core/src/agent/harness/tool_filter.rs@@ -12,7 +12,7 @@use tinyagents_harness::tool::SelectableTool;-use crate::agent::context::prompt::ConnectedIntegrationTool;+use crate::agent::prompts::ConnectedIntegrationTool;pub use tinyagents_harness::tool::MIN_CONFIDENT_HITS;diff --git a/crates/openhuman-core/src/agent/harness/tool_filter_tests.rs b/crates/openhuman-core/src/agent/harness/tool_filter_tests.rsindex de838234c0..b180393b41 100644--- a/crates/openhuman-core/src/agent/harness/tool_filter_tests.rs+++ b/crates/openhuman-core/src/agent/harness/tool_filter_tests.rs@@ -10,7 +10,7 @@//! moving up with the algorithm.use super::*;-use crate::agent::context::prompt::ConnectedIntegrationTool;+use crate::agent::prompts::ConnectedIntegrationTool;// ── Real-dataset integration tests ────────────────────────────────//diff --git a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rsindex 924af826bc..3c13b2bd6a 100644--- a/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs+++ b/crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod_tests.rs@@ -1,9 +1,9 @@use super::*;use crate::security::{AutonomyLevel, SecurityPolicy};-use crate::tools::traits::Tool;use crate::tools::FileReadTool;use serde_json::json;use std::sync::Arc;+use tinytools::Tool;#[tokio::test]async fn threshold_persists_preview_and_readable_file() {diff --git a/crates/openhuman-core/src/agent/learning/prompt_sections.rs b/crates/openhuman-core/src/agent/learning/prompt_sections.rsindex c39dc3ed7e..94d8c2158e 100644--- a/crates/openhuman-core/src/agent/learning/prompt_sections.rs+++ b/crates/openhuman-core/src/agent/learning/prompt_sections.rs@@ -18,10 +18,10 @@//! call `memory_recall` / `memory_search` before answering questions that draw on//! prior sessions. Registered after `LearnedContextSection` in the section chain.-use crate::agent::context::prompt::{PromptContext, PromptSection};-use crate::tools::traits::Tool;+use crate::agent::prompts::{PromptContext, PromptSection};use anyhow::Result;use std::collections::HashSet;+use tinytools::Tool;/// Injects recent observations and patterns from the learning subsystem.pub struct LearnedContextSection;diff --git a/crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs b/crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rsindex 1ba4e51512..7e47692d9e 100644--- a/crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs+++ b/crates/openhuman-core/src/agent/learning/prompt_sections_tests_2_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::LearnedContextData;+use crate::agent::prompts::LearnedContextData;use crate::memory::{Memory, MemoryCategory, MemoryEntry};use async_trait::async_trait;use std::collections::HashSet;@@ -75,7 +75,7 @@ fn prompt_context(learned: LearnedContextData) -> PromptContext<'static> {dispatcher_instructions: "",learned,visible_tool_names,- tool_call_format: crate::agent::context::prompt::ToolCallFormat::PFormat,+ tool_call_format: crate::agent::prompts::ToolCallFormat::PFormat,connected_integrations: &[],connected_identities_md: String::new(),include_profile: false,@@ -307,11 +307,8 @@ impl Tool for NamedTool {serde_json::json!({})}- async fn execute(- &self,- _args: serde_json::Value,- ) -> anyhow::Result<crate::tools::traits::ToolResult> {- Ok(crate::tools::traits::ToolResult::success(String::new()))+ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success(String::new()))}}diff --git a/crates/openhuman-core/src/agent/learning/tools.rs b/crates/openhuman-core/src/agent/learning/tools.rsindex c8a2069146..2766f11804 100644--- a/crates/openhuman-core/src/agent/learning/tools.rs+++ b/crates/openhuman-core/src/agent/learning/tools.rs@@ -23,8 +23,8 @@ use serde_json::json;use crate::agent::learning::cache::FacetCache;use crate::agent::learning::stability_detector::StabilityDetector;use crate::config::rpc as config_rpc;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use tinymemory_api::provider::{FacetState, ProfileFacet, UserState};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Acquire the profile facet cache, mirroring `learning::schemas::get_cache`.///diff --git a/crates/openhuman-core/src/agent/learning/tools_tests.rs b/crates/openhuman-core/src/agent/learning/tools_tests.rsindex c5c9352789..d92dc00228 100644--- a/crates/openhuman-core/src/agent/learning/tools_tests.rs+++ b/crates/openhuman-core/src/agent/learning/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolScope;+use tinytools::ToolScope;#[test]fn names_and_levels() {diff --git a/crates/openhuman-core/src/agent/mod.rs b/crates/openhuman-core/src/agent/mod.rsindex 95638f450d..9933b5483f 100644--- a/crates/openhuman-core/src/agent/mod.rs+++ b/crates/openhuman-core/src/agent/mod.rs@@ -37,7 +37,6 @@ pub(crate) mod message_convert;pub mod messages;pub mod multimodal;pub mod orchestration;-pub mod pformat;pub mod plan_review;/// Cross-platform shell selection shared by [`host_runtime::NativeRuntime`]/// and [`crate::sandbox::ops`] so all three shell-spawning sites@@ -57,10 +56,7 @@ pub mod progress_sink;/// session id with user attribution (issue #3886).pub(crate) mod progress_tracing;/// Prompt plumbing — types, section builders, and-/// [`SystemPromptBuilder`](prompts::SystemPromptBuilder). Moved from-/// `crate::agent::context::prompt` so prompt rendering lives next to the-/// agents that consume it. `crate::agent::context::prompt` is retained as-/// a thin re-export shim for now.+/// [`SystemPromptBuilder`](prompts::SystemPromptBuilder).pub mod prompts;pub mod registry;mod schemas;diff --git a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime_tests.rs b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime_tests.rsindex ca6f545eb2..f3dcaf67f1 100644--- a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime_tests.rs@@ -15,17 +15,17 @@ use async_trait::async_trait;use serde_json::json;use super::*;-use crate::agent::context::prompt::ToolCallFormat;use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::fork_context::{with_parent_context, ParentExecutionContext};+use crate::agent::prompts::ToolCallFormat;use crate::config::{AgentConfig, Config};use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};-use crate::tools::Tool;use tinyagents_session::run_ledger::{self, AgentTeamMemberStatus, AgentTeamMemberUpsert, AgentTeamStatus, AgentTeamTaskStatus,AgentTeamTaskUpsert, AgentTeamUpsert,};use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};+use tinytools::Tool;// ── Mocks (mirror workflow_runs::engine_tests) ──────────────────────────────diff --git a/crates/openhuman-core/src/agent/orchestration/ops.rs b/crates/openhuman-core/src/agent/orchestration/ops.rsindex 63c8d3c08b..5405b4d651 100644--- a/crates/openhuman-core/src/agent/orchestration/ops.rs+++ b/crates/openhuman-core/src/agent/orchestration/ops.rs@@ -33,15 +33,17 @@ use crate::agent::harness::subagent_runner::{run_subagent, SubagentRunOptions, SubagentRunOutcome,};use crate::agent::progress::AgentProgress;-use crate::agent::tinyagents::orchestration::{- shared_steering_registry, DetachedTaskRegistry, DetachedTaskRegistryError,- DetachedTaskWaitOutcome, OrchestrationTaskStatus, TaskId,-};+use crate::agent::tinyagents::host::steering::shared_steering_registry;use crate::core::bus::BUS;use crate::core::events::DomainEvent;use std::collections::BTreeMap;use std::sync::Arc;use thiserror::Error;+use tinyagents_graph::orchestration::{+ DetachedTaskRegistry, DetachedTaskRegistryError, DetachedTaskWaitOutcome,+ OrchestrationTaskStatus,+};+use tinyagents_harness::ids::TaskId;use tinyagents_harness::CancellationToken;use tokio::sync::{mpsc, watch};use tokio::time::{Duration, Instant};diff --git a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/ops_tests.rsindex 732f9840f1..e86b8fcd94 100644--- a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs@@ -1,10 +1,9 @@use super::*;-use crate::agent::context::prompt::ToolCallFormat;use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::fork_context::{with_parent_context, ParentExecutionContext};+use crate::agent::prompts::ToolCallFormat;use crate::config::AgentConfig;use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};-use crate::tools::Tool;use async_trait::async_trait;use parking_lot::Mutex;use std::sync::{@@ -12,6 +11,7 @@ use std::sync::{Arc,};use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};+use tinytools::Tool;use tokio::time::Duration;#[derive(Default)]diff --git a/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs b/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rsindex 3f2699f216..9b00019099 100644--- a/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs+++ b/crates/openhuman-core/src/agent/orchestration/parent_context/builder.rs@@ -113,7 +113,7 @@ pub(crate) async fn build_root_parent(session_id: format!("{session_prefix}-{}", uuid::Uuid::new_v4()),channel: channel.to_string(),connected_integrations: agent.connected_integrations().to_vec(),- tool_call_format: crate::agent::context::prompt::ToolCallFormat::PFormat,+ tool_call_format: crate::agent::prompts::ToolCallFormat::PFormat,session_key: agent.session_key().to_string(),session_parent_prefix: agent.session_parent_prefix().map(str::to_string),on_progress: None,diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rsindex c3d183aa1f..fba0dfaad4 100644--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/registry.rs@@ -27,7 +27,8 @@ use tokio::sync::watch;use tokio::task::AbortHandle;use crate::agent::harness::run_queue::RunQueue;-use crate::agent::tinyagents::orchestration::{shared_steering_registry, DetachedTaskRegistry};+use crate::agent::tinyagents::host::steering::shared_steering_registry;+use tinyagents_graph::orchestration::DetachedTaskRegistry;use tinyagents_harness::ids::TaskId;use tinyagents_harness::CancellationToken;diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rsindex abace3aaa4..2f52bcbb15 100644--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/resolve.rs@@ -7,7 +7,7 @@ use std::path::Path;use tinyagents_harness::ids::TaskId;-use crate::agent::tinyagents::orchestration::OrchestrationTaskRecord;+use tinyagents_graph::orchestration::OrchestrationTaskRecord;use super::registry::{registry, SubagentResumeRef};use super::task_ledger::{diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rsindex 52f0c265a4..241542f6df 100644--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/steering.rs@@ -3,10 +3,9 @@//! `SteeringHandle` fast path for runs that have registered one.use crate::agent::harness::run_queue::{QueueMode, QueuedMessage};-use crate::agent::tinyagents::orchestration::{- DetachedTaskRegistryError, SteeringCommand, SteeringCommandKind,-};+use tinyagents_graph::orchestration::DetachedTaskRegistryError;use tinyagents_harness::ids::TaskId;+use tinyagents_harness::steering::{SteeringCommand, SteeringCommandKind};use tinyinference_llm::message::Message as TaMessage;use super::cancel::now_ms;diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rsindex d379c8e8aa..7360ea7106 100644--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs@@ -12,7 +12,7 @@use std::path::{Path, PathBuf};use std::sync::{Arc, OnceLock};-use crate::agent::tinyagents::orchestration::{+use tinyagents_graph::orchestration::{open_jsonl_task_store_or_memory, reconcile_orphaned_tasks, InMemoryTaskStore,OrchestrationTaskFilter, OrchestrationTaskKind, OrchestrationTaskRecord,OrchestrationTaskResult, OrchestrationTaskSpec, OrchestrationTaskStatus, TaskStore,diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents/wait.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents/wait.rsindex 4e0c1b0f88..83035b58d5 100644--- a/crates/openhuman-core/src/agent/orchestration/running_subagents/wait.rs+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents/wait.rs@@ -5,12 +5,11 @@use std::path::Path;use std::time::Duration;-use crate::agent::tinyagents::orchestration::DetachedTaskRegistryError;+use tinyagents_graph::orchestration::{DetachedTaskRegistryError, DetachedTaskWaitOutcome};use tinyagents_harness::ids::TaskId;use super::registry::{registry, SubagentStatus};use super::task_ledger::{record_to_status, task_record_for_task_in_workspace, task_status_label};-use crate::agent::tinyagents::orchestration::DetachedTaskWaitOutcome;/// Why a wait could not be set up.#[derive(Debug, PartialEq, Eq)]diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rsindex 13cb45b22e..9165aa9ce6 100644--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs@@ -9,17 +9,18 @@ use crate::agent::orchestration::running_subagents::steering::steer_directive;use crate::agent::orchestration::running_subagents::steering::SteerDirectiveError;use crate::agent::orchestration::running_subagents::steering::SteeringDirective;use crate::agent::orchestration::running_subagents::wait::wait;-use crate::agent::tinyagents::orchestration::shared_steering_registry;-use crate::agent::tinyagents::orchestration::{- openhuman_steering_handle, OrchestrationTaskStatus, SteeringHandle, SteeringPolicy,- SteeringRunClass,+use crate::agent::tinyagents::host::steering::{+ openhuman_steering_handle, shared_steering_registry, SteeringRunClass,};use std::path::PathBuf;use std::sync::Arc;use std::sync::MutexGuard;use std::time::Duration;+use tinyagents_graph::orchestration::OrchestrationTaskStatus;use tinyagents_harness::ids::TaskId;-use tinyagents_harness::steering::{SteeringCommand, SteeringCommandKind};+use tinyagents_harness::steering::{+ SteeringCommand, SteeringCommandKind, SteeringHandle, SteeringPolicy,+};use tokio::sync::watch;use tokio::task::AbortHandle;diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel_graph/staging.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel_graph/staging.rsindex a43a3c99bd..c00b8a418b 100644--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel_graph/staging.rs+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel_graph/staging.rs@@ -24,7 +24,7 @@ use crate::agent::harness::definition::{};use crate::agent::harness::fork_context::ParentExecutionContext;use crate::agent::orchestration::worktree::BaseRef;-use crate::tools::PermissionLevel;+use tinytools::PermissionLevel;use super::request::ParallelAgentTask;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/scout_run.rs b/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/scout_run.rsindex 8295e46da1..3118bb4306 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/scout_run.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/scout_run.rs@@ -11,8 +11,8 @@ use crate::agent::progress::AgentProgress;use crate::agent::tinyagents::thread_context::current_thread_id;use crate::core::bus::BUS;use crate::core::events::DomainEvent;-use crate::tools::traits::ToolResult;use tinyagents_harness::workspace::WorkspaceDescriptor;+use tinytools::ToolResult;use super::tool::AgentPrepareContextTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/tool.rs b/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/tool.rsindex 2c34bfc94d..80e4ec4b05 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/tool.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/tool.rs@@ -5,10 +5,10 @@use std::fmt::Write as _;use crate::agent::harness::fork_context::{current_agent_context_prepared_sources, current_parent};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use super::scout_run::{already_prepared_context_bundle, run_context_scout_with_catalog_and_workspace,@@ -51,12 +51,12 @@ impl AgentPrepareContextTool {return String::new();};let visible = &parent.visible_tool_names;- let specs: &[std::sync::Arc<crate::tools::ToolSpec>] =- if parent.visible_tool_specs.is_empty() {- &parent.all_tool_specs- } else {- &parent.visible_tool_specs- };+ let specs: &[std::sync::Arc<tinytools::ToolSpec>] = if parent.visible_tool_specs.is_empty()+ {+ &parent.all_tool_specs+ } else {+ &parent.visible_tool_specs+ };let mut out = String::with_capacity(2048);for spec in specs.iter() {if spec.name == "agent_prepare_context" {diff --git a/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context_tests.rsindex 61651c8489..8cec35dfc5 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context_tests.rs@@ -2,8 +2,8 @@ use super::*;use crate::agent::harness::AgentContextPreparedSource;use crate::agent::harness::SubagentRunError;-use crate::tools::Tool;use serde_json::json;+use tinytools::Tool;#[test]fn schema_requires_question_and_makes_focus_optional() {let tool = AgentPrepareContextTool::new();@@ -329,8 +329,8 @@ fn credits_exhausted_scout_failure_does_not_reach_sentry() {// ─────────────────────────────────────────────────────────────────────────────/// A spec with the given name and description; the schema is irrelevant here.-fn catalog_spec(name: &str, description: &str) -> std::sync::Arc<crate::tools::ToolSpec> {- std::sync::Arc::new(crate::tools::ToolSpec {+fn catalog_spec(name: &str, description: &str) -> std::sync::Arc<tinytools::ToolSpec> {+ std::sync::Arc::new(tinytools::ToolSpec {name: name.to_string(),description: description.to_string(),parameters: serde_json::json!({"type": "object"}),@@ -342,8 +342,8 @@ fn catalog_spec(name: &str, description: &str) -> std::sync::Arc<crate::tools::T/// `visible_tool_names` is derived from the visible specs, as the turn/// builder derives it.fn parent_context_with_specs(- all_tool_specs: Vec<std::sync::Arc<crate::tools::ToolSpec>>,- visible_tool_specs: Vec<std::sync::Arc<crate::tools::ToolSpec>>,+ all_tool_specs: Vec<std::sync::Arc<tinytools::ToolSpec>>,+ visible_tool_specs: Vec<std::sync::Arc<tinytools::ToolSpec>>,) -> crate::agent::harness::fork_context::ParentExecutionContext {use std::sync::Arc;let workspace = tempfile::TempDir::new().expect("temp workspace");@@ -377,7 +377,7 @@ fn parent_context_with_specs(session_id: "parent-session".into(),channel: "test".into(),connected_integrations: Vec::new(),- tool_call_format: crate::agent::context::prompt::ToolCallFormat::Native,+ tool_call_format: crate::agent::prompts::ToolCallFormat::Native,session_key: "parent-key".into(),session_parent_prefix: None,on_progress: None,diff --git a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rsindex e1348a0a02..a5d5e7a1bb 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs@@ -2,15 +2,15 @@ use async_trait::async_trait;use serde_json::json;use serde_json::Value;-use crate::tools::traits::{+use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolExposure, ToolResult, ToolTimeout,};-use tinytools::ToolRunContext;pub struct ArchetypeDelegationTool {pub tool_name: String,/// The agent this tool routes to, in the shape- /// [`crate::tools::traits::delegation_target`] reads back off the+ /// [`crate::tools::host_extensions::delegation_target`] reads back off the/// erased host-extension slot.////// A newtype rather than a bare `String` because that slot is one `Any` perdiff --git a/crates/openhuman-core/src/agent/orchestration/tools/close_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/close_subagent.rsindex 7e3822eb7a..6d8933b667 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/close_subagent.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/close_subagent.rs@@ -3,9 +3,9 @@use crate::agent::harness::fork_context::current_parent;use crate::agent::orchestration::subagent_sessions::SubagentSessionStore;use crate::agent::orchestration::{running_subagents, subagent_sessions};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct CloseSubagentTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/close_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/close_subagent_tests.rsindex 451d035fd1..27f23ba99a 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/close_subagent_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/close_subagent_tests.rs@@ -1,6 +1,6 @@use super::*;-use crate::agent::context::prompt::ToolCallFormat;use crate::agent::harness::fork_context::{with_parent_context, ParentExecutionContext};+use crate::agent::prompts::ToolCallFormat;use crate::config::AgentConfig;use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};use std::collections::HashSet;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation.rs b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation.rsindex 2afee5a819..4cce3958c2 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation.rs@@ -58,16 +58,14 @@//! [`DelegateTool`]: crate::agent::tools::DelegateTool//! [`ArchetypeDelegationTool`]: super::ArchetypeDelegationTool//! [`SkillDelegationTool`]: super::SkillDelegationTool-//! [`ToolExposure::Hidden`]: crate::tools::traits::ToolExposure::Hidden+//! [`ToolExposure::Hidden`]: tinytools::ToolExposure::Hiddenuse async_trait::async_trait;use serde_json::{json, Value};use super::archetype_delegation::{delegation_envelope_properties, render_structured_handoff};-use crate::tools::traits::{- PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult, ToolTimeout,-};use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult, ToolTimeout};/// The advertised name. A constant so the synthesis site, the prompt's/// delegation section and the tests cannot disagree about it.diff --git a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_tests.rsindex fcd596080e..76847746ab 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/collapsed_delegation_tests.rs@@ -7,7 +7,7 @@use super::*;use crate::agent::orchestration::tools::ArchetypeDelegationTool;-use crate::tools::traits::ToolExposure;+use tinytools::ToolExposure;fn targets() -> Vec<DelegateTarget> {vec![@@ -205,7 +205,7 @@ fn the_timeout_is_unbounded_like_the_members_it_replaces() {// `Unbounded` on `ArchetypeDelegationTool` in the first place.assert!(matches!(tool().timeout_policy(&serde_json::json!({})),- crate::tools::traits::ToolTimeout::Unbounded+ tinytools::ToolTimeout::Unbounded));}diff --git a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rsindex 58c0bbe22f..cb3971d335 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs@@ -15,10 +15,10 @@ use crate::agent::harness::subagent_runner::{};use crate::agent::messages::ChatMessage;use crate::agent::progress::AgentProgress;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};pub struct ContinueSubagentTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rsindex ce60943337..49e76c84c4 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs@@ -13,11 +13,11 @@use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::orchestration::delegation::run_subagent_delegation;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};/// Default reviewer-requested revision budget when the caller omits it.const DEFAULT_MAX_REVISIONS: usize = 2;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs b/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rsindex 75b3465ebe..11635cda50 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/dispatch.rs@@ -4,8 +4,8 @@ use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::fork_context::current_parent;use crate::agent::harness::subagent_runner::{run_subagent, SubagentRunOptions, SubagentRunStatus};use crate::agent::progress::AgentProgress;-use crate::tools::traits::{Tool as _, ToolCallOptions, ToolResult};use tinytools::ToolRunContext;+use tinytools::{Tool as _, ToolCallOptions, ToolResult};/// How a delegated sub-agent run should be scheduled relative to the parent/// turn.diff --git a/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rsindex c949204ca2..eb1a195ff8 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/dispatch_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::Tool;+use tinytools::Tool;use crate::agent::tools::AskClarificationTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/list_subagents.rs b/crates/openhuman-core/src/agent/orchestration/tools/list_subagents.rsindex 986201a7fb..d23f53286c 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/list_subagents.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/list_subagents.rs@@ -7,10 +7,10 @@ use crate::agent::orchestration::{self, DurableSubagentSessionSummary, DurableSubagentStatus, SubagentSessionStore,},};-use crate::agent::tinyagents::orchestration::{OrchestrationTaskRecord, OrchestrationTaskStatus};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinyagents_graph::orchestration::{OrchestrationTaskRecord, OrchestrationTaskStatus};+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct ListSubagentsTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/skill_delegation.rs b/crates/openhuman-core/src/agent/orchestration/tools/skill_delegation.rsindex 1bada95f45..71b6161f51 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/skill_delegation.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/skill_delegation.rs@@ -20,8 +20,8 @@ use async_trait::async_trait;use serde_json::json;use crate::tools::orchestrator_tools::sanitise_slug;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};/// Canonical tool name surfaced to the orchestrator LLM.pub const INTEGRATIONS_DELEGATE_TOOL_NAME: &str = "delegate_to_integrations_agent";diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rsindex 1df545addb..d5da9f5ec3 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs@@ -16,10 +16,10 @@ use crate::agent::orchestration::subagent_sessions::{};use crate::agent::progress::AgentProgress;use crate::memory::conversations::{self as conversations, ConversationMessage};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};pub struct SpawnAsyncSubagentTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rsindex e86bce9f87..a6e3944875 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs@@ -1,7 +1,7 @@use super::*;-use crate::agent::context::prompt::ToolCallFormat;use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::fork_context::{with_parent_context, ParentExecutionContext};+use crate::agent::prompts::ToolCallFormat;use crate::config::AgentConfig;use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};use std::collections::HashSet;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rsindex 5273167b44..26c721eec2 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs@@ -14,10 +14,10 @@ use crate::agent::orchestration::spawn_parallel_graph::{SpawnParallelGraphOutcome, SpawnParallelTaskValidationError,};use crate::agent::tinyagents::current_run_cancellation;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};use async_trait::async_trait;use serde_json::json;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};pub struct SpawnParallelAgentsTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rsindex df5f711a55..9157e4bb6d 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs@@ -1,5 +1,4 @@use super::*;-use crate::agent::context::prompt::ToolCallFormat;use crate::agent::dispatcher::NativeToolDispatcher;use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::definition::{@@ -11,11 +10,10 @@ use crate::agent::orchestration::spawn_parallel_graph::{prepare_spawn_parallel_tasks_from_defs, ParallelTaskRejectionKind, SpawnParallelTaskPreflight,WorkerDispatchMode,};+use crate::agent::prompts::ToolCallFormat;use crate::agent::Agent;use crate::config::AgentConfig;use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};-use crate::tools::traits::ToolTimeout;-use crate::tools::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use parking_lot::Mutex;use serde_json::json;@@ -27,6 +25,8 @@ use std::sync::{use tinyinference_llm::message::{AssistantMessage, Message};use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};use tinyinference_llm::tool::ToolCall;+use tinytools::ToolTimeout;+use tinytools::{PermissionLevel, Tool, ToolResult};use tokio::time::{sleep, timeout, Duration};const PARENT_PROMPT_CANARY: &str = "parallel-fanout-e2e-canary";diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rsindex 5a9ada1b43..97cdb3a66c 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent.rs@@ -21,11 +21,11 @@ use crate::agent::progress::AgentProgress;use crate::memory::conversations::{self as conversations, ConversationMessage, CreateConversationThread,};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::PathBuf;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};/// Spawns a sub-agent of the requested type to handle a delegated task.///diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rsindex eb1d62dd90..f15926946f 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs@@ -224,7 +224,7 @@ impl Tool for SpawnSubagentTool {// unreachable, …) so offline behaviour is unchanged.let parent_ctx = current_parent();let live_integrations: Vec<- crate::agent::context::prompt::ConnectedIntegration,+ crate::agent::prompts::ConnectedIntegration,> = {match crate::config::Config::load_or_init().await {Ok(config) => {@@ -273,7 +273,7 @@ impl Tool for SpawnSubagentTool {}}};- let allowlist: Vec<&crate::agent::context::prompt::ConnectedIntegration> =+ let allowlist: Vec<&crate::agent::prompts::ConnectedIntegration> =live_integrations.iter().collect();let connected_slugs: Vec<String> = allowlist.iter()diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rsindex f93789b80a..c63811b0cf 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs@@ -13,10 +13,10 @@ use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::fork_context::current_parent;use crate::agent::harness::subagent_runner::{run_subagent, SubagentRunOptions};use crate::memory::conversations;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};/// Spawns a sub-agent in a dedicated worker thread.pub struct SpawnWorkerThreadTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rsindex 3a9adab531..697a97f4eb 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs@@ -84,7 +84,7 @@ fn test_parent_ctx(workspace_dir: PathBuf) -> ParentExecutionContext {on_progress: None,run_queue: None,agent_config: crate::config::AgentConfig::default(),- tool_call_format: crate::agent::context::prompt::ToolCallFormat::Native,+ tool_call_format: crate::agent::prompts::ToolCallFormat::Native,}}diff --git a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rsindex 879efcf546..75f337f8df 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs@@ -10,9 +10,9 @@use crate::agent::harness::fork_context::current_parent;use crate::agent::harness::run_queue::QueueMode;use crate::agent::orchestration::running_subagents::{self, SteerError};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct SteerSubagentTool;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rsindex d6dc0cb52f..f93545f5b6 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs@@ -2,13 +2,12 @@ use super::{ArchetypeDelegationTool, DelegationTarget, SkillDelegationTool, SpawnSubagentTool,SpawnWorkerThreadTool,};-use crate::agent::context::prompt::{ConnectedIntegration, ToolCallFormat};use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::{with_parent_context, ParentExecutionContext};use crate::agent::messages::ChatMessage;+use crate::agent::prompts::{ConnectedIntegration, ToolCallFormat};use crate::memory::conversations;use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};-use crate::tools::Tool;use async_trait::async_trait;use parking_lot::Mutex;use serde_json::json;@@ -16,6 +15,7 @@ use std::path::Path;use std::sync::Arc;use tinyinference_llm::message::Message;use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};+use tinytools::Tool;const SPAWN_SUBAGENT_CANARY: &str = "tool-e2e-spawn-subagent-canary";const ARCHETYPE_DELEGATION_CANARY: &str = "tool-e2e-archetype-delegation-canary";diff --git a/crates/openhuman-core/src/agent/orchestration/tools/wait.rs b/crates/openhuman-core/src/agent/orchestration/tools/wait.rsindex 1d0ae89696..c0a02dbb83 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/wait.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/wait.rs@@ -7,9 +7,9 @@use std::time::Duration;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult, ToolTimeout};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult, ToolTimeout};const DEFAULT_DURATION_SECS: u64 = 5;const MAX_DURATION_SECS: u64 = 600;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent.rsindex 73d2dae1a9..084503f769 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/wait_subagent.rs@@ -11,9 +11,9 @@ use crate::agent::harness::fork_context::current_parent;use crate::agent::orchestration::running_subagents::{self, SubagentStatus, WaitError, WaitOutcome,};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult, ToolTimeout};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult, ToolTimeout};const DEFAULT_TIMEOUT_SECS: u64 = 120;/// Ceiling on a single wait. Matches Codex's `wait_agent` maximum of one hour:diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine_tests.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine_tests.rsindex 81e8c675a1..84564aceb1 100644--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine_tests.rs@@ -24,15 +24,15 @@ use super::*;// The phase scheduler moved to the tinyagents-backed `graph` submodule in #4249;// its signature is unchanged (`drive_phases(config, run_id, definition, cancel)`).use super::super::graph::drive_phases;-use crate::agent::context::prompt::ToolCallFormat;use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::fork_context::{with_parent_context, ParentExecutionContext};+use crate::agent::prompts::ToolCallFormat;use crate::config::{AgentConfig, Config};use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};-use crate::tools::Tool;use tinyagents_session::run_ledger::WorkflowRunStatus;use tinyagents_session::run_ledger::{get_workflow_run, upsert_workflow_run, WorkflowRunUpsert};use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};+use tinytools::Tool;use super::super::types::{WorkflowDefinition, WorkflowPhase, WorkflowSafetyTier};diff --git a/crates/openhuman-core/src/agent/pformat.rs b/crates/openhuman-core/src/agent/pformat.rsdeleted file mode 100644index 48f7c02fa9..0000000000--- a/crates/openhuman-core/src/agent/pformat.rs+++ /dev/null@@ -1,66 +0,0 @@-//! P-format tool calls — OpenHuman's adapter over-//! [`tinyagents_harness::tool_calling::pformat`].-//!-//! The format itself — the positional `name[arg|arg]` grammar, the schema-driven-//! argument reconstruction, the type coercion, the escape handling — lives in the-//! crate. What stays here is the part that speaks OpenHuman's own tool-//! vocabulary.-//!-//! # Why the crate takes schemas and this takes tools-//!-//! `build_registry` upstream takes `(name, schema)` pairs rather than a tool-//! trait object. A host's tool type is its own vocabulary, and a crate that-//! depended on it could not be used by a second host — which is the whole point-//! of the seam. So the two functions below are the adapter: they read-//! [`Tool::name`] and [`Tool::parameters_schema`] and hand the crate exactly the-//! two things it needs.-//!-//! Everything else is re-exported unchanged, so existing `pformat::…` call sites-//! keep working.--use crate::tools::Tool;--pub use tinyagents_harness::tool_calling::{- parse_call, render_signature, render_signature_from_schema, PFormatParamType, PFormatRegistry,- PFormatToolParams,-};--/// Build a [`PFormatRegistry`] from the agent's tool slice.-///-/// Call once at construction time, before the tools are moved into the agent —-/// the result is owned and self-contained, so it survives the move without-/// keeping a reference back to the live `Vec<Box<dyn Tool>>` the agent owns.-///-/// The registry is also the safety boundary the format depends on: the parser-/// refuses to invent argument names for a tool it does not know, so a model-/// cannot tunnel arbitrary JSON through by guessing a tool name that does not-/// exist. A registry built from anything other than the agent's real tools-/// would widen that.-pub fn build_registry(tools: &[Box<dyn Tool>]) -> PFormatRegistry {- build_registry_from_refs(tools.iter().map(|t| t.as_ref()))-}--/// [`build_registry`] over any iterator of borrowed tools.-///-/// A session agent's surface is two sets — the durable registry and the-/// synthesised delegation set (`Agent::synthesized_tools`) — that cannot be-/// merged into one owned slice, since `Box<dyn Tool>` is not cloneable.-pub fn build_registry_from_refs<'a>(- tools: impl IntoIterator<Item = &'a dyn Tool>,-) -> PFormatRegistry {- tinyagents_harness::tool_calling::build_registry(- tools.into_iter().map(|t| (t.name(), t.parameters_schema())),- )-}--/// Render a single tool's p-format signature, e.g. `get_weather[location|unit]`.-///-/// This signature goes into the tool catalogue in the system prompt, telling the-/// model exactly how to order positional arguments.-pub fn render_signature_from_tool(tool: &dyn Tool) -> String {- render_signature_from_schema(tool.name(), &tool.parameters_schema())-}--#[cfg(test)]-#[path = "pformat_tests.rs"]-mod tests;diff --git a/crates/openhuman-core/src/agent/pformat_tests.rs b/crates/openhuman-core/src/agent/pformat_tests.rsindex 58d308f05e..b1869120dd 100644--- a/crates/openhuman-core/src/agent/pformat_tests.rs+++ b/crates/openhuman-core/src/agent/pformat_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::ToolResult;+use tinytools::ToolResult;use async_trait::async_trait;struct StubTool(&'static str);diff --git a/crates/openhuman-core/src/agent/plan_review/tool.rs b/crates/openhuman-core/src/agent/plan_review/tool.rsindex 2fe8227093..3ea37583db 100644--- a/crates/openhuman-core/src/agent/plan_review/tool.rs+++ b/crates/openhuman-core/src/agent/plan_review/tool.rs@@ -13,7 +13,7 @@ use serde_json::json;use crate::agent::turn_origin::{self, AgentTurnOrigin};use crate::security::approval::APPROVAL_CHAT_CONTEXT;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult, ToolTimeout};+use tinytools::{PermissionLevel, Tool, ToolResult, ToolTimeout};use super::gate;use super::types::PlanReviewResolution;diff --git a/crates/openhuman-core/src/agent/profiles/prompt_section.rs b/crates/openhuman-core/src/agent/profiles/prompt_section.rsindex 2087568b2c..52542ada64 100644--- a/crates/openhuman-core/src/agent/profiles/prompt_section.rs+++ b/crates/openhuman-core/src/agent/profiles/prompt_section.rs@@ -4,7 +4,7 @@use std::path::Path;-use crate::agent::context::prompt::{PromptContext, PromptSection};+use crate::agent::prompts::{PromptContext, PromptSection};use anyhow::Result;/// One-sentence system-prompt notice, mirroring hermes's cross-profilediff --git a/crates/openhuman-core/src/agent/profiles/prompt_section_tests.rs b/crates/openhuman-core/src/agent/profiles/prompt_section_tests.rsindex 0da3a209f8..5fe66a489f 100644--- a/crates/openhuman-core/src/agent/profiles/prompt_section_tests.rs+++ b/crates/openhuman-core/src/agent/profiles/prompt_section_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, PromptContext, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, PromptContext, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/progress.rs b/crates/openhuman-core/src/agent/progress.rsindex a50e4984f5..9c80c85482 100644--- a/crates/openhuman-core/src/agent/progress.rs+++ b/crates/openhuman-core/src/agent/progress.rs@@ -39,7 +39,7 @@ pub enum AgentProgress {iteration: u32,/// Server-computed human label for the chat processing timeline/// (e.g. "Reading messages"), or `None` to defer to the client- /// formatter. Set from [`crate::tools::traits::Tool::display_label`].+ /// formatter. Set from [`tinytools::Tool::display_label`].display_label: Option<String>,/// Server-computed contextual detail shown after the label/// (e.g. "[email protected]"), from `Tool::display_detail`.diff --git a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rsindex a07a779885..c375c447dd 100644--- a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs+++ b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs@@ -239,7 +239,7 @@ fn observation_to_progress(obs: &AgentObservation, state: &mut ReplayState) -> V));let label = format!("{} (unavailable)",- crate::tools::traits::humanize_tool_name(requested_name)+ tinytools::humanize_tool_name(requested_name));let detail = Some("tool not available".to_string());match state.active_subagent() {diff --git a/crates/openhuman-core/src/agent/prompts/agents_md.rs b/crates/openhuman-core/src/agent/prompts/agents_md.rsindex 41018a4674..76934eba6d 100644--- a/crates/openhuman-core/src/agent/prompts/agents_md.rs+++ b/crates/openhuman-core/src/agent/prompts/agents_md.rs@@ -10,12 +10,12 @@//! `worktree_action_dir` override, that override dir is the local layer.//!//! The loaded strings are threaded into-//! [`crate::agent::context::prompt::PromptContext`] and rendered by+//! [`crate::agent::prompts::PromptContext`] and rendered by//! `AgentsInstructionsSection` **once at system-prompt build time** — never//! re-read per turn — so the frozen system-prompt prefix / KV-cache contract is//! preserved. Missing, unreadable, or empty files are silently skipped. The//! renderer caps each layer at-//! [`crate::agent::context::prompt::BOOTSTRAP_MAX_CHARS`] with a+//! [`crate::agent::prompts::BOOTSTRAP_MAX_CHARS`] with a//! `[... truncated]` marker.use super::types::BOOTSTRAP_MAX_CHARS;diff --git a/crates/openhuman-core/src/agent/prompts/mod.rs b/crates/openhuman-core/src/agent/prompts/mod.rsindex 81e7ae52f4..78cdedaf2c 100644--- a/crates/openhuman-core/src/agent/prompts/mod.rs+++ b/crates/openhuman-core/src/agent/prompts/mod.rs@@ -1,6 +1,6 @@//! Bundled prompt assets and system-prompt rendering pipeline. See//! [`README.md`](README.md) for the section/builder model and the-//! `agent::context::prompt` compat shim.+//! `agent::prompts`.pub mod types;pub use types::*;diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests.rsindex bf45ca4c8e..74b59d6b20 100644--- a/crates/openhuman-core/src/agent/prompts/mod_tests.rs+++ b/crates/openhuman-core/src/agent/prompts/mod_tests.rs@@ -1,9 +1,9 @@use super::*;-use crate::tools::traits::Tool;use async_trait::async_trait;use std::collections::HashSet;use std::path::Path;use std::sync::LazyLock;+use tinytools::Tool;static NO_FILTER: LazyLock<HashSet<String>> = LazyLock::new(HashSet::new);@@ -41,8 +41,8 @@ impl Tool for TestTool {serde_json::json!({"type": "object"})}- async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<crate::tools::ToolResult> {- Ok(crate::tools::ToolResult::success("ok"))+ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("ok"))}}diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rsindex 77d8be67b5..91e04210df 100644--- a/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs+++ b/crates/openhuman-core/src/agent/prompts/mod_tests_builder_sections_tests.rs@@ -438,11 +438,8 @@ fn tools_section_pformat_renders_signature_not_schema() {}})}- async fn execute(- &self,- _args: serde_json::Value,- ) -> anyhow::Result<crate::tools::ToolResult> {- Ok(crate::tools::ToolResult::success("ok"))+ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("ok"))}}@@ -501,11 +498,8 @@ fn tools_section_renders_invalid_schema_tool_without_arguments() {serde_json::Value::String("not JSON schema text".to_string())}- async fn execute(- &self,- _args: serde_json::Value,- ) -> anyhow::Result<crate::tools::ToolResult> {- Ok(crate::tools::ToolResult::success("ok"))+ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("ok"))}}diff --git a/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs b/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rsindex 5cf4b08537..ec1f33d20b 100644--- a/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs+++ b/crates/openhuman-core/src/agent/prompts/render_helpers/subagent.rs@@ -57,8 +57,8 @@ pub fn render_subagent_system_prompt(workspace_dir: &Path,model_name: &str,allowed_indices: &[usize],- parent_tools: &[Box<dyn crate::tools::Tool>],- extra_tools: &[Box<dyn crate::tools::Tool>],+ parent_tools: &[Box<dyn tinytools::Tool>],+ extra_tools: &[Box<dyn tinytools::Tool>],archetype_body: &str,options: SubagentRenderOptions,tool_call_format: ToolCallFormat,@@ -95,8 +95,8 @@ pub fn render_subagent_system_prompt_with_format(workspace_dir: &Path,model_name: &str,allowed_indices: &[usize],- parent_tools: &[Box<dyn crate::tools::Tool>],- extra_tools: &[Box<dyn crate::tools::Tool>],+ parent_tools: &[Box<dyn tinytools::Tool>],+ extra_tools: &[Box<dyn tinytools::Tool>],archetype_body: &str,options: SubagentRenderOptions,tool_call_format: ToolCallFormat,@@ -197,7 +197,7 @@ pub fn render_subagent_system_prompt_with_format(// `extra_tools` — or the model has no way to know they exist.if !matches!(tool_call_format, ToolCallFormat::Native) {out.push_str("## Tools\n\n");- let render_one = |out: &mut String, tool: &dyn crate::tools::Tool| match tool_call_format {+ let render_one = |out: &mut String, tool: &dyn tinytools::Tool| match tool_call_format {ToolCallFormat::PFormat => {let sig = render_pformat_signature_for_box_tool(tool);let _ = writeln!(@@ -325,7 +325,7 @@ pub fn render_subagent_system_prompt_with_format(/// Used by `render_subagent_system_prompt` which operates on `Box<dyn Tool>`/// directly (no intermediate `PromptTool`). Mirrors the `PromptTool` variant/// below — both BTreeMap-iterate the schema's `properties` in the same order.-fn render_pformat_signature_for_box_tool(tool: &dyn crate::tools::Tool) -> String {+fn render_pformat_signature_for_box_tool(tool: &dyn tinytools::Tool) -> String {let schema = tool.parameters_schema();let names: Vec<String> = schema.get("properties")diff --git a/crates/openhuman-core/src/agent/prompts/sections.rs b/crates/openhuman-core/src/agent/prompts/sections.rsindex e2c5e6f114..e4b08cd372 100644--- a/crates/openhuman-core/src/agent/prompts/sections.rs+++ b/crates/openhuman-core/src/agent/prompts/sections.rs@@ -12,8 +12,8 @@ use super::render_helpers::{use super::types::*;use anyhow::Result;use std::fmt::Write;-use tinyagents_harness::tool_calling::dialect::render_pformat_catalogue;use tinytools::ToolSpec;+use tinytools_agent::dialect::render_pformat_catalogue;// ─────────────────────────────────────────────────────────────────────────────// Special sections (archetype, dynamic, reflection)diff --git a/crates/openhuman-core/src/agent/prompts/types.rs b/crates/openhuman-core/src/agent/prompts/types.rsindex e9088903b9..04d5558c08 100644--- a/crates/openhuman-core/src/agent/prompts/types.rs+++ b/crates/openhuman-core/src/agent/prompts/types.rs@@ -7,10 +7,10 @@//! renderer.use crate::skills::Workflow;-use crate::tools::Tool;use anyhow::Result;use chrono::{DateTime, Utc};use std::path::Path;+use tinytools::Tool;// ─────────────────────────────────────────────────────────────────────────────// Constantsdiff --git a/crates/openhuman-core/src/agent/registry/agents/archivist/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/archivist/prompt.rsindex 8e8e96e972..b79c84a734 100644--- a/crates/openhuman-core/src/agent/registry/agents/archivist/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/archivist/prompt.rs@@ -1,13 +1,11 @@//! System prompt builder for the `archivist` built-in agent.//!//! Returns the fully-assembled system prompt. Each agent's `build()`-//! composes section helpers from [`crate::agent::context::prompt`]+//! composes section helpers from [`crate::agent::prompts`]//! in the order it wants — so the output IS what the LLM sees, no//! post-processing in the runner.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/archivist/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/archivist/prompt_tests.rsindex 41f72e542c..67a958a444 100644--- a/crates/openhuman-core/src/agent/registry/agents/archivist/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/archivist/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/code_executor/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/code_executor/prompt.rsindex 8a9f278f5d..f645d253bb 100644--- a/crates/openhuman-core/src/agent/registry/agents/code_executor/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/code_executor/prompt.rs@@ -5,7 +5,7 @@//! in its TOML — it executes code or external actions and needs the//! guard rails inlined).-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/code_executor/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/code_executor/prompt_tests.rsindex 81f39aca30..e263148216 100644--- a/crates/openhuman-core/src/agent/registry/agents/code_executor/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/code_executor/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt.rsindex 3024b2289b..1395ab5348 100644--- a/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt.rs@@ -10,7 +10,7 @@//! `AgentPrepareContextTool`, not here — this builder only describes the//! scout's own gathering surface.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, ConnectedIntegration, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt_tests.rsindex ab869d0cd0..62b1893d71 100644--- a/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/context_scout/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;fn test_ctx() -> PromptContext<'static> {diff --git a/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rsindex 45ca5fddd7..c50cdb8146 100644--- a/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/critic/prompt.rs@@ -4,9 +4,7 @@//! (from the sibling `prompt.md`) plus the same section helpers the//! runtime uses for every other agent.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/critic/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/critic/prompt_tests.rsindex 9d079cdebc..314866ca7b 100644--- a/crates/openhuman-core/src/agent/registry/agents/critic/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/critic/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt.rsindex 5a0596e57c..94edf52af6 100644--- a/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt.rs@@ -7,7 +7,7 @@//! skills catalogue and global memory context are omitted — they would//! dilute the financial-safety voice the archetype establishes.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt_tests.rsindex d5a26eca00..db373be176 100644--- a/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/crypto_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;fn empty_ctx() -> PromptContext<'static> {diff --git a/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt.rsindex 784e0670d0..e0cb442473 100644--- a/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt.rs@@ -8,9 +8,7 @@//! answers in *who the user is and what they want* is this agent's whole//! job), its own read-only tool catalogue, and the workspace block.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt_tests.rsindex e97326c720..5dfa4a2cb4 100644--- a/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/flow_memory_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;fn test_ctx() -> PromptContext<'static> {diff --git a/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt.rsindex aec81400e7..aeda97ce12 100644--- a/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt.rs@@ -4,9 +4,7 @@//! user-files, tools, and workspace sections so the returned string IS what//! the LLM sees.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt_tests.rsindex 4837f11746..a4c58ff97d 100644--- a/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/goals_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/help/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/help/prompt.rsindex a6427f9398..ddf0d07e83 100644--- a/crates/openhuman-core/src/agent/registry/agents/help/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/help/prompt.rs@@ -4,9 +4,7 @@//! — render the archetype, then the standard tools + workspace blocks//! so the model sees the `gitbooks_*` schemas the runtime injected.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/help/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/help/prompt_tests.rsindex 9c096cdbac..f68a32bc1e 100644--- a/crates/openhuman-core/src/agent/registry/agents/help/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/help/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rsindex 4388e9c837..4fe0ffed93 100644--- a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt.rs@@ -3,9 +3,7 @@//! Returns the final, fully-assembled system prompt — archetype body (from the//! sibling `prompt.md`) plus the shared section helpers every agent uses.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rsindex d3dd996bcc..9f3a3b4855 100644--- a/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/image_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt.rsindex 2422317938..587350bfe5 100644--- a/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt.rs@@ -20,7 +20,7 @@//! agents stay lean and the integrations_agent-specific wording isn't a branch//! on `agent_id` somewhere else.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, ConnectedIntegration,PromptContext,};diff --git a/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt_tests.rsindex aef0afa70e..8406aa86e6 100644--- a/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;fn ctx_with<'a>(integrations: &'a [ConnectedIntegration]) -> PromptContext<'a> {diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rsindex 90133dfa5b..3fc2a8c172 100644--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs@@ -176,7 +176,7 @@ fn coding_agent_prompts_reference_action_sandbox_not_stale_workspace() {#[test]fn every_builtin_has_a_prompt_body() {- use crate::agent::context::prompt::{+ use crate::agent::prompts::{ConnectedIntegration, LearnedContextData, PromptContext, PromptTool, ToolCallFormat,};let empty_tools: Vec<PromptTool<'_>> = Vec::new();diff --git a/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt.rsindex d1790eb618..08af40ef4a 100644--- a/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt.rs@@ -6,9 +6,7 @@//! This agent *uses* already-connected MCP servers; `mcp_setup` *installs*//! them.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt_tests.rsindex a2664f343d..1e95f282ad 100644--- a/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/mcp_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;fn empty_ctx() -> PromptContext<'static> {diff --git a/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt.rsindex 93ad5aaf4b..6404a956dc 100644--- a/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt.rs@@ -5,9 +5,7 @@//! plus `ask_user_clarification` (filtered down by the harness from the//! `agent.toml` allowlist).-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt_tests.rsindex 5da49683fb..54c6010192 100644--- a/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/mcp_setup/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;fn empty_ctx() -> PromptContext<'static> {diff --git a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rsindex 471b942dea..103ed864e0 100644--- a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt.rs@@ -1,11 +1,11 @@//! System prompt builder for the `morning_briefing` built-in agent.//!//! Returns the fully-assembled system prompt. Each agent's `build()`-//! composes section helpers from [`crate::agent::context::prompt`]+//! composes section helpers from [`crate::agent::prompts`]//! in the order it wants — so the output IS what the LLM sees, no//! post-processing in the runner.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_ambient_environment, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt_tests.rsindex f81c97e3a7..759282853b 100644--- a/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/morning_briefing/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat, UserIdentity};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat, UserIdentity};use std::collections::HashSet;fn ctx_with_identity(identity: Option<UserIdentity>) -> PromptContext<'static> {diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rsindex 975c344617..cb9a585722 100644--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs@@ -11,12 +11,12 @@//! `integrations_agent/prompt.rs` and nobody has to branch on `agent_id`//! in a shared section impl.-use crate::agent::context::prompt::{+use crate::agent::harness::definition::SubagentEntry;+use crate::agent::harness::AgentDefinitionRegistry;+use crate::agent::prompts::{render_datetime, render_identity, render_tools, render_user_files, render_workspace,ConnectedIntegration, PromptContext, ToolCallFormat,};-use crate::agent::harness::definition::SubagentEntry;-use crate::agent::harness::AgentDefinitionRegistry;use crate::skills::ops_types::Workflow;use crate::tools::orchestrator_tools::sanitise_slug;use crate::tools::toolpacks;diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rsindex 6a1c335a18..937f325bd5 100644--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rsindex 6a158e278d..966732a7e7 100644--- a/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/planner/prompt.rs@@ -1,11 +1,11 @@//! System prompt builder for the `planner` built-in agent.//!//! Returns the fully-assembled system prompt. Each agent's `build()`-//! composes section helpers from [`crate::agent::context::prompt`]+//! composes section helpers from [`crate::agent::prompts`]//! in the order it wants — so the output IS what the LLM sees, no//! post-processing in the runner.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_datetime, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/planner/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/planner/prompt_tests.rsindex 2acd046e23..72a205214a 100644--- a/crates/openhuman-core/src/agent/registry/agents/planner/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/planner/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rsindex 9ecc4c8afc..5ddbfd2f02 100644--- a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt.rs@@ -1,8 +1,6 @@//! System prompt builder for the `presentation_agent` built-in agent.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rsindex 4c532288b7..68783cc7ff 100644--- a/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/presentation_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/profile_memory_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/profile_memory_agent/prompt.rsindex 5933542be6..6487ea8a42 100644--- a/crates/openhuman-core/src/agent/registry/agents/profile_memory_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/profile_memory_agent/prompt.rs@@ -1,6 +1,6 @@//! System prompt builder for the `profile_memory_agent` built-in agent.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/researcher/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/researcher/prompt.rsindex 15e77412ba..d867d2089c 100644--- a/crates/openhuman-core/src/agent/registry/agents/researcher/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/researcher/prompt.rs@@ -1,11 +1,11 @@//! System prompt builder for the `researcher` built-in agent.//!//! Returns the fully-assembled system prompt. Each agent's `build()`-//! composes section helpers from [`crate::agent::context::prompt`]+//! composes section helpers from [`crate::agent::prompts`]//! in the order it wants — so the output IS what the LLM sees, no//! post-processing in the runner.-use crate::agent::context::prompt::{render_tools, render_user_files, PromptContext};+use crate::agent::prompts::{render_tools, render_user_files, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/researcher/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/researcher/prompt_tests.rsindex 9a12bcf122..66db3b6a2f 100644--- a/crates/openhuman-core/src/agent/registry/agents/researcher/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/researcher/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt.rsindex eb5d2c099a..a3916be819 100644--- a/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt.rs@@ -1,8 +1,6 @@//! System prompt builder for the `scheduler_agent` built-in agent.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt_tests.rsindex 5100908287..716a90f856 100644--- a/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/scheduler_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/settings_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/settings_agent/prompt.rsindex 7bf0c1e46f..cdb0e2abe8 100644--- a/crates/openhuman-core/src/agent/registry/agents/settings_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/settings_agent/prompt.rs@@ -1,6 +1,6 @@//! System prompt builder for the `settings_agent` built-in agent.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt.rsindex 3a8b2c7b02..b23d6552d0 100644--- a/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt.rs@@ -1,6 +1,6 @@//! System prompt builder for the `skill_creator` built-in agent.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt_tests.rsindex 049ec31df2..642f570139 100644--- a/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/skill_creator/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rsindex 127f0b881c..dafe0f8e53 100644--- a/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt.rs@@ -1,13 +1,11 @@//! System prompt builder for the `summarizer` built-in agent.//!//! Returns the fully-assembled system prompt. Each agent's `build()`-//! composes section helpers from [`crate::agent::context::prompt`]+//! composes section helpers from [`crate::agent::prompts`]//! in the order it wants — so the output IS what the LLM sees, no//! post-processing in the runner.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;/// The summarizer archetype, verbatim.diff --git a/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt_tests.rsindex 11e49c22ac..8e633c624d 100644--- a/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/summarizer/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rsindex d494ff260a..11c9ccf64a 100644--- a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt.rs@@ -1,6 +1,6 @@//! System prompt builder for the `task_manager_agent` built-in agent.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rsindex 54e7857001..bc80c4dcb4 100644--- a/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/task_manager_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/tool_maker/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/tool_maker/prompt.rsindex 375d5d4248..38e4fcec19 100644--- a/crates/openhuman-core/src/agent/registry/agents/tool_maker/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/tool_maker/prompt.rs@@ -5,7 +5,7 @@//! in its TOML — it executes code or external actions and needs the//! guard rails inlined).-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/registry/agents/tool_maker/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/tool_maker/prompt_tests.rsindex d02effb733..ba0cf5597f 100644--- a/crates/openhuman-core/src/agent/registry/agents/tool_maker/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/tool_maker/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt.rsindex ee8e9b1c1a..ce5ed6b27c 100644--- a/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt.rs@@ -6,9 +6,7 @@//! Composio action tools are filtered out at tool-list construction//! time in the subagent runner.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt_tests.rsindex 8913730895..d674abe18f 100644--- a/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/tools_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rsindex c4f92e6359..459a9ca4f2 100644--- a/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt.rs@@ -1,13 +1,11 @@//! System prompt builder for the `trigger_reactor` built-in agent.//!//! Returns the fully-assembled system prompt. Each agent's `build()`-//! composes section helpers from [`crate::agent::context::prompt`]+//! composes section helpers from [`crate::agent::prompts`]//! in the order it wants — so the output IS what the LLM sees, no//! post-processing in the runner.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt_tests.rsindex c15da02f2a..260942499b 100644--- a/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/trigger_reactor/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rsindex a36093caf7..ab38ba81a7 100644--- a/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt.rs@@ -1,13 +1,11 @@//! System prompt builder for the `trigger_triage` built-in agent.//!//! Returns the fully-assembled system prompt. Each agent's `build()`-//! composes section helpers from [`crate::agent::context::prompt`]+//! composes section helpers from [`crate::agent::prompts`]//! in the order it wants — so the output IS what the LLM sees, no//! post-processing in the runner.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt_tests.rsindex 5025fe1ec6..3935aef6a9 100644--- a/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/trigger_triage/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rsindex bedea05519..0d9c6b712e 100644--- a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt.rs@@ -3,9 +3,7 @@//! Returns the final, fully-assembled system prompt — archetype body (from the//! sibling `prompt.md`) plus the shared section helpers every agent uses.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rsindex 519b19c107..cb2f268932 100644--- a/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/video_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs b/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rsindex 45c3678e98..efdd500a1c 100644--- a/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs+++ b/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt.rs@@ -4,9 +4,7 @@//! (from the sibling `prompt.md`) plus the same section helpers the//! runtime uses for every other agent.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = include_str!("prompt.md");diff --git a/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt_tests.rsindex c4b8764412..7349c6b7f4 100644--- a/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt_tests.rs+++ b/crates/openhuman-core/src/agent/registry/agents/vision_agent/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;#[test]diff --git a/crates/openhuman-core/src/agent/tinyagents/convert.rs b/crates/openhuman-core/src/agent/tinyagents/convert.rsindex ba6eefa253..ce61d6546c 100644--- a/crates/openhuman-core/src/agent/tinyagents/convert.rs+++ b/crates/openhuman-core/src/agent/tinyagents/convert.rs@@ -6,7 +6,7 @@use tinyinference_llm::tool::ToolSchema;-use crate::tools::ToolSpec;+use tinytools::ToolSpec;pub(crate) fn spec_to_schema(spec: &ToolSpec) -> ToolSchema {ToolSchema::new(diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rsindex 3790e4069e..19a3008e04 100644--- a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs+++ b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs@@ -19,11 +19,11 @@ use crate::agent::harness::tool_result_artifacts::ToolResultArtifactIndexStore;use crate::agent::progress::AgentProgress;use crate::agent::tinyagents::harness_context_ladder::install_context_ladder;use crate::agent::tinyagents::harness_tool_registration::register_turn_tools_and_agents;+use crate::agent::tinyagents::host::steering;use crate::agent::tinyagents::middleware::{self, TurnContextMiddleware};use crate::agent::tinyagents::observability::{IterationCursor, ProviderUsageCarry, SubagentScope, ToolFailureMap, ToolNameMap,};-use crate::agent::tinyagents::orchestration;use crate::agent::tinyagents::routes;use crate::agent::tinyagents::stop_hooks;use crate::agent::tinyagents::tools::EarlyExitHook;@@ -110,7 +110,7 @@ pub(super) struct AssembledTurnHarness {pub(super) fn assemble_turn_harness(turn_models: TurnModels,model: &str,- tool_sets: Vec<Arc<Vec<Box<dyn crate::tools::Tool>>>>,+ tool_sets: Vec<Arc<Vec<Box<dyn tinytools::Tool>>>>,allowed: Option<HashSet<String>>,max_iterations: usize,_on_progress: Option<Sender<AgentProgress>>,@@ -261,11 +261,11 @@ pub(super) fn assemble_turn_harness(// graceful control-flow steering (Resume/Cancel/Redirect). `subagent_scope`// is the only run-class signal available at this steer site.let steering_run_class = if subagent_scope.is_some() {- orchestration::SteeringRunClass::Background+ steering::SteeringRunClass::Background} else {- orchestration::SteeringRunClass::Interactive+ steering::SteeringRunClass::Interactive};- let handle = Some(orchestration::openhuman_steering_handle(steering_run_class));+ let handle = Some(steering::openhuman_steering_handle(steering_run_class));// Shared by the two breakers below: whichever halts writes the root cause here.let halt_summary: HaltSummarySlot = std::sync::Arc::new(std::sync::Mutex::new(None));diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rsindex 3b8d35f94e..3758209b25 100644--- a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs+++ b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs@@ -31,7 +31,7 @@ use crate::agent::tinyagents::turn_policy::is_subagent_spawn_or_delegate_tool;pub(super) fn register_turn_tools_and_agents(harness: &mut AgentHarness<()>,capability_registry: &mut CapabilityRegistry<()>,- tool_sets: &[Arc<Vec<Box<dyn crate::tools::Tool>>>],+ tool_sets: &[Arc<Vec<Box<dyn tinytools::Tool>>>],allowed: &Option<HashSet<String>>,early_exit_set: &HashSet<&str>,early_exit_hook: Option<&EarlyExitHook>,diff --git a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rsindex e38efef794..f2a41e89d4 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/context_composer.rs@@ -4,7 +4,7 @@//! # Which OpenHuman domains this adapts//!//! * [`crate::agent::prompts`] (re-exported as-//! `crate::agent::context::prompt`) — `SystemPromptBuilder`,+//! `crate::agent::prompts`) — `SystemPromptBuilder`,//! `PromptContext`, `LearnedContextData`, `ConnectedIntegration`,//! `ToolCallFormat`, `load_agents_md_layers`, `render_connected_identities`.//! The `SOUL.md` / `IDENTITY.md` / `HEARTBEAT.md` bootstrap files underdiff --git a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry.rs b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry.rsindex 422cb72056..9eca6bdbe8 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/definition_registry.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/definition_registry.rs@@ -76,8 +76,8 @@ use std::collections::HashSet;use std::sync::Arc;use async_trait::async_trait;+use tinyagents_definition::{AgentDefinition, DefinitionRegistry};use tinyagents_harness::error::Result;-use tinyagents_harness::host::{AgentDefinition, DefinitionRegistry};use crate::agent::harness::definition::{AgentDefinition as HostAgentDefinition, AgentDefinitionRegistry, AgentTier, ModelSpec,diff --git a/crates/openhuman-core/src/agent/tinyagents/host/mod.rs b/crates/openhuman-core/src/agent/tinyagents/host/mod.rsindex de1551cff1..09e9af6865 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/mod.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/mod.rs@@ -42,6 +42,7 @@ pub mod learning_sink;pub mod model_resolver;pub mod progress_sink;pub mod security_gate;+pub(crate) mod steering;pub mod tool_outcome_classifier;pub use agent_memory::OpenHumanAgentMemory;diff --git a/crates/openhuman-core/src/agent/tinyagents/host/progress_sink.rs b/crates/openhuman-core/src/agent/tinyagents/host/progress_sink.rsindex f06595993b..c1e0de5607 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/progress_sink.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/progress_sink.rs@@ -439,7 +439,7 @@ impl ProgressSink for OpenHumanProgressSink {// registry, which this sink has no handle to; `None` tells// the client to use its own formatter.// TODO(phase4): resolve labels from the tool registry- // (`crate::tools::traits::Tool::display_label`)+ // (`tinytools::Tool::display_label`)// once the sink is constructed with a registry handle.display_label: None,display_detail: None,diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rsindex 022fc260cb..b93c9a2863 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs@@ -91,7 +91,7 @@ use crate::security::prompt_injection::{enforce_prompt_input, PromptEnforcementAction, PromptEnforcementContext,};use crate::tools::agent_policy::{ToolPolicyAction, ToolPolicySession};-use crate::tools::{PermissionLevel, Tool};+use tinytools::{PermissionLevel, Tool};/// The tool name whose arguments carry a shell command string.///diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rsindex 8c1c3386ab..22a9256405 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs@@ -1,7 +1,7 @@use super::*;use crate::security::policy::AutonomyLevel;-use crate::tools::ToolResult;use serde_json::json;+use tinytools::ToolResult;/// Minimal registered tool. `execute` is unreachable: this adapter answers/// questions about tools, it never runs them.diff --git a/crates/openhuman-core/src/agent/tinyagents/host/steering.rs b/crates/openhuman-core/src/agent/tinyagents/host/steering.rsnew file mode 100644index 0000000000..bab7e98e0b--- /dev/null+++ b/crates/openhuman-core/src/agent/tinyagents/host/steering.rs@@ -0,0 +1,40 @@+//! OpenHuman's steering policy over TinyAgents' generic steering queue.++use std::sync::OnceLock;++use tinyagents_graph::orchestration::SteeringRegistry;+use tinyagents_harness::steering::{SteeringCommandKind, SteeringHandle, SteeringPolicy};++static STEERING_REGISTRY: OnceLock<SteeringRegistry> = OnceLock::new();++/// Process-local registry for TinyAgents steering handles keyed by detached task id.+pub(crate) fn shared_steering_registry() -> &'static SteeringRegistry {+ STEERING_REGISTRY.get_or_init(SteeringRegistry::new)+}++/// Run class used to tighten OpenHuman's steering allowlist.+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub(crate) enum SteeringRunClass {+ /// The user's live interactive chat turn.+ Interactive,+ /// A detached/background sub-agent turn.+ Background,+}++/// Creates a steering handle restricted to controls OpenHuman authorizes.+pub(crate) fn openhuman_steering_handle(run_class: SteeringRunClass) -> SteeringHandle {+ let mut policy = SteeringPolicy::new()+ .allow(SteeringCommandKind::InjectMessage)+ .allow(SteeringCommandKind::Pause);+ if run_class == SteeringRunClass::Background {+ policy = policy+ .allow(SteeringCommandKind::Resume)+ .allow(SteeringCommandKind::Cancel)+ .allow(SteeringCommandKind::Redirect);+ }+ SteeringHandle::new(policy)+}++#[cfg(test)]+#[path = "../orchestration_tests.rs"]+mod tests;diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rsindex 028c8d6d8b..9da4852d4c 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/approval.rs@@ -14,7 +14,7 @@ use tinyinference_llm::tool::ToolCall as TaToolCall;use crate::security::approval::{redact_args, summarize_action, ApprovalGate, ExecutionOutcome, GateOutcome,};-use crate::tools::Tool;+use tinytools::Tool;/// `wrap_tool`: route OpenHuman's human-in-the-loop **approval gate** through a/// named tinyagents tool middleware (issue #4249, Phase 1). A tool with andiff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/arg_recovery.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/arg_recovery.rsindex 69ab428b9f..d458c917f5 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/arg_recovery.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/arg_recovery.rs@@ -10,7 +10,7 @@ use tinyagents_harness::error::Result as TaResult;use tinyagents_harness::middleware::Middleware;use tinyinference_llm::tool::{ToolCall as TaToolCall, ToolSchema};-use crate::tools::Tool;+use tinytools::Tool;/// `before_tool`: repair a tool call's arguments *before* the harness runs its/// fatal pre-execution schema gate (issues #4249 / #4451). A model can emitdiff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/cli_rpc_only.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/cli_rpc_only.rsindex f28288ec2b..4b44f1d9f3 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/cli_rpc_only.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/cli_rpc_only.rs@@ -11,10 +11,10 @@ use tinyagents_harness::middleware::{MiddlewareToolOutcome, ToolHandler, ToolMiduse tinyagents_harness::tool::ToolResult as TaToolResult;use tinyinference_llm::tool::ToolCall as TaToolCall;-use crate::tools::Tool;+use tinytools::Tool;/// `wrap_tool`: refuse a tool whose scope is-/// [`ToolScope::CliRpcOnly`](crate::tools::ToolScope) inside the+/// [`ToolScope::CliRpcOnly`](tinytools::ToolScope) inside the/// autonomous agent loop (issue #4249). The in-house engine ran this gate in/// `engine::tools`; the tinyagents path dropped it, so a CLI/RPC-only tool/// (e.g. phone calls) would execute from the model loop. Applies on every path@@ -34,7 +34,7 @@ impl CliRpcOnlyMiddleware {.iter().flat_map(|set| set.iter()).find(|t| t.name() == name)- .map(|t| t.scope() == crate::tools::ToolScope::CliRpcOnly)+ .map(|t| t.scope() == tinytools::ToolScope::CliRpcOnly).unwrap_or(false)}}diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rsindex f9beccae62..b8f72b177d 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/packed_tool_route_tests.rs@@ -2,7 +2,7 @@ use super::*;use std::collections::HashMap;use crate::tools::agent_policy::ToolPolicyEngine;-use crate::tools::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// `skill_registry_search` with a chosen permission level.struct PackedFake(PermissionLevel);diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rsindex f03a19a9f9..e6fb92db87 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/tool_policy.rs@@ -13,7 +13,7 @@ use tinyagents_harness::tool::ToolResult as TaToolResult;use tinyinference_llm::tool::ToolCall as TaToolCall;use crate::agent::tinyagents::policy_denial::PolicyDenial;-use crate::tools::Tool;+use tinytools::Tool;/// `wrap_tool`: enforce the agent's builder-configured [`ToolPolicy`] at the tool/// boundary (issue #4249). The in-house engine ran this check in@@ -75,7 +75,8 @@ impl ToolPolicyMiddleware {fn callable_delegates_for(&self, owners: &[&str]) -> Vec<String> {let mut found: Vec<String> = Vec::new();for tool in self.tool_sets.iter().flat_map(|set| set.iter()) {- let Some(target) = crate::tools::traits::delegation_target(tool.as_ref()) else {+ let Some(target) = crate::tools::host_extensions::delegation_target(tool.as_ref())+ else {continue;};if !owners.contains(&target) {@@ -164,7 +165,7 @@ impl ToolPolicyMiddleware {.get("skill").and_then(serde_json::Value::as_str)?;let tool = self.resolve_tool(&call.name)?;- let handle = crate::tools::traits::pack_registry_handle(tool.as_ref())?;+ let handle = crate::tools::host_extensions::pack_registry_handle(tool.as_ref())?;let is_callable = |name: &str| !self.session.decision_for(name).blocks_execution();let route = crate::tools::toolpacks::pack(skill).map(|pack| self.route_for_pack(pack))@@ -298,7 +299,9 @@ impl ToolPolicyMiddleware {.iter().flat_map(|set| set.iter()).find(|t| t.name() == name)- .and_then(|t| crate::tools::traits::generated_runtime_context(t.as_ref(), args))+ .and_then(|t| {+ crate::tools::host_extensions::generated_runtime_context(t.as_ref(), args)+ })}}diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rsindex 892579271c..08b7174b47 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_loop_guard_tests.rs@@ -254,7 +254,7 @@ async fn halt_on_missing_connection_asks_the_user_instead_of_reporting_back() {#[tokio::test]async fn repeated_tool_failure_nudges_change_of_strategy_before_the_halt() {- use crate::agent::tinyagents::orchestration::{openhuman_steering_handle, SteeringRunClass};+ use crate::agent::tinyagents::host::steering::{openhuman_steering_handle, SteeringRunClass};use tinyagents_harness::steering::SteeringCommandKind;// #4089: before the same-strategy retry cap, the breaker must feed adiff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rsindex 1f93bbcae1..d0a944ecba 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs@@ -26,12 +26,12 @@ use crate::agent::tinyagents::payload_summarizer::{PayloadSummarizer, SummarizeOutcome, UnavailableReason,};use crate::inference::tokenjuice::AgentTokenjuiceCompression;-use crate::tools::Tool;use tinyagents_harness::context::{RunConfig, RunContext};use tinyagents_harness::no_progress::{DEFAULT_REPEAT_CALL_THRESHOLD, DEFAULT_REPEAT_OUTPUT_THRESHOLD,};use tinyinference_llm::model::ModelRequest;+use tinytools::Tool;fn ctx() -> RunContext<()> {RunContext::new(RunConfig::new("mw-test"), ())@@ -106,8 +106,8 @@ impl Tool for FakeTool {fn parameters_schema(&self) -> serde_json::Value {json!({ "type": "object" })}- async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<crate::tools::ToolResult> {- Ok(crate::tools::ToolResult::success("ok"))+ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<tinytools::ToolResult> {+ Ok(tinytools::ToolResult::success("ok"))}fn max_result_size_chars(&self) -> Option<usize> {self.capdiff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rsindex aa685b0844..b9fc15f477 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs@@ -14,12 +14,12 @@ use crate::tools::agent_policy::{ToolPolicySession,};use crate::tools::toolpacks::{append_pack_tools, bind_pack_registry, USE_SKILL};-use crate::tools::traits::{PermissionLevel, ToolResult};+use tinytools::{PermissionLevel, ToolResult};struct RoutingFakeTool(&'static str);#[async_trait]-impl crate::tools::traits::Tool for RoutingFakeTool {+impl tinytools::Tool for RoutingFakeTool {fn name(&self) -> &str {self.0}@@ -61,7 +61,7 @@ fn non_owner_middleware() -> ToolPolicyMiddleware {/// pack's permission ceiling — where `use_skill` reports the pack-wide maximum/// for an inner name it cannot resolve (#6302).fn non_owner_middleware_at(allowed: PermissionLevel) -> ToolPolicyMiddleware {- let mut tools: Vec<Box<dyn crate::tools::traits::Tool>> = vec![+ let mut tools: Vec<Box<dyn tinytools::Tool>> = vec![Box::new(RoutingFakeTool("build_workflow")),Box::new(RoutingFakeTool("propose_workflow")),Box::new(ArchetypeDelegationTool {@@ -210,7 +210,7 @@ async fn a_use_skill_denial_names_a_delegate_this_session_can_call() {/// naming the owning agents rather than inventing a call it cannot make.#[tokio::test]async fn a_session_without_the_delegate_is_not_told_to_call_it() {- let mut tools: Vec<Box<dyn crate::tools::traits::Tool>> =+ let mut tools: Vec<Box<dyn tinytools::Tool>> =vec![Box::new(RoutingFakeTool("propose_workflow"))];append_pack_tools(&mut tools);let tools = Arc::new(tools);@@ -272,8 +272,7 @@ async fn use_skill_reaches_a_withheld_packed_tool() {use crate::tools::agent_policy::ToolPolicyEngine;use crate::tools::toolpacks::strip_packed_from_visible;- let mut tools: Vec<Box<dyn crate::tools::traits::Tool>> =- vec![Box::new(RoutingFakeTool("goal_set"))];+ let mut tools: Vec<Box<dyn tinytools::Tool>> = vec![Box::new(RoutingFakeTool("goal_set"))];append_pack_tools(&mut tools);let tools = Arc::new(tools);bind_pack_registry(&tools);@@ -323,7 +322,7 @@ async fn a_prompt_hidden_delegate_is_not_offered_as_a_direct_route() {use crate::tools::agent_policy::ToolPolicyEngine;use crate::tools::toolpacks::strip_packed_from_visible;- let mut tools: Vec<Box<dyn crate::tools::traits::Tool>> = vec+/// Build a [`PFormatRegistry`](tinytools_agent::PFormatRegistry)/// from the tool schemas advertised on a [`ModelRequest`] (issue #4465).////// The text-mode fallback parse needs each tool's positional parameter layout@@ -38,14 +38,14 @@ pub(crate) fn native_chat_messages(request: &ModelRequest) -> Vec<ChatMessage> {/// otherwise), so the registry is available in both modes. Tool-less requests/// skip fallback parsing entirely; this empty registry is therefore consulted/// only alongside a non-empty advertised tool list.-fn pformat_registry_from_request(request: &ModelRequest) -> crate::agent::pformat::PFormatRegistry {+fn pformat_registry_from_request(request: &ModelRequest) -> tinytools_agent::PFormatRegistry {request.tools.iter().map(|t| {(t.name.clone(),- crate::agent::pformat::PFormatToolParams::from_schema(&t.parameters),+ tinytools_agent::PFormatToolParams::from_schema(&t.parameters),)}).collect()@@ -71,7 +71,7 @@ fn pformat_registry_from_request(request: &ModelRequest) -> crate::agent::pforma/// adapter preserves the provider-requested tool name.fn response_to_model_response(response: &ChatResponse,- pformat_registry: &crate::agent::pformat::PFormatRegistry,+ pformat_registry: &tinytools_agent::PFormatRegistry,parse_text_tool_calls: bool,) -> ModelResponse {let (visible_text, tool_calls): (String, Vec<TaToolCall>) = if !response.tool_calls.is_empty() {@@ -89,7 +89,7 @@ fn response_to_model_response(} else if parse_text_tool_calls {let text = response.text.as_deref().unwrap_or_default();let (prose, parsed) =- crate::agent::harness::parse_tool_calls_with_pformat(text, pformat_registry);+ tinytools_agent::parse_tool_calls_with_pformat(text, pformat_registry);if parsed.is_empty() {(text.to_string(), Vec::new())} else {@@ -167,7 +167,7 @@ fn response_to_model_response(pub(crate) fn native_model_response(response: &ChatResponse) -> ModelResponse {response_to_model_response(response,- &crate::agent::pformat::PFormatRegistry::default(),+ &tinytools_agent::PFormatRegistry::default(),false,)}diff --git a/crates/openhuman-core/src/agent/tinyagents/model_g1_usage_tests_tests.rs b/crates/openhuman-core/src/agent/tinyagents/model_g1_usage_tests_tests.rsindex 44e3b62303..4afabca088 100644--- a/crates/openhuman-core/src/agent/tinyagents/model_g1_usage_tests_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/model_g1_usage_tests_tests.rs@@ -4,8 +4,8 @@//! reconstruct exactly via [`usage_info_from_response`].use super::*;-fn empty_registry() -> crate::agent::pformat::PFormatRegistry {- crate::agent::pformat::PFormatRegistry::default()+fn empty_registry() -> tinytools_agent::PFormatRegistry {+ tinytools_agent::PFormatRegistry::default()}#[test]diff --git a/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs b/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rsindex ebf386ff3e..73d0c1ac92 100644--- a/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs+++ b/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs@@ -9,7 +9,7 @@ use tinyagents_harness::cache::CacheLayoutEvent;use tinyagents_harness::events::{AgentEvent, EventListener, EventRecord};use crate::agent::progress::AgentProgress;-use crate::tools::traits::humanize_tool_name;+use tinytools::humanize_tool_name;use super::event_bridge::OpenhumanEventBridge;diff --git a/crates/openhuman-core/src/agent/tinyagents/orchestration.rs b/crates/openhuman-core/src/agent/tinyagents/orchestration.rsdeleted file mode 100644index 747929eace..0000000000--- a/crates/openhuman-core/src/agent/tinyagents/orchestration.rs+++ /dev/null@@ -1,101 +0,0 @@-//! Shared orchestration helpers on the `tinyagents` graph layer (issue #4249).-//!-//! OpenHuman's control plane historically hand-rolled fan-out-//! ([`futures_util::future::join_all`]) and a bespoke detached-sub-agent registry-//! (raw `tokio` `AbortHandle`s, `watch` status channels, tombstone sets). This-//! module is the shared seam that re-expresses that work on `tinyagents`-//! primitives so the detached-sub-agent control plane routes through one place:-//!-//! - The `graph::orchestration` task primitives ([`TaskStore`],-//! [`OrchestrationTaskKind`], …) are re-exported here so the detached-sub-agent-//! control plane gets typed task lifecycle bookkeeping (Pending → Running →-//! Completed/Failed/Cancelled/…) instead of bespoke status enums + watch-//! channels + tombstones. The store tracks durable lifecycle while-//! [`DetachedTaskRegistry`] owns the process-local status, cancellation,-//! hard-abort, ownership, and steering mechanics. OpenHuman retains its-//! product metadata and `RunQueue` compatibility fallback.-//!-//! Graph lifecycle events are mirrored onto tracing via the shared-//! [`GraphTracingSink`](crate::agent::tinyagents::observability::GraphTracingSink).--use std::sync::OnceLock;--// Re-export the tinyagents task-orchestration primitives so the detached-// sub-agent control plane imports lifecycle types from one openhuman path.-pub(crate) use tinyagents_graph::orchestration::OrchestrationTaskStatus;-#[allow(unused_imports)]-pub(crate) use tinyagents_graph::orchestration::SteeringRegistry;-pub(crate) use tinyagents_graph::orchestration::{- open_jsonl_task_store_or_memory, reconcile_orphaned_tasks, DetachedTaskRegistry,- DetachedTaskRegistryError, DetachedTaskWaitOutcome, InMemoryTaskStore, OrchestrationTaskFilter,- OrchestrationTaskKind, OrchestrationTaskRecord, OrchestrationTaskResult, OrchestrationTaskSpec,- TaskStore, TaskStoreRegistry,-};-#[allow(unused_imports)]-pub(crate) use tinyagents_harness::ids::TaskId;-#[allow(unused_imports)]-pub(crate) use tinyagents_harness::steering::{- SteeringCommand, SteeringCommandKind, SteeringHandle, SteeringPolicy,-};--static STEERING_REGISTRY: OnceLock<SteeringRegistry> = OnceLock::new();--/// Process-local registry for TinyAgents steering handles keyed by detached-/// task id. The current product control path still uses OpenHuman's `RunQueue`;-/// this registry is the crate-native lookup seam for the next control-plane-/// migration slice.-pub(crate) fn shared_steering_registry() -> &'static SteeringRegistry {- STEERING_REGISTRY.get_or_init(SteeringRegistry::new)-}--/// Run class of a TinyAgents turn, used to tighten the steering allowlist.-///-/// The distinction matters for steering safety: an *interactive* turn is the-/// user's own live chat turn, where the only trusted controls are transcript-/// injection (user/orchestrator steering) and cooperative `Pause`. A-/// *background* turn is a detached sub-agent run with no live user transcript of-/// its own, so it can additionally accept crate-native control-flow steering-/// (`Resume`, `Cancel`) and `Redirect` — a graceful, safe-boundary alternative-/// to the hard `AbortHandle` cancel — without ever widening what the interactive-/// path accepts.-#[derive(Debug, Clone, Copy, PartialEq, Eq)]-pub(crate) enum SteeringRunClass {- /// The user's live interactive chat turn.- Interactive,- /// A detached / background sub-agent run.- Background,-}--/// Steering handle policy for OpenHuman's shared TinyAgents turn path, tightened-/// per [`SteeringRunClass`].-///-/// Interactive turns send `InjectMessage` for user/orchestrator steering and-/// `Pause` for cooperative early-exit, cap, stop-hook, and repeated-failure-/// halts — nothing else, matching the prior behavior exactly. Background-/// (detached sub-agent) runs additionally accept `Resume`, `Cancel`, and-/// `Redirect`: control-flow steering that never injects untrusted transcript and-/// still lands only at a safe loop boundary (the crate drains before each model-/// call). A command whose kind is not in the allowlist is *rejected* by the-/// crate and aborts the run with `TinyAgentsError::Steering`, so callers must-/// only enqueue kinds this policy permits (see `running_subagents::steer_directive`).-pub(crate) fn openhuman_steering_handle(run_class: SteeringRunClass) -> SteeringHandle {- let mut policy = SteeringPolicy::new()- .allow(SteeringCommandKind::InjectMessage)- .allow(SteeringCommandKind::Pause);- if run_class == SteeringRunClass::Background {- // Background-only widening: accept graceful control-flow steering without- // also accepting transcript injection beyond the shared `InjectMessage`- // lane. `Cancel` is the crate-native, safe-boundary equivalent of the- // hard abort; `Resume` lifts a `Pause`; `Redirect` lowers to a system- // instruction the normal approval-gated loop still governs.- policy = policy- .allow(SteeringCommandKind::Resume)- .allow(SteeringCommandKind::Cancel)- .allow(SteeringCommandKind::Redirect);- }- SteeringHandle::new(policy)-}--#[cfg(test)]-#[path = "orchestration_tests.rs"]-mod tests;diff --git a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rsindex b52672cfc8..a4d940ecf1 100644--- a/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs+++ b/crates/openhuman-core/src/agent/tinyagents/payload_summarizer.rs@@ -450,14 +450,14 @@ impl SubagentPayloadSummarizer {let prompt_tools = Vec::new();let visible_tool_names = HashSet::new();let connected_identities_md = crate::agent::prompts::render_connected_identities();- let prompt_ctx = crate::agent::context::prompt::PromptContext {+ let prompt_ctx = crate::agent::prompts::PromptContext {workspace_dir: &parent.workspace_dir,model_name: model,agent_id: &self.definition.id,tools: &prompt_tools,workflows: parent.workflows.as_slice(),dispatcher_instructions: "",- learned: crate::agent::context::prompt::LearnedContextData::default(),+ learned: crate::agent::prompts::LearnedContextData::default(),visible_tool_names: &visible_tool_names,tool_call_format: parent.tool_call_format,connected_integrations: &parent.connected_integrations,diff --git a/crates/openhuman-core/src/agent/tinyagents/policy_denial.rs b/crates/openhuman-core/src/agent/tinyagents/policy_denial.rsindex 49ffae4097..8d8b4b7f2e 100644--- a/crates/openhuman-core/src/agent/tinyagents/policy_denial.rs+++ b/crates/openhuman-core/src/agent/tinyagents/policy_denial.rs@@ -20,7 +20,7 @@//! tool-call record carried out to the caller.use crate::security::POLICY_BLOCKED_MARKER;-use crate::tools::PermissionLevel;+use tinytools::PermissionLevel;/// Generic workaround for a raw security-policy / autonomy block. These denials/// originate deep in the tools / `SecurityPolicy` layer (autonomy tier, commanddiff --git a/crates/openhuman-core/src/agent/tinyagents/tools.rs b/crates/openhuman-core/src/agent/tinyagents/tools.rsindex adf83e3212..70090b9153 100644--- a/crates/openhuman-core/src/agent/tinyagents/tools.rs+++ b/crates/openhuman-core/src/agent/tinyagents/tools.rs@@ -1,6 +1,6 @@//! `tinyagents` [`Tool`] adapter over an openhuman [`Tool`] (issue #4249).//!-//! Wraps `Arc<dyn crate::tools::Tool>` so the harness agent-loop can invoke+//! Wraps `Arc<dyn tinytools::Tool>` so the harness agent-loop can invoke//! the exact same tools the legacy loop runs. The harness calls `call` with a//! validated [`TaToolCall`] (parsed JSON arguments + correlation id); we execute//! the underlying tool and render the [`ToolResult`] the way the LLM should see@@ -78,13 +78,13 @@ impl EarlyExitHook {/// A harness tool backed by an openhuman [`Tool`].#[cfg(test)]pub(crate) struct ToolAdapter {- inner: Arc<dyn crate::tools::Tool>,+ inner: Arc<dyn tinytools::Tool>,}#[cfg(test)]impl ToolAdapter {/// Wrap a resolved openhuman tool.- pub(crate) fn new(inner: Arc<dyn crate::tools::Tool>) -> Self {+ pub(crate) fn new(inner: Arc<dyn tinytools::Tool>) -> Self {Self { inner }}}@@ -126,9 +126,9 @@ impl Tool<()> for ToolAdapter {}}-pub(crate) fn tool_policy_from_openhuman_tool(tool: &dyn crate::tools::Tool) -> ToolPolicy {- use crate::tools::traits::ToolTimeout;- use crate::tools::PermissionLevel;+pub(crate) fn tool_policy_from_openhuman_tool(tool: &dyn tinytools::Tool) -> ToolPolicy {+ use tinytools::PermissionLevel;+ use tinytools::ToolTimeout;let permission = tool.permission_level();let external_effect = tool.external_effect();@@ -188,11 +188,11 @@ pub(crate) fn tool_policy_from_openhuman_tool(tool: &dyn crate::tools::Tool) ->/// `"javascript"` label the node runtime uses for the same events).const TINYAGENTS_TOOL_SESSION: &str = "tinyagents";-/// Execute an openhuman [`Tool`](crate::tools::Tool) for a harness+/// Execute an openhuman [`Tool`](tinytools::Tool) for a harness/// [`TaToolCall`] and render the [`TaToolResult`] the way the LLM should see it/// (mirrors the live-path `HarnessToolExecutor`).pub(crate) async fn execute_openhuman_tool(- tool: &dyn crate::tools::Tool,+ tool: &dyn tinytools::Tool,call: TaToolCall,context: Option<&dyn ToolRunContext>,) -> TaToolResult {@@ -231,7 +231,7 @@ pub(crate) async fn execute_openhuman_tool(// which the per-tool adapter does not carry; approval covers external// effects, and `RunPolicy::unknown_tool` recovers unregistered tool names// before execution reaches this adapter.- let options = crate::tools::ToolCallOptions {+ let options = tinytools::ToolCallOptions {prefer_markdown: true,};let (deadline, timeout_secs) =@@ -320,7 +320,7 @@ pub(crate) async fn execute_openhuman_tool(/// lets a route reuse the same `Arc`-shared tools the legacy loop runs without/// cloning them.pub(crate) struct SharedToolAdapter {- sets: Vec<Arc<Vec<Box<dyn crate::tools::Tool>>>>,+ sets: Vec<Arc<Vec<Box<dyn tinytools::Tool>>>>,name: String,description: String,schema: ToolSchema,@@ -333,7 +333,7 @@ impl SharedToolAdapter {/// Build an adapter for the tool named `name`, locating it across `sets` to/// capture its advertised spec. Returns `None` when no set contains it.pub(crate) fn for_name(- sets: Vec<Arc<Vec<Box<dyn crate::tools::Tool>>>>,+ sets: Vec<Arc<Vec<Box<dyn tinytools::Tool>>>>,name: &str,) -> Option<Self> {let (spec, policy) = setsdiff --git a/crates/openhuman-core/src/agent/tinyagents/tools_tests.rs b/crates/openhuman-core/src/agent/tinyagents/tools_tests.rsindex 7e006370fa..1e13825326 100644--- a/crates/openhuman-core/src/agent/tinyagents/tools_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/tools_tests.rs@@ -1,13 +1,13 @@use super::*;-use crate::tools::traits::ToolTimeout;-use crate::tools::ToolResult as OhToolResult;+use tinytools::ToolResult as OhToolResult;+use tinytools::ToolTimeout;/// A tool whose `execute_with_options` sleeps forever but declares a short/// per-call timeout, so the adapter's deadline must fire.struct HangingTool;#[async_trait]-impl crate::tools::Tool for HangingTool {+impl tinytools::Tool for HangingTool {fn name(&self) -> &str {"hang"}@@ -30,7 +30,7 @@ impl crate::tools::Tool for HangingTool {struct EchoTool;#[async_trait]-impl crate::tools::Tool for EchoTool {+impl tinytools::Tool for EchoTool {fn name(&self) -> &str {"echo"}diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rsindex dd0594db7c..b216ce30ea 100644--- a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs+++ b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs@@ -54,7 +54,7 @@ pub(crate) async fn run_turn_via_tinyagents(model: &str,temperature: f64,history: Vec<ChatMessage>,- resolved_tools: Vec<Arc<dyn crate::tools::Tool>>,+ resolved_tools: Vec<Arc<dyn tinytools::Tool>>,max_iterations: usize,) -> Result<TinyagentsTurnOutcome> {// `0` means "unset" → the legacy default; otherwise the harness cap would be@@ -203,7 +203,7 @@ pub(crate) async fn run_turn_via_tinyagents_shared(provider_id: String,model: &str,history: Vec<ChatMessage>,- tool_sets: Vec<Arc<Vec<Box<dyn crate::tools::Tool>>>>,+ tool_sets: Vec<Arc<Vec<Box<dyn tinytools::Tool>>>>,allowed: Option<HashSet<String>>,max_iterations: usize,on_progress: Option<Sender<AgentProgress>>,diff --git a/crates/openhuman-core/src/agent/todos/tools.rs b/crates/openhuman-core/src/agent/todos/tools.rsindex 45c3292e51..2becf51457 100644--- a/crates/openhuman-core/src/agent/todos/tools.rs+++ b/crates/openhuman-core/src/agent/todos/tools.rs@@ -19,7 +19,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolExposure, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolExposure, ToolResult};use super::ops::{self, BoardLocation, CardPatch, TodosSnapshot};diff --git a/crates/openhuman-core/src/agent/todos/tools_tests.rs b/crates/openhuman-core/src/agent/todos/tools_tests.rsindex 1c7e7a2819..3e504db1d6 100644--- a/crates/openhuman-core/src/agent/todos/tools_tests.rs+++ b/crates/openhuman-core/src/agent/todos/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolScope;+use tinytools::ToolScope;fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/agent/tools/ask_clarification.rs b/crates/openhuman-core/src/agent/tools/ask_clarification.rsindex 067e7de399..3f91d477cc 100644--- a/crates/openhuman-core/src/agent/tools/ask_clarification.rs+++ b/crates/openhuman-core/src/agent/tools/ask_clarification.rs@@ -1,8 +1,8 @@//! Tool: ask_user_clarification — pause execution and ask the user a question.-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult};/// Pauses the current execution to ask the user for clarification.///diff --git a/crates/openhuman-core/src/agent/tools/delegate.rs b/crates/openhuman-core/src/agent/tools/delegate.rsindex 1fc83fe4a4..0fdef961ab 100644--- a/crates/openhuman-core/src/agent/tools/delegate.rs+++ b/crates/openhuman-core/src/agent/tools/delegate.rs@@ -5,7 +5,6 @@ use crate::inference::provider::{use crate::security::policy::ToolOperation;use crate::security::SecurityPolicy;use crate::tools::timeout::tool_execution_timeout_secs;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::collections::HashMap;@@ -13,6 +12,7 @@ use std::sync::Arc;use std::time::Duration;use tinyinference_llm::message::Message;use tinyinference_llm::model::{ChatModel, ModelRequest};+use tinytools::{Tool, ToolResult};/// Tool that delegates a subtask to a named agent with a different/// provider/model configuration. Enables multi-agent workflows wherediff --git a/crates/openhuman-core/src/agent/tools/delegate_to_personality.rs b/crates/openhuman-core/src/agent/tools/delegate_to_personality.rsindex d017d3cbc2..e20973d05e 100644--- a/crates/openhuman-core/src/agent/tools/delegate_to_personality.rs+++ b/crates/openhuman-core/src/agent/tools/delegate_to_personality.rs@@ -5,10 +5,10 @@ use crate::agent::harness::fork_context::current_parent;use crate::agent::harness::subagent_runner::{run_subagent, SubagentRunOptions};use crate::agent::profiles::AgentProfileStore;use crate::agent::profiles::PersonalityContext;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};pub struct DelegateToPersonalityTool;diff --git a/crates/openhuman-core/src/agent/tools/plan_exit.rs b/crates/openhuman-core/src/agent/tools/plan_exit.rsindex ef2de515a9..fe55d7f573 100644--- a/crates/openhuman-core/src/agent/tools/plan_exit.rs+++ b/crates/openhuman-core/src/agent/tools/plan_exit.rs@@ -11,9 +11,9 @@//! lives outside the tool. The follow-up `plan` vs `build` mode work//! (referenced in issue #1205) will wire the harness side.-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult};/// Stable marker the harness greps for to detect a plan→build hand-off.pub const PLAN_EXIT_MARKER: &str = "[plan_exit]";diff --git a/crates/openhuman-core/src/agent/tools/remember_preference.rs b/crates/openhuman-core/src/agent/tools/remember_preference.rsindex d00cec4ca4..1e797061cb 100644--- a/crates/openhuman-core/src/agent/tools/remember_preference.rs+++ b/crates/openhuman-core/src/agent/tools/remember_preference.rs@@ -37,12 +37,12 @@use crate::memory::ops::guard::active_memory_guard;use crate::security::policy::ToolOperation;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use tinymemory_api::provider::MemoryCore;use tinymemory_api::types::{MemoryCategory, MemoryTaint};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Valid facet classes that a pinned preference may belong to.///diff --git a/crates/openhuman-core/src/agent/tools/run_workflow.rs b/crates/openhuman-core/src/agent/tools/run_workflow.rsindex 43a8119ece..098ad2f22d 100644--- a/crates/openhuman-core/src/agent/tools/run_workflow.rs+++ b/crates/openhuman-core/src/agent/tools/run_workflow.rs@@ -35,7 +35,7 @@ use serde_json::json;use crate::skills::runtime::{await_run_outcome, spawn_workflow_run_background_with_profile};use crate::skills::schemas::resolve_workspace_dir;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Tool name surfaced to the LLM's function-calling schema.pub const RUN_WORKFLOW_TOOL_NAME: &str = "run_workflow";diff --git a/crates/openhuman-core/src/agent/tools/save_preference.rs b/crates/openhuman-core/src/agent/tools/save_preference.rsindex 527a443b41..d77b5f0a68 100644--- a/crates/openhuman-core/src/agent/tools/save_preference.rs+++ b/crates/openhuman-core/src/agent/tools/save_preference.rs@@ -27,9 +27,9 @@ use crate::memory::ops::guard::active_memory_guard;use crate::memory::safety;use crate::security::policy::ToolOperation;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use tinymemory_api::provider::MemoryCore as _;use tinymemory_api::types::MemoryCategory;+use tinytools::{PermissionLevel, Tool, ToolResult};// Namespace constants live in `memory::preferences` so the write path (here),// the system-prompt builder (Lane A), and per-turn recall (Lane B) all share adiff --git a/crates/openhuman-core/src/agent/tools/todo.rs b/crates/openhuman-core/src/agent/tools/todo.rsindex 0862e31af0..0223559e44 100644--- a/crates/openhuman-core/src/agent/tools/todo.rs+++ b/crates/openhuman-core/src/agent/tools/todo.rs@@ -10,9 +10,9 @@use crate::agent::tinyagents::thread_context;use crate::agent::todos::ops::{self, BoardLocation, CardPatch};use crate::agent::todos::types::{TaskApprovalMode, TaskBoardCard, TaskCardStatus};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct TodoTool;diff --git a/crates/openhuman-core/src/agent/tools/update_task.rs b/crates/openhuman-core/src/agent/tools/update_task.rsindex 1ffa249332..0a39e95181 100644--- a/crates/openhuman-core/src/agent/tools/update_task.rs+++ b/crates/openhuman-core/src/agent/tools/update_task.rs@@ -12,10 +12,10 @@use crate::agent::todos::ops::{self, BoardLocation, CardPatch};use crate::integrations::task_sources::TASK_SOURCES_THREAD_ID;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::PathBuf;+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct UpdateTaskTool;diff --git a/crates/openhuman-core/src/agent/tools/update_task_tests.rs b/crates/openhuman-core/src/agent/tools/update_task_tests.rsindex 8d950586eb..dd98c1bb83 100644--- a/crates/openhuman-core/src/agent/tools/update_task_tests.rs+++ b/crates/openhuman-core/src/agent/tools/update_task_tests.rs@@ -2,8 +2,8 @@use super::*;use crate::agent::todos::types::TaskCardStatus;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;// ── build_patch ──────────────────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/agent/triage/evaluator/prompt.rs b/crates/openhuman-core/src/agent/triage/evaluator/prompt.rsindex 76b7a17d8d..2f9de8fbf7 100644--- a/crates/openhuman-core/src/agent/triage/evaluator/prompt.rs+++ b/crates/openhuman-core/src/agent/triage/evaluator/prompt.rs@@ -13,7 +13,7 @@ pub(crate) fn extract_inline_prompt(def: &AgentDefinition) -> Option<String> {match &def.system_prompt {PromptSource::Inline(body) if !body.is_empty() => Some(body.clone()),PromptSource::Dynamic(build) => {- use crate::agent::context::prompt::{+ use crate::agent::prompts::{ConnectedIntegration, LearnedContextData, PromptContext, PromptTool, ToolCallFormat,};let empty_tools: Vec<PromptTool<'_>> = Vec::new();diff --git a/crates/openhuman-core/src/bin/rss_bench.rs b/crates/openhuman-core/src/bin/rss_bench.rsindex 9d8dd0b341..a01b1ad9d2 100644--- a/crates/openhuman-core/src/bin/rss_bench.rs+++ b/crates/openhuman-core/src/bin/rss_bench.rs@@ -33,7 +33,8 @@ use openhuman_core::platform::proc_metrics::{self, BenchReport, ProcSample, RosterResult, REPORT_SCHEMA_VERSION, RSS_BUDGET_KIB,RSS_HARD_CAP_KIB,};-use openhuman_core::tools::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};+use std::path::PathBuf;use std::process::Stdio;use std::sync::Arc;diff --git a/crates/openhuman-core/src/channels/context.rs b/crates/openhuman-core/src/channels/context.rsindex a019506926..940ffba0d0 100644--- a/crates/openhuman-core/src/channels/context.rs+++ b/crates/openhuman-core/src/channels/context.rs@@ -2,11 +2,11 @@use crate::agent::messages::ChatMessage;use crate::agent::tinyagents::TurnModelSource;-use crate::tools::Tool;use crate::util::truncate_with_ellipsis;use std::collections::HashMap;use std::path::PathBuf;use std::sync::{Arc, Mutex};+use tinytools::Tool;pub(crate) use tinychannels::context::{effective_channel_message_timeout_secs, should_skip_memory_context_entry,diff --git a/crates/openhuman-core/src/channels/context_tests.rs b/crates/openhuman-core/src/channels/context_tests.rsindex 208aa6f8f5..0406abc360 100644--- a/crates/openhuman-core/src/channels/context_tests.rs+++ b/crates/openhuman-core/src/channels/context_tests.rs@@ -1,8 +1,8 @@use super::*;use crate::channels::traits;-use crate::tools::{Tool, ToolResult};use async_trait::async_trait;use tinymemory_api::types::{MemoryCategory, MemoryEntry};+use tinytools::{Tool, ToolResult};struct DummyTool;diff --git a/crates/openhuman-core/src/channels/routes_tests.rs b/crates/openhuman-core/src/channels/routes_tests.rsindex 1995200c03..3a22bde4d9 100644--- a/crates/openhuman-core/src/channels/routes_tests.rs+++ b/crates/openhuman-core/src/channels/routes_tests.rs@@ -5,12 +5,12 @@ use crate::channels::telegram::{TelegramRemoteCommand, TelegramRemoteSubscriber}use crate::channels::traits::ChannelMessage;use crate::core::events::DomainEvent;use crate::memory::{Memory, MemoryCategory, MemoryEntry};-use crate::tools::{Tool, ToolResult};use async_trait::async_trait;use std::collections::HashMap;use std::path::PathBuf;use std::sync::{Arc, Mutex};use tinybus::EventHandler;+use tinytools::{Tool, ToolResult};struct DummyMemory;diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/mod_scoping_tests_tests.rs b/crates/openhuman-core/src/channels/runtime/dispatch/mod_scoping_tests_tests.rsindex a7d5d27020..0c4c2ebe38 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/mod_scoping_tests_tests.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/mod_scoping_tests_tests.rs@@ -14,8 +14,8 @@ use super::*;use crate::agent::harness::definition::{AgentDefinition, DefinitionSource, ModelSpec, PromptSource, SandboxMode, ToolScope,};-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};use async_trait::async_trait;+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};/// Minimal owned tool stub — just enough for `build_visible_tool_set`/// to read its `name()`.diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs b/crates/openhuman-core/src/channels/runtime/dispatch/routing.rsindex bcf19f1151..b376f5a577 100644--- a/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs+++ b/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs@@ -6,16 +6,17 @@//! agent and synthesise its delegation tool surface.//! * [`build_visible_tool_set`] — union of named tools + extra (delegation) tools.-use crate::agent::context::prompt::ConnectedIntegration;use crate::agent::harness::definition::{AgentDefinition, AgentDefinitionRegistry, ToolScope};+use crate::agent::prompts::ConnectedIntegration;use crate::config::Config;use crate::integrations::composio::{cached_active_integrations_including_expired, fetch_connected_integrations_status,FetchConnectedIntegrationsStatus,};-use crate::tools::{orchestrator_tools, Tool};+use crate::tools::orchestrator_tools;use std::collections::HashSet;use std::time::Duration;+use tinytools::Tool;/// Per-turn scoping fields derived from the active agent definition.///diff --git a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rsindex 0b8a6ec0dc..f48b2d0aa9 100644--- a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs@@ -7,7 +7,6 @@ use super::chat_workload::{resolve_chat_workload, ChatWorkloadResolution};use super::credentials::{hydrate_channel_credentials, RuntimeProxyClients};use super::prompt::format_access_context;use super::relay::start_relay_runtime;-use crate::agent::harness::build_tool_instructions_filtered;use crate::agent::host_runtime;use crate::channels::context::{effective_channel_message_timeout_secs, ChannelRuntimeContext,@@ -288,17 +287,17 @@ async fn start_channels_inner(mut config: Config) -> Result<()> {// Filter out Workflow-category tools (e.g. Composio, Apify) from the// main agent prompt — those are only available to the integrations_agent// subagent via category_filter = "skill".- let non_skill_tools: Vec<&Box<dyn crate::tools::Tool>> = tools_registry+ let non_skill_tools: Vec<&Box<dyn tinytools::Tool>> = tools_registry.iter()- .filter(|t| t.category() != crate::tools::traits::ToolCategory::Workflow)+ .filter(|t| t.category() != tinytools::ToolCategory::Workflow).collect();- let non_skill_refs: Vec<&dyn crate::tools::Tool> =- non_skill_tools.iter().map(|t| t.as_ref()).collect();// Everything after the rendered prompt is fixed for the process: the// tool-instruction block, then the model's current filesystem access// boundaries so it self-limits (advisory only — the SecurityPolicy// enforces these regardless).- let mut prompt_suffix = build_tool_instructions_filtered(&non_skill_refs);+ let non_skill_specs: Vec<tinytools::ToolSpec> =+ non_skill_tools.iter().map(|tool| tool.spec()).collect();+ let mut prompt_suffix = tinytools_agent::dialect::XmlDialect::instructions(&non_skill_specs);prompt_suffix.push_str(&format_access_context(&security));// The prompt itself is rendered here for the current identity and// re-rendered whenever the active profile or an identity file changesdiff --git a/crates/openhuman-core/src/channels/runtime/test_support.rs b/crates/openhuman-core/src/channels/runtime/test_support.rsindex 4d6bd65d62..26bd110104 100644--- a/crates/openhuman-core/src/channels/runtime/test_support.rs+++ b/crates/openhuman-core/src/channels/runtime/test_support.rs@@ -18,7 +18,6 @@ use crate::config::{MultimodalConfig, MultimodalFileConfig, ReliabilityConfig};use crate::core::bus::BUS;use crate::core::events::DomainEvent;use crate::inference::provider::ProviderRuntimeOptions;-use crate::tools::{Tool, ToolResult};use anyhow::Result;use async_trait::async_trait;use std::collections::HashMap;@@ -28,6 +27,7 @@ use std::sync::{Arc, Mutex};use std::time::Duration;use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};use tinymemory_api::types::{MemoryCategory, MemoryEntry};+use tinytools::{Tool, ToolResult};#[derive(Debug, Clone)]pub struct DispatchHarnessOptions {diff --git a/crates/openhuman-core/src/channels/tests/common.rs b/crates/openhuman-core/src/channels/tests/common.rsindex 0b024a18ea..df47e5d5ee 100644--- a/crates/openhuman-core/src/channels/tests/common.rs+++ b/crates/openhuman-core/src/channels/tests/common.rs@@ -1,6 +1,5 @@use crate::channels::{traits, Channel, SendMessage};use crate::memory::{Memory, MemoryCategory, MemoryEntry};-use crate::tools::{Tool, ToolResult};use std::sync::atomic::{AtomicUsize, Ordering};use std::sync::{Arc, Mutex};use std::time::Duration;@@ -8,6 +7,7 @@ use tempfile::TempDir;use tinyinference_llm::message::{AssistantMessage, Message};use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};use tinyinference_llm::tool::ToolCall;+use tinytools::{Tool, ToolResult};fn message_role(message: &Message) -> &'static str {match message {diff --git a/crates/openhuman-core/src/config/tools.rs b/crates/openhuman-core/src/config/tools.rsindex 5378034f67..ba86d7be70 100644--- a/crates/openhuman-core/src/config/tools.rs+++ b/crates/openhuman-core/src/config/tools.rs@@ -18,7 +18,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/config/tools_tests.rs b/crates/openhuman-core/src/config/tools_tests.rsindex 06a5fcc7ab..e5f0826c1e 100644--- a/crates/openhuman-core/src/config/tools_tests.rs+++ b/crates/openhuman-core/src/config/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::{PermissionLevel, ToolScope};+use tinytools::{PermissionLevel, ToolScope};#[test]fn read_metadata() {diff --git a/crates/openhuman-core/src/config/workspace/tools.rs b/crates/openhuman-core/src/config/workspace/tools.rsindex 7ccbe80dfb..17651e3358 100644--- a/crates/openhuman-core/src/config/workspace/tools.rs+++ b/crates/openhuman-core/src/config/workspace/tools.rs@@ -15,7 +15,7 @@ use serde_json::{json, Value};use crate::config::workspace::{ops, rpc};use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};fn req_str(args: &serde_json::Value, key: &str) -> anyhow::Result<String> {args.get(key)diff --git a/crates/openhuman-core/src/config/workspace/tools_tests.rs b/crates/openhuman-core/src/config/workspace/tools_tests.rsindex 486492d14c..22255686d6 100644--- a/crates/openhuman-core/src/config/workspace/tools_tests.rs+++ b/crates/openhuman-core/src/config/workspace/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolScope;+use tinytools::ToolScope;fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/cron/tools/add.rs b/crates/openhuman-core/src/cron/tools/add.rsindex 6c91c658bf..14474a2eb8 100644--- a/crates/openhuman-core/src/cron/tools/add.rs+++ b/crates/openhuman-core/src/cron/tools/add.rs@@ -1,10 +1,10 @@use crate::config::Config;use crate::cron::{self, DeliveryConfig, JobType, Schedule, SessionTarget};use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult};/// Look up the configured `allowed_users` list for a channel by name./// Returns `None` if the channel is unknown or unconfigured. An emptydiff --git a/crates/openhuman-core/src/cron/tools/collapsed.rs b/crates/openhuman-core/src/cron/tools/collapsed.rsindex 5860489688..e9aac09fec 100644--- a/crates/openhuman-core/src/cron/tools/collapsed.rs+++ b/crates/openhuman-core/src/cron/tools/collapsed.rs@@ -39,10 +39,10 @@ use crate::tools::implementations::meta::collapse::{any_external_effect, args_without_action, merge_action_schemas, resolve, strictest_permission,unknown_action_message, CollapsedAction,};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};#[cfg(test)]-use crate::tools::traits::ToolExposure;+use tinytools::ToolExposure;/// The advertised name. A constant so the registration site, the legacy-alias/// carve-out and the tests cannot disagree.diff --git a/crates/openhuman-core/src/cron/tools/list.rs b/crates/openhuman-core/src/cron/tools/list.rsindex 5336663a86..b4ffe720c7 100644--- a/crates/openhuman-core/src/cron/tools/list.rs+++ b/crates/openhuman-core/src/cron/tools/list.rs@@ -1,11 +1,11 @@use crate::config::Config;use crate::cron;use crate::cron::CronJob;-use crate::tools::traits::{Tool, ToolCallOptions, ToolExposure, ToolResult};use async_trait::async_trait;use serde_json::json;use std::fmt::Write as _;use std::sync::Arc;+use tinytools::{Tool, ToolCallOptions, ToolExposure, ToolResult};fn render_jobs_markdown(jobs: &[CronJob]) -> String {if jobs.is_empty() {diff --git a/crates/openhuman-core/src/cron/tools/remove.rs b/crates/openhuman-core/src/cron/tools/remove.rsindex 82174464e8..38e628b529 100644--- a/crates/openhuman-core/src/cron/tools/remove.rs+++ b/crates/openhuman-core/src/cron/tools/remove.rs@@ -1,9 +1,9 @@use crate::config::Config;use crate::cron;-use crate::tools::traits::{PermissionLevel, Tool, ToolExposure, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolExposure, ToolResult};pub struct CronRemoveTool {config: Arc<Config>,diff --git a/crates/openhuman-core/src/cron/tools/run.rs b/crates/openhuman-core/src/cron/tools/run.rsindex ae34f320b8..468155ca3f 100644--- a/crates/openhuman-core/src/cron/tools/run.rs+++ b/crates/openhuman-core/src/cron/tools/run.rs@@ -1,10 +1,10 @@use crate::config::Config;use crate::cron;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult};use async_trait::async_trait;use chrono::Utc;use serde_json::json;use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult};pub struct CronRunTool {config: Arc<Config>,diff --git a/crates/openhuman-core/src/cron/tools/runs.rs b/crates/openhuman-core/src/cron/tools/runs.rsindex e6d5c0f2c9..c7235ba9b6 100644--- a/crates/openhuman-core/src/cron/tools/runs.rs+++ b/crates/openhuman-core/src/cron/tools/runs.rs@@ -1,11 +1,11 @@use crate::config::Config;use crate::cron;-use crate::tools::traits::{Tool, ToolCallOptions, ToolExposure, ToolResult};use async_trait::async_trait;use serde::Serialize;use serde_json::json;use std::fmt::Write as _;use std::sync::Arc;+use tinytools::{Tool, ToolCallOptions, ToolExposure, ToolResult};const MAX_RUN_OUTPUT_CHARS: usize = 500;diff --git a/crates/openhuman-core/src/cron/tools/update.rs b/crates/openhuman-core/src/cron/tools/update.rsindex 2e54bc28ac..669410b2e2 100644--- a/crates/openhuman-core/src/cron/tools/update.rs+++ b/crates/openhuman-core/src/cron/tools/update.rs@@ -1,10 +1,10 @@use crate::config::Config;use crate::cron::{self, CronJobPatch};use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult};pub struct CronUpdateTool {config: Arc<Config>,diff --git a/crates/openhuman-core/src/desktop/dashboard/tools.rs b/crates/openhuman-core/src/desktop/dashboard/tools.rsindex d003c1858a..dc11a0ab10 100644--- a/crates/openhuman-core/src/desktop/dashboard/tools.rs+++ b/crates/openhuman-core/src/desktop/dashboard/tools.rs@@ -6,7 +6,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/desktop/dashboard/tools_tests.rs b/crates/openhuman-core/src/desktop/dashboard/tools_tests.rsindex 5e1557ec47..565fdffa6e 100644--- a/crates/openhuman-core/src/desktop/dashboard/tools_tests.rs+++ b/crates/openhuman-core/src/desktop/dashboard/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::{PermissionLevel, ToolScope};+use tinytools::{PermissionLevel, ToolScope};#[test]fn metadata() {diff --git a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt.rs b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt.rsindex 2eaaf483a6..719255792c 100644--- a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt.rs+++ b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt.rs@@ -11,9 +11,7 @@//! external effect); the "read, then suggest — never act" invariant lives in//! the archetype body instead.-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = tinyflows_copilot::prompts::FLOW_DISCOVERY;diff --git a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rsindex 75f2e85e21..3c18c02038 100644--- a/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs+++ b/crates/openhuman-core/src/flows/agents/flow_discovery/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;fn ctx() -> PromptContext<'static> {diff --git a/crates/openhuman-core/src/flows/agents/workflow_builder/prompt.rs b/crates/openhuman-core/src/flows/agents/workflow_builder/prompt.rsindex de815523e9..43ec98ec75 100644--- a/crates/openhuman-core/src/flows/agents/workflow_builder/prompt.rs+++ b/crates/openhuman-core/src/flows/agents/workflow_builder/prompt.rs@@ -7,9 +7,7 @@//! real external effect (the "propose, never persist" invariant lives in the//! archetype body instead).-use crate::agent::context::prompt::{- render_tools, render_user_files, render_workspace, PromptContext,-};+use crate::agent::prompts::{render_tools, render_user_files, render_workspace, PromptContext};use anyhow::Result;const ARCHETYPE: &str = tinyflows_copilot::prompts::WORKFLOW_BUILDER;diff --git a/crates/openhuman-core/src/flows/agents/workflow_builder/prompt_tests.rs b/crates/openhuman-core/src/flows/agents/workflow_builder/prompt_tests.rsindex d7a1d6d086..ee410d425c 100644--- a/crates/openhuman-core/src/flows/agents/workflow_builder/prompt_tests.rs+++ b/crates/openhuman-core/src/flows/agents/workflow_builder/prompt_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::{LearnedContextData, ToolCallFormat};+use crate::agent::prompts::{LearnedContextData, ToolCallFormat};use std::collections::HashSet;fn ctx() -> PromptContext<'static> {diff --git a/crates/openhuman-core/src/flows/agents/workflow_builder/tool_wording_tests_tests.rs b/crates/openhuman-core/src/flows/agents/workflow_builder/tool_wording_tests_tests.rsindex 244bdf13ff..9a51611d06 100644--- a/crates/openhuman-core/src/flows/agents/workflow_builder/tool_wording_tests_tests.rs+++ b/crates/openhuman-core/src/flows/agents/workflow_builder/tool_wording_tests_tests.rs@@ -5,7 +5,7 @@#[test]fn list_agent_profiles_tool_description_has_no_stale_followup_language() {use crate::flows::builder_tools::ListAgentProfilesTool;- use crate::tools::traits::Tool;+ use tinytools::Tool;let description = ListAgentProfilesTool::new().description().to_string();diff --git a/crates/openhuman-core/src/flows/builder_tools/catalog_search.rs b/crates/openhuman-core/src/flows/builder_tools/catalog_search.rsindex e429bfc59c..2d789c1747 100644--- a/crates/openhuman-core/src/flows/builder_tools/catalog_search.rs+++ b/crates/openhuman-core/src/flows/builder_tools/catalog_search.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::flows::ops;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ─────────────────────────────────────────────────────────────────────────────// search_tool_catalog — read-only: real Composio tool slugs from the FULLdiff --git a/crates/openhuman-core/src/flows/builder_tools/connection_reads.rs b/crates/openhuman-core/src/flows/builder_tools/connection_reads.rsindex 3757cb721b..16f23dcd7d 100644--- a/crates/openhuman-core/src/flows/builder_tools/connection_reads.rs+++ b/crates/openhuman-core/src/flows/builder_tools/connection_reads.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::flows::ops;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// `list_connectable_toolkits`: read-only list of the Composio toolkits the/// builder can wire, each tagged connected/unconnected — so the agent can steerdiff --git a/crates/openhuman-core/src/flows/builder_tools/draft_edit.rs b/crates/openhuman-core/src/flows/builder_tools/draft_edit.rsindex 612fbb2aac..3cfdd64f3f 100644--- a/crates/openhuman-core/src/flows/builder_tools/draft_edit.rs+++ b/crates/openhuman-core/src/flows/builder_tools/draft_edit.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::flows::ops;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Comma list of the valid `op` tag values, for the missing-/unknown-`op`/// parse errors surfaced by [`EditWorkflowTool`].diff --git a/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs b/crates/openhuman-core/src/flows/builder_tools/draft_revise.rsindex 78f938b88d..db66595d4d 100644--- a/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs+++ b/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs@@ -8,7 +8,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::flows::ops;use crate::flows::ops::validate_and_migrate_graph;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ─────────────────────────────────────────────────────────────────────────────// revise_workflow — iterative refine of an existing draft (proposal only)diff --git a/crates/openhuman-core/src/flows/builder_tools/draft_validate.rs b/crates/openhuman-core/src/flows/builder_tools/draft_validate.rsindex 64f124a7ac..aa57ec9225 100644--- a/crates/openhuman-core/src/flows/builder_tools/draft_validate.rs+++ b/crates/openhuman-core/src/flows/builder_tools/draft_validate.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::flows::ops;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ─────────────────────────────────────────────────────────────────────────────// validate_workflow — standalone check without proposing (F3)diff --git a/crates/openhuman-core/src/flows/builder_tools/dry_run.rs b/crates/openhuman-core/src/flows/builder_tools/dry_run.rsindex fe0357f2b4..52cc2b1dc3 100644--- a/crates/openhuman-core/src/flows/builder_tools/dry_run.rs+++ b/crates/openhuman-core/src/flows/builder_tools/dry_run.rs@@ -9,7 +9,7 @@ use tinyflows::model::WorkflowGraph;use crate::config::Config;use crate::flows::ops;use crate::flows::ops::validate_and_migrate_graph;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};use super::dry_run_diagnostics::{find_upstream_condition, tool_call_arg_null_entries, tool_call_error_message, CapturingObserver,diff --git a/crates/openhuman-core/src/flows/builder_tools/flow_reads.rs b/crates/openhuman-core/src/flows/builder_tools/flow_reads.rsindex 582d252953..229532e8a8 100644--- a/crates/openhuman-core/src/flows/builder_tools/flow_reads.rs+++ b/crates/openhuman-core/src/flows/builder_tools/flow_reads.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::flows::ops;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ─────────────────────────────────────────────────────────────────────────────// get_flow_history — read-only: prior graph snapshots (F6)diff --git a/crates/openhuman-core/src/flows/builder_tools/kind_reads.rs b/crates/openhuman-core/src/flows/builder_tools/kind_reads.rsindex 51c7c6fd4b..b2339e01cd 100644--- a/crates/openhuman-core/src/flows/builder_tools/kind_reads.rs+++ b/crates/openhuman-core/src/flows/builder_tools/kind_reads.rs@@ -3,7 +3,7 @@use async_trait::async_trait;use serde_json::{json, Value};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ─────────────────────────────────────────────────────────────────────────────// list_agent_profiles — read-only: selectable agent kinds for an `agent` nodediff --git a/crates/openhuman-core/src/flows/builder_tools/persistence.rs b/crates/openhuman-core/src/flows/builder_tools/persistence.rsindex 0a6ad71faf..01ed3e1134 100644--- a/crates/openhuman-core/src/flows/builder_tools/persistence.rs+++ b/crates/openhuman-core/src/flows/builder_tools/persistence.rs@@ -10,7 +10,7 @@ use crate::config::Config;use crate::flows::ops;use crate::flows::ops::validate_and_migrate_graph;use crate::flows::tools;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// `create_workflow`: the gated create tool (audit F4/F12). Persists a NEW/// flow, always **born disabled** (enable stays human-only) and behind thediff --git a/crates/openhuman-core/src/flows/builder_tools/run_control.rs b/crates/openhuman-core/src/flows/builder_tools/run_control.rsindex 9ba956e16f..0f0a7698aa 100644--- a/crates/openhuman-core/src/flows/builder_tools/run_control.rs+++ b/crates/openhuman-core/src/flows/builder_tools/run_control.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::flows::ops;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ─────────────────────────────────────────────────────────────────────────────// Phase 4 — the self-debug loop + gated create (F4, F7)diff --git a/crates/openhuman-core/src/flows/builder_tools/tool_contract.rs b/crates/openhuman-core/src/flows/builder_tools/tool_contract.rsindex bedf4d543f..bf6e9fa6fc 100644--- a/crates/openhuman-core/src/flows/builder_tools/tool_contract.rs+++ b/crates/openhuman-core/src/flows/builder_tools/tool_contract.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::flows::ops;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ─────────────────────────────────────────────────────────────────────────────// get_tool_contract — read-only: the FULL live contract for one action slugdiff --git a/crates/openhuman-core/src/flows/builder_tools_tests.rs b/crates/openhuman-core/src/flows/builder_tools_tests.rsindex 49ba202fe0..16f0b2845b 100644--- a/crates/openhuman-core/src/flows/builder_tools_tests.rs+++ b/crates/openhuman-core/src/flows/builder_tools_tests.rs@@ -3,9 +3,9 @@ use std::sync::Arc;use super::*;use crate::config::Config;use crate::flows::ops;-use crate::tools::traits::{PermissionLevel, Tool};use serde_json::{json, Value};use tempfile::TempDir;+use tinytools::{PermissionLevel, Tool};fn test_config(tmp: &TempDir) -> Arc<Config> {let config = Config {diff --git a/crates/openhuman-core/src/flows/discovery_tools.rs b/crates/openhuman-core/src/flows/discovery_tools.rsindex 3b44fee0b0..3079fa0db3 100644--- a/crates/openhuman-core/src/flows/discovery_tools.rs+++ b/crates/openhuman-core/src/flows/discovery_tools.rs@@ -34,7 +34,7 @@ use sha2::{Digest, Sha256};use crate::config::Config;use crate::flows::store;use crate::flows::types::{FlowSuggestion, SuggestionStatus};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Hard cap on suggestions accepted in one `suggest_workflows` call. Keeps the/// UI section digestible and bounds the write; the agent is told to return thediff --git a/crates/openhuman-core/src/flows/memory_tools.rs b/crates/openhuman-core/src/flows/memory_tools.rsindex 42a397388d..4ad6693d4f 100644--- a/crates/openhuman-core/src/flows/memory_tools.rs+++ b/crates/openhuman-core/src/flows/memory_tools.rs@@ -35,10 +35,10 @@ use crate::agent::turn_origin::{self, AgentTurnOrigin, TrustedAutomationSource};use crate::memory::ops::guard::active_memory_guard;use crate::security::policy::ToolOperation;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use tinymemory_api::provider::{MemoryCore, MemoryRecall};use tinymemory_api::recall::OwnedRecallOpts;use tinymemory_api::types::{MemoryCategory, MemoryEntry, MemoryTaint};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Returns the flow id the *run itself* is scoped under, when the current/// agent turn is executing inside a saved-flow rundiff --git a/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs b/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rsindex cf3352cec7..c4c2ffbb7c 100644--- a/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs+++ b/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs@@ -414,7 +414,7 @@ async fn flows_build_hides_the_live_run_tool_from_the_builder_belt() {// are external-effect tools. This pins that invariant independently of// belt name-resolution so the hide-list can't silently stop covering a// live-run/resume tool.- use crate::tools::Tool as _;+ use tinytools::Tool as _;let live_runner = crate::flows::tools::RunFlowTool::new(std::sync::Arc::new(config.clone()));assert!(live_runner.external_effect(),diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http.rsindex a867baba12..6d45b39e1b 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs@@ -20,8 +20,8 @@ use super::*;use crate::config::{Config, HttpRequestConfig};use crate::security::credentials::{HttpCredential, HttpCredentialsStore};use crate::security::{CommandClass, SecurityPolicy};-use crate::tools::traits::Tool as _;use crate::tools::HttpRequestTool;+use tinytools::Tool as _;/// [`HttpClient`] adapter over `HttpRequestTool`/// (`crates/openhuman-core/src/tools/impl/network/http_request.rs`). Allowlist + DNS-rebinddiff --git a/crates/openhuman-core/src/flows/tinyflows/memory_node_e2e_tests.rs b/crates/openhuman-core/src/flows/tinyflows/memory_node_e2e_tests.rsindex e451f7a8a5..8445ae292f 100644--- a/crates/openhuman-core/src/flows/tinyflows/memory_node_e2e_tests.rs+++ b/crates/openhuman-core/src/flows/tinyflows/memory_node_e2e_tests.rs@@ -52,7 +52,7 @@ use crate::agent::turn_origin::{self, AgentTurnOrigin, TrustedAutomationSource};use crate::config::Config;use crate::flows::memory_tools::FlowMemoryRecallTool;use crate::security::AutonomyLevel;-use crate::tools::traits::Tool;+use tinytools::Tool;use super::build_capabilities;diff --git a/crates/openhuman-core/src/flows/tools.rs b/crates/openhuman-core/src/flows/tools.rsindex 5f793855b2..aeb56d288d 100644--- a/crates/openhuman-core/src/flows/tools.rs+++ b/crates/openhuman-core/src/flows/tools.rs@@ -24,7 +24,7 @@ use tinyflows::model::{Node, NodeKind, WorkflowGraph};use crate::config::Config;use crate::flows::ops::{build_builder_proposal, validate_and_migrate_graph};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// Max characters kept for a `config_hint` before truncation, so a long/// prompt/expression doesn't blow up the proposal summary sent to the LLM@@ -606,7 +606,7 @@ fn config_hint(node: &Node) -> Option<String> {/// Truncates a hint string to [`MAX_CONFIG_HINT_CHARS`], appending an/// ellipsis when it was cut — mirrors-/// `crate::tools::traits::render_context_value`'s truncation+/// `tinytools::render_context_value`'s truncation/// behavior for tool-call timeline details.fn truncate_hint(s: &str) -> String {if s.chars().count() <= MAX_CONFIG_HINT_CHARS {diff --git a/crates/openhuman-core/src/hosting/hosting_tests.rs b/crates/openhuman-core/src/hosting/hosting_tests.rsindex bfc808fda7..4b15077a19 100644--- a/crates/openhuman-core/src/hosting/hosting_tests.rs+++ b/crates/openhuman-core/src/hosting/hosting_tests.rs@@ -9,7 +9,7 @@ use serde_json::json;use super::*;use crate::config::Config;-use crate::tools::traits::Tool;+use tinytools::Tool;fn config_with(workspace: &std::path::Path, enabled: bool, api_key: &str) -> Config {let mut config = Config::default();diff --git a/crates/openhuman-core/src/hosting/mod.rs b/crates/openhuman-core/src/hosting/mod.rsindex 3a4713c4e0..a328957a57 100644--- a/crates/openhuman-core/src/hosting/mod.rs+++ b/crates/openhuman-core/src/hosting/mod.rs@@ -150,7 +150,7 @@ impl Account {}/// The agent tools this account exposes.- pub fn tools(&self) -> Vec<Box<dyn crate::tools::Tool>> {+ pub fn tools(&self) -> Vec<Box<dyn tinytools::Tool>> {tools::hosting_tools(self)}}diff --git a/crates/openhuman-core/src/hosting/tools.rs b/crates/openhuman-core/src/hosting/tools.rsindex 136f0b534e..3d59d1b3cd 100644--- a/crates/openhuman-core/src/hosting/tools.rs+++ b/crates/openhuman-core/src/hosting/tools.rs@@ -34,7 +34,7 @@ pub use launch::LaunchSiteTool;pub use sites::{ListSitesTool, SetEnvTool};use super::Account;-use crate::tools::traits::Tool;+use tinytools::Tool;/// Every hosting tool, for one account.pub fn hosting_tools(account: &Account) -> Vec<Box<dyn Tool>> {diff --git a/crates/openhuman-core/src/hosting/tools/analytics.rs b/crates/openhuman-core/src/hosting/tools/analytics.rsindex 17f40fde6e..3828274f46 100644--- a/crates/openhuman-core/src/hosting/tools/analytics.rs+++ b/crates/openhuman-core/src/hosting/tools/analytics.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use tinyhosts::{AnalyticsDimension, AnalyticsQuery, Host};use super::required_str;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ── hosting_analytics ───────────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/hosting/tools/deployments.rs b/crates/openhuman-core/src/hosting/tools/deployments.rsindex cfc5a46726..5359053566 100644--- a/crates/openhuman-core/src/hosting/tools/deployments.rs+++ b/crates/openhuman-core/src/hosting/tools/deployments.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use tinyhosts::Host;use super::required_str;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ── hosting_deployment_status ───────────────────────────────────────────────diff --git a/crates/openhuman-core/src/hosting/tools/domains.rs b/crates/openhuman-core/src/hosting/tools/domains.rsindex 5d1cb15dce..3a97323d34 100644--- a/crates/openhuman-core/src/hosting/tools/domains.rs+++ b/crates/openhuman-core/src/hosting/tools/domains.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use tinyhosts::{Domain, Host};use super::required_str;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ── hosting_add_domain ──────────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/hosting/tools/launch.rs b/crates/openhuman-core/src/hosting/tools/launch.rsindex b32b4795dc..f881b1d9ac 100644--- a/crates/openhuman-core/src/hosting/tools/launch.rs+++ b/crates/openhuman-core/src/hosting/tools/launch.rs@@ -6,7 +6,7 @@ use tinyhosts::{Bundle, DatabaseKind, DatabaseSpec, EnvVar, Launch, LaunchPlan,use super::{env_value, required_str};use crate::hosting::{resolve_in_workspace, Account};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};/// Renders a launch as the two sentences a model needs: where it is, and what/// it still has to wait for.diff --git a/crates/openhuman-core/src/hosting/tools/sites.rs b/crates/openhuman-core/src/hosting/tools/sites.rsindex 501beeaf3d..53c0d721a1 100644--- a/crates/openhuman-core/src/hosting/tools/sites.rs+++ b/crates/openhuman-core/src/hosting/tools/sites.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use tinyhosts::{DeploymentTarget, EnvVar, Host};use super::{env_value, required_str};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};// ── hosting_list_sites ──────────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/inference/provider/types.rs b/crates/openhuman-core/src/inference/provider/types.rsindex e0a01e41fd..87f4b4c90c 100644--- a/crates/openhuman-core/src/inference/provider/types.rs+++ b/crates/openhuman-core/src/inference/provider/types.rs@@ -1,10 +1,10 @@use crate::agent::messages::ChatMessage;-use crate::tools::ToolSpec;use serde::{Deserialize, Serialize};/// Token usage returned by a provider. Defined in the contract crate because/// the extracted memory subsystem threads it out of summarisation runs; every/// existing `inference::provider::UsageInfo` path keeps naming this one type.pub use tinymemory_api::host::UsageInfo;+use tinytools::ToolSpec;/// A tool call requested by the LLM.#[derive(Debug, Clone, Serialize, Deserialize)]diff --git a/crates/openhuman-core/src/inference/tokenjuice/tools.rs b/crates/openhuman-core/src/inference/tokenjuice/tools.rsindex e474c4280c..6e4936eed9 100644--- a/crates/openhuman-core/src/inference/tokenjuice/tools.rs+++ b/crates/openhuman-core/src/inference/tokenjuice/tools.rs@@ -12,7 +12,7 @@ use async_trait::async_trait;use serde_json::{json, Value};use crate::inference::tokenjuice::types::{RangeUnit, RetrieveRange};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct TokenjuiceRetrieveTool;diff --git a/crates/openhuman-core/src/integrations/composio/action_tool.rs b/crates/openhuman-core/src/integrations/composio/action_tool.rsindex aeb23dda0d..e56a600c04 100644--- a/crates/openhuman-core/src/integrations/composio/action_tool.rs+++ b/crates/openhuman-core/src/integrations/composio/action_tool.rs@@ -35,7 +35,7 @@ use crate::agent::harness::current_sandbox_mode;use crate::agent::harness::definition::SandboxMode;use crate::config::rpc as config_rpc;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};/// A single Composio action exposed as a first-class tool.pub struct ComposioActionTool {diff --git a/crates/openhuman-core/src/integrations/composio/action_tool_tests.rs b/crates/openhuman-core/src/integrations/composio/action_tool_tests.rsindex e1102960ad..eb4c392861 100644--- a/crates/openhuman-core/src/integrations/composio/action_tool_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/action_tool_tests.rs@@ -57,7 +57,7 @@ fn error_text(result: &ToolResult) -> String {.content.iter().filter_map(|c| match c {- crate::tools::traits::ToolContent::Text { text } => Some(text.clone()),+ tinytools::ToolContent::Text { text } => Some(text.clone()),_ => None,}).collect::<Vec<_>>()diff --git a/crates/openhuman-core/src/integrations/composio/connected_integrations/cache.rs b/crates/openhuman-core/src/integrations/composio/connected_integrations/cache.rsindex 7df615ae2f..941d71f7ac 100644--- a/crates/openhuman-core/src/integrations/composio/connected_integrations/cache.rs+++ b/crates/openhuman-core/src/integrations/composio/connected_integrations/cache.rs@@ -5,7 +5,7 @@//! helpers ([`connected_set_hash`], [`sync_cache_with_connections`]) that//! keep it in sync with a fresh backend `list_connections` response.-use crate::agent::context::prompt::ConnectedIntegration;+use crate::agent::prompts::ConnectedIntegration;use crate::config::Config;use std::collections::{HashMap, HashSet};diff --git a/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch.rs b/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch.rsindex 8f7dd55a31..cf8c913418 100644--- a/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch.rs+++ b/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch.rs@@ -6,7 +6,7 @@use std::time::Instant;-use crate::agent::context::prompt::{ConnectedIntegration, ConnectedIntegrationTool};+use crate::agent::prompts::{ConnectedIntegration, ConnectedIntegrationTool};use crate::config::Config;use super::cache::{cache_key, CachedIntegrations, CACHE_TTL, INTEGRATIONS_CACHE};diff --git a/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch_uncached.rs b/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch_uncached.rsindex 054b68b13e..8eee80f55f 100644--- a/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch_uncached.rs+++ b/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch_uncached.rs@@ -4,9 +4,7 @@//! sequential fetch-then-merge routine that resists a further//! responsibility split without changing its behavior.-use crate::agent::context::prompt::{- ConnectedIntegration, ConnectedIntegrationTool, GatedIntegrationTool,-};+use crate::agent::prompts::{ConnectedIntegration, ConnectedIntegrationTool, GatedIntegrationTool};use crate::config::Config;use super::fetch::{connectable_toolkit_slugs, resolve_toolkit_description};@@ -436,7 +434,7 @@ pub(super) async fn fetch_connected_integrations_uncached((Vec::new(), Vec::new())};- let integration_connections: Vec<crate::agent::context::prompt::IntegrationConnection> =+ let integration_connections: Vec<crate::agent::prompts::IntegrationConnection> =if connected {let mut conns: Vec<_> = connections.iter()@@ -457,7 +455,7 @@ pub(super) async fn fetch_connected_integrations_uncached(.map(str::trim).find(|s| !s.is_empty()).map(str::to_string);- crate::agent::context::prompt::IntegrationConnection {+ crate::agent::prompts::IntegrationConnection {connection_id: c.id.clone(),label,is_default: idx == 0,diff --git a/crates/openhuman-core/src/integrations/composio/ops/mod.rs b/crates/openhuman-core/src/integrations/composio/ops/mod.rsindex c1f9d6a76f..a9e471df5c 100644--- a/crates/openhuman-core/src/integrations/composio/ops/mod.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/mod.rs@@ -98,7 +98,7 @@ pub(crate) use super::connected_integrations::cache_key;#[cfg(test)]pub(crate) use super::connected_integrations::{CachedIntegrations, CACHE_TTL, INTEGRATIONS_CACHE};#[cfg(test)]-pub(crate) use crate::agent::context::prompt::ConnectedIntegration;+pub(crate) use crate::agent::prompts::ConnectedIntegration;#[cfg(test)]pub(crate) use std::time::{Duration, Instant};diff --git a/crates/openhuman-core/src/integrations/composio/ops_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_tests.rsindex 6af483d3d5..7f78fb94e8 100644--- a/crates/openhuman-core/src/integrations/composio/ops_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/ops_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::context::prompt::IntegrationConnection;+use crate::agent::prompts::IntegrationConnection;use crate::integrations::composio::module_client::module_guard;diff --git a/crates/openhuman-core/src/integrations/composio/tools.rs b/crates/openhuman-core/src/integrations/composio/tools.rsindex e3b50f4e13..abdfc4fe56 100644--- a/crates/openhuman-core/src/integrations/composio/tools.rs+++ b/crates/openhuman-core/src/integrations/composio/tools.rs@@ -52,10 +52,6 @@ pub use registry::all_composio_agent_tools;// submodule.pub(crate) use visibility::{action_mutates_external_state, resolve_action_scope};-#[cfg(test)]-use crate::tools::traits::Tool;-#[cfg(test)]-use crate::tools::traits::{PermissionLevel, ToolCategory};pub use authorize::ComposioAuthorizeTool;#[cfg(test)]use connect::{@@ -66,6 +62,10 @@ pub use list_connections::ComposioListConnectionsTool;pub use list_toolkits::ComposioListToolkitsTool;pub use list_tools::ComposioListToolsTool;#[cfg(test)]+use tinytools::Tool;+#[cfg(test)]+use tinytools::{PermissionLevel, ToolCategory};+#[cfg(test)]use visibility::{empty_uncurated_toolkits_message, normalized_scope_toolkits, render_tools_markdown,retain_connected_tools,diff --git a/crates/openhuman-core/src/integrations/composio/tools/authorize.rs b/crates/openhuman-core/src/integrations/composio/tools/authorize.rsindex 64f4db1cc2..b0bf853041 100644--- a/crates/openhuman-core/src/integrations/composio/tools/authorize.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/authorize.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::rpc as config_rpc;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};use super::super::client::{create_composio_client, ComposioClientKind};diff --git a/crates/openhuman-core/src/integrations/composio/tools/connect.rs b/crates/openhuman-core/src/integrations/composio/tools/connect.rsindex b16b50527c..bfd17b201c 100644--- a/crates/openhuman-core/src/integrations/composio/tools/connect.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/connect.rs@@ -10,7 +10,7 @@ use serde_json::{json, Value};use crate::config::rpc as config_rpc;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};use super::super::client::{create_composio_client, direct_list_connections, ComposioClientKind};diff --git a/crates/openhuman-core/src/integrations/composio/tools/direct.rs b/crates/openhuman-core/src/integrations/composio/tools/direct.rsindex d89ba6a813..208897da68 100644--- a/crates/openhuman-core/src/integrations/composio/tools/direct.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/direct.rs@@ -27,8 +27,6 @@ pub use types::ComposioTool;// reachable unqualified via `use super::*`, mirroring the single-scope shape// `include!` gave it before the split into responsibility-based submodules.#[cfg(test)]-use crate::tools::traits::Tool;-#[cfg(test)]use connections::ComposioAuthConfig;#[cfg(test)]use construction::normalize_entity_id;@@ -40,4 +38,6 @@ use discovery::{#[cfg(test)]use http_errors::{extract_api_error_message, extract_redirect_url, sanitize_error_message};#[cfg(test)]+use tinytools::Tool;+#[cfg(test)]use types::{ensure_https, is_loopback_http_url, COMPOSIO_API_BASE_V3};diff --git a/crates/openhuman-core/src/integrations/composio/tools/direct/tool_impl.rs b/crates/openhuman-core/src/integrations/composio/tools/direct/tool_impl.rsindex e438954201..e09c636159 100644--- a/crates/openhuman-core/src/integrations/composio/tools/direct/tool_impl.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/direct/tool_impl.rs@@ -3,9 +3,9 @@use super::types::ComposioTool;use crate::security::policy::ToolOperation;-use crate::tools::traits::{Tool, ToolCategory, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolCategory, ToolResult};#[async_trait]impl Tool for ComposioTool {diff --git a/crates/openhuman-core/src/integrations/composio/tools/direct_tests_sanitization_and_connected_accounts_tests.rs b/crates/openhuman-core/src/integrations/composio/tools/direct_tests_sanitization_and_connected_accounts_tests.rsindex dedf7cca21..bc7f864442 100644--- a/crates/openhuman-core/src/integrations/composio/tools/direct_tests_sanitization_and_connected_accounts_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/direct_tests_sanitization_and_connected_accounts_tests.rs@@ -121,7 +121,7 @@ fn map_v3_tools_prefers_toolkit_slug_over_app_name() {#[test]fn composio_tool_category_is_skill() {- use crate::tools::traits::ToolCategory;+ use tinytools::ToolCategory;let tool = ComposioTool::new("key", None, test_security());assert_eq!(tool.category(), ToolCategory::Workflow);}diff --git a/crates/openhuman-core/src/integrations/composio/tools/execute.rs b/crates/openhuman-core/src/integrations/composio/tools/execute.rsindex 8f8ce62243..fbc82d5ea5 100644--- a/crates/openhuman-core/src/integrations/composio/tools/execute.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/execute.rs@@ -12,7 +12,7 @@ use crate::agent::harness::current_task_recency_window;use crate::agent::harness::definition::SandboxMode;use crate::config::rpc as config_rpc;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};use super::super::client::create_composio_client;use super::super::ops::load_user_scope_pref;diff --git a/crates/openhuman-core/src/integrations/composio/tools/list_connections.rs b/crates/openhuman-core/src/integrations/composio/tools/list_connections.rsindex 31e1fa02df..815c0e50fa 100644--- a/crates/openhuman-core/src/integrations/composio/tools/list_connections.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/list_connections.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::rpc as config_rpc;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};use super::super::client::{create_composio_client, direct_list_connections, ComposioClientKind};diff --git a/crates/openhuman-core/src/integrations/composio/tools/list_toolkits.rs b/crates/openhuman-core/src/integrations/composio/tools/list_toolkits.rsindex 6209d7a2e7..0e06605c28 100644--- a/crates/openhuman-core/src/integrations/composio/tools/list_toolkits.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/list_toolkits.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use crate::config::rpc as config_rpc;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};use super::super::client::{create_composio_client, ComposioClientKind};diff --git a/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs b/crates/openhuman-core/src/integrations/composio/tools/list_tools.rsindex 227bb47254..bbd474a249 100644--- a/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs@@ -8,7 +8,7 @@ use serde_json::{json, Value};use crate::config::rpc as config_rpc;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};use super::super::client::{create_composio_client, ComposioClientKind};use super::super::types::ComposioToolsResponse;diff --git a/crates/openhuman-core/src/integrations/composio/tools/registry.rs b/crates/openhuman-core/src/integrations/composio/tools/registry.rsindex 4d0bdfb1ff..d644f3bcbc 100644--- a/crates/openhuman-core/src/integrations/composio/tools/registry.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/registry.rs@@ -3,7 +3,7 @@use std::sync::Arc;-use crate::tools::traits::Tool;+use tinytools::Tool;use super::authorize::ComposioAuthorizeTool;use super::connect::ComposioConnectTool;diff --git a/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs b/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rsindex a0d50b2dd5..7fc37d2752 100644--- a/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs@@ -111,7 +111,7 @@ async fn list_tools_in_direct_mode_returns_empty_without_hitting_backend() {.content.iter().find_map(|c| match c {- crate::tools::traits::ToolContent::Text { text } => Some(text.clone()),+ tinytools::ToolContent::Text { text } => Some(text.clone()),_ => None,}).unwrap_or_default();@@ -216,7 +216,7 @@ async fn list_toolkits_in_direct_mode_returns_empty_without_hitting_backend() {.content.iter().find_map(|c| match c {- crate::tools::traits::ToolContent::Text { text } => Some(text.clone()),+ tinytools::ToolContent::Text { text } => Some(text.clone()),_ => None,}).unwrap_or_default();diff --git a/crates/openhuman-core/src/integrations/composio/tools_metadata_and_sandbox_tests.rs b/crates/openhuman-core/src/integrations/composio/tools_metadata_and_sandbox_tests.rsindex 09ab904c2a..13f88fa15d 100644--- a/crates/openhuman-core/src/integrations/composio/tools_metadata_and_sandbox_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/tools_metadata_and_sandbox_tests.rs@@ -89,7 +89,7 @@ async fn authorize_tool_execute_rejects_missing_toolkit() {.content.iter().filter_map(|c| match c {- crate::tools::traits::ToolContent::Text { text } => Some(text.clone()),+ tinytools::ToolContent::Text { text } => Some(text.clone()),_ => None,}).collect::<Vec<_>>()@@ -268,7 +268,7 @@ async fn execute_tool_execute_rejects_missing_tool() {.content.iter().filter_map(|c| match c {- crate::tools::traits::ToolContent::Text { text } => Some(text.clone()),+ tinytools::ToolContent::Text { text } => Some(text.clone()),_ => None,}).collect::<Vec<_>>()diff --git a/crates/openhuman-core/src/integrations/composio/tools_tests.rs b/crates/openhuman-core/src/integrations/composio/tools_tests.rsindex c7cecfbb7e..e7759920f4 100644--- a/crates/openhuman-core/src/integrations/composio/tools_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/tools_tests.rs@@ -2,7 +2,7 @@ use super::*;use std::path::Path;use std::sync::Arc;-use crate::tools::traits::ToolResult;+use tinytools::ToolResult;struct WorkspaceEnvGuard {previous: Option<std::ffi::OsString>,}@@ -77,12 +77,12 @@ fn fake_config_arc() -> Arc<crate::config::Config> {// ── composio_connect (inline approval card, #3993) ──────────────────-fn tool_result_text(result: &crate::tools::traits::ToolResult) -> String {+fn tool_result_text(result: &tinytools::ToolResult) -> String {result.content.iter().filter_map(|c| match c {- crate::tools::traits::ToolContent::Text { text } => Some(text.clone()),+ tinytools::ToolContent::Text { text } => Some(text.clone()),_ => None,}).collect::<Vec<_>>()@@ -101,7 +101,7 @@ fn error_text(result: &ToolResult) -> String {.content.iter().filter_map(|c| match c {- crate::tools::traits::ToolContent::Text { text } => Some(text.clone()),+ tinytools::ToolContent::Text { text } => Some(text.clone()),_ => None,}).collect::<Vec<_>>()diff --git a/crates/openhuman-core/src/integrations/file_storage/tools/delete.rs b/crates/openhuman-core/src/integrations/file_storage/tools/delete.rsindex ccb7e37759..d1442e4731 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools/delete.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools/delete.rs@@ -8,7 +8,7 @@ use serde_json::{json, Value};use super::helpers::{file_path, readonly_autonomy_block, validate_file_id};use crate::integrations::IntegrationClient;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};use crate::integrations::file_storage::types::DeleteResponse;diff --git a/crates/openhuman-core/src/integrations/file_storage/tools/download.rs b/crates/openhuman-core/src/integrations/file_storage/tools/download.rsindex 2561936cad..438059a13d 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools/download.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools/download.rs@@ -12,8 +12,8 @@ use super::helpers::{};use crate::integrations::IntegrationClient;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};pub struct StorageDownloadFileTool {client: Arc<IntegrationClient>,diff --git a/crates/openhuman-core/src/integrations/file_storage/tools/helpers.rs b/crates/openhuman-core/src/integrations/file_storage/tools/helpers.rsindex f0a7577c01..82556bf092 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools/helpers.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools/helpers.rs@@ -6,7 +6,7 @@ use serde_json::Value;use tinytools::ToolRunContext;use crate::security::SecurityPolicy;-use crate::tools::traits::ToolResult;+use tinytools::ToolResult;pub(super) const FILES_PATH: &str = "/agent-integrations/file-storage/files";diff --git a/crates/openhuman-core/src/integrations/file_storage/tools/link.rs b/crates/openhuman-core/src/integrations/file_storage/tools/link.rsindex 0e76f33566..a82e42d202 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools/link.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools/link.rs@@ -8,7 +8,7 @@ use serde_json::{json, Value};use super::helpers::{file_path, readonly_autonomy_block, validate_file_id};use crate::integrations::IntegrationClient;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};use crate::integrations::file_storage::types::LinkResponse;diff --git a/crates/openhuman-core/src/integrations/file_storage/tools/list.rs b/crates/openhuman-core/src/integrations/file_storage/tools/list.rsindex 56a315b9ca..1dad2285a4 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools/list.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools/list.rs@@ -7,7 +7,7 @@ use serde_json::{json, Value};use super::helpers::FILES_PATH;use crate::integrations::IntegrationClient;-use crate::tools::traits::{Tool, ToolCategory, ToolResult};+use tinytools::{Tool, ToolCategory, ToolResult};use crate::integrations::file_storage::types::{FileMeta, ListFilesResponse};diff --git a/crates/openhuman-core/src/integrations/file_storage/tools/registry.rs b/crates/openhuman-core/src/integrations/file_storage/tools/registry.rsindex 0ae8a8e98f..8dce9c3eb2 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools/registry.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools/registry.rs@@ -5,7 +5,7 @@ use std::sync::Arc;use crate::config::Config;use crate::security::SecurityPolicy;-use crate::tools::traits::Tool;+use tinytools::Tool;use super::delete::StorageDeleteFileTool;use super::download::StorageDownloadFileTool;diff --git a/crates/openhuman-core/src/integrations/file_storage/tools/upload.rs b/crates/openhuman-core/src/integrations/file_storage/tools/upload.rsindex f6e24a36c5..5455ad232c 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools/upload.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools/upload.rs@@ -9,8 +9,8 @@ use serde_json::{json, Value};use super::helpers::{mime_for_path, readonly_autonomy_block, resolve_upload_path};use crate::integrations::IntegrationClient;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};use super::helpers::{action_dir_for_context, FILES_PATH};use crate::integrations::file_storage::types::UploadResponse;diff --git a/crates/openhuman-core/src/integrations/file_storage/tools/visibility.rs b/crates/openhuman-core/src/integrations/file_storage/tools/visibility.rsindex 7749d68d8c..c157e99f70 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools/visibility.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools/visibility.rs@@ -8,7 +8,7 @@ use serde_json::{json, Value};use super::helpers::{file_path, readonly_autonomy_block, validate_file_id, validate_visibility};use crate::integrations::IntegrationClient;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};use crate::integrations::file_storage::types::FileMeta;diff --git a/crates/openhuman-core/src/integrations/file_storage/tools_tests.rs b/crates/openhuman-core/src/integrations/file_storage/tools_tests.rsindex 1be403e633..e00009e183 100644--- a/crates/openhuman-core/src/integrations/file_storage/tools_tests.rs+++ b/crates/openhuman-core/src/integrations/file_storage/tools_tests.rs@@ -9,7 +9,7 @@ use super::{};use crate::integrations::IntegrationClient;use crate::security::{AutonomyLevel, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory};+use tinytools::{PermissionLevel, Tool, ToolCategory};fn dummy_client() -> Arc<IntegrationClient> {// No requests are made in these tests; the URL/token are placeholders.diff --git a/crates/openhuman-core/src/integrations/task_sources/tools.rs b/crates/openhuman-core/src/integrations/task_sources/tools.rsindex 479dc240c8..4f76b4e0bf 100644--- a/crates/openhuman-core/src/integrations/task_sources/tools.rs+++ b/crates/openhuman-core/src/integrations/task_sources/tools.rs@@ -18,7 +18,7 @@ use serde_json::json;use crate::config::Config;use crate::integrations::task_sources::{FilterSpec, ProviderSlug, TaskSourcePatch};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/integrations/task_sources/tools_tests.rs b/crates/openhuman-core/src/integrations/task_sources/tools_tests.rsindex 3e41df2230..6fb657c29c 100644--- a/crates/openhuman-core/src/integrations/task_sources/tools_tests.rs+++ b/crates/openhuman-core/src/integrations/task_sources/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolScope;+use tinytools::ToolScope;fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/integrations/tools/google_places.rs b/crates/openhuman-core/src/integrations/tools/google_places.rsindex 56010989ce..b37509a76d 100644--- a/crates/openhuman-core/src/integrations/tools/google_places.rs+++ b/crates/openhuman-core/src/integrations/tools/google_places.rs@@ -13,11 +13,11 @@//! The backend handles Google API keys, billing, and rate limiting.use super::IntegrationClient;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolResult};// ── Response types ──────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/integrations/tools/stock_prices.rs b/crates/openhuman-core/src/integrations/tools/stock_prices.rsindex dfcb753578..a0ea510f51 100644--- a/crates/openhuman-core/src/integrations/tools/stock_prices.rs+++ b/crates/openhuman-core/src/integrations/tools/stock_prices.rs@@ -13,11 +13,11 @@//! Pricing is metered by the backend; the response includes `costUsd` per call.use super::IntegrationClient;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolExposure, ToolResult};const PATH_QUOTE: &str = "/agent-integrations/financial-apis/quote";const PATH_OPTIONS: &str = "/agent-integrations/financial-apis/options";diff --git a/crates/openhuman-core/src/integrations/tools/twilio.rs b/crates/openhuman-core/src/integrations/tools/twilio.rsindex acbfbebcae..5d02f3119c 100644--- a/crates/openhuman-core/src/integrations/tools/twilio.rs+++ b/crates/openhuman-core/src/integrations/tools/twilio.rs@@ -12,11 +12,11 @@use super::IntegrationClient;use crate::integrations::ToolScope;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolResult};/// Makes outbound phone calls via the backend Twilio integration.pub struct TwilioCallTool {diff --git a/crates/openhuman-core/src/integrations/types.rs b/crates/openhuman-core/src/integrations/types.rsindex 894ae2d9e6..3e7a94d99d 100644--- a/crates/openhuman-core/src/integrations/types.rs+++ b/crates/openhuman-core/src/integrations/types.rs@@ -3,7 +3,7 @@use serde::Deserialize;// Re-export ToolScope from the canonical definition in tools::traits.-pub use crate::tools::traits::ToolScope;+pub use tinytools::ToolScope;// ── Pricing types (fetched from backend) ────────────────────────────diff --git a/crates/openhuman-core/src/mcp/registry/tools.rs b/crates/openhuman-core/src/mcp/registry/tools.rsindex 07e505df67..171424c68c 100644--- a/crates/openhuman-core/src/mcp/registry/tools.rs+++ b/crates/openhuman-core/src/mcp/registry/tools.rs@@ -21,7 +21,7 @@ use async_trait::async_trait;use serde_json::{json, Value};use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/mcp/registry/tools_tests.rs b/crates/openhuman-core/src/mcp/registry/tools_tests.rsindex f1516bc121..e13cf291f3 100644--- a/crates/openhuman-core/src/mcp/registry/tools_tests.rs+++ b/crates/openhuman-core/src/mcp/registry/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolScope;+use tinytools::ToolScope;fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/media/generation/tools.rs b/crates/openhuman-core/src/media/generation/tools.rsindex 9057388f29..192c25dcca 100644--- a/crates/openhuman-core/src/media/generation/tools.rs+++ b/crates/openhuman-core/src/media/generation/tools.rs@@ -24,8 +24,8 @@ use serde_json::{json, Value};use crate::config::Config;use crate::integrations::IntegrationClient;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult};use super::download::persist_media;use super::types::MediaResponse;diff --git a/crates/openhuman-core/src/media/generation/tools_tests.rs b/crates/openhuman-core/src/media/generation/tools_tests.rsindex c906a9b379..ccf5e66a3a 100644--- a/crates/openhuman-core/src/media/generation/tools_tests.rs+++ b/crates/openhuman-core/src/media/generation/tools_tests.rs@@ -5,7 +5,7 @@ use serde_json::json;use super::{MediaGenerateImageTool, MediaGenerateVideoTool, MediaListModelsTool};use crate::integrations::IntegrationClient;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory};+use tinytools::{PermissionLevel, Tool, ToolCategory};fn dummy_client() -> Arc<IntegrationClient> {// No requests are made in these tests; the URL/token are placeholders.diff --git a/crates/openhuman-core/src/memory/agent/agent/prompt.rs b/crates/openhuman-core/src/memory/agent/agent/prompt.rsindex a014c5b01f..c3e58dffea 100644--- a/crates/openhuman-core/src/memory/agent/agent/prompt.rs+++ b/crates/openhuman-core/src/memory/agent/agent/prompt.rs@@ -1,6 +1,6 @@//! System prompt builder for the `agent_memory` built-in agent.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/memory/agent/tools.rs b/crates/openhuman-core/src/memory/agent/tools.rsindex abf811c55c..68e1f907ca 100644--- a/crates/openhuman-core/src/memory/agent/tools.rs+++ b/crates/openhuman-core/src/memory/agent/tools.rs@@ -12,12 +12,10 @@use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::fork_context::current_parent;use crate::agent::harness::subagent_runner::{run_subagent, SubagentRunOptions, SubagentRunStatus};-use crate::tools::traits::{- PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult, ToolScope,-};use async_trait::async_trait;use serde_json::json;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult, ToolScope};const AGENT_ID: &str = "agent_memory";diff --git a/crates/openhuman-core/src/memory/query/cover_window.rs b/crates/openhuman-core/src/memory/query/cover_window.rsindex 433b628ae1..548bfa8989 100644--- a/crates/openhuman-core/src/memory/query/cover_window.rs+++ b/crates/openhuman-core/src/memory/query/cover_window.rs@@ -2,9 +2,9 @@ use crate::memory::api::chunks::SourceKind;use crate::memory::api::provider::{CoverWindowQuery, MemoryProvider};use crate::memory::ops::guard::active_memory_guard;use crate::memory::tree::retrieval::rpc::CoverWindowRequest;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolResult};/// Agent-facing wrapper for the windowed minimum-cover retrieval. Returns the/// smallest set of nodes (summaries + raw chunks) covering all memory indiff --git a/crates/openhuman-core/src/memory/query/cover_window_tests.rs b/crates/openhuman-core/src/memory/query/cover_window_tests.rsindex a0f3167d18..c63b88157e 100644--- a/crates/openhuman-core/src/memory/query/cover_window_tests.rs+++ b/crates/openhuman-core/src/memory/query/cover_window_tests.rs@@ -1,6 +1,6 @@use super::*;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;#[test]fn parameters_schema_requires_window_bounds() {diff --git a/crates/openhuman-core/src/memory/query/drill_down.rs b/crates/openhuman-core/src/memory/query/drill_down.rsindex c3f4654bb1..9dfc2313cf 100644--- a/crates/openhuman-core/src/memory/query/drill_down.rs+++ b/crates/openhuman-core/src/memory/query/drill_down.rs@@ -1,8 +1,8 @@use crate::memory::query::backend;use crate::memory::tree::retrieval::rpc::DrillDownRequest;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolResult};pub struct MemoryTreeDrillDownTool;diff --git a/crates/openhuman-core/src/memory/query/drill_down_tests.rs b/crates/openhuman-core/src/memory/query/drill_down_tests.rsindex 5c2ac0e230..6f59695691 100644--- a/crates/openhuman-core/src/memory/query/drill_down_tests.rs+++ b/crates/openhuman-core/src/memory/query/drill_down_tests.rs@@ -5,8 +5,8 @@ use tempfile::TempDir;use crate::config::Config;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,diff --git a/crates/openhuman-core/src/memory/query/fast_walk.rs b/crates/openhuman-core/src/memory/query/fast_walk.rsindex 5479ec6ca9..90dfcb2b78 100644--- a/crates/openhuman-core/src/memory/query/fast_walk.rs+++ b/crates/openhuman-core/src/memory/query/fast_walk.rs@@ -7,7 +7,7 @@use crate::memory::api::provider::{FastRetrieveQuery, MemoryProvider};use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::ToolResult;+use tinytools::ToolResult;/// Parse the shared `memory_tree` args and run deterministic retrieval./// Accepts `query` (required), `limit`, `time_window_days`, and `max_hops`.diff --git a/crates/openhuman-core/src/memory/query/fetch_leaves.rs b/crates/openhuman-core/src/memory/query/fetch_leaves.rsindex bf52924d22..8b8c56df5e 100644--- a/crates/openhuman-core/src/memory/query/fetch_leaves.rs+++ b/crates/openhuman-core/src/memory/query/fetch_leaves.rs@@ -1,8 +1,8 @@use crate::memory::query::backend;use crate::memory::tree::retrieval::rpc::FetchLeavesRequest;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolResult};/// Hard cap on `chunk_ids` enforced at the tool boundary so the tool's/// behaviour matches the schema description. The retrieval RPC alsodiff --git a/crates/openhuman-core/src/memory/query/fetch_leaves_tests.rs b/crates/openhuman-core/src/memory/query/fetch_leaves_tests.rsindex 11bc8ba79f..ff7978cb56 100644--- a/crates/openhuman-core/src/memory/query/fetch_leaves_tests.rs+++ b/crates/openhuman-core/src/memory/query/fetch_leaves_tests.rs@@ -5,8 +5,8 @@ use tempfile::TempDir;use crate::config::Config;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,diff --git a/crates/openhuman-core/src/memory/query/ingest_document.rs b/crates/openhuman-core/src/memory/query/ingest_document.rsindex 543e9d4b36..ffcd878bcc 100644--- a/crates/openhuman-core/src/memory/query/ingest_document.rs+++ b/crates/openhuman-core/src/memory/query/ingest_document.rs@@ -1,11 +1,11 @@use crate::config::rpc as config_rpc;use crate::memory::tree::tree::rpc;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use chrono::{DateTime, Utc};use serde::Serialize;use serde_json::json;use tinymemory_api::chunks::SourceKind;+use tinytools::{Tool, ToolResult};/// The `document` ingest payload, as the driver's canonicaliser reads it.///diff --git a/crates/openhuman-core/src/memory/query/ingest_document_tests.rs b/crates/openhuman-core/src/memory/query/ingest_document_tests.rsindex 1bba2221ee..0699959a83 100644--- a/crates/openhuman-core/src/memory/query/ingest_document_tests.rs+++ b/crates/openhuman-core/src/memory/query/ingest_document_tests.rs@@ -5,8 +5,8 @@ use tempfile::TempDir;use crate::config::Config;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,diff --git a/crates/openhuman-core/src/memory/query/mod.rs b/crates/openhuman-core/src/memory/query/mod.rsindex 32d28e9acf..01333f2fce 100644--- a/crates/openhuman-core/src/memory/query/mod.rs+++ b/crates/openhuman-core/src/memory/query/mod.rs@@ -27,9 +27,9 @@ pub use query_source::MemoryTreeQuerySourceTool;pub use search_entities::MemoryTreeSearchEntitiesTool;pub use MemoryTreeTool as MemoryQueryTool;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolResult};/// Single multi-mode tool that consolidates all six memory-tree retrieval/// primitives behind one LLM-facing entry. The `mode` field routes to thediff --git a/crates/openhuman-core/src/memory/query/mod_memory_tree_dispatcher_tests_tests.rs b/crates/openhuman-core/src/memory/query/mod_memory_tree_dispatcher_tests_tests.rsindex 07ec454ec9..5fcd813cee 100644--- a/crates/openhuman-core/src/memory/query/mod_memory_tree_dispatcher_tests_tests.rs+++ b/crates/openhuman-core/src/memory/query/mod_memory_tree_dispatcher_tests_tests.rs@@ -1,8 +1,8 @@use super::*;use crate::memory::query::test_workspace::isolated_config;-use crate::tools::traits::Tool;use serde_json::json;use tempfile::TempDir;+use tinytools::Tool;#[test]fn memory_tree_tool_name_is_correct() {diff --git a/crates/openhuman-core/src/memory/query/query_source.rs b/crates/openhuman-core/src/memory/query/query_source.rsindex 95fcfd0808..072ef2b867 100644--- a/crates/openhuman-core/src/memory/query/query_source.rs+++ b/crates/openhuman-core/src/memory/query/query_source.rs@@ -1,9 +1,9 @@use crate::memory::api::chunks::SourceKind;use crate::memory::query::backend;use crate::memory::tree::retrieval::rpc::QuerySourceRequest;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolResult};pub struct MemoryTreeQuerySourceTool;diff --git a/crates/openhuman-core/src/memory/query/query_source_tests.rs b/crates/openhuman-core/src/memory/query/query_source_tests.rsindex aeb2c593a0..c9f5c7a1b1 100644--- a/crates/openhuman-core/src/memory/query/query_source_tests.rs+++ b/crates/openhuman-core/src/memory/query/query_source_tests.rs@@ -5,8 +5,8 @@ use tempfile::TempDir;use crate::config::Config;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,diff --git a/crates/openhuman-core/src/memory/query/search_entities.rs b/crates/openhuman-core/src/memory/query/search_entities.rsindex b1ada4ad50..e9976b7b47 100644--- a/crates/openhuman-core/src/memory/query/search_entities.rs+++ b/crates/openhuman-core/src/memory/query/search_entities.rs@@ -1,9 +1,9 @@use crate::memory::api::provider::MemoryProvider;use crate::memory::ops::guard::active_memory_guard;use crate::memory::tree::retrieval::rpc::SearchEntitiesRequest;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolResult};pub struct MemoryTreeSearchEntitiesTool;diff --git a/crates/openhuman-core/src/memory/query/search_entities_tests.rs b/crates/openhuman-core/src/memory/query/search_entities_tests.rsindex 880f8c962b..850514135c 100644--- a/crates/openhuman-core/src/memory/query/search_entities_tests.rs+++ b/crates/openhuman-core/src/memory/query/search_entities_tests.rs@@ -5,8 +5,8 @@ use tempfile::TempDir;use crate::config::Config;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,diff --git a/crates/openhuman-core/src/memory/tool_memory/prompt.rs b/crates/openhuman-core/src/memory/tool_memory/prompt.rsindex 0a970e5354..aae4cdb27c 100644--- a/crates/openhuman-core/src/memory/tool_memory/prompt.rs+++ b/crates/openhuman-core/src/memory/tool_memory/prompt.rs@@ -27,7 +27,7 @@use anyhow::Result;-use crate::agent::context::prompt::{PromptContext, PromptSection};+use crate::agent::prompts::{PromptContext, PromptSection};use crate::memory::api::tool_memory::{ToolMemoryPriority, ToolMemoryRule};diff --git a/crates/openhuman-core/src/memory/tools/collapsed.rs b/crates/openhuman-core/src/memory/tools/collapsed.rsindex 6bd7146660..4e1282fa71 100644--- a/crates/openhuman-core/src/memory/tools/collapsed.rs+++ b/crates/openhuman-core/src/memory/tools/collapsed.rs@@ -53,10 +53,10 @@ use crate::tools::implementations::meta::collapse::{any_external_effect, args_without_action, merge_action_schemas, resolve, strictest_permission,unknown_action_message, CollapsedAction,};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};#[cfg(test)]-use crate::tools::traits::ToolExposure;+use tinytools::ToolExposure;/// The advertised name.pub const MEMORY_TOOL_NAME: &str = "memory";diff --git a/crates/openhuman-core/src/memory/tools/doctor.rs b/crates/openhuman-core/src/memory/tools/doctor.rsindex b644a987b7..5364aec6a7 100644--- a/crates/openhuman-core/src/memory/tools/doctor.rs+++ b/crates/openhuman-core/src/memory/tools/doctor.rs@@ -14,10 +14,10 @@use crate::config::Config;use crate::memory::tree::health::report::run_doctor;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolExposure, ToolResult};/// Let the agent run the one-shot memory-pipeline diagnostic.pub struct MemoryDoctorTool {diff --git a/crates/openhuman-core/src/memory/tools/flavour.rs b/crates/openhuman-core/src/memory/tools/flavour.rsindex ca874f5289..92f829c5f1 100644--- a/crates/openhuman-core/src/memory/tools/flavour.rs+++ b/crates/openhuman-core/src/memory/tools/flavour.rs@@ -31,7 +31,7 @@ use serde_json::json;use crate::config::Config;use crate::memory::api::provider::MemoryProvider;-use crate::tools::traits::{PermissionLevel, Tool, ToolExposure, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolExposure, ToolResult};/// The seven persona facets, host-side (#5560).///diff --git a/crates/openhuman-core/src/memory/tools/forget.rs b/crates/openhuman-core/src/memory/tools/forget.rsindex bfbb3f5565..1e9f6ceaff 100644--- a/crates/openhuman-core/src/memory/tools/forget.rs+++ b/crates/openhuman-core/src/memory/tools/forget.rs@@ -2,10 +2,10 @@ use crate::memory::api::provider::MemoryCore;use crate::memory::ops::guard::active_memory_guard;use crate::security::policy::ToolOperation;use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolExposure, ToolResult};/// Let the agent forget/delete a memory entrypub struct MemoryForgetTool {diff --git a/crates/openhuman-core/src/memory/tools/goals.rs b/crates/openhuman-core/src/memory/tools/goals.rsindex cd3c8a905a..5233f380ef 100644--- a/crates/openhuman-core/src/memory/tools/goals.rs+++ b/crates/openhuman-core/src/memory/tools/goals.rs@@ -56,7 +56,7 @@ use crate::memory::api::provider::MemoryProvider;use crate::memory::goals::ops;use crate::memory::guard::MemoryGuard;use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};/// The guarded driver for this call, checked to serve the goals family.///diff --git a/crates/openhuman-core/src/memory/tools/goals_tests.rs b/crates/openhuman-core/src/memory/tools/goals_tests.rsindex 8bacec1cda..2a62c31cbb 100644--- a/crates/openhuman-core/src/memory/tools/goals_tests.rs+++ b/crates/openhuman-core/src/memory/tools/goals_tests.rs@@ -16,7 +16,7 @@ use std::ffi::OsString;use tempfile::TempDir;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,@@ -172,7 +172,7 @@ async fn missing_arguments_are_reported_as_tool_errors() {/// list; a flat `ReadOnly` would admit an edit on a channel that refuses one.#[test]fn permission_is_per_op_and_unknown_ops_report_the_ceiling() {- use crate::tools::traits::PermissionLevel;+ use tinytools::PermissionLevel;let goals = GoalsTool::new(std::env::temp_dir());assert_eq!(diff --git a/crates/openhuman-core/src/memory/tools/raw_store/kinds.rs b/crates/openhuman-core/src/memory/tools/raw_store/kinds.rsindex e9edf4cbdc..10f1fac56b 100644--- a/crates/openhuman-core/src/memory/tools/raw_store/kinds.rs+++ b/crates/openhuman-core/src/memory/tools/raw_store/kinds.rs@@ -11,7 +11,7 @@ use serde_json::{json, Value};use crate::memory::api::provider::MemoryProvider;use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};+use tinytools::{Tool, ToolExposure, ToolResult};pub struct MemoryStoreKindsTool;diff --git a/crates/openhuman-core/src/memory/tools/raw_store/mod_tests.rs b/crates/openhuman-core/src/memory/tools/raw_store/mod_tests.rsindex a7b6fb047e..1bbc3ca20a 100644--- a/crates/openhuman-core/src/memory/tools/raw_store/mod_tests.rs+++ b/crates/openhuman-core/src/memory/tools/raw_store/mod_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::Tool;+use tinytools::Tool;#[test]fn exports_memory_store_tools_with_stable_names() {diff --git a/crates/openhuman-core/src/memory/tools/raw_store/raw_chunks.rs b/crates/openhuman-core/src/memory/tools/raw_store/raw_chunks.rsindex ec10f9d7c6..4e4716fc2c 100644--- a/crates/openhuman-core/src/memory/tools/raw_store/raw_chunks.rs+++ b/crates/openhuman-core/src/memory/tools/raw_store/raw_chunks.rs@@ -11,7 +11,7 @@ use serde_json::json;use crate::memory::api::chunks::SourceKind;use crate::memory::api::provider::{ChunkQuery, MemoryProvider};use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};+use tinytools::{Tool, ToolExposure, ToolResult};pub struct MemoryStoreRawChunksTool;diff --git a/crates/openhuman-core/src/memory/tools/raw_store/raw_chunks_tests.rs b/crates/openhuman-core/src/memory/tools/raw_store/raw_chunks_tests.rsindex 1b01862165..1c2fdae546 100644--- a/crates/openhuman-core/src/memory/tools/raw_store/raw_chunks_tests.rs+++ b/crates/openhuman-core/src/memory/tools/raw_store/raw_chunks_tests.rs@@ -5,8 +5,8 @@ use tempfile::TempDir;use crate::config::Config;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,diff --git a/crates/openhuman-core/src/memory/tools/raw_store/raw_search.rs b/crates/openhuman-core/src/memory/tools/raw_store/raw_search.rsindex eba2e77581..5d4751e1a0 100644--- a/crates/openhuman-core/src/memory/tools/raw_store/raw_search.rs+++ b/crates/openhuman-core/src/memory/tools/raw_store/raw_search.rs@@ -12,7 +12,7 @@ use serde_json::json;use crate::memory::api::provider::MemoryProvider;use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};+use tinytools::{Tool, ToolExposure, ToolResult};pub struct MemoryStoreRawSearchTool;diff --git a/crates/openhuman-core/src/memory/tools/raw_store/raw_search_tests.rs b/crates/openhuman-core/src/memory/tools/raw_store/raw_search_tests.rsindex 1b0cc58b53..41de5b4a76 100644--- a/crates/openhuman-core/src/memory/tools/raw_store/raw_search_tests.rs+++ b/crates/openhuman-core/src/memory/tools/raw_store/raw_search_tests.rs@@ -5,8 +5,8 @@ use tempfile::TempDir;use crate::config::Config;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,diff --git a/crates/openhuman-core/src/memory/tools/recall.rs b/crates/openhuman-core/src/memory/tools/recall.rsindex 726f50aeda..69218965e7 100644--- a/crates/openhuman-core/src/memory/tools/recall.rs+++ b/crates/openhuman-core/src/memory/tools/recall.rs@@ -1,10 +1,10 @@use crate::agent::tinyagents::host::agent_memory::DEFAULT_AGENT_MEMORY_NAMESPACE;use crate::memory::api::provider::MemoryRecall;use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};use async_trait::async_trait;use serde_json::json;use std::fmt::Write;+use tinytools::{Tool, ToolExposure, ToolResult};/// Let the agent search its own memory.///diff --git a/crates/openhuman-core/src/memory/tools/search/chunk_context.rs b/crates/openhuman-core/src/memory/tools/search/chunk_context.rsindex 5c9bd72dac..dbb236a15e 100644--- a/crates/openhuman-core/src/memory/tools/search/chunk_context.rs+++ b/crates/openhuman-core/src/memory/tools/search/chunk_context.rs@@ -11,7 +11,7 @@ use std::fmt::Write;use crate::memory::api::provider::{ChunkQuery, MemoryProvider};use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};+use tinytools::{Tool, ToolExposure, ToolResult};pub struct MemoryChunkContextTool;diff --git a/crates/openhuman-core/src/memory/tools/search/hybrid_search.rs b/crates/openhuman-core/src/memory/tools/search/hybrid_search.rsindex 35b1d1c49a..623c97926d 100644--- a/crates/openhuman-core/src/memory/tools/search/hybrid_search.rs+++ b/crates/openhuman-core/src/memory/tools/search/hybrid_search.rs@@ -12,7 +12,7 @@ use std::fmt::Write;use crate::memory::api::provider::MemoryProvider;use crate::memory::api::types::MemoryItemKind;use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};+use tinytools::{Tool, ToolExposure, ToolResult};pub struct MemoryHybridSearchTool;diff --git a/crates/openhuman-core/src/memory/tools/search/vector_search.rs b/crates/openhuman-core/src/memory/tools/search/vector_search.rsindex 9bbdd6a691..d162dc5a6a 100644--- a/crates/openhuman-core/src/memory/tools/search/vector_search.rs+++ b/crates/openhuman-core/src/memory/tools/search/vector_search.rs@@ -15,8 +15,8 @@ use crate::memory::api::chunks::SourceKind;use crate::memory::api::provider::ChunkQuery;use crate::memory::api::provider::MemoryProvider;use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};use tinyinference_embeddings::{cosine_similarity_f64, mmr_select, MmrCandidate};+use tinytools::{Tool, ToolExposure, ToolResult};pub struct MemoryVectorSearchTool;diff --git a/crates/openhuman-core/src/memory/tools/store.rs b/crates/openhuman-core/src/memory/tools/store.rsindex 8daf078fae..b9db4a950c 100644--- a/crates/openhuman-core/src/memory/tools/store.rs+++ b/crates/openhuman-core/src/memory/tools/store.rs@@ -5,11 +5,11 @@ use crate::memory::ops::guard::active_memory_guard;use crate::memory::safety;use crate::security::policy::ToolOperation;use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolExposure, ToolResult};use async_trait::async_trait;use serde_json::json;use sha2::{Digest, Sha256};use std::sync::Arc;+use tinytools::{Tool, ToolExposure, ToolResult};/// Let the agent store memories — its own brain writespub struct MemoryStoreTool {diff --git a/crates/openhuman-core/src/memory/tools/tool_memory/list.rs b/crates/openhuman-core/src/memory/tools/tool_memory/list.rsindex da93de6ff7..59d6d2bdeb 100644--- a/crates/openhuman-core/src/memory/tools/tool_memory/list.rs+++ b/crates/openhuman-core/src/memory/tools/tool_memory/list.rs@@ -16,7 +16,7 @@ use serde_json::json;use crate::memory::ops::guard::active_memory_guard;use crate::memory::ops::tool_memory::NO_TOOL_MEMORY;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};pub struct MemoryToolsListTool;diff --git a/crates/openhuman-core/src/memory/tools/tool_memory/list_tests.rs b/crates/openhuman-core/src/memory/tools/tool_memory/list_tests.rsindex 9948e96f9d..edbdc39df2 100644--- a/crates/openhuman-core/src/memory/tools/tool_memory/list_tests.rs+++ b/crates/openhuman-core/src/memory/tools/tool_memory/list_tests.rs@@ -5,8 +5,8 @@ use tempfile::TempDir;use crate::config::Config;use crate::config::TEST_ENV_LOCK;-use crate::tools::traits::Tool;use serde_json::json;+use tinytools::Tool;struct WorkspaceEnvGuard {_lock: std::sync::MutexGuard<'static, ()>,diff --git a/crates/openhuman-core/src/memory/tools/tool_memory/mod_tests.rs b/crates/openhuman-core/src/memory/tools/tool_memory/mod_tests.rsindex 484b527f67..bb9bb67093 100644--- a/crates/openhuman-core/src/memory/tools/tool_memory/mod_tests.rs+++ b/crates/openhuman-core/src/memory/tools/tool_memory/mod_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::Tool;+use tinytools::Tool;#[test]fn exports_memory_tool_wrappers_with_stable_names() {diff --git a/crates/openhuman-core/src/memory/tools/tool_memory/put.rs b/crates/openhuman-core/src/memory/tools/tool_memory/put.rsindex 58cd87fb65..e6a8098b41 100644--- a/crates/openhuman-core/src/memory/tools/tool_memory/put.rs+++ b/crates/openhuman-core/src/memory/tools/tool_memory/put.rs@@ -29,7 +29,7 @@ use serde_json::json;use crate::memory::api::tool_memory::{ToolMemoryPriority, ToolMemoryRule, ToolMemorySource};use crate::memory::ops::guard::active_memory_guard;use crate::memory::ops::tool_memory::NO_TOOL_MEMORY;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};pub struct MemoryToolsPutTool;diff --git a/crates/openhuman-core/src/memory/tools/tool_memory/put_tests.rs b/crates/openhuman-core/src/memory/tools/tool_memory/put_tests.rsindex 6f51908e1b..4ba314ceef 100644--- a/crates/openhuman-core/src/memory/tools/tool_memory/put_tests.rs+++ b/crates/openhuman-core/src/memory/tools/tool_memory/put_tests.rs@@ -8,9 +8,9 @@ use crate::config::TEST_ENV_LOCK;use crate::memory::guard::policy::GUARD_DENIED_PREFIX;use crate::security::live_policy;use crate::security::policy::{AutonomyLevel, SecurityPolicy};-use crate::tools::traits::Tool;use serde_json::json;use std::sync::Arc;+use tinytools::Tool;/// Install `autonomy` as the live policy for this test thread only. Same/// shape `memory/guard/policy_tests.rs` uses; `#[tokio::test]`'sdiff --git a/crates/openhuman-core/src/platform/cost/tools.rs b/crates/openhuman-core/src/platform/cost/tools.rsindex cd664be7db..f924f8519d 100644--- a/crates/openhuman-core/src/platform/cost/tools.rs+++ b/crates/openhuman-core/src/platform/cost/tools.rs@@ -6,7 +6,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};use super::rpc;diff --git a/crates/openhuman-core/src/platform/cost/tools_tests.rs b/crates/openhuman-core/src/platform/cost/tools_tests.rsindex 25ec0587fd..d7efe34dbe 100644--- a/crates/openhuman-core/src/platform/cost/tools_tests.rs+++ b/crates/openhuman-core/src/platform/cost/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::{PermissionLevel, ToolScope};+use tinytools::{PermissionLevel, ToolScope};fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/platform/doctor/tools.rs b/crates/openhuman-core/src/platform/doctor/tools.rsindex 7e1dbba91b..2200178362 100644--- a/crates/openhuman-core/src/platform/doctor/tools.rs+++ b/crates/openhuman-core/src/platform/doctor/tools.rs@@ -9,7 +9,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/platform/doctor/tools_tests.rs b/crates/openhuman-core/src/platform/doctor/tools_tests.rsindex e06f325941..bbdca43eb7 100644--- a/crates/openhuman-core/src/platform/doctor/tools_tests.rs+++ b/crates/openhuman-core/src/platform/doctor/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::{PermissionLevel, ToolScope};+use tinytools::{PermissionLevel, ToolScope};fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/platform/health/tools.rs b/crates/openhuman-core/src/platform/health/tools.rsindex 2c2d976699..1048635a12 100644--- a/crates/openhuman-core/src/platform/health/tools.rs+++ b/crates/openhuman-core/src/platform/health/tools.rs@@ -3,7 +3,7 @@use async_trait::async_trait;use serde_json::json;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/platform/health/tools_tests.rs b/crates/openhuman-core/src/platform/health/tools_tests.rsindex 849785ae12..fce223fb7a 100644--- a/crates/openhuman-core/src/platform/health/tools_tests.rs+++ b/crates/openhuman-core/src/platform/health/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::{PermissionLevel, ToolScope};+use tinytools::{PermissionLevel, ToolScope};#[test]fn metadata() {diff --git a/crates/openhuman-core/src/platform/service/tools.rs b/crates/openhuman-core/src/platform/service/tools.rsindex 7d561f5b7a..4c24c06e49 100644--- a/crates/openhuman-core/src/platform/service/tools.rs+++ b/crates/openhuman-core/src/platform/service/tools.rs@@ -12,7 +12,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/platform/service/tools_tests.rs b/crates/openhuman-core/src/platform/service/tools_tests.rsindex 4d36f0def2..4d44293825 100644--- a/crates/openhuman-core/src/platform/service/tools_tests.rs+++ b/crates/openhuman-core/src/platform/service/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolScope;+use tinytools::ToolScope;fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/runtime/node/ops.rs b/crates/openhuman-core/src/runtime/node/ops.rsindex be50bbe08a..edee9f5754 100644--- a/crates/openhuman-core/src/runtime/node/ops.rs+++ b/crates/openhuman-core/src/runtime/node/ops.rs@@ -7,7 +7,8 @@ use crate::core::bus::BUS;use crate::core::events::DomainEvent;use crate::runtime::node::types::{ExecuteToolOutcome, RuntimeToolSummary};use crate::security::{CommandClass, SecurityPolicy};-use crate::tools::{self, PermissionLevel, Tool, ToolCallOptions, ToolScope};+use crate::tools;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolScope};use tracing::{debug, trace};fn tool_scope_label(scope: ToolScope) -> &'static str {diff --git a/crates/openhuman-core/src/search/engines/brave.rs b/crates/openhuman-core/src/search/engines/brave.rsindex 24defdcde0..57940b548e 100644--- a/crates/openhuman-core/src/search/engines/brave.rs+++ b/crates/openhuman-core/src/search/engines/brave.rs@@ -1,6 +1,6 @@use crate::config::Config;use crate::search::registry::SearchToolParams;-use crate::tools::Tool;+use tinytools::Tool;pub(crate) fn build(root_config: &Config, params: SearchToolParams) -> Vec<Box<dyn Tool>> {tracing::debug!("[search] active engine = brave (BYO direct API)");diff --git a/crates/openhuman-core/src/search/engines/disabled.rs b/crates/openhuman-core/src/search/engines/disabled.rsindex 471bdb03b9..88427347b4 100644--- a/crates/openhuman-core/src/search/engines/disabled.rs+++ b/crates/openhuman-core/src/search/engines/disabled.rs@@ -1,6 +1,6 @@use crate::config::Config;use crate::search::registry::SearchToolParams;-use crate::tools::Tool;+use tinytools::Tool;pub(crate) fn build(_: &Config, _: SearchToolParams) -> Vec<Box<dyn Tool>> {tracing::debug!("[search] disabled — no search tools registered");diff --git a/crates/openhuman-core/src/search/engines/exa.rs b/crates/openhuman-core/src/search/engines/exa.rsindex 53c7303c5d..f3e8bb0bbc 100644--- a/crates/openhuman-core/src/search/engines/exa.rs+++ b/crates/openhuman-core/src/search/engines/exa.rs@@ -1,6 +1,6 @@use crate::config::Config;use crate::search::registry::SearchToolParams;-use crate::tools::Tool;+use tinytools::Tool;/// Exa BYOK: every tool here calls `https://api.exa.ai` directly with the/// user's own key. Nothing in this surface routes through the managed backend.diff --git a/crates/openhuman-core/src/search/engines/managed.rs b/crates/openhuman-core/src/search/engines/managed.rsindex 0b8826a55d..dc1b3a14d9 100644--- a/crates/openhuman-core/src/search/engines/managed.rs+++ b/crates/openhuman-core/src/search/engines/managed.rs@@ -1,7 +1,7 @@use crate::config::Config;use crate::search::registry::SearchToolParams;-use crate::tools::Tool;use std::sync::Arc;+use tinytools::Tool;pub(crate) fn build(root_config: &Config, params: SearchToolParams) -> Vec<Box<dyn Tool>> {tracing::debug!(diff --git a/crates/openhuman-core/src/search/engines/parallel.rs b/crates/openhuman-core/src/search/engines/parallel.rsindex a83e133c48..1125e4fc51 100644--- a/crates/openhuman-core/src/search/engines/parallel.rs+++ b/crates/openhuman-core/src/search/engines/parallel.rs@@ -2,7 +2,7 @@ use std::sync::Arc;use crate::config::Config;use crate::search::registry::SearchToolParams;-use crate::tools::Tool;+use tinytools::Tool;pub(crate) fn build(root_config: &Config, params: SearchToolParams) -> Vec<Box<dyn Tool>> {tracing::debug!("[search] active engine = parallel (BYO direct API)");diff --git a/crates/openhuman-core/src/search/engines/querit.rs b/crates/openhuman-core/src/search/engines/querit.rsindex 2b9bbce780..3128e97f8e 100644--- a/crates/openhuman-core/src/search/engines/querit.rs+++ b/crates/openhuman-core/src/search/engines/querit.rs@@ -1,6 +1,6 @@use crate::config::Config;use crate::search::registry::SearchToolParams;-use crate::tools::Tool;+use tinytools::Tool;pub(crate) fn build(root_config: &Config, params: SearchToolParams) -> Vec<Box<dyn Tool>> {tracing::debug!("[search] active engine = querit (BYO direct API)");diff --git a/crates/openhuman-core/src/search/engines/tavily.rs b/crates/openhuman-core/src/search/engines/tavily.rsindex bd5803869a..dfb8092a28 100644--- a/crates/openhuman-core/src/search/engines/tavily.rs+++ b/crates/openhuman-core/src/search/engines/tavily.rs@@ -1,6 +1,6 @@use crate::config::Config;use crate::search::registry::SearchToolParams;-use crate::tools::Tool;+use tinytools::Tool;/// Tavily BYOK: every tool here calls `https://api.tavily.com` directly with the/// user's own key. Nothing in this surface routes through the managed backend.diff --git a/crates/openhuman-core/src/search/registry.rs b/crates/openhuman-core/src/search/registry.rsindex d233d7651b..51c2fe11d2 100644--- a/crates/openhuman-core/src/search/registry.rs+++ b/crates/openhuman-core/src/search/registry.rs@@ -1,6 +1,6 @@use crate::config::{Config, SearchEngine};-use crate::tools::Tool;use std::sync::Arc;+use tinytools::Tool;use super::engines;diff --git a/crates/openhuman-core/src/search/tools/brave.rs b/crates/openhuman-core/src/search/tools/brave.rsindex 10647d23ca..9cb5b9ed9b 100644--- a/crates/openhuman-core/src/search/tools/brave.rs+++ b/crates/openhuman-core/src/search/tools/brave.rs@@ -16,11 +16,11 @@//! key is wired up so the agent surfaces the misconfiguration instead//! of silently routing elsewhere.-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::{json, Value};use std::time::Duration;+use tinytools::{Tool, ToolCallOptions, ToolResult};const DEFAULT_API_BASE: &str = "https://api.search.brave.com/res/v1";diff --git a/crates/openhuman-core/src/search/tools/exa.rs b/crates/openhuman-core/src/search/tools/exa.rsindex 433a827c98..f52fa97b4c 100644--- a/crates/openhuman-core/src/search/tools/exa.rs+++ b/crates/openhuman-core/src/search/tools/exa.rs@@ -12,11 +12,11 @@//! to `api.exa.ai` -- the OpenHuman managed backend is never involved. The//! managed (`engine = "managed"`) path is untouched by this module.-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde::{Deserialize, Serialize};use serde_json::{json, Value};use std::time::Duration;+use tinytools::{Tool, ToolCallOptions, ToolResult};const DEFAULT_API_URL: &str = "https://api.exa.ai";diff --git a/crates/openhuman-core/src/search/tools/parallel.rs b/crates/openhuman-core/src/search/tools/parallel.rsindex a4d7399586..2437c80708 100644--- a/crates/openhuman-core/src/search/tools/parallel.rs+++ b/crates/openhuman-core/src/search/tools/parallel.rs@@ -41,8 +41,6 @@ pub use search::{ParallelSearchTool, SearchResponse, SearchResultItem};#[cfg(test)]use crate::integrations::IntegrationClient;#[cfg(test)]-use crate::tools::traits::Tool;-#[cfg(test)]use enrich::{enrich_payload, format_enrich_response, EnrichResponse};#[cfg(test)]use extract::ExtractResponse;@@ -52,3 +50,5 @@ use research::{format_research_response, research_payload, ResearchResponse};use serde_json::json;#[cfg(test)]use std::sync::Arc;+#[cfg(test)]+use tinytools::Tool;diff --git a/crates/openhuman-core/src/search/tools/parallel/chat.rs b/crates/openhuman-core/src/search/tools/parallel/chat.rsindex 68754ad34f..3d625d6495 100644--- a/crates/openhuman-core/src/search/tools/parallel/chat.rs+++ b/crates/openhuman-core/src/search/tools/parallel/chat.rs@@ -1,11 +1,11 @@//! Chat: `ParallelChatTool` and its response types.use crate::integrations::IntegrationClient;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolResult};// ── ParallelChatTool ────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/search/tools/parallel/dataset.rs b/crates/openhuman-core/src/search/tools/parallel/dataset.rsindex fe4ba24265..875ce2a28a 100644--- a/crates/openhuman-core/src/search/tools/parallel/dataset.rs+++ b/crates/openhuman-core/src/search/tools/parallel/dataset.rs@@ -1,11 +1,11 @@//! Dataset: `ParallelDatasetTool` (FindAll, async).use crate::integrations::IntegrationClient;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolResult};// ── ParallelDatasetTool ─────────────────────────────────────────────diff --git a/crates/openhuman-core/src/search/tools/parallel/enrich.rs b/crates/openhuman-core/src/search/tools/parallel/enrich.rsindex ddb3753eda..6522aaf3b6 100644--- a/crates/openhuman-core/src/search/tools/parallel/enrich.rs+++ b/crates/openhuman-core/src/search/tools/parallel/enrich.rs@@ -1,11 +1,11 @@//! Enrich: `ParallelEnrichTool` and its response types.use crate::integrations::IntegrationClient;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolResult};// ── ParallelEnrichTool ──────────────────────────────────────────────diff --git a/crates/openhuman-core/src/search/tools/parallel/extract.rs b/crates/openhuman-core/src/search/tools/parallel/extract.rsindex 6b072c1fd7..2872df0346 100644--- a/crates/openhuman-core/src/search/tools/parallel/extract.rs+++ b/crates/openhuman-core/src/search/tools/parallel/extract.rs@@ -2,11 +2,11 @@use super::search::truncate_chars;use crate::integrations::IntegrationClient;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolResult};#[derive(Debug, Deserialize)]pub(super) struct ExtractResponse {diff --git a/crates/openhuman-core/src/search/tools/parallel/research.rs b/crates/openhuman-core/src/search/tools/parallel/research.rsindex 9ad5775bf7..b8a1a00de8 100644--- a/crates/openhuman-core/src/search/tools/parallel/research.rs+++ b/crates/openhuman-core/src/search/tools/parallel/research.rs@@ -1,11 +1,11 @@//! Research: `ParallelResearchTool` and its response types.use crate::integrations::IntegrationClient;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolResult};// ── ParallelResearchTool ────────────────────────────────────────────diff --git a/crates/openhuman-core/src/search/tools/parallel/search.rs b/crates/openhuman-core/src/search/tools/parallel/search.rsindex 0dc64fa7dd..a0905a8533 100644--- a/crates/openhuman-core/src/search/tools/parallel/search.rs+++ b/crates/openhuman-core/src/search/tools/parallel/search.rs@@ -1,12 +1,12 @@//! Search: `ParallelSearchTool` and its response types.use crate::integrations::IntegrationClient;-use crate::tools::traits::{Tool, ToolResult};pub(super) use crate::util::truncate_chars_flagged as truncate_chars;use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolResult};// ── Response types ──────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/search/tools/querit.rs b/crates/openhuman-core/src/search/tools/querit.rsindex f2f0df12fd..acf2d110d7 100644--- a/crates/openhuman-core/src/search/tools/querit.rs+++ b/crates/openhuman-core/src/search/tools/querit.rs@@ -10,11 +10,11 @@//! time-range, country, and language filters. This integration calls the//! Querit API directly using the user's configured API key.-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde::{Deserialize, Serialize};use serde_json::{json, Map, Value};use std::time::Duration;+use tinytools::{Tool, ToolCallOptions, ToolResult};const DEFAULT_API_URL: &str = "https://api.querit.ai/v1";diff --git a/crates/openhuman-core/src/search/tools/searxng.rs b/crates/openhuman-core/src/search/tools/searxng.rsindex 3fa3d06573..6d1ef0b3e1 100644--- a/crates/openhuman-core/src/search/tools/searxng.rs+++ b/crates/openhuman-core/src/search/tools/searxng.rs@@ -4,7 +4,6 @@//! keeps the output shape small and stable for agents and MCP clients://! `{ title, url, snippet, source }`.-use crate::tools::traits::{Tool, ToolCallOptions, ToolCategory, ToolResult};use crate::util::utf8_safe_prefix_at_byte_boundary;use anyhow::Context;use async_trait::async_trait;@@ -12,6 +11,7 @@ use serde::{Deserialize, Serialize};use serde_json::json;use std::sync::OnceLock;use std::time::Duration;+use tinytools::{Tool, ToolCallOptions, ToolCategory, ToolResult};const DEFAULT_SOURCE: &str = "searxng";/// Maximum number of SearXNG results accepted by the public tool surface.diff --git a/crates/openhuman-core/src/search/tools/seltz.rs b/crates/openhuman-core/src/search/tools/seltz.rsindex db60551a40..b7b780b936 100644--- a/crates/openhuman-core/src/search/tools/seltz.rs+++ b/crates/openhuman-core/src/search/tools/seltz.rs@@ -10,12 +10,12 @@//! custom crawler/index with sub-200ms median latency. Unlike the Parallel//! integration, this calls the Seltz API directly — no backend proxy needed.-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use crate::util::utf8_safe_prefix_at_byte_boundary;use async_trait::async_trait;use serde::{Deserialize, Serialize};use serde_json::json;use std::time::Duration;+use tinytools::{Tool, ToolCallOptions, ToolResult};/// Default Seltz API base URL.const DEFAULT_API_URL: &str = "https://api.seltz.ai/v1";diff --git a/crates/openhuman-core/src/search/tools/tavily.rs b/crates/openhuman-core/src/search/tools/tavily.rsindex 42f299316f..0f378955cf 100644--- a/crates/openhuman-core/src/search/tools/tavily.rs+++ b/crates/openhuman-core/src/search/tools/tavily.rs@@ -31,8 +31,8 @@ pub use types::{// `TavilyClient`s and result rows to exercise the tools' HTTP-adjacent// formatting directly.#[cfg(test)]-use crate::tools::traits::{Tool, ToolCallOptions};-#[cfg(test)]pub(crate) use client::TavilyClient;#[cfg(test)]use serde_json::{json, Value};+#[cfg(test)]+use tinytools::{Tool, ToolCallOptions};diff --git a/crates/openhuman-core/src/search/tools/tavily/client.rs b/crates/openhuman-core/src/search/tools/tavily/client.rsindex 9f28b3045f..23b0859909 100644--- a/crates/openhuman-core/src/search/tools/tavily/client.rs+++ b/crates/openhuman-core/src/search/tools/tavily/client.rs@@ -4,9 +4,9 @@use super::types::{escape_link_destination, escape_link_text, non_empty, TavilyImage, TavilyResultItem,};-use crate::tools::traits::ToolResult;use serde_json::Value;use std::time::Duration;+use tinytools::ToolResult;const DEFAULT_API_URL: &str = "https://api.tavily.com";const SEARCH_EXCERPT_MAX_CHARS: usize = 500;diff --git a/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs b/crates/openhuman-core/src/search/tools/tavily/extract_tool.rsindex c3e25b7819..83377d2e92 100644--- a/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs+++ b/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs@@ -4,9 +4,9 @@ use super::client::TavilyClient;use super::types::{copy_string, non_empty, TavilyExtractResponse, TavilyExtractResult};use crate::search::tools::tavily::types::escape_link_destination;use crate::search::tools::tavily::types::escape_link_text;-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::{json, Value};+use tinytools::{Tool, ToolCallOptions, ToolResult};/// Retrieve full page contents for a list of URLs (`POST /extract`).pub struct TavilyExtractTool {diff --git a/crates/openhuman-core/src/search/tools/tavily/search_tool.rs b/crates/openhuman-core/src/search/tools/tavily/search_tool.rsindex 2760cae028..070d4dc3ce 100644--- a/crates/openhuman-core/src/search/tools/tavily/search_tool.rs+++ b/crates/openhuman-core/src/search/tools/tavily/search_tool.rs@@ -2,9 +2,9 @@use super::client::TavilyClient;use super::types::{copy_bool, copy_domain_filter, copy_string, non_empty, TavilySearchResponse};-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::{json, Value};+use tinytools::{Tool, ToolCallOptions, ToolResult};/// Web / news / finance search via the Tavily API (`POST /search`).pub struct TavilySearchTool {diff --git a/crates/openhuman-core/src/search/tools/tinyfish.rs b/crates/openhuman-core/src/search/tools/tinyfish.rsindex ee8dd15fce..d99f47017c 100644--- a/crates/openhuman-core/src/search/tools/tinyfish.rs+++ b/crates/openhuman-core/src/search/tools/tinyfish.rs@@ -12,12 +12,12 @@//! Agent runs execute browser workflows on remote websites.use crate::integrations::IntegrationClient;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};use crate::util::truncate_chars_flagged as truncate_chars;use async_trait::async_trait;use serde::Deserialize;use serde_json::json;use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};fn non_empty_string<'a>(args: &'a serde_json::Value, key: &str) -> anyhow::Result<&'a str> {args.get(key)diff --git a/crates/openhuman-core/src/search/tools/web_search.rs b/crates/openhuman-core/src/search/tools/web_search.rsindex 6a787eecdd..a7b7fb59af 100644--- a/crates/openhuman-core/src/search/tools/web_search.rs+++ b/crates/openhuman-core/src/search/tools/web_search.rs@@ -12,11 +12,11 @@use super::{SearchResponse, SearchResultItem, SeltzSearchTool};use crate::config::Config;use crate::integrations::IntegrationClient;-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::{json, Value};use sha2::{Digest, Sha256};use std::sync::Arc;+use tinytools::{Tool, ToolCallOptions, ToolResult};/// Provider the OpenHuman Managed search path resolves to today. Exa powers/// the overwhelming majority of managed search traffic, so it is the labelleddiff --git a/crates/openhuman-core/src/security/approval/gate.rs b/crates/openhuman-core/src/security/approval/gate.rsindex 19cb13f265..caa43fc51b 100644--- a/crates/openhuman-core/src/security/approval/gate.rs+++ b/crates/openhuman-core/src/security/approval/gate.rs@@ -1,5 +1,5 @@//! `ApprovalGate` — middleware between the agent and any tool whose-//! [`crate::tools::Tool::external_effect`] returns `true`.+//! [`tinytools::Tool::external_effect`] returns `true`.//!//! Flow (issue #1339)://! 1. Agent harness calls [`ApprovalGate::intercept`] with the tooldiff --git a/crates/openhuman-core/src/security/approval/mod.rs b/crates/openhuman-core/src/security/approval/mod.rsindex b3d0e83a4e..142017a42c 100644--- a/crates/openhuman-core/src/security/approval/mod.rs+++ b/crates/openhuman-core/src/security/approval/mod.rs@@ -2,7 +2,7 @@//!//! [`ApprovalGate`] (in [`gate`]) is the single approval path — async//! middleware between the agent and any tool whose-//! [`crate::tools::Tool::external_effect`] returns `true`. It+//! [`tinytools::Tool::external_effect`] returns `true`. It//! persists pending rows in SQLite, parks the tool-call future on a oneshot,//! and resumes when the UI dispatches `approval_decide`. Introduced for issue//! #1339 so external-channel writes (Slack post, email send, calendar create,diff --git a/crates/openhuman-core/src/security/credentials/tools.rs b/crates/openhuman-core/src/security/credentials/tools.rsindex 9ba4ef5ec9..76b4e1c5d2 100644--- a/crates/openhuman-core/src/security/credentials/tools.rs+++ b/crates/openhuman-core/src/security/credentials/tools.rs@@ -16,7 +16,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::security::credentials;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};macro_rules! emit {($outcome:expr, $name:literal) => {{diff --git a/crates/openhuman-core/src/security/credentials/tools_tests.rs b/crates/openhuman-core/src/security/credentials/tools_tests.rsindex 2f374a8b9a..0b98191fb7 100644--- a/crates/openhuman-core/src/security/credentials/tools_tests.rs+++ b/crates/openhuman-core/src/security/credentials/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::{PermissionLevel, ToolScope};+use tinytools::{PermissionLevel, ToolScope};fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/security/tools.rs b/crates/openhuman-core/src/security/tools.rsindex c2d62b0322..3e5ce43a18 100644--- a/crates/openhuman-core/src/security/tools.rs+++ b/crates/openhuman-core/src/security/tools.rs@@ -9,7 +9,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/security/tools_tests.rs b/crates/openhuman-core/src/security/tools_tests.rsindex b7b2e0af31..ac1252d5d5 100644--- a/crates/openhuman-core/src/security/tools_tests.rs+++ b/crates/openhuman-core/src/security/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::{PermissionLevel, ToolScope};+use tinytools::{PermissionLevel, ToolScope};#[tokio::test]async fn metadata_and_execute() {diff --git a/crates/openhuman-core/src/skills/catalog/agent/skill_setup/prompt.rs b/crates/openhuman-core/src/skills/catalog/agent/skill_setup/prompt.rsindex 4b963a5e81..8056400ce5 100644--- a/crates/openhuman-core/src/skills/catalog/agent/skill_setup/prompt.rs+++ b/crates/openhuman-core/src/skills/catalog/agent/skill_setup/prompt.rs@@ -1,6 +1,6 @@//! System prompt builder for the `skill_setup` built-in agent.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/skills/catalog/tools.rs b/crates/openhuman-core/src/skills/catalog/tools.rsindex dc2e2e0201..a2a8982981 100644--- a/crates/openhuman-core/src/skills/catalog/tools.rs+++ b/crates/openhuman-core/src/skills/catalog/tools.rs@@ -11,7 +11,7 @@ use serde_json::json;use crate::config::Config;use crate::tools::status::{NOT_FOUND_MARKER, UNSUPPORTED_MARKER};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};use super::ops;diff --git a/crates/openhuman-core/src/skills/e2e_plumbing_tests.rs b/crates/openhuman-core/src/skills/e2e_plumbing_tests.rsindex 165996bd49..6de78d03c2 100644--- a/crates/openhuman-core/src/skills/e2e_plumbing_tests.rs+++ b/crates/openhuman-core/src/skills/e2e_plumbing_tests.rs@@ -38,10 +38,10 @@ use crate::skills::ops_types::WorkflowScope;use crate::skills::registry::get_workflow;use crate::skills::run_log;use crate::skills::runtime::await_run_outcome;-use crate::tools::traits::Tool;use tinyinference_llm::message::AssistantMessage;use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};use tinyinference_llm::tool::ToolCall;+use tinytools::Tool;// ── Mock LLM ─────────────────────────────────────────────────────────────// Minimal scripted model: pops queued ModelResponses in order. Mirrors thediff --git a/crates/openhuman-core/src/skills/e2e_run_tests.rs b/crates/openhuman-core/src/skills/e2e_run_tests.rsindex 288bae2568..b7cb090b9a 100644--- a/crates/openhuman-core/src/skills/e2e_run_tests.rs+++ b/crates/openhuman-core/src/skills/e2e_run_tests.rs@@ -40,10 +40,10 @@ use crate::config::{MultimodalConfig, MultimodalFileConfig};use crate::inference::provider::factory::test_provider_override;use crate::skills::runtime::{await_run_outcome, spawn_workflow_run_background};use crate::skills::schemas::resolve_workspace_dir;-use crate::tools::traits::Tool;use tinyinference_llm::message::AssistantMessage;use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};use tinyinference_llm::tool::ToolCall;+use tinytools::Tool;/// Serialize this module's tests (each touches process-global state).fn serial() -> &'static tokio::sync::Mutex<()> {diff --git a/crates/openhuman-core/src/skills/runtime/agent/skill_executor/prompt.rs b/crates/openhuman-core/src/skills/runtime/agent/skill_executor/prompt.rsindex 4d37edcfb6..6f5cf4bdf9 100644--- a/crates/openhuman-core/src/skills/runtime/agent/skill_executor/prompt.rs+++ b/crates/openhuman-core/src/skills/runtime/agent/skill_executor/prompt.rs@@ -1,6 +1,6 @@//! System prompt builder for the `skill_executor` built-in agent.-use crate::agent::context::prompt::{+use crate::agent::prompts::{render_safety, render_tools, render_user_files, render_workspace, PromptContext,};use anyhow::Result;diff --git a/crates/openhuman-core/src/skills/runtime/tools.rs b/crates/openhuman-core/src/skills/runtime/tools.rsindex 341403fa5c..5d8c9d532d 100644--- a/crates/openhuman-core/src/skills/runtime/tools.rs+++ b/crates/openhuman-core/src/skills/runtime/tools.rs@@ -6,7 +6,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};use super::ops::{resolve_runtimes, RuntimeRequirement};diff --git a/crates/openhuman-core/src/skills/search.rs b/crates/openhuman-core/src/skills/search.rsindex a8d250e68c..a6aa3263a5 100644--- a/crates/openhuman-core/src/skills/search.rs+++ b/crates/openhuman-core/src/skills/search.rs@@ -41,8 +41,8 @@ use super::ops_discover::{discover_workflows_with_profile, is_workspace_trusted}use super::ops_types::{Workflow, WorkflowScope};use super::tools::{skill_allowed, SkillAllowlist};use crate::config::Config;-use crate::tools::traits::{Tool, ToolResult};use crate::util::bm25::Bm25Index;+use tinytools::{Tool, ToolResult};/// How many matches a search returns when the caller does not say.const DEFAULT_LIMIT: usize = 5;diff --git a/crates/openhuman-core/src/skills/tools.rs b/crates/openhuman-core/src/skills/tools.rsindex b1b210b4d3..e5fea24b20 100644--- a/crates/openhuman-core/src/skills/tools.rs+++ b/crates/openhuman-core/src/skills/tools.rs@@ -27,7 +27,7 @@ use serde_json::json;#[cfg(test)]use crate::config::Config;#[cfg(test)]-use crate::tools::traits::{PermissionLevel, Tool};+use tinytools::{PermissionLevel, Tool};mod helpers;mod read;diff --git a/crates/openhuman-core/src/skills/tools/read.rs b/crates/openhuman-core/src/skills/tools/read.rsindex 6acda6440f..54decd4713 100644--- a/crates/openhuman-core/src/skills/tools/read.rs+++ b/crates/openhuman-core/src/skills/tools/read.rs@@ -8,7 +8,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};use super::super::ops_discover::{discover_workflows_with_profile, is_workspace_trusted, profile_local_skill_ids,diff --git a/crates/openhuman-core/src/skills/tools/write.rs b/crates/openhuman-core/src/skills/tools/write.rsindex 66da65d1d4..5a5f95fcdc 100644--- a/crates/openhuman-core/src/skills/tools/write.rs+++ b/crates/openhuman-core/src/skills/tools/write.rs@@ -8,7 +8,7 @@ use async_trait::async_trait;use serde_json::json;use crate::config::Config;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};use super::super::ops_create::{create_workflow, CreateWorkflowParams};use super::super::ops_install::{diff --git a/crates/openhuman-core/src/skills/tools_tests.rs b/crates/openhuman-core/src/skills/tools_tests.rsindex 6ea13e6b66..82476d9bd2 100644--- a/crates/openhuman-core/src/skills/tools_tests.rs+++ b/crates/openhuman-core/src/skills/tools_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolScope;+use tinytools::ToolScope;fn cfg() -> Arc<Config> {Arc::new(Config::default())diff --git a/crates/openhuman-core/src/skills/tools_uninstall.rs b/crates/openhuman-core/src/skills/tools_uninstall.rsindex cbbed43d7f..e461b31914 100644--- a/crates/openhuman-core/src/skills/tools_uninstall.rs+++ b/crates/openhuman-core/src/skills/tools_uninstall.rs@@ -3,7 +3,7 @@use async_trait::async_trait;use serde_json::json;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};use super::helpers::read_required_str;use crate::skills::ops_install::{uninstall_workflow, UninstallWorkflowParams};diff --git a/crates/openhuman-core/src/tools/agent_policy/engine.rs b/crates/openhuman-core/src/tools/agent_policy/engine.rsindex 11dcdf7d09..0607824529 100644--- a/crates/openhuman-core/src/tools/agent_policy/engine.rs+++ b/crates/openhuman-core/src/tools/agent_policy/engine.rs@@ -1,6 +1,6 @@use super::{TaskProfile, TaskRiskLevel, ToolCapability, ToolPolicyAction, ToolPolicyDecision};-use crate::tools::{PermissionLevel, Tool};use std::collections::{BTreeSet, HashMap, HashSet};+use tinytools::{PermissionLevel, Tool};/// Builds deterministic per-session policy snapshots from the active agent,/// channel, configured channel permissions, and available tool registry.diff --git a/crates/openhuman-core/src/tools/agent_policy/engine_tests.rs b/crates/openhuman-core/src/tools/agent_policy/engine_tests.rsindex ff8ea516e3..fe0c03a2c4 100644--- a/crates/openhuman-core/src/tools/agent_policy/engine_tests.rs+++ b/crates/openhuman-core/src/tools/agent_policy/engine_tests.rs@@ -1,7 +1,7 @@use super::*;-use crate::tools::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use std::collections::{HashMap, HashSet};+use tinytools::{PermissionLevel, Tool, ToolResult};struct PolicyTestTool {name: &'static str,diff --git a/crates/openhuman-core/src/tools/agent_policy/prompt_tests.rs b/crates/openhuman-core/src/tools/agent_policy/prompt_tests.rsindex b8392dbbe3..eaf39068ec 100644--- a/crates/openhuman-core/src/tools/agent_policy/prompt_tests.rs+++ b/crates/openhuman-core/src/tools/agent_policy/prompt_tests.rs@@ -1,8 +1,8 @@use super::*;use crate::tools::agent_policy::ToolPolicyEngine;-use crate::tools::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use std::collections::{HashMap, HashSet};+use tinytools::{PermissionLevel, Tool, ToolResult};struct PromptTestTool {name: String,diff --git a/crates/openhuman-core/src/tools/agent_policy/types.rs b/crates/openhuman-core/src/tools/agent_policy/types.rsindex e177c92de8..ca5f13dfb8 100644--- a/crates/openhuman-core/src/tools/agent_policy/types.rs+++ b/crates/openhuman-core/src/tools/agent_policy/types.rs@@ -1,5 +1,5 @@-use crate::tools::PermissionLevel;use std::collections::{BTreeSet, HashMap, HashSet};+use tinytools::PermissionLevel;const NO_TOOLS_ALLOWED_SENTINEL: &str = "__openhuman_no_policy_allowed_tools__";diff --git a/crates/openhuman-core/src/tools/generated.rs b/crates/openhuman-core/src/tools/generated.rsindex 9751c47e60..f64d709978 100644--- a/crates/openhuman-core/src/tools/generated.rs+++ b/crates/openhuman-core/src/tools/generated.rs@@ -11,9 +11,7 @@ use async_trait::async_trait;use serde::{Deserialize, Serialize};use serde_json::Value;-use crate::tools::traits::{- humanize_tool_name, PermissionLevel, Tool, ToolCategory, ToolResult, ToolScope,-};+use tinytools::{humanize_tool_name, PermissionLevel, Tool, ToolCategory, ToolResult, ToolScope};#[derive(Debug, Clone)]pub struct GeneratedToolDefinition {diff --git a/crates/openhuman-core/src/tools/host_extensions.rs b/crates/openhuman-core/src/tools/host_extensions.rsnew file mode 100644index 0000000000..c4f593a79e--- /dev/null+++ b/crates/openhuman-core/src/tools/host_extensions.rs@@ -0,0 +1,37 @@+//! OpenHuman-owned metadata recovered from TinyTools' erased extension seams.+//!+//! These helpers are intentionally separate from the `tinytools` vocabulary:+//! pack registries, delegation targets, and generated-tool runtime metadata are+//! host implementation details, not portable tool-trait APIs.++use crate::agent::orchestration::tools::DelegationTarget;+use crate::agent::tool_policy::GeneratedToolRuntimeContext;+use crate::tools::toolpacks::PackRegistryHandle;+use tinytools::Tool;++/// Reads a tool's pack-registry handle from its erased host extension.+pub fn pack_registry_handle(tool: &dyn Tool) -> Option<&PackRegistryHandle> {+ tool.host_extension()+ .and_then(|any| any.downcast_ref::<PackRegistryHandle>())+}++/// Reads the target agent a synthesized `delegate_*` tool routes to.+pub fn delegation_target(tool: &dyn Tool) -> Option<&str> {+ tool.host_extension()+ .and_then(|any| any.downcast_ref::<DelegationTarget>())+ .map(|target| target.0.as_str())+}++/// Reads generated-tool runtime metadata from the erased per-call extension.+pub fn generated_runtime_context(+ tool: &dyn Tool,+ args: &serde_json::Value,+) -> Option<GeneratedToolRuntimeContext> {+ tool.host_call_extension(args)+ .and_then(|any| any.downcast::<GeneratedToolRuntimeContext>().ok())+ .map(|boxed| *boxed)+}++#[cfg(test)]+#[path = "traits_tests.rs"]+mod tests;diff --git a/crates/openhuman-core/src/tools/impl/browser/browser.rs b/crates/openhuman-core/src/tools/impl/browser/browser.rsindex 5b4a0e3576..e98098997a 100644--- a/crates/openhuman-core/src/tools/impl/browser/browser.rs+++ b/crates/openhuman-core/src/tools/impl/browser/browser.rs@@ -47,13 +47,13 @@ pub(super) use types::{pub use types::{BrowserAction, ComputerUseConfig};use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolResult};use anyhow::Context;use async_trait::async_trait;use serde_json::{json, Value};use std::process::Stdio;use std::sync::Arc;use std::time::Duration;+use tinytools::{Tool, ToolResult};use tokio::process::Command;use tracing::debug;diff --git a/crates/openhuman-core/src/tools/impl/browser/browser_open.rs b/crates/openhuman-core/src/tools/impl/browser/browser_open.rsindex 411dd1b031..18d878a2ec 100644--- a/crates/openhuman-core/src/tools/impl/browser/browser_open.rs+++ b/crates/openhuman-core/src/tools/impl/browser/browser_open.rs@@ -1,8 +1,8 @@use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;+use tinytools::{Tool, ToolResult};/// Open approved HTTPS URLs in Brave Browser (no scraping, no DOM automation).pub struct BrowserOpenTool {diff --git a/crates/openhuman-core/src/tools/impl/browser/image_info.rs b/crates/openhuman-core/src/tools/impl/browser/image_info.rsindex fb2d3eaaf4..720808576f 100644--- a/crates/openhuman-core/src/tools/impl/browser/image_info.rs+++ b/crates/openhuman-core/src/tools/impl/browser/image_info.rs@@ -1,9 +1,9 @@use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::fmt::Write;use std::sync::Arc;+use tinytools::{Tool, ToolResult};/// Maximum file size we will read and base64-encode (5 MB).const MAX_IMAGE_BYTES: u64 = 5_242_880;diff --git a/crates/openhuman-core/src/tools/impl/document/mod.rs b/crates/openhuman-core/src/tools/impl/document/mod.rsindex 1e768f65f6..753024f37d 100644--- a/crates/openhuman-core/src/tools/impl/document/mod.rs+++ b/crates/openhuman-core/src/tools/impl/document/mod.rs@@ -34,7 +34,7 @@ use serde_json::{json, Value};use crate::agent::artifacts::{create_artifact, fail_artifact, finalize_artifact, ArtifactKind};use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};mod engine;/// The document wire contract, shared with the `tinydocs` module.diff --git a/crates/openhuman-core/src/tools/impl/document/types.rs b/crates/openhuman-core/src/tools/impl/document/types.rsindex ae20d3e516..1748627068 100644--- a/crates/openhuman-core/src/tools/impl/document/types.rs+++ b/crates/openhuman-core/src/tools/impl/document/types.rs@@ -39,7 +39,7 @@ pub use crate::tools::implementations::document::format::spec::document::{#[allow(unused_imports)]pub use crate::tools::implementations::document::format::spec::DocumentSection;-/// Tool output returned via [`crate::tools::traits::ToolResult`]+/// Tool output returned via [`tinytools::ToolResult`]/// as the JSON `data` field.#[derive(Debug, Clone, Serialize, Deserialize)]pub struct GenerateDocumentOutput {diff --git a/crates/openhuman-core/src/tools/impl/filesystem/apply_patch.rs b/crates/openhuman-core/src/tools/impl/filesystem/apply_patch.rsindex 5d075d7b0a..d310a5dd9d 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/apply_patch.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/apply_patch.rs@@ -8,13 +8,13 @@use crate::agent::file_state;use crate::security::{CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::collections::HashMap;use std::path::PathBuf;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};const MAX_FILE_BYTES: u64 = 5 * 1024 * 1024;const MAX_EDITS: usize = 50;diff --git a/crates/openhuman-core/src/tools/impl/filesystem/csv_export.rs b/crates/openhuman-core/src/tools/impl/filesystem/csv_export.rsindex 1286a2e848..bec764ba02 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/csv_export.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/csv_export.rs@@ -1,9 +1,9 @@use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{Tool, ToolCallOptions, ToolResult};/// Export structured data (JSON array of objects) as a CSV file to the workspace.pub struct CsvExportTool {@@ -120,8 +120,8 @@ impl Tool for CsvExportTool {})}- fn permission_level(&self) -> crate::tools::traits::PermissionLevel {- crate::tools::traits::PermissionLevel::Write+ fn permission_level(&self) -> tinytools::PermissionLevel {+ tinytools::PermissionLevel::Write}async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {diff --git a/crates/openhuman-core/src/tools/impl/filesystem/edit_file.rs b/crates/openhuman-core/src/tools/impl/filesystem/edit_file.rsindex 6f17b73c36..e4b6f83006 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/edit_file.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/edit_file.rs@@ -8,11 +8,11 @@use crate::agent::file_state;use crate::security::{CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};const MAX_FILE_BYTES: u64 = 5 * 1024 * 1024;diff --git a/crates/openhuman-core/src/tools/impl/filesystem/file_read.rs b/crates/openhuman-core/src/tools/impl/filesystem/file_read.rsindex 801e1916fc..d25ba1d5be 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/file_read.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/file_read.rs@@ -1,10 +1,10 @@use crate::agent::file_state;use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{Tool, ToolCallOptions, ToolResult};const MAX_FILE_SIZE_BYTES: u64 = 10 * 1024 * 1024;/// Keep a page below the harness's 16 KiB per-result ceiling so the continuationdiff --git a/crates/openhuman-core/src/tools/impl/filesystem/file_write.rs b/crates/openhuman-core/src/tools/impl/filesystem/file_write.rsindex 4aae37af53..5ceddbba63 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/file_write.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/file_write.rs@@ -1,10 +1,10 @@use crate::agent::file_state;use crate::security::{CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};const MAX_CONTENT_BYTES: usize = 5 * 1024 * 1024;diff --git a/crates/openhuman-core/src/tools/impl/filesystem/git_operations.rs b/crates/openhuman-core/src/tools/impl/filesystem/git_operations.rsindex 9966309a3b..e25650b292 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/git_operations.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/git_operations.rs@@ -1,10 +1,10 @@use crate::security::{AutonomyLevel, CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::{Path, PathBuf};use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{Tool, ToolCallOptions, ToolResult};use super::git_operations_config::{disallowed_config_refusal, first_disallowed_repo_config_key, hardened_git,diff --git a/crates/openhuman-core/src/tools/impl/filesystem/glob_search.rs b/crates/openhuman-core/src/tools/impl/filesystem/glob_search.rsindex 45faa065c1..67f626bb58 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/glob_search.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/glob_search.rs@@ -24,13 +24,13 @@//! beyond what the readers already permit.use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use glob::Pattern;use serde_json::json;use std::path::Path;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use walkdir::WalkDir;const DEFAULT_MAX_RESULTS: usize = 500;diff --git a/crates/openhuman-core/src/tools/impl/filesystem/grep.rs b/crates/openhuman-core/src/tools/impl/filesystem/grep.rsindex a4179d603c..5ced6886da 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/grep.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/grep.rs@@ -6,13 +6,13 @@//! same path-sandboxing + rate-limiting as `file_read`.use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use regex::Regex;use serde_json::json;use std::path::Path;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use walkdir::WalkDir;const DEFAULT_MAX_MATCHES: usize = 200;diff --git a/crates/openhuman-core/src/tools/impl/filesystem/list_files.rs b/crates/openhuman-core/src/tools/impl/filesystem/list_files.rsindex 56005164da..9b81c4c80c 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/list_files.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/list_files.rs@@ -5,11 +5,11 @@//! directories, and symlinks. Path sandboxing matches `file_read`.use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};const MAX_ENTRIES: usize = 1_000;diff --git a/crates/openhuman-core/src/tools/impl/filesystem/read_diff.rs b/crates/openhuman-core/src/tools/impl/filesystem/read_diff.rsindex 6034dcba2c..3269f81d6a 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/read_diff.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/read_diff.rs@@ -1,10 +1,10 @@//! Tool: read_diff — structured git diff output for the Critic archetype.-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::PathBuf;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};/// Returns `git diff` output in a structured format.pub struct ReadDiffTool {diff --git a/crates/openhuman-core/src/tools/impl/filesystem/run_linter.rs b/crates/openhuman-core/src/tools/impl/filesystem/run_linter.rsindex f8993e803a..b918874b65 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/run_linter.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/run_linter.rs@@ -1,10 +1,10 @@//! Tool: run_linter — run linting tools for the Critic archetype.-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::PathBuf;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};/// Runs linters (cargo clippy, eslint) and returns structured findings.pub struct RunLinterTool {diff --git a/crates/openhuman-core/src/tools/impl/filesystem/run_tests.rs b/crates/openhuman-core/src/tools/impl/filesystem/run_tests.rsindex a91e948803..56437e1b78 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/run_tests.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/run_tests.rs@@ -1,10 +1,10 @@//! Tool: run_tests — run test suites for the Critic archetype.-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::PathBuf;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};/// Runs test suites (cargo test, vitest) and returns pass/fail with output.pub struct RunTestsTool {diff --git a/crates/openhuman-core/src/tools/impl/filesystem/update_memory_md.rs b/crates/openhuman-core/src/tools/impl/filesystem/update_memory_md.rsindex 43d20e40f4..2e627e6d53 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/update_memory_md.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/update_memory_md.rs@@ -1,6 +1,5 @@//! Tool: update_memory_md — append or update sections in MEMORY.md or SKILL.md.-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::json;use std::collections::HashMap;@@ -8,6 +7,7 @@ use std::path::{Path, PathBuf};use std::sync::atomic::{AtomicU64, Ordering};use std::sync::{Arc, LazyLock, Mutex};use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};/// Allowed workspace markdown files this tool may modify.const ALLOWED_FILES: &[&str] = &["MEMORY.md", "SKILL.md"];diff --git a/crates/openhuman-core/src/tools/impl/meta/collapse.rs b/crates/openhuman-core/src/tools/impl/meta/collapse.rsindex cd87bcdb22..57d779f4d9 100644--- a/crates/openhuman-core/src/tools/impl/meta/collapse.rs+++ b/crates/openhuman-core/src/tools/impl/meta/collapse.rs@@ -38,7 +38,7 @@ use std::collections::BTreeMap;use serde_json::{json, Map, Value};-use crate::tools::{PermissionLevel, Tool};+use tinytools::{PermissionLevel, Tool};/// One member of a collapsed family: the action name the model passes, and the/// tool that serves it.diff --git a/crates/openhuman-core/src/tools/impl/meta/collapse_tests.rs b/crates/openhuman-core/src/tools/impl/meta/collapse_tests.rsindex 101b765b8a..0bdff285b2 100644--- a/crates/openhuman-core/src/tools/impl/meta/collapse_tests.rs+++ b/crates/openhuman-core/src/tools/impl/meta/collapse_tests.rs@@ -1,6 +1,6 @@use super::*;-use crate::tools::ToolResult;use async_trait::async_trait;+use tinytools::ToolResult;struct Stub {name: &'static str,diff --git a/crates/openhuman-core/src/tools/impl/meta/mod.rs b/crates/openhuman-core/src/tools/impl/meta/mod.rsindex 9dd68c00a0..61c4e020ac 100644--- a/crates/openhuman-core/src/tools/impl/meta/mod.rs+++ b/crates/openhuman-core/src/tools/impl/meta/mod.rs@@ -1,7 +1,7 @@//! Tools *about* the tool surface itself.//!//! Two members: [`tool_search`], the lookup half of-//! [`ToolExposure::Deferred`](crate::tools::ToolExposure). It sits+//! [`ToolExposure::Deferred`](tinytools::ToolExposure). It sits//! in its own family rather than under `system/` because it is not a capability//! the host offers the user — it is the model asking what it is able to do.diff --git a/crates/openhuman-core/src/tools/impl/meta/tool_search.rs b/crates/openhuman-core/src/tools/impl/meta/tool_search.rsindex b3cfdb4e97..d37939d3ee 100644--- a/crates/openhuman-core/src/tools/impl/meta/tool_search.rs+++ b/crates/openhuman-core/src/tools/impl/meta/tool_search.rs@@ -38,8 +38,8 @@ use std::sync::{Arc, RwLock};use anyhow::Result;use serde_json::{json, Value};-use crate::tools::{PermissionLevel, Tool, ToolCategory, ToolResult, ToolSpec};use crate::util::bm25::Bm25Index;+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult, ToolSpec};/// How many matches a search returns when the caller does not say.const DEFAULT_LIMIT: usize = 5;@@ -265,7 +265,7 @@ pub fn strip_deferred_from_visible(visible: &mut std::collections::HashSet<String>,tools: &[Box<dyn Tool>],) -> Vec<ToolSpec> {- use crate::tools::ToolExposure;+ use tinytools::ToolExposure;let mut deferred = Vec::new();for tool in tools {diff --git a/crates/openhuman-core/src/tools/impl/meta/tool_search_tests.rs b/crates/openhuman-core/src/tools/impl/meta/tool_search_tests.rsindex d40f5999ba..5ae6d4ee5a 100644--- a/crates/openhuman-core/src/tools/impl/meta/tool_search_tests.rs+++ b/crates/openhuman-core/src/tools/impl/meta/tool_search_tests.rs@@ -89,7 +89,7 @@ fn ranking_is_stable_across_identical_queries() {struct ExposureTestTool {name: &'static str,description: &'static str,- exposure: crate::tools::ToolExposure,+ exposure: tinytools::ToolExposure,}#[async_trait::async_trait]@@ -106,7 +106,7 @@ impl Tool for ExposureTestTool {json!({"type": "object"})}- fn exposure(&self) -> crate::tools::ToolExposure {+ fn exposure(&self) -> tinytools::ToolExposure {self.exposure}@@ -121,7 +121,7 @@ impl Tool for ExposureTestTool {/// Stripping without the index would make every deferred tool unreachable.#[test]fn a_deferred_tool_leaves_the_wire_and_is_found_by_tool_search() {- use crate::tools::ToolExposure;+ use tinytools::ToolExposure;let tools: Vec<Box<dyn Tool>> = vec![Box::new(ToolSearchTool::new()),Box::new(ExposureTestTool {diff --git a/crates/openhuman-core/src/tools/impl/network/curl.rs b/crates/openhuman-core/src/tools/impl/network/curl.rsindex cc756da649..bac8178f9a 100644--- a/crates/openhuman-core/src/tools/impl/network/curl.rs+++ b/crates/openhuman-core/src/tools/impl/network/curl.rs@@ -8,13 +8,13 @@use super::url_guard::{normalize_allowed_domains, validate_url_with_dns_check};use crate::security::{CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use futures_util::StreamExt;use sha2::{Digest, Sha256};use std::path::{Component, Path, PathBuf};use std::sync::Arc;use std::time::Duration;+use tinytools::{PermissionLevel, Tool, ToolResult};use tokio::fs;use tokio::io::AsyncWriteExt;diff --git a/crates/openhuman-core/src/tools/impl/network/gitbooks.rs b/crates/openhuman-core/src/tools/impl/network/gitbooks.rsindex 83e053c5de..8d29097402 100644--- a/crates/openhuman-core/src/tools/impl/network/gitbooks.rs+++ b/crates/openhuman-core/src/tools/impl/network/gitbooks.rs@@ -2,10 +2,10 @@//! GitBook MCP server through the shared `crate::mcp::http_client` path.use crate::mcp::http_client::{redact_endpoint, McpHttpClient};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::{json, Value};use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct GitbooksSearchTool {client: Arc<McpHttpClient>,diff --git a/crates/openhuman-core/src/tools/impl/network/gmail_unsubscribe.rs b/crates/openhuman-core/src/tools/impl/network/gmail_unsubscribe.rsindex 3447c2e2f4..60d184755e 100644--- a/crates/openhuman-core/src/tools/impl/network/gmail_unsubscribe.rs+++ b/crates/openhuman-core/src/tools/impl/network/gmail_unsubscribe.rs@@ -1,5 +1,5 @@-use crate::tools::traits::{Tool, ToolCategory, ToolResult};use async_trait::async_trait;+use tinytools::{Tool, ToolCategory, ToolResult};pub struct GmailUnsubscribeTool;diff --git a/crates/openhuman-core/src/tools/impl/network/gmail_unsubscribe_tests.rs b/crates/openhuman-core/src/tools/impl/network/gmail_unsubscribe_tests.rsindex c389dfc1d7..fcfc1f9dcd 100644--- a/crates/openhuman-core/src/tools/impl/network/gmail_unsubscribe_tests.rs+++ b/crates/openhuman-core/src/tools/impl/network/gmail_unsubscribe_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::tools::traits::ToolContent;+use tinytools::ToolContent;#[tokio::test]async fn test_gmail_unsubscribe_valid() {diff --git a/crates/openhuman-core/src/tools/impl/network/http_request.rs b/crates/openhuman-core/src/tools/impl/network/http_request.rsindex 0271203d01..0882a0ce8e 100644--- a/crates/openhuman-core/src/tools/impl/network/http_request.rs+++ b/crates/openhuman-core/src/tools/impl/network/http_request.rs@@ -1,8 +1,8 @@use super::url_guard::{normalize_allowed_domains, validate_url_with_dns_check};use crate::config::HttpRequestConfig;use crate::security::{CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;+use tinytools::{PermissionLevel, Tool, ToolResult};// Only used by the `web3`-gated x402 402-retry path below.#[cfg(feature = "web3")]use base64::engine::Engine as _;diff --git a/crates/openhuman-core/src/tools/impl/network/mcp.rs b/crates/openhuman-core/src/tools/impl/network/mcp.rsindex 402337a61f..03061693bd 100644--- a/crates/openhuman-core/src/tools/impl/network/mcp.rs+++ b/crates/openhuman-core/src/tools/impl/network/mcp.rs@@ -1,9 +1,9 @@use crate::mcp::config_servers::{McpRegistrySource, McpServerRegistry};use crate::security::{SecurityPolicy, ToolOperation};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use serde_json::{json, Value};use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};pub struct McpListServersTool {registry: Arc<McpServerRegistry>,diff --git a/crates/openhuman-core/src/tools/impl/network/mcp_setup.rs b/crates/openhuman-core/src/tools/impl/network/mcp_setup.rsindex b08676c5dd..dcb728a51c 100644--- a/crates/openhuman-core/src/tools/impl/network/mcp_setup.rs+++ b/crates/openhuman-core/src/tools/impl/network/mcp_setup.rs@@ -20,7 +20,7 @@ use serde_json::{json, Value};use crate::config::Config;use crate::mcp::registry::setup_ops;-use crate::tools::traits::{PermissionLevel, Tool, ToolCategory, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolResult};// ── Helpers ──────────────────────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/tools/impl/network/web_fetch.rs b/crates/openhuman-core/src/tools/impl/network/web_fetch.rsindex bd3fd57663..b6e06c825c 100644--- a/crates/openhuman-core/src/tools/impl/network/web_fetch.rs+++ b/crates/openhuman-core/src/tools/impl/network/web_fetch.rs@@ -9,11 +9,11 @@use super::url_guard::{normalize_allowed_domains, validate_url_with_dns_check};use crate::config::HttpRequestConfig;use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use std::time::Duration;+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct WebFetchTool {security: Arc<SecurityPolicy>,diff --git a/crates/openhuman-core/src/tools/impl/presentation/mod.rs b/crates/openhuman-core/src/tools/impl/presentation/mod.rsindex 35f575b087..dd3f62f13f 100644--- a/crates/openhuman-core/src/tools/impl/presentation/mod.rs+++ b/crates/openhuman-core/src/tools/impl/presentation/mod.rs@@ -39,7 +39,7 @@ use crate::agent::artifacts::{create_artifact, fail_artifact, finalize_artifact, read_artifact_bytes, ArtifactKind,};use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};mod engine;mod types;diff --git a/crates/openhuman-core/src/tools/impl/presentation/types.rs b/crates/openhuman-core/src/tools/impl/presentation/types.rsindex b8141ac6ec..4791b084ef 100644--- a/crates/openhuman-core/src/tools/impl/presentation/types.rs+++ b/crates/openhuman-core/src/tools/impl/presentation/types.rs@@ -124,7 +124,7 @@ pub struct GeneratePresentationInput {pub slides: Vec<SlideSpec>,}-/// Tool output returned via [`crate::tools::traits::ToolResult`]+/// Tool output returned via [`tinytools::ToolResult`]/// as the JSON `data` field.#[derive(Debug, Clone, Serialize, Deserialize)]pub struct GeneratePresentationOutput {diff --git a/crates/openhuman-core/src/tools/impl/system/command_output.rs b/crates/openhuman-core/src/tools/impl/system/command_output.rsindex 6b80d8d7b6..c8ebb2a5bc 100644--- a/crates/openhuman-core/src/tools/impl/system/command_output.rs+++ b/crates/openhuman-core/src/tools/impl/system/command_output.rs@@ -26,7 +26,7 @@//! as raw stdout so existing callers that parse a command's output (e.g. `pwd`)//! keep working unchanged.-use crate::tools::traits::ToolResult;+use tinytools::ToolResult;/// Hint appended after the exit code for the exit statuses that almost always/// mean "this exact command cannot succeed on retry here". Empty for every otherdiff --git a/crates/openhuman-core/src/tools/impl/system/current_time.rs b/crates/openhuman-core/src/tools/impl/system/current_time.rsindex 4ee7f1e8b2..9df5cd0f4b 100644--- a/crates/openhuman-core/src/tools/impl/system/current_time.rs+++ b/crates/openhuman-core/src/tools/impl/system/current_time.rs@@ -5,11 +5,11 @@//! having to shell out to `date`. Read-only, no arguments beyond an optional//! IANA timezone for a convenience conversion.-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use chrono::{Local, SecondsFormat, Utc};use chrono_tz::Tz;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};pub struct CurrentTimeTool;diff --git a/crates/openhuman-core/src/tools/impl/system/detect_tools.rs b/crates/openhuman-core/src/tools/impl/system/detect_tools.rsindex e82c086b55..b251e5adc3 100644--- a/crates/openhuman-core/src/tools/impl/system/detect_tools.rs+++ b/crates/openhuman-core/src/tools/impl/system/detect_tools.rs@@ -4,10 +4,10 @@//! assuming. Read-only: it only scans `$PATH` for executables (no subprocesses,//! no writes), so it is safe in every access mode.-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::PathBuf;+use tinytools::{PermissionLevel, Tool, ToolResult};/// Common developer tools probed when the caller doesn't specify a list.const DEFAULT_CANDIDATES: &[&str] = &[diff --git a/crates/openhuman-core/src/tools/impl/system/insert_sql_record.rs b/crates/openhuman-core/src/tools/impl/system/insert_sql_record.rsindex 49c7cbcb9e..79ba20443e 100644--- a/crates/openhuman-core/src/tools/impl/system/insert_sql_record.rs+++ b/crates/openhuman-core/src/tools/impl/system/insert_sql_record.rs@@ -1,8 +1,8 @@//! Tool: insert_sql_record — insert an episodic record into the FTS5 memory database.-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult};/// Valid values for the `role` parameter.const VALID_ROLES: &[&str] = &["user", "assistant", "tool"];diff --git a/crates/openhuman-core/src/tools/impl/system/install_tool.rs b/crates/openhuman-core/src/tools/impl/system/install_tool.rsindex 8ab5ba2393..c7235a9a1d 100644--- a/crates/openhuman-core/src/tools/impl/system/install_tool.rs+++ b/crates/openhuman-core/src/tools/impl/system/install_tool.rs@@ -12,11 +12,11 @@//! `npm -g`, `cargo install`) work without elevation.use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use std::time::Duration;+use tinytools::{PermissionLevel, Tool, ToolResult};use tokio::process::Command as TokioCommand;use tokio::time::timeout;diff --git a/crates/openhuman-core/src/tools/impl/system/lsp.rs b/crates/openhuman-core/src/tools/impl/system/lsp.rsindex 06c60a504a..a4fea9ef88 100644--- a/crates/openhuman-core/src/tools/impl/system/lsp.rs+++ b/crates/openhuman-core/src/tools/impl/system/lsp.rs@@ -15,9 +15,9 @@//! 3. When enabled but no backend is wired, the tool returns a clear//! "not yet implemented" error instead of silently misbehaving.-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult};/// Env var that gates LSP tool registration.pub const LSP_ENABLED_ENV: &str = "OPENHUMAN_LSP_ENABLED";diff --git a/crates/openhuman-core/src/tools/impl/system/node_exec.rs b/crates/openhuman-core/src/tools/impl/system/node_exec.rsindex 0cae5771d4..2b34f1598f 100644--- a/crates/openhuman-core/src/tools/impl/system/node_exec.rs+++ b/crates/openhuman-core/src/tools/impl/system/node_exec.rs@@ -24,12 +24,12 @@use crate::agent::host_runtime::RuntimeAdapter;use crate::runtime::javascript::NodeBootstrap;use crate::security::{CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use std::time::Duration;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};/// Absolute ceiling a caller may request via `timeout_secs`. There is **no**/// default timeout — `node_exec` runs scripts that legitimately take minutesdiff --git a/crates/openhuman-core/src/tools/impl/system/npm_exec.rs b/crates/openhuman-core/src/tools/impl/system/npm_exec.rsindex bf4a9bdd2a..d773bf0930 100644--- a/crates/openhuman-core/src/tools/impl/system/npm_exec.rs+++ b/crates/openhuman-core/src/tools/impl/system/npm_exec.rs@@ -20,12 +20,12 @@use crate::agent::host_runtime::RuntimeAdapter;use crate::runtime::javascript::NodeBootstrap;use crate::security::{CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use std::time::Duration;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};/// Absolute ceiling callers can request via `timeout_secs`. There is **no**/// default timeout — `npm install`/build steps on a cold cache or slow networkdiff --git a/crates/openhuman-core/src/tools/impl/system/proxy_config.rs b/crates/openhuman-core/src/tools/impl/system/proxy_config.rsindex 2b3b2bb03c..bbd0216976 100644--- a/crates/openhuman-core/src/tools/impl/system/proxy_config.rs+++ b/crates/openhuman-core/src/tools/impl/system/proxy_config.rs@@ -2,12 +2,12 @@ use crate::config::{runtime_proxy_config, set_runtime_proxy_config, Config, ProxyConfig, ProxyScope,};use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolResult};use crate::util::MaybeSet;use async_trait::async_trait;use serde_json::{json, Value};use std::fs;use std::sync::Arc;+use tinytools::{Tool, ToolResult};pub struct ProxyConfigTool {config: Arc<Config>,diff --git a/crates/openhuman-core/src/tools/impl/system/pushover.rs b/crates/openhuman-core/src/tools/impl/system/pushover.rsindex 4c14d77f1c..783db60777 100644--- a/crates/openhuman-core/src/tools/impl/system/pushover.rs+++ b/crates/openhuman-core/src/tools/impl/system/pushover.rs@@ -1,9 +1,9 @@use crate::security::SecurityPolicy;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::PathBuf;use std::sync::Arc;+use tinytools::{Tool, ToolResult};const PUSHOVER_API_URL: &str = "https://api.pushover.net/1/messages.json";const PUSHOVER_REQUEST_TIMEOUT_SECS: u64 = 15;diff --git a/crates/openhuman-core/src/tools/impl/system/python_exec.rs b/crates/openhuman-core/src/tools/impl/system/python_exec.rsindex 01a76c3c68..727011be95 100644--- a/crates/openhuman-core/src/tools/impl/system/python_exec.rs+++ b/crates/openhuman-core/src/tools/impl/system/python_exec.rs@@ -19,12 +19,12 @@use crate::agent::host_runtime::RuntimeAdapter;use crate::runtime::python::PythonBootstrap;use crate::security::{CommandClass, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};use async_trait::async_trait;use serde_json::json;use std::sync::Arc;use std::time::Duration;use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};/// Absolute ceiling a caller may request via `timeout_secs`. No default timeout —/// Python scripts legitimately take minutes; a deadline applies only whendiff --git a/crates/openhuman-core/src/tools/impl/system/resolve_time.rs b/crates/openhuman-core/src/tools/impl/system/resolve_time.rsindex 1f21432bc5..9cc8e9f0e0 100644--- a/crates/openhuman-core/src/tools/impl/system/resolve_time.rs+++ b/crates/openhuman-core/src/tools/impl/system/resolve_time.rs@@ -30,11 +30,11 @@//! - `value` — the representation named by the optional `format` arg//! (defaults to `unix_s`), as a string, for copy-paste.-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use async_trait::async_trait;use chrono::{DateTime, Duration, Local, NaiveDate, NaiveDateTime, SecondsFormat, Utc};use chrono_tz::Tz;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};pub struct ResolveTimeTool;diff --git a/crates/openhuman-core/src/tools/impl/system/retrieve_tool_output.rs b/crates/openhuman-core/src/tools/impl/system/retrieve_tool_output.rsindex 418f3d9517..abc2ded99f 100644--- a/crates/openhuman-core/src/tools/impl/system/retrieve_tool_output.rs+++ b/crates/openhuman-core/src/tools/impl/system/retrieve_tool_output.rs@@ -7,9 +7,9 @@//!//! Read-only, no side effects, no path/network access.-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct RetrieveToolOutputTool;diff --git a/crates/openhuman-core/src/tools/impl/system/schedule.rs b/crates/openhuman-core/src/tools/impl/system/schedule.rsindex 30fd20d3b0..c4c2d72054 100644--- a/crates/openhuman-core/src/tools/impl/system/schedule.rs+++ b/crates/openhuman-core/src/tools/impl/system/schedule.rs@@ -1,12 +1,12 @@use crate::config::Config;use crate::cron::{self, DeliveryConfig, Schedule, SessionTarget};use crate::security::SecurityPolicy;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use anyhow::Result;use async_trait::async_trait;use chrono::{DateTime, Utc};use serde_json::json;use std::sync::Arc;+use tinytools::{PermissionLevel, Tool, ToolResult};/// Tool that lets the agent manage recurring and one-shot scheduled tasks.pub struct ScheduleTool {diff --git a/crates/openhuman-core/src/tools/impl/system/shell.rs b/crates/openhuman-core/src/tools/impl/system/shell.rsindex 9c783162f9..8c5bdb84a4 100644--- a/crates/openhuman-core/src/tools/impl/system/shell.rs+++ b/crates/openhuman-core/src/tools/impl/system/shell.rs@@ -2,13 +2,13 @@ use crate::agent::host_runtime::RuntimeAdapter;use crate::runtime::javascript::NodeBootstrap;use crate::runtime::python::PythonBootstrap;use crate::security::{AuditLogger, CommandExecutionLog, GateDecision, SecurityPolicy};-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};use async_trait::async_trait;use serde_json::json;use std::path::{Path, PathBuf};use std::sync::Arc;use std::time::{Duration, Instant};use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolTimeout};/// Maximum output size in bytes (1MB).const MAX_OUTPUT_BYTES: usize = 1_048_576;diff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests_schema_and_env_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests_schema_and_env_tests.rsindex 83b906a336..3b3a0d3144 100644--- a/crates/openhuman-core/src/tools/impl/system/shell_tests_schema_and_env_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests_schema_and_env_tests.rs@@ -266,7 +266,7 @@ async fn shell_uses_workspace_descriptor_root_as_cwd() {let result = tool.execute_with_context(json!({"command": "pwd"}),- crate::tools::traits::ToolCallOptions {+ tinytools::ToolCallOptions {prefer_markdown: false,},Some(&ctx),diff --git a/crates/openhuman-core/src/tools/impl/system/tool_stats.rs b/crates/openhuman-core/src/tools/impl/system/tool_stats.rsindex 75b3bf8c11..7386c67b0a 100644--- a/crates/openhuman-core/src/tools/impl/system/tool_stats.rs+++ b/crates/openhuman-core/src/tools/impl/system/tool_stats.rs@@ -2,10 +2,10 @@use crate::agent::learning::tool_tracker::ToolStats;use crate::memory::ops::guard::active_memory_guard;-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;use tinymemory_api::provider::MemoryCore as _;use tinymemory_api::types::MemoryCategory;+use tinytools::{Tool, ToolResult};/// Holds no memory handle: it resolves the guarded driver per call, so the/// tool registry no longer has to be handed an engine just to build this.diff --git a/crates/openhuman-core/src/tools/impl/system/update_apply.rs b/crates/openhuman-core/src/tools/impl/system/update_apply.rsindex 8aaa2027f9..dda87bfda7 100644--- a/crates/openhuman-core/src/tools/impl/system/update_apply.rs+++ b/crates/openhuman-core/src/tools/impl/system/update_apply.rs@@ -26,7 +26,7 @@ use serde_json::{json, Value};use crate::platform::update;use crate::security::{SecurityPolicy, ToolOperation};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct UpdateApplyTool {security: Arc<SecurityPolicy>,diff --git a/crates/openhuman-core/src/tools/impl/system/update_check.rs b/crates/openhuman-core/src/tools/impl/system/update_check.rsindex 873bf654c3..d2f7e0fcd2 100644--- a/crates/openhuman-core/src/tools/impl/system/update_check.rs+++ b/crates/openhuman-core/src/tools/impl/system/update_check.rs@@ -11,7 +11,7 @@ use async_trait::async_trait;use serde_json::{json, Value};use crate::platform::update;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct UpdateCheckTool;diff --git a/crates/openhuman-core/src/tools/impl/system/workspace_state.rs b/crates/openhuman-core/src/tools/impl/system/workspace_state.rsindex a0ef826926..e9624bfa88 100644--- a/crates/openhuman-core/src/tools/impl/system/workspace_state.rs+++ b/crates/openhuman-core/src/tools/impl/system/workspace_state.rs@@ -1,9 +1,9 @@//! Tool: read_workspace_state — read-only workspace overview for Orchestrator/Planner.-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use async_trait::async_trait;use serde_json::json;use std::path::PathBuf;+use tinytools::{PermissionLevel, Tool, ToolResult};/// Returns a summary of the workspace: git status, file tree, recent commits.pub struct WorkspaceStateTool {diff --git a/crates/openhuman-core/src/tools/mod.rs b/crates/openhuman-core/src/tools/mod.rsindex 3356daaaa4..010f45294d 100644--- a/crates/openhuman-core/src/tools/mod.rs+++ b/crates/openhuman-core/src/tools/mod.rs@@ -1,6 +1,7 @@pub mod agent_policy;mod capability;pub mod generated;+pub mod host_extensions;pub mod ops;pub mod orchestrator_tools;pub mod policy;@@ -10,7 +11,6 @@ mod schemas;pub mod status;pub mod timeout;pub mod toolpacks;-pub mod traits;pub(crate) mod user_filter;#[path = "impl/mod.rs"]@@ -69,8 +69,4 @@ pub use schemas::{all_controller_schemas as all_tools_controller_schemas,all_registered_controllers as all_tools_registered_controllers,};-pub use traits::{- PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolContent, ToolExposure, ToolResult,- ToolScope, ToolSpec,-};pub(crate) use user_filter::filter_tools_by_user_preference;diff --git a/crates/openhuman-core/src/tools/orchestrator_tools.rs b/crates/openhuman-core/src/tools/orchestrator_tools.rsindex 8b6f4b6957..4795667e33 100644--- a/crates/openhuman-core/src/tools/orchestrator_tools.rs+++ b/crates/openhuman-core/src/tools/orchestrator_tools.rs@@ -30,8 +30,8 @@//! [`SubagentEntry::AgentId`]: crate::agent::harness::definition::SubagentEntry::AgentId//! [`SubagentEntry::Skills`]: crate::agent::harness::definition::SubagentEntry::Skills-use crate::agent::context::prompt::ConnectedIntegration;use crate::agent::harness::definition::{AgentDefinition, AgentDefinitionRegistry, SubagentEntry};+use crate::agent::prompts::ConnectedIntegration;// SpawnWorkerThreadTool import kept commented while the worker-thread spawn is// temporarily disabled (see tinyhumansai/openhuman#1624).diff --git a/crates/openhuman-core/src/tools/schemas/web_search.rs b/crates/openhuman-core/src/tools/schemas/web_search.rsindex 26e9f111c4..ae1accbb6b 100644--- a/crates/openhuman-core/src/tools/schemas/web_search.rs+++ b/crates/openhuman-core/src/tools/schemas/web_search.rs@@ -7,7 +7,7 @@ use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;use crate::rpc::RpcOutcome;use crate::search::tools::SEARXNG_MAX_RESULTS;-use crate::tools::traits::Tool;+use tinytools::Tool;pub(super) fn handle_web_search(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {diff --git a/crates/openhuman-core/src/tools/timeout/mod.rs b/crates/openhuman-core/src/tools/timeout/mod.rsindex b677ed1c1f..04ddc1cc40 100644--- a/crates/openhuman-core/src/tools/timeout/mod.rs+++ b/crates/openhuman-core/src/tools/timeout/mod.rs@@ -167,8 +167,8 @@ const TOOL_TIMEOUT_GRACE_SECS: u64 = 5;////// Moved out of the retired legacy `engine::tools` module during the tinyagents/// migration (issue #4249); it lives here next to the timeout constants it uses.-pub fn resolve_tool_deadline(policy: crate::tools::traits::ToolTimeout) -> (Option<Duration>, u64) {- use crate::tools::traits::ToolTimeout;+pub fn resolve_tool_deadline(policy: tinytools::ToolTimeout) -> (Option<Duration>, u64) {+ use tinytools::ToolTimeout;match policy {ToolTimeout::Inherit => {let s = tool_execution_timeout_secs();diff --git a/crates/openhuman-core/src/tools/toolpacks/ops.rs b/crates/openhuman-core/src/tools/toolpacks/ops.rsindex 49682e5d12..2a071cfb60 100644--- a/crates/openhuman-core/src/tools/toolpacks/ops.rs+++ b/crates/openhuman-core/src/tools/toolpacks/ops.rs@@ -5,7 +5,7 @@ use std::sync::{Arc, Weak};use super::registry;use super::tools::{PackRegistryHandle, UseSkillTool, USE_SKILL};-use crate::tools::traits::Tool;+use tinytools::Tool;/// Append `use_skill` to a freshly built registry.///@@ -64,7 +64,7 @@ fn for_each_pack_tool(if tool.name() != USE_SKILL {continue;}- if let Some(handle) = crate::tools::traits::pack_registry_handle(tool.as_ref()) {+ if let Some(handle) = crate::tools::host_extensions::pack_registry_handle(tool.as_ref()) {edit(handle);bound += 1;}@@ -155,7 +155,7 @@ pub fn is_withheld_from(agent_id: &str, tool: &str) -> bool {/// agent carries **unpacked** — a delegate no pack withholds, and therefore/// one it advertises by construction.///-/// [`delegation_target`]: crate::tools::traits::delegation_target+/// [`delegation_target`]: crate::tools::host_extensions::delegation_target////// Inside a closed pack, a tool that is itself a hand-off (e.g. `create_skill`)/// stays reachable: it is a route, not a raw tool. A tool whose group an embedder@@ -176,14 +176,14 @@ pub fn closed_by_direct_handoff(agent_id: &str, tools: &[&dyn Tool]) -> Vec<&'stlet reachable_owners: HashSet<&str> = tools.iter().filter(|tool| registry::pack_for_tool(tool.name()).is_none())- .filter_map(|tool| crate::tools::traits::delegation_target(*tool))+ .filter_map(|tool| crate::tools::host_extensions::delegation_target(*tool)).collect();if reachable_owners.is_empty() {return Vec::new();}let handoffs: HashSet<&str> = tools.iter()- .filter(|tool| crate::tools::traits::delegation_target(**tool).is_some())+ .filter(|tool| crate::tools::host_extensions::delegation_target(**tool).is_some()).map(|tool| tool.name()).collect();let groups = super::groups::current();diff --git a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rsindex 5082f40d35..30df3d4027 100644--- a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs+++ b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs@@ -11,7 +11,7 @@ use async_trait::async_trait;use serde_json::{json, Value};use super::*;-use crate::tools::traits::{PermissionLevel, Tool, ToolResult, ToolTimeout};+use tinytools::{PermissionLevel, Tool, ToolResult, ToolTimeout};struct FakeTool {name: &'static str,diff --git a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rsindex 60279cf82a..9a18305a7e 100644--- a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs+++ b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs@@ -6,10 +6,10 @@ use super::*;// ── the index must agree with the gate too ──────────────────────────────────/// A spec shaped like the one `UseSkillTool` publishes.-fn use_skill_spec() -> crate::tools::traits::ToolSpec {+fn use_skill_spec() -> tinytools::ToolSpec {let tools = registry_with_all(&["build_workflow"]);let tool = find(&tools, USE_SKILL);- crate::tools::traits::ToolSpec {+ tinytools::ToolSpec {name: tool.name().to_string(),description: tool.description().to_string(),parameters: tool.parameters_schema(),@@ -210,7 +210,7 @@ fn rebinding_a_pack_handle_repoints_it_at_the_new_registry() {let rebuilt = Arc::new(rebuilt);// Re-point the ORIGINAL handle at it, which is what a rebuild does.- crate::tools::traits::pack_registry_handle(use_skill)+ crate::tools::host_extensions::pack_registry_handle(use_skill).expect("use_skill exposes a pack registry handle").bind(Arc::downgrade(&rebuilt));@@ -233,7 +233,7 @@ fn rebinding_a_pack_handle_repoints_it_at_the_new_registry() {#[test]fn a_non_owner_listing_omits_the_tools_the_gate_will_refuse() {let tools = registry_with_all(&["build_workflow", "propose_workflow"]);- let handle = crate::tools::traits::pack_registry_handle(find(&tools, USE_SKILL))+ let handle = crate::tools::host_extensions::pack_registry_handle(find(&tools, USE_SKILL)).expect("use_skill carries the pack handle");let rendered = render_pack_filtered(@@ -259,7 +259,7 @@ fn a_non_owner_listing_omits_the_tools_the_gate_will_refuse() {#[test]fn a_listing_with_nothing_callable_names_the_route_out() {let tools = registry_with_all(&["build_workflow", "propose_workflow"]);- let handle = crate::tools::traits::pack_registry_handle(find(&tools, USE_SKILL))+ let handle = crate::tools::host_extensions::pack_registry_handle(find(&tools, USE_SKILL)).expect("use_skill carries the pack handle");let route = route_sentence(&["build_workflow".to_string()], &["workflow_builder"]);@@ -331,7 +331,7 @@ fn the_mcp_and_skill_hand_offs_are_never_packed() {fn a_direct_hand_off_closes_its_owners_pack_and_nothing_else() {use crate::agent::orchestration::tools::{ArchetypeDelegationTool, DelegationTarget};- let delegate = |name: &str, target: &str| -> Box<dyn crate::tools::traits::Tool> {+ let delegate = |name: &str, target: &str| -> Box<dyn tinytools::Tool> {Box::new(ArchetypeDelegationTool {tool_name: name.to_string(),agent_id: DelegationTarget(target.to_string()),@@ -348,7 +348,7 @@ fn a_direct_hand_off_closes_its_owners_pack_and_nothing_else() {"wallet_status","mcp_registry_tool_call",]);- let tools: Vec<&dyn crate::tools::traits::Tool> = raw+ let tools: Vec<&dyn tinytools::Tool> = raw.iter().map(|t| t.as_ref()).chain(delegates.iter().map(|t| t.as_ref()))@@ -383,7 +383,7 @@ fn a_direct_hand_off_closes_its_owners_pack_and_nothing_else() {// Keyed on the visible set, this closed nothing on a real session while// every test passed. Pack membership is knowable as soon as the tools are,// so the raw tools close with no visible set in the picture at all.- let named_only: Vec<&dyn crate::tools::traits::Tool> = raw.iter().map(|t| t.as_ref()).collect();+ let named_only: Vec<&dyn tinytools::Tool> = raw.iter().map(|t| t.as_ref()).collect();assert!(closed_by_direct_handoff("orchestrator", &named_only).is_empty(),"with no hand-off among the tools there is nothing to close: the rule \@@ -411,13 +411,13 @@ fn a_named_scope_session_closes_the_pack_its_visible_list_never_mentions() {use crate::agent::orchestration::tools::{ArchetypeDelegationTool, DelegationTarget};use crate::tools::agent_policy::ToolPolicyEngine;- let delegate: Box<dyn crate::tools::traits::Tool> = Box::new(ArchetypeDelegationTool {+ let delegate: Box<dyn tinytools::Tool> = Box::new(ArchetypeDelegationTool {tool_name: "setup_skills".to_string(),agent_id: DelegationTarget("skill_setup".to_string()),tool_description: String::new(),});let raw = registry_with_all(&["skill_registry_install"]);- let tools: Vec<&dyn crate::tools::traits::Tool> = raw+ let tools: Vec<&dyn tinytools::Tool> = raw.iter().map(|t| t.as_ref()).chain(std::iter::once(delegate.as_ref()))diff --git a/crates/openhuman-core/src/tools/toolpacks/tools.rs b/crates/openhuman-core/src/tools/toolpacks/tools.rsindex febe8e09d1..e5ed4c75ff 100644--- a/crates/openhuman-core/src/tools/toolpacks/tools.rs+++ b/crates/openhuman-core/src/tools/toolpacks/tools.rs@@ -6,8 +6,8 @@ use async_trait::async_trait;use serde_json::{json, Value};use super::registry;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolSpec};use tinytools::ToolRunContext;+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult, ToolSpec};pub const USE_SKILL: &str = "use_skill";@@ -490,13 +490,13 @@ impl Tool for UseSkillTool {}}- fn timeout_policy(&self, args: &Value) -> crate::tools::traits::ToolTimeout {+ fn timeout_policy(&self, args: &Value) -> tinytools::ToolTimeout {match self.resolve(args) {Some((tools, idx)) => {let inner_args = args.get("args").cloned().unwrap_or_else(|| json!({}));tools[idx].timeout_policy(&inner_args)}- None => crate::tools::traits::ToolTimeout::Inherit,+ None => tinytools::ToolTimeout::Inherit,}}diff --git a/crates/openhuman-core/src/tools/traits.rs b/crates/openhuman-core/src/tools/traits.rsdeleted file mode 100644index c28aefe231..0000000000--- a/crates/openhuman-core/src/tools/traits.rs+++ /dev/null@@ -1,81 +0,0 @@-//! The tool trait and its vocabulary — the stable host import path.-//!-//! Every definition here lives in [`tinytools`], which `tinyagents` also-//! depends on. That is what makes `tinytools::Tool` and the trait the harness-//! runs a loop over the *same* trait: a tool is implemented once and both sides-//! accept it, with no conversion at the seam to get subtly wrong.-//!-//! ~190 call sites in this crate import from `crate::tools::traits`,-//! so this module stays as the path they name rather than rewriting each import-//! to point at the crate. New code may name either.-//!-//! # What did *not* move-//!-//! Everything that decides something. `tinytools` lets a tool declare the-//! privilege it needs and whether it reaches outside the machine; this host-//! decides what to do about those declarations — [`policy`], the security-//! policy, the approval gate and the sandbox are all still ours, and are meant-//! to stay in one auditable place.-//!-//! [`policy`]: crate::tools::policy--pub use tinytools::{- context_detail_from_args, humanize_tool_name, PermissionLevel, Tool, ToolCallOptions,- ToolCategory, ToolContent, ToolExposure, ToolResult, ToolRunContext, ToolScope, ToolSpec,- ToolTimeout,-};--use crate::agent::orchestration::tools::DelegationTarget;-use crate::agent::tool_policy::GeneratedToolRuntimeContext;-use crate::tools::toolpacks::PackRegistryHandle;--/// Reads a tool's pack-registry handle back out of the erased host extension.-///-/// `use_skill` reads the registry it itself lives in, so-/// they cannot be handed it at construction; `toolpacks::bind_pack_registry`-/// finds them in an already-built registry and hands them a `Weak` view of it.-///-/// The handle rides on [`Tool::host_extension`] rather than a typed trait-/// method because it is *this host's* concept — a vocabulary shared with other-/// hosts has no business naming it. Every other tool returns `None` here and-/// pays nothing.-pub fn pack_registry_handle(tool: &dyn Tool) -> Option<&PackRegistryHandle> {- tool.host_extension()- .and_then(|any| any.downcast_ref::<PackRegistryHandle>())-}--/// Reads the agent a synthesised `delegate_*` tool routes to.-///-/// The toolpack route hint uses this to answer "which of this pack's owner-/// agents can this session actually reach, and under what tool name?" without-/// keeping a second copy of every agent's `delegate_name`. Asking the session's-/// own tool set is what makes the answer trustworthy: a delegate the session was-/// not built with simply is not there to find, so a hint can never name a call-/// the model cannot make.-///-/// Erased for the same reason as [`pack_registry_handle`].-pub fn delegation_target(tool: &dyn Tool) -> Option<&str> {- tool.host_extension()- .and_then(|any| any.downcast_ref::<DelegationTarget>())- .map(|target| target.0.as_str())-}--/// Reads a tool's generated-tool runtime metadata back out of the erased-/// per-call host extension.-///-/// Generated or externally supplied tools carry this so the agent policy layer-/// can apply provider / capability / risk rules before execution. Built-in-/// tools leave it unset. Erased for the same reason as-/// [`pack_registry_handle`].-pub fn generated_runtime_context(- tool: &dyn Tool,- args: &serde_json::Value,-) -> Option<GeneratedToolRuntimeContext> {- tool.host_call_extension(args)- .and_then(|any| any.downcast::<GeneratedToolRuntimeContext>().ok())- .map(|boxed| *boxed)-}--#[cfg(test)]-#[path = "traits_tests.rs"]-mod tests;diff --git a/crates/openhuman-core/src/tools/user_filter.rs b/crates/openhuman-core/src/tools/user_filter.rsindex 144b20d992..bcfa570f12 100644--- a/crates/openhuman-core/src/tools/user_filter.rs+++ b/crates/openhuman-core/src/tools/user_filter.rs@@ -295,7 +295,7 @@ fn expand_enabled_tool_names(enabled_tool_names: &[String]) -> HashSet<String> {/// available. Default-OFF opt-in gating (the ~160 overextending tools from/// #3050) is unchanged.pub(crate) fn filter_tools_by_user_preference(- tools: &mut Vec<Box<dyn crate::tools::Tool>>,+ tools: &mut Vec<Box<dyn tinytools::Tool>>,enabled_tool_names: &[String],) {if enabled_tool_names.is_empty() {diff --git a/crates/openhuman-core/src/tools/user_filter_tests.rs b/crates/openhuman-core/src/tools/user_filter_tests.rsindex aae91ca020..5eeaeaa444 100644--- a/crates/openhuman-core/src/tools/user_filter_tests.rs+++ b/crates/openhuman-core/src/tools/user_filter_tests.rs@@ -1,6 +1,6 @@use super::{expand_enabled_tool_names, filter_tools_by_user_preference};-use crate::tools::traits::{Tool, ToolResult};use async_trait::async_trait;+use tinytools::{Tool, ToolResult};#[test]fn expands_legacy_ui_toggle_ids_to_rust_tool_names() {diff --git a/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast.rs b/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast.rsindex 49823eca7c..d3e43c4f0c 100644--- a/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast.rs+++ b/crates/openhuman-core/src/voice/audio_toolkit/tools/podcast.rs@@ -5,11 +5,11 @@ use serde_json::json;use crate::config::Config;use crate::security::{SecurityPolicy, ToolOperation};-use crate::tools::traits::{PermissionLevel, Tool, ToolResult};use crate::voice::audio_toolkit::{email_podcast, generate_and_email_podcast, generate_podcast, AudioGenerateRequest,EmailPodcastRequest,};+use tinytools::{PermissionLevel, Tool, ToolResult};pub struct AudioGeneratePodcastTool {config: Arc<Config>,diff --git a/crates/openhuman-core/src/web3/bridge/tools.rs b/crates/openhuman-core/src/web3/bridge/tools.rsindex d0a1b9fac5..e04f0b6309 100644--- a/crates/openhuman-core/src/web3/bridge/tools.rs+++ b/crates/openhuman-core/src/web3/bridge/tools.rs@@ -3,10 +3,10 @@use async_trait::async_trait;use serde_json::json;-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use crate::web3::store::execute_quote;use crate::web3::types::{BridgeQuoteParams, ExecuteQuoteParams};use crate::web3::{execute_tool_schema, ops, to_tool_result};+use tinytools::{Tool, ToolCallOptions, ToolResult};pub struct Web3BridgeQuoteTool;pub struct Web3BridgeExecuteTool;diff --git a/crates/openhuman-core/src/web3/dapp/tools.rs b/crates/openhuman-core/src/web3/dapp/tools.rsindex 162980cead..326c9660d4 100644--- a/crates/openhuman-core/src/web3/dapp/tools.rs+++ b/crates/openhuman-core/src/web3/dapp/tools.rs@@ -3,10 +3,10 @@use async_trait::async_trait;use serde_json::json;-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use crate::web3::store::execute_quote;use crate::web3::types::{DappCallParams, ExecuteQuoteParams};use crate::web3::{execute_tool_schema, ops, to_tool_result};+use tinytools::{Tool, ToolCallOptions, ToolResult};pub struct Web3DappCallTool;pub struct Web3DappExecuteTool;diff --git a/crates/openhuman-core/src/web3/mod.rs b/crates/openhuman-core/src/web3/mod.rsindex 9adceb24cf..f67b5211df 100644--- a/crates/openhuman-core/src/web3/mod.rs+++ b/crates/openhuman-core/src/web3/mod.rs@@ -58,7 +58,7 @@ use crate::core::{ControllerSchema, FieldSchema, TypeSchema};#[cfg(feature = "web3")]use crate::rpc::RpcOutcome;#[cfg(feature = "web3")]-use crate::tools::traits::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};// ---------------------------------------------------------------------------// Disabled facade — compiled only when the `web3` feature is OFF.diff --git a/crates/openhuman-core/src/web3/stub.rs b/crates/openhuman-core/src/web3/stub.rsindex 65b306bbec..d202ba03c4 100644--- a/crates/openhuman-core/src/web3/stub.rs+++ b/crates/openhuman-core/src/web3/stub.rs@@ -13,7 +13,7 @@use crate::core::all::RegisteredController;use crate::core::ControllerSchema;-use crate::tools::traits::Tool;+use tinytools::Tool;/// No web3 controller schemas when the domain is compiled out.pub fn all_web3_controller_schemas() -> Vec<ControllerSchema> {diff --git a/crates/openhuman-core/src/web3/swap/tools.rs b/crates/openhuman-core/src/web3/swap/tools.rsindex b12d69f88a..c573255471 100644--- a/crates/openhuman-core/src/web3/swap/tools.rs+++ b/crates/openhuman-core/src/web3/swap/tools.rs@@ -5,10 +5,10 @@use async_trait::async_trait;use serde_json::json;-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use crate::web3::store::execute_quote;use crate::web3::types::{ExecuteQuoteParams, SwapQuoteParams};use crate::web3::{execute_tool_schema, ops, to_tool_result};+use tinytools::{Tool, ToolCallOptions, ToolResult};pub struct Web3SwapQuoteTool;pub struct Web3SwapExecuteTool;diff --git a/crates/openhuman-core/src/web3/wallet/tools/chain_status.rs b/crates/openhuman-core/src/web3/wallet/tools/chain_status.rsindex 179b3e84dc..5de6f5a43a 100644--- a/crates/openhuman-core/src/web3/wallet/tools/chain_status.rs+++ b/crates/openhuman-core/src/web3/wallet/tools/chain_status.rs@@ -1,7 +1,7 @@-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use crate::web3::wallet;use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolCallOptions, ToolResult};pub struct WalletChainStatusTool;diff --git a/crates/openhuman-core/src/web3/wallet/tools/prepare_transfer.rs b/crates/openhuman-core/src/web3/wallet/tools/prepare_transfer.rsindex 6f02ccdeb2..a1e3373dcc 100644--- a/crates/openhuman-core/src/web3/wallet/tools/prepare_transfer.rs+++ b/crates/openhuman-core/src/web3/wallet/tools/prepare_transfer.rs@@ -1,7 +1,7 @@-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use crate::web3::wallet::{self, PrepareTransferParams};use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolCallOptions, ToolResult};pub struct WalletPrepareTransferTool;diff --git a/crates/openhuman-core/src/web3/wallet/tools/status.rs b/crates/openhuman-core/src/web3/wallet/tools/status.rsindex 6f780c544f..5ed9be4c9c 100644--- a/crates/openhuman-core/src/web3/wallet/tools/status.rs+++ b/crates/openhuman-core/src/web3/wallet/tools/status.rs@@ -1,7 +1,7 @@-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use crate::web3::wallet;use async_trait::async_trait;use serde_json::json;+use tinytools::{Tool, ToolCallOptions, ToolResult};pub struct WalletStatusTool;diff --git a/crates/openhuman-core/src/web3/wallet/tools/tx_query.rs b/crates/openhuman-core/src/web3/wallet/tools/tx_query.rsindex 6baf0a3c0b..390cbf48e4 100644--- a/crates/openhuman-core/src/web3/wallet/tools/tx_query.rs+++ b/crates/openhuman-core/src/web3/wallet/tools/tx_query.rs@@ -3,11 +3,11 @@//! same `{chain, hash, evmNetwork?}` input and delegates to the matching//! `wallet::*` dispatcher.-use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};use crate::web3::wallet::{self, EvmNetwork, WalletChain};use async_trait::async_trait;use serde::Deserialize;use serde_json::json;+use tinytools::{Tool, ToolCallOptions, ToolResult};#[derive(Debug, Deserialize)]#[serde(rename_all = "camelCase")]diff --git a/crates/openhuman-core/src/web3/x402/tools.rs b/crates/openhuman-core/src/web3/x402/tools.rsindex bab6d31ef3..9418561d42 100644--- a/crates/openhuman-core/src/web3/x402/tools.rs+++ b/crates/openhuman-core/src/web3/x402/tools.rs@@ -11,7 +11,7 @@ use log::debug;use serde_json::json;use std::time::Duration;-use crate::tools::traits::{PermissionLevel, Tool, ToolCallOptions, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolResult};use super::store;use super::types::*;diff --git a/tests/agent_approval_memory_coverage_e2e.rs b/tests/agent_approval_memory_coverage_e2e.rsindex 3f28edff80..bc3bbf7c62 100644--- a/tests/agent_approval_memory_coverage_e2e.rs+++ b/tests/agent_approval_memory_coverage_e2e.rs@@ -489,7 +489,7 @@ fn composio_write_tools_declare_an_external_effect_so_the_approval_gate_parks_thuse openhuman_core::config::Config;use openhuman_core::integrations::composio::tools::ComposioExecuteTool;- use openhuman_core::tools::traits::Tool;+ use tinytools::Tool;let tool = ComposioExecuteTool::new(Arc::new(Config::default()));diff --git a/tests/agent_builder_public.rs b/tests/agent_builder_public.rsindex 08d9856ba7..1ac358455e 100644--- a/tests/agent_builder_public.rs+++ b/tests/agent_builder_public.rs@@ -1,10 +1,11 @@use anyhow::Result;use async_trait::async_trait;-use openhuman_core::agent::context::prompt::SystemPromptBuilder;use openhuman_core::agent::dispatcher::XmlToolDispatcher;+use openhuman_core::agent::prompts::SystemPromptBuilder;use openhuman_core::agent::Agent;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry};-use openhuman_core::tools::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};+use std::collections::HashSet;use std::sync::Arc;use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse};diff --git a/tests/agent_harness_e2e.rs b/tests/agent_harness_e2e.rsindex 66c10aa0d0..078e017ec5 100644--- a/tests/agent_harness_e2e.rs+++ b/tests/agent_harness_e2e.rs@@ -2363,10 +2363,6 @@ mod streaming_support {use openhuman_core::agent::Agent;use openhuman_core::config::{AgentConfig, ContextConfig};use openhuman_core::memory::Memory;- use openhuman_core::tools::traits::ToolCallOptions;- use openhuman_core::tools::{- PermissionLevel, Tool, ToolContent, ToolResult, ToolScope as RuntimeToolScope,- };use serde_json::json;use std::collections::VecDeque;use std::path::{Path, PathBuf};@@ -2379,6 +2375,10 @@ mod streaming_support {};use tinyinference_llm::tool::ToolCall;use tinyinference_llm::usage::Usage;+ use tinytools::{+ PermissionLevel, Tool, ToolCallOptions, ToolContent, ToolResult,+ ToolScope as RuntimeToolScope,+ };// ── ScriptedProvider ────────────────────────────────────────────────────// Copied (minimal) from tests/agent_session_turn_raw_coverage_e2e.rs:76-152.@@ -4148,14 +4148,15 @@ async fn orchestrator_cannot_call_a_connected_mcp_tool_through_the_raw_registry_mod tool_policy_boundary_placement {use anyhow::Result;use async_trait::async_trait;- use openhuman_core::agent::context::prompt::LearnedContextData;use openhuman_core::agent::dispatcher::NativeToolDispatcher;+ use openhuman_core::agent::prompts::LearnedContextData;use openhuman_core::agent::Agent;use openhuman_core::config::AgentConfig;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary as MemoryNamespaceSummary, RecallOpts,};- use openhuman_core::tools::{PermissionLevel, Tool, ToolResult};+ use tinytools::{PermissionLevel, Tool, ToolResult};+use std::collections::VecDeque;use std::sync::{Arc, Mutex};diff --git a/tests/agent_harness_public.rs b/tests/agent_harness_public.rsindex f83383b2f0..40ef635a76 100644--- a/tests/agent_harness_public.rs+++ b/tests/agent_harness_public.rs@@ -117,7 +117,7 @@ fn stub_parent_context() -> ParentExecutionContext {session_id: "test-session".into(),channel: "test-channel".into(),connected_integrations: vec![],- tool_call_format: openhuman_core::agent::context::prompt::ToolCallFormat::PFormat,+ tool_call_format: openhuman_core::agent::prompts::ToolCallFormat::PFormat,session_key: "test-session".into(),session_parent_prefix: None,on_progress: None,diff --git a/tests/agent_turn_overrides_e2e.rs b/tests/agent_turn_overrides_e2e.rsindex 54ce35584c..6c40163d7f 100644--- a/tests/agent_turn_overrides_e2e.rs+++ b/tests/agent_turn_overrides_e2e.rs@@ -40,13 +40,11 @@ use openhuman_core::agent::harness::session::TurnOverrides;use openhuman_core::agent::tinyagents::thread_context::with_thread_id;use openhuman_core::agent::Agent;use openhuman_core::config::{AgentConfig, ContextConfig};-use openhuman_core::tools::{- PermissionLevel, Tool, ToolContent, ToolResult, ToolScope as RuntimeToolScope,-};use tinyinference_llm::message::Message;use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse, ModelStream, ModelStreamItem,};+use tinytools::{PermissionLevel, Tool, ToolContent, ToolResult, ToolScope as RuntimeToolScope};// ─── Harness ────────────────────────────────────────────────────────────────diff --git a/tests/calendar_grounding_e2e.rs b/tests/calendar_grounding_e2e.rsindex f0f484f82b..66361e53e0 100644--- a/tests/calendar_grounding_e2e.rs+++ b/tests/calendar_grounding_e2e.rs@@ -2,7 +2,8 @@ use anyhow::Result;use async_trait::async_trait;use openhuman_core::agent::dispatcher::NativeToolDispatcher;use openhuman_core::agent::Agent;-use openhuman_core::tools::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};+use parking_lot::Mutex;use serde_json::json;use std::sync::Arc;@@ -180,7 +181,7 @@ async fn test_integrations_agent_has_current_date_context() -> Result<()> {session_id: "test-session".into(),channel: "test".into(),connected_integrations: vec![],- tool_call_format: openhuman_core::agent::context::prompt::ToolCallFormat::PFormat,+ tool_call_format: openhuman_core::agent::prompts::ToolCallFormat::PFormat,session_key: "0_test".into(),session_parent_prefix: None,on_progress: None,diff --git a/tests/composio_list_tools_stack_overflow_regression.rs b/tests/composio_list_tools_stack_overflow_regression.rsindex ce686bef3b..a8834aa1b9 100644--- a/tests/composio_list_tools_stack_overflow_regression.rs+++ b/tests/composio_list_tools_stack_overflow_regression.rs@@ -108,11 +108,11 @@use anyhow::Result;use async_trait::async_trait;-use openhuman_core::agent::context::prompt::ToolCallFormat;use openhuman_core::agent::harness::definition::{AgentDefinitionRegistry, ModelSpec};use openhuman_core::agent::harness::{run_subagent, with_parent_context, ParentExecutionContext, SubagentRunOptions,};+use openhuman_core::agent::prompts::ToolCallFormat;use openhuman_core::config::AgentConfig;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};use parking_lot::Mutex;diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rsindex 4ca4c8cfca..5a3a5ba0ff 100644--- a/tests/json_rpc_e2e.rs+++ b/tests/json_rpc_e2e.rs@@ -13505,8 +13505,8 @@ async fn json_rpc_threads_transcript_get_projects_and_paginates() {#[tokio::test]async fn memory_flavour_agent_tool_e2e_5172() {use openhuman_core::config::Config;- use openhuman_core::tools::traits::Tool;use openhuman_core::tools::MemoryFlavourTool;+ use tinytools::Tool;let _env_lock = json_rpc_e2e_env_lock();let tmp = tempdir().expect("tempdir");diff --git a/tests/raw_coverage/agent_archivist_debug_round21_raw_coverage_e2e.rs b/tests/raw_coverage/agent_archivist_debug_round21_raw_coverage_e2e.rsindex b2bfd09cba..c73ffd1b8a 100644--- a/tests/raw_coverage/agent_archivist_debug_round21_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_archivist_debug_round21_raw_coverage_e2e.rs@@ -11,7 +11,7 @@ use openhuman_core::agent::harness::{};use openhuman_core::agent::hooks::{PostTurnHook, ToolCallRecord, TurnContext};use openhuman_core::config::AgentConfig;-use openhuman_core::agent::context::prompt::ToolCallFormat;+use openhuman_core::agent::prompts::ToolCallFormat;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,};@@ -20,7 +20,8 @@ use openhuman_core::memory::api::provider::MemoryProvider;// `archivist_tests.rs`: production writes through the provider, the proof that// a row landed reads the store directly.use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;-use openhuman_core::tools::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};+use parking_lot::Mutex;use rusqlite::Connection;use serde_json::json;diff --git a/tests/raw_coverage/agent_harness_leftovers_raw_coverage_e2e.rs b/tests/raw_coverage/agent_harness_leftovers_raw_coverage_e2e.rsindex 1392affb29..e670a3413c 100644--- a/tests/raw_coverage/agent_harness_leftovers_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_harness_leftovers_raw_coverage_e2e.rs@@ -1,6 +1,6 @@use anyhow::Result;use async_trait::async_trait;-use openhuman_core::agent::context::prompt::{+use openhuman_core::agent::prompts::{render_ambient_environment, render_subagent_system_prompt, render_tools, render_user_files,ConnectedIntegration, CuratedMemoryPromptSnapshot, LearnedContextData, NamespaceSummary,PersonalityRosterEntry, PromptContext, PromptTool, SubagentRenderOptions, SystemPromptBuilder,@@ -18,7 +18,8 @@ use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary as MemoryNamespaceSummary, RecallOpts,};-use openhuman_core::tools::{PermissionLevel, Tool, ToolContent, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult, ToolContent};+use parking_lot::Mutex;use serde_json::json;use std::collections::{HashSet, VecDeque};diff --git a/tests/raw_coverage/agent_harness_raw_coverage_e2e.rs b/tests/raw_coverage/agent_harness_raw_coverage_e2e.rsindex dc408cff3b..15ff73ee09 100644--- a/tests/raw_coverage/agent_harness_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_harness_raw_coverage_e2e.rs@@ -9,11 +9,12 @@ use openhuman_core::agent::harness::{};use openhuman_core::agent::progress::AgentProgress;use openhuman_core::config::AgentConfig;-use openhuman_core::agent::context::prompt::ToolCallFormat;+use openhuman_core::agent::prompts::ToolCallFormat;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary};use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;use openhuman_core::tools::SpawnSubagentTool;-use openhuman_core::tools::{Tool, ToolResult};+use tinytools::{Tool, ToolResult};+use parking_lot::Mutex;use serde_json::json;use std::path::{Path, PathBuf};diff --git a/tests/raw_coverage/agent_large_round25_raw_coverage_e2e.rs b/tests/raw_coverage/agent_large_round25_raw_coverage_e2e.rsindex a66b1b760e..586023e399 100644--- a/tests/raw_coverage/agent_large_round25_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_large_round25_raw_coverage_e2e.rs@@ -5,14 +5,15 @@ use openhuman_core::agent::harness::{ParentExecutionContext, PromptSource, SandboxMode, SubagentRunOptions, ToolScope,};use openhuman_core::config::AgentConfig;-use openhuman_core::agent::context::prompt::{+use openhuman_core::agent::prompts::{ConnectedIntegration, ConnectedIntegrationTool, ToolCallFormat,};use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,};use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;-use openhuman_core::tools::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};+use parking_lot::Mutex;use serde_json::json;use std::collections::VecDeque;diff --git a/tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rs b/tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rsindex 1b1ae67e35..8f8ea89a17 100644--- a/tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_prompts_subagent_raw_coverage_e2e.rs@@ -8,7 +8,7 @@ use openhuman_core::agent::harness::{ToolScope,};use openhuman_core::config::AgentConfig;-use openhuman_core::agent::context::prompt::{+use openhuman_core::agent::prompts::{render_ambient_environment, render_subagent_system_prompt, render_tools, render_user_files,ConnectedIntegration, CuratedMemoryPromptSnapshot, LearnedContextData, NamespaceSummary,PromptContext, PromptTool, SubagentRenderOptions, SystemPromptBuilder, ToolCallFormat,@@ -18,7 +18,8 @@ use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary as MemoryNamespaceSummary, RecallOpts,};use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;-use openhuman_core::tools::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};+use parking_lot::Mutex;use serde_json::json;use std::collections::{HashSet, VecDeque};@@ -385,7 +386,7 @@ fn prompt_sections_render_files_identity_memory_tools_and_ambient_blocks() -> Relet rendered = SystemPromptBuilder::with_defaults().insert_section_before("user_memory",- Box::new(openhuman_core::agent::context::prompt::UserReflectionsSection),+ Box::new(openhuman_core::agent::prompts::UserReflectionsSection),).build(&ctx)?;@@ -579,7 +580,7 @@ async fn native_parent_integrations_subagent_receives_text_tool_catalogue() -> Rparent_context.connected_integrations = vec![ConnectedIntegration {toolkit: "gmail".into(),description: "Gmail actions".into(),- tools: vec![openhuman_core::agent::context::prompt::ConnectedIntegrationTool {+ tools: vec![openhuman_core::agent::prompts::ConnectedIntegrationTool {name: "GMAIL_LIST_MESSAGES".into(),description: "List messages in a mailbox".into(),parameters: Some(json!({"type": "object"})),diff --git a/tests/raw_coverage/agent_round26_raw_coverage_e2e.rs b/tests/raw_coverage/agent_round26_raw_coverage_e2e.rsindex afd3807e13..3fa8fd3103 100644--- a/tests/raw_coverage/agent_round26_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_round26_raw_coverage_e2e.rs@@ -1,7 +1,7 @@use anyhow::Result;use async_trait::async_trait;use chrono::{TimeZone, Utc};-use openhuman_core::agent::context::prompt::{+use openhuman_core::agent::prompts::{render_ambient_environment, render_safety, render_subagent_system_prompt_with_format,render_tools, ConnectedIntegration, CuratedMemoryPromptSnapshot, LearnedContextData,NamespaceSummary as PromptNamespaceSummary, PersonalityRosterEntry, PersonalityRosterSection,@@ -16,7 +16,8 @@ use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,};use openhuman_core::skills::ops_types::Workflow;-use openhuman_core::tools::{PermissionLevel, Tool, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult};+use parking_lot::Mutex;use serde_json::json;use std::collections::{HashSet, VecDeque};diff --git a/tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs b/tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rsindex b44cc1ef85..3750612f90 100644--- a/tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_session_round24_raw_coverage_e2e.rs@@ -4,7 +4,7 @@ use openhuman_core::agent::dispatcher::XmlToolDispatcher;use openhuman_core::agent::hooks::{PostTurnHook, TurnContext};use openhuman_core::agent::Agent;use openhuman_core::config::{AgentConfig, ContextConfig};-use openhuman_core::agent::context::prompt::{+use openhuman_core::agent::prompts::{ConnectedIntegration, LearnedContextData, PersonalityRosterEntry, PersonalityRosterSection,PromptContext, PromptSection, PromptTool, SubagentRenderOptions, SystemPromptBuilder,ToolCallFormat, UserIdentity, UserIdentitySection,@@ -12,9 +12,8 @@ use openhuman_core::agent::context::prompt::{use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,};-use openhuman_core::tools::{- PermissionLevel, Tool, ToolContent, ToolResult, ToolScope as RuntimeToolScope,-};+use tinytools::{PermissionLevel, Tool, ToolResult, ToolScope, ToolContent};+use tinytools::ToolScope as RuntimeToolScope;use parking_lot::Mutex;use serde_json::json;use std::collections::{HashSet, VecDeque};@@ -611,7 +610,7 @@ fn prompt_sections_cover_dynamic_roster_identity_and_subagent_edges() {let parent_tools: Vec<Box<dyn Tool>> = vec![Box::new(Round24Tool {calls: Arc::new(AtomicUsize::new(0)),})];- let subagent_json = openhuman_core::agent::context::prompt::render_subagent_system_prompt(+ let subagent_json = openhuman_core::agent::prompts::render_subagent_system_prompt(&workspace_path,"round24-model",&[999, 0],diff --git a/tests/raw_coverage/agent_session_turn_raw_coverage_e2e.rs b/tests/raw_coverage/agent_session_turn_raw_coverage_e2e.rsindex 0bc31ff0fd..ccab829f14 100644--- a/tests/raw_coverage/agent_session_turn_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_session_turn_raw_coverage_e2e.rs@@ -21,10 +21,9 @@ use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,};use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;-use openhuman_core::tools::traits::ToolCallOptions;-use openhuman_core::tools::{- PermissionLevel, Tool, ToolContent, ToolResult, ToolScope as RuntimeToolScope,-};+use tinytools::ToolCallOptions;+use tinytools::{PermissionLevel, Tool, ToolResult, ToolScope, ToolContent};+use tinytools::ToolScope as RuntimeToolScope;use serde_json::json;use std::collections::{HashMap, HashSet, VecDeque};use std::path::PathBuf;@@ -1138,7 +1137,7 @@ async fn subagent_runner_parent_context_filters_tools_caps_output_and_reports_ersession_id: "round17-parent-session".to_string(),channel: "round17-parent-channel".to_string(),connected_integrations: Vec::new(),- tool_call_format: openhuman_core::agent::context::prompt::ToolCallFormat::Json,+ tool_call_format: openhuman_core::agent::prompts::ToolCallFormat::Json,session_key: "123_parent".to_string(),session_parent_prefix: Some("root_ancestor".to_string()),on_progress: None,diff --git a/tests/raw_coverage/agent_tool_loop_raw_coverage_e2e.rs b/tests/raw_coverage/agent_tool_loop_raw_coverage_e2e.rsindex 1a7f141875..b798694622 100644--- a/tests/raw_coverage/agent_tool_loop_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_tool_loop_raw_coverage_e2e.rs@@ -7,12 +7,13 @@ use openhuman_core::agent::debug::{dump_agent_prompt, DumpPromptOptions};use openhuman_core::agent::dispatcher::XmlToolDispatcher;use openhuman_core::agent::{Agent, AgentBuilder};use openhuman_core::config::{AgentConfig, MultimodalConfig, MultimodalFileConfig};-use openhuman_core::agent::context::prompt::LearnedContextData;+use openhuman_core::agent::prompts::LearnedContextData;use openhuman_core::agent::messages::ChatMessage;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,};-use openhuman_core::tools::{PermissionLevel, Tool, ToolContent, ToolResult, ToolScope};+use tinytools::{PermissionLevel, Tool, ToolResult, ToolScope, ToolContent};+use serde_json::json;use std::collections::{HashSet, VecDeque};use std::path::PathBuf;diff --git a/tests/raw_coverage/agent_turn_builder_leftovers_raw_coverage_e2e.rs b/tests/raw_coverage/agent_turn_builder_leftovers_raw_coverage_e2e.rsindex c972172506..bffcf972d8 100644--- a/tests/raw_coverage/agent_turn_builder_leftovers_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_turn_builder_leftovers_raw_coverage_e2e.rs@@ -8,7 +8,8 @@ use openhuman_core::agent::context::session_memory::SessionMemoryConfig;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,};-use openhuman_core::tools::{PermissionLevel, Tool, ToolContent, ToolResult};+use tinytools::{PermissionLevel, Tool, ToolResult, ToolContent};+use parking_lot::Mutex;use serde_json::json;use std::collections::VecDeque;diff --git a/tests/raw_coverage/agent_turn_toolloop_round22_raw_coverage_e2e.rs b/tests/raw_coverage/agent_turn_toolloop_round22_raw_coverage_e2e.rsindex 3954c3a6e9..65d15ac30b 100644--- a/tests/raw_coverage/agent_turn_toolloop_round22_raw_coverage_e2e.rs+++ b/tests/raw_coverage/agent_turn_toolloop_round22_raw_coverage_e2e.rs@@ -7,7 +7,8 @@ use openhuman_core::agent::progress::AgentProgress;use openhuman_core::config::{MultimodalConfig, MultimodalFileConfig};use openhuman_core::agent::messages::ChatMessage;use openhuman_core::security::POLICY_BLOCKED_MARKER;-use openhuman_core::tools::{PermissionLevel, Tool, ToolContent, ToolResult, ToolScope};+use tinytools::{PermissionLevel, Tool, ToolResult, ToolScope, ToolContent};+use serde_json::json;use std::collections::VecDeque;use std::sync::{Arc, Mutex, OnceLock};diff --git a/tests/raw_coverage/composio_credentials_state_raw_coverage_e2e.rs b/tests/raw_coverage/composio_credentials_state_raw_coverage_e2e.rsindex b3b806c927..80e191fb3d 100644--- a/tests/raw_coverage/composio_credentials_state_raw_coverage_e2e.rs+++ b/tests/raw_coverage/composio_credentials_state_raw_coverage_e2e.rs@@ -47,10 +47,10 @@ use openhuman_core::threads::ops::{message_append, message_update, messages_list, thread_create_new, thread_generate_title,thread_update_title, threads_list,};+use tinytools::{Tool, ToolCallOptions};use openhuman_core::tools::{ComposioExecuteTool, ComposioListConnectionsTool, ComposioListToolkitsTool,- ComposioListToolsTool, Tool, ToolCallOptions,-};+ ComposioListToolsTool};static ROUND15_ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;diff --git a/tests/raw_coverage/composio_ops_credentials_appstate_raw_coverage_e2e.rs b/tests/raw_coverage/composio_ops_credentials_appstate_raw_coverage_e2e.rsindex 5f91d66942..22f3ec8f01 100644--- a/tests/raw_coverage/composio_ops_credentials_appstate_raw_coverage_e2e.rs+++ b/tests/raw_coverage/composio_ops_credentials_appstate_raw_coverage_e2e.rs@@ -34,10 +34,10 @@ use openhuman_core::security::credentials::profiles::{AuthProfile, AuthProfilesSuse openhuman_core::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,};+use tinytools::{Tool, ToolCallOptions};use openhuman_core::tools::{ComposioAuthorizeTool, ComposioExecuteTool, ComposioListConnectionsTool,- ComposioListToolkitsTool, ComposioListToolsTool, Tool, ToolCallOptions,-};+ ComposioListToolkitsTool, ComposioListToolsTool};static ROUND18_ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;diff --git a/tests/raw_coverage/composio_ops_raw_coverage_e2e.rs b/tests/raw_coverage/composio_ops_raw_coverage_e2e.rsindex 0b241884f9..64358b0511 100644--- a/tests/raw_coverage/composio_ops_raw_coverage_e2e.rs+++ b/tests/raw_coverage/composio_ops_raw_coverage_e2e.rs@@ -35,7 +35,8 @@ use openhuman_core::config::Config;use openhuman_core::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,};-use openhuman_core::tools::{ComposioExecuteTool, Tool};+use tinytools::{Tool};+use openhuman_core::tools::{ComposioExecuteTool};#[derive(Clone, Default)]struct MockState {diff --git a/tests/raw_coverage/composio_raw_coverage_e2e.rs b/tests/raw_coverage/composio_raw_coverage_e2e.rsindex d09526bcef..203888a30c 100644--- a/tests/raw_coverage/composio_raw_coverage_e2e.rs+++ b/tests/raw_coverage/composio_raw_coverage_e2e.rs@@ -56,15 +56,15 @@ use openhuman_core::integrations::composio::{ComposioClient, FetchConnectedIntegrationsStatus,};use openhuman_core::config::Config;-use openhuman_core::agent::context::prompt::ConnectedIntegration;+use openhuman_core::agent::prompts::ConnectedIntegration;use openhuman_core::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,};use openhuman_core::integrations::IntegrationClient;use openhuman_core::security::{AutonomyLevel, SecurityPolicy};+use tinytools::{PermissionLevel, Tool, ToolCategory, ToolCallOptions};use openhuman_core::tools::{- ComposioTool, PermissionLevel, Tool, ToolCallOptions, ToolCategory,-};+ ComposioTool};#[test]fn composio_prepare_execute_arguments_normalizes_calendar_and_notion_payloads() {diff --git a/tests/raw_coverage/composio_tools_direct_raw_coverage_e2e.rs b/tests/raw_coverage/composio_tools_direct_raw_coverage_e2e.rsindex 1147a7d0f3..187c9cd11c 100644--- a/tests/raw_coverage/composio_tools_direct_raw_coverage_e2e.rs+++ b/tests/raw_coverage/composio_tools_direct_raw_coverage_e2e.rs@@ -17,7 +17,8 @@ use tempfile::tempdir;use openhuman_core::integrations::composio::client::{direct_execute, direct_list_connections};use openhuman_core::integrations::composio::trigger_history::ComposioTriggerHistoryStore;use openhuman_core::security::{AutonomyLevel, SecurityPolicy};-use openhuman_core::tools::{ComposioTool, Tool};+use tinytools::{Tool};+use openhuman_core::tools::{ComposioTool};#[derive(Clone, Default)]struct MockState {diff --git a/tests/raw_coverage/composio_tools_ops_state_raw_coverage_e2e.rs b/tests/raw_coverage/composio_tools_ops_state_raw_coverage_e2e.rsindex 07b7c9a9d5..d29e0a56ae 100644--- a/tests/raw_coverage/composio_tools_ops_state_raw_coverage_e2e.rs+++ b/tests/raw_coverage/composio_tools_ops_state_raw_coverage_e2e.rs@@ -34,10 +34,9 @@ use openhuman_core::security::credentials::profiles::{AuthProfile, AuthProfilesSuse openhuman_core::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,};+use tinytools::{Tool, ToolCallOptions};use openhuman_core::tools::{- ComposioAuthorizeTool, ComposioExecuteTool, ComposioListConnectionsTool, ComposioListToolsTool,- Tool, ToolCallOptions,-};+ ComposioAuthorizeTool, ComposioExecuteTool, ComposioListConnectionsTool, ComposioListToolsTool};static ROUND17_ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;diff --git a/tests/raw_coverage/inference_agent_raw_coverage_e2e.rs b/tests/raw_coverage/inference_agent_raw_coverage_e2e.rsindex 2f489e9ea9..c8c5b56a11 100644--- a/tests/raw_coverage/inference_agent_raw_coverage_e2e.rs+++ b/tests/raw_coverage/inference_agent_raw_coverage_e2e.rs@@ -59,8 +59,8 @@ use openhuman_core::agent::multimodal::{use openhuman_core::agent::messages::{ChatMessage, ConversationMessage, ToolResultMessage,};-use openhuman_core::agent::pformat::{- build_registry, parse_call as parse_pformat_call, render_signature, render_signature_from_tool,+use tinytools_agent::{+ build_registry, parse_call as parse_pformat_call, render_signature, render_signature_from_schema,PFormatParamType, PFormatRegistry, PFormatToolParams,};use openhuman_core::agent::prompts::{@@ -171,7 +171,8 @@ use openhuman_core::security::SecurityPolicy;use openhuman_core::agent::tinyagents::thread_context::{current_thread_id, with_thread_id};use openhuman_core::agent::todos::ops::BoardLocation;use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;-use openhuman_core::tools::{Tool, ToolResult, ToolSpec};+use tinytools::{Tool, ToolResult, ToolSpec};+use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};static ENV_LOCK: &std::sync::OnceLock<std::sync::Mutex<()>> = &crate::SHARED_ENV_LOCK;@@ -2726,9 +2727,13 @@ async fn inference_local_controllers_and_presets_cover_public_paths() {fn agent_pformat_and_prompt_renderers_cover_public_paths() {let plan_tool: Box<dyn Tool> = Box::new(PlanExitTool::new());let tools: Vec<Box<dyn Tool>> = vec![plan_tool];- let registry = build_registry(&tools);+ let registry = build_registry(+ tools+ .iter()+ .map(|tool| (tool.name(), tool.parameters_schema())),+ );assert_eq!(- render_signature_from_tool(tools[0].as_ref()),+ render_signature_from_schema(tools[0].name(), &tools[0].parameters_schema()),"plan_exit[0|<plan>]");assert_eq!(diff --git a/tests/raw_coverage/inference_round26_raw_coverage_e2e.rs b/tests/raw_coverage/inference_round26_raw_coverage_e2e.rsindex 29110ee097..127e11aa4f 100644--- a/tests/raw_coverage/inference_round26_raw_coverage_e2e.rs+++ b/tests/raw_coverage/inference_round26_raw_coverage_e2e.rs@@ -17,7 +17,7 @@ use openhuman_core::config::Config;use openhuman_core::agent::messages::ChatMessage;use openhuman_core::inference::host_runtime::LocalAiService;use openhuman_core::inference::provider::types::{ChatRequest, ProviderDelta};-use openhuman_core::tools::ToolSpec;+use tinytools::ToolSpec;use serde_json::{json, Value};use tempfile::{tempdir, TempDir};diff --git a/tests/raw_coverage/tools_agent_credentials_state_raw_coverage_e2e.rs b/tests/raw_coverage/tools_agent_credentials_state_raw_coverage_e2e.rsindex 66c28b7ca4..8d152d7f5a 100644--- a/tests/raw_coverage/tools_agent_credentials_state_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_agent_credentials_state_raw_coverage_e2e.rs@@ -29,7 +29,7 @@ use openhuman_core::config::rpc as config_rpc;use openhuman_core::config::{BrowserConfig, Config, HttpRequestConfig, McpAuthConfig, McpServerConfig,};-use openhuman_core::agent::context::prompt::ToolCallFormat;+use openhuman_core::agent::prompts::ToolCallFormat;use openhuman_core::security::credentials::profiles::{AuthProfile, AuthProfileKind, AuthProfilesStore, TokenSet,};@@ -39,9 +39,9 @@ use openhuman_core::security::credentials::{use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary};use openhuman_core::security::{AuditLogger, SecurityPolicy};use openhuman_core::inference::tokenjuice::AgentTokenjuiceCompression;+use tinytools::{Tool, ToolResult};use openhuman_core::tools::{- all_tools, BrowserTool, ComputerUseConfig, SpawnSubagentTool, Tool, ToolResult,-};+ all_tools, BrowserTool, ComputerUseConfig, SpawnSubagentTool};use parking_lot::Mutex as ParkingMutex;use serde_json::{json, Value};use tempfile::{Builder, TempDir};diff --git a/tests/raw_coverage/tools_approval_channels_raw_coverage_e2e.rs b/tests/raw_coverage/tools_approval_channels_raw_coverage_e2e.rsindex 0755121dbb..8a1d4b6814 100644--- a/tests/raw_coverage/tools_approval_channels_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_approval_channels_raw_coverage_e2e.rs@@ -77,7 +77,7 @@ use openhuman_core::config::schema::{CapabilityProviderConfig, CapabilityProviderTrustState, NodeConfig, WhatsAppConfig,};use openhuman_core::config::{Config, IMessageConfig, WebhookConfig};-use openhuman_core::agent::context::prompt::ConnectedIntegration;+use openhuman_core::agent::prompts::ConnectedIntegration;use openhuman_core::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,};@@ -100,16 +100,15 @@ use openhuman_core::tools::generated::{GeneratedToolAdmissionConfig, GeneratedToolDefinition, GeneratedToolRisk,};use openhuman_core::tools::orchestrator_tools::collect_orchestrator_tools;+use tinytools::{PermissionLevel, Tool, ToolResult, ToolScope, ToolCategory, ToolCallOptions};use openhuman_core::tools::{all_tools, all_tools_controller_schemas, all_tools_registered_controllers,default_tools, ApplyPatchTool, BrowserTool, CleaningStrategy,ComputerUseConfig, CsvExportTool, CurrentTimeTool, DefaultToolPolicy, DetectToolsTool,EditFileTool, FileReadTool, FileWriteTool, GitbooksGetPageTool, GitbooksSearchTool, GlobTool,GrepTool, InsertSqlRecordTool, ListFilesTool, LspTool, NodeExecTool, NpmExecTool,- PermissionLevel, PolicyDecision, ProxyConfigTool, ReadDiffTool, RunLinterTool, RunTestsTool,- SchemaCleanr, Tool, ToolCallOptions, ToolCategory, ToolPolicy, ToolResult, ToolScope,- UpdateApplyTool, UpdateMemoryMdTool, WebFetchTool, WorkspaceStateTool,-};+ PolicyDecision, ProxyConfigTool, ReadDiffTool, RunLinterTool, RunTestsTool,+ SchemaCleanr, ToolPolicy, UpdateApplyTool, UpdateMemoryMdTool, WebFetchTool, WorkspaceStateTool};const TEST_RPC_TOKEN: &str = "tools-approval-channels-raw-e2e-token";@@ -329,7 +328,7 @@ fn coverage_connected_integration(struct DefaultPathTool;#[async_trait]-impl openhuman_core::tools::Tool for DefaultPathTool {+impl tinytools::Tool for DefaultPathTool {fn name(&self) -> &str {"default_path_tool"}@@ -1571,7 +1570,7 @@ fn tools_and_tool_registry_public_surfaces_cover_schema_and_assembly_paths() {assert!(!default_tool.is_concurrency_safe(&json!({})));assert!(!default_tool.external_effect());assert!(!default_tool.external_effect_with_args(&json!({})));- assert!(openhuman_core::tools::traits::generated_runtime_context(+ assert!(openhuman_core::tools::host_extensions::generated_runtime_context(&default_tool,&json!({}))diff --git a/tests/raw_coverage/tools_channels_raw_coverage_e2e.rs b/tests/raw_coverage/tools_channels_raw_coverage_e2e.rsindex aef931f375..bb1a067e93 100644--- a/tests/raw_coverage/tools_channels_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_channels_raw_coverage_e2e.rs@@ -49,11 +49,10 @@ use openhuman_core::tools::generated::{admit_generated_tool_definitions, generated_tools_from_definitions, GeneratedToolAdapter,GeneratedToolAdmissionConfig, GeneratedToolDefinition, GeneratedToolRisk,};+use tinytools::{PermissionLevel, ToolResult, ToolScope, ToolCategory};use openhuman_core::tools::{all_tools, all_tools_controller_schemas, all_tools_registered_controllers,- default_tools, DefaultToolPolicy, PermissionLevel, PolicyDecision, ToolCategory, ToolPolicy,- ToolResult, ToolScope,-};+ default_tools, DefaultToolPolicy, PolicyDecision, ToolPolicy};#[path = "tools_approval_channels_raw_coverage_e2e.rs"]mod prior_tools_approval_channels_raw_coverage_e2e;diff --git a/tests/raw_coverage/tools_composio_adapters_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_adapters_raw_coverage_e2e.rsindex 70bb42b642..be5787fa5e 100644--- a/tests/raw_coverage/tools_composio_adapters_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_composio_adapters_raw_coverage_e2e.rs@@ -28,9 +28,9 @@ use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,};use openhuman_core::security::{AuditLogger, SecurityPolicy};+use tinytools::{Tool};use openhuman_core::tools::{- all_tools, all_tools_registered_controllers, ComposioExecuteTool, Tool,-};+ all_tools, all_tools_registered_controllers, ComposioExecuteTool};static ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;diff --git a/tests/raw_coverage/tools_composio_large_round25_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_large_round25_raw_coverage_e2e.rsindex 59244fafbc..0439a71624 100644--- a/tests/raw_coverage/tools_composio_large_round25_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_composio_large_round25_raw_coverage_e2e.rs@@ -24,7 +24,8 @@ use openhuman_core::integrations::composio::{invalidate_connected_integrations_cache, FetchConnectedIntegrationsStatus,};use openhuman_core::config::Config;-use openhuman_core::tools::{ComposioListToolsTool, Tool, ToolCallOptions};+use tinytools::{Tool, ToolCallOptions};+use openhuman_core::tools::{ComposioListToolsTool};static ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;diff --git a/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rsindex 81ba93ba15..e6b776bdd5 100644--- a/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_composio_network_leftovers_raw_coverage_e2e.rs@@ -20,10 +20,10 @@ use openhuman_core::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,};use openhuman_core::security::SecurityPolicy;+use tinytools::{Tool, ToolCallOptions};use openhuman_core::tools::{ComposioAuthorizeTool, ComposioListConnectionsTool, ComposioListToolkitsTool,- ComposioListToolsTool, ComposioTool, SpawnSubagentTool, Tool, ToolCallOptions,-};+ ComposioListToolsTool, ComposioTool, SpawnSubagentTool};static ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;diff --git a/tests/raw_coverage/tools_composio_round22_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_round22_raw_coverage_e2e.rsindex fd584a8c18..87c875b4e7 100644--- a/tests/raw_coverage/tools_composio_round22_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_composio_round22_raw_coverage_e2e.rs@@ -22,9 +22,9 @@ use openhuman_core::config::{Config, DelegateAgentConfig};use openhuman_core::cron::DeliveryConfig;use openhuman_core::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary};use openhuman_core::security::{AuditLogger, SecurityPolicy};+use tinytools::{Tool, ToolCallOptions};use openhuman_core::tools::{- all_tools, ComposioTool, CronAddTool, TodoTool, Tool, ToolCallOptions,-};+ all_tools, ComposioTool, CronAddTool, TodoTool};static ENV_LOCK: &OnceLock<Mutex<()>> = &crate::SHARED_ENV_LOCK;diff --git a/tests/raw_coverage/tools_composio_round24_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_round24_raw_coverage_e2e.rsindex 6c4fcef008..2e966a0104 100644--- a/tests/raw_coverage/tools_composio_round24_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_composio_round24_raw_coverage_e2e.rs@@ -14,7 +14,8 @@ use axum::{Json, Router};use serde_json::{json, Value};use openhuman_core::security::{AutonomyLevel, SecurityPolicy};-use openhuman_core::tools::{ComposioTool, Tool};+use tinytools::{Tool};+use openhuman_core::tools::{ComposioTool};#[derive(Clone, Debug)]struct RecordedRequest {diff --git a/tests/raw_coverage/tools_composio_round26_raw_coverage_e2e.rs b/tests/raw_coverage/tools_composio_round26_raw_coverage_e2e.rsindex 08ad033bdf..4915e86f0a 100644--- a/tests/raw_coverage/tools_composio_round26_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_composio_round26_raw_coverage_e2e.rs@@ -14,7 +14,8 @@ use axum::{Json, Router};use serde_json::{json, Value};use openhuman_core::security::{AutonomyLevel, SecurityPolicy};-use openhuman_core::tools::{ComposioTool, PermissionLevel, Tool};+use tinytools::{PermissionLevel, Tool};+use openhuman_core::tools::{ComposioTool};#[derive(Clone, Debug)]struct RecordedRequest {diff --git a/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs b/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rsindex 615bfab117..cc1f118dd2 100644--- a/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_erased_host_extension_raw_coverage_e2e.rs@@ -33,9 +33,8 @@ use openhuman_core::agent::tool_policy::{use openhuman_core::skills::types::tool_result_from_mcp;use openhuman_core::tools::toolpacks::registry::PACKS;use openhuman_core::tools::toolpacks::tools::{PackRegistryHandle, UseSkillTool};-use openhuman_core::tools::traits::{- generated_runtime_context, pack_registry_handle, PermissionLevel, Tool, ToolResult,-};+use openhuman_core::tools::host_extensions::{generated_runtime_context, pack_registry_handle};+use tinytools::{PermissionLevel, Tool, ToolResult};/// A production pack tool's registry handle survives the round trip through/// `dyn Any` **as the same handle**, not merely as some handle.diff --git a/tests/raw_coverage/tools_network_channels_raw_coverage_e2e.rs b/tests/raw_coverage/tools_network_channels_raw_coverage_e2e.rsindex e3e445550b..8125650bd2 100644--- a/tests/raw_coverage/tools_network_channels_raw_coverage_e2e.rs+++ b/tests/raw_coverage/tools_network_channels_raw_coverage_e2e.rs@@ -25,9 +25,9 @@ use openhuman_core::web_chat::{};use openhuman_core::config::{AutonomyConfig, Config};use openhuman_core::security::{AutonomyLevel, SecurityPolicy};+use tinytools::{Tool, ToolCallOptions};use openhuman_core::tools::{- ComposioTool, GitOperationsTool, ScheduleTool, Tool, ToolCallOptions,-};+ ComposioTool, GitOperationsTool, ScheduleTool};#[derive(Clone, Debug)]struct MockRequest {@@ -75,7 +75,7 @@ fn temp_config() -> (TempDir, Config) {(tmp, config)}-fn text(result: &openhuman_core::tools::ToolResult) -> String {+fn text(result: &tinytools::ToolResult) -> String {result.output()}diff --git a/tests/x402_twit_sh_live.rs b/tests/x402_twit_sh_live.rsindex b58894bd5b..3bb306b696 100644--- a/tests/x402_twit_sh_live.rs+++ b/tests/x402_twit_sh_live.rs@@ -3,9 +3,9 @@//! Run manually (requires a funded wallet)://! GGML_NATIVE=OFF cargo test --test x402_twit_sh_live -- --ignored --nocapture-use openhuman_core::tools::traits::Tool;use openhuman_core::web3::x402;use serde_json::json;+use tinytools::Tool;#[tokio::test]#[ignore] // requires funded wallet + network access