| 11226 | } |
| 11227 | |
| 11228 | static void uninstall_additional_agents(const cbm_detected_agents_t *agents, const char *home, |
| 11229 | bool dry_run) { |
| 11230 | char installed_binary[CLI_BUF_1K]; |
| 11231 | cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary)); |
| 11232 | if (agents->hermes) { |
| 11233 | char hermes_home[CLI_BUF_1K]; |
| 11234 | char cp[CLI_BUF_1K]; |
| 11235 | char skills_dir[CLI_BUF_1K]; |
| 11236 | char binary_path[CLI_BUF_1K]; |
| 11237 | cbm_hermes_home_dir(home, hermes_home, sizeof(hermes_home)); |
| 11238 | snprintf(cp, sizeof(cp), "%s/config.yaml", hermes_home); |
| 11239 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", hermes_home); |
| 11240 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 11241 | int hook_result = |
| 11242 | dry_run ? CBM_YAML_IDENTITY_EDIT_OK : cbm_remove_hermes_context_hook(cp, binary_path); |
| 11243 | if (hook_result == CBM_YAML_IDENTITY_EDIT_FOREIGN) { |
| 11244 | printf(" hook: preserved modified pre_llm_call entry\n"); |
| 11245 | } else if (hook_result != CBM_YAML_IDENTITY_EDIT_OK) { |
| 11246 | record_agent_config_error(true, "Hermes", "pre_llm_hook_uninstall", cp); |
| 11247 | } else { |
| 11248 | printf(" hook: removed canonical pre_llm_call entry\n"); |
| 11249 | } |
| 11250 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Hermes", cp, NULL}, dry_run, |
| 11251 | cbm_remove_hermes_mcp_owned); |
| 11252 | uninstall_agent_skill("Hermes", skills_dir, dry_run); |
| 11253 | } |
| 11254 | if (agents->openhands) { |
| 11255 | char cp[CLI_BUF_1K]; |
| 11256 | char skills_dir[CLI_BUF_1K]; |
| 11257 | snprintf(cp, sizeof(cp), "%s/.openhands/mcp.json", home); |
| 11258 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 11259 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"OpenHands", cp, NULL}, dry_run, |
| 11260 | cbm_remove_editor_mcp_owned); |
| 11261 | printf(" removed %d skill(s)\n", cbm_remove_skills(skills_dir, dry_run)); |
| 11262 | } |
| 11263 | if (agents->augment) { |
| 11264 | char cp[CLI_BUF_1K]; |
| 11265 | char ip[CLI_BUF_1K]; |
| 11266 | char ap[CLI_BUF_1K]; |
| 11267 | char session_hp[CLI_BUF_1K]; |
| 11268 | char coverage_hp[CLI_BUF_1K]; |
| 11269 | char binary_path[CLI_BUF_1K]; |
| 11270 | snprintf(cp, sizeof(cp), "%s/.augment/settings.json", home); |
| 11271 | snprintf(ip, sizeof(ip), "%s/.augment/rules/codebase-memory.md", home); |
| 11272 | snprintf(ap, sizeof(ap), "%s/.augment/agents/codebase-memory.md", home); |
| 11273 | snprintf(session_hp, sizeof(session_hp), "%s/.augment/hooks/%s", home, |
| 11274 | AUGMENT_SESSION_SCRIPT); |
| 11275 | snprintf(coverage_hp, sizeof(coverage_hp), "%s/.augment/hooks/%s", home, |
| 11276 | AUGMENT_COVERAGE_SCRIPT); |
| 11277 | /* The owned-document match must rebuild the scripts with the exact |
| 11278 | * binary path the install embedded — the managed canonical plain form |
| 11279 | * on Windows, not a hand-assembled default. */ |
| 11280 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 11281 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Augment/Auggie", cp, ip}, dry_run, |
| 11282 | cbm_remove_editor_mcp_owned); |
| 11283 | uninstall_tiered_agent_profiles( |
| 11284 | (cbm_tiered_profile_set_t){ |
| 11285 | .label = "Augment/Auggie", |
no test coverage detected