Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */
| 12331 | |
| 12332 | /* Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */ |
| 12333 | static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const char *home, |
| 12334 | bool dry_run) { |
| 12335 | char installed_binary[CLI_BUF_1K]; |
| 12336 | cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary)); |
| 12337 | if (agents->zed) { |
| 12338 | char config_dir[CLI_BUF_1K]; |
| 12339 | char cp[CLI_BUF_1K]; |
| 12340 | char ip[CLI_BUF_1K]; |
| 12341 | char skills_dir[CLI_BUF_1K]; |
| 12342 | cbm_zed_config_dir(home, config_dir, sizeof(config_dir)); |
| 12343 | cbm_zed_instructions_path(home, ip, sizeof(ip)); |
| 12344 | snprintf(cp, sizeof(cp), "%s/settings.json", config_dir); |
| 12345 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 12346 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Zed", cp, ip}, dry_run, |
| 12347 | cbm_remove_zed_mcp_owned); |
| 12348 | uninstall_agent_skill("Zed", skills_dir, dry_run); |
| 12349 | } |
| 12350 | if (agents->kilocode) { |
| 12351 | char cp[CLI_BUF_1K]; |
| 12352 | char ip[CLI_BUF_1K]; |
| 12353 | char ap[CLI_BUF_1K]; |
| 12354 | snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home); |
| 12355 | snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home); |
| 12356 | snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home); |
| 12357 | if (!dry_run) { |
| 12358 | if (cbm_remove_kilo_mcp_owned(installed_binary, cp) != CLI_OK) { |
| 12359 | record_agent_config_error(true, "KiloCode", "mcp_uninstall", cp); |
| 12360 | } |
| 12361 | if (cbm_json_like_remove_string(cp, "instructions", ip) != CLI_OK) { |
| 12362 | record_agent_config_error(true, "KiloCode", "instruction_reference_uninstall", cp); |
| 12363 | } |
| 12364 | if (cbm_remove_instructions(ip) != CLI_OK) { |
| 12365 | record_agent_config_error(true, "KiloCode", "instructions_uninstall", ip); |
| 12366 | } |
| 12367 | |
| 12368 | char legacy_cp[CLI_BUF_1K]; |
| 12369 | char legacy_ip[CLI_BUF_1K]; |
| 12370 | #ifdef __APPLE__ |
| 12371 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 12372 | "%s/Library/Application Support/Code/User/globalStorage/" |
| 12373 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 12374 | home); |
| 12375 | #elif defined(_WIN32) |
| 12376 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 12377 | "%s/AppData/Roaming/Code/User/globalStorage/" |
| 12378 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 12379 | home); |
| 12380 | #else |
| 12381 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 12382 | "%s/.config/Code/User/globalStorage/" |
| 12383 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 12384 | home); |
| 12385 | #endif |
| 12386 | snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md", |
| 12387 | home); |
| 12388 | if (cbm_file_exists(legacy_cp) && |
| 12389 | cbm_remove_editor_mcp_owned(installed_binary, legacy_cp) != CLI_OK) { |
| 12390 | record_agent_config_error(true, "KiloCode", "legacy_mcp_uninstall", legacy_cp); |
no test coverage detected