@kage-core/kage-graph-mcp 2.0.0 → 2.0.1

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.
Files changed (2) hide show
  1. package/dist/kernel.js +22 -4
  2. package/package.json +4 -3
package/dist/kernel.js CHANGED
@@ -8527,13 +8527,26 @@ function truthReport(projectDir) {
8527
8527
  docFiles.push((0, node_path_1.join)("docs", name));
8528
8528
  }
8529
8529
  }
8530
+ // Track fenced code blocks: sample output quoted in fences must not be treated
8531
+ // as doc claims (a pasted truth report would flag its own examples as lies).
8532
+ // Shell-typed fences are the exception — `npm run x` there is a real claim.
8530
8533
  const docLines = [];
8531
8534
  for (const doc of docFiles) {
8532
8535
  const text = safeReadText((0, node_path_1.join)(projectDir, doc));
8533
8536
  if (!text)
8534
8537
  continue;
8535
- text.split(/\r?\n/).forEach((line, index) => docLines.push({ doc, line: index + 1, text: line }));
8538
+ let fence = null;
8539
+ text.split(/\r?\n/).forEach((line, index) => {
8540
+ const fenceMatch = line.match(/^\s*(?:```|~~~)\s*([A-Za-z0-9_-]*)/);
8541
+ if (fenceMatch) {
8542
+ fence = fence === null ? (fenceMatch[1] || "text").toLowerCase() : null;
8543
+ docLines.push({ doc, line: index + 1, text: line, fence: "marker" });
8544
+ return;
8545
+ }
8546
+ docLines.push({ doc, line: index + 1, text: line, fence });
8547
+ });
8536
8548
  }
8549
+ const SHELL_FENCES = new Set(["bash", "sh", "shell", "zsh", "console", "terminal"]);
8537
8550
  const docsText = docLines.map((entry) => entry.text).join("\n");
8538
8551
  const voidFindings = [];
8539
8552
  if (hasGit) {
@@ -8580,7 +8593,11 @@ function truthReport(projectDir) {
8580
8593
  .join("\n")
8581
8594
  : "";
8582
8595
  for (const entry of docLines) {
8583
- for (const candidate of truthDocPathCandidates(entry.text)) {
8596
+ if (entry.fence === "marker")
8597
+ continue;
8598
+ const inShellFence = entry.fence !== null && SHELL_FENCES.has(entry.fence);
8599
+ // Path claims only count in prose; fenced content is sample output.
8600
+ for (const candidate of entry.fence === null ? truthDocPathCandidates(entry.text) : []) {
8584
8601
  const key = `path:${candidate}`;
8585
8602
  if (seenLies.has(key) || (0, node_fs_1.existsSync)((0, node_path_1.join)(projectDir, candidate)))
8586
8603
  continue;
@@ -8593,7 +8610,8 @@ function truthReport(projectDir) {
8593
8610
  surprise: 70,
8594
8611
  });
8595
8612
  }
8596
- if (packageJsonText && Object.keys(scripts).length) {
8613
+ // Script/CLI claims count in prose AND shell fences (a quoted command is a claim).
8614
+ if (packageJsonText && Object.keys(scripts).length && (entry.fence === null || inShellFence)) {
8597
8615
  for (const match of entry.text.matchAll(/\bnpm run ([A-Za-z0-9:_-]+)/g)) {
8598
8616
  const script = match[1];
8599
8617
  const key = `script:${script}`;
@@ -8609,7 +8627,7 @@ function truthReport(projectDir) {
8609
8627
  });
8610
8628
  }
8611
8629
  }
8612
- if (cliSourceText) {
8630
+ if (cliSourceText && (entry.fence === null || inShellFence)) {
8613
8631
  for (const bin of binNames) {
8614
8632
  for (const match of entry.text.matchAll(new RegExp(`\`${bin} ([a-z][a-z0-9-]+)`, "g"))) {
8615
8633
  const subcommand = match[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kage-core/kage-graph-mcp",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Local-first repo memory, code graph, and recall MCP server for coding agents",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -47,5 +47,6 @@
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=18"
50
- }
51
- }
50
+ },
51
+ "mcpName": "com.kage-core/kage"
52
+ }