Skip to content

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

fix(registry): deduplicate module registration across registry parts

Steven Enamakel1674f9bf252c
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.rs
new file mode 100644
index 0000000000..2358ce95a0
--- /dev/null
+++ b/crates/openhuman-core/src/integrations/composio/connected_integrations/fetch_uncached.rs
@@ -0,0 +1,490 @@
+//! [`fetch_connected_integrations_uncached`] — the actual mode-aware
+//! backend/direct fetch behind [`super::fetch::fetch_connected_integrations_status`]'s
+//! cache miss path. Kept in its own file because it is one large,
+//! 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::config::Config;
+
+
+async fn fetch_connected_integrations_uncached(
+ config: &Config,
+) -> Option<Vec<ConnectedIntegration>> {
+ use super::super::client::{create_composio_client, direct_list_connections, ComposioClientKind};
+
+ // Route via the mode-aware factory so the chat-agent's
+ // "connected_integrations" view reflects the live tenant — backend
+ // (tinyhumans) or direct (user's personal Composio). Prior to #1710
+ // Wave 3 this path called `build_composio_client` directly, which
+ // is backend-only — after a `composio.mode = "direct"` toggle the
+ // cache kept replaying the tinyhumans-tenant connections back into
+ // the integration overview (e.g. gmail / notion appearing as
+ // connected in direct mode even when the user's direct tenant had
+ // a different set of toolkits). Resolving per call closes the
+ // loop: `ComposioConfigChangedSubscriber` invalidates the cache on
+ // toggle and the next miss re-populates it from the live tenant.
+ let kind = match create_composio_client(config) {
+ Ok(kind) => kind,
+ Err(e) => {
+ tracing::debug!(
+ error = %e,
+ "[composio] fetch_connected_integrations: no client (not signed in?)"
+ );
+ return None;
+ }
+ };
+
+ // Pull the allowlist + connections + tool catalogue. Backend mode
+ // walks the tinyhumans tenant's curated allowlist via
+ // `list_toolkits`; direct mode has no centralised allowlist (per
+ // `ops::composio_list_toolkits`'s direct-mode branch) so the
+ // user's set of active connections IS the universe of valid
+ // toolkit arguments.
+ //
+ // On transient errors we return `None` instead of a degraded
+ // `Some(Vec::new())` so `fetch_connected_integrations` does NOT
+ // cache the failure. Caching an empty allowlist would hide every
+ // integration from the orchestrator until the process restarts or
+ // the cache is explicitly invalidated — a single 5xx during
+ // startup would silently break delegation for the whole session.
+ let (allowlisted_toolkits, connections, tools_by_toolkit, catalog_descriptions): (
+ Vec<String>,
+ Vec<super::super::types::ComposioConnection>,
+ Vec<super::super::types::ComposioToolSchema>,
+ std::collections::HashMap<String, String>,
+ ) = match &kind {
+ ComposioClientKind::Backend(client) => {
+ let (allowlist, catalog_descriptions): (
+ Vec<String>,
+ std::collections::HashMap<String, String>,
+ ) = match client.list_toolkits().await {
+ Ok(resp) => {
+ // Index the dynamic catalog's descriptions by lowercased
+ // slug so the prompt builder can prefer them over the
+ // hardcoded table (see `resolve_toolkit_description`).
+ // Empty descriptions are skipped so the fallback applies.
+ let catalog_descriptions: std::collections::HashMap<String, String> = resp
+ .catalog
+ .iter()
+ .filter_map(|entry| {
+ let slug = entry.slug.trim().to_ascii_lowercase();
+ if slug.is_empty() {
+ return None;
+ }
+ let desc = entry
+ .description
+ .as_deref()
+ .map(str::trim)
+ .filter(|d| !d.is_empty())?;
+ Some((slug, desc.to_string()))
+ })
+ .collect();
+ // Source the connectable set from the catalog's enabled
+ // entries (the gate's own predicate), falling back to the
+ // flat `toolkits` array for pre-catalog backends. See
+ // `connectable_toolkit_slugs`.
+ let allowlist = connectable_toolkit_slugs(&resp.toolkits, &resp.catalog);
+ tracing::debug!(
+ catalog_entries = resp.catalog.len(),
+ catalog_descriptions = catalog_descriptions.len(),
+ connectable = allowlist.len(),
+ catalog_sourced = !resp.catalog.is_empty(),
+ "[composio] fetch_connected_integrations: resolved connectable set from catalog"
+ );
+ (allowlist, catalog_descriptions)
+ }
+ Err(e) => {
+ tracing::warn!(
+ "[composio] fetch_connected_integrations: list_toolkits (backend) failed: {e}"
+ );
+ return None;
+ }
+ };
+
+ if allowlist.is_empty() {
+ tracing::debug!(
+ "[composio] fetch_connected_integrations: backend allowlist is empty"
+ );
+ return Some(Vec::new());
+ }
+
+ let connections = match client.list_connections().await {
+ Ok(resp) => resp.connections,
+ Err(e) => {
+ tracing::warn!(
+ "[composio] fetch_connected_integrations: list_connections (backend) failed: {e}"
+ );
+ return None;
+ }
+ };
+
+ // Tool catalogue scoped to the active subset only —
+ // not-connected toolkits won't be invoked from a sub-agent.
+ let connected_slugs_for_tools: Vec<String> = {
+ let mut v: Vec<String> = connections
+ .iter()
+ .filter(|c| c.is_active())
+ .map(|c| c.normalized_toolkit())
+ .filter(|t| !t.is_empty())
+ .collect();
+ v.sort();
+ v.dedup();
+ v
+ };
+ let tools = if connected_slugs_for_tools.is_empty() {
+ Vec::new()
+ } else {
+ match client
+ .list_tools(Some(&connected_slugs_for_tools), None)
+ .await
+ {
+ Ok(resp) => resp.tools,
+ Err(e) => {
+ tracing::warn!(
+ "[composio] fetch_connected_integrations: list_tools (backend) failed: {e}"
+ );
+ return None;
+ }
+ }
+ };
+
+ (allowlist, connections, tools, catalog_descriptions)
+ }
+ ComposioClientKind::Direct(direct) => {
+ // Direct mode: walk the user's personal Composio tenant
+ // for *connection state* (active accounts on their key) —
+ // there's no central allowlist in direct mode, so the
+ // active set IS the allowlist.
+ //
+ // Tool *schemas* are tenant-agnostic — Composio's action
+ // definitions (e.g. GMAIL_SEND_EMAIL parameter shape) are
+ // identical regardless of which Composio tenant a user is
+ // connected via. So we best-effort fetch schemas through
+ // the backend client (curated list_tools) if a backend
+ // session is available, even though connection routing
+ // goes to the user's direct tenant. This preserves the
+ // chat agent's "21 gmail actions available" view while
+ // execution itself (via `ComposioActionTool` / Wave 1
+ // factory) still routes to the user's tenant. Direct-only
+ // users without a backend session get empty tools — that
+ // matches `composio_list_tools`'s direct-mode policy and
+ // the `subagent_runner` LazyToolkitResolver still resolves
+ // tools lazily at delegation time.
+ let connections = match direct_list_connections(direct).await {
+ Ok(resp) => resp.connections,
+ Err(e) => {
+ tracing::warn!(
+ "[composio] fetch_connected_integrations: list_connections (direct) failed: {e:#}"
+ );
+ return None;
+ }
+ };
+ let allowlist: Vec<String> = {
+ let mut v: Vec<String> = connections
+ .iter()
+ .filter(|c| c.is_active())
+ .map(|c| c.normalized_toolkit())
+ .filter(|t| !t.is_empty())
+ .collect();
+ v.sort();
+ v.dedup();
+ v
+ };
+ if allowlist.is_empty() {
+ tracing::info!(
+ "[composio-direct] fetch_connected_integrations: direct tenant has no active connections; returning empty overview"
+ );
+ return Some(Vec::new());
+ }
+ tracing::debug!(
+ connected = allowlist.len(),
+ "[composio-direct] fetch_connected_integrations: using direct tenant's active set as allowlist (no central allowlist in direct mode)"
+ );
+
+ // Best-effort: pull tool schemas via the backend client
+ // (definitional source). Failure is non-fatal — we fall
+ // back to empty tools and let lazy resolution handle it.
+ let tools = match super::super::client::build_composio_client(config) {
+ Some(backend_client) => {
+ match backend_client.list_tools(Some(&allowlist), None).await {
+ Ok(resp) => {
+ tracing::debug!(
+ count = resp.tools.len(),
+ "[composio-direct] fetch_connected_integrations: pulled tool schemas from backend (tenant-agnostic definitional source)"
+ );
+ resp.tools
+ }
+ Err(e) => {
+ tracing::info!(
+ "[composio-direct] fetch_connected_integrations: backend list_tools failed (will use lazy fallback at delegation time): {e:#}"
+ );
+ Vec::new()
+ }
+ }
+ }
+ None => {
+ tracing::info!(
+ "[composio-direct] fetch_connected_integrations: no backend session for schema fetch; lazy fallback at delegation time"
+ );
+ Vec::new()
+ }
+ };
+ // Direct mode has no central catalog endpoint, so prompt
+ // descriptions come from the hardcoded fallback table.
+ (
+ allowlist,
+ connections,
+ tools,
+ std::collections::HashMap::new(),
+ )
+ }
+ };
+
+ // Active connection slugs (status filter mirrors the original logic).
+ let connected_slugs: std::collections::HashSet<String> = connections
+ .iter()
+ .filter(|c| c.is_active())
+ .map(|c| c.normalized_toolkit())
+ .filter(|toolkit| !toolkit.is_empty())
+ .collect();
+
+ // Most-informative *non-active* status per toolkit slug. Lets the
+ // integrations_agent spawn-gate (#2365) emit a precise message
+ // when a connection row exists but isn't usable yet (`INITIATED`
+ // — OAuth still in progress) or any longer (`EXPIRED` / `FAILED`)
+ // — instead of the legacy generic "available but not authorized".
+ //
+ // Status priority (UI-actionability):
+ // 1. EXPIRED — reconnect path
+ // 2. FAILED / ERROR — reconnect path
+ // 3. INITIATED / INITIALIZING / PENDING — finish OAuth in browser
+ // 4. anything else — passes through verbatim
+ let non_active_status_by_slug: std::collections::HashMap<String, String> = {
+ fn priority(status: &str) -> u8 {
+ let s = status.trim().to_ascii_uppercase();
+ match s.as_str() {
+ "EXPIRED" => 4,
+ "FAILED" | "ERROR" => 3,
+ "INITIATED" | "INITIALIZING" | "PENDING" => 2,
+ _ => 1,
+ }
+ }
+ let mut map: std::collections::HashMap<String, (u8, String)> =
+ std::collections::HashMap::new();
+ for conn in connections.iter().filter(|c| !c.is_active()) {
+ let slug = conn.normalized_toolkit();
+ if slug.is_empty() {
+ continue;
+ }
+ // Don't override an ACTIVE-slug — those carry no non-active
+ // status from this map's perspective.
+ if connected_slugs.contains(&slug) {
+ continue;
+ }
+ let p = priority(&conn.status);
+ map.entry(slug.clone())
+ .and_modify(|cur| {
+ if p > cur.0 {
+ tracing::debug!(
+ target: "composio",
+ toolkit = %slug,
+ previous_status = %cur.1,
+ previous_priority = cur.0,
+ new_status = %conn.status,
+ new_priority = p,
+ "[composio] non_active_status_by_slug: upgraded most-informative status"
+ );
+ *cur = (p, conn.status.clone());
+ } else {
+ tracing::trace!(
+ target: "composio",
+ toolkit = %slug,
+ kept_status = %cur.1,
+ kept_priority = cur.0,
+ candidate_status = %conn.status,
+ candidate_priority = p,
+ "[composio] non_active_status_by_slug: kept higher-priority status"
+ );
+ }
+ })
+ .or_insert_with(|| {
+ tracing::debug!(
+ target: "composio",
+ toolkit = %slug,
+ status = %conn.status,
+ priority = p,
+ "[composio] non_active_status_by_slug: first non-active row"
+ );
+ (p, conn.status.clone())
+ });
+ }
+ let final_map: std::collections::HashMap<String, String> =
+ map.into_iter().map(|(k, (_, v))| (k, v)).collect();
+ tracing::debug!(
+ target: "composio",
+ entries = final_map.len(),
+ "[composio] non_active_status_by_slug: final map"
+ );
+ final_map
+ };
+
+ // Deduplicate the allowlist so a backend that returns duplicates
+ // doesn't produce dual entries downstream.
+ let mut unique_toolkits: Vec<String> = allowlisted_toolkits.clone();
+ unique_toolkits.sort();
+ unique_toolkits.dedup();
+
+ // Build one entry per allowlisted toolkit. Connected entries
+ // carry their action catalogue; not-connected entries carry an
+ // empty `tools` vec.
+ let mut integrations: Vec<ConnectedIntegration> = Vec::with_capacity(unique_toolkits.len());
+ for slug in &unique_toolkits {
+ let connected = connected_slugs.contains(slug);
+ // Anchor the prefix with an underscore so slugs that share
+ // a text prefix (e.g. `git` vs `github`) don't false-match
+ // each other's actions. `GMAIL_SEND_EMAIL` matches `gmail_`,
+ // not just `gmail`, so siblings stay in their own buckets.
+ let action_prefix = format!("{}_", slug.to_uppercase());
+ let (tools, gated_tools): (Vec<ConnectedIntegrationTool>, Vec<GatedIntegrationTool>) =
+ if connected {
+ // Apply the same curated-whitelist + user-scope filter the
+ // meta-tool layer uses, so the integrations_agent prompt
+ // only advertises actions the agent is actually allowed to
+ // call. One pref load per toolkit (not per action).
+ //
+ // Actions that the catalog *does* know about but the user's
+ // current scope pref denies are routed into `gated_tools` so
+ // the agent can honestly answer "I have this capability but
+ // it needs the {scope} toggle in Connections → {toolkit}".
+ // The agent cannot flip the scope itself — that's a UI-only
+ // action. Without this gated surface the LLM has no way to
+ // know the gated action exists at all and will tell the user
+ // "I don't support that" — technically correct about its
+ // callable surface, but misleading about the toolkit.
+ let pref = super::super::ops::load_user_scope_pref(config, slug).await;
+ let mut visible: Vec<ConnectedIntegrationTool> = Vec::new();
+ let mut gated: Vec<GatedIntegrationTool> = Vec::new();
+ for t in tools_by_toolkit
+ .iter()
+ .filter(|t| t.function.name.starts_with(&action_prefix))
+ {
+ if super::super::providers::is_action_visible_with_pref(&t.function.name, &pref) {
+ visible.push(ConnectedIntegrationTool {
+ name: t.function.name.clone(),
+ description: t.function.description.clone().unwrap_or_default(),
+ parameters: t.function.parameters.clone(),
+ });
+ } else if let Some(required_scope) =
+ super::super::providers::curated_scope_for(&t.function.name)
+ {
+ // Only surface CURATED actions as `gated` — uncurated
+ // tools (which fall through to `classify_unknown` and
+ // happen to land outside the user's pref) are not
+ // first-class user-facing capabilities, and listing
+ // them would clutter the prompt with internal slugs.
+ // Deliberately NO `parameters` field: the LLM should
+ // not be able to construct a call envelope; it can
+ // only describe + point at the unlock path.
+ // Ship the unlock path as data — single path today
+ // (the Connections UI toggle). The agent does NOT
+ // have a tool to flip scopes; that capability was
+ // removed because LLM-mediated scope elevation made
+ // the safety contract depend on model behavior and
+ // was a soft gate the model could route around. If
+ // more unlock paths exist in future (per-action
+ // approval modal, time-boxed elevation, etc.) they
+ // land here and the prompt renderer picks them up.
+ let scope_str = required_scope.as_str();
+ let unlock_paths = vec![format!(
+ "the user enables it themselves in \
+ Connections → {slug} → {scope_str}"
+ )];
+ gated.push(GatedIntegrationTool {
+ name: t.function.name.clone(),
+ description: t.function.description.clone().unwrap_or_default(),
+ required_scope: scope_str.to_string(),
+ unlock_paths,
+ });
+ }
+ }
+ tracing::debug!(
+ toolkit = %slug,
+ visible = visible.len(),
+ gated = gated.len(),
+ "[composio][scopes] integrations prompt action set"
+ );
+ (visible, gated)
+ } else {
+ (Vec::new(), Vec::new())
+ };
+
+ let integration_connections: Vec<
+ crate::agent::context::prompt::IntegrationConnection,
+ > = if connected {
+ let mut conns: Vec<_> = connections
+ .iter()
+ .filter(|c| c.is_active() && c.normalized_toolkit() == *slug)
+ .collect();
+ conns.sort_by(|a, b| a.created_at.cmp(&b.created_at));
+ conns
+ .iter()
+ .enumerate()
+ .map(|(idx, c)| {
+ let label = [
+ c.account_email.as_deref(),
+ c.workspace.as_deref(),
+ c.username.as_deref(),
+ ]
+ .into_iter()
+ .flatten()
+ .map(str::trim)
+ .find(|s| !s.is_empty())
+ .map(str::to_string);
+ crate::agent::context::prompt::IntegrationConnection {
+ connection_id: c.id.clone(),
+ label,
+ is_default: idx == 0,
+ }
+ })
+ .collect()
+ } else {
+ Vec::new()
+ };
+
+ integrations.push(ConnectedIntegration {
+ toolkit: slug.clone(),
+ description: resolve_toolkit_description(&catalog_descriptions, slug),
+ tools,
+ gated_tools,
+ connected,
+ connections: integration_connections,
+ non_active_status: if connected {
+ None
+ } else {
+ non_active_status_by_slug.get(slug).cloned()
+ },
+ });
+ }
+
+ integrations.sort_by(|a, b| a.toolkit.cmp(&b.toolkit));
+
+ let connected_count = integrations.iter().filter(|i| i.connected).count();
+ tracing::info!(
+ total = integrations.len(),
+ connected = connected_count,
+ "[composio] fetch_connected_integrations: done"
+ );
+ for ci in &integrations {
+ tracing::debug!(
+ toolkit = %ci.toolkit,
+ connected = ci.connected,
+ non_active_status = ?ci.non_active_status,
+ tool_count = ci.tools.len(),
+ "[composio] integration overview"
+ );
+ }
+
+ Some(integrations)
diff --git a/crates/openhuman-core/src/mcp/server/tools_tests.rs b/crates/openhuman-core/src/mcp/server/tools_tests.rs
index 6ab4415173..28479a9fc3 100644
--- a/crates/openhuman-core/src/mcp/server/tools_tests.rs
+++ b/crates/openhuman-core/src/mcp/server/tools_tests.rs
@@ -1,7 +1,7 @@
use super::specs::list_tools_result_for_config;
use super::*;
-#[path = "tools_tests_part_01_tests.rs"]
-mod part_01_tests;
-#[path = "tools_tests_part_02_tests.rs"]
-mod part_02_tests;
+#[path = "tools_tests_params_and_specs_tests.rs"]
+mod params_and_specs_tests;
+#[path = "tools_tests_tag_and_dispatch_tests.rs"]
+mod tag_and_dispatch_tests;
diff --git a/crates/openhuman-core/src/modules/registry_part_01.rs b/crates/openhuman-core/src/modules/registry_part_01.rs
deleted file mode 100644
index 7f9c26b4e6..0000000000
--- a/crates/openhuman-core/src/modules/registry_part_01.rs
+++ /dev/null
@@ -1,633 +0,0 @@
-use super::types::{LoadPolicy, ModuleRecord, PlatformAsset};
-
-/// The `tinydocs` module: `.docx` / `.pptx` synthesis and `.pdf` extraction.
-///
-/// Lazy, because a user who never asks for a document should not pay a download,
-/// a `dlopen`, and the resident cost of a library that is never unloaded.
-const TINYDOCS: ModuleRecord = ModuleRecord {
- id: "tinydocs",
- description: "Document synthesis (.docx, .pptx) and PDF text extraction",
- bus_name: "ai.tinyhumans.tinydocs.Documents",
- object_path: "/ai/tinyhumans/tinydocs/Documents",
- version: "0.1.15",
- release_url: "https://github.com/tinyhumansai/tinydocs/releases/tag/v0.1.15",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinydocs-module-0.1.15-ubuntu-24.04-x86_64.tar.gz",
- sha256: "15a425fb336559bc87722ea0208fe911afd915eda33df9155ce08fe1e737d3a1",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinydocs-module-0.1.15-ubuntu-24.04-arm64.tar.gz",
- sha256: "b1ea63930860624ee1b221cb8669e4435f5551692634ad3911ad9d94d9407aa5",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinydocs-module-0.1.15-ubuntu-22.04-x86_64.tar.gz",
- sha256: "a0f6991e9feeb29a2cbf7a802e46e27232c028517f00606c56a57383c00ba83b",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinydocs-module-0.1.15-ubuntu-22.04-arm64.tar.gz",
- sha256: "c9e66d54c39108cf125d37ba6c1d36cde6f702901a0ba5dcb007e8c6f8f8fd63",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinydocs-module-0.1.15-macos-26-arm64.tar.gz",
- sha256: "b1fdcce5debb275220b1deaea4b90c84daea212496d08a8af95fd7c1d02aa32c",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinydocs-module-0.1.15-macos-26-x86_64.tar.gz",
- sha256: "cbef909e15ef48151feb90746b23c42a2a54ee0cabaa48ee1324c8f5e584f768",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinydocs-module-0.1.15-macos-15-arm64.tar.gz",
- sha256: "979fc81cc8c73ca52afddb2bb363d126f2cabdc0875b0fe954b4bd2d58a308a9",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinydocs-module-0.1.15-macos-15-x86_64.tar.gz",
- sha256: "3094a320870183ca77629f4132ab99f2a411276d3111002b0dd25028904e2517",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinydocs-module-0.1.15-windows-2025-x86_64.zip",
- sha256: "8e7ee6ad41d5b4d39dc54c18802079d4a0ba5757acbf3b3c3b8aef3e0754afdf",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinydocs-module-0.1.15-windows-2022-x86_64.zip",
- sha256: "70bcf4ab948d19c99965c914de44fa9819e57a12cc984217ce3b1851b7584888",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinydocs-module-0.1.15-windows-11-arm64.zip",
- sha256: "f43dea943fab9179c827df5718562a7263ea73f35d915660f9d9fdeadc7de347",
- },
- ],
- load: LoadPolicy::Lazy,
-};
-
-/// The `tinywallet` module: transaction building and assembly for four chains.
-///
-/// Lazy for the same reason as [`TINYDOCS`], and more so: most sessions never
-/// touch a wallet, and this artifact carries `bitcoin` and a native `secp256k1`
-/// build that would otherwise be resident for all of them.
-///
-/// **This host sends it the recovery phrase, over confidential calls, and never
-/// derives or signs itself.** All four chains — Bitcoin, EVM, Solana and Tron —
-/// derive and sign inside the module. This binary does not link the root
-/// `tinywallet` crate at all — it takes `tinywallet-bus`, the wire contract,
-/// which carries no `key` gate — nor does it link `k256`; see the note on the
-/// `tinywallet-bus` dependency.
-///
-/// The phrase is only sent to a module tinybus has attested *and* whose digest
-/// matches one of the entries below — `super::wallet::attested_proxy` checks
-/// this table itself rather than trusting that some check happened.
-///
-/// The contract also exposes `ExportKey` for downstream hosts that must drive
-/// a signer locally; OpenHuman itself does not call it.
-///
-/// Three releases got here, and the order mattered. v0.2.3 changed no method at
-/// all — it was the same module rebuilt against a bus that could attest it.
-/// Attestation used to be recorded only from a `modules.toml` beside the
-/// artifact, and a release download extracts into a temporary directory that has
-/// none, so this module could never be an attested recipient however carefully
-/// the digest below was pinned (tinybus#15 fixed that). Only then was it safe
-/// for v0.3.0 to add methods that take a secret, and for v0.4.0 to add
-/// `SignMessage` for the Solana and x402 encodings the wire contract does not
-/// model. Adding them earlier would have made them unreachable in production and
-/// reachable in a developer's tree, which is the worst of both.
-const TINYWALLET: ModuleRecord = ModuleRecord {
- id: "tinywallet",
- description: "Transaction building and assembly for Bitcoin, EVM, Solana and Tron",
- bus_name: "ai.tinyhumans.tinywallet.Wallet",
- object_path: "/ai/tinyhumans/tinywallet/Wallet",
- version: "0.5.1",
- release_url: "https://github.com/tinyhumansai/tinywallet/releases/tag/v0.5.1",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinywallet-module-0.5.1-ubuntu-24.04-x86_64.tar.gz",
- sha256: "60ae46bc18b08671d7646ad01affa7f878a4b035a050a47a80353bca5dffc276",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinywallet-module-0.5.1-ubuntu-24.04-arm64.tar.gz",
- sha256: "9f516cb30d36314c72b49c30ad81661da2435a40a064e99583658ba99ed9db2a",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinywallet-module-0.5.1-ubuntu-22.04-x86_64.tar.gz",
- sha256: "88b63685cab8a622416f24f1ad569153f249d6d74732ff33c79e4021cf64a611",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinywallet-module-0.5.1-ubuntu-22.04-arm64.tar.gz",
- sha256: "6c86be45fd260690a93f36024abc9d4f777c30233c70b0363bc23bd25dc4fdfb",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinywallet-module-0.5.1-macos-26-arm64.tar.gz",
- sha256: "4e517d4a3440c2aad852cf5ec23d12863dc9748ecad256dc1578b9f21f4f0ace",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinywallet-module-0.5.1-macos-26-x86_64.tar.gz",
- sha256: "94a6270d07aa0f0788312383552c1baec26ba2db6856c1ab425ddafc4d61b3bb",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinywallet-module-0.5.1-macos-15-arm64.tar.gz",
- sha256: "95e1f1905e0c358ae03b448c11b8c8a413d67951fd02b9f0d78f811f7e5e3037",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinywallet-module-0.5.1-macos-15-x86_64.tar.gz",
- sha256: "55973b9a5b2c0cea8ddd380a3b9ece65c09485faeea2d1cc1e6846b8e888828a",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinywallet-module-0.5.1-windows-2025-x86_64.zip",
- sha256: "96037a6c660e31b747898976feba5c73bd05a47a34b1c9d1f125c215cffde5ec",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinywallet-module-0.5.1-windows-2022-x86_64.zip",
- sha256: "256282d33a832f19cfae3309194f08a602676f4f1c9e52fb2ced998216882f4c",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinywallet-module-0.5.1-windows-11-arm64.zip",
- sha256: "8b56db13123abe43035d339521323cb74969fedc5d57df2d591153dd3afec4d6",
- },
- ],
- load: LoadPolicy::Lazy,
-};
-
-/// The complete TinyMemory engine, loaded eagerly so its capabilities are
-/// available when the kernel assembles its RPC and tool surfaces.
-const TINYMEMORY: ModuleRecord = ModuleRecord {
- id: "tinymemory",
- description: "Local memory engine: store, ranked recall, and portable export",
- bus_name: "ai.tinyhumans.tinymemory.Memory",
- object_path: "/ai/tinyhumans/tinymemory/Memory",
- version: "1.16.0",
- release_url: "https://github.com/tinyhumansai/tinymemory/releases/tag/v1.16.0",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinymemory-module-1.16.0-ubuntu-24.04-x86_64.tar.gz",
- sha256: "fc65fce075b0d286b0d1cce48fc8952c2936e4b945f2af84b6a20d800c2a10d7",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinymemory-module-1.16.0-ubuntu-24.04-arm64.tar.gz",
- sha256: "1735efb7b0b6a56c85da1b62fbfa2d2a68995a04203ec2d79b4e1b389935fd92",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinymemory-module-1.16.0-ubuntu-22.04-x86_64.tar.gz",
- sha256: "f3ba06867ec89b8374a405f8a8569f5cecf88490609354ae4a6c1faa6e55b425",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinymemory-module-1.16.0-ubuntu-22.04-arm64.tar.gz",
- sha256: "b9f6794806e9463cffbfc3ce0c4b4b39cb8c1f3403a2ba956b0984cc35e9354a",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinymemory-module-1.16.0-macos-26-arm64.tar.gz",
- sha256: "097ab5fdc352f84f34b770302db73c5c1468e7ad48709e1767e74d61cc55646c",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinymemory-module-1.16.0-macos-26-x86_64.tar.gz",
- sha256: "3128eaff5e820c86fabfbe6a759976150313ca3c2c38e00bb2bb67dd2dfa76ba",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinymemory-module-1.16.0-macos-15-arm64.tar.gz",
- sha256: "fa9d65f31b7ece3eed0d118795ce06b66f0bd271556b91ccad09b0c4b41d94f9",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinymemory-module-1.16.0-macos-15-x86_64.tar.gz",
- sha256: "ac1343f128cdd4b299b43318019d1b26c0c8fc28abf62bf24ff8fb6d9894730f",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinymemory-module-1.16.0-windows-2025-x86_64.zip",
- sha256: "dcf5ec88583a02b284f0b430a037230a3d974703d39f11be53a4e36688c8d7db",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinymemory-module-1.16.0-windows-2022-x86_64.zip",
- sha256: "cf56453fba522a075e569d60c39d7e56e938ff2d4fbb8270debaffd7e6b39819",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinymemory-module-1.16.0-windows-11-arm64.zip",
- sha256: "9d0ca43cc3c7cac29e631e9870fc30d3fd4971e272e393ed2a91adb7ca20fdf3",
- },
- ],
- // Eager, unlike the two codecs above. A codec that is never asked for should
- // not be paid for, but a memory driver's absence changes what the kernel
- // offers rather than merely delaying it: capabilities are read at bind time
- // and the RPC surface and agent-tool list are filtered from them. Resolving
- // that during a user's first recall would mean the first recall is the one
- // that behaves differently.
- load: LoadPolicy::Eager,
-};
-
-/// The `tinyjuice` content-aware tool-output compression engine.
-///
-/// Lazy because the host's compaction policy can disable it, and a session that
-/// never produces compressible tool output should not pay the download or
-/// resident native-library cost.
-const TINYJUICE: ModuleRecord = ModuleRecord {
- id: "tinyjuice",
- description: "Content-aware tool-output compression and recoverable caching",
- bus_name: "ai.tinyhumans.tinyjuice.Compression",
- object_path: "/ai/tinyhumans/tinyjuice/Compression",
- version: "0.2.5",
- release_url: "https://github.com/tinyhumansai/tinyjuice/releases/tag/v0.2.5",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinyjuice-module-0.2.5-ubuntu-24.04-x86_64.tar.gz",
- sha256: "e46e1b9338c20ce3b42403ace7bd7fe563a553ea3472f2111292a3fe200f6e67",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinyjuice-module-0.2.5-ubuntu-24.04-arm64.tar.gz",
- sha256: "fb2098d392d37001af728263fd375ab4663bc301be45e8ce4c713ee2b070badf",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinyjuice-module-0.2.5-ubuntu-22.04-x86_64.tar.gz",
- sha256: "946b78e860a1d8c913d83b913daef4966cfccaa2eb8814d4107bbbd63813033d",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinyjuice-module-0.2.5-ubuntu-22.04-arm64.tar.gz",
- sha256: "6eaae41654850e1fa695f3bbba6eb2c9531cd97eb3e5f163d8290510f3e668e5",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinyjuice-module-0.2.5-macos-26-arm64.tar.gz",
- sha256: "c1c154619827ca8c9f4f7b73c05dbbf992e98242de5e46bfe15dd82aa1c21746",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinyjuice-module-0.2.5-macos-26-x86_64.tar.gz",
- sha256: "b02842c52ef0f92849d08d839a01096a4b9b2900e364f4bd4f32076c2c4d2bad",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinyjuice-module-0.2.5-macos-15-arm64.tar.gz",
- sha256: "f22a74aaf6972b7062ceb83ce79671a80f26135a2ee507a74a9c250dcf6bf250",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinyjuice-module-0.2.5-macos-15-x86_64.tar.gz",
- sha256: "f0b428fac0c8a7352faf284e27ba73fab949686b404373be9792ce0fa40471eb",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinyjuice-module-0.2.5-windows-2025-x86_64.zip",
- sha256: "0c37efc18feeaf84388d9a818ea821c5b92a937ae49f5fd2d2ed7e7436615e1e",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinyjuice-module-0.2.5-windows-2022-x86_64.zip",
- sha256: "56685bba88c800f7bfb0d6a61dba1d4c31f63ae6eb8ad9df12116a39739a3df2",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinyjuice-module-0.2.5-windows-11-arm64.zip",
- sha256: "3c0956cb1e7f0123b0a53c8f7e1f66a7eb672b090d5a8add611c29844726331c",
- },
- ],
- load: LoadPolicy::Lazy,
-};
-
-/// The `tinyvoice` module: the host-agnostic half of the voice pipeline.
-///
-/// Wake-word gating, fast-path command routing, STT hallucination detection,
-/// and the capture-side audio work (downmix, resample, silence gate, WAV
-/// framing).
-///
-/// Lazy, and more clearly so than the others: voice is opt-in twice over — a
-/// user has to enable dictation or always-on listening before any of this runs
-/// — so a session that never speaks should not pay a download or a `dlopen`.
-///
-/// **The VAD deliberately does not come through here.** A segmenter is driven
-/// once per 20 ms frame from inside a `cpal` callback, and a bus round trip at
-/// that cadence would cost more than the sixty-line state machine it replaces.
-/// `voice::always_on` keeps its own; see [`super::voice`].
-const TINYVOICE: ModuleRecord = ModuleRecord {
- id: "tinyvoice",
- description: "Wake-word gating, command routing, hallucination detection, capture audio",
- bus_name: "ai.tinyhumans.tinyvoice.Voice",
- object_path: "/ai/tinyhumans/tinyvoice/Voice",
- version: "0.1.6",
- release_url: "https://github.com/tinyhumansai/tinyvoice/releases/tag/v0.1.6",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinyvoice-module-0.1.6-ubuntu-24.04-x86_64.tar.gz",
- sha256: "40686bfb1840024d1a49bb2959e454fde44a54ec35b0e86a160fbcb031d4242a",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinyvoice-module-0.1.6-ubuntu-24.04-arm64.tar.gz",
- sha256: "da691e1007691a7f4a4b377ee5f0ca03553c57f0ef887d188708d764e5b5a24b",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinyvoice-module-0.1.6-ubuntu-22.04-x86_64.tar.gz",
- sha256: "b494fe15f2270718b93d1b56b1e848694ca88b6efcbdd9a134594ef042660ed7",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinyvoice-module-0.1.6-ubuntu-22.04-arm64.tar.gz",
- sha256: "e641ea4eea89fa0f90f00577445351fb7a2762a6b473443c17240e5d5c6bcde9",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinyvoice-module-0.1.6-macos-26-arm64.tar.gz",
- sha256: "3ff9a2d4b7b7e055cf15f4566c7b84032b90bc913ebf022cb69bc6d884fe6945",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinyvoice-module-0.1.6-macos-26-x86_64.tar.gz",
- sha256: "e77f2104f3b6e6230a449d220fd1fdc475d57bc329e7ddeac6223b9cb3b50422",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinyvoice-module-0.1.6-macos-15-arm64.tar.gz",
- sha256: "4ba67976463dd164471c4bbe34bf7f3ad7280fb80c4e660c6692bea62bdca20f",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinyvoice-module-0.1.6-macos-15-x86_64.tar.gz",
- sha256: "39795777b8c27f8726473a8a26a6372430ac586046cd5a6c0ccc633815d83ea9",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinyvoice-module-0.1.6-windows-2025-x86_64.zip",
- sha256: "22c3c48e918156ed3680e8cdcebf493f37cab99c01ec5f44ff3d316c93942c02",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinyvoice-module-0.1.6-windows-2022-x86_64.zip",
- sha256: "0e7cef580404005c5736a6e5ab0a9430bc30ee017955536365dbbb2e06da5b6b",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinyvoice-module-0.1.6-windows-11-arm64.zip",
- sha256: "0bc68da8a0f937436f74384184402ca502cc92d261d67b6d55f41e2e43582874",
- },
- ],
- load: LoadPolicy::Lazy,
-};
-
-/// The `tinyruntime` module: the runtime router.
-///
-/// Resolves a language runtime, installs one when the host has none, reuses one
-/// when it does, and runs code on a bounded pool of warm interpreter processes.
-/// It is a router: on its own it knows no languages, and it routes to the two
-/// provider records below.
-///
-/// Lazy, because a host that never runs a skill, a flow step, or a `node_exec`
-/// should not pay a download and a `dlopen` for the ability to.
-///
-/// The digests below are v0.2.2's, taken verbatim from that release's
-/// `checksum.toml`. Until it existed this record carried no assets at all and
-/// the module was reachable only from a developer build named by
-/// `modules.local` or found on `OPENHUMAN_MODULE_PATH` — so on any machine that
-/// had not built it, the runtime domain was a set of tools that could not run.
-const TINYRUNTIME: ModuleRecord = ModuleRecord {
- id: "tinyruntime",
- description: "Language runtime resolution, installation, and pooled execution",
- bus_name: "ai.tinyhumans.runtime.Runtime",
- object_path: "/ai/tinyhumans/runtime/Runtime",
- version: "0.2.4",
- release_url: "https://github.com/tinyhumansai/tinyruntime/releases/tag/v0.2.4",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinyruntime-0.2.4-ubuntu-24.04-x86_64.tar.gz",
- sha256: "c0b24429d345a8a62b448de420d98fbef2f31c070ff5d5b1b378d7417ef528ae",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinyruntime-0.2.4-ubuntu-24.04-arm64.tar.gz",
- sha256: "4b23925dbd0f6646ec67927909a7e86582332d70a785ddb707f3b043fe5f9664",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinyruntime-0.2.4-ubuntu-22.04-x86_64.tar.gz",
- sha256: "f67923a9a84d3924ccb2965fba68fe0961f71c10e1f61888f958deded3b6ba83",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinyruntime-0.2.4-ubuntu-22.04-arm64.tar.gz",
- sha256: "61b89164633fa5c234a454559f54ac14c41ad35a7c04f779c3c65daae69f3401",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinyruntime-0.2.4-macos-26-arm64.tar.gz",
- sha256: "43342102c5c85af1b0e839b8e3c732db47aa5e04bcc9b6d2c4d6657e4a118efc",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinyruntime-0.2.4-macos-26-x86_64.tar.gz",
- sha256: "dd37d959c0d3d721e2654e7c3af4ccd4f1f771b4ac9a83db13dbae761331d10b",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinyruntime-0.2.4-macos-15-arm64.tar.gz",
- sha256: "ae4e7577e2031e196dce6b604b821450bb0a0d8610f82a68887a6f0ea2e3db31",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinyruntime-0.2.4-macos-15-x86_64.tar.gz",
- sha256: "90168f2be16717f10cf1a27337343df697b0d502d52250342184b0c16380c20a",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinyruntime-0.2.4-windows-2025-x86_64.zip",
- sha256: "7556dc37998c73fa0141aa8b737245b44e06473fc115cdde0eaa861804b1dfe1",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinyruntime-0.2.4-windows-2022-x86_64.zip",
- sha256: "b1f4679705f83e7627407fe108470b81d9dcfb0f978d5eb11de49e8ff1b9fdc9",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinyruntime-0.2.4-windows-11-arm64.zip",
- sha256: "68bc59305c230f3d7b97722ecc009a3a25d55398398a51261049c190c52571a9",
- },
- ],
- load: LoadPolicy::Lazy,
-};
-
-/// The `tinyruntime-nodejs` module: the Node.js half of the router's knowledge.
-///
-/// Answers which host interpreters count, which archive nodejs.org publishes for
-/// this machine, where the binaries land, and what a warm Node worker is. It
-/// installs nothing itself.
-///
-/// It implements the shared `ai.tinyhumans.runtime.Provider` interface but
-/// serves at its own object path, because two modules cannot claim one bus name
-/// and tinybus derives the path from the name.
-///
-/// Lazy, and loaded by the same call that loads the router: a language is only
-/// worth its `dlopen` when something asks for that language.
-///
-/// Released alongside the router and pinned the same way — see [`TINYRUNTIME`].
-const TINYRUNTIME_NODEJS: ModuleRecord = ModuleRecord {
- id: "tinyruntime-nodejs",
- description: "Node.js runtime provider for tinyruntime",
- bus_name: "ai.tinyhumans.runtime.nodejs.Provider",
- object_path: "/ai/tinyhumans/runtime/nodejs/Provider",
- version: "0.2.2",
- release_url: "https://github.com/tinyhumansai/tinyruntime-nodejs/releases/tag/v0.2.2",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinyruntime-nodejs-0.2.2-ubuntu-24.04-x86_64.tar.gz",
- sha256: "60bebfacfaccc5c899044fe542a07b1b2ef74ffeeca5d7f53ef0338b6dab4865",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinyruntime-nodejs-0.2.2-ubuntu-24.04-arm64.tar.gz",
- sha256: "ff9114e32db29de2a43df83e7d8b330926d5862cdb50ca20adc863d5d99becaf",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinyruntime-nodejs-0.2.2-ubuntu-22.04-x86_64.tar.gz",
- sha256: "3f25a17d41226fa8cc56cd9f5f5bd447bff4b9f55c1bd68d7bf8ebbf10575aaa",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinyruntime-nodejs-0.2.2-ubuntu-22.04-arm64.tar.gz",
- sha256: "ec271b78487caaea5c5ae1951568a838be49b5df4d362d8855cb27ba243a8c44",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinyruntime-nodejs-0.2.2-macos-26-arm64.tar.gz",
- sha256: "394d160e8de754e09121a52ae6a4b5a7b440c0035fb52cbdaa2dfe7ee523b7b0",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinyruntime-nodejs-0.2.2-macos-26-x86_64.tar.gz",
- sha256: "bbde43f8d839aacb34f735bbde2e8f56207a1a49fb5b07732a3be7b486243ce3",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinyruntime-nodejs-0.2.2-macos-15-arm64.tar.gz",
- sha256: "83ea9c8ea1b43dc4e98cb585e98d254080c2070092b3c1458f19012df5ea3cd8",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinyruntime-nodejs-0.2.2-macos-15-x86_64.tar.gz",
- sha256: "6bdb686d1e857d6c28a49ab2ab87785d8c4fecbf7ef62ad218d7b3e159e2339a",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinyruntime-nodejs-0.2.2-windows-2025-x86_64.zip",
- sha256: "36aab2547fbb7f336e15ecb66768661a4bd35f3da6179fc3efcd47bbb8d0df96",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinyruntime-nodejs-0.2.2-windows-2022-x86_64.zip",
- sha256: "0beaf8ee4765b10f1d12d0ee0c872209935fa48184424842aa6fd299a6e3f5a8",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinyruntime-nodejs-0.2.2-windows-11-arm64.zip",
- sha256: "d47571781dc17edfb0438943fbe2026417d33414904667ade0f9cb6de27e5733",
- },
- ],
- load: LoadPolicy::Lazy,
-};
-
-/// The `tinyruntime-python` module: the Python half of the router's knowledge.
-///
-/// Answers which host interpreters count, which standalone build to install, and
-/// what a warm Python worker is. It installs nothing itself.
-///
-/// Released alongside the router and pinned the same way — see [`TINYRUNTIME`].
-const TINYRUNTIME_PYTHON: ModuleRecord = ModuleRecord {
- id: "tinyruntime-python",
- description: "Python runtime provider for tinyruntime",
- bus_name: "ai.tinyhumans.runtime.python.Provider",
- object_path: "/ai/tinyhumans/runtime/python/Provider",
- version: "0.2.2",
- release_url: "https://github.com/tinyhumansai/tinyruntime-python/releases/tag/v0.2.2",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinyruntime-python-0.2.2-ubuntu-24.04-x86_64.tar.gz",
- sha256: "8d020d8af32f2735e646e164124a84027d260638a1d3cfa392e7c97de179eca6",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinyruntime-python-0.2.2-ubuntu-24.04-arm64.tar.gz",
- sha256: "49fb3458636a8247b9735d80a573538bec8c73f8323e9ad0e2eaf5715b88edf1",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinyruntime-python-0.2.2-ubuntu-22.04-x86_64.tar.gz",
- sha256: "4f7e23f6f20df2820489f3cde4445e319c5b4c5285bb37e113112f7d83d37a57",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinyruntime-python-0.2.2-ubuntu-22.04-arm64.tar.gz",
- sha256: "89ca7864016bd62d2b247fc791b800acf7bbe8903bf40a12da2396e1396a9f63",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinyruntime-python-0.2.2-macos-26-arm64.tar.gz",
- sha256: "2d091cbb29dc9d06996f290eaea8f03cf027e8fc9cff72824b9eae86d7ce5483",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinyruntime-python-0.2.2-macos-26-x86_64.tar.gz",
- sha256: "b0ec8c06202bf148463a087920387d3f243761756a570a334af16b9ba473267f",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinyruntime-python-0.2.2-macos-15-arm64.tar.gz",
- sha256: "5577ed48e84d35ec07d0de8db29c840e0addcd5e54792a02b714e883a65a7ed8",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinyruntime-python-0.2.2-macos-15-x86_64.tar.gz",
- sha256: "e08fb6a06a47fd3a1e4e9ae1b6a52f42f3b78655c5f91f4e5dbd7448d6db19a4",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinyruntime-python-0.2.2-windows-2025-x86_64.zip",
- sha256: "e22d5120ae58f9562a9861cd2c84a4d88ac692fa12d283ae047aafbe1a71adcc",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinyruntime-python-0.2.2-windows-2022-x86_64.zip",
- sha256: "41f27a63ad1e5cc2559ed2fa11d698a775dad55763c7b5e5c884a3ef14f1a811",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinyruntime-python-0.2.2-windows-11-arm64.zip",
- sha256: "0e96e8c0dbf1cfd497c8691928659c9f0bb3bf42a77eaa02bce59547f63b929e",
- },
- ],
- load: LoadPolicy::Lazy,
-};
diff --git a/crates/openhuman-core/src/modules/registry_part_02.rs b/crates/openhuman-core/src/modules/registry_part_02.rs
deleted file mode 100644
index 317aa5114f..0000000000
--- a/crates/openhuman-core/src/modules/registry_part_02.rs
+++ /dev/null
@@ -1,177 +0,0 @@
-
-/// The `tinymcp` module: the Model Context Protocol client.
-///
-/// Owns both transports (Streamable HTTP and a subprocess over stdio), the
-/// statically declared server set a host puts in its own configuration, the
-/// dynamic registry of user-installed servers with its SQLite store, the
-/// reconnect supervisor, the browser sign-in flow, and the write-audit log.
-///
-/// Lazy, because dialing an MCP server is something most sessions never do: a
-/// host with no installed servers and no configured ones would otherwise pay a
-/// download and a `dlopen` for a capability it never reaches. That differs from
-/// the module's own `lazy = false` export hint, which speaks for a host whose
-/// servers should be connected the moment it comes up — this host decides when
-/// that moment is, and does so on the first ask.
-///
-/// **What stays out of the module is host policy**, and the split is the same
-/// one the contract's own documentation draws: the prompt-injection scan over
-/// remote tool definitions, the `mcp_clients` / `mcp_setup` RPC surface, the
-/// agent-facing tools, and the proxy *scoping* decision all belong to this
-/// application's threat model, not to a protocol client. `tinymcp-bus` carries
-/// the vocabulary; this table says which bytes may speak it.
-const TINYMCP: ModuleRecord = ModuleRecord {
- id: "tinymcp",
- description: "Model Context Protocol client: transports, registry, and the write-audit log",
- bus_name: "ai.tinyhumans.tinymcp.Mcp",
- object_path: "/ai/tinyhumans/tinymcp/Mcp",
- version: "0.3.2",
- release_url: "https://github.com/tinyhumansai/tinymcp/releases/tag/v0.3.2",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinymcp-0.3.2-ubuntu-24.04-x86_64.tar.gz",
- sha256: "8bb03dcec777fbd52fedf678dafc04e44afeabc453b3459aace76e721bde7450",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinymcp-0.3.2-ubuntu-24.04-arm64.tar.gz",
- sha256: "cdb06140a3d763c6137dc8470a6896f30707909bc6ac896088391fece220e284",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinymcp-0.3.2-ubuntu-22.04-x86_64.tar.gz",
- sha256: "879de1fb22e4b0b9383638ef00d207ed580a23c6b1fbc85a96b9d405c7e4273d",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinymcp-0.3.2-ubuntu-22.04-arm64.tar.gz",
- sha256: "324a448f1fd3b564f9c3892fe48f96415cd1c3a33f2c234e3c805410136fe7e2",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinymcp-0.3.2-macos-26-arm64.tar.gz",
- sha256: "dd952d4bdf865e9a8b5b358267f7f0c0895d15e9d657c5fc82f15f48f0b281eb",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinymcp-0.3.2-macos-26-x86_64.tar.gz",
- sha256: "11d284c1f9b194c5ac3865656e19b4d4ed3ca91a70e28359f14d13ac73101b1c",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinymcp-0.3.2-macos-15-arm64.tar.gz",
- sha256: "fc86f823719d305de6abc321d88a5b455517c4a6945135af15f7fbc2a3fca403",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinymcp-0.3.2-macos-15-x86_64.tar.gz",
- sha256: "7aec3ab842a7b2c6162d98021873416705b0da5c685ae0c0d8d3792684c0a530",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinymcp-0.3.2-windows-2025-x86_64.zip",
- sha256: "d0defc7df1f4bf4084ebaa1c373316e44f51d27f0ce32b35ac26937905fddda1",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinymcp-0.3.2-windows-2022-x86_64.zip",
- sha256: "71a35710fa45dc07c4f3d24074a189e5cd2ebff678276a57c7b25d907353fe3e",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinymcp-0.3.2-windows-11-arm64.zip",
- sha256: "cd31640774b27adf0472aaf0ad43f3a3c3e9d1b716624b40816c71240abdfa9e",
- },
- ],
- load: LoadPolicy::Lazy,
-};
-
-const TINYCONNECTORS: ModuleRecord = ModuleRecord {
- id: "tinyconnectors",
- description: "OAuth connector integrations: accounts, actions, triggers, and record sync",
- bus_name: "ai.tinyhumans.connectors.Composio",
- object_path: "/ai/tinyhumans/connectors/Composio",
- version: "0.9.0",
- release_url: "https://github.com/tinyhumansai/tinyconnectors/releases/tag/v0.9.0",
- assets: &[
- PlatformAsset {
- host_key: "ubuntu-24.04-x86_64",
- archive: "tinyconnectors-0.9.0-ubuntu-24.04-x86_64.tar.gz",
- sha256: "4c9d8d6bcfa55fa5dd2a9d42c48d5be6c039357ca2b0e2519bb6018843ae2eab",
- },
- PlatformAsset {
- host_key: "ubuntu-24.04-arm64",
- archive: "tinyconnectors-0.9.0-ubuntu-24.04-arm64.tar.gz",
- sha256: "da7a3281e935f69575cb79b1a7a4cd2243a010655114a2e9b4f6d56fd2f6ca58",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-x86_64",
- archive: "tinyconnectors-0.9.0-ubuntu-22.04-x86_64.tar.gz",
- sha256: "375a03a9cad4ed0b8687d1601cefcedce8db0f183bfd66b32bf7531945d6a9bb",
- },
- PlatformAsset {
- host_key: "ubuntu-22.04-arm64",
- archive: "tinyconnectors-0.9.0-ubuntu-22.04-arm64.tar.gz",
- sha256: "43512f888b2fe302c8ddc9e36f1eaa755f35261f1270045b50ea9d58d53572b1",
- },
- PlatformAsset {
- host_key: "macos-26-arm64",
- archive: "tinyconnectors-0.9.0-macos-26-arm64.tar.gz",
- sha256: "60c9facc643bd306899e43b88b922c0ee51bb02dfe8d49aff7022f44a5f279e1",
- },
- PlatformAsset {
- host_key: "macos-26-x86_64",
- archive: "tinyconnectors-0.9.0-macos-26-x86_64.tar.gz",
- sha256: "99759d644e5cd2818146a67c976a26e0c80cf05bd0b55faa063b4cc3842c89f9",
- },
- PlatformAsset {
- host_key: "macos-15-arm64",
- archive: "tinyconnectors-0.9.0-macos-15-arm64.tar.gz",
- sha256: "0aa345d7d5fe3d0bbe095d865c22427e61d1f6f2b6413d7f47456a16a1eb056c",
- },
- PlatformAsset {
- host_key: "macos-15-x86_64",
- archive: "tinyconnectors-0.9.0-macos-15-x86_64.tar.gz",
- sha256: "ad2d6590b00225512f5bdd0d96b33bb7adacde709fe788d260837bf619bfa343",
- },
- PlatformAsset {
- host_key: "windows-2025-x86_64",
- archive: "tinyconnectors-0.9.0-windows-2025-x86_64.zip",
- sha256: "55dfc1f709b6f027688bfd043b9edfcfe000fa20aaf7d429f92cc6bc02233737",
- },
- PlatformAsset {
- host_key: "windows-2022-x86_64",
- archive: "tinyconnectors-0.9.0-windows-2022-x86_64.zip",
- sha256: "fc24cc1cf77e9e97f6f1ae21976d945cd5ee6c8e6edce656b6d676c423140ff6",
- },
- PlatformAsset {
- host_key: "windows-11-arm64",
- archive: "tinyconnectors-0.9.0-windows-11-arm64.zip",
- sha256: "f5c7cede5b8425119bee391c9470053213f23c9f7e406d2d2ddc76b70549d99e",
- },
- ],
- // Lazy: a user with no connected accounts should not pay to load it, and
- // most sessions never touch a connector. Safe even signed out — the module
- // loads without configuration and still answers the capability members.
- load: LoadPolicy::Lazy,
-};
-
-/// Every module this build can load.
-pub const ALL: &[ModuleRecord] = &[
- TINYDOCS,
- TINYWALLET,
- TINYMEMORY,
- TINYJUICE,
- TINYVOICE,
- TINYRUNTIME,
- TINYRUNTIME_NODEJS,
- TINYRUNTIME_PYTHON,
- TINYMCP,
- TINYCONNECTORS,
-];
-
-/// The record for `id`, if this build knows it.
-#[must_use]
-pub fn find(id: &str) -> Option<&'static ModuleRecord> {
- ALL.iter().find(|record| record.id == id)
-}
diff --git a/crates/openhuman-core/src/security/credentials/profiles/keychain.rs b/crates/openhuman-core/src/security/credentials/profiles/keychain.rs
new file mode 100644
index 0000000000..040318cd1b
--- /dev/null
+++ b/crates/openhuman-core/src/security/credentials/profiles/keychain.rs
@@ -0,0 +1,94 @@
+//! OS-keychain backed secret storage for individual auth profiles.
+
+use anyhow::Context;
+
+use super::{AuthProfile, AuthProfilesStore, KeychainSecrets, KEYCHAIN_AUTH_PREFIX};
+
+impl AuthProfilesStore {
+ /// Build a keychain key for an auth profile's combined secret payload.
+ pub(super) fn keychain_key_for_profile(&self, profile_id: &str) -> String {
+ format!("{KEYCHAIN_AUTH_PREFIX}{profile_id}")
+ }
+
+ /// Store auth secrets for a profile in the OS keychain.
+ ///
+ /// The secrets are serialized as a compact JSON object so a single
+ /// keychain entry holds all token fields for the profile.
+ pub(super) fn keychain_store_secrets(&self, profile: &AuthProfile) -> anyhow::Result<()> {
+ let key = self.keychain_key_for_profile(&profile.id);
+ let secrets = serde_json::json!({
+ "token": profile.token,
+ "access_token": profile.token_set.as_ref().map(|ts| &ts.access_token),
+ "refresh_token": profile.token_set.as_ref().and_then(|ts| ts.refresh_token.as_deref()),
+ "id_token": profile.token_set.as_ref().and_then(|ts| ts.id_token.as_deref()),
+ });
+ let payload = serde_json::to_string(&secrets)
+ .context("Failed to serialize auth secrets for keychain")?;
+ crate::security::keyring::set(&self.user_id, &key, &payload).map_err(|e| {
+ anyhow::anyhow!(
+ "Keychain set failed for profile {}: {e} | detail={}",
+ profile.id,
+ e.diagnostic()
+ )
+ })?;
+ log::debug!(
+ "[auth] keychain_store_secrets stored profile_id={} user_id={}",
+ profile.id,
+ self.user_id
+ );
+ Ok(())
+ }
+
+ /// Load auth secrets for a profile from the OS keychain.
+ ///
+ /// Returns `None` if no keychain entry exists for the profile.
+ pub(super) fn keychain_load_secrets(
+ &self,
+ profile_id: &str,
+ ) -> anyhow::Result<Option<KeychainSecrets>> {
+ let key = self.keychain_key_for_profile(profile_id);
+ let payload = match crate::security::keyring::get(&self.user_id, &key) {
+ Ok(Some(p)) => p,
+ Ok(None) => {
+ log::debug!(
+ "[auth] keychain_load_secrets miss profile_id={profile_id} user_id={}",
+ self.user_id
+ );
+ return Ok(None);
+ }
+ Err(e) => {
+ log::warn!(
+ "[auth] keychain_load_secrets error profile_id={profile_id} user_id={}: {e} | detail={}",
+ self.user_id,
+ e.diagnostic()
+ );
+ return Ok(None);
+ }
+ };
+ let secrets: KeychainSecrets = serde_json::from_str(&payload).map_err(|e| {
+ anyhow::anyhow!("Keychain payload for profile {profile_id} is not valid JSON: {e}")
+ })?;
+ log::debug!(
+ "[auth] keychain_load_secrets hit profile_id={profile_id} user_id={}",
+ self.user_id
+ );
+ Ok(Some(secrets))
+ }
+
+ /// Delete keychain secrets for a profile (called on profile removal).
+ pub(super) fn keychain_delete_secrets(&self, profile_id: &str) {
+ let key = self.keychain_key_for_profile(profile_id);
+ if let Err(e) = crate::security::keyring::delete(&self.user_id, &key) {
+ log::warn!(
+ "[auth] keychain_delete_secrets error profile_id={profile_id} user_id={}: {e} | detail={}",
+ self.user_id,
+ e.diagnostic()
+ );
+ } else {
+ log::debug!(
+ "[auth] keychain_delete_secrets ok profile_id={profile_id} user_id={}",
+ self.user_id
+ );
+ }
+ }
+}