| 8531 | } |
| 8532 | |
| 8533 | static void uninstall_vscode_profile_configs(const char *code_user, const char *binary_path, |
| 8534 | bool dry_run) { |
| 8535 | char profiles_dir[CLI_BUF_1K]; |
| 8536 | snprintf(profiles_dir, sizeof(profiles_dir), "%s/profiles", code_user); |
| 8537 | cbm_dir_t *directory = cbm_opendir(profiles_dir); |
| 8538 | if (!directory) { |
| 8539 | return; |
| 8540 | } |
| 8541 | cbm_dirent_t *entry; |
| 8542 | while ((entry = cbm_readdir(directory)) != NULL) { |
| 8543 | if (strcmp(entry->name, ".") == 0 || strcmp(entry->name, "..") == 0) { |
| 8544 | continue; |
| 8545 | } |
| 8546 | char profile_dir[CLI_BUF_1K]; |
| 8547 | snprintf(profile_dir, sizeof(profile_dir), "%s/%s", profiles_dir, entry->name); |
| 8548 | struct stat state; |
| 8549 | if (stat(profile_dir, &state) != 0 || !S_ISDIR(state.st_mode)) { |
| 8550 | continue; |
| 8551 | } |
| 8552 | char config_path[CLI_BUF_1K]; |
| 8553 | snprintf(config_path, sizeof(config_path), "%s/mcp.json", profile_dir); |
| 8554 | if (!dry_run && cbm_remove_vscode_mcp_owned(binary_path, config_path) != CLI_OK) { |
| 8555 | record_agent_config_error(true, "VS Code", "profile_mcp_uninstall", config_path); |
| 8556 | } |
| 8557 | } |
| 8558 | cbm_closedir(directory); |
| 8559 | } |
| 8560 | |
| 8561 | /* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */ |
| 8562 | static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
no test coverage detected