@context-engine-bridge/context-engine-mcp-bridge 0.0.43 → 0.0.45
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 +20 -10
package/package.json
CHANGED
package/src/mcpServer.js
CHANGED
|
@@ -187,7 +187,8 @@ async function _enrichWithLsp(result, lspConn, workspace) {
|
|
|
187
187
|
}
|
|
188
188
|
const target = _lspTarget(parsed);
|
|
189
189
|
if (!parsed.ok && !target.ok) return result;
|
|
190
|
-
|
|
190
|
+
const dest = target !== parsed ? target : parsed;
|
|
191
|
+
dest._lsp_status = await _resolveLspStatus(dest, target, lspConn, workspace);
|
|
191
192
|
textBlock.text = JSON.stringify(parsed);
|
|
192
193
|
return result;
|
|
193
194
|
} catch (err) {
|
|
@@ -1076,14 +1077,22 @@ async function createBridgeServer(options) {
|
|
|
1076
1077
|
tool.inputSchema = { ...tool.inputSchema, properties: { ...tool.inputSchema.properties, include_lsp: lspProp } };
|
|
1077
1078
|
}
|
|
1078
1079
|
if (tool.outputSchema) {
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1080
|
+
const lspFields = { _lsp_status: { type: "string" }, _lsp: { type: "object" } };
|
|
1081
|
+
const resultProp = tool.outputSchema.properties?.result;
|
|
1082
|
+
if (resultProp && resultProp.properties) {
|
|
1083
|
+
tool.outputSchema = {
|
|
1084
|
+
...tool.outputSchema,
|
|
1085
|
+
properties: {
|
|
1086
|
+
...tool.outputSchema.properties,
|
|
1087
|
+
result: { ...resultProp, properties: { ...resultProp.properties, ...lspFields } },
|
|
1088
|
+
},
|
|
1089
|
+
};
|
|
1090
|
+
} else {
|
|
1091
|
+
tool.outputSchema = {
|
|
1092
|
+
...tool.outputSchema,
|
|
1093
|
+
properties: { ...(tool.outputSchema.properties || {}), ...lspFields },
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1087
1096
|
}
|
|
1088
1097
|
}
|
|
1089
1098
|
|
|
@@ -1312,7 +1321,8 @@ async function createBridgeServer(options) {
|
|
|
1312
1321
|
const tb = Array.isArray(result?.content) && result.content.find(c => c.type === "text");
|
|
1313
1322
|
if (tb?.text) {
|
|
1314
1323
|
const p = JSON.parse(tb.text);
|
|
1315
|
-
|
|
1324
|
+
const d = _lspTarget(p);
|
|
1325
|
+
(d !== p ? d : p)._lsp_status = "not_available";
|
|
1316
1326
|
tb.text = JSON.stringify(p);
|
|
1317
1327
|
}
|
|
1318
1328
|
} catch (e) { debugLog("[ctxce] LSP not_available inject failed: " + String(e)); }
|