| 8732 | } |
| 8733 | |
| 8734 | static void install_additional_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 8735 | const char *binary_path, bool force, bool dry_run) { |
| 8736 | if (agents->hermes) { |
| 8737 | char hermes_home[CLI_BUF_1K]; |
| 8738 | char cp[CLI_BUF_1K]; |
| 8739 | char skills_dir[CLI_BUF_1K]; |
| 8740 | cbm_hermes_home_dir(home, hermes_home, sizeof(hermes_home)); |
| 8741 | snprintf(cp, sizeof(cp), "%s/config.yaml", hermes_home); |
| 8742 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", hermes_home); |
| 8743 | install_generic_agent_config("Hermes", binary_path, cp, NULL, dry_run, |
| 8744 | cbm_upsert_hermes_mcp); |
| 8745 | install_agent_skill("Hermes", skills_dir, force, dry_run); |
| 8746 | if (g_install_plan) { |
| 8747 | plan_record("Hermes", "hook", cp); |
| 8748 | } else { |
| 8749 | int hook_result = CBM_YAML_IDENTITY_EDIT_OK; |
| 8750 | if (!dry_run) { |
| 8751 | hook_result = prepare_config_parent(cp) |
| 8752 | ? cbm_upsert_hermes_context_hook(cp, binary_path) |
| 8753 | : CBM_YAML_IDENTITY_EDIT_ERROR; |
| 8754 | } |
| 8755 | if (hook_result == CBM_YAML_IDENTITY_EDIT_FOREIGN) { |
| 8756 | record_agent_config_error(false, "Hermes", "pre_llm_hook_foreign", cp); |
| 8757 | } else if (hook_result != CBM_YAML_IDENTITY_EDIT_OK) { |
| 8758 | record_agent_config_error(false, "Hermes", "pre_llm_hook_install", cp); |
| 8759 | } else { |
| 8760 | printf(" hook: %s (pre_llm_call)\n", cp); |
| 8761 | } |
| 8762 | } |
| 8763 | } |
| 8764 | if (agents->openhands) { |
| 8765 | char cp[CLI_BUF_1K]; |
| 8766 | char skills_dir[CLI_BUF_1K]; |
| 8767 | snprintf(cp, sizeof(cp), "%s/.openhands/mcp.json", home); |
| 8768 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 8769 | install_generic_agent_config("OpenHands", binary_path, cp, NULL, dry_run, |
| 8770 | cbm_install_editor_mcp); |
| 8771 | install_agent_skill("OpenHands", skills_dir, force, dry_run); |
| 8772 | } |
| 8773 | if (agents->augment) { |
| 8774 | char cp[CLI_BUF_1K]; |
| 8775 | char ip[CLI_BUF_1K]; |
| 8776 | char ap[CLI_BUF_1K]; |
| 8777 | char session_hp[CLI_BUF_1K]; |
| 8778 | char coverage_hp[CLI_BUF_1K]; |
| 8779 | snprintf(cp, sizeof(cp), "%s/.augment/settings.json", home); |
| 8780 | snprintf(ip, sizeof(ip), "%s/.augment/rules/codebase-memory.md", home); |
| 8781 | snprintf(ap, sizeof(ap), "%s/.augment/agents/codebase-memory.md", home); |
| 8782 | snprintf(session_hp, sizeof(session_hp), "%s/.augment/hooks/%s", home, |
| 8783 | AUGMENT_SESSION_SCRIPT); |
| 8784 | snprintf(coverage_hp, sizeof(coverage_hp), "%s/.augment/hooks/%s", home, |
| 8785 | AUGMENT_COVERAGE_SCRIPT); |
| 8786 | install_generic_agent_config("Augment/Auggie", binary_path, cp, ip, dry_run, |
| 8787 | cbm_install_editor_mcp); |
| 8788 | install_tiered_agent_profiles( |
| 8789 | (cbm_tiered_profile_set_t){ |
| 8790 | .label = "Augment/Auggie", |
| 8791 | .verify_path = ap, |
no test coverage detected