import fs from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') const outRoot = path.join(root, '战役素材', '新') const BASE = `Premium live-action Chinese historical film still, archaeology-informed Xin dynasty and late Western Han material culture, early first century CE, cinematic 16:9 landscape, subtle film grain, physically plausible scale, rammed earth, aged timber, hemp, low-sheen silk, leather, lacquered lamellar armor, straight swords, crossbows and wooden carts. Leave calm negative space for webpage copy. No baked-in text, readable banners, subtitles, logo or watermark; no clone-face armies, fantasy armor, Tang/Song/Ming/Qing gear or architecture, imperial yellow dragon robes, Forbidden City, modern maps, UI arrows, firearms, cannons, gunpowder explosions, samurai armor, European plate, magic, anime, gore or body piles.` const img = (file, alt, request, inference) => ({ original:`images/${file}.png`, delivery:`images/${file}.webp`, alt, prompt:`Use case: historical-scene. Digital Me Xin-dynasty story frame. ${request} ${BASE}`, visualInference:inference, refinementPrompt:'' }) const packs = [ { dir:'成昌之战(廉丹战死)', event:{canonicalName:'成昌之战(廉丹战死)',aliases:['成昌之战','廉丹战死','王匡廉丹东征赤眉'],era:'新朝地皇三年',date:'公元22年四月至冬',place:'东方诸郡、无盐与成昌(约今山东、河南交界区域;成昌具体位置不作唯一断言)',summary:'王莽派太师王匡、更始将军廉丹率十余万锐士东征;官军攻拔无盐后疲兵冒进成昌,被赤眉别校董宪所部击败,王匡逃走,廉丹交出印绶符节后留下战死。'}, narration:{language:'zh-CN',estimatedSeconds:87,fullText:'公元二十二年四月,王莽派太师王匡、更始将军廉丹率十余万锐士东征赤眉。出长安都门时大雨湿衣,长老叹息说这是“泣军”。官军一路放纵,东方百姓甚至传唱:宁可遇到赤眉,也不要遇到太师和更始将军。入冬,无盐的索卢恢等举兵据城,王匡、廉丹攻下无盐,斩首万余。王莽遣使慰劳,两人都进爵为公。赤眉别校董宪率数万人在梁郡,王匡想乘胜追击。廉丹认为军队刚刚攻城,已经疲惫,应先休兵养威;王匡不听,独自引军前进,廉丹只能跟随。两军在成昌交战,新军战败,王匡逃走。廉丹把印绶和符节交给属吏送还王匡,说他可以走,自己不能走,随后留下战死。汝云、王隆等二十余名校尉听说廉丹已死,也返身赴战。这场败仗没有复杂的计谋,只有一支失去民心的疲军、一次不被采纳的劝阻,以及两位主帅在败局中截然不同的选择。'}, scenes:[ {id:'01',title:'雨湿泣军',timePlace:'公元22年四月,长安都门外',purpose:'从出师大雨和东方民谣建立官军失去民心的背景。',narration:'王匡、廉丹率十余万锐士东征。出都门大雨湿衣,长老叹为“泣军”。',overlay:{heading:'雨湿泣军',line:'大军尚未接敌,百姓已经替它写下不祥的名字。'},people:[{name:'王匡',office:'新朝太师',action:'与廉丹率十余万锐士东征'},{name:'廉丹',office:'新朝更始将军',action:'共同统军东进'},{name:'长安长老',office:'出师旁观者',action:'见大雨湿军,叹称“泣军”'}],image:img('01-weeping-army-departs','长安都门外阴雨中,王匡和廉丹立马检视出征队列,十余万军只以层层延伸的步骑与粮车暗示,一名老者在路旁望着湿透士卒叹息。','Cold rain outside an austere Chang’an gate. Wang Kuang, an older high official turned field commander, and Lian Dan, a seasoned commander in his fifties with a square weathered face, practical dark lamellar armor and a muted red-brown cloak, inspect sodden ranks departing east. Infantry, riders and baggage carts stretch in layers without impossible crowd scale. At the roadside, one elderly civilian watches soaked soldiers and quietly laments. Somber departure, no supernatural omen, no readable standards.','人物外貌、雨中队列与长老位置为视觉重构;四月出师、大雨湿衣、长老称“泣军”有史载。'),sources:['《汉书·王莽传下》卷九十九下']}, {id:'02',title:'拔无盐进爵',timePlace:'公元22年冬,无盐城',purpose:'交代官军先胜和两将进爵,避免成昌失败显得毫无前因。',narration:'入冬,官军攻拔索卢恢据守的无盐,斩首万余。王莽遣使劳军,两将进爵为公。',overlay:{heading:'拔无盐进爵',line:'胜利和封赏,让疲惫看起来像还可以再追一次。'},people:[{name:'王匡',office:'太师',action:'与廉丹攻拔无盐,获进爵为公'},{name:'廉丹',office:'更始将军',action:'参与攻城并接受劳军封赏'},{name:'索卢恢',office:'无盐起事首领',action:'据城反新;城破后的个人结局不在画面断言'}],image:img('02-wuyan-falls-and-envoy-arrives','无盐土城被攻破后的克制场景,新军收拢俘虏与器械,疲惫的王匡、廉丹在城门外接过使者带来的封缄诏牍,不展示首级或庆功宴。','Restrained aftermath outside captured Wuyan, a modest rammed-earth county town. Xin troops secure the gate, gather intact weapons and register prisoners without humiliation. Wang Kuang and Lian Dan, matching scene 01 and visibly exhausted, receive sealed blank wooden-slip orders from an imperial courier beside mud-stained horses. The official reward arrives before the army has rested. No severed heads, no feast, no massacre, no readable edict.','城墙、收拢俘虏、使者抵达与两将受命同框为视觉推演;攻拔无盐、斩首万余、遣使劳军与进爵有史载。'),sources:['《汉书·王莽传下》卷九十九下']}, {id:'03',title:'疲军仍进',timePlace:'无盐至梁郡成昌方向',purpose:'呈现廉丹劝休、王匡不听这一直接决策节点。',narration:'董宪数万人在梁郡。廉丹请先休士养威,王匡不听,独自引军前进,廉丹随后跟上。',overlay:{heading:'疲军仍进',line:'该停的时候没有停,前一场胜利成了下一场败仗的起点。'},people:[{name:'王匡',office:'太师、主帅',action:'拒绝休整建议,引兵进击董宪'},{name:'廉丹',office:'更始将军',action:'主张休士养威,劝阻不成后随军前进'},{name:'董宪',office:'赤眉别校',action:'率数万人在梁郡活动'}],image:img('03-lian-dan-urges-rest','泥泞行军营地中,廉丹按住展开的无字木牍并指向疲兵与倒卧马匹,劝王匡休整;王匡已翻身上马指向前路,队列被迫重新集合。','Muddy roadside camp after Wuyan. Lian Dan, matching prior scenes, presses one hand beside blank wooden route slips and points to exhausted infantry, damaged sandals, tired horses and unfinished cooking fires, urging rest. Wang Kuang has already mounted and gestures toward the road to Liang commandery, impatient to advance. Officers reluctantly call worn troops back into line. The disagreement is practical, not theatrical shouting; no map text.','议军地点、疲兵细节、两将手势和行军重启为视觉重构;廉丹劝休、王匡不听独进、廉丹随之有史载。'),sources:['《汉书·王莽传下》卷九十九下','《后汉纪》卷一']}, {id:'04',title:'成昌兵败',timePlace:'成昌战场',purpose:'表现疲军交战后崩溃,不虚构阵法、单挑或精确伤亡。',narration:'新军与董宪所部合战成昌,阵线很快崩溃。王匡带兵撤走,廉丹被留在败局中央。',overlay:{heading:'成昌兵败',line:'史书没有留下阵图,只留下“匡走”与“丹止”。'},people:[{name:'董宪',office:'赤眉别校',action:'率赤眉数万人与新军交战'},{name:'王匡',office:'太师',action:'兵败后逃走'},{name:'廉丹',office:'更始将军',action:'在败阵中停止撤退'}],image:img('04-xin-line-breaks-at-chengchang','冬日平野上新军阵线破裂,赤眉军以眉部红色涂记相互识别但不戴统一红头巾;王匡带少数骑从远撤,廉丹在中景令部曲收拢盾阵。','Winter battle on an open eastern plain near Chengchang. The exhausted Xin formation breaks into retreat under pressure from Dong Xian’s Red Eyebrow forces, whose fighters use small red marks painted around their brows for recognition rather than theatrical red headbands. In the far middle distance Wang Kuang withdraws with a small mounted group. Lian Dan remains closer to the broken line, ordering a compact shield group to turn and hold. No invented duel, no precise tactic claim, no corpses or blood.','阵线、两将相对位置、赤眉识别方式与撤退方向为视觉重构;成昌合战、兵败、王匡走、廉丹止有史载。'),sources:['《汉书·王莽传下》卷九十九下','《后汉纪》卷一']}, {id:'05',title:'交印而止',timePlace:'成昌败阵后段',purpose:'以印绶符节和返身赴战收束廉丹选择,克制处理战死。',narration:'廉丹把印绶符节交给属吏送还王匡,自己留下。二十余名校尉得知后,也返身赴战。',overlay:{heading:'交印而止',line:'印已经交出去,他仍没有走。'},people:[{name:'廉丹',office:'更始将军、果公',action:'交出印绶符节后留下战死'},{name:'汝云、王隆等',office:'校尉二十余人',action:'闻廉丹死,返身赴战并战死'},{name:'王匡',office:'太师',action:'接收廉丹送还的印绶符节;本人已撤离'}],image:img('05-seal-returned-last-stand','暮色败阵边缘,廉丹把装有印绶符节的封闭木匣交给骑马属吏令其追送王匡,自己转身走向尚在集结的二十余名校尉;不展示死亡瞬间。','At the edge of the defeated field in fading winter light, Lian Dan, matching prior scenes, hands a mounted clerk a closed wooden box containing his seal ribbons and command tally, directing him after the retreating Wang Kuang. Lian Dan then turns back toward a small group of roughly two dozen officers reforming around battered shields. Show resolve and exhaustion, not a glamorous last-charge pose. No death moment, no blood, no readable inscription.','木匣、传递动作、校尉集结和暮色为克制视觉重构;交印绶符节、廉丹止而战死、汝云王隆等返战皆有史载。'),sources:['《汉书·王莽传下》卷九十九下']} ], bgm:{catalogId:'zhanzhen:kunyang#1',title:'昆阳之战',version:'王邑版·仅复用无主唱新莽败军器乐 stem',status:'pending-export',pathOrUrl:'',usage:'删除王邑歌词与昆阳专属风雨音效,保留低弦、沉重军鼓和逐步松散的节拍;第二幕短促抬升,第三幕起不断失稳,第五幕撤去主鼓。',reason:'项目没有成昌专属曲;王邑版同属新莽败军视角,可复用为王匡、廉丹东征的制度性崩解声场,仓库暂无成品音频。',cues:[{from:'00:00',to:'00:17',scene:'01',direction:'雨声感与低鼓建立泣军。'},{from:'00:17',to:'00:34',scene:'02',direction:'短促抬升但不凯旋。'},{from:'00:34',to:'00:51',scene:'03',direction:'节拍开始不稳。'},{from:'00:51',to:'01:08',scene:'04',direction:'崩阵处打击层散开。'},{from:'01:08',to:'01:27',scene:'05',direction:'撤鼓,仅留低弦与木质敲击。'}]}, sources:[{claim:'泣军、十余万锐士、东方民谣、无盐胜利、成昌败战与廉丹交印战死',citation:'《汉书·王莽传下》卷九十九下',url:'https://zh.wikisource.org/zh-hans/汉书/卷099下'},{claim:'董宪在梁郡、劝休未从、成昌败战及校尉返战',citation:'《后汉纪》卷一',url:'https://zh.wikisource.org/zh-hans/后汉纪/卷1'}], blacklist:['把太师王匡误认成绿林军同名将领王匡','把“更始将军”廉丹误认成更始帝刘玄的将领;这是新朝官号','把无盐胜利与成昌失败合成同一场战斗,或省略疲兵冒进的先后关系','用演义情节虚构董宪与王匡、廉丹单挑或精确阵法','把赤眉画成统一红巾军;其识别标记是涂红眉部','展示斩首万余、廉丹死亡或尸体的血腥近景','现代文字地图、水印、后世服饰建筑、火器爆炸或动漫画风'] }, { dir:'长安之战(王莽死于渐台)', event:{canonicalName:'长安之战(王莽死于渐台)',aliases:['新亡·王莽死于渐台','长安城破','渐台之战'],era:'新朝地皇四年',date:'公元23年十月初一至初三(《汉书》纪日戊申朔至庚戌)',place:'长安宣平门、未央宫与渐台',summary:'各路汉兵攻入长安,王邑率残部抵抗;王莽在群臣扶掖下退至四面环水的渐台,十月初三众兵登台,商人杜吴杀王莽并取其绶,新朝灭亡。'}, narration:{language:'zh-CN',estimatedSeconds:89,fullText:'公元二十三年十月,昆阳败后三个多月,各路汉兵从四面会集长安,争先攻城。十月初一,兵从宣平门攻入。城中少年朱弟、张鱼等纵火攻宫门,火势逼近掖庭,王莽从宣室躲避。大司马王邑仍在昼夜苦战,士卒伤亡几乎殆尽;他退入宫中,看见儿子王睦正脱下冠服准备逃走,便喝令他回去,父子最终共同守莽。十月初三清晨,群臣扶着王莽走出白虎门。和新公王揖备车,王莽乘车退往渐台,想利用池水拒守。他仍带着皇帝的玺绶、匕首、符命和威斗,公卿、侍中、黄门郎等一千余人跟上这座水中高台。众兵层层包围,台上仍在抵抗。下午,攻军登台。杀死王莽的不是哪位名将,而是闯上台的商人杜吴。他拿走王莽的绶带,却说不出绶的主人在哪里。新朝十五年的官爵与符命,到此变成一件连夺取者都未必认得的物件。',}, scenes:[ {id:'01',title:'四兵会城',timePlace:'公元23年十月初,长安城外',purpose:'建立昆阳战后三个月长安被各路兵马围攻的终局态势。',narration:'各路汉兵从四面会集长安,争先攻城。新朝已经没有足够的野战军来解围。',overlay:{heading:'四兵会城',line:'昆阳丢掉的是主力,长安等来的是所有方向的兵。'},people:[{name:'更始诸军',office:'攻新联军',action:'从长安四面会集并争先攻城'},{name:'王邑',office:'新朝大司马',action:'组织城内残余兵力防守'}],image:img('01-armies-converge-on-changan','秋日长安外城远景,多路装备不一的更始军从不同道路与城门方向会集,城上新军守卒稀疏,王邑在墙内检查防线,不出现现代鸟瞰地图。','Wide autumn view of early-imperial Chang’an under converging attack. Several distinct columns of Gengshi-aligned troops approach from different roads and gate sectors, with varied equipment showing a coalition rather than one uniform army. Sparse Xin defenders hold rammed-earth walls and timber gate towers. Inside the wall, Wang Yi, an exhausted older commander in battered dark lamellar armor and muted crimson cloak, inspects the defense. Geography implied through depth, not a map or impossible aerial panorama.','兵路、城防视角、各军装备差异与王邑位置为视觉重构;长安旁兵四会城下与争欲先入有史载。'),sources:['《汉书·王莽传下》卷九十九下']}, {id:'02',title:'宣平门入',timePlace:'十月初一,宣平门至未央宫',purpose:'表现破城与宫门火攻,不把城市毁灭当成视觉奇观。',narration:'十月初一,攻军从宣平门入城。朱弟、张鱼等焚烧宫门,王莽避火转入宣室。',overlay:{heading:'宣平门入',line:'城门一破,未央宫的殿门也成了下一层防线。'},people:[{name:'朱弟、张鱼等',office:'长安城中少年',action:'焚烧作室门并呼王莽出降'},{name:'王莽',office:'新朝皇帝',action:'避开宫门火势转入宣室'}],image:img('02-xuanping-gate-breached','长安宣平门被攻开后,士卒与城中少年穿过烟雾进入宽阔街道,远处未央宫外围一扇木门燃烧;王莽只以被近臣护送远离火势的深青衣身影出现。','After the Xuanping Gate is breached, mixed soldiers and Chang’an youths move through smoke into a broad early-imperial street. Farther inside, one timber outer gate of the Weiyang Palace complex burns, orange light limited and realistic rather than a city-wide inferno. Wang Mang appears only as a distant elderly East Asian ruler in dark blue-black formal robes, escorted away from the fire by attendants. No massacre, no giant palace skyline, no readable shouted slogans.','城门破口、火势范围、街道与王莽撤移同框为视觉重构;宣平门入、朱弟张鱼等烧作室门、莽避火宣室有史载。'),sources:['《汉书·王莽传下》卷九十九下']}, {id:'03',title:'衣冠欲逃',timePlace:'未央宫内,王邑退入之际',purpose:'以王邑喝回脱冠服的儿子呈现新朝最后的位阶束缚。',narration:'王邑昼夜苦战,部众几尽。退入宫中时,他撞见儿子王睦正脱冠服逃命,便喝令他回去。',overlay:{heading:'衣冠欲逃',line:'儿子想脱掉的是官服,父亲让他穿回的是最后的身份。'},people:[{name:'王邑',office:'新朝大司马',action:'苦战后喝令儿子王睦返回,共守王莽'},{name:'王睦',office:'侍中、王邑之子',action:'试图解下衣冠逃走,被父亲喝回'}],image:img('03-wang-yi-stops-his-son','烟尘弥漫的宫廊内,甲胄破损的王邑扶墙走入,正看见儿子王睦把官冠和外袍放在木栏旁准备混入人群;王邑抬手喝止,不展示争斗。','Smoke-dim palace corridor during the collapse. Wang Yi, matching scene 01, armor battered and exhausted after continuous fighting, braces against a timber post. He catches his adult son Wang Mu quietly setting down an official cap and outer court robe beside a low rail, preparing to disappear among fleeing attendants. Wang Yi raises one hand and orders him back; the son freezes between identities. Intimate moral pressure, no physical violence, no readable insignia.','宫廊、逃散人流、衣冠摆放与父子动作是视觉重构;王邑见王睦解衣冠欲逃并叱令还、父子共守有史载。'),sources:['《汉书·王莽传下》卷九十九下']}, {id:'04',title:'抱符命上渐台',timePlace:'十月初三清晨,白虎门至渐台',purpose:'呈现王莽携符命威斗退保水中高台及千余从官随行。',narration:'群臣扶王莽出白虎门,王揖备车。王莽抱着符命与威斗退至渐台,一千余从官跟随。',overlay:{heading:'抱符命上渐台',line:'把他送上皇位的符命,最后也被他抱上绝路。'},people:[{name:'王莽',office:'新朝皇帝',action:'携玺绶、符命和威斗退保渐台'},{name:'王揖',office:'和新公',action:'在白虎门外奉车接应'},{name:'公卿与从官',office:'公卿大夫、侍中、黄门郎等',action:'一千余人随王莽登台'}],image:img('04-wang-mang-reaches-jantai','灰冷清晨,年老王莽被群臣扶下低阶、登上白虎门外等候的朴素车驾,怀中抱封闭符命木匣与青铜式盘;前方池水环绕的渐台上已有守卒和上千从官涌入。','Cold gray dawn at the White Tiger Gate. The elderly Wang Mang in dark blue-black robes and seal ribbons is supported down low steps by ministers toward a modest waiting carriage held by Duke Wang Yi. He clutches a closed wooden box representing prophetic documents and a bronze cosmological divination board, neither glowing nor readable. Beyond, a high timber-and-earth terrace stands within palace ponds; streams of court officials and guards crowd onto its narrow approaches. Historically sober, no mystical effects, no monumental fantasy tower.','车驾、符命匣、威斗外观、池水尺度与千余人流为视觉重构;白虎门奉车、莽之渐台、抱符命威斗及从官千余有史载。'),sources:['《汉书·王莽传下》卷九十九下']}, {id:'05',title:'杜吴取绶',timePlace:'十月初三下午,渐台',purpose:'以绶带易手表现王莽之死与新亡,不展示尸体分裂。',narration:'众兵攻上渐台。商人杜吴杀王莽并取走绶带,却答不出绶主所在。新朝至此灭亡。',overlay:{heading:'杜吴取绶',line:'一个王朝最后留下的,是一条夺取者也未必认得的绶带。'},people:[{name:'杜吴',office:'商人、攻台者',action:'杀王莽并取其绶;画面只表现战后持绶'},{name:'公宾就',office:'校尉、故大行治礼',action:'询问杜吴绶带主人所在'},{name:'王莽',office:'新朝皇帝',action:'死于渐台;画面不展示遗体、斩首或分尸'}],image:img('05-du-wu-holds-the-seal-ribbon','战斗刚停的渐台上,商人杜吴衣着朴素、手持从地上拾起的深色绶带,茫然面对前来询问的校尉公宾就;远处封闭室门与放下武器的士卒暗示王莽已死,绝不展示尸体。','Restrained aftermath on the Jantai terrace. Du Wu, an ordinary middle-aged merchant in plain hemp clothing among the attackers, holds a dark imperial seal ribbon he has taken, looking uncertain as the uniformed officer Gongbin Jiu questions him. Behind them, soldiers lower weapons near a closed room door; Wang Mang’s death is implied only by the abandoned carriage gear and silent court objects, with no body, head, blood or dismemberment. Palace ponds and smoke-gray Chang’an beyond, sober end of a regime, not triumph.','杜吴外貌、绶带颜色、问答位置与封闭室门为视觉重构;杜吴杀莽取绶、公宾就询问绶主有史载。'),sources:['《汉书·王莽传下》卷九十九下']} ], bgm:{catalogId:'mingchangmian:wangmangjiajiuxi#0',title:'王莽·加九锡',version:'电影级配乐·仅取无主唱器乐 stem并反向收束',status:'pending-export',pathOrUrl:'',usage:'删除歌词与加九锡庆典声场,把同一主题由完整礼乐逐幕拆散:城破后只剩低弦、木质敲击和不稳定铜音,第五幕在绶带易手处完全失去主旋律。',reason:'项目没有长安破城专属曲;王莽主题从加九锡到渐台可形成首尾反转,属于项目自生成音乐,仓库暂无成品音频。',cues:[{from:'00:00',to:'00:18',scene:'01',direction:'残缺礼乐主题压在低频中。'},{from:'00:18',to:'00:36',scene:'02',direction:'木门燃烧处加入短促噪点。'},{from:'00:36',to:'00:54',scene:'03',direction:'父子对峙处撤去主鼓。'},{from:'00:54',to:'01:12',scene:'04',direction:'符命主题只剩单音。'},{from:'01:12',to:'01:29',scene:'05',direction:'绶带易手后主旋律消失。'}]}, sources:[{claim:'长安四面会兵、宣平门入、未央宫火攻、王邑父子、王莽退渐台、杜吴取绶与新亡',citation:'《汉书·王莽传下》卷九十九下',url:'https://zh.wikisource.org/zh-hans/汉书/卷099下'}], blacklist:['把攻入长安的各路汉兵画成东汉中央政府的统一正规军;此时仍属更始诸军及地方兵马','把渐台画成高山孤堡、佛塔或后世楼阁;它是未央宫池水中的台','把王莽所抱符命画成发光神书,或把威斗误作兵器','展示王莽被杀、斩首、分尸、悬首或群众食舌等血腥细节','把杜吴塑造成预先奉命斩王莽的著名将军;原文明确称商人','现代文字地图、水印、后世服饰建筑、火器爆炸或动漫画风'] } ] function md(p){const a=[`# ${p.event.canonicalName}|素材说明`,'','## 事件边界','',`- 规范事件名:${p.event.canonicalName}`,`- 常用称呼:${p.event.aliases.join('、')}`,`- 时代:${p.event.era}`,`- 日期:${p.event.date}`,`- 地点:${p.event.place}`,`- 一句话结论:${p.event.summary}`,'','## 60–90 秒主旁白','',p.narration.fullText,'','## 分幕素材',''];for(const s of p.scenes)a.push(`### ${s.id}|${s.title}`,'',`- 时间地点:${s.timePlace}`,`- 本幕作用:${s.purpose}`,`- 分幕旁白:${s.narration}`,`- 页面标题:${s.overlay.heading}`,`- 页面短句:${s.overlay.line}`,`- PNG:\`${s.image.original}\``,`- WebP:\`${s.image.delivery}\``,`- 替代文本:${s.image.alt}`,`- 视觉推演边界:${s.image.visualInference}`,`- 人物:${s.people.map(x=>`${x.name}(${x.office};${x.action})`).join(';')}`,`- 史料:${s.sources.join(';')}`,'','生成提示词:','','```text',s.image.prompt,'```','');a.push('## BGM 选曲','',`- 项目曲目:\`${p.bgm.catalogId}\`|${p.bgm.title}|${p.bgm.version}`,`- 状态:${p.bgm.status}`,`- 用法:${p.bgm.usage}`,`- 选择理由:${p.bgm.reason}`,'- 音频路径或 URL:仓库暂缺,待导出','','| 时间 | 分幕 | 编排 |','|---|---|---|',...p.bgm.cues.map(x=>`| ${x.from}–${x.to} | ${x.scene} | ${x.direction} |`),'','## 史料来源','',...p.sources.map(x=>`- ${x.claim}:[${x.citation}](${x.url})`),'','## 禁区与误读防护','',...p.blacklist.map(x=>`- ${x}`),'','## 交付检查','','- [ ] 每幕 PNG 原图存在且为 16:9','- [ ] 每幕 WebP 交付图存在且为 16:9','- [x] 旁白、页面文案、人物标签、提示词、视觉推演和史料齐全','- [ ] BGM 已导出并填写可用路径','- [ ] \`manifest.json\` 与本说明中的文件名全部校验通过','');return a.join('\n')+'\n'} for(const p of packs){const d=path.join(outRoot,p.dir);if(fs.existsSync(d))throw new Error(`Refusing to overwrite ${d}`);fs.mkdirSync(path.join(d,'images'),{recursive:true});fs.writeFileSync(path.join(d,'manifest.json'),JSON.stringify({event:p.event,narration:p.narration,scenes:p.scenes,bgm:p.bgm,sources:p.sources,blacklist:p.blacklist},null,2)+'\n');fs.writeFileSync(path.join(d,'素材说明.md'),md(p))} console.log(`Generated ${packs.length} Xin-dynasty gap packages`)