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

Function plan_record

src/cli/cli.c:7137–7155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7135static int g_agent_uninstall_errors = 0;
7136
7137static void plan_record(const char *agent, const char *kind, const char *path) {
7138 if (!g_install_plan || !path || !path[0]) {
7139 return;
7140 }
7141 cbm_install_plan_t *pl = g_install_plan;
7142 if (pl->count >= pl->cap) {
7143 int ncap = pl->cap ? pl->cap * 2 : CLI_BUF_16;
7144 cbm_plan_entry_t *ni = realloc(pl->items, (size_t)ncap * sizeof(*ni));
7145 if (!ni) {
7146 return;
7147 }
7148 pl->items = ni;
7149 pl->cap = ncap;
7150 }
7151 cbm_plan_entry_t *e = &pl->items[pl->count++];
7152 snprintf(e->agent, sizeof(e->agent), "%s", agent);
7153 snprintf(e->kind, sizeof(e->kind), "%s", kind);
7154 snprintf(e->path, sizeof(e->path), "%s", path);
7155}
7156
7157static void record_agent_config_error(bool uninstalling, const char *agent, const char *operation,
7158 const char *path) {

Calls

no outgoing calls

Tested by

no test coverage detected