feat(video-from-script): 新增账号创建Q&A流程并移除独立风格文件系统

- 新增 `account-creation.md` 参考文档,定义结构化问答创建账号流程
- 将视觉风格信息内嵌到 `prompts/*.md` 中,移除独立的 `styles/` 目录
- 更新 SKILL.md 和 account-system.md 以反映新架构
- 更新账号校验逻辑适配新参考图管理方式
- 更新模板 `account.json` 添加 `references` 字段和默认视频模型
This commit is contained in:
2026-04-30 21:27:49 +08:00
parent 86b9b7948d
commit 3326f6cb37
11 changed files with 246 additions and 500 deletions

View File

@@ -73,33 +73,21 @@ function validateAccount(accountId) {
if (!config.defaultFormat) issues.push('缺少 defaultFormat')
const refDir = path.join(accountDir, 'references')
const styles = config.styles || {}
const hasStyleRefs = Object.values(styles).some(s => s.references && s.references.length > 0)
const localRefs = fs.existsSync(refDir)
? fs.readdirSync(refDir).filter(f => /\.(png|jpg|jpeg|webp)$/i.test(f))
: []
if (localRefs.length === 0 && !hasStyleRefs) {
const topRefs = config.references || []
if (localRefs.length === 0 && topRefs.length === 0) {
issues.push('无参考图(建议至少 1 张)')
}
const stylesDir = path.join(accountDir, 'styles')
const styleFiles = fs.existsSync(stylesDir)
? fs.readdirSync(stylesDir).filter(f => f.endsWith('.md'))
: []
if (styleFiles.length === 0) {
issues.push('无风格文件styles/ 下至少 1 个 .md')
}
for (const [sName, sConf] of Object.entries(styles)) {
for (const ref of (sConf.references || [])) {
if (!ref.url) issues.push(`styles.${sName}: 参考图 ${ref.file} 缺少 url未上传 OSS`)
}
for (const ref of topRefs) {
if (!ref.url) issues.push(`参考图 ${ref.file} 缺少 url未上传 OSS`)
}
if (issues.length === 0) {
console.log(`✓ 账号校验通过: ${accountId}`)
console.log(` ${config.name}, 模型: ${config.imageModel}+${config.videoModel || '(未指定)'}`)
console.log(` 参考图: ${localRefs.length} 本地, 风格: ${styleFiles.length} `)
console.log(` 参考图: ${localRefs.length} 本地, ${topRefs.length} 已上传`)
} else {
console.error(`✗ 发现 ${issues.length} 个问题:`)
issues.forEach(i => console.error(` - ${i}`))