use tauri::{command, AppHandle};
use crate::services::plugin_scanner::{scan_server_directory, perform_scan};

/// Scan a server directory for plugins
#[command]
pub async fn scan_server_dir(app_handle: AppHandle, path: String) -> Result<(), String> {
    scan_server_directory(app_handle, path).await
}

/// Scan a server directory and return the result immediately
#[command]
pub async fn scan_server_dir_sync(app_handle: AppHandle, path: String) -> Result<crate::models::server::ScanResult, String> {
    perform_scan(&app_handle, &path).await
}