@context-engine-bridge/context-engine-mcp-bridge 0.0.50 → 0.0.52
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/package.json +1 -1
- package/src/mcpServer.js +15 -4
package/package.json
CHANGED
package/src/mcpServer.js
CHANGED
|
@@ -190,6 +190,13 @@ async function _enrichWithLsp(result, lspConn, workspace) {
|
|
|
190
190
|
const dest = target !== parsed ? target : parsed;
|
|
191
191
|
dest._lsp_status = await _resolveLspStatus(dest, target, lspConn, workspace);
|
|
192
192
|
textBlock.text = JSON.stringify(parsed);
|
|
193
|
+
if (result.structuredContent && typeof result.structuredContent === "object") {
|
|
194
|
+
const sc = result.structuredContent;
|
|
195
|
+
const scTarget = _lspTarget(sc);
|
|
196
|
+
const scDest = scTarget !== sc ? scTarget : sc;
|
|
197
|
+
scDest._lsp_status = dest._lsp_status;
|
|
198
|
+
if (dest._lsp) scDest._lsp = dest._lsp;
|
|
199
|
+
}
|
|
193
200
|
return result;
|
|
194
201
|
} catch (err) {
|
|
195
202
|
debugLog("[ctxce] LSP enrichment failed: " + String(err));
|
|
@@ -1310,25 +1317,29 @@ async function createBridgeServer(options) {
|
|
|
1310
1317
|
undefined,
|
|
1311
1318
|
{ timeout: timeoutMs },
|
|
1312
1319
|
);
|
|
1313
|
-
const finalResult = maybeRemapToolResult(name, result, workspace);
|
|
1314
1320
|
const lspConn = includeLsp && _readLspConnection(workspace);
|
|
1315
1321
|
if (includeLsp) {
|
|
1316
1322
|
debugLog("[ctxce] LSP gate: tool=" + name + " lsp=" + (lspConn ? "port:" + lspConn.port : "null"));
|
|
1317
1323
|
}
|
|
1318
1324
|
if (lspConn) {
|
|
1319
|
-
|
|
1325
|
+
result = await _enrichWithLsp(result, lspConn, workspace);
|
|
1320
1326
|
} else if (includeLsp) {
|
|
1321
1327
|
try {
|
|
1322
|
-
const tb = Array.isArray(
|
|
1328
|
+
const tb = Array.isArray(result?.content) && result.content.find(c => c.type === "text");
|
|
1323
1329
|
if (tb?.text) {
|
|
1324
1330
|
const p = JSON.parse(tb.text);
|
|
1325
1331
|
const d = _lspTarget(p);
|
|
1326
1332
|
(d !== p ? d : p)._lsp_status = "not_available";
|
|
1327
1333
|
tb.text = JSON.stringify(p);
|
|
1334
|
+
if (result.structuredContent && typeof result.structuredContent === "object") {
|
|
1335
|
+
const sc = result.structuredContent;
|
|
1336
|
+
const scD = _lspTarget(sc);
|
|
1337
|
+
(scD !== sc ? scD : sc)._lsp_status = "not_available";
|
|
1338
|
+
}
|
|
1328
1339
|
}
|
|
1329
1340
|
} catch (e) { debugLog("[ctxce] LSP not_available inject failed: " + String(e)); }
|
|
1330
1341
|
}
|
|
1331
|
-
return
|
|
1342
|
+
return maybeRemapToolResult(name, result, workspace);
|
|
1332
1343
|
} catch (err) {
|
|
1333
1344
|
lastError = err;
|
|
1334
1345
|
|