@nextclaw/runtime 0.2.32 → 0.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { ProviderSpec, ProviderRegistry, ProviderCatalogPlugin } from '@nextclaw/core';
2
- export { ProviderCatalogPlugin, ProviderSpec } from '@nextclaw/core';
1
+ import { ProviderCatalogPlugin, ProviderCatalogPlugin as ProviderCatalogPlugin$1, ProviderRegistry, ProviderSpec, ProviderSpec as ProviderSpec$1 } from "@nextclaw/core";
3
2
 
3
+ //#region src/channels/builtin.d.ts
4
4
  declare const BUILTIN_CHANNEL_PLUGIN_IDS: readonly ["telegram", "whatsapp", "discord", "feishu", "mochat", "dingtalk", "wecom", "email", "slack", "qq", "weixin"];
5
5
  type BuiltinChannelPluginId = (typeof BUILTIN_CHANNEL_PLUGIN_IDS)[number];
6
6
  declare function isBuiltinChannelPluginId(value: string): value is BuiltinChannelPluginId;
7
-
7
+ //#endregion
8
+ //#region src/providers/index.d.ts
8
9
  declare function installBuiltinProviderRegistry(): ProviderRegistry;
9
- declare function listBuiltinProviderPlugins(): ProviderCatalogPlugin[];
10
- declare function listBuiltinProviders(): ProviderSpec[];
11
- declare function findBuiltinProviderByName(name: string): ProviderSpec | undefined;
10
+ declare function listBuiltinProviderPlugins(): ProviderCatalogPlugin$1[];
11
+ declare function listBuiltinProviders(): ProviderSpec$1[];
12
+ declare function findBuiltinProviderByName(name: string): ProviderSpec$1 | undefined;
12
13
  declare function builtinProviderIds(): string[];
