bigpowers 2.87.3 → 2.87.4
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/.pi/package.json +1 -1
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/scripts/lib/__pycache__/link_utils.cpython-312.pyc +0 -0
- package/scripts/lib/__pycache__/srp_engine_links.cpython-312.pyc +0 -0
- package/scripts/lib/install-helpers.js +147 -20
- package/scripts/test-install-helpers.js +110 -0
package/.pi/package.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.87.4](https://github.com/danielvm-git/bigpowers/compare/v2.87.3...v2.87.4) (2026-08-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **install:** uninstall menu now removes symlinks for all 18 tools and local installs ([#110](https://github.com/danielvm-git/bigpowers/issues/110)) ([5e8ae1c](https://github.com/danielvm-git/bigpowers/commit/5e8ae1ccd6a127502edde2b0dfb93a28609e82a3))
|
|
7
|
+
|
|
1
8
|
## [2.87.3](https://github.com/danielvm-git/bigpowers/compare/v2.87.2...v2.87.3) (2026-08-07)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -404,23 +404,23 @@ function installLocal(tool, repoRoot) {
|
|
|
404
404
|
|
|
405
405
|
function uninstallTool(toolId, repoRoot) {
|
|
406
406
|
const homeDir = require('os').homedir();
|
|
407
|
+
// installLocal() resolves its own targets from process.cwd() at call time
|
|
408
|
+
// (bin/setup.js never passes a mode/cwd into uninstallTool), so the
|
|
409
|
+
// interactive Uninstall menu — which offers no global/local choice — must
|
|
410
|
+
// clean whichever scope was actually installed into. Previously this
|
|
411
|
+
// function only ever touched homeDir: a local install (`bigpowers install`
|
|
412
|
+
// → Local) was reported as "removed" but every local symlink survived.
|
|
413
|
+
const cwd = process.cwd();
|
|
407
414
|
|
|
408
415
|
switch (toolId) {
|
|
409
416
|
case 'claude': {
|
|
410
|
-
|
|
411
|
-
if (fs.existsSync(skillsDir)) {
|
|
412
|
-
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
413
|
-
if (!entry.isSymbolicLink()) continue;
|
|
414
|
-
const target = fs.readlinkSync(path.join(skillsDir, entry.name));
|
|
415
|
-
if (target.startsWith(repoRoot)) {
|
|
416
|
-
removeSymlink(path.join(skillsDir, entry.name));
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
417
|
+
removeRepoRootedSkillLinks(path.join(homeDir, '.claude', 'skills'), repoRoot);
|
|
420
418
|
const hooksDir = path.join(homeDir, '.claude', 'hooks');
|
|
421
419
|
removeSymlink(path.join(hooksDir, 'block-dangerous-git.sh'));
|
|
422
420
|
removeSymlink(path.join(hooksDir, 'rtk-rewrite.sh'));
|
|
423
421
|
removeSymlink(path.join(hooksDir, 'lib'));
|
|
422
|
+
// installLocal('claude') only links skills/ (no hooks) into cwd/.claude/skills
|
|
423
|
+
removeRepoRootedSkillLinks(path.join(cwd, '.claude', 'skills'), repoRoot);
|
|
424
424
|
break;
|
|
425
425
|
}
|
|
426
426
|
case 'gemini':
|
|
@@ -434,18 +434,12 @@ function uninstallTool(toolId, repoRoot) {
|
|
|
434
434
|
]) {
|
|
435
435
|
removeSymlink(path.join(homeDir, '.gemini', 'hooks', hookFile));
|
|
436
436
|
}
|
|
437
|
+
// installLocal('gemini') links repoRoot/.gemini/extensions/bigpowers into cwd
|
|
438
|
+
removeSymlink(path.join(cwd, '.gemini', 'extensions', 'bigpowers'));
|
|
437
439
|
break;
|
|
438
440
|
case 'pi': {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
442
|
-
if (!entry.isSymbolicLink()) continue;
|
|
443
|
-
const target = fs.readlinkSync(path.join(skillsDir, entry.name));
|
|
444
|
-
if (target.startsWith(repoRoot)) {
|
|
445
|
-
removeSymlink(path.join(skillsDir, entry.name));
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
441
|
+
removeRepoRootedSkillLinks(path.join(homeDir, '.pi', 'agent', 'skills'), repoRoot);
|
|
442
|
+
removeRepoRootedSkillLinks(path.join(cwd, '.pi', 'agent', 'skills'), repoRoot);
|
|
449
443
|
break;
|
|
450
444
|
}
|
|
451
445
|
case 'hermes': {
|
|
@@ -460,6 +454,17 @@ function uninstallTool(toolId, repoRoot) {
|
|
|
460
454
|
}
|
|
461
455
|
}
|
|
462
456
|
removeSymlink(path.join(homeDir, '.hermes', 'hooks', 'session-log'));
|
|
457
|
+
// installLocal('hermes') renders skills into cwd/.hermes/skills (no hook locally)
|
|
458
|
+
const localSkillsDir = path.join(cwd, '.hermes', 'skills');
|
|
459
|
+
if (fs.existsSync(localSkillsDir)) {
|
|
460
|
+
for (const entry of fs.readdirSync(localSkillsDir, { withFileTypes: true })) {
|
|
461
|
+
if (!entry.isSymbolicLink()) continue;
|
|
462
|
+
const target = fs.readlinkSync(path.join(localSkillsDir, entry.name));
|
|
463
|
+
if (target.startsWith(repoRoot) || target.includes('.hermes/skills')) {
|
|
464
|
+
removeSymlink(path.join(localSkillsDir, entry.name));
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
463
468
|
break;
|
|
464
469
|
}
|
|
465
470
|
case 'zcode': {
|
|
@@ -474,6 +479,8 @@ function uninstallTool(toolId, repoRoot) {
|
|
|
474
479
|
}
|
|
475
480
|
}
|
|
476
481
|
removeSymlink(path.join(homeDir, '.zcode', 'AGENTS.md'));
|
|
482
|
+
removeManagedSkillLinks(path.join(cwd, '.zcode', 'skills'), repoRoot);
|
|
483
|
+
removeSymlink(path.join(cwd, '.zcode', 'AGENTS.md'));
|
|
477
484
|
break;
|
|
478
485
|
}
|
|
479
486
|
case 'mimo': {
|
|
@@ -488,6 +495,8 @@ function uninstallTool(toolId, repoRoot) {
|
|
|
488
495
|
}
|
|
489
496
|
}
|
|
490
497
|
removeSymlink(path.join(homeDir, '.mimocode', 'AGENTS.md'));
|
|
498
|
+
removeManagedSkillLinks(path.join(cwd, '.mimocode', 'skills'), repoRoot);
|
|
499
|
+
removeSymlink(path.join(cwd, '.mimocode', 'AGENTS.md'));
|
|
491
500
|
break;
|
|
492
501
|
}
|
|
493
502
|
case 'antigravity':
|
|
@@ -502,10 +511,20 @@ function uninstallTool(toolId, repoRoot) {
|
|
|
502
511
|
}
|
|
503
512
|
}
|
|
504
513
|
}
|
|
514
|
+
// installLocal('antigravity') renders into cwd/.agents/skills and — only
|
|
515
|
+
// if absent — symlinks cwd/AGENTS.md. Skip the local skills dir entirely
|
|
516
|
+
// when cwd === repoRoot: that's this repo's own tracked .agents/skills
|
|
517
|
+
// source tree (the installer's rendered-skill INPUT), not an install
|
|
518
|
+
// target, and must never be touched by uninstall.
|
|
519
|
+
if (cwd !== repoRoot) {
|
|
520
|
+
removeManagedSkillLinks(path.join(cwd, '.agents', 'skills'), repoRoot);
|
|
521
|
+
}
|
|
522
|
+
removeSymlink(path.join(cwd, 'AGENTS.md'));
|
|
505
523
|
break;
|
|
506
524
|
}
|
|
507
525
|
case 'cursor':
|
|
508
526
|
removeSymlink(path.join(homeDir, '.cursor', 'rules'));
|
|
527
|
+
removeSymlink(path.join(cwd, '.cursor', 'rules'));
|
|
509
528
|
break;
|
|
510
529
|
case 'codex':
|
|
511
530
|
{
|
|
@@ -518,7 +537,60 @@ function uninstallTool(toolId, repoRoot) {
|
|
|
518
537
|
}
|
|
519
538
|
}
|
|
520
539
|
removeSymlink(path.join(homeDir, '.codex', 'hooks', 'pre-tool-git-guard.sh'));
|
|
540
|
+
removeSymlink(path.join(homeDir, '.codex', 'AGENTS.md'));
|
|
541
|
+
// installLocal('codex') only symlinks cwd/.codex/AGENTS.md (no skills/hooks locally)
|
|
542
|
+
removeSymlink(path.join(cwd, '.codex', 'AGENTS.md'));
|
|
521
543
|
break; // story: e65s02
|
|
544
|
+
case 'qwen':
|
|
545
|
+
removeManagedSkillLinks(path.join(homeDir, '.qwen', 'skills'), repoRoot);
|
|
546
|
+
removeSymlink(path.join(homeDir, '.qwen', 'QWEN.md'));
|
|
547
|
+
removeSymlink(path.join(homeDir, '.qwen', 'hooks', 'pre-tool-git-guard.sh'));
|
|
548
|
+
break; // story: e68s02
|
|
549
|
+
case 'codebuddy':
|
|
550
|
+
removeManagedSkillLinks(path.join(homeDir, '.codebuddy', 'skills'), repoRoot);
|
|
551
|
+
removeSymlink(path.join(homeDir, '.codebuddy', 'AGENTS.md'));
|
|
552
|
+
removeSymlink(path.join(homeDir, '.codebuddy', 'hooks', 'pre-tool-git-guard.sh'));
|
|
553
|
+
break; // story: e72s02
|
|
554
|
+
case 'cline':
|
|
555
|
+
removeManagedSkillLinks(path.join(homeDir, '.cline', 'skills'), repoRoot);
|
|
556
|
+
break; // story: e66s02
|
|
557
|
+
case 'kilo':
|
|
558
|
+
case 'kilocode': {
|
|
559
|
+
const rulesDir = path.join(homeDir, '.kilocode', 'rules');
|
|
560
|
+
if (fs.existsSync(rulesDir)) {
|
|
561
|
+
for (const f of fs.readdirSync(rulesDir)) {
|
|
562
|
+
if (!f.endsWith('.md')) continue;
|
|
563
|
+
removeSymlink(path.join(rulesDir, f));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
removeManagedFile(path.join(homeDir, '.kilocode', 'AGENTS.md'));
|
|
567
|
+
break; // story: e67s02
|
|
568
|
+
}
|
|
569
|
+
case 'trae':
|
|
570
|
+
removeManagedSkillLinks(path.join(homeDir, '.trae', 'skills'), repoRoot);
|
|
571
|
+
removeSymlink(path.join(homeDir, '.trae', 'AGENTS.md'));
|
|
572
|
+
removeSymlink(path.join(homeDir, '.trae', 'hooks', 'pre-tool-git-guard.sh'));
|
|
573
|
+
break; // story: e70s02
|
|
574
|
+
case 'windsurf': {
|
|
575
|
+
const rulesDir = path.join(homeDir, '.codeium', 'windsurf', 'rules');
|
|
576
|
+
if (fs.existsSync(rulesDir)) {
|
|
577
|
+
for (const f of fs.readdirSync(rulesDir)) {
|
|
578
|
+
if (!f.endsWith('.md')) continue;
|
|
579
|
+
removeSymlink(path.join(rulesDir, f));
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
removeManagedFile(path.join(homeDir, '.codeium', 'windsurf', 'AGENTS.md'));
|
|
583
|
+
removeSymlink(path.join(homeDir, '.codeium', 'windsurf', 'hooks', 'pre-tool-git-guard.sh'));
|
|
584
|
+
break; // story: e73s02
|
|
585
|
+
}
|
|
586
|
+
case 'opencode':
|
|
587
|
+
removeManagedSkillLinks(path.join(homeDir, '.config', 'opencode', 'skills'), repoRoot);
|
|
588
|
+
removeSymlink(path.join(homeDir, '.config', 'opencode', 'AGENTS.md'));
|
|
589
|
+
break; // story: e62s02
|
|
590
|
+
case 'copilot':
|
|
591
|
+
removeManagedSkillLinks(path.join(homeDir, '.copilot', 'skills'), repoRoot);
|
|
592
|
+
removeManagedFile(path.join(homeDir, '.copilot', 'AGENTS.md'));
|
|
593
|
+
break; // story: e71s02
|
|
522
594
|
}
|
|
523
595
|
}
|
|
524
596
|
|
|
@@ -533,6 +605,61 @@ function removeSymlink(p) {
|
|
|
533
605
|
return false;
|
|
534
606
|
}
|
|
535
607
|
|
|
608
|
+
// Strict variant of removeManagedSkillLinks: only removes symlinks whose
|
|
609
|
+
// target starts with THIS repoRoot exactly (no 'bigpowers' substring match).
|
|
610
|
+
// Used for claude/pi, where a looser match could delete symlinks pointing at
|
|
611
|
+
// an unrelated bigpowers checkout elsewhere on disk (e.g. a second clone).
|
|
612
|
+
function removeRepoRootedSkillLinks(skillsDir, repoRoot) {
|
|
613
|
+
if (!fs.existsSync(skillsDir)) return;
|
|
614
|
+
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
615
|
+
if (!entry.isSymbolicLink()) continue;
|
|
616
|
+
const linkPath = path.join(skillsDir, entry.name);
|
|
617
|
+
let target;
|
|
618
|
+
try {
|
|
619
|
+
target = fs.readlinkSync(linkPath);
|
|
620
|
+
} catch {
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
if (target.startsWith(repoRoot)) {
|
|
624
|
+
removeSymlink(linkPath);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// Remove bigpowers-managed skill symlinks from a tool's skills dir. Only touches
|
|
630
|
+
// symlinks that resolve back into the repo (installGlobal creates them via
|
|
631
|
+
// linkRenderedSkills → linkDir), leaving any user-authored entries alone.
|
|
632
|
+
function removeManagedSkillLinks(skillsDir, repoRoot) {
|
|
633
|
+
if (!fs.existsSync(skillsDir)) return;
|
|
634
|
+
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
635
|
+
if (!entry.isSymbolicLink()) continue;
|
|
636
|
+
const linkPath = path.join(skillsDir, entry.name);
|
|
637
|
+
let target;
|
|
638
|
+
try {
|
|
639
|
+
target = fs.readlinkSync(linkPath);
|
|
640
|
+
} catch {
|
|
641
|
+
continue;
|
|
642
|
+
}
|
|
643
|
+
if (target.startsWith(repoRoot) || target.includes('bigpowers')) {
|
|
644
|
+
removeSymlink(linkPath);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// Remove a file the installer placed as a plain copy (kilo/windsurf/copilot use
|
|
650
|
+
// fs.copyFileSync for AGENTS.md, so removeSymlink would skip it). Also handles
|
|
651
|
+
// the symlink case so it's safe on either install shape.
|
|
652
|
+
function removeManagedFile(p) {
|
|
653
|
+
try {
|
|
654
|
+
const stat = fs.lstatSync(p);
|
|
655
|
+
if (stat.isSymbolicLink() || stat.isFile()) {
|
|
656
|
+
fs.unlinkSync(p);
|
|
657
|
+
return true;
|
|
658
|
+
}
|
|
659
|
+
} catch {}
|
|
660
|
+
return false;
|
|
661
|
+
}
|
|
662
|
+
|
|
536
663
|
function detectExistingInstall() {
|
|
537
664
|
const homeDir = require('os').homedir();
|
|
538
665
|
const marker = path.join(homeDir, '.claude', 'skills', 'survey-context');
|
|
@@ -87,6 +87,116 @@ try {
|
|
|
87
87
|
uninstallTool('cursor', ROOT);
|
|
88
88
|
assert.ok(!fs.existsSync(rulesDst), 'uninstallTool(cursor) must remove rules symlink');
|
|
89
89
|
|
|
90
|
+
// Regression: every tool the uninstall menu offers must have a real uninstall
|
|
91
|
+
// path. Before this, qwen/codebuddy/cline/kilo/trae/windsurf/opencode/copilot
|
|
92
|
+
// had install cases but no uninstall case — uninstall reported success while
|
|
93
|
+
// leaving every symlink in place.
|
|
94
|
+
installGlobal({ id: 'qwen', name: 'Qwen Code' }, ROOT);
|
|
95
|
+
const qwenSkills = path.join(tmpHome, '.qwen', 'skills');
|
|
96
|
+
const qwenSample = fs.existsSync(qwenSkills)
|
|
97
|
+
&& fs.readdirSync(qwenSkills).find((n) => {
|
|
98
|
+
try { return fs.lstatSync(path.join(qwenSkills, n)).isSymbolicLink(); } catch { return false; }
|
|
99
|
+
});
|
|
100
|
+
assert.ok(qwenSample, 'qwen install must create at least one skill symlink');
|
|
101
|
+
uninstallTool('qwen', ROOT);
|
|
102
|
+
assert.ok(
|
|
103
|
+
!fs.existsSync(path.join(qwenSkills, qwenSample)),
|
|
104
|
+
'uninstallTool(qwen) must remove repo-rooted skill symlinks'
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// copilot writes AGENTS.md as a plain copy (not a symlink); uninstall must
|
|
108
|
+
// still remove it via removeManagedFile.
|
|
109
|
+
installGlobal({ id: 'copilot', name: 'Copilot' }, ROOT);
|
|
110
|
+
const copilotAgents = path.join(tmpHome, '.copilot', 'AGENTS.md');
|
|
111
|
+
const copilotHadAgents = fs.existsSync(copilotAgents);
|
|
112
|
+
uninstallTool('copilot', ROOT);
|
|
113
|
+
if (copilotHadAgents) {
|
|
114
|
+
assert.ok(!fs.existsSync(copilotAgents), 'uninstallTool(copilot) must remove copied AGENTS.md');
|
|
115
|
+
}
|
|
116
|
+
const copilotSkills = path.join(tmpHome, '.copilot', 'skills');
|
|
117
|
+
if (fs.existsSync(copilotSkills)) {
|
|
118
|
+
const leftover = fs.readdirSync(copilotSkills).find((n) => {
|
|
119
|
+
try { return fs.lstatSync(path.join(copilotSkills, n)).isSymbolicLink(); } catch { return false; }
|
|
120
|
+
});
|
|
121
|
+
assert.ok(!leftover, 'uninstallTool(copilot) must remove skill symlinks');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Regression: uninstallTool() only ever touched homeDir. The interactive
|
|
125
|
+
// Uninstall menu (bin/setup.js handleUninstall) never asks global-vs-local
|
|
126
|
+
// and calls uninstallTool(toolId, ROOT) unconditionally — so a *local*
|
|
127
|
+
// install (`bigpowers install` → Local) was reported "removed" while every
|
|
128
|
+
// local symlink survived, for every tool. Verify local install/uninstall
|
|
129
|
+
// round-trips for tools spanning each install shape: skill-symlink dir
|
|
130
|
+
// (pi, claude), single linked dir (cursor, gemini), and a linked file
|
|
131
|
+
// (codex AGENTS.md).
|
|
132
|
+
const { installLocal } = require('../scripts/lib/install-helpers.js');
|
|
133
|
+
const savedCwd = process.cwd();
|
|
134
|
+
const tmpCwd = mkdtempSync(path.join(os.tmpdir(), 'bp-install-helpers-local-'));
|
|
135
|
+
try {
|
|
136
|
+
process.chdir(tmpCwd);
|
|
137
|
+
|
|
138
|
+
installLocal({ id: 'pi', name: 'pi' }, ROOT);
|
|
139
|
+
const localPiSkills = path.join(tmpCwd, '.pi', 'agent', 'skills');
|
|
140
|
+
const localPiSample = fs.readdirSync(localPiSkills).find((n) => {
|
|
141
|
+
try { return fs.lstatSync(path.join(localPiSkills, n)).isSymbolicLink(); } catch { return false; }
|
|
142
|
+
});
|
|
143
|
+
assert.ok(localPiSample, 'local pi install must create at least one skill symlink');
|
|
144
|
+
uninstallTool('pi', ROOT);
|
|
145
|
+
assert.ok(
|
|
146
|
+
!fs.existsSync(path.join(localPiSkills, localPiSample)),
|
|
147
|
+
'uninstallTool(pi) must also remove LOCAL (cwd) skill symlinks, not just global'
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
installLocal({ id: 'claude', name: 'Claude Code' }, ROOT);
|
|
151
|
+
const localClaudeSkills = path.join(tmpCwd, '.claude', 'skills');
|
|
152
|
+
const localClaudeSample = fs.readdirSync(localClaudeSkills).find((n) => {
|
|
153
|
+
try { return fs.lstatSync(path.join(localClaudeSkills, n)).isSymbolicLink(); } catch { return false; }
|
|
154
|
+
});
|
|
155
|
+
assert.ok(localClaudeSample, 'local claude install must create at least one skill symlink');
|
|
156
|
+
uninstallTool('claude', ROOT);
|
|
157
|
+
assert.ok(
|
|
158
|
+
!fs.existsSync(path.join(localClaudeSkills, localClaudeSample)),
|
|
159
|
+
'uninstallTool(claude) must also remove LOCAL (cwd) skill symlinks, not just global'
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
installLocal({ id: 'cursor', name: 'Cursor' }, ROOT);
|
|
163
|
+
const localCursorRules = path.join(tmpCwd, '.cursor', 'rules');
|
|
164
|
+
assert.ok(fs.lstatSync(localCursorRules).isSymbolicLink(), 'local cursor install must symlink .cursor/rules');
|
|
165
|
+
uninstallTool('cursor', ROOT);
|
|
166
|
+
assert.ok(!fs.existsSync(localCursorRules), 'uninstallTool(cursor) must remove LOCAL .cursor/rules symlink');
|
|
167
|
+
|
|
168
|
+
installLocal({ id: 'gemini', name: 'Gemini' }, ROOT);
|
|
169
|
+
const localGeminiExt = path.join(tmpCwd, '.gemini', 'extensions', 'bigpowers');
|
|
170
|
+
assert.ok(fs.lstatSync(localGeminiExt).isSymbolicLink(), 'local gemini install must symlink extensions/bigpowers');
|
|
171
|
+
uninstallTool('gemini', ROOT);
|
|
172
|
+
assert.ok(!fs.existsSync(localGeminiExt), 'uninstallTool(gemini) must remove LOCAL extensions/bigpowers symlink');
|
|
173
|
+
|
|
174
|
+
installLocal({ id: 'codex', name: 'Codex' }, ROOT);
|
|
175
|
+
const localCodexAgents = path.join(tmpCwd, '.codex', 'AGENTS.md');
|
|
176
|
+
assert.ok(fs.lstatSync(localCodexAgents).isSymbolicLink(), 'local codex install must symlink AGENTS.md');
|
|
177
|
+
uninstallTool('codex', ROOT);
|
|
178
|
+
assert.ok(!fs.existsSync(localCodexAgents), 'uninstallTool(codex) must remove LOCAL AGENTS.md symlink');
|
|
179
|
+
} finally {
|
|
180
|
+
process.chdir(savedCwd);
|
|
181
|
+
rmSync(tmpCwd, { recursive: true, force: true });
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Guard against future drift: assert the menu's supported set matches the
|
|
185
|
+
// uninstall switch. Any id in SUPPORTED_IDS with no uninstall case regresses
|
|
186
|
+
// this bug (silent no-op reported as success).
|
|
187
|
+
const helpersSrc = fs.readFileSync(path.join(ROOT, 'scripts', 'lib', 'install-helpers.js'), 'utf8');
|
|
188
|
+
const uninstallBody = helpersSrc.slice(helpersSrc.indexOf('function uninstallTool'));
|
|
189
|
+
const setupText = fs.readFileSync(path.join(ROOT, 'bin/setup.js'), 'utf8');
|
|
190
|
+
const supportedLine = setupText.match(/const SUPPORTED_IDS = new Set\(\[([^\]]*)\]\)/);
|
|
191
|
+
assert.ok(supportedLine, 'SUPPORTED_IDS must be declarable from bin/setup.js');
|
|
192
|
+
const supportedIds = supportedLine[1].match(/'([^']+)'/g).map((s) => s.replace(/'/g, ''));
|
|
193
|
+
for (const id of supportedIds) {
|
|
194
|
+
assert.ok(
|
|
195
|
+
new RegExp(`case '${id}':`).test(uninstallBody),
|
|
196
|
+
`uninstallTool must handle '${id}' (listed in SUPPORTED_IDS) — else uninstall silently no-ops`
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
90
200
|
const installPaths = [
|
|
91
201
|
path.join(ROOT, 'scripts', 'install.sh'),
|
|
92
202
|
...fs.readdirSync(path.join(ROOT, 'scripts', 'lib'))
|