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 +22 -9
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
|
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\
|
|
299
|
+
/# squeezr env vars[\s\S]*?fi\n/,
|
|
287
300
|
shellBlock + '\n'
|
|
288
301
|
)
|
|
289
302
|
fs.writeFileSync(profile, updatedContent)
|
|
290
|
-
console.log(` [ok]
|
|
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
|
|
416
|
-
if (!existing.includes('
|
|
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\
|
|
431
|
+
/# squeezr env vars[\s\S]*?fi\n/,
|
|
419
432
|
shellBlock + '\n'
|
|
420
433
|
)
|
|
421
434
|
fs.writeFileSync(profile, updatedContent)
|
|
422
|
-
console.log(` [ok]
|
|
435
|
+
console.log(` [ok] Shell profile updated with MITM proxy vars`)
|
|
423
436
|
} else {
|
|
424
|
-
console.log(` [skip] Env vars
|
|
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.
|
|
1
|
+
export declare const VERSION = "1.13.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.13.
|
|
1
|
+
export const VERSION = '1.13.1';
|
package/package.json
CHANGED