| 8305 | } |
| 8306 | |
| 8307 | static void install_agent_client_registry(const char *home, const char *binary_path, |
| 8308 | bool inherit_claude_session, bool force, bool dry_run) { |
| 8309 | cbm_agent_registry_context_t registry; |
| 8310 | cbm_init_agent_registry_context(home, ®istry); |
| 8311 | for (size_t index = 0U; index < cbm_agent_client_count(); index++) { |
| 8312 | const cbm_agent_client_profile_t *profile = cbm_agent_client_at(index); |
| 8313 | if (!profile || !cbm_agent_client_detect(profile->id, ®istry.options)) { |
| 8314 | continue; |
| 8315 | } |
| 8316 | if (!g_install_plan) { |
| 8317 | printf("%s:\n", profile->display_name); |
| 8318 | } |
| 8319 | |
| 8320 | char config_path[CLI_BUF_1K] = {0}; |
| 8321 | bool config_resolved = false; |
| 8322 | if ((profile->capabilities & CBM_AGENT_CAP_MCP) != 0U) { |
| 8323 | int resolved = cbm_agent_client_resolve_path(profile->id, ®istry.options, |
| 8324 | config_path, sizeof(config_path)); |
| 8325 | if (resolved != 0 || !profile->install_mcp) { |
| 8326 | record_agent_config_error(false, profile->display_name, "mcp_resolve", |
| 8327 | profile->stable_id); |
| 8328 | } else if (g_install_plan) { |
| 8329 | config_resolved = true; |
| 8330 | plan_record(profile->display_name, "mcp_config", config_path); |
| 8331 | } else { |
| 8332 | config_resolved = true; |
| 8333 | int edit_result = CBM_AGENT_EDIT_OK; |
| 8334 | if (!dry_run) { |
| 8335 | edit_result = prepare_config_parent(config_path) |
| 8336 | ? profile->install_mcp(profile->id, config_path, binary_path) |
| 8337 | : CBM_AGENT_EDIT_ERROR; |
| 8338 | } |
| 8339 | if (edit_result == CBM_AGENT_EDIT_FOREIGN) { |
| 8340 | record_agent_config_error(false, profile->display_name, "mcp_foreign", |
| 8341 | config_path); |
| 8342 | } else if (edit_result != CBM_AGENT_EDIT_OK) { |
| 8343 | record_agent_config_error(false, profile->display_name, "mcp_install", |
| 8344 | config_path); |
| 8345 | } else { |
| 8346 | printf(" mcp: %s\n", config_path); |
| 8347 | } |
| 8348 | } |
| 8349 | } |
| 8350 | |
| 8351 | if (profile->id == CBM_AGENT_CLIENT_QODER) { |
| 8352 | install_qoder_durable_context(home, binary_path, config_path, config_resolved, force, |
| 8353 | dry_run); |
| 8354 | } else if (profile->id == CBM_AGENT_CLIENT_KIMI) { |
| 8355 | install_kimi_durable_context(®istry, binary_path, force, dry_run); |
| 8356 | } else if (profile->id == CBM_AGENT_CLIENT_GITLAB_DUO) { |
| 8357 | install_gitlab_durable_context(®istry, binary_path, dry_run); |
| 8358 | } else if (profile->id == CBM_AGENT_CLIENT_ROVO_DEV) { |
| 8359 | install_rovo_durable_context(home, force, dry_run); |
| 8360 | } else if (profile->id == CBM_AGENT_CLIENT_AMP) { |
| 8361 | install_amp_durable_context(home, force, dry_run); |
| 8362 | } else if (profile->id == CBM_AGENT_CLIENT_DEVIN) { |
| 8363 | install_devin_durable_context(®istry, binary_path, config_path, config_resolved, |
| 8364 | inherit_claude_session, force, dry_run); |
no test coverage detected