claude-scionos 4.1.7 → 4.1.8

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/routerlab.js +21 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-scionos",
3
- "version": "4.1.7",
3
+ "version": "4.1.8",
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
@@ -234,6 +234,23 @@ function hasVerifiedModelIds(modelIds) {
234
234
  return Array.isArray(modelIds) && modelIds.length > 0;
235
235
  }
236
236
 
237
+ function hasExploitableModelIds(modelIds, serviceValue = DEFAULT_SERVICE) {
238
+ if (!hasVerifiedModelIds(modelIds)) {
239
+ return false;
240
+ }
241
+
242
+ const serviceStrategies = getServiceStrategies(serviceValue);
243
+ const knownModelIds = new Set(
244
+ serviceStrategies.flatMap((strategy) => getRequiredModels(strategy)),
245
+ );
246
+
247
+ if (knownModelIds.size === 0) {
248
+ return false;
249
+ }
250
+
251
+ return modelIds.some((modelId) => knownModelIds.has(modelId));
252
+ }
253
+
237
254
  function assessStrategy(strategyValue, modelIds = [], serviceValue = DEFAULT_SERVICE) {
238
255
  const serviceLabel = getServiceLabel(serviceValue);
239
256
  const strategy = findStrategy(strategyValue, serviceValue);
@@ -256,7 +273,7 @@ function assessStrategy(strategyValue, modelIds = [], serviceValue = DEFAULT_SER
256
273
  };
257
274
  }
258
275
 
259
- if (!hasVerifiedModelIds(modelIds)) {
276
+ if (!hasExploitableModelIds(modelIds, serviceValue)) {
260
277
  return {
261
278
  available: true,
262
279
  level: 'unknown',
@@ -316,7 +333,7 @@ function assessStrategyLaunch(strategyValue, modelIds = [], serviceValue = DEFAU
316
333
  };
317
334
  }
318
335
 
319
- if (!requiredModels.length || !hasVerifiedModelIds(modelIds)) {
336
+ if (!requiredModels.length || !hasExploitableModelIds(modelIds, serviceValue)) {
320
337
  return {
321
338
  ready: availability.level !== 'unavailable',
322
339
  note: availability.note,
@@ -351,7 +368,7 @@ function assessStrategyLaunch(strategyValue, modelIds = [], serviceValue = DEFAU
351
368
  }
352
369
 
353
370
  function getFallbackStrategy(strategyValue, modelIds = [], serviceValue = DEFAULT_SERVICE) {
354
- if (hasVerifiedModelIds(modelIds)) {
371
+ if (hasExploitableModelIds(modelIds, serviceValue)) {
355
372
  return assessStrategyLaunch(strategyValue, modelIds, serviceValue).ready ? strategyValue : null;
356
373
  }
357
374
 
@@ -628,6 +645,7 @@ export {
628
645
  getServiceStrategies,
629
646
  getStoredToken,
630
647
  getStoredTokenStatus,
648
+ hasExploitableModelIds,
631
649
  getStrategyChoices,
632
650
  hasVerifiedModelIds,
633
651
  listStrategies,