| 8054 | } |
| 8055 | |
| 8056 | static void install_kimi_durable_context(const cbm_agent_registry_context_t *registry, |
| 8057 | const char *binary_path, bool force, bool dry_run) { |
| 8058 | const char *kimi_home = registry->options.kimi_code_home; |
| 8059 | char default_home[CLI_BUF_1K]; |
| 8060 | if (!kimi_home || !kimi_home[0]) { |
| 8061 | snprintf(default_home, sizeof(default_home), "%s/.kimi-code", registry->options.home_dir); |
| 8062 | kimi_home = default_home; |
| 8063 | } |
| 8064 | char instructions_path[CLI_BUF_1K]; |
| 8065 | char skills_dir[CLI_BUF_1K]; |
| 8066 | char config_path[CLI_BUF_1K]; |
| 8067 | snprintf(instructions_path, sizeof(instructions_path), "%s/AGENTS.md", kimi_home); |
| 8068 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", kimi_home); |
| 8069 | snprintf(config_path, sizeof(config_path), "%s/config.toml", kimi_home); |
| 8070 | install_managed_agent_instructions("Kimi Code CLI", instructions_path, dry_run); |
| 8071 | install_agent_skill("Kimi Code CLI", skills_dir, force, dry_run); |
| 8072 | if (g_install_plan) { |
| 8073 | plan_record("Kimi Code CLI", "hook", config_path); |
| 8074 | return; |
| 8075 | } |
| 8076 | bool installed = true; |
| 8077 | if (!dry_run && (!prepare_config_parent(config_path) || |
| 8078 | cbm_upsert_kimi_context_hook(config_path, binary_path) != CLI_OK)) { |
| 8079 | installed = false; |
| 8080 | record_agent_config_error(false, "Kimi Code CLI", "prompt_hook_install", config_path); |
| 8081 | } |
| 8082 | if (installed) { |
| 8083 | printf(" hook: %s (UserPromptSubmit)\n", config_path); |
| 8084 | } |
| 8085 | } |
| 8086 | |
| 8087 | static void install_rovo_durable_context(const char *home, bool force, bool dry_run) { |
| 8088 | char instructions_path[CLI_BUF_1K]; |
no test coverage detected