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(voice): add README files for voice and always-on modules
Steven Enamakel037546283e01
diff --git a/crates/openhuman-core/src/voice/README.md b/crates/openhuman-core/src/voice/README.mdindex d9ddda1089..07b8613a88 100644--- a/crates/openhuman-core/src/voice/README.md+++ b/crates/openhuman-core/src/voice/README.md@@ -41,11 +41,11 @@ Keeping the two surfaces in lockstep is enforced by the disabled-build check| `factory/` | `SttProvider` / `TtsProvider` traits; cloud/piper/external implementations; `create_stt_provider` / `create_tts_provider`; `effective_*_provider`; slug:model parsing; `DEFAULT_STT_MODEL`, `DEFAULT_PIPER_VOICE`. Split into `entry.rs` (public entry points + constants), `traits.rs`, `stt_providers.rs` (`CloudSttProvider`, `ExternalSttProvider`), `tts_providers.rs` (`CloudTtsProvider`, `PiperTtsProvider`, `ExternalTtsProvider`), `helpers.rs` (`split_slug_model`, `effective_*_provider`, slug-keyed lookup in `config.voice_providers`). || `schemas/` | Controller schemas, registry exports, and all `handle_voice_*` / `handle_overlay_stt_notify` RPC handlers. Split into `registry.rs`, `params.rs`, `helpers.rs`, `handlers.rs` (+ `handlers/provider_server.rs`, `handlers/transcribe_tts.rs`). || `server.rs` (+ `server/runtime.rs`, `server/pipeline.rs`, `server/hotkey_listener.rs`, `server/singleton.rs`, `server/types.rs`) | The `VoiceServer` dictation runtime: hotkey event loop, recording lifecycle, duration/silence/hallucination gates, background processing, global singleton (`global_server` / `try_global_server` / `start_if_enabled` / `run_standalone`, all in `server/singleton.rs`). |-| `always_on.rs` (+ `always_on/processor.rs`, `always_on/capture.rs`, `always_on/lock_watcher.rs`, `always_on/transcribe.rs`) | Phase 2 always-on listening: keeps the mic open continuously and uses VAD to carve utterances instead of gating on a hotkey. Owns the `cpal` stream and thread discipline; everything else (VAD session, resample, energies, WAV encode, wake-word gate, command/intent routing) runs in the `tinyvoice` module. Opt-in (`config.voice_server.always_on_enabled`); pauses while the screen is locked (macOS only; other platforms have no lock signal yet). |+| `always_on.rs` (+ `always_on/processor.rs`, `always_on/capture.rs`, `always_on/lock_watcher.rs`, `always_on/transcribe.rs`) | Phase 2 always-on listening: keeps the mic open continuously and uses VAD to carve utterances instead of gating on a hotkey. The `cpal` stream and thread discipline live in `tinyvoice::capture`; everything else (VAD session, resample, energies, WAV encode, wake-word gate, command/intent routing) runs in the `tinyvoice` module. Opt-in (`config.voice_server.always_on_enabled`); pauses while the screen is locked (macOS only; other platforms have no lock signal yet). || `bus.rs` | Publishes `DomainEvent::Voice(VoiceEvent::PttTranscriptCommitted)` via `publish_ptt_transcript_committed`. || `compile_status.rs` | `VOICE_COMPILED_IN`: see the gate section above. || `hotkey.rs` | Re-export of `tinyvoice::hotkey` (the `tinyvoice` library's off-by-default `hotkey` feature, which owns the `rdev` dependency): `ActivationMode` (Tap/Push), `HotkeyEvent`, `HotkeyCombination`, `parse_hotkey`, `start_listener`. Its tests live in tinyvoice. |-| `audio_capture.rs` | cpal mic capture → 16 kHz mono WAV bytes; `RecordingHandle`, silence-gate ring buffer, peak-RMS reporting. Delegates framing/resample/energy math to `crate::modules::voice` (the `tinyvoice` module). |+| `audio_capture.rs` | Mic capture → 16 kHz mono WAV bytes; `RecordingHandle`, peak-RMS reporting, and the host microphone-permission policy. The `cpal` device flow is `tinyvoice::capture`. Delegates framing/resample/energy math to `crate::modules::voice` (the `tinyvoice` module). || `audio_toolkit/` | Podcast generation + email delivery (`audio_toolkit` RPC namespace), gated by the same `voice` feature. See its own [README](audio_toolkit/README.md). || `text_input.rs` | Clipboard-paste text insertion (`insert_text`): writes clipboard then simulates Cmd/Ctrl+V via enigo, restoring prior clipboard. || `dictation_listener.rs` | Core-side dictation broadcast bus: `DictationEvent`, `publish_dictation_event` / `subscribe_dictation_events`, `publish_transcription` / `subscribe_transcription_results`, rdev listener lifecycle (`start_if_enabled` / `stop`), `normalize_hotkey_for_rdev`. |diff --git a/crates/openhuman-core/src/voice/always_on/README.md b/crates/openhuman-core/src/voice/always_on/README.mdindex f67c87aff3..e4919dcbe3 100644--- a/crates/openhuman-core/src/voice/always_on/README.md+++ b/crates/openhuman-core/src/voice/always_on/README.md@@ -14,7 +14,7 @@ The split follows the audio callback, not the cost of a call. A module call is a| File | Role || --- | --- |-| `capture.rs` | Owns the `cpal` stream and its realtime callback. `spawn_capture_thread` builds the input stream on a dedicated thread and blocks on a readiness handshake; each callback converts the device sample format to `f32` and forwards the interleaved buffer untouched via `try_send` (never blocking `send`), dropping the newest chunk and counting drops when the processor falls behind. |+| `capture.rs` | Host microphone-permission policy over `tinyvoice::capture`, which owns the `cpal` stream and its realtime callback. `spawn_capture_thread` builds the input stream on a dedicated thread and blocks on a readiness handshake; each callback converts the device sample format to `f32` and forwards the interleaved buffer untouched via `try_send` (never blocking `send`), dropping the newest chunk and counting drops when the processor falls behind. || `lock_watcher.rs` | The macOS screen-lock privacy hook. `spawn_lock_watcher` polls `CGSessionCopyCurrentDictionary` every two seconds and flips `PAUSED` on lock/unlock transitions. Other platforms log that the watcher is unavailable and never pause (no lock signal yet). || `processor.rs` | The async pipeline: owns the `ENABLED`/`PAUSED`/`RUNNING` gates, opens and retries the `tinyvoice::VadSession`, turns raw capture chunks into segmented utterances, and hands finished ones to `transcribe_and_deliver`. `start_if_enabled` is safe to call at boot and at runtime (the Settings toggle calls it through the config RPC); `stop` flips `ENABLED` off for logout without tearing down the microphone stream. || `transcribe.rs` | Transcribes a finished utterance through the configured STT provider (the same factory dispatch `voice.stt_dispatch` uses), applies the wake-word gate (`tinyvoice::extract_command`), and routes recognized commands either to a local fast path (`execute_intent`, media transport and volume via `osascript` on macOS) or, for `VoiceIntent::Unknown` or a failed local execution, to the agent via `crate::voice::dictation_listener::publish_transcription`. |@@ -42,7 +42,7 @@ Transcription is forced to English (`Some("en")`) because auto-detect rendered t- The microphone stream is spawned once per process and stays open for the process lifetime once started; toggling `always_on_enabled` off only stops processing, it does not close the stream. Toggling back on reuses it.- A VAD session that fails to open (for example, the module has not finished downloading) does not stop the capture thread. Audio is dropped and the open is retried on `SESSION_RETRY_INTERVAL` so the feature self-heals without a restart.-- `capture.rs` never blocks the realtime audio callback: a full queue drops the newest chunk, which is deliberately the newer end to lose, since the queue ahead of it is older speech closer to being transcribed.+- `tinyvoice::capture` (via `capture.rs`) never blocks the realtime audio callback: a full queue drops the newest chunk, which is deliberately the newer end to lose, since the queue ahead of it is older speech closer to being transcribed.## See also