labs-claude 0.3.5 → 0.3.6

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/labs.js CHANGED
@@ -312,18 +312,17 @@ async function runAuto(args) {
312
312
  }
313
313
 
314
314
  async function runInteractiveSetup() {
315
- await playMascotIntro(version, 'Choose your backend to set up');
316
- console.log(` ${c.bold('Select setup mode:')}`);
317
- console.log(` ${c.cyan('1.')} ${c.bold('Labs Key (Qwen4 1M)')} ${c.dim('Paste lk_... key from admin — Vision, Web, 200–400 tok/s [Recommended]')}`);
318
- console.log(` ${c.cyan('2.')} ${c.bold('ElevenLabs')} ${c.dim('ElevenLabs API key + bridge agent + Chrome control')}`);
319
- console.log(` ${c.cyan('3.')} ${c.bold('Google Gemini 4')} ${c.dim('AI Studio key or Vertex AI')}`);
320
- console.log(` ${c.cyan('4.')} ${c.bold('Amazon Bedrock')} ${c.dim('Bedrock API key (GLM 5.3)')}\n`);
315
+ await playMascotIntro(version, 'Setup · Qwen4 1M · Vision · Web Search');
316
+ console.log(` ${c.bold('Available engines:')}`);
317
+ console.log(` ${c.cyan('1.')} ${c.bold('Qwen4 1M')} ${c.mint('● LIVE')} ${c.dim('Enter your lk_... key — Vision, Web, 200–400 tok/s [Default]')}`);
318
+ console.log(` ${c.dim('2. Opus 5.5 ○ In progress (coming soon)')}`);
319
+ console.log(` ${c.dim('3. Gemini 4 ○ In progress (coming soon)')}`);
320
+ console.log(` ${c.dim('4. GLM 5.3 ○ In progress (coming soon)')}\n`);
321
321
  const choice = (await ask(' Choose [1]: ')) || '1';
322
- if (choice === '1') return saveGatewayKey(askHidden, ask);
323
- if (choice === '2') return runSetup();
324
- if (choice === '3') return setupGemini();
325
- if (choice === '4') return setupBedrock();
326
- console.log(` ${c.rose('✖')} Unknown choice "${choice}".`);
322
+ if (choice !== '1') {
323
+ console.log(` ${c.amber('⚡')} That engine is still cooking in the lab — setting up ${c.cyan('Qwen4 1M')} now!\n`);
324
+ }
325
+ return saveGatewayKey(askHidden, ask, undefined, true);
327
326
  }
328
327
 
