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(integrations): document trigger and companion features
Steven Enamakel1abbb028ed38
diff --git a/gitbooks/features/integrations/triggers.md b/gitbooks/features/integrations/triggers.mdindex 023cfa7081..d85a640d9b 100644--- a/gitbooks/features/integrations/triggers.md+++ b/gitbooks/features/integrations/triggers.md@@ -1,136 +1,124 @@---description: >-- Live events from connected integrations (a new Gmail message, a Notion edit,- a Stripe charge) arrive as triggers, get classified by a triage agent, and- can fire agent actions automatically.+ Live events from connected apps (a new Gmail message, a Notion edit, a Stripe+ charge) arrive as triggers, get sorted by a triage agent, and can start agent+ actions automatically.icon: bolt---# Triggers-A connected integration is not just a place the agent can read from on demand. It is also a **source of live events**. When someone sends you an email, edits a Notion page, opens a GitHub issue on one of your repos, charges a card on Stripe, or DMs you on Slack, OpenHuman receives that event in near-real-time and can decide whether to do something about it.+A connected integration is more than a place the agent can read from on demand. It is also a source of live events. When someone emails you, edits a Notion page, opens a GitHub issue on your repo, charges a card on Stripe or DMs you on Slack, OpenHuman gets the event within moments and decides whether to act on it.-This page is about that pipeline: how triggers arrive, how they get classified, and how a trigger can turn into a full agent action without you typing a thing.+This page covers how triggers arrive, how they are sorted, and how one can turn into a full agent action without you typing anything.## What a trigger is-A trigger is an external event published by an integration you've connected. Common shapes:+A trigger is an external event published by an integration you have connected. Some examples:-| Integration | Example trigger |-| ------------ | ----------------------------------------------------------------- |-| **Gmail** | `GMAIL_NEW_GMAIL_MESSAGE`, new mail in inbox |-| **Slack** | `SLACK_NEW_MESSAGE`, channel/DM message you were mentioned in |-| **Notion** | `NOTION_PAGE_UPDATED`, a tracked page changed |-| **GitHub** | `GITHUB_ISSUE_OPENED`, `GITHUB_PULL_REQUEST_OPENED` on your repos |-| **Stripe** | `STRIPE_CHARGE_SUCCEEDED`, a successful charge on your account |-| **Calendar** | `GOOGLE_CALENDAR_EVENT_CREATED`, a new event on your calendar |+| Integration | Example trigger |+| ----------- | ----------------------------------------------------------------- |+| Gmail | `GMAIL_NEW_GMAIL_MESSAGE`, new mail in your inbox |+| Slack | `SLACK_NEW_MESSAGE`, a channel or DM message that mentions you |+| Notion | `NOTION_PAGE_UPDATED`, a tracked page changed |+| GitHub | `GITHUB_ISSUE_OPENED`, `GITHUB_PULL_REQUEST_OPENED` on your repos |+| Stripe | `STRIPE_CHARGE_SUCCEEDED`, a successful charge on your account |+| Calendar | `GOOGLE_CALENDAR_EVENT_CREATED`, a new event on your calendar |-The full set comes from the [Composio](https://composio.dev) connector layer that powers [third-party integrations](README.md). When a connection is active, the relevant trigger subscriptions are wired up automatically.+The full set comes from the [Composio](https://composio.dev) connector layer behind [third-party integrations](README.md). When a connection is active, the matching trigger subscriptions are set up for you.### Gmail OAuth scopes-Gmail trigger subscriptions require message-read access on the connected Google account. Fresh OpenHuman Gmail authorizations request `https://www.googleapis.com/auth/gmail.readonly` so `GMAIL_NEW_GMAIL_MESSAGE` can be enabled and the native Gmail sync path can read the new message metadata.+Gmail triggers need message-read access on the connected Google account. New Gmail authorizations request `https://www.googleapis.com/auth/gmail.readonly`, so `GMAIL_NEW_GMAIL_MESSAGE` can be enabled and the native Gmail sync can read new message metadata. If you connected Gmail before this scope was requested, reconnect it from Settings before enabling Gmail triggers.-If an older Gmail connection was created before this scope was requested, reconnect Gmail from Settings before enabling Gmail triggers.--## Where triggers come from, end to end+## How a trigger reaches the agent```text┌────────────────────┐-│ third-party API │ Gmail / Slack / Notion / GitHub / ...+│ third-party API │ Gmail / Slack / Notion / GitHub / ...└─────────┬──────────┘- │ webhook- ▼+ │ webhook+ ▼┌────────────────────┐-│ OpenHuman backend │ HMAC-verifies the webhook, normalises the payload+│ OpenHuman backend │ verifies the webhook signature, cleans up the payload└─────────┬──────────┘- │ Socket.IO event ("composio:trigger")- ▼+ │ Socket.IO event ("composio:trigger")+ ▼┌────────────────────┐-│ Rust core │ publishes DomainEvent::ComposioTriggerReceived-│ (your laptop) │ on the in-process event bus+│ Rust core │ publishes a trigger-received event+│ (your computer) │ on the in-process event bus└─────────┬──────────┘- │- ▼+ │+ ▼┌────────────────────┐-│ Trigger Triage │ classifies: drop / acknowledge / react / escalate+│ Trigger triage │ drop / acknowledge / react / escalate└─────────┬──────────┘- │- ▼+ │+ ▼┌────────────────────┐-│ One of: │-│ - nothing │ ← drop-│ - memory note │ ← acknowledge-│ - Trigger Reactor │ ← react (1-2 tool calls)-│ - Orchestrator │ ← escalate (full multi-step planning)+│ One of: │+│ - nothing │ ← drop+│ - memory note │ ← acknowledge+│ - Trigger reactor │ ← react (1-2 tool calls)+│ - Orchestrator │ ← escalate (full multi-step planning)└────────────────────┘```-The webhook never reaches your machine raw. The backend is what holds the OAuth token and what receives the webhook directly from the third-party. It does HMAC verification, normalises the payload, and forwards it to your Rust core over the existing authenticated socket. Your laptop sees a clean, validated `ComposioTriggerReceived` event on the bus, nothing else.+The raw webhook never reaches your machine. The backend holds the OAuth token and receives the webhook from the third party. It verifies the HMAC signature, cleans up the payload and forwards it to your core over the existing authenticated socket. Your computer only sees a validated event.## The triage step-Before any action runs, every trigger goes through the [`trigger_triage`](https://github.com/tinyhumansai/openhuman/tree/main/crates/openhuman-core/src/agent/registry/agents/trigger_triage) agent. Its only job is to decide what the rest of the system should do.+Before anything runs, the `trigger_triage` agent looks at every trigger. Its only job is to decide what happens next. It picks exactly one of four actions:-It picks exactly one of four actions:+| Action | What happens | When it is used |+| ------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |+| `drop` | Nothing. The trigger is logged and discarded. | Spam, duplicates and noise. This is the default for things you don't care about. |+| `acknowledge` | A short memory note is saved. No agent runs. | Passive notices worth remembering, such as "a new page was created in archive". |+| `react` | The `trigger_reactor` agent runs with one or two tool calls. | A small one-step effect: store a memory entry, post a quick acknowledgement, mark a thread read. |+| `escalate` | The full orchestrator agent takes over and plans. | Anything that needs reasoning or several steps: drafting a reply, updating several Notion pages, deciding how to handle an inbound issue. |-| Action | What happens | When to use |-| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |-| **`drop`** | Nothing. Trigger is silently logged and discarded. | Spam, duplicates, irrelevant noise. The default for things you don't care about. |-| **`acknowledge`** | A short memory note is persisted, no agent runs. | Passive notifications worth remembering ("a new page was created in archive"). |-| **`react`** | The [`trigger_reactor`](https://github.com/tinyhumansai/openhuman/tree/main/crates/openhuman-core/src/agent/registry/agents/trigger_reactor) agent runs with one or two tool calls. | A small, single-step side effect: store a memory entry, post a quick acknowledgement, mark a thread read. |-| **`escalate`** | The full **orchestrator** agent takes over with planning capability. | Anything that needs reasoning, multiple steps, or multiple skills: drafting a reply, updating several Notion pages, deciding how to triage an inbound issue. |+The triage agent has the same memory and workspace context as the rest of the agent. It can tell whether a trigger relates to what you are working on, who is involved, and whether you have asked OpenHuman to act on this kind of thing before.-The triage agent has the same memory and workspace context the rest of the agent has. It can tell whether a trigger is relevant to something you're currently working on, who the people involved are, and whether it's the kind of thing you've asked OpenHuman to act on before.+## When a trigger becomes an agent action-## When a trigger turns into an agent action+This is what separates "OpenHuman has a Gmail integration" from "OpenHuman is on call for your inbox".-This is the part that distinguishes "OpenHuman has a Gmail integration" from "OpenHuman is on call for your inbox":+**React** is the cheap path. The trigger reactor is a narrow specialist with a hard budget of a couple of tool calls. It suits writing a one-line memory note ("saw a new Stripe charge for $84, customer X"), marking a Slack message handled because it is the same automated alert you have already triaged twice this week, or storing a structured record of an event you might look up later.-- **`react`** is the cheap path. The Trigger Reactor is a narrow specialist with a hard budget of a couple of tool calls. It's perfect for: writing a one-line memory note that says "saw a new charge from Stripe for $84, customer X, merchant Y", silently marking a Slack message as handled because it's the same automated alert you've already triaged twice this week, or storing a structured record of an event the user might want to look up later.+**Escalate** is the heavy path. When triage decides a trigger needs real work, it hands the orchestrator a self-contained task description. The orchestrator has your full set of skills, tools and memory. It might:-- **`escalate`** is the heavy path. When the Triage agent decides the trigger needs real work, it hands off to the Orchestrator with a self-contained task description. The orchestrator has access to your full skill surface, tools, and memory. From there it might:- - Draft a reply to an important email and queue it for your approval.- - Pull up the relevant Notion / Linear / Drive context for an inbound issue and write a structured comment.- - Update three connected systems based on a single inbound event ("this customer's plan changed in Stripe, update HubSpot, post in #revenue, and add a note to their Notion file").+- Draft a reply to an important email and queue it for your approval.+- Pull the relevant Notion, Linear or Drive context for an inbound issue and write a structured comment.+- Update three connected systems from one event, such as a customer's plan changing in Stripe, which updates HubSpot, posts in #revenue and adds a note to their Notion file.-In both cases the action runs on your machine, against your configured memory engine, with the same model-routing and tool surface the rest of the agent uses.+Either way, the action runs on your machine, against your configured memory engine, with the same model routing and tools as the rest of the agent.-## Why a triage step at all+## Why triage exists-It's tempting to skip the classifier and just pipe every trigger straight into the orchestrator. That's a bad idea for two reasons:+You could pipe every trigger straight into the orchestrator. That would be a mistake for two reasons.-1. **Most triggers are noise.** A connected Gmail account fires dozens of triggers an hour, the vast majority of which the user doesn't care about. Running the orchestrator on each would burn budget and produce a constant stream of background activity.-2. **Different triggers deserve different ceilings.** An automated Stripe receipt and a personal Slack DM should not cost the same number of tokens to handle. Triage lets the cheap path be cheap and reserves the orchestrator for things that earn it.+1. Most triggers are noise. A connected Gmail account fires dozens of triggers an hour, and you care about few of them. Running the orchestrator on each would burn budget and create a constant stream of background activity.+2. Triggers deserve different budgets. An automated Stripe receipt and a personal Slack DM should not cost the same number of tokens. Triage keeps the cheap path cheap and saves the orchestrator for events that earn it.-Triage runs on the fast model tier (see [Automatic Model Routing](../model-routing/README.md)) so the classification itself is sub-second.+Triage runs on the fast model tier (see [Model routing](../model-routing/README.md)), so classification takes well under a second.## Configuration and opt-out-- **On by default.** Once an integration is connected, its triggers feed into the pipeline automatically.-- **Opt-out.** The triage path is gated on the `OPENHUMAN_TRIGGER_TRIAGE_DISABLED` environment variable. Setting it to `1` / `true` / `yes` turns off agent classification and falls back to passive logging only. The integration itself stays connected; only the auto-action behaviour is suppressed.-- **Per-trigger settings.** Trigger settings (which integrations and event types should be evaluated) are managed under **Settings**; the underlying RPC methods are `update_composio_trigger_settings` / `get_composio_trigger_settings`.-- **Audit log.** Every trigger, regardless of decision, is written to the trigger history so you can see what arrived, what the classifier decided, and what (if anything) ran. Decisions and escalations are also published as `TriggerEvaluated` / `TriggerEscalated` events on the in-process bus, which means anything inside the core can subscribe to them.+- **On by default.** Once an integration is connected, its triggers feed the pipeline automatically.+- **Opt out.** Set the `OPENHUMAN_TRIGGER_TRIAGE_DISABLED` environment variable to `1`, `true` or `yes`. Agent classification turns off and triggers are only logged. The integration stays connected. Only the automatic actions stop.+- **Per-trigger settings.** Choose which integrations and event types are evaluated under **Settings**. The RPC methods are `get_composio_trigger_settings` and `update_composio_trigger_settings`.+- **Audit log.** Every trigger is written to the trigger history, whatever the decision, so you can see what arrived, what triage decided and what ran. Decisions and escalations are also published as `TriggerEvaluated` and `TriggerEscalated` events on the in-process bus, so anything inside the core can subscribe.## Privacy boundary-Triggers follow the same boundary as the rest of the product (see [Privacy & Security](../privacy-and-security.md)):--- The third-party token lives on the backend, never on your laptop.-- The webhook is HMAC-verified by the backend before it reaches your machine.-- The trigger payload is processed by your local core; classification and any reaction run on your machine, against your configured memory engine.-- Memory notes written by `acknowledge` / `react` / `escalate` paths are stored as learnings in your memory engine when memory is on.--## Implementation pointers (for developers)+Triggers follow the same boundary as the rest of the product (see [Privacy and security](../privacy-and-security.md)):-- Triage agent: `crates/openhuman-core/src/agent/registry/agents/trigger_triage/`-- Reactor agent: `crates/openhuman-core/src/agent/registry/agents/trigger_reactor/`-- Composio bus subscriber: `crates/openhuman-core/src/integrations/composio/bus.rs` (`ComposioTriggerSubscriber`)-- Trigger history persistence: `crates/openhuman-core/src/integrations/composio/trigger_history.rs`-- Domain events: `DomainEvent::ComposioTriggerReceived`, `DomainEvent::TriggerEscalated` in `crates/openhuman-core/src/core/events.rs`-- Trigger settings RPC: `update_composio_trigger_settings` / `get_composio_trigger_settings` in `crates/openhuman-core/src/config/`+- The third-party token lives on the backend and never on your computer.+- The backend verifies the webhook signature before anything reaches your machine.+- Your local core processes the payload. Classification and any reaction run on your machine, against your configured memory engine.+- Notes written by the acknowledge, react and escalate paths are stored as learnings in your memory engine when memory is on.## See also-- [Third-party Integrations](README.md), the catalog of services triggers come from.-- [Memory sources](../memory.md), the polling counterpart, periodic ingest of source data into memory.+- [Third-party integrations](README.md): the catalog of services triggers come from.+- [Memory sources](../memory.md): the polling counterpart, which pulls source data into memory on a schedule.diff --git a/gitbooks/features/ios-companion.md b/gitbooks/features/ios-companion.mdindex 080c899831..94af8ba2de 100644--- a/gitbooks/features/ios-companion.md+++ b/gitbooks/features/ios-companion.md@@ -1,33 +1,29 @@---description: >-- Pair an iOS companion app to your desktop OpenHuman over an end-to-end- encrypted tunnel, scanned from a QR code.+ Pair an iOS companion app with your desktop OpenHuman over an end-to-end+ encrypted tunnel, set up by scanning a QR code.icon: mobile-screen----# iOS Companion+# iOS companion-The iOS Companion lets you reach your desktop OpenHuman from your phone: you scan a QR code shown on the desktop, the two devices agree on a shared key, and from then on the phone talks to the desktop core over an encrypted channel.+The iOS companion lets you reach your desktop OpenHuman from your phone. You scan a QR code shown on the desktop, the two devices agree on a shared key, and from then on the phone talks to the desktop core over an encrypted channel.{% hint style="warning" %}-**Experimental / non-shipping.** The iOS client is in-progress and is **not** part of the shipped desktop product. APIs, wire formats, and the pairing flow can change without notice, and an upgrade may force you to re-pair. Treat everything below as a developer preview.+Experimental and not shipping. The iOS client is in progress and is not part of the shipped desktop product. APIs, wire formats and the pairing flow can change without notice, and an upgrade may force you to pair again. Treat everything below as a developer preview.{% endhint %}-The desktop core is always the source of truth. The phone is a thin client. It does not run its own agent, it relays requests to the core and renders the results.+The desktop core is always the source of truth. The phone is a thin client. It does not run its own agent. It relays requests to the core and shows the results.-What is experimental here is the **client**, not the core. The core's pairing domain is complete and wired into the controller registry (`crates/openhuman-core/src/security/devices/`): it registers the channel, derives the keys, persists the device, and tracks peer status. Earlier contributor notes described pairing as blocked on an unmerged backend change; that is no longer the case. Two real gaps remain, both noted below: there is no desktop screen for managing paired devices, and revocation is local-side only.+The experimental part is the client, not the core. The core's pairing code is complete: it registers the channel, derives the keys, saves the device and tracks whether the peer is online. Two gaps remain. There is no desktop screen for managing paired devices, and revoking a device only takes effect locally.------## What it is--Pairing is brokered by the Rust `devices` domain in the core. The core registers a pairing channel with the tinyhumans backend's `tunnel:*` Socket.IO relay, generates a fresh X25519 keypair, and renders a QR code. The phone scans it, generates **its own** X25519 keypair, and connects back over the same relay. The backend is a **blind forwarder**: it relays opaque frames and never sees plaintext.+## How pairing works-Pairing and revocation are core RPCs, not a desktop screen. The old **Settings → Devices** page was removed and its slug now redirects to **Settings → Account** (`app/src/components/settings/settingsRouteRegistry.ts`), and nothing in the desktop frontend calls the `devices_*` methods. Listing and revoking a paired device means calling the core directly for now.+The core's `devices` domain handles pairing. The core registers a pairing channel with the backend's `tunnel:*` Socket.IO relay, generates a fresh X25519 keypair and shows a QR code. The phone scans it, generates its own X25519 keypair and connects back over the same relay. The backend only forwards frames. It relays opaque data and never sees plaintext.----+Pairing and revocation are core RPCs, not a desktop screen. The old **Settings > Devices** page was removed, and its address now redirects to **Settings > Account**. Nothing in the desktop frontend calls the `devices_*` methods yet, so listing or revoking a paired device means calling the core directly.-## Pairing via QR code+## Pairing with a QR code```textDesktop core Backend relay iOS app@@ -52,50 +48,50 @@ Desktop core Backend relay iOS app| devices_list now returns it | |```-The QR payload (carried as an `openhuman://pair?...` deep link) contains the channel id (`cid`), a single-use pairing token (`pt`), the core's public key (`cpk`), an optional LAN URL (`rpc`), and an expiry (`exp`). The pairing token is single-use and the QR is rejected client-side once `exp` has passed. The core does not choose that expiry: it stores and republishes whatever `pairingExpiresAt` the backend returns in its `tunnel:register` ACK, so the real TTL is the backend's.+The QR code carries an `openhuman://pair?...` deep link with these fields:----+- `cid`: the channel id.+- `pt`: a single-use pairing token.+- `cpk`: the core's public key.+- `rpc`: an optional LAN URL.+- `exp`: the expiry.-## The end-to-end tunnel+The phone rejects the QR once `exp` has passed. The core does not choose the expiry. It stores and republishes whatever `pairingExpiresAt` the backend returns when the channel is registered, so the real lifetime is the backend's.-Confidentiality and integrity live entirely on the two endpoints. The exact primitives, from `crates/openhuman-core/src/security/devices/crypto.rs`:+## The end-to-end tunnel-- **Key agreement:** X25519 Diffie-Hellman. Each side has a long-term static keypair (the core's is in the QR; the device's is minted at scan time) plus an ephemeral keypair minted per session for forward secrecy.-- **Session-key derivation:** HKDF-SHA256 over `ikm = static_dh || eph_dh`, salted with `client_eph_pub || server_eph_pub`. Two **directional** 32-byte subkeys are expanded with distinct info tags (`openhuman-tunnel/v1/c2s` and `openhuman-tunnel/v1/s2c`), so a frame one side seals can never decrypt under its own opener (closes the cross-direction reflection attack class).-- **Frame cipher:** XChaCha20-Poly1305 (AEAD, 192-bit nonce). Wire format is `version(0x02) || nonce(24) || ciphertext+tag`, with a random nonce per frame.-- **Replay protection:** a sliding window over the last 128 nonces seen per opener.+Confidentiality and integrity are handled entirely by the two endpoints. The primitives are:-Static DH authenticates the peer via the QR-code provenance; ephemeral DH means a later static-key leak cannot decrypt past traffic. The legacy single-key `version=0x01` frame shape is rejected with an explicit "re-pair required" error, so peers must re-pair after an upgrade. Outbound frames are capped at 64 KB.+- **Key agreement:** X25519 Diffie-Hellman. Each side has a long-term static keypair (the core's is in the QR code, and the device's is created at scan time) plus an ephemeral keypair for each session, for forward secrecy.+- **Session keys:** HKDF-SHA256 over the static and ephemeral shared secrets, salted with both ephemeral public keys. It expands two directional 32-byte keys with different labels (`openhuman-tunnel/v1/c2s` and `openhuman-tunnel/v1/s2c`). A frame one side seals can therefore never be opened by the same side, which blocks reflection attacks.+- **Frame cipher:** XChaCha20-Poly1305 with a 192-bit nonce. A frame is `version(0x02) || nonce(24) || ciphertext+tag`, with a random nonce each time.+- **Replay protection:** a sliding window over the last 128 nonces seen by each receiver.----+The static exchange authenticates the peer through the QR code. The ephemeral exchange means a later leak of a static key cannot decrypt past traffic. The old single-key `version=0x01` frame is rejected with a "re-pair required" error, so peers must pair again after an upgrade. Outbound frames are capped at 64 KB.## Transport strategies-The phone may reach the core three ways. `TransportManager` (`app/src/services/transport/`) picks one from the saved `ConnectionProfile`; for a paired device it **races LAN against the tunnel** (2 s LAN timeout) and uses whichever answers `openhuman.ping` first.--| Strategy | Class | When it's used | Trade-offs |-| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |-| **LAN HTTP** (`LanHttpTransport`) | Direct HTTP to the core's LAN `rpc_url` | Phone and desktop on the same network | Fastest, lowest latency. Requires same LAN; not encrypted by this layer (relies on local network trust). |-| **Tunnel** (`TunnelTransport`) | E2E encrypted frames over the backend Socket.IO relay | Anywhere with internet; default fallback | Works across networks; X25519 + XChaCha20-Poly1305 end to end. Higher latency (relayed); depends on backend availability. |-| **Cloud HTTP** (`CloudHttpTransport`) | HTTP to a cloud-hosted core endpoint | Profile `kind: "cloud"`, when LAN and tunnel are unreachable | Reachable from anywhere; depends on a hosted core and its own auth. |+The phone can reach the core in three ways. `TransportManager` picks one based on the saved connection profile. For a paired device it races the LAN against the tunnel (with a 2 second LAN timeout) and uses whichever answers `openhuman.ping` first.------## Device management & revocation+| Strategy | What it does | When it is used | Trade-offs |+| --- | --- | --- | --- |+| LAN HTTP (`LanHttpTransport`) | Direct HTTP to the core's LAN `rpc_url` | Phone and desktop on the same network | Fastest. Needs the same LAN, and this layer does not encrypt it, so it relies on trust in the local network. |+| Tunnel (`TunnelTransport`) | Encrypted frames over the backend Socket.IO relay | Anywhere with internet. The default fallback. | Works across networks and is encrypted end to end. Slower because it is relayed, and it depends on the backend being up. |+| Cloud HTTP (`CloudHttpTransport`) | HTTP to a cloud-hosted core endpoint | Profile `kind: "cloud"`, when LAN and tunnel are unreachable | Reachable from anywhere. Needs a hosted core and its own auth. |-Paired devices are persisted by the core in SQLite (`{workspace_dir}/devices/devices.db`, table `paired_devices`): channel id, label, the device's public key, a SHA-256 hash of the core session token, and timestamps. The core's X25519 private key is stored encrypted at rest (via the OS keyring `SecretStore`) so handshakes survive a restart.+## Device management and revocation-- **Create**: `devices_create_pairing` registers the channel, mints and persists the keypair, and returns the QR fields.-- **List**: `devices_list` returns non-revoked devices, overlaying a live `peer_online` flag sourced from `tunnel:peer-status` (online status is never persisted).-- **Revoke**: `devices_revoke` soft-deletes the device, tears down all in-memory and tunnel state for the channel, and publishes a `DeviceRevoked` event. Today revocation is local-side: the backend channel is left to expire via its pairing-token TTL (a backend revoke endpoint is a follow-up).+The core saves paired devices in SQLite (`{workspace_dir}/devices/devices.db`, table `paired_devices`). Each record has the channel id, a label, the device's public key, a SHA-256 hash of the core session token, and timestamps. The core's X25519 private key is encrypted at rest through the OS keyring, so handshakes survive a restart.-All three are reachable over JSON-RPC as `openhuman.devices_create_pairing`, `openhuman.devices_list` and `openhuman.devices_revoke`, and on the CLI through the generic namespace dispatcher: `openhuman-core devices create_pairing`, `openhuman-core devices list`, `openhuman-core devices revoke --channel_id <id>`.+- **Create:** `devices_create_pairing` registers the channel, creates and saves the keypair, and returns the QR fields.+- **List:** `devices_list` returns devices that are not revoked, with a live `peer_online` flag from `tunnel:peer-status`. Online status is never saved.+- **Revoke:** `devices_revoke` soft-deletes the device, clears all in-memory and tunnel state for the channel, and publishes a `DeviceRevoked` event. Revocation is local only. The backend channel is left to expire with its pairing-token lifetime.----+All three are available over JSON-RPC as `openhuman.devices_create_pairing`, `openhuman.devices_list` and `openhuman.devices_revoke`. On the CLI, use `openhuman-core devices create_pairing`, `openhuman-core devices list` and `openhuman-core devices revoke --channel_id <id>`.## See also-- [Privacy & Security](privacy-and-security.md): how OpenHuman handles your data and keys.-- [Voice](native-tools/voice.md): push-to-talk and dictation, the headline use case for a phone companion.+- [Privacy and security](privacy-and-security.md): how OpenHuman handles your data and keys.+- [Voice](native-tools/voice.md): push-to-talk and dictation, the main use for a phone companion.- [Architecture](../developing/architecture.md): where the iOS client sits relative to the core.-- [OS Keyring & Secret Storage](os-keyring-and-secret-storage.md): where the core's X25519 private key is kept.+- [OS keyring and secret storage](os-keyring-and-secret-storage.md): where the core's X25519 private key is kept.diff --git a/gitbooks/features/mascot/README.md b/gitbooks/features/mascot/README.mdindex 79ee54b547..2604c632f4 100644--- a/gitbooks/features/mascot/README.md+++ b/gitbooks/features/mascot/README.md@@ -1,56 +1,50 @@---description: >-- The on-screen face of OpenHuman: a desktop mascot that speaks, reacts, and- keeps working in the background even when you aren't looking at it.+ The face of OpenHuman: an on-screen mascot that speaks, reacts, and shows+ when the agent is working, even while you aren't looking.icon: face-smile----# The Mascot+# The mascot-OpenHuman has a face. The mascot is an animated character that lives on your desktop and acts as the visible surface of the agent, what it's saying, what it's thinking about, when it's idle, when it's busy, when it has something to tell you.+OpenHuman has a face. The mascot is an animated character on your desktop that shows what the agent is saying, what it is thinking about, whether it is idle or busy, and when it has something to tell you.-It is not a chrome ornament. The mascot is wired into the same pieces as the rest of the agent: [voice](../native-tools/voice.md), [memory](../memory.md) and [scheduled runs](../native-tools/cron.md). When the agent talks, the mascot is the one talking; when the agent is thinking, the mascot is the one thinking.+It is more than decoration. The mascot is wired into the same parts as the rest of the agent: [voice](../native-tools/voice.md), [memory](../memory.md) and [scheduled runs](../native-tools/cron.md). When the agent talks, the mascot talks. When the agent thinks, the mascot thinks.## What it does-### It speaks, and lip-syncs to its own voice+### It speaks and lip-syncs-When the agent replies, the audio is generated through a hosted TTS model and streamed to your speakers. At the same time, the mascot drives a viseme map against the audio so its mouth shapes match the words coming out. There's no separate "talking head" video, the same audio stream that you hear is the one driving the animation.+When the agent replies, a hosted text-to-speech model generates the audio and streams it to your speakers. The mascot maps the audio to mouth shapes so its lips match the words. There is no separate talking-head video. The audio you hear is the same stream that drives the animation.-See [Native Voice](../native-tools/voice.md) for the speech-to-text and text-to-speech plumbing the mascot rides on top of.+See [Voice](../native-tools/voice.md) for the speech-to-text and text-to-speech behind it.-### It moves and reacts to its surroundings+### It reacts-The mascot has mood states (idle, thinking, listening, talking, surprised) and it transitions between them based on what the agent is doing. When you start typing it shifts into a listening pose. When the model is reasoning, it shows that. When a tool call returns something noteworthy, it reacts. When you stop interacting for a while, it drifts into idle.+The mascot has moods: idle, thinking, listening, talking and surprised. It moves between them based on what the agent is doing. It shifts into a listening pose when you start typing, shows when the model is reasoning, reacts when a tool returns something noteworthy, and drifts into idle when you stop interacting.-After a turn finishes, the desktop mascot also reads the conversation-level cue that arrives with the chat result. A success cue produces a short happy acknowledgement, uncertainty produces a confused acknowledgement, and warnings or failed outcomes produce a concerned acknowledgement. If no strong cue is present, it keeps the existing calm post-turn acknowledgement and falls back to idle.--It is meant to feel alive, not animated-on-rails.+After a turn finishes, the mascot also reads the conversation-level cue that comes with the chat result. A success cue gets a short happy acknowledgement. Uncertainty gets a confused one. Warnings and failures get a concerned one. With no strong cue, it keeps the calm default and goes back to idle.### It remembers you-The mascot is the visible part of an agent that has [memory](../memory.md) underneath it. It remembers what you've talked about, what you prefer, what's in your documents and what's been decided, across the sources you've added. When it greets you in the morning, it isn't starting from zero.--That memory is what makes the personality consistent over weeks and months. The mascot you talk to today knows what the mascot you talked to last Tuesday knows.--### It works while you're away+Behind the mascot is an agent with [memory](../memory.md). It remembers what you have talked about, what you prefer, what is in your documents and what you decided, across the sources you have added. When it greets you in the morning, it isn't starting from zero. That memory keeps its personality consistent over weeks and months.-Even when you've stopped typing, work can keep happening on your behalf: [scheduled routines](../native-tools/cron.md) run on a cron expression, [triggers](../integrations/triggers.md) fire on inbound events, and [workflows](../workflows.md) execute durable, approval-gated graphs. So when you come back to the desk, the mascot may have already drafted the email, refreshed the dashboard, or queued the question it needs to ask you. The face on the screen is the one that did the work.+### It works while you are away-## Why have a mascot at all?+Work can continue when you stop typing. [Scheduled routines](../native-tools/cron.md) run on a cron expression, [triggers](../integrations/triggers.md) fire on inbound events, and [workflows](../workflows.md) run durable graphs with approval steps. When you come back, the mascot may have already drafted the email, refreshed the dashboard, or queued the question it needs to ask you.-Most assistants are a blinking text input. That's fine for a tool. It's not fine for something that's meant to be alongside you all day, with persistent memory of your life, taking actions on your behalf.+## Why have a mascot-The mascot exists because:+Most assistants are a blinking text box. That works for a tool. It works less well for something that stays with you all day, remembers your life and acts for you. The mascot helps in three ways:-- **Presence beats panels.** A face you can glance at tells you, in one frame, whether the agent is busy, idle, or trying to get your attention.-- **It makes talking feel like a conversation.** An animated character lip-syncing to its own speech is a different experience from a robotic voice and a blank panel.-- **Personality is a UX surface.** A consistent character on screen is easier to trust, talk to, and forgive when it makes a mistake than a faceless API.+- A face you can glance at shows in one frame whether the agent is busy, idle or asking for attention.+- A character that lip-syncs its own speech makes talking feel like a conversation.+- A consistent character is easier to trust, talk to and forgive than a faceless API.## See also-- [Native Voice](../native-tools/voice.md), the STT / TTS plumbing the mascot rides on.-- [Memory](../memory.md), what the mascot remembers, and how.-- [Themes & Theme Studio](../theming.md), where the mascot's colour, shape and voice are set.-- [Chat](../chat.md) and [Notifications & Activity](../notifications-and-activity.md), where the mascot's cues surface.-- [`voice` domain](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-core/src/voice/README.md), the Rust side of speech.+- [Voice](../native-tools/voice.md): the speech-to-text and text-to-speech behind the mascot.+- [Memory](../memory.md): what the mascot remembers, and how.+- [Themes and Theme Studio](../theming.md): where the mascot's color, shape and voice are set.+- [Chat](../chat.md) and [Notifications and activity](../notifications-and-activity.md): where the mascot's cues show up.+- [Voice domain](https://github.com/tinyhumansai/openhuman/blob/main/crates/openhuman-core/src/voice/README.md): the Rust side of speech.