| 8112 | } |
| 8113 | |
| 8114 | static void install_agent_client_registry(const char *home, const char *binary_path, |
| 8115 | bool inherit_claude_session, bool force, bool dry_run) { |
| 8116 | cbm_agent_registry_context_t registry; |
| 8117 | cbm_init_agent_registry_context(home, ®istry); |
| 8118 | for (size_t index = 0U; index < cbm_agent_client_count(); index++) { |
| 8119 | const cbm_agent_client_profile_t *profile = cbm_agent_client_at(index); |
| 8120 | if (!profile || !cbm_agent_client_detect(profile->id, ®istry.options)) { |
| 8121 | continue; |
| 8122 | } |
| 8123 | if (!g_install_plan) { |
| 8124 | printf("%s:\n", profile->display_name); |
| 8125 | } |
| 8126 | |
| 8127 | char config_path[CLI_BUF_1K] = {0}; |
| 8128 | bool config_resolved = false; |
| 8129 | if ((profile->capabilities & CBM_AGENT_CAP_MCP) != 0U) { |
| 8130 | int resolved = cbm_agent_client_resolve_path(profile->id, ®istry.options, |
| 8131 | config_path, sizeof(config_path)); |
| 8132 | if (resolved != 0 || !profile->install_mcp) { |
| 8133 | record_agent_config_error(false, profile->display_name, "mcp_resolve", |
| 8134 | profile->stable_id); |
| 8135 | } else if (g_install_plan) { |
| 8136 | config_resolved = true; |
| 8137 | plan_record(profile->display_name, "mcp_config", config_path); |
| 8138 | } else { |
| 8139 | config_resolved = true; |
| 8140 | int edit_result = CBM_AGENT_EDIT_OK; |
| 8141 | if (!dry_run) { |
| 8142 | edit_result = prepare_config_parent(config_path) |
| 8143 | ? profile->install_mcp(profile->id, config_path, binary_path) |
| 8144 | : CBM_AGENT_EDIT_ERROR; |
| 8145 | } |
| 8146 | if (edit_result == CBM_AGENT_EDIT_FOREIGN) { |
| 8147 | record_agent_config_error(false, profile->display_name, "mcp_foreign", |
| 8148 | config_path); |
| 8149 | } else if (edit_result != CBM_AGENT_EDIT_OK) { |
| 8150 | record_agent_config_error(false, profile->display_name, "mcp_install", |
| 8151 | config_path); |
| 8152 | } else { |
| 8153 | printf(" mcp: %s\n", config_path); |
| 8154 | } |
| 8155 | } |
| 8156 | } |
| 8157 | |
| 8158 | if (profile->id == CBM_AGENT_CLIENT_QODER) { |
| 8159 | install_qoder_durable_context(home, binary_path, config_path, config_resolved, force, |
| 8160 | dry_run); |
| 8161 | } else if (profile->id == CBM_AGENT_CLIENT_KIMI) { |
| 8162 | install_kimi_durable_context(®istry, binary_path, force, dry_run); |
| 8163 | } else if (profile->id == CBM_AGENT_CLIENT_GITLAB_DUO) { |
| 8164 | install_gitlab_durable_context(®istry, binary_path, dry_run); |
| 8165 | } else if (profile->id == CBM_AGENT_CLIENT_ROVO_DEV) { |
| 8166 | install_rovo_durable_context(home, force, dry_run); |
| 8167 | } else if (profile->id == CBM_AGENT_CLIENT_AMP) { |
| 8168 | install_amp_durable_context(home, force, dry_run); |
| 8169 | } else if (profile->id == CBM_AGENT_CLIENT_DEVIN) { |
| 8170 | install_devin_durable_context(®istry, binary_path, config_path, config_resolved, |
| 8171 | inherit_claude_session, force, dry_run); |
no test coverage detected