@openclaw/qwen-provider 2026.8.1-beta.2 → 2026.8.1

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/api.js CHANGED
@@ -1,4 +1,4 @@
1
- import { MODELSTUDIO_BASE_URL, MODELSTUDIO_CN_BASE_URL, MODELSTUDIO_DEFAULT_COST, MODELSTUDIO_DEFAULT_MODEL_ID, MODELSTUDIO_DEFAULT_MODEL_REF, MODELSTUDIO_GLOBAL_BASE_URL, MODELSTUDIO_MODEL_CATALOG, MODELSTUDIO_STANDARD_CN_BASE_URL, MODELSTUDIO_STANDARD_GLOBAL_BASE_URL, QWEN_36_FLASH_MODEL_ID, QWEN_36_PLUS_MODEL_ID, QWEN_37_MAX_MODEL_ID, QWEN_37_PLUS_MODEL_ID, QWEN_BASE_URL, QWEN_CN_BASE_URL, QWEN_DEFAULT_COST, QWEN_DEFAULT_MODEL_ID, QWEN_DEFAULT_MODEL_REF, QWEN_GLOBAL_BASE_URL, QWEN_MODEL_CATALOG, QWEN_STANDARD_CN_BASE_URL, QWEN_STANDARD_GLOBAL_BASE_URL, QWEN_TOKEN_PLAN_CN_BASE_URL, QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID, QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, QWEN_TOKEN_PLAN_GLOBAL_BASE_URL, QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, QWEN_TOKEN_PLAN_MODEL_CATALOG, QWEN_TOKEN_PLAN_PROVIDER_ID, applyModelStudioNativeStreamingUsageCompat, applyQwenNativeStreamingUsageCompat, buildModelStudioDefaultModelDefinition, buildModelStudioModelDefinition, buildQwenDefaultModelDefinition, buildQwenModelCatalogForBaseUrl, buildQwenModelDefinition, isNativeModelStudioBaseUrl, isNativeQwenBaseUrl, isQwen36PlusSupportedBaseUrl, isQwenCodingPlanBaseUrl, isQwenStandardOnlyModelId, resolveQwenTokenPlanBaseUrl } from "./models.js";
1
+ import { A as applyModelStudioNativeStreamingUsageCompat, C as QWEN_TOKEN_PLAN_CN_BASE_URL, D as QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, E as QWEN_TOKEN_PLAN_GLOBAL_BASE_URL, F as buildQwenModelCatalogForBaseUrl, H as isQwenStandardOnlyModelId, I as buildQwenModelDefinition, L as isNativeModelStudioBaseUrl, M as buildModelStudioDefaultModelDefinition, N as buildModelStudioModelDefinition, O as QWEN_TOKEN_PLAN_MODEL_CATALOG, P as buildQwenDefaultModelDefinition, R as isNativeQwenBaseUrl, S as QWEN_STANDARD_GLOBAL_BASE_URL, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, V as isQwenCodingPlanBaseUrl, _ as QWEN_DEFAULT_MODEL_ID, a as MODELSTUDIO_DEFAULT_MODEL_REF, b as QWEN_MODEL_CATALOG, c as MODELSTUDIO_STANDARD_CN_BASE_URL, d as QWEN_36_PLUS_MODEL_ID, f as QWEN_37_MAX_MODEL_ID, g as QWEN_DEFAULT_COST, h as QWEN_CN_BASE_URL, i as MODELSTUDIO_DEFAULT_MODEL_ID, j as applyQwenNativeStreamingUsageCompat, k as QWEN_TOKEN_PLAN_PROVIDER_ID, l as MODELSTUDIO_STANDARD_GLOBAL_BASE_URL, m as QWEN_BASE_URL, n as MODELSTUDIO_CN_BASE_URL, o as MODELSTUDIO_GLOBAL_BASE_URL, p as QWEN_37_PLUS_MODEL_ID, q as resolveQwenTokenPlanBaseUrl, r as MODELSTUDIO_DEFAULT_COST, s as MODELSTUDIO_MODEL_CATALOG, t as MODELSTUDIO_BASE_URL, u as QWEN_36_FLASH_MODEL_ID, v as QWEN_DEFAULT_MODEL_REF, w as QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID, x as QWEN_STANDARD_CN_BASE_URL, y as QWEN_GLOBAL_BASE_URL, z as isQwen36PlusSupportedBaseUrl } from "./models-C6e6jhtg.js";
2
2
  import { buildModelStudioProvider, buildQwenProvider, buildQwenTokenPlanProvider } from "./provider-catalog.js";
3
3
  import { createQwenThinkingWrapper, wrapQwenProviderStream } from "./stream.js";
