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

Function plan_record

src/cli/cli.c:7307–7325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7305static int g_agent_uninstall_errors = 0;
7306
7307static void plan_record(const char *agent, const char *kind, const char *path) {
7308 if (!g_install_plan || !path || !path[0]) {
7309 return;
7310 }
7311 cbm_install_plan_t *pl = g_install_plan;
7312 if (pl->count >= pl->cap) {
7313 int ncap = pl->cap ? pl->cap * 2 : CLI_BUF_16;
7314 cbm_plan_entry_t *ni = realloc(pl->items, (size_t)ncap * sizeof(*ni));
7315 if (!ni) {
7316 return;
7317 }
7318 pl->items = ni;
7319 pl->cap = ncap;
7320 }
7321 cbm_plan_entry_t *e = &pl->items[pl->count++];
7322 snprintf(e->agent, sizeof(e->agent), "%s", agent);
7323 snprintf(e->kind, sizeof(e->kind), "%s", kind);
7324 snprintf(e->path, sizeof(e->path), "%s", path);
7325}
7326
7327/* Describe what the target actually IS, so a refusal is triageable.
7328 *

Calls

no outgoing calls

Tested by

no test coverage detected