13
-
14
- export { BUILTIN_CHANNEL_PLUGIN_IDS, type BuiltinChannelPluginId, builtinProviderIds, findBuiltinProviderByName, installBuiltinProviderRegistry, isBuiltinChannelPluginId, listBuiltinProviderPlugins, listBuiltinProviders };
14
+ //#endregion
15
+ export { BUILTIN_CHANNEL_PLUGIN_IDS, type BuiltinChannelPluginId, type ProviderCatalogPlugin, type ProviderSpec, builtinProviderIds, findBuiltinProviderByName, installBuiltinProviderRegistry, isBuiltinChannelPluginId, listBuiltinProviderPlugins, listBuiltinProviders };
package/dist/index.js CHANGED
@@ -1,494 +1,503 @@
1
- // src/providers/index.ts
2
- import {
3
- ProviderRegistry,
4
- setProviderRegistry
5
- } from "@nextclaw/core";
6
-
7
- // src/providers/plugins/dashscope-coding-plan.ts
8
- var dashscopeCodingPlanProviderSpec = {
9
- name: "dashscope-coding-plan",
10
- keywords: ["dashscope-coding-plan", "coding-plan"],
11
- envKey: "DASHSCOPE_CODING_PLAN_API_KEY",
12
- displayName: "DashScope Coding Plan",
13
- modelPrefix: "dashscope-coding-plan",
14
- litellmPrefix: "dashscope-coding-plan",
15
- skipPrefixes: ["dashscope-coding-plan/"],
16
- envExtras: [],
17
- isGateway: false,
18
- isLocal: false,
19
- detectByKeyPrefix: "sk-sp-",
20
- detectByBaseKeyword: "coding.dashscope.aliyuncs.com",
21
- defaultApiBase: "https://coding.dashscope.aliyuncs.com/v1",
22
- defaultModels: [
23
- "dashscope-coding-plan/qwen3.5-plus",
24
- "dashscope-coding-plan/qwen3-max-2026-01-23",
25
- "dashscope-coding-plan/qwen3-coder-next",
26
- "dashscope-coding-plan/qwen3-coder-plus",
27
- "dashscope-coding-plan/MiniMax-M2.5",
28
- "dashscope-coding-plan/glm-5",
29
- "dashscope-coding-plan/glm-4.7",
30
- "dashscope-coding-plan/kimi-k2.5"
31
- ],
32
- visionModels: ["dashscope-coding-plan/qwen3.5-plus", "dashscope-coding-plan/kimi-k2.5"],
33
- stripModelPrefix: false,
34
- modelOverrides: [],
35
- supportsResponsesApi: false,
36
- logo: "dashscope.png",
37
- apiBaseHelp: {
38
- zh: "Coding Plan \u5FC5\u987B\u4F7F\u7528\u4E13\u5C5E Base URL https://coding.dashscope.aliyuncs.com/v1\uFF0C\u5E76\u914D\u5408 sk-sp- \u5F00\u5934\u7684\u4E13\u5C5E API Key\uFF1B\u4E0D\u8981\u4E0E\u666E\u901A DashScope \u6309\u91CF\u8BA1\u8D39 Key/Base URL \u6DF7\u7528\u3002",
39
- en: "Coding Plan must use the dedicated base URL https://coding.dashscope.aliyuncs.com/v1 together with an sk-sp- API key. Do not mix it with the regular DashScope pay-as-you-go key/base URL."
40
- }
41
- };
42
-
43
- // src/providers/plugins/builtin.ts
44
- var builtinProviderPlugin = {
45
- id: "builtin-runtime-providers",
46
- providers: [
47
- {
48
- name: "nextclaw",
49
- keywords: ["nextclaw", "dashscope/", "qwen3.5", "qwen"],
50
- envKey: "NEXTCLAW_API_KEY",
51
- displayName: "NextClaw Built-in",
52
- modelPrefix: "nextclaw",
53
- litellmPrefix: "nextclaw",
54
- skipPrefixes: [],
55
- envExtras: [],
56
- isGateway: true,
57
- isLocal: false,
58
- detectByKeyPrefix: "nc_free_",
59
- detectByBaseKeyword: "nextclaw.io",
60
- defaultApiBase: "https://ai-gateway-api.nextclaw.io/v1",
61
- defaultModels: [
62
- "dashscope/qwen3.5-plus",
63
- "dashscope/qwen3.5-flash",
64
- "dashscope/qwen3.5-122b-a10b",
65
- "dashscope/qwen3.5-35b-a3b"
66
- ],
67
- stripModelPrefix: false,
68
- modelOverrides: []
69
- },
70
- {
71
- name: "openrouter",
72
- keywords: ["openrouter"],
73
- envKey: "OPENROUTER_API_KEY",
74
- displayName: "OpenRouter",
75
- modelPrefix: "openrouter",
76
- litellmPrefix: "openrouter",
77
- skipPrefixes: [],
78
- envExtras: [],
79
- isGateway: true,
80
- isLocal: false,
81
- detectByKeyPrefix: "sk-or-",
82
- detectByBaseKeyword: "openrouter",
83
- defaultApiBase: "https://openrouter.ai/api/v1",
84
- defaultModels: [
85
- "openrouter/minimax/minimax-m2.5",
86
- "openrouter/xiaomi/mimo-v2-pro",
87
- "openrouter/stepfun/step-3.5-flash:free",
88
- "openrouter/google/gemini-3-flash-preview",
89
- "openrouter/deepseek/deepseek-v3.2",
90
- "openrouter/x-ai/grok-4.1-fast",
91
- "openrouter/z-ai/glm-5",
92
- "openrouter/anthropic/claude-opus-4.6",
93
- "openrouter/openai/gpt-5.3-codex"
94
- ],
95
- stripModelPrefix: false,
96
- modelOverrides: [],
97
- logo: "openrouter.svg"
98
- },
99
- {
100
- name: "aihubmix",
101
- keywords: ["aihubmix"],
102
- envKey: "OPENAI_API_KEY",
103
- displayName: "AiHubMix",
104
- modelPrefix: "aihubmix",
105
- litellmPrefix: "openai",
106
- skipPrefixes: [],
107
- envExtras: [],
108
- isGateway: true,
109
- isLocal: false,
110
- detectByKeyPrefix: "",
111
- detectByBaseKeyword: "aihubmix",
112
- defaultApiBase: "https://aihubmix.com/v1",
113
- defaultModels: ["aihubmix/gpt-5.3-codex", "aihubmix/claude-opus-4.6", "aihubmix/gemini-3.1-pro-preview"],
114
- visionModels: ["aihubmix/gemini-3.1-pro-preview", "aihubmix/gpt-5.4"],
115
- stripModelPrefix: true,
116
- modelOverrides: [],
117
- logo: "aihubmix.png"
118
- },
119
- {
120
- name: "anthropic",
121
- keywords: ["anthropic", "claude"],
122
- envKey: "ANTHROPIC_API_KEY",
123
- displayName: "Anthropic",
124
- modelPrefix: "anthropic",
125
- litellmPrefix: "anthropic",
126
- skipPrefixes: ["anthropic/"],
127
- envExtras: [],
128
- isGateway: false,
129
- isLocal: false,
130
- detectByKeyPrefix: "",
131
- detectByBaseKeyword: "",
132
- defaultApiBase: "https://api.anthropic.com",
133
- defaultModels: ["anthropic/claude-opus-4-6", "anthropic/claude-sonnet-4-6"],
134
- stripModelPrefix: false,
135
- modelOverrides: [],
136
- logo: "anthropic.svg"
137
- },
138
- {
139
- name: "openai",
140
- keywords: ["openai", "gpt"],
141
- envKey: "OPENAI_API_KEY",
142
- displayName: "OpenAI",
143
- modelPrefix: "openai",
144
- litellmPrefix: "openai",
145
- skipPrefixes: ["openai/"],
146
- envExtras: [],
147
- isGateway: false,
148
- isLocal: false,
149
- detectByKeyPrefix: "",
150
- detectByBaseKeyword: "",
151
- defaultApiBase: "https://api.openai.com/v1",
152
- defaultModels: ["openai/gpt-5.3-codex", "openai/gpt-5-mini", "openai/gpt-5-nano"],
153
- visionModels: ["openai/gpt-5.4"],
154
- stripModelPrefix: false,
155
- modelOverrides: [],
156
- supportsWireApi: true,
157
- wireApiOptions: ["auto", "chat", "responses"],
158
- defaultWireApi: "auto",
159
- logo: "openai.svg"
160
- },
161
- {
162
- name: "deepseek",
163
- keywords: ["deepseek"],
164
- envKey: "DEEPSEEK_API_KEY",
165
- displayName: "DeepSeek",
166
- modelPrefix: "deepseek",
167
- litellmPrefix: "deepseek",
168
- skipPrefixes: ["deepseek/"],
169
- envExtras: [],
170
- isGateway: false,
171
- isLocal: false,
172
- detectByKeyPrefix: "",
173
- detectByBaseKeyword: "",
174
- defaultApiBase: "https://api.deepseek.com",
175
- defaultModels: ["deepseek/deepseek-chat", "deepseek/deepseek-reasoner"],
176
- stripModelPrefix: false,
177
- modelOverrides: [],
178
- logo: "deepseek.png"
179
- },
180
- {
181
- name: "gemini",
182
- keywords: ["gemini"],
183
- envKey: "GEMINI_API_KEY",
184
- displayName: "Gemini",
185
- modelPrefix: "gemini",
186
- litellmPrefix: "gemini",
187
- skipPrefixes: ["gemini/"],
188
- envExtras: [],
189
- isGateway: false,
190
- isLocal: false,
191
- detectByKeyPrefix: "",
192
- detectByBaseKeyword: "",
193
- defaultApiBase: "https://generativelanguage.googleapis.com/v1beta/openai",
194
- defaultModels: ["gemini/gemini-3.1-pro-preview", "gemini/gemini-3-flash-preview"],
195
- visionModels: ["gemini/gemini-3.1-pro-preview", "gemini/gemini-3-flash-preview"],
196
- stripModelPrefix: false,
197
- modelOverrides: [],
198
- logo: "gemini.svg"
199
- },
200
- {
201
- name: "zhipu",
202
- keywords: ["zhipu", "glm", "zai"],
203
- envKey: "ZAI_API_KEY",
204
- displayName: "Zhipu AI",
205
- modelPrefix: "zai",
206
- litellmPrefix: "zai",
207
- skipPrefixes: ["zhipu/", "zai/", "openrouter/", "hosted_vllm/"],
208
- envExtras: [["ZHIPUAI_API_KEY", "{api_key}"]],
209
- isGateway: false,
210
- isLocal: false,
211
- detectByKeyPrefix: "",
212
- detectByBaseKeyword: "",
213
- defaultApiBase: "https://open.bigmodel.cn/api/paas/v4",
214
- defaultModels: ["zai/glm-5"],
215
- stripModelPrefix: false,
216
- modelOverrides: [],
217
- logo: "zhipu.svg"
218
- },
219
- {
220
- name: "dashscope",
221
- keywords: ["qwen", "dashscope"],
222
- envKey: "DASHSCOPE_API_KEY",
223
- displayName: "DashScope",
224
- modelPrefix: "dashscope",
225
- litellmPrefix: "dashscope",
226
- skipPrefixes: ["dashscope/", "openrouter/"],
227
- envExtras: [],
228
- isGateway: false,
229
- isLocal: false,
230
- detectByKeyPrefix: "",
231
- detectByBaseKeyword: "",
232
- defaultApiBase: "https://dashscope.aliyuncs.com/compatible-mode/v1",
233
- defaultModels: [
234
- "dashscope/qwen3.5-plus",
235
- "dashscope/qwen3.5-flash",
236
- "dashscope/qwen3.5-397b-a17b",
237
- "dashscope/qwen3.5-122b-a10b",
238
- "dashscope/qwen3.5-35b-a3b",
239
- "dashscope/qwen3.5-27b"
240
- ],
241
- stripModelPrefix: false,
242
- modelOverrides: [],
243
- supportsResponsesApi: false,
244
- logo: "dashscope.png"
245
- },
246
- dashscopeCodingPlanProviderSpec,
247
- {
248
- name: "qwen-portal",
249
- keywords: ["qwen-portal", "qwen"],
250
- envKey: "QWEN_PORTAL_TOKEN",
251
- displayName: "Qwen Portal",
252
- modelPrefix: "qwen-portal",
253
- litellmPrefix: "qwen-portal",
254
- skipPrefixes: ["qwen-portal/"],
255
- envExtras: [],
256
- isGateway: false,
257
- isLocal: false,
258
- detectByKeyPrefix: "",
259
- detectByBaseKeyword: "portal.qwen.ai",
260
- defaultApiBase: "https://portal.qwen.ai/v1",
261
- defaultModels: ["qwen-portal/coder-model", "qwen-portal/vision-model"],
262
- visionModels: ["qwen-portal/vision-model"],
263
- stripModelPrefix: false,
264
- modelOverrides: [],
265
- auth: {
266
- kind: "device_code",
267
- displayName: "Qwen OAuth",
268
- baseUrl: "https://chat.qwen.ai",
269
- deviceCodePath: "/api/v1/oauth2/device/code",
270
- tokenPath: "/api/v1/oauth2/token",
271
- clientId: "f0304373b74a44d2b584a3fb70ca9e56",
272
- scope: "openid profile email model.completion",
273
- grantType: "urn:ietf:params:oauth:grant-type:device_code",
274
- usePkce: true,
275
- cliCredential: {
276
- path: "~/.qwen/oauth_creds.json",
277
- accessTokenField: "access_token",
278
- refreshTokenField: "refresh_token",
279
- expiresAtField: "expiry_date"
280
- },
281
- note: {
282
- zh: "\u901A\u8FC7\u6D4F\u89C8\u5668\u767B\u5F55 Qwen \u540E\u5373\u53EF\u5728 NextClaw \u4E2D\u4F7F\u7528\u8BE5 Provider\u3002",
283
- en: "Log in to Qwen in your browser, then use this provider in NextClaw."
284
- }
285
- }
286
- },
287
- {
288
- name: "moonshot",
289
- keywords: ["moonshot", "kimi"],
290
- envKey: "MOONSHOT_API_KEY",
291
- displayName: "Moonshot",
292
- modelPrefix: "moonshot",
293
- litellmPrefix: "moonshot",
294
- skipPrefixes: ["moonshot/", "openrouter/"],
295
- envExtras: [["MOONSHOT_API_BASE", "{api_base}"]],
296
- isGateway: false,
297
- isLocal: false,
298
- detectByKeyPrefix: "",
299
- detectByBaseKeyword: "",
300
- defaultApiBase: "https://api.moonshot.ai/v1",
301
- defaultModels: ["moonshot/kimi-k2.5"],
302
- stripModelPrefix: false,
303
- modelOverrides: [],
304
- logo: "moonshot.png"
305
- },
306
- {
307
- name: "minimax",
308
- keywords: ["minimax"],
309
- envKey: "MINIMAX_API_KEY",
310
- displayName: "MiniMax",
311
- modelPrefix: "minimax",
312
- litellmPrefix: "minimax",
313
- skipPrefixes: ["minimax/", "openrouter/"],
314
- envExtras: [],
315
- isGateway: false,
316
- isLocal: false,
317
- detectByKeyPrefix: "",
318
- detectByBaseKeyword: "",
319
- defaultApiBase: "https://api.minimaxi.com/v1",
320
- defaultModels: ["minimax/MiniMax-M2.7", "minimax/MiniMax-M2.7-highspeed", "minimax/MiniMax-M2.5", "minimax/MiniMax-M2.5-highspeed"],
321
- stripModelPrefix: false,
322
- modelOverrides: [],
323
- supportsWireApi: true,
324
- wireApiOptions: ["auto", "chat", "responses"],
325
- defaultWireApi: "chat",
326
- logo: "minimax.svg",
327
- apiBaseHelp: {
328
- zh: "MiniMax \u4E2D\u56FD\u533A\u8BF7\u4F7F\u7528 https://api.minimaxi.com/v1\uFF1B\u6D77\u5916\u8BF7\u4F7F\u7528 https://api.minimax.io/v1\u3002AI Coding Tools \u63A8\u8350\u4F7F\u7528 MiniMax-M2.7\uFF0C\u5E76\u5C06 Wire API \u8BBE\u4E3A Chat\u3002",
329
- en: "Use https://api.minimaxi.com/v1 for Mainland China accounts, and https://api.minimax.io/v1 for overseas accounts. For AI Coding Tools, prefer MiniMax-M2.7 with Wire API set to Chat."
330
- }
331
- },
332
- {
333
- name: "minimax-portal",
334
- keywords: ["minimax-portal", "minimax"],
335
- envKey: "MINIMAX_PORTAL_TOKEN",
336
- displayName: "MiniMax Portal",
337
- modelPrefix: "minimax-portal",
338
- litellmPrefix: "minimax-portal",
339
- skipPrefixes: ["minimax-portal/"],
340
- envExtras: [],
341
- isGateway: false,
342
- isLocal: false,
343
- detectByKeyPrefix: "",
344
- detectByBaseKeyword: "",
345
- defaultApiBase: "https://api.minimax.io/v1",
346
- defaultModels: ["minimax-portal/MiniMax-M2.5", "minimax-portal/MiniMax-M2.5-highspeed"],
347
- stripModelPrefix: false,
348
- modelOverrides: [],
349
- logo: "minimax.svg",
350
- apiBaseHelp: {
351
- zh: "OAuth Global \u9ED8\u8BA4\u4F7F\u7528 https://api.minimax.io/v1\uFF1BOAuth \u4E2D\u56FD\u533A\u9ED8\u8BA4\u4F7F\u7528 https://api.minimaxi.com/v1\u3002",
352
- en: "OAuth Global uses https://api.minimax.io/v1 by default; OAuth CN uses https://api.minimaxi.com/v1."
353
- },
354
- auth: {
355
- kind: "device_code",
356
- protocol: "minimax_user_code",
357
- displayName: "MiniMax OAuth",
358
- baseUrl: "https://api.minimax.io",
359
- deviceCodePath: "/oauth/code",
360
- tokenPath: "/oauth/token",
361
- clientId: "78257093-7e40-4613-99e0-527b14b39113",
362
- scope: "group_id profile model.completion",
363
- grantType: "urn:ietf:params:oauth:grant-type:user_code",
364
- usePkce: true,
365
- defaultMethodId: "cn",
366
- methods: [
367
- {
368
- id: "global",
369
- label: {
370
- zh: "Global\uFF08\u6D77\u5916\uFF09",
371
- en: "Global"
372
- },
373
- hint: {
374
- zh: "\u9002\u7528\u4E8E\u6D77\u5916\u7528\u6237\uFF0C\u9ED8\u8BA4 API Base \u4E3A https://api.minimax.io/v1\u3002",
375
- en: "For international users. Default API base: https://api.minimax.io/v1."
376
- },
377
- baseUrl: "https://api.minimax.io",
378
- defaultApiBase: "https://api.minimax.io/v1"
379
- },
380
- {
381
- id: "cn",
382
- label: {
383
- zh: "\u4E2D\u56FD\u533A\uFF08CN\uFF09",
384
- en: "China Mainland (CN)"
385
- },
386
- hint: {
387
- zh: "\u9002\u7528\u4E8E\u4E2D\u56FD\u533A\u7528\u6237\uFF0C\u9ED8\u8BA4 API Base \u4E3A https://api.minimaxi.com/v1\u3002",
388
- en: "For Mainland China users. Default API base: https://api.minimaxi.com/v1."
389
- },
390
- baseUrl: "https://api.minimaxi.com",
391
- defaultApiBase: "https://api.minimaxi.com/v1"
392
- }
393
- ],
394
- note: {
395
- zh: "\u901A\u8FC7\u6D4F\u89C8\u5668\u5B8C\u6210 MiniMax OAuth \u6388\u6743\u540E\u5373\u53EF\u4F7F\u7528\uFF0C\u65E0\u9700\u624B\u52A8\u586B\u5199 API Key\u3002",
396
- en: "Complete MiniMax OAuth in browser to use this provider without manually entering an API key."
397
- }
398
- }
399
- },
400
- {
401
- name: "vllm",
402
- keywords: ["vllm"],
403
- envKey: "HOSTED_VLLM_API_KEY",
404
- displayName: "vLLM/Local",
405
- modelPrefix: "hosted_vllm",
406
- litellmPrefix: "hosted_vllm",
407
- skipPrefixes: [],
408
- envExtras: [],
409
- isGateway: false,
410
- isLocal: true,
411
- detectByKeyPrefix: "",
412
- detectByBaseKeyword: "",
413
- defaultApiBase: "http://127.0.0.1:8000/v1",
414
- defaultModels: [
415
- "hosted_vllm/meta-llama/Llama-3.1-8B-Instruct",
416
- "hosted_vllm/Qwen/Qwen2.5-7B-Instruct"
417
- ],
418
- stripModelPrefix: false,
419
- modelOverrides: [],
420
- logo: "vllm.svg"
421
- },
422
- {
423
- name: "groq",
424
- keywords: ["groq"],
425
- envKey: "GROQ_API_KEY",
426
- displayName: "Groq",
427
- modelPrefix: "groq",
428
- litellmPrefix: "groq",
429
- skipPrefixes: ["groq/"],
430
- envExtras: [],
431
- isGateway: false,
432
- isLocal: false,
433
- detectByKeyPrefix: "",
434
- detectByBaseKeyword: "",
435
- defaultApiBase: "https://api.groq.com/openai/v1",
436
- defaultModels: ["groq/openai/gpt-oss-120b", "groq/llama-3.1-8b-instant"],
437
- stripModelPrefix: false,
438
- modelOverrides: [],
439
- logo: "groq.svg"
440
- }
441
- ]
442
- };
443
-
444
- // src/providers/plugins/index.ts
445
- var BUILTIN_PROVIDER_PLUGINS = [builtinProviderPlugin];
446
-
447
- // src/providers/index.ts
448
- var builtinProviderRegistry = new ProviderRegistry(BUILTIN_PROVIDER_PLUGINS);
1
+ import { ProviderRegistry, setProviderRegistry } from "@nextclaw/core";
2
+ //#endregion
3
+ //#region src/providers/index.ts
4
+ const builtinProviderRegistry = new ProviderRegistry([{
5
+ id: "builtin-runtime-providers",
6
+ providers: [
7
+ {
8
+ name: "nextclaw",
9
+ keywords: [
10
+ "nextclaw",
11
+ "dashscope/",
12
+ "qwen3.5",
13
+ "qwen"
14
+ ],
15
+ envKey: "NEXTCLAW_API_KEY",
16
+ displayName: "NextClaw Built-in",
17
+ modelPrefix: "nextclaw",
18
+ litellmPrefix: "nextclaw",
19
+ skipPrefixes: [],
20
+ envExtras: [],
21
+ isGateway: true,
22
+ isLocal: false,
23
+ detectByKeyPrefix: "nc_free_",
24
+ detectByBaseKeyword: "nextclaw.io",
25
+ defaultApiBase: "https://ai-gateway-api.nextclaw.io/v1",
26
+ defaultModels: [
27
+ "dashscope/qwen3.5-plus",
28
+ "dashscope/qwen3.5-flash",
29
+ "dashscope/qwen3.5-122b-a10b",
30
+ "dashscope/qwen3.5-35b-a3b"
31
+ ],
32
+ stripModelPrefix: false,
33
+ modelOverrides: []
34
+ },
35
+ {
36
+ name: "openrouter",
37
+ keywords: ["openrouter"],
38
+ envKey: "OPENROUTER_API_KEY",
39
+ displayName: "OpenRouter",
40
+ modelPrefix: "openrouter",
41
+ litellmPrefix: "openrouter",
42
+ skipPrefixes: [],
43
+ envExtras: [],
44
+ isGateway: true,
45
+ isLocal: false,
46
+ detectByKeyPrefix: "sk-or-",
47
+ detectByBaseKeyword: "openrouter",
48
+ defaultApiBase: "https://openrouter.ai/api/v1",
49
+ defaultModels: [
50
+ "openrouter/minimax/minimax-m2.5",
51
+ "openrouter/xiaomi/mimo-v2-pro",
52
+ "openrouter/stepfun/step-3.5-flash:free",
53
+ "openrouter/google/gemini-3-flash-preview",
54
+ "openrouter/deepseek/deepseek-v3.2",
55
+ "openrouter/x-ai/grok-4.1-fast",
56
+ "openrouter/z-ai/glm-5",
57
+ "openrouter/anthropic/claude-opus-4.6",
58
+ "openrouter/openai/gpt-5.3-codex"
59
+ ],
60
+ stripModelPrefix: false,
61
+ modelOverrides: [],
62
+ logo: "openrouter.svg"
63
+ },
64
+ {
65
+ name: "aihubmix",
66
+ keywords: ["aihubmix"],
67
+ envKey: "OPENAI_API_KEY",
68
+ displayName: "AiHubMix",
69
+ modelPrefix: "aihubmix",
70
+ litellmPrefix: "openai",
71
+ skipPrefixes: [],
72
+ envExtras: [],
73
+ isGateway: true,
74
+ isLocal: false,
75
+ detectByKeyPrefix: "",
76
+ detectByBaseKeyword: "aihubmix",
77
+ defaultApiBase: "https://aihubmix.com/v1",
78
+ defaultModels: [
79
+ "aihubmix/gpt-5.3-codex",
80
+ "aihubmix/claude-opus-4.6",
81
+ "aihubmix/gemini-3.1-pro-preview"
82
+ ],
83
+ visionModels: ["aihubmix/gemini-3.1-pro-preview", "aihubmix/gpt-5.4"],
84
+ stripModelPrefix: true,
85
+ modelOverrides: [],
86
+ logo: "aihubmix.png"
87
+ },
88
+ {
89
+ name: "anthropic",
90
+ keywords: ["anthropic", "claude"],
91
+ envKey: "ANTHROPIC_API_KEY",
92
+ displayName: "Anthropic",
93
+ modelPrefix: "anthropic",
94
+ litellmPrefix: "anthropic",
95
+ skipPrefixes: ["anthropic/"],
96
+ envExtras: [],
97
+ isGateway: false,
98
+ isLocal: false,
99
+ detectByKeyPrefix: "",
100
+ detectByBaseKeyword: "",
101
+ defaultApiBase: "https://api.anthropic.com",
102
+ defaultModels: ["anthropic/claude-opus-4-6", "anthropic/claude-sonnet-4-6"],
103
+ stripModelPrefix: false,
104
+ modelOverrides: [],
105
+ logo: "anthropic.svg"
106
+ },
107
+ {
108
+ name: "openai",
109
+ keywords: ["openai", "gpt"],
110
+ envKey: "OPENAI_API_KEY",
111
+ displayName: "OpenAI",
112
+ modelPrefix: "openai",
113
+ litellmPrefix: "openai",
114
+ skipPrefixes: ["openai/"],
115
+ envExtras: [],
116
+ isGateway: false,
117
+ isLocal: false,
118
+ detectByKeyPrefix: "",
119
+ detectByBaseKeyword: "",
120
+ defaultApiBase: "https://api.openai.com/v1",
121
+ defaultModels: [
122
+ "openai/gpt-5.3-codex",
123
+ "openai/gpt-5-mini",
124
+ "openai/gpt-5-nano"
125
+ ],
126
+ visionModels: ["openai/gpt-5.4"],
127
+ stripModelPrefix: false,
128
+ modelOverrides: [],
129
+ supportsWireApi: true,
130
+ wireApiOptions: [
131
+ "auto",
132
+ "chat",
133
+ "responses"
134
+ ],
135
+ defaultWireApi: "auto",
136
+ logo: "openai.svg"
137
+ },
138
+ {
139
+ name: "deepseek",
140
+ keywords: ["deepseek"],
141
+ envKey: "DEEPSEEK_API_KEY",
142
+ displayName: "DeepSeek",
143
+ modelPrefix: "deepseek",
144
+ litellmPrefix: "deepseek",
145
+ skipPrefixes: ["deepseek/"],
146
+ envExtras: [],
147
+ isGateway: false,
148
+ isLocal: false,
149
+ detectByKeyPrefix: "",
150
+ detectByBaseKeyword: "",
151
+ defaultApiBase: "https://api.deepseek.com",
152
+ defaultModels: ["deepseek/deepseek-chat", "deepseek/deepseek-reasoner"],
153
+ stripModelPrefix: false,
154
+ modelOverrides: [],
155
+ logo: "deepseek.png"
156
+ },
157
+ {
158
+ name: "gemini",
159
+ keywords: ["gemini"],
160
+ envKey: "GEMINI_API_KEY",
161
+ displayName: "Gemini",
162
+ modelPrefix: "gemini",
163
+ litellmPrefix: "gemini",
164
+ skipPrefixes: ["gemini/"],
165
+ envExtras: [],
166
+ isGateway: false,
167
+ isLocal: false,
168
+ detectByKeyPrefix: "",
169
+ detectByBaseKeyword: "",
170
+ defaultApiBase: "https://generativelanguage.googleapis.com/v1beta/openai",
171
+ defaultModels: ["gemini/gemini-3.1-pro-preview", "gemini/gemini-3-flash-preview"],
172
+ visionModels: ["gemini/gemini-3.1-pro-preview", "gemini/gemini-3-flash-preview"],
173
+ stripModelPrefix: false,
174
+ modelOverrides: [],
175
+ logo: "gemini.svg"
176
+ },
177
+ {
178
+ name: "zhipu",
179
+ keywords: [
180
+ "zhipu",
181
+ "glm",
182
+ "zai"
183
+ ],
184
+ envKey: "ZAI_API_KEY",
185
+ displayName: "Zhipu AI",
186
+ modelPrefix: "zai",
187
+ litellmPrefix: "zai",
188
+ skipPrefixes: [
189
+ "zhipu/",
190
+ "zai/",
191
+ "openrouter/",
192
+ "hosted_vllm/"
193
+ ],
194
+ envExtras: [["ZHIPUAI_API_KEY", "{api_key}"]],
195
+ isGateway: false,
196
+ isLocal: false,
197
+ detectByKeyPrefix: "",
198
+ detectByBaseKeyword: "",
199
+ defaultApiBase: "https://open.bigmodel.cn/api/paas/v4",
200
+ defaultModels: ["zai/glm-5"],
201
+ stripModelPrefix: false,
202
+ modelOverrides: [],
203
+ logo: "zhipu.svg"
204
+ },
205
+ {
206
+ name: "dashscope",
207
+ keywords: ["qwen", "dashscope"],
208
+ envKey: "DASHSCOPE_API_KEY",
209
+ displayName: "DashScope",
210
+ modelPrefix: "dashscope",
211
+ litellmPrefix: "dashscope",
212
+ skipPrefixes: ["dashscope/", "openrouter/"],
213
+ envExtras: [],
214
+ isGateway: false,
215
+ isLocal: false,
216
+ detectByKeyPrefix: "",
217
+ detectByBaseKeyword: "",
218
+ defaultApiBase: "https://dashscope.aliyuncs.com/compatible-mode/v1",
219
+ defaultModels: [
220
+ "dashscope/qwen3.5-plus",
221
+ "dashscope/qwen3.5-flash",
222
+ "dashscope/qwen3.5-397b-a17b",
223
+ "dashscope/qwen3.5-122b-a10b",
224
+ "dashscope/qwen3.5-35b-a3b",
225
+ "dashscope/qwen3.5-27b"
226
+ ],
227
+ stripModelPrefix: false,
228
+ modelOverrides: [],
229
+ supportsResponsesApi: false,
230
+ logo: "dashscope.png"
231
+ },
232
+ {
233
+ name: "dashscope-coding-plan",
234
+ keywords: ["dashscope-coding-plan", "coding-plan"],
235
+ envKey: "DASHSCOPE_CODING_PLAN_API_KEY",
236
+ displayName: "DashScope Coding Plan",
237
+ modelPrefix: "dashscope-coding-plan",
238
+ litellmPrefix: "dashscope-coding-plan",
239
+ skipPrefixes: ["dashscope-coding-plan/"],
240
+ envExtras: [],
241
+ isGateway: false,
242
+ isLocal: false,
243
+ detectByKeyPrefix: "sk-sp-",
244
+ detectByBaseKeyword: "coding.dashscope.aliyuncs.com",
245
+ defaultApiBase: "https://coding.dashscope.aliyuncs.com/v1",
246
+ defaultModels: [
247
+ "dashscope-coding-plan/qwen3.5-plus",
248
+ "dashscope-coding-plan/qwen3-max-2026-01-23",
249
+ "dashscope-coding-plan/qwen3-coder-next",
250
+ "dashscope-coding-plan/qwen3-coder-plus",
251
+ "dashscope-coding-plan/MiniMax-M2.5",
252
+ "dashscope-coding-plan/glm-5",
253
+ "dashscope-coding-plan/glm-4.7",
254
+ "dashscope-coding-plan/kimi-k2.5"
255
+ ],
256
+ visionModels: ["dashscope-coding-plan/qwen3.5-plus", "dashscope-coding-plan/kimi-k2.5"],
257
+ stripModelPrefix: false,
258
+ modelOverrides: [],
259
+ supportsResponsesApi: false,
260
+ logo: "dashscope.png",
261
+ apiBaseHelp: {
262
+ zh: "Coding Plan 必须使用专属 Base URL https://coding.dashscope.aliyuncs.com/v1,并配合 sk-sp- 开头的专属 API Key;不要与普通 DashScope 按量计费 Key/Base URL 混用。",
263
+ en: "Coding Plan must use the dedicated base URL https://coding.dashscope.aliyuncs.com/v1 together with an sk-sp- API key. Do not mix it with the regular DashScope pay-as-you-go key/base URL."
264
+ }
265
+ },
266
+ {
267
+ name: "qwen-portal",
268
+ keywords: ["qwen-portal", "qwen"],
269
+ envKey: "QWEN_PORTAL_TOKEN",
270
+ displayName: "Qwen Portal",
271
+ modelPrefix: "qwen-portal",
272
+ litellmPrefix: "qwen-portal",
273
+ skipPrefixes: ["qwen-portal/"],
274
+ envExtras: [],
275
+ isGateway: false,
276
+ isLocal: false,
277
+ detectByKeyPrefix: "",
278
+ detectByBaseKeyword: "portal.qwen.ai",
279
+ defaultApiBase: "https://portal.qwen.ai/v1",
280
+ defaultModels: ["qwen-portal/coder-model", "qwen-portal/vision-model"],
281
+ visionModels: ["qwen-portal/vision-model"],
282
+ stripModelPrefix: false,
283
+ modelOverrides: [],
284
+ auth: {
285
+ kind: "device_code",
286
+ displayName: "Qwen OAuth",
287
+ baseUrl: "https://chat.qwen.ai",
288
+ deviceCodePath: "/api/v1/oauth2/device/code",
289
+ tokenPath: "/api/v1/oauth2/token",
290
+ clientId: "f0304373b74a44d2b584a3fb70ca9e56",
291
+ scope: "openid profile email model.completion",
292
+ grantType: "urn:ietf:params:oauth:grant-type:device_code",
293
+ usePkce: true,
294
+ cliCredential: {
295
+ path: "~/.qwen/oauth_creds.json",
296
+ accessTokenField: "access_token",
297
+ refreshTokenField: "refresh_token",
298
+ expiresAtField: "expiry_date"
299
+ },
300
+ note: {
301
+ zh: "通过浏览器登录 Qwen 后即可在 NextClaw 中使用该 Provider。",
302
+ en: "Log in to Qwen in your browser, then use this provider in NextClaw."
303
+ }
304
+ }
305
+ },
306
+ {
307
+ name: "moonshot",
308
+ keywords: ["moonshot", "kimi"],
309
+ envKey: "MOONSHOT_API_KEY",
310
+ displayName: "Moonshot",
311
+ modelPrefix: "moonshot",
312
+ litellmPrefix: "moonshot",
313
+ skipPrefixes: ["moonshot/", "openrouter/"],
314
+ envExtras: [["MOONSHOT_API_BASE", "{api_base}"]],
315
+ isGateway: false,
316
+ isLocal: false,
317
+ detectByKeyPrefix: "",
318
+ detectByBaseKeyword: "",
319
+ defaultApiBase: "https://api.moonshot.ai/v1",
320
+ defaultModels: ["moonshot/kimi-k2.5"],
321
+ stripModelPrefix: false,
322
+ modelOverrides: [],
323
+ logo: "moonshot.png"
324
+ },
325
+ {
326
+ name: "minimax",
327
+ keywords: ["minimax"],
328
+ envKey: "MINIMAX_API_KEY",
329
+ displayName: "MiniMax",
330
+ modelPrefix: "minimax",
331
+ litellmPrefix: "minimax",
332
+ skipPrefixes: ["minimax/", "openrouter/"],
333
+ envExtras: [],
334
+ isGateway: false,
335
+ isLocal: false,
336
+ detectByKeyPrefix: "",
337
+ detectByBaseKeyword: "",
338
+ defaultApiBase: "https://api.minimaxi.com/v1",
339
+ defaultModels: [
340
+ "minimax/MiniMax-M2.7",
341
+ "minimax/MiniMax-M2.7-highspeed",
342
+ "minimax/MiniMax-M2.5",
343
+ "minimax/MiniMax-M2.5-highspeed"
344
+ ],
345
+ stripModelPrefix: false,
346
+ modelOverrides: [],
347
+ supportsWireApi: true,
348
+ wireApiOptions: [
349
+ "auto",
350
+ "chat",
351
+ "responses"
352
+ ],
353
+ defaultWireApi: "chat",
354
+ logo: "minimax.svg",
355
+ apiBaseHelp: {
356
+ zh: "MiniMax 中国区请使用 https://api.minimaxi.com/v1;海外请使用 https://api.minimax.io/v1。AI Coding Tools 推荐使用 MiniMax-M2.7,并将 Wire API 设为 Chat。",
357
+ en: "Use https://api.minimaxi.com/v1 for Mainland China accounts, and https://api.minimax.io/v1 for overseas accounts. For AI Coding Tools, prefer MiniMax-M2.7 with Wire API set to Chat."
358
+ }
359
+ },
360
+ {
361
+ name: "minimax-portal",
362
+ keywords: ["minimax-portal", "minimax"],
363
+ envKey: "MINIMAX_PORTAL_TOKEN",
364
+ displayName: "MiniMax Portal",
365
+ modelPrefix: "minimax-portal",
366
+ litellmPrefix: "minimax-portal",
367
+ skipPrefixes: ["minimax-portal/"],
368
+ envExtras: [],
369
+ isGateway: false,
370
+ isLocal: false,
371
+ detectByKeyPrefix: "",
372
+ detectByBaseKeyword: "",
373
+ defaultApiBase: "https://api.minimax.io/v1",
374
+ defaultModels: ["minimax-portal/MiniMax-M2.5", "minimax-portal/MiniMax-M2.5-highspeed"],
375
+ stripModelPrefix: false,
376
+ modelOverrides: [],
377
+ logo: "minimax.svg",
378
+ apiBaseHelp: {
379
+ zh: "OAuth Global 默认使用 https://api.minimax.io/v1;OAuth 中国区默认使用 https://api.minimaxi.com/v1。",
380
+ en: "OAuth Global uses https://api.minimax.io/v1 by default; OAuth CN uses https://api.minimaxi.com/v1."
381
+ },
382
+ auth: {
383
+ kind: "device_code",
384
+ protocol: "minimax_user_code",
385
+ displayName: "MiniMax OAuth",
386
+ baseUrl: "https://api.minimax.io",
387
+ deviceCodePath: "/oauth/code",
388
+ tokenPath: "/oauth/token",
389
+ clientId: "78257093-7e40-4613-99e0-527b14b39113",
390
+ scope: "group_id profile model.completion",
391
+ grantType: "urn:ietf:params:oauth:grant-type:user_code",
392
+ usePkce: true,
393
+ defaultMethodId: "cn",
394
+ methods: [{
395
+ id: "global",
396
+ label: {
397
+ zh: "Global(海外)",
398
+ en: "Global"
399
+ },
400
+ hint: {
401
+ zh: "适用于海外用户,默认 API Base 为 https://api.minimax.io/v1。",
402
+ en: "For international users. Default API base: https://api.minimax.io/v1."
403
+ },
404
+ baseUrl: "https://api.minimax.io",
405
+ defaultApiBase: "https://api.minimax.io/v1"
406
+ }, {
407
+ id: "cn",
408
+ label: {
409
+ zh: "中国区(CN)",
410
+ en: "China Mainland (CN)"
411
+ },
412
+ hint: {
413
+ zh: "适用于中国区用户,默认 API Base 为 https://api.minimaxi.com/v1",
414
+ en: "For Mainland China users. Default API base: https://api.minimaxi.com/v1."
415
+ },
416
+ baseUrl: "https://api.minimaxi.com",
417
+ defaultApiBase: "https://api.minimaxi.com/v1"
418
+ }],
419
+ note: {
420
+ zh: "通过浏览器完成 MiniMax OAuth 授权后即可使用,无需手动填写 API Key。",
421
+ en: "Complete MiniMax OAuth in browser to use this provider without manually entering an API key."
422
+ }
423
+ }
424
+ },
425
+ {
426
+ name: "vllm",
427
+ keywords: ["vllm"],
428
+ envKey: "HOSTED_VLLM_API_KEY",
429
+ displayName: "vLLM/Local",
430
+ modelPrefix: "hosted_vllm",
431
+ litellmPrefix: "hosted_vllm",
432
+ skipPrefixes: [],
433
+ envExtras: [],
434
+ isGateway: false,
435
+ isLocal: true,
436
+ detectByKeyPrefix: "",
437
+ detectByBaseKeyword: "",
438
+ defaultApiBase: "http://127.0.0.1:8000/v1",
439
+ defaultModels: ["hosted_vllm/meta-llama/Llama-3.1-8B-Instruct", "hosted_vllm/Qwen/Qwen2.5-7B-Instruct"],
440
+ stripModelPrefix: false,
441
+ modelOverrides: [],
442
+ logo: "vllm.svg"
443
+ },
444
+ {
445
+ name: "groq",
446
+ keywords: ["groq"],
447
+ envKey: "GROQ_API_KEY",
448
+ displayName: "Groq",
449
+ modelPrefix: "groq",
450
+ litellmPrefix: "groq",
451
+ skipPrefixes: ["groq/"],
452
+ envExtras: [],
453
+ isGateway: false,
454
+ isLocal: false,
455
+ detectByKeyPrefix: "",
456
+ detectByBaseKeyword: "",
457
+ defaultApiBase: "https://api.groq.com/openai/v1",
458
+ defaultModels: ["groq/openai/gpt-oss-120b", "groq/llama-3.1-8b-instant"],
459
+ stripModelPrefix: false,
460
+ modelOverrides: [],
461
+ logo: "groq.svg"
462
+ }
463
+ ]
464
+ }]);
449
465
  function installBuiltinProviderRegistry() {
450
- setProviderRegistry(builtinProviderRegistry);
451
- return builtinProviderRegistry;
466
+ setProviderRegistry(builtinProviderRegistry);
467
+ return builtinProviderRegistry;
452
468
  }
