feat(agent): 添加视频创作工作流技能系统和流程工具

新增基于 SKILL.md 的视频创作工作流系统,Agent 可通过 skills 目录加载结构化的导演指令;实现 validate_storyboard、update_manifest_items、confirm_images 三个流程工具支撑分镜校验、提示词更新和图片确认。
This commit is contained in:
2026-05-08 01:54:04 +08:00
parent 3a124f0310
commit e16305840b
7 changed files with 316 additions and 13 deletions

View File

@@ -0,0 +1,26 @@
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}`;
}
},
};