claude-scionos 4.3.5 → 4.5.0

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/README.fr.md CHANGED
@@ -67,21 +67,21 @@ npx claude-scionos --strategy aws --no-prompt -p "Résume ce dépôt"
67
67
  - `--service llm` bascule le lanceur vers `https://llm.routerlab.ch`
68
68
  - `llm` est prévu pour un accès sur invitation
69
69
  - les tokens enregistrés avec `auth login --service llm` sont stockés séparément du token RouterLab par défaut
70
- - `llm` expose pour l'instant `claude`, `claude-gpt`, `claude-gpt-special` et `deepseek-v4-beta`
71
- - `routerlab` expose aussi `claude-gpt`, `claude-minimax-m2.7` et `claude-glm-5.1`
70
+ - `llm` expose pour l'instant `claude`, `claude-gpt`, `claude-gpt-special`, `deepseek-v4-beta` et `claude-minimax-m2.7`
71
+ - `routerlab` expose aussi `claude-gpt`, `claude-kimi-k2.6`, `claude-minimax-m2.7` et `claude-glm-5.1`
72
72
 
73
73
  ## Stratégies
74
74
 
75
75
  - `default` : utilise Claude Code normalement sans proxy local
76
- - `aws` : remappe les familles de modèles Claude vers les variantes Claude AWS de RouterLab
77
- - `claude` : remappe les familles de modèles Claude sur `--service llm` vers les variantes Claude standard `claude-haiku-4-5-20251001`, `claude-sonnet-4-6` et `claude-opus-4-6`
78
- - `claude-gpt` : mappe les requêtes Claude vers la famille `claude-gpt`
79
- `claude-gpt-5.5 ==> claude-opus-4.7`, `claude-gpt-5.4 ==> claude-sonnet-4.6`, `claude-gpt-5.4-mini ==> claude-gpt-5.4-mini`
80
- - `claude-gpt-special` : sur `--service llm`, force toutes les requêtes vers `claude-gpt-5.4-sp`
81
- - `deepseek-v4-beta` : sur `--service llm`, mappe les requêtes Claude vers `claude-deepseek-v4-pro` pour opus et `claude-deepseek-v4-flash` pour sonnet ou haiku
82
- - `claude-qwen3.6-plus` : force toutes les requêtes vers `claude-qwen3.6-plus`
83
- - `claude-minimax-m2.7` : force toutes les requêtes vers `claude-minimax-m2.7`
84
- - `claude-glm-5.1` : force toutes les requêtes vers `claude-glm-5.1`
76
+ - `aws` : remappe les familles de modèles Claude vers les variantes Claude AWS de RouterLab
77
+ - `claude` : remappe les familles de modèles Claude sur `--service llm` vers les variantes Claude standard `claude-haiku-4-5-20251001`, `claude-sonnet-4-6` et `claude-opus-4-6`
78
+ - `claude-gpt` : mappe les requêtes Claude vers la famille `claude-gpt`
79
+ les requêtes Opus sont mappées vers `claude-gpt-5.5`, les requêtes Sonnet vers `claude-gpt-5.4` et les requêtes Haiku vers `claude-gpt-5.4-mini`
80
+ - `claude-gpt-special` : sur `--service llm`, force toutes les requêtes vers `claude-gpt-5.4-sp`
81
+ - `deepseek-v4-beta` : sur `--service llm`, mappe les requêtes Claude vers `claude-deepseek-v4-pro` pour opus ou sonnet et `claude-deepseek-v4-flash` pour haiku
82
+ - `claude-kimi-k2.6` : force toutes les requêtes vers `claude-kimi-k2.6`
83
+ - `claude-minimax-m2.7` : force toutes les requêtes vers `claude-minimax-m2.7`
84
+ - `claude-glm-5.1` : force toutes les requêtes vers `claude-glm-5.1`
85
85
 
86
86
  Utilise `--list-strategies` pour voir les stratégies disponibles pour le service choisi et leur disponibilité réelle quand un token est disponible.
87
87
 
package/README.md CHANGED
@@ -67,21 +67,21 @@ npx claude-scionos --strategy aws --no-prompt -p "Summarize this repo"
67
67
  - `--service llm` switches the launcher to `https://llm.routerlab.ch`
