squeezr-ai 1.13.0 → 1.13.1

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/bin/squeezr.js CHANGED
@@ -113,12 +113,23 @@ function stopProxy() {
113
113
  const match = out.match(/LISTENING\s+(\d+)/)
114
114
  pid = match?.[1]
115
115
  } else {
116
- pid = execSync(`lsof -ti :${port}`, { encoding: 'utf-8', stdio: 'pipe' }).trim()
116
+ // Use -sTCP:LISTEN to get only the listening process, not connected clients.
117
+ // lsof may return multiple PIDs without this flag.
118
+ try {
119
+ pid = execSync(`lsof -ti :${port} -sTCP:LISTEN`, { encoding: 'utf-8', stdio: 'pipe' }).trim()
120
+ } catch {
121
+ // fallback: fuser (available on most Linux/WSL)
122
+ try {
123
+ pid = execSync(`fuser ${port}/tcp 2>/dev/null`, { encoding: 'utf-8', stdio: 'pipe' }).trim()
124
+ } catch {}
125
+ }
117
126
  }
118
127
  if (!pid) {
119
128
  console.log(`Squeezr is not running on port ${port}`)
120
129
  return
121
130
  }
131
+ // Take only the first PID in case multiple are returned
132
+ pid = pid.split(/\s+/)[0]
122
133
  if (process.platform === 'win32') {
123
134
  execSync(`taskkill /F /PID ${pid}`, { stdio: 'pipe' })
124
135
  } else {
@@ -261,6 +272,7 @@ function setupUnix() {
261
272
  `export ANTHROPIC_BASE_URL=http://localhost:${port}`,
262
273
  `export openai_base_url=http://localhost:${port}`,
263
274
  `export GEMINI_API_BASE_URL=http://localhost:${port}`,
275
+ `# squeezr MITM proxy for Codex (TLS interception)`,
264
276
  `export HTTPS_PROXY=http://localhost:${mitmPort}`,
265
277
  `export SSL_CERT_FILE=${bundlePath}`,
266
278
  `# squeezr auto-heal: start proxy if not running`,
@@ -281,13 +293,14 @@ function setupUnix() {
281
293
  fs.appendFileSync(profile, `\n${shellBlock}\n`)
282
294
  console.log(` [ok] Env vars + auto-heal added to ${profile}`)
283
295
  } else {
284
- if (!existing.includes('squeezr auto-heal')) {
296
+ if (!existing.includes('SSL_CERT_FILE') || !existing.includes('squeezr MITM')) {
297
+ // Re-write block to include MITM vars
285
298
  const updatedContent = existing.replace(
286
- /# squeezr env vars\n(?:export [A-Z_]+=http:\/\/localhost:\d+\n?)*/,
299
+ /# squeezr env vars[\s\S]*?fi\n/,
287
300
  shellBlock + '\n'
288
301
  )
289
302
  fs.writeFileSync(profile, updatedContent)
290
- console.log(` [ok] Auto-heal guard added to ${profile}`)
303
+ console.log(` [ok] Shell profile updated with MITM proxy vars`)
291
304
  } else {
292
305
  console.log(` [skip] Env vars + auto-heal already in ${profile}`)
293
306
  }
@@ -412,16 +425,16 @@ function setupWSL() {
412
425
  fs.appendFileSync(profile, `\n${shellBlock}\n`)
413
426
  console.log(` [ok] Env vars + auto-heal added to ${profile}`)
414
427
  } else {
415
- // Update existing block to include auto-heal if missing
416
- if (!existing.includes('squeezr auto-heal')) {
428
+ // Update existing block if missing MITM proxy vars
429
+ if (!existing.includes('SSL_CERT_FILE') || !existing.includes('HTTPS_PROXY')) {
417
430
  const updatedContent = existing.replace(
418
- /# squeezr env vars\n(?:export [A-Z_]+=http:\/\/localhost:\d+\n?)*/,
431
+ /# squeezr env vars[\s\S]*?fi\n/,
419
432
  shellBlock + '\n'
420
433
  )
421
434
  fs.writeFileSync(profile, updatedContent)
422
- console.log(` [ok] Auto-heal guard added to ${profile}`)
435
+ console.log(` [ok] Shell profile updated with MITM proxy vars`)
423
436
  } else {
424
- console.log(` [skip] Env vars + auto-heal already in ${profile}`)
437
+ console.log(` [skip] Env vars already in ${profile}`)
425
438
  }
426
439
  }
427
440
 
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.13.0";
1
+ export declare const VERSION = "1.13.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.13.0';
1
+ export const VERSION = '1.13.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squeezr-ai",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
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",