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.
Files changed (3) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/index.js +51 -18
  3. 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 chalk from 'chalk';
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 'cross-spawn';
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(" │ ") + p.bold("Scio") + s.bold("Nos") + w.bold(" ✕ ") + c.bold("Claude Code") + 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
- // Map any Claude model to our target
124
- // Claude Code usually requests 'claude-3-opus-...' or 'claude-3-5-sonnet...'
125
- // We force the target.
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} -> ${targetModel}`));
154
+ console.log(chalk.yellow(`[Proxy] Swapping model ${bodyJson.model} -> ${newModel}`));
128
155
  }
129
- bodyJson.model = targetModel;
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 Opus/Sonnet/Haiku natively)',
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: 'Kimi K2.5',
312
- value: 'kimi-k2.5',
313
- description: 'Force all requests to Kimi K2.5'
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: 'Force MiniMax-M2.1 (Map all models to MiniMax)',
317
- value: 'minimax-m2.1',
318
- description: 'Intercepts traffic and routes everything to MiniMax-M2.1'
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",
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.1.0",
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.0"
40
+ "which": "^6.0.1"
44
41
  },
45
42
  "devDependencies": {
46
- "@eslint/js": "^9.39.2",
47
- "eslint": "^9.39.2",
48
- "globals": "^17.0.0",
49
- "vitest": "^4.0.16"
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
  }