MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / install_agent_client_registry

Function install_agent_client_registry

src/cli/cli.c:8158–8228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 15

cbm_agent_client_countFunction · 0.85
cbm_agent_client_atFunction · 0.85
cbm_agent_client_detectFunction · 0.85
plan_recordFunction · 0.85
prepare_config_parentFunction · 0.85

Tested by

no test coverage detected