diff --git a/src-tauri/src/commands/process.rs b/src-tauri/src/commands/process.rs index 1f7b786..9e54478 100644 --- a/src-tauri/src/commands/process.rs +++ b/src-tauri/src/commands/process.rs @@ -64,6 +64,36 @@ pub async fn check_port_in_use(port: u16) -> Result { } } +#[derive(serde::Serialize)] +pub struct SecureVersionInfo { + pub current_version: String, + pub is_secure: bool, +} + +/// Check if current OpenClaw version is secure (>= 2026.1.29) +#[command] +pub async fn check_secure_version() -> Result { + info!("[Process Check] Checking OpenClaw version security..."); + match shell::run_openclaw(&["--version"]) { + Ok(version) => { + let v = version.trim().to_string(); + // Basic string comparison assuming YYYY.M.D format + let is_secure = v >= "2026.1.29".to_string(); + + info!("[Process Check] Version: {}, Secure: {}", v, is_secure); + Ok(SecureVersionInfo { + current_version: v, + is_secure, + }) + }, + Err(e) => { + debug!("[Process Check] Failed to get version for security check: {}", e); + // If we can't get version, assume insecure or handle error + Err(e) + }, + } +} + /// Get Node.js version #[command] pub async fn get_node_version() -> Result, String> { diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 130570a..379a89e 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -34,6 +34,7 @@ fn main() { // Process management process::check_openclaw_installed, process::get_openclaw_version, + process::check_secure_version, process::check_port_in_use, // Configuration management config::get_config,