yingclaw 1.6.2 → 1.6.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.
Files changed (2) hide show
  1. package/lib/config.js +14 -2
  2. package/package.json +1 -1
package/lib/config.js CHANGED
@@ -12,8 +12,8 @@ const PROVIDERS = {
12
12
  modelsUrl: 'https://api.deepseek.com/v1/models',
13
13
  fastModel: 'deepseek-v4-flash',
14
14
  models: [
15
- { name: 'DeepSeek V4 Flash(快速)', value: 'deepseek-v4-flash' },
16
15
  { name: 'DeepSeek V4 Pro(强力)', value: 'deepseek-v4-pro[1m]' },
16
+ { name: 'DeepSeek V4 Flash(快速)', value: 'deepseek-v4-flash' },
17
17
  ],
18
18
  },
19
19
  qwen: {
@@ -57,6 +57,17 @@ const PROVIDERS = {
57
57
  },
58
58
  };
59
59
 
60
+ function normalizeModelIds(providerKey, ids) {
61
+ if (providerKey !== 'deepseek') return ids;
62
+
63
+ const mapped = ids.map((id) => id === 'deepseek-v4-pro' ? 'deepseek-v4-pro[1m]' : id);
64
+ const preferred = ['deepseek-v4-pro[1m]', 'deepseek-v4-flash'];
65
+ return [
66
+ ...preferred.filter((id) => mapped.includes(id)),
67
+ ...mapped.filter((id) => !preferred.includes(id)),
68
+ ];
69
+ }
70
+
60
71
  // 联网拉取厂商支持的模型列表,失败返回 null
61
72
  function fetchModels(providerKey, apiKey) {
62
73
  return new Promise((resolve) => {
@@ -86,7 +97,7 @@ function fetchModels(providerKey, apiKey) {
86
97
  const list = parsed.data || parsed.models || [];
87
98
  const ids = list.map(m => m.id || m.model || m.name).filter(Boolean);
88
99
  if (ids.length === 0) return resolve(null);
89
- resolve(ids);
100
+ resolve(normalizeModelIds(providerKey, ids));
90
101
  } catch {
91
102
  resolve(null);
92
103
  }
@@ -245,6 +256,7 @@ module.exports = {
245
256
  fetchModels,
246
257
  resetConfig,
247
258
  validateConfig,
259
+ normalizeModelIds,
248
260
  resolveFastModel,
249
261
  providerKeyFromBaseUrl,
250
262
  buildClaudeEnv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yingclaw",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Claude Code × 国产大模型一键接入:DeepSeek、Qwen、MiniMax、GLM、MiMo",
5
5
  "main": "index.js",
6
6
  "bin": {