skillhub 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +51 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4020,12 +4020,20 @@ async function fetchSkillContent(owner, repo, skillPath, branch = "main", source
|
|
|
4020
4020
|
pathsToTry.push(filename);
|
|
4021
4021
|
}
|
|
4022
4022
|
} else {
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4023
|
+
const skillName = skillPath ? skillPath.replace(/^(skills|\.claude\/skills|\.github\/skills)\//, "") : "";
|
|
4024
|
+
pathsToTry = [basePath];
|
|
4025
|
+
if (skillName) {
|
|
4026
|
+
const candidates = [
|
|
4027
|
+
`skills/${skillName}/${filename}`,
|
|
4028
|
+
`.claude/skills/${skillName}/${filename}`,
|
|
4029
|
+
`.github/skills/${skillName}/${filename}`
|
|
4030
|
+
];
|
|
4031
|
+
for (const candidate of candidates) {
|
|
4032
|
+
if (candidate !== basePath) {
|
|
4033
|
+
pathsToTry.push(candidate);
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4029
4037
|
}
|
|
4030
4038
|
for (const pathToTry of pathsToTry) {
|
|
4031
4039
|
try {
|
|
@@ -4047,18 +4055,45 @@ async function fetchSkillContent(owner, repo, skillPath, branch = "main", source
|
|
|
4047
4055
|
}
|
|
4048
4056
|
};
|
|
4049
4057
|
break;
|
|
4050
|
-
} catch
|
|
4051
|
-
|
|
4058
|
+
} catch {
|
|
4059
|
+
continue;
|
|
4052
4060
|
}
|
|
4053
4061
|
}
|
|
4054
4062
|
if (error.status === 404) {
|
|
4055
4063
|
continue;
|
|
4056
4064
|
}
|
|
4065
|
+
if (error.status === 403) {
|
|
4066
|
+
throw new Error(
|
|
4067
|
+
`GitHub API rate limit exceeded. Set GITHUB_TOKEN environment variable for higher rate limits.`
|
|
4068
|
+
);
|
|
4069
|
+
}
|
|
4057
4070
|
throw new Error(`Failed to fetch from GitHub: ${error.message}`);
|
|
4058
4071
|
}
|
|
4059
4072
|
}
|
|
4060
4073
|
if (!skillMdResponse) {
|
|
4061
|
-
|
|
4074
|
+
for (const pathToTry of pathsToTry) {
|
|
4075
|
+
try {
|
|
4076
|
+
const rawContent = await fetchRawFile(owner, repo, pathToTry, branch);
|
|
4077
|
+
skillMdResponse = {
|
|
4078
|
+
data: {
|
|
4079
|
+
content: Buffer.from(rawContent).toString("base64"),
|
|
4080
|
+
encoding: "base64"
|
|
4081
|
+
}
|
|
4082
|
+
};
|
|
4083
|
+
break;
|
|
4084
|
+
} catch {
|
|
4085
|
+
continue;
|
|
4086
|
+
}
|
|
4087
|
+
}
|
|
4088
|
+
}
|
|
4089
|
+
if (!skillMdResponse) {
|
|
4090
|
+
const triedPaths = pathsToTry.map((p) => ` - ${owner}/${repo}/${p}`).join("\n");
|
|
4091
|
+
throw new Error(
|
|
4092
|
+
`${filename} not found at ${owner}/${repo} (tried ${pathsToTry.length} paths):
|
|
4093
|
+
${triedPaths}
|
|
4094
|
+
|
|
4095
|
+
The skill may have been moved or deleted from the repository.`
|
|
4096
|
+
);
|
|
4062
4097
|
}
|
|
4063
4098
|
if (!("content" in skillMdResponse.data)) {
|
|
4064
4099
|
throw new Error(`${filename} not found`);
|
|
@@ -4312,8 +4347,13 @@ async function install(skillId, options2) {
|
|
|
4312
4347
|
if (cachedFiles.sourceFormat) {
|
|
4313
4348
|
sourceFormat = cachedFiles.sourceFormat;
|
|
4314
4349
|
}
|
|
4315
|
-
|
|
4316
|
-
|
|
4350
|
+
const converted = convertCachedFilesToSkillContent(cachedFiles, sourceFormat);
|
|
4351
|
+
if (converted.skillMd) {
|
|
4352
|
+
content = converted;
|
|
4353
|
+
spinner.text = cachedFiles.fromCache ? `Using cached files (${cachedFiles.files.length} files)` : `Downloaded ${cachedFiles.files.length} files via API`;
|
|
4354
|
+
} else {
|
|
4355
|
+
spinner.text = "API returned files but main instruction file missing, falling back...";
|
|
4356
|
+
}
|
|
4317
4357
|
}
|
|
4318
4358
|
} catch {
|
|
4319
4359
|
spinner.text = "API file fetch failed, falling back to GitHub...";
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillhub",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "CLI tool for managing AI Agent skills - search, install, and update skills for Claude, Codex, Copilot, and more",
|
|
5
5
|
"author": "SkillHub Contributors",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/airano-ir/skillhub.git",
|
|
10
10
|
"directory": "apps/cli"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://skills.palebluedot.live",
|