Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(overlay): add README for desktop overlay module

Steven Enamakelca4dfa2d9bab
diff --git a/crates/openhuman-core/src/desktop/overlay/README.md b/crates/openhuman-core/src/desktop/overlay/README.md
index 1d60c6c789..34adb3331f 100644
--- a/crates/openhuman-core/src/desktop/overlay/README.md
+++ b/crates/openhuman-core/src/desktop/overlay/README.md
@@ -1,11 +1,11 @@
# overlay
-Signals pushed from the core to the desktop **overlay window** — a separate Tauri WebView (`OverlayApp.tsx`, configured in `crates/openhuman-app/tauri.conf.json`) that renders short, non-focus-stealing messages over the desktop. Because the overlay runs in its own JS runtime it cannot share Redux state with the main window; instead it subscribes to a dedicated Socket.IO connection and reacts to events the core broadcasts. This module owns a single fire-and-forget broadcast bus for **attention** events; the Socket.IO transport bridge (`crates/openhuman-core/src/core/socketio.rs`) subscribes and forwards them to the overlay window. It is deliberately light: export-focused, one broadcast channel, no persistence and no RPC.
+Signals pushed from the core to the desktop **overlay surfaces** — separate WebViews (`app/src/overlay/OverlayApp.tsx` and the macOS notch pill `app/src/notch/NotchApp.tsx`, hosted by `crates/openhuman-app/src/notch_window.rs`) that render short, non-focus-stealing messages over the desktop. The standalone `overlay` window is currently disabled in `crates/openhuman-app/tauri.conf.json`; the notch is the live consumer. Because these surfaces run in their own JS runtime they cannot share Redux state with the main window; each subscribes to its own Socket.IO connection and reacts to events the core broadcasts. This module owns a single fire-and-forget broadcast bus for **attention** events; the Socket.IO transport bridge (`crates/openhuman-core/src/core/socketio.rs`) subscribes and forwards them. It is deliberately light: export-focused, one broadcast channel, no persistence and no RPC.
## Responsibilities
- Define the `OverlayAttentionEvent` payload and its `OverlayAttentionTone` visual hint.
-- Provide a process-global broadcast channel so any core caller (subconscious loop, heartbeat, …) can surface a transient overlay message without threading a sender around.
+- Provide a process-global broadcast channel so any core caller can surface a transient overlay message without threading a sender around.
- Expose `publish_attention` (fire-and-forget producer) and `subscribe_attention_events` (consumed by the Socket.IO bridge).
- (STT/dictation overlay activation is driven separately by `voice::dictation_listener`'s `dictation:toggle` / `dictation:transcription` events — not by this module.)
@@ -15,7 +15,7 @@ Signals pushed from the core to the desktop **overlay window** — a separate Ta
| --- | --- |
| `crates/openhuman-core/src/desktop/overlay/mod.rs` | Module docstring + re-exports only (`publish_attention`, `subscribe_attention_events`, `OverlayAttentionEvent`, `OverlayAttentionTone`). |
| `crates/openhuman-core/src/desktop/overlay/types.rs` | `OverlayAttentionEvent` (message + optional `id` / `tone` / `ttl_ms` / `source`) with builder helpers, and the `OverlayAttentionTone` enum (`neutral` / `accent` / `success`). |
-| `crates/openhuman-core/src/desktop/overlay/bus.rs` | `Lazy` `tokio::sync::broadcast` channel (capacity 64) plus `publish_attention` / `subscribe_attention_events`; includes inline `#[cfg(test)]` tests. |
+| `crates/openhuman-core/src/desktop/overlay/bus.rs` | `Lazy` `tokio::sync::broadcast` channel (capacity 64) plus `publish_attention` / `subscribe_attention_events`; tests live in the sibling `bus_tests.rs`. |
## Public surface
@@ -39,12 +39,12 @@ None. State is purely an in-memory broadcast channel; events not consumed when p
## Used by
- `crates/openhuman-core/src/core/socketio.rs` — subscribes to the bus and forwards events to the overlay WebView over Socket.IO.
+- `crates/openhuman-core/src/voice/always_on_part_01.rs` — `notch_status` publishes "Listening" / "Processing" status messages (`source: "voice"`, with a TTL) that the notch maps to icons. The only in-tree publisher today.
- `crates/openhuman-core/src/desktop/notifications/bus.rs` — references this module's bus only as a documented pattern to mirror (no code dependency).
-- Per the module docstring, intended publishers include the subconscious loop and heartbeat via `publish_attention`.
## Notes / gotchas
- **Fire-and-forget:** if the Socket.IO bridge hasn't started or the overlay socket is disconnected, `publish_attention` drops the event and returns `0`. There is no buffering/replay for late subscribers.
- **Channel capacity is 64** — a slow/absent overlay consumer causes `Lagged` drops (logged as a warning by the bridge), not back-pressure.
-- Keep `message` short: the overlay types it out character-by-character and auto-dismisses after `ttl_ms` (frontend default when `None`).
+- Keep `message` short: the overlay types it out character-by-character and auto-dismisses after `ttl_ms` (frontend default when `None`). The notch treats the literal messages `Listening` and `Processing` as reserved status words.
- The bridge emits two event names (`overlay:attention` and `overlay_attention`) for client compatibility.
diff --git a/crates/openhuman-core/src/memory/read_rpc/mod.rs b/crates/openhuman-core/src/memory/read_rpc/mod.rs
index be286fbd89..9c5eb16a7f 100644
--- a/crates/openhuman-core/src/memory/read_rpc/mod.rs
+++ b/crates/openhuman-core/src/memory/read_rpc/mod.rs
@@ -53,10 +53,9 @@ pub(crate) fn parse_source_kind_str(s: &str) -> Option<tinymemory_api::chunks::S
// The raw-SQLite `with_connection` door that used to sit here is gone: nothing
// production-side in `read_rpc` names the engine any more (`wipe_all`,
// `clear_composio_sync_state` and `delete_source` left for `purge_all`,
-// `kv_list` + `kv_delete` and `forget_matching(Source)`), and the tests assert
-// through the contract instead. `cfg(test)` code links the `tinymemory-core`
-// **dev-dependency**, which stays after the normal dependency was dropped
-// (#5560), so nothing here keeps the engine crate in the shipped binary.
+// `kv_list` + `kv_delete` and `forget_matching(Source)`), and the tests go
+// through the same handlers. Nothing here keeps the engine crate in the
+// shipped binary (#5560).
#[cfg(test)]
pub(crate) use crate::config::Config;
#[cfg(test)]