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: update module-level docs across several crates
Steven Enamakeldd76518dc91c
diff --git a/crates/openhuman-core/src/config/schema/modules.rs b/crates/openhuman-core/src/config/schema/modules.rsindex e71f8e2fb2..3ac8761ef1 100644--- a/crates/openhuman-core/src/config/schema/modules.rs+++ b/crates/openhuman-core/src/config/schema/modules.rs@@ -2,7 +2,7 @@//!//! A module is trusted in-process code, so this block deliberately cannot add//! one. The set of loadable modules is compiled into-//! `openhuman::modules::registry`; what config controls is whether they load at+//! `crate::modules::registry`; what config controls is whether they load at//! all, whether this host may fetch them, and where a developer's own build//! lives. A config file that could name a new artifact to `dlopen` would be a//! remote-code-execution surface with a download step.diff --git a/crates/openhuman-core/src/config/schema/types_part_01.rs b/crates/openhuman-core/src/config/schema/types_part_01.rsindex b07d5b89e8..4cfa1a2d8f 100644--- a/crates/openhuman-core/src/config/schema/types_part_01.rs+++ b/crates/openhuman-core/src/config/schema/types_part_01.rs@@ -320,7 +320,7 @@ pub struct Config {/// Loadable native modules — whether they load, whether this host may fetch/// them, and where a developer's own build lives. The loadable *set* is- /// compiled in, not configured: see `openhuman::modules::registry`.+ /// compiled in, not configured: see `crate::modules::registry`.#[serde(default)]pub modules: super::ModulesConfig,diff --git a/crates/openhuman-core/src/integrations/task_sources/README.md b/crates/openhuman-core/src/integrations/task_sources/README.mdindex 9251f8310a..e2593b95ba 100644--- a/crates/openhuman-core/src/integrations/task_sources/README.md+++ b/crates/openhuman-core/src/integrations/task_sources/README.md@@ -28,14 +28,16 @@ Proactive ingestion of work items from external tools. A **task source** is a us| `crates/openhuman-core/src/integrations/task_sources/route.rs` | `route_enriched` / `add_card` / `board_cards` — appends todo cards to the `task-sources` board (`TASK_SOURCES_THREAD_ID`), removes stale cards on re-ingest, and dispatches a scheduler-gated triage turn for proactive sources. || `crates/openhuman-core/src/integrations/task_sources/periodic.rs` | `start_periodic_poll` — global tick scheduler; per-source due-timing in a process-global map; `run_one_tick` is `pub(crate)` for tests. || `crates/openhuman-core/src/integrations/task_sources/bus.rs` | `TaskSourcesConnectionSubscriber` + `register_task_sources_subscriber` — one-shot fetch on `ComposioConnectionCreated`. |+| `crates/openhuman-core/src/integrations/task_sources/tools.rs` | LLM-callable wrappers over `ops.rs` — see [Agent tools](#agent-tools) below. || `crates/openhuman-core/src/integrations/task_sources/store_tests.rs` | Sibling test suite for `store.rs`. || `crates/openhuman-core/src/integrations/task_sources/pipeline_tests.rs` | Sibling test suite for `pipeline.rs`. |+| `crates/openhuman-core/src/integrations/task_sources/tools_tests.rs` | Sibling test suite for `tools.rs`. |## Public surfaceRe-exported from `mod.rs`:-- Types: `TaskSource`, `TaskSourcePatch`, `FilterSpec`, `ProviderSlug`, `SourceTarget`, `FetchReason`, `EnrichedTask`, `FetchOutcome`; plus `NormalizedTask` / `TaskFetchFilter` re-exported from the composio providers.+- Types: `TaskSource`, `TaskSourcePatch`, `FilterSpec`, `ProviderSlug`, `SourceTarget`, `FetchReason`, `EnrichedTask`, `FetchOutcome`; plus `NormalizedTask`, `TaskContainer`, `TaskFetchFilter`, `TaskKind` re-exported from `crate::integrations::composio::providers` (`pub use crate::integrations::composio::providers::{NormalizedTask, TaskContainer, TaskFetchFilter, TaskKind};` in `mod.rs`).- Functions: `start_periodic_poll`, `run_source_once`.- Constant: `TASK_SOURCES_THREAD_ID` (`"task-sources"`).- RPC registry: `all_task_sources_controller_schemas`, `all_task_sources_registered_controllers`, `task_sources_schemas`.@@ -60,7 +62,32 @@ Handlers parse params and delegate to `ops.rs`; schemas reference `FilterSpec`,## Agent tools-None. This domain owns no `tools.rs` / agent tools. It *produces* work for agents (todo cards + triage turns) rather than exposing callable tools.+`tools.rs` wraps `ops.rs` as thin LLM-callable shims — each parses args,+calls the matching `ops` function, and emits its `RpcOutcome::value` as JSON.+Read/observe tools are default-enabled; the persistent-config mutators are+default-OFF and must be explicitly allowlisted via `tools/user_filter.rs`+(the `task_source_manage` filter group covers `add`/`update`/`remove`).++| Tool name | Struct | Backing op | Default |+| --- | --- | --- | --- |+| `task_source_list` | `TaskSourceListTool` | `ops::list` | enabled |+| `task_source_get` | `TaskSourceGetTool` | `ops::get` | enabled |+| `task_source_fetch` | `TaskSourceFetchTool` | `ops::fetch` | enabled |+| `task_source_list_tasks` | `TaskSourceListTasksTool` | `ops::list_tasks` | enabled |+| `task_source_preview_filter` | `TaskSourcePreviewFilterTool` | `ops::preview_filter` | enabled |+| `task_source_status` | `TaskSourceStatusTool` | `ops::status` | enabled |+| `task_source_add` | `TaskSourceAddTool` | `ops::add` | OFF (`task_source_manage`) |+| `task_source_update` | `TaskSourceUpdateTool` | `ops::update` | OFF (`task_source_manage`) |+| `task_source_remove` | `TaskSourceRemoveTool` | `ops::remove` | OFF (`task_source_manage`) |++Re-exported into the global agent tool registry via+`crates/openhuman-core/src/tools/mod.rs`+(`pub use crate::integrations::task_sources::tools::*;`).++`task_source_fetch` and `task_source_preview_filter` currently advertise+themselves as **UNAVAILABLE** in their tool descriptions: the underlying+`ComposioProvider::fetch_tasks` path was removed upstream (tinymemory+v1.13.4), so calling either always fails until it is restored.## Eventsdiff --git a/crates/openhuman-core/src/mcp/audit/README.md b/crates/openhuman-core/src/mcp/audit/README.mdindex 61c138d184..37d3e3ddfc 100644--- a/crates/openhuman-core/src/mcp/audit/README.md+++ b/crates/openhuman-core/src/mcp/audit/README.md@@ -1,62 +1,64 @@-# mcp/audit+# mcp/audit — write-audit RPC surface-Persistent audit log for MCP write-tool calls. When the MCP server dispatches a write tool (e.g. `memory.store`, `tree.tag`) on behalf of an external MCP client (Claude Desktop, Cursor, …), this domain records the attempt — successful or failed — into the local workspace SQLite database and exposes a read-only query surface over those records. The audit table lives inside the existing memory-tree chunk database, reusing the same per-workspace persistence rather than opening a new file.+RPC surface over the MCP write-audit log. The log itself — its store and+schema — moved to [`tinymcp`](https://github.com/tinyhumansai/tinymcp). What+is here is the `mcp_audit` controller family and the payload types it+speaks, re-exported from the wire contract.-## Responsibilities+## Where the rows are-- Record every MCP write-tool attempt: timestamp, originating client, tool name, an arg summary, the resulting chunk id (if any), success flag, and error message.-- Truncate over-long error messages at a UTF-8 char boundary (cap 1024 bytes) before persisting.-- Query the audit log newest-first with optional filters: `since_ms`, exact `client_filter`, exact `tool_filter`, `success_only`, plus `limit`/`offset` paging (default limit 50, hard cap 500).-- Expose the query as an internal-only RPC controller (`mcp_audit.list`).+The audit table used to be created inside this application's memory-tree+chunk database, which was precisely what made it unmovable. It has its own+file now, `<workspace>/mcp_audit/mcp_audit.db`, under the same workspace+directory. Rows written before the move stay in the old table: an audit log+is history rather than operational state, and nothing reads that table any+more.## Key files| File | Role || --- | --- |-| `crates/openhuman-core/src/mcp/audit/mod.rs` | Export-only module surface; re-exports store fns, types, and the controller-schema pair. |-| `crates/openhuman-core/src/mcp/audit/types.rs` | Serde types: `NewMcpWriteRecord` (insert), `McpWriteRecord` (row), `McpWriteListQuery` (filters/paging). |-| `crates/openhuman-core/src/mcp/audit/store.rs` | Persistence: `record_write` (INSERT) and `list_writes` (filtered SELECT), arg/error serialization, limit/offset normalization, row mapping. Includes the test suite. |-| `crates/openhuman-core/src/mcp/audit/schemas.rs` | Controller schema for `mcp_audit.list` + `handle_list` handler delegating to `store::list_writes`. Internal-controller registration. |+| `mod.rs` | Facade: re-exports the payload types (`types` module, from `tinymcp_bus`), `record_write`/`list_writes` (delegating to the `mcp::host` service's `AuditStore`), and the schema re-exports. |+| `schemas.rs` / `schemas_tests.rs` | The `mcp_audit.list` controller: schema (`limit`/`offset`/`since_ms`/`client_filter`/`tool_filter`/`success_only` inputs, `records` output) and its handler. |+| `stub.rs` | The `mcp`-less mirror: `record_write` is a no-op returning `Ok(0)`, `list_writes` returns `Ok(vec![])`. |-## Public surface+## RPC surface-From `mod.rs`:-- Types: `McpWriteRecord`, `NewMcpWriteRecord`, `McpWriteListQuery`.-- Store fns: `record_write(&Config, NewMcpWriteRecord) -> Result<i64>`, `list_writes(&Config, &McpWriteListQuery) -> Result<Vec<McpWriteRecord>>`.-- Schema/controller exports: `all_mcp_audit_controller_schemas`, `all_mcp_audit_registered_controllers`, `all_mcp_audit_internal_controllers`, `mcp_audit_schemas`.+`mcp_audit.list` is the only controller, registered as **internal-only**+(`all_mcp_audit_internal_controllers`, used by the desktop UI/CLI, not the+public schema) at `core/all.rs` (~lines 1015-1020). Its filter and limit+semantics (`limit` default 50 / max 500, `offset`, `since_ms`,+`client_filter`, `tool_filter`, `success_only`) are enforced by the handler+in `schemas.rs` against the query it hands `list_writes`; whether the+underlying `tinymcp::AuditStore` applies those same bounds internally is the+contract's concern, not this layer's.-## RPC / controllers+## Compile-time gate (`mcp` feature)-- **`openhuman.mcp_audit_list`** (namespace `mcp_audit`, function `list`) — lists write-attempt audit records (successes and rejected/failed attempts) ordered by `timestamp_ms` descending.- - Inputs (all optional): `limit` (u64, default 50, max 500), `offset` (u64), `since_ms` (u64), `client_filter` (string, exact), `tool_filter` (string, exact), `success_only` (bool).- - Output: `records` — array of `McpWriteRecord`.-- **Internal-only.** Registered via `all_internal_controllers` and wired into `crates/openhuman-core/src/core/all.rs` through `all_mcp_audit_internal_controllers()`. Per `crates/openhuman-core/src/core/all_tests.rs`, the method is routable internally (`schema_for_rpc_method`) but **not** exposed publicly via `rpc_method_from_parts`.--## Persistence--- Table `mcp_writes` in the memory-tree chunk SQLite DB; schema and indexes (`idx_mcp_writes_timestamp`, `idx_mcp_writes_client`, `idx_mcp_writes_tool`) are created in `crates/openhuman-core/src/memory/store/chunks/store.rs`, not here.-- Columns: `id`, `timestamp_ms`, `client_info`, `tool_name`, `args_summary` (JSON text), `resulting_chunk_id`, `success` (0/1), `error_message`.-- Connections are obtained via `chunk_store::with_connection(config, …)`; this module does not own a DB handle.+`pub mod audit;` is always compiled — it is a facade. The RPC surface+(`schemas`) is gated; with the `mcp` feature off, `stub` mirrors the+consumed surface (`record_write`, `list_writes`,+`all_mcp_audit_internal_controllers`) so the audited subsystem simply+appears never to have happened, rather than erroring.## Dependencies-- `crate::config::Config` — workspace location used to resolve the DB.-- `crate::config::rpc` (`load_config_with_timeout`) — loads config in the RPC handler.-- `tinymemory_core::store::chunks::store` — provides `with_connection`; the audit table is co-located in the chunk DB.-- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — controller/schema plumbing.-- External crates: `rusqlite`, `serde`/`serde_json`, `anyhow`.+- `tinymcp` (`AuditStore`) — the write-audit store, opened per workspace by+ `crate::mcp::host`.+- `tinymcp_bus` — `McpWriteListQuery`, `McpWriteRecord`, `NewMcpWriteRecord`.+- `crate::mcp::host` — resolves the per-workspace `AuditStore` via+ `for_config`.+- `crate::core::all` — `ControllerSchema`, `RegisteredController` types for+ the internal-controller registration.+- `crate::rpc::RpcOutcome` — the response envelope other RPC domains use;+ `mcp_audit.list`'s handler returns a raw JSON object rather than+ `RpcOutcome` (see `schemas.rs::handle_list`).## Used by-- `crates/openhuman-core/src/mcp/server/write_dispatch.rs` — calls `mcp::audit::record_write` after each write attempt and `mcp::audit::list_writes` for its own surfaces/tests.-- `crates/openhuman-core/src/mcp/server/tools_tests.rs` — reads back audit rows in tests.-- `crates/openhuman-core/src/core/all.rs` — registers the internal controller.-- `crates/openhuman-core/src/tools/registry/ops.rs` — independently `COUNT`s `mcp_writes` rows (queries the shared table directly, not via this module's API).--## Notes / gotchas--- Filters `client_filter`/`tool_filter` are trimmed and dropped when empty (`normalized_filter`); matching is exact, not prefix/substring.-- `limit`/`offset` are `u64` in the query but converted to `i64` for SQLite (`u64_to_i64` errors on overflow); `limit` is clamped to `MAX_LIST_LIMIT` (500), default 50.-- Error messages longer than 1024 bytes are truncated at the nearest preceding UTF-8 char boundary, so multibyte error text stays valid.-- The table itself is created by the memory_store chunk DB migration — this module assumes it already exists and will fail if that migration hasn't run.-- Logging uses the grep-friendly `[mcp_audit]` prefix at `debug`/`trace`/`warn`.+- `crates/openhuman-core/src/mcp/server/write_dispatch.rs` — calls+ `audit::record_write` for every MCP write-tool attempt (success and+ rejection), which opens the per-workspace `mcp::host` service and writes+ through its `AuditStore`.+- `crates/openhuman-core/src/core/all.rs` — registers+ `all_mcp_audit_internal_controllers()`.diff --git a/crates/openhuman-core/src/memory/read_rpc/README.md b/crates/openhuman-core/src/memory/read_rpc/README.mdnew file mode 100644index 0000000000..01b97d7274--- /dev/null+++ b/crates/openhuman-core/src/memory/read_rpc/README.md@@ -0,0 +1,44 @@+# read_rpc++Read RPCs that back the Memory tab dashboard: list / inspect / search /+recall / score / delete methods for a human browsing their stored memory,+not for an LLM tool loop. All methods share the existing `memory_tree`+JSON-RPC namespace with the rest of [`memory/tree/`](../tree/), so they get+the same authentication, telemetry, and discovery.++Distinct from [`memory::ops`](../ops/) (re-exported as `memory::rpc`, the+write/ingest surface) and [`memory::tree::retrieval`](../tree/retrieval/)+(LLM-callable retrieval primitives) — see `mod.rs`'s module doc for how the+three surfaces divide the space.++## Files++| File | Exports |+| --- | --- |+| `admin.rs` | `backfill_connector_trees_rpc`, `delete_source_rpc`, `flush_now_rpc`, `flush_source_tree_rpc`, `reset_tree_rpc`, `wipe_all_rpc` |+| `chunks.rs` | `list_chunks_rpc`, `list_sources_rpc`, `recall_rpc`, `search_rpc`, plus the `display_name_for_source` / `read_chunk_row` helpers |+| `entities.rs` | `chunk_score_rpc`, `chunks_for_entity_rpc`, `delete_chunk_rpc`, `entity_index_for_rpc`, `top_entities_rpc` |+| `graph.rs` | `graph_export_rpc` (summary-forest + leaf-chunk graph for the Memory tab, built from `MemoryTree::{summary_forest, recent_leaves}` and `MemoryChunks`/`MemoryEntities` reads — not the contract's key/value `MemoryGraph`) |+| `vault.rs` | `obsidian_vault_status_rpc`, `vault_health_check_rpc` (filesystem probes behind `spawn_blocking`, delegating the registration check to `crate::memory::obsidian_registry`) |+| `types.rs` | Wire DTOs shared across the above (`ChunkRow`, `ChunkFilter`, `EntityRef`, `Source`, the `*Response` types, and size limits like `MAX_LIST_LIMIT`) |++`mod.rs` re-exports everything so callers and the test file can `use+super::*;`.++## Wiring++Handlers are registered in [`memory/schema/handlers.rs`](../schema/handlers.rs),+which calls each `read_rpc::*_rpc` function under the `memory_tree.*`+controller schemas defined in [`memory/schema/`](../schema/) — for example+`read_rpc::list_chunks_rpc`, `read_rpc::graph_export_rpc`,+`read_rpc::wipe_all_rpc`. There is no separate `read_rpc`-only namespace or+registry; it rides the same `memory_tree` controller set as the rest of+`memory/tree/`.++## Tests++Each file has a colocated `*_tests.rs` (`admin_tests.rs`, `chunks_tests.rs`,+`entities_tests.rs`, `graph_tests.rs`, `vault_tests.rs`); `read_rpc_tests*.rs`+at the `memory/` root drives cross-file behavior with `use super::*;` against+this module, including a `#[cfg(test)]`-only `with_connection` door for+asserting on the rows a handler wrote directly.diff --git a/crates/openhuman-core/src/memory/read_rpc/mod.rs b/crates/openhuman-core/src/memory/read_rpc/mod.rsindex dc5aed4206..5596379f14 100644--- a/crates/openhuman-core/src/memory/read_rpc/mod.rs+++ b/crates/openhuman-core/src/memory/read_rpc/mod.rs@@ -1,7 +1,8 @@//! Read RPCs that back the new Memory tab UI.//!-//! Distinct from [`super::rpc`] (write/ingest) and [`super::retrieval::rpc`]-//! (LLM-callable retrieval primitives), this module exposes a small set of+//! Distinct from [`super::rpc`] (write/ingest, an alias of [`super::ops`])+//! and [`super::tree::retrieval`] (LLM-callable retrieval primitives), this+//! module exposes a small set of//! "list / inspect / search / recall / score-for / delete" methods designed//! for a human-facing dashboard — not for an LLM tool loop.//!diff --git a/crates/openhuman-core/src/web3/wallet/README.md b/crates/openhuman-core/src/web3/wallet/README.mdindex 7cd9c923bd..5955a198e6 100644--- a/crates/openhuman-core/src/web3/wallet/README.md+++ b/crates/openhuman-core/src/web3/wallet/README.md@@ -117,14 +117,14 @@ None. The module publishes/subscribes no `DomainEvent`s and has no `bus.rs`. Cha- `crate::tools::traits` — `Tool`/`ToolResult`/`ToolCallOptions` for the agent tools.- `crate::core::all` (`ControllerFuture`, `RegisteredController`) and `crate::core` (`ControllerSchema`, `FieldSchema`, `TypeSchema`) — RPC controller registry wiring.- `crate::rpc::RpcOutcome` — standard RPC return shape.-- External crates: `ethers_core` / `ethers_signers` / `coins_bip39` (EVM + ABI + BIP-39), `bitcoin` + `secp256k1` (BTC), `ed25519_dalek` (Solana), `sha2`, `hex`, `reqwest`, `serde`/`serde_json`, `tempfile`, `parking_lot`, `once_cell`.+- `tinywallet-bus` (`vendor/tinywallet/crates/tinywallet-bus`, optional, gated by the `web3` feature; features `btc`, `evm`, `solana`, `tron`, `keccak`, `net`, `wire`, `eip712`, `abi`, `tx-codec`) — the contract crate. It owns address formats (parsing/validation/conversion) and the wire types crossing the `Transport` seam (`SecretMaterial`, `TransactionSpec`, `NetworkId`), the ERC-20/EIP-712 encoders, and the Tron verifier. Per Cargo.toml's own rationale: taken as the contract crate and NOT the root `tinywallet` crate — key derivation, transaction building, signing and the chain clients (including the `bitcoin` crate and its native secp256k1 build) live inside that loaded module now, so this binary links none of it. The root `tinywallet` crate is still a dev-dependency, used only so test fixtures can derive a known account from a BIP-39 vector phrase.+- Other external crates: `k256` (secp256k1 signing over digests the wallet hands back — replaces `bitcoin`/`secp256k1` as a direct dependency), `coins-bip39` (shared BIP-39 mnemonic → seed for BTC/Tron/Solana derivation), `ed25519-dalek` (Solana signing), `curve25519-dalek` (Solana off-curve ATA check), `bs58` (Solana/Tron base58 addresses), `sha2`, `hex`, `reqwest`, `serde`/`serde_json`, `tempfile`, `parking_lot`, `once_cell`.## Used by-- `crates/openhuman-core/src/tools/mod.rs` & `crates/openhuman-core/src/tools/ops.rs` — register the three wallet agent tools.-- `crates/openhuman-core/src/agent/agents/loader.rs` — references the wallet tools when assembling agent toolsets.+- `crates/openhuman-core/src/tools/mod.rs` — re-exports `wallet::tools::*`; `crates/openhuman-core/src/tools/ops.rs` — registers the six wallet agent tools (gated on the `web3` feature) and reserves the `wallet_`/`web3_`/`x402_` name prefixes as Web3-exclusive.- `crates/openhuman-core/src/core/all.rs` — wires controllers/schemas/capability description.-- `crates/openhuman-core/src/test_support/introspect.rs` — introspection in tests.+- `crates/openhuman-core/src/test_support/introspect.rs` — `wallet_prepared_quotes` introspection helper used in tests, backed by `wallet::prepared_quotes_for_test`.## Notes / gotchasdiff --git a/crates/openhuman-core/src/web_chat/mod.rs b/crates/openhuman-core/src/web_chat/mod.rsindex b27be80ae6..3e53f7e838 100644--- a/crates/openhuman-core/src/web_chat/mod.rs+++ b/crates/openhuman-core/src/web_chat/mod.rs@@ -1,3 +1,24 @@+//! Web/desktop channel turn runner.+//!+//! Drives a chat turn from a Socket.IO `chat` event through the agent+//! harness to a delivered, durably-persisted reply: `start_chat`+//! (`ops_part_02.rs`) validates and preprocesses the message, resolves or+//! builds the session `Agent` (`session.rs`), and hands off to+//! `run_task::run_chat_task`, which spawns `spawn_progress_bridge` alongside+//! the run and lets `presentation.rs` persist the reply+//! (`reply_persistence.rs`) before announcing it. Exposes the `channel.web_*`+//! RPC namespace (`schemas.rs`) and the `WebChannelEvent` broadcast bus+//! (`event_bus.rs`) that both Socket.IO and the JSON-RPC `/events` SSE stream+//! consume. See `README.md` for the full lifecycle and wiring.+//!+//! Submodules: `ops*.rs` (request surface, session/in-flight state),+//! `run_task.rs` (turn execution), `session.rs` (agent build/fingerprint),+//! `progress_bridge.rs` (progress → socket event bridge), `presentation.rs`+//! (reply segmentation/delivery), `reply_persistence.rs` (durable reply+//! write), `event_bus.rs` (broadcast + `DomainEvent` surface subscribers),+//! `web_errors*.rs` (provider error classification), `schemas.rs` (RPC+//! contract), `types.rs` (shared param/state types).+mod event_bus;mod ops;// Response delivery/segmentation for the web surface (folded in from the former