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

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/cli.js +68 -0
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -13,6 +13,7 @@ const graph_registry_js_1 = require("./graph-registry.js");
13
13
  const CORE_USAGE = `Kage — code-grounded memory for coding agents
14
14
 
15
15
  Core commands:
16
+ kage install [--project <dir>] one-shot: init + index + auto-wire detected agents
16
17
  kage demo 30-second trust demo (temp dir)
17
18
  kage scan --project <dir> 60-second truth report on any repo (zero setup)
18
19
  kage init --project <dir> create repo memory (.agent_memory only)
@@ -32,6 +33,7 @@ Usage:
32
33
  kage index --project <dir>
33
34
  kage scan --project <dir> [--json]
34
35
  kage demo [--project <dir>]
36
+ kage install [--project <dir>] [--agents a,b] [--no-agents] [--json]
35
37
  kage init --project <dir> [--with-policy]
36
38
  kage policy --project <dir>
37
39
  kage doctor --project <dir>
@@ -311,6 +313,72 @@ async function main() {
311
313
  process.exit(2);
312
314
  return;
313
315
  }
316
+ if (command === "install") {
317
+ const project = projectArg(args);
318
+ const agentsFlag = takeArg(args, "--agents");
319
+ const skipAgents = args.includes("--no-agents");
320
+ const json = args.includes("--json");
321
+ const home = (0, node_os_1.homedir)();
322
+ // Detection is config-dir presence, not PATH: agents like Cursor never expose a binary.
323
+ const probes = [
324
+ { agent: "claude-code", paths: [(0, node_path_1.join)(home, ".claude.json"), (0, node_path_1.join)(home, ".claude")] },
325
+ { agent: "codex", paths: [(0, node_path_1.join)(home, ".codex")] },
326
+ { agent: "cursor", paths: [(0, node_path_1.join)(home, ".cursor")] },
327
+ { agent: "windsurf", paths: [(0, node_path_1.join)(home, ".codeium", "windsurf")] },
328
+ { agent: "gemini-cli", paths: [(0, node_path_1.join)(home, ".gemini")] },
329
+ { agent: "opencode", paths: [(0, node_path_1.join)(home, ".config", "opencode"), (0, node_path_1.join)(home, ".opencode")] },
330
+ { agent: "goose", paths: [(0, node_path_1.join)(home, ".config", "goose")] },
331
+ { agent: "aider", paths: [(0, node_path_1.join)(home, ".aider.conf.yml")] },
332
+ ];
333
+ const requested = agentsFlag
334
+ ? agentsFlag.split(",").map((a) => a.trim()).filter((a) => kernel_js_1.SETUP_AGENTS.includes(a))
335
+ : null;
336
+ const detected = requested ?? probes.filter((p) => p.paths.some((path) => (0, node_fs_1.existsSync)(path))).map((p) => p.agent);
337
+ const init = (0, kernel_js_1.initProject)(project, { policy: false });
338
+ const wired = [];
339
+ if (!skipAgents) {
340
+ for (const agent of detected) {
341
+ try {
342
+ const result = (0, kernel_js_1.setupAgent)(agent, project, { write: true });
343
+ wired.push({ agent, ok: result.wrote, config_path: result.config_path ?? undefined, error: result.wrote || result.write_supported ? undefined : `config is print-only — run: kage setup ${agent} --project . and paste it` });
344
+ }
345
+ catch (error) {
346
+ wired.push({ agent, ok: false, error: error instanceof Error ? error.message : String(error) });
347
+ }
348
+ }
349
+ }
350
+ if (json) {
351
+ console.log(JSON.stringify({ project_dir: init.index.projectDir, packets: init.index.packets, validation_ok: init.validation.ok, agents: wired }, null, 2));
352
+ if (!init.validation.ok)
353
+ process.exit(2);
354
+ return;
355
+ }
356
+ console.log(`Kage installed in ${init.index.projectDir}\n`);
357
+ console.log(" Memory .agent_memory/ created — packets are plain files, reviewable in git");
358
+ console.log(` Indexes ${init.index.indexes.length} built (code graph, recall, structure)`);
359
+ if (skipAgents) {
360
+ console.log(" Agents skipped (--no-agents)");
361
+ }
362
+ else if (!wired.length) {
363
+ console.log(" Agents none detected — wire one manually: kage setup <agent> --project . --write");
364
+ }
365
+ else {
366
+ for (const w of wired) {
367
+ if (w.ok)
368
+ console.log(` Agents ${w.agent} ✓ wired${w.config_path ? ` (${w.config_path})` : ""}`);
369
+ else
370
+ console.log(` Agents ${w.agent} ✗ ${w.error ?? "print-only; run kage setup " + w.agent + " --project . --write"}`);
371
+ }
372
+ }
373
+ console.log("\nNext:");
374
+ console.log(" restart your agent — memory now recalls automatically at session start");
375
+ console.log(" kage scan --project . 60-second Truth Report on this repo");
376
+ console.log(" kage viewer --project . local dashboard (gains, packets, graph)");
377
+ console.log("\nVersion control: commit .agent_memory/packets/, ignore .agent_memory/indexes/ and reports/.");
378
+ if (!init.validation.ok)
379
+ process.exit(2);
380
+ return;
381
+ }
314
382
  if (command === "policy") {
315
383
  const result = (0, kernel_js_1.installAgentPolicy)(projectArg(args));
316
384
  console.log(`${result.created ? "Created" : result.updated ? "Updated" : "Already current"} agent policy: ${result.path}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kage-core/kage-graph-mcp",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
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": [
@@ -49,4 +49,4 @@
49
49
  "node": ">=18"
50
50
  },
51
51
  "mcpName": "com.kage-core/kage"
52
- }
52
+ }