@prom.codes/memory-mcp 0.16.0 → 0.18.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.
Files changed (2) hide show
  1. package/dist/bin.js +39 -19
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -2200,7 +2200,7 @@ function applyRecorderHooks(opts = {}) {
2200
2200
  hookPath,
2201
2201
  events: opts.uninstall ? [] : [...RECORDER_EVENTS],
2202
2202
  backup,
2203
- note: opts.uninstall ? "Removed the Prometheus session recorder hooks. Reload your Claude Code window(s)." : "Installed the session recorder (opt-in). Reload / restart your Claude Code window(s). It records LOCALLY to ~/.prometheus/recorder; nothing is uploaded. Uninstall anytime with recorder_setup { uninstall: true }."
2203
+ note: opts.uninstall ? "Removed the prom.codes session recorder hooks. Reload your Claude Code window(s)." : "Installed the session recorder (opt-in). Reload / restart your Claude Code window(s). It records LOCALLY to ~/.prometheus/recorder; nothing is uploaded. Uninstall anytime with recorder_setup { uninstall: true }."
2204
2204
  };
2205
2205
  }
2206
2206
 
@@ -3949,9 +3949,9 @@ var MEMORY_RUNTIMES = [
3949
3949
  ];
3950
3950
  var BLOCK_START = "<!-- prometheus-memory:start -->";
3951
3951
  var BLOCK_END = "<!-- prometheus-memory:end -->";
3952
- var RULE_BLOCK = `## Prometheus Agent Memory
3952
+ var RULE_BLOCK = `## prom.codes Agent Memory
3953
3953
 
3954
- This workspace uses the Prometheus memory MCP server (\`memory_*\` tools).
3954
+ This workspace uses the prom.codes memory MCP server (\`memory_*\` tools).
3955
3955
  Follow this protocol:
3956
3956
 
3957
3957
  1. **Session start:** call \`memory_read\` once before non-trivial work to
@@ -3976,7 +3976,7 @@ ${block}
3976
3976
  ${BLOCK_END}`;
3977
3977
  }
3978
3978
  var CURSOR_FRONTMATTER = `---
3979
- description: Prometheus agent memory protocol
3979
+ description: prom.codes agent memory protocol
3980
3980
  alwaysApply: true
3981
3981
  ---
3982
3982
 
@@ -4279,6 +4279,21 @@ var curateInput = {
4279
4279
  limit: z.number().int().positive().max(MAX_LIMIT).optional()
4280
4280
  };
4281
4281
  var emptyInput = {};
4282
+ var sharedVerdictCache = /* @__PURE__ */ new Map();
4283
+ function memorySource(workspaceRoot, rootIsHomeOrFsRoot) {
4284
+ if (rootIsHomeOrFsRoot)
4285
+ return { backend: "local-sqlite", projectMemoryShared: false };
4286
+ let shared = sharedVerdictCache.get(workspaceRoot);
4287
+ if (shared === void 0) {
4288
+ try {
4289
+ shared = memoriesShared(workspaceRoot);
4290
+ } catch {
4291
+ shared = false;
4292
+ }
4293
+ sharedVerdictCache.set(workspaceRoot, shared);
4294
+ }
4295
+ return { backend: "local-sqlite", projectMemoryShared: shared };
4296
+ }
4282
4297
  function registerTools(server, source, hooks = {}) {
4283
4298
  const ready = typeof source === "function" ? source : () => Promise.resolve(source);
4284
4299
  const onToolCall = hooks.onToolCall;
@@ -4316,6 +4331,9 @@ function registerTools(server, source, hooks = {}) {
4316
4331
  projectFilesSynced: sync.synced,
4317
4332
  projectFilesPruned: sync.pruned,
4318
4333
  ...sync.skipped.length > 0 ? { skippedFiles: sync.skipped } : {},
4334
+ // Provenance (ask 5): memory is local-sqlite; `projectMemoryShared` says
4335
+ // whether these project memories are git-shared with the team.
4336
+ source: memorySource(workspaceRoot, deps.rootIsHomeOrFsRoot),
4319
4337
  woven: weave(records),
4320
4338
  recordsShown: bounded.shown,
4321
4339
  recordsFetched: bounded.fetched,
@@ -4456,6 +4474,8 @@ ${f.value}`);
4456
4474
  projectId,
4457
4475
  query: args.query,
4458
4476
  sources,
4477
+ // Provenance (ask 5): local-sqlite backend + git-shared project flag.
4478
+ source: memorySource(workspaceRoot, deps.rootIsHomeOrFsRoot),
4459
4479
  hits: hits.map((h) => ({ snippet: h.snippet, record: recordToJson(h.record) })),
