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