@oh-story/dsh 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (529) hide show
  1. package/README.md +14 -14
  2. package/lib/client.js +209 -73
  3. package/lib/client.js.map +3 -3
  4. package/lib/drama/manifest.json +248 -168
  5. package/lib/drama/skills/short-drama/SKILL.md +16 -4
  6. package/lib/drama/skills/short-drama/assets/project-template/short-drama.json +3 -0
  7. package/lib/drama/skills/short-drama/references/creator-documents.md +3 -0
  8. package/lib/drama/skills/short-drama/references/knowhow-index.md +15 -0
  9. package/lib/drama/skills/short-drama/scripts/creator_markdown_check.py +14 -0
  10. package/lib/drama/skills/short-drama/scripts/project_tool.py +131 -0
  11. package/lib/drama/skills/short-drama-assets/SKILL.md +2 -1
  12. package/lib/drama/skills/short-drama-assets/references/asset-review-checklist.md +2 -0
  13. package/lib/drama/skills/short-drama-assets/references/character-and-look.md +10 -0
  14. package/lib/drama/skills/short-drama-assets/references/continuity-lock.md +6 -9
  15. package/lib/drama/skills/short-drama-assets/references/era-anchors.md +37 -0
  16. package/lib/drama/skills/short-drama-assets/references/stage-contract.md +2 -0
  17. package/lib/drama/skills/short-drama-assets/references/voice-direction.md +28 -0
  18. package/lib/drama/skills/short-drama-develop/SKILL.md +10 -4
  19. package/lib/drama/skills/short-drama-develop/assets/adaptation-map.example.jsonl +1 -1
  20. package/lib/drama/skills/short-drama-develop/assets/creative-brief.md +8 -0
  21. package/lib/drama/skills/short-drama-develop/references/adaptation-craft.md +80 -13
  22. package/lib/drama/skills/short-drama-develop/references/episode-design.md +95 -12
  23. package/lib/drama/skills/short-drama-develop/references/genre-and-hook-playbook.md +9 -5
  24. package/lib/drama/skills/short-drama-develop/references/genre-cards//345/244/215/344/273/207/346/211/223/350/204/270.md +1 -1
  25. package/lib/drama/skills/short-drama-develop/references/genre-cards//347/263/273/347/273/237/346/265/201.md +51 -0
  26. package/lib/drama/skills/short-drama-develop/references/genre-cards//351/200/206/350/242/255.md +51 -0
  27. package/lib/drama/skills/short-drama-develop/references/genre-cards//351/207/215/347/224/237/347/251/277/350/266/212.md +51 -0
  28. package/lib/drama/skills/short-drama-develop/references/genre-cards.md +10 -7
  29. package/lib/drama/skills/short-drama-develop/references/premise-devices.md +15 -9
  30. package/lib/drama/skills/short-drama-develop/references/serial-character-and-memory.md +3 -2
  31. package/lib/drama/skills/short-drama-develop/references/stage-contract.md +14 -7
  32. package/lib/drama/skills/short-drama-develop/references/story-craft.md +7 -3
  33. package/lib/drama/skills/short-drama-edit/SKILL.md +65 -44
  34. package/lib/drama/skills/short-drama-edit/assets/remotion/README.md +49 -13
  35. package/lib/drama/skills/short-drama-edit/assets/remotion/package.json +4 -2
  36. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Overlay.tsx +31 -0
  37. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Root.tsx +5 -5
  38. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Subtitles.tsx +68 -69
  39. package/lib/drama/skills/short-drama-edit/assets/remotion/src/font.ts +39 -29
  40. package/lib/drama/skills/short-drama-edit/assets/remotion/src/rules.mjs +188 -0
  41. package/lib/drama/skills/short-drama-edit/assets/remotion/src/schema.ts +26 -13
  42. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/Card.tsx +72 -0
  43. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/CornerChip.tsx +39 -0
  44. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/ScreenText.tsx +36 -0
  45. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/SystemPanel.tsx +44 -0
  46. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/TaskPanel.tsx +100 -0
  47. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/chrome.tsx +197 -0
  48. package/lib/drama/skills/short-drama-edit/assets/remotion/src/screen/tokens.ts +62 -0
  49. package/lib/drama/skills/short-drama-edit/assets/remotion/tsconfig.json +1 -0
  50. package/lib/drama/skills/short-drama-edit/assets//345/211/252/350/276/221/345/215/225.md +6 -4
  51. package/lib/drama/skills/short-drama-edit/references/cut-craft.md +26 -67
  52. package/lib/drama/skills/short-drama-edit/references/delivery-verify.md +31 -56
  53. package/lib/drama/skills/short-drama-edit/references/generated-footage.md +42 -78
  54. package/lib/drama/skills/short-drama-edit/references/sound-and-subtitles.md +44 -92
  55. package/lib/drama/skills/short-drama-edit/references/stage-contract.md +14 -16
  56. package/lib/drama/skills/short-drama-edit/scripts/edit_tool.py +1272 -125
  57. package/lib/drama/skills/short-drama-edit/scripts/selftest.py +113 -9
  58. package/lib/drama/skills/short-drama-image-prompts/SKILL.md +2 -0
  59. package/lib/drama/skills/short-drama-image-prompts/references/common-recipe.md +11 -0
  60. package/lib/drama/skills/short-drama-novel-analyze/SKILL.md +3 -3
  61. package/lib/drama/skills/short-drama-novel-analyze/assets/episode-candidate.example.jsonl +2 -2
  62. package/lib/drama/skills/short-drama-novel-analyze/references/adaptation-triage.md +8 -4
  63. package/lib/drama/skills/short-drama-novel-analyze/references/adaptation-value.md +10 -3
  64. package/lib/drama/skills/short-drama-novel-analyze/references/aggregation-and-entities.md +25 -1
  65. package/lib/drama/skills/short-drama-novel-analyze/references/stage-contract.md +1 -0
  66. package/lib/drama/skills/short-drama-produce/SKILL.md +5 -1
  67. package/lib/drama/skills/short-drama-produce/references/adapter-contract.md +14 -20
  68. package/lib/drama/skills/short-drama-produce/references/providers/minimax-h3-video.md +8 -26
  69. package/lib/drama/skills/short-drama-produce/references/providers/minimax-speech.md +41 -0
  70. package/lib/drama/skills/short-drama-produce/scripts/provider_adapters.py +142 -1
  71. package/lib/drama/skills/short-drama-review/SKILL.md +4 -5
  72. package/lib/drama/skills/short-drama-review/references/production-quality-gates.md +6 -19
  73. package/lib/drama/skills/short-drama-review/references/review-method.md +6 -1
  74. package/lib/drama/skills/short-drama-review/references/rubric-assets-prompts.md +11 -0
  75. package/lib/drama/skills/short-drama-review/references/rubric-story-script.md +77 -3
  76. package/lib/drama/skills/short-drama-review/references/rubric-visual-motion.md +24 -35
  77. package/lib/drama/skills/short-drama-review/references/stage-contract.md +3 -0
  78. package/lib/drama/skills/short-drama-storyboard/SKILL.md +23 -11
  79. package/lib/drama/skills/short-drama-storyboard/references/blocking-playbooks.md +1 -1
  80. package/lib/drama/skills/short-drama-storyboard/references/lighting-craft.md +39 -0
  81. package/lib/drama/skills/short-drama-storyboard/references/production-shot-grammar.md +2 -2
  82. package/lib/drama/skills/short-drama-storyboard/references/shot-craft.md +139 -34
  83. package/lib/drama/skills/short-drama-storyboard/references/stage-contract.md +5 -3
  84. package/lib/drama/skills/short-drama-video-prompts/SKILL.md +15 -12
  85. package/lib/drama/skills/short-drama-video-prompts/references/camera-audio-continuity.md +29 -0
  86. package/lib/drama/skills/short-drama-video-prompts/references/delivery-profile.md +4 -5
  87. package/lib/drama/skills/short-drama-video-prompts/references/generability.md +4 -2
  88. package/lib/drama/skills/short-drama-video-prompts/references/minimax-h3.md +52 -39
  89. package/lib/drama/skills/short-drama-video-prompts/references/motion-recipe.md +24 -21
  90. package/lib/drama/skills/short-drama-video-prompts/references/performance-action-timing.md +9 -23
  91. package/lib/drama/skills/short-drama-video-prompts/references/production-prompt-grammar.md +14 -26
  92. package/lib/drama/skills/short-drama-video-prompts/references/review-and-fixtures.md +1 -1
  93. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.0.md +2 -3
  94. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.5.md +34 -9
  95. package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +3 -2
  96. package/lib/drama/skills/short-drama-video-prompts/references/target-model-profile.md +8 -1
  97. package/lib/drama/skills/short-drama-video-prompts/references/wan-3.0.md +103 -0
  98. package/lib/drama/skills/short-drama-video-prompts/scripts/motion_timing_check.py +8 -7
  99. package/lib/drama/skills/short-drama-write/SKILL.md +10 -7
  100. package/lib/drama/skills/short-drama-write/references/dialogue-craft.md +1 -1
  101. package/lib/drama/skills/short-drama-write/references/script-craft.md +56 -3
  102. package/lib/drama/skills/short-drama-write/references/stage-contract.md +4 -0
  103. package/lib/drama/skills/short-drama-write/scripts/duration_estimate.py +48 -2
  104. package/lib/index.js +346 -98
  105. package/lib/index.js.map +4 -4
  106. package/lib/novel-to-game/README.md +299 -59
  107. package/lib/novel-to-game/README_ZH.md +299 -56
  108. package/lib/novel-to-game/VERSION +1 -1
  109. package/lib/novel-to-game/examples/jin-ping-mei/build/BUILD_BRIEF.md +3 -1
  110. package/lib/novel-to-game/examples/jin-ping-mei/build/app/RUN.md +11 -3
  111. package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/new-guofeng.css +397 -8
  112. package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/style.css +0 -31
  113. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/data.js +71 -73
  114. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/engine.js +78 -89
  115. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/main.js +37 -14
  116. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/text.js +5 -5
  117. package/lib/novel-to-game/examples/jin-ping-mei/build/app/package.json +2 -1
  118. package/lib/novel-to-game/examples/jin-ping-mei/qa/README.md +11 -16
  119. package/lib/novel-to-game/examples/jin-ping-mei/qa/verification.json +11 -11
  120. package/lib/novel-to-game/examples/jin-ping-mei/qa/verify_playable_model.mjs +23 -0
  121. package/lib/novel-to-game/manifest.json +77 -87
  122. package/lib/novel-to-game/skills/game-art-direction/SKILL.md +7 -12
  123. package/lib/novel-to-game/skills/game-art-direction/references/art-direction-method.md +27 -106
  124. package/lib/novel-to-game/skills/game-build/SKILL.md +13 -14
  125. package/lib/novel-to-game/skills/game-build/references/blender-asset-workflow.md +24 -0
  126. package/lib/novel-to-game/skills/game-build/references/build-brief-contract.md +45 -82
  127. package/lib/novel-to-game/skills/game-build/references/generative-media-pipeline.md +14 -45
  128. package/lib/novel-to-game/skills/game-build/references/playable-model-contract.md +30 -65
  129. package/lib/novel-to-game/skills/game-build/references/tts-production-contract.md +13 -27
  130. package/lib/novel-to-game/skills/game-concept/SKILL.md +13 -15
  131. package/lib/novel-to-game/skills/game-concept/references/concept-method.md +28 -75
  132. package/lib/novel-to-game/skills/game-qa/SKILL.md +6 -7
  133. package/lib/novel-to-game/skills/game-qa/references/test-design-method.md +9 -5
  134. package/lib/novel-to-game/skills/game-world-design/SKILL.md +12 -16
  135. package/lib/novel-to-game/skills/game-world-design/references/narrative-design-method.md +23 -72
  136. package/lib/novel-to-game/skills/game-world-design/references/numeric-design-method.md +14 -48
  137. package/lib/novel-to-game/skills/game-world-design/references/world-design-method.md +36 -103
  138. package/lib/novel-to-game/skills/novel-game-analyze/SKILL.md +4 -10
  139. package/lib/novel-to-game/skills/novel-game-analyze/references/gameability-protocol.md +4 -4
  140. package/lib/novel-to-game/skills/novel-to-game/SKILL.md +9 -21
  141. package/lib/novel-to-game/skills/novel-to-game/references/intake-method.md +5 -4
  142. package/lib/novel-to-game/skills/novel-to-game/references/pipeline-contract.md +5 -8
  143. package/lib/oh-story/manifest.json +607 -327
  144. package/lib/oh-story/roles/chapter-extractor.md +177 -237
  145. package/lib/oh-story/roles/character-designer.md +1 -2
  146. package/lib/oh-story/roles/consistency-checker.md +15 -13
  147. package/lib/oh-story/roles/narrative-writer.md +36 -38
  148. package/lib/oh-story/roles/story-architect.md +9 -61
  149. package/lib/oh-story/roles/story-explorer.md +20 -125
  150. package/lib/oh-story/roles/story-researcher.md +0 -1
  151. package/lib/oh-story/skills/story/SKILL.md +15 -9
  152. package/lib/oh-story/skills/story/VERSION +1 -1
  153. package/lib/oh-story/skills/story/references/author-memory-maintenance.md +75 -0
  154. package/lib/oh-story/skills/story/references/author-memory.md +46 -94
  155. package/lib/oh-story/skills/story/scripts/author_memory_commit.py +934 -170
  156. package/lib/oh-story/skills/story-cover/SKILL.md +10 -1
  157. package/lib/oh-story/skills/story-deslop/SKILL.md +59 -73
  158. package/lib/oh-story/skills/story-deslop/references/agent-calls.md +5 -0
  159. package/lib/oh-story/skills/story-deslop/references/anti-ai-writing.md +12 -11
  160. package/lib/oh-story/skills/story-deslop/references/author-memory-maintenance.md +75 -0
  161. package/lib/oh-story/skills/story-deslop/references/author-memory.md +46 -94
  162. package/lib/oh-story/skills/story-deslop/references/banned-words.md +2 -2
  163. package/lib/oh-story/skills/story-deslop/references/deslop-gates.md +22 -5
  164. package/lib/oh-story/skills/story-deslop/references/style-resolution.md +4 -4
  165. package/lib/oh-story/skills/story-deslop/scripts/author_memory_commit.py +934 -170
  166. package/lib/oh-story/skills/story-deslop/scripts/check-ai-patterns.js +155 -8
  167. package/lib/oh-story/skills/story-import/SKILL.md +64 -584
  168. package/lib/oh-story/skills/story-import/references/character-state-reverse.md +1 -1
  169. package/lib/oh-story/skills/story-import/references/deep-analysis.md +47 -0
  170. package/lib/oh-story/skills/story-import/references/format-and-structure.md +1 -1
  171. package/lib/oh-story/skills/story-import/references/import-report.md +64 -0
  172. package/lib/oh-story/skills/story-import/references/import-special-cases.md +34 -0
  173. package/lib/oh-story/skills/story-import/references/import-tracking.md +95 -0
  174. package/lib/oh-story/skills/story-import/references/length-routing.md +1 -1
  175. package/lib/oh-story/skills/story-import/references/outline-reverse-rules.md +79 -0
  176. package/lib/oh-story/skills/story-import/references/outline-reverse.md +24 -0
  177. package/lib/oh-story/skills/story-import/references/state-tracking.md +4 -69
  178. package/lib/oh-story/skills/story-import/references/structure-mapping-long.md +98 -92
  179. package/lib/oh-story/skills/story-import/references/structure-mapping-short.md +24 -12
  180. package/lib/oh-story/skills/story-import/references/tracking-initialization.md +1 -1
  181. package/lib/oh-story/skills/story-import/references/tracking-transaction.md +15 -11
  182. package/lib/oh-story/skills/story-import/scripts/build_outline_brief.py +332 -0
  183. package/lib/oh-story/skills/story-import/scripts/check-outline-contract.js +132 -27
  184. package/lib/oh-story/skills/story-import/scripts/tracking_commit.py +478 -15
  185. package/lib/oh-story/skills/story-import/scripts/wordcount_core.py +182 -23
  186. package/lib/oh-story/skills/story-long-analyze/SKILL.md +81 -270
  187. package/lib/oh-story/skills/story-long-analyze/references/author-facing.md +252 -0
  188. package/lib/oh-story/skills/story-long-analyze/references/deconstruction-notes.md +3 -3
  189. package/lib/oh-story/skills/story-long-analyze/references/final-checks.md +19 -0
  190. package/lib/oh-story/skills/story-long-analyze/references/index-rebuild.md +11 -0
  191. package/lib/oh-story/skills/story-long-analyze/references/inspiration-library.md +105 -0
  192. package/lib/oh-story/skills/story-long-analyze/references/pipeline-ops.md +138 -64
  193. package/lib/oh-story/skills/story-long-analyze/references/semantic-acceptance-fixtures.md +84 -0
  194. package/lib/oh-story/skills/story-long-analyze/references/stage1-golden-chapters.md +128 -0
  195. package/lib/oh-story/skills/story-long-analyze/references/stage2-extraction.md +229 -0
  196. package/lib/oh-story/skills/story-long-analyze/references/stage3-plot-rhythm.md +480 -0
  197. package/lib/oh-story/skills/story-long-analyze/references/stage4-characters-settings.md +195 -0
  198. package/lib/oh-story/skills/story-long-analyze/references/stage5-report.md +33 -0
  199. package/lib/oh-story/skills/story-long-analyze/references/style-profile-generator.md +55 -128
  200. package/lib/oh-story/skills/story-long-analyze/references/style-profile-protocol.md +6 -6
  201. package/lib/oh-story/skills/story-long-analyze/references/synthesis-inputs.md +39 -0
  202. package/lib/oh-story/skills/story-long-analyze/scripts/build_chapter_index.py +466 -0
  203. package/lib/oh-story/skills/story-long-analyze/scripts/inspect_existing_assets.py +702 -0
  204. package/lib/oh-story/skills/story-long-analyze/scripts/inspiration_index.py +864 -0
  205. package/lib/oh-story/skills/story-long-analyze/scripts/manage_analysis_run.py +1145 -0
  206. package/lib/oh-story/skills/story-long-analyze/scripts/render_relation_chart.py +425 -0
  207. package/lib/oh-story/skills/story-long-scan/SKILL.md +45 -194
  208. package/lib/oh-story/skills/story-long-scan/references/platform-ciweimao.md +19 -0
  209. package/lib/oh-story/skills/story-long-scan/references/platform-fanqie.md +45 -0
  210. package/lib/oh-story/skills/story-long-scan/references/platform-jjwxc.md +28 -0
  211. package/lib/oh-story/skills/story-long-scan/references/platform-qidian.md +35 -0
  212. package/lib/oh-story/skills/story-long-scan/references/platform-qimao.md +27 -0
  213. package/lib/oh-story/skills/story-long-scan/references/topic-decision.md +6 -2
  214. package/lib/oh-story/skills/story-long-write/SKILL.md +49 -81
  215. package/lib/oh-story/skills/story-long-write/references/agent-calls.md +47 -0
  216. package/lib/oh-story/skills/story-long-write/references/anti-ai-writing.md +12 -11
  217. package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +24 -202
  218. package/lib/oh-story/skills/story-long-write/references/author-memory-maintenance.md +75 -0
  219. package/lib/oh-story/skills/story-long-write/references/author-memory.md +46 -94
  220. package/lib/oh-story/skills/story-long-write/references/banned-words.md +2 -2
  221. package/lib/oh-story/skills/story-long-write/references/benchmark-recall.md +7 -11
  222. package/lib/oh-story/skills/story-long-write/references/character-relations.md +49 -1
  223. package/lib/oh-story/skills/story-long-write/references/cross-book-recall.md +26 -0
  224. package/lib/oh-story/skills/story-long-write/references/deslop-gates.md +171 -0
  225. package/lib/oh-story/skills/story-long-write/references/dialogue-mastery.md +4 -0
  226. package/lib/oh-story/skills/story-long-write/references/emotion-on-page.md +116 -0
  227. package/lib/oh-story/skills/story-long-write/references/emotional-arc-design.md +1 -114
  228. package/lib/oh-story/skills/story-long-write/references/emotional-methods.md +2 -2
  229. package/lib/oh-story/skills/story-long-write/references/genre-prose-cards.md +1 -1
  230. package/lib/oh-story/skills/story-long-write/references/long-chapter-quality.md +7 -15
  231. package/lib/oh-story/skills/story-long-write/references/long-format.md +0 -8
  232. package/lib/oh-story/skills/story-long-write/references/long-genre-catalog.md +1 -1
  233. package/lib/oh-story/skills/story-long-write/references/long-genre-mechanics.md +3 -3
  234. package/lib/oh-story/skills/story-long-write/references/opening-design.md +2 -2
  235. package/lib/oh-story/skills/story-long-write/references/outline-conflict.md +4 -4
  236. package/lib/oh-story/skills/story-long-write/references/outline-methods.md +7 -7
  237. package/lib/oh-story/skills/story-long-write/references/outline-rhythm.md +3 -3
  238. package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +14 -69
  239. package/lib/oh-story/skills/story-long-write/references/plot-frameworks.md +1 -1
  240. package/lib/oh-story/skills/story-long-write/references/plot-special-topics.md +2 -2
  241. package/lib/oh-story/skills/story-long-write/references/project-files.md +19 -13
  242. package/lib/oh-story/skills/story-long-write/references/reader-contract-and-progression.md +13 -5
  243. package/lib/oh-story/skills/story-long-write/references/reference-index.md +5 -6
  244. package/lib/oh-story/skills/story-long-write/references/stop-and-fix.md +9 -0
  245. package/lib/oh-story/skills/story-long-write/references/style-combat-face.md +1 -58
  246. package/lib/oh-story/skills/story-long-write/references/style-genre-modules.md +1 -1
  247. package/lib/oh-story/skills/story-long-write/references/style-resolution.md +4 -4
  248. package/lib/oh-story/skills/story-long-write/references/tracking-initialization.md +1 -1
  249. package/lib/oh-story/skills/story-long-write/references/tracking-transaction.md +15 -11
  250. package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +81 -121
  251. package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +41 -139
  252. package/lib/oh-story/skills/story-long-write/references/workflow-outline.md +157 -0
  253. package/lib/oh-story/skills/story-long-write/references/workflow-revision.md +57 -67
  254. package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +112 -253
  255. package/lib/oh-story/skills/story-long-write/references/workflow-volume.md +142 -0
  256. package/lib/oh-story/skills/story-long-write/references/writer-prompt-fallback.md +6 -4
  257. package/lib/oh-story/skills/story-long-write/references/writing-craft.md +19 -65
  258. package/lib/oh-story/skills/story-long-write/scripts/author_memory_commit.py +934 -170
  259. package/lib/oh-story/skills/story-long-write/scripts/build_architect_brief.py +260 -0
  260. package/lib/oh-story/skills/story-long-write/scripts/build_writer_prompt.py +226 -25
  261. package/lib/oh-story/skills/story-long-write/scripts/check-ai-patterns.js +155 -8
  262. package/lib/oh-story/skills/story-long-write/scripts/check-outline-contract.js +132 -27
  263. package/lib/oh-story/skills/story-long-write/scripts/check-outline-copy.js +7 -2
  264. package/lib/oh-story/skills/story-long-write/scripts/outline_view.py +7 -4
  265. package/lib/oh-story/skills/story-long-write/scripts/storyctl.py +304 -46
  266. package/lib/oh-story/skills/story-long-write/scripts/tracking_commit.py +478 -15
  267. package/lib/oh-story/skills/story-long-write/scripts/wordcount_core.py +182 -23
  268. package/lib/oh-story/skills/story-review/SKILL.md +31 -302
  269. package/lib/oh-story/skills/story-review/references/agent-prompts.md +184 -0
  270. package/lib/oh-story/skills/story-review/references/anti-ai-writing.md +12 -11
  271. package/lib/oh-story/skills/story-review/references/author-memory-maintenance.md +75 -0
  272. package/lib/oh-story/skills/story-review/references/author-memory.md +46 -94
  273. package/lib/oh-story/skills/story-review/references/banned-words.md +2 -2
  274. package/lib/oh-story/skills/story-review/references/batch-review.md +19 -0
  275. package/lib/oh-story/skills/story-review/references/character-relations.md +49 -1
  276. package/lib/oh-story/skills/story-review/references/dialogue-mastery.md +4 -0
  277. package/lib/oh-story/skills/story-review/references/review-quality.md +6 -11
  278. package/lib/oh-story/skills/story-review/references/review-tracking.md +10 -0
  279. package/lib/oh-story/skills/story-review/references/solo.md +52 -0
  280. package/lib/oh-story/skills/story-review/references/style-resolution.md +4 -4
  281. package/lib/oh-story/skills/story-review/references/tracking-initialization.md +1 -1
  282. package/lib/oh-story/skills/story-review/references/tracking-transaction.md +15 -11
  283. package/lib/oh-story/skills/story-review/scripts/author_memory_commit.py +934 -170
  284. package/lib/oh-story/skills/story-review/scripts/check-ai-patterns.js +155 -8
  285. package/lib/oh-story/skills/story-review/scripts/tracking_commit.py +478 -15
  286. package/lib/oh-story/skills/story-review/scripts/wordcount_core.py +182 -23
  287. package/lib/oh-story/skills/story-setup/SKILL.md +71 -452
  288. package/lib/oh-story/skills/story-setup/references/agent-references/agent-quality.md +4 -4
  289. package/lib/oh-story/skills/story-setup/references/agent-references/anti-ai-writing.md +12 -11
  290. package/lib/oh-story/skills/story-setup/references/agent-references/banned-words.md +2 -2
  291. package/lib/oh-story/skills/story-setup/references/agent-references/benchmark-style-load.md +107 -0
  292. package/lib/oh-story/skills/story-setup/references/agent-references/character-relations.md +49 -1
  293. package/lib/oh-story/skills/story-setup/references/agent-references/deslop-gates.md +22 -5
  294. package/lib/oh-story/skills/story-setup/references/agent-references/dialogue-mastery.md +4 -0
  295. package/lib/oh-story/skills/story-setup/references/agent-references/emotion-on-page.md +116 -0
  296. package/lib/oh-story/skills/story-setup/references/agent-references/emotional-arc-design.md +1 -114
  297. package/lib/oh-story/skills/story-setup/references/agent-references/format-and-structure.md +1 -1
  298. package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards.md +1 -1
  299. package/lib/oh-story/skills/story-setup/references/agent-references/long-emotional-methods.md +2 -2
  300. package/lib/oh-story/skills/story-setup/references/agent-references/long-genre-catalog.md +1 -1
  301. package/lib/oh-story/skills/story-setup/references/agent-references/long-genre-mechanics.md +3 -3
  302. package/lib/oh-story/skills/story-setup/references/agent-references/long-quality.md +7 -5
  303. package/lib/oh-story/skills/story-setup/references/agent-references/opening-design.md +2 -2
  304. package/lib/oh-story/skills/story-setup/references/agent-references/outline-conflict.md +4 -4
  305. package/lib/oh-story/skills/story-setup/references/agent-references/outline-methods.md +7 -7
  306. package/lib/oh-story/skills/story-setup/references/agent-references/outline-rhythm.md +3 -3
  307. package/lib/oh-story/skills/story-setup/references/agent-references/short-emotional-methods.md +1 -1
  308. package/lib/oh-story/skills/story-setup/references/agent-references/short-genre-formulas.md +0 -15
  309. package/lib/oh-story/skills/story-setup/references/agent-references/short-reversal.md +1 -1
  310. package/lib/oh-story/skills/story-setup/references/agent-references/style-combat-face.md +1 -58
  311. package/lib/oh-story/skills/story-setup/references/agent-references/style-genre-modules.md +1 -1
  312. package/lib/oh-story/skills/story-setup/references/agent-references/style-resolution.md +4 -4
  313. package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +19 -65
  314. package/lib/oh-story/skills/story-setup/references/diagnostics.md +4 -4
  315. package/lib/oh-story/skills/story-short-analyze/SKILL.md +56 -110
  316. package/lib/oh-story/skills/story-short-analyze/references/analysis-character-relations.md +1 -1
  317. package/lib/oh-story/skills/story-short-analyze/references/analysis-method.md +42 -0
  318. package/lib/oh-story/skills/story-short-analyze/references/optional-modules.md +97 -0
  319. package/lib/oh-story/skills/story-short-analyze/references/output-contract.md +9 -47
  320. package/lib/oh-story/skills/story-short-analyze/references/quality-checklist.md +80 -0
  321. package/lib/oh-story/skills/story-short-analyze/references/source-story-quality.md +4 -4
  322. package/lib/oh-story/skills/story-short-analyze/references/stage2-3-structure-emotion.md +308 -0
  323. package/lib/oh-story/skills/story-short-analyze/references/stage4-6-reversal-summary.md +611 -0
  324. package/lib/oh-story/skills/story-short-scan/SKILL.md +35 -65
  325. package/lib/oh-story/skills/story-short-scan/references/manual-rank-input.md +36 -0
  326. package/lib/oh-story/skills/story-short-scan/references/platform-dianzhong.md +24 -0
  327. package/lib/oh-story/skills/story-short-scan/references/platform-heiyan.md +21 -0
  328. package/lib/oh-story/skills/story-short-scan/references/topic-match.md +38 -0
  329. package/lib/oh-story/skills/story-short-write/SKILL.md +23 -175
  330. package/lib/oh-story/skills/story-short-write/references/agent-calls.md +13 -0
  331. package/lib/oh-story/skills/story-short-write/references/author-memory-maintenance.md +75 -0
  332. package/lib/oh-story/skills/story-short-write/references/author-memory.md +46 -94
  333. package/lib/oh-story/skills/story-short-write/references/banned-words.md +2 -2
  334. package/lib/oh-story/skills/story-short-write/references/benchmark-recall.md +1 -21
  335. package/lib/oh-story/skills/story-short-write/references/dialogue-mastery.md +4 -0
  336. package/lib/oh-story/skills/story-short-write/references/emotional-methods.md +1 -1
  337. package/lib/oh-story/skills/story-short-write/references/genre-writing-formulas.md +0 -15
  338. package/lib/oh-story/skills/story-short-write/references/output-contract.md +9 -47
  339. package/lib/oh-story/skills/story-short-write/references/reference-index.md +17 -47
  340. package/lib/oh-story/skills/story-short-write/references/scene-craft.md +40 -0
  341. package/lib/oh-story/skills/story-short-write/references/short-craft.md +7 -43
  342. package/lib/oh-story/skills/story-short-write/references/short-format.md +3 -3
  343. package/lib/oh-story/skills/story-short-write/references/short-prose-quality.md +2 -1
  344. package/lib/oh-story/skills/story-short-write/references/short-reversal.md +1 -1
  345. package/lib/oh-story/skills/story-short-write/references/style-resolution.md +4 -4
  346. package/lib/oh-story/skills/story-short-write/references/submission-craft.md +1 -1
  347. package/lib/oh-story/skills/story-short-write/references/villain-and-reveal.md +5 -10
  348. package/lib/oh-story/skills/story-short-write/references/workflow-design.md +21 -13
  349. package/lib/oh-story/skills/story-short-write/references/workflow-draft.md +116 -0
  350. package/lib/oh-story/skills/story-short-write/references/workflow-revision.md +99 -0
  351. package/lib/oh-story/skills/story-short-write/references/writing-workflow.md +7 -119
  352. package/lib/oh-story/skills/story-short-write/scripts/author_memory_commit.py +934 -170
  353. package/lib/oh-story/skills/story-short-write/scripts/check-ai-patterns.js +155 -8
  354. package/lib/oh-story/skills/story-short-write/scripts/check-outline-copy.js +7 -2
  355. package/lib/types/client/drama-production-view.d.ts.map +1 -1
  356. package/lib/types/client/file-activity.d.ts +19 -1
  357. package/lib/types/client/file-activity.d.ts.map +1 -1
  358. package/lib/types/client/index.d.ts.map +1 -1
  359. package/lib/types/client/production-prompts.d.ts +7 -0
  360. package/lib/types/client/production-prompts.d.ts.map +1 -1
  361. package/lib/types/client/production-runtime.d.ts +16 -0
  362. package/lib/types/client/production-runtime.d.ts.map +1 -1
  363. package/lib/types/client/video-studio.d.ts.map +1 -1
  364. package/lib/types/drama-adapters.d.ts +5 -3
  365. package/lib/types/drama-adapters.d.ts.map +1 -1
  366. package/lib/types/native-hooks.d.ts +53 -1
  367. package/lib/types/native-hooks.d.ts.map +1 -1
  368. package/lib/types/role-identity.d.ts +17 -0
  369. package/lib/types/role-identity.d.ts.map +1 -0
  370. package/lib/types/role-tool.d.ts.map +1 -1
  371. package/lib/types/skill-provider.d.ts.map +1 -1
  372. package/lib/types/video-project.d.ts.map +1 -1
  373. package/lib/types/workspace-route.d.ts.map +1 -1
  374. package/lib/video-recap/CHANGELOG.md +60 -1
  375. package/lib/video-recap/README.en.md +348 -137
  376. package/lib/video-recap/README.md +340 -136
  377. package/lib/video-recap/manifest.json +406 -251
  378. package/lib/video-recap/skills/video-assemble/SKILL.md +30 -15
  379. package/lib/video-recap/skills/video-assemble/references/audio-modes.md +63 -0
  380. package/lib/video-recap/skills/video-assemble/references/explicit-audio-mix.md +75 -0
  381. package/lib/video-recap/skills/video-assemble/references/foreground-compose.md +118 -0
  382. package/lib/video-recap/skills/video-assemble/references/narration-adoption.md +103 -0
  383. package/lib/video-recap/skills/video-assemble/references/packaging.md +45 -0
  384. package/lib/video-recap/skills/video-assemble/references/pair-media.md +74 -0
  385. package/lib/video-recap/skills/video-assemble/references/source-score.md +147 -0
  386. package/lib/video-recap/skills/video-assemble/references/subtitle-track.md +202 -0
  387. package/lib/video-recap/skills/video-assemble/scripts/adoption/__init__.py +1 -0
  388. package/lib/video-recap/skills/video-assemble/scripts/adoption/audio_mix_binding.py +279 -0
  389. package/lib/video-recap/skills/video-assemble/scripts/adoption/frozen_audio.py +187 -0
  390. package/lib/video-recap/skills/video-assemble/scripts/adoption/narration_binding.py +323 -0
  391. package/lib/video-recap/skills/video-assemble/scripts/adoption/strict_inputs.py +109 -0
  392. package/lib/video-recap/skills/video-assemble/scripts/adoption/strict_publish.py +130 -0
  393. package/lib/video-recap/skills/video-assemble/scripts/artifacts.py +10 -46
  394. package/lib/video-recap/skills/video-assemble/scripts/assemble.py +378 -119
  395. package/lib/video-recap/skills/video-assemble/scripts/assemble_constants.py +29 -12
  396. package/lib/video-recap/skills/video-assemble/scripts/assembly_contract.py +95 -44
  397. package/lib/video-recap/skills/video-assemble/scripts/assembly_settings.py +75 -32
  398. package/lib/video-recap/skills/video-assemble/scripts/audio_mix.py +11 -11
  399. package/lib/video-recap/skills/video-assemble/scripts/compose_foreground.py +293 -0
  400. package/lib/video-recap/skills/video-assemble/scripts/export_jianying.py +71 -78
  401. package/lib/video-recap/skills/video-assemble/scripts/jianying/__init__.py +1 -0
  402. package/lib/video-recap/skills/video-assemble/scripts/{jianying_builders.py → jianying/builders.py} +39 -67
  403. package/lib/video-recap/skills/video-assemble/scripts/{jianying_model.py → jianying/model.py} +3 -11
  404. package/lib/video-recap/skills/video-assemble/scripts/{jianying_optional.py → jianying/optional.py} +1 -1
  405. package/lib/video-recap/skills/video-assemble/scripts/jianying/schema.py +53 -0
  406. package/lib/video-recap/skills/video-assemble/scripts/{jianying_templates.py → jianying/templates.py} +1 -1
  407. package/lib/video-recap/skills/video-assemble/scripts/{jianying_timeline_contract.py → jianying/timeline_contract.py} +34 -13
  408. package/lib/video-recap/skills/video-assemble/scripts/{jianying_writer.py → jianying/writer.py} +7 -17
  409. package/lib/video-recap/skills/video-assemble/scripts/lib.py +37 -4
  410. package/lib/video-recap/skills/video-assemble/scripts/media.py +12 -21
  411. package/lib/video-recap/skills/video-assemble/scripts/narration_audio.py +64 -34
  412. package/lib/video-recap/skills/video-assemble/scripts/packaging.py +122 -0
  413. package/lib/video-recap/skills/video-assemble/scripts/pair_media.py +216 -0
  414. package/lib/video-recap/skills/video-assemble/scripts/render_preflight.py +1 -3
  415. package/lib/video-recap/skills/video-assemble/scripts/source_score.py +469 -0
  416. package/lib/video-recap/skills/video-assemble/scripts/source_subtitles.py +25 -9
  417. package/lib/video-recap/skills/video-assemble/scripts/subtitles/__init__.py +1 -0
  418. package/lib/video-recap/skills/video-assemble/scripts/{subtitle_core.py → subtitles/core.py} +13 -6
  419. package/lib/video-recap/skills/video-assemble/scripts/{subtitle_render.py → subtitles/render.py} +5 -4
  420. package/lib/video-recap/skills/video-assemble/scripts/subtitles/track.py +324 -0
  421. package/lib/video-recap/skills/video-assemble/scripts/subtitles/track_binding.py +200 -0
  422. package/lib/video-recap/skills/video-assemble/scripts/timeline.py +30 -46
  423. package/lib/video-recap/skills/video-assemble/scripts/timeline_emit.py +91 -7
  424. package/lib/video-recap/skills/video-assemble/scripts/visual_render.py +22 -8
  425. package/lib/video-recap/skills/video-cut/SKILL.md +34 -16
  426. package/lib/video-recap/skills/video-cut/references/shot-review.md +50 -0
  427. package/lib/video-recap/skills/video-cut/scripts/cut.py +2 -28
  428. package/lib/video-recap/skills/video-cut/scripts/cut_cli.py +58 -62
  429. package/lib/video-recap/skills/video-cut/scripts/cut_contract.py +21 -106
  430. package/lib/video-recap/skills/video-cut/scripts/cut_render.py +14 -9
  431. package/lib/video-recap/skills/video-cut/scripts/lib.py +39 -0
  432. package/lib/video-recap/skills/video-cut/scripts/narration_mapping.py +2 -155
  433. package/lib/video-recap/skills/video-cut/scripts/narrative_selection.py +244 -0
  434. package/lib/video-recap/skills/video-cut/scripts/shot_review.py +357 -0
  435. package/lib/video-recap/skills/video-recap/SKILL.md +86 -42
  436. package/lib/video-recap/skills/video-recap/references/audio-routing.md +126 -0
  437. package/lib/video-recap/skills/video-recap/references/config-playbook.md +12 -8
  438. package/lib/video-recap/skills/video-recap/references/data-schema.md +44 -33
  439. package/lib/video-recap/skills/video-recap/references/resource-library.md +151 -0
  440. package/lib/video-recap/skills/video-recap/references/shift-left-qc-schema.md +1 -1
  441. package/lib/video-recap/skills/video-recap/scripts/doctor.py +123 -30
  442. package/lib/video-recap/skills/video-recap/scripts/final_qc.py +22 -75
  443. package/lib/video-recap/skills/video-recap/scripts/lib.py +3 -3
  444. package/lib/video-recap/skills/video-recap/scripts/library.py +509 -0
  445. package/lib/video-recap/skills/video-recap/scripts/materials.py +63 -91
  446. package/lib/video-recap/skills/video-recap/scripts/mimo_qc.py +8 -70
  447. package/lib/video-recap/skills/video-recap/scripts/project_binding.py +286 -0
  448. package/lib/video-recap/skills/video-recap/scripts/qc/__init__.py +1 -0
  449. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_client.py → qc/mimo_client.py} +1 -1
  450. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_evidence.py → qc/mimo_evidence.py} +33 -66
  451. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_observations.py → qc/mimo_observations.py} +3 -11
  452. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_payload.py → qc/mimo_payload.py} +4 -7
  453. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_report.py → qc/mimo_report.py} +17 -28
  454. package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_runner.py → qc/mimo_runner.py} +2 -2
  455. package/lib/video-recap/skills/video-recap/scripts/qc_contract.py +0 -19
  456. package/lib/video-recap/skills/video-recap/scripts/recap_cli.py +119 -50
  457. package/lib/video-recap/skills/video-recap/scripts/recap_inspect.py +32 -114
  458. package/lib/video-recap/skills/video-recap/scripts/recap_review.py +9 -23
  459. package/lib/video-recap/skills/video-recap/scripts/recap_runner.py +387 -334
  460. package/lib/video-recap/skills/video-recap/scripts/recap_runtime.py +23 -23
  461. package/lib/video-recap/skills/video-recap/scripts/recap_source.py +278 -0
  462. package/lib/video-recap/skills/video-recap/scripts/recap_stage_qc.py +25 -12
  463. package/lib/video-recap/skills/video-recap/scripts/recap_timeline.py +59 -52
  464. package/lib/video-recap/skills/video-recap/scripts/resource_lock.py +162 -0
  465. package/lib/video-recap/skills/video-script/SKILL.md +16 -13
  466. package/lib/video-recap/skills/video-script/references/creative-editing-playbook.md +9 -5
  467. package/lib/video-recap/skills/video-script/references/promotional-copy.md +68 -0
  468. package/lib/video-recap/skills/video-script/references/research-guide.md +1 -1
  469. package/lib/video-recap/skills/video-script/scripts/evidence_bundle.py +24 -76
  470. package/lib/video-recap/skills/video-script/scripts/lib.py +10 -87
  471. package/lib/video-recap/skills/video-script/scripts/narration_lint.py +63 -39
  472. package/lib/video-recap/skills/video-script/scripts/review.py +0 -2
  473. package/lib/video-recap/skills/video-script/scripts/review_grounding.py +35 -59
  474. package/lib/video-recap/skills/video-script/scripts/review_response.py +66 -128
  475. package/lib/video-recap/skills/video-script/scripts/review_runner.py +12 -20
  476. package/lib/video-recap/skills/video-script/scripts/speech_ownership.py +4 -4
  477. package/lib/video-recap/skills/video-script/scripts/validate.py +53 -42
  478. package/lib/video-recap/skills/video-understanding/SKILL.md +6 -4
  479. package/lib/video-recap/skills/video-understanding/references/data-schema.md +50 -156
  480. package/lib/video-recap/skills/video-understanding/references/research-guide.md +4 -4
  481. package/lib/video-recap/skills/video-understanding/scripts/asr.py +85 -65
  482. package/lib/video-recap/skills/video-understanding/scripts/asr_timing_evidence.py +270 -0
  483. package/lib/video-recap/skills/video-understanding/scripts/brief.py +2 -5
  484. package/lib/video-recap/skills/video-understanding/scripts/briefing/__init__.py +1 -0
  485. package/lib/video-recap/skills/{video-script/scripts/agent_brief.py → video-understanding/scripts/briefing/builder.py} +38 -35
  486. package/lib/video-recap/skills/video-understanding/scripts/{brief_context.py → briefing/context.py} +4 -35
  487. package/lib/video-recap/skills/{video-script/scripts/brief_inputs.py → video-understanding/scripts/briefing/inputs.py} +9 -31
  488. package/lib/video-recap/skills/{video-script/scripts/brief_timeline.py → video-understanding/scripts/briefing/timeline.py} +5 -6
  489. package/lib/video-recap/skills/video-understanding/scripts/consolidate.py +65 -116
  490. package/lib/video-recap/skills/video-understanding/scripts/detect.py +31 -40
  491. package/lib/video-recap/skills/video-understanding/scripts/lib.py +30 -86
  492. package/lib/video-recap/skills/video-understanding/scripts/narration_lint.py +63 -39
  493. package/lib/video-recap/skills/video-understanding/scripts/speech_ownership.py +4 -4
  494. package/lib/video-recap/skills/video-understanding/scripts/storyboard.py +17 -79
  495. package/lib/video-recap/skills/video-understanding/scripts/understanding_brief.py +14 -40
  496. package/lib/video-recap/skills/video-understanding/scripts/understanding_cache.py +64 -46
  497. package/lib/video-recap/skills/video-understanding/scripts/understanding_runner.py +31 -11
  498. package/lib/video-recap/skills/video-understanding/scripts/understanding_storyboard.py +19 -14
  499. package/lib/video-recap/skills/video-understanding/scripts/vlm.py +80 -108
  500. package/lib/video-recap/skills/video-voiceover/SKILL.md +29 -19
  501. package/lib/video-recap/skills/video-voiceover/references/index-tts.md +31 -0
  502. package/lib/video-recap/skills/video-voiceover/scripts/approved_text_policy.py +123 -0
  503. package/lib/video-recap/skills/video-voiceover/scripts/dub.py +51 -59
  504. package/lib/video-recap/skills/video-voiceover/scripts/lib.py +8 -44
  505. package/lib/video-recap/skills/video-voiceover/scripts/providers/__init__.py +1 -0
  506. package/lib/video-recap/skills/video-voiceover/scripts/providers/index_tts.py +184 -0
  507. package/lib/video-recap/skills/video-voiceover/scripts/voiceover.py +212 -134
  508. package/package.json +45 -45
  509. package/lib/novel-to-game/skills/game-world-design/references/dialogue-design-method.md +0 -58
  510. package/lib/novel-to-game/skills/game-world-design/references/game-writing-craft.md +0 -53
  511. package/lib/novel-to-game/skills/novel-to-game/references/intake-benchmark-reference.md +0 -38
  512. package/lib/oh-story/skills/story-long-analyze/references/material-decomposition.md +0 -530
  513. package/lib/oh-story/skills/story-long-analyze/references/output-templates.md +0 -559
  514. package/lib/oh-story/skills/story-long-scan/references/scan-output-format.md +0 -207
  515. package/lib/oh-story/skills/story-long-write/references/state-tracking.md +0 -108
  516. package/lib/oh-story/skills/story-short-analyze/references/material-decomposition.md +0 -678
  517. package/lib/oh-story/skills/story-short-analyze/references/output-templates.md +0 -561
  518. package/lib/video-recap/skills/video-assemble/scripts/jianying_schema.py +0 -98
  519. package/lib/video-recap/skills/video-recap/references/creative-editing-playbook.md +0 -225
  520. package/lib/video-recap/skills/video-recap/references/research-guide.md +0 -74
  521. package/lib/video-recap/skills/video-recap/references/timeline-and-jianying.md +0 -250
  522. package/lib/video-recap/skills/video-script/scripts/brief_context.py +0 -348
  523. package/lib/video-recap/skills/video-script/scripts/narration.py +0 -12
  524. package/lib/video-recap/skills/video-understanding/scripts/agent_brief.py +0 -399
  525. package/lib/video-recap/skills/video-understanding/scripts/brief_inputs.py +0 -290
  526. package/lib/video-recap/skills/video-understanding/scripts/brief_timeline.py +0 -327
  527. /package/lib/video-recap/skills/video-assemble/scripts/{jianying_tracks.py → jianying/tracks.py} +0 -0
  528. /package/lib/video-recap/skills/video-recap/scripts/{mimo_qc_contract.py → qc/mimo_contract.py} +0 -0
  529. /package/lib/video-recap/skills/video-voiceover/scripts/{fish_audio.py → providers/fish_audio.py} +0 -0
