Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */
| 11032 | |
| 11033 | /* Remove editor agent configs (Zed, KiloCode, VS Code, OpenClaw). */ |
| 11034 | static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const char *home, |
| 11035 | bool dry_run) { |
| 11036 | char installed_binary[CLI_BUF_1K]; |
| 11037 | cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary)); |
| 11038 | if (agents->zed) { |
| 11039 | char config_dir[CLI_BUF_1K]; |
| 11040 | char cp[CLI_BUF_1K]; |
| 11041 | char ip[CLI_BUF_1K]; |
| 11042 | char skills_dir[CLI_BUF_1K]; |
| 11043 | cbm_zed_config_dir(home, config_dir, sizeof(config_dir)); |
| 11044 | cbm_zed_instructions_path(home, ip, sizeof(ip)); |
| 11045 | snprintf(cp, sizeof(cp), "%s/settings.json", config_dir); |
| 11046 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 11047 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Zed", cp, ip}, dry_run, |
| 11048 | cbm_remove_zed_mcp_owned); |
| 11049 | uninstall_agent_skill("Zed", skills_dir, dry_run); |
| 11050 | } |
| 11051 | if (agents->kilocode) { |
| 11052 | char cp[CLI_BUF_1K]; |
| 11053 | char ip[CLI_BUF_1K]; |
| 11054 | char ap[CLI_BUF_1K]; |
| 11055 | snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home); |
| 11056 | snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home); |
| 11057 | snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home); |
| 11058 | if (!dry_run) { |
| 11059 | if (cbm_remove_kilo_mcp_owned(installed_binary, cp) != CLI_OK) { |
| 11060 | record_agent_config_error(true, "KiloCode", "mcp_uninstall", cp); |
| 11061 | } |
| 11062 | if (cbm_json_like_remove_string(cp, "instructions", ip) != CLI_OK) { |
| 11063 | record_agent_config_error(true, "KiloCode", "instruction_reference_uninstall", cp); |
| 11064 | } |
| 11065 | if (cbm_remove_instructions(ip) != CLI_OK) { |
| 11066 | record_agent_config_error(true, "KiloCode", "instructions_uninstall", ip); |
| 11067 | } |
| 11068 | |
| 11069 | char legacy_cp[CLI_BUF_1K]; |
| 11070 | char legacy_ip[CLI_BUF_1K]; |
| 11071 | #ifdef __APPLE__ |
| 11072 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 11073 | "%s/Library/Application Support/Code/User/globalStorage/" |
| 11074 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 11075 | home); |
| 11076 | #elif defined(_WIN32) |
| 11077 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 11078 | "%s/AppData/Roaming/Code/User/globalStorage/" |
| 11079 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 11080 | home); |
| 11081 | #else |
| 11082 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 11083 | "%s/.config/Code/User/globalStorage/" |
| 11084 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 11085 | home); |
| 11086 | #endif |
| 11087 | snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md", |
| 11088 | home); |
| 11089 | if (cbm_file_exists(legacy_cp) && |
| 11090 | cbm_remove_editor_mcp_owned(installed_binary, legacy_cp) != CLI_OK) { |
| 11091 | record_agent_config_error(true, "KiloCode", "legacy_mcp_uninstall", legacy_cp); |
no test coverage detected