@oh-story/dsh 0.1.8 → 0.1.10

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 (360) hide show
  1. package/README.md +14 -14
  2. package/lib/client.js +237 -84
  3. package/lib/client.js.map +3 -3
  4. package/lib/drama/manifest.json +183 -77
  5. package/lib/drama/skills/short-drama/SKILL.md +5 -1
  6. package/lib/drama/skills/short-drama/scripts/creator_markdown_check.py +140 -9
  7. package/lib/drama/skills/short-drama/scripts/project_tool.py +11 -0
  8. package/lib/drama/skills/short-drama-assets/references/character-and-look.md +28 -0
  9. package/lib/drama/skills/short-drama-assets/references/continuity-lock.md +8 -2
  10. package/lib/drama/skills/short-drama-assets/references/voice-direction.md +28 -0
  11. package/lib/drama/skills/short-drama-edit/SKILL.md +146 -0
  12. package/lib/drama/skills/short-drama-edit/agents/openai.yaml +4 -0
  13. package/lib/drama/skills/short-drama-edit/assets/remotion/README.md +60 -0
  14. package/lib/drama/skills/short-drama-edit/assets/remotion/package.json +15 -0
  15. package/lib/drama/skills/short-drama-edit/assets/remotion/remotion.config.ts +6 -0
  16. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Root.tsx +26 -0
  17. package/lib/drama/skills/short-drama-edit/assets/remotion/src/Subtitles.tsx +88 -0
  18. package/lib/drama/skills/short-drama-edit/assets/remotion/src/font.ts +46 -0
  19. package/lib/drama/skills/short-drama-edit/assets/remotion/src/index.ts +4 -0
  20. package/lib/drama/skills/short-drama-edit/assets/remotion/src/schema.ts +32 -0
  21. package/lib/drama/skills/short-drama-edit/assets/remotion/tsconfig.json +13 -0
  22. package/lib/drama/skills/short-drama-edit/assets//345/211/252/350/276/221/345/215/225.md +43 -0
  23. package/lib/drama/skills/short-drama-edit/references/cut-craft.md +38 -0
  24. package/lib/drama/skills/short-drama-edit/references/delivery-verify.md +29 -0
  25. package/lib/drama/skills/short-drama-edit/references/generated-footage.md +54 -0
  26. package/lib/drama/skills/short-drama-edit/references/sound-and-subtitles.md +60 -0
  27. package/lib/drama/skills/short-drama-edit/references/stage-contract.md +51 -0
  28. package/lib/drama/skills/short-drama-edit/scripts/edit_tool.py +1156 -0
  29. package/lib/drama/skills/short-drama-edit/scripts/selftest.py +520 -0
  30. package/lib/drama/skills/short-drama-image-prompts/SKILL.md +2 -0
  31. package/lib/drama/skills/short-drama-image-prompts/assets/image-prompts.md +5 -0
  32. package/lib/drama/skills/short-drama-image-prompts/assets/lookdev-prompts.md +3 -0
  33. package/lib/drama/skills/short-drama-image-prompts/references/common-recipe.md +11 -0
  34. package/lib/drama/skills/short-drama-novel-analyze/references/aggregation-and-entities.md +2 -2
  35. package/lib/drama/skills/short-drama-novel-analyze/references/chapter-extraction.md +4 -1
  36. package/lib/drama/skills/short-drama-produce/SKILL.md +29 -4
  37. package/lib/drama/skills/short-drama-produce/references/adapter-contract.md +22 -0
  38. package/lib/drama/skills/short-drama-produce/references/providers/minimax-h3-video.md +13 -12
  39. package/lib/drama/skills/short-drama-produce/references/providers/minimax-speech.md +41 -0
  40. package/lib/drama/skills/short-drama-produce/references/providers/seedance.md +7 -0
  41. package/lib/drama/skills/short-drama-produce/scripts/fixture_adapter.py +18 -1
  42. package/lib/drama/skills/short-drama-produce/scripts/production_tool.py +181 -2
  43. package/lib/drama/skills/short-drama-produce/scripts/provider_adapters.py +199 -3
  44. package/lib/drama/skills/short-drama-review/SKILL.md +2 -0
  45. package/lib/drama/skills/short-drama-review/references/production-quality-gates.md +7 -0
  46. package/lib/drama/skills/short-drama-review/references/rubric-visual-motion.md +10 -0
  47. package/lib/drama/skills/short-drama-storyboard/SKILL.md +12 -1
  48. package/lib/drama/skills/short-drama-storyboard/assets/keyframe-prompts.md +4 -0
  49. package/lib/drama/skills/short-drama-storyboard/references/lighting-craft.md +39 -0
  50. package/lib/drama/skills/short-drama-storyboard/references/shot-craft.md +78 -2
  51. package/lib/drama/skills/short-drama-storyboard/references/stage-contract.md +2 -0
  52. package/lib/drama/skills/short-drama-video-prompts/SKILL.md +12 -5
  53. package/lib/drama/skills/short-drama-video-prompts/references/camera-audio-continuity.md +17 -0
  54. package/lib/drama/skills/short-drama-video-prompts/references/minimax-h3.md +76 -7
  55. package/lib/drama/skills/short-drama-video-prompts/references/motion-recipe.md +5 -2
  56. package/lib/drama/skills/short-drama-video-prompts/references/performance-action-timing.md +21 -0
  57. package/lib/drama/skills/short-drama-video-prompts/references/production-prompt-grammar.md +6 -17
  58. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.0.md +12 -3
  59. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.5.md +61 -5
  60. package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +3 -3
  61. package/lib/drama/skills/short-drama-write/SKILL.md +11 -2
  62. package/lib/drama/skills/short-drama-write/references/screenplay-format.md +6 -0
  63. package/lib/drama/skills/short-drama-write/references/stage-contract.md +1 -0
  64. package/lib/index.js +290 -90
  65. package/lib/index.js.map +4 -4
  66. package/lib/novel-to-game/README.md +299 -59
  67. package/lib/novel-to-game/README_ZH.md +299 -56
  68. package/lib/novel-to-game/VERSION +1 -1
  69. package/lib/novel-to-game/examples/jin-ping-mei/build/BUILD_BRIEF.md +3 -1
  70. package/lib/novel-to-game/examples/jin-ping-mei/build/app/RUN.md +11 -3
  71. package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/new-guofeng.css +397 -8
  72. package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/style.css +0 -31
  73. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/data.js +71 -73
  74. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/engine.js +78 -89
  75. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/main.js +37 -14
  76. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/text.js +5 -5
  77. package/lib/novel-to-game/examples/jin-ping-mei/build/app/package.json +2 -1
  78. package/lib/novel-to-game/examples/jin-ping-mei/qa/README.md +11 -16
  79. package/lib/novel-to-game/examples/jin-ping-mei/qa/verification.json +11 -11
  80. package/lib/novel-to-game/examples/jin-ping-mei/qa/verify_playable_model.mjs +23 -0
  81. package/lib/novel-to-game/manifest.json +77 -87
  82. package/lib/novel-to-game/skills/game-art-direction/SKILL.md +9 -35
  83. package/lib/novel-to-game/skills/game-art-direction/references/art-direction-method.md +27 -106
  84. package/lib/novel-to-game/skills/game-build/SKILL.md +17 -35
  85. package/lib/novel-to-game/skills/game-build/references/blender-asset-workflow.md +24 -0
  86. package/lib/novel-to-game/skills/game-build/references/build-brief-contract.md +45 -82
  87. package/lib/novel-to-game/skills/game-build/references/generative-media-pipeline.md +14 -45
  88. package/lib/novel-to-game/skills/game-build/references/playable-model-contract.md +30 -65
  89. package/lib/novel-to-game/skills/game-build/references/tts-production-contract.md +13 -27
  90. package/lib/novel-to-game/skills/game-concept/SKILL.md +16 -34
  91. package/lib/novel-to-game/skills/game-concept/references/concept-method.md +28 -75
  92. package/lib/novel-to-game/skills/game-qa/SKILL.md +9 -20
  93. package/lib/novel-to-game/skills/game-qa/references/test-design-method.md +10 -6
  94. package/lib/novel-to-game/skills/game-world-design/SKILL.md +19 -32
  95. package/lib/novel-to-game/skills/game-world-design/references/narrative-design-method.md +23 -72
  96. package/lib/novel-to-game/skills/game-world-design/references/numeric-design-method.md +14 -48
  97. package/lib/novel-to-game/skills/game-world-design/references/world-design-method.md +36 -103
  98. package/lib/novel-to-game/skills/novel-game-analyze/SKILL.md +9 -18
  99. package/lib/novel-to-game/skills/novel-game-analyze/references/gameability-protocol.md +4 -4
  100. package/lib/novel-to-game/skills/novel-to-game/SKILL.md +10 -27
  101. package/lib/novel-to-game/skills/novel-to-game/references/intake-method.md +5 -6
  102. package/lib/novel-to-game/skills/novel-to-game/references/pipeline-contract.md +6 -11
  103. package/lib/oh-story/manifest.json +419 -254
  104. package/lib/oh-story/roles/chapter-extractor.md +177 -237
  105. package/lib/oh-story/roles/character-designer.md +1 -1
  106. package/lib/oh-story/roles/consistency-checker.md +4 -4
  107. package/lib/oh-story/roles/narrative-writer.md +56 -243
  108. package/lib/oh-story/roles/story-architect.md +6 -6
  109. package/lib/oh-story/roles/story-explorer.md +11 -11
  110. package/lib/oh-story/skills/story/SKILL.md +13 -7
  111. package/lib/oh-story/skills/story/VERSION +1 -1
  112. package/lib/oh-story/skills/story/references/author-memory.md +61 -29
  113. package/lib/oh-story/skills/story/scripts/author_memory_commit.py +934 -170
  114. package/lib/oh-story/skills/story-cover/SKILL.md +10 -1
  115. package/lib/oh-story/skills/story-deslop/SKILL.md +54 -229
  116. package/lib/oh-story/skills/story-deslop/references/anti-ai-writing.md +29 -56
  117. package/lib/oh-story/skills/story-deslop/references/author-memory.md +61 -29
  118. package/lib/oh-story/skills/story-deslop/references/banned-words.md +3 -1
  119. package/lib/oh-story/skills/story-deslop/references/deslop-gates.md +154 -0
  120. package/lib/oh-story/skills/story-deslop/references/style-resolution.md +27 -0
  121. package/lib/oh-story/skills/story-deslop/scripts/author_memory_commit.py +934 -170
  122. package/lib/oh-story/skills/story-deslop/scripts/check-ai-patterns.js +6 -1
  123. package/lib/oh-story/skills/story-deslop/scripts/check-degeneration.js +39 -20
  124. package/lib/oh-story/skills/story-deslop/scripts/normalize-punctuation.js +10 -5
  125. package/lib/oh-story/skills/story-deslop/scripts/style-whitelist.js +39 -0
  126. package/lib/oh-story/skills/story-import/SKILL.md +78 -82
  127. package/lib/oh-story/skills/story-import/references/character-state-reverse.md +1 -1
  128. package/lib/oh-story/skills/story-import/references/format-and-structure.md +2 -2
  129. package/lib/oh-story/skills/story-import/references/state-tracking.md +4 -69
  130. package/lib/oh-story/skills/story-import/references/structure-mapping-long.md +10 -8
  131. package/lib/oh-story/skills/story-import/references/tracking-initialization.md +31 -0
  132. package/lib/oh-story/skills/story-import/references/tracking-transaction.md +9 -34
  133. package/lib/oh-story/skills/story-import/scripts/check-outline-contract.js +197 -15
  134. package/lib/oh-story/skills/story-import/scripts/tracking_commit.py +210 -2
  135. package/lib/oh-story/skills/story-import/scripts/wordcount_core.py +3 -0
  136. package/lib/oh-story/skills/story-long-analyze/SKILL.md +91 -258
  137. package/lib/oh-story/skills/story-long-analyze/references/author-facing.md +245 -0
  138. package/lib/oh-story/skills/story-long-analyze/references/deconstruction-notes.md +2 -2
  139. package/lib/oh-story/skills/story-long-analyze/references/inspiration-library.md +105 -0
  140. package/lib/oh-story/skills/story-long-analyze/references/material-decomposition.md +113 -105
  141. package/lib/oh-story/skills/story-long-analyze/references/output-templates.md +169 -125
  142. package/lib/oh-story/skills/story-long-analyze/references/pipeline-ops.md +172 -64
  143. package/lib/oh-story/skills/story-long-analyze/references/semantic-acceptance-fixtures.md +84 -0
  144. package/lib/oh-story/skills/story-long-analyze/references/style-profile-generator.md +42 -132
  145. package/lib/oh-story/skills/story-long-analyze/references/style-profile-protocol.md +5 -5
  146. package/lib/oh-story/skills/story-long-analyze/scripts/build_chapter_index.py +466 -0
  147. package/lib/oh-story/skills/story-long-analyze/scripts/inspect_existing_assets.py +702 -0
  148. package/lib/oh-story/skills/story-long-analyze/scripts/inspiration_index.py +864 -0
  149. package/lib/oh-story/skills/story-long-analyze/scripts/manage_analysis_run.py +1106 -0
  150. package/lib/oh-story/skills/story-long-analyze/scripts/render_relation_chart.py +425 -0
  151. package/lib/oh-story/skills/story-long-scan/SKILL.md +4 -1
  152. package/lib/oh-story/skills/story-long-write/SKILL.md +52 -216
  153. package/lib/oh-story/skills/story-long-write/references/anti-ai-writing.md +29 -56
  154. package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +72 -12
  155. package/lib/oh-story/skills/story-long-write/references/author-memory.md +61 -29
  156. package/lib/oh-story/skills/story-long-write/references/banned-words.md +3 -1
  157. package/lib/oh-story/skills/story-long-write/references/benchmark-recall.md +20 -0
  158. package/lib/oh-story/skills/story-long-write/references/cross-book-recall.md +26 -0
  159. package/lib/oh-story/skills/story-long-write/references/dialogue-mastery.md +10 -4
  160. package/lib/oh-story/skills/story-long-write/references/emotional-methods.md +2 -2
  161. package/lib/oh-story/skills/story-long-write/references/long-chapter-quality.md +6 -15
  162. package/lib/oh-story/skills/story-long-write/references/long-format.md +2 -0
  163. package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +2 -0
  164. package/lib/oh-story/skills/story-long-write/references/project-files.md +110 -0
  165. package/lib/oh-story/skills/story-long-write/references/reader-contract-and-progression.md +12 -4
  166. package/lib/oh-story/skills/story-long-write/references/reference-index.md +86 -0
  167. package/lib/oh-story/skills/story-long-write/references/style-combat-face.md +1 -1
  168. package/lib/oh-story/skills/story-long-write/references/style-craft.md +9 -29
  169. package/lib/oh-story/skills/story-long-write/references/style-genre-modules.md +1 -1
  170. package/lib/oh-story/skills/story-long-write/references/style-resolution.md +27 -0
  171. package/lib/oh-story/skills/story-long-write/references/tracking-initialization.md +31 -0
  172. package/lib/oh-story/skills/story-long-write/references/tracking-transaction.md +9 -34
  173. package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +88 -118
  174. package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +55 -119
  175. package/lib/oh-story/skills/story-long-write/references/workflow-revision.md +15 -11
  176. package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +73 -54
  177. package/lib/oh-story/skills/story-long-write/references/writer-prompt-fallback.md +22 -0
  178. package/lib/oh-story/skills/story-long-write/references/writing-craft.md +63 -4
  179. package/lib/oh-story/skills/story-long-write/scripts/author_memory_commit.py +934 -170
  180. package/lib/oh-story/skills/story-long-write/scripts/build_writer_prompt.py +531 -0
  181. package/lib/oh-story/skills/story-long-write/scripts/check-ai-patterns.js +6 -1
  182. package/lib/oh-story/skills/story-long-write/scripts/check-degeneration.js +39 -20
  183. package/lib/oh-story/skills/story-long-write/scripts/check-outline-contract.js +197 -15
  184. package/lib/oh-story/skills/story-long-write/scripts/check-outline-copy.js +90 -23
  185. package/lib/oh-story/skills/story-long-write/scripts/normalize-punctuation.js +10 -5
  186. package/lib/oh-story/skills/story-long-write/scripts/outline_view.py +285 -0
  187. package/lib/oh-story/skills/story-long-write/scripts/storyctl.py +58 -0
  188. package/lib/oh-story/skills/story-long-write/scripts/style-whitelist.js +39 -0
  189. package/lib/oh-story/skills/story-long-write/scripts/tracking_commit.py +210 -2
  190. package/lib/oh-story/skills/story-long-write/scripts/wordcount_core.py +3 -0
  191. package/lib/oh-story/skills/story-review/SKILL.md +80 -87
  192. package/lib/oh-story/skills/story-review/references/anti-ai-writing.md +29 -56
  193. package/lib/oh-story/skills/story-review/references/author-memory.md +61 -29
  194. package/lib/oh-story/skills/story-review/references/banned-words.md +3 -1
  195. package/lib/oh-story/skills/story-review/references/dialogue-mastery.md +10 -4
  196. package/lib/oh-story/skills/story-review/references/review-quality.md +6 -12
  197. package/lib/oh-story/skills/story-review/references/style-resolution.md +27 -0
  198. package/lib/oh-story/skills/story-review/references/tracking-initialization.md +31 -0
  199. package/lib/oh-story/skills/story-review/references/tracking-transaction.md +9 -34
  200. package/lib/oh-story/skills/story-review/scripts/author_memory_commit.py +934 -170
  201. package/lib/oh-story/skills/story-review/scripts/check-ai-patterns.js +6 -1
  202. package/lib/oh-story/skills/story-review/scripts/check-degeneration.js +39 -20
  203. package/lib/oh-story/skills/story-review/scripts/normalize-punctuation.js +10 -5
  204. package/lib/oh-story/skills/story-review/scripts/style-whitelist.js +39 -0
  205. package/lib/oh-story/skills/story-review/scripts/tracking_commit.py +210 -2
  206. package/lib/oh-story/skills/story-review/scripts/wordcount_core.py +3 -0
  207. package/lib/oh-story/skills/story-setup/SKILL.md +58 -43
  208. package/lib/oh-story/skills/story-setup/references/agent-references/anti-ai-writing.md +29 -56
  209. package/lib/oh-story/skills/story-setup/references/agent-references/banned-words.md +3 -1
  210. package/lib/oh-story/skills/story-setup/references/agent-references/deslop-gates.md +154 -0
  211. package/lib/oh-story/skills/story-setup/references/agent-references/dialogue-mastery.md +10 -4
  212. package/lib/oh-story/skills/story-setup/references/agent-references/format-and-structure.md +2 -2
  213. package/lib/oh-story/skills/story-setup/references/agent-references/long-emotional-methods.md +2 -2
  214. package/lib/oh-story/skills/story-setup/references/agent-references/long-quality.md +1 -1
  215. package/lib/oh-story/skills/story-setup/references/agent-references/short-genre-formulas.md +1 -1
  216. package/lib/oh-story/skills/story-setup/references/agent-references/style-combat-face.md +1 -1
  217. package/lib/oh-story/skills/story-setup/references/agent-references/style-genre-modules.md +1 -1
  218. package/lib/oh-story/skills/story-setup/references/agent-references/style-resolution.md +27 -0
  219. package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +63 -4
  220. package/lib/oh-story/skills/story-setup/references/diagnostics.md +38 -0
  221. package/lib/oh-story/skills/story-short-analyze/SKILL.md +22 -3
  222. package/lib/oh-story/skills/story-short-analyze/references/analysis-writing-techniques.md +1 -1
  223. package/lib/oh-story/skills/story-short-analyze/references/material-decomposition.md +5 -1
  224. package/lib/oh-story/skills/story-short-analyze/references/source-story-quality.md +2 -2
  225. package/lib/oh-story/skills/story-short-scan/SKILL.md +5 -1
  226. package/lib/oh-story/skills/story-short-write/SKILL.md +15 -324
  227. package/lib/oh-story/skills/story-short-write/references/author-memory.md +61 -29
  228. package/lib/oh-story/skills/story-short-write/references/banned-words.md +3 -1
  229. package/lib/oh-story/skills/story-short-write/references/benchmark-recall.md +60 -0
  230. package/lib/oh-story/skills/story-short-write/references/dialogue-mastery.md +10 -4
  231. package/lib/oh-story/skills/story-short-write/references/genre-styles//344/270/226/346/203/205/346/211/223/350/204/270.md +2 -2
  232. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/217/214/347/224/267/344/270/273.md +1 -1
  233. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/244/215/344/273/207/346/211/223/350/204/270.md +3 -3
  234. package/lib/oh-story/skills/story-short-write/references/genre-styles//345/256/205/346/226/227/345/256/253/346/226/227.md +3 -3
  235. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/200/273/350/243/201/350/261/252/351/227/250.md +3 -3
  236. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/202/254/347/226/221.md +5 -5
  237. package/lib/oh-story/skills/story-short-write/references/genre-styles//346/260/221/344/277/227/346/200/252/350/260/210.md +4 -4
  238. package/lib/oh-story/skills/story-short-write/references/genre-styles//347/224/234/345/256/240.md +5 -5
  239. package/lib/oh-story/skills/story-short-write/references/genre-styles//350/277/275/345/246/273/347/201/253/350/221/254/345/234/272.md +3 -3
  240. package/lib/oh-story/skills/story-short-write/references/genre-writing-formulas.md +1 -1
  241. package/lib/oh-story/skills/story-short-write/references/genre-writing-techniques.md +1 -1
  242. package/lib/oh-story/skills/story-short-write/references/reference-index.md +55 -0
  243. package/lib/oh-story/skills/story-short-write/references/short-craft.md +12 -14
  244. package/lib/oh-story/skills/story-short-write/references/short-deslop.md +10 -10
  245. package/lib/oh-story/skills/story-short-write/references/short-format.md +3 -1
  246. package/lib/oh-story/skills/story-short-write/references/short-prose-quality.md +2 -2
  247. package/lib/oh-story/skills/story-short-write/references/style-resolution.md +27 -0
  248. package/lib/oh-story/skills/story-short-write/references/workflow-design.md +78 -0
  249. package/lib/oh-story/skills/story-short-write/references/workflow-draft.md +126 -0
  250. package/lib/oh-story/skills/story-short-write/references/workflow-revision.md +32 -0
  251. package/lib/oh-story/skills/story-short-write/references/writing-workflow.md +5 -5
  252. package/lib/oh-story/skills/story-short-write/scripts/author_memory_commit.py +934 -170
  253. package/lib/oh-story/skills/story-short-write/scripts/check-ai-patterns.js +6 -1
  254. package/lib/oh-story/skills/story-short-write/scripts/check-degeneration.js +39 -20
  255. package/lib/oh-story/skills/story-short-write/scripts/check-delivery-contract.js +34 -5
  256. package/lib/oh-story/skills/story-short-write/scripts/check-outline-copy.js +90 -23
  257. package/lib/oh-story/skills/story-short-write/scripts/normalize-punctuation.js +10 -5
  258. package/lib/oh-story/skills/story-short-write/scripts/style-whitelist.js +39 -0
  259. package/lib/types/client/drama-production-view.d.ts.map +1 -1
  260. package/lib/types/client/file-activity.d.ts +19 -1
  261. package/lib/types/client/file-activity.d.ts.map +1 -1
  262. package/lib/types/client/index.d.ts.map +1 -1
  263. package/lib/types/client/production-prompts.d.ts +7 -0
  264. package/lib/types/client/production-prompts.d.ts.map +1 -1
  265. package/lib/types/client/production-runtime.d.ts +33 -0
  266. package/lib/types/client/production-runtime.d.ts.map +1 -1
  267. package/lib/types/drama-adapters.d.ts +5 -3
  268. package/lib/types/drama-adapters.d.ts.map +1 -1
  269. package/lib/types/native-hooks.d.ts +52 -0
  270. package/lib/types/native-hooks.d.ts.map +1 -1
  271. package/lib/types/role-identity.d.ts +17 -0
  272. package/lib/types/role-identity.d.ts.map +1 -0
  273. package/lib/types/role-tool.d.ts.map +1 -1
  274. package/lib/types/skill-provider.d.ts.map +1 -1
  275. package/lib/video-recap/CHANGELOG.md +31 -1
  276. package/lib/video-recap/manifest.json +162 -162
  277. package/lib/video-recap/skills/video-assemble/scripts/artifacts.py +4 -9
  278. package/lib/video-recap/skills/video-assemble/scripts/assemble.py +47 -60
  279. package/lib/video-recap/skills/video-assemble/scripts/assembly_contract.py +77 -115
  280. package/lib/video-recap/skills/video-assemble/scripts/assembly_settings.py +41 -40
  281. package/lib/video-recap/skills/video-assemble/scripts/audio_automation.py +22 -32
  282. package/lib/video-recap/skills/video-assemble/scripts/audio_mix.py +102 -192
  283. package/lib/video-recap/skills/video-assemble/scripts/jianying_builders.py +14 -35
  284. package/lib/video-recap/skills/video-assemble/scripts/jianying_model.py +14 -12
  285. package/lib/video-recap/skills/video-assemble/scripts/jianying_optional.py +8 -9
  286. package/lib/video-recap/skills/video-assemble/scripts/jianying_schema.py +3 -14
  287. package/lib/video-recap/skills/video-assemble/scripts/jianying_timeline_contract.py +23 -12
  288. package/lib/video-recap/skills/video-assemble/scripts/jianying_tracks.py +1 -4
  289. package/lib/video-recap/skills/video-assemble/scripts/jianying_writer.py +24 -25
  290. package/lib/video-recap/skills/video-assemble/scripts/lib.py +31 -85
  291. package/lib/video-recap/skills/video-assemble/scripts/media.py +100 -144
  292. package/lib/video-recap/skills/video-assemble/scripts/narration_audio.py +101 -195
  293. package/lib/video-recap/skills/video-assemble/scripts/render_preflight.py +10 -21
  294. package/lib/video-recap/skills/video-assemble/scripts/source_subtitles.py +90 -169
  295. package/lib/video-recap/skills/video-assemble/scripts/subtitle_core.py +69 -122
  296. package/lib/video-recap/skills/video-assemble/scripts/subtitle_render.py +10 -17
  297. package/lib/video-recap/skills/video-assemble/scripts/timeline.py +33 -48
  298. package/lib/video-recap/skills/video-assemble/scripts/timeline_emit.py +14 -20
  299. package/lib/video-recap/skills/video-assemble/scripts/visual_render.py +135 -213
  300. package/lib/video-recap/skills/video-cut/scripts/cut_cli.py +49 -57
  301. package/lib/video-recap/skills/video-cut/scripts/cut_contract.py +38 -74
  302. package/lib/video-recap/skills/video-cut/scripts/cut_render.py +46 -95
  303. package/lib/video-recap/skills/video-cut/scripts/lib.py +23 -25
  304. package/lib/video-recap/skills/video-cut/scripts/media_geometry.py +70 -173
  305. package/lib/video-recap/skills/video-cut/scripts/narration_mapping.py +28 -53
  306. package/lib/video-recap/skills/video-cut/scripts/sentence_boundaries.py +162 -322
  307. package/lib/video-recap/skills/video-recap/references/timeline-and-jianying.md +6 -7
  308. package/lib/video-recap/skills/video-recap/scripts/doctor.py +104 -124
  309. package/lib/video-recap/skills/video-recap/scripts/final_qc.py +255 -412
  310. package/lib/video-recap/skills/video-recap/scripts/lib.py +30 -52
  311. package/lib/video-recap/skills/video-recap/scripts/materials.py +97 -120
  312. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_client.py +7 -12
  313. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_evidence.py +46 -97
  314. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_observations.py +18 -36
  315. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_payload.py +29 -47
  316. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_report.py +43 -76
  317. package/lib/video-recap/skills/video-recap/scripts/mimo_qc_runner.py +2 -1
  318. package/lib/video-recap/skills/video-recap/scripts/qc_contract.py +2 -1
  319. package/lib/video-recap/skills/video-recap/scripts/recap_cli.py +2 -2
  320. package/lib/video-recap/skills/video-recap/scripts/recap_inspect.py +129 -145
  321. package/lib/video-recap/skills/video-recap/scripts/recap_review.py +27 -20
  322. package/lib/video-recap/skills/video-recap/scripts/recap_runner.py +20 -31
  323. package/lib/video-recap/skills/video-recap/scripts/recap_runtime.py +31 -106
  324. package/lib/video-recap/skills/video-recap/scripts/recap_stage_qc.py +43 -113
  325. package/lib/video-recap/skills/video-recap/scripts/recap_timeline.py +196 -377
  326. package/lib/video-recap/skills/video-script/scripts/agent_brief.py +1 -1
  327. package/lib/video-recap/skills/video-script/scripts/agent_text.py +63 -172
  328. package/lib/video-recap/skills/video-script/scripts/brief_context.py +80 -135
  329. package/lib/video-recap/skills/video-script/scripts/brief_inputs.py +125 -167
  330. package/lib/video-recap/skills/video-script/scripts/brief_timeline.py +93 -208
  331. package/lib/video-recap/skills/video-script/scripts/deslop_qc.py +20 -46
  332. package/lib/video-recap/skills/video-script/scripts/lib.py +30 -26
  333. package/lib/video-recap/skills/video-script/scripts/narration_lint.py +145 -140
  334. package/lib/video-recap/skills/video-script/scripts/review_response.py +12 -42
  335. package/lib/video-recap/skills/video-script/scripts/review_runner.py +0 -6
  336. package/lib/video-recap/skills/video-script/scripts/speech_ownership.py +39 -100
  337. package/lib/video-recap/skills/video-script/scripts/timeline_fusion.py +33 -124
  338. package/lib/video-recap/skills/video-understanding/scripts/agent_brief.py +1 -1
  339. package/lib/video-recap/skills/video-understanding/scripts/agent_text.py +63 -172
  340. package/lib/video-recap/skills/video-understanding/scripts/asr.py +1 -2
  341. package/lib/video-recap/skills/video-understanding/scripts/brief_context.py +80 -135
  342. package/lib/video-recap/skills/video-understanding/scripts/brief_inputs.py +125 -167
  343. package/lib/video-recap/skills/video-understanding/scripts/brief_timeline.py +93 -208
  344. package/lib/video-recap/skills/video-understanding/scripts/consolidate.py +1 -1
  345. package/lib/video-recap/skills/video-understanding/scripts/deslop_qc.py +20 -46
  346. package/lib/video-recap/skills/video-understanding/scripts/lib.py +31 -26
  347. package/lib/video-recap/skills/video-understanding/scripts/narration_lint.py +145 -140
  348. package/lib/video-recap/skills/video-understanding/scripts/speech_ownership.py +39 -100
  349. package/lib/video-recap/skills/video-understanding/scripts/timeline_fusion.py +33 -124
  350. package/lib/video-recap/skills/video-understanding/scripts/vlm.py +1 -4
  351. package/lib/video-recap/skills/video-voiceover/scripts/dub.py +7 -13
  352. package/lib/video-recap/skills/video-voiceover/scripts/fish_audio.py +12 -30
  353. package/lib/video-recap/skills/video-voiceover/scripts/lib.py +98 -131
  354. package/lib/video-recap/skills/video-voiceover/scripts/tts_audio.py +17 -28
  355. package/lib/video-recap/skills/video-voiceover/scripts/voiceover.py +151 -240
  356. package/package.json +45 -45
  357. package/lib/novel-to-game/skills/game-world-design/references/dialogue-design-method.md +0 -59
  358. package/lib/novel-to-game/skills/game-world-design/references/game-writing-craft.md +0 -53
  359. package/lib/novel-to-game/skills/novel-to-game/references/intake-benchmark-reference.md +0 -42
  360. package/lib/oh-story/skills/story-long-write/references/state-tracking.md +0 -108
