vplex-memory 2.4.0 → 2.4.1

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.
package/README.md CHANGED
@@ -11,7 +11,7 @@ Works with Claude Code, Cursor, VS Code Copilot, Windsurf, Codex, and any MCP-co
11
11
  "mcpServers": {
12
12
  "vplex-memory": {
13
13
  "command": "npx",
14
- "args": ["-y", "vplex-memory@2.3.3"]
14
+ "args": ["-y", "vplex-memory@2.4.0"]
15
15
  }
16
16
  }
17
17
  }
@@ -30,7 +30,7 @@ Add to `.mcp.json` in your project root or `~/.claude/settings.json` globally:
30
30
  "mcpServers": {
31
31
  "vplex-memory": {
32
32
  "command": "npx",
33
- "args": ["-y", "vplex-memory@2.3.3"]
33
+ "args": ["-y", "vplex-memory@2.4.0"]
34
34
  }
35
35
  }
36
36
  }
@@ -46,7 +46,7 @@ Add to `.cursor/mcp.json`:
46
46
  "vplex-memory": {
47
47
  "type": "stdio",
48
48
  "command": "npx",
49
- "args": ["-y", "vplex-memory@2.3.3"]
49
+ "args": ["-y", "vplex-memory@2.4.0"]
50
50
  }
51
51
  }
52
52
  }
@@ -62,7 +62,7 @@ Add to `.vscode/mcp.json`:
62
62
  "vplex-memory": {
63
63
  "type": "stdio",
64
64
  "command": "npx",
65
- "args": ["-y", "vplex-memory@2.3.3"]
65
+ "args": ["-y", "vplex-memory@2.4.0"]
66
66
  }
67
67
  }
68
68
  }
@@ -78,7 +78,7 @@ Add to `~/.windsurf/mcp.json`:
78
78
  "vplex-memory": {
79
79
  "type": "stdio",
80
80
  "command": "npx",
81
- "args": ["-y", "vplex-memory@2.3.3"]
81
+ "args": ["-y", "vplex-memory@2.4.0"]
82
82
  }
83
83
  }
84
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vplex-memory",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "VPLEX Memory MCP Server — persistent cross-session memory for AI coding tools",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,7 +19,7 @@
19
19
 
20
20
  import { readFileSync, writeFileSync, statSync, mkdirSync, realpathSync, unlinkSync } from "fs";
21
21
  import { homedir, platform } from "os";
22
- import { join, resolve, relative } from "path";
22
+ import { join, resolve, relative, dirname, parse } from "path";
23
23
  import { createInterface } from "readline";
24
24
 
25
25
  const API_URL = "https://termplex-api.vercel.app";
@@ -411,9 +411,34 @@ function hashString(str) {
411
411
  return Math.abs(hash).toString(36);
412
412
  }
413
413
 
414
- const projectHash = hashString(process.cwd());
415
- const projectName = process.cwd().replace(/\\/g, "/").split("/").pop() || process.cwd();
416
- const projectPath = process.cwd();
414
+ // Detect project root: env override > .git traversal > cwd fallback
415
+ function detectProjectRoot() {
416
+ // Explicit override via env (set in MCP config)
417
+ const envPath = process.env.VPLEX_PROJECT_PATH || process.env.PROJECT_CWD;
418
+ if (envPath) {
419
+ try { statSync(envPath); return envPath; } catch { /* fall through */ }
420
+ }
421
+
422
+ // Walk up from cwd looking for .git (standard project root marker)
423
+ let dir = process.cwd();
424
+ const root = parse(dir).root;
425
+ while (dir !== root) {
426
+ try {
427
+ statSync(join(dir, ".git"));
428
+ return dir; // Found .git — this is the project root
429
+ } catch { /* continue */ }
430
+ const parent = dirname(dir);
431
+ if (parent === dir) break;
432
+ dir = parent;
433
+ }
434
+
435
+ return process.cwd();
436
+ }
437
+
438
+ const detectedRoot = detectProjectRoot();
439
+ const projectHash = hashString(detectedRoot);
440
+ const projectName = detectedRoot.replace(/\\/g, "/").split("/").pop() || detectedRoot;
441
+ const projectPath = detectedRoot;
417
442
 
418
443
  // ── HTTP Helper ─────────────────────────────────────────────────────
419
444