| 9929 | const char *instr_path; |
| 9930 | } mcp_uninstall_args_t; |
| 9931 | static void uninstall_agent_mcp_instr(mcp_uninstall_args_t paths, bool dry_run, |
| 9932 | int (*remove_fn)(const char *, const char *)) { |
| 9933 | const char *name = paths.name; |
| 9934 | const char *instr_path = paths.instr_path; |
| 9935 | if (!dry_run) { |
| 9936 | char binary_path[CLI_BUF_1K]; |
| 9937 | cbm_agent_installed_binary_path(cbm_get_home_dir(), binary_path, sizeof(binary_path)); |
| 9938 | int remove_result = remove_fn(binary_path, paths.config_path); |
| 9939 | if (remove_result < CLI_OK) { |
| 9940 | record_agent_config_error(true, name, "mcp_uninstall", paths.config_path); |
| 9941 | } else if (remove_result > CLI_OK) { |
| 9942 | printf("%s: preserved modified or foreign MCP entry\n", name); |
| 9943 | } |
| 9944 | } |
| 9945 | printf("%s: removed MCP config entry\n", name); |
| 9946 | if (instr_path) { |
| 9947 | if (!dry_run) { |
| 9948 | if (cbm_remove_instructions(instr_path) != CLI_OK) { |
| 9949 | record_agent_config_error(true, name, "instructions_uninstall", instr_path); |
| 9950 | } |
| 9951 | } |
| 9952 | printf(" removed instructions\n"); |
| 9953 | } |
| 9954 | } |
| 9955 | |
| 9956 | static void uninstall_agent_skill(const char *label, const char *skills_dir, bool dry_run) { |
| 9957 | int removed = cbm_remove_skills(skills_dir, dry_run); |
no test coverage detected