mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
feat: add skill storage location toggle between CC Switch and ~/.agents/skills
Allow users to choose between storing skills in CC Switch's managed directory (~/.cc-switch/skills/) or the Agent Skills open standard directory (~/.agents/skills/). Includes migration logic that safely moves files before updating settings, with confirmation dialog for non-empty installations.
This commit is contained in:
@@ -88,6 +88,13 @@ export interface SkillUpdateInfo {
|
||||
remoteHash: string;
|
||||
}
|
||||
|
||||
/** 存储位置迁移结果 */
|
||||
export interface MigrationResult {
|
||||
migratedCount: number;
|
||||
skippedCount: number;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
/** 仓库配置 */
|
||||
export interface SkillRepo {
|
||||
owner: string;
|
||||
@@ -169,6 +176,13 @@ export const skillsApi = {
|
||||
return await invoke("update_skill", { id });
|
||||
},
|
||||
|
||||
/** 迁移 Skill 存储位置 */
|
||||
async migrateStorage(
|
||||
target: "cc_switch" | "unified",
|
||||
): Promise<MigrationResult> {
|
||||
return await invoke("migrate_skill_storage", { target });
|
||||
},
|
||||
|
||||
// ========== 兼容旧 API ==========
|
||||
|
||||
/** 获取技能列表(兼容旧 API) */
|
||||
|
||||
Reference in New Issue
Block a user