feat: add skill update detection via SHA-256 content hashing

- Add content_hash and updated_at fields to skills table (DB migration v6→v7)
- Compute directory content hash on install/import/restore for version tracking
- Add check_updates command: downloads repos, compares hashes, returns update list
- Add update_skill command: backs up old files, re-downloads and replaces SSOT
- Backfill content_hash for existing skills on first update check
- Add "Check Updates" button and per-skill update badge/button in UnifiedSkillsPanel
- Add i18n keys for zh/en/ja
This commit is contained in:
Jason
2026-04-05 19:19:01 +08:00
parent 46488ecd93
commit e3179ad9e4
13 changed files with 660 additions and 14 deletions
+6
View File
@@ -174,6 +174,12 @@ pub struct InstalledSkill {
pub apps: SkillApps,
/// 安装时间(Unix 时间戳)
pub installed_at: i64,
/// 内容哈希(SHA-256,用于更新检测)
#[serde(skip_serializing_if = "Option::is_none")]
pub content_hash: Option<String>,
/// 最近更新时间(Unix 时间戳,0 = 从未更新)
#[serde(default)]
pub updated_at: i64,
}
/// 未管理的 Skill(在应用目录中发现但未被 CC Switch 管理)