labs-claude 0.12.2 → 0.12.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labs-claude",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "Run the real Claude Code CLI on Qwen4 1M (Vision + Web), Gemini 4, Bedrock, or ElevenLabs — with colorful setup and admin token tracking.",
5
5
  "bin": {
6
6
  "labs": "bin/labs.js"
@@ -2,6 +2,7 @@
2
2
  // Box models skip the local ElevenLabs proxy: Claude Code talks to the gateway directly with the user's labs key.
3
3
  const axios = require('axios');
4
4
  const crypto = require('crypto');
5
+ const https = require('https');
5
6
  const fs = require('fs');
6
7
  const path = require('path');
7
8
  const { execFileSync, spawn } = require('child_process');
@@ -46,9 +47,26 @@ function storedConfig() {
46
47
  return fs.existsSync(CONFIG_PATH) ? JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')) : {};
47
48
  }
48
49
 
49
- async function boxModels(url, key) {
50
- const { data } = await axios.get(`${url}/v1/models`, { headers: { 'x-api-key': key }, timeout: 8000 });
51
- return data.data || [];
50
+ const GATEWAY_HTTPS_AGENT = new https.Agent({ keepAlive: true, maxSockets: 4, family: 4 });
51
+
52
+ async function boxModels(url, key, retries = 3) {
53
+ let lastErr;
54
+ for (let i = 0; i < retries; i += 1) {
55
+ try {
56
+ const { data } = await axios.get(`${url}/v1/models`, {
57
+ headers: { 'x-api-key': key },
58
+ timeout: 6000,
59
+ httpsAgent: GATEWAY_HTTPS_AGENT,
60
+ });
61
+ return data.data || [];
62
+ } catch (err) {
63
+ lastErr = err;
64
+ const status = err?.response?.status;
65
+ if (status && status < 500) throw err;
66
+ if (i < retries - 1) await new Promise(r => setTimeout(r, 500 * (i + 1)));
67
+ }
68
+ }
69
+ throw lastErr;
52
70
  }
53
71
 
54
72
  // `labs key lk_...` takes the key from the command line: on Windows PowerShell a Ctrl+V into the hidden prompt can