mindgraph-mcp 0.14.4 → 0.14.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/cli.js +20 -4
- package/dist/index.js +19 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -916,6 +916,15 @@ var init_dist = __esm({
|
|
|
916
916
|
});
|
|
917
917
|
|
|
918
918
|
// src/codegraph.ts
|
|
919
|
+
function unavailabilityCaveats(reason, message) {
|
|
920
|
+
const caveats = [message || "codegraph status failed"];
|
|
921
|
+
if (reason === "absent") {
|
|
922
|
+
caveats.push(
|
|
923
|
+
"Optional: install codegraph (https://github.com/colbymchenry/codegraph) and run `codegraph init` in this repository to enable code anchoring and structural recall. Memory and work tools are unaffected."
|
|
924
|
+
);
|
|
925
|
+
}
|
|
926
|
+
return caveats;
|
|
927
|
+
}
|
|
919
928
|
function normalizePath(path6) {
|
|
920
929
|
return path6.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
921
930
|
}
|
|
@@ -1272,11 +1281,12 @@ var init_codegraph = __esm({
|
|
|
1272
1281
|
return availability;
|
|
1273
1282
|
} catch (cause) {
|
|
1274
1283
|
const failure = cause;
|
|
1284
|
+
const reason = failure.kind ?? "command_failed";
|
|
1275
1285
|
return {
|
|
1276
1286
|
available: false,
|
|
1277
|
-
reason
|
|
1287
|
+
reason,
|
|
1278
1288
|
stale: false,
|
|
1279
|
-
caveats:
|
|
1289
|
+
caveats: unavailabilityCaveats(reason, failure.message)
|
|
1280
1290
|
};
|
|
1281
1291
|
}
|
|
1282
1292
|
}
|
|
@@ -3845,7 +3855,7 @@ var init_tools = __esm({
|
|
|
3845
3855
|
},
|
|
3846
3856
|
{
|
|
3847
3857
|
name: "mindgraph_retrieve",
|
|
3848
|
-
description: "Search and explore the knowledge graph. Use 'context' (default) for BM25 keyword retrieval plus bounded cheapest-first graph expansion \u2014 returns graph nodes only by default (labels, summaries, types, confidence); set include_chunks=true to also get full source text. Pass 1-3 discriminating keywords, not sentences. GOOD: 'Kissinger NATO'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'document_index' to list all ingested documents (titles, dates, UIDs) for orientation. Use 'semantic' when keywords return nothing \u2014 conceptual/fuzzy queries. Use 'hybrid' for keyword + semantic. Use 'text' for fast keyword-only. Use 'neighborhood'/'chain'/'path'/'subgraph' for graph traversal \u2014 traversal steps carry the cheapest witness path_cost (lower = stronger connection; sum of -ln(edge weight)), path_confidence, and witness depth. Use 'preferences' for advice or recommendation requests ('suggest a hotel', 'what should I read?') \u2014 it returns the user's stated/learned preferences relevant to the query (pass the topic as 'query'), so your answer reflects what they actually like instead of being generic. Other structured actions ('active_goals', 'open_questions', etc.) only when the user explicitly asks.",
|
|
3858
|
+
description: "Search and explore the knowledge graph. NOT for work state: for 'what was I working on' or resuming work, use mindgraph_plan action resume_work (structural, deterministic) \u2014 this tool is semantic/keyword recall over ALL knowledge. Use 'context' (default) for BM25 keyword retrieval plus bounded cheapest-first graph expansion \u2014 returns graph nodes only by default (labels, summaries, types, confidence); set include_chunks=true to also get full source text. Pass 1-3 discriminating keywords, not sentences. GOOD: 'Kissinger NATO'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'document_index' to list all ingested documents (titles, dates, UIDs) for orientation. Use 'semantic' when keywords return nothing \u2014 conceptual/fuzzy queries. Use 'hybrid' for keyword + semantic. Use 'text' for fast keyword-only. Use 'neighborhood'/'chain'/'path'/'subgraph' for graph traversal \u2014 traversal steps carry the cheapest witness path_cost (lower = stronger connection; sum of -ln(edge weight)), path_confidence, and witness depth. Use 'preferences' for advice or recommendation requests ('suggest a hotel', 'what should I read?') \u2014 it returns the user's stated/learned preferences relevant to the query (pass the topic as 'query'), so your answer reflects what they actually like instead of being generic. Other structured actions ('active_goals', 'open_questions', etc.) only when the user explicitly asks.",
|
|
3849
3859
|
inputSchema: {
|
|
3850
3860
|
type: "object",
|
|
3851
3861
|
properties: {
|
|
@@ -4881,6 +4891,11 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
4881
4891
|
|
|
4882
4892
|
## Coding profile
|
|
4883
4893
|
|
|
4894
|
+
**Recall order (overrides the #1 rule above for work and code questions):**
|
|
4895
|
+
- "What was I working on?" / current work state / resuming anything: call \`mindgraph_plan\` action \`resume_work\` FIRST. Work state is structural; never answer it from keyword search ("recent work" famously retrieves people named Work).
|
|
4896
|
+
- Knowledge about specific code (a function, file, or route): \`mindgraph_code\` action \`recall\` \u2014 anchor-based, not keyword-based.
|
|
4897
|
+
- Broad knowledge searches: \`mindgraph_retrieve\` as usual, but when searching for work artifacts pass node_types filters (Task, Lesson, RiskAssessment, Claim) to keep personal-graph content out of engineering answers.
|
|
4898
|
+
|
|
4884
4899
|
- Use mindgraph_sync for explicit, one-way project memory-file imports. It discovers and hashes files, but you deliberately map durable assertions with record; it never writes graph state back to files.
|
|
4885
4900
|
- Capture corrections, decisions with rationale, fixes that survived meaningful failed attempts, durable invariants/preferences, and blockers with evidence.
|
|
4886
4901
|
- Do not capture routine mechanics, transient command output, facts cheaply derivable from code, unsupported speculation as high-confidence lessons, or completion without evidence.
|
|
@@ -4893,7 +4908,7 @@ Capture knowledge when the user shares something worth remembering:
|
|
|
4893
4908
|
server = new import_server.Server(
|
|
4894
4909
|
{
|
|
4895
4910
|
name: "mindgraph",
|
|
4896
|
-
version: "0.14.
|
|
4911
|
+
version: "0.14.6"
|
|
4897
4912
|
},
|
|
4898
4913
|
{
|
|
4899
4914
|
capabilities: {
|
|
@@ -6185,6 +6200,7 @@ async function main2() {
|
|
|
6185
6200
|
console.log(
|
|
6186
6201
|
`Installed ${result.added} and refreshed ${result.updated} MindGraph Claude Code hook entries in ${result.path}`
|
|
6187
6202
|
);
|
|
6203
|
+
printCodegraphStatus();
|
|
6188
6204
|
if (apiKey || baseUrl || agentId) {
|
|
6189
6205
|
const envPath = saveHookEnv({ apiKey, baseUrl, agentId });
|
|
6190
6206
|
console.log(`Saved hook connection settings to ${envPath} (mode 600)`);
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,15 @@ var import_promises = require("fs/promises");
|
|
|
45
45
|
var import_node_os = require("os");
|
|
46
46
|
var import_node_path = require("path");
|
|
47
47
|
var import_node_crypto = require("crypto");
|
|
48
|
+
function unavailabilityCaveats(reason, message) {
|
|
49
|
+
const caveats = [message || "codegraph status failed"];
|
|
50
|
+
if (reason === "absent") {
|
|
51
|
+
caveats.push(
|
|
52
|
+
"Optional: install codegraph (https://github.com/colbymchenry/codegraph) and run `codegraph init` in this repository to enable code anchoring and structural recall. Memory and work tools are unaffected."
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return caveats;
|
|
56
|
+
}
|
|
48
57
|
var DEFAULT_TIMEOUT_MS = 5e3;
|
|
49
58
|
var DEFAULT_STATUS_TTL_MS = 6e4;
|
|
50
59
|
var MAX_OUTPUT_BYTES = 5 * 1024 * 1024;
|
|
@@ -364,11 +373,12 @@ var CodegraphAdapter = class {
|
|
|
364
373
|
return availability;
|
|
365
374
|
} catch (cause) {
|
|
366
375
|
const failure = cause;
|
|
376
|
+
const reason = failure.kind ?? "command_failed";
|
|
367
377
|
return {
|
|
368
378
|
available: false,
|
|
369
|
-
reason
|
|
379
|
+
reason,
|
|
370
380
|
stale: false,
|
|
371
|
-
caveats:
|
|
381
|
+
caveats: unavailabilityCaveats(reason, failure.message)
|
|
372
382
|
};
|
|
373
383
|
}
|
|
374
384
|
}
|
|
@@ -1965,7 +1975,7 @@ var TOOLS = [
|
|
|
1965
1975
|
},
|
|
1966
1976
|
{
|
|
1967
1977
|
name: "mindgraph_retrieve",
|
|
1968
|
-
description: "Search and explore the knowledge graph. Use 'context' (default) for BM25 keyword retrieval plus bounded cheapest-first graph expansion \u2014 returns graph nodes only by default (labels, summaries, types, confidence); set include_chunks=true to also get full source text. Pass 1-3 discriminating keywords, not sentences. GOOD: 'Kissinger NATO'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'document_index' to list all ingested documents (titles, dates, UIDs) for orientation. Use 'semantic' when keywords return nothing \u2014 conceptual/fuzzy queries. Use 'hybrid' for keyword + semantic. Use 'text' for fast keyword-only. Use 'neighborhood'/'chain'/'path'/'subgraph' for graph traversal \u2014 traversal steps carry the cheapest witness path_cost (lower = stronger connection; sum of -ln(edge weight)), path_confidence, and witness depth. Use 'preferences' for advice or recommendation requests ('suggest a hotel', 'what should I read?') \u2014 it returns the user's stated/learned preferences relevant to the query (pass the topic as 'query'), so your answer reflects what they actually like instead of being generic. Other structured actions ('active_goals', 'open_questions', etc.) only when the user explicitly asks.",
|
|
1978
|
+
description: "Search and explore the knowledge graph. NOT for work state: for 'what was I working on' or resuming work, use mindgraph_plan action resume_work (structural, deterministic) \u2014 this tool is semantic/keyword recall over ALL knowledge. Use 'context' (default) for BM25 keyword retrieval plus bounded cheapest-first graph expansion \u2014 returns graph nodes only by default (labels, summaries, types, confidence); set include_chunks=true to also get full source text. Pass 1-3 discriminating keywords, not sentences. GOOD: 'Kissinger NATO'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'document_index' to list all ingested documents (titles, dates, UIDs) for orientation. Use 'semantic' when keywords return nothing \u2014 conceptual/fuzzy queries. Use 'hybrid' for keyword + semantic. Use 'text' for fast keyword-only. Use 'neighborhood'/'chain'/'path'/'subgraph' for graph traversal \u2014 traversal steps carry the cheapest witness path_cost (lower = stronger connection; sum of -ln(edge weight)), path_confidence, and witness depth. Use 'preferences' for advice or recommendation requests ('suggest a hotel', 'what should I read?') \u2014 it returns the user's stated/learned preferences relevant to the query (pass the topic as 'query'), so your answer reflects what they actually like instead of being generic. Other structured actions ('active_goals', 'open_questions', etc.) only when the user explicitly asks.",
|
|
1969
1979
|
inputSchema: {
|
|
1970
1980
|
type: "object",
|
|
1971
1981
|
properties: {
|
|
@@ -3919,6 +3929,11 @@ if (PROFILE === "coding") {
|
|
|
3919
3929
|
|
|
3920
3930
|
## Coding profile
|
|
3921
3931
|
|
|
3932
|
+
**Recall order (overrides the #1 rule above for work and code questions):**
|
|
3933
|
+
- "What was I working on?" / current work state / resuming anything: call \`mindgraph_plan\` action \`resume_work\` FIRST. Work state is structural; never answer it from keyword search ("recent work" famously retrieves people named Work).
|
|
3934
|
+
- Knowledge about specific code (a function, file, or route): \`mindgraph_code\` action \`recall\` \u2014 anchor-based, not keyword-based.
|
|
3935
|
+
- Broad knowledge searches: \`mindgraph_retrieve\` as usual, but when searching for work artifacts pass node_types filters (Task, Lesson, RiskAssessment, Claim) to keep personal-graph content out of engineering answers.
|
|
3936
|
+
|
|
3922
3937
|
- Use mindgraph_sync for explicit, one-way project memory-file imports. It discovers and hashes files, but you deliberately map durable assertions with record; it never writes graph state back to files.
|
|
3923
3938
|
- Capture corrections, decisions with rationale, fixes that survived meaningful failed attempts, durable invariants/preferences, and blockers with evidence.
|
|
3924
3939
|
- Do not capture routine mechanics, transient command output, facts cheaply derivable from code, unsupported speculation as high-confidence lessons, or completion without evidence.
|
|
@@ -3931,7 +3946,7 @@ if (PROFILE === "coding") {
|
|
|
3931
3946
|
var server = new import_server.Server(
|
|
3932
3947
|
{
|
|
3933
3948
|
name: "mindgraph",
|
|
3934
|
-
version: "0.14.
|
|
3949
|
+
version: "0.14.6"
|
|
3935
3950
|
},
|
|
3936
3951
|
{
|
|
3937
3952
|
capabilities: {
|