| 11933 | } |
| 11934 | |
| 11935 | static bool remove_cline_context_hooks(const char *cline_root, const char *binary_path, |
| 11936 | bool dry_run, bool uninstalling) { |
| 11937 | bool ok = true; |
| 11938 | for (size_t i = 0U; i < sizeof(cmm_cline_context_events) / sizeof(cmm_cline_context_events[0]); |
| 11939 | i++) { |
| 11940 | char hook_path[CLI_BUF_1K]; |
| 11941 | char script[CLI_BUF_8K]; |
| 11942 | if (cbm_cline_hook_path(cline_root, cmm_cline_context_events[i], hook_path, |
| 11943 | sizeof(hook_path)) != CLI_OK || |
| 11944 | cbm_build_cline_context_script(binary_path, cmm_cline_context_events[i], script, |
| 11945 | sizeof(script)) != CLI_OK) { |
| 11946 | ok = false; |
| 11947 | record_agent_config_error(uninstalling, "Cline", "hook_resolve", |
| 11948 | cmm_cline_context_events[i]); |
| 11949 | continue; |
| 11950 | } |
| 11951 | if (dry_run) { |
| 11952 | printf(" hook: would remove owned %s adapter\n", cmm_cline_context_events[i]); |
| 11953 | continue; |
| 11954 | } |
| 11955 | int result = cbm_text_remove_owned_document(hook_path, script); |
| 11956 | if (result < 0) { |
| 11957 | ok = false; |
| 11958 | record_agent_config_error(uninstalling, "Cline", |
| 11959 | uninstalling ? "hook_uninstall" : "legacy_hook_cleanup", |
| 11960 | hook_path); |
| 11961 | } else if (result == 1) { |
| 11962 | printf(" hook: preserved modified %s adapter\n", cmm_cline_context_events[i]); |
| 11963 | } |
| 11964 | } |
| 11965 | return ok; |
| 11966 | } |
| 11967 | |
| 11968 | static void uninstall_kimi_durable_context(const cbm_agent_registry_context_t *registry, |
| 11969 | bool dry_run) { |
no test coverage detected