vexp-mcp 3.2.2 → 3.2.4
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/dist/daemon-client.js +22 -4
- package/package.json +1 -1
package/dist/daemon-client.js
CHANGED
|
@@ -122,6 +122,10 @@ export class DaemonClient {
|
|
|
122
122
|
return;
|
|
123
123
|
if (!fs.existsSync(path.join(workspaceRoot, ".vexp", "manifest.json")))
|
|
124
124
|
return;
|
|
125
|
+
// The daemon refuses the home directory itself; not asking spares the
|
|
126
|
+
// spawn and the "daemon did not start" it would answer with.
|
|
127
|
+
if (isVexpStateHome(workspaceRoot))
|
|
128
|
+
return;
|
|
125
129
|
const binary = resolveVexpCoreBinary();
|
|
126
130
|
if (!binary)
|
|
127
131
|
return;
|
|
@@ -567,6 +571,19 @@ export function fnvHash(input) {
|
|
|
567
571
|
}
|
|
568
572
|
return hash.toString(16);
|
|
569
573
|
}
|
|
574
|
+
/** True when `dir` is the home / VEXP_HOME directory: vexp's own STATE dir
|
|
575
|
+
* (config, licence, daemons.json), never a workspace — initialized-looking or
|
|
576
|
+
* not, because a stray daemon that indexed home leaves an index.db there and
|
|
577
|
+
* that residue must not read as consent (field report, 2026-09-19).
|
|
578
|
+
* Lockstep with vexp-core utils::forbidden_workspace_reason; the same
|
|
579
|
+
* VEXP_ALLOW_HOME_WORKSPACE=1 lifts it. */
|
|
580
|
+
export function isVexpStateHome(dir) {
|
|
581
|
+
if (process.env.VEXP_ALLOW_HOME_WORKSPACE === "1")
|
|
582
|
+
return false;
|
|
583
|
+
const stateHome = path.resolve(process.env.VEXP_HOME && path.isAbsolute(process.env.VEXP_HOME) ? process.env.VEXP_HOME : os.homedir());
|
|
584
|
+
const a = path.resolve(dir);
|
|
585
|
+
return process.platform === "win32" ? a.toLowerCase() === stateHome.toLowerCase() : a === stateHome;
|
|
586
|
+
}
|
|
570
587
|
/**
|
|
571
588
|
* Walk up from cwd looking for .vexp/ or .git/ to find the workspace root.
|
|
572
589
|
* Used when VEXP_WORKSPACE is not set (e.g., agent spawns MCP server
|
|
@@ -575,12 +592,14 @@ export function fnvHash(input) {
|
|
|
575
592
|
function discoverWorkspaceRoot() {
|
|
576
593
|
const cwd = process.cwd();
|
|
577
594
|
// Pass 1: nearest ancestor with an INITIALIZED .vexp/ (manifest.json or
|
|
578
|
-
// index.db) — a real indexed workspace, not a stray/empty .vexp/ dir.
|
|
595
|
+
// index.db) — a real indexed workspace, not a stray/empty .vexp/ dir. The
|
|
596
|
+
// home directory never qualifies (isVexpStateHome).
|
|
579
597
|
// MUST stay in lockstep with vexp-core/src/utils.rs::discover_workspace_root.
|
|
580
598
|
let current = cwd;
|
|
581
599
|
while (true) {
|
|
582
600
|
const vexp = path.join(current, ".vexp");
|
|
583
|
-
if (fs.existsSync(path.join(vexp, "manifest.json")) || fs.existsSync(path.join(vexp, "index.db")))
|
|
601
|
+
if ((fs.existsSync(path.join(vexp, "manifest.json")) || fs.existsSync(path.join(vexp, "index.db"))) &&
|
|
602
|
+
!isVexpStateHome(current)) {
|
|
584
603
|
return current;
|
|
585
604
|
}
|
|
586
605
|
const parent = path.dirname(current);
|
|
@@ -593,10 +612,9 @@ function discoverWorkspaceRoot() {
|
|
|
593
612
|
// dir: treating it as a workspace let an agent that spawns servers from
|
|
594
613
|
// the home dir target the whole home (field report, 2026-09-02). Lockstep
|
|
595
614
|
// with vexp-core utils::discover_workspace_root.
|
|
596
|
-
const stateHome = path.resolve(process.env.VEXP_HOME && path.isAbsolute(process.env.VEXP_HOME) ? process.env.VEXP_HOME : os.homedir());
|
|
597
615
|
current = cwd;
|
|
598
616
|
while (true) {
|
|
599
|
-
if (fs.existsSync(path.join(current, ".vexp")) &&
|
|
617
|
+
if (fs.existsSync(path.join(current, ".vexp")) && !isVexpStateHome(current))
|
|
600
618
|
return current;
|
|
601
619
|
const parent = path.dirname(current);
|
|
602
620
|
if (parent === current)
|