@sstar/skill-install 1.1.0 → 1.1.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/dist/cli.js
CHANGED
|
@@ -165,6 +165,55 @@ program
|
|
|
165
165
|
}
|
|
166
166
|
// Handle Marketplace installation
|
|
167
167
|
if (result.packageType === types_1.PackageType.MARKETPLACE && result.singleSkillResult?.marketplaceResult) {
|
|
168
|
+
// Plugins only support Claude Code, not Codex
|
|
169
|
+
// For Codex, fallback to skill installation
|
|
170
|
+
if (aiTool === 'codex') {
|
|
171
|
+
console.log('');
|
|
172
|
+
console.log(`${colors.yellow}⚠ Note: Plugins and Marketplaces are only supported for Claude Code.${colors.reset}`);
|
|
173
|
+
console.log(` Selected AI Tool: ${colors.cyan}Codex${colors.reset}`);
|
|
174
|
+
console.log(` Scanning for Skills in this package...`);
|
|
175
|
+
console.log('');
|
|
176
|
+
// Re-scan for skills in the package
|
|
177
|
+
const skills = await installer.scanForSkills(result.tempDir || '');
|
|
178
|
+
if (skills.length > 0) {
|
|
179
|
+
const selectedSkills = await selectSkillsFromPackage(skills);
|
|
180
|
+
if (selectedSkills.length > 0) {
|
|
181
|
+
const installResults = await installer.installSelectedSkills(selectedSkills, result.tempDir || '', {
|
|
182
|
+
source,
|
|
183
|
+
skillsDir,
|
|
184
|
+
username,
|
|
185
|
+
password,
|
|
186
|
+
allowSelfSigned: options.allowSelfSigned,
|
|
187
|
+
force: options.force
|
|
188
|
+
});
|
|
189
|
+
// Display results
|
|
190
|
+
console.log('');
|
|
191
|
+
let successCount = 0;
|
|
192
|
+
let failCount = 0;
|
|
193
|
+
for (const res of installResults) {
|
|
194
|
+
if (res.success) {
|
|
195
|
+
console.log(`✓ Skill "${res.skillName}" installed successfully!`);
|
|
196
|
+
console.log(` Path: ${res.skillPath}`);
|
|
197
|
+
successCount++;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
console.error(`✗ Failed to install skill: ${res.error}`);
|
|
201
|
+
failCount++;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
console.log('');
|
|
205
|
+
console.log(`Installation complete: ${successCount} succeeded, ${failCount} failed.`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
console.log('No Skills found in this package.');
|
|
210
|
+
}
|
|
211
|
+
// Clean up temp directory
|
|
212
|
+
if (result.tempDir) {
|
|
213
|
+
await installer.cleanup(result.tempDir);
|
|
214
|
+
}
|
|
215
|
+
process.exit(0);
|
|
216
|
+
}
|
|
168
217
|
const marketplaceResult = result.singleSkillResult.marketplaceResult;
|
|
169
218
|
const pluginManager = new plugin_manager_1.PluginManager();
|
|
170
219
|
console.log('');
|
|
@@ -234,6 +283,55 @@ program
|
|
|
234
283
|
}
|
|
235
284
|
// Handle Plugin installation
|
|
236
285
|
if (result.packageType === types_1.PackageType.PLUGIN && result.singleSkillResult?.pluginResult) {
|
|
286
|
+
// Plugins only support Claude Code, not Codex
|
|
287
|
+
// For Codex, fallback to skill installation
|
|
288
|
+
if (aiTool === 'codex') {
|
|
289
|
+
console.log('');
|
|
290
|
+
console.log(`${colors.yellow}⚠ Note: Plugins are only supported for Claude Code.${colors.reset}`);
|
|
291
|
+
console.log(` Selected AI Tool: ${colors.cyan}Codex${colors.reset}`);
|
|
292
|
+
console.log(` Scanning for Skills in this package...`);
|
|
293
|
+
console.log('');
|
|
294
|
+
// Re-scan for skills in the package
|
|
295
|
+
const skills = await installer.scanForSkills(result.tempDir || '');
|
|
296
|
+
if (skills.length > 0) {
|
|
297
|
+
const selectedSkills = await selectSkillsFromPackage(skills);
|
|
298
|
+
if (selectedSkills.length > 0) {
|
|
299
|
+
const installResults = await installer.installSelectedSkills(selectedSkills, result.tempDir || '', {
|
|
300
|
+
source,
|
|
301
|
+
skillsDir,
|
|
302
|
+
username,
|
|
303
|
+
password,
|
|
304
|
+
allowSelfSigned: options.allowSelfSigned,
|
|
305
|
+
force: options.force
|
|
306
|
+
});
|
|
307
|
+
// Display results
|
|
308
|
+
console.log('');
|
|
309
|
+
let successCount = 0;
|
|
310
|
+
let failCount = 0;
|
|
311
|
+
for (const res of installResults) {
|
|
312
|
+
if (res.success) {
|
|
313
|
+
console.log(`✓ Skill "${res.skillName}" installed successfully!`);
|
|
314
|
+
console.log(` Path: ${res.skillPath}`);
|
|
315
|
+
successCount++;
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
console.error(`✗ Failed to install skill: ${res.error}`);
|
|
319
|
+
failCount++;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
console.log('');
|
|
323
|
+
console.log(`Installation complete: ${successCount} succeeded, ${failCount} failed.`);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
console.log('No Skills found in this package.');
|
|
328
|
+
}
|
|
329
|
+
// Clean up temp directory
|
|
330
|
+
if (result.tempDir) {
|
|
331
|
+
await installer.cleanup(result.tempDir);
|
|
332
|
+
}
|
|
333
|
+
process.exit(0);
|
|
334
|
+
}
|
|
237
335
|
const pluginResult = result.singleSkillResult.pluginResult;
|
|
238
336
|
console.log('');
|
|
239
337
|
console.log(`${colors.cyan}🔌 Plugin installed successfully!${colors.reset}`);
|
|
@@ -86,6 +86,11 @@ export declare class InstallService {
|
|
|
86
86
|
* Searches recursively for all directories containing SKILL.md
|
|
87
87
|
*/
|
|
88
88
|
private findAllSkillDirectories;
|
|
89
|
+
/**
|
|
90
|
+
* Scan for skills in an extracted directory (for Codex fallback)
|
|
91
|
+
* Returns a list of skills that can be selected for installation
|
|
92
|
+
*/
|
|
93
|
+
scanForSkills(extractDir: string): Promise<SkillInPackage[]>;
|
|
89
94
|
/**
|
|
90
95
|
* Recursively find all directories containing valid SKILL.md
|
|
91
96
|
*/
|
|
@@ -76,11 +76,16 @@ class InstallService {
|
|
|
76
76
|
const packageStructure = await this.packageDetector.detectPackageStructure(extractDir);
|
|
77
77
|
this.logger.info(`Detected package type: ${packageStructure.type}`);
|
|
78
78
|
// Handle based on package type
|
|
79
|
+
let result;
|
|
79
80
|
switch (packageStructure.type) {
|
|
80
81
|
case types_1.PackageType.MARKETPLACE:
|
|
81
|
-
|
|
82
|
+
result = await this.handleMarketplacePackage(extractDir, packageStructure, tempDir);
|
|
83
|
+
keepTempDir = true; // Keep temp dir for marketplace (for Codex fallback)
|
|
84
|
+
return result;
|
|
82
85
|
case types_1.PackageType.PLUGIN:
|
|
83
|
-
|
|
86
|
+
result = await this.handlePluginPackage(extractDir, packageStructure);
|
|
87
|
+
keepTempDir = true; // Keep temp dir for plugin (for Codex fallback)
|
|
88
|
+
return result;
|
|
84
89
|
case types_1.PackageType.SKILL:
|
|
85
90
|
return await this.handleSkillPackage(extractDir, packageStructure, options);
|
|
86
91
|
default:
|
|
@@ -329,6 +334,27 @@ class InstallService {
|
|
|
329
334
|
await this.findSkillDirectoriesRecursive(extractDir, skillDirs);
|
|
330
335
|
return skillDirs;
|
|
331
336
|
}
|
|
337
|
+
/**
|
|
338
|
+
* Scan for skills in an extracted directory (for Codex fallback)
|
|
339
|
+
* Returns a list of skills that can be selected for installation
|
|
340
|
+
*/
|
|
341
|
+
async scanForSkills(extractDir) {
|
|
342
|
+
if (!extractDir) {
|
|
343
|
+
return [];
|
|
344
|
+
}
|
|
345
|
+
const skillDirs = await this.findAllSkillDirectories(extractDir);
|
|
346
|
+
const skills = [];
|
|
347
|
+
for (const skillDir of skillDirs) {
|
|
348
|
+
const metadata = await this.validator.validateOrThrow(skillDir);
|
|
349
|
+
skills.push({
|
|
350
|
+
name: metadata.name,
|
|
351
|
+
description: metadata.description,
|
|
352
|
+
path: skillDir,
|
|
353
|
+
relativePath: (0, path_1.relative)(extractDir, skillDir)
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
return skills;
|
|
357
|
+
}
|
|
332
358
|
/**
|
|
333
359
|
* Recursively find all directories containing valid SKILL.md
|
|
334
360
|
*/
|
package/package.json
CHANGED