mindgraph-mcp 0.22.0 → 0.23.0

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/index.js CHANGED
@@ -51,7 +51,9 @@ function loadHookEnv(dir) {
51
51
  baseUrl: typeof parsed.baseUrl === "string" ? parsed.baseUrl : void 0,
52
52
  apiKey: typeof parsed.apiKey === "string" ? parsed.apiKey : void 0,
53
53
  agentId: typeof parsed.agentId === "string" ? parsed.agentId : void 0,
54
- orgId: typeof parsed.orgId === "string" ? parsed.orgId : void 0
54
+ orgId: typeof parsed.orgId === "string" ? parsed.orgId : void 0,
55
+ promptRecall: typeof parsed.promptRecall === "boolean" ? parsed.promptRecall : void 0,
56
+ capture: typeof parsed.capture === "boolean" ? parsed.capture : void 0
55
57
  };
56
58
  } catch {
57
59
  return {};
@@ -6280,6 +6282,12 @@ var import_node_fs4 = __toESM(require("fs"));
6280
6282
  var import_node_os3 = __toESM(require("os"));
6281
6283
  var import_node_path4 = __toESM(require("path"));
6282
6284
  var import_node_crypto6 = __toESM(require("crypto"));
6285
+ function storedFeatures(homeDir) {
6286
+ const { promptRecall, capture } = loadHookEnv(
6287
+ import_node_path4.default.join(homeDir || import_node_os3.default.homedir(), ".mindgraph")
6288
+ );
6289
+ return { promptRecall, capture };
6290
+ }
6283
6291
  var OWNER_MARKER = "--owner mindgraph";
6284
6292
  var RUNNER_RELATIVE = ".mindgraph/bin/mindgraph-hook.cjs";
6285
6293
  function command(harness) {
@@ -6369,7 +6377,14 @@ function refreshOwnedClaudeHooks(projectDir = process.cwd(), homeDir) {
6369
6377
  const file = settingsPath("claude-code", scope, projectDir, void 0, homeDir);
6370
6378
  if (!import_node_fs4.default.existsSync(file)) continue;
6371
6379
  if (!import_node_fs4.default.readFileSync(file, "utf8").includes(OWNER_MARKER)) continue;
6372
- installHooks("claude-code", scope, projectDir, void 0, homeDir);
6380
+ installHooks(
6381
+ "claude-code",
6382
+ scope,
6383
+ projectDir,
6384
+ void 0,
6385
+ homeDir,
6386
+ storedFeatures(homeDir)
6387
+ );
6373
6388
  refreshed.push(file);
6374
6389
  } catch {
6375
6390
  }
@@ -6401,7 +6416,7 @@ function ownedHook(harness, timeout, additionalContextLimit) {
6401
6416
  ...additionalContextLimit === void 0 ? {} : { additionalContextLimit }
6402
6417
  };
6403
6418
  }
6404
- function desiredEntries(harness) {
6419
+ function desiredEntries(harness, features = {}) {
6405
6420
  const common = {
6406
6421
  SessionStart: [
6407
6422
  {
@@ -6444,11 +6459,17 @@ function desiredEntries(harness) {
6444
6459
  { hooks: [ownedHook(harness, harness === "codex" ? 3 : 30)] }
6445
6460
  ]
6446
6461
  };
6447
- return harness === "claude-code" ? {
6462
+ if (harness !== "claude-code") return common;
6463
+ return {
6448
6464
  ...common,
6449
6465
  TaskCreated: [{ hooks: [ownedHook(harness, 3)] }],
6450
- TaskCompleted: [{ hooks: [ownedHook(harness, 3)] }]
6451
- } : common;
6466
+ TaskCompleted: [{ hooks: [ownedHook(harness, 3)] }],
6467
+ // Bounded recall per prompt: the core gives up at 4s and fails open, so
6468
+ // a 5s budget never holds the prompt longer than that.
6469
+ ...features.promptRecall !== false ? { UserPromptSubmit: [{ hooks: [ownedHook(harness, 5)] }] } : {},
6470
+ // Opt-in transcript capture before compaction (cold-tenant ingest).
6471
+ ...features.capture === true ? { PreCompact: [{ hooks: [ownedHook(harness, 30)] }] } : {}
6472
+ };
6452
6473
  }
6453
6474
  function hookCommand(value) {
6454
6475
  if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
@@ -6469,13 +6490,22 @@ function writeSettings(file, settings) {
6469
6490
  });
6470
6491
  import_node_fs4.default.renameSync(temporary, file);
6471
6492
  }
6472
- function installHooks(harness, scope, projectDir = process.cwd(), codexHomeDir, homeDir) {
6493
+ function installHooks(harness, scope, projectDir = process.cwd(), codexHomeDir, homeDir, features = {}) {
6473
6494
  const file = settingsPath(harness, scope, projectDir, codexHomeDir, homeDir);
6474
6495
  const settings = readSettings(file);
6475
6496
  const hooks = settings.hooks && typeof settings.hooks === "object" && !Array.isArray(settings.hooks) ? settings.hooks : {};
6476
6497
  let added = 0;
6477
6498
  let updated = 0;
6478
- for (const [event, wanted] of Object.entries(desiredEntries(harness))) {
6499
+ const desired = desiredEntries(harness, features);
6500
+ for (const optional of ["UserPromptSubmit", "PreCompact"]) {
6501
+ if (optional in desired || !Array.isArray(hooks[optional])) continue;
6502
+ const kept = hooks[optional].filter(
6503
+ (entry) => !entryHasOwnedHook(entry)
6504
+ );
6505
+ if (kept.length > 0) hooks[optional] = kept;
6506
+ else delete hooks[optional];
6507
+ }
6508
+ for (const [event, wanted] of Object.entries(desired)) {
6479
6509
  const current = Array.isArray(hooks[event]) ? [...hooks[event]] : [];
6480
6510
  const kept = current.filter((entry) => !entryHasOwnedHook(entry));
6481
6511
  const hadOwned = kept.length !== current.length;
@@ -6591,7 +6621,7 @@ if (PROFILE === "coding") {
6591
6621
  }
6592
6622
  var RUNNER_REFRESH = (() => {
6593
6623
  try {
6594
- return refreshHookRunner("0.22.0", import_node_path5.default.join(__dirname, "cli.js"));
6624
+ return refreshHookRunner("0.23.0", import_node_path5.default.join(__dirname, "cli.js"));
6595
6625
  } catch {
6596
6626
  return void 0;
6597
6627
  }
@@ -6605,12 +6635,12 @@ if (RUNNER_REFRESH?.refreshed) {
6605
6635
  }
6606
6636
  })();
6607
6637
  console.error(
6608
- `[mindgraph-mcp] refreshed pinned hook runner ${RUNNER_REFRESH.runnerVersion ? `v${RUNNER_REFRESH.runnerVersion}` : "(pre-sidecar)"} \u2192 v${"0.22.0"}` + (refreshedSettings.length > 0 ? `; refreshed owned hook entries in ${refreshedSettings.join(", ")}` : "")
6638
+ `[mindgraph-mcp] refreshed pinned hook runner ${RUNNER_REFRESH.runnerVersion ? `v${RUNNER_REFRESH.runnerVersion}` : "(pre-sidecar)"} \u2192 v${"0.23.0"}` + (refreshedSettings.length > 0 ? `; refreshed owned hook entries in ${refreshedSettings.join(", ")}` : "")
6609
6639
  );
6610
6640
  }
6611
6641
  var HOOK_SKEW_NOTE = (() => {
6612
6642
  try {
6613
- return versionSkewNote("0.22.0");
6643
+ return versionSkewNote("0.23.0");
6614
6644
  } catch {
6615
6645
  return void 0;
6616
6646
  }
@@ -6631,7 +6661,7 @@ var GOVERNANCE_CONFIG = {
6631
6661
  }
6632
6662
  };
6633
6663
  var MEMORY_RUNTIME_CONFIG = {
6634
- serverVersion: "0.22.0",
6664
+ serverVersion: "0.23.0",
6635
6665
  baseUrl: BASE_URL,
6636
6666
  profile: PROFILE,
6637
6667
  harness: HARNESS,
@@ -6640,7 +6670,7 @@ var MEMORY_RUNTIME_CONFIG = {
6640
6670
  };
6641
6671
  var server = buildMindGraphServer({
6642
6672
  client,
6643
- serverVersion: "0.22.0",
6673
+ serverVersion: "0.23.0",
6644
6674
  instructions: INSTRUCTIONS,
6645
6675
  profile: PROFILE,
6646
6676
  agentId: AGENT_ID,
@@ -6651,7 +6681,7 @@ async function main() {
6651
6681
  const transport = new import_stdio.StdioServerTransport();
6652
6682
  await server.connect(transport);
6653
6683
  console.error(
6654
- `MindGraph MCP server v${"0.22.0"} running on stdio (${BASE_URL})`
6684
+ `MindGraph MCP server v${"0.23.0"} running on stdio (${BASE_URL})`
6655
6685
  );
6656
6686
  }
6657
6687
  main().catch((error2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindgraph-mcp",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "MCP server for MindGraph \u2014 connect Claude Desktop, Claude Code, and any MCP client to your knowledge graph",
5
5
  "repository": {
6
6
  "type": "git",