labs-claude 0.12.4 → 0.12.5

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/package.json +1 -1
  2. package/src/dash.js +18 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labs-claude",
3
- "version": "0.12.4",
3
+ "version": "0.12.5",
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"
package/src/dash.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // Clean, calm, horizontally centered, zero mental load.
3
3
  // Press Enter to code, [s] for settings (effort, theme, chrome, brave, statusline, key), [u] update, [a] admin (owner only).
4
4
  const axios = require('axios');
5
+ const https = require('https');
5
6
  const fs = require('fs');
6
7
  const os = require('os');
7
8
  const path = require('path');
@@ -39,13 +40,24 @@ function hasStatusline() {
39
40
  } catch { return false; }
40
41
  }
41
42
 
42
- async function fetchMe(url, key) {
43
- try {
44
- const { data } = await axios.get(`${url}/v1/me`, { headers: { 'x-api-key': key }, timeout: 4000 });
45
- return data;
46
- } catch {
47
- return null;
43
+ const DASH_HTTPS_AGENT = new https.Agent({ keepAlive: true, maxSockets: 2, family: 4 });
44
+
45
+ async function fetchMe(url, key, retries = 3) {
46
+ for (let i = 0; i < retries; i += 1) {
47
+ try {
48
+ const { data } = await axios.get(`${url}/v1/me`, {
49
+ headers: { 'x-api-key': key },
50
+ timeout: 6000,
51
+ httpsAgent: DASH_HTTPS_AGENT,
52
+ });
53
+ return data;
54
+ } catch (err) {
55
+ const status = err?.response?.status;
56
+ if (status && status < 500) return null;
57
+ if (i < retries - 1) await new Promise(r => setTimeout(r, 400 * (i + 1)));
58
+ }
48
59
  }
60
+ return null;
49
61
  }
50
62
 
51
63
  function centerLine(text, cols) {