Skip to content

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

feat(voice): restructure server module into submodules

Steven Enamakel9966a481fbf9
diff --git a/crates/openhuman-core/src/voice/server.rs b/crates/openhuman-core/src/voice/server.rs
index b8a633528b..15086f0507 100644
--- a/crates/openhuman-core/src/voice/server.rs
+++ b/crates/openhuman-core/src/voice/server.rs
@@ -4,9 +4,40 @@
//! The server listens for a configurable hotkey, records audio from the
//! microphone, transcribes via the configured STT engine, and inserts the result into the
//! active text field.
+//!
+//! ## Module layout
+//!
+//! - [`types`] — run state, status snapshot, and server config.
+//! - [`hotkey_listener`] — rdev vs. the macOS Swift globe listener.
+//! - [`pipeline`] — the background recording → transcription pass.
+//! - [`runtime`] — the hotkey event loop that drives a `VoiceServer`.
+//! - [`singleton`] — the process-global instance, auto-start, and the
+//! standalone (CLI) entry point.
+
+mod hotkey_listener;
+mod pipeline;
+mod runtime;
+mod singleton;
+mod types;
+
+pub use runtime::VoiceServer;
+pub use singleton::{global_server, run_standalone, start_if_enabled, try_global_server};
+pub use types::{ServerState, VoiceServerConfig, VoiceServerStatus};
+
+#[cfg(test)]
+use pipeline::{
+ build_initial_prompt, capture_expected_app_name, process_recording_bg, truncate_for_log,
+ update_state_if_current,
+};
+#[cfg(test)]
+use pipeline::push_recent_transcript;
+#[cfg(test)]
+use types::DEFAULT_SILENCE_THRESHOLD;
+#[cfg(test)]
+use crate::voice::hotkey::ActivationMode;
+
+const LOG_PREFIX: &str = "[voice_server]";
#[cfg(test)]
#[path = "server_tests.rs"]
mod tests;
-include!("server_part_01.rs");
-include!("server_part_02.rs");