qwenproxy-cli 1.5.3 → 1.6.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/clean-cache.js +252 -26
- package/dist/delete-chats.js +206 -37
- package/dist/index.js +548 -74
- package/dist/login.js +144 -28
- package/dist/reset-cooldowns.js +252 -26
- package/dist/sync-clients.js +2 -2
- package/package.json +3 -3
- package/src/api/server.ts +1 -0
- package/src/clean-cache.ts +3 -0
- package/src/core/config.ts +2 -2
- package/src/core/daily-usage.ts +276 -0
- package/src/core/database.ts +27 -1
- package/src/core/process-guard.ts +77 -0
- package/src/core/version.ts +1 -1
- package/src/delete-chats.ts +3 -0
- package/src/index.ts +3 -29
- package/src/login.ts +2 -0
- package/src/routes/chat/account.ts +33 -5
- package/src/routes/chat/index.ts +1 -1
- package/src/routes/chat/retry-policy.ts +30 -0
- package/src/routes/chat/streaming.ts +72 -4
- package/src/services/captcha-coordinator.ts +12 -7
- package/src/services/chat-cleanup.ts +5 -0
- package/src/services/playwright.ts +82 -26
- package/src/services/qwen.ts +65 -9
- package/src/tui/proxy-client.ts +11 -1
- package/src/tui/types.ts +11 -0
- package/src/tui/views/accounts-view.ts +19 -2
- package/src/tui/views/status-view.ts +37 -4
|
@@ -846,12 +846,29 @@ export class StatusView implements TuiView {
|
|
|
846
846
|
const poolPct = accounts.length > 0 ? Math.round((availableCount / accounts.length) * 100) : 0;
|
|
847
847
|
const poolColor = poolPct >= 70 ? theme.green : poolPct >= 40 ? theme.yellow : theme.red;
|
|
848
848
|
const poolBar = renderProgressBar(poolPct, 8, poolColor);
|
|
849
|
+
const poolDailyUsage = data?.dailyUsage;
|
|
850
|
+
const poolUsagePct = poolDailyUsage?.poolUsagePercent ?? 0;
|
|
851
|
+
const poolUsageColor = poolUsagePct >= 80 ? theme.red : poolUsagePct >= 40 ? theme.yellow : theme.cyan;
|
|
852
|
+
const poolUsageBar = renderProgressBar(poolUsagePct, 8, poolUsageColor);
|
|
849
853
|
const innerRightW = Math.max(30, rightW - 2);
|
|
850
|
-
const
|
|
854
|
+
const showUsageCol = innerRightW >= 52;
|
|
855
|
+
const emailWidth = showUsageCol
|
|
856
|
+
? Math.max(14, Math.min(18, innerRightW - 33))
|
|
857
|
+
: Math.max(16, Math.min(20, innerRightW - 27));
|
|
858
|
+
|
|
851
859
|
const rightContent: string[] = [
|
|
852
860
|
` ${theme.bold("Disponibilidade:")} [${poolBar}] ${poolColor(`${availableCount}/${accounts.length} (${poolPct}%)`)}`,
|
|
861
|
+
...(poolDailyUsage
|
|
862
|
+
? [
|
|
863
|
+
` ${theme.bold("Cota Pool Hoje:")} [${poolUsageBar}] ${poolUsageColor(
|
|
864
|
+
`${poolUsagePct}%`,
|
|
865
|
+
)} ${theme.dim(
|
|
866
|
+
`(~${Math.round(poolDailyUsage.totalTokens / 1000)}k tok)`,
|
|
867
|
+
)}`,
|
|
868
|
+
]
|
|
869
|
+
: []),
|
|
853
870
|
` ${theme.dim("─".repeat(Math.max(32, innerRightW - 2)))}`,
|
|
854
|
-
` ${theme.dim(`# ${pad("Conta", emailWidth)} Carga Status`)}`,
|
|
871
|
+
` ${theme.dim(`# ${pad("Conta", emailWidth)} Carga ${showUsageCol ? "Uso% " : ""}Status`)}`,
|
|
855
872
|
` ${theme.dim("─".repeat(Math.max(32, innerRightW - 2)))}`,
|
|
856
873
|
];
|
|
857
874
|
|
|
@@ -864,7 +881,23 @@ export class StatusView implements TuiView {
|
|
|
864
881
|
const name = pad(truncate(acc.emailOrName, emailWidth - 1), emailWidth);
|
|
865
882
|
const active = acc.activeStreams || 0;
|
|
866
883
|
const limit = acc.streamLimit || 1;
|
|
867
|
-
const
|
|
884
|
+
const usagePct = acc.dailyUsagePercent ?? 0;
|
|
885
|
+
|
|
886
|
+
let loadBadge: string;
|
|
887
|
+
if (active > 0) {
|
|
888
|
+
loadBadge = theme.yellow(`[${active}/${limit}]`);
|
|
889
|
+
} else if (!showUsageCol && usagePct > 0) {
|
|
890
|
+
const pctColor = usagePct >= 80 ? theme.red : usagePct >= 40 ? theme.yellow : theme.cyan;
|
|
891
|
+
loadBadge = pctColor(pad(`[${usagePct}%]`, 5));
|
|
892
|
+
} else {
|
|
893
|
+
loadBadge = theme.dim(`[0/${limit}]`);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
const usageCol = showUsageCol
|
|
897
|
+
? (usagePct > 0
|
|
898
|
+
? (usagePct >= 80 ? theme.red(pad(`${usagePct}%`, 5)) : usagePct >= 40 ? theme.yellow(pad(`${usagePct}%`, 5)) : theme.cyan(pad(`${usagePct}%`, 5)))
|
|
899
|
+
: theme.dim(pad("0%", 5))) + " "
|
|
900
|
+
: "";
|
|
868
901
|
|
|
869
902
|
let status = theme.green(`${glyphs.bullet} Pronto`);
|
|
870
903
|
if (active > 0 && !acc.onCooldown && acc.headersReady) {
|
|
@@ -888,7 +921,7 @@ export class StatusView implements TuiView {
|
|
|
888
921
|
? theme.yellow(`◐ Aquecendo...`)
|
|
889
922
|
: theme.muted(`○ Standby`);
|
|
890
923
|
}
|
|
891
|
-
rightContent.push(` ${num}${name} ${loadBadge} ${status}`);
|
|
924
|
+
rightContent.push(` ${num}${name} ${loadBadge} ${usageCol}${status}`);
|
|
892
925
|
});
|
|
893
926
|
}
|
|
894
927
|
|