| 10051 | } |
| 10052 | |
| 10053 | static void uninstall_devin_durable_context(const cbm_agent_registry_context_t *registry, |
| 10054 | const char *binary_path, const char *config_path, |
| 10055 | bool config_resolved, bool dry_run) { |
| 10056 | char devin_dir[CLI_BUF_1K]; |
| 10057 | char instructions_path[CLI_BUF_1K]; |
| 10058 | char skills_dir[CLI_BUF_1K]; |
| 10059 | if (!cbm_devin_user_dir(registry, devin_dir, sizeof(devin_dir))) { |
| 10060 | record_agent_config_error(true, "Devin CLI / Local", "context_resolve", "devin"); |
| 10061 | return; |
| 10062 | } |
| 10063 | snprintf(instructions_path, sizeof(instructions_path), "%s/AGENTS.md", devin_dir); |
| 10064 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", devin_dir); |
| 10065 | bool cleanup_ok = true; |
| 10066 | if (!dry_run && config_resolved && |
| 10067 | cbm_remove_devin_context_hooks(config_path, binary_path) != CLI_OK) { |
| 10068 | cleanup_ok = false; |
| 10069 | record_agent_config_error(true, "Devin CLI / Local", "lifecycle_hook_uninstall", |
| 10070 | config_path); |
| 10071 | } |
| 10072 | const char *hook_status = !config_resolved ? "skipped because the config path was unresolved" |
| 10073 | : dry_run ? "canonical lifecycle cleanup planned" |
| 10074 | : cleanup_ok |
| 10075 | ? "canonical lifecycle cleanup complete; modified or foreign " |
| 10076 | "entries preserved" |
| 10077 | : "canonical lifecycle cleanup failed"; |
| 10078 | printf(" hooks: %s\n", hook_status); |
| 10079 | uninstall_managed_agent_instructions("Devin CLI / Local", instructions_path, dry_run); |
| 10080 | uninstall_agent_skill("Devin CLI / Local", skills_dir, dry_run); |
| 10081 | } |
| 10082 | |
| 10083 | static void uninstall_pi_durable_context(const char *home, bool dry_run) { |
| 10084 | char instructions_path[CLI_BUF_1K]; |
no test coverage detected