mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
feat: integrate skills.sh search for discovering skills from public registry
Add skills.sh API integration allowing users to search and install from a catalog of 91K+ agent skills directly within CC Switch. The search results are converted to DiscoverableSkill objects and reuse the existing install pipeline. Includes fallback directory search for repos where skills are nested in subdirectories, and filters out non-GitHub sources.
This commit is contained in:
@@ -95,6 +95,25 @@ export interface MigrationResult {
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
/** skills.sh 可发现的技能 */
|
||||
export interface SkillsShDiscoverableSkill {
|
||||
key: string;
|
||||
name: string;
|
||||
directory: string;
|
||||
repoOwner: string;
|
||||
repoName: string;
|
||||
repoBranch: string;
|
||||
installs: number;
|
||||
readmeUrl?: string;
|
||||
}
|
||||
|
||||
/** skills.sh 搜索结果 */
|
||||
export interface SkillsShSearchResult {
|
||||
skills: SkillsShDiscoverableSkill[];
|
||||
totalCount: number;
|
||||
query: string;
|
||||
}
|
||||
|
||||
/** 仓库配置 */
|
||||
export interface SkillRepo {
|
||||
owner: string;
|
||||
@@ -183,6 +202,15 @@ export const skillsApi = {
|
||||
return await invoke("migrate_skill_storage", { target });
|
||||
},
|
||||
|
||||
/** 搜索 skills.sh 公共目录 */
|
||||
async searchSkillsSh(
|
||||
query: string,
|
||||
limit: number,
|
||||
offset: number,
|
||||
): Promise<SkillsShSearchResult> {
|
||||
return await invoke("search_skills_sh", { query, limit, offset });
|
||||
},
|
||||
|
||||
// ========== 兼容旧 API ==========
|
||||
|
||||
/** 获取技能列表(兼容旧 API) */
|
||||
|
||||
Reference in New Issue
Block a user