feat(publish): add baijiahao and jianshu desktop adapters
Wires up Baijiahao (百家号) and Jianshu (简书) as first-class desktop publish targets, with risk-control prompts surfaced in the runtime controller and a normalized error message in publish records. Adds external-link buttons in the publish management table, an asset format conversion endpoint for cover image compatibility, and reorders publish-status display priority so failures take precedence over partial successes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,9 @@ import type {
|
||||
import { getAIPlatformCatalogItem, isAIPlatformId } from "@geo/shared-types";
|
||||
|
||||
import {
|
||||
baijiahaoAdapter,
|
||||
getMonitorAdapter,
|
||||
jianshuAdapter,
|
||||
toutiaoAdapter,
|
||||
zhihuAdapter,
|
||||
type AdapterExecutionResult,
|
||||
@@ -139,6 +141,7 @@ const authRequiredMonitorPlatforms = new Set(["yuanbao", "kimi", "deepseek", "do
|
||||
const publishReservedSlots = 1;
|
||||
const minimumForegroundTotalConcurrency = 2;
|
||||
const maximumRuntimeTotalConcurrency = 4;
|
||||
const BAIJIAHAO_RISK_CONTROL_PROMPT = "您触发平台风控,请手动发稿一篇并完成验证,方可继续使用";
|
||||
|
||||
interface RuntimeTaskRecord {
|
||||
id: string;
|
||||
@@ -298,6 +301,9 @@ function accountActionRequiredSummary(
|
||||
authReason: string | null | undefined,
|
||||
): string {
|
||||
const label = runtimePlatformLabel(platform);
|
||||
if (platform === "baijiahao") {
|
||||
return BAIJIAHAO_RISK_CONTROL_PROMPT;
|
||||
}
|
||||
if (authReason === "risk_control") {
|
||||
return `${label} 账号疑似触发风控,请打开平台处理验证或等待限制解除后再继续执行。`;
|
||||
}
|
||||
@@ -319,6 +325,14 @@ function maybeRecordAccountAccessAlert(
|
||||
}
|
||||
|
||||
if (next.authState === "challenge_required" && next.authReason === "risk_control") {
|
||||
if (accountIdentity.platform === "baijiahao") {
|
||||
recordActivity(
|
||||
"warn",
|
||||
"百家号触发平台风控",
|
||||
BAIJIAHAO_RISK_CONTROL_PROMPT,
|
||||
);
|
||||
return;
|
||||
}
|
||||
recordActivity(
|
||||
"warn",
|
||||
`${runtimePlatformLabel(accountIdentity.platform)} 触发风控`,
|
||||
@@ -328,6 +342,14 @@ function maybeRecordAccountAccessAlert(
|
||||
}
|
||||
|
||||
if (next.authState === "challenge_required") {
|
||||
if (accountIdentity.platform === "baijiahao") {
|
||||
recordActivity(
|
||||
"warn",
|
||||
"百家号触发平台风控",
|
||||
BAIJIAHAO_RISK_CONTROL_PROMPT,
|
||||
);
|
||||
return;
|
||||
}
|
||||
recordActivity(
|
||||
"warn",
|
||||
`${runtimePlatformLabel(accountIdentity.platform)} 需要人工验证`,
|
||||
@@ -2837,9 +2859,15 @@ function selectPublishAdapter(platform: string): PublishAdapter | null {
|
||||
if (platform === toutiaoAdapter.platform) {
|
||||
return toutiaoAdapter;
|
||||
}
|
||||
if (platform === baijiahaoAdapter.platform) {
|
||||
return baijiahaoAdapter;
|
||||
}
|
||||
if (platform === zhihuAdapter.platform) {
|
||||
return zhihuAdapter;
|
||||
}
|
||||
if (platform === jianshuAdapter.platform) {
|
||||
return jianshuAdapter;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user