fix: address second PR review — clean replace, IDE failure bubbling, bun validation

- cpSync now does rmSync before copy to avoid stale file merges
- setupIDEs() returns failed IDE list; install reports partial success
- runSmartInstall() returns boolean status instead of void
- Worker port in next-steps URL reads CLAUDE_MEM_WORKER_PORT env var
- Goose YAML regex stops at column-0 keys (prevents eating sibling sections)
- AGENTS.md uninstall removes header-only stub files
- findBunPath() validated before use in WindsurfHooksInstaller
- Cursor marked unsupported in ide-detection until installer is wired

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-04-04 14:17:18 -07:00
parent ae6915b88e
commit 190c74492f
7 changed files with 62 additions and 23 deletions
+1 -1
View File
@@ -285,7 +285,7 @@ export async function installGooseMcpIntegration(): Promise<number> {
if (gooseConfigHasClaudeMemEntry(yamlContent)) {
// Already configured — replace the claude-mem block
// Find the claude-mem entry and replace it
const claudeMemPattern = /( {2}claude-mem:\n(?:.*\n)*?(?= {2}\S|\n\n|$))/;
const claudeMemPattern = /( {2}claude-mem:\n(?:.*\n)*?(?= {2}\S|\n\n|^\S|$))/m;
const newEntry = buildGooseClaudeMemEntryYaml(mcpServerPath) + '\n';
if (claudeMemPattern.test(yamlContent)) {
@@ -218,12 +218,16 @@ export function uninstallOpenCodePlugin(): number {
'\n' +
content.slice(tagEndIndex + CONTEXT_TAG_CLOSE.length).trimStart();
// If the file is now essentially empty, don't bother keeping it
if (content.trim().length === 0) {
// If the file is now essentially empty or only has our header, remove it
const trimmedContent = content.trim();
if (
trimmedContent.length === 0 ||
trimmedContent === '# Claude-Mem Memory Context'
) {
unlinkSync(agentsMdPath);
console.log(` Removed empty AGENTS.md`);
} else {
writeFileSync(agentsMdPath, content.trimEnd() + '\n', 'utf-8');
writeFileSync(agentsMdPath, trimmedContent + '\n', 'utf-8');
console.log(` Cleaned context from AGENTS.md`);
}
}
@@ -278,6 +278,11 @@ export async function installWindsurfHooks(): Promise<number> {
// Find bun executable — required because worker-service.cjs uses bun:sqlite
const bunPath = findBunPath();
if (!bunPath) {
console.error('Could not find Bun runtime');
console.error(' Install Bun: curl -fsSL https://bun.sh/install | bash');
return 1;
}
// IMPORTANT: Tilde expansion is NOT supported in working_directory — use absolute paths
const workingDirectory = path.dirname(workerServicePath);