@vheins/local-memory-mcp 0.8.9 → 0.8.11

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.
@@ -64,21 +64,11 @@ function formatContextForStderr(context) {
64
64
  if (!context || Object.keys(context).length === 0) return "";
65
65
  return ` ${JSON.stringify(context)}`;
66
66
  }
67
- function getMcpIcon(message) {
68
- if (message.includes("search")) return "\u{1F50D}";
69
- if (message.includes("store") || message.includes("write")) return "\u{1F4BE}";
70
- if (message.includes("read") || message.includes("resource")) return "\u{1F4D6}";
71
- if (message.includes("delete")) return "\u{1F5D1}\uFE0F";
72
- if (message.includes("update")) return "\u{1F504}";
73
- if (message.includes("acknowledge")) return "\u2705";
74
- if (message.includes("recap")) return "\u{1F4CB}";
75
- if (message.includes("task")) return "\u26A1";
76
- return "\u{1F916}";
77
- }
78
67
  function deriveLoggerName(message) {
79
68
  if (message.startsWith("[Server]")) return "server";
80
69
  if (message.startsWith("[Vectors]")) return "vectors";
81
- if (message.startsWith("[MCP]")) return "mcp";
70
+ if (message.startsWith("[Tool]")) return "tool";
71
+ if (message.startsWith("[Router]")) return "router";
82
72
  if (message.startsWith("[Dashboard]")) return "dashboard";
83
73
  return "app";
84
74
  }
@@ -87,13 +77,6 @@ function emitToStderr(level, message, context) {
87
77
  return;
88
78
  }
89
79
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
90
- if (message.startsWith("[MCP]")) {
91
- const icon = getMcpIcon(message);
92
- const action = message.replace("[MCP] ", "").trim();
93
- process.stderr.write(`${timestamp} ${icon} [MCP] ${action.padEnd(7)}${formatContextForStderr(context)}
94
- `);
95
- return;
96
- }
97
80
  const levelStr = level.toUpperCase().padEnd(9);
98
81
  process.stderr.write(`${timestamp} [${levelStr}] ${message}${formatContextForStderr(context)}
99
82
  `);
@@ -183,7 +166,7 @@ function createFileSink(logDir, maxFiles = 5) {
183
166
  const date = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10).replace(/-/g, "");
184
167
  const logFile = `${logDir}/mcp-${date}.log`;
