Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */
| 10389 | |
| 10390 | /* Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */ |
| 10391 | static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const char *home, |
| 10392 | bool dry_run) { |
| 10393 | char installed_binary[CLI_BUF_1K]; |
| 10394 | cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary)); |
| 10395 | if (agents->zed) { |
| 10396 | char config_dir[CLI_BUF_1K]; |
| 10397 | char cp[CLI_BUF_1K]; |
| 10398 | char ip[CLI_BUF_1K]; |
| 10399 | char skills_dir[CLI_BUF_1K]; |
| 10400 | cbm_zed_config_dir(home, config_dir, sizeof(config_dir)); |
| 10401 | cbm_zed_instructions_path(home, ip, sizeof(ip)); |
| 10402 | snprintf(cp, sizeof(cp), "%s/settings.json", config_dir); |
| 10403 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 10404 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Zed", cp, ip}, dry_run, |
| 10405 | cbm_remove_zed_mcp_owned); |
| 10406 | uninstall_agent_skill("Zed", skills_dir, dry_run); |
| 10407 | } |
| 10408 | if (agents->kilocode) { |
| 10409 | char cp[CLI_BUF_1K]; |
| 10410 | char ip[CLI_BUF_1K]; |
| 10411 | char ap[CLI_BUF_1K]; |
| 10412 | snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home); |
| 10413 | snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home); |
| 10414 | snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home); |
| 10415 | if (!dry_run) { |
| 10416 | if (cbm_remove_kilo_mcp_owned(installed_binary, cp) != CLI_OK) { |
| 10417 | record_agent_config_error(true, "KiloCode", "mcp_uninstall", cp); |
| 10418 | } |
| 10419 | if (cbm_json_like_remove_string(cp, "instructions", ip) != CLI_OK) { |
| 10420 | record_agent_config_error(true, "KiloCode", "instruction_reference_uninstall", cp); |
| 10421 | } |
| 10422 | if (cbm_remove_instructions(ip) != CLI_OK) { |
| 10423 | record_agent_config_error(true, "KiloCode", "instructions_uninstall", ip); |
| 10424 | } |
| 10425 | |
| 10426 | char legacy_cp[CLI_BUF_1K]; |
| 10427 | char legacy_ip[CLI_BUF_1K]; |
| 10428 | #ifdef __APPLE__ |
| 10429 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 10430 | "%s/Library/Application Support/Code/User/globalStorage/" |
| 10431 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 10432 | home); |
| 10433 | #elif defined(_WIN32) |
| 10434 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 10435 | "%s/AppData/Roaming/Code/User/globalStorage/" |
| 10436 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 10437 | home); |
| 10438 | #else |
| 10439 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 10440 | "%s/.config/Code/User/globalStorage/" |
| 10441 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 10442 | home); |
| 10443 | #endif |
| 10444 | snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md", |
| 10445 | home); |
| 10446 | if (cbm_file_exists(legacy_cp) && |
| 10447 | cbm_remove_editor_mcp_owned(installed_binary, legacy_cp) != CLI_OK) { |
| 10448 | record_agent_config_error(true, "KiloCode", "legacy_mcp_uninstall", legacy_cp); |
no test coverage detected