pub mod commands; pub mod db; pub mod llama; pub mod sidecar; pub mod state; use tauri::window::Color; use tauri::Manager; use commands::ai::{ai_chat, ai_configure, ai_list_providers}; use commands::export::export_transcript; use commands::project::{ create_project, delete_project, get_project, list_projects, load_project_file, load_project_transcript, save_project_file, save_project_transcript, update_segment, }; use commands::settings::{load_settings, save_settings}; use commands::sidecar::{check_sidecar, check_sidecar_update, download_sidecar}; use commands::system::{get_data_dir, llama_list_models, llama_start, llama_status, llama_stop}; use commands::transcribe::{download_diarize_model, run_pipeline, transcribe_file}; use state::AppState; #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { let app_state = AppState::new().expect("Failed to initialize app state"); tauri::Builder::default() .plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_dialog::init()) .manage(app_state) .setup(|app| { // Tell the sidecar manager where Tauri placed bundled resources // and where to extract the sidecar archive if let (Ok(resource_dir), Ok(data_dir)) = (app.path().resource_dir(), app.path().app_local_data_dir()) { sidecar::init_dirs(resource_dir, data_dir); } // Set the webview background to match the app's dark theme if let Some(window) = app.get_webview_window("main") { let _ = window.set_background_color(Some(Color(10, 10, 35, 255))); } Ok(()) }) .invoke_handler(tauri::generate_handler![ create_project, get_project, list_projects, delete_project, save_project_transcript, load_project_transcript, update_segment, save_project_file, load_project_file, transcribe_file, run_pipeline, download_diarize_model, export_transcript, ai_chat, ai_list_providers, ai_configure, llama_start, llama_stop, llama_status, llama_list_models, get_data_dir, load_settings, save_settings, check_sidecar, download_sidecar, check_sidecar_update, ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); }