@omnicross/contracts 0.1.0

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 (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/account-tokens-types.cjs +18 -0
  4. package/dist/account-tokens-types.d.cts +142 -0
  5. package/dist/account-tokens-types.d.ts +142 -0
  6. package/dist/account-tokens-types.js +0 -0
  7. package/dist/canonical-models.cjs +262 -0
  8. package/dist/canonical-models.d.cts +107 -0
  9. package/dist/canonical-models.d.ts +107 -0
  10. package/dist/canonical-models.js +232 -0
  11. package/dist/completion-types.cjs +18 -0
  12. package/dist/completion-types.d.cts +324 -0
  13. package/dist/completion-types.d.ts +324 -0
  14. package/dist/completion-types.js +0 -0
  15. package/dist/endpoint-resolver.cjs +54 -0
  16. package/dist/endpoint-resolver.d.cts +43 -0
  17. package/dist/endpoint-resolver.d.ts +43 -0
  18. package/dist/endpoint-resolver.js +29 -0
  19. package/dist/extended-context.cjs +39 -0
  20. package/dist/extended-context.d.cts +21 -0
  21. package/dist/extended-context.d.ts +21 -0
  22. package/dist/extended-context.js +13 -0
  23. package/dist/index.cjs +2724 -0
  24. package/dist/index.d.cts +14 -0
  25. package/dist/index.d.ts +14 -0
  26. package/dist/index.js +2656 -0
  27. package/dist/llm-config-CQjOimv2.d.cts +390 -0
  28. package/dist/llm-config-D1jKQLVp.d.ts +390 -0
  29. package/dist/llm-config.cjs +18 -0
  30. package/dist/llm-config.d.cts +2 -0
  31. package/dist/llm-config.d.ts +2 -0
  32. package/dist/llm-config.js +0 -0
  33. package/dist/mcp-types.cjs +33 -0
  34. package/dist/mcp-types.d.cts +131 -0
  35. package/dist/mcp-types.d.ts +131 -0
  36. package/dist/mcp-types.js +8 -0
  37. package/dist/message-blocks.cjs +18 -0
  38. package/dist/message-blocks.d.cts +44 -0
  39. package/dist/message-blocks.d.ts +44 -0
  40. package/dist/message-blocks.js +0 -0
  41. package/dist/provider-presets/index.cjs +2183 -0
  42. package/dist/provider-presets/index.d.cts +104 -0
  43. package/dist/provider-presets/index.d.ts +104 -0
  44. package/dist/provider-presets/index.js +2143 -0
  45. package/dist/subscription-types.cjs +48 -0
  46. package/dist/subscription-types.d.cts +149 -0
  47. package/dist/subscription-types.d.ts +149 -0
  48. package/dist/subscription-types.js +22 -0
  49. package/dist/thinking-CBWSLel8.d.cts +33 -0
  50. package/dist/thinking-CBWSLel8.d.ts +33 -0
  51. package/dist/thinking-config.cjs +243 -0
  52. package/dist/thinking-config.d.cts +71 -0
  53. package/dist/thinking-config.d.ts +71 -0
  54. package/dist/thinking-config.js +205 -0
  55. package/dist/usage-types.cjs +18 -0
  56. package/dist/usage-types.d.cts +41 -0
  57. package/dist/usage-types.d.ts +41 -0
  58. package/dist/usage-types.js +0 -0
  59. package/dist/websearch-types.cjs +37 -0
  60. package/dist/websearch-types.d.cts +76 -0
  61. package/dist/websearch-types.d.ts +76 -0
  62. package/dist/websearch-types.js +11 -0
  63. package/package.json +116 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,2724 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ API_MODE_IDS: () => API_MODE_IDS,
24
+ CANNOT_DISABLE_THINKING_PATTERNS: () => CANNOT_DISABLE_THINKING_PATTERNS,
25
+ CATALOG_VERSION: () => CATALOG_VERSION,
26
+ CODING_PLAN_URL_PRESETS: () => CODING_PLAN_URL_PRESETS,
27
+ DEFAULT_MAX_TOKENS: () => DEFAULT_MAX_TOKENS,
28
+ DEFAULT_MCP_SESSION_CONFIG: () => DEFAULT_MCP_SESSION_CONFIG,
29
+ DEFAULT_SEED_PRESET_IDS: () => DEFAULT_SEED_PRESET_IDS,
30
+ EFFORT_RATIO: () => EFFORT_RATIO,
31
+ EXTENDED_CONTEXT_CAPABLE_MODELS: () => EXTENDED_CONTEXT_CAPABLE_MODELS,
32
+ KNOWN_MODELS: () => KNOWN_MODELS,
33
+ LLM_PROVIDER_PRESETS: () => LLM_PROVIDER_PRESETS,
34
+ MAX_CONCURRENCY_DEFAULTS: () => MAX_CONCURRENCY_DEFAULTS,
35
+ MODEL_ALIASES: () => MODEL_ALIASES,
36
+ PROVIDER_MODEL_MAPPINGS: () => PROVIDER_MODEL_MAPPINGS,
37
+ PROVIDER_SEARCH_CONFIGS: () => PROVIDER_SEARCH_CONFIGS,
38
+ REASONING_MODEL_PATTERNS: () => REASONING_MODEL_PATTERNS,
39
+ THINKING_TOKEN_MAP: () => THINKING_TOKEN_MAP,
40
+ applyAlias: () => applyAlias,
41
+ buildAnthropicThinking: () => buildAnthropicThinking,
42
+ buildGeminiThinkingConfig: () => buildGeminiThinkingConfig,
43
+ buildQwenThinkingConfig: () => buildQwenThinkingConfig,
44
+ calculateThinkingBudget: () => calculateThinkingBudget,
45
+ canDisableThinking: () => canDisableThinking,
46
+ findTokenLimit: () => findTokenLimit,
47
+ getAllProviderPresets: () => getAllProviderPresets,
48
+ getClaudeMaxTokens: () => getClaudeMaxTokens,
49
+ getCodingPlanBaseUrl: () => getCodingPlanBaseUrl,
50
+ getOpenAIReasoningEffort: () => getOpenAIReasoningEffort,
51
+ getPresetById: () => getPresetById,
52
+ getPresetRevision: () => getPresetRevision,
53
+ getProviderSearchConfig: () => getProviderSearchConfig,
54
+ isApiProvider: () => isApiProvider,
55
+ isExtendedContextCapable: () => isExtendedContextCapable,
56
+ isLocalProvider: () => isLocalProvider,
57
+ isReasoningModel: () => isReasoningModel,
58
+ legacyCliBackendToSubscriptionProvider: () => legacyCliBackendToSubscriptionProvider,
59
+ lookupCanonicalCapabilities: () => lookupCanonicalCapabilities,
60
+ normalizeModelId: () => normalizeModelId,
61
+ resolveFollowProviderModel: () => resolveFollowProviderModel,
62
+ resolveModelCapabilities: () => resolveModelCapabilities,
63
+ resolveProviderEndpoint: () => resolveProviderEndpoint,
64
+ subscriptionTargetForSession: () => subscriptionTargetForSession
65
+ });
66
+ module.exports = __toCommonJS(index_exports);
67
+
68
+ // src/canonical-models.ts
69
+ var OPENAI_MODELS = {
70
+ "gpt-5.5": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
71
+ "gpt-5.4": { category: "reasoning", contextLength: 105e4, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
72
+ "gpt-5.4-mini": { category: "reasoning", contextLength: 4e5, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
73
+ "gpt-5.3-codex": { category: "code", contextLength: 4e5, maxTokens: 128e3, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 128e3 } },
74
+ "gpt-5.2": { category: "reasoning", contextLength: 105e4, maxTokens: 65536, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "minimal", "low", "medium", "high", "xhigh"], thinkingTokenLimit: { min: 0, max: 65536 } },
75
+ "gpt-5": { category: "reasoning", contextLength: 105e4, maxTokens: 65536, reasoning: true, vision: true, functionCall: true },
76
+ "gpt-4.1": { category: "chat", contextLength: 105e4, maxTokens: 32768, vision: true, functionCall: true },
77
+ "gpt-4o": { category: "chat", contextLength: 128e3, maxTokens: 16384, vision: true, functionCall: true },
78
+ "gpt-4o-mini": { category: "chat", contextLength: 128e3, maxTokens: 16384, functionCall: true },
79
+ "o3": { category: "reasoning", contextLength: 2e5, maxTokens: 1e5, reasoning: true, thinkingLevels: ["low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 65536 } },
80
+ "o4-mini": { category: "reasoning", contextLength: 2e5, maxTokens: 1e5, reasoning: true, thinkingLevels: ["low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } }
81
+ };
82
+ var ANTHROPIC_MODELS = {
83
+ "claude-opus-4-7": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
84
+ "claude-opus-4-7[1m]": { category: "reasoning", contextLength: 1e6, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true },
85
+ "claude-opus-4-6": { category: "reasoning", contextLength: 2e5, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 1024, max: 128e3 } },
86
+ "claude-opus-4-6[1m]": { category: "reasoning", contextLength: 1e6, maxTokens: 128e3, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 1024, max: 128e3 } },
87
+ "claude-sonnet-4-6": { category: "chat", contextLength: 2e5, maxTokens: 64e3, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 1024, max: 64e3 } },
88
+ "claude-sonnet-4-6[1m]": { category: "chat", contextLength: 1e6, maxTokens: 64e3, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 1024, max: 64e3 } },
89
+ "claude-haiku-4-5": { category: "chat", contextLength: 2e5, maxTokens: 64e3, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high", "xhigh", "max"], thinkingTokenLimit: { min: 1024, max: 64e3 } }
90
+ };
91
+ var GEMINI_MODELS = {
92
+ "gemini-3-flash": { category: "chat", contextLength: 1e6, maxTokens: 65536, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 24576 } },
93
+ "gemini-3.1-pro": { category: "chat", contextLength: 1e6, maxTokens: 65536, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["low", "medium", "high"], thinkingTokenLimit: { min: 128, max: 32768 } }
94
+ };
95
+ var GROK_MODELS = {
96
+ "grok-4.3": { category: "chat", contextLength: 1e6, maxTokens: 32768, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
97
+ "grok-4.20": { category: "chat", contextLength: 131072, maxTokens: 32768, vision: true, functionCall: true },
98
+ "grok-4.20-reasoning": { category: "reasoning", contextLength: 131072, maxTokens: 32768, reasoning: true, vision: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
99
+ "grok-4.20-multi-agent": { category: "reasoning", contextLength: 131072, maxTokens: 32768, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } }
100
+ };
101
+ var DEEPSEEK_MODELS = {
102
+ "deepseek-v4-flash": { category: "chat", contextLength: 1e6, maxTokens: 384e3, functionCall: true, reasoning: true, thinkingLevels: ["none", "high", "max"], thinkingTokenLimit: { min: 0, max: 32768 } },
103
+ "deepseek-v4-pro": { category: "reasoning", contextLength: 1e6, maxTokens: 384e3, functionCall: true, reasoning: true, thinkingLevels: ["none", "high", "max"], thinkingTokenLimit: { min: 0, max: 32768 } },
104
+ "deepseek-v3": { category: "chat", contextLength: 65536, maxTokens: 8192, functionCall: true },
105
+ "deepseek-v3.2": { category: "code", contextLength: 256e3, maxTokens: 32768, functionCall: true, reasoning: true },
106
+ "deepseek-r1": { category: "reasoning", contextLength: 64e3, maxTokens: 8192, reasoning: true, thinkingTokenLimit: { min: 0, max: 32768 } }
107
+ };
108
+ var ZHIPU_MODELS = {
109
+ "glm-5": { category: "chat", contextLength: 2e5, maxTokens: 128e3, functionCall: true },
110
+ "glm-5.1": { category: "chat", contextLength: 2e5, maxTokens: 128e3, functionCall: true },
111
+ "glm-4.5-air": { category: "chat", contextLength: 128e3, maxTokens: 32768, functionCall: true },
112
+ "glm-4.6v": { category: "chat", contextLength: 128e3, maxTokens: 32768, vision: true, functionCall: true },
113
+ "glm-4.7": { category: "code", contextLength: 2e5, maxTokens: 128e3, functionCall: true }
114
+ };
115
+ var KIMI_MODELS = {
116
+ "kimi-k2.6": { category: "code", contextLength: 256e3, maxTokens: 32768, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
117
+ "kimi-k2.5": { category: "chat", contextLength: 256e3, maxTokens: 65535, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
118
+ "kimi-k2-thinking": { category: "reasoning", contextLength: 256e3, reasoning: true, functionCall: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } }
119
+ };
120
+ var DASHSCOPE_QWEN_MODELS = {
121
+ "qwen3-max": { category: "chat", contextLength: 262144, maxTokens: 65536, functionCall: true, webSearch: true },
122
+ "qwen3.5-plus": { category: "chat", contextLength: 1e6, vision: true, functionCall: true, webSearch: true },
123
+ "qwen-turbo": { category: "chat", contextLength: 1e6, vision: true, webSearch: true },
124
+ "qwen3-coder-plus": { category: "code", contextLength: 1e6, functionCall: true },
125
+ "qwen-3-coder-480b": { category: "code", contextLength: 131072, maxTokens: 8192, functionCall: true },
126
+ "qwen-3-32b": { category: "chat", contextLength: 131072, maxTokens: 8192, functionCall: true },
127
+ "qwen2.5-coder-32b-instruct": { category: "code", contextLength: 32768, maxTokens: 8192, functionCall: true },
128
+ "qwen2.5-coder-7b-instruct": { category: "code", contextLength: 32768, maxTokens: 8192, functionCall: true }
129
+ };
130
+ var VOLCENGINE_DOUBAO_MODELS = {
131
+ "ark-code-latest": { category: "code", contextLength: 256e3, maxTokens: 32768, functionCall: true },
132
+ "doubao-seed-2.0-code": { category: "code", contextLength: 256e3, maxTokens: 128e3, vision: true, functionCall: true },
133
+ "doubao-seed-2.0-lite": { category: "chat", contextLength: 256e3, maxTokens: 32768, functionCall: true }
134
+ };
135
+ var TENCENT_HUNYUAN_MODELS = {
136
+ "tc-code-latest": { category: "code", functionCall: true },
137
+ "hunyuan-2.0-instruct": { category: "chat", functionCall: true },
138
+ "hunyuan-turbos": { category: "chat", functionCall: true }
139
+ };
140
+ var MINIMAX_MODELS = {
141
+ "minimax-m2.5": { category: "code", contextLength: 204800, functionCall: true },
142
+ "minimax-m2.5-highspeed": { category: "code", contextLength: 204800, functionCall: true },
143
+ "minimax-m2.1": { category: "code", contextLength: 204800, functionCall: true },
144
+ "minimax-m2.1-highspeed": { category: "code", contextLength: 204800, functionCall: true }
145
+ };
146
+ var XIAOMI_MIMO_CANONICAL = {
147
+ "mimo-v2.5": { category: "code", contextLength: 1e6, maxTokens: 32768, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
148
+ // mimo-v2.5-pro does not support vision (text + reasoning only).
149
+ "mimo-v2.5-pro": { category: "code", contextLength: 1e6, maxTokens: 32768, vision: false, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
150
+ "mimo-v2-pro": { category: "code", contextLength: 1e6, maxTokens: 32768, vision: true, functionCall: true, reasoning: true, thinkingLevels: ["none", "low", "medium", "high"], thinkingTokenLimit: { min: 0, max: 32768 } },
151
+ "mimo-v2-flash": { category: "code", contextLength: 256e3, maxTokens: 32768, vision: true, functionCall: true },
152
+ "mimo-v2-omni": { category: "chat", contextLength: 256e3, maxTokens: 32768, vision: true, functionCall: true }
153
+ };
154
+ var META_LLAMA_MODELS = {
155
+ "llama-3.3-70b": { category: "chat", contextLength: 131072, maxTokens: 8192, functionCall: true },
156
+ "llama-3.3-70b-versatile": { category: "chat", contextLength: 131072, maxTokens: 32768, functionCall: true },
157
+ "llama-3.3-70b-instruct": { category: "chat", contextLength: 131072, maxTokens: 8192, functionCall: true },
158
+ "llama-3.3-70b-instruct-turbo": { category: "chat", contextLength: 131072, maxTokens: 8192, functionCall: true },
159
+ "llama-3.1-8b-instant": { category: "chat", contextLength: 131072, maxTokens: 8192, functionCall: true }
160
+ };
161
+ var MISTRAL_MODELS = {
162
+ "mistral-large-latest": { category: "chat", contextLength: 131072, maxTokens: 8192, functionCall: true },
163
+ "codestral-latest": { category: "code", contextLength: 256e3, maxTokens: 8192, functionCall: true },
164
+ "mistral-medium-latest": { category: "chat", contextLength: 131072, maxTokens: 8192, functionCall: true },
165
+ "mixtral-8x7b-32768": { category: "chat", contextLength: 32768, maxTokens: 32768, functionCall: true }
166
+ };
167
+ var PERPLEXITY_MODELS = {
168
+ "sonar": { category: "chat", contextLength: 127072, maxTokens: 8192, webSearch: true },
169
+ "sonar-pro": { category: "chat", contextLength: 2e5, maxTokens: 8192, webSearch: true },
170
+ "sonar-reasoning-pro": { category: "reasoning", contextLength: 127072, maxTokens: 8192, reasoning: true, webSearch: true }
171
+ };
172
+ var BAIDU_ERNIE_MODELS = {
173
+ "qianfan-code-latest": { category: "code", contextLength: 98304, maxTokens: 65536, functionCall: true },
174
+ "ernie-4.5": { category: "chat", functionCall: true },
175
+ "ernie-3.5": { category: "chat" }
176
+ };
177
+ var KUAISHOU_KAT_MODELS = {
178
+ "kat-coder-pro-v1": { category: "code", contextLength: 256e3, maxTokens: 128e3, functionCall: true },
179
+ "kat-coder-air-v1": { category: "code", contextLength: 128e3, maxTokens: 32768, functionCall: true }
180
+ };
181
+ var VENDOR_GROUPS = [
182
+ { name: "OPENAI_MODELS", entries: OPENAI_MODELS },
183
+ { name: "ANTHROPIC_MODELS", entries: ANTHROPIC_MODELS },
184
+ { name: "GEMINI_MODELS", entries: GEMINI_MODELS },
185
+ { name: "GROK_MODELS", entries: GROK_MODELS },
186
+ { name: "DEEPSEEK_MODELS", entries: DEEPSEEK_MODELS },
187
+ { name: "ZHIPU_MODELS", entries: ZHIPU_MODELS },
188
+ { name: "KIMI_MODELS", entries: KIMI_MODELS },
189
+ { name: "DASHSCOPE_QWEN_MODELS", entries: DASHSCOPE_QWEN_MODELS },
190
+ { name: "VOLCENGINE_DOUBAO_MODELS", entries: VOLCENGINE_DOUBAO_MODELS },
191
+ { name: "TENCENT_HUNYUAN_MODELS", entries: TENCENT_HUNYUAN_MODELS },
192
+ { name: "MINIMAX_MODELS", entries: MINIMAX_MODELS },
193
+ { name: "XIAOMI_MIMO_CANONICAL", entries: XIAOMI_MIMO_CANONICAL },
194
+ { name: "META_LLAMA_MODELS", entries: META_LLAMA_MODELS },
195
+ { name: "MISTRAL_MODELS", entries: MISTRAL_MODELS },
196
+ { name: "PERPLEXITY_MODELS", entries: PERPLEXITY_MODELS },
197
+ { name: "BAIDU_ERNIE_MODELS", entries: BAIDU_ERNIE_MODELS },
198
+ { name: "KUAISHOU_KAT_MODELS", entries: KUAISHOU_KAT_MODELS }
199
+ ];
200
+ function assertNoDuplicateCanonicalIds() {
201
+ const seen = /* @__PURE__ */ new Map();
202
+ for (const { name, entries } of VENDOR_GROUPS) {
203
+ for (const id of Object.keys(entries)) {
204
+ const prior = seen.get(id);
205
+ if (prior) {
206
+ throw new Error(
207
+ `[canonical-models] duplicate id '${id}' registered in both '${prior}' and '${name}'. Each model must live in exactly one vendor group.`
208
+ );
209
+ }
210
+ seen.set(id, name);
211
+ }
212
+ }
213
+ }
214
+ assertNoDuplicateCanonicalIds();
215
+ var KNOWN_MODELS = Object.freeze(
216
+ Object.assign(
217
+ /* @__PURE__ */ Object.create(null),
218
+ ...VENDOR_GROUPS.map((g) => g.entries)
219
+ )
220
+ );
221
+ function normalizeModelId(rawId) {
222
+ if (!rawId) return "";
223
+ const slashIdx = rawId.lastIndexOf("/");
224
+ const base = slashIdx >= 0 ? rawId.slice(slashIdx + 1) : rawId;
225
+ const colonIdx = base.indexOf(":");
226
+ const noSuffix = colonIdx >= 0 ? base.slice(0, colonIdx) : base;
227
+ return noSuffix.toLowerCase();
228
+ }
229
+ var MODEL_ALIASES = {
230
+ "deepseek-chat": "deepseek-v3",
231
+ "deepseek-reasoner": "deepseek-r1"
232
+ };
233
+ function applyAlias(normalizedId) {
234
+ return MODEL_ALIASES[normalizedId] ?? normalizedId;
235
+ }
236
+ function assertAliasesPointToKnownModels() {
237
+ for (const [from, to] of Object.entries(MODEL_ALIASES)) {
238
+ if (!(to in KNOWN_MODELS)) {
239
+ throw new Error(
240
+ `[canonical-models] alias '${from}' \u2192 '${to}' points at unknown id. Either add '${to}' to a vendor group or fix the alias.`
241
+ );
242
+ }
243
+ }
244
+ }
245
+ assertAliasesPointToKnownModels();
246
+ var CAPABILITY_FIELDS = [
247
+ "category",
248
+ "contextLength",
249
+ "maxTokens",
250
+ "vision",
251
+ "functionCall",
252
+ "reasoning",
253
+ "webSearch",
254
+ "thinkingLevels",
255
+ "thinkingTokenLimit"
256
+ ];
257
+ function lookupCanonicalCapabilities(rawId, extendedContext = false) {
258
+ const normalized = normalizeModelId(rawId);
259
+ if (!normalized) return void 0;
260
+ const canonicalId = applyAlias(normalized);
261
+ if (extendedContext) {
262
+ const extendedKey = `${canonicalId}[1m]`;
263
+ const extended = KNOWN_MODELS[extendedKey];
264
+ if (extended) return extended;
265
+ }
266
+ return KNOWN_MODELS[canonicalId];
267
+ }
268
+ function resolveModelCapabilities(modelId, presetOverride, rowOverride) {
269
+ const canonical = lookupCanonicalCapabilities(modelId) ?? {};
270
+ const result = {};
271
+ for (const field of CAPABILITY_FIELDS) {
272
+ const rowValue = rowOverride?.[field];
273
+ if (rowValue !== void 0) {
274
+ assignField(result, field, rowValue);
275
+ continue;
276
+ }
277
+ const presetValue = presetOverride?.[field];
278
+ if (presetValue !== void 0) {
279
+ assignField(result, field, presetValue);
280
+ continue;
281
+ }
282
+ const canonicalValue = canonical[field];
283
+ if (canonicalValue !== void 0) {
284
+ assignField(result, field, canonicalValue);
285
+ }
286
+ }
287
+ return result;
288
+ }
289
+ function assignField(target, field, value) {
290
+ target[field] = value;
291
+ }
292
+
293
+ // src/endpoint-resolver.ts
294
+ function resolveProviderEndpoint(provider) {
295
+ if (provider.apiModes && provider.apiModes.length > 0 && provider.selectedApiModeId) {
296
+ const mode = provider.apiModes.find((m) => m.id === provider.selectedApiModeId);
297
+ if (mode) {
298
+ return {
299
+ baseUrl: provider.api_base_url || mode.baseUrl,
300
+ apiKey: provider.api_key || mode.apiKey || "",
301
+ resolvedModeId: mode.id,
302
+ source: "api-mode"
303
+ };
304
+ }
305
+ }
306
+ if (provider.codingPlan?.enabled && provider.codingPlan.baseUrl) {
307
+ return {
308
+ baseUrl: provider.codingPlan.baseUrl,
309
+ apiKey: provider.codingPlan.apiKey || provider.api_key || "",
310
+ source: "legacy-coding-plan"
311
+ };
312
+ }
313
+ return {
314
+ baseUrl: provider.api_base_url || "",
315
+ apiKey: provider.api_key || "",
316
+ source: "plain"
317
+ };
318
+ }
319
+
320
+ // src/extended-context.ts
321
+ var EXTENDED_CONTEXT_CAPABLE_MODELS = /* @__PURE__ */ new Set([
322
+ "claude-opus-4-7",
323
+ "claude-opus-4-6",
324
+ "claude-sonnet-4-6"
325
+ ]);
326
+ function isExtendedContextCapable(model) {
327
+ return EXTENDED_CONTEXT_CAPABLE_MODELS.has(model);
328
+ }
329
+
330
+ // src/mcp-types.ts
331
+ var DEFAULT_MCP_SESSION_CONFIG = {
332
+ mode: "auto",
333
+ selectedServers: []
334
+ };
335
+
336
+ // src/provider-presets/catalog.json
337
+ var catalog_default = {
338
+ version: 1,
339
+ generatedFrom: "packages/desktop/app/shared/provider-presets.ts"
340
+ };
341
+
342
+ // src/provider-presets/defaults.ts
343
+ var CODING_PLAN_URL_PRESETS = {
344
+ zhipu: { baseUrl: "https://api.z.ai/api/coding/paas/v4" },
345
+ "zhipu-bigmodel": { baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4" },
346
+ volcengine: { baseUrl: "https://ark.cn-beijing.volces.com/api/coding/v3" },
347
+ kimi: { baseUrl: "https://api.kimi.com/coding/v1" },
348
+ dashscope: { baseUrl: "https://coding.dashscope.aliyuncs.com/compatible-mode/v1", separateApiKey: true },
349
+ tencent: { baseUrl: "https://api.lkeap.cloud.tencent.com/coding/v3" },
350
+ baidu: { baseUrl: "https://qianfan.baidubce.com/v2/coding" },
351
+ kuaishou: { baseUrl: "https://wanqing.streamlakeapi.com/api/gateway/coding/v1" },
352
+ // Xiaomi MiMo Token Plan — both formats first-class.
353
+ // OpenAI variant id `xiaomi-mimo` -> OpenAI Token Plan endpoint.
354
+ // Anthropic variant id `xiaomi-mimo-anthropic` -> Anthropic Token Plan endpoint.
355
+ // Overseas users may swap `token-plan-cn` -> `token-plan-sgp` / `token-plan-ams` manually.
356
+ "xiaomi-mimo": { baseUrl: "https://token-plan-cn.xiaomimimo.com/v1" },
357
+ "xiaomi-mimo-anthropic": { baseUrl: "https://token-plan-cn.xiaomimimo.com/anthropic" }
358
+ // MiniMax and Moore Threads don't need URL switching
359
+ };
360
+ var PROVIDER_MODEL_MAPPINGS = {
361
+ zhipu: {
362
+ primary: "glm-5.1",
363
+ background: "glm-4.5-air",
364
+ vision: "glm-4.6v"
365
+ },
366
+ volcengine: {
367
+ primary: "ark-code-latest",
368
+ background: "doubao-seed-2.0-lite",
369
+ vision: "doubao-seed-2.0-code"
370
+ },
371
+ kimi: {
372
+ primary: "kimi-k2.5",
373
+ background: "kimi-k2-0905-preview",
374
+ vision: "kimi-k2.5"
375
+ },
376
+ dashscope: {
377
+ primary: "qwen3-max",
378
+ background: "qwen-turbo",
379
+ vision: "qwen3.5-plus"
380
+ },
381
+ tencent: {
382
+ primary: "tc-code-latest",
383
+ background: "hunyuan-turbos",
384
+ vision: null
385
+ },
386
+ minimax: {
387
+ primary: "MiniMax-M2.5",
388
+ background: "MiniMax-M2.1-highspeed",
389
+ vision: null
390
+ },
391
+ baidu: {
392
+ primary: "qianfan-code-latest",
393
+ background: "ernie-3.5",
394
+ vision: "ernie-4.5-vl-28b-a3b"
395
+ },
396
+ kuaishou: {
397
+ primary: "kat-coder-pro-v1",
398
+ background: "kat-coder-air-v1",
399
+ vision: null
400
+ },
401
+ mthreads: {
402
+ primary: "glm-4.7",
403
+ background: "glm-4.7",
404
+ vision: null
405
+ },
406
+ "xiaomi-mimo": {
407
+ // xiaomi-mimo API expects lowercase ids — see the Xiaomi preset model list.
408
+ primary: "mimo-v2.5-pro",
409
+ background: "mimo-v2-flash",
410
+ vision: "mimo-v2-omni"
411
+ },
412
+ // International providers
413
+ openai: {
414
+ primary: "gpt-4o",
415
+ background: "gpt-4o-mini",
416
+ vision: "gpt-4o"
417
+ },
418
+ anthropic: {
419
+ primary: "claude-sonnet-4-6",
420
+ background: "claude-haiku-4-5",
421
+ vision: "claude-sonnet-4-6"
422
+ },
423
+ gemini: {
424
+ primary: "gemini-3.1-pro",
425
+ background: "gemini-3-flash",
426
+ vision: "gemini-3.1-pro"
427
+ }
428
+ };
429
+ var PROVIDER_SEARCH_CONFIGS = {
430
+ // Chinese providers
431
+ dashscope: {
432
+ type: "model-param",
433
+ paramName: "enable_search",
434
+ paramValue: true,
435
+ applicableModels: ["qwen3-max", "qwen3.5-plus", "qwen-turbo"]
436
+ },
437
+ kimi: {
438
+ type: "builtin-tool",
439
+ toolDefinition: {
440
+ type: "builtin_function",
441
+ function: { name: "web_search" }
442
+ },
443
+ conflictsWithFC: false,
444
+ applicableModels: null
445
+ },
446
+ volcengine: {
447
+ type: "model-param",
448
+ paramName: "web_search",
449
+ paramValue: { enable: true },
450
+ applicableModels: null
451
+ },
452
+ baidu: {
453
+ type: "model-param",
454
+ paramName: "web_search",
455
+ paramValue: { enable: true, enable_citation: true },
456
+ applicableModels: ["ernie-4.5", "ernie-3.5"]
457
+ },
458
+ minimax: {
459
+ type: "mcp",
460
+ mcpServerId: "minimax-search",
461
+ applicableModels: null
462
+ },
463
+ zhipu: {
464
+ type: "builtin-tool",
465
+ toolDefinition: {
466
+ type: "web_search",
467
+ web_search: { enable: true }
468
+ },
469
+ conflictsWithFC: false,
470
+ applicableModels: null
471
+ },
472
+ // International providers
473
+ anthropic: {
474
+ type: "sdk-native",
475
+ applicableModels: null
476
+ },
477
+ openai: {
478
+ type: "builtin-tool",
479
+ toolDefinition: {
480
+ type: "web_search_preview"
481
+ },
482
+ conflictsWithFC: false,
483
+ applicableModels: null
484
+ },
485
+ google: {
486
+ type: "builtin-tool",
487
+ toolDefinition: {
488
+ google_search: {}
489
+ },
490
+ conflictsWithFC: false,
491
+ applicableModels: null
492
+ },
493
+ // Alias: PROVIDER_MODEL_MAPPINGS uses "gemini", presetId may be either
494
+ gemini: {
495
+ type: "builtin-tool",
496
+ toolDefinition: {
497
+ google_search: {}
498
+ },
499
+ conflictsWithFC: false,
500
+ applicableModels: null
501
+ }
502
+ };
503
+ var DEFAULT_MAX_CONCURRENCY = -1;
504
+ var MAX_CONCURRENCY_DEFAULTS = {
505
+ zhipu: 5,
506
+ "zhipu-bigmodel": 5,
507
+ kimi: 5,
508
+ minimax: 5,
509
+ dashscope: 5,
510
+ volcengine: 5,
511
+ tencent: 5,
512
+ "tencent-anthropic": 5,
513
+ baidu: 5,
514
+ kuaishou: 5,
515
+ mthreads: 5,
516
+ "xiaomi-mimo": 5,
517
+ "xiaomi-mimo-anthropic": 5
518
+ };
519
+ var DEFAULT_SEED_PRESET_IDS = [
520
+ // Tier 1 — international flagship
521
+ "openai",
522
+ "anthropic",
523
+ "gemini",
524
+ "gemini-vertex",
525
+ "deepseek",
526
+ "grok",
527
+ // Tier 2 — aggregator + Chinese flagship (with coding plan).
528
+ // MiniMax + Xiaomi MiMo bumped up next to Kimi per UX preference —
529
+ // popular Anthropic-format Chinese providers cluster together.
530
+ "openrouter",
531
+ "zhipu",
532
+ "zhipu-bigmodel",
533
+ "kimi",
534
+ "minimax",
535
+ "xiaomi-mimo",
536
+ "dashscope",
537
+ "volcengine",
538
+ "tencent",
539
+ // Tier 3 — international extras + fast inference + local
540
+ "siliconflow",
541
+ "mistral",
542
+ "together",
543
+ "perplexity",
544
+ "groq",
545
+ "cerebras",
546
+ "ollama",
547
+ // Tier 4 — specialized
548
+ "azure-openai",
549
+ "openai-response",
550
+ // Tier 5 — cold / niche / variants
551
+ "xiaomi-mimo-anthropic",
552
+ "tencent-anthropic",
553
+ "baidu",
554
+ "kuaishou",
555
+ "mthreads"
556
+ ];
557
+
558
+ // src/provider-presets/presets/anthropic.json
559
+ var anthropic_default = {
560
+ id: "anthropic",
561
+ presetId: "anthropic",
562
+ name: "Anthropic",
563
+ apiFormat: "anthropic",
564
+ apiType: "anthropic",
565
+ api_base_url: "https://api.anthropic.com/v1/messages",
566
+ modelsEndpoint: "https://api.anthropic.com/v1/models",
567
+ models: [
568
+ "claude-opus-4-7",
569
+ "claude-opus-4-7[1m]",
570
+ "claude-sonnet-4-6",
571
+ "claude-sonnet-4-6[1m]",
572
+ "claude-opus-4-6",
573
+ "claude-opus-4-6[1m]",
574
+ "claude-haiku-4-5"
575
+ ],
576
+ modelConfigs: [
577
+ {
578
+ id: "claude-opus-4-7",
579
+ name: "Claude Opus 4.7",
580
+ enabled: true
581
+ },
582
+ {
583
+ id: "claude-opus-4-7[1m]",
584
+ name: "Claude Opus 4.7 (1M)",
585
+ enabled: false
586
+ },
587
+ {
588
+ id: "claude-sonnet-4-6",
589
+ name: "Claude Sonnet 4.6",
590
+ enabled: true
591
+ },
592
+ {
593
+ id: "claude-sonnet-4-6[1m]",
594
+ name: "Claude Sonnet 4.6 (1M)",
595
+ enabled: false
596
+ },
597
+ {
598
+ id: "claude-opus-4-6",
599
+ name: "Claude Opus 4.6",
600
+ enabled: true
601
+ },
602
+ {
603
+ id: "claude-opus-4-6[1m]",
604
+ name: "Claude Opus 4.6 (1M)",
605
+ enabled: false
606
+ },
607
+ {
608
+ id: "claude-haiku-4-5",
609
+ name: "Claude Haiku 4.5",
610
+ enabled: true
611
+ }
612
+ ],
613
+ transformer: {
614
+ use: [
615
+ "anthropic"
616
+ ]
617
+ },
618
+ description: "Claude\u6A21\u578B\u5B98\u65B9API (Anthropic Messages\u683C\u5F0F)",
619
+ icon: "anthropic",
620
+ website: "https://anthropic.com",
621
+ docsUrl: "https://docs.anthropic.com",
622
+ defaultSettings: {
623
+ temperature: 0.7,
624
+ maxTokens: 65536
625
+ },
626
+ isSystem: true,
627
+ isOfficial: true,
628
+ features: [
629
+ "vision",
630
+ "search",
631
+ "reasoning"
632
+ ],
633
+ searchConfig: {
634
+ type: "sdk-native",
635
+ applicableModels: null
636
+ }
637
+ };
638
+
639
+ // src/provider-presets/presets/azure-openai.json
640
+ var azure_openai_default = {
641
+ id: "azure-openai",
642
+ presetId: "azure-openai",
643
+ name: "Azure OpenAI",
644
+ apiFormat: "azure-openai",
645
+ api_base_url: "",
646
+ apiVersion: "2024-08-01-preview",
647
+ models: [],
648
+ description: "Azure OpenAI Service (requires deployment name as model)",
649
+ icon: "azure-openai",
650
+ website: "https://azure.microsoft.com/products/ai-services/openai-service",
651
+ docsUrl: "https://learn.microsoft.com/azure/ai-services/openai/",
652
+ defaultSettings: {
653
+ temperature: 0.7,
654
+ maxTokens: 4096
655
+ },
656
+ isSystem: true,
657
+ features: [
658
+ "vision"
659
+ ]
660
+ };
661
+
662
+ // src/provider-presets/presets/baidu.json
663
+ var baidu_default = {
664
+ id: "baidu",
665
+ presetId: "baidu",
666
+ name: "\u767E\u5EA6\u5343\u5E06",
667
+ nameKey: "presetName.baidu",
668
+ apiFormat: "openai",
669
+ api_base_url: "https://qianfan.baidubce.com/v2",
670
+ codingPlanBaseUrl: "https://qianfan.baidubce.com/v2/coding",
671
+ codingPlanSeparateKey: true,
672
+ models: [
673
+ "qianfan-code-latest",
674
+ "ernie-4.5",
675
+ "ernie-3.5"
676
+ ],
677
+ modelConfigs: [
678
+ {
679
+ id: "qianfan-code-latest",
680
+ name: "Auto (\u5343\u5E06)",
681
+ enabled: true
682
+ },
683
+ {
684
+ id: "ernie-4.5",
685
+ name: "ERNIE 4.5",
686
+ enabled: true
687
+ },
688
+ {
689
+ id: "ernie-3.5",
690
+ name: "ERNIE 3.5",
691
+ enabled: true
692
+ }
693
+ ],
694
+ description: "\u767E\u5EA6\u5343\u5E06\u5927\u6A21\u578B\u5E73\u53F0",
695
+ icon: "baidu",
696
+ website: "https://cloud.baidu.com",
697
+ docsUrl: "https://cloud.baidu.com/doc/qianfan/s/imlg0beiu",
698
+ isSystem: true,
699
+ features: [
700
+ "coding-plan",
701
+ "vision",
702
+ "search",
703
+ "mcp-search"
704
+ ],
705
+ apiModes: [
706
+ {
707
+ id: "standard",
708
+ label: "apiMode.standard",
709
+ baseUrl: "https://qianfan.baidubce.com/v2"
710
+ },
711
+ {
712
+ id: "coding-plan",
713
+ label: "apiMode.codingPlan",
714
+ baseUrl: "https://qianfan.baidubce.com/v2/coding",
715
+ note: "apiMode.baiduCodingPlanSeparateKey"
716
+ }
717
+ ],
718
+ searchConfig: {
719
+ type: "model-param",
720
+ paramName: "web_search",
721
+ paramValue: {
722
+ enable: true,
723
+ enable_citation: true
724
+ },
725
+ applicableModels: [
726
+ "ernie-4.5",
727
+ "ernie-3.5"
728
+ ]
729
+ }
730
+ };
731
+
732
+ // src/provider-presets/presets/cerebras.json
733
+ var cerebras_default = {
734
+ id: "cerebras",
735
+ presetId: "cerebras",
736
+ name: "Cerebras",
737
+ apiFormat: "openai",
738
+ api_base_url: "https://api.cerebras.ai/v1",
739
+ models: [
740
+ "llama-3.3-70b",
741
+ "qwen-3-coder-480b",
742
+ "qwen-3-32b"
743
+ ],
744
+ modelConfigs: [
745
+ {
746
+ id: "llama-3.3-70b",
747
+ name: "Llama 3.3 70B",
748
+ enabled: true,
749
+ category: "chat",
750
+ contextLength: 131072,
751
+ maxTokens: 8192,
752
+ functionCall: true
753
+ },
754
+ {
755
+ id: "qwen-3-coder-480b",
756
+ name: "Qwen3 Coder 480B",
757
+ enabled: true,
758
+ category: "code",
759
+ contextLength: 131072,
760
+ maxTokens: 8192,
761
+ functionCall: true
762
+ },
763
+ {
764
+ id: "qwen-3-32b",
765
+ name: "Qwen3 32B",
766
+ enabled: true,
767
+ category: "chat",
768
+ contextLength: 131072,
769
+ maxTokens: 8192,
770
+ functionCall: true
771
+ }
772
+ ],
773
+ transformer: {
774
+ use: [
775
+ "cerebras"
776
+ ]
777
+ },
778
+ description: "Cerebras Inference \u2014 \u6676\u5706\u7EA7\u82AF\u7247\u9AD8\u901F\u63A8\u7406",
779
+ icon: "cerebras",
780
+ website: "https://cerebras.ai",
781
+ docsUrl: "https://inference-docs.cerebras.ai",
782
+ defaultSettings: {
783
+ temperature: 0.7,
784
+ maxTokens: 4096
785
+ },
786
+ isSystem: true,
787
+ features: []
788
+ };
789
+
790
+ // src/provider-presets/presets/dashscope.json
791
+ var dashscope_default = {
792
+ id: "dashscope",
793
+ presetId: "dashscope",
794
+ name: "\u963F\u91CC\u4E91\u767E\u70BC",
795
+ nameKey: "presetName.dashscope",
796
+ apiFormat: "openai",
797
+ api_base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1",
798
+ codingPlanBaseUrl: "https://coding.dashscope.aliyuncs.com/compatible-mode/v1",
799
+ codingPlanSeparateKey: true,
800
+ modelsEndpoint: "https://dashscope.aliyuncs.com/compatible-mode/v1/models",
801
+ models: [
802
+ "qwen3-max",
803
+ "qwen3.5-plus",
804
+ "qwen-turbo",
805
+ "qwen3-coder-plus"
806
+ ],
807
+ modelConfigs: [
808
+ {
809
+ id: "qwen3-max",
810
+ name: "Qwen3 Max",
811
+ enabled: true
812
+ },
813
+ {
814
+ id: "qwen3.5-plus",
815
+ name: "Qwen3.5 Plus",
816
+ enabled: true
817
+ },
818
+ {
819
+ id: "qwen-turbo",
820
+ name: "Qwen Turbo",
821
+ enabled: true
822
+ },
823
+ {
824
+ id: "qwen3-coder-plus",
825
+ name: "Qwen3 Coder Plus",
826
+ enabled: true
827
+ }
828
+ ],
829
+ description: "\u963F\u91CC\u4E91\u767E\u70BC\u5927\u6A21\u578B\u5E73\u53F0 (DashScope)",
830
+ icon: "dashscope",
831
+ website: "https://www.aliyun.com/product/bailian",
832
+ docsUrl: "https://help.aliyun.com/zh/model-studio/",
833
+ isSystem: true,
834
+ features: [
835
+ "coding-plan",
836
+ "vision",
837
+ "search"
838
+ ],
839
+ searchConfig: {
840
+ type: "model-param",
841
+ paramName: "enable_search",
842
+ paramValue: true,
843
+ applicableModels: [
844
+ "qwen3-max",
845
+ "qwen3.5-plus",
846
+ "qwen-turbo"
847
+ ]
848
+ },
849
+ apiModes: [
850
+ {
851
+ id: "standard",
852
+ label: "apiMode.standard",
853
+ baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1"
854
+ },
855
+ {
856
+ id: "coding-plan",
857
+ label: "apiMode.codingPlan",
858
+ baseUrl: "https://coding.dashscope.aliyuncs.com/compatible-mode/v1",
859
+ note: "apiMode.dashscopeCodingPlanSeparateKey"
860
+ }
861
+ ]
862
+ };
863
+
864
+ // src/provider-presets/presets/deepseek.json
865
+ var deepseek_default = {
866
+ id: "deepseek",
867
+ presetId: "deepseek",
868
+ name: "DeepSeek",
869
+ apiFormat: "openai",
870
+ apiType: "openai",
871
+ api_base_url: "https://api.deepseek.com/v1/chat/completions",
872
+ models: [
873
+ "deepseek-v4-flash",
874
+ "deepseek-v4-pro",
875
+ "deepseek-chat",
876
+ "deepseek-reasoner"
877
+ ],
878
+ modelConfigs: [
879
+ {
880
+ id: "deepseek-v4-flash",
881
+ name: "DeepSeek V4 Flash",
882
+ enabled: true
883
+ },
884
+ {
885
+ id: "deepseek-v4-pro",
886
+ name: "DeepSeek V4 Pro",
887
+ enabled: true
888
+ },
889
+ {
890
+ id: "deepseek-chat",
891
+ name: "DeepSeek Chat (Legacy)",
892
+ enabled: false
893
+ },
894
+ {
895
+ id: "deepseek-reasoner",
896
+ name: "DeepSeek Reasoner (Legacy)",
897
+ enabled: false
898
+ }
899
+ ],
900
+ transformer: {
901
+ use: [
902
+ "deepseek"
903
+ ]
904
+ },
905
+ description: "DeepSeek\u5B98\u65B9API",
906
+ icon: "deepseek",
907
+ website: "https://deepseek.com",
908
+ docsUrl: "https://api-docs.deepseek.com",
909
+ defaultSettings: {
910
+ temperature: 0.7,
911
+ maxTokens: 8192
912
+ },
913
+ isSystem: true,
914
+ features: [
915
+ "reasoning"
916
+ ]
917
+ };
918
+
919
+ // src/provider-presets/presets/gemini.json
920
+ var gemini_default = {
921
+ id: "gemini",
922
+ presetId: "gemini",
923
+ name: "Google Gemini",
924
+ apiFormat: "google",
925
+ apiType: "google",
926
+ api_base_url: "https://generativelanguage.googleapis.com/v1beta/models/",
927
+ modelsEndpoint: "https://generativelanguage.googleapis.com/v1beta/models",
928
+ models: [
929
+ "gemini-3-flash",
930
+ "gemini-3.1-pro"
931
+ ],
932
+ modelConfigs: [
933
+ {
934
+ id: "gemini-3-flash",
935
+ name: "Gemini 3 Flash",
936
+ enabled: true
937
+ },
938
+ {
939
+ id: "gemini-3.1-pro",
940
+ name: "Gemini 3.1 Pro",
941
+ enabled: true
942
+ }
943
+ ],
944
+ transformer: {
945
+ use: [
946
+ "gemini"
947
+ ]
948
+ },
949
+ description: "Google\u7684\u591A\u6A21\u6001AI\u6A21\u578B",
950
+ icon: "gemini",
951
+ website: "https://ai.google.dev",
952
+ docsUrl: "https://ai.google.dev/docs",
953
+ defaultSettings: {
954
+ temperature: 0.7,
955
+ topP: 0.95,
956
+ maxTokens: 65536
957
+ },
958
+ isSystem: true,
959
+ features: [
960
+ "vision",
961
+ "search",
962
+ "reasoning"
963
+ ],
964
+ searchConfig: {
965
+ type: "builtin-tool",
966
+ toolDefinition: {
967
+ google_search: {}
968
+ },
969
+ conflictsWithFC: false,
970
+ applicableModels: null
971
+ }
972
+ };
973
+
974
+ // src/provider-presets/presets/gemini-vertex.json
975
+ var gemini_vertex_default = {
976
+ id: "gemini-vertex",
977
+ presetId: "gemini",
978
+ name: "Google Gemini (Vertex AI)",
979
+ apiFormat: "google",
980
+ apiType: "google",
981
+ api_base_url: "https://us-central1-aiplatform.googleapis.com/v1/projects/YOUR_PROJECT_ID/locations/us-central1/publishers/google",
982
+ models: [
983
+ "gemini-3-flash",
984
+ "gemini-3.1-pro"
985
+ ],
986
+ modelConfigs: [
987
+ {
988
+ id: "gemini-3-flash",
989
+ name: "Gemini 3 Flash",
990
+ enabled: true
991
+ },
992
+ {
993
+ id: "gemini-3.1-pro",
994
+ name: "Gemini 3.1 Pro",
995
+ enabled: true
996
+ }
997
+ ],
998
+ transformer: {
999
+ use: [
1000
+ "gemini"
1001
+ ]
1002
+ },
1003
+ description: "Gemini via Google Cloud Vertex AI \u2014 replace YOUR_PROJECT_ID + region in the URL, paste an OAuth2 access token in the API key field.",
1004
+ icon: "gemini",
1005
+ website: "https://cloud.google.com/vertex-ai",
1006
+ docsUrl: "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models",
1007
+ defaultSettings: {
1008
+ temperature: 0.7,
1009
+ topP: 0.95,
1010
+ maxTokens: 65536
1011
+ },
1012
+ isSystem: true,
1013
+ features: [
1014
+ "vision",
1015
+ "search",
1016
+ "reasoning"
1017
+ ],
1018
+ searchConfig: {
1019
+ type: "builtin-tool",
1020
+ toolDefinition: {
1021
+ google_search: {}
1022
+ },
1023
+ conflictsWithFC: false,
1024
+ applicableModels: null
1025
+ }
1026
+ };
1027
+
1028
+ // src/provider-presets/presets/grok.json
1029
+ var grok_default = {
1030
+ id: "grok",
1031
+ presetId: "grok",
1032
+ name: "Grok",
1033
+ apiFormat: "openai",
1034
+ apiType: "openai",
1035
+ api_base_url: "https://api.x.ai/v1/chat/completions",
1036
+ models: [
1037
+ "grok-4.3",
1038
+ "grok-4.20",
1039
+ "grok-4.20-reasoning",
1040
+ "grok-4.20-multi-agent"
1041
+ ],
1042
+ modelConfigs: [
1043
+ {
1044
+ id: "grok-4.3",
1045
+ name: "Grok 4.3",
1046
+ enabled: true
1047
+ },
1048
+ {
1049
+ id: "grok-4.20",
1050
+ name: "Grok 4.20",
1051
+ enabled: true
1052
+ },
1053
+ {
1054
+ id: "grok-4.20-reasoning",
1055
+ name: "Grok 4.20 Reasoning",
1056
+ enabled: true
1057
+ },
1058
+ {
1059
+ id: "grok-4.20-multi-agent",
1060
+ name: "Grok 4.20 Multi-Agent",
1061
+ enabled: true
1062
+ }
1063
+ ],
1064
+ description: "xAI Grok models with reasoning, vision, and web search capabilities",
1065
+ icon: "grok",
1066
+ website: "https://x.ai",
1067
+ docsUrl: "https://docs.x.ai",
1068
+ defaultSettings: {
1069
+ temperature: 0.7,
1070
+ maxTokens: 4096
1071
+ },
1072
+ isSystem: true,
1073
+ features: [
1074
+ "vision",
1075
+ "reasoning"
1076
+ ]
1077
+ };
1078
+
1079
+ // src/provider-presets/presets/groq.json
1080
+ var groq_default = {
1081
+ id: "groq",
1082
+ presetId: "groq",
1083
+ name: "Groq",
1084
+ apiFormat: "openai",
1085
+ api_base_url: "https://api.groq.com/openai/v1",
1086
+ models: [
1087
+ "llama-3.3-70b-versatile",
1088
+ "llama-3.1-8b-instant",
1089
+ "mixtral-8x7b-32768"
1090
+ ],
1091
+ modelConfigs: [
1092
+ {
1093
+ id: "llama-3.3-70b-versatile",
1094
+ name: "Llama 3.3 70B Versatile",
1095
+ enabled: true,
1096
+ category: "chat",
1097
+ contextLength: 131072,
1098
+ maxTokens: 32768,
1099
+ functionCall: true
1100
+ },
1101
+ {
1102
+ id: "llama-3.1-8b-instant",
1103
+ name: "Llama 3.1 8B Instant",
1104
+ enabled: true,
1105
+ category: "chat",
1106
+ contextLength: 131072,
1107
+ maxTokens: 8192,
1108
+ functionCall: true
1109
+ },
1110
+ {
1111
+ id: "mixtral-8x7b-32768",
1112
+ name: "Mixtral 8x7B",
1113
+ enabled: true,
1114
+ category: "chat",
1115
+ contextLength: 32768,
1116
+ maxTokens: 32768,
1117
+ functionCall: true
1118
+ }
1119
+ ],
1120
+ transformer: {
1121
+ use: [
1122
+ "groq"
1123
+ ]
1124
+ },
1125
+ description: "Groq \u2014 \u9AD8\u901F LPU \u63A8\u7406",
1126
+ icon: "groq",
1127
+ website: "https://groq.com",
1128
+ docsUrl: "https://console.groq.com/docs",
1129
+ defaultSettings: {
1130
+ temperature: 0.7,
1131
+ maxTokens: 4096
1132
+ },
1133
+ isSystem: true,
1134
+ features: []
1135
+ };
1136
+
1137
+ // src/provider-presets/presets/kimi.json
1138
+ var kimi_default = {
1139
+ id: "kimi",
1140
+ presetId: "kimi",
1141
+ name: "Kimi (Moonshot)",
1142
+ apiFormat: "openai",
1143
+ api_base_url: "https://api.moonshot.ai/v1",
1144
+ codingPlanBaseUrl: "https://api.kimi.com/coding/v1",
1145
+ models: [
1146
+ "kimi-k2.6",
1147
+ "kimi-k2.5",
1148
+ "kimi-k2-thinking"
1149
+ ],
1150
+ modelConfigs: [
1151
+ {
1152
+ id: "kimi-k2.6",
1153
+ name: "Kimi K2.6",
1154
+ enabled: true
1155
+ },
1156
+ {
1157
+ id: "kimi-k2.5",
1158
+ name: "Kimi K2.5",
1159
+ enabled: true
1160
+ },
1161
+ {
1162
+ id: "kimi-k2-thinking",
1163
+ name: "Kimi K2 Thinking",
1164
+ enabled: false
1165
+ }
1166
+ ],
1167
+ description: "Moonshot AI - Kimi\u5927\u6A21\u578B",
1168
+ icon: "kimi",
1169
+ website: "https://www.kimi.com",
1170
+ docsUrl: "https://platform.moonshot.ai/docs",
1171
+ isSystem: true,
1172
+ features: [
1173
+ "coding-plan",
1174
+ "vision",
1175
+ "search"
1176
+ ],
1177
+ searchConfig: {
1178
+ type: "builtin-tool",
1179
+ toolDefinition: {
1180
+ type: "builtin_function",
1181
+ function: {
1182
+ name: "web_search"
1183
+ }
1184
+ },
1185
+ conflictsWithFC: false,
1186
+ applicableModels: null
1187
+ },
1188
+ apiModes: [
1189
+ {
1190
+ id: "standard",
1191
+ label: "apiMode.standard",
1192
+ baseUrl: "https://api.moonshot.ai/v1"
1193
+ },
1194
+ {
1195
+ id: "coding-plan",
1196
+ label: "apiMode.codingPlan",
1197
+ baseUrl: "https://api.kimi.com/coding/v1"
1198
+ }
1199
+ ]
1200
+ };
1201
+
1202
+ // src/provider-presets/presets/kuaishou.json
1203
+ var kuaishou_default = {
1204
+ id: "kuaishou",
1205
+ presetId: "kuaishou",
1206
+ name: "\u5FEB\u624B KwaiKAT",
1207
+ nameKey: "presetName.kuaishou",
1208
+ apiFormat: "openai",
1209
+ api_base_url: "https://wanqing.streamlakeapi.com/api/gateway/v1",
1210
+ codingPlanBaseUrl: "https://wanqing.streamlakeapi.com/api/gateway/coding/v1",
1211
+ models: [
1212
+ "kat-coder-pro-v1",
1213
+ "kat-coder-air-v1"
1214
+ ],
1215
+ modelConfigs: [
1216
+ {
1217
+ id: "kat-coder-pro-v1",
1218
+ name: "KAT-Coder Pro",
1219
+ enabled: true
1220
+ },
1221
+ {
1222
+ id: "kat-coder-air-v1",
1223
+ name: "KAT-Coder Air (\u514D\u8D39)",
1224
+ enabled: true
1225
+ }
1226
+ ],
1227
+ description: "\u5FEB\u624B StreamLake \u5927\u6A21\u578B\u5E73\u53F0",
1228
+ icon: "kuaishou",
1229
+ website: "https://streamlake.com",
1230
+ docsUrl: "https://www.streamlake.com/document/WANQING/me6ymdjrqv8lp4iq0o9",
1231
+ isSystem: true,
1232
+ features: [
1233
+ "coding-plan"
1234
+ ],
1235
+ apiModes: [
1236
+ {
1237
+ id: "standard",
1238
+ label: "apiMode.standard",
1239
+ baseUrl: "https://wanqing.streamlakeapi.com/api/gateway/v1"
1240
+ },
1241
+ {
1242
+ id: "coding-plan",
1243
+ label: "apiMode.codingPlan",
1244
+ baseUrl: "https://wanqing.streamlakeapi.com/api/gateway/coding/v1"
1245
+ }
1246
+ ]
1247
+ };
1248
+
1249
+ // src/provider-presets/presets/minimax.json
1250
+ var minimax_default = {
1251
+ id: "minimax",
1252
+ presetId: "minimax",
1253
+ name: "MiniMax",
1254
+ apiFormat: "anthropic",
1255
+ api_base_url: "https://api.minimaxi.com/anthropic",
1256
+ transformer: {
1257
+ use: [
1258
+ "anthropic"
1259
+ ]
1260
+ },
1261
+ models: [
1262
+ "MiniMax-M2.5",
1263
+ "MiniMax-M2.5-highspeed",
1264
+ "MiniMax-M2.1",
1265
+ "MiniMax-M2.1-highspeed"
1266
+ ],
1267
+ modelConfigs: [
1268
+ {
1269
+ id: "MiniMax-M2.5",
1270
+ name: "MiniMax M2.5",
1271
+ enabled: true
1272
+ },
1273
+ {
1274
+ id: "MiniMax-M2.5-highspeed",
1275
+ name: "MiniMax M2.5 \u6781\u901F\u7248",
1276
+ enabled: true
1277
+ },
1278
+ {
1279
+ id: "MiniMax-M2.1",
1280
+ name: "MiniMax M2.1",
1281
+ enabled: true
1282
+ },
1283
+ {
1284
+ id: "MiniMax-M2.1-highspeed",
1285
+ name: "MiniMax M2.1 \u6781\u901F\u7248",
1286
+ enabled: true
1287
+ }
1288
+ ],
1289
+ description: "MiniMax\u5927\u6A21\u578B\u5E73\u53F0",
1290
+ icon: "minimax",
1291
+ website: "https://platform.minimaxi.com",
1292
+ docsUrl: "https://platform.minimaxi.com/docs",
1293
+ isSystem: true,
1294
+ features: [
1295
+ "coding-plan",
1296
+ "mcp-search",
1297
+ "mcp-vision"
1298
+ ],
1299
+ searchConfig: {
1300
+ type: "mcp",
1301
+ mcpServerId: "minimax-search",
1302
+ applicableModels: null
1303
+ }
1304
+ };
1305
+
1306
+ // src/provider-presets/presets/mistral.json
1307
+ var mistral_default = {
1308
+ id: "mistral",
1309
+ presetId: "mistral",
1310
+ name: "Mistral",
1311
+ apiFormat: "openai",
1312
+ api_base_url: "https://api.mistral.ai/v1",
1313
+ modelsEndpoint: "https://api.mistral.ai/v1/models",
1314
+ models: [
1315
+ "mistral-large-latest",
1316
+ "codestral-latest",
1317
+ "mistral-medium-latest"
1318
+ ],
1319
+ modelConfigs: [
1320
+ {
1321
+ id: "mistral-large-latest",
1322
+ name: "Mistral Large",
1323
+ enabled: true
1324
+ },
1325
+ {
1326
+ id: "codestral-latest",
1327
+ name: "Codestral",
1328
+ enabled: true
1329
+ },
1330
+ {
1331
+ id: "mistral-medium-latest",
1332
+ name: "Mistral Medium",
1333
+ enabled: true
1334
+ }
1335
+ ],
1336
+ description: "Mistral La Plateforme \u2014 \u6CD5\u56FD\u5927\u6A21\u578B",
1337
+ icon: "mistral",
1338
+ website: "https://mistral.ai",
1339
+ docsUrl: "https://docs.mistral.ai",
1340
+ defaultSettings: {
1341
+ temperature: 0.7,
1342
+ maxTokens: 4096
1343
+ },
1344
+ isSystem: true,
1345
+ features: []
1346
+ };
1347
+
1348
+ // src/provider-presets/presets/mthreads.json
1349
+ var mthreads_default = {
1350
+ id: "mthreads",
1351
+ presetId: "mthreads",
1352
+ name: "\u6469\u5C14\u7EBF\u7A0B",
1353
+ nameKey: "presetName.mthreads",
1354
+ apiFormat: "openai",
1355
+ api_base_url: "",
1356
+ models: [
1357
+ "glm-4.7"
1358
+ ],
1359
+ modelConfigs: [
1360
+ {
1361
+ id: "glm-4.7",
1362
+ name: "GLM-4.7",
1363
+ enabled: true
1364
+ }
1365
+ ],
1366
+ description: "\u6469\u5C14\u7EBF\u7A0B AI Coding Plan (\u56FD\u4EA7\u82AF\u7247)",
1367
+ icon: "mthreads",
1368
+ website: "https://code.mthreads.com",
1369
+ docsUrl: "https://docs.mthreads.com/kuaecloud/kuaecloud-doc-online/coding_plan/plan_overview",
1370
+ isSystem: true,
1371
+ features: [
1372
+ "coding-plan"
1373
+ ]
1374
+ };
1375
+
1376
+ // src/provider-presets/presets/ollama.json
1377
+ var ollama_default = {
1378
+ id: "ollama",
1379
+ presetId: "ollama",
1380
+ name: "Ollama",
1381
+ apiFormat: "openai",
1382
+ api_base_url: "http://localhost:11434/v1",
1383
+ modelsEndpoint: "http://localhost:11434/v1/models",
1384
+ models: [],
1385
+ modelConfigs: [],
1386
+ description: "Ollama \u2014 \u672C\u5730\u5927\u6A21\u578B\u63A8\u7406\uFF08API key \u53EF\u7559\u7A7A\u6216\u586B\u4EFB\u610F\u5360\u4F4D\u7B26\uFF09",
1387
+ icon: "ollama",
1388
+ website: "https://ollama.com",
1389
+ docsUrl: "https://github.com/ollama/ollama/blob/main/docs/openai.md",
1390
+ defaultSettings: {
1391
+ temperature: 0.7,
1392
+ maxTokens: 4096
1393
+ },
1394
+ isSystem: true,
1395
+ features: [
1396
+ "local"
1397
+ ]
1398
+ };
1399
+
1400
+ // src/provider-presets/presets/openai.json
1401
+ var openai_default = {
1402
+ id: "openai",
1403
+ presetId: "openai",
1404
+ name: "OpenAI",
1405
+ apiFormat: "openai",
1406
+ apiType: "openai",
1407
+ api_base_url: "https://api.openai.com/v1/chat/completions",
1408
+ models: [
1409
+ "gpt-5.5",
1410
+ "gpt-5.4",
1411
+ "gpt-5.4-mini",
1412
+ "gpt-5.2",
1413
+ "gpt-4o",
1414
+ "gpt-4o-mini"
1415
+ ],
1416
+ modelConfigs: [
1417
+ {
1418
+ id: "gpt-5.5",
1419
+ name: "GPT-5.5",
1420
+ enabled: true
1421
+ },
1422
+ {
1423
+ id: "gpt-5.4",
1424
+ name: "GPT-5.4",
1425
+ enabled: true
1426
+ },
1427
+ {
1428
+ id: "gpt-5.4-mini",
1429
+ name: "GPT-5.4 Mini",
1430
+ enabled: true
1431
+ },
1432
+ {
1433
+ id: "gpt-5.2",
1434
+ name: "GPT-5.2",
1435
+ enabled: true
1436
+ },
1437
+ {
1438
+ id: "gpt-4o",
1439
+ name: "GPT-4o",
1440
+ enabled: true
1441
+ },
1442
+ {
1443
+ id: "gpt-4o-mini",
1444
+ name: "GPT-4o Mini",
1445
+ enabled: true
1446
+ }
1447
+ ],
1448
+ description: "OpenAI\u5B98\u65B9API",
1449
+ icon: "openai",
1450
+ website: "https://openai.com",
1451
+ docsUrl: "https://platform.openai.com/docs",
1452
+ defaultSettings: {
1453
+ temperature: 0.7,
1454
+ maxTokens: 4096
1455
+ },
1456
+ isSystem: true,
1457
+ features: [
1458
+ "vision",
1459
+ "search"
1460
+ ],
1461
+ searchConfig: {
1462
+ type: "builtin-tool",
1463
+ toolDefinition: {
1464
+ type: "web_search_preview"
1465
+ },
1466
+ conflictsWithFC: false,
1467
+ applicableModels: null
1468
+ }
1469
+ };
1470
+
1471
+ // src/provider-presets/presets/openai-response.json
1472
+ var openai_response_default = {
1473
+ id: "openai-response",
1474
+ presetId: "openai-response",
1475
+ name: "OpenAI (Responses API)",
1476
+ apiFormat: "openai-response",
1477
+ api_base_url: "https://api.openai.com",
1478
+ models: [
1479
+ "gpt-5.5",
1480
+ "gpt-5.4",
1481
+ "gpt-5.4-mini",
1482
+ "gpt-5.3-codex",
1483
+ "gpt-5.2",
1484
+ "o3",
1485
+ "o4-mini",
1486
+ "gpt-4.1"
1487
+ ],
1488
+ modelConfigs: [
1489
+ {
1490
+ id: "gpt-5.5",
1491
+ name: "GPT-5.5",
1492
+ enabled: true
1493
+ },
1494
+ {
1495
+ id: "gpt-5.4",
1496
+ name: "GPT-5.4",
1497
+ enabled: true
1498
+ },
1499
+ {
1500
+ id: "gpt-5.4-mini",
1501
+ name: "GPT-5.4 Mini",
1502
+ enabled: true
1503
+ },
1504
+ {
1505
+ id: "gpt-5.3-codex",
1506
+ name: "GPT-5.3 Codex",
1507
+ enabled: true
1508
+ },
1509
+ {
1510
+ id: "gpt-5.2",
1511
+ name: "GPT-5.2",
1512
+ enabled: true
1513
+ },
1514
+ {
1515
+ id: "o3",
1516
+ name: "o3",
1517
+ enabled: true
1518
+ },
1519
+ {
1520
+ id: "o4-mini",
1521
+ name: "o4 Mini",
1522
+ enabled: true
1523
+ },
1524
+ {
1525
+ id: "gpt-4.1",
1526
+ name: "GPT-4.1",
1527
+ enabled: true
1528
+ }
1529
+ ],
1530
+ transformer: {
1531
+ use: [
1532
+ "openai-response"
1533
+ ]
1534
+ },
1535
+ description: "OpenAI Responses API (/v1/responses endpoint)",
1536
+ icon: "openai",
1537
+ website: "https://openai.com",
1538
+ docsUrl: "https://platform.openai.com/docs/api-reference/responses",
1539
+ defaultSettings: {
1540
+ temperature: 0.7,
1541
+ maxTokens: 4096
1542
+ },
1543
+ isSystem: true,
1544
+ features: [
1545
+ "vision",
1546
+ "reasoning"
1547
+ ]
1548
+ };
1549
+
1550
+ // src/provider-presets/presets/openrouter.json
1551
+ var openrouter_default = {
1552
+ id: "openrouter",
1553
+ presetId: "openrouter",
1554
+ name: "OpenRouter",
1555
+ apiFormat: "openai",
1556
+ api_base_url: "https://openrouter.ai/api/v1",
1557
+ modelsEndpoint: "https://openrouter.ai/api/v1/models",
1558
+ models: [
1559
+ "anthropic/claude-sonnet-4-6",
1560
+ "openai/gpt-5",
1561
+ "google/gemini-3.1-pro",
1562
+ "meta-llama/llama-3.3-70b-instruct",
1563
+ "deepseek/deepseek-v3.2"
1564
+ ],
1565
+ modelConfigs: [
1566
+ {
1567
+ id: "anthropic/claude-sonnet-4-6",
1568
+ name: "Claude Sonnet 4.6 (OpenRouter)",
1569
+ enabled: true
1570
+ },
1571
+ {
1572
+ id: "openai/gpt-5",
1573
+ name: "GPT-5 (OpenRouter)",
1574
+ enabled: true
1575
+ },
1576
+ {
1577
+ id: "google/gemini-3.1-pro",
1578
+ name: "Gemini 3.1 Pro (OpenRouter)",
1579
+ enabled: true
1580
+ },
1581
+ {
1582
+ id: "meta-llama/llama-3.3-70b-instruct",
1583
+ name: "Llama 3.3 70B (OpenRouter)",
1584
+ enabled: true
1585
+ },
1586
+ {
1587
+ id: "deepseek/deepseek-v3.2",
1588
+ name: "DeepSeek V3.2 (OpenRouter)",
1589
+ enabled: true
1590
+ }
1591
+ ],
1592
+ transformer: {
1593
+ use: [
1594
+ "openrouter"
1595
+ ]
1596
+ },
1597
+ description: "OpenRouter \u2014 \u7EDF\u4E00\u805A\u5408\u591A\u5BB6 LLM provider",
1598
+ icon: "openrouter",
1599
+ website: "https://openrouter.ai",
1600
+ docsUrl: "https://openrouter.ai/docs",
1601
+ defaultSettings: {
1602
+ temperature: 0.7,
1603
+ maxTokens: 4096
1604
+ },
1605
+ isSystem: true,
1606
+ features: [
1607
+ "vision",
1608
+ "reasoning"
1609
+ ]
1610
+ };
1611
+
1612
+ // src/provider-presets/presets/perplexity.json
1613
+ var perplexity_default = {
1614
+ id: "perplexity",
1615
+ presetId: "perplexity",
1616
+ name: "Perplexity",
1617
+ apiFormat: "openai",
1618
+ api_base_url: "https://api.perplexity.ai",
1619
+ models: [
1620
+ "sonar",
1621
+ "sonar-pro",
1622
+ "sonar-reasoning-pro"
1623
+ ],
1624
+ modelConfigs: [
1625
+ {
1626
+ id: "sonar",
1627
+ name: "Sonar",
1628
+ enabled: true
1629
+ },
1630
+ {
1631
+ id: "sonar-pro",
1632
+ name: "Sonar Pro",
1633
+ enabled: true
1634
+ },
1635
+ {
1636
+ id: "sonar-reasoning-pro",
1637
+ name: "Sonar Reasoning Pro",
1638
+ enabled: true
1639
+ }
1640
+ ],
1641
+ description: "Perplexity Sonar \u2014 \u641C\u7D22\u589E\u5F3A\u63A8\u7406",
1642
+ icon: "perplexity",
1643
+ website: "https://perplexity.ai",
1644
+ docsUrl: "https://docs.perplexity.ai",
1645
+ defaultSettings: {
1646
+ temperature: 0.7,
1647
+ maxTokens: 4096
1648
+ },
1649
+ isSystem: true,
1650
+ features: [
1651
+ "search"
1652
+ ]
1653
+ };
1654
+
1655
+ // src/provider-presets/presets/siliconflow.json
1656
+ var siliconflow_default = {
1657
+ id: "siliconflow",
1658
+ presetId: "siliconflow",
1659
+ name: "SiliconFlow",
1660
+ apiFormat: "openai",
1661
+ api_base_url: "https://api.siliconflow.com/v1",
1662
+ modelsEndpoint: "https://api.siliconflow.com/v1/models",
1663
+ models: [
1664
+ "Qwen/Qwen2.5-Coder-32B-Instruct",
1665
+ "Qwen/Qwen2.5-Coder-7B-Instruct",
1666
+ "deepseek-ai/DeepSeek-V3",
1667
+ "zai-org/GLM-4.7"
1668
+ ],
1669
+ modelConfigs: [
1670
+ {
1671
+ id: "Qwen/Qwen2.5-Coder-32B-Instruct",
1672
+ name: "Qwen2.5 Coder 32B",
1673
+ enabled: true
1674
+ },
1675
+ {
1676
+ id: "Qwen/Qwen2.5-Coder-7B-Instruct",
1677
+ name: "Qwen2.5 Coder 7B",
1678
+ enabled: true
1679
+ },
1680
+ {
1681
+ id: "deepseek-ai/DeepSeek-V3",
1682
+ name: "DeepSeek V3 (\u805A\u5408)",
1683
+ enabled: true
1684
+ },
1685
+ {
1686
+ id: "zai-org/GLM-4.7",
1687
+ name: "GLM-4.7 (\u805A\u5408)",
1688
+ enabled: true
1689
+ }
1690
+ ],
1691
+ description: "\u7845\u57FA\u6D41\u52A8 - \u591A\u6A21\u578B\u805A\u5408\u63A8\u7406\u5E73\u53F0",
1692
+ icon: "silicon",
1693
+ website: "https://www.siliconflow.com",
1694
+ docsUrl: "https://docs.siliconflow.com",
1695
+ defaultSettings: {
1696
+ temperature: 0.7,
1697
+ maxTokens: 4096
1698
+ },
1699
+ isSystem: true,
1700
+ features: [
1701
+ "vision"
1702
+ ]
1703
+ };
1704
+
1705
+ // src/provider-presets/presets/tencent.json
1706
+ var tencent_default = {
1707
+ id: "tencent",
1708
+ presetId: "tencent",
1709
+ name: "\u817E\u8BAF\u4E91\u6DF7\u5143",
1710
+ nameKey: "presetName.tencent",
1711
+ apiFormat: "openai",
1712
+ api_base_url: "https://api.lkeap.cloud.tencent.com/v1",
1713
+ codingPlanBaseUrl: "https://api.lkeap.cloud.tencent.com/coding/v3",
1714
+ codingPlanSeparateKey: true,
1715
+ models: [
1716
+ "tc-code-latest",
1717
+ "hunyuan-2.0-instruct",
1718
+ "hunyuan-turbos",
1719
+ "glm-5",
1720
+ "kimi-k2.5",
1721
+ "minimax-m2.5"
1722
+ ],
1723
+ modelConfigs: [
1724
+ {
1725
+ id: "tc-code-latest",
1726
+ name: "Auto",
1727
+ enabled: true
1728
+ },
1729
+ {
1730
+ id: "hunyuan-2.0-instruct",
1731
+ name: "\u6DF7\u5143 2.0 Instruct",
1732
+ enabled: true
1733
+ },
1734
+ {
1735
+ id: "hunyuan-turbos",
1736
+ name: "\u6DF7\u5143 TurboS",
1737
+ enabled: true
1738
+ },
1739
+ {
1740
+ id: "glm-5",
1741
+ name: "GLM-5",
1742
+ enabled: true
1743
+ },
1744
+ {
1745
+ id: "kimi-k2.5",
1746
+ name: "Kimi K2.5",
1747
+ enabled: true
1748
+ },
1749
+ {
1750
+ id: "minimax-m2.5",
1751
+ name: "MiniMax M2.5",
1752
+ enabled: true
1753
+ }
1754
+ ],
1755
+ description: "\u817E\u8BAF\u4E91\u5927\u6A21\u578B\u5E73\u53F0 (OpenAI \u517C\u5BB9) \u2014 \u542B Coding Plan\uFF1BToken Plan \u4EC5 Anthropic \u534F\u8BAE\uFF0C\u8BF7\u4F7F\u7528 tencent-anthropic preset",
1756
+ icon: "tencent",
1757
+ website: "https://cloud.tencent.com",
1758
+ docsUrl: "https://cloud.tencent.com/document/product/1772/128947",
1759
+ isSystem: true,
1760
+ features: [
1761
+ "coding-plan"
1762
+ ],
1763
+ apiModes: [
1764
+ {
1765
+ id: "standard",
1766
+ label: "apiMode.standard",
1767
+ baseUrl: "https://api.lkeap.cloud.tencent.com/v1",
1768
+ apiKeyPrefix: "sk-"
1769
+ },
1770
+ {
1771
+ id: "coding-plan",
1772
+ label: "apiMode.codingPlan",
1773
+ baseUrl: "https://api.lkeap.cloud.tencent.com/coding/v3",
1774
+ apiKeyPrefix: "sk-sp-"
1775
+ }
1776
+ ]
1777
+ };
1778
+
1779
+ // src/provider-presets/presets/tencent-anthropic.json
1780
+ var tencent_anthropic_default = {
1781
+ id: "tencent-anthropic",
1782
+ presetId: "tencent",
1783
+ name: "\u817E\u8BAF\u4E91\u6DF7\u5143 (Token Plan)",
1784
+ nameKey: "presetName.tencentAnthropic",
1785
+ apiFormat: "anthropic",
1786
+ api_base_url: "https://api.lkeap.cloud.tencent.com/plan/anthropic/v1/messages",
1787
+ transformer: {
1788
+ use: [
1789
+ "anthropic"
1790
+ ]
1791
+ },
1792
+ models: [
1793
+ "tc-code-latest",
1794
+ "hunyuan-2.0-instruct",
1795
+ "hunyuan-turbos",
1796
+ "glm-5",
1797
+ "kimi-k2.5",
1798
+ "minimax-m2.5"
1799
+ ],
1800
+ modelConfigs: [
1801
+ {
1802
+ id: "tc-code-latest",
1803
+ name: "Auto",
1804
+ enabled: true
1805
+ },
1806
+ {
1807
+ id: "hunyuan-2.0-instruct",
1808
+ name: "\u6DF7\u5143 2.0 Instruct",
1809
+ enabled: true
1810
+ },
1811
+ {
1812
+ id: "hunyuan-turbos",
1813
+ name: "\u6DF7\u5143 TurboS",
1814
+ enabled: true
1815
+ },
1816
+ {
1817
+ id: "glm-5",
1818
+ name: "GLM-5",
1819
+ enabled: true
1820
+ },
1821
+ {
1822
+ id: "kimi-k2.5",
1823
+ name: "Kimi K2.5",
1824
+ enabled: true
1825
+ },
1826
+ {
1827
+ id: "minimax-m2.5",
1828
+ name: "MiniMax M2.5",
1829
+ enabled: true
1830
+ }
1831
+ ],
1832
+ description: "\u817E\u8BAF\u4E91\u6DF7\u5143 (Anthropic \u517C\u5BB9) \u2014 \u542B Token Plan + Coding Plan\uFF1B\u9002\u5408 Claude Code \u5DE5\u5177\u94FE",
1833
+ icon: "tencent",
1834
+ website: "https://cloud.tencent.com",
1835
+ docsUrl: "https://cloud.tencent.com/document/product/1772/128947",
1836
+ isSystem: true,
1837
+ features: [
1838
+ "coding-plan"
1839
+ ],
1840
+ apiModes: [
1841
+ {
1842
+ id: "token-plan",
1843
+ label: "apiMode.tokenPlan",
1844
+ baseUrl: "https://api.lkeap.cloud.tencent.com/plan/anthropic/v1/messages",
1845
+ apiKeyPrefix: "sk-tp-",
1846
+ note: "apiMode.tencentTokenPlanAnthropicOnly"
1847
+ },
1848
+ {
1849
+ id: "coding-plan",
1850
+ label: "apiMode.codingPlan",
1851
+ baseUrl: "https://api.lkeap.cloud.tencent.com/coding/anthropic",
1852
+ apiKeyPrefix: "sk-sp-"
1853
+ }
1854
+ ]
1855
+ };
1856
+
1857
+ // src/provider-presets/presets/together.json
1858
+ var together_default = {
1859
+ id: "together",
1860
+ presetId: "together",
1861
+ name: "Together AI",
1862
+ apiFormat: "openai",
1863
+ api_base_url: "https://api.together.xyz/v1",
1864
+ modelsEndpoint: "https://api.together.xyz/v1/models",
1865
+ models: [
1866
+ "meta-llama/Llama-3.3-70B-Instruct-Turbo",
1867
+ "Qwen/Qwen2.5-Coder-32B-Instruct",
1868
+ "deepseek-ai/DeepSeek-V3"
1869
+ ],
1870
+ modelConfigs: [
1871
+ {
1872
+ id: "meta-llama/Llama-3.3-70B-Instruct-Turbo",
1873
+ name: "Llama 3.3 70B Turbo",
1874
+ enabled: true
1875
+ },
1876
+ {
1877
+ id: "Qwen/Qwen2.5-Coder-32B-Instruct",
1878
+ name: "Qwen2.5 Coder 32B",
1879
+ enabled: true
1880
+ },
1881
+ {
1882
+ id: "deepseek-ai/DeepSeek-V3",
1883
+ name: "DeepSeek V3",
1884
+ enabled: true
1885
+ }
1886
+ ],
1887
+ description: "Together AI \u2014 \u5F00\u6E90\u6A21\u578B\u805A\u5408\u63A8\u7406",
1888
+ icon: "together",
1889
+ website: "https://together.ai",
1890
+ docsUrl: "https://docs.together.ai",
1891
+ defaultSettings: {
1892
+ temperature: 0.7,
1893
+ maxTokens: 4096
1894
+ },
1895
+ isSystem: true,
1896
+ features: []
1897
+ };
1898
+
1899
+ // src/provider-presets/presets/volcengine.json
1900
+ var volcengine_default = {
1901
+ id: "volcengine",
1902
+ presetId: "volcengine",
1903
+ name: "\u706B\u5C71\u65B9\u821F",
1904
+ nameKey: "presetName.volcengine",
1905
+ apiFormat: "openai",
1906
+ api_base_url: "https://ark.cn-beijing.volces.com/api/v3",
1907
+ codingPlanBaseUrl: "https://ark.cn-beijing.volces.com/api/coding/v3",
1908
+ models: [
1909
+ "ark-code-latest",
1910
+ "doubao-seed-2.0-code",
1911
+ "doubao-seed-2.0-lite",
1912
+ "glm-4.7",
1913
+ "deepseek-v3.2",
1914
+ "kimi-k2.5"
1915
+ ],
1916
+ modelConfigs: [
1917
+ {
1918
+ id: "ark-code-latest",
1919
+ name: "Auto (\u667A\u80FD\u8DEF\u7531)",
1920
+ enabled: true
1921
+ },
1922
+ {
1923
+ id: "doubao-seed-2.0-code",
1924
+ name: "\u8C46\u5305 Seed 2.0 Code",
1925
+ enabled: true
1926
+ },
1927
+ {
1928
+ id: "doubao-seed-2.0-lite",
1929
+ name: "\u8C46\u5305 Seed 2.0 Lite",
1930
+ enabled: true
1931
+ },
1932
+ {
1933
+ id: "glm-4.7",
1934
+ name: "GLM-4.7",
1935
+ enabled: true
1936
+ },
1937
+ {
1938
+ id: "deepseek-v3.2",
1939
+ name: "DeepSeek V3.2",
1940
+ enabled: true
1941
+ },
1942
+ {
1943
+ id: "kimi-k2.5",
1944
+ name: "Kimi K2.5",
1945
+ enabled: true
1946
+ }
1947
+ ],
1948
+ description: "\u5B57\u8282\u8DF3\u52A8\u706B\u5C71\u65B9\u821F\u5927\u6A21\u578B\u5E73\u53F0",
1949
+ icon: "volcengine",
1950
+ website: "https://www.volcengine.com",
1951
+ docsUrl: "https://www.volcengine.com/docs/82379/1330626",
1952
+ isSystem: true,
1953
+ features: [
1954
+ "coding-plan",
1955
+ "vision",
1956
+ "search",
1957
+ "auto-routing"
1958
+ ],
1959
+ searchConfig: {
1960
+ type: "model-param",
1961
+ paramName: "web_search",
1962
+ paramValue: {
1963
+ enable: true
1964
+ },
1965
+ applicableModels: null
1966
+ },
1967
+ apiModes: [
1968
+ {
1969
+ id: "standard",
1970
+ label: "apiMode.standard",
1971
+ baseUrl: "https://ark.cn-beijing.volces.com/api/v3"
1972
+ },
1973
+ {
1974
+ id: "coding-plan",
1975
+ label: "apiMode.codingPlan",
1976
+ baseUrl: "https://ark.cn-beijing.volces.com/api/coding/v3"
1977
+ }
1978
+ ]
1979
+ };
1980
+
1981
+ // src/provider-presets/presets/xiaomi-mimo.json
1982
+ var xiaomi_mimo_default = {
1983
+ id: "xiaomi-mimo",
1984
+ presetId: "xiaomi-mimo",
1985
+ name: "\u5C0F\u7C73 MiMo (OpenAI)",
1986
+ nameKey: "presetName.xiaomiMimoOpenai",
1987
+ apiFormat: "openai",
1988
+ api_base_url: "https://api.xiaomimimo.com/v1",
1989
+ codingPlanBaseUrl: "https://token-plan-cn.xiaomimimo.com/v1",
1990
+ models: [
1991
+ "mimo-v2.5",
1992
+ "mimo-v2.5-pro",
1993
+ "mimo-v2-pro",
1994
+ "mimo-v2-flash",
1995
+ "mimo-v2-omni"
1996
+ ],
1997
+ modelConfigs: [
1998
+ {
1999
+ id: "mimo-v2.5",
2000
+ name: "MiMo V2.5",
2001
+ enabled: true
2002
+ },
2003
+ {
2004
+ id: "mimo-v2.5-pro",
2005
+ name: "MiMo V2.5 Pro",
2006
+ enabled: true
2007
+ },
2008
+ {
2009
+ id: "mimo-v2-pro",
2010
+ name: "MiMo V2 Pro",
2011
+ enabled: true
2012
+ },
2013
+ {
2014
+ id: "mimo-v2-flash",
2015
+ name: "MiMo V2 Flash",
2016
+ enabled: true
2017
+ },
2018
+ {
2019
+ id: "mimo-v2-omni",
2020
+ name: "MiMo V2 Omni",
2021
+ enabled: true
2022
+ }
2023
+ ],
2024
+ description: "\u5C0F\u7C73 MiMo (OpenAI \u517C\u5BB9) \u2014 \u9002\u5408\u901A\u7528 OpenAI \u5DE5\u5177\u94FE\uFF1B\u8BA2\u9605 Token Plan \u540E\u542F\u7528 coding plan\uFF0C\u6D77\u5916\u7528\u6237\u53EF\u624B\u52A8\u6539 baseUrl \u4E3A token-plan-sgp.* / token-plan-ams.*\u3002",
2025
+ icon: "xiaomi",
2026
+ website: "https://xiaomimimo.com",
2027
+ docsUrl: "https://platform.xiaomimimo.com/",
2028
+ isSystem: true,
2029
+ features: [
2030
+ "coding-plan",
2031
+ "vision"
2032
+ ],
2033
+ apiModes: [
2034
+ {
2035
+ id: "standard",
2036
+ label: "apiMode.standard",
2037
+ baseUrl: "https://api.xiaomimimo.com/v1"
2038
+ },
2039
+ {
2040
+ id: "token-plan",
2041
+ label: "apiMode.tokenPlan",
2042
+ baseUrl: "https://token-plan-cn.xiaomimimo.com/v1",
2043
+ apiKeyPrefix: "tp-",
2044
+ note: "apiMode.xiaomiTokenPlanRegions"
2045
+ }
2046
+ ]
2047
+ };
2048
+
2049
+ // src/provider-presets/presets/xiaomi-mimo-anthropic.json
2050
+ var xiaomi_mimo_anthropic_default = {
2051
+ id: "xiaomi-mimo-anthropic",
2052
+ presetId: "xiaomi-mimo",
2053
+ name: "\u5C0F\u7C73 MiMo (Anthropic)",
2054
+ nameKey: "presetName.xiaomiMimoAnthropic",
2055
+ apiFormat: "anthropic",
2056
+ api_base_url: "https://api.xiaomimimo.com/anthropic",
2057
+ codingPlanBaseUrl: "https://token-plan-cn.xiaomimimo.com/anthropic",
2058
+ transformer: {
2059
+ use: [
2060
+ "anthropic"
2061
+ ]
2062
+ },
2063
+ models: [
2064
+ "mimo-v2.5",
2065
+ "mimo-v2.5-pro",
2066
+ "mimo-v2-pro",
2067
+ "mimo-v2-flash",
2068
+ "mimo-v2-omni"
2069
+ ],
2070
+ modelConfigs: [
2071
+ {
2072
+ id: "mimo-v2.5",
2073
+ name: "MiMo V2.5",
2074
+ enabled: true
2075
+ },
2076
+ {
2077
+ id: "mimo-v2.5-pro",
2078
+ name: "MiMo V2.5 Pro",
2079
+ enabled: true
2080
+ },
2081
+ {
2082
+ id: "mimo-v2-pro",
2083
+ name: "MiMo V2 Pro",
2084
+ enabled: true
2085
+ },
2086
+ {
2087
+ id: "mimo-v2-flash",
2088
+ name: "MiMo V2 Flash",
2089
+ enabled: true
2090
+ },
2091
+ {
2092
+ id: "mimo-v2-omni",
2093
+ name: "MiMo V2 Omni",
2094
+ enabled: true
2095
+ }
2096
+ ],
2097
+ description: "\u5C0F\u7C73 MiMo (Anthropic \u517C\u5BB9) \u2014 \u9002\u5408 Claude Code \u7C7B\u5DE5\u5177\u94FE\uFF1B\u8BA2\u9605 Token Plan \u540E\u542F\u7528 coding plan\uFF0C\u6D77\u5916\u7528\u6237\u53EF\u624B\u52A8\u6539 baseUrl \u4E3A token-plan-sgp.* / token-plan-ams.*\u3002",
2098
+ icon: "xiaomi",
2099
+ website: "https://xiaomimimo.com",
2100
+ docsUrl: "https://platform.xiaomimimo.com/",
2101
+ isSystem: true,
2102
+ features: [
2103
+ "coding-plan",
2104
+ "vision"
2105
+ ],
2106
+ apiModes: [
2107
+ {
2108
+ id: "standard",
2109
+ label: "apiMode.standard",
2110
+ baseUrl: "https://api.xiaomimimo.com/anthropic"
2111
+ },
2112
+ {
2113
+ id: "token-plan",
2114
+ label: "apiMode.tokenPlan",
2115
+ baseUrl: "https://token-plan-cn.xiaomimimo.com/anthropic",
2116
+ apiKeyPrefix: "tp-",
2117
+ note: "apiMode.xiaomiTokenPlanRegions"
2118
+ }
2119
+ ]
2120
+ };
2121
+
2122
+ // src/provider-presets/presets/zhipu.json
2123
+ var zhipu_default = {
2124
+ id: "zhipu",
2125
+ presetId: "zhipu",
2126
+ name: "z.ai",
2127
+ nameKey: "presetName.zhipu",
2128
+ apiFormat: "openai",
2129
+ api_base_url: "https://api.z.ai/api/paas/v4",
2130
+ codingPlanBaseUrl: "https://api.z.ai/api/coding/paas/v4",
2131
+ modelsEndpoint: "https://api.z.ai/api/paas/v4/models",
2132
+ models: [
2133
+ "glm-5",
2134
+ "glm-5.1",
2135
+ "glm-4.5-air",
2136
+ "glm-4.6v",
2137
+ "glm-4.7"
2138
+ ],
2139
+ modelConfigs: [
2140
+ {
2141
+ id: "glm-5",
2142
+ name: "GLM-5",
2143
+ enabled: true
2144
+ },
2145
+ {
2146
+ id: "glm-5.1",
2147
+ name: "GLM-5.1",
2148
+ enabled: true
2149
+ },
2150
+ {
2151
+ id: "glm-4.5-air",
2152
+ name: "GLM-4.5 Air",
2153
+ enabled: true
2154
+ },
2155
+ {
2156
+ id: "glm-4.6v",
2157
+ name: "GLM-4.6V",
2158
+ enabled: true
2159
+ },
2160
+ {
2161
+ id: "glm-4.7",
2162
+ name: "GLM-4.7",
2163
+ enabled: true
2164
+ }
2165
+ ],
2166
+ description: "\u667A\u8C31AI\u5927\u6A21\u578B\u5F00\u653E\u5E73\u53F0",
2167
+ icon: "zhipu",
2168
+ website: "https://z.ai",
2169
+ docsUrl: "https://docs.z.ai",
2170
+ isSystem: true,
2171
+ features: [
2172
+ "coding-plan",
2173
+ "vision",
2174
+ "mcp-search",
2175
+ "mcp-vision"
2176
+ ],
2177
+ searchConfig: {
2178
+ type: "builtin-tool",
2179
+ toolDefinition: {
2180
+ type: "web_search",
2181
+ web_search: {
2182
+ enable: true
2183
+ }
2184
+ },
2185
+ conflictsWithFC: false,
2186
+ applicableModels: null
2187
+ },
2188
+ apiModes: [
2189
+ {
2190
+ id: "standard",
2191
+ label: "apiMode.standard",
2192
+ baseUrl: "https://api.z.ai/api/paas/v4"
2193
+ },
2194
+ {
2195
+ id: "coding-plan",
2196
+ label: "apiMode.codingPlan",
2197
+ baseUrl: "https://api.z.ai/api/coding/paas/v4"
2198
+ }
2199
+ ]
2200
+ };
2201
+
2202
+ // src/provider-presets/presets/zhipu-bigmodel.json
2203
+ var zhipu_bigmodel_default = {
2204
+ id: "zhipu-bigmodel",
2205
+ presetId: "zhipu",
2206
+ name: "\u667A\u8C31 GLM",
2207
+ nameKey: "presetName.zhipuBigmodel",
2208
+ apiFormat: "openai",
2209
+ api_base_url: "https://open.bigmodel.cn/api/paas/v4",
2210
+ codingPlanBaseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
2211
+ modelsEndpoint: "https://open.bigmodel.cn/api/paas/v4/models",
2212
+ models: [
2213
+ "glm-5",
2214
+ "glm-5.1",
2215
+ "glm-4.5-air",
2216
+ "glm-4.6v",
2217
+ "glm-4.7"
2218
+ ],
2219
+ modelConfigs: [
2220
+ {
2221
+ id: "glm-5",
2222
+ name: "GLM-5",
2223
+ enabled: true,
2224
+ category: "chat",
2225
+ contextLength: 2e5,
2226
+ maxTokens: 128e3,
2227
+ functionCall: true
2228
+ },
2229
+ {
2230
+ id: "glm-5.1",
2231
+ name: "GLM-5.1",
2232
+ enabled: true,
2233
+ category: "chat",
2234
+ contextLength: 2e5,
2235
+ maxTokens: 128e3,
2236
+ functionCall: true
2237
+ },
2238
+ {
2239
+ id: "glm-4.5-air",
2240
+ name: "GLM-4.5 Air",
2241
+ enabled: true,
2242
+ category: "chat",
2243
+ contextLength: 128e3,
2244
+ maxTokens: 32768,
2245
+ functionCall: true
2246
+ },
2247
+ {
2248
+ id: "glm-4.6v",
2249
+ name: "GLM-4.6V",
2250
+ enabled: true,
2251
+ category: "chat",
2252
+ contextLength: 128e3,
2253
+ maxTokens: 32768,
2254
+ vision: true,
2255
+ functionCall: true
2256
+ },
2257
+ {
2258
+ id: "glm-4.7",
2259
+ name: "GLM-4.7",
2260
+ enabled: true,
2261
+ category: "code",
2262
+ contextLength: 2e5,
2263
+ maxTokens: 128e3,
2264
+ functionCall: true
2265
+ }
2266
+ ],
2267
+ description: "\u667A\u8C31AI\u5927\u6A21\u578B\u5F00\u653E\u5E73\u53F0 (bigmodel.cn \u56FD\u5185\u7AEF\u70B9)",
2268
+ icon: "zhipu",
2269
+ website: "https://bigmodel.cn",
2270
+ docsUrl: "https://docs.bigmodel.cn",
2271
+ isSystem: true,
2272
+ features: [
2273
+ "coding-plan",
2274
+ "vision",
2275
+ "mcp-search",
2276
+ "mcp-vision"
2277
+ ],
2278
+ searchConfig: {
2279
+ type: "builtin-tool",
2280
+ toolDefinition: {
2281
+ type: "web_search",
2282
+ web_search: {
2283
+ enable: true
2284
+ }
2285
+ },
2286
+ conflictsWithFC: false,
2287
+ applicableModels: null
2288
+ },
2289
+ apiModes: [
2290
+ {
2291
+ id: "standard",
2292
+ label: "apiMode.standard",
2293
+ baseUrl: "https://open.bigmodel.cn/api/paas/v4"
2294
+ },
2295
+ {
2296
+ id: "coding-plan",
2297
+ label: "apiMode.codingPlan",
2298
+ baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4"
2299
+ }
2300
+ ]
2301
+ };
2302
+
2303
+ // src/provider-presets/manifest.ts
2304
+ var RAW_PRESETS_IN_ORDER = [
2305
+ // International
2306
+ openai_default,
2307
+ anthropic_default,
2308
+ gemini_default,
2309
+ gemini_vertex_default,
2310
+ grok_default,
2311
+ deepseek_default,
2312
+ azure_openai_default,
2313
+ openai_response_default,
2314
+ siliconflow_default,
2315
+ openrouter_default,
2316
+ mistral_default,
2317
+ together_default,
2318
+ perplexity_default,
2319
+ // Chinese cloud
2320
+ zhipu_default,
2321
+ zhipu_bigmodel_default,
2322
+ volcengine_default,
2323
+ kimi_default,
2324
+ dashscope_default,
2325
+ tencent_default,
2326
+ tencent_anthropic_default,
2327
+ minimax_default,
2328
+ baidu_default,
2329
+ kuaishou_default,
2330
+ mthreads_default,
2331
+ xiaomi_mimo_default,
2332
+ xiaomi_mimo_anthropic_default,
2333
+ // Local-inference
2334
+ ollama_default,
2335
+ // Fast-inference
2336
+ groq_default,
2337
+ cerebras_default
2338
+ ];
2339
+
2340
+ // src/provider-presets/schema.ts
2341
+ var import_zod = require("zod");
2342
+
2343
+ // src/provider-presets/types.ts
2344
+ var API_MODE_IDS = {
2345
+ STANDARD: "standard",
2346
+ CODING_PLAN: "coding-plan",
2347
+ TOKEN_PLAN: "token-plan"
2348
+ };
2349
+
2350
+ // src/provider-presets/schema.ts
2351
+ var API_FORMATS = [
2352
+ "openai",
2353
+ "anthropic",
2354
+ "google",
2355
+ "azure-openai",
2356
+ "openai-response"
2357
+ ];
2358
+ var searchCapabilitySchema = import_zod.z.enum([
2359
+ "model-param",
2360
+ "builtin-tool",
2361
+ "mcp",
2362
+ "sdk-native",
2363
+ "none"
2364
+ ]);
2365
+ var providerSearchConfigSchema = import_zod.z.object({
2366
+ type: searchCapabilitySchema,
2367
+ paramName: import_zod.z.string().optional(),
2368
+ paramValue: import_zod.z.unknown().optional(),
2369
+ extraParams: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional(),
2370
+ toolDefinition: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional(),
2371
+ conflictsWithFC: import_zod.z.boolean().optional(),
2372
+ mcpServerId: import_zod.z.string().optional(),
2373
+ applicableModels: import_zod.z.array(import_zod.z.string()).nullable().optional()
2374
+ }).passthrough();
2375
+ var apiModeSchema = import_zod.z.object({
2376
+ id: import_zod.z.string(),
2377
+ label: import_zod.z.string(),
2378
+ baseUrl: import_zod.z.string(),
2379
+ apiKey: import_zod.z.string().optional(),
2380
+ apiKeyPrefix: import_zod.z.string().optional(),
2381
+ note: import_zod.z.string().optional()
2382
+ }).passthrough();
2383
+ var modelConfigSchema = import_zod.z.object({ id: import_zod.z.string(), name: import_zod.z.string(), enabled: import_zod.z.boolean() }).passthrough();
2384
+ var transformerConfigSchema = import_zod.z.record(import_zod.z.string(), import_zod.z.unknown());
2385
+ var presetSchema = import_zod.z.object({
2386
+ id: import_zod.z.string().min(1),
2387
+ presetId: import_zod.z.string().min(1),
2388
+ name: import_zod.z.string().min(1),
2389
+ apiFormat: import_zod.z.enum(API_FORMATS),
2390
+ api_base_url: import_zod.z.string(),
2391
+ models: import_zod.z.array(import_zod.z.string()),
2392
+ apiType: import_zod.z.string().optional(),
2393
+ nameKey: import_zod.z.string().optional(),
2394
+ modelsEndpoint: import_zod.z.string().optional(),
2395
+ apiVersion: import_zod.z.string().optional(),
2396
+ modelConfigs: import_zod.z.array(modelConfigSchema).optional(),
2397
+ modelGroups: import_zod.z.array(import_zod.z.record(import_zod.z.string(), import_zod.z.unknown())).optional(),
2398
+ transformer: transformerConfigSchema.optional(),
2399
+ description: import_zod.z.string().optional(),
2400
+ icon: import_zod.z.string().optional(),
2401
+ website: import_zod.z.string().optional(),
2402
+ docsUrl: import_zod.z.string().optional(),
2403
+ defaultSettings: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional(),
2404
+ isSystem: import_zod.z.boolean().optional(),
2405
+ isOfficial: import_zod.z.boolean().optional(),
2406
+ maxConcurrency: import_zod.z.number().optional(),
2407
+ codingPlanBaseUrl: import_zod.z.string().optional(),
2408
+ codingPlanSeparateKey: import_zod.z.boolean().optional(),
2409
+ features: import_zod.z.array(import_zod.z.string()).optional(),
2410
+ searchConfig: providerSearchConfigSchema.optional(),
2411
+ apiModes: import_zod.z.array(apiModeSchema).optional(),
2412
+ // Additive, reserved (design D2). Inert for current consumers.
2413
+ revision: import_zod.z.number().int().positive().optional()
2414
+ }).passthrough();
2415
+
2416
+ // src/provider-presets/index.ts
2417
+ var CATALOG_VERSION = catalog_default.version;
2418
+ var PRESET_REVISIONS = {};
2419
+ function loadPresets() {
2420
+ return RAW_PRESETS_IN_ORDER.map((raw) => {
2421
+ const parsed = presetSchema.parse(raw);
2422
+ PRESET_REVISIONS[parsed.id] = parsed.revision ?? 1;
2423
+ if ("revision" in parsed) {
2424
+ const { revision: _revision, ...rest } = parsed;
2425
+ void _revision;
2426
+ return rest;
2427
+ }
2428
+ return parsed;
2429
+ });
2430
+ }
2431
+ var LLM_PROVIDER_PRESETS = loadPresets();
2432
+ function getPresetRevision(id) {
2433
+ return PRESET_REVISIONS[id] ?? 1;
2434
+ }
2435
+ function resolveFollowProviderModel(providerId, presetId, type) {
2436
+ const key = presetId || providerId;
2437
+ const mapping = PROVIDER_MODEL_MAPPINGS[key];
2438
+ if (!mapping) return void 0;
2439
+ const modelId = type === "background" ? mapping.background : mapping.vision;
2440
+ if (!modelId) return void 0;
2441
+ return `${providerId},${modelId}`;
2442
+ }
2443
+ function getAllProviderPresets() {
2444
+ return LLM_PROVIDER_PRESETS.map((p) => ({
2445
+ maxConcurrency: MAX_CONCURRENCY_DEFAULTS[p.id] ?? DEFAULT_MAX_CONCURRENCY,
2446
+ ...p
2447
+ }));
2448
+ }
2449
+ function getPresetById(idOrPresetId) {
2450
+ const all = getAllProviderPresets();
2451
+ return all.find((p) => p.id === idOrPresetId) ?? all.find((p) => p.presetId === idOrPresetId);
2452
+ }
2453
+ function getCodingPlanBaseUrl(idOrPresetId) {
2454
+ const preset = getPresetById(idOrPresetId);
2455
+ if (preset?.codingPlanBaseUrl) return preset.codingPlanBaseUrl;
2456
+ return CODING_PLAN_URL_PRESETS[idOrPresetId]?.baseUrl;
2457
+ }
2458
+ function getProviderSearchConfig(presetId) {
2459
+ const preset = getPresetById(presetId);
2460
+ if (preset?.searchConfig) return preset.searchConfig;
2461
+ return PROVIDER_SEARCH_CONFIGS[presetId];
2462
+ }
2463
+
2464
+ // src/subscription-types.ts
2465
+ function legacyCliBackendToSubscriptionProvider(cliBackend) {
2466
+ switch (cliBackend) {
2467
+ case "claude-code":
2468
+ return "claude";
2469
+ case "codex":
2470
+ return "codex";
2471
+ case "gemini-cli":
2472
+ return "gemini";
2473
+ case "opencodego":
2474
+ return "opencodego";
2475
+ default:
2476
+ return null;
2477
+ }
2478
+ }
2479
+ function subscriptionTargetForSession(session) {
2480
+ return session.subscriptionProviderId ?? legacyCliBackendToSubscriptionProvider(session.cliBackend);
2481
+ }
2482
+
2483
+ // src/thinking-config.ts
2484
+ var EFFORT_RATIO = {
2485
+ none: 0.01,
2486
+ minimal: 0.02,
2487
+ low: 0.05,
2488
+ medium: 0.5,
2489
+ high: 0.8,
2490
+ xhigh: 0.92,
2491
+ max: 0.95
2492
+ };
2493
+ var DEFAULT_MAX_TOKENS = 4096;
2494
+ var THINKING_TOKEN_MAP = {
2495
+ // Gemini
2496
+ "gemini-2\\.5-flash-lite": { min: 512, max: 24576 },
2497
+ "gemini-.*-flash": { min: 0, max: 24576 },
2498
+ "gemini-.*-pro": { min: 128, max: 32768 },
2499
+ // Qwen
2500
+ "qwen3-235b-a22b-thinking": { min: 0, max: 81920 },
2501
+ "qwen3-30b-a3b-thinking": { min: 0, max: 81920 },
2502
+ "qwen3-vl-235b-a22b-thinking": { min: 0, max: 81920 },
2503
+ "qwen3-vl-30b-a3b-thinking": { min: 0, max: 81920 },
2504
+ "qwen-plus-2025": { min: 0, max: 38912 },
2505
+ "qwen-plus": { min: 0, max: 81920 },
2506
+ "qwen-turbo": { min: 0, max: 38912 },
2507
+ "qwen-flash": { min: 0, max: 81920 },
2508
+ "qwen3-": { min: 1024, max: 38912 },
2509
+ qwq: { min: 1024, max: 38912 },
2510
+ // Claude (incl. AWS Bedrock, GCP Vertex AI)
2511
+ "claude-opus-4[.-]7": { min: 1024, max: 128e3 },
2512
+ "claude-(sonnet|opus)-4[.-]6": { min: 1024, max: 128e3 },
2513
+ "claude-3[.-]7.*sonnet": { min: 1024, max: 64e3 },
2514
+ "claude-(haiku|sonnet|opus)-4[.-]5": { min: 1024, max: 64e3 },
2515
+ "claude-opus-4[.-]1": { min: 1024, max: 32e3 },
2516
+ "claude-sonnet-4": { min: 1024, max: 64e3 },
2517
+ "claude-opus-4": { min: 1024, max: 32e3 },
2518
+ "claude-3[.-]5-sonnet": { min: 1024, max: 64e3 },
2519
+ // OpenAI o-series
2520
+ "o1-preview": { min: 0, max: 32768 },
2521
+ "o1-mini": { min: 0, max: 32768 },
2522
+ "o1-pro": { min: 0, max: 32768 },
2523
+ "o3-mini": { min: 0, max: 32768 },
2524
+ o3: { min: 0, max: 65536 },
2525
+ "o4-mini": { min: 0, max: 32768 },
2526
+ // GPT-5 series (Response API reasoning models)
2527
+ "gpt-5\\.5": { min: 0, max: 128e3 },
2528
+ "gpt-5\\.4": { min: 0, max: 128e3 },
2529
+ "gpt-5\\.3": { min: 0, max: 128e3 },
2530
+ "gpt-5\\.2": { min: 0, max: 65536 },
2531
+ "gpt-5\\.1": { min: 0, max: 65536 },
2532
+ "gpt-5": { min: 0, max: 65536 },
2533
+ // DeepSeek
2534
+ "deepseek-v4-pro": { min: 0, max: 32768 },
2535
+ "deepseek-v4-flash": { min: 0, max: 32768 },
2536
+ "deepseek-r1": { min: 0, max: 32768 },
2537
+ "deepseek-reasoner": { min: 0, max: 32768 },
2538
+ // Baichuan
2539
+ "baichuan-m2": { min: 0, max: 3e4 },
2540
+ "baichuan-m3": { min: 0, max: 3e4 },
2541
+ // Grok
2542
+ "grok-3": { min: 0, max: 32768 },
2543
+ // Zhipu GLM
2544
+ "glm.*zero": { min: 0, max: 16384 },
2545
+ // Hunyuan
2546
+ "hunyuan.*t1": { min: 0, max: 16384 },
2547
+ // Doubao
2548
+ "doubao.*think": { min: 0, max: 16384 }
2549
+ };
2550
+ var REASONING_MODEL_PATTERNS = [
2551
+ /^o[134](-mini|-preview|-pro)?$/i,
2552
+ /^gpt-5(\.\d)?(-pro|-codex|-codex-max)?/i,
2553
+ /claude.*3[.-]?5.*sonnet|claude.*sonnet.*3[.-]?5|claude-sonnet-4|claude-opus-4|claude-(haiku|sonnet|opus)-4[.-]?5/i,
2554
+ /gemini.*(2\.0|2-|2\.5|3).*flash|gemini.*(2\.5|3).*pro|gemini.*think/i,
2555
+ /grok-3/i,
2556
+ /qwq|qwen.*qwq|qwen.*thinking/i,
2557
+ /deepseek-v4|deepseek.*r1|r1.*deepseek|deepseek-reasoner/i,
2558
+ /glm.*zero/i,
2559
+ /hunyuan.*t1/i,
2560
+ /doubao.*think/i,
2561
+ /baichuan-m[23]/i
2562
+ ];
2563
+ var CANNOT_DISABLE_THINKING_PATTERNS = [
2564
+ /gemini.*3.*pro/i,
2565
+ /gemini.*2\.5.*pro/i,
2566
+ /^o1-pro$/i
2567
+ ];
2568
+ function isReasoningModel(modelId) {
2569
+ if (!modelId) return false;
2570
+ return REASONING_MODEL_PATTERNS.some((pattern) => pattern.test(modelId));
2571
+ }
2572
+ function canDisableThinking(modelId) {
2573
+ if (!modelId) return true;
2574
+ return !CANNOT_DISABLE_THINKING_PATTERNS.some((pattern) => pattern.test(modelId));
2575
+ }
2576
+ function findTokenLimit(modelOrId) {
2577
+ if (!modelOrId) return null;
2578
+ if (typeof modelOrId === "object") {
2579
+ if (modelOrId.thinkingTokenLimit) return modelOrId.thinkingTokenLimit;
2580
+ return findTokenLimit(modelOrId.id);
2581
+ }
2582
+ const lowerModelId = modelOrId.toLowerCase();
2583
+ for (const [pattern, limit] of Object.entries(THINKING_TOKEN_MAP)) {
2584
+ const regex = new RegExp(pattern, "i");
2585
+ if (regex.test(lowerModelId)) {
2586
+ return limit;
2587
+ }
2588
+ }
2589
+ return null;
2590
+ }
2591
+ function calculateThinkingBudget(modelId, level, userMaxTokens) {
2592
+ if (level === "none") {
2593
+ const tokenLimit2 = findTokenLimit(modelId);
2594
+ if (tokenLimit2 && tokenLimit2.min > 0) {
2595
+ return tokenLimit2.min;
2596
+ }
2597
+ return void 0;
2598
+ }
2599
+ const tokenLimit = findTokenLimit(modelId);
2600
+ const ratio = EFFORT_RATIO[level];
2601
+ if (!tokenLimit) {
2602
+ if (userMaxTokens) {
2603
+ const maxBudget = Math.floor(userMaxTokens * 0.75);
2604
+ return Math.floor(Math.min(userMaxTokens * ratio, maxBudget));
2605
+ }
2606
+ return void 0;
2607
+ }
2608
+ const formulaResult = Math.floor((tokenLimit.max - tokenLimit.min) * ratio + tokenLimit.min);
2609
+ if (userMaxTokens !== void 0) {
2610
+ const maxBudgetFromUserTokens = Math.floor(userMaxTokens * Math.min(ratio, 0.75));
2611
+ return Math.max(tokenLimit.min, Math.min(formulaResult, maxBudgetFromUserTokens));
2612
+ }
2613
+ return formulaResult;
2614
+ }
2615
+ function getClaudeMaxTokens(userMaxTokens, thinkingBudget) {
2616
+ if (!userMaxTokens) return void 0;
2617
+ if (!thinkingBudget) return userMaxTokens;
2618
+ const outputTokens = userMaxTokens - thinkingBudget;
2619
+ return outputTokens > 0 ? outputTokens : void 0;
2620
+ }
2621
+ function getOpenAIReasoningEffort(level) {
2622
+ switch (level) {
2623
+ case "none":
2624
+ return "none";
2625
+ case "minimal":
2626
+ return "minimal";
2627
+ case "low":
2628
+ return "low";
2629
+ case "medium":
2630
+ return "medium";
2631
+ case "high":
2632
+ return "high";
2633
+ case "xhigh":
2634
+ return "xhigh";
2635
+ case "max":
2636
+ return "high";
2637
+ default:
2638
+ return void 0;
2639
+ }
2640
+ }
2641
+ function buildGeminiThinkingConfig(modelId, level, userMaxTokens) {
2642
+ if (!isReasoningModel(modelId)) {
2643
+ return void 0;
2644
+ }
2645
+ const budget = calculateThinkingBudget(modelId, level, userMaxTokens);
2646
+ if (budget === void 0) {
2647
+ return void 0;
2648
+ }
2649
+ return { thinking_budget: budget };
2650
+ }
2651
+ function buildAnthropicThinking(modelId, level, userMaxTokens) {
2652
+ if (level === "none") {
2653
+ return void 0;
2654
+ }
2655
+ const budget = calculateThinkingBudget(modelId, level, userMaxTokens);
2656
+ if (!budget || budget < 1024) {
2657
+ return { type: "enabled", budget_tokens: 1024 };
2658
+ }
2659
+ return { type: "enabled", budget_tokens: budget };
2660
+ }
2661
+ function buildQwenThinkingConfig(level, userMaxTokens) {
2662
+ if (level === "none") {
2663
+ return { enable_thinking: false };
2664
+ }
2665
+ const ratio = EFFORT_RATIO[level];
2666
+ const budget = userMaxTokens ? Math.floor(userMaxTokens * ratio) : void 0;
2667
+ return {
2668
+ enable_thinking: true,
2669
+ thinking_budget: budget
2670
+ };
2671
+ }
2672
+
2673
+ // src/websearch-types.ts
2674
+ function isApiProvider(id) {
2675
+ return !id.startsWith("local-");
2676
+ }
2677
+ function isLocalProvider(id) {
2678
+ return id.startsWith("local-");
2679
+ }
2680
+ // Annotate the CommonJS export names for ESM import in node:
2681
+ 0 && (module.exports = {
2682
+ API_MODE_IDS,
2683
+ CANNOT_DISABLE_THINKING_PATTERNS,
2684
+ CATALOG_VERSION,
2685
+ CODING_PLAN_URL_PRESETS,
2686
+ DEFAULT_MAX_TOKENS,
2687
+ DEFAULT_MCP_SESSION_CONFIG,
2688
+ DEFAULT_SEED_PRESET_IDS,
2689
+ EFFORT_RATIO,
2690
+ EXTENDED_CONTEXT_CAPABLE_MODELS,
2691
+ KNOWN_MODELS,
2692
+ LLM_PROVIDER_PRESETS,
2693
+ MAX_CONCURRENCY_DEFAULTS,
2694
+ MODEL_ALIASES,
2695
+ PROVIDER_MODEL_MAPPINGS,
2696
+ PROVIDER_SEARCH_CONFIGS,
2697
+ REASONING_MODEL_PATTERNS,
2698
+ THINKING_TOKEN_MAP,
2699
+ applyAlias,
2700
+ buildAnthropicThinking,
2701
+ buildGeminiThinkingConfig,
2702
+ buildQwenThinkingConfig,
2703
+ calculateThinkingBudget,
2704
+ canDisableThinking,
2705
+ findTokenLimit,
2706
+ getAllProviderPresets,
2707
+ getClaudeMaxTokens,
2708
+ getCodingPlanBaseUrl,
2709
+ getOpenAIReasoningEffort,
2710
+ getPresetById,
2711
+ getPresetRevision,
2712
+ getProviderSearchConfig,
2713
+ isApiProvider,
2714
+ isExtendedContextCapable,
2715
+ isLocalProvider,
2716
+ isReasoningModel,
2717
+ legacyCliBackendToSubscriptionProvider,
2718
+ lookupCanonicalCapabilities,
2719
+ normalizeModelId,
2720
+ resolveFollowProviderModel,
2721
+ resolveModelCapabilities,
2722
+ resolveProviderEndpoint,
2723
+ subscriptionTargetForSession
2724
+ });