| 8367 | } |
| 8368 | |
| 8369 | static void install_agent_client_registry(const char *home, const char *binary_path, |
| 8370 | bool inherit_claude_session, bool force, bool dry_run) { |
| 8371 | cbm_agent_registry_context_t registry; |
| 8372 | cbm_init_agent_registry_context(home, ®istry); |
| 8373 | for (size_t index = 0U; index < cbm_agent_client_count(); index++) { |
| 8374 | const cbm_agent_client_profile_t *profile = cbm_agent_client_at(index); |
| 8375 | if (!profile || !cbm_agent_client_detect(profile->id, ®istry.options)) { |
| 8376 | continue; |
| 8377 | } |
| 8378 | if (!g_install_plan) { |
| 8379 | printf("%s:\n", profile->display_name); |
| 8380 | } |
| 8381 | |
| 8382 | char config_path[CLI_BUF_1K] = {0}; |
| 8383 | bool config_resolved = false; |
| 8384 | if ((profile->capabilities & CBM_AGENT_CAP_MCP) != 0U) { |
| 8385 | int resolved = cbm_agent_client_resolve_path(profile->id, ®istry.options, |
| 8386 | config_path, sizeof(config_path)); |
| 8387 | if (resolved != 0 || !profile->install_mcp) { |
| 8388 | record_agent_config_error(false, profile->display_name, "mcp_resolve", |
| 8389 | profile->stable_id); |
| 8390 | } else if (g_install_plan) { |
| 8391 | config_resolved = true; |
| 8392 | plan_record(profile->display_name, "mcp_config", config_path); |
| 8393 | } else { |
| 8394 | config_resolved = true; |
| 8395 | int edit_result = CBM_AGENT_EDIT_OK; |
| 8396 | if (!dry_run) { |
| 8397 | edit_result = prepare_config_parent(config_path) |
| 8398 | ? profile->install_mcp(profile->id, config_path, binary_path) |
| 8399 | : CBM_AGENT_EDIT_ERROR; |
| 8400 | } |
| 8401 | if (edit_result == CBM_AGENT_EDIT_FOREIGN) { |
| 8402 | record_agent_config_error(false, profile->display_name, "mcp_foreign", |
| 8403 | config_path); |
| 8404 | } else if (edit_result != CBM_AGENT_EDIT_OK) { |
| 8405 | record_agent_config_error(false, profile->display_name, "mcp_install", |
| 8406 | config_path); |
| 8407 | } else { |
| 8408 | printf(" mcp: %s\n", config_path); |
| 8409 | } |
| 8410 | } |
| 8411 | } |
| 8412 | |
| 8413 | if (profile->id == CBM_AGENT_CLIENT_QODER) { |
| 8414 | install_qoder_durable_context(home, binary_path, config_path, config_resolved, force, |
| 8415 | dry_run); |
| 8416 | } else if (profile->id == CBM_AGENT_CLIENT_KIMI) { |
| 8417 | install_kimi_durable_context(®istry, binary_path, force, dry_run); |
| 8418 | } else if (profile->id == CBM_AGENT_CLIENT_GITLAB_DUO) { |
| 8419 | install_gitlab_durable_context(®istry, binary_path, dry_run); |
| 8420 | } else if (profile->id == CBM_AGENT_CLIENT_ROVO_DEV) { |
| 8421 | install_rovo_durable_context(home, force, dry_run); |
| 8422 | } else if (profile->id == CBM_AGENT_CLIENT_AMP) { |
| 8423 | install_amp_durable_context(home, force, dry_run); |
| 8424 | } else if (profile->id == CBM_AGENT_CLIENT_DEVIN) { |
| 8425 | install_devin_durable_context(®istry, binary_path, config_path, config_resolved, |
| 8426 | inherit_claude_session, force, dry_run); |
no test coverage detected