magector 1.2.7 → 1.2.8
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/package.json +5 -5
- package/src/mcp-server.js +10 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magector",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Semantic code search for Magento 2 — index, search, MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/mcp-server.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"ruvector": "^0.1.96"
|
|
32
32
|
},
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"@magector/cli-darwin-arm64": "1.2.
|
|
35
|
-
"@magector/cli-linux-x64": "1.2.
|
|
36
|
-
"@magector/cli-linux-arm64": "1.2.
|
|
37
|
-
"@magector/cli-win32-x64": "1.2.
|
|
34
|
+
"@magector/cli-darwin-arm64": "1.2.8",
|
|
35
|
+
"@magector/cli-linux-x64": "1.2.8",
|
|
36
|
+
"@magector/cli-linux-arm64": "1.2.8",
|
|
37
|
+
"@magector/cli-win32-x64": "1.2.8"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
40
|
"magento",
|
package/src/mcp-server.js
CHANGED
|
@@ -40,6 +40,13 @@ const config = {
|
|
|
40
40
|
|
|
41
41
|
// ─── Rust Core Integration ──────────────────────────────────────
|
|
42
42
|
|
|
43
|
+
// Env vars to suppress ONNX Runtime native logs that would pollute stdout/JSON-RPC
|
|
44
|
+
const rustEnv = {
|
|
45
|
+
...process.env,
|
|
46
|
+
ORT_LOG_LEVEL: 'error',
|
|
47
|
+
RUST_LOG: 'error',
|
|
48
|
+
};
|
|
49
|
+
|
|
43
50
|
function rustSearch(query, limit = 10) {
|
|
44
51
|
const result = execFileSync(config.rustBinary, [
|
|
45
52
|
'search', query,
|
|
@@ -47,7 +54,7 @@ function rustSearch(query, limit = 10) {
|
|
|
47
54
|
'-c', config.modelCache,
|
|
48
55
|
'-l', String(limit),
|
|
49
56
|
'-f', 'json'
|
|
50
|
-
], { encoding: 'utf-8', timeout: 30000, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
57
|
+
], { encoding: 'utf-8', timeout: 30000, stdio: ['pipe', 'pipe', 'pipe'], env: rustEnv });
|
|
51
58
|
return JSON.parse(result);
|
|
52
59
|
}
|
|
53
60
|
|
|
@@ -57,7 +64,7 @@ function rustIndex(magentoRoot) {
|
|
|
57
64
|
'-m', magentoRoot,
|
|
58
65
|
'-d', config.dbPath,
|
|
59
66
|
'-c', config.modelCache
|
|
60
|
-
], { encoding: 'utf-8', timeout: 600000, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
67
|
+
], { encoding: 'utf-8', timeout: 600000, stdio: ['pipe', 'pipe', 'pipe'], env: rustEnv });
|
|
61
68
|
return result;
|
|
62
69
|
}
|
|
63
70
|
|
|
@@ -65,7 +72,7 @@ function rustStats() {
|
|
|
65
72
|
const result = execFileSync(config.rustBinary, [
|
|
66
73
|
'stats',
|
|
67
74
|
'-d', config.dbPath
|
|
68
|
-
], { encoding: 'utf-8', timeout: 10000, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
75
|
+
], { encoding: 'utf-8', timeout: 10000, stdio: ['pipe', 'pipe', 'pipe'], env: rustEnv });
|
|
69
76
|
// Parse text output: "Total vectors: N" and "Embedding dim: N"
|
|
70
77
|
const vectors = result.match(/Total vectors:\s*(\d+)/)?.[1] || '0';
|
|
71
78
|
const dim = result.match(/Embedding dim:\s*(\d+)/)?.[1] || '384';
|