yingclaw 2.5.7 → 2.5.11

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/README.md CHANGED
@@ -62,7 +62,7 @@ claw gateway
62
62
  | 阿里云百炼 | qwen3-max | qwen3.5-plus |
63
63
  | MiniMax | MiniMax-M2.7 | MiniMax-M2.7-Turbo |
64
64
  | 智谱 GLM | GLM-4.7 | GLM-5-Turbo |
65
- | 小米 MiMo | mimo-v2.5-pro | mimo-v2-flash |
65
+ | 小米 MiMo | mimo-v2.5-pro | mimo-v2.5 |
66
66
  | 自定义接口 | 自动获取或手动输入 | — |
67
67
 
68
68
  DeepSeek 的 `[1m]` 后缀是真实 API 模型 ID,表示 100 万 token 上下文窗口([官方说明](https://api-docs.deepseek.com/zh-cn/quick_start/agent_integrations/claude_code))。
package/lib/config.js CHANGED
@@ -75,7 +75,7 @@ const PROVIDERS = {
75
75
  name: '小米 MiMo',
76
76
  baseUrl: 'https://api.xiaomimimo.com/anthropic',
77
77
  modelsUrl: 'https://api.xiaomimimo.com/v1/models',
78
- fastModel: 'mimo-v2-flash',
78
+ fastModel: 'mimo-v2.5',
79
79
  models: [
80
80
  { name: 'MiMo V2.5 Pro(旗舰)', value: 'mimo-v2.5-pro' },
81
81
  { name: 'MiMo V2.5(均衡)', value: 'mimo-v2.5' },
package/lib/desktop.js CHANGED
@@ -22,6 +22,12 @@ const DESKTOP_GATEWAY_KEYS = [
22
22
  'disableDeploymentModeChooser',
23
23
  'deploymentOrganizationUuid',
24
24
  ];
25
+ const MAC_POLICY_KEYS = [
26
+ ...DESKTOP_GATEWAY_KEYS,
27
+ 'inferenceGatewayHeaders',
28
+ 'isClaudeCodeForDesktopEnabled',
29
+ 'coworkEgressAllowedHosts',
30
+ ];
25
31
 
26
32
  function buildRuntimeEnterpriseConfig(entry) {
27
33
  return {
@@ -109,6 +115,13 @@ function buildClaudeDesktopMacDefaultsCommands(entry) {
109
115
  ];
110
116
  }
111
117
 
118
+ function buildClaudeDesktopMacDefaultsDeleteCommands() {
119
+ return MAC_POLICY_KEYS.map((key) => ({
120
+ command: 'defaults',
121
+ args: ['delete', MAC_POLICY_BUNDLE, key],
122
+ }));
123
+ }
124
+
112
125
  function writeClaudeDesktopMacDefaults(entry) {
113
126
  for (const { command, args } of buildClaudeDesktopMacDefaultsCommands(entry)) {
114
127
  const result = spawnSync(command, args, { encoding: 'utf8' });
@@ -118,6 +131,13 @@ function writeClaudeDesktopMacDefaults(entry) {
118
131
  }
119
132
  }
120
133
 
134
+ function clearClaudeDesktopMacDefaults(options = {}) {
135
+ const runner = options.runner || spawnSync;
136
+ for (const { command, args } of buildClaudeDesktopMacDefaultsDeleteCommands()) {
137
+ runner(command, args, { encoding: 'utf8', stdio: 'pipe' });
138
+ }
139
+ }
140
+
121
141
  function buildClaudeDesktopEnterpriseConfig(config, options = {}) {
122
142
  const gatewayConfig = ensureDesktopGatewayConfig(config, options);
123
143
  const models = serializeGatewayModels(gatewayConfig);
@@ -282,9 +302,16 @@ function clearClaudeDesktopConfig(options = {}) {
282
302
 
283
303
  // Clear configLibrary regardless of whether the main config file exists
284
304
  const libResult = clearClaudeDesktopConfigLibrary({ ...options, dataDir });
305
+ const shouldClearPlatformPolicy = (options.platform || process.platform) === 'darwin'
306
+ && !options.dataDir
307
+ && !options.configFile
308
+ && options.writePlatformPolicy !== false;
309
+ if (shouldClearPlatformPolicy) {
310
+ clearClaudeDesktopMacDefaults(options);
311
+ }
285
312
 
286
313
  if (!file || !fs.existsSync(file)) {
287
- return { result: libResult.result === 'updated' ? 'updated' : 'missing', file, dataDir };
314
+ return { result: libResult.result === 'updated' || shouldClearPlatformPolicy ? 'updated' : 'missing', file, dataDir };
288
315
  }
289
316
 
290
317
  const current = readJsonFile(file);
@@ -383,6 +410,7 @@ module.exports = {
383
410
  buildClaudeDesktopEnterpriseConfig,
384
411
  buildClaudeDesktopDirectEnterpriseConfig,
385
412
  buildClaudeDesktopMacDefaultsCommands,
413
+ buildClaudeDesktopMacDefaultsDeleteCommands,
386
414
  buildClaudeDesktopOpenCommands,
387
415
  clearClaudeDesktopConfig,
388
416
  getClaudeDesktopConfigLibraryDir,
package/lib/gateway.js CHANGED
@@ -7,6 +7,16 @@ const YINGCLAW_GATEWAY_PREFIX = '/yingclaw';
7
7
  const DESKTOP_ROUTE_SPECS = [
8
8
  { id: 'claude-sonnet-4-6', displayName: 'Sonnet', upstreamKey: 'model' },
9
9
  { id: 'claude-haiku-4-5', displayName: 'Haiku', upstreamKey: 'fastModel' },
10
+ { id: 'claude-opus-4-7', displayName: 'Opus' },
11
+ { id: 'claude-sonnet-4-5', displayName: 'Sonnet' },
12
+ { id: 'claude-haiku-4-0', displayName: 'Haiku' },
13
+ { id: 'claude-opus-4-1', displayName: 'Opus' },
14
+ { id: 'claude-sonnet-4-0', displayName: 'Sonnet' },
15
+ { id: 'claude-haiku-3-5', displayName: 'Haiku' },
16
+ { id: 'claude-opus-3-0', displayName: 'Opus' },
17
+ { id: 'claude-sonnet-3-7', displayName: 'Sonnet' },
18
+ { id: 'claude-sonnet-3-5', displayName: 'Sonnet' },
19
+ { id: 'claude-haiku-3-0', displayName: 'Haiku' },
10
20
  ];
11
21
  const ONE_M_CONTEXT_SUFFIX = ' [1M]';
12
22
 
@@ -48,21 +58,28 @@ function desktopRouteLabel(routeId) {
48
58
  return is1m ? `${label} 1M` : label;
49
59
  }
50
60
 
61
+ function isDesktopChatModel(model) {
62
+ return !/(^|[-_])(tts|voice|voiceclone|voicedesign|speech|audio|image|video|embedding|embed|rerank|moderation)([-_]|$)/i
63
+ .test(String(model || ''));
64
+ }
65
+
51
66
  function buildDesktopGatewayRoutes(config) {
52
67
  const fastModel = config.fastModel || config.model;
53
- const source = { model: config.model, fastModel };
54
- return DESKTOP_ROUTE_SPECS
55
- .map((spec) => {
56
- const upstreamModel = source[spec.upstreamKey];
57
- const supports1m = modelSupports1m(upstreamModel);
58
- return upstreamModel ? {
59
- id: desktopRouteId(spec.id, supports1m),
60
- displayName: spec.displayName,
61
- upstreamModel,
62
- supports1m,
63
- } : null;
64
- })
65
- .filter(Boolean);
68
+ const configuredModels = [config.model, fastModel];
69
+ const providerModels = Array.isArray(config.availableModels) ? config.availableModels : [];
70
+ const upstreamModels = [...new Set([...configuredModels, ...providerModels].filter(Boolean))]
71
+ .filter(isDesktopChatModel);
72
+
73
+ return upstreamModels.slice(0, DESKTOP_ROUTE_SPECS.length).map((upstreamModel, index) => {
74
+ const spec = DESKTOP_ROUTE_SPECS[index];
75
+ const supports1m = modelSupports1m(upstreamModel);
76
+ return {
77
+ id: desktopRouteId(spec.id, supports1m),
78
+ displayName: spec.displayName,
79
+ upstreamModel,
80
+ supports1m,
81
+ };
82
+ });
66
83
  }
67
84
 
68
85
  function buildDesktopGatewayMappingRows(config) {
@@ -262,6 +279,7 @@ module.exports = {
262
279
  createGatewayKey,
263
280
  ensureDesktopGatewayConfig,
264
281
  modelSupports1m,
282
+ isDesktopChatModel,
265
283
  stripOneMContextSuffix,
266
284
  desktopRouteId,
267
285
  desktopRouteLabel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yingclaw",
3
- "version": "2.5.7",
3
+ "version": "2.5.11",
4
4
  "description": "Claude Code × 国产大模型一键接入:DeepSeek、Kimi、Qwen、MiniMax、GLM、MiMo",
5
5
  "main": "index.js",
6
6
  "bin": {