@chakresh/kresh 0.1.21 → 0.1.25
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
CHANGED
package/src/commands/install.js
CHANGED
|
@@ -18,15 +18,27 @@ export async function installSkill(skillSlug, isRetry = false, options = {}) {
|
|
|
18
18
|
const { skillContent, files, ...metadata } = response.data;
|
|
19
19
|
spinner.stop();
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const isAgent = metadata.category === 'AGENTS.md/CLAUDE.md' || metadata.category === 'AGENT.md/CLAUDE.md' || metadata.category === 'Agents';
|
|
22
|
+
const isDesign = metadata.category === 'Design.md';
|
|
23
|
+
|
|
24
|
+
if (isAgent || isDesign) {
|
|
25
|
+
let fileName;
|
|
26
|
+
if (isDesign) {
|
|
27
|
+
fileName = metadata.name;
|
|
28
|
+
if (!fileName.toLowerCase().endsWith('.md')) {
|
|
29
|
+
fileName += '.md';
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
} else {
|
|
32
|
+
const answer = await inquirer.prompt([
|
|
33
|
+
{
|
|
34
|
+
type: 'list',
|
|
35
|
+
name: 'fileName',
|
|
36
|
+
message: 'This is an Agent or Claude config. Where would you like to save it?',
|
|
37
|
+
choices: ['AGENTS.md', 'CLAUDE.md', 'Standard skills folder']
|
|
38
|
+
}
|
|
39
|
+
]);
|
|
40
|
+
fileName = answer.fileName;
|
|
41
|
+
}
|
|
30
42
|
|
|
31
43
|
if (fileName !== 'Standard skills folder') {
|
|
32
44
|
const rootDir = await getWorkspaceRoot();
|
|
@@ -79,6 +79,15 @@ export async function writeLocalSkill(slug, skillContent, metadata, baseDir = 's
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
await fs.writeFile(path.join(targetDir, 'metadata.json'), JSON.stringify(metadata, null, 2), 'utf8');
|
|
82
|
+
|
|
83
|
+
// Touch the workspace root to trigger IDE file watchers (like VS Code) to refresh their file explorers
|
|
84
|
+
try {
|
|
85
|
+
const now = new Date();
|
|
86
|
+
await fs.utimes(rootDir, now, now);
|
|
87
|
+
} catch (e) {
|
|
88
|
+
// Ignore if we can't touch the root directory
|
|
89
|
+
}
|
|
90
|
+
|
|
82
91
|
return targetDir;
|
|
83
92
|
} catch (error) {
|
|
84
93
|
console.error(`Failed to write skill files in the ${baseDir} directory:`, error);
|