local-mcp 1.44.1 → 1.44.3
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/download.js +8 -2
- package/index.js +17 -1
- package/package.json +1 -1
package/download.js
CHANGED
|
@@ -102,10 +102,16 @@ async function ensureRuntime() {
|
|
|
102
102
|
const pythonBin = path.join(versionDir, 'bin', 'python3')
|
|
103
103
|
const serverPath = path.join(versionDir, 'server.py')
|
|
104
104
|
|
|
105
|
-
// Ya está en cache
|
|
106
|
-
|
|
105
|
+
// Ya está en cache — verificar integridad básica (python313.zip requerido)
|
|
106
|
+
const zipPath = path.join(versionDir, 'lib', 'python313.zip')
|
|
107
|
+
if (fs.existsSync(pythonBin) && fs.existsSync(serverPath) && fs.existsSync(zipPath)) {
|
|
107
108
|
return { pythonBin, serverPath, runtimeDir: versionDir }
|
|
108
109
|
}
|
|
110
|
+
// Cache incompleto (falta zip u otros archivos) → limpiar y re-descargar
|
|
111
|
+
if (fs.existsSync(versionDir)) {
|
|
112
|
+
process.stderr.write(` Cache incompleto — re-descargando...\n`)
|
|
113
|
+
fs.rmSync(versionDir, { recursive: true, force: true })
|
|
114
|
+
}
|
|
109
115
|
|
|
110
116
|
process.stderr.write(`\nLocal MCP runtime v${version} no encontrado en cache.\n`)
|
|
111
117
|
process.stderr.write(`Descargando desde ${url}\n`)
|
package/index.js
CHANGED
|
@@ -84,14 +84,30 @@ async function main() {
|
|
|
84
84
|
|
|
85
85
|
const { pythonBin, serverPath, runtimeDir } = runtime
|
|
86
86
|
|
|
87
|
-
//
|
|
87
|
+
// Variables de entorno para el servidor Python
|
|
88
88
|
const frameworksPath = path.join(runtimeDir, 'Frameworks')
|
|
89
|
+
const libPath = path.join(runtimeDir, 'lib', 'python3.13')
|
|
89
90
|
const env = { ...process.env }
|
|
91
|
+
|
|
92
|
+
// Frameworks bundleados (libssl, libcrypto, liblzma, etc.)
|
|
90
93
|
if (require('fs').existsSync(frameworksPath)) {
|
|
91
94
|
env.DYLD_FRAMEWORK_PATH = frameworksPath + (env.DYLD_FRAMEWORK_PATH ? ':' + env.DYLD_FRAMEWORK_PATH : '')
|
|
92
95
|
env.DYLD_LIBRARY_PATH = frameworksPath + (env.DYLD_LIBRARY_PATH ? ':' + env.DYLD_LIBRARY_PATH : '')
|
|
93
96
|
}
|
|
94
97
|
|
|
98
|
+
// PYTHONHOME + PYTHONPATH para aislar el runtime del sistema
|
|
99
|
+
env.PYTHONHOME = runtimeDir
|
|
100
|
+
env.PYTHONNOUSERSITE = '1'
|
|
101
|
+
|
|
102
|
+
const sitePkgs = path.join(libPath, 'site-packages')
|
|
103
|
+
const libDynload = path.join(libPath, 'lib-dynload')
|
|
104
|
+
const zipLib = path.join(runtimeDir, 'lib', 'python313.zip')
|
|
105
|
+
const pyPaths = [zipLib, libPath, sitePkgs, libDynload]
|
|
106
|
+
.filter(p => require('fs').existsSync(p))
|
|
107
|
+
if (pyPaths.length > 0) {
|
|
108
|
+
env.PYTHONPATH = pyPaths.join(':') + (env.PYTHONPATH ? ':' + env.PYTHONPATH : '')
|
|
109
|
+
}
|
|
110
|
+
|
|
95
111
|
const extraArgs = process.argv.slice(cmd ? 2 : 3)
|
|
96
112
|
const result = spawnSync(pythonBin, [serverPath, 'stdio', ...extraArgs], {
|
|
97
113
|
stdio: 'inherit',
|
package/package.json
CHANGED