68
68
  - `llm` is intended for invitation-only access
69
69
  - Tokens stored with `auth login --service llm` are kept separate from the default RouterLab token
70
- - `llm` currently exposes `claude`, `claude-gpt`, `claude-gpt-special`, and `deepseek-v4-beta`
71
- - `routerlab` also exposes `claude-gpt`, `claude-minimax-m2.7`, and `claude-glm-5.1`
70
+ - `llm` currently exposes `claude`, `claude-gpt`, `claude-gpt-special`, `deepseek-v4-beta`, and `claude-minimax-m2.7`
71
+ - `routerlab` also exposes `claude-gpt`, `claude-kimi-k2.6`, `claude-minimax-m2.7`, and `claude-glm-5.1`
72
72
 
73
73
  ## Strategies
74
74
 
75
75
  - `default`: use Claude Code normally without the local proxy
76
- - `aws`: remap Claude model families to RouterLab AWS-backed Claude variants
77
- - `claude`: remap Claude model families on `--service llm` to the standard Claude variants `claude-haiku-4-5-20251001`, `claude-sonnet-4-6`, and `claude-opus-4-6`
78
- - `claude-gpt`: map Claude requests to the `claude-gpt` family
79
- `claude-gpt-5.5 ==> claude-opus-4.7`, `claude-gpt-5.4 ==> claude-sonnet-4.6`, `claude-gpt-5.4-mini ==> claude-gpt-5.4-mini`
80
- - `claude-gpt-special`: on `--service llm`, force all requests to `claude-gpt-5.4-sp`
81
- - `deepseek-v4-beta`: on `--service llm`, map Claude requests to `claude-deepseek-v4-pro` for opus and `claude-deepseek-v4-flash` for sonnet or haiku
82
- - `claude-qwen3.6-plus`: force all requests to `claude-qwen3.6-plus`
83
- - `claude-minimax-m2.7`: force all requests to `claude-minimax-m2.7`
84
- - `claude-glm-5.1`: force all requests to `claude-glm-5.1`
76
+ - `aws`: remap Claude model families to RouterLab AWS-backed Claude variants
77
+ - `claude`: remap Claude model families on `--service llm` to the standard Claude variants `claude-haiku-4-5-20251001`, `claude-sonnet-4-6`, and `claude-opus-4-6`
78
+ - `claude-gpt`: map Claude requests to the `claude-gpt` family
79
+ Opus requests map to `claude-gpt-5.5`, Sonnet requests map to `claude-gpt-5.4`, and Haiku requests map to `claude-gpt-5.4-mini`
80
+ - `claude-gpt-special`: on `--service llm`, force all requests to `claude-gpt-5.4-sp`
81
+ - `deepseek-v4-beta`: on `--service llm`, map Claude requests to `claude-deepseek-v4-pro` for opus or sonnet and `claude-deepseek-v4-flash` for haiku
82
+ - `claude-kimi-k2.6`: force all requests to `claude-kimi-k2.6`
83
+ - `claude-minimax-m2.7`: force all requests to `claude-minimax-m2.7`
84
+ - `claude-glm-5.1`: force all requests to `claude-glm-5.1`
85
85
 
86
86
  Use `--list-strategies` to see the strategies available for the selected service and their live availability when a token is available.
87
87
 
package/index.js CHANGED
@@ -52,6 +52,23 @@ import { startProxyServer } from './src/proxy.js';
52
52
 
53
53
  const require = createRequire(import.meta.url);
54
54
  const pkg = require('./package.json');
55
+ const SIGNAL_EXIT_CODES = {
56
+ SIGHUP: 129,
57
+ SIGINT: 130,
58
+ SIGQUIT: 131,
59
+ SIGILL: 132,
60
+ SIGTRAP: 133,
61
+ SIGABRT: 134,
62
+ SIGBUS: 135,
63
+ SIGFPE: 136,
64
+ SIGKILL: 137,
65
+ SIGUSR1: 138,
66
+ SIGSEGV: 139,
67
+ SIGUSR2: 140,
68
+ SIGPIPE: 141,
69
+ SIGALRM: 142,
70
+ SIGTERM: 143
71
+ };
55
72
 
