use once_cell::sync::{Lazy, OnceCell}; use parking_lot::RwLock; use std::{sync::Arc}; use platform_dirs::AppDirs; use std::path::PathBuf; #[macro_use] extern crate log; pub mod time; pub mod audio; pub mod commands; pub mod config; pub mod db; pub mod i18n; #[cfg(feature = "jarvis_app")] pub mod listener; pub mod recorder; #[cfg(feature = "jarvis_app")] pub mod stt; #[cfg(feature = "intent")] pub mod intent; pub mod vosk_models; #[cfg(feature = "jarvis_app")] pub mod audio_processing; #[cfg(feature = "jarvis_app")] pub mod ipc; pub mod voices; pub mod audio_buffer; // shared statics // pub static APP_DIR: Lazy = Lazy::new(|| std::env::current_dir().unwrap()); pub static APP_DIR: Lazy = Lazy::new(|| { std::env::current_exe() .ok() .and_then(|p| p.parent().map(|p| p.to_path_buf())) .unwrap_or_else(|| std::env::current_dir().unwrap()) }); pub static SOUND_DIR: Lazy = Lazy::new(|| APP_DIR.clone().join(config::SOUND_PATH)); pub static APP_DIRS: OnceCell = OnceCell::new(); pub static APP_CONFIG_DIR: OnceCell = OnceCell::new(); pub static APP_LOG_DIR: OnceCell = OnceCell::new(); pub static DB: OnceCell>> = OnceCell::new(); pub static COMMANDS_LIST: OnceCell> = OnceCell::new(); // re-exports pub use commands::JCommandsList; pub use config::structs::*; pub use db::structs::Settings; // use crate::commands::{JComandsList, JCommand};