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(architecture): add tauri shell architecture guide
Steven Enamakel6b0d99f64ad9
diff --git a/gitbooks/developing/architecture/tauri-shell.md b/gitbooks/developing/architecture/tauri-shell.mdindex 5d77109aa9..a949a413a5 100644--- a/gitbooks/developing/architecture/tauri-shell.md+++ b/gitbooks/developing/architecture/tauri-shell.md@@ -1,45 +1,45 @@---description: >-- The desktop host in crates/openhuman-app/: Tauri v2 and WebView, the IPC- command surface, the embedded core's lifecycle, and the core JSON-RPC bridge.+ The desktop host in crates/openhuman-app/: the Tauri v2 webview, the IPC+ commands, the embedded core's lifecycle and the JSON-RPC bridge.icon: desktop---# Tauri shell-`crates/openhuman-app/` is the desktop host for OpenHuman: Tauri v2 and WebView, IPC commands, window management, and the bridge to the embedded `openhuman-core` Rust runtime over core JSON-RPC. It does **not** duplicate the full domain stack; that lives in `crates/openhuman-core` (library `openhuman_core`; the `openhuman-core` binary is `crates/openhuman-cli/src/main.rs`).+`crates/openhuman-app/` is the desktop host for OpenHuman. It provides the Tauri v2 webview, IPC commands and window management, and bridges to the embedded `openhuman-core` Rust runtime over core JSON-RPC. It does not duplicate the domain stack. That lives in `crates/openhuman-core` (library `openhuman_core`; the `openhuman-core` binary is `crates/openhuman-cli/src/main.rs`).## Responsibilities-1. **Web UI**. Load the Vite build from `app/dist` (or dev server on port 1420).-2. **IPC**. Expose an explicit set of Tauri commands (see [Commands](#tauri-ipc-commands-cratesopenhuman-app)).-3. **Core lifecycle**. Run the core JSON-RPC server as an in-process tokio task (`core_process.rs`) and hand the renderer its URL/bearer via `core_rpc_url` / `core_rpc_token`.-4. **Window + tray**. Desktop window behavior (main, mascot, notch, overlay windows) and system tray (see `lib.rs`).-5. **Session ownership**. Log the user in and keep the current user fresh (`session/`, backed by `openhuman_tinyhumans::session`): exchange the login token, validate the JWT against `GET /auth/me`, cache `/auth/me`, and hand the resulting credential to the core with `auth.set_credential`. The core never talks to the backend's auth endpoints itself.+1. Web UI. Load the Vite build from `app/dist` (or dev server on port 1420).+2. IPC. Expose an explicit set of Tauri commands (see [Tauri IPC commands](#tauri-ipc-commands-cratesopenhuman-app)).+3. Core lifecycle. Run the core JSON-RPC server as an in-process tokio task (`core_process.rs`) and hand the renderer its URL/bearer via `core_rpc_url` / `core_rpc_token`.+4. Window and tray. Desktop window behavior (main, mascot, notch, overlay windows) and system tray (see `lib.rs`).+5. Session ownership. Log the user in and keep the current user fresh (`session/`, backed by `openhuman_tinyhumans::session`): exchange the login token, validate the JWT against `GET /auth/me`, cache `/auth/me`, and hand the resulting credential to the core with `auth.set_credential`. The core never talks to the backend's auth endpoints itself.## Core process model-`app/package.json` `core:stage` is intentionally a no-op kept for script compatibility. The desktop app links the core in-process, so local builds no longer need a staged `openhuman-core-*` sidecar under `crates/openhuman-app/binaries/`.+The desktop app links the core in-process, so local builds need no staged `openhuman-core-*` sidecar. The `core:stage` script in `app/package.json` is a no-op kept for script compatibility.## Stuck process recovery-Normal app quit runs teardown from `RunEvent::ExitRequested`: long-lived scanner tasks stop, the embedded core's cancellation token is triggered, and the final process sweep sends `SIGTERM` to direct children before escalating holdouts with `SIGKILL` after a short grace period. Sweep summaries are logged as `[app] sweep: term=N kill=M total=K`; any nonzero `kill` count is a warning and means a child ignored graceful shutdown.+Normal app quit runs teardown from `RunEvent::ExitRequested`: long-lived scanner tasks stop and the embedded core's cancellation token fires. The final process sweep then sends `SIGTERM` to direct children and, after a short grace period, `SIGKILL` to any holdouts. Sweep summaries are logged as `[app] sweep: term=N kill=M total=K`; any nonzero `kill` count is a warning and means a child ignored graceful shutdown.On macOS, hard exits (Force Quit, `SIGKILL`, renderer crash) can skip normal teardown. The next launch runs startup recovery before the app runtime starts: it lists OpenHuman processes whose executable path belongs to the launching `.app/Contents`, skips the current process, sends `SIGTERM`, waits briefly, then `SIGKILL`s stragglers that still match the same pid+command. Logs use the `[startup-recovery]` prefix.-Startup recovery skips when `OPENHUMAN_CORE_REUSE_EXISTING=1` is set so manual CLI-core reuse still works. The Tauri command `process_diagnostics_list_owned` returns the currently owned process list; the macOS implementation is bundle-scoped, Linux/Windows currently return empty.+Startup recovery skips when `OPENHUMAN_CORE_REUSE_EXISTING=1` is set so manual CLI-core reuse still works. The Tauri command `process_diagnostics_list_owned` returns the currently owned process list; the macOS implementation is bundle-scoped, and Linux and Windows return an empty list.## Tauri shell architecture (`crates/openhuman-app/`)### Overview-The **`crates/openhuman-app`** crate (Cargo package **`openhuman-app`**, lib **`openhuman`**, binary **`OpenHuman`**) is a **desktop-only** host. It embeds the React UI, registers plugins (deep link, opener, OS, notifications, autostart, updater), manages the main window and tray, and runs the core JSON-RPC server **in-process**.+The `crates/openhuman-app` crate (Cargo package `openhuman-app`, lib `openhuman`, binary `OpenHuman`) is a desktop-only host. It embeds the React UI, registers plugins (deep link, opener, OS, notifications, autostart, updater), manages the main window and tray, and runs the core JSON-RPC server in-process.Non-desktop targets fail at compile time (`compile_error!` in `lib.rs`).-### Directory layout (actual)+### Directory layout-`crates/openhuman-app/src/` is a flat set of modules (no `commands/` or `utils/` subtree). Key modules:+`crates/openhuman-app/src/` is a flat set of modules, with no `commands/` or `utils/` subtree. The key modules:```textcrates/openhuman-app/src/@@ -51,12 +51,12 @@ crates/openhuman-app/src/│ # core at a URL, or one this app provisions in a container /│ # over SSH / both (tinybox). types · store · ops · registry ·│ # commands-├── imessage_scanner/ # macOS-only: reads ~/Library/Messages/chat.db directly (never used CDP)+├── imessage_scanner/ # macOS-only: reads ~/Library/Messages/chat.db directly├── mascot_native_window.rs / notch_window.rs / window_state.rs├── dictation_hotkeys.rs / ptt_hotkeys.rs / ptt_overlay.rs├── native_notifications/├── artifact_commands.rs # Artifact export (copy into Downloads)-├── directory_picker.rs # Native folder picker for the folder memory source (#5831)+├── directory_picker.rs # Native folder picker for the folder memory source├── external_navigation.rs # Keeps the main webview from navigating off-app; hands remote links to the OS browser├── workspace_paths.rs # Safe workspace-relative file open/reveal/preview├── app_update.rs # Updater support (commands live in lib.rs)@@ -70,14 +70,7 @@ crates/openhuman-app/src/└── stderr_panic_hook.rs / reset_reboot_schedule.rs```-This listing was rewritten against the real tree after #5478 / #5456. Gone with-the move off Chromium: `cdp/`, the `cef_*` preflight modules, `webview_accounts/`,-every `*_scanner/` but `imessage_scanner/`, the `meet_*` call window,-`fake_camera/` and `companion_commands.rs`. `webview_apis/` went later: it was-the WS bridge those scanners called, and once they were gone its router-dispatched nothing while still binding a loopback listener at boot.--There is **no** `src-tauri/src/services/session_service.rs` in this tree; session semantics are handled in the web layer + backend + core as applicable.+There is no `src-tauri/src/services/session_service.rs` in this tree. Session handling lives in `session/` (see [Session](#session-session)), the web layer, the backend and the core.### Data flow: UI → core@@ -88,54 +81,54 @@ React (fetch)→ embedded openhuman core server (tokio task in this process)```-The renderer talks to the local core **directly over HTTP**: `app/src/services/coreRpcClient.ts` invokes `core_rpc_url` / `core_rpc_token` once, then issues plain `fetch()` calls. The `relay_http_rpc` Tauri command is a host-side fallback used only when the RPC URL is **not** a trustworthy origin for the secure `tauri://localhost` webview (e.g. a self-hosted runtime on a LAN IP, blocked as mixed content, #3865). In that case the Rust host delegates to `openhuman_rpc::post_json_rpc` from the shared `crates/openhuman-rpc` crate (feature `http-client`): 30 s timeout, redirects disabled when a bearer is present, status + body mirrored back verbatim as `HttpRpcResponse`. The shell adds only the gateway transport guard (`validate_remote_transport`, feature `gateways`) before delegating.+The renderer talks to the local core directly over HTTP: `app/src/services/coreRpcClient.ts` invokes `core_rpc_url` / `core_rpc_token` once, then issues plain `fetch()` calls. The `relay_http_rpc` Tauri command is a host-side fallback used only when the RPC URL is not a trustworthy origin for the secure `tauri://localhost` webview (for example a self-hosted runtime on a LAN IP, blocked as mixed content). In that case the Rust host delegates to `openhuman_rpc::post_json_rpc` from the shared `crates/openhuman-rpc` crate (feature `http-client`): 30 s timeout, redirects disabled when a bearer is present, status + body mirrored back verbatim as `HttpRpcResponse`. The shell adds only the gateway transport guard (`validate_remote_transport`, feature `gateways`) before delegating.`CoreProcessHandle` in `core_process.rs` owns the embedded server task (started via `openhuman_rpc::server::run_server_embedded_with_ready` with a per-launch random bearer token) and handles stale-listener/port-conflict recovery.### Window and tray behavior- The shell creates a tray icon at startup (`RunEvent::Ready`) and wires actions to open the main window or quit. Tray setup is skipped on Linux packaged runs (GTK panic).-- Hide-to-tray is implemented in the `RunEvent::WindowEvent { CloseRequested }` handlers in `lib.rs`, not as IPC commands: macOS hides the whole app (`AppHandle::hide()`, #2049), Windows hides the top-level `Chrome_WidgetWin_1` frame via `EnumWindows` + `SW_HIDE` (#1607).+- Hide-to-tray is implemented in the `RunEvent::WindowEvent { CloseRequested }` handlers in `lib.rs`, not as IPC commands: macOS hides the whole app (`AppHandle::hide()`), Windows hides the top-level `Chrome_WidgetWin_1` frame via `EnumWindows` and `SW_HIDE`.- On macOS `RunEvent::Reopen` (Dock click) restores and focuses the main window.### Bundled resources-`tauri.conf.json` bundles **`../../crates/openhuman-core/src/agent/prompts`** so the core prompt markdown ships with the app.+`tauri.conf.json` bundles `../../crates/openhuman-core/src/agent/prompts` so the core prompt markdown ships with the app.### Related-- IPC surface: see the [Commands](#tauri-ipc-commands-cratesopenhuman-app) section below-- HTTP bridge: see the [Core bridge & helpers](#core-bridge--helpers-cratesopenhuman-app) section below+- IPC surface: see [Tauri IPC commands](#tauri-ipc-commands-cratesopenhuman-app) below+- HTTP bridge: see [Core bridge and helpers](#core-bridge-and-helpers-cratesopenhuman-app) below- Rust domains and runtime: `crates/openhuman-core/src/`, `crates/openhuman-core/src/core/`- Shared RPC contracts + HTTP client: `crates/openhuman-rpc/` (also used by `crates/openhuman-tui` for envelope decoding)## Tauri IPC commands (`crates/openhuman-app`)-All commands are registered in **`crates/openhuman-app/src/lib.rs`** inside `tauri::generate_handler![...]`: that list is the authoritative reference. The major families:+All commands are registered in `crates/openhuman-app/src/lib.rs` inside `tauri::generate_handler![...]`. That list is the reference. The major families:-### Core RPC & diagnostics+### Core RPC and diagnostics| Command | Purpose || -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |-| `core_rpc_url` | Return the **active gateway's** JSON-RPC URL: the embedded core's `http://127.0.0.1:<port>/rpc` unless another gateway is active |+| `core_rpc_url` | Return the active gateway's JSON-RPC URL: the embedded core's `http://127.0.0.1:<port>/rpc` unless another gateway is active || `core_rpc_token` | Return the active gateway's bearer. Paired with `core_rpc_url`: a token minted for the embedded core is meaningless to a core in a container || `core_rpc_endpoint` | Return the URL and bearer together from one resolved snapshot, so a gateway switch between two separate calls cannot pair one gateway's URL with another's token |-| `relay_http_rpc` | Host-side JSON-RPC POST (`{ url, token?, body }` → `{ status, body }`) for self-hosted runtimes the webview cannot fetch (mixed content, #3865) |+| `relay_http_rpc` | Host-side JSON-RPC POST (`{ url, token?, body }` → `{ status, body }`) for self-hosted runtimes the webview cannot fetch (mixed content) || `overlay_parent_rpc_url` | RPC URL inherited from a parent process (overlay windows), from `OPENHUMAN_CORE_RPC_URL` || `process_diagnostics_list_owned` | List OpenHuman processes owned by this app bundle (macOS; empty elsewhere) |-Use **`app/src/services/coreRpcClient.ts`** (`callCoreRpc`) from the frontend.+Use `app/src/services/coreRpcClient.ts` (`callCoreRpc`) from the frontend.### Gateways: running the core somewhere else-A **gateway** is one way of reaching an OpenHuman core. Four exist: the core inside this+A gateway is one way of reaching an OpenHuman core. Four exist: the core inside thisprocess, a core somebody else is running at a URL, and two this app provisions itself: ina Docker container, or on a machine reached over SSH. The last two are the same code:[tinybox](https://github.com/tinyhumansai/tinybox) models *reach* (`local` / `ssh`) and*confinement* (`passthrough` / `docker`) as independent axes, so "a container on the buildserver" is those two choices made separately rather than a third case with code of its own.-**The seam is one line.** A gateway resolves to a URL and a bearer, and `core_rpc_url` /+The seam is one line. A gateway resolves to a URL and a bearer, and `core_rpc_url` /`core_rpc_token` answer from the active one. Every RPC call site in the renderer thereforefollows along unchanged: there is no per-gateway transport in the frontend, and`services/transport/` (the iOS `ConnectionProfile` path) is not involved.@@ -155,9 +148,9 @@ that is easy to omit and impossible to notice missing: publishing puts the port| `gateway_active` | Which gateway is active || `gateway_status` | `inactive` / `activating{step}` / `connected{endpoint}` / `failed{reason}` |-Records live shell-side in `gateways.json`, **not** renderer `localStorage`: an SSH+Records live shell-side in `gateways.json`, not renderer `localStorage`. An SSHidentity path and a remote bearer are materially more sensitive than a window position, and-the renderer's own notes on the cloud token (audit U3, `utils/configPersistence.ts`) already+the renderer's own notes on the cloud token (`utils/configPersistence.ts`) alreadysay a renderer XSS can read anything kept there. The frontend holds a gateway *id*.Shell-internal callers (`imessage_scanner`, `local_data_reset`) deliberately@@ -169,10 +162,10 @@ Gated by the shell-local `gateways` Cargo feature (default on). That gate is unrthe feature-forwarding rules in `AGENTS.md`, which govern which `openhuman_core` gates theshell forwards; nothing here belongs in `scripts/ci/product-features.txt`.-Frontend: **`app/src/services/gatewayService.ts`**, surfaced in Settings → Core connection+Frontend: `app/src/services/gatewayService.ts`, surfaced in Settings → Core connection(`components/settings/panels/core/GatewaySection.tsx`).-### Core & app lifecycle+### Core and app lifecycle| Command | Purpose || ------------------------------------------------- | --------------------------------------------- |@@ -207,7 +200,7 @@ A JWT accepted while the backend is unreachable (live `exp`, subject claim) is i| Command | Purpose || ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- || `register_dictation_hotkey` / `unregister_dictation_hotkey` | Global dictation shortcuts (`dictation_hotkeys.rs`) |-| `register_ptt_hotkey` / `unregister_ptt_hotkey` / `show_ptt_overlay` | Push-to-talk: see the [PTT section](#push-to-talk-ptt-hotkey--overlay) below |+| `register_ptt_hotkey` / `unregister_ptt_hotkey` / `show_ptt_overlay` | Push-to-talk: see the [PTT section](#push-to-talk-ptt-hotkey-and-overlay) below |### Notifications@@ -222,14 +215,14 @@ A JWT accepted while the backend is unreachable (live `exp`, subject claim) is i| `mascot_window_show` / `mascot_window_hide` | Toggle the mascot native window || `notch_window_show` / `notch_window_hide` | Toggle the notch window |-Hide-to-tray / reopen behavior is **not** an IPC command: it lives in the `RunEvent` handlers in `lib.rs` (see [Window and tray behavior](#window-and-tray-behavior)).+Hide-to-tray / reopen behavior is not an IPC command: it lives in the `RunEvent` handlers in `lib.rs` (see [Window and tray behavior](#window-and-tray-behavior)).### Artifacts, logs, MCP, OAuth| Command | Purpose || ---------------------------------------------------------------- | --------------------------------------------------------------------------------------- |-| `download_artifact_to_downloads` | Copy an artifact straight to the Downloads folder (`artifact_commands.rs`); the Save-As dialog this used to sit behind was dropped with the shell's `rfd` dependency |-| `pick_directory_via_dialog` | Native OS folder picker for the folder memory source, returning an absolute path a `webkitdirectory` input cannot report (`directory_picker.rs`, #5831) |+| `download_artifact_to_downloads` | Copy an artifact straight to the Downloads folder (`artifact_commands.rs`); there is no Save-As dialog |+| `pick_directory_via_dialog` | Native OS folder picker for the folder memory source, returning an absolute path a `webkitdirectory` input cannot report (`directory_picker.rs`) || `reveal_logs_folder` / `logs_folder_path` | Open / return the file-logging folder (`file_logging.rs`) || `mcp_resolve_binary_path` / `mcp_open_client_config` | MCP client helpers (`mcp_commands.rs`) || `start_loopback_oauth_listener` / `stop_loopback_oauth_listener` | Localhost OAuth redirect listener (`loopback_oauth.rs`) |@@ -237,7 +230,7 @@ Hide-to-tray / reopen behavior is **not** an IPC command: it lives in the `RunEv### Workspace file links-From **`workspace_paths.rs`** (closes `#1402`). These commands accept workspace-relative paths only. The shell resolves each path against the active OpenHuman workspace, canonicalizes the target, and rejects traversal, absolute paths, URI-like prefixes, and symlink escapes before opening or reading anything.+From `workspace_paths.rs` . These commands accept workspace-relative paths only. The shell resolves each path against the active OpenHuman workspace, canonicalizes the target, and rejects traversal, absolute paths, URI-like prefixes, and symlink escapes before opening or reading anything.| Command | Purpose || --------------------------------- | ---------------------------------------------------------------------- |@@ -245,9 +238,9 @@ From **`workspace_paths.rs`** (closes `#1402`). These commands accept workspace-| `reveal_workspace_path` | Reveal an existing workspace file or directory in the OS file manager. || `preview_workspace_text` | Read a capped UTF-8 text preview from an existing workspace file. |-### Push-to-talk (PTT) hotkey + overlay+### Push-to-talk (PTT) hotkey and overlay-Registered in **`lib.rs`** (`ptt_hotkeys.rs` + `ptt_overlay.rs`). These commands manage the global push-to-talk shortcut and the floating overlay window.+Registered in `lib.rs` (`ptt_hotkeys.rs` + `ptt_overlay.rs`). These commands manage the global push-to-talk shortcut and the floating overlay window.| Command | Signature | Purpose || ----------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |@@ -255,21 +248,21 @@ Registered in **`lib.rs`** (`ptt_hotkeys.rs` + `ptt_overlay.rs`). These commands| `unregister_ptt_hotkey` | `() -> Result<(), String>` | Unregister the current PTT hotkey and tear down the overlay window. || `show_ptt_overlay` | `(active: bool, session_id: u64) -> ()` | Show (`active: true`) or hide (`active: false`) the floating PTT overlay window. The window is focus-stealing-free (`focus: false`). Called by `PttHotkeyManager.tsx` via `app/src/utils/tauriCommands/ptt.ts`. |-**Event flow:** `register_ptt_hotkey` wires the OS hotkey to fire `ptt://start` / `ptt://stop` Tauri events that `PttHotkeyManager.tsx` subscribes to via `@tauri-apps/api/event`. The manager forwards them into the `pttService` state machine which drives the audio capture → transcribe → chat-send pipeline.+Event flow: `register_ptt_hotkey` wires the OS hotkey to fire `ptt://start` / `ptt://stop` Tauri events that `PttHotkeyManager.tsx` subscribes to via `@tauri-apps/api/event`. The manager forwards them into the `pttService` state machine which drives the audio capture → transcribe → chat-send pipeline.-**Conflict detection:** `register_ptt_hotkey` checks for overlap with the active dictation shortcuts before registering. If a conflict is detected it returns `"ConflictsWithDictation(<shortcut>)"` without registering anything, and the settings panel surfaces this as `pttSettings.errorConflictsWithDictation`.+Conflict detection: `register_ptt_hotkey` checks for overlap with the active dictation shortcuts before registering. If a conflict is detected it returns `"ConflictsWithDictation(<shortcut>)"` without registering anything, and the settings panel surfaces this as `pttSettings.errorConflictsWithDictation`.### Synthetic input main-thread executor (native registry, not `invoke`)-Registered in **`lib.rs`** at startup under the event-bus native-request method+Registered in `lib.rs` at startup under the event-bus native-request method`computer.input_on_main_thread` (`INPUT_ON_MAIN_THREAD_METHOD`, defined in-`openhuman_core::tools::computer::main_thread`). This is **not** a+`openhuman_core::tools::computer::main_thread`). This is not a`@tauri-apps/api` `invoke` command. It is an in-process native request the-**core** dispatches to the **shell** so synthetic input runs on the real app+core dispatches to the shell so synthetic input runs on the real appmain thread.Why: enigo's macOS keyboard-layout lookup (`TSMGetInputSourceProperty`) traps-(`_dispatch_assert_queue_fail` / `EXC_BREAKPOINT`) and crashes the desktop host when+(`_dispatch_assert_queue_fail`, `EXC_BREAKPOINT`) and crashes the desktop host whencalled off the main thread. The `mouse` / `keyboard` tools therefore never callenigo on their tokio worker; they build a closure and dispatch it here, wherethe shell runs it via `AppHandle::run_on_main_thread`.@@ -281,9 +274,9 @@ the shell runs it via `AppHandle::run_on_main_thread`.| Response | `Result<String, String>`: `Ok(message)` on success, `Err(reason)` on failure || Availability | Desktop only. Headless / CLI builds register no executor; the core call then returns a clean `Err`. |-### Removed / not present+### Names that do not exist-The following **do not** exist in the current `generate_handler!` list: `greet`, `core_rpc_relay` (superseded by direct `fetch` + `relay_http_rpc`), `ai_get_config` / `ai_refresh_config` / `write_ai_config_file`, `show_window` / `hide_window` / `toggle_window` / `minimize_window` / `maximize_window` / `close_window`, the `openhuman_*` daemon/service helpers, `exchange_token`, `get_auth_state`, `socket_connect`, `start_telegram_login`. Authentication and sockets are handled in the **React** app and **core** process, not via these IPC names.+The following do not exist in the current `generate_handler!` list: `greet`, `core_rpc_relay` (replaced by direct `fetch` and `relay_http_rpc`), `ai_get_config` / `ai_refresh_config` / `write_ai_config_file`, `show_window` / `hide_window` / `toggle_window` / `minimize_window` / `maximize_window` / `close_window`, the `openhuman_*` daemon/service helpers, `exchange_token`, `get_auth_state`, `socket_connect`, `start_telegram_login`. Authentication and sockets are handled in the React app and the core process, not through these IPC names.### Example: core RPC@@ -300,20 +293,20 @@ const result = await callCoreRpc({----_See `crates/openhuman-app/src/lib.rs` (`generate_handler!`) for the authoritative list._+See `crates/openhuman-app/src/lib.rs` (`generate_handler!`) for the full list.-## Core bridge & helpers (`crates/openhuman-app`)+## Core bridge and helpers (`crates/openhuman-app`)-The Tauri crate **does not** embed a duplicate Socket.io server or Telegram client; it focuses on **in-process core lifecycle** and the thin HTTP/auth glue around the core's JSON-RPC surface.+The Tauri crate does not embed a duplicate Socket.io server or Telegram client; it focuses on in-process core lifecycle and the thin HTTP/auth glue around the core's JSON-RPC surface.### `CoreProcessHandle` (`core_process.rs`)-- Runs the core's HTTP/JSON-RPC server as a **tokio task inside the Tauri host** via `openhuman_rpc::server::run_server_embedded_with_ready`: no sidecar binary.+- Runs the core's HTTP/JSON-RPC server as a tokio task inside the Tauri host via `openhuman_rpc::server::run_server_embedded_with_ready`: no sidecar binary.- Generates a per-launch 256-bit hex bearer token (`generate_rpc_token`) and hands it to the embedded server; the renderer reads it via the `core_rpc_token` command.-- Stale-listener policy (#1130): if the core port is already occupied, probes whether the listener is an old OpenHuman core (terminate + respawn) or something foreign (surface the conflict). `OPENHUMAN_CORE_REUSE_EXISTING=1` opts back into attach-to-existing for debugging.+- Stale-listener policy: if the core port is already occupied, probes whether the listener is an old OpenHuman core (terminate + respawn) or something foreign (surface the conflict). `OPENHUMAN_CORE_REUSE_EXISTING=1` opts back into attach-to-existing for debugging.- Managed as Tauri state in `lib.rs` (`app.manage(core_handle)`).### `core_rpc` (`core_rpc.rs`)- Shared auth helpers for host-side calls to the local core (URL from `OPENHUMAN_CORE_RPC_URL` or the default port; bearer from `core_process::current_rpc_token`).-- **`relay_http_rpc`** Tauri command: a thin wrapper over `openhuman_rpc::post_json_rpc` (`crates/openhuman-rpc`, feature `http-client`) for self-hosted runtimes on non-trustworthy origins; `bearer_header`, `redact_url_for_log` and `HttpRpcResponse` are re-exported from that crate (see [Core RPC & diagnostics](#core-rpc--diagnostics)).+- `relay_http_rpc` Tauri command: a thin wrapper over `openhuman_rpc::post_json_rpc` (`crates/openhuman-rpc`, feature `http-client`) for self-hosted runtimes on non-trustworthy origins; `bearer_header`, `redact_url_for_log` and `HttpRpcResponse` are re-exported from that crate (see [Core RPC and diagnostics](#core-rpc-and-diagnostics)).