magector 1.3.0 → 1.3.2
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/binary.js +20 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magector",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Semantic code search for Magento 2 — index, search, MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/mcp-server.js",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"ruvector": "^0.1.96"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@magector/cli-darwin-arm64": "1.3.
|
|
37
|
-
"@magector/cli-linux-x64": "1.3.
|
|
38
|
-
"@magector/cli-linux-arm64": "1.3.
|
|
39
|
-
"@magector/cli-win32-x64": "1.3.
|
|
36
|
+
"@magector/cli-darwin-arm64": "1.3.2",
|
|
37
|
+
"@magector/cli-linux-x64": "1.3.2",
|
|
38
|
+
"@magector/cli-linux-arm64": "1.3.2",
|
|
39
|
+
"@magector/cli-win32-x64": "1.3.2"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
42
42
|
"magento",
|
package/src/binary.js
CHANGED
|
@@ -40,7 +40,26 @@ export function resolveBinary() {
|
|
|
40
40
|
return binPath;
|
|
41
41
|
}
|
|
42
42
|
} catch {
|
|
43
|
-
// Package not installed —
|
|
43
|
+
// Package not installed — try to self-heal by installing it
|
|
44
|
+
try {
|
|
45
|
+
const pkgRoot = path.join(__dirname, '..');
|
|
46
|
+
execFileSync('npm', ['install', '--no-save', platformPkg], {
|
|
47
|
+
cwd: pkgRoot,
|
|
48
|
+
timeout: 60000,
|
|
49
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
50
|
+
});
|
|
51
|
+
// Retry resolution after install
|
|
52
|
+
const pkgDir = path.dirname(require.resolve(`${platformPkg}/package.json`));
|
|
53
|
+
const binPath = path.join(pkgDir, 'bin', BINARY_NAME);
|
|
54
|
+
if (existsSync(binPath)) {
|
|
55
|
+
if (process.platform !== 'win32') {
|
|
56
|
+
try { chmodSync(binPath, 0o755); } catch {}
|
|
57
|
+
}
|
|
58
|
+
return binPath;
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
// Self-heal failed — continue to other fallbacks
|
|
62
|
+
}
|
|
44
63
|
}
|
|
45
64
|
|
|
46
65
|
// 3. Dev fallback: local Rust build
|