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

Function cp_open_indexed

tests/test_convergence_probe.c:200–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200static cbm_store_t *cp_open_indexed(CP_Proj *lp) {
201 lp->project = cbm_project_name_from_path(lp->tmpdir);
202 if (!lp->project) return NULL;
203 const char *home = getenv("HOME");
204 if (!home) home = "/tmp";
205 char cache_dir[512];
206 snprintf(cache_dir, sizeof(cache_dir), "%s/.cache/codebase-memory-mcp", home);
207 cbm_mkdir(cache_dir);
208 snprintf(lp->dbpath, sizeof(lp->dbpath), "%s/%s.db", cache_dir, lp->project);
209 unlink(lp->dbpath);
210 lp->srv = cbm_mcp_server_new(NULL);
211 if (!lp->srv) return NULL;
212 char args[700];
213 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\"}", lp->tmpdir);
214 char *resp = cbm_mcp_handle_tool(lp->srv, "index_repository", args);
215 if (resp) free(resp);
216 return cbm_store_open_path(lp->dbpath);
217}
218
219static cbm_store_t *cp_index_files(CP_Proj *lp, const CP_File *files, int nfiles) {
220 memset(lp, 0, sizeof(*lp));

Callers 1

cp_index_filesFunction · 0.85

Calls 4

cbm_mcp_server_newFunction · 0.85
cbm_mcp_handle_toolFunction · 0.85
cbm_store_open_pathFunction · 0.85

Tested by

no test coverage detected