329
328
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labs-claude",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
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"
@@ -43,57 +43,61 @@ async function boxModels(url, key) {
43
43
 
44
44
  // `labs key lk_...` takes the key from the command line: on Windows PowerShell a Ctrl+V into the hidden prompt can
45
45
  // arrive empty (a friend saw "does not look like a labs key" with a correct lk_ key, 22 Nov).
46
- async function saveGatewayKey(askHidden, ask, givenKey) {
47
- await playMascotIntro(version, 'Fast Qwen4 1M Setup · Native Vision · Web Search');
46
+ async function saveGatewayKey(askHidden, ask, givenKey, skipIntro = false) {
47
+ if (!skipIntro) await playMascotIntro(version, 'Qwen4 1M · Native Vision · Web Search · Zero Limits');
48
48
  const stored = storedConfig();
49
49
  const url = (stored.gatewayUrl || DEFAULT_GATEWAY_URL).replace(/\/+$/, '');
50
- console.log(` ${c.dim('Gateway:')} ${c.cyan(url)}`);
51
- const key = givenKey ? String(givenKey).trim() : await askHidden(` ${c.amber('🔑')} Paste your labs key ${c.dim('(lk_..., hidden; or run: labs key lk_...)')}: `);
50
+ const key = givenKey ? String(givenKey).trim() : await askHidden(` ${c.amber('🔑')} Paste your API key ${c.dim('(lk_..., hidden; or run: labs key lk_...)')}: `);
52
51
  if (!/^lk_[A-Za-z0-9_-]{20,}$/.test(key)) {
53
52
  console.log(key
54
- ? ` ${c.rose('✖')} That does not look like a labs key (it starts with ${c.bold('lk_')}). Nothing saved.`
55
- : ` ${c.rose('✖')} Nothing arrived (PowerShell sometimes swallows hidden Ctrl+V). Run instead:\n ${c.cyan('labs key lk_your_key_here')}`);
53
+ ? ` ${c.rose('✖')} That does not look like a valid labs key (it starts with ${c.bold('lk_')}). Nothing saved.`
54
+ : ` ${c.rose('✖')} Nothing arrived (some terminals swallow hidden Ctrl+V). Run instead:\n ${c.cyan('labs key lk_your_key_here')}`);
56
55
  return process.exit(1);
57
56
  }
58
57
  let models = [];
59
58
  try {
60
59
  models = await withSpinner(randomQuip(), () => boxModels(url, key));
61
60
  console.log(models.length
62
- ? ` ${c.mint('✔')} Key verified · Box online: ${c.cyan(models.map(m => m.id).join(', '))}`
63
- : ` ${c.mint('✔')} Key verified · ${c.amber('Box is sleeping right now (ready when it wakes).')}`);
61
+ ? ` ${c.mint('✔')} API key verified · Engine online: ${c.cyan(models.map(m => m.id).join(', '))}`
62
+ : ` ${c.mint('✔')} API key verified · ${c.amber('GPU box is sleeping right now (ready as soon as it wakes).')}`);
64
63
  } catch (error) {
65
64
  const status = error.response?.status;
66
65
  console.log(status === 401
67
- ? ` ${c.rose('✖')} The gateway refused this key (paused or deleted). Nothing saved.`
68
- : ` ${c.rose('✖')} Could not reach ${url} (${error.code || error.message}). Nothing saved.`);
66
+ ? ` ${c.rose('✖')} This key was refused (paused or revoked). Ask admin for a fresh key.`
67
+ : ` ${c.rose('✖')} Could not connect to engine (${error.code || error.message}). Nothing saved.`);
69
68
  return process.exit(1);
70
69
  }
71
70
 
72
71
  let defaultBoxModel = stored.defaultBoxModel || 'qwen';
73
72
  let defaultEffort = stored.defaultEffort || 'high';
