Files
video-create/web/server/agent/tools/confirm-images.ts
sion123 e16305840b feat(agent): 添加视频创作工作流技能系统和流程工具
新增基于 SKILL.md 的视频创作工作流系统,Agent 可通过 skills 目录加载结构化的导演指令;实现 validate_storyboard、update_manifest_items、confirm_images 三个流程工具支撑分镜校验、提示词更新和图片确认。
2026-05-08 01:54:04 +08:00

27 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { execSync } from 'child_process';
import { PIPELINE_SCRIPT, PROJECT_ROOT } from './shared';
import type { ToolDefinition } from './types';
export const confirmImages: ToolDefinition = {
name: 'confirm_images',
description: '确认分镜图质量,将 manifest 中所有图片标记为 confirmed=true。也可以跳过确认直接批量确认。',
input_schema: {
type: 'object',
properties: {
manifestPath: { type: 'string', description: 'manifest.json 路径' },
skip: { type: 'boolean', description: '跳过人工确认,直接全部确认(默认 false' },
},
required: ['manifestPath'],
},
execute: async (params) => {
const { manifestPath, skip = false } = params as { manifestPath: string; skip?: boolean };
try {
const cmd = `node "${PIPELINE_SCRIPT}" confirm --manifest "${manifestPath}"${skip ? ' --all' : ''}`;
const output = execSync(cmd, { cwd: PROJECT_ROOT, encoding: 'utf-8' });
return `图片确认完成:\n${output}`;
} catch (err: any) {
return `确认失败: ${err.message}`;
}
},
};