@softerist/heuristic-mcp 2.1.36 → 2.1.38

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.
@@ -1,5 +1,6 @@
1
1
  import fs from 'fs/promises';
2
- import { writeFileSync } from 'fs';
2
+ import { writeFileSync, existsSync, statSync } from 'fs';
3
+
3
4
  import path from 'path';
4
5
  import os from 'os';
5
6
  import { fileURLToPath } from 'url';
@@ -14,10 +15,20 @@ function detectCurrentIDE() {
14
15
  if (process.env.CURSOR_AGENT) {
15
16
  return 'Cursor';
16
17
  }
18
+
19
+ // Fallback: Check for Antigravity directory presence
20
+ try {
21
+ const agPath = path.join(os.homedir(), '.gemini', 'antigravity');
22
+ if (existsSync(agPath) || (statSync && statSync(agPath).isDirectory())) {
23
+ return 'Antigravity';
24
+ }
25
+ } catch (e) {}
26
+
17
27
  // Claude Desktop doesn't have a known env var, so we rely on existing config detection
18
28
  return null;
19
29
  }
20
30
 
31
+
21
32
  // Known config paths for different IDEs
22
33
  function getConfigPaths() {
23
34
  const platform = process.platform;
@@ -97,8 +108,8 @@ export async function register(filter = null) {
97
108
 
98
109
  // For Antigravity, we MUST use absolute path because ${workspaceFolder} variable expansion
99
110
  // is not supported in the current version, and '.' uses the wrong CWD.
100
- // For other IDEs, '.' is usually safer or they support variables.
101
- const workspacePath = currentIDE === 'Antigravity' ? process.cwd() : '.';
111
+ // Use INIT_CWD (where npm install was run) if available, otherwise cwd.
112
+ const workspacePath = currentIDE === 'Antigravity' ? (process.env.INIT_CWD || process.cwd()) : '.';
102
113
 
103
114
  const serverConfig = {
104
115
  command: binaryPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softerist/heuristic-mcp",
3
- "version": "2.1.36",
3
+ "version": "2.1.38",
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",