feat(monitoring): decouple AI platforms from media_platforms and expand catalog to 6

Add ai_platforms table + shared catalog (yuanbao/kimi/wenxin/deepseek/doubao/qwen),
drop FKs from platform_accounts and desktop_tasks to media_platforms, and wire
target_account_id + platform into DesktopTaskEvent so the desktop runtime no
longer has to infer them from local state. Desktop client gains generic AI page
detection for binding, drops stale-business-date monitor tasks at the edge, and
refactors AccountsView/AiPlatformsView around the shared catalog. Admin tracking
view surfaces per-platform sampling status cards.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-20 15:40:18 +08:00
parent 25dad49ed3
commit 09295d11a1
21 changed files with 2073 additions and 843 deletions
@@ -42,7 +42,7 @@ function presentClientError(kind: ClientActionKind, error: unknown): ClientError
? "账号绑定失败"
: kind === "unbind-account"
? "账号解绑失败"
: "打开创作台失败",
: "打开台失败",
);
if (message === "desktop_account_bind_window_closed") {
@@ -77,7 +77,7 @@ function presentClientError(kind: ClientActionKind, error: unknown): ClientError
};
}
if (message.startsWith("desktop_publish_platform_not_supported:")) {
if (message.startsWith("desktop_platform_not_supported:")) {
const platformId = message.split(":")[1] || "当前平台";
return {
tone: "error",
@@ -105,7 +105,7 @@ function presentClientError(kind: ClientActionKind, error: unknown): ClientError
if (kind === "open-console") {
return {
tone: "error",
title: "打开创作台失败",
title: "打开台失败",
content: message,
};
}
@@ -11,6 +11,7 @@ import logoWangyihao from "../assets/logos/logo_wangyihao.png";
import logoWeixinGzh from "../assets/logos/logo_weixin_gzh.svg";
import logoZhihu from "../assets/logos/logo_zhihu.png";
import logoZol from "../assets/logos/logo_zol.png";
import { aiPlatformCatalog } from "@geo/shared-types";
export interface DesktopMediaDefinition {
id: string;
@@ -156,37 +157,15 @@ export const desktopPublishMediaCatalog: DesktopMediaDefinition[] = [
},
];
export const desktopMonitoringMediaCatalog: DesktopMediaDefinition[] = [
{
id: "deepseek",
label: "DeepSeek",
shortName: "D",
accent: "#4468ff",
loginUrl: "https://chat.deepseek.com/",
logoUrl: null,
category: "monitoring",
description: "AI 监测 / 登录后可采集",
},
{
id: "qwen",
label: "通义千问",
shortName: "Q",
accent: "#6b46ff",
loginUrl: "https://www.qianwen.com/",
logoUrl: null,
category: "monitoring",
description: "AI 监测 / 匿名可用",
},
{
id: "doubao",
label: "豆包",
shortName: "豆",
accent: "#00a870",
loginUrl: "https://www.doubao.com/",
logoUrl: null,
category: "monitoring",
description: "AI 监测 / 匿名可用",
},
];
export const desktopMonitoringMediaCatalog: DesktopMediaDefinition[] = aiPlatformCatalog.map((platform) => ({
id: platform.id,
label: platform.label,
shortName: platform.shortName,
accent: platform.accent,
loginUrl: platform.loginUrl,
logoUrl: null,
category: "monitoring",
description: platform.description,
}));
export const desktopMediaCatalog = [...desktopPublishMediaCatalog, ...desktopMonitoringMediaCatalog];