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