| 10494 | const char *instr_path; |
| 10495 | } mcp_uninstall_args_t; |
| 10496 | static void uninstall_agent_mcp_instr(mcp_uninstall_args_t paths, bool dry_run, |
| 10497 | int (*remove_fn)(const char *, const char *)) { |
| 10498 | const char *name = paths.name; |
| 10499 | const char *instr_path = paths.instr_path; |
| 10500 | if (!dry_run) { |
| 10501 | char binary_path[CLI_BUF_1K]; |
| 10502 | cbm_agent_installed_binary_path(cbm_get_home_dir(), binary_path, sizeof(binary_path)); |
| 10503 | int remove_result = remove_fn(binary_path, paths.config_path); |
| 10504 | if (remove_result < CLI_OK) { |
| 10505 | record_agent_config_error(true, name, "mcp_uninstall", paths.config_path); |
| 10506 | } else if (remove_result > CLI_OK) { |
| 10507 | printf("%s: preserved modified or foreign MCP entry\n", name); |
| 10508 | } |
| 10509 | } |
| 10510 | printf("%s: removed MCP config entry\n", name); |
| 10511 | if (instr_path) { |
| 10512 | if (!dry_run) { |
| 10513 | if (cbm_remove_instructions(instr_path) != CLI_OK) { |
| 10514 | record_agent_config_error(true, name, "instructions_uninstall", instr_path); |
| 10515 | } |
| 10516 | } |
| 10517 | printf(" removed instructions\n"); |
| 10518 | } |
| 10519 | } |
| 10520 | |
| 10521 | static void uninstall_agent_skill(const char *label, const char *skills_dir, bool dry_run) { |
| 10522 | int removed = cbm_remove_skills(skills_dir, dry_run); |
no test coverage detected