@vheins/local-memory-mcp 0.8.15 → 0.8.17
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.
|
@@ -3,14 +3,26 @@ import { fileURLToPath } from "url";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
var pkgPath = path.join(__dirname, "../../package.json");
|
|
7
6
|
var pkgVersion = "0.1.0";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
var candidates = [
|
|
8
|
+
path.join(__dirname, "../../package.json"),
|
|
9
|
+
// dev: dist/mcp/ -> root
|
|
10
|
+
path.join(__dirname, "../../../package.json"),
|
|
11
|
+
// global install: lib/node_modules/.../dist/mcp/
|
|
12
|
+
path.join(__dirname, "../../../../package.json")
|
|
13
|
+
// deeper nesting
|
|
14
|
+
];
|
|
15
|
+
for (const pkgPath of candidates) {
|
|
16
|
+
try {
|
|
17
|
+
if (fs.existsSync(pkgPath)) {
|
|
18
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
19
|
+
if (pkg.name === "@vheins/local-memory-mcp" && pkg.version) {
|
|
20
|
+
pkgVersion = pkg.version;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
12
25
|
}
|
|
13
|
-
} catch {
|
|
14
26
|
}
|
|
15
27
|
var MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
16
28
|
var CAPABILITIES = {
|
|
@@ -1279,15 +1291,15 @@ var MemoryEntity = class extends BaseEntity {
|
|
|
1279
1291
|
let sql = `SELECT * FROM memories WHERE (${where.join(" AND ")}) AND (expires_at IS NULL OR expires_at > ?)`;
|
|
1280
1292
|
if (!includeArchived) sql += " AND status = 'active'";
|
|
1281
1293
|
sql += ` ORDER BY CASE WHEN repo = ? THEN 0 ELSE 1 END, importance DESC, created_at DESC LIMIT 100`;
|
|
1282
|
-
const
|
|
1283
|
-
if (
|
|
1294
|
+
const candidates2 = this.all(sql, [...params, now.toISOString(), repo]);
|
|
1295
|
+
if (candidates2.length < 5) {
|
|
1284
1296
|
const recentSql = `SELECT * FROM memories WHERE (${where.join(" OR ")}) AND status = 'active' AND (expires_at IS NULL OR expires_at > ?) ORDER BY created_at DESC LIMIT 10`;
|
|
1285
1297
|
const recent = this.all(recentSql, [...params, now.toISOString()]);
|
|
1286
1298
|
for (const r of recent) {
|
|
1287
|
-
if (!
|
|
1299
|
+
if (!candidates2.find((c) => c.id === r.id)) candidates2.push(r);
|
|
1288
1300
|
}
|
|
1289
1301
|
}
|
|
1290
|
-
return
|
|
1302
|
+
return candidates2.map((row) => {
|
|
1291
1303
|
const memory = this.rowToMemoryEntry(row);
|
|
1292
1304
|
const isExpired = row.expires_at && new Date(row.expires_at) <= now;
|
|
1293
1305
|
const isArchived = row.status === "archived" && !includeArchived;
|
|
@@ -3264,8 +3276,8 @@ function invalidPaginationParams(message) {
|
|
|
3264
3276
|
|
|
3265
3277
|
// src/mcp/utils/completion.ts
|
|
3266
3278
|
var MAX_COMPLETION_VALUES = 100;
|
|
3267
|
-
function rankCompletionValues(
|
|
3268
|
-
const unique = [...new Set(
|
|
3279
|
+
function rankCompletionValues(candidates2, input) {
|
|
3280
|
+
const unique = [...new Set(candidates2.filter(Boolean))];
|
|
3269
3281
|
const needle = input.trim().toLowerCase();
|
|
3270
3282
|
if (!needle) {
|
|
3271
3283
|
return unique.slice(0, MAX_COMPLETION_VALUES);
|
|
@@ -3677,7 +3689,7 @@ import matter from "gray-matter";
|
|
|
3677
3689
|
var __filename = fileURLToPath3(import.meta.url);
|
|
3678
3690
|
var __dirname2 = path5.dirname(__filename);
|
|
3679
3691
|
function findPromptDir() {
|
|
3680
|
-
const
|
|
3692
|
+
const candidates2 = [
|
|
3681
3693
|
// Production if chunked into dist/
|
|
3682
3694
|
"./prompts",
|
|
3683
3695
|
// Production if inlined into dist/mcp/
|
|
@@ -3685,7 +3697,7 @@ function findPromptDir() {
|
|
|
3685
3697
|
// Dev: /src/mcp/prompts/definitions (next to loader.ts)
|
|
3686
3698
|
"./definitions"
|
|
3687
3699
|
].map((relPath) => path5.resolve(__dirname2, relPath));
|
|
3688
|
-
for (const dir of
|
|
3700
|
+
for (const dir of candidates2) {
|
|
3689
3701
|
if (fs5.existsSync(dir)) {
|
|
3690
3702
|
const files = fs5.readdirSync(dir);
|
|
3691
3703
|
if (files.some((f) => f.endsWith(".md"))) {
|
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-LWORZXCL.js";
|
|
47
47
|
|
|
48
48
|
// src/mcp/server.ts
|
|
49
49
|
import readline from "readline";
|
|
@@ -2197,7 +2197,7 @@ if (process.argv.includes("doctor")) {
|
|
|
2197
2197
|
var db = await SQLiteStore.create();
|
|
2198
2198
|
var vectors = new RealVectorStore(db);
|
|
2199
2199
|
addLogSink(createFileSink(path3.dirname(db.getDbPath())));
|
|
2200
|
-
logger.info("[Server] startup", { pid: process.pid, db: db.getDbPath() });
|
|
2200
|
+
logger.info("[Server] startup", { pid: process.pid, version: CAPABILITIES.serverInfo.version, db: db.getDbPath() });
|
|
2201
2201
|
vectors.initialize().catch((err) => {
|
|
2202
2202
|
logger.warn("[Server] Initial vector model loading failed. Will retry on first use.", { error: String(err) });
|
|
2203
2203
|
});
|