@iceinvein/code-intelligence-mcp 0.1.2 → 0.1.5

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.
Files changed (2) hide show
  1. package/bin/run.js +29 -2
  2. package/package.json +1 -1
package/bin/run.js CHANGED
@@ -32,7 +32,12 @@ if (!env.EMBEDDINGS_AUTO_DOWNLOAD) {
32
32
  env.EMBEDDINGS_AUTO_DOWNLOAD = 'true';
33
33
  }
34
34
 
35
- // 4. Metal Acceleration for macOS
35
+ // 4. Set Better Default Model (Jina V2 Base Code)
36
+ if (!env.EMBEDDINGS_MODEL_REPO) {
37
+ env.EMBEDDINGS_MODEL_REPO = 'jinaai/jina-embeddings-v2-base-code';
38
+ }
39
+
40
+ // 5. Metal Acceleration for macOS
36
41
  if (os.platform() === 'darwin' && !env.EMBEDDINGS_DEVICE) {
37
42
  env.EMBEDDINGS_DEVICE = 'metal';
38
43
  } else if (!env.EMBEDDINGS_DEVICE) {
@@ -42,11 +47,33 @@ if (os.platform() === 'darwin' && !env.EMBEDDINGS_DEVICE) {
42
47
  // 5. Set persistence paths to be inside the project (BASE_DIR/.cimcp)
43
48
  // if not explicitly overridden. This keeps indexes local to the project.
44
49
  const cimcpDir = path.join(env.BASE_DIR, '.cimcp');
50
+
51
+ // Ensure .cimcp directory exists
52
+ if (!fs.existsSync(cimcpDir)) {
53
+ try {
54
+ fs.mkdirSync(cimcpDir, { recursive: true });
55
+ } catch (e) {
56
+ console.error(`Failed to create .cimcp directory at ${cimcpDir}:`, e.message);
57
+ // Continue, the server might handle it or fail later
58
+ }
59
+ }
60
+
45
61
  if (!env.DB_PATH) env.DB_PATH = path.join(cimcpDir, 'code-intelligence.db');
46
62
  if (!env.VECTOR_DB_PATH) env.VECTOR_DB_PATH = path.join(cimcpDir, 'vectors');
47
63
  if (!env.TANTIVY_INDEX_PATH) env.TANTIVY_INDEX_PATH = path.join(cimcpDir, 'tantivy-index');
64
+
48
65
  // Also set model dir to local project cache if not set globally
49
- if (!env.EMBEDDINGS_MODEL_DIR) env.EMBEDDINGS_MODEL_DIR = path.join(cimcpDir, 'embeddings-model');
66
+ if (!env.EMBEDDINGS_MODEL_DIR) {
67
+ env.EMBEDDINGS_MODEL_DIR = path.join(cimcpDir, 'embeddings-model');
68
+ // Ensure model dir exists, otherwise the Rust server might complain
69
+ if (!fs.existsSync(env.EMBEDDINGS_MODEL_DIR)) {
70
+ try {
71
+ fs.mkdirSync(env.EMBEDDINGS_MODEL_DIR, { recursive: true });
72
+ } catch (e) {
73
+ console.error(`Failed to create embeddings directory at ${env.EMBEDDINGS_MODEL_DIR}:`, e.message);
74
+ }
75
+ }
76
+ }
50
77
 
51
78
  // Spawn the process
52
79
  const child = spawn(BINARY_PATH, process.argv.slice(2), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iceinvein/code-intelligence-mcp",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "description": "Code Intelligence MCP Server - Smart context for your LLM coding agent",
5
5
  "bin": {
6
6
  "code-intelligence-mcp": "bin/run.js"