qwenproxy-cli 1.3.3 → 1.3.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwenproxy-cli",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
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": {
@@ -80,7 +80,7 @@ const envSchema = z
80
80
  CHAT_TIMEOUT: z.string().default("180000"),
81
81
  NAVIGATION_TIMEOUT: z.string().default("60000"),
82
82
  PAGE_TIMEOUT: z.string().default("60000"),
83
- HEADERS_TIMEOUT: z.string().default("90000"),
83
+ HEADERS_TIMEOUT: z.string().default("120000"),
84
84
  TIME_TO_FIRST_BYTE: z.string().default("60000"),
85
85
  IDLE_STREAM_TIMEOUT: z.string().default("60000"),
86
86
  // Deadline for the FIRST upstream chunk on thinking models (the reasoning
@@ -2529,6 +2529,16 @@ export async function captureQwenHeaders(
2529
2529
  await page.focus(inputSelector, { timeout: inputActionTimeoutMs });
2530
2530
  if (settled || page.isClosed()) return;
2531
2531
  await page.fill(inputSelector, "a", { timeout: inputActionTimeoutMs });
2532
+ // Dispatch native React input events and keyboard stroke to guarantee React updates state
2533
+ if (typeof page.keyboard?.press === "function") {
2534
+ await page.keyboard.press("End").catch(() => {});
2535
+ }
2536
+ if (typeof (page.keyboard as any)?.type === "function") {
2537
+ await (page.keyboard as any).type(" ").catch(() => {});
2538
+ }
2539
+ if (typeof page.keyboard?.press === "function") {
2540
+ await page.keyboard.press("Backspace").catch(() => {});
2541
+ }
2532
2542
  if (typeof page.evaluate === "function") {
2533
2543
  await page.evaluate((sel) => {
2534
2544
  const el = document.querySelector(sel) as HTMLTextAreaElement | null;
@@ -2570,7 +2580,18 @@ export async function captureQwenHeaders(
2570
2580
  return;
2571
2581
  }
2572
2582
  if (settled || page.isClosed()) return;
2573
- await sleep(2000);
2583
+
2584
+ // Wait up to 3s for React to enable the send button after typing
2585
+ try {
2586
+ await page.waitForFunction(() => {
2587
+ const btn = document.querySelector(
2588
+ ".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"
2589
+ ) as HTMLButtonElement | null;
2590
+ return btn && !btn.disabled && !btn.classList.contains("disabled") && btn.getAttribute("aria-disabled") !== "true";
2591
+ }, { timeout: 3000 });
2592
+ } catch {
2593
+ await sleep(1000);
2594
+ }
2574
2595
  if (settled || page.isClosed()) return;
2575
2596
 
2576
2597
  const sendSelectors = [