MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / uninstall_tiered_agent_profiles

Function uninstall_tiered_agent_profiles

src/cli/cli.c:8964–8997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8962}
8963
8964static void uninstall_tiered_agent_profiles(cbm_tiered_profile_set_t profiles, bool dry_run) {
8965 cbm_graph_access_t access = cbm_tiered_profile_set_access(profiles);
8966 for (int value = 0; value < (int)CBM_GRAPH_TIER_COUNT; value++) {
8967 cbm_graph_tier_t tier = (cbm_graph_tier_t)value;
8968 char path[CLI_BUF_1K];
8969 if (cbm_tiered_profile_path(profiles.verify_path, tier, path, sizeof(path)) != CLI_OK) {
8970 record_agent_config_error(true, profiles.label, "agent_path", profiles.verify_path);
8971 continue;
8972 }
8973 if (dry_run) {
8974 printf(" %s agent: would remove owned profile %s\n", profiles.label, path);
8975 continue;
8976 }
8977 char *current =
8978 cbm_render_graph_profile(profiles.dialect, tier, access, profiles.binary_path);
8979 if (!current) {
8980 record_agent_config_error(true, profiles.label, "agent_render", path);
8981 continue;
8982 }
8983 tiered_released_profiles_t released;
8984 tiered_released_profiles_collect(profiles, tier, access, &released);
8985 int result =
8986 cbm_text_remove_owned_document_any(path, current, released.content, released.count);
8987 tiered_released_profiles_free(&released);
8988 free(current);
8989 if (result < CLI_OK) {
8990 record_agent_config_error(true, profiles.label, "agent_uninstall", path);
8991 } else if (result > CLI_OK) {
8992 printf(" %s agent: preserved modified profile %s\n", profiles.label, path);
8993 } else {
8994 printf(" %s agent: removed owned profile %s\n", profiles.label, path);
8995 }
8996 }
8997}
8998
8999static void install_tiered_profile_prompts(const char *label, const char *verify_path,
9000 cbm_graph_profile_dialect_t dialect,

Tested by

no test coverage detected