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
docs: add README documentation for core modules
Steven Enamakel04408a7b82de
diff --git a/crates/openhuman-core/src/integrations/README.md b/crates/openhuman-core/src/integrations/README.mdindex 2d3e2c3515..8c645a5c1a 100644--- a/crates/openhuman-core/src/integrations/README.md+++ b/crates/openhuman-core/src/integrations/README.md@@ -1,28 +1,47 @@# integrations-Shared HTTP client and non-search integration tools for third-party providers.+Shared HTTP client, backend-proxied agent tools, and the Composio and+task-source sub-domains for third-party providers.Search provider implementations live under `crates/openhuman-core/src/search/`. This module-keeps the backend-proxied integration client and the remaining non-search tool-families.+keeps the backend-proxied integration client, the connector (Composio) and+task-source sub-domains, and the remaining non-search tool families.## Responsibilities- Provide `IntegrationClient`, a shared `reqwest` HTTP client for backend-proxied integrations: backend URL sanitization, bearer auth, `{success,data,error}` envelope parsing, bounded error-detail extraction, and pricing cache.- Build the client from root config (`build_client`), resolving backend URL and app-session JWT; return `None` when the user is not signed in.- Fetch per-integration pricing from `/agent-integrations/pricing`, with a Composio direct-mode short-circuit (`pricing_for_config`).-- Implement and export non-search tools: Apify, Google Places, stock/market data, and Twilio.+- Implement and export non-search, non-connector tools: Google Places, stock/market data, and Twilio.+- Own the [`composio`](composio/README.md) connector sub-domain and the [`task_sources`](task_sources/README.md) sub-domain as child modules.+- Own the [`file_storage`](file_storage/README.md) managed cloud file-storage tool family as a child module.- Classify transport and user-state failures through `core::observability::report_error_or_expected`.+Every request `IntegrationClient` sends to the TinyHumans backend carries a+sanitized `x-sdk-name` (see `ProductIdentity` handling in `client_part_01.rs`+and `client_tests.rs::product_identity_seen_by_backend`), per AGENTS.md+"Backend API".++## Members++| Path | Role |+| --- | --- |+| `client.rs` + `client_part_01.rs` / `client_part_02.rs` | `IntegrationClient`: `post`/`get`/`get_bytes`/`patch`/`delete`/`upload_multipart`/`pricing`, backend URL sanitization, and client construction. |+| `types.rs` | Shared serde types for backend envelopes and pricing. |+| `tools.rs` | Non-search, non-connector agent tools: Google Places, stock/market data, Twilio. |+| [`file_storage/`](file_storage/README.md) | Managed cloud file-storage agent tools (`Storage*Tool`), backed by the backend's S3-based `file_storage` provider. |+| [`composio/`](composio/README.md) | Composio connector integration: catalogs, connections, triggers, direct-auth fallback, and the `tinyconnectors` module bridge. |+| [`task_sources/`](task_sources/README.md) | Normalizes external task feeds (via the Composio providers) into agent-facing list/fetch/filter tools. |+| `test_support.rs` + `test_support_backend.rs` | In-process fake integration backend (`spawn_fake_integration_backend`) used by `tools/ops_tests_part_02_tests.rs` / `ops_tests_part_03_tests.rs` to exercise integration tools without a real backend. |+## Key Files| File | Role || --- | --- |-| `crates/openhuman-core/src/integrations/mod.rs` | Export-only module root. Re-exports `build_client`, `pricing_for_config`, `IntegrationClient`, pricing/envelope types, and `ToolScope`. |-| `crates/openhuman-core/src/integrations/client.rs` | `IntegrationClient` + `post`/`get`/`pricing`, backend URL sanitization, and client construction. |+| `crates/openhuman-core/src/integrations/mod.rs` | Export-only module root. Declares the `client`, `composio`, `file_storage`, `task_sources`, `tools`, `types` submodules; re-exports `build_client`, `pricing_for_config`, `IntegrationClient`, pricing/envelope types. |+| `crates/openhuman-core/src/integrations/client.rs` | `IntegrationClient` construction and top-level methods; split across `client_part_01.rs` / `client_part_02.rs`. || `crates/openhuman-core/src/integrations/types.rs` | Shared serde types for backend envelopes and pricing. |-| `crates/openhuman-core/src/integrations/tools.rs` | Aggregates and re-exports non-search integration tool modules. |-| `crates/openhuman-core/src/integrations/tools/apify.rs` | Apify actor run + status + dataset results. |+| `crates/openhuman-core/src/integrations/tools.rs` | Aggregates and re-exports the non-search, non-connector tool modules. || `crates/openhuman-core/src/integrations/tools/google_places.rs` | Google Places search + details. || `crates/openhuman-core/src/integrations/tools/stock_prices.rs` | Market data via backend financial APIs. || `crates/openhuman-core/src/integrations/tools/twilio.rs` | Outbound phone calls via backend Twilio. |@@ -42,14 +61,32 @@ From `crates/openhuman-core/src/integrations/mod.rs`:- `build_client(&Config) -> Option<Arc<IntegrationClient>>`- `pricing_for_config(&IntegrationClient, &Config) -> IntegrationPricing`- Types: `BackendResponse<T>`, `IntegrationPricing`, `IntegrationPricingEntry`, `PricingIntegrations`, `ToolScope`-- Non-search tool structs via `tools.rs`+- Non-search, non-connector tool structs via `tools.rs`## Agent Tools-Tools are constructed and registered by `crates/openhuman-core/src/tools/ops.rs`, gated by-`config.integrations.<provider>.is_active()` for Apify, Google Places,-stock/market data, and Twilio. Search tools, including TinyFish, are governed-by `crates/openhuman-core/src/search/`.+From `tools.rs`: `GooglePlacesDetailsTool`, `GooglePlacesSearchTool`,+`StockCommodityTool`, `StockCryptoSeriesTool`, `StockExchangeRateTool`,+`StockOptionsTool`, `StockQuoteTool`, `TwilioCallTool`. These are constructed+and registered by `crates/openhuman-core/src/tools/ops.rs`, gated by+`config.integrations.<provider>.is_active()`.++The `file_storage/` tools (see [its README](file_storage/README.md)) are+built separately via `build_file_storage_tools` (also called from+`tools/ops.rs`, around line 905) because they need `action_dir` and a+`SecurityPolicy` rather than a provider config flag.++Composio connector tools and task-source tools live in and are documented by+their own sub-domains; all three tool families are re-exported into the+global agent tool registry through `tools/mod.rs`:++```rust+pub use crate::integrations::composio::tools::*;+pub use crate::integrations::task_sources::tools::*;+pub use crate::integrations::tools::*;+```++Search tools, including TinyFish, are governed by `crates/openhuman-core/src/search/`.## Notes@@ -59,3 +96,4 @@ by `crates/openhuman-core/src/search/`.- `IntegrationClient::new` re-runs backend URL sanitization as defense in depth.- `IntegrationClient::pricing()` returns empty pricing on network error so toolregistration does not fail.+</content>diff --git a/crates/openhuman-core/src/mcp/README.md b/crates/openhuman-core/src/mcp/README.mdindex 87bfa0354a..1d62dee2b8 100644--- a/crates/openhuman-core/src/mcp/README.md+++ b/crates/openhuman-core/src/mcp/README.md@@ -1,110 +1,111 @@-# mcp — MCP client/server family+# mcp — MCP host-One directory, one gate. Members: `server/` (the `openhuman mcp` stdio/HTTP-server), `registry/` (dynamic, SQLite-backed Smithery installs), `audit/` (the-write-audit log), `config_servers/` (the static, TOML-declared server set +-stdio transport), and `http_client/` (the HTTP transport primitive). Each of-`server`/`registry`/`audit` has its own README.--The family root `mcp/mod.rs` is **ungated**: `http_client` is always compiled-(always-compiled consumers outside the MCP subsystem reach it), and the three-facades each ship a `stub.rs` that must resolve in an `mcp`-less build. The-gate is pushed onto each member — `config_servers` is leaf-gated, `http_client`-is not gated at all.--`sanitize` is **not** in this family: it moved to `util/sanitize.rs`, because-the orchestrator prompt runs *skill* descriptions through it.--The rest of this page documents `config_servers/` + `http_client/` — the halves-that were the old `mcp_client` directory.-------Reusable **MCP client transport library** plus a **read-only static server set** declared in the user's TOML config. This module knows how to *talk to* a remote MCP server over two transports — Streamable HTTP (with OAuth discovery + SSE per the MCP spec) and subprocess JSON-RPC over stdin/stdout — and exposes the servers the user pinned under `[[mcp_client.servers]]` as a queryable registry. It owns no RPC surface, no persistence, and no event-bus subscribers; it is a building block consumed by other domains. Its sibling `mcp::registry` reuses `config_servers`' `McpStdioClient` for all stdio transport of dynamically-installed Smithery servers.+Host-side half of Model Context Protocol support. Both transports, the+static config-declared server set, the dynamic (Smithery/official-catalog)+registry with its store, its reconnect supervisor and browser sign-in, and+the write-audit log moved out to [`tinymcp`](https://github.com/tinyhumansai/tinymcp).+What is here is what belongs to this application: the one holder of that+library's services, the RPC surface over it, the agent-facing tools, and the+`openhuman mcp` server that exposes this application's own tools to external+MCP hosts.## Responsibilities-- Implement the MCP **Streamable HTTP** client (`McpHttpClient`): `initialize` handshake + protocol-version negotiation, `tools/list`, `tools/call`, SSE event draining, session lifecycle (`Mcp-Session-Id`), `notifications/initialized`, and graceful `close_session` via HTTP DELETE.-- Implement the MCP **stdio** client (`McpStdioClient`): spawn a subprocess, speak newline-delimited JSON-RPC over stdin/stdout, and cache a single long-lived session.-- Handle **OAuth / authorization discovery** on HTTP transport: parse `WWW-Authenticate` challenges on 401, fetch protected-resource metadata and authorization-server metadata (OIDC `.well-known` + OAuth `.well-known`).-- Apply per-server **auth** (bearer / basic / custom header / query param) to outbound requests.-- **Reinitialize-and-retry once** on a 404 indicating an expired HTTP session.-- Mirror tool-schema parameters tagged `x-mcp-header` into `Mcp-Param-*` request headers.-- Render raw MCP `tools/call` results into the skills `ToolResult` shape.-- Build a static `McpServerRegistry` from `Config` (`[[mcp_client.servers]]` + a legacy `gitbooks` server), enforce per-server allow/deny tool lists, and pick HTTP vs stdio transport per entry.-- **Redact** endpoints in logs/errors (scheme + authority only; credentials → `<redacted>`).+- Hold the `tinymcp` service — one per workspace — and open it at boot+ ([`host`]).+- Expose the `mcp_clients` and `mcp_setup` RPC namespaces, the agent-facing+ `mcp_registry_*` tools, and the prompt-injection scan over remote tool+ definitions ([`registry`]).+- Expose the RPC surface over the write-audit log ([`audit`]).+- Run the `openhuman mcp` stdio/HTTP server that serves this application's+ own tools to external MCP clients ([`server`]) — the *server* side, which+ did not move because it is bound to the tool registry, the permission+ model and the agent turn machinery.++## Where the boundary fell++Three things stayed here on purpose, each because it is host policy rather+than protocol:++- **Prompt-injection detection** over remote tool definitions+ (`registry::tools_safe_for_agent`). The detector, its rules, and what a hit+ means belong to this application's threat model. The *lexical* half —+ control characters, prompt-template fences, length caps — lives in the+ contract instead, applied by the display accessors on every remote+ description.+- **Events.** `tinymcp` reports what happened in its return values;+ translating that into a `DomainEvent` happens here, where the vocabulary is+ known (`registry::bus`, `registry::supervisor_events`, `audit`'s schema+ layer).+- **The proxy decision.** Whether a proxy applies to MCP traffic is decided+ by this application's proxy scope setting, per-service list and no-proxy+ list — `host::proxy_for_mcp` consults them and hands `tinymcp` the answer.## Key files-| File | Role |+| Path | Purpose || --- | --- |-| `crates/openhuman-core/src/mcp/mod.rs` | Family root (ungated). Declares the five members and documents where the gate sits. |-| `crates/openhuman-core/src/mcp/http_client/mod.rs` | Ungated carve-out. Re-exports the HTTP transport + protocol types. |-| `crates/openhuman-core/src/mcp/config_servers/mod.rs` | Leaf-gated on `mcp`. Re-exports the static registry + stdio transport. |-| `crates/openhuman-core/src/mcp/http_client/client.rs` | `McpHttpClient` (Streamable HTTP transport), shared MCP protocol types, SSE/`WWW-Authenticate` parsing, `render_tool_result`, `redact_endpoint`, `x-mcp-header` mirroring. Largest file; carries the inline test suite. |-| `crates/openhuman-core/src/mcp/config_servers/stdio.rs` | `McpStdioClient` — subprocess spawn + newline-delimited JSON-RPC over stdin/stdout, single cached `StdioSession`. |-| `crates/openhuman-core/src/mcp/config_servers/spawn_env.rs` | PATH reconstruction for stdio children: probes the user's login shell (`$SHELL -ilc`) + well-known version-manager dirs (nvm/volta/bun/Homebrew), caches the result, and resolves the command up front so missing `npx`/`uvx` fails with actionable guidance. |-| `crates/openhuman-core/src/mcp/config_servers/registry.rs` | `McpServerRegistry`, `McpServerDefinition`, `McpTransportClient` (Http/Stdio dispatch enum), `McpRegistrySource`; builds the static set from `Config`, applies allow/deny tool filtering. |--## Public surface--Re-exported from the two member `mod.rs` files:--- **HTTP transport / protocol types** (`http_client/client.rs`, ungated): `McpHttpClient`, `McpInitializeResult`, `McpRemoteTool`, `McpServerToolResult`, `McpSseEvent`, `McpAuthChallenge`, `McpAuthorizationContext`, `ProtectedResourceMetadata`, `AuthorizationServerMetadata`, and the helper `redact_endpoint`.-- **Stdio transport** (`config_servers/stdio.rs`, gated): `McpStdioClient`.-- **Registry** (`config_servers/registry.rs`, gated): `McpServerRegistry`, `McpServerDefinition`, `McpTransportClient`, `McpRegistrySource`.--Key entry points:--- `McpHttpClient::new(endpoint, timeout_secs)` / `with_options(endpoint, timeout_secs, auth, identity)` → `initialize`, `list_tools`, `call_tool`, `discover_authorization`, `drain_events`, `close_session`, `initialize_snapshot`.-- `McpStdioClient::new(command, args, env, cwd, identity)` → `initialize`, `list_tools`, `call_tool`, `close_session`.-- `McpServerRegistry::from_config(&Config)` → `list`, `get`, `list_tools`, `call_tool`, `initialize`, `discover_authorization`, `is_empty`.-- `McpTransportClient` — enum unifying `Http`/`Stdio`, forwarding `initialize`/`list_tools`/`call_tool`/`discover_authorization` (stdio always returns `None` for authorization discovery).--## Configuration--Reads `config.mcp_client` (`McpClientConfig`): `enabled`, `servers` (`Vec<McpServerConfig>`), and `client_identity` (`McpClientIdentityConfig` → client name/title/version sent in the `initialize` handshake). Each `McpServerConfig` supplies `name`, `endpoint`, `command`/`args`/`env`/`cwd` (stdio), `description`, `enabled`, `allowed_tools`, `disallowed_tools`, `timeout_secs`, and `auth` (`McpAuthConfig`). Also reads `config.gitbooks` (`enabled`, `endpoint`, `timeout_secs`) to seed a legacy `gitbooks` HTTP server when no explicit server of that name exists. HTTP clients apply the runtime proxy via `config::apply_runtime_proxy_to_builder(builder, "tool.mcp_client")`.--Transport selection in `build_transport_client`: a non-empty `command` ⇒ stdio; otherwise HTTP against `endpoint`.--## RPC / controllers--None. This module exposes no JSON-RPC controllers or schemas of its own. RPC-facing MCP work lives in the sibling `mcp::registry` and in the generic bridge tools.--## Agent tools--None owned here. The generic bridge tools that drive this registry (`mcp_list_servers`, `mcp_list_tools`, `mcp_call_tool`) live in `crates/openhuman-core/src/tools/impl/network/mcp.rs`; the bespoke `gitbooks` tool (`tools/impl/network/gitbooks.rs`) consumes `McpHttpClient` directly.--## Events--None. No `bus.rs`; publishes/subscribes to no `DomainEvent`s.--## Persistence--None. No `store.rs`. The static registry is rebuilt from `Config` in memory; HTTP/stdio session state (session id, negotiated protocol version, cached tool list, child process) lives only in the in-memory client instances.+| `mod.rs` | Family root, entry points, and the two re-export facades below. |+| `host.rs` / `host_tests.rs` | The per-workspace `tinymcp` service holder — see [its own doc comment](host.rs) for the shape (`HOSTS` map, `McpHost`, `for_config`/`try_service`/`init`, `client_config`, `proxy_for_mcp`). |+| [`registry/README.md`](registry/README.md) | `mcp_clients`/`mcp_setup` RPC, agent tools, reconnect-supervisor events. |+| [`audit/README.md`](audit/README.md) | `mcp_audit` RPC over the write-audit log. |+| [`server/README.md`](server/README.md) | The `openhuman mcp` server (this application as an MCP host's target). |++## The two re-export modules++`mcp::http_client` and `mcp::config_servers` are not directories — they no+longer hold transport source, only `pub use` re-exports of `tinymcp`:++- `http_client` (ungated) — the Streamable HTTP transport:+ `tinymcp::transport::http::{McpHttpClient, McpHttpClientBuilder}`,+ `tinymcp::Error` as `McpError`, `redact_endpoint`, `render_tool_result`, and+ the `tinymcp_bus` wire types (`McpRemoteTool`, `McpServerToolResult`,+ `McpSseEvent`, the OAuth challenge/metadata types). Always compiled because+ always-on consumers outside the MCP subsystem name it — including+ `mcp::server`'s test-only HTTP round-trip.+- `config_servers` (`mcp` feature) — the statically declared, TOML-configured+ server set: `tinymcp::transport::stdio::McpStdioClient`,+ `McpRegistrySource`, `McpServerDefinition`, `McpServerRegistry`,+ `McpTransportClient`, and `tinymcp_bus::McpAuthConfig` re-exported as+ `McpDefinitionAuth` (distinct from this application's own+ `config::McpAuthConfig`, which the TOML file declares).++Neither module implements a transport, a handshake, or OAuth discovery any+more — that all lives in `tinymcp` now. Read+[the tinymcp repo](https://github.com/tinyhumansai/tinymcp) for that half.++## Startup wiring++`mcp::start(config)` initializes the registry's bus subscriber and opens the+host service; it never fails (MCP being unavailable must not stop the core+coming up). `mcp::start_boot_jobs(config)` additionally spawns the+installed-server boot pass and the reconnect supervisor. Both are called from+`core/jsonrpc.rs` (`start` on the RPC-enable path) and+`core/runtime/services.rs` (`start_boot_jobs` on the boot path); each is+idempotent so the two callers can't double-register or double-spawn.++## Compile-time gate (`mcp` feature)++`pub mod mcp;` is always compiled — the family root is a facade. `host` and+`http_client` are ungated because the startup path and always-on consumers+reach them unconditionally. `registry`, `audit`, `server`, and+`config_servers` keep their own gate and their own `stub.rs`, so a build+without the feature still serves `/rpc` without those namespaces.## Dependencies-- `crate::config` — `Config`, `McpClientConfig`, `McpServerConfig`, `McpAuthConfig`, `McpClientIdentityConfig`, and `apply_runtime_proxy_to_builder` (proxy-aware reqwest builder). Source of the static server set and per-server auth/identity.-- `crate::skills::types::ToolResult` — the rendered result shape returned from `tools/call` (via `render_tool_result`).--External crates: `reqwest` (HTTP), `tokio` (process + async IO + `sync::Mutex`), `parking_lot::Mutex` (HTTP session state), `serde`/`serde_json`, `base64`, `anyhow`, `tracing`.--## Used by--- `crates/openhuman-core/src/mcp/registry/` (`mod.rs`, `connections.rs`, `setup_ops.rs`) — reuses `McpStdioClient` (and HTTP client) for all transport of dynamically-installed servers; carries no transport code of its own.-- `crates/openhuman-core/src/tools/impl/network/mcp.rs` and `tools/ops.rs` — generic `mcp_*` bridge tools driving the static registry.-- `crates/openhuman-core/src/tools/impl/network/gitbooks.rs` — uses `McpHttpClient` directly for the GitBook docs server.-- `crates/openhuman-core/src/mcp/server/http.rs` — references this module.--## Notes / gotchas--- **Latest protocol version is `2025-11-25`**, sent on every `initialize`; the server's negotiated version must be one of the four `SUPPORTED_PROTOCOL_VERSIONS` or `initialize` fails. The constant is duplicated in both `http_client/client.rs` and `config_servers/stdio.rs`.-- HTTP transport uses `redirect::Policy::none()` and a 10s connect timeout; the per-request timeout comes from the server's `timeout_secs`.-- A 404 on a request while a session id is held triggers exactly one reinitialize + retry (`allow_reinitialize` guards against loops); after that the error propagates.-- `Accept` is always `application/json, text/event-stream`; the client transparently parses an SSE-framed single response (`parse_sse_message`) or a plain JSON body based on `Content-Type`.-- Tool allow/deny enforcement is **fail-closed and pre-transport**: `is_tool_allowed` rejects empty names, anything in `disallowed_tools`, and (when `allowed_tools` is non-empty) anything not allow-listed; `registry.call_tool` blocks before any network/subprocess I/O.-- The legacy `gitbooks` server is only auto-seeded when `config.gitbooks.enabled` and no explicit server named `gitbooks` exists (explicit config wins, flipping `source` from `LegacyGitbooks` to `Config`).-- `redact_endpoint` returns `<redacted>` for any URL containing userinfo (`@`) or a non-`http(s)` scheme — used in all log/error output so endpoints never leak credentials.-- `McpStdioClient` discards child stderr (`Stdio::null()`) and skips non-JSON stdout lines (logged at debug); the session is a single cached `StdioSession` guarded by a tokio `Mutex`.-- Stdio children inherit a **reconstructed PATH** (`spawn_env::spawn_path`), not the GUI-stripped process PATH, so `npx`/`uvx` servers spawn the same way a terminal would. A config-provided `PATH` env still overrides it. The command is resolved before spawn; a missing Node/uv runtime surfaces actionable install guidance instead of a raw `ENOENT` (#4279).+- `tinymcp` (path dependency on `vendor/tinymcp`, `default-features = false`)+ — the extracted client library.+- `tinymcp-bus` — the wire contract: payload types and member names, with no+ transport and no runtime, also used to generate the desktop settings+ schema.+- `crate::config` — `McpClientConfig`/`McpServerConfig`/`McpAuthConfig` and+ the runtime proxy config `host::client_config`/`proxy_for_mcp` convert+ from.+- `crate::core::bus` / `crate::core::events` — `DomainEvent` publishing for+ everything that stayed host-side.++See `Cargo.toml` (`crates/openhuman-core/Cargo.toml`, the `tinymcp` block)+for why this stays a path dependency rather than the pinned release, and+`crates/openhuman-core/src/modules/registry.rs` for the release version this+application does pin for the loadable-module path.diff --git a/crates/openhuman-core/src/media/image/README.md b/crates/openhuman-core/src/media/image/README.mdindex 7ce5c9b2b3..42b0442ed5 100644--- a/crates/openhuman-core/src/media/image/README.md+++ b/crates/openhuman-core/src/media/image/README.md@@ -6,6 +6,14 @@ This module does not execute image generation or pixel inspection directly. Itdefines the stable model-facing contracts that provider/runtime adapters canexpose when image capabilities are available.+Currently unwired (#2997) — no tool registers these contracts yet ("image tool+contracts scaffold (currently unwired, #2997)", per `media/mod.rs`).++## Gate++Gated transitively by the `media` feature at+`crates/openhuman-core/src/lib.rs` (`#[cfg(feature = "media")] pub mod media;`).+## Responsibilities- Define the `image_generation` contract for hosted raster image creation anddiff --git a/crates/openhuman-core/src/media/mod.rs b/crates/openhuman-core/src/media/mod.rsindex c1f4a12970..d8f8d8244d 100644--- a/crates/openhuman-core/src/media/mod.rs+++ b/crates/openhuman-core/src/media/mod.rs@@ -5,7 +5,7 @@//! - [`image`] — image tool contracts scaffold (currently unwired, #2997)//!//! Gated by the `media` feature at the family root (`pub mod media;` in-//! `crates/openhuman-core/src/mod.rs`), because both children are wholly gated. It is a+//! `crates/openhuman-core/src/lib.rs`), because both children are wholly gated. It is a//! **surface-only** gate: media generation is backend-proxied over the shared//! `reqwest`, and the `image` crate is shared with channel upload, so no//! exclusive dependency is shed. No controller/store/subscriber is taggeddiff --git a/crates/openhuman-core/src/search/README.md b/crates/openhuman-core/src/search/README.mdindex 00f80d3cd1..cb5704ca9a 100644--- a/crates/openhuman-core/src/search/README.md+++ b/crates/openhuman-core/src/search/README.md@@ -24,3 +24,33 @@ Top-level home for web search selection and agent-facing search tool registratioA BYO engine with no key configured falls back to the managed surface, so `managed` stays the effective default until a key is saved.When search is disabled, search tools are absent from the agent runtime tool list, so they do not render in agent context.++## Wiring++- `search::build_search_tools` (`registry.rs`) is called once from+ `tools/ops.rs:891` to assemble the search slice of the agent tool list.+- `tools/mod.rs:47` re-exports `crate::search::tools::*`, so callers reach+ search tools through `crate::tools` rather than importing `crate::search`+ directly.+- TinyFish tools are not tied to `search.engine`: `registry.rs` pushes them+ whenever `config.integrations.tinyfish.is_active()`, on top of whichever+ engine is active.+- `SearxngSearchTool` and `SeltzSearchTool` bypass the engine registry+ entirely. They are constructed per-request by the `tools_searxng_search`+ (`tools/schemas_part_02.rs:41`) and `tools_seltz_search`+ (`tools/schemas_part_01.rs:555`) RPC handlers, using arguments from the RPC+ call rather than saved `Config.search` state.++## `engines/`++`engines` is `pub(crate)`. Each file (`managed`, `parallel`, `brave`,+`querit`, `exa`, `tavily`, `disabled`) exports a single+`pub(crate) fn build(root_config: &Config, params: SearchToolParams) -> Vec<Box<dyn Tool>>`+that constructs that engine's tool set — e.g. `managed::build` wraps a single+`WebSearchTool` pointed at the backend-proxied `web_search` endpoint.+`registry.rs` matches `search.effective_engine()` to pick exactly one.++See [`tools/README.md`](tools/README.md) for the provider -> tool -> transport+table, and+[`gitbooks/features/native-tools/web-search.md`](../../../../../gitbooks/features/native-tools/web-search.md)+for the user-facing description of engine selection.diff --git a/crates/openhuman-core/src/web3/wallet/README.md b/crates/openhuman-core/src/web3/wallet/README.mdindex a685368c59..6c05a43c61 100644--- a/crates/openhuman-core/src/web3/wallet/README.md+++ b/crates/openhuman-core/src/web3/wallet/README.md@@ -4,6 +4,22 @@ Core-owned local multi-chain crypto wallet, deliberately **basic**: key/accountHigher-level DeFi affordances (swaps, bridges, generic dapp/contract calls) live in the separate [`web3`](../README.md) module, which builds on the wallet's **crate-internal** `sign_and_broadcast_evm` / `sign_and_broadcast_solana` primitives. They are not part of the wallet's agent / RPC surface.+## Compile-time gate (`web3` feature)++`pub mod wallet;` in `web3/mod.rs` is ALWAYS compiled — it is a facade. The real+implementation (`ops`, `execution`, `defaults`, `abi`, `chains`, `schemas`,+`tools`, `transport`) is gated behind the default-ON `web3` Cargo feature+(shared with `web3` and `web3::x402`). When the feature is off, `stub` takes+its place and mirrors the subset of the public surface that always-on / other-+gated callers depend on — `WALLET_NOT_CONFIGURED_MESSAGE`, `status`,+`secret_material`, `WalletChain`, `prepare_transfer`, `execute_prepared`, the+prepare/execute param + result types, `solana_cluster` / `SolanaCluster`,+`prepared_quotes_for_test`, and the controller-registration entry points+(`all_wallet_registered_controllers`, `all_wallet_controller_schemas`) —+with no-op / disabled-error bodies. Signatures must match the real ones+exactly; `cargo check --no-default-features` is the only thing that catches+drift.+## Responsibilities- Persist wallet onboarding state (consent flag, mnemonic word count, setup source, exactly one derived account per supported chain) and the encrypted recovery phrase.