@petersobhy/ai-toolkit 1.8.3 → 1.8.5
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/index.js +8 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -79,20 +79,24 @@ async function installSkill(name) {
|
|
|
79
79
|
const skillContent = await get(`${RAW_BASE}/${SKILLS_PATH}/${name}/SKILL.md`);
|
|
80
80
|
fs.mkdirSync(INSTALL_DIR, { recursive: true });
|
|
81
81
|
fs.writeFileSync(path.join(INSTALL_DIR, `${name}.md`), skillContent);
|
|
82
|
-
console.log(` ✓ ${name}.md → ${INSTALL_DIR}`);
|
|
83
82
|
|
|
84
|
-
// Install companion scripts → ~/.
|
|
85
|
-
const scripts = entries.filter(e =>
|
|
83
|
+
// Install companion scripts → ~/.ai-toolkit/scripts/<name>/
|
|
84
|
+
const scripts = entries.filter(e =>
|
|
85
|
+
e.type === 'file' &&
|
|
86
|
+
e.name !== 'SKILL.md' &&
|
|
87
|
+
e.name !== 'README.md' &&
|
|
88
|
+
!e.name.endsWith('.test.mjs')
|
|
89
|
+
);
|
|
86
90
|
if (scripts.length > 0) {
|
|
87
91
|
const scriptDir = path.join(SCRIPTS_DIR, name);
|
|
88
92
|
fs.mkdirSync(scriptDir, { recursive: true });
|
|
89
93
|
for (const script of scripts) {
|
|
90
94
|
const content = await get(`${RAW_BASE}/${SKILLS_PATH}/${name}/${script.name}`);
|
|
91
95
|
fs.writeFileSync(path.join(scriptDir, script.name), content);
|
|
92
|
-
console.log(` ✓ ${script.name} → ${scriptDir}`);
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
|
|
99
|
+
console.log(` ✓ ${name}`);
|
|
96
100
|
return true;
|
|
97
101
|
}
|
|
98
102
|
|