@@ -2,6 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  const fs = require('fs');
5
+ const { loadStyleWhitelist, maskStyleText } = require('./style-whitelist.js');
5
6
  const path = require('path');
6
7
 
7
8
  const USAGE = `Usage: node check-ai-patterns.js [--check] [--json] [--fail-on=blocking|all] <file...>
@@ -30,6 +31,7 @@ Detect high-risk AI-flavor prose patterns that need human rewrite:
30
31
  - 章尾状态总结体 (文末窗口 这一夜注定/这一切都结束了/新的人生才刚刚开始/命运的齿轮)
31
32
  - 引号强调滥用 (叙述里 1-4 字短词加引号强调,密度型)
32
33
 
34
+ Book-local .deslop-whitelist literal spans are excluded from style scanning (no regex or ancestor inheritance).
33
35
  Each finding carries severity: blocking by default for generation/deslop cleanup (not-is-comparison / em-dash / voice-contrast / negation-parade / reverse-not-is / trailer-ending / trailer-summary). This is a local style/readability gate, not an AIGC detector score; functional human text can be marked for review instead of hard-edited for a detector.
34
36
  或 advisory (period-stutter / long-paragraph / micro-action-tic / stock-reaction-tic / action-list-tic / abstract-summary-tic / cliche-density-tic / metaphor-density-tic / reasoning-chain-tic / system-notice-formality-tic / overcompressed-prose-tic / low-connective-density-tic / quote-emphasis-tic / formulaic-parallelism,是提示,justified 的长推理/氛围段可保留)。
35
37
  --fail-on=blocking 只在出现 blocking finding 时退出 1;默认 --fail-on=all 有任何 finding 即退出 1。
@@ -308,7 +310,10 @@ for (const file of options.files) {
308
310
  continue;
309
311
  }
310
312
 
311
- const findings = scanDocument(input).map((finding) => ({ file, ...finding }));
313
+ let whitelist;
314
+ try { whitelist = loadStyleWhitelist(fullPath); }
315
+ catch (error) { die(`${file}: unable to read .deslop-whitelist (${error.message})`); }
316
+ const findings = scanDocument(maskStyleText(input, whitelist)).map((finding) => ({ file, ...finding }));
312
317
  allFindings.push(...findings);
313
318
  }
314
319
 
@@ -43,6 +43,17 @@ const PLACEHOLDER_PATTERNS = [
43
43
  { re: /我(无法|不能)(继续(写|创作|生成|下去)|生成(内容|文本|正文)?|创作|续写|完成(这个|本)?(章|篇|创作|请求))/, label: '元信息泄漏(生成拒绝语)', hard: false },
44
44
  ];
45
45
 
46
+ const QUOTED_SPAN_PATTERNS = [
47
+ /「[^」]*」/g,
48
+ /『[^』]*』/g,
49
+ /【[^】]*】/g,
50
+ /“[^”]*”/g,
51
+ // 单引号须成对;词内撇号(don't、O’Connor)不作为开闭引号。
52
+ /(?<![A-Za-z0-9_])‘(?:[^’]|(?<=[A-Za-z0-9_])’(?=[A-Za-z0-9_]))*(?!(?<=[A-Za-z0-9_])’[A-Za-z0-9_])’/g,
53
+ /"[^"]*"/g,
54
+ /(?<![A-Za-z0-9_])'(?:[^']|(?<=[A-Za-z0-9_])'(?=[A-Za-z0-9_]))*(?!(?<=[A-Za-z0-9_])'[A-Za-z0-9_])'/g,
55
+ ];
56
+
46
57
  // 工程词泄漏(正文元信息扫描的确定性版):弱模型把写作工程词漏进正文,破坏代入感
47
58
  // (DeepSeek-v4 这类会在对话里冒「该到下一章了」)。漏词的模型自己发现不了,靠脚本兜。
48
59
  // tier1 = 纯写作流水线术语,正文里几乎永不合法;tier2 = 章节结构/歧义词,角色在故事内
@@ -150,21 +161,23 @@ function isContent(trimmed) {
150
161
  return trimmed && !trimmed.startsWith('#') && !/^-{3,}$/.test(trimmed);
151
162
  }
152
163
 
153
- function isDialogueLike(trimmed) {
154
- return /[“”"'‘’「」『』【】]/.test(trimmed);
164
+ // 等长遮住成对引号内的内容以保留列号;未闭合引号不豁免。
165
+ function maskQuotedSpans(text) {
166
+ let masked = text;
167
+ for (const pattern of QUOTED_SPAN_PATTERNS) {
168
+ masked = masked.replace(pattern, (match) => ' '.repeat(match.length));
169
+ }
170
+ return masked;
155
171
  }
156
172
 
157
173
  // 去掉成对引号内的片段(台词/系统词/引用物件),只留引号外叙述。复读判定用:重复台词是体裁
158
174
  // 手法(豁免),但「叙述 + 引号内物件/短台词」混合行里引号外叙述的复读仍是退化,不能整行豁免。
159
175
  function stripQuoted(text) {
160
- return text
161
- .replace(/「[^」]*」/g, '')
162
- .replace(/『[^』]*』/g, '')
163
- .replace(/【[^】]*】/g, '')
164
- .replace(/“[^”]*”/g, '')
165
- .replace(/‘[^’]*’/g, '')
166
- .replace(/"[^"]*"/g, '')
167
- .replace(/'[^']*'/g, '');
176
+ let stripped = text;
177
+ for (const pattern of QUOTED_SPAN_PATTERNS) {
178
+ stripped = stripped.replace(pattern, '');
179
+ }
180
+ return stripped;
168
181
  }
169
182
 
170
183
  function visibleLength(text) {
@@ -253,18 +266,19 @@ function findPlaceholders(content) {
253
266
  const findings = [];
254
267
  for (const { trimmed, lineNo } of content) {
255
268
  if (!isContent(trimmed)) continue;
256
- const dialogue = isDialogueLike(trimmed);
269
+ const outsideQuotes = maskQuotedSpans(trimmed);
257
270
  for (const { re, label, hard } of PLACEHOLDER_PATTERNS) {
258
- if (!hard && dialogue) continue; // soft 拒绝语在对话行里可能是正常台词,豁免
259
- const m = re.exec(trimmed);
271
+ // hard 信号仍扫描整行;soft 自指/拒绝语只扫描成对引号外,且遮罩等长以保留列号。
272
+ const m = re.exec(hard ? trimmed : outsideQuotes);
260
273
  if (m) {
274
+ const index = m.index || 0;
261
275
  findings.push({
262
276
  line: lineNo,
263
- column: (m.index || 0) + 1,
277
+ column: index + 1,
264
278
  type: 'placeholder-leak',
265
279
  severity: 'blocking',
266
280
  message: `${label}:正文混入元信息/拒绝语/占位符,重写本段干净落地。`,
267
- excerpt: compact(trimmed.slice(Math.max(0, (m.index || 0) - 4), (m.index || 0) + 20)),
281
+ excerpt: compact(trimmed.slice(Math.max(0, index - 4), index + 20)),
268
282
  });
269
283
  break; // one finding per line is enough
270
284
  }
@@ -283,17 +297,22 @@ function findMetaLeak(content) {
283
297
  // 标题行(第N章 章名,无 ## 前缀时也算)属「标题行以外的正文」之外,排除
284
298
  if (/^第[一二三四五六七八九十百千万两0-9]+章/.test(trimmed)) continue;
285
299
  }
286
- const dialogue = isDialogueLike(trimmed);
287
- let m = META_TIER1_RE.exec(trimmed);
300
+ const outsideQuotes = maskQuotedSpans(trimmed);
301
+ let m = META_TIER1_RE.exec(outsideQuotes);
302
+ let quotedTier1 = false;
303
+ if (!m) {
304
+ m = META_TIER1_RE.exec(trimmed);
305
+ quotedTier1 = Boolean(m);
306
+ }
288
307
  if (m) {
289
308
  // tier1 纯工程词正文里几乎永不合法→blocking;但写手/编剧题材里角色在故事内真讨论创作,
290
- // 台词(对话行)里可能合法,降级为 advisory(仍报告,交人/LLM 判,不强制回炉)。
309
+ // 且命中实际位于成对引号内时可能合法,降级为 advisory。同一行别处出现引号不影响判定。
291
310
  findings.push({
292
311
  line: lineNo,
293
312
  column: m.index + 1,
294
313
  type: 'meta-leak',
295
- severity: dialogue ? 'advisory' : 'blocking',
296
- message: `工程词泄漏:「${m[0]}」是写作流水线术语,正文里不该出现;改成角色/场景内表达。${dialogue ? '例外:角色为作者/编剧、在故事内真实讨论创作时,台词里可能合法。' : ''}`,
314
+ severity: quotedTier1 ? 'advisory' : 'blocking',
315
+ message: `工程词泄漏:「${m[0]}」是写作流水线术语,正文里不该出现;改成角色/场景内表达。${quotedTier1 ? '例外:角色为作者/编剧、在故事内真实讨论创作时,台词里可能合法。' : ''}`,
297
316
  excerpt: compact(trimmed.slice(Math.max(0, m.index - 6), m.index + 18)),
298
317
  });
299
318
  continue; // tier1 命中即可,不再叠 tier2
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * Usage:
6
6
  * node scripts/check-delivery-contract.js --json \
7
- * --min-chars N --max-chars N --sections N [project-dir]
7
+ * --min-chars N --max-chars N --sections N [--min-section-chars N] [--check-contract] [project-dir]
8
+ * --check-contract validates only parameters before writing; it is not delivery approval.
8
9
  * Exit: 0 = pass, 1 = blocking delivery failures, 2 = invalid invocation.
9
10
  *
10
11
  * The verifier only checks user-visible size and shape. It does not score prose,
@@ -91,6 +92,23 @@ function verify(projectDir, contract) {
91
92
  '只校正缺失、多余或误写的小节标记;不要为凑节数新开支线。'
92
93
  ))
93
94
 
95
+ if (contract.minSectionChars != null) {
96
+ for (const [index, entry] of markers.entries()) {
97
+ const end = index + 1 < markers.length ? markers[index + 1].line - 1 : lines.length
98
+ const count = visibleChars(lines.slice(entry.line, end).join('\n'))
99
+ checks.push({
100
+ ...makeCheck(
101
+ 'delivery.section-min-chars',
102
+ count >= contract.minSectionChars,
103
+ `${entry.text} 正文非空白 Unicode 字符:${count}`,
104
+ `每节正文至少 ${contract.minSectionChars} 个非空白字符(不含小节标记)`,
105
+ `只补足第 ${index + 1} 节既有情节点的行动、后果或对话,不新增支线。`
106
+ ),
107
+ section: index + 1,
108
+ actual_chars: count,
109
+ })
110
+ }
111
+ }
94
112
  const styles = new Set(markers.map((entry) => entry.marker.style))
95
113
  checks.push(makeCheck(
96
114
  'delivery.section-style',
@@ -141,12 +159,14 @@ function report(project, contract, checks) {
141
159
  return {
142
160
  schema_version: 1,
143
161
  verifier: 'story-short-write.delivery-contract',
162
+ scope: 'delivery',
144
163
  project,
145
164
  contract: {
146
165
  metric: 'non_whitespace_unicode_chars_v1',
147
166
  min_chars: contract.minChars,
148
167
  max_chars: contract.maxChars,
149
168
  sections: contract.sections,
169
+ min_section_chars: contract.minSectionChars ?? null,
150
170
  },
151
171
  ok: failures.length === 0,
152
172
  checks,
@@ -158,6 +178,7 @@ function report(project, contract, checks) {
158
178
  expected: failure.expected,
159
179
  references: failure.references,
160
180
  repair: failure.repair,
181
+ ...(failure.section === undefined ? {} : { section: failure.section, actual_chars: failure.actual_chars }),
161
182
  })),
162
183
  }
163
184
  }
@@ -173,8 +194,8 @@ function parseArgs(argv) {
173
194
  const positional = []
174
195
  for (let index = 0; index < argv.length; index++) {
175
196
  const arg = argv[index]
176
- if (arg === '--json') continue
177
- if (['--min-chars', '--max-chars', '--sections'].includes(arg)) {
197
+ if (arg === '--json' || arg === '--check-contract') continue
198
+ if (['--min-chars', '--max-chars', '--sections', '--min-section-chars'].includes(arg)) {
178
199
  if (index + 1 >= argv.length || argv[index + 1].startsWith('--')) return null
179
200
  values[arg] = parsePositiveInteger(argv[++index])
180
201
  if (values[arg] === null) return null
@@ -186,12 +207,18 @@ function parseArgs(argv) {
186
207
  if (positional.length > 1) return null
187
208
  if (!values['--min-chars'] || !values['--max-chars'] || !values['--sections']) return null
188
209
  if (values['--min-chars'] > values['--max-chars']) return null
210
+ // The shortest allowed markers are 1., 2., ...; they count even without a body floor.
211
+ const sections = values['--sections']
212
+ let minimum = sections * ((values['--min-section-chars'] ?? 0) + 1)
213
+ for (let start = 1; start <= sections; start *= 10) minimum += sections - start + 1
214
+ if (minimum > values['--max-chars']) return null
189
215
  return {
190
216
  project: positional[0] || '.',
191
217
  contract: {
192
218
  minChars: values['--min-chars'],
193
219
  maxChars: values['--max-chars'],
194
220
  sections: values['--sections'],
221
+ minSectionChars: values['--min-section-chars'] ?? null,
195
222
  },
196
223
  }
197
224
  }
@@ -199,10 +226,12 @@ function parseArgs(argv) {
199
226
  function main(argv) {
200
227
  const parsed = parseArgs(argv)
201
228
  if (!parsed) {
202
- process.stderr.write('用法: node scripts/check-delivery-contract.js --json --min-chars N --max-chars N --sections N [project-dir]\n')
229
+ process.stderr.write('参数缺失或范围不可同时满足。用法: node scripts/check-delivery-contract.js --json --min-chars N --max-chars N --sections N [--min-section-chars N] [--check-contract] [project-dir]\n')
203
230
  return 2
204
231
  }
205
- const result = verify(parsed.project, parsed.contract)
232
+ const result = argv.includes('--check-contract')
233
+ ? { ...report(path.resolve(parsed.project), parsed.contract, []), scope: 'parameters-only' }
234
+ : verify(parsed.project, parsed.contract)
206
235
  process.stdout.write(`${JSON.stringify(result, null, 2)}\n`)
207
236
  return result.ok ? 0 : 1
208
237
  }
@@ -31,8 +31,9 @@
31
31
  * 收尾复扫用 `正文/第XXX章_*.md` 这类通配传多章时,多出来的正文不能被当成细纲吞掉
32
32
  * ——那会让首个文件比错对象、其余文件根本不检,静默退 0 报「干净」。
33
33
  *
34
- * 退出码:0 = 干净或无法判定(缺细纲/非分章正文);1 = 有重合待复核。
35
- * 无发现时完全静默,不污染上下文。
34
+ * 退出码:0 = 干净或未自动发现细纲而跳过;1 = 有重合待复核;
35
+ * 2 = 参数错误、输入不可读(含已发现的细纲)或非预期异常。
36
+ * 干净时静默;自动发现不到细纲时明确报告跳过,避免与「已检查且干净」混淆。
36
37
  */
37
38
 
38
39
  'use strict'
@@ -42,19 +43,59 @@ const path = require('path')
42
43
  const MIN_RUN = 16 // 判定阈值:连续重合 >15 字,即 >=16
43
44
  const REPORT_TOP = 8 // 最多列出的片段数
44
45
 
45
- function read(p) {
46
+ function readTextFile(p) {
46
47
  try {
47
- return fs.readFileSync(p, 'utf8').replace(/^/, '')
48
- } catch {
49
- return null
48
+ const stat = fs.statSync(p)
49
+ if (!stat.isFile()) return { ok: false, reason: '不是普通文件' }
50
+ return { ok: true, text: fs.readFileSync(p, 'utf8').replace(/^/, '') }
51
+ } catch (error) {
52
+ if (error && error.code === 'ENOENT') return { ok: false, reason: '不存在' }
53
+ if (error && error.code) return { ok: false, reason: `无法读取(${error.code})` }
54
+ return { ok: false, reason: `无法读取:${error instanceof Error ? error.message : String(error)}` }
50
55
  }
51
56
  }
52
57
 
58
+ function reportInputError(kind, file, reason) {
59
+ process.stderr.write(`错误: 无法读取${kind} "${file}":${reason}。\n`)
60
+ }
61
+
62
+ function reportUsageError(message) {
63
+ process.stderr.write(`错误: ${message}。\n`)
64
+ process.stderr.write('用法: node check-outline-copy.js [--outline <细纲路径>] <正文路径...>\n')
65
+ return 2
66
+ }
67
+
53
68
  /** 只留汉字——剥掉标点/加粗/【】后比对,防止细纲标注造成假阴性 */
54
69
  function hanOnly(s) {
55
70
  return s.replace(/[^一-鿿]/g, '')
56
71
  }
57
72
 
73
+ // 写后回填的完成记录不是誊抄来源。标题块包含子标题;字段块止于下一字段或标题。
74
+ function stripCompletionRecord(outline) {
75
+ let headingLevel = 0
76
+ let inField = false
77
+ return outline.split('\n').filter((line) => {
78
+ const heading = line.match(/^ {0,3}(#{1,6})[\t ]+(.*)$/)
79
+ if (headingLevel) {
80
+ if (!heading || heading[1].length > headingLevel) return false
81
+ headingLevel = 0
82
+ }
83
+ if (inField) {
84
+ if (!heading && !/^[-*+][\t ]+/.test(line)) return false
85
+ inField = false
86
+ }
87
+ if (heading && heading[2].includes('实际完成情况')) {
88
+ headingLevel = heading[1].length
89
+ return false
90
+ }
91
+ if (/^[-*+][\t ]+(?:\*\*|__)?实际完成情况[^::]*[::]/.test(line)) {
92
+ inField = true
93
+ return false
94
+ }
95
+ return true
96
+ }).join('\n')
97
+ }
98
+
58
99
  /**
59
100
  * 抽出细纲「复沓锚句」字段下的原话,一行一条。
60
101
  * 只认这一个字段,不扫情节点序列——锚句集中在固定区块,情节点保持只写「要发生什么」。
@@ -129,7 +170,9 @@ function findOutline(proseFile) {
129
170
  const fm = file.match(/^细纲_第0*(\d+)章.*\.md$/)
130
171
  if (fm && fm[1] === chapter) return path.join(dir, file)
131
172
  }
132
- } catch {}
173
+ } catch (error) {
174
+ if (error.code !== 'ENOENT') throw error
175
+ }
133
176
  return null
134
177
  }
135
178
 
@@ -137,34 +180,56 @@ function main() {
137
180
  const proseFiles = []
138
181
  let explicitOutline = null
139
182
  const argv = process.argv.slice(2)
183
+ let positionalOnly = false
140
184
  for (let k = 0; k < argv.length; k++) {
141
- if (argv[k] === '--outline') explicitOutline = argv[++k] || null
142
- else proseFiles.push(argv[k])
143
- }
144
- if (!proseFiles.length) {
145
- process.stderr.write('用法: node check-outline-copy.js [--outline <细纲路径>] <正文路径...>\n')
146
- return 0
185
+ const arg = argv[k]
186
+ if (!positionalOnly && arg === '--') {
187
+ positionalOnly = true
188
+ } else if (!positionalOnly && arg === '--outline') {
189
+ if (explicitOutline !== null) return reportUsageError('--outline 不能重复指定')
190
+ const value = argv[k + 1]
191
+ if (!value || value.startsWith('--')) return reportUsageError('--outline 缺少路径')
192
+ explicitOutline = value
193
+ k++
194
+ } else if (!positionalOnly && arg.startsWith('--')) {
195
+ return reportUsageError(`未知选项: ${arg}`)
196
+ } else {
197
+ proseFiles.push(arg)
198
+ }
147
199
  }
148
- // 逐个文件独立判定;任一文件有重合即整体退 1
200
+ if (!proseFiles.length) return reportUsageError('缺少正文路径')
201
+
202
+ // 逐个文件独立判定;输入错误优先于重合发现
149
203
  let status = 0
150
204
  for (const proseFile of proseFiles) {
151
- if (checkOne(proseFile, explicitOutline)) status = 1
205
+ status = Math.max(status, checkOne(proseFile, explicitOutline))
152
206
  }
153
207
  return status
154
208
  }
155
209
 
156
210
  function checkOne(proseFile, explicitOutline) {
157
- const prose = read(proseFile)
158
- if (prose === null) return 0
211
+ const proseResult = readTextFile(proseFile)
212
+ if (!proseResult.ok) {
213
+ reportInputError('正文', proseFile, proseResult.reason)
214
+ return 2
215
+ }
216
+ const prose = proseResult.text
159
217
 
160
218
  const outlineFile = explicitOutline || findOutline(proseFile)
161
- if (!outlineFile) return 0
162
- const outline = read(outlineFile)
163
- if (outline === null) return 0
219
+ if (!outlineFile) {
220
+ process.stdout.write(`细纲照搬检测:跳过 "${proseFile}"(未自动发现细纲)。\n`)
221
+ return 0
222
+ }
223
+ const outlineResult = readTextFile(outlineFile)
224
+ if (!outlineResult.ok) {
225
+ reportInputError(explicitOutline ? '显式细纲' : '自动发现的细纲', outlineFile, outlineResult.reason)
226
+ return 2
227
+ }
228
+ const outline = outlineResult.text
164
229
 
165
230
  // 正文去掉标题行后比对
166
231
  const P = hanOnly(prose.replace(/^#.*$/gm, ''))
167
- const O = hanOnly(outline)
232
+ const O = hanOnly(stripCompletionRecord(outline))
168
233
  if (P.length < MIN_RUN || O.length < MIN_RUN) return 0
169
234
 
170
235
  // 复沓锚句列出的原话允许逐字落地,命中后计入豁免、不判誊抄
@@ -236,6 +301,8 @@ function checkOne(proseFile, explicitOutline) {
236
301
 
237
302
  try {
238
303
  process.exit(main())
239
- } catch {
240
- process.exit(0)
304
+ } catch (error) {
305
+ const message = error instanceof Error ? error.message : String(error)
306
+ process.stderr.write(`错误: 细纲照搬检测异常:${message}。\n`)
307
+ process.exit(2)
241
308
  }
@@ -2,6 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  const fs = require('fs');
5
+ const { loadStyleWhitelist, styleSpans } = require('./style-whitelist.js');
5
6
  const path = require('path');
6
7
 
7
8
  const USAGE = `Usage: node normalize-punctuation.js [--check] [--quote-mode keep|ascii|yan] <file...>
