squeezr-ai 1.14.0 → 1.14.2
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 +43 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/bin/squeezr.js
CHANGED
|
@@ -190,10 +190,16 @@ function setupWindows() {
|
|
|
190
190
|
console.log('Setting up Squeezr for Windows...\n')
|
|
191
191
|
|
|
192
192
|
// 1. Set env vars permanently via setx (user scope, no admin needed)
|
|
193
|
+
const port = process.env.SQUEEZR_PORT || 8080
|
|
194
|
+
const mitmPort = Number(port) + 1
|
|
195
|
+
const caPath = path.join(os.homedir(), '.squeezr', 'mitm-ca', 'ca.crt')
|
|
193
196
|
const vars = {
|
|
194
|
-
ANTHROPIC_BASE_URL:
|
|
195
|
-
openai_base_url:
|
|
196
|
-
GEMINI_API_BASE_URL:
|
|
197
|
+
ANTHROPIC_BASE_URL: `http://localhost:${port}`,
|
|
198
|
+
openai_base_url: `http://localhost:${port}`,
|
|
199
|
+
GEMINI_API_BASE_URL: `http://localhost:${port}`,
|
|
200
|
+
HTTPS_PROXY: `http://localhost:${mitmPort}`,
|
|
201
|
+
// Node.js does NOT use the Windows Certificate Store — this makes Codex (Node.js) trust the MITM CA
|
|
202
|
+
NODE_EXTRA_CA_CERTS: caPath,
|
|
197
203
|
}
|
|
198
204
|
for (const [key, value] of Object.entries(vars)) {
|
|
199
205
|
try {
|
|
@@ -277,18 +283,49 @@ function setupWindows() {
|
|
|
277
283
|
console.log(` [ok] Squeezr started in background (pid ${child.pid})`)
|
|
278
284
|
console.log(` [ok] Logs → ${logFile}`)
|
|
279
285
|
|
|
280
|
-
|
|
286
|
+
// 4. Trust MITM CA in Windows Certificate Store (for native apps like browsers)
|
|
287
|
+
// Node.js apps (Codex) use NODE_EXTRA_CA_CERTS set above instead.
|
|
288
|
+
// The CA is generated on first proxy start — wait briefly for it to appear
|
|
289
|
+
const waitForCa = (retries = 10, interval = 500) => new Promise(resolve => {
|
|
290
|
+
const check = (n) => {
|
|
291
|
+
if (fs.existsSync(caPath)) return resolve(true)
|
|
292
|
+
if (n <= 0) return resolve(false)
|
|
293
|
+
setTimeout(() => check(n - 1), interval)
|
|
294
|
+
}
|
|
295
|
+
check(retries)
|
|
296
|
+
})
|
|
297
|
+
|
|
298
|
+
waitForCa().then(found => {
|
|
299
|
+
if (!found) {
|
|
300
|
+
console.log(` [warn] MITM CA not found yet — run 'squeezr setup' again after first start`)
|
|
301
|
+
printDone()
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
try {
|
|
305
|
+
execSync(`certutil -addstore -f Root "${caPath}"`, { stdio: 'pipe' })
|
|
306
|
+
console.log(` [ok] MITM CA trusted in Windows Certificate Store (Codex TLS interception ready)`)
|
|
307
|
+
} catch {
|
|
308
|
+
console.log(` [warn] Could not trust MITM CA — run as Administrator or trust manually:`)
|
|
309
|
+
console.log(` certutil -addstore -f Root "${caPath}"`)
|
|
310
|
+
}
|
|
311
|
+
printDone()
|
|
312
|
+
})
|
|
313
|
+
|
|
314
|
+
function printDone() {
|
|
315
|
+
console.log(`
|
|
281
316
|
Done!
|
|
282
317
|
|
|
283
|
-
Squeezr is running on http://localhost
|
|
318
|
+
Squeezr is running on http://localhost:${port}
|
|
319
|
+
MITM proxy on http://localhost:${mitmPort} (Codex TLS interception)
|
|
284
320
|
All CLIs (Claude Code, Codex, Aider, Gemini, Ollama) are configured.
|
|
285
321
|
|
|
286
|
-
Restart your terminal
|
|
322
|
+
Restart your terminal once for the env vars to take effect.
|
|
287
323
|
After that, everything is automatic — Squeezr starts silently on every login.
|
|
288
324
|
|
|
289
325
|
squeezr status — check it's running
|
|
290
326
|
squeezr gain — see token savings
|
|
291
327
|
`)
|
|
328
|
+
}
|
|
292
329
|
}
|
|
293
330
|
|
|
294
331
|
function setupUnix() {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.14.
|
|
1
|
+
export declare const VERSION = "1.14.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.14.
|
|
1
|
+
export const VERSION = '1.14.2';
|
package/package.json
CHANGED