mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 18:05:37 +08:00
fix: replace implicit app inference with explicit selection for Skills import and sync
Skills import previously inferred app enablement from filesystem presence, causing incorrect multi-app activation when the same skill directory existed under multiple app paths. Now the frontend submits explicit app selections via ImportSkillSelection, and schema migration preserves a snapshot of legacy app mappings to avoid lossy reconstruction. Also adds reconciliation to sync_to_app (removes disabled/orphaned symlinks) and MCP sync_all_enabled (removes disabled servers from live config).
This commit is contained in:
+10
-2
@@ -48,6 +48,12 @@ export interface UnmanagedSkill {
|
||||
path: string;
|
||||
}
|
||||
|
||||
/** 导入已有 Skill 时提交的应用启用状态 */
|
||||
export interface ImportSkillSelection {
|
||||
directory: string;
|
||||
apps: SkillApps;
|
||||
}
|
||||
|
||||
/** 技能对象(兼容旧 API) */
|
||||
export interface Skill {
|
||||
key: string;
|
||||
@@ -103,8 +109,10 @@ export const skillsApi = {
|
||||
},
|
||||
|
||||
/** 从应用目录导入 Skills */
|
||||
async importFromApps(directories: string[]): Promise<InstalledSkill[]> {
|
||||
return await invoke("import_skills_from_apps", { directories });
|
||||
async importFromApps(
|
||||
imports: ImportSkillSelection[],
|
||||
): Promise<InstalledSkill[]> {
|
||||
return await invoke("import_skills_from_apps", { imports });
|
||||
},
|
||||
|
||||
/** 发现可安装的 Skills(从仓库获取) */
|
||||
|
||||
Reference in New Issue
Block a user