local-mcp 1.133.0 → 1.135.0

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 (3) hide show
  1. package/download.js +46 -1
  2. package/package.json +1 -1
  3. package/setup.js +10 -0
package/download.js CHANGED
@@ -166,6 +166,51 @@ async function ensureRuntime() {
166
166
  return { pythonBin: binPath, serverPath: binPath, runtimeDir: versionDir, binPath }
167
167
  }
168
168
 
169
+ /**
170
+ * Descarga el co-proceso teams-proxy si no está instalado o es una versión diferente.
171
+ * El binary se instala en ~/.local/share/local-mcp/bin/teams-proxy
172
+ * @returns {Promise<string|null>} Ruta al binary, o null si falla
173
+ */
174
+ async function ensureTeamsProxy() {
175
+ const info = await getLatestBinary()
176
+ const version = info.version
177
+ const arch = process.arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64'
178
+ const binPath = path.join(CACHE_DIR, 'teams-proxy')
179
+ const verFile = path.join(CACHE_DIR, '.teams-proxy-version')
180
+
181
+ // Ya instalado y actualizado
182
+ if (fs.existsSync(binPath) && fs.existsSync(verFile)) {
183
+ if (fs.readFileSync(verFile, 'utf8').trim() === version) return binPath
184
+ }
185
+
186
+ const url = `https://download.local-mcp.com/teams-proxy-${version}-${arch}.tar.gz`
187
+ process.stderr.write(`\nDescargando teams-proxy v${version}...\n`)
188
+
189
+ fs.mkdirSync(CACHE_DIR, { recursive: true })
190
+ const tarPath = path.join(CACHE_DIR, `teams-proxy-${version}.tar.gz`)
191
+
192
+ try {
193
+ await downloadFile(url, tarPath)
194
+ const stat = fs.statSync(tarPath)
195
+ if (stat.size < 1000) { fs.unlinkSync(tarPath); throw new Error(`Descarga incompleta (${stat.size} bytes)`) }
196
+
197
+ execFileSync('tar', ['-xzf', tarPath, '-C', CACHE_DIR], { stdio: 'pipe' })
198
+ fs.unlinkSync(tarPath)
199
+
200
+ if (!fs.existsSync(binPath)) throw new Error('teams-proxy no encontrado tras extraer')
201
+ fs.chmodSync(binPath, 0o755)
202
+ try { execFileSync('codesign', ['--force', '--sign', '-', '--identifier', 'com.local-mcp.teams-proxy', binPath], { stdio: 'pipe' }) } catch { /* no crítico */ }
203
+
204
+ fs.writeFileSync(verFile, version, 'utf8')
205
+ process.stderr.write(` teams-proxy instalado en ${binPath}\n`)
206
+ return binPath
207
+ } catch (err) {
208
+ try { if (fs.existsSync(tarPath)) fs.unlinkSync(tarPath) } catch {}
209
+ process.stderr.write(` (teams-proxy no disponible: ${err.message})\n`)
210
+ return null
211
+ }
212
+ }
213
+
169
214
  /**
170
215
  * Descarga e instala el tray SwiftUI (menu bar app) — universal binary (arm64 + Intel).
171
216
  * @returns {Promise<string|null>} Ruta al .app instalado, o null si falla
@@ -266,4 +311,4 @@ function _writeTrayLaunchAgent(trayApp) {
266
311
  } catch { /* no crítico */ }
267
312
  }
268
313
 
269
- module.exports = { ensureBinary, ensureRuntime, ensureTray, CACHE_DIR, TRAY_DIR }
314
+ module.exports = { ensureBinary, ensureRuntime, ensureTray, ensureTeamsProxy, CACHE_DIR, TRAY_DIR }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "local-mcp",
3
- "version": "1.133.0",
3
+ "version": "1.135.0",
4
4
  "description": "MCP server for macOS — connect Claude Desktop, Cursor, Windsurf to Mail, Calendar, Contacts, Teams, OneDrive. Privacy-first: all data stays on your Mac.",
5
5
  "main": "index.js",
6
6
  "bin": {
package/setup.js CHANGED
@@ -172,11 +172,21 @@ async function runSetup(opts = {}) {
172
172
 
173
173
  // Instalar y lanzar el tray (menu bar app) — arm64 only, non-fatal
174
174
  await _installTray()
175
+ await _installTeamsProxy()
175
176
 
176
177
  // Ping de tracking (fire-and-forget, no bloquea)
177
178
  _pingInstall(configured, opts.method || 'setup')
178
179
  }
179
180
 
181
+ async function _installTeamsProxy() {
182
+ try {
183
+ const { ensureTeamsProxy } = require('./download')
184
+ await ensureTeamsProxy()
185
+ } catch (err) {
186
+ process.stderr.write(` (teams-proxy not available: ${err.message})\n`)
187
+ }
188
+ }
189
+
180
190
  async function _installTray() {
181
191
  try {
182
192
  const { ensureTray } = require('./download')