4
4
  export { MODELSTUDIO_BASE_URL, MODELSTUDIO_CN_BASE_URL, MODELSTUDIO_DEFAULT_COST, MODELSTUDIO_DEFAULT_MODEL_ID, MODELSTUDIO_DEFAULT_MODEL_REF, MODELSTUDIO_GLOBAL_BASE_URL, MODELSTUDIO_MODEL_CATALOG, MODELSTUDIO_STANDARD_CN_BASE_URL, MODELSTUDIO_STANDARD_GLOBAL_BASE_URL, QWEN_36_FLASH_MODEL_ID, QWEN_36_PLUS_MODEL_ID, QWEN_37_MAX_MODEL_ID, QWEN_37_PLUS_MODEL_ID, QWEN_BASE_URL, QWEN_CN_BASE_URL, QWEN_DEFAULT_COST, QWEN_DEFAULT_MODEL_ID, QWEN_DEFAULT_MODEL_REF, QWEN_GLOBAL_BASE_URL, QWEN_MODEL_CATALOG, QWEN_STANDARD_CN_BASE_URL, QWEN_STANDARD_GLOBAL_BASE_URL, QWEN_TOKEN_PLAN_CN_BASE_URL, QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID, QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, QWEN_TOKEN_PLAN_GLOBAL_BASE_URL, QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, QWEN_TOKEN_PLAN_MODEL_CATALOG, QWEN_TOKEN_PLAN_PROVIDER_ID, applyModelStudioNativeStreamingUsageCompat, applyQwenNativeStreamingUsageCompat, buildModelStudioDefaultModelDefinition, buildModelStudioModelDefinition, buildModelStudioProvider, buildQwenDefaultModelDefinition, buildQwenModelCatalogForBaseUrl, buildQwenModelDefinition, buildQwenProvider, buildQwenTokenPlanProvider, createQwenThinkingWrapper, isNativeModelStudioBaseUrl, isNativeQwenBaseUrl, isQwen36PlusSupportedBaseUrl, isQwenCodingPlanBaseUrl, isQwenStandardOnlyModelId, resolveQwenTokenPlanBaseUrl, wrapQwenProviderStream };
package/dist/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { QWEN_DEFAULT_MODEL_REF, QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, QWEN_TOKEN_PLAN_PROVIDER_ID, applyQwenNativeStreamingUsageCompat, isQwenCodingPlanBaseUrl, isQwenStandardOnlyModelId, isQwenTokenPlanDeepSeekV4ModelId, isQwenTokenPlanGlmModelId, isQwenTokenPlanThinkingOnlyModelId, supportsQwenTokenPlanGlmMaxThinking } from "./models.js";
2
- import { buildQwenProvider, buildQwenTokenPlanProvider } from "./provider-catalog.js";
3
- import { wrapQwenProviderStream } from "./stream.js";
4
- import "./api.js";
1
+ import { B as isQwen38ModelId, D as QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID, H as isQwenStandardOnlyModelId, J as supportsQwenTokenPlanGlmMaxThinking, K as isQwenTokenPlanThinkingOnlyModelId, T as QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF, U as isQwenTokenPlanDeepSeekV4ModelId, V as isQwenCodingPlanBaseUrl, W as isQwenTokenPlanGlmModelId, k as QWEN_TOKEN_PLAN_PROVIDER_ID, v as QWEN_DEFAULT_MODEL_REF } from "./models-C6e6jhtg.js";
5
2
  import { buildQwenMediaUnderstandingProvider } from "./media-understanding-provider.js";
3
+ import { buildQwenProvider, buildQwenTokenPlanProvider } from "./provider-catalog.js";
6
4
  import { applyQwenConfig, applyQwenConfigCn, applyQwenStandardConfig, applyQwenStandardConfigCn, applyQwenTokenPlanConfig } from "./onboard.js";
5
+ import { wrapQwenProviderStream } from "./stream.js";
7
6
  import { qwenVideoGenerationProvider } from "./video-generation-provider.js";
8
7
  import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
9
8
  import { buildOpenAICompatibleLiveModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
@@ -67,6 +66,8 @@ function createQwenTokenPlanAuthMethod(region) {
67
66
  });
68
67
  }
