@softerist/heuristic-mcp 2.1.34 → 2.1.36

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.
@@ -93,6 +93,7 @@ function forceLog(message) {
93
93
  export async function register(filter = null) {
94
94
  const binaryPath = process.execPath; // The node binary
95
95
  const scriptPath = fileURLToPath(new URL('../index.js', import.meta.url)); // Absolute path to index.js
96
+ const currentIDE = detectCurrentIDE();
96
97
 
97
98
  // For Antigravity, we MUST use absolute path because ${workspaceFolder} variable expansion
98
99
  // is not supported in the current version, and '.' uses the wrong CWD.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softerist/heuristic-mcp",
3
- "version": "2.1.34",
3
+ "version": "2.1.36",
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",
@@ -12,8 +12,8 @@
12
12
  "dev": "node --watch index.js",
13
13
  "test": "vitest run",
14
14
  "test:watch": "vitest",
15
- "clear-cache": "node scripts/clear-cache.js",
16
- "postinstall": "node scripts/postinstall.js"
15
+ "clean": "node scripts/clear-cache.js",
16
+ "postinstall": "node scripts/postinstall.js && node scripts/download-model.js"
17
17
  },
18
18
  "keywords": [
19
19
  "mcp",
@@ -0,0 +1,32 @@
1
+
2
+ import { pipeline, env } from '@xenova/transformers';
3
+ import path from 'path';
4
+ import fs from 'fs';
5
+ import os from 'os';
6
+ import { getGlobalCacheDir } from '../lib/config.js';
7
+
8
+ // Force cache directory to global location
9
+ const globalCacheDir = path.join(getGlobalCacheDir(), 'xenova');
10
+ env.cacheDir = globalCacheDir;
11
+
12
+ console.log(`[Model Setup] Pre-caching model to: ${globalCacheDir}`);
13
+
14
+ async function downloadModel() {
15
+ try {
16
+ // Check if network is available by pinging HF (simple check)
17
+ // Actually, pipeline() will fail fast if network is down
18
+ console.log(`[Model Setup] Downloading 'Xenova/all-MiniLM-L6-v2'...`);
19
+
20
+ // This will download the model to the cache directory
21
+ await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');
22
+
23
+ console.log(`[Model Setup] ✅ Model cached successfully!`);
24
+ } catch (error) {
25
+ console.warn(`[Model Setup] ⚠️ Constructive warning: Failed to pre-download model.`);
26
+ console.warn(`[Model Setup] This is okay! The server will attempt to download it when started.`);
27
+ console.warn(`[Model Setup] Error details: ${error.message}`);
28
+ // Don't fail the install, just warn
29
+ }
30
+ }
31
+
32
+ downloadModel();