| 10042 | } |
| 10043 | |
| 10044 | static bool remove_cline_context_hooks(const char *cline_root, const char *binary_path, |
| 10045 | bool dry_run, bool uninstalling) { |
| 10046 | bool ok = true; |
| 10047 | for (size_t i = 0U; i < sizeof(cmm_cline_context_events) / sizeof(cmm_cline_context_events[0]); |
| 10048 | i++) { |
| 10049 | char hook_path[CLI_BUF_1K]; |
| 10050 | char script[CLI_BUF_8K]; |
| 10051 | if (cbm_cline_hook_path(cline_root, cmm_cline_context_events[i], hook_path, |
| 10052 | sizeof(hook_path)) != CLI_OK || |
| 10053 | cbm_build_cline_context_script(binary_path, cmm_cline_context_events[i], script, |
| 10054 | sizeof(script)) != CLI_OK) { |
| 10055 | ok = false; |
| 10056 | record_agent_config_error(uninstalling, "Cline", "hook_resolve", |
| 10057 | cmm_cline_context_events[i]); |
| 10058 | continue; |
| 10059 | } |
| 10060 | if (dry_run) { |
| 10061 | printf(" hook: would remove owned %s adapter\n", cmm_cline_context_events[i]); |
| 10062 | continue; |
| 10063 | } |
| 10064 | int result = cbm_text_remove_owned_document(hook_path, script); |
| 10065 | if (result < 0) { |
| 10066 | ok = false; |
| 10067 | record_agent_config_error(uninstalling, "Cline", |
| 10068 | uninstalling ? "hook_uninstall" : "legacy_hook_cleanup", |
| 10069 | hook_path); |
| 10070 | } else if (result == 1) { |
| 10071 | printf(" hook: preserved modified %s adapter\n", cmm_cline_context_events[i]); |
| 10072 | } |
| 10073 | } |
| 10074 | return ok; |
| 10075 | } |
| 10076 | |
| 10077 | static void uninstall_kimi_durable_context(const cbm_agent_registry_context_t *registry, |
| 10078 | bool dry_run) { |
no test coverage detected