From a4ac9f966419990e764ee77cde1b88b5db660fd9 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 13:33:46 +0000 Subject: [PATCH 1/5] fix: XSS security, panic protection, import/export, search P0 Security: - Fix XSS in loadPrompts() - escape prompt.name, content, tags with escapeHtml() - Fix XSS in showEditPromptModal() - use DOM APIs instead of string interpolation - Remove unused windows crate from root Cargo.toml (service has its own) P1 Features: - Add service thread panic protection with auto-restart (catch_unwind + 3s retry) - Add prompt export (export_prompts command + download JSON) - Add prompt import (import_prompts command + file picker UI) - Add main panel search (search_prompts command + search bar UI) Quick fixes: - Remove duplicate insertBefore call - Remove duplicate innerHTML assignment Co-Authored-By: Ha AI <1134180104@qq.com> --- Cargo.lock | 1 - Cargo.toml | 1 - src/index.html | 19 ++++- src/main.rs | 156 +++++++++++++++++++++++++++++++++++++-- src/main_simple.js | 178 +++++++++++++++++++++++++++++++++++++-------- 5 files changed, 315 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ac4ed1..0ac183b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3126,7 +3126,6 @@ dependencies = [ "tauri-plugin-shell", "tauri-plugin-single-instance", "tokio", - "windows 0.52.0", "winres", ] diff --git a/Cargo.toml b/Cargo.toml index 043fbaf..497e1bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,6 @@ serde_json = "1.0" serde_yaml = "0.9" tokio = { version = "1.0", features = ["full"] } tauri = { version = "2.0.0", features = ["tray-icon"] } -windows = { version = "0.52", features = ["Win32_UI_WindowsAndMessaging", "Win32_UI_Input_KeyboardAndMouse", "Win32_Foundation"] } tauri-plugin-shell = "2.0.0" tauri-plugin-dialog = "2.0.0" tauri-plugin-fs = "2.0.0" diff --git a/src/index.html b/src/index.html index 62f84b8..9554f72 100644 --- a/src/index.html +++ b/src/index.html @@ -38,6 +38,20 @@