feat(desktop): add Wenxin monitoring adapter and surface platform risk control

Introduces the Wenxin (文心一言) monitoring adapter and registers it in
the runtime controller and adapter index. Adds a new risk_control
failure classification with custom classifiers for Doubao and Wenxin
that recognize rate-limit, 频控 and 访问环境异常 signals, and propagates
this state through account-health, runtime activity alerts, and the
renderer views so users see "触发风控" instead of a generic challenge
message on the Home, Accounts, and AI Platforms screens.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 15:26:24 +08:00
parent bd4ee8feef
commit ca40657c5a
12 changed files with 2552 additions and 21 deletions
@@ -56,7 +56,7 @@ function authLabel(account: AccountRow | null) {
case "active":
return "授权正常";
case "challenge_required":
return "需人工验证";
return account.authReason === "risk_control" ? "触发风控" : "需人工验证";
case "expired":
return "授权过期";
case "expiring_soon":
@@ -88,6 +88,22 @@ function authColor(account: AccountRow | null) {
}
}
function accountActionAlert(account: AccountRow | null): string | null {
if (!account || account.authState !== "challenge_required") {
return null;
}
if (account.authReason === "risk_control" && account.platform === "doubao") {
return "豆包账号疑似触发风控,监控已暂停。请点击“打开平台”,在前台完成验证或等待限制解除后,再刷新状态。";
}
if (account.authReason === "risk_control") {
return "当前账号疑似触发平台限制,相关任务已暂停。请先打开平台处理验证后,再刷新状态。";
}
return "当前账号需要人工验证,相关任务会暂停执行。请先打开平台完成验证后,再刷新状态。";
}
function verificationLabel(account: AccountRow): string {
if (account.lastVerifiedAt) {
return formatVerifiedAtLabel(account.lastVerifiedAt);
@@ -328,6 +344,19 @@ async function unbindPlatform(account: AccountRow) {
</a-button>
</div>
<div v-if="accountActionAlert(platform.account)" class="card-alert">
<a-alert
type="warning"
show-icon
banner
>
<template #message>
{{ accountActionAlert(platform.account) }}
</template>
<template #icon><WarningOutlined /></template>
</a-alert>
</div>
<div v-if="platform.duplicateCount > 0" class="card-alert">
<a-alert
type="warning"