@@ -9,6 +10,7 @@ const USAGE = `Usage: node normalize-punctuation.js [--check] [--quote-mode keep
9
10
  Normalize正文 punctuation deterministically:
10
11
  - replace ellipses, em dashes, and double hyphens with Chinese punctuation
11
12
  - remove markdown divider lines (---) from正文
13
+ - preserve pause punctuation covered by book-local .deslop-whitelist literals
12
14
  - keep quote style by default; convert quotes only when explicitly requested
13
15
  `;
14
16
 
@@ -61,7 +63,10 @@ for (const file of options.files) {
61
63
  continue;
62
64
  }
63
65
 
64
- const result = normalizeDocument(input, options.quoteMode);
66
+ let whitelist;
67
+ try { whitelist = loadStyleWhitelist(fullPath); }
68
+ catch (error) { die(`${file}: unable to read .deslop-whitelist (${error.message})`); }
69
+ const result = normalizeDocument(input, options.quoteMode, whitelist);
65
70
  totalFindings += result.findings.length;
66
71
 
67
72
  if (options.check) {
@@ -94,7 +99,7 @@ function die(message) {
94
99
  process.exit(2);
95
100
  }
96
101
 
97
- function normalizeDocument(input, quoteMode) {
102
+ function normalizeDocument(input, quoteMode, whitelist) {
98
103
  const { lines, endings } = splitLinesKeepingEndings(input);
99
104
 
100
105
  const findings = [];
@@ -159,7 +164,7 @@ function normalizeDocument(input, quoteMode) {
159
164
  }
160
165
 
161
166
  const commentOpenBefore = commentOpen;
162
- const punctuationResult = normalizePausePunctuation(line, lineNo, commentOpen);
167
+ const punctuationResult = normalizePausePunctuation(line, lineNo, commentOpen, whitelist);
163
168
  findings.push(...punctuationResult.findings);
164
169
  line = punctuationResult.line;
165
170
  commentOpen = punctuationResult.commentOpen;
@@ -237,7 +242,7 @@ function isClosingFence(line, fence) {
237
242
  // 一遍归一化留不干净,再跑一遍还会改已定稿的正文;所以反复归一化到不动点。
238
243
  // 每遍至少把一个 `…/./—/-` 换成非停顿字符,字符数严格递减,必然收敛。
239
244
  // findings 只留第一遍:同一处不重复计数,column 也仍然是原行的偏移。
240
- function normalizePausePunctuation(line, lineNo, commentOpen) {
245
+ function normalizePausePunctuation(line, lineNo, commentOpen, whitelist) {
241
246
  let current = line;
242
247
  let findings = null;
243
248
  let commentOpenAfter = commentOpen;
@@ -245,7 +250,7 @@ function normalizePausePunctuation(line, lineNo, commentOpen) {
245
250
  for (;;) {
246
251
  const comments = htmlCommentSpans(current, commentOpen);
247
252
  commentOpenAfter = comments.open;
248
- const pass = normalizePausePunctuationPass(current, lineNo, comments.spans);
253
+ const pass = normalizePausePunctuationPass(current, lineNo, comments.spans.concat(styleSpans(current, whitelist)));
249
254
  if (findings === null) findings = pass.findings;
250
255
  if (pass.line === current) break;
251
256
  current = pass.line;
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // Book-local only: never inherit an unrelated workspace or another book's choices.
7
+ function loadStyleWhitelist(file) {
8
+ const parent = path.dirname(path.resolve(file));
9
+ const book = path.basename(parent) === '正文' ? path.dirname(parent) : parent;
10
+ try {
11
+ return fs.readFileSync(path.join(book, '.deslop-whitelist'), 'utf8')
12
+ .split(/\r?\n/).map(line => line.trim())
13
+ .filter(line => line && !line.startsWith('#'))
14
+ .sort((a, b) => b.length - a.length);
15
+ } catch (error) {
16
+ if (error.code === 'ENOENT') return [];
17
+ throw error;
18
+ }
19
+ }
20
+
21
+ function styleSpans(text, whitelist) {
22
+ const spans = [];
23
+ for (const literal of whitelist) {
24
+ for (let at = text.indexOf(literal); at !== -1; at = text.indexOf(literal, at + 1)) {
25
+ spans.push([at, at + literal.length]);
26
+ }
27
+ }
28
+ return spans;
29
+ }
30
+
31
+ function maskStyleText(text, whitelist) {
32
+ const chars = text.split('');
33
+ for (const [start, end] of styleSpans(text, whitelist)) {
34
+ chars.fill('?', start, end);
35
+ }
36
+ return chars.join('');
37
+ }
38
+
39
+ module.exports = { loadStyleWhitelist, styleSpans, maskStyleText };
@@ -1 +1 @@
1
- {"version":3,"file":"drama-production-view.d.ts","sourceRoot":"","sources":["../../../src/client/drama-production-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,mBAAmB,EAAE,KAAK,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGnJ,OAAO,EAAyL,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,sBAAsB,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAE3V,UAAU,KAAK;IACb,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IA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,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,sBAAsB,EAAE,KAAK,IAAI,CAAC;IACxE,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,IAAI,CAAC;IACvE,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,QAAQ,CAAC,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC;CAChC;AAoED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,2CAyF/C"}
@@ -25,12 +25,30 @@ export interface WorkspaceFilePath {
25
25
  export declare function streamingAssistant(timeline: ConversationTimelineSnapshot): PartialAssistant | null;
26
26
  /** Read a JSON string even while the model is still streaming its closing quote. */
27
27
  export declare function jsonStringPrefix(raw: string, key: string): JsonStringPrefix | undefined;
28
+ /** A call a finished Assistant step issued that DSH has not settled yet. */
29
+ export interface UndispatchedCall {
30
+ readonly callId: string;
31
+ readonly name: string;
32
+ readonly argsRaw: string;
33
+ }
34
+ /**
35
+ * Calls of the open Turn whose Assistant step has finished streaming but that have no result yet.
36
+ * DSH 0.1.7 hides such a call's tool row until its durable `tool/call` event — through pre-execute
37
+ * hooks and any approval — so it is in neither `partial` nor the running calls, and a call it does
38
+ * list stays `preparing` without arguments. The step's own tool-call block still holds them.
39
+ */
40
+ export declare function undispatchedCalls(chat: ChatSnapshot): UndispatchedCall[];
41
+ export declare function sameUndispatchedCalls(left: readonly UndispatchedCall[], right: readonly UndispatchedCall[]): boolean;
28
42
  /** Return every active file mutation in official DSH dispatch order, including nested Code Mode calls. */
29
- export declare function fileMutations(runningCalls: readonly RunningToolCall[], partial?: PartialAssistant | null): FileMutationActivity[];
43
+ export declare function fileMutations(runningCalls: readonly RunningToolCall[], partial?: PartialAssistant | null, undispatched?: readonly UndispatchedCall[]): FileMutationActivity[];
30
44
  /** Running calls whose settlement may have changed creative files. */
31
45
  export declare function mutatingCallIds(runningCalls: readonly RunningToolCall[]): ReadonlySet<string>;
32
46
  /** Latest durable successful mutation, used when a fast call skips the live render window. */
33
47
  export declare function latestSettledMutation(chat: ChatSnapshot): string | undefined;
48
+ /** The Turn that produced {@link latestSettledMutation}, when the Chat still locates it. */
49
+ export declare function latestSettledMutationTurn(chat: ChatSnapshot): number | undefined;
50
+ /** The last Turn while it is open. A reloaded Session shows history Turns as closed. */
51
+ export declare function openTurn(chat: ChatSnapshot): number | undefined;
34
52
  /** Convert a DSH tool path to the creative-relative path accepted by the narrow route. */
35
53
  export declare function creativeRelativePath(path: string | undefined, cwd: string | undefined): string | undefined;
36
54
  export declare function workbenchModeForPath(path: string | undefined): WorkbenchMode | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"file-activity.d.ts","sourceRoot":"","sources":["../../../src/client/file-activity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,KAAK,EACV,4BAA4B,EAC5B,gBAAgB,EAChB,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,oBAAoB,CAAC;AAEvE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,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,aAAa,GAAG,IAAI,CAsClD;;;;;;AAED,wBAAuC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAgEpE,eAAO,MAAM,IAAI,aAAa,CAAC;AAC/B,eAAO,MAAM,MAAM,UAAwC,CAAC;AAE5D,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,OAAO;QACf,oBAAoB,EAAE;YAAE,IAAI,EAAE,QAAQ,CAAC;YAAC,KAAK,EAAE,SAAS,CAAA;SAAE,CAAC;KAC5D;CACF;AAuzDD,iFAAiF;AACjF,wBAAgB,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAsClD;;;;;;AAED,wBAAuC"}
@@ -5,5 +5,12 @@ export declare function nativeBatchPrompt(production: DramaEpisodeProduction, jo
5
5
  readonly id: string;
6
6
  readonly prompt: string;
7
7
  }[]): string;
8
+ /**
9
+ * Upstream's edit stage owns only the 剪辑单 CUT items, the delivery spec, and what it writes under
10
+ * 制作成果/成片/ (short-drama-edit stage-contract.md). Normalised clips therefore go to 成片/规格统一/,
11
+ * which mediaTargetFromPath keeps out of the shot versions, and carry no job id that could correlate
12
+ * them with a production job. An external mix ends with the loudnorm pass render itself runs
13
+ * (edit_tool.py `_loudnorm_filter`, then AAC 192k at 48 kHz).
14
+ */
8
15
  export declare function nativeCompositionPrompt(production: DramaEpisodeProduction, job: ProductionJob, orderedPaths: readonly string[]): string;
9
16
  //# sourceMappingURL=production-prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"production-prompts.d.ts","sourceRoot":"","sources":["../../../src/client/production-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAIrF,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,sBAAsB,EAClC,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,SAAS,sBAAsB,EAAE,GAC5C,MAAM,CAqBR;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,sBAAsB,EAClC,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,SAAS;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GACtE,MAAM,CAcR;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,sBAAsB,EAClC,GAAG,EAAE,aAAa,EAClB,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,MAAM,CAWR"}
1
+ {"version":3,"file":"production-prompts.d.ts","sourceRoot":"","sources":["../../../src/client/production-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAqBrF,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,sBAAsB,EAClC,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,SAAS,sBAAsB,EAAE,GAC5C,MAAM,CAuBR;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,sBAAsB,EAClC,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,SAAS;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GACtE,MAAM,CAgBR;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,sBAAsB,EAClC,GAAG,EAAE,aAAa,EAClB,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,MAAM,CAoBR"}
@@ -19,6 +19,13 @@ export interface ProductionJob {
19
19
  readonly output?: ProductionMediaVersion | undefined;
20
20
  readonly expectedOutputs: number;
21
21
  readonly completedOutputs: number;
22
+ /**
23
+ * Deliverable whose name the job cannot influence. Drama Skills 0.7 renders the
24
+ * assembled cut to a fixed path, so it carries no job id to correlate on.
25
+ */
26
+ readonly outputPath?: string | undefined;
27
+ /** Versions already at `outputPath` when the job was dispatched, so an earlier cut never completes it. */
28
+ readonly supersededOutputIds?: readonly string[] | undefined;
22
29
  }
23
30
  export interface ProductionSequenceItem {
24
31
  readonly shotId: string;
@@ -32,16 +39,42 @@ export interface ProductionQueueEntry {
32
39
  readonly id: string;
33
40
  readonly preview: string;
34
41
  }
42
+ /**
43
+ * DSH Queue rows from the host `inbox` projection's `next-turn` list. DSH 0.1.7 removed
44
+ * `SessionSnapshot.queue`; reading it threw and blanked the whole workbench (#50). The
45
+ * projection is wire JSON and absent without agent-loop, so every row is checked rather than
46
+ * trusted. Like DSH's own QueueDock, a row whose prompt RPC already has a transcript echo is
47
+ * a turn being claimed, not a queued one. The preview is the row's full text: the job-id label
48
+ * is matched against it, and the old 200-character preview could cut that label off.
49
+ */
50
+ export declare function productionQueueFromInbox(rows: unknown, claimedRequestIds?: ReadonlySet<string>): ProductionQueueEntry[];
35
51
  export declare function createPendingJob(input: {
36
52
  readonly id: string;
37
53
  readonly targetId: string;
38
54
  readonly kind: ProductionJobKind;
39
55
  readonly prompt: string;
40
56
  readonly expectedOutputs?: number | undefined;
57
+ readonly outputPath?: string | undefined;
58
+ readonly supersededOutputIds?: readonly string[] | undefined;
41
59
  }): ProductionJob;
42
60
  export declare function selectedVersionForTarget(targetId: string, versions: readonly ProductionMediaVersion[], selections: Readonly<Record<string, string>>, kind?: ProductionMediaVersion["kind"]): ProductionMediaVersion | undefined;
43
61
  export declare function mediaTargetFromPath(path: string, knownTargets: readonly string[]): string | undefined;
44
62
  export declare function mediaVersionMatchesJob(version: ProductionMediaVersion, jobId: string): boolean;
63
+ export declare function outputsForJob(job: ProductionJob, versions: readonly ProductionMediaVersion[]): ProductionMediaVersion[];
64
+ /**
65
+ * True while a composition the creator already dispatched has not settled. Every composition
66
+ * for an episode renders to the same upstream path, so a second one dispatched now would be
67
+ * completed by the first one's cut — and, once marked succeeded, could no longer be removed
68
+ * from the DSH Queue.
69
+ */
70
+ export declare function compositionInFlight(jobs: readonly ProductionJob[]): boolean;
71
+ /**
72
+ * A composition whose Turn ended without a cut stays dispatched_unknown so a late cut can still
73
+ * complete it, and compositionInFlight lets the creator compose again. Both render to the same
74
+ * upstream path, so once a new composition is dispatched its cut would complete the old job too.
75
+ * Fail the old one instead, keeping the check findings its error already reports.
76
+ */
77
+ export declare function settleSupersededCompositions(jobs: readonly ProductionJob[], next: ProductionJob): ProductionJob[];
45
78
  export declare function referencesForTarget(targetId: string, production: {
46
79
  readonly shots: readonly {
47
80
  readonly id: string;