| 10992 | } |
| 10993 | |
| 10994 | static void uninstall_additional_agents(const cbm_detected_agents_t *agents, const char *home, |
| 10995 | bool dry_run) { |
| 10996 | char installed_binary[CLI_BUF_1K]; |
| 10997 | cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary)); |
| 10998 | if (agents->hermes) { |
| 10999 | char hermes_home[CLI_BUF_1K]; |
| 11000 | char cp[CLI_BUF_1K]; |
| 11001 | char skills_dir[CLI_BUF_1K]; |
| 11002 | char binary_path[CLI_BUF_1K]; |
| 11003 | cbm_hermes_home_dir(home, hermes_home, sizeof(hermes_home)); |
| 11004 | snprintf(cp, sizeof(cp), "%s/config.yaml", hermes_home); |
| 11005 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", hermes_home); |
| 11006 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 11007 | int hook_result = |
| 11008 | dry_run ? CBM_YAML_IDENTITY_EDIT_OK : cbm_remove_hermes_context_hook(cp, binary_path); |
| 11009 | if (hook_result == CBM_YAML_IDENTITY_EDIT_FOREIGN) { |
| 11010 | printf(" hook: preserved modified pre_llm_call entry\n"); |
| 11011 | } else if (hook_result != CBM_YAML_IDENTITY_EDIT_OK) { |
| 11012 | record_agent_config_error(true, "Hermes", "pre_llm_hook_uninstall", cp); |
| 11013 | } else { |
| 11014 | printf(" hook: removed canonical pre_llm_call entry\n"); |
| 11015 | } |
| 11016 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Hermes", cp, NULL}, dry_run, |
| 11017 | cbm_remove_hermes_mcp_owned); |
| 11018 | uninstall_agent_skill("Hermes", skills_dir, dry_run); |
| 11019 | } |
| 11020 | if (agents->openhands) { |
| 11021 | char cp[CLI_BUF_1K]; |
| 11022 | char skills_dir[CLI_BUF_1K]; |
| 11023 | snprintf(cp, sizeof(cp), "%s/.openhands/mcp.json", home); |
| 11024 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 11025 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"OpenHands", cp, NULL}, dry_run, |
| 11026 | cbm_remove_editor_mcp_owned); |
| 11027 | printf(" removed %d skill(s)\n", cbm_remove_skills(skills_dir, dry_run)); |
| 11028 | } |
| 11029 | if (agents->augment) { |
| 11030 | char cp[CLI_BUF_1K]; |
| 11031 | char ip[CLI_BUF_1K]; |
| 11032 | char ap[CLI_BUF_1K]; |
| 11033 | char session_hp[CLI_BUF_1K]; |
| 11034 | char coverage_hp[CLI_BUF_1K]; |
| 11035 | char binary_path[CLI_BUF_1K]; |
| 11036 | snprintf(cp, sizeof(cp), "%s/.augment/settings.json", home); |
| 11037 | snprintf(ip, sizeof(ip), "%s/.augment/rules/codebase-memory.md", home); |
| 11038 | snprintf(ap, sizeof(ap), "%s/.augment/agents/codebase-memory.md", home); |
| 11039 | snprintf(session_hp, sizeof(session_hp), "%s/.augment/hooks/%s", home, |
| 11040 | AUGMENT_SESSION_SCRIPT); |
| 11041 | snprintf(coverage_hp, sizeof(coverage_hp), "%s/.augment/hooks/%s", home, |
| 11042 | AUGMENT_COVERAGE_SCRIPT); |
| 11043 | /* The owned-document match must rebuild the scripts with the exact |
| 11044 | * binary path the install embedded — the managed canonical plain form |
| 11045 | * on Windows, not a hand-assembled default. */ |
| 11046 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 11047 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Augment/Auggie", cp, ip}, dry_run, |
| 11048 | cbm_remove_editor_mcp_owned); |
| 11049 | uninstall_tiered_agent_profiles( |
| 11050 | (cbm_tiered_profile_set_t){ |
| 11051 | .label = "Augment/Auggie", |
no test coverage detected