pub mod activity;
pub mod commands;
pub mod component_detection;
pub mod helper;
pub mod models;
pub mod process;
pub mod singbox_service;
pub mod storage;
pub mod subscription;
pub mod validation;

pub mod adapters {
    pub mod proxifyre;
    pub mod proxy_router;
    pub mod singbox;
}

pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_dialog::init())
        .manage(commands::CommandState::default())
        .invoke_handler(tauri::generate_handler![
            commands::get_status,
            commands::get_admin_status,
            commands::restart_as_admin,
            commands::get_startup_snapshot,
            commands::get_profiles,
            commands::get_saved_state,
            commands::save_profile,
            commands::get_targets,
            commands::save_target,
            commands::get_components,
            commands::get_proxifyre_setup_status,
            commands::get_singbox_status,
            commands::get_singbox_setup_status,
            commands::resolve_profile_preview,
            commands::save_singbox_subscription,
            commands::fetch_singbox_subscription,
            commands::forget_singbox_subscription,
            commands::select_singbox_server,
            commands::ping_singbox_server,
            commands::ping_all_singbox_servers,
            commands::ping_proxy_target,
            commands::generate_singbox_config,
            commands::apply_profiles,
            commands::get_logs,
            commands::open_config_location,
            commands::start_proxifyre_service,
            commands::stop_proxifyre_service,
            commands::install_proxifyre,
            commands::uninstall_proxifyre,
            commands::start_singbox_service,
            commands::stop_singbox_service,
            commands::install_singbox,
            commands::uninstall_singbox
        ])
        .run(tauri::generate_context!())
        .expect("не удалось запустить клиент ProxyWarden");
}
