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
Merge branch 'epic/8096-voice-cut' of github.com:senamakel/openhuman into epic-8096-399-always-on
Steven Enamakel20f1c27dfff4
diff --cc crates/openhuman-core/src/modules/voice.rsindex ae9a1be6cc,5af6f756e3..280f830e62--- a/crates/openhuman-core/src/modules/voice.rs+++ b/crates/openhuman-core/src/modules/voice.rs@@@ -246,33 -444,48 +246,6 @@@ impl RecorderSession}}- /// Frame 16-bit PCM samples as a WAV file, without touching the samples.-/// Downmix and resample a raw capture buffer to 16 kHz mono samples.--///- /// A caller holding `i16` should not have- /// to widen to `f32` and let the module narrow back: that round trip is lossy- /// by one LSB for no reason. This path is exact.-/// The sibling of [`prepare_capture`] for a live loop, which needs samples to-/// measure and accumulate rather than a finished container.--///--/// # Errors--///- /// [`VoiceCallError`] when the module is unavailable or the call fails.- pub async fn encode_wav_pcm16(-/// [`VoiceCallError`], including a `Failed` when `samples` is not a whole-/// number of frames for `channels`.-pub async fn prepare_frames(-- config: &Config,- samples: &[i16],- sample_rate: u32,- samples: &[f32],- source_rate: u32,-- channels: u16,- ) -> Result<Vec<u8>, VoiceCallError> {- use base64::Engine as _;- let bytes: Vec<u8> = samples.iter().flat_map(|s| s.to_le_bytes()).collect();- let encoded = base64::engine::general_purpose::STANDARD.encode(bytes);- let wav: String = call(-) -> Result<Vec<f32>, VoiceCallError> {- let encoded: String = call(-- config,- methods::ENCODE_WAV_PCM16,- (encoded, sample_rate, channels),- methods::PREPARE_FRAMES,- (encode_samples(samples), source_rate, channels),-- )-- .await?;- decode_audio(&wav)- decode_samples(&encoded)-}--/// Root-mean-square energy of each fixed-size frame in a buffer.-///-/// # Errors-///-/// [`VoiceCallError`] when the module is unavailable or `frame_len` is zero.-pub async fn frame_energies(- config: &Config,- samples: &[f32],- frame_len: u32,-) -> Result<Vec<f32>, VoiceCallError> {- call(- config,- methods::FRAME_ENERGIES,- (encode_samples(samples), frame_len),- )- .await--}--/// Load the voice module if it is not already serving.////// Callers do not have to invoke this — every operation above does it — but adiff --cc crates/openhuman-core/src/modules/voice_tests.rsindex 625696c260,215d7ec2b1..ba10d46e97--- a/crates/openhuman-core/src/modules/voice_tests.rs+++ b/crates/openhuman-core/src/modules/voice_tests.rs@@@ -112,9 -406,23 +112,8 @@@ fn every_member_this_client_calls_is_on// surface, including capture leases and hotkeys, aligned with the module.use tinyvoice_bus::names::methods;let called = [- methods::ROUTE,- methods::EXTRACT_COMMAND,- methods::WAKE_WORD_PRESENT,methods::IS_HALLUCINATED,- methods::ENCODE_WAV_PCM16,- methods::VAD_OPEN,- methods::VAD_PUSH,- methods::VAD_IS_SPEAKING,- methods::VAD_RESET,- methods::VAD_CLOSE,- methods::PREPARE_FRAMES,- methods::FRAME_ENERGIES,- methods::ENCODE_WAV,methods::PREPARE_CAPTURE,- methods::CAPTURE_POLL,- methods::CAPTURE_SHUTDOWN,- methods::CAPTURE_START,- methods::CAPTURE_STOP,methods::RESERVE_CAPTURE,methods::LIST_INPUT_DEVICES,methods::RECORDING_START,diff --cc crates/openhuman-core/src/voice/README.mdindex 9b99fef7c4,ba7b8e7018..675031e93d--- a/crates/openhuman-core/src/voice/README.md+++ b/crates/openhuman-core/src/voice/README.md@@@ -229,9 -230,9 +219,8 @@@ one chat and the meet bot use, then str| [`cloud_transcribe.rs`](./cloud_transcribe.rs) | Auth adapter for hosted STT: resolves the backend credential and calls `tinyinference_voice::cloud` against `/openai/v1/audio/transcriptions`. || [`local_speech.rs`](./local_speech.rs) | Config adapter for Piper: resolves the binary and voice through the local runtime and calls `tinyinference-voice`. || [`postprocess.rs`](./postprocess.rs) | Config adapter for LLM transcript cleanup (`cleanup_transcription`). |- | [`streaming.rs`](./streaming.rs) | `/ws/dictation` handler (`handle_dictation_ws`). Compiled only with both `voice` and `http-server`. || [`reply_speech.rs`](./reply_speech.rs) | Agent reply synthesis through the backend speech endpoint (`synthesize_reply`, `ReplySpeechOptions`). || [`server.rs`](./server.rs), [`server/`](./server/) | The `VoiceServer` dictation runtime: hotkey loop, recording lifecycle, gates, delivery, global singleton. [README](server/README.md). |-| [`always_on.rs`](./always_on.rs), [`always_on/`](./always_on/) | VAD-driven continuous listening, screen-lock pause, wake word and intent routing. [README](always_on/README.md). || [`audio_capture.rs`](./audio_capture.rs) | Microphone recording to 16 kHz mono WAV (`start_recording`, `RecordingHandle`, `RecordingResult`, `list_input_devices`) with peak RMS and the host microphone-permission policy. The `cpal` stream is `tinyvoice::capture`. || [`dictation_listener.rs`](./dictation_listener.rs) | The two broadcast channels and host event-forwarding lifecycle over TinyVoice's native listener. || [`bus.rs`](./bus.rs) | `publish_ptt_transcript_committed`. |@@@ -257,10 -258,13 +246,10 @@@(`ops.rs`) are the business operations behind the core RPCs.- `VoiceServer` ([`server/runtime.rs`](./server/runtime.rs)) with `global_server`, `try_global_server`,`start_if_enabled` and `run_standalone` ([`server/singleton.rs`](./server/singleton.rs)).-- `always_on::start_if_enabled` / `always_on::stop` start and stop continuous- listening; the config controller calls `start_if_enabled` again after- voice-server settings are saved.- `synthesize_reply` ([`reply_speech.rs`](./reply_speech.rs)) and `transcribe_cloud`([`cloud_transcribe.rs`](./cloud_transcribe.rs)) are the direct hosted-backend entry points.- - `handle_live_voice_ws` ([`live/ws.rs`](./live/ws.rs)) and `handle_dictation_ws`- (`streaming.rs`) are the WebSocket handlers the RPC crate mounts.+ - `handle_live_voice_ws` ([`live/ws.rs`](./live/ws.rs)) is the WebSocket handler+ the RPC crate mounts.- `handle_voice_harness_turn` (`realtime_harness/`) runs one realtime harnessturn.diff --cc crates/openhuman-core/src/voice/mod.rsindex 6f50a4bffe,175b2fa5a9..81de2c1208--- a/crates/openhuman-core/src/voice/mod.rs+++ b/crates/openhuman-core/src/voice/mod.rs@@@ -14,8 -14,8 +14,8 @@@//! implementation (the submodules below)//! is gated behind the default-ON `voice` Cargo feature. When the feature is//! off, [`stub`] takes its place and exposes the same public surface that-//! always-on / other-gated callers depend on (`server`, `dictation_listener`,+//! other-gated callers depend on (`server`, `dictation_listener`,- //! `streaming`, `create_stt_provider`,+ //! `create_stt_provider`,//! `effective_stt_provider`, `publish_ptt_transcript_committed`) with//! no-op / disabled-error bodies. Keeping the two surfaces in lockstep is//! enforced by the disabled-build checkdiff --cc crates/openhuman-core/src/voice/stub.rsindex ddca2cd21c,9daa3dbc9c..f129dea2cc--- a/crates/openhuman-core/src/voice/stub.rs+++ b/crates/openhuman-core/src/voice/stub.rs@@@ -174,26 -174,23 +174,6 @@@ pub mod dictation_listenerpub async fn stop() {}}--// ---------------------------------------------------------------------------- // streaming::handle_dictation_ws (provided by the real voice host adapter)-// always_on::{start_if_enabled, stop}--// ------------------------------------------------------------------------------ // axum-only, and its sole caller (`openhuman_rpc::server::http::dictation::dictation_ws_handler`) is- // gated the same way, so the stub's dictation-WS surface is exclusive to the- // `http-server` feature too (#5048): voice-OFF + http-server-OFF needs no- // `voice::streaming` at all.- #[cfg(feature = "http-server")]- pub mod streaming {- use std::sync::Arc;-pub mod always_on {- use crate::config::Config;--- use axum::extract::ws::WebSocket;- /// No-op: always-on listening does not exist when voice is disabled.- pub async fn start_if_enabled(_ctx: &crate::core::runtime::DispatchCtx, _config: &Config) {}--- use crate::config::Config;- /// No-op: nothing to stop.- pub fn stop() {}--- /// Drop the upgraded socket immediately — there is nothing to transcribe.- pub async fn handle_dictation_ws(_socket: WebSocket, _config: Arc<Config>) {}- /// No-op: no module capture leases exist when voice is disabled.- pub async fn shutdown() {}--}--// `live::ws::handle_live_voice_ws`: with voice off there are no live// providers, so the upgraded socket is dropped immediately.#[cfg(feature = "http-server")]