| 8475 | } |
| 8476 | |
| 8477 | static void uninstall_vscode_profile_configs(const char *code_user, const char *binary_path, |
| 8478 | bool dry_run) { |
| 8479 | char profiles_dir[CLI_BUF_1K]; |
| 8480 | snprintf(profiles_dir, sizeof(profiles_dir), "%s/profiles", code_user); |
| 8481 | cbm_dir_t *directory = cbm_opendir(profiles_dir); |
| 8482 | if (!directory) { |
| 8483 | return; |
| 8484 | } |
| 8485 | cbm_dirent_t *entry; |
| 8486 | while ((entry = cbm_readdir(directory)) != NULL) { |
| 8487 | if (strcmp(entry->name, ".") == 0 || strcmp(entry->name, "..") == 0) { |
| 8488 | continue; |
| 8489 | } |
| 8490 | char profile_dir[CLI_BUF_1K]; |
| 8491 | snprintf(profile_dir, sizeof(profile_dir), "%s/%s", profiles_dir, entry->name); |
| 8492 | struct stat state; |
| 8493 | if (stat(profile_dir, &state) != 0 || !S_ISDIR(state.st_mode)) { |
| 8494 | continue; |
| 8495 | } |
| 8496 | char config_path[CLI_BUF_1K]; |
| 8497 | snprintf(config_path, sizeof(config_path), "%s/mcp.json", profile_dir); |
| 8498 | if (!dry_run && cbm_remove_vscode_mcp_owned(binary_path, config_path) != CLI_OK) { |
| 8499 | record_agent_config_error(true, "VS Code", "profile_mcp_uninstall", config_path); |
| 8500 | } |
| 8501 | } |
| 8502 | cbm_closedir(directory); |
| 8503 | } |
| 8504 | |
| 8505 | /* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */ |
| 8506 | static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
no test coverage detected