squeezr-ai 1.17.11 → 1.17.12

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/squeezr.js +33 -23
  2. package/package.json +1 -1
package/bin/squeezr.js CHANGED
@@ -248,6 +248,7 @@ async function startDaemon() {
248
248
  console.log(`Squeezr is already running (v${pkg.version})`)
249
249
  console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${port}`)
250
250
  console.log(` MITM proxy (Codex): http://localhost:${mitmPort}`)
251
+ console.log(` Dashboard: http://localhost:${port}/squeezr/dashboard`)
251
252
  return
252
253
  }
253
254
  // Version mismatch — old process from before npm update. Kill and restart.
@@ -275,6 +276,7 @@ async function startDaemon() {
275
276
  console.log(`Squeezr started (pid ${child.pid})`)
276
277
  console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${port}`)
277
278
  console.log(` MITM proxy (Codex): http://localhost:${mitmPort}`)
279
+ console.log(` Dashboard: http://localhost:${port}/squeezr/dashboard`)
278
280
  console.log(` Logs: ${logFile}`)
279
281
 
280
282
  }
@@ -296,6 +298,20 @@ function showLogs() {
296
298
  console.log(tail.join('\n'))
297
299
  }
298
300
 
301
+ function killMcpProcesses() {
302
+ if (process.platform === 'win32') {
303
+ try {
304
+ execSync(
305
+ `powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter \\"name='node.exe'\\" | Where-Object { $_.CommandLine -like '*squeezr*mcp*' -or $_.CommandLine -like '*mcp.js*' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }"`,
306
+ { stdio: 'pipe' }
307
+ )
308
+ } catch {}
309
+ } else {
310
+ try { execSync(`pkill -f 'squeezr.*mcp' 2>/dev/null`, { stdio: 'pipe' }) } catch {}
311
+ try { execSync(`pkill -f 'mcp\\.js' 2>/dev/null`, { stdio: 'pipe' }) } catch {}
312
+ }
313
+ }
314
+
299
315
  function stopProxy() {
300
316
  const port = getPort()
301
317
  const mitmPort = getMitmPort(port)
@@ -332,6 +348,10 @@ function stopProxy() {
332
348
  }
333
349
  } catch {}
334
350
  }
351
+
352
+ // Also stop the MCP server process
353
+ killMcpProcesses()
354
+
335
355
  // Clear HTTPS_PROXY so npm and other tools don't try to use the dead proxy