69
68
  function resolveQwenTokenPlanThinkingProfile(modelId) {
69
+ const qwenProfile = resolveQwenThinkingProfile(modelId);
70
+ if (qwenProfile) return qwenProfile;
70
71
  if (isQwenTokenPlanThinkingOnlyModelId(modelId)) return {
71
72
  levels: [{
72
73
  id: "low",
@@ -84,6 +85,17 @@ function resolveQwenTokenPlanThinkingProfile(modelId) {
84
85
  defaultLevel: "high"
85
86
  };
86
87
  }
88
+ function resolveQwenThinkingProfile(modelId) {
89
+ return isQwen38ModelId(modelId) ? {
90
+ levels: [
91
+ "off",
92
+ "low",
93
+ "medium",
94
+ "xhigh"
95
+ ].map((id) => ({ id })),
96
+ defaultLevel: "xhigh"
97
+ } : void 0;
98
+ }
87
99
  var qwen_default = defineSingleProviderPluginEntry({
88
100
  id: PROVIDER_ID,
89
101
  name: "Qwen Provider",
@@ -107,7 +119,7 @@ var qwen_default = defineSingleProviderPluginEntry({
107
119
  "Manage API keys: https://home.qwencloud.com/api-keys",
108
120
  "Docs: https://docs.qwencloud.com/",
109
121
  "Endpoint: dashscope.aliyuncs.com/compatible-mode/v1",
110
- "Models: qwen3.7-max, qwen3.7-plus, qwen3.6-plus, qwen3.6-flash, qwen3.5-plus, etc."
122
+ "Models: qwen3.8-max, qwen3.8-flash, qwen3.7-plus, and other discovered models."
111
123
  ].join("\n"),
112
124
  noteTitle: "Qwen Cloud Standard (China)",
113
125
  wizard: {
@@ -130,7 +142,7 @@ var qwen_default = defineSingleProviderPluginEntry({
130
142
  "Manage API keys: https://home.qwencloud.com/api-keys",
131
143
  "Docs: https://docs.qwencloud.com/",
132
144
  "Endpoint: dashscope-intl.aliyuncs.com/compatible-mode/v1",
133
- "Models: qwen3.7-max, qwen3.7-plus, qwen3.6-plus, qwen3.6-flash, qwen3.5-plus, etc."
145
+ "Models: qwen3.8-max, qwen3.8-flash, qwen3.7-plus, and other discovered models."
134
146
  ].join("\n"),
135
147
  noteTitle: "Qwen Cloud Standard (Global/Intl)",
136
148
  wizard: {
@@ -200,8 +212,8 @@ var qwen_default = defineSingleProviderPluginEntry({
200
212
  },
201
213
  staticRun: async () => ({ provider: buildQwenProvider() })
202
214
  },
203
- applyNativeStreamingUsageCompat: ({ providerConfig }) => applyQwenNativeStreamingUsageCompat(providerConfig),
204
215
  wrapStreamFn: wrapQwenProviderStream,
216
+ resolveThinkingProfile: ({ modelId }) => resolveQwenThinkingProfile(modelId),
205
217
  normalizeConfig: ({ providerConfig }) => {
206
218
  if (!isQwenCodingPlanBaseUrl(providerConfig.baseUrl)) return;
207
219
  const models = providerConfig.models?.filter((model) => !isQwenStandardOnlyModelId(model.id));
@@ -235,7 +247,6 @@ var qwen_default = defineSingleProviderPluginEntry({
235
247
  order: "simple",
236
248
  run: async () => ({ provider: buildQwenTokenPlanProvider() })
237
249
  },
238
- applyNativeStreamingUsageCompat: ({ providerConfig }) => applyQwenNativeStreamingUsageCompat(providerConfig),
239
250
  wrapStreamFn: wrapQwenProviderStream,
240
251
  resolveThinkingProfile: ({ modelId }) => resolveQwenTokenPlanThinkingProfile(modelId)
241
252
  });
@@ -244,7 +255,6 @@ var qwen_default = defineSingleProviderPluginEntry({
244
255
  label: "Alibaba Token Plan (legacy custom config)",
245
256
  docsPath: "/providers/qwen",
246
257
  auth: [],
247
- applyNativeStreamingUsageCompat: ({ providerConfig }) => applyQwenNativeStreamingUsageCompat(providerConfig),
248
258
  wrapStreamFn: wrapQwenProviderStream
249
259
  });
250
260
  api.registerMediaUnderstandingProvider(buildQwenMediaUnderstandingProvider());
@@ -1,54 +1,17 @@
1
- import { QWEN_STANDARD_GLOBAL_BASE_URL } from "./models.js";
2
- import { buildOpenAiCompatibleVideoRequestBody, coerceOpenAiCompatibleVideoText, describeImageWithModel, describeImagesWithModel, resolveMediaUnderstandingString } from "openclaw/plugin-sdk/media-understanding";
3
- import { assertOkOrThrowHttpError, postJsonRequest, readProviderJsonResponse, resolveProviderHttpRequestConfig } from "openclaw/plugin-sdk/provider-http";
1
+ import { S as QWEN_STANDARD_GLOBAL_BASE_URL } from "./models-C6e6jhtg.js";
2
+ import { describeImageWithModel, describeImagesWithModel, describeOpenAiCompatibleVideo } from "openclaw/plugin-sdk/media-understanding";
4
3
  //#region extensions/qwen/media-understanding-provider.ts
5
4
  const DEFAULT_QWEN_MEDIA_MODEL = "qwen3.6-plus";
6
5
  const DEFAULT_QWEN_VIDEO_PROMPT = "Describe the video in detail.";
7
- async function describeQwenVideo(params) {
8
- const fetchFn = params.fetchFn ?? fetch;
9
- const model = resolveMediaUnderstandingString(params.model, DEFAULT_QWEN_MEDIA_MODEL);
10
- const mime = resolveMediaUnderstandingString(params.mime, "video/mp4");
11
- const prompt = resolveMediaUnderstandingString(params.prompt, DEFAULT_QWEN_VIDEO_PROMPT);
12
- const { baseUrl, allowPrivateNetwork, headers, dispatcherPolicy } = resolveProviderHttpRequestConfig({
13
- baseUrl: params.baseUrl,
6
+ function describeQwenVideo(params) {
7
+ return describeOpenAiCompatibleVideo({
8
+ ...params,
14
9
  defaultBaseUrl: QWEN_STANDARD_GLOBAL_BASE_URL,
15
- headers: params.headers,
16
- request: params.request,
17
- defaultHeaders: {
18
- "content-type": "application/json",
19
- authorization: `Bearer ${params.apiKey}`
20
- },
10
+ defaultModel: DEFAULT_QWEN_MEDIA_MODEL,
11
+ defaultPrompt: DEFAULT_QWEN_VIDEO_PROMPT,
21
12
  provider: "qwen",
22
- api: "openai-completions",
23
- capability: "video",
24
- transport: "media-understanding"
25
- });
26
- const { response: res, release } = await postJsonRequest({
27
- url: `${baseUrl}/chat/completions`,
28
- headers,
29
- body: buildOpenAiCompatibleVideoRequestBody({
30
- model,
31
- prompt,
32
- mime,
33
- buffer: params.buffer
34
- }),
35
- timeoutMs: params.timeoutMs,
36
- ...params.signal ? { signal: params.signal } : {},
37
- fetchFn,
38
- allowPrivateNetwork,
39
- dispatcherPolicy
13
+ providerLabel: "Qwen"
40
14
  });
41
- try {
42
- await assertOkOrThrowHttpError(res, "Qwen video description failed");
43
- const text = coerceOpenAiCompatibleVideoText(await readProviderJsonResponse(res, "Qwen video description failed"));
44
- if (!text) throw new Error("Qwen video description response missing content");
45
- return {
46
- text,
47
- model
48
- };
49
- } finally {
50
- await release();
51
- }
52
15
  }
53
16
  function buildQwenMediaUnderstandingProvider() {
54
17
  return {
@@ -0,0 +1,495 @@
1
+ import { applyProviderNativeStreamingUsageCompat, buildManifestModelProviderConfig, supportsNativeStreamingUsageCompat } from "openclaw/plugin-sdk/provider-catalog-shared";
2
+ //#region extensions/qwen/openclaw.plugin.json
3
+ var modelCatalog = {
4
+ "suppressions": [
5
+ {
6
+ "provider": "qwen",
7
+ "model": "qwen3.8-max",
8
+ "reason": "qwen3.8-max is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go or Token Plan endpoint.",
9
+ "when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
10
+ },
11
+ {
12
+ "provider": "qwen",
13
+ "model": "qwen3.8-flash",
14
+ "reason": "qwen3.8-flash is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go or Token Plan endpoint.",
15
+ "when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
16
+ },
17
+ {
18
+ "provider": "modelstudio",
19
+ "model": "qwen3.8-max",
20
+ "reason": "qwen3.8-max is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go or Token Plan endpoint.",
21
+ "when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
22
+ },
23
+ {
24
+ "provider": "modelstudio",
25
+ "model": "qwen3.8-flash",
26
+ "reason": "qwen3.8-flash is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go or Token Plan endpoint.",
27
+ "when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
28
+ },
29
+ {
30
+ "provider": "qwen",
31
+ "model": "qwen3.6-flash",
32
+ "reason": "qwen3.6-flash is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go Qwen endpoint.",
33
+ "when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
34
+ },
35
+ {
36
+ "provider": "qwen",
37
+ "model": "qwen3.7-max",
38
+ "reason": "qwen3.7-max is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go Qwen endpoint.",
39
+ "when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
40
+ },
41
+ {
42
+ "provider": "modelstudio",
43
+ "model": "qwen3.6-flash",
44
+ "reason": "qwen3.6-flash is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go Qwen endpoint.",
45
+ "when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
46
+ },
47
+ {
48
+ "provider": "modelstudio",
49
+ "model": "qwen3.7-max",
50
+ "reason": "qwen3.7-max is not supported on the Qwen Coding Plan endpoint; use a Standard pay-as-you-go Qwen endpoint.",
51
+ "when": { "baseUrlHosts": ["coding.dashscope.aliyuncs.com", "coding-intl.dashscope.aliyuncs.com"] }
52
+ }
53
+ ],
54
+ "providers": {
55
+ "qwen": {
56
+ "api": "openai-completions",
57
+ "models": [
58
+ {
59
+ "id": "qwen3.5-plus",
60
+ "reasoning": false,
61
+ "input": ["text", "image"],
62
+ "contextWindow": 1e6,
63
+ "maxTokens": 65536
64
+ },
65
+ {
66
+ "id": "qwen3.6-flash",
67
+ "reasoning": true,
68
+ "input": ["text", "image"],
69
+ "contextWindow": 1e6,
70
+ "maxTokens": 65536
71
+ },
72
+ {
73
+ "id": "qwen3.6-plus",
74
+ "reasoning": true,
75
+ "input": ["text", "image"],
76
+ "contextWindow": 1e6,
77
+ "maxTokens": 65536
78
+ },
79
+ {
80
+ "id": "qwen3.7-max",
81
+ "reasoning": true,
82
+ "input": ["text"],
83
+ "contextWindow": 1e6,
84
+ "maxTokens": 65536
85
+ },
86
+ {
87
+ "id": "qwen3.7-plus",
88
+ "reasoning": true,
89
+ "input": ["text", "image"],
90
+ "contextWindow": 1e6,
91
+ "maxTokens": 65536
92
+ },
93
+ {
94
+ "id": "qwen3.8-max",
95
+ "reasoning": true,
96
+ "input": ["text", "image"],
97
+ "contextWindow": 1e6,
98
+ "maxTokens": 131072,
99
+ "thinkingLevelMap": {
100
+ "minimal": "low",
101
+ "high": "xhigh",
102
+ "max": "xhigh"
103
+ },
104
+ "compat": {
105
+ "codeMode": "capable",
106
+ "supportsReasoningEffort": true,
107
+ "supportedReasoningEfforts": [
108
+ "low",
109
+ "medium",
110
+ "xhigh"
111
+ ],
112
+ "reasoningEffortMap": {
113
+ "minimal": "low",
114
+ "high": "xhigh",
115
+ "max": "xhigh"
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "id": "qwen3.8-flash",
121
+ "reasoning": true,
122
+ "input": ["text", "image"],
123
+ "contextWindow": 1e6,
124
+ "maxTokens": 131072,
125
+ "thinkingLevelMap": {
126
+ "minimal": "low",
127
+ "high": "xhigh",
128
+ "max": "xhigh"
129
+ },
130
+ "compat": {
131
+ "supportsReasoningEffort": true,
132
+ "supportedReasoningEfforts": [
133
+ "low",
134
+ "medium",
135
+ "xhigh"
136
+ ],
137
+ "reasoningEffortMap": {
138
+ "minimal": "low",
139
+ "high": "xhigh",
140
+ "max": "xhigh"
141
+ }
142
+ }
143
+ },
144
+ {
145
+ "id": "qwen3-max-2026-01-23",
146
+ "reasoning": false,
147
+ "input": ["text"],
148
+ "contextWindow": 262144,
149
+ "maxTokens": 65536
150
+ },
151
+ {
152
+ "id": "qwen3-coder-next",
153
+ "reasoning": false,
154
+ "input": ["text"],
155
+ "contextWindow": 262144,
156
+ "maxTokens": 65536
157
+ },
158
+ {
159
+ "id": "qwen3-coder-plus",
160
+ "reasoning": false,
161
+ "input": ["text"],
162
+ "contextWindow": 1e6,
163
+ "maxTokens": 65536
164
+ },
165
+ {
166
+ "id": "MiniMax-M2.5",
167
+ "reasoning": true,
168
+ "input": ["text"],
169
+ "contextWindow": 1e6,
170
+ "maxTokens": 65536
171
+ },
172
+ {
173
+ "id": "glm-5",
174
+ "reasoning": false,
175
+ "input": ["text"],
176
+ "contextWindow": 202752,
177
+ "maxTokens": 16384
178
+ },
179
+ {
180
+ "id": "glm-4.7",
181
+ "reasoning": false,
182
+ "input": ["text"],
183
+ "contextWindow": 202752,
184
+ "maxTokens": 16384
185
+ },
186
+ {
187
+ "id": "kimi-k2.5",
188
+ "reasoning": false,
189
+ "input": ["text", "image"],
190
+ "contextWindow": 262144,
191
+ "maxTokens": 32768
192
+ }
193
+ ]
194
+ },
195
+ "qwen-token-plan": {
196
+ "baseUrl": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
197
+ "api": "openai-completions",
198
+ "models": [
199
+ {
200
+ "id": "qwen3.7-plus",
201
+ "name": "qwen3.7-plus",
202
+ "reasoning": true,
203
+ "input": ["text", "image"],
204
+ "cost": {
205
+ "input": 0,
206
+ "output": 0,
207
+ "cacheRead": 0,
208
+ "cacheWrite": 0
209
+ },
210
+ "contextWindow": 1e6,
211
+ "maxTokens": 65536
212
+ },
213
+ {
214
+ "id": "qwen3.8-max",
215
+ "name": "qwen3.8-max",
216
+ "reasoning": true,
217
+ "input": ["text", "image"],
218
+ "cost": {
219
+ "input": 0,
220
+ "output": 0,
221
+ "cacheRead": 0,
222
+ "cacheWrite": 0
223
+ },
224
+ "contextWindow": 1e6,
225
+ "maxTokens": 131072,
226
+ "thinkingLevelMap": {
227
+ "minimal": "low",
228
+ "high": "xhigh",
229
+ "max": "xhigh"
230
+ },
231
+ "compat": {
232
+ "codeMode": "capable",
233
+ "supportsReasoningEffort": true,
234
+ "supportedReasoningEfforts": [
235
+ "low",
236
+ "medium",
237
+ "xhigh"
238
+ ],
239
+ "reasoningEffortMap": {
240
+ "minimal": "low",
241
+ "high": "xhigh",
242
+ "max": "xhigh"
243
+ }
244
+ }
245
+ },
246
+ {
247
+ "id": "qwen3.8-flash",
248
+ "name": "qwen3.8-flash",
249
+ "reasoning": true,
250
+ "input": ["text", "image"],
251
+ "cost": {
252
+ "input": 0,
253
+ "output": 0,
254
+ "cacheRead": 0,
255
+ "cacheWrite": 0
256
+ },
257
+ "contextWindow": 1e6,
258
+ "maxTokens": 131072,
259
+ "thinkingLevelMap": {
260
+ "minimal": "low",
261
+ "high": "xhigh",
262
+ "max": "xhigh"
263
+ },
264
+ "compat": {
265
+ "supportsReasoningEffort": true,
266
+ "supportedReasoningEfforts": [
267
+ "low",
268
+ "medium",
269
+ "xhigh"
270
+ ],
271
+ "reasoningEffortMap": {
272
+ "minimal": "low",
273
+ "high": "xhigh",
274
+ "max": "xhigh"
275
+ }
276
+ }
277
+ },
278
+ {
279
+ "id": "qwen3.6-plus",
280
+ "name": "qwen3.6-plus",
281
+ "reasoning": true,
282
+ "input": ["text", "image"],
283
+ "cost": {
284
+ "input": 0,
285
+ "output": 0,
286
+ "cacheRead": 0,
287
+ "cacheWrite": 0
288
+ },
289
+ "contextWindow": 1e6,
290
+ "maxTokens": 65536
291
+ },
292
+ {
293
+ "id": "qwen3-coder-next",
294
+ "name": "qwen3-coder-next",
295
+ "reasoning": true,
296
+ "input": ["text"],
297
+ "cost": {
298
+ "input": 0,
299
+ "output": 0,
300
+ "cacheRead": 0,
301
+ "cacheWrite": 0
302
+ },
303
+ "contextWindow": 262144,
304
+ "maxTokens": 65536,
305
+ "status": "deprecated",
306
+ "replacedBy": "qwen3.7-plus"
307
+ },
308
+ {
309
+ "id": "kimi-k2.5",
310
+ "name": "kimi-k2.5",
311
+ "reasoning": true,
312
+ "input": ["text", "image"],
313
+ "cost": {
314
+ "input": 0,
315
+ "output": 0,
316
+ "cacheRead": 0,
317
+ "cacheWrite": 0
318
+ },
319
+ "contextWindow": 262144,
320
+ "maxTokens": 98304
321
+ },
322
+ {
323
+ "id": "glm-5",
324
+ "name": "glm-5",
325
+ "reasoning": true,
326
+ "input": ["text"],
327
+ "cost": {
328
+ "input": 0,
329
+ "output": 0,
330
+ "cacheRead": 0,
331
+ "cacheWrite": 0
332
+ },
333
+ "contextWindow": 202752,
334
+ "maxTokens": 16384
335
+ },
336
+ {
337
+ "id": "MiniMax-M2.5",
338
+ "name": "MiniMax-M2.5",
339
+ "reasoning": true,
340
+ "input": ["text"],
341
+ "cost": {
342
+ "input": 0,
343
+ "output": 0,
344
+ "cacheRead": 0,
345
+ "cacheWrite": 0
346
+ },
347
+ "contextWindow": 196608,
348
+ "maxTokens": 32768
349
+ }
350
+ ]
351
+ }
352
+ },
353
+ "discovery": {
354
+ "qwen": "runtime",
355
+ "qwen-token-plan": "refreshable"
356
+ }
357
+ };
358
+ //#endregion
359
+ //#region extensions/qwen/models.ts
360
+ const QWEN_BASE_URL = "https://coding-intl.dashscope.aliyuncs.com/v1";
361
+ const QWEN_GLOBAL_BASE_URL = QWEN_BASE_URL;
362
+ const QWEN_CN_BASE_URL = "https://coding.dashscope.aliyuncs.com/v1";
363
+ const QWEN_STANDARD_CN_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
364
+ const QWEN_STANDARD_GLOBAL_BASE_URL = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1";
365
+ const QWEN_TOKEN_PLAN_PROVIDER_ID = "qwen-token-plan";
366
+ const QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID = "bailian-token-plan";
367
+ const QWEN_TOKEN_PLAN_GLOBAL_BASE_URL = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1";
368
+ const QWEN_TOKEN_PLAN_CN_BASE_URL = "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1";
369
+ const QWEN_DEFAULT_MODEL_ID = "qwen3.5-plus";
370
+ const QWEN_36_FLASH_MODEL_ID = "qwen3.6-flash";
371
+ const QWEN_36_PLUS_MODEL_ID = "qwen3.6-plus";
372
+ const QWEN_37_MAX_MODEL_ID = "qwen3.7-max";
373
+ const QWEN_37_PLUS_MODEL_ID = "qwen3.7-plus";
374
+ const QWEN_38_MODEL_IDS = /* @__PURE__ */ new Set(["qwen3.8-max", "qwen3.8-flash"]);
375
+ function isQwen38ModelId(modelId) {
376
+ return QWEN_38_MODEL_IDS.has(modelId.trim().toLowerCase());
377
+ }
378
+ const QWEN_DEFAULT_COST = {
379
+ input: 0,
380
+ output: 0,
381
+ cacheRead: 0,
382
+ cacheWrite: 0
383
+ };
384
+ const QWEN_DEFAULT_MODEL_REF = `qwen/${QWEN_DEFAULT_MODEL_ID}`;
385
+ const QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID = QWEN_37_PLUS_MODEL_ID;
386
+ const QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF = `${QWEN_TOKEN_PLAN_PROVIDER_ID}/${QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID}`;
387
+ function isQwenTokenPlanThinkingOnlyModelId(modelId) {
388
+ const normalized = modelId.trim().toLowerCase();
389
+ return normalized === "minimax-m2.5" || normalized.startsWith("kimi-k2.7-code");
390
+ }
391
+ function isQwenTokenPlanDeepSeekV4ModelId(modelId) {
392
+ return modelId.trim().toLowerCase().startsWith("deepseek-v4");
393
+ }
394
+ function isQwenTokenPlanKimiModelId(modelId) {
395
+ return modelId.trim().toLowerCase().startsWith("kimi-");
396
+ }
397
+ function isQwenTokenPlanGlmModelId(modelId) {
398
+ return modelId.trim().toLowerCase().startsWith("glm-");
399
+ }
400
+ function supportsQwenTokenPlanGlmMaxThinking(modelId) {
401
+ return modelId.trim().toLowerCase() === "glm-5.2";
402
+ }
403
+ const QWEN_TOKEN_PLAN_BASE_URLS = {
404
+ global: QWEN_TOKEN_PLAN_GLOBAL_BASE_URL,
405
+ cn: QWEN_TOKEN_PLAN_CN_BASE_URL
406
+ };
407
+ function resolveQwenTokenPlanBaseUrl(region) {
408
+ return QWEN_TOKEN_PLAN_BASE_URLS[region];
409
+ }
410
+ const QWEN_TOKEN_PLAN_MODEL_CATALOG = buildManifestModelProviderConfig({
411
+ providerId: QWEN_TOKEN_PLAN_PROVIDER_ID,
412
+ catalog: modelCatalog.providers[QWEN_TOKEN_PLAN_PROVIDER_ID]
413
+ }).models;
414
+ const QWEN_MODEL_CATALOG = buildManifestModelProviderConfig({
415
+ providerId: "qwen",
416
+ catalog: {
417
+ ...modelCatalog.providers.qwen,
418
+ baseUrl: QWEN_BASE_URL
419
+ }
420
+ }).models;
421
+ function isQwenCodingPlanBaseUrl(baseUrl) {
422
+ const trimmed = baseUrl?.trim();
423
+ if (!trimmed) return false;
424
+ try {
425
+ const hostname = new URL(trimmed).hostname.toLowerCase().replace(/\.+$/, "");
426
+ return hostname === "coding.dashscope.aliyuncs.com" || hostname === "coding-intl.dashscope.aliyuncs.com";
427
+ } catch {
428
+ return false;
429
+ }
430
+ }
431
+ function isQwen36PlusSupportedBaseUrl(_baseUrl) {
432
+ return true;
433
+ }
434
+ const QWEN_STANDARD_ONLY_MODEL_IDS = /* @__PURE__ */ new Set([
435
+ QWEN_36_FLASH_MODEL_ID,
436
+ QWEN_37_MAX_MODEL_ID,
437
+ ...QWEN_38_MODEL_IDS
438
+ ]);
439
+ function isQwenStandardOnlyModelId(modelId) {
440
+ return QWEN_STANDARD_ONLY_MODEL_IDS.has(modelId);
441
+ }
442
+ function buildQwenModelCatalogForBaseUrl(baseUrl) {
443
+ return isQwenCodingPlanBaseUrl(baseUrl) ? QWEN_MODEL_CATALOG.filter((model) => !isQwenStandardOnlyModelId(model.id)) : QWEN_MODEL_CATALOG;
444
+ }
445
+ function isNativeQwenBaseUrl(baseUrl) {
446
+ return supportsNativeStreamingUsageCompat({
447
+ providerId: "qwen",
448
+ baseUrl
449
+ });
450
+ }
451
+ function applyQwenNativeStreamingUsageCompat(provider) {
452
+ return applyProviderNativeStreamingUsageCompat({
453
+ providerId: "qwen",
454
+ providerConfig: provider
455
+ });
456
+ }
457
+ function buildQwenModelDefinition(params) {
458
+ const catalog = QWEN_MODEL_CATALOG.find((model) => model.id === params.id);
459
+ return {
460
+ id: params.id,
461
+ name: params.name ?? catalog?.name ?? params.id,
462
+ reasoning: params.reasoning ?? catalog?.reasoning ?? false,
463
+ input: params.input ?? (catalog?.input ? [...catalog.input] : ["text"]),
464
+ cost: params.cost ?? catalog?.cost ?? QWEN_DEFAULT_COST,
465
+ contextWindow: params.contextWindow ?? catalog?.contextWindow ?? 262144,
466
+ maxTokens: params.maxTokens ?? catalog?.maxTokens ?? 65536
467
+ };
468
+ }
469
+ function buildQwenDefaultModelDefinition() {
470
+ return buildQwenModelDefinition({ id: QWEN_DEFAULT_MODEL_ID });
471
+ }
472
+ /** @deprecated Use QWEN_BASE_URL. */
473
+ const MODELSTUDIO_BASE_URL = QWEN_BASE_URL;
474
+ /** @deprecated Use QWEN_GLOBAL_BASE_URL. */
475
+ const MODELSTUDIO_GLOBAL_BASE_URL = QWEN_GLOBAL_BASE_URL;
476
+ /** @deprecated Use QWEN_CN_BASE_URL. */
477
+ const MODELSTUDIO_CN_BASE_URL = QWEN_CN_BASE_URL;
478
+ /** @deprecated Use QWEN_STANDARD_CN_BASE_URL. */
479
+ const MODELSTUDIO_STANDARD_CN_BASE_URL = QWEN_STANDARD_CN_BASE_URL;
480
+ /** @deprecated Use QWEN_STANDARD_GLOBAL_BASE_URL. */
481
+ const MODELSTUDIO_STANDARD_GLOBAL_BASE_URL = QWEN_STANDARD_GLOBAL_BASE_URL;
482
+ /** @deprecated Use QWEN_DEFAULT_MODEL_ID. */
483
+ const MODELSTUDIO_DEFAULT_MODEL_ID = QWEN_DEFAULT_MODEL_ID;
484
+ /** @deprecated Use QWEN_DEFAULT_COST. */
485
+ const MODELSTUDIO_DEFAULT_COST = QWEN_DEFAULT_COST;
486
+ /** @deprecated Use qwen/${QWEN_DEFAULT_MODEL_ID}. */
487
+ const MODELSTUDIO_DEFAULT_MODEL_REF = `modelstudio/${QWEN_DEFAULT_MODEL_ID}`;
488
+ /** @deprecated Use QWEN_MODEL_CATALOG. */
489
+ const MODELSTUDIO_MODEL_CATALOG = QWEN_MODEL_CATALOG;
490
+ const isNativeModelStudioBaseUrl = isNativeQwenBaseUrl;
491
+ const applyModelStudioNativeStreamingUsageCompat = applyQwenNativeStreamingUsageCompat;
492
+ const buildModelStudioModelDefinition = buildQwenModelDefinition;
493
+ const buildModelStudioDefaultModelDefinition = buildQwenDefaultModelDefinition;
494
+ //#endregion
495
+ export { applyModelStudioNativeStreamingUsageCompat as A, isQwen38ModelId as B, QWEN_TOKEN_PLAN_CN_BASE_URL as C, QWEN_TOKEN_PLAN_LEGACY_PROVIDER_ID as D, QWEN_TOKEN_PLAN_GLOBAL_BASE_URL as E, buildQwenModelCatalogForBaseUrl as F, isQwenTokenPlanKimiModelId as G, isQwenStandardOnlyModelId as H, buildQwenModelDefinition as I, supportsQwenTokenPlanGlmMaxThinking as J, isQwenTokenPlanThinkingOnlyModelId as K, isNativeModelStudioBaseUrl as L, buildModelStudioDefaultModelDefinition as M, buildModelStudioModelDefinition as N, QWEN_TOKEN_PLAN_MODEL_CATALOG as O, buildQwenDefaultModelDefinition as P, isNativeQwenBaseUrl as R, QWEN_STANDARD_GLOBAL_BASE_URL as S, QWEN_TOKEN_PLAN_DEFAULT_MODEL_REF as T, isQwenTokenPlanDeepSeekV4ModelId as U, isQwenCodingPlanBaseUrl as V, isQwenTokenPlanGlmModelId as W, QWEN_DEFAULT_MODEL_ID as _, MODELSTUDIO_DEFAULT_MODEL_REF as a, QWEN_MODEL_CATALOG as b, MODELSTUDIO_STANDARD_CN_BASE_URL as c, QWEN_36_PLUS_MODEL_ID as d, QWEN_37_MAX_MODEL_ID as f, QWEN_DEFAULT_COST as g, QWEN_CN_BASE_URL as h, MODELSTUDIO_DEFAULT_MODEL_ID as i, applyQwenNativeStreamingUsageCompat as j, QWEN_TOKEN_PLAN_PROVIDER_ID as k, MODELSTUDIO_STANDARD_GLOBAL_BASE_URL as l, QWEN_BASE_URL as m, MODELSTUDIO_CN_BASE_URL as n, MODELSTUDIO_GLOBAL_BASE_URL as o, QWEN_37_PLUS_MODEL_ID as p, resolveQwenTokenPlanBaseUrl as q, MODELSTUDIO_DEFAULT_COST as r, MODELSTUDIO_MODEL_CATALOG as s, MODELSTUDIO_BASE_URL as t, QWEN_36_FLASH_MODEL_ID as u, QWEN_DEFAULT_MODEL_REF as v, QWEN_TOKEN_PLAN_DEFAULT_MODEL_ID as w, QWEN_STANDARD_CN_BASE_URL as x, QWEN_GLOBAL_BASE_URL as y, isQwen36PlusSupportedBaseUrl as z };