feat(video-from-script): 重构工作流为子Agent分步执行并新增提示词模板系统
将视频制作工作流拆分为独立子步骤:分镜 → 图片提示词 → 生图 → 视频提示词 → 生视频 → 成片,每步由子Agent独立执行。引入prompts/目录统一管理提示词模板(分镜.md、图片提示词.md、视频提示词.md),通过account.json的storyboardPrompt/imageStylePrompt/videoStylePrompt字段引用。 变更内容: - 新增confirmed机制和pipeline.js confirm命令,生图后必须人工确认才能继续 - manifest schema改用shotDesc/narration/duration/directorRef替代旧字段 - 文件命名规则从keyword改为slug(从shotDesc/narration派生) - 删除旧的storyboard-rules.md和prompt-rules.md - pipeline.js脚本拆分为lib/目录下的独立模块(cmd-init/cmd-confirm/cmd-validate/phase-*) - 新增cmd-create-account支持一键创建带prompts目录的账号 - capcut_assemble支持narration字段替代text作为字幕源 - 新增.gitclaude/settings.json权限配置
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Phase: assemble — CapCut 成片组装
|
||||
*
|
||||
* 图片/视频 + TTS → 剪映草稿
|
||||
*/
|
||||
|
||||
const { log, getManifestDir } = require('./pipeline-utils')
|
||||
|
||||
async function phaseAssemble(manifest, manifestPath, options) {
|
||||
const dir = getManifestDir(manifestPath)
|
||||
const accountConfig = options.accountConfig || {}
|
||||
const capcutConfig = accountConfig.capcut || {}
|
||||
|
||||
const videoItems = manifest.items.filter(it => it.video && it.status === 'done')
|
||||
const hasVideos = videoItems.length > 0
|
||||
const mode = hasVideos ? 'videos' : 'images'
|
||||
|
||||
const assembleArgs = {
|
||||
input: dir,
|
||||
manifest: manifestPath,
|
||||
mode,
|
||||
format: manifest.format || accountConfig.defaultFormat || '9:16',
|
||||
subtitles: mode === 'images' ? 'true' : 'false',
|
||||
voiceover: manifest.items.some(it => it.audio) ? 'true' : 'false',
|
||||
duration: '4',
|
||||
animation: 'kenburns-zoom',
|
||||
}
|
||||
|
||||
if (capcutConfig.defaultBGM) assembleArgs.bgm = capcutConfig.defaultBGM
|
||||
if (capcutConfig.effects) assembleArgs.effects = capcutConfig.effects.join(',')
|
||||
if (capcutConfig.filter) assembleArgs.filter = capcutConfig.filter
|
||||
|
||||
log('assemble', `模式: ${mode}, 字幕: true, 配音: ${assembleArgs.voiceover}`)
|
||||
|
||||
const { assemble } = require('../capcut_assemble')
|
||||
await assemble(assembleArgs)
|
||||
|
||||
log('assemble', '成片完成')
|
||||
}
|
||||
|
||||
module.exports = { phaseAssemble }
|
||||
Reference in New Issue
Block a user