claude-scionos 4.1.2 → 4.1.3

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/index.js CHANGED
@@ -41,6 +41,7 @@ import {
41
41
  getStoredToken,
42
42
  getStoredTokenStatus,
43
43
  getStrategyChoices,
44
+ hasVerifiedModelIds,
44
45
  listStrategies,
45
46
  storeToken,
46
47
  validateToken
@@ -147,7 +148,7 @@ function showStatus(label, level, detail) {
147
148
  }
148
149
 
149
150
  function getStrategyIndicator(strategyValue, modelIds, serviceValue) {
150
- if (!Array.isArray(modelIds)) {
151
+ if (!hasVerifiedModelIds(modelIds)) {
151
152
  return chalk.gray('●');
152
153
  }
153
154
 
@@ -394,7 +395,7 @@ async function resolveStrategyChoice(parsed, modelIds, serviceConfig) {
394
395
  throw new Error(`Strategy "${selected}" cannot support the default Claude Code launch on ${serviceConfig.availabilityLabel}. ${selectedLaunchReadiness.note}`);
395
396
  }
396
397
 
397
- if (Array.isArray(modelIds)) {
398
+ if (hasVerifiedModelIds(modelIds)) {
398
399
  const availability = assessStrategy(selected, modelIds, serviceConfig.value);
399
400
  if (availability.level === 'partial') {
400
401
  console.log(chalk.yellow(`⚠ Strategy "${selected}" is only partially available on ${serviceConfig.availabilityLabel}.`));
@@ -419,7 +420,7 @@ async function resolveStrategyChoice(parsed, modelIds, serviceConfig) {
419
420
 
420
421
  const strategyChoices = getStrategyChoices(modelIds, serviceConfig.value).map((choice) => {
421
422
  const launchReadiness = assessStrategyLaunch(choice.value, modelIds, serviceConfig.value);
422
- const disabled = Array.isArray(modelIds) && !launchReadiness.ready ? launchReadiness.note : false;
423
+ const disabled = hasVerifiedModelIds(modelIds) && !launchReadiness.ready ? launchReadiness.note : false;
423
424
 
424
425
  return {
425
426
  ...choice,
@@ -429,7 +430,7 @@ async function resolveStrategyChoice(parsed, modelIds, serviceConfig) {
429
430
  };
430
431
  });
431
432
 
432
- if (Array.isArray(modelIds) && strategyChoices.every((choice) => choice.disabled)) {
433
+ if (hasVerifiedModelIds(modelIds) && strategyChoices.every((choice) => choice.disabled)) {
433
434
  throw new Error(`No launchable strategy is available on ${serviceConfig.availabilityLabel}.`);
434
435
  }
435
436
 
@@ -450,7 +451,7 @@ function showStrategies(modelIds = null, serviceConfig) {
450
451
  const strategies = listStrategies(modelIds, serviceConfig.value);
451
452
  showSection('Strategies', strategies.map((strategy) => {
452
453
  const indicator = getStrategyIndicator(strategy.value, modelIds, serviceConfig.value);
453
- const state = !Array.isArray(modelIds)
454
+ const state = !hasVerifiedModelIds(modelIds)
454
455
  ? chalk.gray('Unknown')
455
456
  : assessStrategyLaunch(strategy.value, modelIds, serviceConfig.value).ready
456
457
  ? chalk.green('Ready')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-scionos",
3
- "version": "4.1.2",
3
+ "version": "4.1.3",
4
4
  "description": "RouterLab launcher, strategy proxy and secure token wrapper for Claude Code CLI",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/routerlab.js CHANGED
@@ -211,6 +211,10 @@ function getRequiredModels(strategy) {
211
211
  return strategy?.requiredModels ?? strategy?.mappedModels ?? [];
212
212
  }
213
213
 
214
+ function hasVerifiedModelIds(modelIds) {
215
+ return Array.isArray(modelIds) && modelIds.length > 0;
216
+ }
217
+
214
218
  function assessStrategy(strategyValue, modelIds = [], serviceValue = DEFAULT_SERVICE) {
215
219
  const serviceLabel = getServiceLabel(serviceValue);
216
220
  const strategy = findStrategy(strategyValue, serviceValue);
@@ -230,14 +234,14 @@ function assessStrategy(strategyValue, modelIds = [], serviceValue = DEFAULT_SER
230
234
  level: 'ready',
231
235
  note: 'Always available.',
232
236
  strategy,
233
- };
234
- }
235
-
236
- if (!Array.isArray(modelIds)) {
237
- return {
238
- available: true,
239
- level: 'unknown',
240
- note: 'Availability not verified.',
237
+ };
238
+ }
239
+
240
+ if (!hasVerifiedModelIds(modelIds)) {
241
+ return {
242
+ available: true,
243
+ level: 'unknown',
244
+ note: 'Availability not verified.',
241
245
  strategy,
242
246
  };
243
247
  }
@@ -293,7 +297,7 @@ function assessStrategyLaunch(strategyValue, modelIds = [], serviceValue = DEFAU
293
297
  };
294
298
  }
295
299
 
296
- if (!requiredModels.length || !Array.isArray(modelIds)) {
300
+ if (!requiredModels.length || !hasVerifiedModelIds(modelIds)) {
297
301
  return {
298
302
  ready: availability.level !== 'unavailable',
299
303
  note: availability.note,
@@ -328,7 +332,7 @@ function assessStrategyLaunch(strategyValue, modelIds = [], serviceValue = DEFAU
328
332
  }
329
333
 
330
334
  function getFallbackStrategy(strategyValue, modelIds = [], serviceValue = DEFAULT_SERVICE) {
331
- if (Array.isArray(modelIds)) {
335
+ if (hasVerifiedModelIds(modelIds)) {
332
336
  return assessStrategyLaunch(strategyValue, modelIds, serviceValue).ready ? strategyValue : null;
333
337
  }
334
338
 
@@ -588,7 +592,8 @@ export {
588
592
  getStoredToken,
589
593
  getStoredTokenStatus,
590
594
  getStrategyChoices,
591
- listStrategies,
592
- storeToken,
593
- validateToken,
594
- };
595
+ hasVerifiedModelIds,
596
+ listStrategies,
597
+ storeToken,
598
+ validateToken,
599
+ };