453
469
  function listBuiltinProviderPlugins() {
454
- return builtinProviderRegistry.listProviderPlugins();
470
+ return builtinProviderRegistry.listProviderPlugins();
455
471
  }
456
472
  function listBuiltinProviders() {
457
- return builtinProviderRegistry.listProviderSpecs();
473
+ return builtinProviderRegistry.listProviderSpecs();
458
474
  }
459
475
  function findBuiltinProviderByName(name) {
460
- return builtinProviderRegistry.findProviderByName(name);
476
+ return builtinProviderRegistry.findProviderByName(name);
461
477
  }
462
478
  function builtinProviderIds() {
463
- return listBuiltinProviders().map((provider) => provider.name);
479
+ return listBuiltinProviders().map((provider) => provider.name);
464
480
  }
465
-
466
- // src/channels/builtin.ts
467
- var BUILTIN_CHANNEL_PLUGIN_IDS = [
468
- "telegram",
469
- "whatsapp",
470
- "discord",
471
- "feishu",
472
- "mochat",
473
- "dingtalk",
474
- "wecom",
475
- "email",
476
- "slack",
477
- "qq",
478
- "weixin"
481
+ //#endregion
482
+ //#region src/channels/builtin.ts
483
+ const BUILTIN_CHANNEL_PLUGIN_IDS = [
484
+ "telegram",
485
+ "whatsapp",
486
+ "discord",
487
+ "feishu",
488
+ "mochat",
489
+ "dingtalk",
490
+ "wecom",
491
+ "email",
492
+ "slack",
493
+ "qq",
494
+ "weixin"
479
495
  ];
480
496
  function isBuiltinChannelPluginId(value) {
481
- return BUILTIN_CHANNEL_PLUGIN_IDS.includes(value);
497
+ return BUILTIN_CHANNEL_PLUGIN_IDS.includes(value);
482
498
  }
483
-
484
- // src/index.ts
499
+ //#endregion
500
+ //#region src/index.ts
485
501
  installBuiltinProviderRegistry();
486
- export {
487
- BUILTIN_CHANNEL_PLUGIN_IDS,
488
- builtinProviderIds,
489
- findBuiltinProviderByName,
490
- installBuiltinProviderRegistry,
491
- isBuiltinChannelPluginId,
492
- listBuiltinProviderPlugins,
493
- listBuiltinProviders
494
- };
502
+ //#endregion
503
+ export { BUILTIN_CHANNEL_PLUGIN_IDS, builtinProviderIds, findBuiltinProviderByName, installBuiltinProviderRegistry, isBuiltinChannelPluginId, listBuiltinProviderPlugins, listBuiltinProviders };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/runtime",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "private": false,
5
5
  "description": "NextClaw runtime assembly for builtin providers and channels.",
6
6
  "type": "module",
@@ -15,16 +15,15 @@
15
15
  "dist"
16
16
  ],
17
17
  "dependencies": {
18
- "@nextclaw/core": "0.12.0"
18
+ "@nextclaw/core": "0.12.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^20.17.6",
22
22
  "prettier": "^3.3.3",
23
- "tsup": "^8.3.5",
24
23
  "typescript": "^5.6.3"
25
24
  },
26
25
  "scripts": {
27
- "build": "tsup src/index.ts --format esm --dts --out-dir dist",
26
+ "build": "tsdown src/index.ts --dts --clean --target es2022 --no-fixedExtension",
28
27
  "lint": "eslint .",
29
28
  "tsc": "tsc -p tsconfig.json"
30
29
  }