labs-claude 0.3.6 → 0.4.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/labs.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  const axios = require('axios');
3
3
  const { spawn } = require('child_process');
4
4
  const { randomUUID } = require('crypto');
@@ -17,36 +17,18 @@ const { planSubscriptionLeg, planLabsLegArgs, createWatcher } = require('../src/
17
17
  const { version } = require('../package.json');
18
18
  const { c, playMascotIntro, checkUpdateNotice, runSelfUpdate } = require('../src/ui');
19
19
 
20
- const HELP = `labs ${version} — Run Claude Code on Antigravity (agy), Google Gemini 4, ElevenLabs, Bedrock, or Qwen
20
+ const HELP = `labs ${version} — Run Claude Code on Qwen4-35B-A3B (1M context · Native Vision · Web Search)
21
21
 
22
- labs open Claude Code on the default model
23
- labs --model gem Gemini 4 Hydrogen (1M context, reasoning) via your signed-in agy CLI
24
- labs --model gemini Gemini 4 Hydrogen (1M context, reasoning) via agy or your ElevenLabs bridge
25
- labs --model hydrogen same as --model gemini (also: agy-flash, agy-opus, agy-sonnet, agy-oss)
26
- labs --model opus pick a model by name, number (labs --model 5) or raw LLM id
27
- labs -p "question" any Claude Code flag works, e.g. -p, --resume, --permission-mode
28
- labs auto [claude args] real Claude Code on your subscription; on a limit or expired login, same session continues on labs Opus 5.5
29
- labs models [--all] list models
30
- labs usage credits left and what recent sessions cost per model
31
- labs setup set your ElevenLabs key, the bridge agent and real-Chrome control
32
- labs bedrock save your Amazon Bedrock key, then: labs --model glm (GLM 5.3)
33
- labs --model qwen Claude Code on our GPU box (qwen | qwen-uncensored), through the labs gateway
34
- labs key save your labs key (lk_...) with interactive model + effort setup
35
- labs admin [subcommand] terminal-native Admin Control Room (stats | create | pause | resume | revoke | usage)
36
- labs update update labs-claude to the latest npm version in one command
37
- labs console open the web admin console (optional; labs admin does everything in terminal)
38
- labs paint "a red kite" paint on the box (--size wide|portrait|square… --count 1-4 --seed N); prints the file paths
39
- labs image-mcp picture tool for any Claude Code chat: claude mcp add -s user labs-image -- labs image-mcp
40
- labs web-mcp web search + page reading on this computer (added to every box session by itself)
41
- labs admin-token <ssh> make a new console admin token on the gateway server
42
- labs chat open the private chat page (http://127.0.0.1:8081/chat)
43
- labs serve start the background proxy if it is not running, then exit
44
- labs autostart on|off keep the proxy (and the chat page) running from login (Windows)
45
- labs stop stop the background proxy
22
+ labs open Claude Code directly on Qwen4-35B-A3B (1M ctx, high effort)
23
+ labs --model qwen explicitly launch Qwen4-35B-A3B (also: --model qwen-uncensored)
24
+ labs -p "question" any Claude Code flag works (-p, --resume, --effort max, etc.)
25
+ labs setup interactive mascot setup (paste lk_... key, choose effort)
26
+ labs key [lk_...] save or rotate your labs API key
27
+ labs models list available engines (Qwen4-35B-A3B live + upcoming)
28
+ labs update update labs-claude to the latest npm version in 1 command
29
+ labs admin [subcommand] admin terminal control room (stats | create | pause | resume | revoke | usage)
46
30
 
47
- Inside Claude Code: /model <name> switches model, e.g. /model gemini-4-neon
48
- Browser: "open gmail.com and read my top email" uses your real Chrome (set up with labs setup)
49
- Update: npm install -g labs-claude@latest --prefer-online, then close and reopen every labs window`;
31
+ Inside Claude Code: /effort low | high | max adjusts reasoning depth live.`;
50
32
 
51
33
  function printModels(config, showAll) {
52
34
  const llms = loadLlmList();
@@ -376,7 +358,16 @@ async function main() {
376
358
  else config.defaultModel = 'hydrogen'; // gemini-4-hydrogen works via ElevenLabs gateway; setup will prompt if needed
377
359
  }
378
360
 
379
- if (args[0] === 'models') return printModels(config, args.includes('--all'));
361
+ if (args[0] === 'models') {
362
+ console.log(`\n ${c.bold(c.white('labs engines'))}\n`);
363
+ console.log(` ${c.cyan('1.')} ${c.bold('qwen')} ${c.mint('● live')} ${c.dim('Qwen4-35B-A3B · 1m context · vision · web · 200-400 tok/s ← default')}`);
364
+ console.log(` ${c.cyan('2.')} ${c.bold('qwen-uncensored')} ${c.mint('● live')} ${c.dim('same qwen4 engine, uncensored alias 💀')}`);
365
+ console.log(` ${c.dim('3. opus ○ coming soon')}`);
366
+ console.log(` ${c.dim('4. gemini ○ coming soon')}`);
367
+ console.log(` ${c.dim('5. glm ○ coming soon')}\n`);
368
+ console.log(` ${c.dim('start:')} ${c.cyan('labs')} ${c.dim('effort inside chat:')} ${c.cyan('/effort low | high | max')}\n`);
369
+ return;
370
+ }
380
371
  if (args[0] === 'usage') return printUsage(config);
381
372
  if (args[0] === 'chat') return openChat(config);
382
373
  if (args[0] === 'stop') return console.log(await stopProxy(config.port) ? '🛑 Proxy stopped' : 'Proxy was not running');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labs-claude",
3
- "version": "0.3.6",
3
+ "version": "0.4.1",
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"
@@ -7,21 +7,27 @@ const path = require('path');
7
7
  const { execFileSync, spawn } = require('child_process');
8
8
  const { CONFIG_PATH, LABS_DIR, saveConfig } = require('./config');
9
9
  const { withBypassDefault } = require('./launch-args');
10
- const { c, randomQuip, playMascotIntro, withSpinner, printCard } = require('./ui');
10
+ const { c, randomQuip, playMascotIntro, askMasked, withSpinner, printCard } = require('./ui');
11
11
  const { version } = require('../package.json');
12
12
 
13
- const GATEWAY_MODELS = { qwen: 'qwen-normal', 'qwen-normal': 'qwen-normal', 'qwen-uncensored': 'qwen-uncensored' };
13
+ const GATEWAY_MODELS = {
14
+ qwen: 'qwen-normal',
15
+ qwen4: 'qwen-normal',
16
+ 'qwen4-35b': 'qwen-normal',
17
+ 'qwen-normal': 'qwen-normal',
18
+ 'qwen-uncensored': 'qwen-uncensored'
19
+ };
14
20
  const DEFAULT_GATEWAY_URL = 'https://labs.instant.uz';
15
21
  const ADMIN_TOKEN_FILE = path.join(LABS_DIR, 'gateway-admin');
16
- // Same capability list the box's own claude-local uses, so /effort and thinking work on Qwen.
22
+ // Same capability list the box's own claude-local uses, so /effort, xhigh, max, and thinking work on Qwen4.
17
23
  const CAPS = 'effort,xhigh_effort,max_effort,thinking,interleaved_thinking';
18
24
 
19
- // A friend who saved only a labs key (no ElevenLabs account) gets Qwen from a bare `labs`, never the ElevenLabs setup.
20
- function boxOnlyArgs(args, stored, env = process.env) {
25
+ // Whenever a labs key is configured, bare `labs` ALWAYS launches Qwen4 (never falls back into ElevenLabs).
26
+ function boxOnlyArgs(args, stored) {
21
27
  const named = args.some(a => a === '--model' || a.startsWith('--model='));
22
- const command = ['models', 'usage', 'chat', 'stop', 'setup', 'update'].includes(args[0]);
28
+ const command = ['models', 'usage', 'chat', 'stop', 'setup', 'update', 'admin', 'key', 'console', 'paint'].includes(args[0]);
23
29
  const defaultModel = stored.defaultBoxModel || 'qwen';
24
- return !named && !command && stored.gatewayKey && !stored.apiKey && !env.ELEVENLABS_API_KEY ? ['--model', defaultModel, ...args] : null;
30
+ return !named && !command && stored.gatewayKey ? ['--model', defaultModel, ...args] : null;
25
31
  }
26
32
 
27
33
  function gatewayModelFrom(args) {
@@ -44,22 +50,24 @@ async function boxModels(url, key) {
44
50
  // `labs key lk_...` takes the key from the command line: on Windows PowerShell a Ctrl+V into the hidden prompt can
45
51
  // arrive empty (a friend saw "does not look like a labs key" with a correct lk_ key, 22 Nov).
46
52
  async function saveGatewayKey(askHidden, ask, givenKey, skipIntro = false) {
47
- if (!skipIntro) await playMascotIntro(version, 'Qwen4 1M · Native Vision · Web Search · Zero Limits');
53
+ if (!skipIntro) await playMascotIntro(version, 'Qwen4-35B-A3B · 1M Context · Vision · Web');
48
54
  const stored = storedConfig();
49
55
  const url = (stored.gatewayUrl || DEFAULT_GATEWAY_URL).replace(/\/+$/, '');
50
- const key = givenKey ? String(givenKey).trim() : await askHidden(` ${c.amber('🔑')} Paste your API key ${c.dim('(lk_..., hidden; or run: labs key lk_...)')}: `);
56
+ const key = givenKey
57
+ ? String(givenKey).trim()
58
+ : await askMasked(` ${c.cyan('[1/3]')} ${c.amber('🔑')} Paste your API key ${c.dim('(lk_...)')}: `);
51
59
  if (!/^lk_[A-Za-z0-9_-]{20,}$/.test(key)) {
52
60
  console.log(key
53
61
  ? ` ${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')}`);
62
+ : ` ${c.rose('✖')} Nothing arrived. Run with the key directly:\n ${c.cyan('labs key lk_your_key_here')}`);
55
63
  return process.exit(1);
56
64
  }
57
65
  let models = [];
58
66
  try {
59
67
  models = await withSpinner(randomQuip(), () => boxModels(url, key));
60
68
  console.log(models.length
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).')}`);
69
+ ? ` ${c.mint('✔')} Key verified · ${c.bold('Qwen4-35B-A3B')} online ${c.dim('(1M ctx · Vision · Web)')}`
70
+ : ` ${c.mint('✔')} Key verified · ${c.amber('GPU box is sleeping right now (ready as soon as it wakes).')}`);
63
71
  } catch (error) {
64
72
  const status = error.response?.status;
65
73
  console.log(status === 401
@@ -68,21 +76,20 @@ async function saveGatewayKey(askHidden, ask, givenKey, skipIntro = false) {
68
76
  return process.exit(1);
69
77
  }
70
78
 
71
- let defaultBoxModel = stored.defaultBoxModel || 'qwen';
79
+ let defaultBoxModel = 'qwen';
72
80
  let defaultEffort = stored.defaultEffort || 'high';
73
81
  if (process.stdin.isTTY) {
74
- console.log(`\n ${c.bold('Pick your default model:')}`);
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]')}`);
82
+ console.log(`\n ${c.cyan('[2/3]')} ${c.bold('Choose default engine:')}`);
83
+ console.log(` ${c.cyan('1.')} ${c.bold('Qwen4-35B-A3B')} ${c.mint('● LIVE')} ${c.dim('1M ctx · Native Vision · Web · 200–400 tok/s [Default]')}`);
76
84
  console.log(` ${c.dim('2. Opus 5.5 ○ In progress (coming soon)')}`);
77
85
  console.log(` ${c.dim('3. Gemini 4 ○ In progress (coming soon)')}`);
78
86
  console.log(` ${c.dim('4. GLM 5.3 ○ In progress (coming soon)')}`);
79
87
  const mChoice = await ask(' Choose [1]: ');
80
88
  if (mChoice && mChoice !== '1') {
81
- console.log(` ${c.amber('⚡')} Still cooking that one in the lab — locking in ${c.cyan('Qwen4 1M')} for now!`);
89
+ console.log(` ${c.amber('⚡')} Still cooking that one in the lab — locking in ${c.cyan('Qwen4-35B-A3B')} for now!`);
82
90
  }
83
- defaultBoxModel = 'qwen';
84
91
 
85
- console.log(`\n ${c.bold('Pick your default thinking effort:')}`);
92
+ console.log(`\n ${c.cyan('[3/3]')} ${c.bold('Choose default thinking effort:')}`);
86
93
  console.log(` ${c.cyan('1.')} ${c.bold('high')} ${c.dim('Best everyday balance (auto-skips thinking on easy prompts) [Default]')}`);
87
94
  console.log(` ${c.cyan('2.')} ${c.bold('xhigh')} ${c.dim('Deepest reasoning for tough bugs & architecture (max)')}`);
88
95
  console.log(` ${c.cyan('3.')} ${c.bold('low')} ${c.dim('Minimal thinking, fastest multi-agent speed')}`);
@@ -92,9 +99,11 @@ async function saveGatewayKey(askHidden, ask, givenKey, skipIntro = false) {
92
99
  else defaultEffort = 'high';
93
100
  }
94
101
 
95
- saveConfig({ ...stored, gatewayUrl: url, gatewayKey: key, defaultBoxModel, defaultEffort });
102
+ // Strip any stale ElevenLabs keys so bare `labs` never falls back into ElevenLabs.
103
+ const { apiKey: _oldEl, bridgeAgent: _oldBridge, ...cleanStored } = stored;
104
+ saveConfig({ ...cleanStored, gatewayUrl: url, gatewayKey: key, defaultBoxModel, defaultEffort });
96
105
  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)')}`,
106
+ `${c.mint('Start coding:')} ${c.cyan('labs')} ${c.dim('(opens Claude Code on Qwen4-35B-A3B · 1M · Vision)')}`,
98
107
  `${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
108
  `${c.mint('Re-configure:')} ${c.cyan('labs setup')} ${c.dim('(change key or effort anytime)')}`,
100
109
  `${c.mint('Auto-update:')} ${c.cyan('labs update')} ${c.dim('(1-command latest version)')}`,
@@ -126,12 +135,17 @@ async function prepareGatewayLaunch(config, args, picked) {
126
135
 
127
136
  const claudeArgs = args.filter((_, i) => i !== picked.index && (picked.inline || i !== picked.index + 1));
128
137
  if (!claudeArgs.some(a => a === '--effort' || a.startsWith('--effort='))) claudeArgs.push('--effort', config.defaultEffort || 'high');
138
+ const ctxLabel = (model.max_model_len || 131072) >= 1000000 ? '1m context' : `${Math.round((model.max_model_len || 131072) / 1000)}k context`;
139
+ const displayName = picked.id === 'qwen-uncensored' ? 'Qwen4-35B-A3B (uncensored)' : 'Qwen4-35B-A3B';
129
140
  const env = {
130
141
  ...process.env,
131
142
  ANTHROPIC_BASE_URL: url,
132
143
  ANTHROPIC_AUTH_TOKEN: config.gatewayKey,
133
144
  ANTHROPIC_MODEL: picked.id,
134
- // Every row Claude Code can fall back to points at the same box model, so side calls and subagents stay on it.
145
+ ANTHROPIC_CUSTOM_MODEL_OPTION: picked.id,
146
+ ANTHROPIC_CUSTOM_MODEL_OPTION_NAME: displayName,
147
+ ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION: `${displayName} · ${ctxLabel} · vision · web · 200-400 tok/s`,
148
+ // Every row Claude Code can fall back to points at the same box model, so side calls and subagents stay on Qwen4.
135
149
  ANTHROPIC_DEFAULT_OPUS_MODEL: picked.id,
136
150
  ANTHROPIC_DEFAULT_SONNET_MODEL: picked.id,
137
151
  ANTHROPIC_DEFAULT_HAIKU_MODEL: picked.id,
@@ -142,8 +156,7 @@ async function prepareGatewayLaunch(config, args, picked) {
142
156
  CLAUDE_CODE_MAX_CONTEXT_TOKENS: String(model.max_model_len || 131072)
143
157
  };
144
158
  for (const name of ['ANTHROPIC_API_KEY', 'ANTHROPIC_CUSTOM_HEADERS']) delete env[name];
145
- const ctxLabel = (model.max_model_len || 131072) >= 1000000 ? '1M context' : `${Math.round((model.max_model_len || 131072) / 1000)}k context`;
146
- const banner = `${c.mint('🚀')} ${c.bold('Claude Code')} on ${c.cyan(picked.id)} ${c.dim(`(${ctxLabel} · Vision · Web)`)} via ${c.dim(url)}\n ${c.violet('✦')} ${c.dim(randomQuip())}`;
159
+ const banner = `${c.mint('🚀')} ${c.bold('claude code')} on ${c.cyan(displayName)} ${c.dim(`(${ctxLabel} · vision · web)`)}\n ${c.violet('✦')} ${c.dim(randomQuip(picked.id))}`;
147
160
  // Qwen cannot use Claude Code's WebSearch (an Anthropic server tool); give it a search tool that runs here instead.
148
161
  if (!claudeArgs.some(a => a === '--strict-mcp-config')) claudeArgs.push(...require('./web-mcp').webMcpArgs());
149
162
  return { claudeArgs: withBypassDefault(claudeArgs), env, banner };
package/src/ui.js CHANGED
@@ -1,7 +1,8 @@
1
- // Colorful terminal UI, ASCII mascot, lightweight animations, and non-blocking npm update check.
2
- // Zero external dependencies; degrades cleanly when stdout is not a TTY or NO_COLOR is set.
1
+ // Top-tier terminal UI: 24-bit RGB gradients, animated LABS mascot, live *-masked input,
2
+ // Karpathy-mode humor quips, boxed cards, and non-blocking npm auto-update check.
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const readline = require('readline');
5
6
  const { spawnSync } = require('child_process');
6
7
 
7
8
  const USE_COLOR = Boolean(process.stdout.isTTY && !process.env.NO_COLOR);
@@ -18,9 +19,23 @@ const c = {
18
19
  white: s => ansi('38;2;248;250;252', s),
19
20
  };
20
21
 
22
+ function gradient(text, from = [56, 189, 248], to = [167, 139, 250]) {
23
+ if (!USE_COLOR) return String(text);
24
+ const chars = [...String(text)];
25
+ const len = Math.max(1, chars.length - 1);
26
+ return chars.map((ch, i) => {
27
+ if (ch === ' ') return ' ';
28
+ const t = i / len;
29
+ const r = Math.round(from[0] + (to[0] - from[0]) * t);
30
+ const g = Math.round(from[1] + (to[1] - from[1]) * t);
31
+ const b = Math.round(from[2] + (to[2] - from[2]) * t);
32
+ return `\x1b[38;2;${r};${g};${b}m${ch}`;
33
+ }).join('') + '\x1b[0m';
34
+ }
35
+
21
36
  const MASCOT_FRAMES = [
22
37
  [
23
- ' ╭───╮ ',
38
+ ' ╭───╮ · ',
24
39
  ' ╭──┴───┴──╮ ',
25
40
  ' │ ◉ ◉ │ ',
26
41
  ' │ ◡ │ ',
@@ -29,72 +44,207 @@ const MASCOT_FRAMES = [
29
44
  ' ╰─────────╯ ',
30
45
  ],
31
46
  [
32
- ' ╭───╮ ✦ ',
47
+ ' · ╭───╮ ✦ ',
33
48
  ' ╭──┴───┴──╮ ',
34
49
  ' │ ◉ ◉ │ ',
35
50
  ' │ ◡ │ ',
36
51
  ' ╰─┬─────┬─╯ ',
37
- ' ╱ ▒▒▒▒▒ ╲ ',
52
+ ' ╱ ▒▒░░▒ ╲ ',
38
53
  ' ╰─────────╯ ',
39
54
  ],
40
55
  [
41
- ' ✦ ╭───╮ · ',
56
+ ' ✦ ╭───╮ ✧ ',
42
57
  ' ╭──┴───┴──╮ ',
43
58
  ' │ ◠ ◠ │ ',
44
59
  ' │ ◡ │ ',
45
60
  ' ╰─┬─────┬─╯ ',
46
- ' ╱ ▓▓▓▓▓ ╲ ',
61
+ ' ╱ ▓▓▒▒▓ ╲ ',
62
+ ' ╰─────────╯ ',
63
+ ],
64
+ [
65
+ ' ✧ ╭───╮ ✦ ',
66
+ ' ╭──┴───┴──╮ ',
67
+ ' │ ◉ ◉ │ ',
68
+ ' │ ◡ │ ',
69
+ ' ╰─┬─────┬─╯ ',
70
+ ' ╱ ██▓▓█ ╲ ',
71
+ ' ╰─────────╯ ',
72
+ ],
73
+ [
74
+ ' ✦ ╭───╮ ✨ ',
75
+ ' ╭──┴───┴──╮ ',
76
+ ' │ ✦ ✦ │ ',
77
+ ' │ ◡ │ ',
78
+ ' ╰─┬─────┬─╯ ',
79
+ ' ╱ █████ ╲ ',
80
+ ' ╰─────────╯ ',
81
+ ],
82
+ [
83
+ ' ✨ ╭───╮ ✦ ',
84
+ ' ╭──┴───┴──╮ ',
85
+ ' │ ◉ ◉ │ ',
86
+ ' │ ◡ │ ',
87
+ ' ╰─┬─────┬─╯ ',
88
+ ' ╱ █████ ╲ ',
47
89
  ' ╰─────────╯ ',
48
90
  ],
49
91
  ];
50
92
 
51
- const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
93
+ const CHILL_QUIPS = [
94
+ 'bro is actually cooking rn 🔥',
95
+ 'hold up let him cook 👨‍🍳🔥',
96
+ 'hehe, spinning up qwen4... try not to hack into nasa 💀',
97
+ 'bro really opened another terminal tab 😭',
98
+ 'gpu fans just entered airplane mode ✈️💀',
99
+ 'warming up 256 experts (8 are coding, 248 are chilling) 💀',
100
+ 'loading 1m context... still smaller than your chrome tabs 😭',
101
+ 'no sleep just shipping 🚀😭',
102
+ 'bro woke up and chose 400 tok/s ⚡',
103
+ 'convincing the gpu to go brrr rn 🏎️💨',
104
+ 'if this takes >2s blame wifi not me 💀',
105
+ 'unlocking vision + web search... lock in bro 🔒⚡',
106
+ 'chat is this real?? yes bro 1m context is live 😭🔥',
107
+ 'main character energy detected ✨🚀',
108
+ 'bro really said "i can fix it in 5 mins" (3 hours ago) 💀',
109
+ 'pouring 600w of iced coffee into the gpu ☕⚡',
110
+ 'zero rate limits, pure vibes only 🌊🔥',
111
+ 'prod is shaking rn bro be gentle 😭💀',
112
+ 'git push --force energy (please don’t) 👀💀',
113
+ 'loading big brain mode... 🧠⚡',
114
+ 'your friend is gonna ask how this is so fast 🤫🔥',
115
+ 'shipping before the coffee gets cold ☕🚀',
116
+ 'vibe coding at 400 tokens/sec, peak cinema 🎬🔥',
117
+ 'qwen4 just stretched its knuckles, we ready 💪⚡',
118
+ 'deleting bugs before they even spawn 🪲🔫',
119
+ 'bro’s terminal looks like a movie hacker screen rn 💀✨',
120
+ '1,048,576 tokens of pure locked-in focus 🎯🔥',
121
+ 'trust the process, we shipping tonight 🌙🚀',
122
+ 'no cap this gpu is actually flying rn 🦅⚡',
123
+ 'who needs sleep when you have 1m context 😭☕',
124
+ 'spawning braincells... please wait 🧠✨',
125
+ 'bro is about to refactor the whole repo at 2am 💀🔥',
126
+ 'vision online, web online, aura +1000 ✨⚡',
127
+ 'stack overflow? never heard of her 💅🔥',
128
+ 'building the future from a dark terminal 🖤🚀',
129
+ 'type shi, we locked in 🔒🔥',
130
+ 'let the gpu handle the heavy lifting bro 🏋️⚡',
131
+ 'speedrunning this feature like it’s a world record ⏱️🔥',
132
+ 'your code is about to look illegally clean 🧼✨',
133
+ 'qwen4 woke up with zero chill today 💀🔥',
134
+ 'fetching brain power from the cloud ☁️⚡',
135
+ 'bro’s about to cook a 5-star pull request 👨‍🍳⭐',
136
+ 'no bugs allowed in this zip code 🚫🪲',
137
+ 'terminal aura maxed out ✨💻',
138
+ 'fast enough to make your keyboard jealous ⌨️💨',
139
+ 'ok ok let’s see what we breaking today 😭🔧',
140
+ 'certified cracked engineer moment 💀🔥',
141
+ 'running on pure caffeine and tensor cores ☕⚡',
142
+ 'don’t blink, it’s already loaded 👀🚀',
143
+ 'we are so back 🔥🚀',
144
+ ];
52
145
 
53
- const KARPATHY_QUIPS = [
54
- 'Warming up 256 MoE experts (8 are coding, 248 are in standup)...',
55
- 'Karpathy mode: staring directly into the loss curve...',
56
- 'Convincing DFlash2 to guess 7 tokens ahead with zero brain loss...',
57
- 'Loading 1,048,576 tokens of context (more memory than your last sprint)...',
58
- 'Feeding Blackwell tensor cores 600 watts of pure unfiltered caffeine...',
59
- 'Checking RadixAttention prefix cache so TTFT stays sub-100ms...',
60
- 'Calibrating xhigh reasoning... please hold while the model overthinks...',
61
- 'Zero corporate rate limits detected. Full local throttle engaged.',
146
+ const UNCENSORED_QUIPS = [
147
+ 'hehe, going uncensored mode 💀 which one are you hacking into, nasa? 😭',
148
+ 'uncensored mode unlocked 💀 bro what are you building rn 😭🔥',
149
+ 'no guardrails, just vibes 💀 don’t get us on the news bro 😭',
150
+ 'bro clicked uncensored with zero hesitation 💀⚡',
62
151
  ];
63
152
 
64
- function randomQuip() {
65
- return KARPATHY_QUIPS[Math.floor(Math.random() * KARPATHY_QUIPS.length)];
153
+ function randomQuip(modelId = '') {
154
+ if (String(modelId).includes('uncensored')) {
155
+ return UNCENSORED_QUIPS[Math.floor(Math.random() * UNCENSORED_QUIPS.length)];
156
+ }
157
+ return CHILL_QUIPS[Math.floor(Math.random() * CHILL_QUIPS.length)];
66
158
  }
67
159
 
68
- async function playMascotIntro(version, subtitle = 'Claude Code · Qwen4 1M · Vision · Web') {
160
+ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
161
+
162
+ async function playMascotIntro(version, subtitle = 'Qwen4-35B-A3B · 1M Context · Vision · Web') {
69
163
  const quip = randomQuip();
70
- const paintFrame = (frame, accent) => {
71
- const lines = [
72
- '',
73
- ` ${accent(frame[0])} ${c.bold(c.white('LABS'))} ${c.violet(`v${version}`)}`,
74
- ` ${accent(frame[1])} ${c.dim(subtitle)}`,
75
- ` ${c.cyan(frame[2])} ${c.mint('●')} ${c.dim(quip)}`,
76
- ` ${c.cyan(frame[3])}`,
77
- ` ${accent(frame[4])}`,
78
- ` ${c.mint(frame[5])}`,
79
- ` ${c.mint(frame[6])}`,
80
- '',
81
- ];
82
- return lines.join('\n');
83
- };
164
+ const wordmark = gradient('█░░ ▄▀█ █▄▄ █▀', [56, 189, 248], [52, 211, 153]);
165
+ const wordmark2 = gradient('█▄▄ █▀█ █▄█ ▄█', [167, 139, 250], [56, 189, 248]);
166
+
167
+ const paintFrame = (frame, fromRgb, toRgb) => [
168
+ '',
169
+ ` ${gradient(frame[0], fromRgb, toRgb)} ${wordmark} ${c.violet(`v${version}`)}`,
170
+ ` ${gradient(frame[1], fromRgb, toRgb)} ${wordmark2}`,
171
+ ` ${c.cyan(frame[2])} ${c.white(subtitle)}`,
172
+ ` ${c.cyan(frame[3])} ${c.mint('✦')} ${c.dim(quip)}`,
173
+ ` ${gradient(frame[4], fromRgb, toRgb)}`,
174
+ ` ${gradient(frame[5], [52, 211, 153], [56, 189, 248])}`,
175
+ ` ${c.mint(frame[6])}`,
176
+ '',
177
+ ].join('\n');
84
178
 
85
179
  if (!USE_COLOR) {
86
- console.log(paintFrame(MASCOT_FRAMES[2], s => s));
180
+ console.log(paintFrame(MASCOT_FRAMES[5], [56, 189, 248], [52, 211, 153]));
87
181
  return;
88
182
  }
89
183
 
90
- const accents = [c.violet, c.cyan, c.mint];
184
+ const palettes = [
185
+ [[167, 139, 250], [56, 189, 248]],
186
+ [[56, 189, 248], [52, 211, 153]],
187
+ [[52, 211, 153], [251, 191, 36]],
188
+ [[251, 191, 36], [167, 139, 250]],
189
+ [[167, 139, 250], [52, 211, 153]],
190
+ [[56, 189, 248], [52, 211, 153]],
191
+ ];
91
192
  for (let i = 0; i < MASCOT_FRAMES.length; i += 1) {
92
193
  if (i > 0) process.stdout.write('\x1b[9A\x1b[0J');
93
- process.stdout.write(paintFrame(MASCOT_FRAMES[i], accents[i]) + '\n');
94
- if (i < MASCOT_FRAMES.length - 1) await sleep(130);
194
+ process.stdout.write(paintFrame(MASCOT_FRAMES[i], palettes[i][0], palettes[i][1]) + '\n');
195
+ if (i < MASCOT_FRAMES.length - 1) await sleep(95);
95
196
  }
96
197
  }
97
198
 
199
+ // Live *-masked input so pasting or typing an API key feels responsive instead of frozen.
200
+ function askMasked(promptText) {
201
+ return new Promise(resolve => {
202
+ if (!process.stdin.isTTY) {
203
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
204
+ rl.question(promptText, ans => { rl.close(); resolve(ans.trim()); });
205
+ return;
206
+ }
207
+ process.stdout.write(promptText);
208
+ const stdin = process.stdin;
209
+ const wasRaw = stdin.isRaw;
210
+ stdin.setRawMode(true);
211
+ stdin.resume();
212
+ stdin.setEncoding('utf8');
213
+ let value = '';
214
+ const cleanup = () => {
215
+ stdin.removeListener('data', onData);
216
+ stdin.setRawMode(Boolean(wasRaw));
217
+ stdin.pause();
218
+ };
219
+ const onData = chunk => {
220
+ for (const ch of chunk) {
221
+ if (ch === '\r' || ch === '\n') {
222
+ cleanup();
223
+ process.stdout.write('\n');
224
+ return resolve(value.trim());
225
+ }
226
+ if (ch === '\u0003') {
227
+ cleanup();
228
+ process.stdout.write('\n');
229
+ process.exit(130);
230
+ }
231
+ if (ch === '\u007f' || ch === '\b') {
232
+ if (value.length > 0) {
233
+ value = value.slice(0, -1);
234
+ process.stdout.write('\b \b');
235
+ }
236
+ continue;
237
+ }
238
+ if (ch >= ' ') {
239
+ value += ch;
240
+ process.stdout.write(c.mint('*'));
241
+ }
242
+ }
243
+ };
244
+ stdin.on('data', onData);
245
+ });
246
+ }
247
+
98
248
  async function withSpinner(label, fn) {
99
249
  if (!USE_COLOR) {
100
250
  process.stdout.write(` ... ${label}\n`);
@@ -104,22 +254,22 @@ async function withSpinner(label, fn) {
104
254
  let idx = 0;
105
255
  const timer = setInterval(() => {
106
256
  process.stdout.write(`\r ${c.cyan(frames[idx++ % frames.length])} ${c.dim(label)}`);
107
- }, 75);
257
+ }, 70);
108
258
  try {
109
259
  const result = await fn();
110
260
  clearInterval(timer);
111
- process.stdout.write(`\r ${c.mint('✔')} ${label}${' '.repeat(12)}\n`);
261
+ process.stdout.write(`\r ${c.mint('✔')} ${label}${' '.repeat(14)}\n`);
112
262
  return result;
113
263
  } catch (error) {
114
264
  clearInterval(timer);
115
- process.stdout.write(`\r ${c.rose('✖')} ${label}${' '.repeat(12)}\n`);
265
+ process.stdout.write(`\r ${c.rose('✖')} ${label}${' '.repeat(14)}\n`);
116
266
  throw error;
117
267
  }
118
268
  }
119
269
 
120
270
  function printCard(title, rows) {
121
271
  const strip = s => String(s).replace(/\x1b\[[0-9;]*m/g, '');
122
- const width = Math.max(44, strip(title).length + 4, ...rows.map(r => strip(r).length + 4));
272
+ const width = Math.max(46, strip(title).length + 4, ...rows.map(r => strip(r).length + 4));
123
273
  const top = ` ${c.violet('╭─')} ${c.bold(c.white(title))} ${c.violet('─'.repeat(Math.max(1, width - strip(title).length - 3)) + '╮')}`;
124
274
  const bot = ` ${c.violet('╰' + '─'.repeat(width + 1) + '╯')}`;
125
275
  console.log('');
@@ -151,10 +301,10 @@ function checkUpdateNotice(currentVersion, labsDir) {
151
301
  } catch { /* ignore corrupt cache */ }
152
302
 
153
303
  if (cached && cached.latest && isNewerVersion(cached.latest, currentVersion)) {
154
- console.log(` ${c.amber('⬆')} ${c.bold(`Update available:`)} ${c.dim(currentVersion)} → ${c.mint(cached.latest)} ${c.dim('Run:')} ${c.cyan('labs update')}`);
304
+ console.log(` ${c.amber('⬆')} ${c.bold('Update available:')} ${c.dim(currentVersion)} → ${c.mint(cached.latest)} ${c.dim('Run:')} ${c.cyan('labs update')}`);
155
305
  }
156
306
 
157
- const stale = !cached || (Date.now() - (cached.checkedAt || 0)) > 24 * 3600e3;
307
+ const stale = !cached || (Date.now() - (cached.checkedAt || 0)) > 6 * 3600e3;
158
308
  if (stale && typeof fetch === 'function') {
159
309
  fetch('https://registry.npmjs.org/labs-claude/latest', { signal: AbortSignal.timeout(2500) })
160
310
  .then(r => (r.ok ? r.json() : null))
@@ -185,4 +335,4 @@ function runSelfUpdate(currentVersion) {
185
335
  console.log(`\n ${c.mint('✔')} Updated to latest! Close and reopen any open labs terminals.\n`);
186
336
  }
187
337
 
188
- module.exports = { c, KARPATHY_QUIPS, randomQuip, playMascotIntro, withSpinner, printCard, isNewerVersion, checkUpdateNotice, runSelfUpdate };
338
+ module.exports = { c, gradient, CHILL_QUIPS, randomQuip, playMascotIntro, askMasked, withSpinner, printCard, isNewerVersion, checkUpdateNotice, runSelfUpdate };