yymaxapi 1.0.53 → 1.0.55

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/bin/yymaxapi.js CHANGED
@@ -3397,44 +3397,55 @@ async function switchModel(paths) {
3397
3397
  return;
3398
3398
  }
3399
3399
 
3400
- // 已知 provider 别名映射
3401
- const PROVIDER_LABELS = {
3402
- 'claude-yunyi': '云翼 Claude (包月)',
3403
- 'yunyi': '云翼 Codex (包月)',
3404
- 'heibai': 'MAXAPI (按量)',
3405
- };
3400
+ const claudeApiConfig = API_CONFIG.claude;
3401
+ const codexApiConfig = API_CONFIG.codex;
3402
+ const claudeProviderName = claudeApiConfig.providerName;
3403
+ const codexProviderName = codexApiConfig.providerName;
3406
3404
 
3407
- // 收集所有 provider 的所有模型
3405
+ // 从预设模型列表构建选项(确保始终展示最新可用模型)
3408
3406
  const choices = [];
3409
- for (const [providerName, providerConfig] of Object.entries(providers)) {
3410
- const label = PROVIDER_LABELS[providerName] || providerName;
3411
- const models = providerConfig.models || [];
3412
- if (models.length === 0) continue;
3407
+ const listedKeys = new Set();
3413
3408
 
3414
- choices.push(new inquirer.Separator(` -- ${label} --`));
3415
- for (const m of models) {
3409
+ if (CLAUDE_MODELS.length > 0) {
3410
+ choices.push(new inquirer.Separator(' -- Claude --'));
3411
+ for (const m of CLAUDE_MODELS) {
3412
+ const providerName = providers[claudeProviderName] ? claudeProviderName : Object.keys(providers)[0];
3416
3413
  const modelKey = `${providerName}/${m.id}`;
3417
3414
  const isCurrent = modelKey === primary;
3418
3415
  choices.push({
3419
- name: isCurrent ? `${m.name || m.id} (当前)` : (m.name || m.id),
3416
+ name: isCurrent ? `${m.name} (当前)` : m.name,
3420
3417
  value: modelKey,
3421
3418
  });
3419
+ listedKeys.add(modelKey);
3422
3420
  }
3423
3421
  }
3424
3422
 
3425
- // 也把 agents.defaults.models 里注册过但 provider.models 里没列出的补上
3426
- const registeredKeys = Object.keys(config.agents?.defaults?.models || {});
3427
- const listedKeys = new Set(choices.filter(c => c.value).map(c => c.value));
3428
- for (const modelKey of registeredKeys) {
3429
- if (listedKeys.has(modelKey)) continue;
3430
- const [pName, mId] = modelKey.split('/');
3431
- if (!pName || !mId) continue;
3432
- const label = PROVIDER_LABELS[pName] || pName;
3433
- const isCurrent = modelKey === primary;
3434
- choices.push({
3435
- name: isCurrent ? `${label} / ${mId} (当前)` : `${label} / ${mId}`,
3436
- value: modelKey,
3437
- });
3423
+ if (CODEX_MODELS.length > 0) {
3424
+ choices.push(new inquirer.Separator(' -- GPT --'));
3425
+ for (const m of CODEX_MODELS) {
3426
+ const providerName = providers[codexProviderName] ? codexProviderName : Object.keys(providers)[0];
3427
+ const modelKey = `${providerName}/${m.id}`;
3428
+ const isCurrent = modelKey === primary;
3429
+ choices.push({
3430
+ name: isCurrent ? `${m.name} (当前)` : m.name,
3431
+ value: modelKey,
3432
+ });
3433
+ listedKeys.add(modelKey);
3434
+ }
3435
+ }
3436
+
3437
+ // 补上配置文件中已有但不在预设列表里的模型
3438
+ for (const [providerName, providerConfig] of Object.entries(providers)) {
3439
+ for (const m of (providerConfig.models || [])) {
3440
+ const modelKey = `${providerName}/${m.id}`;
3441
+ if (listedKeys.has(modelKey)) continue;
3442
+ const isCurrent = modelKey === primary;
3443
+ choices.push({
3444
+ name: isCurrent ? `${m.name || m.id} (当前)` : (m.name || m.id),
3445
+ value: modelKey,
3446
+ });
3447
+ listedKeys.add(modelKey);
3448
+ }
3438
3449
  }
3439
3450
 
3440
3451
  if (choices.filter(c => c.value).length === 0) {
@@ -24,15 +24,12 @@
24
24
  ],
25
25
  "models": {
26
26
  "claude": [
27
- { "id": "claude-opus-4-6", "name": "Claude Opus 4.6" },
28
- { "id": "claude-opus-4-6-Thinking", "name": "Claude Opus 4.6 Thinking" },
29
27
  { "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6" },
30
- { "id": "claude-sonnet-4-6-Thinking", "name": "Claude Sonnet 4.6 Thinking" },
31
- { "id": "claude-haiku-4-5", "name": "Claude Haiku 4.5" }
28
+ { "id": "claude-opus-4-6", "name": "Claude Opus 4.6 (待恢复)" }
32
29
  ],
33
30
  "codex": [
34
- { "id": "gpt-5.3-codex", "name": "GPT 5.3 Codex" },
35
- { "id": "gpt-5.2", "name": "GPT 5.2" }
31
+ { "id": "gpt-5.4", "name": "GPT 5.4" },
32
+ { "id": "gpt-5.4-pro", "name": "GPT 5.4 Pro (待支持)" }
36
33
  ]
37
34
  },
38
35
  "apiConfig": {
@@ -46,8 +43,8 @@
46
43
  "codex": {
47
44
  "urlSuffix": "/codex",
48
45
  "api": "openai-responses",
49
- "contextWindow": 128000,
50
- "maxTokens": 32768,
46
+ "contextWindow": 1050000,
47
+ "maxTokens": 128000,
51
48
  "providerName": "yunyi"
52
49
  }
53
50
  }
@@ -89,6 +86,6 @@ npx yymaxapi@latest
89
86
 
90
87
  **注意事项:**
91
88
  - `base_url` 不要加 `/v1`,平台会自动拼接 `/v1/messages`
92
- - 可用模型:`claude-opus-4-6`、`claude-opus-4-6-Thinking`、`claude-sonnet-4-6`、`claude-sonnet-4-6-Thinking`、`claude-haiku-4-5`
89
+ - 可用模型:`claude-sonnet-4-6`、`claude-opus-4-6`
93
90
  - 已验证环境:腾讯云 OpenCloudOS,OpenClaw `2026.2.3-1`
94
91
  - 参考文档:https://cloud.tencent.com/developer/article/2624003
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yymaxapi",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
4
4
  "description": "跨平台 OpenClaw/Clawdbot 配置管理工具 - 管理中转地址、模型切换、API Keys、测速优化",
5
5
  "main": "bin/yymaxapi.js",
6
6
  "bin": {