| 8110 | } |
| 8111 | |
| 8112 | static void install_kimi_durable_context(const cbm_agent_registry_context_t *registry, |
| 8113 | const char *binary_path, bool force, bool dry_run) { |
| 8114 | const char *kimi_home = registry->options.kimi_code_home; |
| 8115 | char default_home[CLI_BUF_1K]; |
| 8116 | if (!kimi_home || !kimi_home[0]) { |
| 8117 | snprintf(default_home, sizeof(default_home), "%s/.kimi-code", registry->options.home_dir); |
| 8118 | kimi_home = default_home; |
| 8119 | } |
| 8120 | char instructions_path[CLI_BUF_1K]; |
| 8121 | char skills_dir[CLI_BUF_1K]; |
| 8122 | char config_path[CLI_BUF_1K]; |
| 8123 | snprintf(instructions_path, sizeof(instructions_path), "%s/AGENTS.md", kimi_home); |
| 8124 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", kimi_home); |
| 8125 | snprintf(config_path, sizeof(config_path), "%s/config.toml", kimi_home); |
| 8126 | install_managed_agent_instructions("Kimi Code CLI", instructions_path, dry_run); |
| 8127 | install_agent_skill("Kimi Code CLI", skills_dir, force, dry_run); |
| 8128 | if (g_install_plan) { |
| 8129 | plan_record("Kimi Code CLI", "hook", config_path); |
| 8130 | return; |
| 8131 | } |
| 8132 | bool installed = true; |
| 8133 | if (!dry_run && (!prepare_config_parent(config_path) || |
| 8134 | cbm_upsert_kimi_context_hook(config_path, binary_path) != CLI_OK)) { |
| 8135 | installed = false; |
| 8136 | record_agent_config_error(false, "Kimi Code CLI", "prompt_hook_install", config_path); |
| 8137 | } |
| 8138 | if (installed) { |
| 8139 | printf(" hook: %s (UserPromptSubmit)\n", config_path); |
| 8140 | } |
| 8141 | } |
| 8142 | |
| 8143 | static void install_rovo_durable_context(const char *home, bool force, bool dry_run) { |
| 8144 | char instructions_path[CLI_BUF_1K]; |
no test coverage detected