336
356
  if (process.platform === 'win32') {
337
357
  try { execSync('setx HTTPS_PROXY ""', { stdio: 'pipe' }) } catch {}
@@ -344,8 +364,6 @@ function stopProxy() {
344
364
 
345
365
  if (killed) {
346
366
  console.log(`Squeezr stopped`)
347
- console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${port}`)
348
- console.log(` MITM proxy (Codex): http://localhost:${mitmPort}`)
349
367
  } else {
350
368
  console.log(`Squeezr is not running`)
351
369
  }
@@ -364,6 +382,7 @@ async function checkStatus() {
364
382
  console.log(`Squeezr is running (v${json.version})`)
365
383
  console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${port}`)
366
384
  console.log(` MITM proxy (Codex): http://localhost:${mitmPort}`)
385
+ console.log(` Dashboard: http://localhost:${port}/squeezr/dashboard`)
367
386
  } catch {
368
387
  console.log(`Squeezr is running on port ${port}`)
369
388
  }
@@ -507,7 +526,8 @@ async function configurePorts() {
507
526
 
508
527
  console.log(`\nCurrent ports:`)
509
528
  console.log(` HTTP proxy (Claude/Aider/Gemini): ${currentPort}`)
510
- console.log(` MITM proxy (Codex): ${currentMitm}\n`)
529
+ console.log(` MITM proxy (Codex): ${currentMitm}`)
530
+ console.log(` Dashboard: ${currentPort}/squeezr/dashboard (same port as proxy)\n`)
511
531
 
512
532
  const newPort = await ask(`HTTP proxy port [${currentPort}]: `)
513
533
  const newMitm = await ask(`MITM proxy port [${currentMitm}]: `)
@@ -720,7 +740,11 @@ async function uninstall() {
720
740
  } catch {}
721
741
  }
722
742
 
723
- // 8. npm uninstall -g (clear HTTPS_PROXY first so npm doesn't hit dead proxy)
743
+ // 8. Remove MCP registrations
744
+ console.log(' [..] Removing MCP registrations...')
745
+ try { await mcpUninstall() } catch {}
746
+
747
+ // 9. npm uninstall -g (clear HTTPS_PROXY first so npm doesn't hit dead proxy)
724
748
  console.log(' [..] Uninstalling npm package...')
725
749
  const cleanEnv = { ...process.env, HTTPS_PROXY: '', https_proxy: '', HTTP_PROXY: '', http_proxy: '' }
726
750
  try {
@@ -1369,22 +1393,9 @@ switch (command) {
1369
1393
  case 'update':
1370
1394
  await (async () => {
1371
1395
  console.log('Stopping Squeezr...')
1372
- stopProxy()
1373
- // Also kill anything on the ports by brute force
1374
- const uPort = getPort()
1375
- const uMitmPort = getMitmPort(uPort)
1376
- if (process.platform === 'win32') {
1377
- try { execSync(`for /f "tokens=5" %a in ('netstat -ano ^| findstr ":${uPort} " ^| findstr LISTENING') do taskkill /F /PID %a`, { stdio: 'pipe', shell: 'cmd.exe' }) } catch {}
1378
- try { execSync(`for /f "tokens=5" %a in ('netstat -ano ^| findstr ":${uMitmPort} " ^| findstr LISTENING') do taskkill /F /PID %a`, { stdio: 'pipe', shell: 'cmd.exe' }) } catch {}
1379
- // Kill squeezr-mcp (Claude Code MCP server) — it holds dist/mcp.js locked on Windows
1380
- console.log('Releasing file locks...')
1381
- try { execSync(`wmic process where "commandline like '%squeezr-ai%dist%mcp%'" call terminate`, { stdio: 'pipe', shell: 'cmd.exe' }) } catch {}
1382
- try { execSync(`wmic process where "commandline like '%-mcp.js%'" call terminate`, { stdio: 'pipe', shell: 'cmd.exe' }) } catch {}
1383
- try { execSync(`wmic process where "commandline like '%squeezr-mcp%'" call terminate`, { stdio: 'pipe', shell: 'cmd.exe' }) } catch {}
1384
- } else {
1385
- try { execSync(`kill -9 $(lsof -ti:${uPort}) 2>/dev/null`, { stdio: 'pipe' }) } catch {}
1386
- try { execSync(`kill -9 $(lsof -ti:${uMitmPort}) 2>/dev/null`, { stdio: 'pipe' }) } catch {}
1387
- }
1396
+ stopProxy() // also kills MCP via killMcpProcesses()
1397
+ console.log('Releasing file locks...')
1398
+ killMcpProcesses() // double-kill in case stopProxy was too fast
1388
1399
  await new Promise(r => setTimeout(r, 2000))
1389
1400
 
1390
1401
  console.log('Installing latest version...')
@@ -1400,9 +1411,7 @@ switch (command) {
1400
1411
  if ((msg.includes('EBUSY') || msg.includes('EPERM')) && attempt < 4) {
1401
1412
  console.log(` Files still locked, retrying in 3s (attempt ${attempt}/4)...`)
1402
1413
  // Try harder to release locks on retry
1403
- if (process.platform === 'win32') {
1404
- try { execSync(`wmic process where "commandline like '%squeezr-ai%'" call terminate`, { stdio: 'pipe', shell: 'cmd.exe' }) } catch {}
1405
- }
1414
+ killMcpProcesses()
1406
1415
  await new Promise(r => setTimeout(r, 3000))
1407
1416
  } else if (!msg.includes('EBUSY') && !msg.includes('EPERM') && process.platform !== 'win32') {
1408
1417
  // On Unix, try sudo as fallback (not useful on Windows)
@@ -1462,6 +1471,7 @@ switch (command) {
1462
1471
  console.log(`Squeezr started (pid ${child.pid})`)
1463
1472
  console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${startPort}`)
1464
1473
  console.log(` MITM proxy (Codex): http://localhost:${startMitmPort}`)
1474
+ console.log(` Dashboard: http://localhost:${startPort}/squeezr/dashboard`)
1465
1475
  console.log(` Logs: ${logFile}`)
1466
1476
 
1467
1477
  // Ensure PowerShell wrapper is installed (so env vars refresh automatically)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squeezr-ai",
3
- "version": "1.17.11",
3
+ "version": "1.17.12",
4
4
  "description": "AI proxy that compresses Claude Code, Codex, Aider, Gemini CLI and Ollama context windows to save thousands of tokens per session",
5
5
  "keywords": [
6
6
  "claude",