@suwujs/codex-vault 0.3.1 → 0.3.3
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/bin/cli.js +2 -38
- package/package.json +1 -1
- package/plugin/VERSION +1 -1
package/bin/cli.js
CHANGED
|
@@ -205,8 +205,7 @@ function cmdUninstall() {
|
|
|
205
205
|
// 7. Clean CLAUDE.md
|
|
206
206
|
cleanInstructionFile(path.join(cwd, 'CLAUDE.md'), 'CLAUDE.md');
|
|
207
207
|
|
|
208
|
-
// 8.
|
|
209
|
-
cleanAgentsMd(cwd);
|
|
208
|
+
// 8. AGENTS.md — leave untouched (may contain user's own agent instructions)
|
|
210
209
|
|
|
211
210
|
// Summary
|
|
212
211
|
console.log('\ncodex-vault has been uninstalled.');
|
|
@@ -270,7 +269,6 @@ function cleanHooksJson(filePath, label) {
|
|
|
270
269
|
if (Object.keys(data).length === 0) {
|
|
271
270
|
fs.unlinkSync(filePath);
|
|
272
271
|
console.log(` [x] Removed ${label} (empty after cleanup)`);
|
|
273
|
-
cleanEmptyParents(path.dirname(filePath));
|
|
274
272
|
} else {
|
|
275
273
|
fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n');
|
|
276
274
|
console.log(` [x] Cleaned codex-vault hooks from ${label}`);
|
|
@@ -303,7 +301,6 @@ function cleanCodexConfigToml(cwd) {
|
|
|
303
301
|
if (content.trim() === '') {
|
|
304
302
|
fs.unlinkSync(filePath);
|
|
305
303
|
console.log(' [x] Removed .codex/config.toml (empty after cleanup)');
|
|
306
|
-
cleanEmptyParents(path.dirname(filePath));
|
|
307
304
|
} else {
|
|
308
305
|
fs.writeFileSync(filePath, content);
|
|
309
306
|
console.log(' [x] Cleaned codex_hooks from .codex/config.toml');
|
|
@@ -330,12 +327,9 @@ function removeSkills(agentDir, label, skillNames) {
|
|
|
330
327
|
|
|
331
328
|
console.log(` [x] Removed ${removed} skills from ${label}/skills/`);
|
|
332
329
|
|
|
333
|
-
// Clean up empty
|
|
330
|
+
// Clean up empty skills/ directory only — never delete the agent dir itself
|
|
334
331
|
if (isDirEmpty(skillsDir)) {
|
|
335
332
|
fs.rmdirSync(skillsDir);
|
|
336
|
-
if (isDirEmpty(agentDir)) {
|
|
337
|
-
fs.rmdirSync(agentDir);
|
|
338
|
-
}
|
|
339
333
|
}
|
|
340
334
|
}
|
|
341
335
|
|
|
@@ -397,26 +391,6 @@ function cleanInstructionFile(filePath, label) {
|
|
|
397
391
|
}
|
|
398
392
|
}
|
|
399
393
|
|
|
400
|
-
/**
|
|
401
|
-
* Handle AGENTS.md: if it's just "@CLAUDE.md", delete it.
|
|
402
|
-
* Otherwise apply the same section-removal logic as CLAUDE.md.
|
|
403
|
-
*/
|
|
404
|
-
function cleanAgentsMd(cwd) {
|
|
405
|
-
const filePath = path.join(cwd, 'AGENTS.md');
|
|
406
|
-
if (!fs.existsSync(filePath)) return;
|
|
407
|
-
|
|
408
|
-
const content = fs.readFileSync(filePath, 'utf8');
|
|
409
|
-
|
|
410
|
-
// If content is just @CLAUDE.md (possibly with whitespace), delete the file
|
|
411
|
-
if (content.trim() === '@CLAUDE.md') {
|
|
412
|
-
fs.unlinkSync(filePath);
|
|
413
|
-
console.log(' [x] Removed AGENTS.md (@CLAUDE.md reference)');
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
// Otherwise, apply the same section-removal logic
|
|
418
|
-
cleanInstructionFile(filePath, 'AGENTS.md');
|
|
419
|
-
}
|
|
420
394
|
|
|
421
395
|
/**
|
|
422
396
|
* Check if a directory is empty.
|
|
@@ -430,13 +404,3 @@ function isDirEmpty(dirPath) {
|
|
|
430
404
|
}
|
|
431
405
|
}
|
|
432
406
|
|
|
433
|
-
/**
|
|
434
|
-
* Remove empty parent directories up to (but not including) cwd.
|
|
435
|
-
*/
|
|
436
|
-
function cleanEmptyParents(dirPath) {
|
|
437
|
-
const cwd = process.cwd();
|
|
438
|
-
if (dirPath === cwd || !dirPath.startsWith(cwd)) return;
|
|
439
|
-
if (isDirEmpty(dirPath)) {
|
|
440
|
-
fs.rmdirSync(dirPath);
|
|
441
|
-
}
|
|
442
|
-
}
|
package/package.json
CHANGED
package/plugin/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.3
|