| 10237 | } |
| 10238 | |
| 10239 | static void uninstall_agent_client_registry(const char *home, bool dry_run) { |
| 10240 | cbm_agent_registry_context_t registry; |
| 10241 | cbm_init_agent_registry_context(home, ®istry); |
| 10242 | char binary_path[CLI_BUF_1K]; |
| 10243 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 10244 | for (size_t index = 0U; index < cbm_agent_client_count(); index++) { |
| 10245 | const cbm_agent_client_profile_t *profile = cbm_agent_client_at(index); |
| 10246 | if (!profile || !cbm_agent_client_cleanup_candidate(profile->id, ®istry.options)) { |
| 10247 | continue; |
| 10248 | } |
| 10249 | printf("%s:\n", profile->display_name); |
| 10250 | char config_path[CLI_BUF_1K] = {0}; |
| 10251 | bool config_resolved = false; |
| 10252 | if ((profile->capabilities & CBM_AGENT_CAP_MCP) != 0U) { |
| 10253 | int resolved = cbm_agent_client_resolve_path(profile->id, ®istry.options, |
| 10254 | config_path, sizeof(config_path)); |
| 10255 | if (resolved != 0 || !profile->remove_mcp) { |
| 10256 | record_agent_config_error(true, profile->display_name, "mcp_resolve", |
| 10257 | profile->stable_id); |
| 10258 | } else { |
| 10259 | config_resolved = true; |
| 10260 | int edit_result = dry_run |
| 10261 | ? CBM_AGENT_EDIT_OK |
| 10262 | : profile->remove_mcp(profile->id, config_path, binary_path); |
| 10263 | if (edit_result == CBM_AGENT_EDIT_FOREIGN) { |
| 10264 | printf(" mcp: preserved modified or foreign entry in %s\n", config_path); |
| 10265 | } else if (edit_result != CBM_AGENT_EDIT_OK) { |
| 10266 | record_agent_config_error(true, profile->display_name, "mcp_uninstall", |
| 10267 | config_path); |
| 10268 | } else { |
| 10269 | printf(" mcp: removed canonical entry from %s\n", config_path); |
| 10270 | } |
| 10271 | } |
| 10272 | } |
| 10273 | |
| 10274 | if (profile->id == CBM_AGENT_CLIENT_QODER) { |
| 10275 | uninstall_qoder_durable_context(home, binary_path, config_path, config_resolved, |
| 10276 | dry_run); |
| 10277 | } else if (profile->id == CBM_AGENT_CLIENT_KIMI) { |
| 10278 | uninstall_kimi_durable_context(®istry, dry_run); |
| 10279 | } else if (profile->id == CBM_AGENT_CLIENT_GITLAB_DUO) { |
| 10280 | uninstall_gitlab_durable_context(®istry, binary_path, dry_run); |
| 10281 | } else if (profile->id == CBM_AGENT_CLIENT_ROVO_DEV) { |
| 10282 | uninstall_rovo_durable_context(home, dry_run); |
| 10283 | } else if (profile->id == CBM_AGENT_CLIENT_AMP) { |
| 10284 | uninstall_amp_durable_context(home, dry_run); |
| 10285 | } else if (profile->id == CBM_AGENT_CLIENT_DEVIN) { |
| 10286 | uninstall_devin_durable_context(®istry, binary_path, config_path, config_resolved, |
| 10287 | dry_run); |
| 10288 | } else if (profile->id == CBM_AGENT_CLIENT_CODEBUDDY) { |
| 10289 | uninstall_codebuddy_durable_context(home, dry_run); |
| 10290 | } else if (profile->id == CBM_AGENT_CLIENT_IBM_BOB_IDE) { |
| 10291 | uninstall_bob_durable_context(home, true, dry_run); |
| 10292 | } else if (profile->id == CBM_AGENT_CLIENT_IBM_BOB_SHELL) { |
| 10293 | uninstall_bob_durable_context(home, false, dry_run); |
| 10294 | } else if (profile->id == CBM_AGENT_CLIENT_POCHI) { |
| 10295 | uninstall_pochi_durable_context(home, dry_run); |
| 10296 | } else if (profile->id == CBM_AGENT_CLIENT_PI) { |
no test coverage detected