Skip to content

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

feat(connectors): add integration tool config schema

Steven Enamakelb12ad3e08cbc
diff --git a/crates/openhuman-core/src/config/schema/tools/integrations.rs b/crates/openhuman-core/src/config/schema/tools/integrations.rs
index 137c11c464..abea481c83 100644
--- a/crates/openhuman-core/src/config/schema/tools/integrations.rs
+++ b/crates/openhuman-core/src/config/schema/tools/integrations.rs
@@ -76,6 +76,19 @@ pub struct ComposioConfig {
#[serde(default)]
pub gmail_sync_query: String,
+ /// Toolkits offered to the agent: when non-empty, only these are listed
+ /// (case-insensitive; `_` and `-` are ignored, so `google_calendar` is
+ /// `googlecalendar`). An empty list offers every toolkit. Narrows what the
+ /// connector module lists (tools, toolkits, agent-ready toolkits) without
+ /// touching existing connections or scope preferences. Read when the
+ /// connector module loads, so an edit applies on the next launch.
+ #[serde(default)]
+ pub offered_toolkits_allow: Vec<String>,
+ /// Toolkits never offered to the agent, even when `offered_toolkits_allow`
+ /// names them. Same matching and timing as the allow list.
+ #[serde(default)]
+ pub offered_toolkits_deny: Vec<String>,
+
/// A direct-mode credential an embedder pinned for one agent. Never
/// persisted. While set, Composio tools resolve against this config
/// rather than reloading `config_path`, and its key wins over the
@@ -103,6 +116,8 @@ impl std::fmt::Debug for ComposioConfig {
.field("mode", &self.mode)
.field("api_key", &self.api_key.as_ref().map(|_| "<redacted>"))
.field("gmail_sync_query", &self.gmail_sync_query)
+ .field("offered_toolkits_allow", &self.offered_toolkits_allow)
+ .field("offered_toolkits_deny", &self.offered_toolkits_deny)
.field("host_credential", &self.host_credential)
.finish()
}
@@ -193,6 +208,8 @@ impl Default for ComposioConfig {
mode: default_composio_mode(),
api_key: None,
gmail_sync_query: String::new(),
+ offered_toolkits_allow: Vec::new(),
+ offered_toolkits_deny: Vec::new(),
host_credential: None,
}
}
diff --git a/crates/openhuman-core/src/modules/connectors.rs b/crates/openhuman-core/src/modules/connectors.rs
index 25250ed943..70bc3439ee 100644
--- a/crates/openhuman-core/src/modules/connectors.rs
+++ b/crates/openhuman-core/src/modules/connectors.rs
@@ -64,6 +64,24 @@ pub use names::methods;
/// loudly rather than silently downgrading to the other route, which would send
/// a user's requests somewhere they did not choose.
pub fn module_config(config: &Config) -> Result<serde_json::Value, String> {
+ let mut payload = route_config(config)?;
+ payload["offered_toolkits"] = offered_toolkits(config);
+ Ok(payload)
+}
+
+/// The host's offered-toolkit policy as the module reads it
+/// (`tinyconnectors_bus::vocabulary::OfferedToolkits`). Also the whole load
+/// blob when no route can be named, so the policy still applies to the
+/// capability listings of a signed-out module.
+#[must_use]
+pub fn offered_toolkits(config: &Config) -> serde_json::Value {
+ serde_json::json!({
+ "allow": config.composio.offered_toolkits_allow,
+ "deny": config.composio.offered_toolkits_deny,
+ })
+}
+
+fn route_config(config: &Config) -> Result<serde_json::Value, String> {
let state_dir = config.workspace_dir.join("state");
// A host-pinned credential outranks the mode and the credential store, the
@@ -221,6 +239,8 @@ async fn ensure_routed(config: &Config, proxy: &Proxy) -> Result<(), String> {
// it later would strand the history already written there.
if let Some(object) = route.as_object_mut() {
object.remove("state_dir");
+ // Load-time like `state_dir`: the policy is not part of the route.
+ object.remove("offered_toolkits");
}
let current = fingerprint(&route);
diff --git a/crates/openhuman-core/src/modules/ops.rs b/crates/openhuman-core/src/modules/ops.rs
index 13034272e8..c395947080 100644
--- a/crates/openhuman-core/src/modules/ops.rs
+++ b/crates/openhuman-core/src/modules/ops.rs
@@ -545,7 +545,7 @@ fn module_config(config: &Config, id: &str) -> serde_json::Value {
error = %error,
"[connectors] no route configured; loading with the capability surface only"
);
- serde_json::json!({})
+ serde_json::json!({ "offered_toolkits": super::connectors::offered_toolkits(config) })
});
}
serde_json::json!({})