fix: 为镜头提示词缺少首帧提供操作指引

This commit is contained in:
GouJ committed 2026-09-23 09:29:24 +08:00
1 parent 0ce9ae00e7
commit de26dd0c19
8 files changed
+149 -19

No files matched your search

+10 -2
View File
@@ -7,6 +7,14 @@ export interface Operation {
label: string
error: string
notice: string
recovery: OperationRecovery | null
}
/** 失败后的可执行恢复位置;仅保留当前浏览器会话内的真实上下文。 */
export type OperationRecovery = {
target: 'keyframe'
shotId: string
episodeNo?: number
}
/** 按项目而非 graph 上锁,防止改写剧本与拆解同时提交。 */
@@ -14,14 +22,14 @@ const operations = reactive<Record<string, Operation>>({})
/** 取得项目操作状态,不向浏览器持久化虚假的后台运行状态。 */
export function getOperation(projectId: string): Operation {
return (operations[projectId] ??= { pending: false, label: '', error: '', notice: '' })
return (operations[projectId] ??= { pending: false, label: '', error: '', notice: '', recovery: null })
}
/** 只提交一次;断网不自动重试,后台是否已执行由刷新后的 checkpoint 确认。 */
export async function runOperation(projectId: string, label: string, action: () => Promise<unknown>) {
const operation = getOperation(projectId)
if (operation.pending) return false
Object.assign(operation, { pending: true, label, error: '', notice: '' })
Object.assign(operation, { pending: true, label, error: '', notice: '', recovery: null })
try {
await action()
operation.notice = '请求已返回,正在重新读取后端状态;最终结果以下方记录为准。'