vexp-mcp 3.4.0 → 3.4.2
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-upgrade.js
CHANGED
|
@@ -84,7 +84,7 @@ export function daemonUpgradeDecision(o) {
|
|
|
84
84
|
}
|
|
85
85
|
if (!isOlderVersion(o.running, o.engine))
|
|
86
86
|
return { replace: false, why: "daemon is not older" };
|
|
87
|
-
if (o.exe &&
|
|
87
|
+
if (o.exe && editorOwnedExe(o.exe))
|
|
88
88
|
return { replace: false, why: "started by an editor window" };
|
|
89
89
|
if (o.status !== "healthy")
|
|
90
90
|
return { replace: false, why: "index not settled" };
|
|
@@ -94,6 +94,24 @@ export function daemonUpgradeDecision(o) {
|
|
|
94
94
|
}
|
|
95
95
|
return { replace: true };
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Whether a daemon's executable is the engine inside an editor extension's
|
|
99
|
+
* folder (rule 4). The path is resolved when it exists: a daemon started
|
|
100
|
+
* through vexp's version-free link (<home>/.vexp/bin) reports the link on
|
|
101
|
+
* macOS and Windows, where the engine records the path it was started as,
|
|
102
|
+
* and the link names no extension folder (field report, 2026-11-10).
|
|
103
|
+
*/
|
|
104
|
+
function editorOwnedExe(exe) {
|
|
105
|
+
const editor = /vexp\.vexp-vscode-\d/i;
|
|
106
|
+
if (editor.test(exe))
|
|
107
|
+
return true;
|
|
108
|
+
try {
|
|
109
|
+
return editor.test(fs.realpathSync.native(exe));
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return false; // gone, or not a path on this machine
|
|
113
|
+
}
|
|
114
|
+
}
|
|
97
115
|
/**
|
|
98
116
|
* Where the attempts are remembered: vexp's own state directory, one small
|
|
99
117
|
* file for the machine, shared by the CLI and the MCP server so that they
|
|
@@ -40,8 +40,18 @@ export async function handleGetSkeleton(params, daemon) {
|
|
|
40
40
|
const result = await daemon.call("get_skeleton", daemonParams);
|
|
41
41
|
return formatSkeletonsAsText(result);
|
|
42
42
|
}
|
|
43
|
-
function formatSkeletonsAsText(
|
|
43
|
+
export function formatSkeletonsAsText(all) {
|
|
44
44
|
const lines = [];
|
|
45
|
+
// A requested file with nothing to show says why, in place of a skeleton:
|
|
46
|
+
// a file the index skipped as too large read "files may not be indexed
|
|
47
|
+
// yet" and never would be (field report, 2026-11-10). Lockstep with the
|
|
48
|
+
// Rust server's render_skeleton_result.
|
|
49
|
+
const notIndexed = Array.isArray(all) ? all.filter((n) => typeof n.not_indexed === "string") : [];
|
|
50
|
+
const nodes = Array.isArray(all) ? all.filter((n) => typeof n.not_indexed !== "string") : all;
|
|
51
|
+
const reasons = notIndexed.map((n) => `## \`${n.file_path}\`\n\n*${n.not_indexed}*\n`);
|
|
52
|
+
if (Array.isArray(nodes) && nodes.length === 0 && reasons.length > 0) {
|
|
53
|
+
return ["# File Skeletons", "", ...reasons].join("\n");
|
|
54
|
+
}
|
|
45
55
|
if (!Array.isArray(nodes) || nodes.length === 0) {
|
|
46
56
|
lines.push("# File Skeletons");
|
|
47
57
|
lines.push("");
|
|
@@ -78,5 +88,6 @@ function formatSkeletonsAsText(nodes) {
|
|
|
78
88
|
lines.push("```");
|
|
79
89
|
lines.push("");
|
|
80
90
|
}
|
|
91
|
+
lines.push(...reasons);
|
|
81
92
|
return lines.join("\n");
|
|
82
93
|
}
|
|
@@ -28,7 +28,10 @@ export const SEARCH_LOGIC_FLOW_DEFINITION = {
|
|
|
28
28
|
};
|
|
29
29
|
export async function handleSearchLogicFlow(params, daemon) {
|
|
30
30
|
const validated = SearchLogicFlowSchema.parse(params);
|
|
31
|
-
|
|
31
|
+
// `with_endpoints`: the daemon also says which symbols the two names
|
|
32
|
+
// resolved to, so an answer with no path is still checkable. An older
|
|
33
|
+
// daemon ignores it and sends the bare path array.
|
|
34
|
+
const result = await daemon.call("search_logic_flow", { ...validated, with_endpoints: true });
|
|
32
35
|
// Handle cross-repo gap response
|
|
33
36
|
if (typeof result === 'object' && result !== null && 'cross_repo_gap' in result) {
|
|
34
37
|
return formatCrossRepoGap(result);
|
|
@@ -57,12 +60,37 @@ function formatCrossRepoGap(gap) {
|
|
|
57
60
|
}
|
|
58
61
|
return lines.join("\n");
|
|
59
62
|
}
|
|
60
|
-
|
|
63
|
+
/**
|
|
64
|
+
* search_logic_flow as text. The native server's `render_logic_flow_result`
|
|
65
|
+
* (vexp-core/src/mcp_stdio.rs) writes the same lines; both test files hold
|
|
66
|
+
* the same fixture and expected text.
|
|
67
|
+
*
|
|
68
|
+
* Takes the daemon's `with_endpoints` object, or an older daemon's bare path
|
|
69
|
+
* array (rendered with the names as typed). When a name matched a different
|
|
70
|
+
* symbol than the one typed, a line says which: without it, "no path" after
|
|
71
|
+
* a guessed name cannot be told apart from two symbols that do not connect.
|
|
72
|
+
*/
|
|
73
|
+
export function formatFlowAsText(start, end, result) {
|
|
61
74
|
const lines = [];
|
|
62
|
-
|
|
75
|
+
const ends = Array.isArray(result) ? null : result;
|
|
76
|
+
const paths = Array.isArray(result)
|
|
77
|
+
? result
|
|
78
|
+
: Array.isArray(result?.paths) ? result.paths : [];
|
|
79
|
+
lines.push(`# Logic Flow: \`${ends?.start?.fqn ?? start}\` → \`${ends?.end?.fqn ?? end}\``);
|
|
80
|
+
if (ends) {
|
|
81
|
+
for (const [label, endpoint, typed] of [["start", ends.start, start], ["end", ends.end, end]]) {
|
|
82
|
+
const fqn = endpoint?.fqn ?? typed;
|
|
83
|
+
if (fqn === typed)
|
|
84
|
+
continue;
|
|
85
|
+
const at = endpoint?.file_path
|
|
86
|
+
? ` (${endpoint.file_path}${typeof endpoint.start_line === "number" ? `:${endpoint.start_line}` : ""})`
|
|
87
|
+
: "";
|
|
88
|
+
lines.push(`> ${label} \`${typed}\` matched \`${fqn}\`${at}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
63
91
|
lines.push(`> ${paths.length} path(s) found`);
|
|
64
92
|
lines.push("");
|
|
65
|
-
if (
|
|
93
|
+
if (paths.length === 0) {
|
|
66
94
|
lines.push("*No execution path found between these symbols. " +
|
|
67
95
|
"They may not be connected, or the path may exceed the search depth.*");
|
|
68
96
|
return lines.join("\n");
|
|
@@ -72,7 +100,10 @@ function formatFlowAsText(start, end, paths) {
|
|
|
72
100
|
lines.push("");
|
|
73
101
|
path.nodes.forEach((node, nodeIdx) => {
|
|
74
102
|
const isLast = nodeIdx === path.nodes.length - 1;
|
|
75
|
-
|
|
103
|
+
// edges_description[i] joins node i to node i + 1: a step is labelled
|
|
104
|
+
// with the edge that reaches it. Until 3.4.1 this read [nodeIdx], the
|
|
105
|
+
// edge leaving the step, so the first edge was never shown.
|
|
106
|
+
const edge = nodeIdx > 0 ? path.edges_description[nodeIdx - 1] ?? "" : "";
|
|
76
107
|
if (nodeIdx === 0) {
|
|
77
108
|
lines.push(`1. **START** \`${node.fqn}\``);
|
|
78
109
|
lines.push(` *${node.file_path}:${node.start_line}*`);
|