@softerist/heuristic-mcp 2.1.37 → 2.1.39

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.
@@ -198,8 +198,25 @@ export async function logs() {
198
198
  console.log(` Indexing: ⚠️ INCOMPLETE or UNKNOWN`);
199
199
  }
200
200
 
201
- } catch (e) {
202
- console.log(` Status: Invalid or corrupted (${e.message})`);
201
+ } catch (err) {
202
+ if (err.code === 'ENOENT') {
203
+ // Meta file missing - check if directory is fresh (indexing in progress)
204
+ try {
205
+ const stats = await fs.stat(cacheDir);
206
+ const ageMs = new Date() - stats.mtime;
207
+ // If less than 10 minutes old, assume indexing
208
+ if (ageMs < 10 * 60 * 1000) {
209
+ console.log(` Status: ⏳ Initializing / Indexing in progress...`);
210
+ console.log(` (Metadata file has not been written yet using ID ${dir})`);
211
+ } else {
212
+ console.log(` Status: ⚠️ Incomplete cache (stale)`);
213
+ }
214
+ } catch {
215
+ console.log(` Status: ❌ Invalid cache directory`);
216
+ }
217
+ } else {
218
+ console.log(` Status: ❌ Invalid or corrupted (${err.message})`);
219
+ }
203
220
  }
204
221
  }
205
222
 
@@ -108,8 +108,8 @@ export async function register(filter = null) {
108
108
 
109
109
  // For Antigravity, we MUST use absolute path because ${workspaceFolder} variable expansion
110
110
  // is not supported in the current version, and '.' uses the wrong CWD.
111
- // For other IDEs, '.' is usually safer or they support variables.
112
- 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()) : '.';
113
113
 
114
114
  const serverConfig = {
115
115
  command: binaryPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softerist/heuristic-mcp",
3
- "version": "2.1.37",
3
+ "version": "2.1.39",
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",