185
168
  return (payload) => {
186
- const line = `${(/* @__PURE__ */ new Date()).toISOString()} [${payload.level.toUpperCase()}] ${JSON.stringify(payload.data)}
169
+ const line = `${(/* @__PURE__ */ new Date()).toISOString()} [${payload.level.toUpperCase()}] [pid:${process.pid}] ${JSON.stringify(payload.data)}
187
170
  `;
188
171
  try {
189
172
  fs2.appendFileSync(logFile, line);
@@ -3428,7 +3411,7 @@ function completeResourceArgument(resourceUri, argumentName, argumentValue, _con
3428
3411
  throw invalidCompletionParams(`Unknown resource template or argument: ${resourceUri} (${argumentName})`);
3429
3412
  }
3430
3413
  function readResource(uri, db, session) {
3431
- logger.info("[MCP] resource.read", { uri });
3414
+ logger.info("[Tool] resource.read", { uri });
3432
3415
  if (uri === "repository://index") {
3433
3416
  const repos = db.system.listRepoNavigation();
3434
3417
  const payload = JSON.stringify(repos, null, 2);
@@ -6,7 +6,7 @@ import {
6
6
  TOOL_DEFINITIONS,
7
7
  listResources,
8
8
  logger
9
- } from "../chunk-BEKJW4RS.js";
9
+ } from "../chunk-PAEKULGL.js";
10
10
 
11
11
  // src/dashboard/server.ts
12
12
  import express from "express";
@@ -43,7 +43,7 @@ import {
43
43
  setLogLevel,
44
44
  updateSessionFromInitialize,
45
45
  updateSessionRoots
46
- } from "../chunk-BEKJW4RS.js";
46
+ } from "../chunk-PAEKULGL.js";
47
47
 
48
48
  // src/mcp/server.ts
49
49
  import readline from "readline";
@@ -352,7 +352,7 @@ async function handleMemoryStore(params, db2, vectors2) {
352
352
  const oldMemory = db2.memories.getById(validated.supersedes);
353
353
  if (oldMemory) {
354
354
  db2.memories.update(oldMemory.id, { status: "archived" });
355
- logger.info("[MCP] memory.store - archived superseded memory", {
355
+ logger.info("[Tool] memory.store - archived superseded memory", {
356
356
  oldId: oldMemory.id,
357
357
  newId: validated.supersedes
358
358
  });
@@ -392,7 +392,7 @@ async function handleMemoryStore(params, db2, vectors2) {
392
392
  } catch (error) {
393
393
  logger.warn("Failed to generate vector embedding", { error: String(error) });
394
394
  }
395
- logger.info("[MCP] memory.store", {
395
+ logger.info("[Tool] memory.store", {
396
396
  repo: validated.scope.repo,
397
397
  id: entry.id,
398
398
  title: entry.title,
@@ -480,7 +480,7 @@ async function handleMemoryUpdate(params, db2, vectors2) {
480
480
  await vectors2.upsert(validated.id, validated.content);
481
481
  }
482
482
  db2.actions.logAction("update", existing.scope.repo, { memoryId: validated.id, resultCount: 1 });
483
- logger.info("[MCP] memory.update", { repo: existing.scope.repo, id: validated.id, fields: Object.keys(updates) });
483
+ logger.info("[Tool] memory.update", { repo: existing.scope.repo, id: validated.id, fields: Object.keys(updates) });
484
484
  return createMcpResponse(
485
485
  {
486
486
  success: true,
@@ -612,7 +612,7 @@ async function handleMemorySearch(params, db2, vectors2) {
612
612
  const total = allMatches.length;
613
613
  const paginatedResults = allMatches.slice(validated.offset, validated.offset + validated.limit);
614
614
  db2.memories.incrementHitCounts(paginatedResults.map((m) => m.id));
615
- logger.info("[MCP] memory.search", {
615
+ logger.info("[Tool] memory.search", {
616
616
  repo: validated.repo,
617
617
  query: validated.query,
618
618
  total,
@@ -712,7 +712,7 @@ function extractAcceptedElicitationContent(result) {
712
712
  // src/mcp/tools/memory.recap.ts
713
713
  async function handleMemoryRecap(params, db2) {
714
714
  const validated = MemoryRecapSchema.parse(params);
715
- logger.info("[MCP] memory.recap", { repo: validated.repo, limit: validated.limit, offset: validated.offset });
715
+ logger.info("[Tool] memory.recap", { repo: validated.repo, limit: validated.limit, offset: validated.offset });
716
716
  const stats = db2.memories.getStats(validated.repo);
717
717
  const total = db2.memories.getTotalCount(validated.repo, false, ["task_archive"]);
718
718
  const rows = db2.memories.getRecentMemories(validated.repo, validated.limit, validated.offset, false, [
@@ -1509,7 +1509,7 @@ ${contextBlock || "No additional context provided."}`
1509
1509
  if (!answer) {
1510
1510
  throw new Error("Sampling did not return a final text answer");
1511
1511
  }
1512
- logger.info("[MCP] memory.synthesize", {
1512
+ logger.info("[Tool] memory.synthesize", {
1513
1513
  repo,
1514
1514
  objective: validated.objective,
1515
1515
  iterations,
@@ -1680,7 +1680,7 @@ async function handleMemoryDelete(params, db2, vectors2, onProgress) {
1680
1680
  if (onProgress) {
1681
1681
  onProgress(progress, total);
1682
1682
  }
1683
- logger.info("[MCP] memory.delete", { repo: lastRepo, count: deletedCount });
1683
+ logger.info("[Tool] memory.delete", { repo: lastRepo, count: deletedCount });
1684
1684
  return createMcpResponse(
1685
1685
  {
1686
1686
  success: true,
@@ -1719,14 +1719,14 @@ async function handleMemoryAcknowledge(params, db2) {
1719
1719
  }
1720
1720
  if (validated.status === "used") {
1721
1721
  db2.memories.incrementRecallCount(memory.id);
1722
- logger.info("[MCP] memory.acknowledge - used", { id: memory.id, context: validated.application_context });
1722
+ logger.info("[Tool] memory.acknowledge - used", { id: memory.id, context: validated.application_context });
1723
1723
  } else if (validated.status === "contradictory") {
1724
- logger.warn("[MCP] memory.acknowledge - contradiction reported", {
1724
+ logger.warn("[Tool] memory.acknowledge - contradiction reported", {
1725
1725
  id: memory.id,
1726
1726
  context: validated.application_context
1727
1727
  });
1728
1728
  } else {
1729
- logger.info("[MCP] memory.acknowledge - irrelevant", { id: memory.id, context: validated.application_context });
1729
+ logger.info("[Tool] memory.acknowledge - irrelevant", { id: memory.id, context: validated.application_context });
1730
1730
  }
1731
1731
  return createMcpResponse(
1732
1732
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vheins/local-memory-mcp",
3
- "version": "0.8.9",
3
+ "version": "0.8.11",
4
4
  "description": "MCP Local Memory Service for coding copilot agents",
5
5
  "mcpName": "io.github.vheins/local-memory-mcp",
6
6
  "type": "module",