Tray options implementation + Voice system rewrite + build fixes

This commit is contained in:
Priler 2026-01-07 23:29:46 +05:00
parent 412acb7e2d
commit 47b7e7a65d
117 changed files with 1300 additions and 2334 deletions

View file

@ -0,0 +1,22 @@
use jarvis_core::commands::{self, JCommand, JCommandsList};
use once_cell::sync::Lazy;
static COMMANDS: Lazy<Vec<JCommandsList>> = Lazy::new(|| {
commands::parse_commands().unwrap_or_default()
});
#[tauri::command]
pub fn get_commands_count() -> usize {
COMMANDS
.iter()
.map(|list| list.commands.len())
.sum()
}
#[tauri::command]
pub fn get_commands_list() -> Vec<JCommand> {
COMMANDS
.iter()
.flat_map(|list| list.commands.clone())
.collect()
}

View file

@ -0,0 +1,16 @@
use jarvis_core::voices::{self, structs::VoiceConfig};
#[tauri::command]
pub fn list_voices() -> Vec<VoiceConfig> {
voices::list_voices()
}
#[tauri::command]
pub fn get_voice(voice_id: String) -> Option<VoiceConfig> {
voices::get_voice(&voice_id)
}
#[tauri::command]
pub fn preview_voice(voice_id: String) {
voices::play_preview(&voice_id);
}