@infinitedusky/indusk-mcp 1.11.4 → 1.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/commands/init.js +16 -16
- package/dist/bin/commands/update.js +15 -11
- package/package.json +1 -1
|
@@ -283,19 +283,21 @@ export async function init(projectRoot, options = {}) {
|
|
|
283
283
|
console.info(" skip: codegraphcontext (pipx not found — install pipx first, then: pipx install codegraphcontext)");
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
//
|
|
286
|
+
// Ensure CGC config is correct: localhost, cgc-{project} graph name
|
|
287
287
|
if (existingServers.has("codegraphcontext") && !force) {
|
|
288
288
|
try {
|
|
289
289
|
const mcpConfig = JSON.parse(readFileSync(mcpJsonPath, "utf-8"));
|
|
290
290
|
const cgcEnv = mcpConfig.mcpServers?.codegraphcontext?.env;
|
|
291
|
-
|
|
291
|
+
const correctGraph = `cgc-${projectName}`;
|
|
292
|
+
if (cgcEnv &&
|
|
293
|
+
(cgcEnv.FALKORDB_HOST !== "localhost" || cgcEnv.FALKORDB_GRAPH_NAME !== correctGraph)) {
|
|
292
294
|
execSync("claude mcp remove -s project codegraphcontext", {
|
|
293
295
|
cwd: projectRoot,
|
|
294
296
|
stdio: "pipe",
|
|
295
297
|
timeout: 10000,
|
|
296
298
|
});
|
|
297
|
-
execSync(`claude mcp add -t stdio -s project -e DATABASE_TYPE=falkordb-remote -e FALKORDB_HOST=localhost -e FALKORDB_GRAPH_NAME=${
|
|
298
|
-
console.info(
|
|
299
|
+
execSync(`claude mcp add -t stdio -s project -e DATABASE_TYPE=falkordb-remote -e FALKORDB_HOST=localhost -e FALKORDB_GRAPH_NAME=${correctGraph} -- codegraphcontext cgc mcp start`, { cwd: projectRoot, stdio: "pipe", timeout: 10000 });
|
|
300
|
+
console.info(` fixed: codegraphcontext → localhost, ${correctGraph}`);
|
|
299
301
|
}
|
|
300
302
|
}
|
|
301
303
|
catch { }
|
|
@@ -661,19 +663,17 @@ export async function init(projectRoot, options = {}) {
|
|
|
661
663
|
for (const [event, entries] of Object.entries(hookConfig)) {
|
|
662
664
|
const existingEntries = existing.hooks[event] || [];
|
|
663
665
|
// Check if our hook is already present
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
666
|
+
// Check each hook entry individually so new hooks get added even if old ones exist
|
|
667
|
+
for (const entry of entries) {
|
|
668
|
+
const alreadyPresent = existingEntries.some((e) => e.matcher === entry.matcher &&
|
|
669
|
+
entry.hooks.every((newHook) => e.hooks?.some((h) => h.command === newHook.command)));
|
|
670
|
+
if (!alreadyPresent || force) {
|
|
671
|
+
if (force) {
|
|
672
|
+
existing.hooks[event] = (existing.hooks[event] || []).filter((e) => e.matcher !== entry.matcher);
|
|
673
|
+
}
|
|
674
|
+
existing.hooks[event] = [...(existing.hooks[event] || []), entry];
|
|
675
|
+
hooksUpdated = true;
|
|
674
676
|
}
|
|
675
|
-
existing.hooks[event] = [...(existing.hooks[event] || []), ...entries];
|
|
676
|
-
hooksUpdated = true;
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
if (hooksUpdated || permissionsUpdated) {
|
|
@@ -247,20 +247,24 @@ export async function update(projectRoot) {
|
|
|
247
247
|
try {
|
|
248
248
|
const mcpConfig = JSON.parse(readFileSync(mcpJsonPath, "utf-8"));
|
|
249
249
|
let mcpChanged = false;
|
|
250
|
-
//
|
|
250
|
+
// Ensure CGC config is correct: localhost, cgc-{project} graph name
|
|
251
251
|
const cgcEnv = mcpConfig.mcpServers?.codegraphcontext?.env;
|
|
252
|
-
if (cgcEnv
|
|
252
|
+
if (cgcEnv) {
|
|
253
253
|
const { basename } = await import("node:path");
|
|
254
254
|
const projectName = basename(projectRoot);
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
255
|
+
const correctHost = "localhost";
|
|
256
|
+
const correctGraph = `cgc-${projectName}`;
|
|
257
|
+
const needsFix = cgcEnv.FALKORDB_HOST !== correctHost || cgcEnv.FALKORDB_GRAPH_NAME !== correctGraph;
|
|
258
|
+
if (needsFix) {
|
|
259
|
+
try {
|
|
260
|
+
run("claude mcp remove -s project codegraphcontext");
|
|
261
|
+
run(`claude mcp add -t stdio -s project -e DATABASE_TYPE=falkordb-remote -e FALKORDB_HOST=${correctHost} -e FALKORDB_GRAPH_NAME=${correctGraph} -- codegraphcontext cgc mcp start`);
|
|
262
|
+
console.info(` fixed: codegraphcontext → ${correctHost}, ${correctGraph}`);
|
|
263
|
+
mcpChanged = true;
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
console.info(" could not fix codegraphcontext — update .mcp.json manually");
|
|
267
|
+
}
|
|
264
268
|
}
|
|
265
269
|
}
|
|
266
270
|
// Migrate indusk: npx without --yes → npx --yes
|