@softerist/heuristic-mcp 2.1.28 → 2.1.30
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 +23 -24
- package/package.json +1 -1
- package/scripts/postinstall.js +7 -4
package/features/register.js
CHANGED
|
@@ -30,63 +30,62 @@ function detectCurrentIDE() {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// Known config paths for different IDEs
|
|
33
|
-
function getConfigPaths(
|
|
33
|
+
function getConfigPaths() {
|
|
34
34
|
const platform = process.platform;
|
|
35
35
|
const home = os.homedir();
|
|
36
|
+
const currentIDE = detectCurrentIDE();
|
|
36
37
|
const allPaths = [];
|
|
37
38
|
|
|
38
|
-
// Antigravity
|
|
39
|
+
// Antigravity - dedicated mcp_config.json
|
|
39
40
|
allPaths.push({
|
|
40
41
|
name: 'Antigravity',
|
|
41
|
-
path: path.join(home, '.gemini', 'antigravity', 'mcp_config.json')
|
|
42
|
-
canCreate: true // Dedicated MCP config, safe to create
|
|
42
|
+
path: path.join(home, '.gemini', 'antigravity', 'mcp_config.json')
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
// Claude Desktop
|
|
45
|
+
// Claude Desktop - dedicated config file
|
|
46
46
|
if (platform === 'darwin') {
|
|
47
47
|
allPaths.push({
|
|
48
48
|
name: 'Claude Desktop',
|
|
49
|
-
path: path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
|
|
50
|
-
canCreate: true // Dedicated config file
|
|
49
|
+
path: path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
|
|
51
50
|
});
|
|
52
51
|
} else if (platform === 'win32') {
|
|
53
52
|
allPaths.push({
|
|
54
53
|
name: 'Claude Desktop',
|
|
55
|
-
path: path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json')
|
|
56
|
-
canCreate: true
|
|
54
|
+
path: path.join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json')
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
// Cursor
|
|
58
|
+
// Cursor - settings.json with mcpServers key
|
|
61
59
|
if (platform === 'darwin') {
|
|
62
60
|
allPaths.push({
|
|
63
61
|
name: 'Cursor',
|
|
64
|
-
path: path.join(home, 'Library', 'Application Support', 'Cursor', 'User', 'settings.json')
|
|
65
|
-
canCreate: false // Shared settings file, only update if exists
|
|
62
|
+
path: path.join(home, 'Library', 'Application Support', 'Cursor', 'User', 'settings.json')
|
|
66
63
|
});
|
|
67
64
|
} else if (platform === 'win32') {
|
|
68
65
|
allPaths.push({
|
|
69
66
|
name: 'Cursor',
|
|
70
|
-
path: path.join(process.env.APPDATA || '', 'Cursor', 'User', 'settings.json')
|
|
71
|
-
canCreate: false
|
|
67
|
+
path: path.join(process.env.APPDATA || '', 'Cursor', 'User', 'settings.json')
|
|
72
68
|
});
|
|
73
69
|
} else {
|
|
74
70
|
allPaths.push({
|
|
75
71
|
name: 'Cursor',
|
|
76
|
-
path: path.join(home, '.config', 'Cursor', 'User', 'settings.json')
|
|
77
|
-
canCreate: false
|
|
72
|
+
path: path.join(home, '.config', 'Cursor', 'User', 'settings.json')
|
|
78
73
|
});
|
|
79
74
|
}
|
|
80
75
|
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (currentIDE) {
|
|
85
|
-
return allPaths.filter(p => p.name === currentIDE);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
76
|
+
// CONSISTENT LOGIC:
|
|
77
|
+
// - If IDE is detected via env var → return ONLY that IDE, canCreate: true
|
|
78
|
+
// - If no IDE detected → return ALL, canCreate: false (only update existing configs)
|
|
88
79
|
|
|
89
|
-
|
|
80
|
+
if (currentIDE) {
|
|
81
|
+
// IDE detected - return only that IDE with permission to create
|
|
82
|
+
return allPaths
|
|
83
|
+
.filter(p => p.name === currentIDE)
|
|
84
|
+
.map(p => ({ ...p, canCreate: true }));
|
|
85
|
+
} else {
|
|
86
|
+
// No IDE detected - return all but don't create new configs
|
|
87
|
+
return allPaths.map(p => ({ ...p, canCreate: false }));
|
|
88
|
+
}
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
// Helper to force output to terminal, bypassing npm's silence
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softerist/heuristic-mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.30",
|
|
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",
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { register } from '../features/register.js';
|
|
2
2
|
|
|
3
|
-
// Run the registration process
|
|
3
|
+
// Run the registration process - MUST await to ensure file writes complete
|
|
4
4
|
console.log('[PostInstall] Running Heuristic MCP registration...');
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
await register();
|
|
8
|
+
console.log('[PostInstall] Registration complete.');
|
|
9
|
+
} catch (err) {
|
|
6
10
|
console.error('[PostInstall] Registration failed:', err.message);
|
|
7
11
|
// Don't fail the install if registration fails, just warn
|
|
8
|
-
|
|
9
|
-
});
|
|
12
|
+
}
|