@vheins/local-memory-mcp 0.8.8 → 0.8.10
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("[
|
|
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
|
`);
|
|
@@ -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("[
|
|
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);
|
package/dist/dashboard/server.js
CHANGED
package/dist/mcp/server.js
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
setLogLevel,
|
|
44
44
|
updateSessionFromInitialize,
|
|
45
45
|
updateSessionRoots
|
|
46
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-L3HUZO2K.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("[
|
|
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("[
|
|
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("[
|
|
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("[
|
|
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("[
|
|
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("[
|
|
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("[
|
|
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("[
|
|
1722
|
+
logger.info("[Tool] memory.acknowledge - used", { id: memory.id, context: validated.application_context });
|
|
1723
1723
|
} else if (validated.status === "contradictory") {
|
|
1724
|
-
logger.warn("[
|
|
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("[
|
|
1729
|
+
logger.info("[Tool] memory.acknowledge - irrelevant", { id: memory.id, context: validated.application_context });
|
|
1730
1730
|
}
|
|
1731
1731
|
return createMcpResponse(
|
|
1732
1732
|
{
|
|
@@ -1956,6 +1956,7 @@ function createRouter(db2, vectors2, options) {
|
|
|
1956
1956
|
} else {
|
|
1957
1957
|
result = await executeToolLogic();
|
|
1958
1958
|
}
|
|
1959
|
+
logger.info(`[Tool] ${toolName} result`, { repo, result });
|
|
1959
1960
|
try {
|
|
1960
1961
|
const actionType = toolName.split("-")[1] || toolName;
|
|
1961
1962
|
const res = result;
|