| 8425 | } |
| 8426 | |
| 8427 | static void uninstall_vscode_profile_configs(const char *code_user, const char *binary_path, |
| 8428 | bool dry_run) { |
| 8429 | char profiles_dir[CLI_BUF_1K]; |
| 8430 | snprintf(profiles_dir, sizeof(profiles_dir), "%s/profiles", code_user); |
| 8431 | cbm_dir_t *directory = cbm_opendir(profiles_dir); |
| 8432 | if (!directory) { |
| 8433 | return; |
| 8434 | } |
| 8435 | cbm_dirent_t *entry; |
| 8436 | while ((entry = cbm_readdir(directory)) != NULL) { |
| 8437 | if (strcmp(entry->name, ".") == 0 || strcmp(entry->name, "..") == 0) { |
| 8438 | continue; |
| 8439 | } |
| 8440 | char profile_dir[CLI_BUF_1K]; |
| 8441 | snprintf(profile_dir, sizeof(profile_dir), "%s/%s", profiles_dir, entry->name); |
| 8442 | struct stat state; |
| 8443 | if (stat(profile_dir, &state) != 0 || !S_ISDIR(state.st_mode)) { |
| 8444 | continue; |
| 8445 | } |
| 8446 | char config_path[CLI_BUF_1K]; |
| 8447 | snprintf(config_path, sizeof(config_path), "%s/mcp.json", profile_dir); |
| 8448 | if (!dry_run && cbm_remove_vscode_mcp_owned(binary_path, config_path) != CLI_OK) { |
| 8449 | record_agent_config_error(true, "VS Code", "profile_mcp_uninstall", config_path); |
| 8450 | } |
| 8451 | } |
| 8452 | cbm_closedir(directory); |
| 8453 | } |
| 8454 | |
| 8455 | /* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */ |
| 8456 | static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
no test coverage detected