Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */
| 8454 | |
| 8455 | /* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */ |
| 8456 | static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 8457 | const char *binary_path, bool force, bool dry_run) { |
| 8458 | if (agents->zed) { |
| 8459 | char config_dir[CLI_BUF_1K]; |
| 8460 | char cp[CLI_BUF_1K]; |
| 8461 | char ip[CLI_BUF_1K]; |
| 8462 | char skills_dir[CLI_BUF_1K]; |
| 8463 | cbm_zed_config_dir(home, config_dir, sizeof(config_dir)); |
| 8464 | cbm_zed_instructions_path(home, ip, sizeof(ip)); |
| 8465 | snprintf(cp, sizeof(cp), "%s/settings.json", config_dir); |
| 8466 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 8467 | install_generic_agent_config("Zed", binary_path, cp, ip, dry_run, cbm_install_zed_mcp); |
| 8468 | install_agent_skill("Zed", skills_dir, force, dry_run); |
| 8469 | } |
| 8470 | if (agents->kilocode) { |
| 8471 | char cp[CLI_BUF_1K]; |
| 8472 | char ip[CLI_BUF_1K]; |
| 8473 | char ap[CLI_BUF_1K]; |
| 8474 | snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home); |
| 8475 | snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home); |
| 8476 | snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home); |
| 8477 | install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run, cbm_upsert_kilo_mcp); |
| 8478 | install_tiered_agent_profiles( |
| 8479 | (cbm_tiered_profile_set_t){ |
| 8480 | .label = "KiloCode", |
| 8481 | .verify_path = ap, |
| 8482 | .binary_path = binary_path, |
| 8483 | .legacy_verify_content = legacy_kilo_verify_agent_content, |
| 8484 | .dialect = CBM_GRAPH_DIALECT_KILO, |
| 8485 | }, |
| 8486 | dry_run); |
| 8487 | if (!dry_run && !g_install_plan) { |
| 8488 | if (cbm_json_like_add_unique_string(cp, "instructions", ip) != CLI_OK) { |
| 8489 | record_agent_config_error(false, "KiloCode", "instruction_reference_install", cp); |
| 8490 | } |
| 8491 | |
| 8492 | /* Migrate only the fragments owned by releases that targeted the |
| 8493 | * retired VS Code extension storage path. */ |
| 8494 | char legacy_cp[CLI_BUF_1K]; |
| 8495 | char legacy_ip[CLI_BUF_1K]; |
| 8496 | #ifdef __APPLE__ |
| 8497 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 8498 | "%s/Library/Application Support/Code/User/globalStorage/" |
| 8499 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 8500 | home); |
| 8501 | #elif defined(_WIN32) |
| 8502 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 8503 | "%s/AppData/Roaming/Code/User/globalStorage/" |
| 8504 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 8505 | home); |
| 8506 | #else |
| 8507 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 8508 | "%s/.config/Code/User/globalStorage/" |
| 8509 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 8510 | home); |
| 8511 | #endif |
| 8512 | snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md", |
| 8513 | home); |
no test coverage detected