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:
@@ -0,0 +1 @@
|
||||
export * from "./ai-platforms.ts";
|
||||
@@ -0,0 +1,76 @@
|
||||
export interface AIPlatformCatalogItem {
|
||||
id: string;
|
||||
label: string;
|
||||
shortName: string;
|
||||
accent: string;
|
||||
description: string;
|
||||
loginUrl: string;
|
||||
consoleUrl: string;
|
||||
}
|
||||
|
||||
export const aiPlatformCatalog: readonly AIPlatformCatalogItem[] = [
|
||||
{
|
||||
id: "yuanbao",
|
||||
label: "混元 / 元宝",
|
||||
shortName: "元",
|
||||
accent: "#19bf6b",
|
||||
description: "腾讯系 AI 平台账号绑定与静默监测",
|
||||
loginUrl: "https://yuanbao.tencent.com/",
|
||||
consoleUrl: "https://yuanbao.tencent.com/",
|
||||
},
|
||||
{
|
||||
id: "kimi",
|
||||
label: "Kimi",
|
||||
shortName: "K",
|
||||
accent: "#111827",
|
||||
description: "Moonshot AI 账号绑定与静默监测",
|
||||
loginUrl: "https://kimi.moonshot.cn/",
|
||||
consoleUrl: "https://kimi.moonshot.cn/",
|
||||
},
|
||||
{
|
||||
id: "wenxin",
|
||||
label: "文心一言",
|
||||
shortName: "文",
|
||||
accent: "#20c6d7",
|
||||
description: "百度文心账号绑定与静默监测",
|
||||
loginUrl: "https://yiyan.baidu.com/",
|
||||
consoleUrl: "https://yiyan.baidu.com/",
|
||||
},
|
||||
{
|
||||
id: "deepseek",
|
||||
label: "DeepSeek",
|
||||
shortName: "D",
|
||||
accent: "#4468ff",
|
||||
description: "DeepSeek 账号绑定与静默监测",
|
||||
loginUrl: "https://chat.deepseek.com/",
|
||||
consoleUrl: "https://chat.deepseek.com/",
|
||||
},
|
||||
{
|
||||
id: "doubao",
|
||||
label: "豆包",
|
||||
shortName: "豆",
|
||||
accent: "#ff9348",
|
||||
description: "字节豆包账号绑定与静默监测",
|
||||
loginUrl: "https://www.doubao.com/",
|
||||
consoleUrl: "https://www.doubao.com/",
|
||||
},
|
||||
{
|
||||
id: "qwen",
|
||||
label: "通义千问",
|
||||
shortName: "通",
|
||||
accent: "#276ef1",
|
||||
description: "阿里千问账号绑定与静默监测",
|
||||
loginUrl: "https://www.qianwen.com/",
|
||||
consoleUrl: "https://www.qianwen.com/",
|
||||
},
|
||||
] as const;
|
||||
|
||||
const aiPlatformMap = new Map(aiPlatformCatalog.map((item) => [item.id, item]));
|
||||
|
||||
export function getAIPlatformCatalogItem(platformId: string): AIPlatformCatalogItem | null {
|
||||
return aiPlatformMap.get(platformId) ?? null;
|
||||
}
|
||||
|
||||
export function isAIPlatformId(platformId: string): boolean {
|
||||
return aiPlatformMap.has(platformId);
|
||||
}
|
||||
@@ -5,6 +5,8 @@ export interface ApiEnvelope<T> {
|
||||
request_id: string;
|
||||
}
|
||||
|
||||
export * from "./ai-platforms.js";
|
||||
|
||||
export interface ApiErrorEnvelope {
|
||||
code: number;
|
||||
message: string;
|
||||
@@ -235,7 +237,9 @@ export interface DesktopTaskEventMessage {
|
||||
task_id: string;
|
||||
job_id: string;
|
||||
workspace_id: number;
|
||||
target_account_id: string;
|
||||
target_client_id: string;
|
||||
platform: string;
|
||||
status:
|
||||
| "queued"
|
||||
| "in_progress"
|
||||
|
||||
Reference in New Issue
Block a user