74
- if (!givenKey && process.stdin.isTTY) {
73
+ if (process.stdin.isTTY) {
75
74
  console.log(`\n ${c.bold('Pick your default model:')}`);
76
- console.log(` ${c.cyan('1.')} ${c.bold('qwen')} ${c.dim('Qwen4-35B-A3B · 1M ctx · Vision · 200–400 tok/s (default)')}`);
77
- console.log(` ${c.cyan('2.')} ${c.bold('qwen-uncensored')} ${c.dim('Same Qwen4 engine, direct alias')}`);
78
- const mChoice = await ask(` Choose [${defaultBoxModel === 'qwen-uncensored' ? '2' : '1'}]: `);
79
- if (mChoice === '2') defaultBoxModel = 'qwen-uncensored';
80
- else if (mChoice === '1') defaultBoxModel = 'qwen';
75
+ console.log(` ${c.cyan('1.')} ${c.bold('Qwen4 1M')} ${c.mint('● LIVE')} ${c.dim('1M ctx · Native Vision · Web · 200–400 tok/s [Default]')}`);
76
+ console.log(` ${c.dim('2. Opus 5.5 ○ In progress (coming soon)')}`);
77
+ console.log(` ${c.dim('3. Gemini 4 ○ In progress (coming soon)')}`);
78
+ console.log(` ${c.dim('4. GLM 5.3 ○ In progress (coming soon)')}`);
79
+ const mChoice = await ask(' Choose [1]: ');
80
+ if (mChoice && mChoice !== '1') {
81
+ console.log(` ${c.amber('⚡')} Still cooking that one in the lab — locking in ${c.cyan('Qwen4 1M')} for now!`);
82
+ }
83
+ defaultBoxModel = 'qwen';
81
84
 
82
85
  console.log(`\n ${c.bold('Pick your default thinking effort:')}`);
83
- console.log(` ${c.cyan('1.')} ${c.bold('high')} ${c.dim('Best everyday balance (auto-skips thinking on simple prompts)')}`);
86
+ console.log(` ${c.cyan('1.')} ${c.bold('high')} ${c.dim('Best everyday balance (auto-skips thinking on easy prompts) [Default]')}`);
84
87
  console.log(` ${c.cyan('2.')} ${c.bold('xhigh')} ${c.dim('Deepest reasoning for tough bugs & architecture (max)')}`);
85
88
  console.log(` ${c.cyan('3.')} ${c.bold('low')} ${c.dim('Minimal thinking, fastest multi-agent speed')}`);
86
89
  const eChoice = await ask(' Choose [1]: ');
87
90
  if (eChoice === '2') defaultEffort = 'xhigh';
88
91
  else if (eChoice === '3') defaultEffort = 'low';
89
- else if (eChoice === '1') defaultEffort = 'high';
92
+ else defaultEffort = 'high';
90
93
  }
91
94
 
92
95
  saveConfig({ ...stored, gatewayUrl: url, gatewayKey: key, defaultBoxModel, defaultEffort });
93
- printCard('You are all set!', [
94
- `${c.mint('Run now:')} ${c.cyan('labs')} ${c.dim('(starts Claude Code on Qwen4 1M)')}`,
95
- `${c.mint('Switch tab:')} ${c.cyan('/effort low')} ${c.dim('or')} ${c.cyan('/effort max')} ${c.dim('inside Claude Code')}`,
96
- `${c.mint('Update CLI:')} ${c.cyan('labs update')}`,
96
+ printCard('READY TO SHIP · HOW LABS WORKS', [
97
+ `${c.mint('Start coding:')} ${c.cyan('labs')} ${c.dim('(opens Claude Code on Qwen4 1M + Vision + Web)')}`,
98
+ `${c.mint('Change IQ:')} ${c.cyan('/effort low')} ${c.dim('|')} ${c.cyan('/effort high')} ${c.dim('|')} ${c.cyan('/effort max')} ${c.dim('inside chat')}`,
99
+ `${c.mint('Re-configure:')} ${c.cyan('labs setup')} ${c.dim('(change key or effort anytime)')}`,
100
+ `${c.mint('Auto-update:')} ${c.cyan('labs update')} ${c.dim('(1-command latest version)')}`,
97
101
  ]);
98
102
  }
99
103
 
package/src/ui.js CHANGED
@@ -168,14 +168,21 @@ function checkUpdateNotice(currentVersion, labsDir) {
168
168
  }
169
169
 
170
170
  function runSelfUpdate(currentVersion) {
171
- console.log(`\n ${c.cyan('⬆')} Updating ${c.bold('labs-claude')} (current ${c.dim(currentVersion)}) from npm...\n`);
171
+ console.log(`\n ${c.cyan('⬆')} Updating ${c.bold('labs-claude')} (current ${c.dim(currentVersion)}) from npm...`);
172
+ console.log(` ${c.violet('✦')} ${c.dim(randomQuip())}\n`);
172
173
  const cmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
173
174
  const res = spawnSync(cmd, ['install', '-g', 'labs-claude@latest', '--prefer-online'], { stdio: 'inherit', shell: process.platform === 'win32' });
174
175
  if (res.status !== 0) {
175
- console.error(`\n ${c.rose('✖')} Update failed. Try manually: ${c.cyan('npm install -g labs-claude@latest --prefer-online')}`);
176
+ console.error(`\n ${c.rose('✖')} Update failed.`);
177
+ if (process.platform !== 'win32') {
178
+ console.error(` ${c.amber('💡 Mac/Linux fix (if you saw EACCES on ~/.npm):')}`);
179
+ console.error(` ${c.cyan('sudo chown -R $(whoami) ~/.npm && npm install -g labs-claude@latest --prefer-online')}\n`);
180
+ } else {
181
+ console.error(` Try manually: ${c.cyan('npm install -g labs-claude@latest --prefer-online')}\n`);
182
+ }
176
183
  process.exit(res.status || 1);
177
184
  }
178
- console.log(`\n ${c.mint('✔')} Updated! Close and reopen any open labs terminals to use the new version.\n`);
185
+ console.log(`\n ${c.mint('✔')} Updated to latest! Close and reopen any open labs terminals.\n`);
179
186
  }
180
187
 
181
188
  module.exports = { c, KARPATHY_QUIPS, randomQuip, playMascotIntro, withSpinner, printCard, isNewerVersion, checkUpdateNotice, runSelfUpdate };