vexp-mcp 3.3.0 → 3.3.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/dist/daemon-client.js +46 -1
- package/package.json +1 -1
package/dist/daemon-client.js
CHANGED
|
@@ -121,7 +121,14 @@ export class DaemonClient {
|
|
|
121
121
|
// the guard keeps the contract true for any other caller.
|
|
122
122
|
if (readDailyLimitMarker(workspaceRoot))
|
|
123
123
|
return;
|
|
124
|
-
|
|
124
|
+
// Consent: this folder's own manifest, or, for a fresh git worktree, the
|
|
125
|
+
// set-up checkout it belongs to (its daemon indexes the worktree). Not on
|
|
126
|
+
// Windows: a daemon holds the worktree's index open past the session,
|
|
127
|
+
// and Windows then refuses the harness's `git worktree remove` (git
|
|
128
|
+
// unregisters the worktree and leaves the folder behind; reproduced on
|
|
129
|
+
// Windows 11, 2026-09-30).
|
|
130
|
+
if (!fs.existsSync(path.join(workspaceRoot, ".vexp", "manifest.json")) &&
|
|
131
|
+
!(process.platform !== "win32" && worktreeConsentSource(workspaceRoot)))
|
|
125
132
|
return;
|
|
126
133
|
// The daemon refuses the home directory itself; not asking spares the
|
|
127
134
|
// spawn and the "daemon did not start" it would answer with.
|
|
@@ -585,6 +592,44 @@ export function isVexpStateHome(dir) {
|
|
|
585
592
|
const a = path.resolve(dir);
|
|
586
593
|
return process.platform === "win32" ? a.toLowerCase() === stateHome.toLowerCase() : a === stateHome;
|
|
587
594
|
}
|
|
595
|
+
/**
|
|
596
|
+
* The main checkout a linked git worktree takes its consent from: set up with
|
|
597
|
+
* vexp (manifest.json or index.db in its .vexp/) and not the state home.
|
|
598
|
+
* null for anything that is not a linked worktree (a submodule is not).
|
|
599
|
+
*
|
|
600
|
+
* A fresh worktree has no .vexp/, so a worktree of a set-up repository got no
|
|
601
|
+
* daemon and no tools until someone ran `vexp index` in it (AppSumo report,
|
|
602
|
+
* 2026-09-30). Lockstep with vexp-core utils::worktree_consent_source /
|
|
603
|
+
* git_project_root.
|
|
604
|
+
*/
|
|
605
|
+
export function worktreeConsentSource(dir) {
|
|
606
|
+
let content;
|
|
607
|
+
try {
|
|
608
|
+
if (!fs.statSync(path.join(dir, ".git")).isFile())
|
|
609
|
+
return null;
|
|
610
|
+
content = fs.readFileSync(path.join(dir, ".git"), "utf-8");
|
|
611
|
+
}
|
|
612
|
+
catch {
|
|
613
|
+
return null;
|
|
614
|
+
}
|
|
615
|
+
const gitdir = content
|
|
616
|
+
.split(/\r?\n/)
|
|
617
|
+
.map((l) => l.trim())
|
|
618
|
+
.find((l) => l.startsWith("gitdir:"))
|
|
619
|
+
?.slice("gitdir:".length)
|
|
620
|
+
.trim()
|
|
621
|
+
.replace(/\\/g, "/");
|
|
622
|
+
const at = gitdir ? gitdir.indexOf("/.git/worktrees/") : -1;
|
|
623
|
+
if (!gitdir || at <= 0)
|
|
624
|
+
return null;
|
|
625
|
+
const main = path.resolve(dir, gitdir.slice(0, at));
|
|
626
|
+
if (isVexpStateHome(main))
|
|
627
|
+
return null;
|
|
628
|
+
const vexp = path.join(main, ".vexp");
|
|
629
|
+
return fs.existsSync(path.join(vexp, "manifest.json")) || fs.existsSync(path.join(vexp, "index.db"))
|
|
630
|
+
? main
|
|
631
|
+
: null;
|
|
632
|
+
}
|
|
588
633
|
/**
|
|
589
634
|
* Walk up from cwd looking for .vexp/ or .git/ to find the workspace root.
|
|
590
635
|
* Used when VEXP_WORKSPACE is not set (e.g., agent spawns MCP server
|