scalemax 0.1.37 → 0.1.39

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.
File without changes
File without changes
@@ -4,9 +4,10 @@ import ora from 'ora';
4
4
  import { clients } from '../clients.js';
5
5
  import { SCALEMAX_BASE_URL } from '../constants.js';
6
6
  import { loadApiKey } from '../utils/keyStore.js';
7
- import { validateApiKey, isAnthropicModel, isModelRouteAvailable } from '../utils/api.js';
7
+ import { validateApiKey, isAnthropicModel, isModelRouteAvailable, AUTO_MODEL_ID } from '../utils/api.js';
8
8
  import { homeDir } from '../utils/paths.js';
9
9
  import { isExactChatCompletionsModelId } from '../configure/models.js';
10
+ import { isContinueEligibleModelId } from '../configure/continue.js';
10
11
  export async function detectAll(home = homeDir()) {
11
12
  const ctx = { home, platform: process.platform, env: process.env };
12
13
  return Promise.all(clients.map(c => c.detect(ctx)));
@@ -40,6 +41,24 @@ async function maybeLaunchCodex(chosen, successful, baseUrl = SCALEMAX_BASE_URL)
40
41
  }
41
42
  console.log('\nIf Codex asks for authentication,\nit should already be configured to use ScaleMax.\n\nIf you still see the official login screen,\nthe configuration is incomplete or Codex rejected the generated auth/config files.\n');
42
43
  }
44
+ /**
45
+ * Whether Claude Code specifically can reach a model, which is a narrower
46
+ * question than isAnthropicModel(). Auto is not made by Anthropic -- it is
47
+ * served by ScaleMax's own Kiro-backed stock, and modelPresentation.ts on the
48
+ * gateway is deliberate about never attributing it to a maker that did not
49
+ * build it. But Auto DOES speak the Anthropic Messages PROTOCOL: the gateway
50
+ * bridges every Auto request through /v1/messages (live-verified, 2026-08-08 --
51
+ * a real `claude -p` session against a ScaleMax-generated config answered
52
+ * correctly). Before this, an auto-api key's catalog (one model, `auto`,
53
+ * provider `scalemax`) failed isAnthropicModel entirely, so Claude Code was
54
+ * DETECTED but silently never configured -- no error, no explanation, just
55
+ * absent from the list of clients the installer touched. `auto` is therefore
56
+ * checked by id, not folded into isAnthropicModel itself, which stays reserved
57
+ * for "did Anthropic make this."
58
+ */
59
+ function reachableByClaudeCode(model) {
60
+ return isAnthropicModel(model) || model.id === AUTO_MODEL_ID;
61
+ }
43
62
  export function clientAllowedForModels(clientId, models) {
44
63
  models = models.filter(isModelRouteAvailable);
45
64
  if (!models.length)
@@ -50,9 +69,9 @@ export function clientAllowedForModels(clientId, models) {
50
69
  // OpenAI-compatible Chat Completions.
51
70
  const crossProtocolClients = new Set(['cursor', 'roo-code', 'cline', 'opencode', 'openclaw', 'hermes', 'cherry-studio', 'api-code']);
52
71
  if (clientId === 'continue')
53
- return models.some(model => isExactChatCompletionsModelId(model.id));
72
+ return models.some(model => isContinueEligibleModelId(model.id));
54
73
  if (clientId === 'claude')
55
- return models.some(isAnthropicModel);
74
+ return models.some(reachableByClaudeCode);
56
75
  if (clientId === 'codex')
57
76
  return models.some(model => !isAnthropicModel(model) && !isExactChatCompletionsModelId(model.id));
58
77
  if (clientId === 'hermes' && models.every(model => isExactChatCompletionsModelId(model.id)))