@@ -33,14 +33,19 @@ description: >
33
33
  ## 3. 输入契约
34
34
 
35
35
  - `<video>`:源视频;cut 模式下为 `edited_source.mp4`。
36
- - `work_dir/tts_meta.json`:配音阶段写出的 `{segments: [...]}`。每段包含 `audio_path`、时间、`pause_after_ms`、`overlaps_speech` 和用于混音/字幕的位置。
36
+ - `work_dir/tts_meta.json`:默认 `narration` 模式必需;配音阶段写出的 `{segments: [...]}`。每段包含 `audio_path`、时间、`pause_after_ms`、`overlaps_speech` 和用于混音/字幕的位置。显式 `source-mix` / `adopted-packet-copy` 模式不读取它。
37
+ - 已采用的配音使用显式 `--tts-meta` 和 `--narration-adoption`:后者由调用方独立确认文字、请求的引擎/声线和速度策略,不能从待消费元数据自动“批准”出来。完整格式与记录边界见 `references/narration-adoption.md`。
38
+ - 已采用的完整声音底轨与逐段配音可再传 `--audio-mix-adoption`;严格格式、48 kHz 声道矩阵和双 binding 事务见 `references/explicit-audio-mix.md`。
37
39
 
38
- 下面的 `scripts/...` 均相对于本技能目录。若执行器从仓库根目录启动,请给脚本路径加上本技能的绝对目录。脚本不从其他技能目录读取文件;外部输入仅限命令显式传入的视频、参数与 `work_dir` 产物。
40
+ 下面的 `scripts/...` 均相对于本技能目录。若执行器从仓库根目录启动,请给脚本路径加上本技能的绝对目录。
39
41
 
