| 8162 | } |
| 8163 | |
| 8164 | static void install_agent_client_registry(const char *home, const char *binary_path, |
| 8165 | bool inherit_claude_session, bool force, bool dry_run) { |
| 8166 | cbm_agent_registry_context_t registry; |
| 8167 | cbm_init_agent_registry_context(home, ®istry); |
| 8168 | for (size_t index = 0U; index < cbm_agent_client_count(); index++) { |
| 8169 | const cbm_agent_client_profile_t *profile = cbm_agent_client_at(index); |
| 8170 | if (!profile || !cbm_agent_client_detect(profile->id, ®istry.options)) { |
| 8171 | continue; |
| 8172 | } |
| 8173 | if (!g_install_plan) { |
| 8174 | printf("%s:\n", profile->display_name); |
| 8175 | } |
| 8176 | |
| 8177 | char config_path[CLI_BUF_1K] = {0}; |
| 8178 | bool config_resolved = false; |
| 8179 | if ((profile->capabilities & CBM_AGENT_CAP_MCP) != 0U) { |
| 8180 | int resolved = cbm_agent_client_resolve_path(profile->id, ®istry.options, |
| 8181 | config_path, sizeof(config_path)); |
| 8182 | if (resolved != 0 || !profile->install_mcp) { |
| 8183 | record_agent_config_error(false, profile->display_name, "mcp_resolve", |
| 8184 | profile->stable_id); |
| 8185 | } else if (g_install_plan) { |
| 8186 | config_resolved = true; |
| 8187 | plan_record(profile->display_name, "mcp_config", config_path); |
| 8188 | } else { |
| 8189 | config_resolved = true; |
| 8190 | int edit_result = CBM_AGENT_EDIT_OK; |
| 8191 | if (!dry_run) { |
| 8192 | edit_result = prepare_config_parent(config_path) |
| 8193 | ? profile->install_mcp(profile->id, config_path, binary_path) |
| 8194 | : CBM_AGENT_EDIT_ERROR; |
| 8195 | } |
| 8196 | if (edit_result == CBM_AGENT_EDIT_FOREIGN) { |
| 8197 | record_agent_config_error(false, profile->display_name, "mcp_foreign", |
| 8198 | config_path); |
| 8199 | } else if (edit_result != CBM_AGENT_EDIT_OK) { |
| 8200 | record_agent_config_error(false, profile->display_name, "mcp_install", |
| 8201 | config_path); |
| 8202 | } else { |
| 8203 | printf(" mcp: %s\n", config_path); |
| 8204 | } |
| 8205 | } |
| 8206 | } |
| 8207 | |
| 8208 | if (profile->id == CBM_AGENT_CLIENT_QODER) { |
| 8209 | install_qoder_durable_context(home, binary_path, config_path, config_resolved, force, |
| 8210 | dry_run); |
| 8211 | } else if (profile->id == CBM_AGENT_CLIENT_KIMI) { |
| 8212 | install_kimi_durable_context(®istry, binary_path, force, dry_run); |
| 8213 | } else if (profile->id == CBM_AGENT_CLIENT_GITLAB_DUO) { |
| 8214 | install_gitlab_durable_context(®istry, binary_path, dry_run); |
| 8215 | } else if (profile->id == CBM_AGENT_CLIENT_ROVO_DEV) { |
| 8216 | install_rovo_durable_context(home, force, dry_run); |
| 8217 | } else if (profile->id == CBM_AGENT_CLIENT_AMP) { |
| 8218 | install_amp_durable_context(home, force, dry_run); |
| 8219 | } else if (profile->id == CBM_AGENT_CLIENT_DEVIN) { |
| 8220 | install_devin_durable_context(®istry, binary_path, config_path, config_resolved, |
| 8221 | inherit_claude_session, force, dry_run); |
no test coverage detected