@exreve/exk 1.0.42 → 1.0.44

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.
@@ -146,6 +146,11 @@ const PROVIDERS = {
146
146
  baseUrl: 'https://api.minimax.io/anthropic',
147
147
  models: ['MiniMax-M2.7', 'MiniMax-M2.7-highspeed'],
148
148
  },
149
+ openrouter: {
150
+ apiKey: '', // Populated from ai-config.json openrouterApiKey (served by backend)
151
+ baseUrl: 'https://openrouter.ai/api',
152
+ models: ['gpt-oss-120b:cerebras'],
153
+ },
149
154
  };
150
155
  /** Resolve which provider to use based on model name or explicit provider ID.
151
156
  * 1. Populate provider API keys from ai-config.json (served by backend).
@@ -156,6 +161,7 @@ function resolveProvider(model, providerId) {
156
161
  // Populate provider keys from ai-config.json
157
162
  const aiConfig = loadAiConfig();
158
163
  PROVIDERS.minimax.apiKey = aiConfig.minimaxApiKey || process.env.MINIMAX_API_KEY || '';
164
+ PROVIDERS.openrouter.apiKey = aiConfig.openrouterApiKey || process.env.OPENROUTER_API_KEY || '';
159
165
  if (!PROVIDERS.zai.apiKey)
160
166
  PROVIDERS.zai.apiKey = aiConfig.apiKey || '';
161
167
  // 1. Explicit provider selection
@@ -262,6 +268,15 @@ function envForClaudeCodeChild(localModel, resolvedProvider) {
262
268
  env.ANTHROPIC_DEFAULT_HAIKU_MODEL = resolvedProvider.model;
263
269
  env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = '1';
264
270
  }
271
+ // For OpenRouter specifically: override ALL model aliases so the SDK
272
+ // sends the correct model ID to the Anthropic-compatible endpoint
273
+ if (resolvedProvider?.provider === 'openrouter') {
274
+ env.ANTHROPIC_MODEL = resolvedProvider.model;
275
+ env.ANTHROPIC_DEFAULT_SONNET_MODEL = resolvedProvider.model;
276
+ env.ANTHROPIC_DEFAULT_OPUS_MODEL = resolvedProvider.model;
277
+ env.ANTHROPIC_DEFAULT_HAIKU_MODEL = resolvedProvider.model;
278
+ env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = '1';
279
+ }
265
280
  // Apply proxy if enabled
266
281
  const proxyToggle = readProxyToggle();
267
282
  if (proxyToggle.enabled && proxy) {
@@ -697,6 +712,14 @@ export class AgentSessionManager {
697
712
  settingsEnv.ANTHROPIC_DEFAULT_HAIKU_MODEL = resolved.model;
698
713
  settingsEnv.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = '1';
699
714
  }
715
+ // For OpenRouter: also override all model aliases in settings
716
+ if (resolved.provider === 'openrouter') {
717
+ settingsEnv.ANTHROPIC_MODEL = resolved.model;
718
+ settingsEnv.ANTHROPIC_DEFAULT_SONNET_MODEL = resolved.model;
719
+ settingsEnv.ANTHROPIC_DEFAULT_OPUS_MODEL = resolved.model;
720
+ settingsEnv.ANTHROPIC_DEFAULT_HAIKU_MODEL = resolved.model;
721
+ settingsEnv.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = '1';
722
+ }
700
723
  effectiveSettings = { env: settingsEnv };
701
724
  console.log(`[agentSession] Provider: ${resolved.provider}, baseUrl: ${resolved.baseUrl}, model: ${resolved.model}`);
702
725
  }
@@ -190,6 +190,7 @@ function createBrowserQueryTool(config) {
190
190
  schema: z.string().optional().describe('JSON schema for structured output, as a JSON string (e.g. \'{"type":"object","properties":{"price":{"type":"number"}}}\')'),
191
191
  maxSteps: z.number().optional().describe('Max automation steps, default 20. Use lower values for simple tasks.'),
192
192
  country: z.string().optional().describe('2-letter country code for proxy and locale (e.g. "US", "GB", "DE"). Uses direct connection if omitted.'),
193
+ mobile: z.boolean().optional().describe('If true, use mobile viewport (390x844 — iPhone 14 dimensions) instead of desktop.'),
193
194
  }, async (args) => {
194
195
  const apiUrl = getApiUrl();
195
196
  // Read device ID for CLI auth
@@ -217,6 +218,8 @@ function createBrowserQueryTool(config) {
217
218
  }
218
219
  if (args.country)
219
220
  body.country = args.country;
221
+ if (args.mobile)
222
+ body.mobile = args.mobile;
220
223
  if (config.sessionId)
221
224
  body.sessionId = config.sessionId;
222
225
  if (config.promptId)
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exreve/exk",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "description": "exk - Control Claude CLI with voice and programmable interfaces",
5
5
  "type": "module",
6
6
  "bin": {