40
42
  ## 4. 运行命令
41
43
 
42
44
  ```bash
43
45
  python3 scripts/assemble.py <video> --work-dir <work_dir> \
46
+ [--audio-mode narration|source-mix|adopted-packet-copy] [--audio-stream-index <N>] \
47
+ [--tts-meta <tts_meta.json> --narration-adoption <narration_adoption.json>] \
48
+ [--audio-mix-adoption <audio_mix_adoption.json>] \
44
49
  [--recap-stem <name>] [--output-dir <dir>] [--no-burn-subtitles] \
45
50
  [--subtitle-y-top <inclusive-y> --subtitle-y-bot <exclusive-y>] \
46
51
  [--source-video <orig.mp4>] [--export-jianying [--jianying-out <dir>]]
@@ -53,15 +58,20 @@ python3 scripts/assemble.py <video> --work-dir <work_dir> \
53
58
  - `subtitles.srt`:旁白字幕;烧录时另有 `subtitles.ass`。
54
59
  - `timeline.json`:后端无关的多轨模型,包含视频、原声、旁白、BGM、字幕和 ducking 自动化。
55
60
  - `_placed_*.wav`:实际写入主混音的完整逐段旁白 PCM;时间线与剪映只引用这些文件。
56
- - `assembly_manifest.json`:输入来源、cut 来源指纹、渲染设置与最终输出路径。
61
+ - `narration_input_binding.json`:旁白输入、转换、实际放置、旁白总轨和最终音轨的消费记录(路径、PCM 参数、packet 计数)。区分未采用与已绑定采用决定两种状态;不等于声线鉴定或听审。
62
+ - `audio_mix_binding.json`:显式完整声音分支消费的画面时钟、底轨、48 kHz 配音放置、premaster、固定 master gain、最终 PCM/AAC 事实与 narration binding 路径的记录。
63
+ - `assembly_manifest.json`:输入来源、cut 来源标识(路径、大小、mtime)、渲染设置与最终输出路径。
57
64
  - `assembly_qc.json`:旁白完整性、原声句末交接、时间线素材时长与交付质量的发布门禁。
58
65
  - 剪映草稿目录:仅 `--export-jianying` 时生成,包含 `draft_content.json`、`draft_info.json` 与 `draft_meta_info.json`。
59
66
 
60
67
  ## 6. 合成规则
61
68
 
69
+ - 音频模式的处理与冻结语义见 `references/audio-modes.md`。默认仍为 `narration`;另外两种模式必须显式选择。
70
+ - `--audio-mix-adoption` 只与显式 `--tts-meta`、`--narration-adoption` 同时使用;它保留 `narration` 模式名,但跳过旧速度/适配、原声 handoff、环境 BGM、duck、loudnorm 和 limiter。
62
71
  - 音频按轨道混合:原声、可选 BGM 与旁白各自独立。
63
72
  - 旁白不做任何容差裁尾;温和加速后仍放不下即 `no_safe_fit`。每段 `_placed_*.wav`
64
73
  必须与序列化后的时间线区间等长或更短,否则 `timeline_audio_mismatch` 阻断。
74
+ - 已采用配音的 v1 合同只支持原速、禁止段内适速;不能让环境默认 1.15 倍速或旧缓存覆盖它。放不下就修订安排,不裁尾。严格运行使用新工作目录与新输出路径;输入/实际混音来源变动或 QC 失败时,不发布候选成片。没有采用文件的旧入口仍是兼容模式,不自动获得同等证据。
65
75
  - 原声在旁白结束后保持压低到下一可靠句末的 `pause_start`,只在实测停顿内渐强,
66
76
  于 `source_restore_at` 回满;无后续锚点时保持压低到时间线末端,而不是放出半句。
67
77
  - `--export-jianying` / `EXPORT_JIANYING=1` 可把 `timeline.json` 导出为可编辑草稿。cut 模式应传 `--source-video <orig>`,让草稿引用真实原片区间。
@@ -76,22 +86,27 @@ python3 scripts/assemble.py <video> --work-dir <work_dir> \
76
86
  - 烧录字幕需要带 `subtitles` / libass 的 ffmpeg;合成阶段会预检并在缺失时明确失败。
77
87
  - 原声留白中的对白字幕优先读取 Agent 校对的 `original_subtitles.json`;否则保守映射 ASR。只有遮罩覆盖留白或用户字幕明确要求替换时才烧录原声对白,并用 `「」` 与旁白区分。
78
88
 
79
- ## 7. 字幕与可选包装
80
-
81
- 先锁定画面、剪点、旁白和混音,再投入字幕动画或边框包装。字幕样式不能掩盖叙事、剪点或声音问题。
89
+ ### 按原片区间准备声音,而不是整体压低旧成片
82
90
 
83
- 普通交付优先使用现有 ASS 路径。只有用户需要更精细的逐 cue 排版、动画或透明图层时,才使用 Remotion 或其他代码渲染器作为**项目级可选实现**,不要把特定框架、字体、颜色或黄字写成核心依赖。推荐顺序:
91
+ 已有多段原声取舍和独立 BGM 决定时,先用 `references/source-score.md` 的独立
92
+ `source_score.py` 从原片声音流按精确帧区间重建原声轨、音乐轨及两者之和;它只输出
93
+ 声音底轨和来源回执。要与逐段已采用配音合成,再由调用方提供 `references/explicit-audio-mix.md`
94
+ 的严格 adoption;不要将底轨塞入旧入口自动 duck,也不要从含旧解说的成片取整条声音冒充干净原声。
84
95
 
85
- 1. 输出无包装的锁定母版,确认音画内容不再变化。
86
- 2. 从实际 TTS / 时间线生成 captions;TTS 块保持连续思路,字幕可以按阅读宽度拆 cue。
87
- 3. 先抽检开头、亮背景、暗背景、人物近景和长字幕样帧,确定字号、安全区、描边、阴影及是否需要底板。
88
- 4. 渲染完整透明字幕层,再 overlay 到锁定母版;合成后确认音轨未被意外改写。
89
- 5. 完整播放实际最终文件,并复查字幕遮脸、跳字、断行、首尾帧和边界处残影。
96
+ ## 7. 字幕与可选包装
90
97
 
91
- 包装价值来自稳定、可读、与内容一致的排版,不来自效果数量。先建立统一字体、颜色、描边/阴影和轻量动效;底板、边框、花字与音效只有解决具体可读性或叙事任务时才加入。一个样帧好看不代表全片成立。
98
+ 先锁定画面、剪点、旁白和混音,再投入字幕动画或边框包装;字幕样式不能掩盖叙事、剪点或声音问题。
99
+ 普通交付优先使用现有 ASS 路径;只有用户需要逐 cue 排版、动画或透明图层时,才用项目级代码渲染器,
100
+ 并按 `references/foreground-compose.md` 把它生成的 RGBA 序列叠到锁定母版。包装顺序与样帧抽检清单见
101
+ `references/packaging.md`。
92
102
 
93
103
  ## 8. 能力边界
94
104
 
95
- - 不生成旁白文字,也不合成 TTS。
96
- - 不重新转写视频,不擅自改变 Agent 的时间决定。
105
+ - 不生成旁白文字,不合成 TTS,不重新转写视频。
97
106
  - 字幕烧录默认开启;关闭时不会重编码绘制字幕区域。
107
+
108
+ 显式输出轴字幕轨的独立合同、完整替换语义和当前边界见 `references/subtitle-track.md`。
109
+
110
+ 画面回原片重建后,若需保留另一文件中的已采用完整混音,先按
111
+ `references/pair-media.md` 显式配对独立画面与音轨。配对只复制流,不补字幕或片名卡;
112
+ 后续字幕轨必须重新绑定配对后的容器与 `a:0`,不能继续沿用旧版本身份。
@@ -0,0 +1,63 @@
1
+ # Assembly audio modes
2
+
3
+ `assemble.py` keeps `narration` as its API and CLI default. Non-narration
4
+ behavior is opt-in with `--audio-mode`; `--audio-stream-index N` is the
5
+ zero-based audio ordinal used by FFmpeg's `0:a:N` selector.
6
+
7
+ ## `narration`
8
+
9
+ - Requires non-empty `tts_meta.json` segments, as before.
10
+ - Builds/places narration WAV, performs source ducking and optional BGM mix,
11
+ then applies the configured final loudness/limiter stage and AAC encoding.
12
+ - Missing source audio may use the existing synthetic-silence fallback.
13
+ - With the additional strict `--audio-mix-adoption`, narration instead consumes an
14
+ adopted prepared bed plus complete direct-to-48-kHz narration placements. This is
15
+ still narration mode, but it bypasses ambient BGM, ducking, speed/fit, loudnorm, and
16
+ limiter operations. See `explicit-audio-mix.md`.
17
+
18
+ ## `source-mix`
19
+
20
+ - Does not read or require `tts_meta.json` and never creates narration audio.
21
+ - Uses the selected input audio stream, applies `IDLE_ORIG_VOLUME`, mixes a
22
+ declared `BGM_PATH` when present, and runs the configured final
23
+ loudness/limiter stage before AAC encoding.
24
+ - A declared but missing `BGM_PATH` is an error in this new mode (the legacy
25
+ narration-mode warn-and-skip behavior remains unchanged).
26
+ - This is a processed mix, not frozen audio. `assembly_qc.json` reports the
27
+ operations that actually ran.
28
+
29
+ ## `adopted-packet-copy`
30
+
31
+ - First implementation supports a selected AAC stream from `<video>` only.
32
+ - Rejects TTS segments, explicit `--tts-meta`, any configured `BGM_PATH`, a
33
+ missing/wrong stream, unsupported codec, or audio/picture interval mismatch.
34
+ - Maps that stream with `-c:a copy`. It does not build narration, mix, duck,
35
+ normalize, limit, resample, change tempo, or add silence.
36
+ - It deliberately omits `-t` and `-shortest`, preserving AAC priming and tail
37
+ packets. After rendering, the output is probed and compared with the input:
38
+ decoder parameters, packet count, total payload bytes, the packet-clock span,
39
+ and every packet's size and PTS/DTS/duration converted to rational time must
40
+ match. Packet side data also must match, including AAC skip-sample/
41
+ discard-padding values and their reason fields.
42
+ - QC/manifest evidence records selected stream, absolute stream index, codec,
43
+ time base, sample rate, channels/layout, packet count, payload bytes, packet
44
+ details, and actual operation flags.
45
+
46
+ The adopted-copy settings payload excludes narration/mix/loudness defaults, so
47
+ irrelevant ambient settings do not invalidate a frozen-audio render. Video
48
+ filters and video re-encoding remain allowed; packet verification must still
49
+ pass afterward.
50
+
51
+ These modes do not create a commercial quality profile, automatic speech
52
+ alignment, listening approval, or release approval. An explicit subtitle track
53
+ is only a version/media-bound timing declaration; its evidence labels and
54
+ `NOT_CHECKED` acoustic/listening status remain authoritative.
55
+ Matching packets and decoder parameters show the encoded audio was copied; they
56
+ do not prove perceptual quality or that a person listened to the result.
57
+
58
+ `timeline.json` represents either non-narration mode as one complete clip from
59
+ the current input video and records the selected stream. Adopted copy uses gain
60
+ 1 with no automation. Source-mix records processed/non-frozen delivery and is
61
+ not claimed to be reconstructable by an editor. The optional JianYing exporter
62
+ currently supports only selected stream 0; requesting export with another
63
+ stream fails instead of silently substituting the default stream.
@@ -0,0 +1,75 @@
1
+ # Explicit adopted full-sound mix
2
+
3
+ Use this path only when the picture, a completed `prepared_bed_receipt`, an exact
4
+ narration adoption, narration placements/gains, and one fixed master gain have already
5
+ been independently selected. It is still `audio_mode=narration`, but it bypasses the
6
+ legacy narration timing, ducking, ambient BGM, loudness-normalization, and limiter path.
7
+
8
+ ```bash
9
+ python3 scripts/assemble.py picture.mp4 --work-dir NEW_WORK \
10
+ --tts-meta /local/tts_meta.json \
11
+ --narration-adoption /local/narration_adoption.json \
12
+ --audio-mix-adoption /local/audio_mix_adoption.json
13
+ ```
14
+
15
+ All strict output paths, including the CLI delivery alias, must be new. The CLI copies
16
+ to a hidden delivery stage and creates the alias with an exclusive atomic link, so a
17
+ concurrent or existing file is never overwritten.
18
+
19
+ ## Adoption schema v1
20
+
21
+ ```json
22
+ {
23
+ "artifact": "audio_mix_adoption",
24
+ "schema_version": 1,
25
+ "prepared_receipt": {"path": "/local/prepared_bed_receipt.json"},
26
+ "format": {"sample_rate": 48000, "channels": 2, "total_samples": 1856000},
27
+ "segments": [
28
+ {"index": 0, "output_start_sample": 366000, "gain": 0.4251421093940735}
29
+ ],
30
+ "master_gain_db": 0.75
31
+ }
32
+ ```
33
+
34
+ Unknown or missing fields fail; legacy `*_sha256` keys are ignored. The format must
35
+ equal the actual zero-origin picture frame clock at 48 kHz and the prepared receipt.
36
+ The receipt, all three float PCM beds (format, sample count, finite PCM), the picture,
37
+ the narration adoption file and the ordered segment indices are checked before
38
+ narration snapshots are written.
39
+
40
+ ## Exact audio operations
41
+
42
+ Each narration snapshot is decoded directly and completely to `pcm_f32le`, 48 kHz
43
+ stereo. Version 1 uses one fixed channel matrix, recorded per segment as
44
+ `mono_equal_power` or `stereo_identity`:
45
+
46
+ - mono is panned to left and right at `1/sqrt(2)` per channel;
47
+ - stereo preserves independent left and right channels at unit gain;
48
+ - inputs with more than two channels are rejected.
49
+
50
+ There is no intermediate 44.1 kHz mono placement, speed change, fade, trim, tail pad,
51
+ normalization, or automatic fit. Every complete converted WAV must fit its adopted
52
+ integer `output_start_sample`; placements may not overlap. Adopted per-segment gains
53
+ form a float `voice_bus.wav`. The producer's `prepared_bed.wav` and voice bus form a
54
+ float premaster, then the sole adopted `master_gain_db` forms the float master consumed
55
+ by the final AAC encode. The picture's old audio is never a mixer input.
56
+
57
+ ## Records and publication
58
+
59
+ `narration_input_binding.json` records the actual direct 48 kHz placed files and voice
60
+ bus, marking the bus `CONSUMED_BY_EXPLICIT_MIX`. `audio_mix_binding.json` records the
61
+ mix adoption path, picture path and clock, prepared receipt path and stems, converted
62
+ placements (path, channel matrix, PCM facts), voice bus, premaster, master, the
63
+ narration binding path, the final decoded PCM facts, the final AAC decoder/packet
64
+ count/payload bytes, and the actual output picture decoder/frame clock. The output
65
+ picture must preserve fps, frame count, zero start, and duration. A video-copy path
66
+ reports `packet_identity: EXACT` when decoder parameters and packet sizes/timestamps
67
+ are unchanged; an allowed visual re-encode reports `REENCODED_CLOCK_MATCH`. Timeline,
68
+ settings, QC, and manifest identify the explicit path rather than reporting ambient
69
+ ducking/BGM/loudnorm operations.
70
+
71
+ The candidate render is written to a hidden file. Both bindings are written, QC must
72
+ pass, the media is published, and a second QC runs against the published path. Any
73
+ render, binding, or QC failure removes the candidate, final-named media and the
74
+ bindings written by this run instead of overwriting an older success.
75
+ Diagnostic/staging audio may remain in the unique work directory.
@@ -0,0 +1,118 @@
1
+ # Caller-rendered foreground composition
2
+
3
+ `compose_foreground.py` performs one narrow operation: it overlays a caller-rendered,
4
+ full-canvas RGBA PNG sequence on an already locked H264/CFR/AAC base, optionally
5
+ replaces a declared tail with an explicit endcard asset, and copies `a:0` without
6
+ decoding or rewriting it. The PNG pixels are the source schema. This is not a CSS,
7
+ font, text, subtitle, logo, animation, or plugin renderer.
8
+
9
+ ## Command
10
+
11
+ ```bash
12
+ python3 scripts/compose_foreground.py foreground_plan.json \
13
+ --output-dir a-new-directory [--plan-only]
14
+ ```
15
+
16
+ The output directory must not exist. A normal run publishes `foreground.mp4` only
17
+ after the staged media's frame clock, canvas/color metadata, AAC decoder/packets/PTS/
18
+ side data, and a full audio/video decode pass verification.
19
+ A failure retains `foreground_run.json` and available logs but removes staged/final
20
+ media. `--plan-only` validates the complete plan and inputs and writes only
21
+ `foreground_run.json`; it does not render media or update any current pointer.
22
+
23
+ ## Strict plan schema v1
24
+
25
+ ```json
26
+ {
27
+ "artifact": "foreground_compose_plan",
28
+ "schema_version": 1,
29
+ "base": {"path": "/local/base.mp4"},
30
+ "video": {"fps": "30/1", "width": 1280, "height": 720, "total_frames": 300},
31
+ "foreground": {
32
+ "directory": "/local/foreground_sequence",
33
+ "pattern": "frame_%06d.png",
34
+ "start_frame": 0,
35
+ "end_frame": 270
36
+ },
37
+ "endcard": {
38
+ "kind": "sequence",
39
+ "directory": "/local/endcard_sequence",
40
+ "pattern": "frame_%06d.png",
41
+ "start_frame": 270,
42
+ "end_frame": 300
43
+ },
44
+ "producer_receipt": {"path": "/local/producer_receipt.json"}
45
+ }
46
+ ```
47
+
48
+ `endcard` is an exact tagged union. The alternative static form is:
49
+
50
+ ```json
51
+ {
52
+ "kind": "still",
53
+ "path": "/local/endcard.png",
54
+ "start_frame": 270,
55
+ "end_frame": 300
56
+ }
57
+ ```
58
+
59
+ When the foreground itself covers the entire declared frame clock, the only accepted
60
+ no-tail form is exactly:
61
+
62
+ ```json
63
+ {"kind": "none"}
64
+ ```
65
+
66
+ It accepts no additional fields. It is invalid when the foreground reserves any tail;
67
+ there is no implicit filler, repeated last frame, or generated endcard.
68
+
69
+ Use `still` only when a genuinely static full-canvas endcard is intended. A static
70
+ PNG does not reconstruct a delivered fade or other animated endcard; supply the
71
+ caller-rendered `sequence` form for that case.
72
+
73
+ Both sequences use **local zero-based filenames** regardless of their output range.
74
+ Thus the endcard example contains `frame_000000.png` through `frame_000029.png`,
75
+ mapped to output frames `[270,300)`. The foreground must start at output frame zero.
76
+ Its end must equal the endcard start, and the endcard end must equal the independently
77
+ probed base frame count. With `kind: "none"`, the foreground end must instead equal
78
+ that full base frame count. Bounds are half-open.
79
+
80
+ The only accepted filename pattern is the literal `frame_%06d.png`. The directory
81
+ must contain exactly the expected contiguous entries—no missing or extra files. Every
82
+ actual image must probe as PNG, `rgba`, and the exact declared full canvas. Repeated
83
+ files and symlinks are allowed so transparent holds need not duplicate storage. The
84
+ run report records each sequence's directory and validated `frame_count`. Legacy
85
+ `sha256` / `ordered_sha256` keys in a plan are ignored.
86
+
87
+ ## Base and output invariants
88
+
89
+ The first version accepts one selected `v:0` H264, zero-origin CFR, YUV420P,
90
+ BT.709/TV-range base and adopted AAC `a:0`. Declared fps, canvas, and frame count are
91
+ checked independently against actual decoded frame PTS. Picture and audio intervals
92
+ must satisfy the narrow `pair_media` timing contract.
93
+
94
+ Composition explicitly overlays in RGB, converts to BT.709 limited-range YUV420P,
95
+ limits the final video filter to the declared half-open frame clock, and re-encodes
96
+ only video with fixed `libx264 -preset fast -crf 18` settings. A no-tail run uses only
97
+ the base and foreground inputs; it does not synthesize or pad a tail. The filter EOF
98
+ prevents still-image input loops without imposing an output-level video frame cap that
99
+ could stop accepted trailing AAC packets from being copied. The run
100
+ report records that encoder, preset, CRF, pixel format, color contract, and audio-copy
101
+ mode explicitly. H.264 CRF encoding is lossy: preserved transparent regions are
102
+ visually checked against tolerances, not claimed pixel-identical to decoded base
103
+ pixels. The compositor does not use `-r`, `-shortest`, or `-t`. Audio is mapped from
104
+ base `a:0` with `-c:a copy`; output verification requires matching decoder
105
+ parameters, packet count, payload bytes, PTS/DTS/duration/size, and side data.
106
+
107
+ ## Provenance and review boundary
108
+
109
+ The producer receipt is a caller artifact that must exist when the plan is read.
110
+ Its declarations may
111
+ describe roles or content decisions such as title/note/brand, `dialogues=[]`, or
112
+ hidden markers. Core records those declarations as `DECLARED_NOT_CHECKED`; it does
113
+ not infer semantic truth from pixels or claim that dialogue/subtitle duplication is
114
+ absent. A separate producer/reviewer must establish that evidence.
115
+
116
+ Every run reports `direct_listening` and `normal_speed_review` as `NOT_CHECKED` and
117
+ `release_approved` as false. Pixel validation and deterministic rendering are not
118
+ commercial-quality or release approval.
@@ -0,0 +1,103 @@
1
+ # Narration adoption and the consumed-input record
2
+
3
+ Narration assembly accepts legacy `tts_meta.json`, but a current file by itself is
4
+ not an adoption decision. Use an explicit adoption document when the selected spoken
5
+ text, requested provider/voice, and tempo policy must be bound to the actual final mix.
6
+
7
+ ```bash
8
+ python3 scripts/assemble.py input.mp4 --work-dir work \
9
+ --tts-meta /local/tts_meta.json \
10
+ --narration-adoption /local/narration_adoption.json
11
+ ```
12
+
13
+ `--narration-adoption` is narration-only and requires an explicitly supplied
14
+ `--tts-meta`; it never adopts an ambient work-directory file automatically.
15
+
16
+ ## Strict v1 schema
17
+
18
+ ```json
19
+ {
20
+ "artifact": "narration_adoption",
21
+ "schema_version": 1,
22
+ "segments": [
23
+ {
24
+ "index": 0,
25
+ "spoken_text": "exact selected words",
26
+ "requested_provider": "caller-selected-provider",
27
+ "requested_voice": "caller-selected-voice"
28
+ }
29
+ ],
30
+ "tempo_policy": {
31
+ "global_atempo": 1.0,
32
+ "bounded_segment_fit": false,
33
+ "segment_tempo_max": 1.0,
34
+ "cumulative_tempo_max": 1.0,
35
+ "cumulative_tempo_hard_max": 1.0
36
+ }
37
+ }
38
+ ```
39
+
40
+ That policy is the conservative default. An adoption may declare its own values and
41
+ they are honoured: `global_atempo` must be positive and no greater than
42
+ `cumulative_tempo_hard_max`, `segment_tempo_max` and `cumulative_tempo_max` must be at
43
+ least `1.0`, `cumulative_tempo_hard_max` must not be below `cumulative_tempo_max`, and
44
+ `bounded_segment_fit` must be a boolean. Malformed or out-of-bounds policies fail;
45
+ ambient defaults such as a global 1.15 speed never override an adoption. With
46
+ `bounded_segment_fit` false, an adopted segment that does not fit its authored window
47
+ blocks without time trimming or bounded fit.
48
+
49
+ The adoption's ordered segment indices and spoken text must match both the segment
50
+ list in the supplied `tts_meta.json` and the in-memory list passed to
51
+ `assemble_video`; those two lists must be equal to each other. Unknown fields fail;
52
+ legacy `tts_meta_sha256` / `processed_wav_sha256` keys are ignored. The consumer never
53
+ creates an adoption from metadata that it is about to consume.
54
+
55
+ ## Validation and snapshots
56
+
57
+ Every adopted `audio_path` must exist before any media is probed or rendered. The
58
+ adopted inputs are then copied to per-run snapshots under
59
+ `work/.narration_input_snapshots/`; the original files are never modified, and the
60
+ render reads only the snapshots. Every conversion, placed WAV, and the completed
61
+ narration bus is recorded with its path and probed PCM facts before the final FFmpeg
62
+ command runs.
63
+
64
+ On the legacy narration-mix path, Python's standard WAV reader cannot open every valid post-processed WAV encoding.
65
+ Noncanonical input, including `pcm_f32le`, 48 kHz, or stereo WAV, is explicitly
66
+ decoded by the existing FFmpeg executable to 44.1 kHz mono PCM16 before placement.
67
+ The conversion path and actual PCM facts are recorded; the consumer does not claim
68
+ that converted samples equal the original samples.
69
+
70
+ The explicit full-sound path described in `explicit-audio-mix.md` deliberately does
71
+ not use that 44.1 kHz mono conversion. It consumes the snapshots directly as complete
72
+ 48 kHz float placements, preserving native stereo channels.
73
+
74
+ An adopted render writes to a hidden candidate path. The binding is written, QC runs
75
+ against the candidate, the candidate is renamed to the final path, and QC runs once
76
+ more against the published file. A blocking QC removes the candidate and the binding
77
+ instead of publishing; the run records the final output as absent rather than
78
+ claiming a missing file was published. Non-final work or diagnostic artifacts may
79
+ remain for investigation.
80
+
81
+ ## Binding report
82
+
83
+ After successful assembly, `work/narration_input_binding.json` records:
84
+
85
+ - original input path and snapshot path;
86
+ - any explicit conversion path and PCM parameters;
87
+ - each complete placed WAV path and PCM parameters;
88
+ - `narration.wav` path and PCM parameters;
89
+ - the final output path and its encoded audio-stream facts (decoder parameters,
90
+ packet count, payload bytes, start time, duration);
91
+ - the adoption path, its `tts_meta` path, and the exact tempo policy when supplied.
92
+
93
+ The report uses one of two identity statuses:
94
+
95
+ - `UNADOPTED`: no adoption was supplied; the legacy inputs were consumed as given;
96
+ - `BOUND_TO_ADOPTION`: the adoption's selection and tempo policy were carried
97
+ through the final mix.
98
+
99
+ `BOUND_TO_ADOPTION` records what was consumed, not provider truth, acoustic speaker
100
+ identity, direct listening, naturalness, or release approval; voice authentication
101
+ and direct listening stay `NOT_CHECKED`. QC, manifest, and settings records reference
102
+ a binding only while its recorded final output path still exists; source-mix and
103
+ adopted-packet-copy modes do not reuse narration binding evidence.
@@ -0,0 +1,45 @@
1
+ # 字幕与包装的推荐顺序
2
+
3
+ 先锁定画面、剪点、旁白和混音,再投入字幕动画或边框包装。字幕样式不能掩盖叙事、剪点或声音问题。
4
+
5
+ 普通交付优先使用现有 ASS 路径。只有用户需要更精细的逐 cue 排版、动画或透明图层时,才使用 Remotion
6
+ 或其他代码渲染器作为**项目级可选实现**,不要把特定框架、字体、颜色或黄字写成核心依赖。
7
+
8
+ ## 推荐顺序
9
+
10
+ 1. 输出无包装的锁定母版,确认音画内容不再变化。
11
+ 2. 从实际 TTS / 时间线生成 captions;TTS 块保持连续思路,字幕可以按阅读宽度拆 cue。
12
+ 3. 先抽检开头、亮背景、暗背景、人物近景和长字幕样帧,确定字号、安全区、描边、阴影及是否需要底板。
13
+ 4. 渲染完整透明字幕层,再 overlay 到锁定母版;合成后确认音轨未被意外改写。
14
+ 5. 完整播放实际最终文件,并复查字幕遮脸、跳字、断行、首尾帧和边界处残影。
15
+
16
+ 已有项目级渲染器能输出精确包装时,使用 `foreground-compose.md` 将它生成的 RGBA 序列叠到锁定母版,
17
+ 而不是用通用白字黑框近似品牌样式。该操作保留实际帧钟和 AAC 包,不生成字体或文案;只有通过验证的
18
+ 新文件才写入新目录。片名卡有渐显或动画时须提供完整序列,不能冻结最后一张图代替。
19
+
20
+ ## 静态包装图层 `packaging_layers.json`
21
+
22
+ 包框、标题条、角标 logo 这类整片不动的图片,可以直接在合成时叠加,不必先渲染成逐帧序列。
23
+ 在 `work_dir` 写 `packaging_layers.json`:
24
+
25
+ ```json
26
+ {
27
+ "canvas": {"width": 1080, "height": 1920},
28
+ "layers": [
29
+ {"name": "frame", "path": "/abs/frame.png", "rect": {"x": 0, "y": 0, "width": 1080, "height": 1920}}
30
+ ],
31
+ "template": {"id": "brand-frame", "version": 2}
32
+ }
33
+ ```
34
+
35
+ - `canvas` 必须等于成片画布,否则合成前报错;`rect` 必须在画布内,图片缩放到 `rect` 大小(透明区域保持透明)。
36
+ - 叠加顺序:遮原字幕 → 包装图层(按数组顺序)→ 画面文字 → 解说字幕 → 缩放。
37
+ - `timeline.json` 同时得到对应的 image 轨,剪映草稿里的包框可单独编辑。
38
+ - `assembly_manifest.json` 的 `video_filters.packaging_layers` 记录每张图片的路径与 `{size, mtime_ns}`。
39
+ - 编排器按项目绑定的 `packaging` 模板写出这个文件时会带 `written_by` 标记;
40
+ 手写的文件不会被它删除。有渐显或动画的包装仍走 `foreground-compose.md`。
41
+
42
+ ## 原则
43
+
44
+ 包装价值来自稳定、可读、与内容一致的排版,不来自效果数量。先建立统一字体、颜色、描边/阴影和轻量动效;
45
+ 底板、边框、花字与音效只有解决具体可读性或叙事任务时才加入。一个样帧好看不代表全片成立。
@@ -0,0 +1,74 @@
1
+ # Pair rebuilt picture with a retained adopted soundtrack
2
+
3
+ When the picture is rebuilt/reframed but the adopted mix must not change, use
4
+ `pair_media.py` before `assemble.py --audio-mode adopted-packet-copy`. This is a
5
+ real two-input stream copy, not re-encoding an old finished video's picture.
6
+ It does not generate narration, align speech, design packaging, or create an
7
+ end card. It does not decide which inputs the editor intended to adopt.
8
+
9
+ ```json
10
+ {
11
+ "artifact": "media_pair",
12
+ "schema_version": 1,
13
+ "picture": {"path": "/project/picture.mp4"},
14
+ "audio": {"path": "/project/adopted.m4a", "selected_stream": 0}
15
+ }
16
+ ```
17
+
18
+ Both paths must be explicit local files. `selected_stream` is the audio ordinal
19
+ (`a:N`), not the absolute stream index. The audio donor may be an old MP4 with
20
+ unrelated video: only the selected audio is used. The picture's audio is ignored.
21
+ Both files must exist when the plan is read. The plan is strict: unknown fields
22
+ do not silently request unsupported retime, gain, trimming or offset operations
23
+ (legacy `sha256` keys are ignored).
24
+
25
+ ```bash
26
+ python3 scripts/pair_media.py pair.json --output-dir new-pair-directory --plan-only
27
+ # A PLANNED directory is not reusable as a rendered candidate: choose a NEW one.
28
+ python3 scripts/pair_media.py pair.json --output-dir new-render-directory
29
+ ```
30
+
31
+ The output directory must not already exist. No existing input, final asset,
32
+ current pointer, or user-approved version is overwritten. `--plan-only` checks
33
+ actual inputs and timing but creates no video and invokes no mux. A rendered run
34
+ provides:
35
+
36
+ - `paired.mp4`: selected picture and audio, both compressed-stream copied.
37
+ - `pair_run.json`: `PLANNED`, `PAIR_RENDERED`, or `FAILED`, explicit input and
38
+ plan/output paths, frame count, timing tolerance and output stream numbering.
39
+ - `picture_identity.json`: decoder, geometry/color, complete actual frame clock
40
+ and compressed packet size/timing/side-data facts.
41
+ - `adopted_audio_identity.json`: donor and output AAC packet/decoder facts.
42
+ - mux command/log for reconstruction and diagnosis.
43
+
44
+ The first implementation deliberately accepts H264 or HEVC in an MP4-family container,
45
+ complete zero-origin CFR picture (1–120 fps), and contiguous AAC packets with
46
+ known nominal sample duration. No VFR, retime, offset, format conversion, padding,
47
+ trimming, `-shortest`, normalization or gain is inferred. Packet priming and skip
48
+ metadata are retained. The packet clock must also agree with the declared audio
49
+ stream interval (at most one nominal priming packet before the start; the packet
50
+ end matches the stream end within one sample). This is checked again on the
51
+ actual muxed output. Picture/audio starts and ends must differ by no more than
52
+ the larger of one picture frame or one nominal AAC packet. The interval check is
53
+ compatibility, **not perceptual synchronization or acoustic alignment**. A tiny
54
+ container-tail tolerance does not authorize cutting a word.
55
+
56
+ Muxing goes to a staging file. The output's video decoder/packet sizes and
57
+ timestamps/full frame clock/geometry/color and adopted AAC packets must match
58
+ the inputs, the output must contain only `v:0,a:0`, and full decode must pass
59
+ before final publication. Failure leaves a FAILED record and logs, not a
60
+ final `paired.mp4`. Rebuilding source geometry is certified by its own upstream
61
+ render/map evidence, not by the existence of a successfully paired container.
62
+
63
+ ## Subtitle integration: bind AFTER pairing
64
+
65
+ The output audio ordinal is always **0**, even when the donor used `a:1`.
66
+ Create the complete output-clock `subtitle_track.json` against
67
+ `subtitles.track_binding.current_bindings(paired_video, 0)`, then run the existing
68
+ adopted assembly path. Do not reuse a binding computed against the picture-only
69
+ file or the donor's old stream ordinal. A present stale subtitle track fails rather than falling
70
+ back to estimated timings. See [subtitle-track.md](subtitle-track.md).
71
+
72
+ Pairing preserves the input picture, including any explicit black tail; it does
73
+ not turn that black tail into a branded end card. Listening, normal-speed review,
74
+ editorial intent and release approval remain separate from this mechanical proof.