| 8259 | } |
| 8260 | |
| 8261 | static void install_kimi_durable_context(const cbm_agent_registry_context_t *registry, |
| 8262 | const char *binary_path, bool force, bool dry_run) { |
| 8263 | const char *kimi_home = registry->options.kimi_code_home; |
| 8264 | char default_home[CLI_BUF_1K]; |
| 8265 | if (!kimi_home || !kimi_home[0]) { |
| 8266 | snprintf(default_home, sizeof(default_home), "%s/.kimi-code", registry->options.home_dir); |
| 8267 | kimi_home = default_home; |
| 8268 | } |
| 8269 | char instructions_path[CLI_BUF_1K]; |
| 8270 | char skills_dir[CLI_BUF_1K]; |
| 8271 | char config_path[CLI_BUF_1K]; |
| 8272 | snprintf(instructions_path, sizeof(instructions_path), "%s/AGENTS.md", kimi_home); |
| 8273 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", kimi_home); |
| 8274 | snprintf(config_path, sizeof(config_path), "%s/config.toml", kimi_home); |
| 8275 | install_managed_agent_instructions("Kimi Code CLI", instructions_path, dry_run); |
| 8276 | install_agent_skill("Kimi Code CLI", skills_dir, force, dry_run); |
| 8277 | if (g_install_plan) { |
| 8278 | plan_record("Kimi Code CLI", "hook", config_path); |
| 8279 | return; |
| 8280 | } |
| 8281 | bool installed = true; |
| 8282 | if (!dry_run && (!prepare_config_parent(config_path) || |
| 8283 | cbm_upsert_kimi_context_hook(config_path, binary_path) != CLI_OK)) { |
| 8284 | installed = false; |
| 8285 | record_agent_config_error(false, "Kimi Code CLI", "prompt_hook_install", config_path); |
| 8286 | } |
| 8287 | if (installed) { |
| 8288 | printf(" hook: %s (UserPromptSubmit)\n", config_path); |
| 8289 | } |
| 8290 | } |
| 8291 | |
| 8292 | static void install_rovo_durable_context(const char *home, bool force, bool dry_run) { |
| 8293 | char instructions_path[CLI_BUF_1K]; |
no test coverage detected