vexp-mcp 3.2.4 → 3.2.5

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.
@@ -672,7 +672,7 @@ function resolveWorkspaceWithSource(explicit) {
672
672
  return { root: explicit, source: "VEXP_WORKSPACE" };
673
673
  const vw = process.env["VEXP_WORKSPACE"];
674
674
  const cpd = process.env["CLAUDE_PROJECT_DIR"];
675
- if (vw && cpd && path.resolve(vw).toLowerCase() !== path.resolve(cpd).toLowerCase()) {
675
+ if (vw && cpd && canonicalWorkspaceRoot(path.resolve(vw)).toLowerCase() !== canonicalWorkspaceRoot(path.resolve(cpd)).toLowerCase()) {
676
676
  warnOnce(`[vexp-mcp] VEXP_WORKSPACE=${vw} disagrees with this session's ` +
677
677
  `CLAUDE_PROJECT_DIR=${cpd}; using CLAUDE_PROJECT_DIR for per-session ` +
678
678
  `targeting. Unset the global VEXP_WORKSPACE env var to silence this.`);
@@ -741,7 +741,7 @@ function pickFromDaemonRegistry(workspaceHint) {
741
741
  });
742
742
  if (entries.length === 0)
743
743
  return null;
744
- const hintNorm = workspaceHint.toLowerCase();
744
+ const hintNorm = canonicalWorkspaceRoot(workspaceHint).toLowerCase();
745
745
  for (const [ws, sock] of entries) {
746
746
  if (ws.toLowerCase() === hintNorm)
747
747
  return sock;
@@ -827,7 +827,7 @@ export function resolveTargeting() {
827
827
  if (fromRegistry)
828
828
  return { socket: fromRegistry, source, socketOrigin: "registry", workspaceRoot };
829
829
  // Hash-based last-ditch (daemon should always register, so this is rare)
830
- const hash = fnvHash(workspaceRoot.toLowerCase());
830
+ const hash = fnvHash(canonicalWorkspaceRoot(workspaceRoot).toLowerCase());
831
831
  return { socket: `\\\\.\\pipe\\vexp-${hash.slice(0, 8)}`, source, socketOrigin: "hash-fallback", workspaceRoot };
832
832
  }
833
833
  // Unix: prefer workspace-local if the socket file actually exists
@@ -985,11 +985,34 @@ export function resolveWorkspaceByHash(hashPrefix) {
985
985
  }
986
986
  return null;
987
987
  }
988
+ /**
989
+ * The workspace root as the daemon spells it. vexp-core canonicalizes the
990
+ * root before deriving the pipe name and the daemons.json key, and on
991
+ * Windows a folder on a mapped drive canonicalizes to its share:
992
+ * `X:\proj` becomes `\\server\share\proj`. Every hash computed from the
993
+ * drive-letter spelling named a pipe the daemon never bound, so `vexp
994
+ * status` on a share reported the daemon as down and started a second one,
995
+ * and the MCP bridge could not reach it (field report, Samba share from
996
+ * Windows 11, 2026-09-20). Node's native realpath resolves the same way; a
997
+ * local path only gets its case corrected, which the lowercase hash never
998
+ * saw. Falls back to the spelling given when the folder cannot be resolved
999
+ * (a stale registry row, a path that is not there yet).
1000
+ */
1001
+ export function canonicalWorkspaceRoot(root) {
1002
+ if (process.platform !== "win32")
1003
+ return root;
1004
+ try {
1005
+ return fs.realpathSync.native(root);
1006
+ }
1007
+ catch {
1008
+ return root;
1009
+ }
1010
+ }
988
1011
  /** Deterministic socket/pipe path for a workspace root — mirrors the Rust
989
1012
  * daemon's get_socket_path (vexp-core/src/utils.rs). */
990
1013
  function socketPathForWorkspace(ws) {
991
1014
  if (process.platform === "win32") {
992
- return `\\\\.\\pipe\\vexp-${fnvHash(ws.toLowerCase()).slice(0, 8)}`;
1015
+ return `\\\\.\\pipe\\vexp-${fnvHash(canonicalWorkspaceRoot(ws).toLowerCase()).slice(0, 8)}`;
993
1016
  }
994
1017
  return path.join(ws, ".vexp", "daemon.sock");
995
1018
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vexp-mcp",
3
- "version": "3.2.4",
3
+ "version": "3.2.5",
4
4
  "license": "UNLICENSED",
5
5
  "description": "vexp MCP server — AI context tools for coding agents",
6
6
  "type": "module",