| 9995 | } |
| 9996 | |
| 9997 | static void uninstall_devin_durable_context(const cbm_agent_registry_context_t *registry, |
| 9998 | const char *binary_path, const char *config_path, |
| 9999 | bool config_resolved, bool dry_run) { |
| 10000 | char devin_dir[CLI_BUF_1K]; |
| 10001 | char instructions_path[CLI_BUF_1K]; |
| 10002 | char skills_dir[CLI_BUF_1K]; |
| 10003 | if (!cbm_devin_user_dir(registry, devin_dir, sizeof(devin_dir))) { |
| 10004 | record_agent_config_error(true, "Devin CLI / Local", "context_resolve", "devin"); |
| 10005 | return; |
| 10006 | } |
| 10007 | snprintf(instructions_path, sizeof(instructions_path), "%s/AGENTS.md", devin_dir); |
| 10008 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", devin_dir); |
| 10009 | bool cleanup_ok = true; |
| 10010 | if (!dry_run && config_resolved && |
| 10011 | cbm_remove_devin_context_hooks(config_path, binary_path) != CLI_OK) { |
| 10012 | cleanup_ok = false; |
| 10013 | record_agent_config_error(true, "Devin CLI / Local", "lifecycle_hook_uninstall", |
| 10014 | config_path); |
| 10015 | } |
| 10016 | const char *hook_status = !config_resolved ? "skipped because the config path was unresolved" |
| 10017 | : dry_run ? "canonical lifecycle cleanup planned" |
| 10018 | : cleanup_ok |
| 10019 | ? "canonical lifecycle cleanup complete; modified or foreign " |
| 10020 | "entries preserved" |
| 10021 | : "canonical lifecycle cleanup failed"; |
| 10022 | printf(" hooks: %s\n", hook_status); |
| 10023 | uninstall_managed_agent_instructions("Devin CLI / Local", instructions_path, dry_run); |
| 10024 | uninstall_agent_skill("Devin CLI / Local", skills_dir, dry_run); |
| 10025 | } |
| 10026 | |
| 10027 | static void uninstall_pi_durable_context(const char *home, bool dry_run) { |
| 10028 | char instructions_path[CLI_BUF_1K]; |
no test coverage detected