Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */
| 10445 | |
| 10446 | /* Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */ |
| 10447 | static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const char *home, |
| 10448 | bool dry_run) { |
| 10449 | char installed_binary[CLI_BUF_1K]; |
| 10450 | cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary)); |
| 10451 | if (agents->zed) { |
| 10452 | char config_dir[CLI_BUF_1K]; |
| 10453 | char cp[CLI_BUF_1K]; |
| 10454 | char ip[CLI_BUF_1K]; |
| 10455 | char skills_dir[CLI_BUF_1K]; |
| 10456 | cbm_zed_config_dir(home, config_dir, sizeof(config_dir)); |
| 10457 | cbm_zed_instructions_path(home, ip, sizeof(ip)); |
| 10458 | snprintf(cp, sizeof(cp), "%s/settings.json", config_dir); |
| 10459 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 10460 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Zed", cp, ip}, dry_run, |
| 10461 | cbm_remove_zed_mcp_owned); |
| 10462 | uninstall_agent_skill("Zed", skills_dir, dry_run); |
| 10463 | } |
| 10464 | if (agents->kilocode) { |
| 10465 | char cp[CLI_BUF_1K]; |
| 10466 | char ip[CLI_BUF_1K]; |
| 10467 | char ap[CLI_BUF_1K]; |
| 10468 | snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home); |
| 10469 | snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home); |
| 10470 | snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home); |
| 10471 | if (!dry_run) { |
| 10472 | if (cbm_remove_kilo_mcp_owned(installed_binary, cp) != CLI_OK) { |
| 10473 | record_agent_config_error(true, "KiloCode", "mcp_uninstall", cp); |
| 10474 | } |
| 10475 | if (cbm_json_like_remove_string(cp, "instructions", ip) != CLI_OK) { |
| 10476 | record_agent_config_error(true, "KiloCode", "instruction_reference_uninstall", cp); |
| 10477 | } |
| 10478 | if (cbm_remove_instructions(ip) != CLI_OK) { |
| 10479 | record_agent_config_error(true, "KiloCode", "instructions_uninstall", ip); |
| 10480 | } |
| 10481 | |
| 10482 | char legacy_cp[CLI_BUF_1K]; |
| 10483 | char legacy_ip[CLI_BUF_1K]; |
| 10484 | #ifdef __APPLE__ |
| 10485 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 10486 | "%s/Library/Application Support/Code/User/globalStorage/" |
| 10487 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 10488 | home); |
| 10489 | #elif defined(_WIN32) |
| 10490 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 10491 | "%s/AppData/Roaming/Code/User/globalStorage/" |
| 10492 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 10493 | home); |
| 10494 | #else |
| 10495 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 10496 | "%s/.config/Code/User/globalStorage/" |
| 10497 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 10498 | home); |
| 10499 | #endif |
| 10500 | snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md", |
| 10501 | home); |
| 10502 | if (cbm_file_exists(legacy_cp) && |
| 10503 | cbm_remove_editor_mcp_owned(installed_binary, legacy_cp) != CLI_OK) { |
| 10504 | record_agent_config_error(true, "KiloCode", "legacy_mcp_uninstall", legacy_cp); |
no test coverage detected