@nextclaw/runtime 0.2.31 → 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 +9 -8
- package/dist/index.js +489 -480
- package/package.json +3 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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
|
-
|
|
451
|
-
|
|
466
|
+
setProviderRegistry(builtinProviderRegistry);
|
|
467
|
+
return builtinProviderRegistry;
|
|
452
468
|
}
|
|
453
469
|
function listBuiltinProviderPlugins() {
|
|
454
|
-
|
|
470
|
+
return builtinProviderRegistry.listProviderPlugins();
|
|
455
471
|
}
|
|
456
472
|
function listBuiltinProviders() {
|
|
457
|
-
|
|
473
|
+
return builtinProviderRegistry.listProviderSpecs();
|
|
458
474
|
}
|
|
459
475
|
function findBuiltinProviderByName(name) {
|
|
460
|
-
|
|
476
|
+
return builtinProviderRegistry.findProviderByName(name);
|
|
461
477
|
}
|
|
462
478
|
function builtinProviderIds() {
|
|
463
|
-
|
|
479
|
+
return listBuiltinProviders().map((provider) => provider.name);
|
|
464
480
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
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
|
-
|
|
497
|
+
return BUILTIN_CHANNEL_PLUGIN_IDS.includes(value);
|
|
482
498
|
}
|
|
483
|
-
|
|
484
|
-
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region src/index.ts
|
|
485
501
|
installBuiltinProviderRegistry();
|
|
486
|
-
|
|
487
|
-
|
|
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.
|
|
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.
|
|
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": "
|
|
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
|
}
|