4460
4480
  sessions: sessionHits
4461
4481
  });
@@ -4511,7 +4531,7 @@ ${f.value}`);
4511
4531
  });
4512
4532
  reg("setup", {
4513
4533
  title: "Install memory rules into runtime configs",
4514
- description: "Idempotently install the Prometheus memory-protocol rule block into agent runtime configs in this workspace: CLAUDE.md (claude-code), .cursor/rules/prometheus-memory.mdc (cursor), .augment/rules/prometheus-memory.md (augment), AGENTS.md (agents). Without `runtimes` it auto-detects which runtimes are present (fallback: agents). Only the marked block is written \u2014 existing content is never touched. Re-running updates the block in place.",
4534
+ description: "Idempotently install the prom.codes memory-protocol rule block into agent runtime configs in this workspace: CLAUDE.md (claude-code), .cursor/rules/prometheus-memory.mdc (cursor), .augment/rules/prometheus-memory.md (augment), AGENTS.md (agents). Without `runtimes` it auto-detects which runtimes are present (fallback: agents). Only the marked block is written \u2014 existing content is never touched. Re-running updates the block in place.",
4515
4535
  inputSchema: setupInput
4516
4536
  }, async (args) => {
4517
4537
  const deps = await ready();
@@ -4533,7 +4553,7 @@ ${f.value}`);
4533
4553
  });
