@mcp-graph-workflow/mcp-graph 5.11.0 → 5.12.0
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/api/routes/code-graph.d.ts.map +1 -1
- package/dist/api/routes/code-graph.js +163 -0
- package/dist/api/routes/code-graph.js.map +1 -1
- package/dist/core/code/code-indexer.d.ts +5 -3
- package/dist/core/code/code-indexer.d.ts.map +1 -1
- package/dist/core/code/code-indexer.js +57 -10
- package/dist/core/code/code-indexer.js.map +1 -1
- package/dist/core/code/code-types.d.ts +8 -0
- package/dist/core/code/code-types.d.ts.map +1 -1
- package/dist/core/code/code-types.js.map +1 -1
- package/dist/core/code/graph-traversal.d.ts +15 -0
- package/dist/core/code/graph-traversal.d.ts.map +1 -1
- package/dist/core/code/graph-traversal.js +53 -0
- package/dist/core/code/graph-traversal.js.map +1 -1
- package/dist/core/code/ts-analyzer.d.ts +6 -1
- package/dist/core/code/ts-analyzer.d.ts.map +1 -1
- package/dist/core/code/ts-analyzer.js +8 -0
- package/dist/core/code/ts-analyzer.js.map +1 -1
- package/dist/core/config/config-schema.d.ts +8 -0
- package/dist/core/config/config-schema.d.ts.map +1 -1
- package/dist/core/config/config-schema.js +3 -1
- package/dist/core/config/config-schema.js.map +1 -1
- package/dist/core/context/context-assembler.d.ts +2 -0
- package/dist/core/context/context-assembler.d.ts.map +1 -1
- package/dist/core/context/context-assembler.js +15 -0
- package/dist/core/context/context-assembler.js.map +1 -1
- package/dist/core/lsp/language-detector.d.ts +11 -0
- package/dist/core/lsp/language-detector.d.ts.map +1 -0
- package/dist/core/lsp/language-detector.js +149 -0
- package/dist/core/lsp/language-detector.js.map +1 -0
- package/dist/core/lsp/lsp-analyzer.d.ts +16 -0
- package/dist/core/lsp/lsp-analyzer.d.ts.map +1 -0
- package/dist/core/lsp/lsp-analyzer.js +30 -0
- package/dist/core/lsp/lsp-analyzer.js.map +1 -0
- package/dist/core/lsp/lsp-bridge.d.ts +40 -0
- package/dist/core/lsp/lsp-bridge.d.ts.map +1 -0
- package/dist/core/lsp/lsp-bridge.js +349 -0
- package/dist/core/lsp/lsp-bridge.js.map +1 -0
- package/dist/core/lsp/lsp-cache.d.ts +33 -0
- package/dist/core/lsp/lsp-cache.d.ts.map +1 -0
- package/dist/core/lsp/lsp-cache.js +134 -0
- package/dist/core/lsp/lsp-cache.js.map +1 -0
- package/dist/core/lsp/lsp-client.d.ts +47 -0
- package/dist/core/lsp/lsp-client.d.ts.map +1 -0
- package/dist/core/lsp/lsp-client.js +256 -0
- package/dist/core/lsp/lsp-client.js.map +1 -0
- package/dist/core/lsp/lsp-diagnostics.d.ts +40 -0
- package/dist/core/lsp/lsp-diagnostics.d.ts.map +1 -0
- package/dist/core/lsp/lsp-diagnostics.js +113 -0
- package/dist/core/lsp/lsp-diagnostics.js.map +1 -0
- package/dist/core/lsp/lsp-server-manager.d.ts +56 -0
- package/dist/core/lsp/lsp-server-manager.d.ts.map +1 -0
- package/dist/core/lsp/lsp-server-manager.js +330 -0
- package/dist/core/lsp/lsp-server-manager.js.map +1 -0
- package/dist/core/lsp/lsp-types.d.ts +130 -0
- package/dist/core/lsp/lsp-types.d.ts.map +1 -0
- package/dist/core/lsp/lsp-types.js +131 -0
- package/dist/core/lsp/lsp-types.js.map +1 -0
- package/dist/core/lsp/server-registry.d.ts +19 -0
- package/dist/core/lsp/server-registry.d.ts.map +1 -0
- package/dist/core/lsp/server-registry.js +188 -0
- package/dist/core/lsp/server-registry.js.map +1 -0
- package/dist/core/rag/multi-strategy-retrieval.d.ts +6 -0
- package/dist/core/rag/multi-strategy-retrieval.d.ts.map +1 -1
- package/dist/core/rag/multi-strategy-retrieval.js +31 -3
- package/dist/core/rag/multi-strategy-retrieval.js.map +1 -1
- package/dist/core/store/migrations.d.ts.map +1 -1
- package/dist/core/store/migrations.js +21 -0
- package/dist/core/store/migrations.js.map +1 -1
- package/dist/mcp/tools/code-intelligence.d.ts +15 -0
- package/dist/mcp/tools/code-intelligence.d.ts.map +1 -0
- package/dist/mcp/tools/code-intelligence.js +276 -0
- package/dist/mcp/tools/code-intelligence.js.map +1 -0
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +4 -0
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/schemas/knowledge.schema.d.ts +2 -0
- package/dist/schemas/knowledge.schema.d.ts.map +1 -1
- package/dist/schemas/knowledge.schema.js +1 -1
- package/dist/schemas/knowledge.schema.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LspServerManager — Manages multiple language server instances (one per language).
|
|
3
|
+
*
|
|
4
|
+
* Handles lazy startup, keep-alive timers, auto-restart on crash,
|
|
5
|
+
* and extension-based routing via ServerRegistry.
|
|
6
|
+
*/
|
|
7
|
+
import { exec } from "node:child_process";
|
|
8
|
+
import { promisify } from "node:util";
|
|
9
|
+
import { LspClient } from "./lsp-client.js";
|
|
10
|
+
import { logger } from "../utils/logger.js";
|
|
11
|
+
const execAsync = promisify(exec);
|
|
12
|
+
const DEFAULT_KEEPALIVE_MS = 5 * 60 * 1000; // 5 minutes
|
|
13
|
+
const MAX_RESTART_ATTEMPTS = 3;
|
|
14
|
+
const REQUEST_TIMEOUT_MS = 30_000;
|
|
15
|
+
export class LspServerManager {
|
|
16
|
+
registry;
|
|
17
|
+
rootUri;
|
|
18
|
+
keepAliveMs;
|
|
19
|
+
servers = new Map();
|
|
20
|
+
constructor(registry, rootUri, keepAliveMs = DEFAULT_KEEPALIVE_MS) {
|
|
21
|
+
this.registry = registry;
|
|
22
|
+
this.rootUri = rootUri;
|
|
23
|
+
this.keepAliveMs = keepAliveMs;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get a running LSP client for a language. Starts the server lazily if needed.
|
|
27
|
+
* Returns null if the server binary is not available.
|
|
28
|
+
*/
|
|
29
|
+
async ensureServer(languageId) {
|
|
30
|
+
// 1. Check if already running
|
|
31
|
+
const existing = this.servers.get(languageId);
|
|
32
|
+
if (existing && existing.state.status === "ready") {
|
|
33
|
+
this.resetKeepAlive(languageId);
|
|
34
|
+
return existing.client;
|
|
35
|
+
}
|
|
36
|
+
// 2. Get config from registry
|
|
37
|
+
const config = this.registry.getConfigForLanguage(languageId);
|
|
38
|
+
if (!config) {
|
|
39
|
+
logger.debug("LspServerManager: no config for language", { languageId });
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
// 3. Check if installed
|
|
43
|
+
const installed = await this.isServerInstalled(languageId);
|
|
44
|
+
if (!installed) {
|
|
45
|
+
logger.warn("LspServerManager: server binary not found", {
|
|
46
|
+
languageId,
|
|
47
|
+
command: config.command,
|
|
48
|
+
});
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
// 4. Start server
|
|
52
|
+
try {
|
|
53
|
+
const client = await this.startServer(config);
|
|
54
|
+
const managed = {
|
|
55
|
+
client,
|
|
56
|
+
config,
|
|
57
|
+
state: {
|
|
58
|
+
languageId,
|
|
59
|
+
status: "ready",
|
|
60
|
+
pid: client.pid,
|
|
61
|
+
},
|
|
62
|
+
restartCount: 0,
|
|
63
|
+
keepAliveTimer: null,
|
|
64
|
+
lastActivity: Date.now(),
|
|
65
|
+
intentionalStop: false,
|
|
66
|
+
};
|
|
67
|
+
this.servers.set(languageId, managed);
|
|
68
|
+
// 5. Set up exit handler for auto-restart
|
|
69
|
+
client.on("exit", (code) => {
|
|
70
|
+
void this.handleServerExit(languageId, code);
|
|
71
|
+
});
|
|
72
|
+
// 6. Set up keepAlive timer
|
|
73
|
+
this.resetKeepAlive(languageId);
|
|
74
|
+
logger.info("LspServerManager: server started", {
|
|
75
|
+
languageId,
|
|
76
|
+
pid: String(client.pid ?? "unknown"),
|
|
77
|
+
});
|
|
78
|
+
return client;
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
82
|
+
logger.error("LspServerManager: failed to start server", {
|
|
83
|
+
languageId,
|
|
84
|
+
error: errorMsg,
|
|
85
|
+
});
|
|
86
|
+
// Store error state
|
|
87
|
+
this.servers.set(languageId, {
|
|
88
|
+
client: new LspClient(config.command, config.args, REQUEST_TIMEOUT_MS),
|
|
89
|
+
config,
|
|
90
|
+
state: {
|
|
91
|
+
languageId,
|
|
92
|
+
status: "error",
|
|
93
|
+
error: errorMsg,
|
|
94
|
+
},
|
|
95
|
+
restartCount: 0,
|
|
96
|
+
keepAliveTimer: null,
|
|
97
|
+
lastActivity: Date.now(),
|
|
98
|
+
intentionalStop: false,
|
|
99
|
+
});
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get a client for a file path (routes by extension via registry).
|
|
105
|
+
* Returns null if no server configured for the file's language.
|
|
106
|
+
*/
|
|
107
|
+
async getClientForFile(filePath) {
|
|
108
|
+
const languageId = this.registry.getLanguageForFile(filePath);
|
|
109
|
+
if (!languageId) {
|
|
110
|
+
logger.debug("LspServerManager: no language mapping for file", { filePath });
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
return this.ensureServer(languageId);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Check if a language server binary is installed.
|
|
117
|
+
* Uses probeCommand from config if available, otherwise `which` (or `where` on Windows).
|
|
118
|
+
*/
|
|
119
|
+
async isServerInstalled(languageId) {
|
|
120
|
+
const config = this.registry.getConfigForLanguage(languageId);
|
|
121
|
+
if (!config) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
const probeCmd = config.probeCommand
|
|
125
|
+
? config.probeCommand
|
|
126
|
+
: process.platform === "win32"
|
|
127
|
+
? `where ${config.command}`
|
|
128
|
+
: `which ${config.command}`;
|
|
129
|
+
try {
|
|
130
|
+
await execAsync(probeCmd);
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get status of all known language servers.
|
|
139
|
+
*/
|
|
140
|
+
getStatus() {
|
|
141
|
+
const result = new Map();
|
|
142
|
+
// Include running/errored servers
|
|
143
|
+
for (const [langId, managed] of this.servers) {
|
|
144
|
+
result.set(langId, { ...managed.state });
|
|
145
|
+
}
|
|
146
|
+
// Include known-but-not-started servers from registry
|
|
147
|
+
for (const config of this.registry.getAllConfigs()) {
|
|
148
|
+
if (!result.has(config.languageId)) {
|
|
149
|
+
result.set(config.languageId, {
|
|
150
|
+
languageId: config.languageId,
|
|
151
|
+
status: "stopped",
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Shutdown all running servers gracefully.
|
|
159
|
+
*/
|
|
160
|
+
async shutdownAll() {
|
|
161
|
+
const stopPromises = [];
|
|
162
|
+
for (const [languageId, managed] of this.servers) {
|
|
163
|
+
if (managed.keepAliveTimer) {
|
|
164
|
+
clearTimeout(managed.keepAliveTimer);
|
|
165
|
+
managed.keepAliveTimer = null;
|
|
166
|
+
}
|
|
167
|
+
managed.intentionalStop = true;
|
|
168
|
+
if (managed.state.status === "ready") {
|
|
169
|
+
logger.info("LspServerManager: stopping server", { languageId });
|
|
170
|
+
stopPromises.push(managed.client.stop());
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
await Promise.allSettled(stopPromises);
|
|
174
|
+
this.servers.clear();
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Stop a single language server.
|
|
178
|
+
*/
|
|
179
|
+
async stopServer(languageId) {
|
|
180
|
+
const managed = this.servers.get(languageId);
|
|
181
|
+
if (!managed) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (managed.keepAliveTimer) {
|
|
185
|
+
clearTimeout(managed.keepAliveTimer);
|
|
186
|
+
managed.keepAliveTimer = null;
|
|
187
|
+
}
|
|
188
|
+
managed.intentionalStop = true;
|
|
189
|
+
if (managed.state.status === "ready") {
|
|
190
|
+
await managed.client.stop();
|
|
191
|
+
}
|
|
192
|
+
managed.state = {
|
|
193
|
+
languageId,
|
|
194
|
+
status: "stopped",
|
|
195
|
+
};
|
|
196
|
+
this.servers.delete(languageId);
|
|
197
|
+
}
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
// Private methods
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
/**
|
|
202
|
+
* Reset the keep-alive timer for a language (call on each request).
|
|
203
|
+
*/
|
|
204
|
+
resetKeepAlive(languageId) {
|
|
205
|
+
const managed = this.servers.get(languageId);
|
|
206
|
+
if (!managed) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (managed.keepAliveTimer) {
|
|
210
|
+
clearTimeout(managed.keepAliveTimer);
|
|
211
|
+
}
|
|
212
|
+
managed.lastActivity = Date.now();
|
|
213
|
+
managed.keepAliveTimer = setTimeout(() => {
|
|
214
|
+
logger.info("LspServerManager: keep-alive timeout, stopping server", {
|
|
215
|
+
languageId,
|
|
216
|
+
});
|
|
217
|
+
void this.stopServer(languageId);
|
|
218
|
+
}, this.keepAliveMs);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Handle server crash: auto-restart up to MAX_RESTART_ATTEMPTS.
|
|
222
|
+
*/
|
|
223
|
+
async handleServerExit(languageId, code) {
|
|
224
|
+
const managed = this.servers.get(languageId);
|
|
225
|
+
if (!managed) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
// If intentional stop, don't restart
|
|
229
|
+
if (managed.intentionalStop) {
|
|
230
|
+
managed.state = {
|
|
231
|
+
languageId,
|
|
232
|
+
status: "stopped",
|
|
233
|
+
};
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
managed.state = {
|
|
237
|
+
languageId,
|
|
238
|
+
status: "error",
|
|
239
|
+
error: `Process exited with code ${code}`,
|
|
240
|
+
};
|
|
241
|
+
if (managed.restartCount >= MAX_RESTART_ATTEMPTS) {
|
|
242
|
+
logger.error("LspServerManager: max restart attempts reached", {
|
|
243
|
+
languageId,
|
|
244
|
+
restartCount: String(managed.restartCount),
|
|
245
|
+
});
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
managed.restartCount++;
|
|
249
|
+
const delay = 1000 * Math.pow(2, managed.restartCount - 1);
|
|
250
|
+
logger.warn("LspServerManager: server crashed, restarting", {
|
|
251
|
+
languageId,
|
|
252
|
+
restartCount: String(managed.restartCount),
|
|
253
|
+
delayMs: String(delay),
|
|
254
|
+
exitCode: String(code ?? "null"),
|
|
255
|
+
});
|
|
256
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
257
|
+
// Re-check state after delay — may have been intentionally stopped
|
|
258
|
+
const current = this.servers.get(languageId);
|
|
259
|
+
if (!current || current.intentionalStop) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
try {
|
|
263
|
+
const client = await this.startServer(managed.config);
|
|
264
|
+
current.client = client;
|
|
265
|
+
current.state = {
|
|
266
|
+
languageId,
|
|
267
|
+
status: "ready",
|
|
268
|
+
pid: client.pid,
|
|
269
|
+
};
|
|
270
|
+
client.on("exit", (exitCode) => {
|
|
271
|
+
void this.handleServerExit(languageId, exitCode);
|
|
272
|
+
});
|
|
273
|
+
this.resetKeepAlive(languageId);
|
|
274
|
+
logger.info("LspServerManager: server restarted successfully", {
|
|
275
|
+
languageId,
|
|
276
|
+
attempt: String(managed.restartCount),
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
catch (err) {
|
|
280
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
281
|
+
logger.error("LspServerManager: restart failed", {
|
|
282
|
+
languageId,
|
|
283
|
+
error: errorMsg,
|
|
284
|
+
});
|
|
285
|
+
current.state = {
|
|
286
|
+
languageId,
|
|
287
|
+
status: "error",
|
|
288
|
+
error: errorMsg,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Start a language server: spawn process, send initialize, wait for response.
|
|
294
|
+
*/
|
|
295
|
+
async startServer(config) {
|
|
296
|
+
const client = new LspClient(config.command, config.args, REQUEST_TIMEOUT_MS);
|
|
297
|
+
await client.start();
|
|
298
|
+
// Send initialize request
|
|
299
|
+
const initParams = {
|
|
300
|
+
processId: process.pid,
|
|
301
|
+
rootUri: this.rootUri,
|
|
302
|
+
capabilities: {
|
|
303
|
+
textDocument: {
|
|
304
|
+
definition: {},
|
|
305
|
+
references: {},
|
|
306
|
+
hover: { contentFormat: ["markdown", "plaintext"] },
|
|
307
|
+
rename: { prepareSupport: true },
|
|
308
|
+
callHierarchy: {},
|
|
309
|
+
typeHierarchy: {},
|
|
310
|
+
publishDiagnostics: { relatedInformation: true },
|
|
311
|
+
documentSymbol: { hierarchicalDocumentSymbolSupport: true },
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
if (config.initializationOptions) {
|
|
316
|
+
initParams.initializationOptions = config.initializationOptions;
|
|
317
|
+
}
|
|
318
|
+
await client.sendRequest("initialize", initParams);
|
|
319
|
+
// Send initialized notification
|
|
320
|
+
client.sendNotification("initialized", {});
|
|
321
|
+
// Send workspace configuration if settings exist
|
|
322
|
+
if (config.settings) {
|
|
323
|
+
client.sendNotification("workspace/didChangeConfiguration", {
|
|
324
|
+
settings: config.settings,
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
return client;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=lsp-server-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-server-manager.js","sourceRoot":"","sources":["../../../src/core/lsp/lsp-server-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAA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CAAC,CAAC;QAE3C,iDAAiD;QACjD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,EAAE;gBAC1D,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B,CAAC,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LSP Multi-Language Integration — Zod Schemas & Types
|
|
3
|
+
*
|
|
4
|
+
* Defines all schemas for Language Server Protocol integration:
|
|
5
|
+
* server configuration, code locations, diagnostics, symbols,
|
|
6
|
+
* edits, server state, and language detection.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod/v4";
|
|
9
|
+
export declare const LspServerConfigSchema: z.ZodObject<{
|
|
10
|
+
languageId: z.ZodString;
|
|
11
|
+
extensions: z.ZodArray<z.ZodString>;
|
|
12
|
+
command: z.ZodString;
|
|
13
|
+
args: z.ZodArray<z.ZodString>;
|
|
14
|
+
configFiles: z.ZodArray<z.ZodString>;
|
|
15
|
+
probeCommand: z.ZodOptional<z.ZodString>;
|
|
16
|
+
initializationOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
17
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type LspServerConfig = z.infer<typeof LspServerConfigSchema>;
|
|
20
|
+
export declare const LspConfigOverrideSchema: z.ZodObject<{
|
|
21
|
+
languageId: z.ZodString;
|
|
22
|
+
command: z.ZodString;
|
|
23
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
24
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
initializationOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
26
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type LspConfigOverride = z.infer<typeof LspConfigOverrideSchema>;
|
|
29
|
+
export declare const LspLocationSchema: z.ZodObject<{
|
|
30
|
+
file: z.ZodString;
|
|
31
|
+
startLine: z.ZodInt;
|
|
32
|
+
startCharacter: z.ZodInt;
|
|
33
|
+
endLine: z.ZodInt;
|
|
34
|
+
endCharacter: z.ZodInt;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type LspLocation = z.infer<typeof LspLocationSchema>;
|
|
37
|
+
export declare const LspHoverResultSchema: z.ZodObject<{
|
|
38
|
+
signature: z.ZodString;
|
|
39
|
+
documentation: z.ZodOptional<z.ZodString>;
|
|
40
|
+
language: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type LspHoverResult = z.infer<typeof LspHoverResultSchema>;
|
|
43
|
+
export declare const LspDiagnosticSeverity: {
|
|
44
|
+
readonly Error: 1;
|
|
45
|
+
readonly Warning: 2;
|
|
46
|
+
readonly Information: 3;
|
|
47
|
+
readonly Hint: 4;
|
|
48
|
+
};
|
|
49
|
+
export type LspDiagnosticSeverityValue = (typeof LspDiagnosticSeverity)[keyof typeof LspDiagnosticSeverity];
|
|
50
|
+
export declare const LspDiagnosticSchema: z.ZodObject<{
|
|
51
|
+
file: z.ZodString;
|
|
52
|
+
startLine: z.ZodInt;
|
|
53
|
+
startCharacter: z.ZodInt;
|
|
54
|
+
endLine: z.ZodInt;
|
|
55
|
+
endCharacter: z.ZodInt;
|
|
56
|
+
severity: z.ZodNumber;
|
|
57
|
+
message: z.ZodString;
|
|
58
|
+
code: z.ZodOptional<z.ZodString>;
|
|
59
|
+
source: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export type LspDiagnostic = z.infer<typeof LspDiagnosticSchema>;
|
|
62
|
+
export declare const LspCallHierarchyItemSchema: z.ZodObject<{
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
kind: z.ZodString;
|
|
65
|
+
file: z.ZodString;
|
|
66
|
+
startLine: z.ZodInt;
|
|
67
|
+
endLine: z.ZodInt;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type LspCallHierarchyItem = z.infer<typeof LspCallHierarchyItemSchema>;
|
|
70
|
+
export declare const LspDocumentSymbolSchema: z.ZodType<{
|
|
71
|
+
name: string;
|
|
72
|
+
kind: string;
|
|
73
|
+
file: string;
|
|
74
|
+
startLine: number;
|
|
75
|
+
endLine: number;
|
|
76
|
+
children?: Array<{
|
|
77
|
+
name: string;
|
|
78
|
+
kind: string;
|
|
79
|
+
file: string;
|
|
80
|
+
startLine: number;
|
|
81
|
+
endLine: number;
|
|
82
|
+
children?: Array<unknown>;
|
|
83
|
+
}>;
|
|
84
|
+
}>;
|
|
85
|
+
export type LspDocumentSymbol = z.infer<typeof LspDocumentSymbolSchema>;
|
|
86
|
+
export declare const LspTextEditSchema: z.ZodObject<{
|
|
87
|
+
file: z.ZodString;
|
|
88
|
+
startLine: z.ZodInt;
|
|
89
|
+
startCharacter: z.ZodInt;
|
|
90
|
+
endLine: z.ZodInt;
|
|
91
|
+
endCharacter: z.ZodInt;
|
|
92
|
+
newText: z.ZodString;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export type LspTextEdit = z.infer<typeof LspTextEditSchema>;
|
|
95
|
+
export declare const LspWorkspaceEditSchema: z.ZodObject<{
|
|
96
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
97
|
+
file: z.ZodString;
|
|
98
|
+
startLine: z.ZodInt;
|
|
99
|
+
startCharacter: z.ZodInt;
|
|
100
|
+
endLine: z.ZodInt;
|
|
101
|
+
endCharacter: z.ZodInt;
|
|
102
|
+
newText: z.ZodString;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export type LspWorkspaceEdit = z.infer<typeof LspWorkspaceEditSchema>;
|
|
106
|
+
export declare const LspServerStateSchema: z.ZodObject<{
|
|
107
|
+
languageId: z.ZodString;
|
|
108
|
+
status: z.ZodEnum<{
|
|
109
|
+
ready: "ready";
|
|
110
|
+
error: "error";
|
|
111
|
+
stopped: "stopped";
|
|
112
|
+
starting: "starting";
|
|
113
|
+
}>;
|
|
114
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
error: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
export type LspServerState = z.infer<typeof LspServerStateSchema>;
|
|
118
|
+
export declare const DetectedLanguageSchema: z.ZodObject<{
|
|
119
|
+
languageId: z.ZodString;
|
|
120
|
+
confidence: z.ZodNumber;
|
|
121
|
+
detectedVia: z.ZodEnum<{
|
|
122
|
+
file_extension: "file_extension";
|
|
123
|
+
config_file: "config_file";
|
|
124
|
+
shebang: "shebang";
|
|
125
|
+
}>;
|
|
126
|
+
fileCount: z.ZodInt;
|
|
127
|
+
configFile: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
export type DetectedLanguage = z.infer<typeof DetectedLanguageSchema>;
|
|
130
|
+
//# sourceMappingURL=lsp-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-types.d.ts","sourceRoot":"","sources":["../../../src/core/lsp/lsp-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAM3B,eAAO,MAAM,qBAAqB;;;;;;;;;iBAShC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE,eAAO,MAAM,uBAAuB;;;;;;;iBAOlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;A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,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAM5D,eAAO,MAAM,sBAAsB;;;;;;;;;iBAEjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAMtE,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAK/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAMlE,eAAO,MAAM,sBAAsB;;;;;;;;;;iBAMjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LSP Multi-Language Integration — Zod Schemas & Types
|
|
3
|
+
*
|
|
4
|
+
* Defines all schemas for Language Server Protocol integration:
|
|
5
|
+
* server configuration, code locations, diagnostics, symbols,
|
|
6
|
+
* edits, server state, and language detection.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod/v4";
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// 1. LspServerConfigSchema — Configuration for a language server
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
export const LspServerConfigSchema = z.object({
|
|
13
|
+
languageId: z.string(),
|
|
14
|
+
extensions: z.array(z.string()),
|
|
15
|
+
command: z.string(),
|
|
16
|
+
args: z.array(z.string()),
|
|
17
|
+
configFiles: z.array(z.string()),
|
|
18
|
+
probeCommand: z.string().optional(),
|
|
19
|
+
initializationOptions: z.record(z.string(), z.unknown()).optional(),
|
|
20
|
+
settings: z.record(z.string(), z.unknown()).optional(),
|
|
21
|
+
});
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// 2. LspConfigOverrideSchema — User override for a server
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
export const LspConfigOverrideSchema = z.object({
|
|
26
|
+
languageId: z.string(),
|
|
27
|
+
command: z.string(),
|
|
28
|
+
args: z.array(z.string()).default([]),
|
|
29
|
+
extensions: z.array(z.string()).optional(),
|
|
30
|
+
initializationOptions: z.record(z.string(), z.unknown()).optional(),
|
|
31
|
+
settings: z.record(z.string(), z.unknown()).optional(),
|
|
32
|
+
});
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// 3. LspLocationSchema — A code location
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
export const LspLocationSchema = z.object({
|
|
37
|
+
file: z.string(),
|
|
38
|
+
startLine: z.int().min(0),
|
|
39
|
+
startCharacter: z.int().min(0),
|
|
40
|
+
endLine: z.int().min(0),
|
|
41
|
+
endCharacter: z.int().min(0),
|
|
42
|
+
});
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// 4. LspHoverResultSchema
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
export const LspHoverResultSchema = z.object({
|
|
47
|
+
signature: z.string(),
|
|
48
|
+
documentation: z.string().optional(),
|
|
49
|
+
language: z.string().optional(),
|
|
50
|
+
});
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
// 5. LspDiagnosticSeverity — const enum object
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
export const LspDiagnosticSeverity = {
|
|
55
|
+
Error: 1,
|
|
56
|
+
Warning: 2,
|
|
57
|
+
Information: 3,
|
|
58
|
+
Hint: 4,
|
|
59
|
+
};
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// 6. LspDiagnosticSchema
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
export const LspDiagnosticSchema = z.object({
|
|
64
|
+
file: z.string(),
|
|
65
|
+
startLine: z.int().min(0),
|
|
66
|
+
startCharacter: z.int().min(0),
|
|
67
|
+
endLine: z.int().min(0),
|
|
68
|
+
endCharacter: z.int().min(0),
|
|
69
|
+
severity: z.number().int().min(1).max(4),
|
|
70
|
+
message: z.string(),
|
|
71
|
+
code: z.string().optional(),
|
|
72
|
+
source: z.string().optional(),
|
|
73
|
+
});
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// 7. LspCallHierarchyItemSchema
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
export const LspCallHierarchyItemSchema = z.object({
|
|
78
|
+
name: z.string(),
|
|
79
|
+
kind: z.string(),
|
|
80
|
+
file: z.string(),
|
|
81
|
+
startLine: z.int().min(0),
|
|
82
|
+
endLine: z.int().min(0),
|
|
83
|
+
});
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// 8. LspDocumentSymbolSchema (recursive with optional children)
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
export const LspDocumentSymbolSchema = z.object({
|
|
88
|
+
name: z.string(),
|
|
89
|
+
kind: z.string(),
|
|
90
|
+
file: z.string(),
|
|
91
|
+
startLine: z.int().min(0),
|
|
92
|
+
endLine: z.int().min(0),
|
|
93
|
+
children: z.lazy(() => z.array(LspDocumentSymbolSchema)).optional(),
|
|
94
|
+
});
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// 9. LspTextEditSchema
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
export const LspTextEditSchema = z.object({
|
|
99
|
+
file: z.string(),
|
|
100
|
+
startLine: z.int().min(0),
|
|
101
|
+
startCharacter: z.int().min(0),
|
|
102
|
+
endLine: z.int().min(0),
|
|
103
|
+
endCharacter: z.int().min(0),
|
|
104
|
+
newText: z.string(),
|
|
105
|
+
});
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// 10. LspWorkspaceEditSchema
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
export const LspWorkspaceEditSchema = z.object({
|
|
110
|
+
changes: z.array(LspTextEditSchema),
|
|
111
|
+
});
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
// 11. LspServerStateSchema
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
export const LspServerStateSchema = z.object({
|
|
116
|
+
languageId: z.string(),
|
|
117
|
+
status: z.enum(["stopped", "starting", "ready", "error"]),
|
|
118
|
+
pid: z.number().int().optional(),
|
|
119
|
+
error: z.string().optional(),
|
|
120
|
+
});
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
// 12. DetectedLanguageSchema
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
export const DetectedLanguageSchema = z.object({
|
|
125
|
+
languageId: z.string(),
|
|
126
|
+
confidence: z.number().min(0).max(1),
|
|
127
|
+
detectedVia: z.enum(["file_extension", "config_file", "shebang"]),
|
|
128
|
+
fileCount: z.int().min(0),
|
|
129
|
+
configFile: z.string().optional(),
|
|
130
|
+
});
|
|
131
|
+
//# sourceMappingURL=lsp-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-types.js","sourceRoot":"","sources":["../../../src/core/lsp/lsp-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,8EAA8E;AAC9E,iEAAiE;AACjE,8EAA8E;AAE9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACzB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE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AAC,CAAC,gBAAgB,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;IACjE,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ServerRegistry — Registry of language server configurations.
|
|
3
|
+
*
|
|
4
|
+
* Manages 12 built-in language servers with extension routing,
|
|
5
|
+
* supports user overrides and custom language additions.
|
|
6
|
+
*/
|
|
7
|
+
import type { LspServerConfig, LspConfigOverride } from "./lsp-types.js";
|
|
8
|
+
export declare class ServerRegistry {
|
|
9
|
+
private servers;
|
|
10
|
+
private extensionMap;
|
|
11
|
+
constructor(overrides?: LspConfigOverride[]);
|
|
12
|
+
getConfigForLanguage(languageId: string): LspServerConfig | undefined;
|
|
13
|
+
getLanguageForExtension(ext: string): string | undefined;
|
|
14
|
+
getLanguageForFile(filePath: string): string | undefined;
|
|
15
|
+
getAllConfigs(): LspServerConfig[];
|
|
16
|
+
getSupportedExtensions(): string[];
|
|
17
|
+
private rebuildExtensionMap;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=server-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-registry.d.ts","sourceRoot":"","sources":["../../../src/core/lsp/server-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAiGzE,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,YAAY,CAAsB;gBAE9B,SAAS,CAAC,EAAE,iBAAiB,EAAE;IAyD3C,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIrE,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIxD,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IASxD,aAAa,IAAI,eAAe,EAAE;IAIlC,sBAAsB,IAAI,MAAM,EAAE;IAQlC,OAAO,CAAC,mBAAmB;CAQ5B"}
|