mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
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:
@@ -25,6 +25,8 @@ export interface InstalledSkill {
|
||||
readmeUrl?: string;
|
||||
apps: SkillApps;
|
||||
installedAt: number;
|
||||
contentHash?: string;
|
||||
updatedAt: number;
|
||||
}
|
||||
|
||||
export interface SkillUninstallResult {
|
||||
@@ -78,6 +80,14 @@ export interface Skill {
|
||||
repoBranch?: string;
|
||||
}
|
||||
|
||||
/** Skill 更新信息 */
|
||||
export interface SkillUpdateInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
currentHash?: string;
|
||||
remoteHash: string;
|
||||
}
|
||||
|
||||
/** 仓库配置 */
|
||||
export interface SkillRepo {
|
||||
owner: string;
|
||||
@@ -149,6 +159,16 @@ export const skillsApi = {
|
||||
return await invoke("discover_available_skills");
|
||||
},
|
||||
|
||||
/** 检查 Skills 更新 */
|
||||
async checkUpdates(): Promise<SkillUpdateInfo[]> {
|
||||
return await invoke("check_skill_updates");
|
||||
},
|
||||
|
||||
/** 更新单个 Skill */
|
||||
async updateSkill(id: string): Promise<InstalledSkill> {
|
||||
return await invoke("update_skill", { id });
|
||||
},
|
||||
|
||||
// ========== 兼容旧 API ==========
|
||||
|
||||
/** 获取技能列表(兼容旧 API) */
|
||||
|
||||
Reference in New Issue
Block a user