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 and architecture
Steven Enamakel973b20fb390d
diff --git a/crates/openhuman-core/src/integrations/file_storage/README.md b/crates/openhuman-core/src/integrations/file_storage/README.mdnew file mode 100644index 0000000000..a64b7eae82--- /dev/null+++ b/crates/openhuman-core/src/integrations/file_storage/README.md@@ -0,0 +1,104 @@+# file_storage++Agent tools for managed cloud file storage, backed by the OpenHuman backend's+`file_storage` provider (S3 under the hood). Files upload from and download+into the agent's `action_dir`; the backend owns the bucket, billing, quota,+and TTL enforcement.++## Responsibilities++- Upload a file from the workspace, list stored files, generate presigned+ download links, change visibility, and delete files — all proxied through+ `/agent-integrations/file-storage/*`.+- Enforce that uploads read from, and downloads write into, the agent's+ `action_dir` (the agent's canonical read/write root); reject paths that+ escape it, including via symlinks.+- Track backend-owned limits: 1 GiB quota per user, TTL 7 days on the free+ plan / up to 1 year on paid plans. Billing goes through the standard+ integration billing flow (S3 rates plus margin), charged upfront for the+ whole TTL on upload and as egress on download/link generation.+- Block all six tools when autonomy is read-only (`SecurityPolicy::can_act`).++## Key Files++| File | Role |+| --- | --- |+| `mod.rs` | Export-only module root; re-exports `build_file_storage_tools` and the six `Storage*Tool` structs. |+| `types.rs` | Serde types for backend responses (`UploadResponse`, `ListFilesResponse`, `FileMeta`, `LinkResponse`, `DeleteResponse`). |+| `tools.rs` | Module doc listing the backend endpoints and billing model; wires in `tools_part_01.rs` / `tools_part_02.rs` via `include!`. |+| `tools_part_01.rs` | Shared helpers (path resolution/validation, filename/mime handling) plus `StorageUploadFileTool`, `StorageDownloadFileTool`, `StorageListFilesTool`. |+| `tools_part_02.rs` | `StorageGetLinkTool`, `StorageSetVisibilityTool`, `StorageDeleteFileTool`, and the `build_file_storage_tools` builder. |+| `tools_tests.rs` | Tool metadata/schema tests and path-resolution/sanitization unit tests. |++## Agent Tools++| Tool name | Struct | Backend route |+| --- | --- | --- |+| `storage_upload_file` | `StorageUploadFileTool` | `POST /agent-integrations/file-storage/files` (multipart) |+| `storage_download_file` | `StorageDownloadFileTool` | `GET /agent-integrations/file-storage/files/{id}/download` |+| `storage_list_files` | `StorageListFilesTool` | `GET /agent-integrations/file-storage/files` |+| `storage_get_link` | `StorageGetLinkTool` | `POST /agent-integrations/file-storage/files/{id}/link` |+| `storage_set_visibility` | `StorageSetVisibilityTool` | `PATCH /agent-integrations/file-storage/files/{id}` |+| `storage_delete_file` | `StorageDeleteFileTool` | `DELETE /agent-integrations/file-storage/files/{id}` |++`storage_list_files`, `storage_get_link`, `storage_set_visibility`, and+`storage_delete_file` take a `file_id`, validated against an+alphanumeric/`-`/`_` charset before it is interpolated into the URL path+(`validate_file_id`).++## Security Notes++- `resolve_upload_path` (`tools_part_01.rs`) resolves the `path` argument+ relative to `action_dir` if not absolute, canonicalizes both the workspace+ root and the candidate, and rejects the upload unless the canonicalized+ path starts with the canonicalized `action_dir` — this also rejects a+ symlink that resolves outside the workspace, and rejects non-regular files.+- Downloads always land under `<action_dir>/storage-downloads/`; the target+ filename is sanitized (`sanitize_filename`) to strip path separators and+ traversal before it is joined onto that fixed directory, so a malicious+ `filename` argument or server-supplied name cannot escape it.+- `execute_with_context` prefers the TinyAgents workspace root from+ `ToolRunContext` over the tool's default `action_dir`+ (`action_dir_for_context`), mirroring the pattern used by media generation+ tools.+- `StorageUploadFileTool`, `StorageDownloadFileTool`, `StorageGetLinkTool`,+ `StorageSetVisibilityTool`, and `StorageDeleteFileTool` all check+ `SecurityPolicy::can_act()` up front and return a+ `[policy-blocked]` `ToolResult::error` under read-only autonomy;+ `StorageListFilesTool` is read-only and unguarded.++## Wiring++`build_file_storage_tools(root_config, action_dir)` (`tools_part_02.rs`) is+the sole construction entry point. It returns an empty tool list when+`crate::integrations::build_client` yields no client (no backend URL+configured, or the user is not signed in), otherwise builds a+`SecurityPolicy` from `root_config.autonomy` and returns all six tools.++Called from `crates/openhuman-core/src/tools/ops.rs` (around line 905):++```rust+tools.extend(crate::integrations::file_storage::build_file_storage_tools(...));+```++The tool structs themselves are re-exported through+`crates/openhuman-core/src/integrations/mod.rs` and+`crates/openhuman-core/src/tools/mod.rs` (`pub use crate::integrations::tools::*;`).++## Dependencies++- `crate::integrations::IntegrationClient` (and `build_client`) — the shared+ backend-proxied HTTP client; see the [parent README](../README.md).+- `crate::security::SecurityPolicy` — gates the mutating tools under+ read-only autonomy.+- `crate::tools::traits` — `Tool`, `ToolResult`, `PermissionLevel`,+ `ToolCategory`.+- `tinytools::ToolRunContext` — supplies the TinyAgents workspace root when+ running inside an agent turn.++## Tests++`tools_tests.rs` covers tool name/permission/category/schema metadata for all+six tools plus unit tests for `resolve_upload_path` and `sanitize_filename`+(traversal and symlink-escape rejection, filename sanitization).+</content>diff --git a/crates/openhuman-core/src/media/image/README.md b/crates/openhuman-core/src/media/image/README.mdindex 6ec6bae503..80305d2fbc 100644--- a/crates/openhuman-core/src/media/image/README.md+++ b/crates/openhuman-core/src/media/image/README.md@@ -6,8 +6,9 @@ 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`).+Currently unwired (#2997) — no tool registers these contracts yet. See the+family root: `media/mod.rs` describes this crate as an "image tool contracts+scaffold (currently unwired, #2997)".## Gatediff --git a/crates/openhuman-core/src/memory/README.md b/crates/openhuman-core/src/memory/README.mdindex 8074e06331..9239b87212 100644--- a/crates/openhuman-core/src/memory/README.md+++ b/crates/openhuman-core/src/memory/README.md@@ -71,6 +71,24 @@ link. `memory::api` is the re-export of the contract, and its own module docsexplain which parts of `tinymemory-api` are the *bus* surface and which are thehost's own use of the crate — they are not the same set.+## Wiring++`core/all.rs` registers the nine schema families behind the `all_memory_*_registered_controllers`+aliases re-exported from [`mod.rs`](mod.rs) — `core_recall`, `documents`,+`ingest`, `files`, `kv_graph`, `sync`, `learn`, `provider`, `tool_memory` —+plus [`goals`](goals/)'s, [`people`](people/)'s, and+[`tree`](tree/)'s own `all_memory_tree_*`, `all_retrieval_*`, and+`all_tree_summarizer_*` registered-controller functions,+[`sync/sync_status`](sync/sync_status.rs)'s `all_memory_sync_status_registered_controllers`,+and [`sources`](sources/)'s `all_memory_sources_registered_controllers`.++Agent tools reach the same registry through+[`tools/mod.rs`](../tools/mod.rs): `pub use crate::memory::tools::*`,+`crate::memory::tools::goals::*`, and `crate::memory::agent::tools::*`.++`memory::rpc` is an alias of [`ops`](ops/) (`pub use ops as rpc;` in+[`mod.rs`](mod.rs)) kept for callers that predate the extraction.+## Domains that kept their RPC surface hereEach is the RPC surface for a family the *driver* serves: the handler and@@ -84,7 +102,7 @@ each was a thin wrapper over `pub use tinymemory_core::<domain>::*;` as well.| [`goals/`](goals/) | Goal tracking RPC. || [`people/`](people/) | People/contacts RPC. || [`sources/`](sources/) | Source-registration RPC. |-| [`sync/`](sync/) | Composio + workspace + MCP sync pipeline RPC. |+| [`sync/`](sync/) | `composio/` bus subscribers + providers (incl. Slack), and `sync_status/` — per-connection sync status/progress RPC. || [`tool_memory/`](tool_memory/) | Tool-scoped rules + agent read/write tools. || [`tree/`](tree/) | Tree walk/retrieval RPC. |diff --git a/crates/openhuman-core/src/memory/tree/README.md b/crates/openhuman-core/src/memory/tree/README.mdnew file mode 100644index 0000000000..ce46d1fec3--- /dev/null+++ b/crates/openhuman-core/src/memory/tree/README.md@@ -0,0 +1,51 @@+# tree++Host layer over the memory tree engine, which now lives in the TinyMemory+module (see [`memory/README.md`](../README.md) for the extraction). Every+handler and schema here names OpenHuman's `RpcOutcome` and `ControllerSchema`,+which the engine crate cannot see, so this directory is what stayed behind:+RPC surface, not tree mechanics.++`mod.rs` carries the module's own #5560 accounting for why the old `pub use+tinymemory_core::tree::*` glob was deleted — read it there rather than here+for that history. What resolves under `memory::tree::…` today is the four+submodules below plus the controller-registry re-exports `mod.rs` aggregates+from them (they cannot live in the extracted crate alongside the rest of+`tree`, since aggregation is inherently host-side).++## Submodules++| Module | Role |+| --- | --- |+| [`tree/`](tree/) | Host surface over what used to be `tinymemory_core::tree::tree` — the per-source summary tree's persistence-adjacent RPC (`rpc.rs`, `canonicalize_types.rs`). |+| [`tree_runtime/`](tree_runtime/) | The markdown time tree's host surface: JSON-RPC handlers (`ops.rs`, `schemas.rs`), the `tree-summarizer` CLI (`cli.rs`), and an event subscriber (`bus.rs`). Reaches the tree through the contract's six runtime doors (`runtime_buffer_write`, `runtime_read_node`, `runtime_read_children`, `runtime_tree_status`, `runtime_summarize`, `runtime_rebuild`) rather than building an engine config host-side. |+| [`retrieval/`](retrieval/) | Host layer over `tinymemory_core::tree::retrieval`: LLM-callable retrieval primitives (`query_source`, `cover_window`, `search_entities`, `drill_down`, `fetch_leaves`) as `memory_tree.*` JSON-RPC methods, delegating to the bound driver via `crate::memory::api::provider::retrieval`. |+| [`health/`](health/) | The pipeline failure taxonomy (`FailureCode`, `FailureClass`, `PipelineFailure`, `DegradedState`) and the `user_error` wire payload for a web channel, plus the doctor `report` that reads the bound driver's `MemoryMaintenance::{diagnose, degraded_state}`. Not to be confused with `tinymemory_api::health::MemoryHealth` (driver liveness) — see the module doc for the name collision. |++## Registered RPC namespaces++`mod.rs` re-exports three controller registries, wired into `core/all.rs`:++- `all_memory_tree_registered_controllers` (from [`memory/schema/`](../schema/),+ `mod.rs`'s `pub use crate::memory::schema::{...}`) — the core `memory_tree`+ namespace's ingest/query controllers.+- `all_retrieval_registered_controllers` (`retrieval/schemas.rs`) — Phase 4+ retrieval tools, also under the `memory_tree` namespace (kept in the same+ namespace deliberately, "to keep the tool surface tightly grouped with the+ Phase 1-3 ingest controllers"): `query_source`, `cover_window`,+ `search_entities`, `drill_down`, `fetch_leaves`.+- `all_tree_summarizer_registered_controllers` (`tree_runtime/schemas.rs`) —+ the `tree_summarizer` namespace: `ingest`, `run`, `query`, `status`,+ `rebuild`.++All three are registered in `crates/openhuman-core/src/core/all.rs` alongside+the rest of the RPC registry.++## Related surfaces++- [`memory/query/`](../query/) is the agent-facing `memory_tree` tool+ (`MemoryQueryTool`) that calls into this directory's retrieval RPC through+ `memory/query/backend.rs`, not directly into `retrieval::rpc`.+- [`memory/read_rpc/`](../read_rpc/) is the Memory tab dashboard's read+ surface; it shares the `memory_tree` namespace with the controllers+ registered here rather than defining its own.diff --git a/crates/openhuman-core/src/sandbox/README.md b/crates/openhuman-core/src/sandbox/README.mdnew file mode 100644index 0000000000..83fc53ffa4--- /dev/null+++ b/crates/openhuman-core/src/sandbox/README.md@@ -0,0 +1,114 @@+# Sandbox++Per-session sandbox backend selection and routed execution for agent tool+commands. Separates three concerns that used to be conflated: **where** a+tool runs (this module), **which** tools are allowed (security / tool+policy), and **whether** a tool needs host access (elevated ops, also owned+here). The gateway/core process itself always runs on the host; only+selected tool families (shell, filesystem, process) execute through a+sandbox backend.++This is a distinct layer from `crate::security::traits::Sandbox` (the older+`Command`-wrapping backends in `security/{docker,bubblewrap,firejail,landlock}.rs`+used by `security::create_sandbox`). That trait wraps a `Command` in-place;+this domain resolves a per-session `SandboxPolicy`, owns its own Docker+backend, and delegates local OS-level confinement to `cwd_jail`.++## Public surface++- `pub enum SandboxBackendKind { None, Local, Docker }` — `types.rs` — which+ backend a session resolved to.+- `pub struct SandboxPolicy` — `types.rs` — `backend`, `workspace_root`,+ `read_only_mounts`, `allow_network`, `env_passthrough`,+ `docker_overrides`.+- `pub struct DockerOverrides` — `types.rs` — per-session image/network/+ resource-limit overrides layered on `RuntimeConfig`'s `[runtime.docker]`.+- `pub struct ElevatedOp` / `pub const ELEVATED_TOOLS` — `types.rs` — tools+ (`git_operations`, `install_tool`, `docker_management`,+ `process_management`) that always require host access and must be audited+ via `build_elevated_op` rather than silently bypassing the sandbox.+- `pub const SANDBOX_ENV_PASSTHROUGH` — `ops.rs` — the allowlisted+ environment variables (`PATH`, `HOME`, `TERM`, ...) forwarded into+ sandboxed execution; no other host env leaks in.+- `pub fn resolve_sandbox_policy(mode: SandboxMode, action_dir, runtime_config, is_remote_session) -> SandboxPolicy`+ — `ops.rs` — `SandboxMode::None`/`ReadOnly` resolve to `SandboxBackendKind::None`;+ `Sandboxed` resolves to `Docker` when `runtime_config.kind == "docker"` or+ the session is remote (channel/cron), else `Local` (OS jail via+ `cwd_jail`).+- `pub async fn create_sandbox_backend(policy) -> SandboxBackendHandle` —+ `ops.rs` — instantiates/probes the resolved backend.+- `pub async fn execute_in_sandbox(policy, command, working_dir, extra_env, timeout) -> anyhow::Result<SandboxExecResult>`+ — `ops.rs` — routes to unsandboxed, `cwd_jail`-based local jail, or Docker+ execution based on `policy.backend`.+- `pub fn is_elevated_op(tool_name) -> bool` / `pub fn build_elevated_op(...) -> ElevatedOp`+ — `ops.rs` — the escape hatch a sandboxed tool call uses to run on the+ host, with an audited reason.+- `pub mod docker` — Docker-specific container execution+ (`docker_exec`, `docker_backend_handle`, orphan cleanup).+- `pub mod cwd_jail` — the OS-level path-confinement backend used by+ `Local`; see [`cwd_jail/README.md`](cwd_jail/README.md).+- `sandbox` RPC namespace (`schemas.rs`): `status`, `resolve_policy`,+ `cleanup_orphans`, `validate_policy`, wired through+ `all_sandbox_registered_controllers()` in+ `crates/openhuman-core/src/core/all.rs`.++## Backend behavior++- **None** — `execute_unsandboxed` runs the command directly via+ `agent::platform_shell` after validating `working_dir` with+ `config::ensure_usable_cwd`.+- **Local** — `execute_local_jail` builds a `cwd_jail::Jail` rooted at+ `policy.workspace_root`, applies `deny_net()`/read-only mounts from the+ policy, and spawns through `cwd_jail::default_backend()` (falling back to+ `NoopBackend` if no OS jail is available on the host). Output is captured+ by redirecting stdout/stderr to temp files inside the jail root because+ some backends (macOS Seatbelt) rebuild the command and drop piped stdio.+- **Docker** — `docker::docker_exec` runs `docker run --rm` with the host+ `action_dir` mounted read/write at `/workspace`, network `none` by+ default, `--cap-drop ALL` (plus policy-specified extra drops), a+ read-only rootfs with `/tmp` and `/var/tmp` tmpfs mounts, memory/CPU+ limits, and only the explicit env passthrough list injected. Containers+ carry `openhuman.sandbox=true` for orphan cleanup.++## Security invariant++Sandbox backend selection is a defense-in-depth layer, not a replacement for+policy. Rust path checks in `security` (`is_workspace_internal_path`,+`is_always_forbidden`, `classify_command`) still apply even when+`resolve_sandbox_policy` falls back to `SandboxBackendKind::None` — either+explicitly (`SandboxMode::None`/`ReadOnly`) or implicitly when the `Local`+backend has no usable OS jail and `create_sandbox_backend`/+`execute_local_jail` in `ops.rs` fall back to `cwd_jail::NoopBackend` (an+unenforced passthrough, reported as `SandboxStatus::Inactive` rather than+`Ready` so callers can tell the difference). Do not treat a resolved+`SandboxBackendKind` as a security boundary on its own.++## Dependencies++- `crate::agent::harness::definition::SandboxMode` — the agent-declared+ mode this domain resolves against.+- `crate::agent::platform_shell` — Windows-aware shell/command building for+ the unsandboxed and local-jail paths.+- `crate::config::RuntimeConfig` — `[runtime] kind` and `[runtime.docker]`+ overrides feed `resolve_sandbox_policy`.++## Called by++- `crates/openhuman-core/src/tools/impl/system/{shell,node_exec,npm_exec,python_exec}.rs`+ — resolve a policy and call `execute_in_sandbox` per invocation.+- `crates/openhuman-core/src/flows/tinyflows/caps/code.rs` — sandboxed code+ execution capability.+- `crates/openhuman-core/src/agent/platform_shell.rs`,+ `agent/profiles/guard.rs` — reference this domain when documenting+ confinement guarantees for shell-spawning sites.+- `crates/openhuman-core/src/config/ops/sandbox.rs` — RPC settings surface+ (`get_sandbox_settings`) reads `SANDBOX_ENV_PASSTHROUGH` and+ `[security.sandbox]` config.++## Tests++- `types_tests.rs`, `ops_tests.rs`, `schemas_tests.rs`, `docker_tests.rs` —+ sibling `#[cfg(test)]` suites per file.+- `ops_tests.rs` includes a regression test (#3235) pinning+ `local_status_for_backend` so a host with no OS jail reports `Inactive`+ rather than a false `Ready`.diff --git a/crates/openhuman-core/src/web3/wallet/README.md b/crates/openhuman-core/src/web3/wallet/README.mdindex 6c05a43c61..c6b4081474 100644--- a/crates/openhuman-core/src/web3/wallet/README.md+++ b/crates/openhuman-core/src/web3/wallet/README.md@@ -28,7 +28,7 @@ drift.- Build prepared-transaction quotes (validated, fee-estimated, TTL'd) that must be explicitly confirmed before execution.- Sign and broadcast confirmed quotes per chain; restore (and TTL-refresh) the quote on failure so it stays retryable.- Bind each quote to the chat thread that prepared it so a leaked `quote_id` in a shared channel can't be hijacked from another agent session.-- Expose six agent tools (`wallet_status`, `wallet_chain_status`, `wallet_prepare_transfer`, `wallet_tx_status`, `wallet_tx_receipt`, `wallet_lookup_tx`) and twelve `wallet.*` RPC controllers.+- Expose six agent tools (`wallet_status`, `wallet_chain_status`, `wallet_prepare_transfer`, `wallet_tx_status`, `wallet_tx_receipt`, `wallet_lookup_tx`) and twelve `wallet` RPC controllers.- Provide crate-internal `sign_and_broadcast_evm` / `sign_and_broadcast_solana` primitives for the `web3` layer (sign+broadcast an externally-built unsigned transaction). Not exposed to the agent / RPC surface.## Key files@@ -39,18 +39,21 @@ drift.| `crates/openhuman-core/src/web3/wallet/ops.rs` | Onboarding metadata + secret persistence: `WalletChain`/`WalletAccount`/`WalletStatus` types, `setup`/`status`, atomic `wallet-state.json` writes (temp-file + fsync), corrupt-state quarantine, keychain load/save/migrate, `validate_setup`, and `secret_material` (crate-internal) used by chain signers. || `crates/openhuman-core/src/web3/wallet/execution.rs` | Execution surface: balances/network_defaults/supported_assets/chain_status reads, `prepare_transfer`/`execute_prepared` (native + token transfers only), `tx_status`/`tx_receipt`/`lookup_tx` readers, the crate-internal `sign_and_broadcast_evm`/`sign_and_broadcast_solana` re-exports, the in-memory quote store (TTL'd, capped at 64), `QuoteOwner` chat-thread binding, amount/address/calldata validation, fee estimation, hex/u256 helpers. || `crates/openhuman-core/src/web3/wallet/defaults.rs` | `EvmNetwork` enum (chain id, default RPC, explorer base, env var), default RPC/REST URLs for BTC/Solana/Tron, env-override resolution, and per-chain/per-network asset catalogs. |-| `crates/openhuman-core/src/web3/wallet/abi.rs` | `encode_erc20_transfer` — encodes `transfer(address,uint256)` calldata via `ethers_core::abi`. |+| `crates/openhuman-core/src/web3/wallet/abi.rs` | `encode_erc20_transfer` — delegates the `transfer(address,uint256)` calldata encoding to `tinywallet_bus::abi`, mapping its typed errors (`InvalidRecipient`/`InvalidAmount`) to the plain-`String` shape the RPC/tool surface uses. || `crates/openhuman-core/src/web3/wallet/schemas.rs` | RPC controller schemas + `handle_*` dispatchers delegating to `ops`/`execution`; `all_wallet_controller_schemas` / `all_wallet_registered_controllers`. || `crates/openhuman-core/src/web3/wallet/rpc.rs` | **Network transport** (not RPC controllers): shared `reqwest::Client`, JSON-RPC POST (`rpc_call`, `evm_rpc_call`, `rpc_call_to`), REST GET/POST helpers, URL redaction for logs. |-| `crates/openhuman-core/src/web3/wallet/tools.rs` | Re-exports the three agent tool structs from `tools/`. |+| `crates/openhuman-core/src/web3/wallet/transport.rs` | OpenHuman's implementation of the `tinywallet_bus::rpc::Transport` seam: resolves a `tinywallet_bus::rpc::NetworkId` to an endpoint (including `OPENHUMAN_WALLET_RPC_<CHAIN>` overrides), redacts URLs for logs, and reuses `rpc.rs`'s shared `reqwest` client. Classifies errors conservatively — anything it cannot prove is a transport failure is reported as `TransportError::Rpc` (authoritative) rather than `Unreachable` (retryable), so an unclassifiable error stops a failover loop instead of risking a double broadcast. |+| `crates/openhuman-core/src/web3/wallet/tools.rs` | Re-exports the six agent tool structs from `tools/`. || `crates/openhuman-core/src/web3/wallet/tools/status.rs` | `WalletStatusTool` (`wallet_status`). || `crates/openhuman-core/src/web3/wallet/tools/chain_status.rs` | `WalletChainStatusTool` (`wallet_chain_status`). || `crates/openhuman-core/src/web3/wallet/tools/prepare_transfer.rs` | `WalletPrepareTransferTool` (`wallet_prepare_transfer`). |+| `crates/openhuman-core/src/web3/wallet/tools/tx_query.rs` | `WalletTxStatusTool` (`wallet_tx_status`), `WalletTxReceiptTool` (`wallet_tx_receipt`), `WalletLookupTxTool` (`wallet_lookup_tx`) — share a `{chain, hash, evmNetwork?}` input and delegate to the matching `wallet::*` dispatcher. || `crates/openhuman-core/src/web3/wallet/chains/mod.rs` | Per-chain executor namespace; docstring of the small per-chain surface (`execute_*_quote`, `native_balance`, `validate_*_address`). |-| `crates/openhuman-core/src/web3/wallet/chains/evm.rs` | EVM key derivation (`ethers_signers` BIP-39), EIP-1559/typed-tx signing, `eth_*` balance/gas/broadcast. |-| `crates/openhuman-core/src/web3/wallet/chains/btc.rs` | Bitcoin P2WPKH derivation/signing (`bitcoin` crate, secp256k1, BIP-32) + Esplora REST balance/broadcast. |-| `crates/openhuman-core/src/web3/wallet/chains/solana.rs` | Solana ed25519 (`ed25519_dalek`) derivation, native + SPL transfers, JSON-RPC balance/broadcast. |+| `crates/openhuman-core/src/web3/wallet/chains/evm.rs` | EVM signing/broadcast built on `tinywallet_bus::wire::{SecretMaterial, TransactionSpec}` and `tinywallet_bus::address::evm::validate`; one derivation path shared across all EVM networks, EIP-1559 signing, `eth_*` balance/gas/broadcast. |+| `crates/openhuman-core/src/web3/wallet/chains/btc.rs` | Bitcoin P2WPKH (BIP84) derivation/signing via `tinywallet_bus::wire`/`tinywallet_bus::address::btc`, plus Esplora REST balance/broadcast. |+| `crates/openhuman-core/src/web3/wallet/chains/solana.rs` | Solana native + SPL transfers: hand-rolled wire format (`ed25519_dalek`, `curve25519_dalek`, `sha2`) to avoid pulling in `solana-sdk`; JSON-RPC balance/broadcast. || `crates/openhuman-core/src/web3/wallet/chains/tron.rs` | Tron derivation/signing + TronGrid REST native + TRC20 transfers. |+| `crates/openhuman-core/src/web3/wallet/stub.rs` | Disabled-wallet facade compiled when `web3` is off; mirrors the subset of the real surface that always-on / other-gated callers need, with no-op / disabled-error bodies. See the Compile-time gate section. || `crates/openhuman-core/src/web3/wallet/test_support.rs` | `#[cfg(test)]` shared plumbing: `TEST_LOCK`, `setup_wallet_in` (deterministic "abandon … about" mnemonic), per-chain sample addresses. |## Public surfacediff --git a/gitbooks/developing/architecture/mcp-registry.md b/gitbooks/developing/architecture/mcp-registry.mdindex bd94883dc8..7fa94c5dbc 100644--- a/gitbooks/developing/architecture/mcp-registry.md+++ b/gitbooks/developing/architecture/mcp-registry.md@@ -1,9 +1,9 @@---description: >-- The dynamic, user-facing side of MCP-client support: discover servers on- Smithery and the official MCP registry, persist installs to SQLite, supervise- local-spawn subprocess lifecycle, surface their tools to agents via the- unified tool registry.+ The host half of the dynamic, user-facing side of MCP-client support:+ discover servers on Smithery and the official MCP registry, install and+ connect them (persistence and supervision live in the vendored `tinymcp`+ crate), and surface their tools to agents via the unified tool registry.icon: plug---@@ -96,6 +96,10 @@ pub use types::{ConnStatus, InstalledServer, McpTool};- Core startup, via `mcp::host::init` and the reconnect-supervisor loop.- Frontend Skills UI: the **MCP** tab at `/skills?tab=mcp` (`McpServersTab`) dispatches through `ops.rs` over the `openhuman.mcp_clients_*` RPC namespace: browse, install (auto-connects), connect/disconnect, status, tool call, `update_env` (reconfigure + reconnect), and `registry_settings_get` / `registry_settings_set` (Smithery / official-registry credentials; secret values are write-only). The agent-native flow uses `openhuman.mcp_setup_*` via the `mcp_setup` sub-agent (orchestrator delegate `setup_mcp_server`).+## Tests++Focused `*_tests.rs` siblings cover each file: `bus_tests.rs`, `ops_tests.rs`, `schemas_tests.rs`, `setup_ops_tests.rs`, `supervisor_events_tests.rs`, `tools_tests.rs`.+## Related- [`mcp/registry/mod.rs`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-core/src/mcp/registry/mod.rs) and [`mcp/mod.rs`](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-core/src/mcp/mod.rs): the authoritative rustdoc this page mirrors.