feat(short-drama-agent-front): 接入关系修复并优化配置与弹窗

This commit is contained in:
GJ committed 2026-10-31 22:37:22 +08:00
1 parent 2db8549818
commit 41d1cfe3ed
15 files changed
+1134 -323

No files matched your search

+13 -5
View File
@@ -1,8 +1,8 @@
import type { BreakdownState } from './types'
import type { CandidateCommitPreview } from './candidate.types'
import type { CandidateCommitPreview, CandidateCommitCheckPreview } from './candidate.types'
/** 安全检查项与用户可理解的阻断原因共用一份映射。 */
export const candidateCheckLabels: Record<keyof CandidateCommitPreview['checks'], string> = {
export const candidateCheckLabels: Record<keyof CandidateCommitCheckPreview['checks'], string> = {
qualityPolicyMatches: '质量规则与当前已确认版本一致',
episodeNumbersMatch: '剧集范围与候选一致',
episodeFingerprintsMatch: '剧本正文版本未变化',
@@ -10,7 +10,8 @@ export const candidateCheckLabels: Record<keyof CandidateCommitPreview['checks']
noActiveVideos: '没有正在生成的视频',
noSubjectIdentities: '没有需要保护的主体身份',
noSubjectImages: '没有需要保护的主体图片',
noProtectedShots: '没有需要保护的镜头资产'
noProtectedShots: '没有需要保护的镜头资产',
relationEvidenceValid: '场景、道具关系的来源证据有效'
}
/** 必须逐项校验的固定安全门禁,不根据响应动态减少检查项。 */
export const candidateCheckKeys = [
@@ -21,7 +22,8 @@ export const candidateCheckKeys = [
'noActiveVideos',
'noSubjectIdentities',
'noSubjectImages',
'noProtectedShots'
'noProtectedShots',
'relationEvidenceValid'
] as const
/**
@@ -36,7 +38,13 @@ export function candidatePreviewReady(
projectId: string,
checkpointId?: string
): boolean {
if (!preview || preview.projectId !== projectId || preview.checkpointId !== checkpointId) return false
if (
!preview ||
preview.status === 'already_committed' ||
preview.projectId !== projectId ||
preview.checkpointId !== checkpointId
)
return false
// 外部 JSON 的布尔值必须严格为 true,不接受缺失值或字符串等真值。
const flags: unknown[] = [preview.readOnly, preview.ready, ...candidateCheckKeys.map(key => preview.checks?.[key])]
return flags.every(value => value === true)