@vheins/local-memory-mcp 0.8.16 → 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
- try {
9
- if (fs.existsSync(pkgPath)) {
10
- const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
11
- pkgVersion = pkg.version;
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 candidates = this.all(sql, [...params, now.toISOString(), repo]);
1283
- if (candidates.length < 5) {
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 (!candidates.find((c) => c.id === r.id)) candidates.push(r);
1299
+ if (!candidates2.find((c) => c.id === r.id)) candidates2.push(r);
1288
1300
  }
1289
1301
  }
1290
- return candidates.map((row) => {
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(candidates, input) {
3268
- const unique = [...new Set(candidates.filter(Boolean))];
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 candidates = [
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 candidates) {
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"))) {
@@ -8,7 +8,7 @@ import {
8
8
  createFileSink,
9
9
  listResources,
10
10
  logger
11
- } from "../chunk-4LVZQKWD.js";
11
+ } from "../chunk-LWORZXCL.js";
12
12
 
13
13
  // src/dashboard/server.ts
14
14
  import express from "express";
@@ -43,7 +43,7 @@ import {
43
43
  setLogLevel,
44
44
  updateSessionFromInitialize,
45
45
  updateSessionRoots
46
- } from "../chunk-4LVZQKWD.js";
46
+ } from "../chunk-LWORZXCL.js";
47
47
 
48
48
  // src/mcp/server.ts
49
49
  import readline from "readline";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vheins/local-memory-mcp",
3
- "version": "0.8.16",
3
+ "version": "0.8.17",
4
4
  "description": "MCP Local Memory Service for coding copilot agents",
5
5
  "mcpName": "io.github.vheins/local-memory-mcp",
6
6
  "type": "module",