4534
4554
  reg("recorder_setup", {
4535
4555
  title: "Install the Session Recorder (opt-in)",
4536
- description: "Install (or, with `uninstall: true`, remove) the Prometheus Session Recorder \u2014 Claude Code hooks that capture your coding sessions LOCALLY so memory-mcp can recall what you did and distil durable knowledge. STRICTLY OPT-IN and reversible: this writes a hook script + 5 hook entries (SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd) into settings.json (backed up first). It records BEHAVIOUR, not code \u2014 tool names + short previews, with secrets redacted and sensitive-file contents skipped \u2014 as append-only JSONL under ~/.prometheus/recorder/. NOTHING is uploaded; it never leaves your machine. `scope`: 'project-local' (default \u2014 this project only, .claude/settings.local.json), 'project' (committed .claude/settings.json), or 'user' (~/.claude/settings.json, every project). After install/uninstall, RELOAD your Claude Code window(s). Claude-Code-specific (Cursor/VS Code do not run hooks).",
4556
+ description: "Install (or, with `uninstall: true`, remove) the prom.codes Session Recorder \u2014 Claude Code hooks that capture your coding sessions LOCALLY so memory-mcp can recall what you did and distil durable knowledge. STRICTLY OPT-IN and reversible: this writes a hook script + 5 hook entries (SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd) into settings.json (backed up first). It records BEHAVIOUR, not code \u2014 tool names + short previews, with secrets redacted and sensitive-file contents skipped \u2014 as append-only JSONL under ~/.prometheus/recorder/. NOTHING is uploaded; it never leaves your machine. `scope`: 'project-local' (default \u2014 this project only, .claude/settings.local.json), 'project' (committed .claude/settings.json), or 'user' (~/.claude/settings.json, every project). After install/uninstall, RELOAD your Claude Code window(s). Claude-Code-specific (Cursor/VS Code do not run hooks).",
4537
4557
  inputSchema: recorderSetupInput
4538
4558
  }, async (args) => {
4539
4559
  const deps = await ready();
@@ -4628,7 +4648,7 @@ ${f.value}`);
4628
4648
  embeddingsError = err instanceof Error ? err.message : String(err);
4629
4649
  }
4630
4650
  }
4631
- const update = await buildUpdateStatus("@prom.codes/memory-mcp", "0.16.0", { isDevBuild: false });
4651
+ const update = await buildUpdateStatus("@prom.codes/memory-mcp", "0.18.0", { isDevBuild: false });
4632
4652
  let recorder;
4633
4653
  try {
4634
4654
  const scopes = ["project-local", "project", "user"];
@@ -4709,11 +4729,11 @@ ${f.value}`);
4709
4729
 
4710
4730
  // dist/server.js
4711
4731
  var SERVER_IDENTITY = {
4712
- name: "prometheus-memory-mcp",
4713
- version: "0.16.0",
4732
+ name: "prom.codes-memory",
4733
+ version: "0.18.0",
4714
4734
  title: "prom.codes Memory"
4715
4735
  };
4716
- var SERVER_INSTRUCTIONS = "Persistent agent memory for this workspace \u2014 USE IT PROACTIVELY; the user will not tell you to. Protocol:\n1. ONE-TIME: if this workspace has no Prometheus memory rule yet, call memory_setup now (idempotent) so the protocol is installed into the runtime rule files and survives future sessions. (The server also auto-installs it on startup when a project rule file already exists \u2014 memory_setup covers the rest.)\n2. SESSION START: before any non-trivial task, call memory_read to recall facts, decisions and procedures from earlier sessions.\n3. DURING WORK: when the user states a durable preference, decision, correction or project fact, store it with memory_write (semantic for facts, procedural for how-tos) \u2014 without being asked.\n4. LOOK-UP: use memory_search for keyword recall when memory_read is not specific enough.\n5. SESSION END: consolidate what was learned with memory_capture.\nCall memory_status anytime to check what is stored and whether the rule is installed. Never store secrets, API keys or credentials \u2014 such writes are rejected.";
4736
+ var SERVER_INSTRUCTIONS = "Persistent agent memory for this workspace \u2014 USE IT PROACTIVELY; the user will not tell you to. Protocol:\n1. ONE-TIME: if this workspace has no prom.codes memory rule yet, call memory_setup now (idempotent) so the protocol is installed into the runtime rule files and survives future sessions. (The server also auto-installs it on startup when a project rule file already exists \u2014 memory_setup covers the rest.)\n2. SESSION START: before any non-trivial task, call memory_read to recall facts, decisions and procedures from earlier sessions.\n3. DURING WORK: when the user states a durable preference, decision, correction or project fact, store it with memory_write (semantic for facts, procedural for how-tos) \u2014 without being asked.\n4. LOOK-UP: use memory_search for keyword recall when memory_read is not specific enough.\n5. SESSION END: consolidate what was learned with memory_capture.\nCall memory_status anytime to check what is stored and whether the rule is installed. Never store secrets, API keys or credentials \u2014 such writes are rejected.";
4717
4737
 
4718
4738
  // dist/bin.js
4719
4739
  function looksLikeMissingNativeBinding(msg) {
@@ -4764,7 +4784,7 @@ async function main() {
4764
4784
  if (shuttingDown)
4765
4785
  return;
4766
4786
  shuttingDown = true;
4767
- process.stderr.write(`prometheus-memory-mcp: ${reason}, shutting down
4787
+ process.stderr.write(`prom.codes-memory: ${reason}, shutting down
4768
4788
  `);
4769
4789
  watchdog?.stop();
4770
4790
  if (recorderTimer !== null)
@@ -4785,7 +4805,7 @@ async function main() {
4785
4805
  server.server.onclose = () => void shutdown("transport closed (client exited)");
4786
4806
  watchdog = createIdleWatchdog({ onIdle: (reason) => void shutdown(reason), env });
4787
4807
  if (watchdog.idleMs > 0) {
4788
- process.stderr.write(`prometheus-memory-mcp: idle self-exit armed (${Math.round(watchdog.idleMs / 6e4)} min of no client activity)
4808
+ process.stderr.write(`prom.codes-memory: idle self-exit armed (${Math.round(watchdog.idleMs / 6e4)} min of no client activity)
4789
4809
  `);
4790
4810
  }
4791
4811
  const armIdleWatch = () => {
@@ -4800,7 +4820,7 @@ async function main() {
4800
4820
  env,
4801
4821
  ...override !== void 0 && override !== "" ? { workspaceRootOverride: override } : {}
4802
4822
  });
4803
- process.stderr.write(`prometheus-memory-mcp: workspace=${composed.workspaceRoot} (via ${via}) project=${composed.projectName} (${composed.projectId}) db=${composed.dbPath} embed=${composed.embedderId}${composed.embeddingsEnabled ? "" : " (keyword-only)"} rerank=${composed.rerankerId} extract=${composed.extractorId} rewrite=${composed.rewriterId} temporal=${composed.temporalEnabled ? "on" : "off"} dedup=${composed.dedupEnabled ? "on" : "off"}
4823
+ process.stderr.write(`prom.codes-memory: workspace=${composed.workspaceRoot} (via ${via}) project=${composed.projectName} (${composed.projectId}) db=${composed.dbPath} embed=${composed.embedderId}${composed.embeddingsEnabled ? "" : " (keyword-only)"} rerank=${composed.rerankerId} extract=${composed.extractorId} rewrite=${composed.rewriterId} temporal=${composed.temporalEnabled ? "on" : "off"} dedup=${composed.dedupEnabled ? "on" : "off"}
4804
4824
  `);
4805
4825
  heartbeat.update({
4806
4826
  workspaceRoot: composed.workspaceRoot,
@@ -4812,13 +4832,13 @@ async function main() {
4812
4832
  }
4813
4833
  });
4814
4834
  if (composed.rootIsHomeOrFsRoot) {
4815
- process.stderr.write(`prometheus-memory-mcp: workspace resolved to ${composed.workspaceRoot} (your home directory or a filesystem root) \u2014 project memories will NOT be mirrored to markdown there. Open a project folder (Claude Code passes it via CLAUDE_PROJECT_DIR) or set PROMETHEUS_WORKSPACE_ROOT. Call memory_status for details.
4835
+ process.stderr.write(`prom.codes-memory: workspace resolved to ${composed.workspaceRoot} (your home directory or a filesystem root) \u2014 project memories will NOT be mirrored to markdown there. Open a project folder (Claude Code passes it via CLAUDE_PROJECT_DIR) or set PROMETHEUS_WORKSPACE_ROOT. Call memory_status for details.
4816
4836
  `);
4817
4837
  } else if (composed.autoSetup) {
4818
4838
  void autoInstallExisting(composed.workspaceRoot).then((results) => {
4819
4839
  const wrote = results.filter((r) => r.action !== "unchanged");
4820
4840
  if (wrote.length > 0) {
4821
- process.stderr.write(`prometheus-memory-mcp: auto-installed the memory rule into ${wrote.map((r) => r.runtime).join(", ")} (set PROMETHEUS_MEMORY_AUTO_SETUP=off to disable)
4841
+ process.stderr.write(`prom.codes-memory: auto-installed the memory rule into ${wrote.map((r) => r.runtime).join(", ")} (set PROMETHEUS_MEMORY_AUTO_SETUP=off to disable)
4822
4842
  `);
4823
4843
  }
4824
4844
  }).catch(() => {
@@ -4829,7 +4849,7 @@ async function main() {
4829
4849
  try {
4830
4850
  const r = await composed.recorder.ingestSpoolDir(composed.projectId, env);
4831
4851
  if (r.events > 0) {
4832
- process.stderr.write(`prometheus-memory-mcp: recorder ingested ${r.events} event(s) from ${r.sessions} session(s); reclaimed ${r.deletedSpools} spool(s)
4852
+ process.stderr.write(`prom.codes-memory: recorder ingested ${r.events} event(s) from ${r.sessions} session(s); reclaimed ${r.deletedSpools} spool(s)
4833
4853
  `);
4834
4854
  }
4835
4855
  const c = composed;
@@ -4845,7 +4865,7 @@ async function main() {
4845
4865
  mirrorToFiles: !c.rootIsHomeOrFsRoot
4846
4866
  }, s.sessionId);
4847
4867
  if (outcome.curated) {
4848
- process.stderr.write(`prometheus-memory-mcp: curated session ${s.sessionId} (${outcome.facts ?? 0} facts, ${outcome.procedures ?? 0} procedures)
4868
+ process.stderr.write(`prom.codes-memory: curated session ${s.sessionId} (${outcome.facts ?? 0} facts, ${outcome.procedures ?? 0} procedures)
4849
4869
  `);
4850
4870
  }
4851
4871
  }
@@ -4874,7 +4894,7 @@ async function main() {
4874
4894
  boot(fromRoots ?? process.cwd(), fromRoots !== null ? "MCP roots" : "cwd fallback (client advertised no roots)");
4875
4895
  } catch (err) {
4876
4896
  const message = err instanceof Error ? err.message : String(err);
4877
- process.stderr.write(`prometheus-memory-mcp: fatal during boot: ${message}
4897
+ process.stderr.write(`prom.codes-memory: fatal during boot: ${message}
4878
4898
  `);
4879
4899
  if (looksLikeMissingNativeBinding(message))
4880
4900
  process.stderr.write(NATIVE_BINDING_HINT);
@@ -4891,7 +4911,7 @@ async function main() {
4891
4911
  }
4892
4912
  main().catch((err) => {
4893
4913
  const message = err instanceof Error ? err.message : String(err);
4894
- process.stderr.write(`prometheus-memory-mcp: fatal: ${message}
4914
+ process.stderr.write(`prom.codes-memory: fatal: ${message}
4895
4915
  `);
4896
4916
  if (looksLikeMissingNativeBinding(message))
4897
4917
  process.stderr.write(NATIVE_BINDING_HINT);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom.codes/memory-mcp",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "prom.codes Memory — persistent, local-first agent memory as an MCP server.",
5
5
  "type": "module",
6
6
  "bin": {