claude-scionos 3.0.3 → 3.0.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.
- package/CHANGELOG.md +15 -0
- package/index.js +51 -18
- package/package.json +7 -10
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.0.5] - 2026-03-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Dynamic AWS Models**: Integrated dynamic routing for AWS 50% discount models (`haiku`, `sonnet`, `opus`) in the local proxy.
|
|
12
|
+
- **Model Selection**: Cleaned up the initial prompt menu to offer 4 robust strategic choices including GLM-5 and MiniMax M2.5.
|
|
13
|
+
|
|
14
|
+
## [3.0.4] - 2026-03-16
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- **Dependencies**: Replaced `chalk`, `cross-spawn`, and `undici` with Node.js >= 22 native APIs (`util.styleText`, `child_process.spawn`, `fetch`).
|
|
18
|
+
- **Dependencies**: Updated development and production packages to the latest versions.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **Code Quality**: Fixed `Token` ESLint assignment warnings and improved formatting compatibility.
|
|
22
|
+
|
|
8
23
|
## [3.0.3] - 2026-02-18
|
|
9
24
|
|
|
10
25
|
### Changed
|
package/index.js
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { styleText } from 'node:util';
|
|
4
|
+
const chalk = {
|
|
5
|
+
hex: (color) => {
|
|
6
|
+
if (color === '#3b82f6') return (t) => styleText('blueBright', t);
|
|
7
|
+
if (color === '#a855f7') return (t) => styleText('magentaBright', t);
|
|
8
|
+
if (color === '#D97757') return (t) => styleText('redBright', t);
|
|
9
|
+
return (t) => t;
|
|
10
|
+
},
|
|
11
|
+
white: (t) => styleText('white', t),
|
|
12
|
+
gray: (t) => styleText('gray', t),
|
|
13
|
+
yellow: (t) => styleText('yellow', t),
|
|
14
|
+
red: (t) => styleText('red', t),
|
|
15
|
+
cyan: (t) => styleText('cyan', t),
|
|
16
|
+
redBright: (t) => styleText('redBright', t),
|
|
17
|
+
blueBright: (t) => styleText('blueBright', t),
|
|
18
|
+
green: (t) => styleText('green', t),
|
|
19
|
+
magenta: (t) => styleText('magenta', t),
|
|
20
|
+
bold: (t) => styleText('bold', t)
|
|
21
|
+
};
|
|
4
22
|
import { password, confirm, select } from '@inquirer/prompts';
|
|
5
|
-
import spawn from '
|
|
23
|
+
import { spawn } from 'node:child_process';
|
|
6
24
|
import updateNotifier from 'update-notifier';
|
|
7
25
|
import process from 'node:process';
|
|
8
26
|
import http from 'node:http';
|
|
@@ -35,7 +53,7 @@ function showBanner() {
|
|
|
35
53
|
console.log("");
|
|
36
54
|
console.log(border(" ┌──────────────────────────────────────────────────────────┐"));
|
|
37
55
|
console.log(border(" │ │"));
|
|
38
|
-
console.log(border(" │ ") +
|
|
56
|
+
console.log(border(" │ ") + chalk.bold(p("Scio")) + chalk.bold(s("Nos")) + chalk.bold(w(" ✕ ")) + chalk.bold(c("Claude Code")) + border(" │"));
|
|
39
57
|
console.log(border(" │ │"));
|
|
40
58
|
console.log(border(" └──────────────────────────────────────────────────────────┘"));
|
|
41
59
|
console.log(g(` v${pkg.version}`));
|
|
@@ -120,13 +138,22 @@ function startProxyServer(targetModel, validToken) {
|
|
|
120
138
|
|
|
121
139
|
// THE MAGIC: Swap the model
|
|
122
140
|
if (bodyJson && bodyJson.model) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
141
|
+
let newModel = targetModel;
|
|
142
|
+
if (targetModel === 'aws') {
|
|
143
|
+
if (bodyJson.model.includes('haiku')) {
|
|
144
|
+
newModel = 'aws-claude-haiku-4-5-20251001';
|
|
145
|
+
} else if (bodyJson.model.includes('opus')) {
|
|
146
|
+
newModel = 'aws-claude-opus-4-6';
|
|
147
|
+
} else {
|
|
148
|
+
// Default to sonnet for AWS if not haiku or opus
|
|
149
|
+
newModel = 'aws-claude-sonnet-4-6';
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
126
153
|
if (process.argv.includes('--scionos-debug')) {
|
|
127
|
-
console.log(chalk.yellow(`[Proxy] Swapping model ${bodyJson.model} -> ${
|
|
154
|
+
console.log(chalk.yellow(`[Proxy] Swapping model ${bodyJson.model} -> ${newModel}`));
|
|
128
155
|
}
|
|
129
|
-
bodyJson.model =
|
|
156
|
+
bodyJson.model = newModel;
|
|
130
157
|
}
|
|
131
158
|
|
|
132
159
|
// Prepare upstream request
|
|
@@ -247,7 +274,7 @@ if (!claudeStatus.installed) {
|
|
|
247
274
|
if (shouldInstall) {
|
|
248
275
|
try {
|
|
249
276
|
console.log(chalk.cyan('\n📦 Installing @anthropic-ai/claude-code...'));
|
|
250
|
-
spawn.sync('npm', ['install', '-g', '@anthropic-ai/claude-code'], { stdio: 'inherit' });
|
|
277
|
+
spawn.sync('npm', ['install', '-g', '@anthropic-ai/claude-code'], { stdio: 'inherit', shell: process.platform === 'win32' });
|
|
251
278
|
claudeStatus = isClaudeCodeInstalled();
|
|
252
279
|
if (!claudeStatus.installed) {
|
|
253
280
|
console.warn(chalk.yellow('⚠ Installation finished, but executable not found immediately. Restart terminal recommended.'));
|
|
@@ -275,7 +302,7 @@ if (process.platform === 'win32') {
|
|
|
275
302
|
}
|
|
276
303
|
|
|
277
304
|
// 3. Token Loop
|
|
278
|
-
let token
|
|
305
|
+
let token;
|
|
279
306
|
while (true) {
|
|
280
307
|
console.log(chalk.blueBright("To retrieve your token, visit: https://routerlab.ch/keys"));
|
|
281
308
|
token = await password({
|
|
@@ -303,19 +330,24 @@ const modelChoice = await select({
|
|
|
303
330
|
message: 'Select Model Strategy:',
|
|
304
331
|
choices: [
|
|
305
332
|
{
|
|
306
|
-
name: 'Default (Use Claude
|
|
333
|
+
name: 'Default (Use Claude natively)',
|
|
307
334
|
value: 'default',
|
|
308
335
|
description: 'Standard behavior. Claude decides which model to use.'
|
|
309
336
|
},
|
|
310
337
|
{
|
|
311
|
-
name: '
|
|
312
|
-
value: '
|
|
313
|
-
description: '
|
|
338
|
+
name: 'Claude AWS (-50% du prix 💰)',
|
|
339
|
+
value: 'aws',
|
|
340
|
+
description: 'Map models to aws-claude-haiku, aws-claude-sonnet, aws-claude-opus'
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: 'GLM-5',
|
|
344
|
+
value: 'glm-5',
|
|
345
|
+
description: 'Remplace tous les modèles par glm-5'
|
|
314
346
|
},
|
|
315
347
|
{
|
|
316
|
-
name: '
|
|
317
|
-
value: 'minimax-m2.
|
|
318
|
-
description: '
|
|
348
|
+
name: 'MiniMax M2.5',
|
|
349
|
+
value: 'minimax-m2.5',
|
|
350
|
+
description: 'Remplace tous les modèles par minimax-m2.5'
|
|
319
351
|
}
|
|
320
352
|
]
|
|
321
353
|
});
|
|
@@ -357,7 +389,8 @@ console.log(chalk.green(`\n🚀 Launching Claude Code [${modelChoice}]...\n`));
|
|
|
357
389
|
|
|
358
390
|
const child = spawn(claudeStatus.cliPath, args, {
|
|
359
391
|
stdio: 'inherit',
|
|
360
|
-
env: env
|
|
392
|
+
env: env,
|
|
393
|
+
shell: process.platform === 'win32'
|
|
361
394
|
});
|
|
362
395
|
|
|
363
396
|
// 7. Cleanup Handlers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-scionos",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Ephemeral and secure runner for Claude Code CLI in ScioNos environment",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,17 +35,14 @@
|
|
|
35
35
|
},
|
|
36
36
|
"private": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@inquirer/prompts": "^8.
|
|
39
|
-
"chalk": "^5.6.2",
|
|
40
|
-
"cross-spawn": "^7.0.6",
|
|
41
|
-
"undici": "^7.18.2",
|
|
38
|
+
"@inquirer/prompts": "^8.3.2",
|
|
42
39
|
"update-notifier": "^7.3.1",
|
|
43
|
-
"which": "^6.0.
|
|
40
|
+
"which": "^6.0.1"
|
|
44
41
|
},
|
|
45
42
|
"devDependencies": {
|
|
46
|
-
"@eslint/js": "^
|
|
47
|
-
"eslint": "^
|
|
48
|
-
"globals": "^17.
|
|
49
|
-
"vitest": "^4.0
|
|
43
|
+
"@eslint/js": "^10.0.1",
|
|
44
|
+
"eslint": "^10.0.3",
|
|
45
|
+
"globals": "^17.4.0",
|
|
46
|
+
"vitest": "^4.1.0"
|
|
50
47
|
}
|
|
51
48
|
}
|