skillstore 0.0.1 → 0.1.0
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/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +21 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/install.d.ts +35 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +272 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/plugin/index.d.ts +3 -0
- package/dist/commands/plugin/index.d.ts.map +1 -0
- package/dist/commands/plugin/index.js +13 -0
- package/dist/commands/plugin/index.js.map +1 -0
- package/dist/commands/plugin/info.d.ts +9 -0
- package/dist/commands/plugin/info.d.ts.map +1 -0
- package/dist/commands/plugin/info.js +75 -0
- package/dist/commands/plugin/info.js.map +1 -0
- package/dist/commands/plugin/install.d.ts +29 -0
- package/dist/commands/plugin/install.d.ts.map +1 -0
- package/dist/commands/plugin/install.js +140 -0
- package/dist/commands/plugin/install.js.map +1 -0
- package/dist/commands/plugin/list.d.ts +22 -0
- package/dist/commands/plugin/list.d.ts.map +1 -0
- package/dist/commands/plugin/list.js +76 -0
- package/dist/commands/plugin/list.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/plugin-api.d.ts +155 -0
- package/dist/lib/plugin-api.d.ts.map +1 -0
- package/dist/lib/plugin-api.js +173 -0
- package/dist/lib/plugin-api.js.map +1 -0
- package/dist/lib/plugin-config.d.ts +56 -0
- package/dist/lib/plugin-config.d.ts.map +1 -0
- package/dist/lib/plugin-config.js +64 -0
- package/dist/lib/plugin-config.js.map +1 -0
- package/dist/lib/plugin-download.d.ts +36 -0
- package/dist/lib/plugin-download.d.ts.map +1 -0
- package/dist/lib/plugin-download.js +134 -0
- package/dist/lib/plugin-download.js.map +1 -0
- package/dist/lib/plugin-logger.d.ts +79 -0
- package/dist/lib/plugin-logger.d.ts.map +1 -0
- package/dist/lib/plugin-logger.js +173 -0
- package/dist/lib/plugin-logger.js.map +1 -0
- package/dist/lib/plugin-verify.d.ts +36 -0
- package/dist/lib/plugin-verify.d.ts.map +1 -0
- package/dist/lib/plugin-verify.js +103 -0
- package/dist/lib/plugin-verify.js.map +1 -0
- package/dist/lib/skill-api.d.ts +33 -0
- package/dist/lib/skill-api.d.ts.map +1 -0
- package/dist/lib/skill-api.js +64 -0
- package/dist/lib/skill-api.js.map +1 -0
- package/package.json +56 -17
- package/src/index.js +0 -16
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** API Error */
|
|
2
|
+
export class SkillApiError extends Error {
|
|
3
|
+
statusCode;
|
|
4
|
+
code;
|
|
5
|
+
constructor(message, statusCode, code) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.statusCode = statusCode;
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.name = 'SkillApiError';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get the API endpoint for skill info
|
|
14
|
+
*/
|
|
15
|
+
function getSkillInfoUrl(config, skillSlug) {
|
|
16
|
+
return `${config.apiBaseUrl}/skills/${skillSlug}`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the download URL for a skill
|
|
20
|
+
*/
|
|
21
|
+
function getSkillDownloadUrl(config, skillSlug) {
|
|
22
|
+
return `${config.apiBaseUrl}/skills/${skillSlug}/download`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fetch skill info/details
|
|
26
|
+
*/
|
|
27
|
+
export async function fetchSkillInfo(config, skillSlug) {
|
|
28
|
+
const url = getSkillInfoUrl(config, skillSlug);
|
|
29
|
+
const response = await fetch(url, {
|
|
30
|
+
method: 'GET',
|
|
31
|
+
headers: {
|
|
32
|
+
Accept: 'application/json',
|
|
33
|
+
},
|
|
34
|
+
signal: AbortSignal.timeout(config.timeout),
|
|
35
|
+
});
|
|
36
|
+
if (!response.ok) {
|
|
37
|
+
const errorText = await response.text().catch(() => 'Unknown error');
|
|
38
|
+
let errorData = {};
|
|
39
|
+
try {
|
|
40
|
+
errorData = JSON.parse(errorText);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Not JSON
|
|
44
|
+
}
|
|
45
|
+
throw new SkillApiError(errorData.error || `Failed to fetch skill info: ${response.statusText}`, response.status, errorData.code);
|
|
46
|
+
}
|
|
47
|
+
const result = (await response.json());
|
|
48
|
+
return result.data;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Download skill as ZIP
|
|
52
|
+
*/
|
|
53
|
+
export async function downloadSkillZip(config, skillSlug) {
|
|
54
|
+
const url = getSkillDownloadUrl(config, skillSlug);
|
|
55
|
+
const response = await fetch(url, {
|
|
56
|
+
method: 'GET',
|
|
57
|
+
signal: AbortSignal.timeout(config.timeout * 2), // Longer timeout for download
|
|
58
|
+
});
|
|
59
|
+
if (!response.ok) {
|
|
60
|
+
throw new SkillApiError(`Failed to download skill: ${response.statusText}`, response.status);
|
|
61
|
+
}
|
|
62
|
+
return await response.arrayBuffer();
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=skill-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-api.js","sourceRoot":"","sources":["../../src/lib/skill-api.ts"],"names":[],"mappings":"AAqBA,gBAAgB;AAChB,MAAM,OAAO,aAAc,SAAQ,KAAK;IAG/B;IACA;IAHR,YACC,OAAe,EACR,UAAkB,EAClB,IAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAS;QAGpB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC7B,CAAC;CACD;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,MAAoB,EAAE,SAAiB;IAC/D,OAAO,GAAG,MAAM,CAA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GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QACjC,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,8BAA8B;KAC/E,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAClB,MAAM,IAAI,aAAa,CACtB,6BAA6B,QAAQ,CAAC,UAAU,EAAE,EAClD,QAAQ,CAAC,MAAM,CACf,CAAC;IACH,CAAC;IAED,OAAO,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
"name": "skillstore",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Skillstore CLI - AI Skills marketplace for Claude Code",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"skillstore": "dist/cli/index.js"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./plugin": {
|
|
17
|
+
"import": "./dist/lib/plugin-api.js",
|
|
18
|
+
"types": "./dist/lib/plugin-api.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"dev": "tsc --watch",
|
|
27
|
+
"check": "tsc --noEmit",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"test:coverage": "vitest run --coverage",
|
|
31
|
+
"prepublishOnly": "npm run build"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"skillstore",
|
|
35
|
+
"ai",
|
|
36
|
+
"skills",
|
|
37
|
+
"claude",
|
|
38
|
+
"claude-code",
|
|
39
|
+
"codex",
|
|
40
|
+
"cli"
|
|
41
|
+
],
|
|
42
|
+
"author": "",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"citty": "^0.1.6",
|
|
46
|
+
"consola": "^3.2.3",
|
|
47
|
+
"fflate": "^0.8.2"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.10.5",
|
|
51
|
+
"@vitest/coverage-v8": "^3.0.0",
|
|
52
|
+
"typescript": "^5.7.3",
|
|
53
|
+
"vitest": "^3.0.0"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18.0.0"
|
|
57
|
+
}
|
|
19
58
|
}
|
package/src/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skillstore SDK
|
|
3
|
-
* AI Skills marketplace for Claude Code
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export function hello() {
|
|
7
|
-
return 'Hello, World!';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function greet(name) {
|
|
11
|
-
return `Hello, ${name}!`;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
15
|
-
console.log(hello());
|
|
16
|
-
}
|