@kage-core/kage-graph-mcp 2.2.2 → 2.2.4

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 CHANGED
@@ -14,8 +14,8 @@ const CORE_USAGE = `Kage — code-grounded memory for coding agents
14
14
 
15
15
  Core commands:
16
16
  kage install [--project <dir>] one-shot: init + index + auto-wire detected agents
17
- kage demo 30-second trust demo (temp dir)
18
17
  kage scan --project <dir> 60-second truth report on any repo (zero setup)
18
+ kage demo watch the reject/withhold loop run in a sandbox
19
19
  kage init --project <dir> create repo memory (.agent_memory only)
20
20
  kage index --project <dir> [--full] build/refresh code graph + indexes
21
21
  kage recall "<query>" --project <dir> grounded recall from repo memory
@@ -294,7 +294,14 @@ async function main() {
294
294
  return;
295
295
  }
296
296
  if (command === "scan") {
297
- const result = (0, kernel_js_1.truthReport)(projectArg(args));
297
+ const scanTarget = (0, node_path_1.resolve)(projectArg(args));
298
+ if (scanTarget === (0, node_os_1.homedir)()) {
299
+ console.log("That's your home directory, not a repo — scanning it would crawl everything you own.");
300
+ console.log("cd into a project and rerun, or point at one:");
301
+ console.log(" npx -y kage-graph-mcp scan --project /path/to/repo");
302
+ process.exit(2);
303
+ }
304
+ const result = (0, kernel_js_1.truthReport)(scanTarget);
298
305
  if (args.includes("--json")) {
299
306
  console.log(JSON.stringify(result, null, 2));
300
307
  return;
package/dist/kernel.js CHANGED
@@ -1947,9 +1947,24 @@ function walkFiles(root, predicate) {
1947
1947
  if (!(0, node_fs_1.existsSync)(root))
1948
1948
  return [];
1949
1949
  const out = [];
1950
- for (const entry of (0, node_fs_1.readdirSync)(root)) {
1950
+ // Unreadable entries (macOS ~/.Trash, permission-locked dirs) are skipped,
1951
+ // never fatal — a scan of an imperfect tree should report, not crash.
1952
+ let entries = [];
1953
+ try {
1954
+ entries = (0, node_fs_1.readdirSync)(root);
1955
+ }
1956
+ catch {
1957
+ return out;
1958
+ }
1959
+ for (const entry of entries) {
1951
1960
  const path = (0, node_path_1.join)(root, entry);
1952
- const stats = (0, node_fs_1.statSync)(path);
1961
+ let stats;
1962
+ try {
1963
+ stats = (0, node_fs_1.statSync)(path);
1964
+ }
1965
+ catch {
1966
+ continue;
1967
+ }
1953
1968
  if (stats.isDirectory())
1954
1969
  out.push(...walkFiles(path, predicate));
1955
1970
  else if (predicate(path))
@@ -3291,7 +3306,15 @@ function scanStructuralFiles(projectDir) {
3291
3306
  const visit = (dir) => {
3292
3307
  if (!(0, node_fs_1.existsSync)(dir))
3293
3308
  return;
3294
- for (const entry of (0, node_fs_1.readdirSync)(dir)) {
3309
+ let dirEntries = [];
3310
+ try {
3311
+ dirEntries = (0, node_fs_1.readdirSync)(dir);
3312
+ }
3313
+ catch {
3314
+ ignore("unreadable_dir");
3315
+ return;
3316
+ }
3317
+ for (const entry of dirEntries) {
3295
3318
  const absolutePath = (0, node_path_1.join)(dir, entry);
3296
3319
  const rel = (0, node_path_1.relative)(projectDir, absolutePath).replace(/\\/g, "/");
3297
3320
  if (shouldSkipCodePath(rel)) {
@@ -8887,9 +8910,9 @@ function truthReport(projectDir) {
8887
8910
  findings,
8888
8911
  warnings,
8889
8912
  next_actions: [
8890
- "kage init --project <dir> create repo memory so this knowledge stops living in one head",
8891
- "kage learn --project <dir> --learning \"...\" --paths <file> capture what only your team knows",
8892
- "kage viewer --project <dir> watch the void close",
8913
+ "npx -y @kage-core/kage-graph-mcp install one command: creates repo memory + wires your agents (Claude Code, Codex, Cursor, ...)",
8914
+ "then just work agents capture learnings and recall them, verified against this code",
8915
+ "kage gains --project . the receipt: what the memory loop saved you this week",
8893
8916
  ],
8894
8917
  };
8895
8918
  }
@@ -15522,14 +15545,18 @@ function repairProject(projectDir, options = {}) {
15522
15545
  // Map a CLI failure to ONE copy-pasteable next command. Pure on purpose:
15523
15546
  // remediation must be unit-testable without throwing real errors.
15524
15547
  function remediationFor(error) {
15548
+ const msg0 = String(error?.message ?? error ?? "");
15549
+ if (/EPERM|EACCES|scandir/i.test(msg0)) {
15550
+ return "point --project at a code repository (a permission-locked folder was hit; system folders like ~/.Trash can't be read)";
15551
+ }
15525
15552
  const text = error instanceof Error ? error.message : String(error);
15526
15553
  if (/ENOENT/i.test(text) && /\.agent_memory/.test(text))
15527
- return "kage init --project .";
15554
+ return "npx -y kage-graph-mcp init --project .";
15528
15555
  if (/Unexpected token|Unexpected end of JSON|is not valid JSON|JSON\.parse|in JSON at position/i.test(text))
15529
- return "kage repair --project .";
15556
+ return "npx -y kage-graph-mcp repair --project .";
15530
15557
  if (/\bindex(es)?\b|\bgraph\b/i.test(text))
15531
- return "kage index --project .";
15532
- return "kage doctor --project .";
15558
+ return "npx -y kage-graph-mcp index --project .";
15559
+ return "npx -y kage-graph-mcp doctor --project .";
15533
15560
  }
15534
15561
  function approvePending(projectDir, id) {
15535
15562
  const pendingFiles = walkFiles(pendingDir(projectDir), (path) => path.endsWith(".json"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kage-core/kage-graph-mcp",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
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": [