| 10533 | } |
| 10534 | |
| 10535 | static void uninstall_additional_agents(const cbm_detected_agents_t *agents, const char *home, |
| 10536 | bool dry_run) { |
| 10537 | char installed_binary[CLI_BUF_1K]; |
| 10538 | cbm_agent_installed_binary_path(home, installed_binary, sizeof(installed_binary)); |
| 10539 | if (agents->hermes) { |
| 10540 | char hermes_home[CLI_BUF_1K]; |
| 10541 | char cp[CLI_BUF_1K]; |
| 10542 | char skills_dir[CLI_BUF_1K]; |
| 10543 | char binary_path[CLI_BUF_1K]; |
| 10544 | cbm_hermes_home_dir(home, hermes_home, sizeof(hermes_home)); |
| 10545 | snprintf(cp, sizeof(cp), "%s/config.yaml", hermes_home); |
| 10546 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", hermes_home); |
| 10547 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 10548 | int hook_result = |
| 10549 | dry_run ? CBM_YAML_IDENTITY_EDIT_OK : cbm_remove_hermes_context_hook(cp, binary_path); |
| 10550 | if (hook_result == CBM_YAML_IDENTITY_EDIT_FOREIGN) { |
| 10551 | printf(" hook: preserved modified pre_llm_call entry\n"); |
| 10552 | } else if (hook_result != CBM_YAML_IDENTITY_EDIT_OK) { |
| 10553 | record_agent_config_error(true, "Hermes", "pre_llm_hook_uninstall", cp); |
| 10554 | } else { |
| 10555 | printf(" hook: removed canonical pre_llm_call entry\n"); |
| 10556 | } |
| 10557 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Hermes", cp, NULL}, dry_run, |
| 10558 | cbm_remove_hermes_mcp_owned); |
| 10559 | uninstall_agent_skill("Hermes", skills_dir, dry_run); |
| 10560 | } |
| 10561 | if (agents->openhands) { |
| 10562 | char cp[CLI_BUF_1K]; |
| 10563 | char skills_dir[CLI_BUF_1K]; |
| 10564 | snprintf(cp, sizeof(cp), "%s/.openhands/mcp.json", home); |
| 10565 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 10566 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"OpenHands", cp, NULL}, dry_run, |
| 10567 | cbm_remove_editor_mcp_owned); |
| 10568 | printf(" removed %d skill(s)\n", cbm_remove_skills(skills_dir, dry_run)); |
| 10569 | } |
| 10570 | if (agents->augment) { |
| 10571 | char cp[CLI_BUF_1K]; |
| 10572 | char ip[CLI_BUF_1K]; |
| 10573 | char ap[CLI_BUF_1K]; |
| 10574 | char session_hp[CLI_BUF_1K]; |
| 10575 | char coverage_hp[CLI_BUF_1K]; |
| 10576 | char binary_path[CLI_BUF_1K]; |
| 10577 | snprintf(cp, sizeof(cp), "%s/.augment/settings.json", home); |
| 10578 | snprintf(ip, sizeof(ip), "%s/.augment/rules/codebase-memory.md", home); |
| 10579 | snprintf(ap, sizeof(ap), "%s/.augment/agents/codebase-memory.md", home); |
| 10580 | snprintf(session_hp, sizeof(session_hp), "%s/.augment/hooks/%s", home, |
| 10581 | AUGMENT_SESSION_SCRIPT); |
| 10582 | snprintf(coverage_hp, sizeof(coverage_hp), "%s/.augment/hooks/%s", home, |
| 10583 | AUGMENT_COVERAGE_SCRIPT); |
| 10584 | /* The owned-document match must rebuild the scripts with the exact |
| 10585 | * binary path the install embedded — the managed canonical plain form |
| 10586 | * on Windows, not a hand-assembled default. */ |
| 10587 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 10588 | uninstall_agent_mcp_instr((mcp_uninstall_args_t){"Augment/Auggie", cp, ip}, dry_run, |
| 10589 | cbm_remove_editor_mcp_owned); |
| 10590 | uninstall_tiered_agent_profiles( |
| 10591 | (cbm_tiered_profile_set_t){ |
| 10592 | .label = "Augment/Auggie", |
no test coverage detected