Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions desktop/scripts/check-file-sizes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,12 @@ const overrides = new Map([
// transition lock doc broadened to cover all protected-PID transitions, and
// clear_agent_session_caches (per-pubkey retain) added alongside the
// per-key clear. Load-bearing identity-contract change; queued to split.
// +4 (1081 -> 1085): mesh recovery keeps one app-scoped state object beside
// the embedded runtime and coordinator. Probe/re-arm logic lives in
// mesh_llm/recovery.rs rather than growing AppState or command modules.
["src-tauri/src/app_state.rs", 1085],
// +8 (1081 -> 1089): app-scoped mesh recovery and message read-aloud state
// remain as thin fields; their implementations live in dedicated modules.
["src-tauri/src/app_state.rs", 1089],
// +8 (994 -> 1002): message read-aloud mounts one app-scoped provider around
// the routed surface so all message rows share playback state and huddle gating.
["src/app/AppShell.tsx", 1002],
// multi-slot splitting + no-op suppression (#1309): the ReadStateManager
// class grew from ~700 lines to ~1019 with the addition of
// splitContextsIntoBudgetedSlots (pure fn + 5 tests), publishSplitSlots,
Expand Down
4 changes: 4 additions & 0 deletions desktop/src-tauri/src/app_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ pub struct AppState {
pub channel_templates_store_lock: Mutex<()>,
pub managed_agent_processes: Mutex<HashMap<ManagedAgentRuntimeKey, ManagedAgentPairRuntime>>,
pub huddle_state: Mutex<HuddleState>,
/// App-scoped message read-aloud state (independent of huddle speech).
/// See `message_tts.rs` for the lifecycle contract.
pub message_tts: crate::message_tts::MessageTtsState,
/// Tauri app handle — stored after setup so huddle commands can emit
/// `huddle-state-changed` events without needing the handle threaded
/// through every call site.
Expand Down Expand Up @@ -213,6 +216,7 @@ pub fn build_app_state() -> AppState {
managed_agent_processes: Mutex::new(HashMap::new()),
session_config_cache: Mutex::new(HashMap::new()),
huddle_state: Mutex::new(HuddleState::default()),
message_tts: crate::message_tts::MessageTtsState::default(),
app_handle: Mutex::new(None),
audio_output_device: Mutex::new(None),
media_proxy_port: AtomicU16::new(0),
Expand Down
4 changes: 4 additions & 0 deletions desktop/src-tauri/src/huddle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ pub async fn start_huddle(
hs.phase = HuddlePhase::Creating;
hs.parent_channel_id = Some(parent_channel_id.clone());
}
// The huddle owns the audio device now — end any message read-aloud.
crate::message_tts::stop_message_playback(&state);

let ephemeral_uuid = Uuid::new_v4();
let ephemeral_channel_id = ephemeral_uuid.to_string();
Expand Down Expand Up @@ -352,6 +354,8 @@ pub async fn join_huddle(
hs.parent_channel_id = Some(parent_channel_id.clone());
hs.ephemeral_channel_id = Some(ephemeral_channel_id.clone());
}
// The huddle owns the audio device now — end any message read-aloud.
crate::message_tts::stop_message_playback(&state);

// Seed participant list with own pubkey as a fallback until relay responds.
let own_pubkey = state
Expand Down
3 changes: 3 additions & 0 deletions desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mod media_proxy;
mod mesh_llm;
#[cfg(not(feature = "mesh-llm"))]
mod mesh_llm_stubs;
mod message_tts;
mod migration;
#[cfg(test)]
mod model_tests;
Expand Down Expand Up @@ -878,6 +879,8 @@ pub fn run() {
get_model_status,
set_tts_enabled,
speak_agent_message,
message_tts::speak_chat_message,
message_tts::stop_chat_message_speech,
add_agent_to_huddle,
check_pipeline_hotstart,
confirm_huddle_active,
Expand Down
Loading
Loading