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 +10 -11
- package/package.json +1 -1
- package/src/gateway-client.js +26 -22
- package/src/ui.js +10 -3
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, '
|
|
316
|
-
console.log(` ${c.bold('
|
|
317
|
-
console.log(` ${c.cyan('1.')} ${c.bold('
|
|
318
|
-
console.log(` ${c.
|
|
319
|
-
console.log(` ${c.
|
|
320
|
-
console.log(` ${c.
|
|
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
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
package/src/gateway-client.js
CHANGED
|
@@ -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, '
|
|
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
|
-
|
|
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 (
|
|
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('✔')}
|
|
63
|
-
: ` ${c.mint('✔')}
|
|
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('✖')}
|
|
68
|
-
: ` ${c.rose('✖')} Could not
|
|
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 (
|
|
73
|
+
if (process.stdin.isTTY) {
|
|
75
74
|
console.log(`\n ${c.bold('Pick your default model:')}`);
|
|
76
|
-
console.log(` ${c.cyan('1.')} ${c.bold('
|
|
77
|
-
console.log(` ${c.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
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
|
|
92
|
+
else defaultEffort = 'high';
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
saveConfig({ ...stored, gatewayUrl: url, gatewayKey: key, defaultBoxModel, defaultEffort });
|
|
93
|
-
printCard('
|
|
94
|
-
`${c.mint('
|
|
95
|
-
`${c.mint('
|
|
96
|
-
`${c.mint('
|
|
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
|
|
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
|
|
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
|
|
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 };
|