hac-mcp 1.0.2 → 1.0.4
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/server.js +9 -9
- package/tools/flexible_search.js +4 -2
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -238,14 +238,13 @@ createServer(app).listen(PORT, () => {
|
|
|
238
238
|
bold: '\x1b[1m',
|
|
239
239
|
dim: '\x1b[2m',
|
|
240
240
|
green: '\x1b[32m',
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
} : { reset: '', bold: '', dim: '', green: '', cyan: '', white: '' };
|
|
241
|
+
blue: '\x1b[34m',
|
|
242
|
+
} : { reset: '', bold: '', dim: '', green: '', blue: '' };
|
|
244
243
|
|
|
245
244
|
// helpers
|
|
246
245
|
const label = s => `${c.dim}${s}${c.reset}`;
|
|
247
|
-
const value = s => `${c.
|
|
248
|
-
const heading = s => `${c.bold}${
|
|
246
|
+
const value = s => `${c.blue}${s}${c.reset}`;
|
|
247
|
+
const heading = s => `${c.bold}${s}${c.reset}`;
|
|
249
248
|
const code = s => `${c.green}${s}${c.reset}`;
|
|
250
249
|
|
|
251
250
|
console.log('');
|
|
@@ -265,12 +264,13 @@ createServer(app).listen(PORT, () => {
|
|
|
265
264
|
console.log(` ${heading('Other MCP Clients')}`);
|
|
266
265
|
console.log(` ${label('Add the following to your MCP client config:')}`);
|
|
267
266
|
console.log('');
|
|
268
|
-
console.log(` ${
|
|
269
|
-
console.log(` ${
|
|
267
|
+
console.log(` ${code('{')}`);
|
|
268
|
+
console.log(` ${code(' "mcpServers": {')}`);
|
|
270
269
|
console.log(` ${code(' "hac-mcp": {')}`);
|
|
271
270
|
console.log(` ${code(` "url": "${base}/mcp/sse"`)}`);
|
|
272
271
|
console.log(` ${code(' }')}`);
|
|
273
|
-
console.log(` ${
|
|
274
|
-
console.log(` ${
|
|
272
|
+
console.log(` ${code(' }')}`);
|
|
273
|
+
console.log(` ${code('}')}`);
|
|
274
|
+
|
|
275
275
|
console.log('');
|
|
276
276
|
});
|
package/tools/flexible_search.js
CHANGED
|
@@ -20,7 +20,9 @@ function parseFlexSearchError(msg) {
|
|
|
20
20
|
|
|
21
21
|
function parseUnknownTypeError(msg) {
|
|
22
22
|
if (!msg) return null;
|
|
23
|
-
const m = msg.match(/unknown type[:\s]+'?(\w+)'?/i)
|
|
23
|
+
const m = msg.match(/unknown type[:\s]+'?(\w+)'?/i)
|
|
24
|
+
|| msg.match(/[Tt]he type '(\w+)' is unknown/)
|
|
25
|
+
|| msg.match(/type code '(\w+)' invalid/i);
|
|
24
26
|
return m?.[1] ?? null;
|
|
25
27
|
}
|
|
26
28
|
|
|
@@ -124,7 +126,7 @@ export const tool = {
|
|
|
124
126
|
let detail = `Unknown type "${unknownType}".`;
|
|
125
127
|
try {
|
|
126
128
|
const types = await getTypeIndex(env);
|
|
127
|
-
const suggestions = fuzzySearch(unknownType, types, { topN:
|
|
129
|
+
const suggestions = fuzzySearch(unknownType, types, { topN: 10 });
|
|
128
130
|
if (suggestions.length) detail += ` Did you mean: ${suggestions.join(', ')}?`;
|
|
129
131
|
} catch (_) {}
|
|
130
132
|
mcpLog({ tool: TOOL, envName: env.name, preview: 'Query error', detail, isError: true, runId });
|