56
73
  function normalizeEntrypointPath(candidate) {
57
74
  if (!candidate) {
@@ -68,6 +85,40 @@ function normalizeEntrypointPath(candidate) {
68
85
  }
69
86
  }
70
87
 
88
+ function shouldSpawnWithShell(commandPath) {
89
+ if (process.platform !== 'win32') {
90
+ return false;
91
+ }
92
+
93
+ const extension = path.extname(commandPath || '').toLowerCase();
94
+ return extension === '.cmd' || extension === '.bat';
95
+ }
96
+
97
+ function resolveProcessExitCode(code, signal) {
98
+ if (typeof code === 'number') {
99
+ return code;
100
+ }
101
+
102
+ if (signal) {
103
+ return SIGNAL_EXIT_CODES[signal] ?? 1;
104
+ }
105
+
106
+ return 1;
107
+ }
108
+
109
+ function createCleanupOnce(cleanup) {
110
+ let cleaned = false;
111
+
112
+ return () => {
113
+ if (cleaned) {
114
+ return;
115
+ }
116
+
117
+ cleaned = true;
118
+ cleanup();
119
+ };
120
+ }
121
+
71
122
  // --- UTILS ---
72
123
 
73
124
  function showBanner() {
@@ -184,6 +235,23 @@ function resolveSelectedService(serviceValue) {
184
235
  throw new Error(`Unknown service "${serviceValue}". Supported values: ${supported}.`);
185
236
  }
186
237
 
238
+ function getRequiredOptionValue(argv, index, optionName) {
239
+ const value = argv[index + 1];
240
+ if (!value || value.startsWith('--')) {
241
+ throw new Error(`${optionName} requires a value.`);
242
+ }
243
+
244
+ return value;
245
+ }
246
+
247
+ function getRequiredInlineOptionValue(value, optionName) {
248
+ if (!value) {
249
+ throw new Error(`${optionName} requires a value.`);
250
+ }
251
+
252
+ return value;
253
+ }
254
+
187
255
  function parseWrapperArgs(argv) {
188
256
  const parsed = {
189
257
  authAction: 'status',
@@ -201,6 +269,11 @@ function parseWrapperArgs(argv) {
201
269
  for (let index = 0; index < argv.length; index += 1) {
202
270
  const arg = argv[index];
203
271
 
272
+ if (arg === '--') {
273
+ parsed.claudeArgs.push(...argv.slice(index + 1));
274
+ break;
275
+ }
276
+
204
277
  if ((arg === 'doctor' || arg === 'auth') && parsed.command === null && parsed.claudeArgs.length === 0) {
205
278
  parsed.command = arg;
206
279
  if (arg === 'auth') {
@@ -224,24 +297,24 @@ function parseWrapperArgs(argv) {
224
297
  }
225
298
 
226
299
  if (arg === '--strategy') {
227
- parsed.strategy = normalizeStrategyValue(argv[index + 1]);
300
+ parsed.strategy = normalizeStrategyValue(getRequiredOptionValue(argv, index, '--strategy'));
228
301
  index += 1;
229
302
  continue;
230
303
  }
231
304
 
232
305
  if (arg === '--service') {
233
- parsed.service = normalizeServiceValue(argv[index + 1]);
306
+ parsed.service = normalizeServiceValue(getRequiredOptionValue(argv, index, '--service'));
234
307
  index += 1;
235
308
  continue;
236
309
  }
237
310
 
238
311
  if (arg.startsWith('--strategy=')) {
239
- parsed.strategy = normalizeStrategyValue(arg.slice('--strategy='.length));
312
+ parsed.strategy = normalizeStrategyValue(getRequiredInlineOptionValue(arg.slice('--strategy='.length), '--strategy'));
240
313
  continue;
241
314
  }
242
315
 
243
316
  if (arg.startsWith('--service=')) {
244
- parsed.service = normalizeServiceValue(arg.slice('--service='.length));
317
+ parsed.service = normalizeServiceValue(getRequiredInlineOptionValue(arg.slice('--service='.length), '--service'));
245
318
  continue;
246
319
  }
247
320
 
@@ -255,7 +328,7 @@ function parseWrapperArgs(argv) {
255
328
  continue;
256
329
  }
257
330
 
258
- if (arg === '--scionos-debug') {
331
+ if (arg === '--scionos-debug' || arg === '--scionos') {
259
332
  parsed.debug = true;
260
333
  continue;
261
334
  }
@@ -562,15 +635,12 @@ async function runDoctor(serviceConfig) {
562
635
  showStatus('Env token', getEnvironmentToken() ? 'ok' : 'warn', getEnvironmentToken() ? 'available' : 'not set');
563
636
  console.log('');
564
637
 
565
- const envToken = getEnvironmentToken();
566
- const candidate = envToken
567
- ? { token: envToken, source: 'environment' }
568
- : { token: null, source: storedStatus.stored ? 'secure-store' : 'none' };
638
+ const candidate = getAvailableTokenCandidate(serviceConfig.value);
569
639
  let validation = null;
570
640
 
571
641
  if (!candidate.token) {
572
- showStatus(`${serviceConfig.tokenPromptLabel} auth`, 'warn', storedStatus.stored
573
- ? 'Skipped: stored token available but not validated during doctor on Windows'
642
+ showStatus(`${serviceConfig.tokenPromptLabel} auth`, 'warn', candidate.source === 'secure-store-error'
643
+ ? 'Skipped: stored token is present but could not be read'
574
644
  : 'Skipped: no environment or stored token available');
575
645
  } else {
576
646
  validation = await validateToken(candidate.token, {
@@ -714,6 +784,9 @@ async function main() {
714
784
  proxyServer = proxyInfo.server;
715
785
  finalBaseUrl = proxyInfo.url; // e.g. http://127.0.0.1:54321
716
786
  if (interactive && isDebug) console.log(chalk.gray(`✓ Proxy listening on ${finalBaseUrl}`));
787
+ if (interactive && isDebug && !proxyInfo.authenticated) {
788
+ console.log(chalk.yellow('WARN Proxy authentication is not enabled because Claude Code header injection is not verified; binding remains limited to 127.0.0.1.'));
789
+ }
717
790
  }
718
791
 
719
792
  const env = {
@@ -737,19 +810,19 @@ async function main() {
737
810
  const child = spawn(claudeStatus.cliPath, parsed.claudeArgs, {
738
811
  stdio: 'inherit',
739
812
  env: env,
740
- shell: process.platform === 'win32'
813
+ shell: shouldSpawnWithShell(claudeStatus.cliPath)
741
814
  });
742
815
 
743
- const cleanup = () => {
816
+ const cleanup = createCleanupOnce(() => {
744
817
  if (proxyServer) {
745
818
  if (interactive && isDebug) console.log(chalk.gray('\nStopping proxy server...'));
746
819
  proxyServer.close();
747
820
  }
748
- };
821
+ });
749
822
 
750
- child.on('exit', (code) => {
823
+ child.on('exit', (code, signal) => {
751
824
  cleanup();
752
- process.exit(code ?? 0);
825
+ process.exit(resolveProcessExitCode(code, signal));
753
826
  });
754
827
 
755
828
  child.on('error', (err) => {
@@ -772,7 +845,7 @@ async function main() {
772
845
  process.on('SIGTERM', () => {
773
846
  if (child) child.kill('SIGTERM');
774
847
  cleanup();
775
- process.exit(0);
848
+ process.exit(resolveProcessExitCode(null, 'SIGTERM'));
776
849
  });
777
850
  }
778
851
 
@@ -787,9 +860,13 @@ if (isEntrypoint) {
787
860
 
788
861
  export {
789
862
  canProceedWithValidation,
863
+ createCleanupOnce,
790
864
  installClaudeCode,
791
865
  main,
792
866
  normalizeEntrypointPath,
867
+ parseWrapperArgs,
868
+ resolveProcessExitCode,
793
869
  resolveLaunchToken,
870
+ shouldSpawnWithShell,
794
871
  validateToken
795
872
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-scionos",
3
- "version": "4.3.5",
3
+ "version": "4.5.0",
4
4
  "description": "RouterLab launcher, strategy proxy and secure token wrapper for Claude Code CLI",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -47,8 +47,8 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@eslint/js": "^10.0.1",
50
- "eslint": "^10.2.1",
51
- "globals": "^17.5.0",
50
+ "eslint": "^10.3.0",
51
+ "globals": "^17.6.0",
52
52
  "vitest": "^4.1.5"
53
53
  }
54
54
  }