Skip to content

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

refactor(skills): move skill tool registration into skills module

Steven Enamakela5b77cc4c117
diff --git a/crates/openhuman-core/src/skills/mod.rs b/crates/openhuman-core/src/skills/mod.rs
index 2fb8371384..1fb7a142ff 100644
--- a/crates/openhuman-core/src/skills/mod.rs
+++ b/crates/openhuman-core/src/skills/mod.rs
@@ -45,6 +45,8 @@ pub mod ops_install;
#[cfg(feature = "skills")]
pub mod preflight;
#[cfg(feature = "skills")]
+pub(crate) mod registration;
+#[cfg(feature = "skills")]
pub mod registry;
#[cfg(feature = "skills")]
pub mod run_log;
diff --git a/crates/openhuman-core/src/skills/registration.rs b/crates/openhuman-core/src/skills/registration.rs
new file mode 100644
index 0000000000..e2422259e6
--- /dev/null
+++ b/crates/openhuman-core/src/skills/registration.rs
@@ -0,0 +1,46 @@
+//! Registration of skill discovery, management, and workflow metadata tools.
+
+use super::catalog::tools::{
+ SkillRegistryBrowseTool, SkillRegistryInstallTool, SkillRegistrySearchTool,
+ SkillRegistrySourcesTool, SkillRegistryUninstallTool,
+};
+use super::runtime::tools::SkillRuntimeResolveRuntimesTool;
+use super::search::SkillSearchTool;
+use super::tools::{
+ WorkflowCreateTool, WorkflowDescribeTool, WorkflowInstallFromUrlTool, WorkflowListTool,
+ WorkflowReadResourceTool, WorkflowReadRunLogTool, WorkflowRecentRunsTool,
+ WorkflowUninstallTool,
+};
+use crate::config::Config;
+use std::sync::Arc;
+use tinytools::Tool;
+
+/// Build the skill tool family in its persisted catalogue order.
+pub(crate) fn tools(config: Arc<Config>) -> Vec<Box<dyn Tool>> {
+ vec![
+ // Skills metadata tools. `skill_run` is already exposed by RunSkillTool
+ // above, so it is not duplicated. Reads ship default-ON; the
+ // create/install/uninstall mutators ship default-OFF via
+ // `tools::user_filter` (install also fetches remote content).
+ Box::new(WorkflowListTool::new(config.clone())),
+ Box::new(WorkflowDescribeTool::new(config.clone())),
+ Box::new(SkillSearchTool::new(config.clone())),
+ // Skill registry tools — browse/search/install from remote registries.
+ // Browse and search are read-only (default-ON); install is a write
+ // operation (fetches remote content and writes to disk).
+ Box::new(SkillRegistryBrowseTool),
+ Box::new(SkillRegistrySearchTool),
+ Box::new(SkillRegistryInstallTool::new(config.clone())),
+ Box::new(SkillRegistrySourcesTool),
+ Box::new(SkillRegistryUninstallTool),
+ // Skill runtime probes — resolve the reusable Node/Python runtimes
+ // that skill execution relies on before a script-backed skill runs.
+ Box::new(SkillRuntimeResolveRuntimesTool::new(config.clone())),
+ Box::new(WorkflowReadResourceTool::new(config.clone())),
+ Box::new(WorkflowRecentRunsTool::new(config.clone())),
+ Box::new(WorkflowReadRunLogTool::new(config.clone())),
+ Box::new(WorkflowCreateTool::new(config.clone())),
+ Box::new(WorkflowInstallFromUrlTool::new(config.clone())),
+ Box::new(WorkflowUninstallTool),
+ ]
+}
diff --git a/crates/openhuman-core/src/tools/mod.rs b/crates/openhuman-core/src/tools/mod.rs
index 9c2308aa3a..5a359eb815 100644
--- a/crates/openhuman-core/src/tools/mod.rs
+++ b/crates/openhuman-core/src/tools/mod.rs
@@ -29,14 +29,6 @@ pub use crate::memory::tools::{MemoryTool, MEMORY_TOOL_NAME};
pub use crate::search::TinySearchTool;
pub use crate::security::credentials::tools::*;
pub use crate::security::tools::*;
-#[cfg(feature = "skills")]
-pub use crate::skills::catalog::tools::*;
-#[cfg(feature = "skills")]
-pub use crate::skills::runtime::tools::*;
-#[cfg(feature = "skills")]
-pub use crate::skills::search::SkillSearchTool;
-#[cfg(feature = "skills")]
-pub use crate::skills::tools::*;
#[cfg(feature = "voice")]
pub use crate::voice::audio_toolkit::tools::*;
pub use implementations::*;
diff --git a/crates/openhuman-core/src/tools/ops.rs b/crates/openhuman-core/src/tools/ops.rs
index 2d76328d3d..4229254dc9 100644
--- a/crates/openhuman-core/src/tools/ops.rs
+++ b/crates/openhuman-core/src/tools/ops.rs
@@ -217,45 +217,10 @@ pub fn all_tools_with_runtime(
security.clone(),
)),
Box::new(GmailUnsubscribeTool),
- // Skills metadata tools. `skill_run` is already exposed by RunSkillTool
- // above, so it is not duplicated. Reads ship default-ON; the
- // create/install/uninstall mutators ship default-OFF via
- // `tools::user_filter` (install also fetches remote content).
- #[cfg(feature = "skills")]
- Box::new(WorkflowListTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(WorkflowDescribeTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(SkillSearchTool::new(config.clone())),
- // Skill registry tools — browse/search/install from remote registries.
- // Browse and search are read-only (default-ON); install is a write
- // operation (fetches remote content and writes to disk).
- #[cfg(feature = "skills")]
- Box::new(SkillRegistryBrowseTool),
- #[cfg(feature = "skills")]
- Box::new(SkillRegistrySearchTool),
- #[cfg(feature = "skills")]
- Box::new(SkillRegistryInstallTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(SkillRegistrySourcesTool),
- #[cfg(feature = "skills")]
- Box::new(SkillRegistryUninstallTool),
- // Skill runtime probes — resolve the reusable Node/Python runtimes
- // that skill execution relies on before a script-backed skill runs.
- #[cfg(feature = "skills")]
- Box::new(SkillRuntimeResolveRuntimesTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(WorkflowReadResourceTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(WorkflowRecentRunsTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(WorkflowReadRunLogTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(WorkflowCreateTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(WorkflowInstallFromUrlTool::new(config.clone())),
- #[cfg(feature = "skills")]
- Box::new(WorkflowUninstallTool),
+ ]);
+ #[cfg(feature = "skills")]
+ tools.extend(crate::skills::registration::tools(config.clone()));
+ tools.extend(vec![
// Task & productivity tools (issue: agent-tool expansion).
// Read/observe + bounded-write tools are registered here; the
// destructive/overextending siblings (artifact_delete,