| 9457 | } |
| 9458 | |
| 9459 | static void install_kimi_durable_context(const cbm_agent_registry_context_t *registry, |
| 9460 | const char *binary_path, bool force, bool dry_run) { |
| 9461 | const char *kimi_home = registry->options.kimi_code_home; |
| 9462 | char default_home[CLI_BUF_1K]; |
| 9463 | if (!kimi_home || !kimi_home[0]) { |
| 9464 | snprintf(default_home, sizeof(default_home), "%s/.kimi-code", registry->options.home_dir); |
| 9465 | kimi_home = default_home; |
| 9466 | } |
| 9467 | char instructions_path[CLI_BUF_1K]; |
| 9468 | char skills_dir[CLI_BUF_1K]; |
| 9469 | char config_path[CLI_BUF_1K]; |
| 9470 | snprintf(instructions_path, sizeof(instructions_path), "%s/AGENTS.md", kimi_home); |
| 9471 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", kimi_home); |
| 9472 | snprintf(config_path, sizeof(config_path), "%s/config.toml", kimi_home); |
| 9473 | install_managed_agent_instructions("Kimi Code CLI", instructions_path, dry_run); |
| 9474 | install_agent_skill("Kimi Code CLI", skills_dir, force, dry_run); |
| 9475 | if (g_install_plan) { |
| 9476 | plan_record("Kimi Code CLI", "hook", config_path); |
| 9477 | return; |
| 9478 | } |
| 9479 | bool installed = true; |
| 9480 | if (!dry_run && (!prepare_config_parent(config_path) || |
| 9481 | cbm_upsert_kimi_context_hook(config_path, binary_path) != CLI_OK)) { |
| 9482 | installed = false; |
| 9483 | record_agent_config_error(false, "Kimi Code CLI", "prompt_hook_install", config_path); |
| 9484 | } |
| 9485 | if (installed) { |
| 9486 | printf(" hook: %s (UserPromptSubmit)\n", config_path); |
| 9487 | } |
| 9488 | } |
| 9489 | |
| 9490 | static void install_rovo_durable_context(const char *home, bool force, bool dry_run) { |
| 9491 | char instructions_path[CLI_BUF_1K]; |
no test coverage detected