qwenproxy-cli 1.6.7 → 1.6.9
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/clean-cache.js +7 -4
- package/dist/delete-chats.js +15 -13
- package/dist/index.js +16 -14
- package/dist/login.js +7 -7
- package/dist/reset-cooldowns.js +7 -4
- package/dist/sync-clients.js +1 -1
- package/package.json +1 -1
- package/src/core/config.ts +1 -1
- package/src/core/version.ts +1 -1
- package/src/services/auth-playwright.ts +1 -1
- package/src/services/playwright.ts +6 -6
- package/src/services/qwen.ts +14 -6
package/dist/clean-cache.js
CHANGED
|
@@ -997,7 +997,7 @@ var init_config = __esm({
|
|
|
997
997
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
998
998
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
999
999
|
// Override via env when Qwen ships a new bundle.
|
|
1000
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
1000
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
1001
1001
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
1002
1002
|
// (chats/new, settings): those work without them (live-probed). The
|
|
1003
1003
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -2726,6 +2726,9 @@ function updateQwenWebVersion(version) {
|
|
|
2726
2726
|
dynamicWebVersion = version.trim();
|
|
2727
2727
|
}
|
|
2728
2728
|
}
|
|
2729
|
+
function getQwenWebVersion() {
|
|
2730
|
+
return dynamicWebVersion || config.qwen.webVersion;
|
|
2731
|
+
}
|
|
2729
2732
|
var dynamicWebVersion, QWEN_WEB_VERSION, DEFAULT_QWEN_USER_AGENT, QWEN_TIMEZONE_HEADER;
|
|
2730
2733
|
var init_qwen_headers = __esm({
|
|
2731
2734
|
"src/services/qwen-headers.ts"() {
|
|
@@ -4097,7 +4100,7 @@ async function loginViaApi(page, email, password) {
|
|
|
4097
4100
|
accept: "application/json, text/plain, */*",
|
|
4098
4101
|
"content-type": "application/json",
|
|
4099
4102
|
source: "web",
|
|
4100
|
-
version: "0.3.
|
|
4103
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4101
4104
|
"x-request-origin": "https://chat.qwen.ai",
|
|
4102
4105
|
timezone: tz,
|
|
4103
4106
|
"x-request-id": requestId2
|
|
@@ -4129,7 +4132,7 @@ async function loginViaApi(page, email, password) {
|
|
|
4129
4132
|
accept: "application/json, text/plain, */*",
|
|
4130
4133
|
"content-type": "application/json",
|
|
4131
4134
|
source: "web",
|
|
4132
|
-
version: "0.3.
|
|
4135
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4133
4136
|
timezone: tz,
|
|
4134
4137
|
"x-request-id": requestId2
|
|
4135
4138
|
},
|
|
@@ -4481,7 +4484,7 @@ async function refreshAccountToken(accountId) {
|
|
|
4481
4484
|
headers: {
|
|
4482
4485
|
accept: "application/json, text/plain, */*",
|
|
4483
4486
|
source: "web",
|
|
4484
|
-
version: "0.3.
|
|
4487
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4485
4488
|
"x-request-origin": "https://chat.qwen.ai",
|
|
4486
4489
|
timezone: tz,
|
|
4487
4490
|
authorization: `Bearer ${rTok}`
|
package/dist/delete-chats.js
CHANGED
|
@@ -1093,7 +1093,7 @@ var init_config = __esm({
|
|
|
1093
1093
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
1094
1094
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
1095
1095
|
// Override via env when Qwen ships a new bundle.
|
|
1096
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
1096
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
1097
1097
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
1098
1098
|
// (chats/new, settings): those work without them (live-probed). The
|
|
1099
1099
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -4978,7 +4978,7 @@ async function startEmailOtpLogin(email, options = {}) {
|
|
|
4978
4978
|
{
|
|
4979
4979
|
email: normalizedEmail,
|
|
4980
4980
|
requestId,
|
|
4981
|
-
version: getQwenWebVersion() || "0.3.
|
|
4981
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4982
4982
|
timezone: formatAsciiTimezone()
|
|
4983
4983
|
}
|
|
4984
4984
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -5073,7 +5073,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
5073
5073
|
email: session.email,
|
|
5074
5074
|
code: cleanCode,
|
|
5075
5075
|
requestId,
|
|
5076
|
-
version: getQwenWebVersion() || "0.3.
|
|
5076
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5077
5077
|
timezone: formatAsciiTimezone()
|
|
5078
5078
|
}
|
|
5079
5079
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -5121,7 +5121,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
5121
5121
|
cookie: `token=${accessToken}`,
|
|
5122
5122
|
userAgent: session.fingerprint.userAgent,
|
|
5123
5123
|
bxV: "2.5.37",
|
|
5124
|
-
version: getQwenWebVersion() || "0.3.
|
|
5124
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5125
5125
|
userId: userId || void 0,
|
|
5126
5126
|
tokenExpiresAt: exp || void 0,
|
|
5127
5127
|
refreshToken: refreshToken || void 0,
|
|
@@ -5365,7 +5365,7 @@ async function loginViaApi(page, email, password) {
|
|
|
5365
5365
|
accept: "application/json, text/plain, */*",
|
|
5366
5366
|
"content-type": "application/json",
|
|
5367
5367
|
source: "web",
|
|
5368
|
-
version: "0.3.
|
|
5368
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5369
5369
|
"x-request-origin": "https://chat.qwen.ai",
|
|
5370
5370
|
timezone: tz,
|
|
5371
5371
|
"x-request-id": requestId2
|
|
@@ -5397,7 +5397,7 @@ async function loginViaApi(page, email, password) {
|
|
|
5397
5397
|
accept: "application/json, text/plain, */*",
|
|
5398
5398
|
"content-type": "application/json",
|
|
5399
5399
|
source: "web",
|
|
5400
|
-
version: "0.3.
|
|
5400
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5401
5401
|
timezone: tz,
|
|
5402
5402
|
"x-request-id": requestId2
|
|
5403
5403
|
},
|
|
@@ -5749,7 +5749,7 @@ async function refreshAccountToken(accountId) {
|
|
|
5749
5749
|
headers: {
|
|
5750
5750
|
accept: "application/json, text/plain, */*",
|
|
5751
5751
|
source: "web",
|
|
5752
|
-
version: "0.3.
|
|
5752
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5753
5753
|
"x-request-origin": "https://chat.qwen.ai",
|
|
5754
5754
|
timezone: tz,
|
|
5755
5755
|
authorization: `Bearer ${rTok}`
|
|
@@ -7233,7 +7233,7 @@ async function getBasicHeaders2(accountId) {
|
|
|
7233
7233
|
secChUa: "",
|
|
7234
7234
|
secChUaMobile: "?0",
|
|
7235
7235
|
secChUaPlatform: "",
|
|
7236
|
-
version: "0.
|
|
7236
|
+
version: "0.3.26"
|
|
7237
7237
|
};
|
|
7238
7238
|
}
|
|
7239
7239
|
const resolvedAccountId = accountId ?? loadAccounts()[0]?.id;
|
|
@@ -9256,7 +9256,6 @@ async function requestQwenPersonalizationInBrowser(accountId, method, path6, hea
|
|
|
9256
9256
|
headers,
|
|
9257
9257
|
payload === void 0 ? void 0 : JSON.stringify(payload),
|
|
9258
9258
|
{
|
|
9259
|
-
settingsPage: true,
|
|
9260
9259
|
referrer: qwenUrl("/settings/personalization"),
|
|
9261
9260
|
noMutexRecovery: true
|
|
9262
9261
|
}
|
|
@@ -9364,9 +9363,13 @@ async function createQwenBrowserResponse(accountId, url, method, headers, body,
|
|
|
9364
9363
|
if (typeof page.on === "function") {
|
|
9365
9364
|
const onFrameNavigated = (frame) => {
|
|
9366
9365
|
if (!settled && typeof page.mainFrame === "function" && frame === page.mainFrame()) {
|
|
9366
|
+
const url2 = typeof frame.url === "function" ? frame.url() : String(frame.url || "");
|
|
9367
|
+
if (url2.startsWith(qwenOrigin()) && !url2.includes("/auth") && !url2.includes("_____tmd_____") && !url2.includes("/punish")) {
|
|
9368
|
+
return;
|
|
9369
|
+
}
|
|
9367
9370
|
handleBrowserStreamEvent(requestId, {
|
|
9368
9371
|
type: "error",
|
|
9369
|
-
message: "Qwen browser page navigated during stream
|
|
9372
|
+
message: "Qwen browser page navigated away during stream",
|
|
9370
9373
|
errorName: "AbortError"
|
|
9371
9374
|
});
|
|
9372
9375
|
}
|
|
@@ -9917,7 +9920,6 @@ async function disableNativeTools(accountId) {
|
|
|
9917
9920
|
requestHeaders,
|
|
9918
9921
|
JSON.stringify(payload),
|
|
9919
9922
|
{
|
|
9920
|
-
settingsPage: true,
|
|
9921
9923
|
referrer: qwenUrl("/settings/personalization")
|
|
9922
9924
|
}
|
|
9923
9925
|
);
|
|
@@ -10100,7 +10102,7 @@ async function deleteSingleQwenChat(accountId, chatId) {
|
|
|
10100
10102
|
}
|
|
10101
10103
|
const requestHeaders = {
|
|
10102
10104
|
source: "web",
|
|
10103
|
-
version: "0.
|
|
10105
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
10104
10106
|
timezone: formatAsciiTimezone(),
|
|
10105
10107
|
"x-request-id": crypto5.randomUUID(),
|
|
10106
10108
|
Referer: qwenUrl(`/c/${encodeURIComponent(chatId)}`)
|
|
@@ -10144,7 +10146,7 @@ async function fetchRemoteQwenChats(accountId) {
|
|
|
10144
10146
|
return [];
|
|
10145
10147
|
}
|
|
10146
10148
|
const requestHeaders = {
|
|
10147
|
-
version: "0.
|
|
10149
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
10148
10150
|
timezone: formatAsciiTimezone(),
|
|
10149
10151
|
"x-request-id": crypto5.randomUUID(),
|
|
10150
10152
|
Referer: qwenUrl("/settings/chats")
|
package/dist/index.js
CHANGED
|
@@ -266,7 +266,7 @@ var init_config = __esm({
|
|
|
266
266
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
267
267
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
268
268
|
// Override via env when Qwen ships a new bundle.
|
|
269
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
269
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
270
270
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
271
271
|
// (chats/new, settings): those work without them (live-probed). The
|
|
272
272
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -6088,7 +6088,7 @@ async function startEmailOtpLogin(email, options = {}) {
|
|
|
6088
6088
|
{
|
|
6089
6089
|
email: normalizedEmail,
|
|
6090
6090
|
requestId,
|
|
6091
|
-
version: getQwenWebVersion() || "0.3.
|
|
6091
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6092
6092
|
timezone: formatAsciiTimezone()
|
|
6093
6093
|
}
|
|
6094
6094
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -6183,7 +6183,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
6183
6183
|
email: session.email,
|
|
6184
6184
|
code: cleanCode,
|
|
6185
6185
|
requestId,
|
|
6186
|
-
version: getQwenWebVersion() || "0.3.
|
|
6186
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6187
6187
|
timezone: formatAsciiTimezone()
|
|
6188
6188
|
}
|
|
6189
6189
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -6231,7 +6231,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
6231
6231
|
cookie: `token=${accessToken}`,
|
|
6232
6232
|
userAgent: session.fingerprint.userAgent,
|
|
6233
6233
|
bxV: "2.5.37",
|
|
6234
|
-
version: getQwenWebVersion() || "0.3.
|
|
6234
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6235
6235
|
userId: userId || void 0,
|
|
6236
6236
|
tokenExpiresAt: exp || void 0,
|
|
6237
6237
|
refreshToken: refreshToken || void 0,
|
|
@@ -6475,7 +6475,7 @@ async function loginViaApi(page, email, password) {
|
|
|
6475
6475
|
accept: "application/json, text/plain, */*",
|
|
6476
6476
|
"content-type": "application/json",
|
|
6477
6477
|
source: "web",
|
|
6478
|
-
version: "0.3.
|
|
6478
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6479
6479
|
"x-request-origin": "https://chat.qwen.ai",
|
|
6480
6480
|
timezone: tz,
|
|
6481
6481
|
"x-request-id": requestId2
|
|
@@ -6507,7 +6507,7 @@ async function loginViaApi(page, email, password) {
|
|
|
6507
6507
|
accept: "application/json, text/plain, */*",
|
|
6508
6508
|
"content-type": "application/json",
|
|
6509
6509
|
source: "web",
|
|
6510
|
-
version: "0.3.
|
|
6510
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6511
6511
|
timezone: tz,
|
|
6512
6512
|
"x-request-id": requestId2
|
|
6513
6513
|
},
|
|
@@ -6859,7 +6859,7 @@ async function refreshAccountToken(accountId) {
|
|
|
6859
6859
|
headers: {
|
|
6860
6860
|
accept: "application/json, text/plain, */*",
|
|
6861
6861
|
source: "web",
|
|
6862
|
-
version: "0.3.
|
|
6862
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
6863
6863
|
"x-request-origin": "https://chat.qwen.ai",
|
|
6864
6864
|
timezone: tz,
|
|
6865
6865
|
authorization: `Bearer ${rTok}`
|
|
@@ -8581,7 +8581,7 @@ async function getBasicHeaders2(accountId) {
|
|
|
8581
8581
|
secChUa: "",
|
|
8582
8582
|
secChUaMobile: "?0",
|
|
8583
8583
|
secChUaPlatform: "",
|
|
8584
|
-
version: "0.
|
|
8584
|
+
version: "0.3.26"
|
|
8585
8585
|
};
|
|
8586
8586
|
}
|
|
8587
8587
|
const resolvedAccountId = accountId ?? loadAccounts()[0]?.id;
|
|
@@ -12446,7 +12446,6 @@ async function requestQwenPersonalizationInBrowser(accountId, method, path21, he
|
|
|
12446
12446
|
headers,
|
|
12447
12447
|
payload === void 0 ? void 0 : JSON.stringify(payload),
|
|
12448
12448
|
{
|
|
12449
|
-
settingsPage: true,
|
|
12450
12449
|
referrer: qwenUrl("/settings/personalization"),
|
|
12451
12450
|
noMutexRecovery: true
|
|
12452
12451
|
}
|
|
@@ -12554,9 +12553,13 @@ async function createQwenBrowserResponse(accountId, url, method, headers, body,
|
|
|
12554
12553
|
if (typeof page.on === "function") {
|
|
12555
12554
|
const onFrameNavigated = (frame) => {
|
|
12556
12555
|
if (!settled && typeof page.mainFrame === "function" && frame === page.mainFrame()) {
|
|
12556
|
+
const url2 = typeof frame.url === "function" ? frame.url() : String(frame.url || "");
|
|
12557
|
+
if (url2.startsWith(qwenOrigin()) && !url2.includes("/auth") && !url2.includes("_____tmd_____") && !url2.includes("/punish")) {
|
|
12558
|
+
return;
|
|
12559
|
+
}
|
|
12557
12560
|
handleBrowserStreamEvent(requestId, {
|
|
12558
12561
|
type: "error",
|
|
12559
|
-
message: "Qwen browser page navigated during stream
|
|
12562
|
+
message: "Qwen browser page navigated away during stream",
|
|
12560
12563
|
errorName: "AbortError"
|
|
12561
12564
|
});
|
|
12562
12565
|
}
|
|
@@ -13107,7 +13110,6 @@ async function disableNativeTools(accountId) {
|
|
|
13107
13110
|
requestHeaders,
|
|
13108
13111
|
JSON.stringify(payload),
|
|
13109
13112
|
{
|
|
13110
|
-
settingsPage: true,
|
|
13111
13113
|
referrer: qwenUrl("/settings/personalization")
|
|
13112
13114
|
}
|
|
13113
13115
|
);
|
|
@@ -13290,7 +13292,7 @@ async function deleteSingleQwenChat(accountId, chatId) {
|
|
|
13290
13292
|
}
|
|
13291
13293
|
const requestHeaders = {
|
|
13292
13294
|
source: "web",
|
|
13293
|
-
version: "0.
|
|
13295
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
13294
13296
|
timezone: formatAsciiTimezone(),
|
|
13295
13297
|
"x-request-id": crypto7.randomUUID(),
|
|
13296
13298
|
Referer: qwenUrl(`/c/${encodeURIComponent(chatId)}`)
|
|
@@ -13334,7 +13336,7 @@ async function fetchRemoteQwenChats(accountId) {
|
|
|
13334
13336
|
return [];
|
|
13335
13337
|
}
|
|
13336
13338
|
const requestHeaders = {
|
|
13337
|
-
version: "0.
|
|
13339
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
13338
13340
|
timezone: formatAsciiTimezone(),
|
|
13339
13341
|
"x-request-id": crypto7.randomUUID(),
|
|
13340
13342
|
Referer: qwenUrl("/settings/chats")
|
|
@@ -27093,7 +27095,7 @@ function getAppVersion() {
|
|
|
27093
27095
|
}
|
|
27094
27096
|
} catch {
|
|
27095
27097
|
}
|
|
27096
|
-
cachedVersion = "v1.6.
|
|
27098
|
+
cachedVersion = "v1.6.9";
|
|
27097
27099
|
return cachedVersion;
|
|
27098
27100
|
}
|
|
27099
27101
|
var cachedVersion;
|
package/dist/login.js
CHANGED
|
@@ -1228,7 +1228,7 @@ var init_config = __esm({
|
|
|
1228
1228
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
1229
1229
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
1230
1230
|
// Override via env when Qwen ships a new bundle.
|
|
1231
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
1231
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
1232
1232
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
1233
1233
|
// (chats/new, settings): those work without them (live-probed). The
|
|
1234
1234
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -4951,7 +4951,7 @@ async function startEmailOtpLogin(email, options = {}) {
|
|
|
4951
4951
|
{
|
|
4952
4952
|
email: normalizedEmail,
|
|
4953
4953
|
requestId,
|
|
4954
|
-
version: getQwenWebVersion() || "0.3.
|
|
4954
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4955
4955
|
timezone: formatAsciiTimezone()
|
|
4956
4956
|
}
|
|
4957
4957
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -5046,7 +5046,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
5046
5046
|
email: session.email,
|
|
5047
5047
|
code: cleanCode,
|
|
5048
5048
|
requestId,
|
|
5049
|
-
version: getQwenWebVersion() || "0.3.
|
|
5049
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5050
5050
|
timezone: formatAsciiTimezone()
|
|
5051
5051
|
}
|
|
5052
5052
|
).catch((err) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -5094,7 +5094,7 @@ async function verifyEmailOtpLogin(sessionId, code) {
|
|
|
5094
5094
|
cookie: `token=${accessToken}`,
|
|
5095
5095
|
userAgent: session.fingerprint.userAgent,
|
|
5096
5096
|
bxV: "2.5.37",
|
|
5097
|
-
version: getQwenWebVersion() || "0.3.
|
|
5097
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5098
5098
|
userId: userId || void 0,
|
|
5099
5099
|
tokenExpiresAt: exp || void 0,
|
|
5100
5100
|
refreshToken: refreshToken || void 0,
|
|
@@ -5338,7 +5338,7 @@ async function loginViaApi(page, email, password) {
|
|
|
5338
5338
|
accept: "application/json, text/plain, */*",
|
|
5339
5339
|
"content-type": "application/json",
|
|
5340
5340
|
source: "web",
|
|
5341
|
-
version: "0.3.
|
|
5341
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5342
5342
|
"x-request-origin": "https://chat.qwen.ai",
|
|
5343
5343
|
timezone: tz,
|
|
5344
5344
|
"x-request-id": requestId2
|
|
@@ -5370,7 +5370,7 @@ async function loginViaApi(page, email, password) {
|
|
|
5370
5370
|
accept: "application/json, text/plain, */*",
|
|
5371
5371
|
"content-type": "application/json",
|
|
5372
5372
|
source: "web",
|
|
5373
|
-
version: "0.3.
|
|
5373
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5374
5374
|
timezone: tz,
|
|
5375
5375
|
"x-request-id": requestId2
|
|
5376
5376
|
},
|
|
@@ -5722,7 +5722,7 @@ async function refreshAccountToken(accountId) {
|
|
|
5722
5722
|
headers: {
|
|
5723
5723
|
accept: "application/json, text/plain, */*",
|
|
5724
5724
|
source: "web",
|
|
5725
|
-
version: "0.3.
|
|
5725
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
5726
5726
|
"x-request-origin": "https://chat.qwen.ai",
|
|
5727
5727
|
timezone: tz,
|
|
5728
5728
|
authorization: `Bearer ${rTok}`
|
package/dist/reset-cooldowns.js
CHANGED
|
@@ -1334,7 +1334,7 @@ var init_config = __esm({
|
|
|
1334
1334
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
1335
1335
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
1336
1336
|
// Override via env when Qwen ships a new bundle.
|
|
1337
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
1337
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
1338
1338
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
1339
1339
|
// (chats/new, settings): those work without them (live-probed). The
|
|
1340
1340
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
|
@@ -2768,6 +2768,9 @@ function updateQwenWebVersion(version) {
|
|
|
2768
2768
|
dynamicWebVersion = version.trim();
|
|
2769
2769
|
}
|
|
2770
2770
|
}
|
|
2771
|
+
function getQwenWebVersion() {
|
|
2772
|
+
return dynamicWebVersion || config.qwen.webVersion;
|
|
2773
|
+
}
|
|
2771
2774
|
var dynamicWebVersion, QWEN_WEB_VERSION, DEFAULT_QWEN_USER_AGENT, QWEN_TIMEZONE_HEADER;
|
|
2772
2775
|
var init_qwen_headers = __esm({
|
|
2773
2776
|
"src/services/qwen-headers.ts"() {
|
|
@@ -4363,7 +4366,7 @@ async function loginViaApi(page, email, password) {
|
|
|
4363
4366
|
accept: "application/json, text/plain, */*",
|
|
4364
4367
|
"content-type": "application/json",
|
|
4365
4368
|
source: "web",
|
|
4366
|
-
version: "0.3.
|
|
4369
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4367
4370
|
"x-request-origin": "https://chat.qwen.ai",
|
|
4368
4371
|
timezone: tz,
|
|
4369
4372
|
"x-request-id": requestId2
|
|
@@ -4395,7 +4398,7 @@ async function loginViaApi(page, email, password) {
|
|
|
4395
4398
|
accept: "application/json, text/plain, */*",
|
|
4396
4399
|
"content-type": "application/json",
|
|
4397
4400
|
source: "web",
|
|
4398
|
-
version: "0.3.
|
|
4401
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4399
4402
|
timezone: tz,
|
|
4400
4403
|
"x-request-id": requestId2
|
|
4401
4404
|
},
|
|
@@ -4747,7 +4750,7 @@ async function refreshAccountToken(accountId) {
|
|
|
4747
4750
|
headers: {
|
|
4748
4751
|
accept: "application/json, text/plain, */*",
|
|
4749
4752
|
source: "web",
|
|
4750
|
-
version: "0.3.
|
|
4753
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
4751
4754
|
"x-request-origin": "https://chat.qwen.ai",
|
|
4752
4755
|
timezone: tz,
|
|
4753
4756
|
authorization: `Bearer ${rTok}`
|
package/dist/sync-clients.js
CHANGED
|
@@ -119,7 +119,7 @@ var envSchema = z.object({
|
|
|
119
119
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
120
120
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
121
121
|
// Override via env when Qwen ships a new bundle.
|
|
122
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
122
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
123
123
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
124
124
|
// (chats/new, settings): those work without them (live-probed). The
|
|
125
125
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qwenproxy-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9",
|
|
4
4
|
"description": "High-performance OpenAI & Anthropic compatible API gateway for Qwen with multi-account rotation, interactive TUI, and resilient tool calling.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"bin": {
|
package/src/core/config.ts
CHANGED
|
@@ -34,7 +34,7 @@ const envSchema = z
|
|
|
34
34
|
// Version header on Qwen API requests = the deployed web bundle version
|
|
35
35
|
// (fallback when dynamic DOM detection is not yet completed).
|
|
36
36
|
// Override via env when Qwen ships a new bundle.
|
|
37
|
-
QWEN_WEB_VERSION: z.string().default("0.
|
|
37
|
+
QWEN_WEB_VERSION: z.string().default("0.3.26"),
|
|
38
38
|
// Controls bx-ua/bx-umidtoken injection on the GENERAL API paths
|
|
39
39
|
// (chats/new, settings): those work without them (live-probed). The
|
|
40
40
|
// completions path is the exception — the 0.2.86 HAR shows the real
|
package/src/core/version.ts
CHANGED
|
@@ -2193,7 +2193,7 @@ export async function startEmailOtpLogin(
|
|
|
2193
2193
|
{
|
|
2194
2194
|
email: normalizedEmail,
|
|
2195
2195
|
requestId,
|
|
2196
|
-
version: getQwenWebVersion() || "0.3.
|
|
2196
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2197
2197
|
timezone: formatAsciiTimezone(),
|
|
2198
2198
|
},
|
|
2199
2199
|
).catch((err: any) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -2305,7 +2305,7 @@ export async function verifyEmailOtpLogin(
|
|
|
2305
2305
|
email: session.email,
|
|
2306
2306
|
code: cleanCode,
|
|
2307
2307
|
requestId,
|
|
2308
|
-
version: getQwenWebVersion() || "0.3.
|
|
2308
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2309
2309
|
timezone: formatAsciiTimezone(),
|
|
2310
2310
|
},
|
|
2311
2311
|
).catch((err: any) => ({ ok: false, error: err?.message || String(err) }));
|
|
@@ -2363,7 +2363,7 @@ export async function verifyEmailOtpLogin(
|
|
|
2363
2363
|
cookie: `token=${accessToken}`,
|
|
2364
2364
|
userAgent: session.fingerprint.userAgent,
|
|
2365
2365
|
bxV: "2.5.37",
|
|
2366
|
-
version: getQwenWebVersion() || "0.3.
|
|
2366
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2367
2367
|
userId: userId || undefined,
|
|
2368
2368
|
tokenExpiresAt: exp || undefined,
|
|
2369
2369
|
refreshToken: refreshToken || undefined,
|
|
@@ -2670,7 +2670,7 @@ async function loginViaApi(
|
|
|
2670
2670
|
accept: "application/json, text/plain, */*",
|
|
2671
2671
|
"content-type": "application/json",
|
|
2672
2672
|
source: "web",
|
|
2673
|
-
version: "0.3.
|
|
2673
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2674
2674
|
"x-request-origin": "https://chat.qwen.ai",
|
|
2675
2675
|
timezone: tz,
|
|
2676
2676
|
"x-request-id": requestId,
|
|
@@ -2711,7 +2711,7 @@ async function loginViaApi(
|
|
|
2711
2711
|
accept: "application/json, text/plain, */*",
|
|
2712
2712
|
"content-type": "application/json",
|
|
2713
2713
|
source: "web",
|
|
2714
|
-
version: "0.3.
|
|
2714
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2715
2715
|
timezone: tz,
|
|
2716
2716
|
"x-request-id": requestId,
|
|
2717
2717
|
},
|
|
@@ -3153,7 +3153,7 @@ export async function refreshAccountToken(
|
|
|
3153
3153
|
headers: {
|
|
3154
3154
|
accept: "application/json, text/plain, */*",
|
|
3155
3155
|
source: "web",
|
|
3156
|
-
version: "0.3.
|
|
3156
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
3157
3157
|
"x-request-origin": "https://chat.qwen.ai",
|
|
3158
3158
|
timezone: tz,
|
|
3159
3159
|
authorization: `Bearer ${rTok}`,
|
package/src/services/qwen.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
UpstreamRateLimit,
|
|
11
11
|
ClientAbortedError,
|
|
12
12
|
} from "../core/errors.ts";
|
|
13
|
-
import { buildQwenRequestHeaders } from "./qwen-headers.ts";
|
|
13
|
+
import { buildQwenRequestHeaders, getQwenWebVersion } from "./qwen-headers.ts";
|
|
14
14
|
import { qwenOrigin, qwenUrl } from "./qwen-url.ts";
|
|
15
15
|
import { config, type ChatMode, isLocalChatMode } from "../core/config.ts";
|
|
16
16
|
import { logger } from "../core/logger.ts";
|
|
@@ -1225,7 +1225,6 @@ async function requestQwenPersonalizationInBrowser(
|
|
|
1225
1225
|
headers,
|
|
1226
1226
|
payload === undefined ? undefined : JSON.stringify(payload),
|
|
1227
1227
|
{
|
|
1228
|
-
settingsPage: true,
|
|
1229
1228
|
referrer: qwenUrl("/settings/personalization"),
|
|
1230
1229
|
noMutexRecovery: true,
|
|
1231
1230
|
},
|
|
@@ -1366,9 +1365,19 @@ async function createQwenBrowserResponse(
|
|
|
1366
1365
|
if (typeof (page as any).on === "function") {
|
|
1367
1366
|
const onFrameNavigated = (frame: any) => {
|
|
1368
1367
|
if (!settled && typeof (page as any).mainFrame === "function" && frame === (page as any).mainFrame()) {
|
|
1368
|
+
const url = typeof frame.url === "function" ? frame.url() : String(frame.url || "");
|
|
1369
|
+
// Safe SPA in-app routing within Qwen Web (e.g. /c/<id>, /#) must NEVER abort active streams
|
|
1370
|
+
if (
|
|
1371
|
+
url.startsWith(qwenOrigin()) &&
|
|
1372
|
+
!url.includes("/auth") &&
|
|
1373
|
+
!url.includes("_____tmd_____") &&
|
|
1374
|
+
!url.includes("/punish")
|
|
1375
|
+
) {
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1369
1378
|
handleBrowserStreamEvent(requestId, {
|
|
1370
1379
|
type: "error",
|
|
1371
|
-
message: "Qwen browser page navigated during stream
|
|
1380
|
+
message: "Qwen browser page navigated away during stream",
|
|
1372
1381
|
errorName: "AbortError",
|
|
1373
1382
|
});
|
|
1374
1383
|
}
|
|
@@ -2113,7 +2122,6 @@ export async function disableNativeTools(accountId?: string): Promise<void> {
|
|
|
2113
2122
|
requestHeaders,
|
|
2114
2123
|
JSON.stringify(payload),
|
|
2115
2124
|
{
|
|
2116
|
-
settingsPage: true,
|
|
2117
2125
|
referrer: qwenUrl("/settings/personalization"),
|
|
2118
2126
|
},
|
|
2119
2127
|
);
|
|
@@ -2361,7 +2369,7 @@ export async function deleteSingleQwenChat(
|
|
|
2361
2369
|
|
|
2362
2370
|
const requestHeaders: Record<string, string> = {
|
|
2363
2371
|
source: "web",
|
|
2364
|
-
version: "0.
|
|
2372
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2365
2373
|
timezone: formatAsciiTimezone(),
|
|
2366
2374
|
"x-request-id": crypto.randomUUID(),
|
|
2367
2375
|
Referer: qwenUrl(`/c/${encodeURIComponent(chatId)}`),
|
|
@@ -2414,7 +2422,7 @@ export async function fetchRemoteQwenChats(
|
|
|
2414
2422
|
}
|
|
2415
2423
|
|
|
2416
2424
|
const requestHeaders: Record<string, string> = {
|
|
2417
|
-
version: "0.
|
|
2425
|
+
version: getQwenWebVersion() || "0.3.26",
|
|
2418
2426
|
timezone: formatAsciiTimezone(),
|
|
2419
2427
|
"x-request-id": crypto.randomUUID(),
|
|
2420
2428
|
Referer: qwenUrl("/settings/chats"),
|