2026-01-04 05:19:47 +05:00
|
|
|
use once_cell::sync::{Lazy, OnceCell};
|
2026-01-04 09:00:51 +05:00
|
|
|
use parking_lot::RwLock;
|
2026-01-05 01:22:45 +05:00
|
|
|
use std::{sync::Arc};
|
2026-01-04 05:19:47 +05:00
|
|
|
use platform_dirs::AppDirs;
|
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
|
extern crate log;
|
|
|
|
|
|
2026-01-07 23:29:46 +05:00
|
|
|
pub mod time;
|
|
|
|
|
|
2026-01-04 05:19:47 +05:00
|
|
|
pub mod audio;
|
|
|
|
|
pub mod commands;
|
|
|
|
|
pub mod config;
|
|
|
|
|
pub mod db;
|
2026-01-07 05:04:04 +05:00
|
|
|
pub mod i18n;
|
2026-01-04 09:00:51 +05:00
|
|
|
|
|
|
|
|
#[cfg(feature = "jarvis_app")]
|
2026-01-04 05:19:47 +05:00
|
|
|
pub mod listener;
|
2026-01-04 09:00:51 +05:00
|
|
|
|
2026-01-04 05:19:47 +05:00
|
|
|
pub mod recorder;
|
2026-01-04 09:00:51 +05:00
|
|
|
|
|
|
|
|
#[cfg(feature = "jarvis_app")]
|
2026-01-04 05:19:47 +05:00
|
|
|
pub mod stt;
|
|
|
|
|
|
2026-01-05 02:23:32 +05:00
|
|
|
#[cfg(feature = "intent")]
|
2026-01-05 01:22:45 +05:00
|
|
|
pub mod intent;
|
|
|
|
|
|
2026-02-11 07:21:50 +05:00
|
|
|
#[cfg(feature = "jarvis_app")]
|
|
|
|
|
pub mod slots;
|
|
|
|
|
|
2026-02-18 21:08:48 +05:00
|
|
|
pub mod models;
|
|
|
|
|
|
|
|
|
|
// re-exported from models/
|
|
|
|
|
pub use models::vosk_models;
|
|
|
|
|
pub use models::gliner_models;
|
2026-01-05 03:38:04 +05:00
|
|
|
|
2026-01-06 23:32:58 +05:00
|
|
|
#[cfg(feature = "jarvis_app")]
|
|
|
|
|
pub mod audio_processing;
|
|
|
|
|
|
2026-01-07 00:15:36 +05:00
|
|
|
#[cfg(feature = "jarvis_app")]
|
|
|
|
|
pub mod ipc;
|
|
|
|
|
|
2026-01-07 23:29:46 +05:00
|
|
|
pub mod voices;
|
|
|
|
|
|
2026-01-08 00:35:21 +05:00
|
|
|
pub mod audio_buffer;
|
|
|
|
|
|
2026-01-17 05:46:38 +05:00
|
|
|
#[cfg(feature = "lua")]
|
|
|
|
|
pub mod lua;
|
|
|
|
|
|
2026-01-04 05:19:47 +05:00
|
|
|
// shared statics
|
2026-01-05 03:38:04 +05:00
|
|
|
// pub static APP_DIR: Lazy<PathBuf> = Lazy::new(|| std::env::current_dir().unwrap());
|
|
|
|
|
pub static APP_DIR: Lazy<PathBuf> = 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())
|
|
|
|
|
});
|
2026-01-07 23:29:46 +05:00
|
|
|
pub static SOUND_DIR: Lazy<PathBuf> = Lazy::new(|| APP_DIR.clone().join(config::SOUND_PATH));
|
2026-01-04 05:19:47 +05:00
|
|
|
pub static APP_DIRS: OnceCell<AppDirs> = OnceCell::new();
|
|
|
|
|
pub static APP_CONFIG_DIR: OnceCell<PathBuf> = OnceCell::new();
|
|
|
|
|
pub static APP_LOG_DIR: OnceCell<PathBuf> = OnceCell::new();
|
2026-01-04 09:00:51 +05:00
|
|
|
pub static DB: OnceCell<Arc<RwLock<db::structs::Settings>>> = OnceCell::new();
|
2026-01-05 01:22:45 +05:00
|
|
|
pub static COMMANDS_LIST: OnceCell<Vec<JCommandsList>> = OnceCell::new();
|
2026-01-04 05:19:47 +05:00
|
|
|
|
|
|
|
|
// re-exports
|
2026-01-05 01:22:45 +05:00
|
|
|
pub use commands::JCommandsList;
|
2026-01-04 05:19:47 +05:00
|
|
|
pub use config::structs::*;
|
2026-01-05 01:22:45 +05:00
|
|
|
pub use db::structs::Settings;
|
2026-02-18 21:08:48 +05:00
|
|
|
pub use db::SettingsManager;
|
2026-01-05 01:22:45 +05:00
|
|
|
|
|
|
|
|
// use crate::commands::{JComandsList, JCommand};
|