Skip to content

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

refactor(tools): consolidate integration tool registration

Steven Enamakel315e8b149095
diff --git a/crates/openhuman-core/src/integrations/tools.rs b/crates/openhuman-core/src/integrations/tools.rs
index 50850802fb..4cb3d10d6a 100644
--- a/crates/openhuman-core/src/integrations/tools.rs
+++ b/crates/openhuman-core/src/integrations/tools.rs
@@ -8,14 +8,3 @@ pub use stock_prices::{
StockCommodityTool, StockCryptoSeriesTool, StockExchangeRateTool, StockOptionsTool,
StockQuoteTool,
};
-
-/// Build this domain's tools in their persisted catalogue order.
-pub(crate) fn registered_tools(
- config: std::sync::Arc<crate::config::Config>,
-) -> Vec<Box<dyn tinytools::Tool>> {
- vec![
- Box::new(SessionStateTool::new(config.clone())),
- Box::new(OAuthConnectUrlTool::new(config.clone())),
- Box::new(OAuthListTool::new(config.clone())),
- ]
-}
diff --git a/crates/openhuman-core/src/security/credentials/tools.rs b/crates/openhuman-core/src/security/credentials/tools.rs
index 8e741e7772..cffdc84d75 100644
--- a/crates/openhuman-core/src/security/credentials/tools.rs
+++ b/crates/openhuman-core/src/security/credentials/tools.rs
@@ -231,7 +231,12 @@ impl Tool for OAuthListTool {
pub(crate) fn registered_tools(
config: std::sync::Arc<crate::config::Config>,
) -> Vec<Box<dyn tinytools::Tool>> {
- vec![Box::new(CredentialListTool::new(config.clone()))]
+ vec![
+ Box::new(CredentialListTool::new(config.clone())),
+ Box::new(SessionStateTool::new(config.clone())),
+ Box::new(OAuthConnectUrlTool::new(config.clone())),
+ Box::new(OAuthListTool::new(config)),
+ ]
}
#[cfg(test)]
diff --git a/crates/openhuman-core/src/tools/README.md b/crates/openhuman-core/src/tools/README.md
index 6a7e9e73ca..d00b8470b4 100644
--- a/crates/openhuman-core/src/tools/README.md
+++ b/crates/openhuman-core/src/tools/README.md
@@ -150,8 +150,9 @@ Where the built-in tools come from:
## Key types and entry points
- `Tool`, `ToolSpec`, `ToolResult`, `ToolExposure`, `PermissionLevel`,
- `ToolScope`, `ToolCategory`: re-exported from `tinytools` in `mod.rs` so an
- embedder implementing a tool reaches the vendored copy.
+ `ToolScope`, `ToolCategory`: imported from the vendored `tinytools`
+ contract. Embedders get `Tool`, `ToolResult`, `ToolExposure` and
+ `PermissionLevel` from the curated `openhuman_embed` facade.
- `ops::all_tools_with_runtime`: the full registry. Its last parameter,
`approval_workspace_root`, scopes `file_write`'s approval prompts.
- `orchestrator_tools::collect_orchestrator_tools` and
diff --git a/crates/openhuman-core/src/tools/ops.rs b/crates/openhuman-core/src/tools/ops.rs
index 2c5783f027..e10111a994 100644
--- a/crates/openhuman-core/src/tools/ops.rs
+++ b/crates/openhuman-core/src/tools/ops.rs
@@ -216,7 +216,6 @@ pub fn all_tools_with_runtime(
tools.extend(crate::security::credentials::tools::registered_tools(
config.clone(),
));
- tools.extend(crate::integrations::tools::registered_tools(config.clone()));
tools.append(&mut vec![
// MCP registry and workspace persona. Observe/connect/call tools
// default-ON; MCP uninstall (mcp_manage), and persona/workspace writers
@@ -488,12 +487,12 @@ pub fn all_tools_with_runtime(
if let Some(client) = crate::integrations::build_client(root_config) {
tracing::debug!("[integrations] client built successfully");
if root_config.integrations.google_places.is_active() {
- tools.push(Box::new(crate::tools::GooglePlacesSearchTool::new(
- Arc::clone(&client),
- )));
- tools.push(Box::new(crate::tools::GooglePlacesDetailsTool::new(
- Arc::clone(&client),
- )));
+ tools.push(Box::new(
+ crate::integrations::tools::GooglePlacesSearchTool::new(Arc::clone(&client)),
+ ));
+ tools.push(Box::new(
+ crate::integrations::tools::GooglePlacesDetailsTool::new(Arc::clone(&client)),
+ ));
tracing::debug!("[integrations] registered google_places tools");
} else {
tracing::debug!("[integrations] google_places disabled — skipping");
@@ -503,21 +502,21 @@ pub fn all_tools_with_runtime(
// suppresses them too. `integrations.parallel` is parsed for old
// config files and no longer does anything.
if root_config.integrations.stock_prices.is_active() {
- tools.push(Box::new(crate::tools::StockQuoteTool::new(Arc::clone(
- &client,
- ))));
- tools.push(Box::new(crate::tools::StockExchangeRateTool::new(
+ tools.push(Box::new(crate::integrations::tools::StockQuoteTool::new(
Arc::clone(&client),
)));
- tools.push(Box::new(crate::tools::StockOptionsTool::new(Arc::clone(
- &client,
- ))));
- tools.push(Box::new(crate::tools::StockCryptoSeriesTool::new(
+ tools.push(Box::new(
+ crate::integrations::tools::StockExchangeRateTool::new(Arc::clone(&client)),
+ ));
+ tools.push(Box::new(crate::integrations::tools::StockOptionsTool::new(
Arc::clone(&client),
)));
- tools.push(Box::new(crate::tools::StockCommodityTool::new(Arc::clone(
- &client,
- ))));
+ tools.push(Box::new(
+ crate::integrations::tools::StockCryptoSeriesTool::new(Arc::clone(&client)),
+ ));
+ tools.push(Box::new(
+ crate::integrations::tools::StockCommodityTool::new(Arc::clone(&client)),
+ ));
tracing::debug!("[integrations] registered stock_prices tools");
} else {
tracing::debug!("[integrations] stock_prices disabled — skipping");