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(core): update module READMEs for channels, inference, and search tools
Steven Enamakel322dcb465908
diff --git a/crates/openhuman-core/src/channels/README.md b/crates/openhuman-core/src/channels/README.mdindex 2931a07ac3..762db94cb8 100644--- a/crates/openhuman-core/src/channels/README.md+++ b/crates/openhuman-core/src/channels/README.md@@ -1,28 +1,46 @@# Channels-Multi-platform messaging integration. Owns the `Channel` trait, per-provider connectors (Slack, Discord, Telegram, WhatsApp, IRC, Matrix, Signal, iMessage, Email, Lark, Mattermost, DingTalk, QQ, Linq, Web, CLI), the runtime supervisor that brings channels online, inbound dispatch into the agent loop, and proactive outbound delivery. Does NOT own the channel system prompt copy (lives in `context/channels_prompt.rs`; `system_prompt.rs` here owns only when it is re-rendered) or per-channel credential storage (delegated to `credentials/`).+Multi-platform messaging integration. Owns the `Channel` trait vocabulary, host glue for every provider (Slack, Discord, Telegram, WhatsApp, WhatsApp Web, IRC, Signal, iMessage, Email, Lark, Mattermost, DingTalk, QQ, Linq, Yuanbao, and the local CLI REPL), the runtime supervisor that brings channels online, inbound dispatch into the agent loop, and proactive outbound delivery. Does NOT own the channel system prompt copy (lives in `agent/context/channels_prompt.rs`; `system_prompt.rs` here owns only when it is re-rendered), per-channel credential storage (delegated to `security/credentials/`), or provider transport implementations (vendored in `tinychannels`; see below).++## Feature gate++The domain lives behind the `channels` feature (default-ON, #4801), except two dependency-free carve-outs that always-on code reaches directly: `traits` (the `Channel`/`SendMessage` re-export, named by the always-on agent-harness interactive loop) and `cli` (`CliChannel`, the dependency-free stdin/stdout REPL that loop drives in every build). Everything else — `providers`, `host`, `controllers`, `runtime`, `bus`, `proactive`, `commands`, `context`, `routes`, `relay_runtime`, the provider re-exports, `doctor_channels`, `start_channels`, and the `test_support` re-export — is `#[cfg(feature = "channels")]`. The gate sheds zero dependencies: `tinychannels` stays load-bearing for the config schema, the `DomainEvent` inbound envelope, and security pairing, so its value is compile-time surface and binary size, not the dependency tree. See AGENTS.md "channels gate".## Public surface-- `pub trait Channel` / `pub struct SendMessage` / `pub struct ChannelMessage` — `traits.rs:5-60` — provider contract for inbound + outbound messages.-- `pub struct ChannelDefinition` / `pub enum ChannelAuthMode` — `controllers/definitions.rs` (re-exported `mod.rs:59`) — declarative provider metadata.-- `pub fn start_channels` — `runtime/startup.rs` (re-exported `mod.rs:65`) — boot all enabled channels under the supervisor.+- `pub use tinychannels_bus::{Channel, ChannelMessage, ChannelSendExt, SendMessage}` — `traits.rs` — the provider contract, sourced from the transport-free `tinychannels-bus` contract crate so it resolves even in `channels`-less builds.+- `pub struct ChannelDefinition` / `pub enum ChannelAuthMode` — `controllers/definitions.rs` (re-exported from `mod.rs`) — declarative provider metadata.+- `pub fn start_channels` — `runtime/startup.rs` (re-exported from `mod.rs`) — boot all enabled channels under the supervisor.- `pub fn doctor_channels` — `commands.rs` — diagnose connectivity for the doctor CLI.- `pub fn build_system_prompt` — re-exported from `crate::agent::context::channels_prompt`.- `pub(crate) enum ChannelSystemPrompt` — `system_prompt.rs` — the prompt a turn is seeded with: `fixed` (tests) or `refreshing` (production), which renders `build_system_prompt_with_identity` for the active agent profile — with the `## Project Context` identity block placed *after* the tool schemas and access context, and the profile's `system_prompt_suffix` as the trailing `## Agent profile` block — and re-renders only when an identity fingerprint (`agent_profiles.json`, root `SOUL/IDENTITY/PROFILE/MEMORY.md`, the profile's `SOUL/MEMORY.md`) changes — #6027 / #6028.-- Per-provider channel structs: `pub struct CliChannel`, `DingTalkChannel`, `DiscordChannel`, `EmailChannel`, `IMessageChannel`, `IrcChannel`, `LarkChannel`, `LinqChannel`, `MattermostChannel`, `QQChannel`, `SignalChannel`, `SlackChannel`, `TelegramChannel`, `WhatsAppChannel` — `providers/<name>.rs`. Cargo-feature-gated: `WhatsAppWebChannel` (`whatsapp-web`).-- Stable `pub use providers::<name>` paths for every provider — `mod.rs:18-36`.-- RPC `channels.{list, describe, connect, disconnect, status, test, telegram_login_start, telegram_login_check, discord_link_start, discord_link_check, discord_list_guilds, discord_list_channels, discord_check_permissions, send_message, send_reaction, create_thread, update_thread, list_threads}` — `controllers/schemas.rs`.+- Per-provider channel structs re-exported from `providers/<name>.rs` (all thin `pub use tinychannels::providers::…` shims): `CliChannel` (`cli.rs`, ungated), `DingTalkChannel`, `DiscordChannel`, `EmailChannel`, `IMessageChannel`, `IrcChannel`, `LarkChannel`, `LinqChannel`, `MattermostChannel`, `QQChannel`, `SignalChannel`, `SlackChannel`, `TelegramChannel`, `WhatsAppChannel`, `YuanbaoChannel`. Cargo-feature-gated: `WhatsAppWebChannel` (`whatsapp-web`).+- Stable `pub use providers::<name>` paths for every provider — `mod.rs`.+- RPC `channels.{list, describe, connect, disconnect, status, set_default, get_default, test, telegram_login_start, telegram_login_check, discord_link_start, discord_link_check, discord_list_guilds, discord_list_channels, discord_check_permissions, send_message, send_reaction, create_thread, update_thread, list_threads}` — `controllers/schemas.rs`.++## Submodule map++| Path | Purpose |+| --- | --- |+| `providers/` | Per-provider re-exports from `tinychannels`, plus Telegram's host-coupled glue ([README](providers/README.md)) |+| `host/` | `build_channel_host` / `build_provider_context`, the OpenHuman implementation of `tinychannels::host` that ported providers call back into |+| `runtime/` | Startup, supervision, and the inbound dispatch loop into the agent ([README](runtime/README.md)) |+| `controllers/` | `channels.*` RPC namespace, `OpenHumanChannelBackend`, provider definitions ([README](controllers/README.md)) |+| `tests/` | Cross-channel integration test suite (`#[cfg(all(feature = "channels", test))]`) |++Flat files: `bus.rs` (`ChannelInboundSubscriber`, publishes `DomainEvent::Channel*` onto the process bus), `cli.rs` (ungated `CliChannel`), `commands.rs` (`doctor_channels`), `context.rs`, `proactive.rs` (subscribes `DomainEvent::ProactiveMessageRequested` for scheduled/triggered outbound sends), `relay_runtime.rs` (`relay_runtime_fronts_channel` — whether a channel is fronted by the relay-websocket transport), `routes.rs`, `system_prompt.rs`, `traits.rs` (ungated `Channel`/`SendMessage` re-export).## Calls into-- `crates/openhuman-core/src/agent/` — inbound messages spawn or resume agent runs through `runtime/dispatch.rs`.+- `crates/openhuman-core/src/agent/` — inbound messages spawn or resume agent runs through `runtime/dispatch/`.+- `crates/openhuman-core/src/agent/context/channels_prompt.rs` — channel system prompt rendering, re-exported as `build_system_prompt`.- `crates/openhuman-core/src/security/credentials/` — per-channel auth tokens, refresh flow.- `crates/openhuman-core/src/config/schema/channels.rs` — runtime channel configuration.- `crates/openhuman-core/src/threads/` — thread state for platforms with native threading (Slack `thread_ts`).- `crates/openhuman-core/src/desktop/notifications/` — surface inbound deliveries to the UI.- `crates/openhuman-core/src/security/encryption/` — at-rest secret protection.-- `crates/openhuman-core/src/core/event_bus/` — emits `DomainEvent::Channel(*)`; `channels/bus.rs` registers `ChannelInboundSubscriber`.+- `crates/openhuman-core/src/core/bus.rs` and `core/events.rs` — `DomainEvent` definitions and the process-wide `BUS`; `channels/bus.rs` registers `ChannelInboundSubscriber` against it.+- `vendor/tinychannels/` — provider transport implementations and the `tinychannels::host` capability boundary; `vendor/tinychannels-bus` — the transport-free trait/type contract.## Called by@@ -30,11 +48,13 @@ Multi-platform messaging integration. Owns the `Channel` trait, per-provider con- `crates/openhuman-core/src/memory/conversations/bus.rs` — persists incoming channel messages as conversation memories.- `crates/openhuman-core/src/cron/bus.rs` — scheduled triggers can post via channels.- `crates/openhuman-core/src/config/schema/channels.rs` — config layer references channel types for validation.-- `crates/openhuman-core/src/core/all.rs` — controller registry wiring.+- `crates/openhuman-core/src/core/all.rs` — registers `controllers::all_channels_registered_controllers()` under the `channels` feature gate.+- `crates/openhuman-core/src/core/runtime/services.rs` — boot path calls `channels::start_channels(config)` unless `OPENHUMAN_DISABLE_CHANNEL_LISTENERS` is set.## Tests-- Unit: `bus_tests.rs`, `routes_tests.rs`, plus per-provider `*_tests.rs` (`email_channel_tests.rs`, `imessage_tests.rs`, `irc_tests.rs`, `lark_tests.rs`, `linq_tests.rs`, `mattermost_tests.rs`, `qq_tests.rs`, `signal_tests.rs`, `web_tests.rs`, `whatsapp_tests.rs`, `whatsapp_web_tests.rs`, `presentation_tests.rs`).-- Cross-channel integration tests: `tests/discord_integration.rs`, `tests/telegram_integration.rs`, `tests/runtime_dispatch.rs`, `tests/common.rs`.-- Telegram channel-level: `providers/telegram/channel_tests.rs`.-- Controller tests: `controllers/{definitions_tests,ops_tests,schemas_tests}.rs`.+- Unit, flat files: `bus_tests.rs` (+ `bus_part_01.rs`/`bus_part_02.rs` split, `bus_inbound_thread_id_tests_tests.rs`, `bus_test_support_tests.rs`), `cli_tests.rs`, `commands_tests.rs`, `context_tests.rs`, `proactive_tests.rs`, `relay_runtime_tests.rs`, `routes_tests.rs`, `system_prompt_tests.rs`, `traits_tests.rs`.+- Cross-channel integration suite: `tests/{common,context,discord_integration,health,identity,memory,personality,prompt,runtime_dispatch,runtime_tool_calls,telegram_integration}.rs` — `common.rs` holds the shared bus/agent/tool fixtures the rest of the suite drives.+- Provider host glue: `providers/telegram/{approval_surface_tests,bus_tests,remote_control_tests}.rs`.+- Controllers: `controllers/{backend_tests,ops_tests,schemas_tests}.rs` (+ `ops_tests_part_01_tests.rs`/`ops_tests_part_02_tests.rs`), `controllers/ops/connect_email_config_tests_tests.rs`.+- Runtime: `runtime/{startup_tests,supervision_tests}.rs` (+ startup secret-resolution tests for email/yuanbao), `runtime/dispatch_tests.rs`, `runtime/dispatch/{mod_scoping_tests_tests,mod_approval_surface_gating_tests_tests,routing_connected_fallback_tests_tests}.rs`.diff --git a/crates/openhuman-core/src/inference/README.md b/crates/openhuman-core/src/inference/README.mdindex abe021af90..1fcc75a7f4 100644--- a/crates/openhuman-core/src/inference/README.md+++ b/crates/openhuman-core/src/inference/README.md@@ -1,14 +1,14 @@# inference-Unified inference domain: the canonical home for everything LLM/STT/TTS/embedding-related. It owns the local-runtime manager (Ollama / LM Studio / Whisper / Piper), native TinyAgents `ChatModel` construction for managed/cloud/local/CLI routes, host credential and access policy, voice transcription and TTS inference, OpenAI/Codex subscription OAuth, and an OpenAI-compatible `/v1/chat/completions` HTTP endpoint. It consolidates the previously separate `local_ai/`, `providers/`, and inference parts of `voice/` under one domain root. The RPC surface is `inference.*`; older `local_ai_*` method names are compatibility aliases in `crates/openhuman-core/src/core/legacy_aliases.rs`.+Unified inference domain: the canonical home for everything LLM/STT/TTS/embedding-related. It owns the local-runtime manager (Ollama / LM Studio / Piper), native TinyAgents `ChatModel` construction for managed/cloud/local/CLI routes, host credential and access policy, voice transcription and TTS inference, OpenAI/Codex subscription OAuth, and an OpenAI-compatible `/v1/chat/completions` HTTP endpoint. It consolidates the previously separate `local_ai/`, `providers/`, and inference parts of `voice/` under one domain root. The RPC surface is `inference.*`; older `local_ai_*` method names are compatibility aliases in `crates/openhuman-core/src/core/legacy_aliases.rs`.## Responsibilities-- Resolve workload names (`chat`, `reasoning`, `agentic`, `coding`, `memory`, `embeddings`, `heartbeat`, `learning`, `subconscious`, etc.) and provider strings (`openhuman`, `cloud`, `ollama:<model>`, `lmstudio:<model>`, `claude_agent_sdk:<model>`, `<slug>:<model>[@<temp>]`) to a concrete `Arc<dyn tinyinference::ChatModel<()>>` + model id.-- Manage the local AI runtime: detect/spawn/adopt `ollama serve` and LM Studio, install/run Whisper (STT) and Piper (TTS), track download progress, and enforce a minimum-context-window floor.+- Resolve workload names (`chat`, `reasoning`, `agentic`, `coding`, `memory`, `embeddings`, `heartbeat`, `learning`, etc.) and provider strings (`openhuman`, `cloud`, `ollama:<model>`, `lmstudio:<model>`, `claude_agent_sdk:<model>`, `claude-code:<model>`, `<slug>:<model>[@<temp>]`) to a concrete `Arc<dyn tinyinference::ChatModel<()>>` + model id.+- Manage the local AI runtime: detect/spawn/adopt `ollama serve` and LM Studio, install/run Piper (TTS), track download progress, and enforce a minimum-context-window floor. Local STT (whisper.cpp) was retired; STT is now cloud/engine-configurable via `voice_server.stt_engine` (see `config/migrations/retire_local_whisper_stt.rs`).- Provide chat, vision (multimodal), summarization, embeddings, sentiment, and "should react" inference operations.- Preserve config-rejection, billing, authentication, and retry classification while TinyAgents owns model-call retry execution.-- Resolve abstract tier names (`reasoning-v1`, `agentic-v1`, `coding-v1`, etc.) through the TinyAgents `ModelRouter` in `openhuman/tinyagents/routes.rs` and the provider factory here.+- Resolve abstract tier names (`reasoning-v1`, `agentic-v1`, `coding-v1`, etc.) through the TinyAgents `ModelRouter` in `crates/openhuman-core/src/agent/tinyagents/routes.rs` and the provider factory here.- Run ChatGPT/Codex OAuth (PKCE) for the `openai` cloud slug and persist tokens in the encrypted auth-profile store.- Expose an OpenAI-compatible `/v1/*` HTTP endpoint guarded by a stable user-managed external bearer.- Detect device hardware profile and recommend/apply local model presets/tiers.diff --git a/crates/openhuman-core/src/search/tools/README.md b/crates/openhuman-core/src/search/tools/README.mdnew file mode 100644index 0000000000..09f03930f5--- /dev/null+++ b/crates/openhuman-core/src/search/tools/README.md@@ -0,0 +1,47 @@+# Search Tools++Agent-facing `Tool` implementations for every search provider. One file per+provider family; `mod.rs` re-exports the full public surface with+`pub use crate::search::tools::*` consumed from `tools/mod.rs`.++## Providers++| File | Exported tools | `name()` | Transport |+| --- | --- | --- | --- |+| `brave.rs` | `BraveWebSearchTool`, `BraveNewsSearchTool`, `BraveImageSearchTool`, `BraveVideoSearchTool` | `web_search_tool`, `brave_news_search`, `brave_image_search`, `brave_video_search` | Direct to `api.search.brave.com`, `X-Subscription-Token` header |+| `exa.rs` | `ExaSearchTool`, `ExaFindSimilarTool`, `ExaGetContentsTool` | `exa_search` or `web_search_tool` (constructor-selected), `exa_find_similar`, `exa_get_contents` | BYOK, direct to `api.exa.ai`, `x-api-key` header — never proxied |+| `parallel.rs` (+ `parallel_part_01.rs`, `parallel_part_02.rs`) | `ParallelSearchTool`, `ParallelExtractTool`, `ParallelChatTool`, `ParallelResearchTool`, `ParallelEnrichTool`, `ParallelDatasetTool` | `parallel_search`, `parallel_extract`, `parallel_chat`, `parallel_research`, `parallel_enrich`, `parallel_dataset` | Backend-proxied via `crate::integrations::IntegrationClient` (`/agent-integrations/parallel/*`) |+| `querit.rs` | `QueritSearchTool` | `querit_search` or `web_search_tool` (constructor-selected) | Direct to `api.querit.ai`, `Authorization: Bearer` header |+| `searxng.rs` | `SearxngSearchTool`, plus `normalize_categories`, `SearxngSearchArgs`, `SearxngSearchResponse`, `MAX_RESULTS` (re-exported as `SEARXNG_MAX_RESULTS`) | `searxng_search` | Direct to a user-configured, self-hosted SearXNG instance (`GET /search?format=json`) |+| `seltz.rs` | `SeltzSearchTool` | `seltz_search` | Direct to `api.seltz.ai`, `x-api-key` header |+| `tavily.rs` (+ `tavily_part_01.rs`, `tavily_part_02.rs`) | `TavilySearchTool`, `TavilyExtractTool` | `tavily_search` or `web_search_tool` (constructor-selected), `tavily_extract` | BYOK, direct to `api.tavily.com`, `Authorization: Bearer` header — never proxied |+| `tinyfish.rs` | `TinyFishSearchTool`, `TinyFishFetchTool`, `TinyFishAgentRunTool` | `tinyfish_search`, `tinyfish_fetch`, `tinyfish_agent_run` | Backend-proxied via `IntegrationClient` (`/agent-integrations/tinyfish/*`); search/fetch are read-oriented, agent-run drives goal-based browser automation |+| `web_search.rs` | `WebSearchTool` (+ crate-internal `resolve_managed_provider`) | `web_search_tool` | Backend-proxied managed search; resolves the actual provider (Exa by default) from the backend response for UI attribution |++Several providers construct their primary tool with a `tool_name` field so the+same struct can register under either its own name (e.g. `exa_search`,+`querit_search`, `tavily_search`) or the canonical `web_search_tool` slot when+that engine is the active `search.engine` — see `exa.rs`, `querit.rs`, and+`tavily_part_02.rs`.++## Registration++Most families are selected by `search::registry::build_search_tools` based on+`Config.search.engine`, via `search/engines/`+([README](../README.md)). `tinyfish.rs` tools are pushed separately by+`registry.rs` whenever `config.integrations.tinyfish.is_active()`, independent+of the chosen search engine.++`SearxngSearchTool` and `SeltzSearchTool` are not reachable through the engine+registry at all — they are constructed directly by the `tools_searxng_search`+(`tools/schemas_part_02.rs:41`) and `tools_seltz_search`+(`tools/schemas_part_01.rs:555`) RPC handlers, one call at a time, from+per-request arguments rather than saved config. `SEARXNG_MAX_RESULTS` and+`normalize_categories` are also reused by `mcp/server/tools/` to keep the MCP+SearXNG surface consistent with the RPC handler.++## Tests++Each provider has a sibling `*_tests.rs` (`brave_tests.rs`, `exa_tests.rs`,+etc.) wired in via `#[cfg(test)] mod tests;`. Tests that need a backend use the+shared mock backend described in `AGENTS.md`, not real network calls.diff --git a/crates/openhuman-core/src/search/tools/mod.rs b/crates/openhuman-core/src/search/tools/mod.rsindex ea6f20d3c0..e90588d8d2 100644--- a/crates/openhuman-core/src/search/tools/mod.rs+++ b/crates/openhuman-core/src/search/tools/mod.rs@@ -1,3 +1,9 @@+//! Agent-facing search tool implementations, one module per provider.+//!+//! See `README.md` for the provider -> tool -> transport table and how each+//! family is registered (engine registry, `IntegrationClient`, or a direct+//! RPC handler).+mod brave;mod exa;mod parallel;