@softerist/heuristic-mcp 2.1.6 → 2.1.8
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/features/register.js +26 -13
- package/package.json +1 -1
package/features/register.js
CHANGED
|
@@ -56,6 +56,19 @@ function getConfigPaths() {
|
|
|
56
56
|
return paths;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
// Helper to force output to terminal, bypassing npm's silence
|
|
60
|
+
function forceLog(message) {
|
|
61
|
+
try {
|
|
62
|
+
if (process.platform !== 'win32') {
|
|
63
|
+
fs.writeFileSync('/dev/tty', message + '\n');
|
|
64
|
+
} else {
|
|
65
|
+
console.error(message);
|
|
66
|
+
}
|
|
67
|
+
} catch (e) {
|
|
68
|
+
console.error(message);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
59
72
|
export async function register(filter = null) {
|
|
60
73
|
const binaryPath = process.execPath; // The node binary
|
|
61
74
|
const scriptPath = fileURLToPath(new URL('../index.js', import.meta.url)); // Absolute path to index.js
|
|
@@ -70,7 +83,7 @@ export async function register(filter = null) {
|
|
|
70
83
|
const configPaths = getConfigPaths();
|
|
71
84
|
let registeredCount = 0;
|
|
72
85
|
|
|
73
|
-
|
|
86
|
+
forceLog(`[Auto-Register] Detecting IDE configurations...`);
|
|
74
87
|
|
|
75
88
|
for (const { name, path: configPath } of configPaths) {
|
|
76
89
|
if (filter && name.toLowerCase() !== filter.toLowerCase()) {
|
|
@@ -82,7 +95,7 @@ export async function register(filter = null) {
|
|
|
82
95
|
try {
|
|
83
96
|
await fs.access(configPath);
|
|
84
97
|
} catch {
|
|
85
|
-
|
|
98
|
+
// forceLog(`[Auto-Register] Skipped ${name}: Config file not found at ${configPath}`);
|
|
86
99
|
continue;
|
|
87
100
|
}
|
|
88
101
|
|
|
@@ -92,7 +105,7 @@ export async function register(filter = null) {
|
|
|
92
105
|
try {
|
|
93
106
|
config = JSON.parse(content);
|
|
94
107
|
} catch (e) {
|
|
95
|
-
|
|
108
|
+
forceLog(`[Auto-Register] Error parsing ${name} config: ${e.message}`);
|
|
96
109
|
continue;
|
|
97
110
|
}
|
|
98
111
|
|
|
@@ -106,31 +119,31 @@ export async function register(filter = null) {
|
|
|
106
119
|
|
|
107
120
|
// Write back
|
|
108
121
|
await fs.writeFile(configPath, JSON.stringify(config, null, 2));
|
|
109
|
-
|
|
122
|
+
forceLog(`\x1b[32m[Auto-Register] ✅ Successfully registered with ${name}\x1b[0m`);
|
|
110
123
|
registeredCount++;
|
|
111
124
|
|
|
112
125
|
} catch (err) {
|
|
113
|
-
|
|
126
|
+
forceLog(`[Auto-Register] Failed to register with ${name}: ${err.message}`);
|
|
114
127
|
}
|
|
115
128
|
}
|
|
116
129
|
|
|
117
130
|
if (registeredCount === 0) {
|
|
118
|
-
|
|
119
|
-
|
|
131
|
+
forceLog(`[Auto-Register] No compatible IDE configurations found to update.`);
|
|
132
|
+
forceLog(`[Auto-Register] Manual Config:\n${JSON.stringify({ mcpServers: { "heuristic-mcp": serverConfig } }, null, 2)}`);
|
|
120
133
|
} else {
|
|
121
|
-
// Friendly Banner
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
134
|
+
// Friendly Banner (Using forceLog to bypass npm stdout suppression)
|
|
135
|
+
forceLog('\n\x1b[36m' + '='.repeat(60));
|
|
136
|
+
forceLog(' 🚀 Heuristic MCP Installed & Configured! ');
|
|
137
|
+
forceLog('='.repeat(60) + '\x1b[0m');
|
|
138
|
+
forceLog(`
|
|
126
139
|
\x1b[33mACTION REQUIRED:\x1b[0m
|
|
127
140
|
1. \x1b[1mRestart your IDE\x1b[0m (or reload the window) to load the new config.
|
|
128
141
|
2. The server will start automatically in the background.
|
|
129
142
|
|
|
130
143
|
\x1b[32mSTATUS:\x1b[0m
|
|
144
|
+
- \x1b[1mConfig:\x1b[0m Updated ${registeredCount} config file(s).
|
|
131
145
|
- \x1b[1mIndexing:\x1b[0m Will begin immediately after restart.
|
|
132
146
|
- \x1b[1mUsage:\x1b[0m You can work while it indexes (it catches up!).
|
|
133
|
-
- \x1b[1mLogs:\x1b[0m Check your IDE's MCP logs if you are curious.
|
|
134
147
|
|
|
135
148
|
\x1b[36mHappy Coding! 🤖\x1b[0m
|
|
136
149
|
`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softerist/heuristic-mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.8",
|
|
4
4
|
"description": "An enhanced MCP server providing intelligent semantic code search with find-similar-code, recency ranking, and improved chunking. Fork of smart-coding-mcp.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|