reeeliance-skills 1.0.1 → 1.0.2
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 +7 -3
- package/package.json +1 -1
- package/src/index.ts +8 -3
package/dist/index.js
CHANGED
|
@@ -47,9 +47,14 @@ async function fetchText(url, token) {
|
|
|
47
47
|
throw new Error(`Failed to fetch ${url}: ${res.status} ${res.statusText}`);
|
|
48
48
|
return res.text();
|
|
49
49
|
}
|
|
50
|
+
// Use GitLab API file endpoint (avoids Cloudflare blocking raw URLs)
|
|
51
|
+
async function fetchFileViaApi(filePath, token) {
|
|
52
|
+
const url = `${GITLAB_API}/files/${encodeURIComponent(filePath)}/raw?ref=${GITLAB_BRANCH}`;
|
|
53
|
+
return fetchText(url, token);
|
|
54
|
+
}
|
|
50
55
|
async function loadRemoteManifest(token) {
|
|
51
56
|
process.stdout.write(chalk.dim("Fetching skill list from GitLab…"));
|
|
52
|
-
const text = await
|
|
57
|
+
const text = await fetchFileViaApi("skills.json", token);
|
|
53
58
|
process.stdout.write(chalk.dim(" done\n"));
|
|
54
59
|
return JSON.parse(text);
|
|
55
60
|
}
|
|
@@ -64,8 +69,7 @@ async function installRemoteSkill(skill, targetDir, token) {
|
|
|
64
69
|
const entries = await listRemoteTree(skill.path, token);
|
|
65
70
|
const files = entries.filter((e) => e.type === "blob");
|
|
66
71
|
for (const file of files) {
|
|
67
|
-
const
|
|
68
|
-
const content = await fetchText(rawUrl, token);
|
|
72
|
+
const content = await fetchFileViaApi(file.path, token);
|
|
69
73
|
const relative = file.path.slice(skill.path.length + 1);
|
|
70
74
|
const destFile = join(destDir, relative);
|
|
71
75
|
mkdirSync(dirname(destFile), { recursive: true });
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -71,9 +71,15 @@ async function fetchText(url: string, token: string): Promise<string> {
|
|
|
71
71
|
return res.text();
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
// Use GitLab API file endpoint (avoids Cloudflare blocking raw URLs)
|
|
75
|
+
async function fetchFileViaApi(filePath: string, token: string): Promise<string> {
|
|
76
|
+
const url = `${GITLAB_API}/files/${encodeURIComponent(filePath)}/raw?ref=${GITLAB_BRANCH}`;
|
|
77
|
+
return fetchText(url, token);
|
|
78
|
+
}
|
|
79
|
+
|
|
74
80
|
async function loadRemoteManifest(token: string): Promise<Manifest> {
|
|
75
81
|
process.stdout.write(chalk.dim("Fetching skill list from GitLab…"));
|
|
76
|
-
const text = await
|
|
82
|
+
const text = await fetchFileViaApi("skills.json", token);
|
|
77
83
|
process.stdout.write(chalk.dim(" done\n"));
|
|
78
84
|
return JSON.parse(text);
|
|
79
85
|
}
|
|
@@ -92,8 +98,7 @@ async function installRemoteSkill(skill: Skill, targetDir: string, token: string
|
|
|
92
98
|
const files = entries.filter((e) => e.type === "blob");
|
|
93
99
|
|
|
94
100
|
for (const file of files) {
|
|
95
|
-
const
|
|
96
|
-
const content = await fetchText(rawUrl, token);
|
|
101
|
+
const content = await fetchFileViaApi(file.path, token);
|
|
97
102
|
const relative = file.path.slice(skill.path.length + 1);
|
|
98
103
|
const destFile = join(destDir, relative);
|
|
99
104
|
mkdirSync(dirname(destFile), { recursive: true });
|