Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */
| 8504 | |
| 8505 | /* Install MCP configs for editor-based agents (Zed, KiloCode, VS Code, OpenClaw). */ |
| 8506 | static void install_editor_agent_configs(const cbm_detected_agents_t *agents, const char *home, |
| 8507 | const char *binary_path, bool force, bool dry_run) { |
| 8508 | if (agents->zed) { |
| 8509 | char config_dir[CLI_BUF_1K]; |
| 8510 | char cp[CLI_BUF_1K]; |
| 8511 | char ip[CLI_BUF_1K]; |
| 8512 | char skills_dir[CLI_BUF_1K]; |
| 8513 | cbm_zed_config_dir(home, config_dir, sizeof(config_dir)); |
| 8514 | cbm_zed_instructions_path(home, ip, sizeof(ip)); |
| 8515 | snprintf(cp, sizeof(cp), "%s/settings.json", config_dir); |
| 8516 | snprintf(skills_dir, sizeof(skills_dir), "%s/.agents/skills", home); |
| 8517 | install_generic_agent_config("Zed", binary_path, cp, ip, dry_run, cbm_install_zed_mcp); |
| 8518 | install_agent_skill("Zed", skills_dir, force, dry_run); |
| 8519 | } |
| 8520 | if (agents->kilocode) { |
| 8521 | char cp[CLI_BUF_1K]; |
| 8522 | char ip[CLI_BUF_1K]; |
| 8523 | char ap[CLI_BUF_1K]; |
| 8524 | snprintf(cp, sizeof(cp), "%s/.config/kilo/kilo.jsonc", home); |
| 8525 | snprintf(ip, sizeof(ip), "%s/.config/kilo/rules/codebase-memory-mcp.md", home); |
| 8526 | snprintf(ap, sizeof(ap), "%s/.config/kilo/agents/codebase-memory.md", home); |
| 8527 | install_generic_agent_config("KiloCode", binary_path, cp, ip, dry_run, cbm_upsert_kilo_mcp); |
| 8528 | install_tiered_agent_profiles( |
| 8529 | (cbm_tiered_profile_set_t){ |
| 8530 | .label = "KiloCode", |
| 8531 | .verify_path = ap, |
| 8532 | .binary_path = binary_path, |
| 8533 | .legacy_verify_content = legacy_kilo_verify_agent_content, |
| 8534 | .dialect = CBM_GRAPH_DIALECT_KILO, |
| 8535 | }, |
| 8536 | dry_run); |
| 8537 | if (!dry_run && !g_install_plan) { |
| 8538 | if (cbm_json_like_add_unique_string(cp, "instructions", ip) != CLI_OK) { |
| 8539 | record_agent_config_error(false, "KiloCode", "instruction_reference_install", cp); |
| 8540 | } |
| 8541 | |
| 8542 | /* Migrate only the fragments owned by releases that targeted the |
| 8543 | * retired VS Code extension storage path. */ |
| 8544 | char legacy_cp[CLI_BUF_1K]; |
| 8545 | char legacy_ip[CLI_BUF_1K]; |
| 8546 | #ifdef __APPLE__ |
| 8547 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 8548 | "%s/Library/Application Support/Code/User/globalStorage/" |
| 8549 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 8550 | home); |
| 8551 | #elif defined(_WIN32) |
| 8552 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 8553 | "%s/AppData/Roaming/Code/User/globalStorage/" |
| 8554 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 8555 | home); |
| 8556 | #else |
| 8557 | snprintf(legacy_cp, sizeof(legacy_cp), |
| 8558 | "%s/.config/Code/User/globalStorage/" |
| 8559 | "kilocode.kilo-code/settings/mcp_settings.json", |
| 8560 | home); |
| 8561 | #endif |
| 8562 | snprintf(legacy_ip, sizeof(legacy_ip), "%s/.kilocode/rules/codebase-memory-mcp.md", |
| 8563 | home); |
no test coverage detected