qwenproxy-cli 1.3.5 → 1.3.6
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/package.json +1 -1
- package/src/services/playwright.ts +10 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qwenproxy-cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
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": {
|
|
@@ -2490,7 +2490,7 @@ export async function captureQwenHeaders(
|
|
|
2490
2490
|
// picking a sibling textarea/contenteditable), then fall back to generic.
|
|
2491
2491
|
// Mirrors upstream 5b3fd3e (robust account header capture).
|
|
2492
2492
|
const inputSelector =
|
|
2493
|
-
|
|
2493
|
+
"textarea.message-input-textarea, textarea[placeholder*='Ask' i], textarea[placeholder*='Pergunte' i], textarea";
|
|
2494
2494
|
// Bound the appearance wait: a page that never renders the chat input is
|
|
2495
2495
|
// blocked (WAF interstitial, punish document, or failed SPA hydration).
|
|
2496
2496
|
// Unbounded, page.focus would burn its 60s default timeout on every
|
|
@@ -2525,26 +2525,17 @@ export async function captureQwenHeaders(
|
|
|
2525
2525
|
if (settled || page.isClosed()) return;
|
|
2526
2526
|
try {
|
|
2527
2527
|
if (typeof (inputLocator as any).focus === "function") {
|
|
2528
|
-
await (inputLocator as any).focus({ timeout: inputActionTimeoutMs });
|
|
2528
|
+
await (inputLocator as any).focus({ timeout: inputActionTimeoutMs }).catch(() => {});
|
|
2529
2529
|
} else {
|
|
2530
|
-
await page.focus(inputSelector, { timeout: inputActionTimeoutMs });
|
|
2530
|
+
await page.focus(inputSelector, { timeout: inputActionTimeoutMs }).catch(() => {});
|
|
2531
2531
|
}
|
|
2532
2532
|
if (settled || page.isClosed()) return;
|
|
2533
2533
|
if (typeof (inputLocator as any).fill === "function") {
|
|
2534
|
-
await (inputLocator as any).fill("a", { timeout: inputActionTimeoutMs });
|
|
2534
|
+
await (inputLocator as any).fill("a", { timeout: inputActionTimeoutMs }).catch(() => {});
|
|
2535
2535
|
} else {
|
|
2536
|
-
await page.fill(inputSelector, "a", { timeout: inputActionTimeoutMs });
|
|
2537
|
-
}
|
|
2538
|
-
// Dispatch native React input events and keyboard stroke to guarantee React updates state
|
|
2539
|
-
if (typeof page.keyboard?.press === "function") {
|
|
2540
|
-
await page.keyboard.press("End").catch(() => {});
|
|
2541
|
-
}
|
|
2542
|
-
if (typeof (page.keyboard as any)?.type === "function") {
|
|
2543
|
-
await (page.keyboard as any).type(" ").catch(() => {});
|
|
2544
|
-
}
|
|
2545
|
-
if (typeof page.keyboard?.press === "function") {
|
|
2546
|
-
await page.keyboard.press("Backspace").catch(() => {});
|
|
2536
|
+
await page.fill(inputSelector, "a", { timeout: inputActionTimeoutMs }).catch(() => {});
|
|
2547
2537
|
}
|
|
2538
|
+
|
|
2548
2539
|
if (typeof page.evaluate === "function") {
|
|
2549
2540
|
await page.evaluate((sel) => {
|
|
2550
2541
|
const el = document.querySelector(sel) as HTMLTextAreaElement | null;
|
|
@@ -2591,17 +2582,18 @@ export async function captureQwenHeaders(
|
|
|
2591
2582
|
try {
|
|
2592
2583
|
await page.waitForFunction(() => {
|
|
2593
2584
|
const btn = document.querySelector(
|
|
2594
|
-
".message-input-right-button-send .send-button, .chat-prompt-send-button, button.send-button, button[aria-label*='Send' i], button[aria-label*='Enviar' i], .send-button-container button"
|
|
2585
|
+
".message-input-right-button-send .send-button, .message-input-right-button-send button, .chat-prompt-send-button, button.send-button, button[aria-label*='Send' i], button[aria-label*='Enviar' i], .send-button-container button"
|
|
2595
2586
|
) as HTMLButtonElement | null;
|
|
2596
2587
|
return btn && !btn.disabled && !btn.classList.contains("disabled") && btn.getAttribute("aria-disabled") !== "true";
|
|
2597
2588
|
}, { timeout: 3000 });
|
|
2598
2589
|
} catch {
|
|
2599
|
-
await sleep(
|
|
2590
|
+
await sleep(500);
|
|
2600
2591
|
}
|
|
2601
2592
|
if (settled || page.isClosed()) return;
|
|
2602
2593
|
|
|
2603
2594
|
const sendSelectors = [
|
|
2604
2595
|
".message-input-right-button-send .send-button",
|
|
2596
|
+
".message-input-right-button-send button",
|
|
2605
2597
|
".chat-prompt-send-button",
|
|
2606
2598
|
"button.send-button",
|
|
2607
2599
|
"button[aria-label*='Send' i]",
|
|
@@ -2624,16 +2616,7 @@ export async function captureQwenHeaders(
|
|
|
2624
2616
|
);
|
|
2625
2617
|
}, btn);
|
|
2626
2618
|
if (!isDisabled) {
|
|
2627
|
-
await
|
|
2628
|
-
const element = document.querySelector(sel) as HTMLElement;
|
|
2629
|
-
if (element) {
|
|
2630
|
-
element.focus();
|
|
2631
|
-
element.click();
|
|
2632
|
-
}
|
|
2633
|
-
}, selector);
|
|
2634
|
-
if (!settled && !page.isClosed()) {
|
|
2635
|
-
await btn.click({ force: true, delay: 50 }).catch(() => {});
|
|
2636
|
-
}
|
|
2619
|
+
await btn.click({ delay: 50 }).catch(() => {});
|
|
2637
2620
|
clicked = true;
|
|
2638
2621
|
break;
|
|
2639
2622
|
}
|