joyskills-cli 0.2.7 → 0.2.8
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/package.json +1 -1
- package/src/commands/install.js +32 -0
package/package.json
CHANGED
package/src/commands/install.js
CHANGED
|
@@ -78,6 +78,38 @@ async function resolveAndInstall(skillInput, targetDir, projectRoot, options) {
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
// ── Step 1.5: team:// protocol ──────────────────────────────────
|
|
82
|
+
if (skillInput.startsWith('team://')) {
|
|
83
|
+
const pathPart = skillInput.slice(7); // Remove team://
|
|
84
|
+
const parts = pathPart.split('/');
|
|
85
|
+
const registryName = parts[0];
|
|
86
|
+
const skillName = parts[1];
|
|
87
|
+
|
|
88
|
+
if (!registryName || !skillName) {
|
|
89
|
+
throw new Error(`Invalid team:// URL format: ${skillInput}. Expected: team://<registry>/<skill>`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Load registry config
|
|
93
|
+
const configPath = path.join(JOYSKILL_CONFIG_DIR, 'config.json');
|
|
94
|
+
if (!fs.existsSync(configPath)) {
|
|
95
|
+
throw new Error(`No registries configured. Run: joySkills team add <name> <git-url>`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
99
|
+
const registries = config.registries || {};
|
|
100
|
+
const reg = registries[registryName];
|
|
101
|
+
|
|
102
|
+
if (!reg?.path || !fs.existsSync(reg.path)) {
|
|
103
|
+
throw new Error(`Registry "${registryName}" not found. Run: joySkills team list`);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const hit = await tryInstallFromRegistryDir(skillName, reg.path, targetDir, projectRoot, options, `team:${registryName}`);
|
|
107
|
+
if (!hit) {
|
|
108
|
+
throw new Error(`Skill "${skillName}" not found in registry "${registryName}"`);
|
|
109
|
+
}
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
81
113
|
// ── Step 2: Project-level registry ──────────────────────────────
|
|
82
114
|
const projectRegistryPath = path.join(projectRoot, '.joyskill', 'registry');
|
|
83
115
|
if (!options.registry || options.registry === 'project') {
|