@spardutti/claude-skills 2.30.0 → 2.30.1
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/lib/github.mjs +12 -2
- package/package.json +1 -1
package/lib/github.mjs
CHANGED
|
@@ -34,6 +34,16 @@ function getAuthHeaders() {
|
|
|
34
34
|
return headers;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
// raw.githubusercontent.com is not the API and does not take an API token. Sent
|
|
38
|
+
// one, it answers 503 — measured: the same URL returns 200 without the header
|
|
39
|
+
// and 503 with it. The CLI passed its API headers to every raw fetch, so a
|
|
40
|
+
// machine with `gh auth token` set lost most skill files to "Warning: Failed to
|
|
41
|
+
// fetch ..., skipping" and installed a partial set, while a machine without gh
|
|
42
|
+
// worked fine. Raw needs the User-Agent and nothing else.
|
|
43
|
+
function getRawHeaders() {
|
|
44
|
+
return { "User-Agent": "claude-skills-cli" };
|
|
45
|
+
}
|
|
46
|
+
|
|
37
47
|
async function fetchListing({ apiUrl, label, entryFilter, buildRawUrl, mapEntry, allow404 = false }) {
|
|
38
48
|
const headers = getAuthHeaders();
|
|
39
49
|
const res = await fetch(apiUrl, { headers });
|
|
@@ -51,7 +61,7 @@ async function fetchListing({ apiUrl, label, entryFilter, buildRawUrl, mapEntry,
|
|
|
51
61
|
const results = await Promise.all(
|
|
52
62
|
entries.map(async (entry) => {
|
|
53
63
|
try {
|
|
54
|
-
const r = await fetch(buildRawUrl(entry), { headers });
|
|
64
|
+
const r = await fetch(buildRawUrl(entry), { headers: getRawHeaders() });
|
|
55
65
|
if (!r.ok) {
|
|
56
66
|
console.warn(` Warning: Failed to fetch ${label} ${entry.name}, skipping`);
|
|
57
67
|
return null;
|
|
@@ -92,7 +102,7 @@ export async function fetchSkills() {
|
|
|
92
102
|
|
|
93
103
|
const fetched = await Promise.all(
|
|
94
104
|
files.map(async (f) => {
|
|
95
|
-
const r = await fetch(`${RAW_BASE}/${dir.name}/${f.name}`, { headers });
|
|
105
|
+
const r = await fetch(`${RAW_BASE}/${dir.name}/${f.name}`, { headers: getRawHeaders() });
|
|
96
106
|
if (!r.ok) {
|
|
97
107
|
console.warn(` Warning: Failed to fetch ${dir.name}/${f.name}, skipping`);
|
|
98
108
|
return null;
|