@oh-story/dsh 0.1.12 → 0.1.14

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 (269) hide show
  1. package/README.md +18 -12
  2. package/lib/client.js +1003 -652
  3. package/lib/client.js.map +4 -4
  4. package/lib/drama/manifest.json +41 -36
  5. package/lib/drama/skills/short-drama/scripts/creator_markdown_check.py +340 -13
  6. package/lib/drama/skills/short-drama-assets/references/voice-direction.md +4 -2
  7. package/lib/drama/skills/short-drama-edit/SKILL.md +32 -12
  8. package/lib/drama/skills/short-drama-edit/references/still-cuts.md +90 -0
  9. package/lib/drama/skills/short-drama-edit/scripts/edit_tool.py +1035 -145
  10. package/lib/drama/skills/short-drama-edit/scripts/selftest.py +48 -0
  11. package/lib/drama/skills/short-drama-produce/SKILL.md +6 -1
  12. package/lib/drama/skills/short-drama-produce/references/adapter-contract.md +12 -0
  13. package/lib/drama/skills/short-drama-produce/scripts/production_tool.py +138 -9
  14. package/lib/drama/skills/short-drama-produce/scripts/provider_adapters.py +6 -0
  15. package/lib/drama/skills/short-drama-storyboard/SKILL.md +2 -0
  16. package/lib/drama/skills/short-drama-storyboard/references/production-shot-grammar.md +3 -1
  17. package/lib/drama/skills/short-drama-video-prompts/SKILL.md +7 -0
  18. package/lib/drama/skills/short-drama-video-prompts/references/performance-action-timing.md +14 -0
  19. package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.5.md +19 -6
  20. package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +1 -0
  21. package/lib/drama/skills/short-drama-video-prompts/references/target-model-profile.md +5 -0
  22. package/lib/drama/skills/short-drama-video-prompts/references/wan-3.0.md +4 -1
  23. package/lib/index.js +17 -7
  24. package/lib/index.js.map +2 -2
  25. package/lib/novel-to-game/README.md +98 -44
  26. package/lib/novel-to-game/README_ZH.md +100 -46
  27. package/lib/novel-to-game/VERSION +1 -1
  28. package/lib/novel-to-game/examples/jin-ping-mei/build/BUILD_BRIEF.md +27 -202
  29. package/lib/novel-to-game/examples/jin-ping-mei/build/app/RUN.md +23 -115
  30. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/chamber.webp +0 -0
  31. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/court_night.webp +0 -0
  32. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/court_rain.webp +0 -0
  33. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/garden.webp +0 -0
  34. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/hall.webp +0 -0
  35. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/kitchen.webp +0 -0
  36. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/street.webp +0 -0
  37. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/street_dawn.webp +0 -0
  38. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/temple.webp +0 -0
  39. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/yue/moon.webp +0 -0
  40. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/meng/angry.webp +0 -0
  41. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/meng/blush.webp +0 -0
  42. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/meng/neutral.webp +0 -0
  43. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/meng/sad.webp +0 -0
  44. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/meng/smile.webp +0 -0
  45. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/meng/surprised.webp +0 -0
  46. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pan/angry.webp +0 -0
  47. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pan/blush.webp +0 -0
  48. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pan/neutral.webp +0 -0
  49. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pan/sad.webp +0 -0
  50. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pan/smile.webp +0 -0
  51. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pan/surprised.webp +0 -0
  52. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pinger/angry.webp +0 -0
  53. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pinger/blush.webp +0 -0
  54. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pinger/neutral.webp +0 -0
  55. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pinger/sad.webp +0 -0
  56. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pinger/smile.webp +0 -0
  57. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/pinger/surprised.webp +0 -0
  58. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/xuee/angry.webp +0 -0
  59. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/xuee/blush.webp +0 -0
  60. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/xuee/neutral.webp +0 -0
  61. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/xuee/sad.webp +0 -0
  62. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/xuee/smile.webp +0 -0
  63. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/xuee/surprised.webp +0 -0
  64. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/yue/angry.webp +0 -0
  65. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/yue/blush.webp +0 -0
  66. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/yue/neutral.webp +0 -0
  67. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/yue/sad.webp +0 -0
  68. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/yue/smile.webp +0 -0
  69. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/sprite/yue/surprised.webp +0 -0
  70. package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/style.css +326 -2503
  71. package/lib/novel-to-game/examples/jin-ping-mei/build/app/index.html +71 -4
  72. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/adv.js +221 -0
  73. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/audio.js +113 -257
  74. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/main.js +511 -3026
  75. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/menus.js +277 -0
  76. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/petals.js +67 -0
  77. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/stage.js +180 -0
  78. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/store.js +70 -0
  79. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/common.js +198 -0
  80. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/common2.js +204 -0
  81. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/common3.js +198 -0
  82. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/dates.js +186 -0
  83. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/index.js +122 -0
  84. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/meng.js +190 -0
  85. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/pan.js +212 -0
  86. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/pinger.js +198 -0
  87. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/xuee.js +199 -0
  88. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/story/yue.js +214 -0
  89. package/lib/novel-to-game/examples/jin-ping-mei/build/app/package.json +2 -2
  90. package/lib/novel-to-game/examples/jin-ping-mei/build/art/generated-art.json +182 -45
  91. package/lib/novel-to-game/examples/jin-ping-mei/qa/README.md +7 -17
  92. package/lib/novel-to-game/examples/jin-ping-mei/qa/verification.json +9 -9
  93. package/lib/novel-to-game/manifest.json +303 -78
  94. package/lib/novel-to-game/skills/game-art-direction/references/art-direction-method.md +7 -2
  95. package/lib/novel-to-game/skills/game-concept/references/concept-method.md +2 -0
  96. package/lib/novel-to-game/skills/game-world-design/references/narrative-design-method.md +2 -0
  97. package/lib/novel-to-game/skills/game-world-design/references/world-design-method.md +9 -0
  98. package/lib/types/client/canvas-viewport.d.ts +31 -0
  99. package/lib/types/client/canvas-viewport.d.ts.map +1 -0
  100. package/lib/types/client/drama-production-view.d.ts +14 -2
  101. package/lib/types/client/drama-production-view.d.ts.map +1 -1
  102. package/lib/types/client/file-activity.d.ts +1 -1
  103. package/lib/types/client/file-activity.d.ts.map +1 -1
  104. package/lib/types/client/index.d.ts.map +1 -1
  105. package/lib/types/client/production-canvas.d.ts +24 -0
  106. package/lib/types/client/production-canvas.d.ts.map +1 -0
  107. package/lib/types/client/production-prompts.d.ts +7 -1
  108. package/lib/types/client/production-prompts.d.ts.map +1 -1
  109. package/lib/types/client/production-runtime.d.ts +7 -2
  110. package/lib/types/client/production-runtime.d.ts.map +1 -1
  111. package/lib/types/drama-adapters.d.ts.map +1 -1
  112. package/lib/types/skill-provider.d.ts.map +1 -1
  113. package/lib/types/video-project.d.ts.map +1 -1
  114. package/lib/video-recap/CHANGELOG.md +123 -1
  115. package/lib/video-recap/README.en.md +20 -16
  116. package/lib/video-recap/README.md +20 -16
  117. package/lib/video-recap/manifest.json +297 -321
  118. package/lib/video-recap/skills/video-assemble/SKILL.md +18 -16
  119. package/lib/video-recap/skills/video-assemble/references/explicit-audio-mix.md +3 -1
  120. package/lib/video-recap/skills/video-assemble/references/jianying/SOURCE.md +5 -5
  121. package/lib/video-recap/skills/video-assemble/references/packaging.md +4 -4
  122. package/lib/video-recap/skills/video-assemble/references/subtitle-track.md +10 -10
  123. package/lib/video-recap/skills/video-assemble/scripts/adoption/audio_mix_binding.py +13 -2
  124. package/lib/video-recap/skills/video-assemble/scripts/adoption/av_clock.py +109 -0
  125. package/lib/video-recap/skills/video-assemble/scripts/adoption/strict_publish.py +4 -1
  126. package/lib/video-recap/skills/video-assemble/scripts/artifacts.py +2 -9
  127. package/lib/video-recap/skills/video-assemble/scripts/assemble.py +188 -51
  128. package/lib/video-recap/skills/video-assemble/scripts/assemble_constants.py +0 -1
  129. package/lib/video-recap/skills/video-assemble/scripts/assembly_contract.py +32 -75
  130. package/lib/video-recap/skills/video-assemble/scripts/assembly_settings.py +8 -15
  131. package/lib/video-recap/skills/video-assemble/scripts/audio_mix.py +202 -161
  132. package/lib/video-recap/skills/video-assemble/scripts/codec_peak.py +112 -0
  133. package/lib/video-recap/skills/video-assemble/scripts/export_jianying.py +10 -101
  134. package/lib/video-recap/skills/video-assemble/scripts/jianying/builders.py +44 -475
  135. package/lib/video-recap/skills/video-assemble/scripts/jianying/model.py +1 -22
  136. package/lib/video-recap/skills/video-assemble/scripts/jianying/templates.py +0 -3
  137. package/lib/video-recap/skills/video-assemble/scripts/jianying/timeline_contract.py +36 -103
  138. package/lib/video-recap/skills/video-assemble/scripts/jianying/tracks.py +0 -8
  139. package/lib/video-recap/skills/video-assemble/scripts/jianying/writer.py +28 -203
  140. package/lib/video-recap/skills/video-assemble/scripts/lib.py +20 -34
  141. package/lib/video-recap/skills/video-assemble/scripts/loudness.py +332 -0
  142. package/lib/video-recap/skills/video-assemble/scripts/media.py +158 -38
  143. package/lib/video-recap/skills/video-assemble/scripts/narration_audio.py +30 -16
  144. package/lib/video-recap/skills/video-assemble/scripts/render_preflight.py +49 -8
  145. package/lib/video-recap/skills/video-assemble/scripts/source_subtitles.py +17 -6
  146. package/lib/video-recap/skills/video-assemble/scripts/subtitles/core.py +24 -2
  147. package/lib/video-recap/skills/video-assemble/scripts/subtitles/track.py +2 -5
  148. package/lib/video-recap/skills/video-assemble/scripts/subtitles/track_binding.py +2 -9
  149. package/lib/video-recap/skills/video-assemble/scripts/timeline.py +12 -34
  150. package/lib/video-recap/skills/video-assemble/scripts/timeline_emit.py +3 -4
  151. package/lib/video-recap/skills/video-assemble/scripts/visual_render.py +28 -2
  152. package/lib/video-recap/skills/video-cut/SKILL.md +37 -11
  153. package/lib/video-recap/skills/video-cut/references/shot-review.md +1 -1
  154. package/lib/video-recap/skills/video-cut/scripts/cut.py +2 -34
  155. package/lib/video-recap/skills/video-cut/scripts/cut_cli.py +96 -124
  156. package/lib/video-recap/skills/video-cut/scripts/cut_contract.py +97 -182
  157. package/lib/video-recap/skills/video-cut/scripts/cut_render.py +177 -166
  158. package/lib/video-recap/skills/video-cut/scripts/frame_grid.py +249 -0
  159. package/lib/video-recap/skills/video-cut/scripts/lib.py +0 -3
  160. package/lib/video-recap/skills/video-cut/scripts/media_geometry.py +173 -7
  161. package/lib/video-recap/skills/video-cut/scripts/sentence_boundaries.py +234 -151
  162. package/lib/video-recap/skills/video-cut/scripts/sentence_gate.py +189 -0
  163. package/lib/video-recap/skills/video-cut/scripts/shot_review.py +2 -6
  164. package/lib/video-recap/skills/video-recap/SKILL.md +28 -29
  165. package/lib/video-recap/skills/video-recap/references/audio-routing.md +8 -6
  166. package/lib/video-recap/skills/video-recap/references/config-playbook.md +10 -13
  167. package/lib/video-recap/skills/video-recap/references/data-schema.md +131 -74
  168. package/lib/video-recap/skills/video-recap/references/resource-library.md +17 -1
  169. package/lib/video-recap/skills/video-recap/scripts/doctor.py +51 -268
  170. package/lib/video-recap/skills/video-recap/scripts/final_qc.py +89 -254
  171. package/lib/video-recap/skills/video-recap/scripts/lib.py +81 -70
  172. package/lib/video-recap/skills/video-recap/scripts/library.py +40 -4
  173. package/lib/video-recap/skills/video-recap/scripts/materials.py +13 -80
  174. package/lib/video-recap/skills/video-recap/scripts/recap_cli.py +55 -17
  175. package/lib/video-recap/skills/video-recap/scripts/recap_inspect.py +1 -3
  176. package/lib/video-recap/skills/video-recap/scripts/recap_runner.py +96 -117
  177. package/lib/video-recap/skills/video-recap/scripts/recap_runtime.py +87 -23
  178. package/lib/video-recap/skills/video-recap/scripts/recap_source.py +0 -39
  179. package/lib/video-recap/skills/video-recap/scripts/recap_stage_qc.py +37 -135
  180. package/lib/video-recap/skills/video-recap/scripts/recap_timeline.py +118 -127
  181. package/lib/video-recap/skills/video-recap/scripts/resources/__init__.py +4 -0
  182. package/lib/video-recap/skills/video-recap/scripts/{resource_lock.py → resources/lock.py} +1 -1
  183. package/lib/video-recap/skills/video-recap/scripts/{project_binding.py → resources/project_binding.py} +78 -17
  184. package/lib/video-recap/skills/video-reference/SKILL.md +108 -0
  185. package/lib/video-recap/skills/video-reference/references/reference-schema.md +139 -0
  186. package/lib/video-recap/skills/video-reference/scripts/lib.py +85 -0
  187. package/lib/video-recap/skills/video-reference/scripts/reference.py +96 -0
  188. package/lib/video-recap/skills/video-reference/scripts/reference_check.py +553 -0
  189. package/lib/video-recap/skills/video-reference/scripts/reference_frames.py +122 -0
  190. package/lib/video-recap/skills/video-reference/scripts/reference_measure.py +253 -0
  191. package/lib/video-recap/skills/video-reference/scripts/reference_profile.py +271 -0
  192. package/lib/video-recap/skills/video-script/SKILL.md +53 -24
  193. package/lib/video-recap/skills/video-script/scripts/agent_text.py +18 -267
  194. package/lib/video-recap/skills/video-script/scripts/deslop_qc.py +12 -30
  195. package/lib/video-recap/skills/video-script/scripts/entry_suggestion.py +125 -0
  196. package/lib/video-recap/skills/video-script/scripts/evidence_bundle.py +2 -26
  197. package/lib/video-recap/skills/video-script/scripts/lib.py +5 -15
  198. package/lib/video-recap/skills/video-script/scripts/lint_summary.py +184 -0
  199. package/lib/video-recap/skills/video-script/scripts/narration_lint.py +120 -100
  200. package/lib/video-recap/skills/video-script/scripts/review.py +3 -34
  201. package/lib/video-recap/skills/video-script/scripts/review_grounding.py +20 -46
  202. package/lib/video-recap/skills/video-script/scripts/review_response.py +120 -258
  203. package/lib/video-recap/skills/video-script/scripts/review_runner.py +12 -11
  204. package/lib/video-recap/skills/video-script/scripts/speech_ownership.py +89 -5
  205. package/lib/video-recap/skills/video-script/scripts/validate.py +26 -34
  206. package/lib/video-recap/skills/video-understanding/SKILL.md +29 -4
  207. package/lib/video-recap/skills/video-understanding/references/data-schema.md +5 -22
  208. package/lib/video-recap/skills/video-understanding/scripts/agent_text.py +24 -121
  209. package/lib/video-recap/skills/video-understanding/scripts/asr.py +11 -5
  210. package/lib/video-recap/skills/video-understanding/scripts/asr_timing_evidence.py +15 -24
  211. package/lib/video-recap/skills/video-understanding/scripts/briefing/builder.py +59 -25
  212. package/lib/video-recap/skills/video-understanding/scripts/briefing/context.py +39 -3
  213. package/lib/video-recap/skills/video-understanding/scripts/briefing/inputs.py +15 -27
  214. package/lib/video-recap/skills/video-understanding/scripts/briefing/timeline.py +136 -37
  215. package/lib/video-recap/skills/video-understanding/scripts/consolidate.py +121 -37
  216. package/lib/video-recap/skills/video-understanding/scripts/detect.py +118 -16
  217. package/lib/video-recap/skills/video-understanding/scripts/index_normalize.py +359 -0
  218. package/lib/video-recap/skills/video-understanding/scripts/lib.py +62 -21
  219. package/lib/video-recap/skills/video-understanding/scripts/storyboard.py +181 -51
  220. package/lib/video-recap/skills/video-understanding/scripts/timeline_fusion.py +0 -26
  221. package/lib/video-recap/skills/video-understanding/scripts/understanding_brief.py +37 -14
  222. package/lib/video-recap/skills/video-understanding/scripts/understanding_cache.py +40 -32
  223. package/lib/video-recap/skills/video-understanding/scripts/understanding_runner.py +100 -127
  224. package/lib/video-recap/skills/video-understanding/scripts/understanding_storyboard.py +182 -30
  225. package/lib/video-recap/skills/video-understanding/scripts/vlm.py +30 -27
  226. package/lib/video-recap/skills/video-voiceover/SKILL.md +51 -18
  227. package/lib/video-recap/skills/video-voiceover/references/index-tts.md +3 -3
  228. package/lib/video-recap/skills/video-voiceover/scripts/approved_text_policy.py +3 -1
  229. package/lib/video-recap/skills/video-voiceover/scripts/dub.py +81 -135
  230. package/lib/video-recap/skills/video-voiceover/scripts/lib.py +9 -34
  231. package/lib/video-recap/skills/video-voiceover/scripts/providers/fish_audio.py +6 -1
  232. package/lib/video-recap/skills/video-voiceover/scripts/tts_audio.py +64 -1
  233. package/lib/video-recap/skills/video-voiceover/scripts/tts_cache.py +99 -0
  234. package/lib/video-recap/skills/video-voiceover/scripts/voiceover.py +177 -200
  235. package/package.json +45 -45
  236. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_accord_five.webp +0 -0
  237. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/public_day15.webp +0 -0
  238. package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/household/li_jiaoer.webp +0 -0
  239. package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/new-guofeng.css +0 -1494
  240. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/assets.js +0 -147
  241. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/data.js +0 -7470
  242. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/engine.js +0 -13066
  243. package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/text.js +0 -32
  244. package/lib/novel-to-game/examples/jin-ping-mei/qa/playable-model.json +0 -99
  245. package/lib/novel-to-game/examples/jin-ping-mei/qa/verify_playable_model.mjs +0 -152
  246. package/lib/video-recap/skills/video-assemble/references/foreground-compose.md +0 -118
  247. package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_combination_segment.json +0 -84
  248. package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_combination_video_material.json +0 -98
  249. package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_draft.json +0 -204
  250. package/lib/video-recap/skills/video-assemble/references/pair-media.md +0 -74
  251. package/lib/video-recap/skills/video-assemble/scripts/compose_foreground.py +0 -293
  252. package/lib/video-recap/skills/video-assemble/scripts/pair_media.py +0 -216
  253. package/lib/video-recap/skills/video-recap/references/shift-left-qc-schema.md +0 -23
  254. package/lib/video-recap/skills/video-recap/scripts/mimo_qc.py +0 -33
  255. package/lib/video-recap/skills/video-recap/scripts/qc/__init__.py +0 -1
  256. package/lib/video-recap/skills/video-recap/scripts/qc/mimo_client.py +0 -13
  257. package/lib/video-recap/skills/video-recap/scripts/qc/mimo_contract.py +0 -9
  258. package/lib/video-recap/skills/video-recap/scripts/qc/mimo_evidence.py +0 -287
  259. package/lib/video-recap/skills/video-recap/scripts/qc/mimo_observations.py +0 -175
  260. package/lib/video-recap/skills/video-recap/scripts/qc/mimo_payload.py +0 -206
  261. package/lib/video-recap/skills/video-recap/scripts/qc/mimo_report.py +0 -318
  262. package/lib/video-recap/skills/video-recap/scripts/qc/mimo_runner.py +0 -130
  263. package/lib/video-recap/skills/video-recap/scripts/qc_contract.py +0 -320
  264. package/lib/video-recap/skills/video-script/scripts/timeline_fusion.py +0 -108
  265. package/lib/video-recap/skills/video-understanding/scripts/brief.py +0 -9
  266. package/lib/video-recap/skills/video-understanding/scripts/deslop_qc.py +0 -211
  267. package/lib/video-recap/skills/video-understanding/scripts/narration_lint.py +0 -707
  268. package/lib/video-recap/skills/video-understanding/scripts/speech_ownership.py +0 -143
  269. /package/lib/video-recap/skills/video-cut/scripts/{narration_mapping.py → cut_qc.py} +0 -0
package/lib/client.js CHANGED
@@ -24,7 +24,7 @@ __export(index_exports, {
24
24
  name: () => name
25
25
  });
26
26
  module.exports = __toCommonJS(index_exports);
27
- var import_dsh_client_store = require("@deepseek-ai/dsh-client-store"), import_react3 = require("react"), import_react_dom = require("react-dom");
27
+ var import_dsh_client_store = require("@deepseek-ai/dsh-client-store"), import_react4 = require("react"), import_react_dom = require("react-dom");
28
28
 
29
29
  // src/client/file-activity.ts
30
30
  var WORKBENCH_LABELS = {
@@ -108,7 +108,7 @@ function parsedArgs(raw) {
108
108
  return;
109
109
  }
110
110
  }
111
- function mutationFromArgs(name2, callId, argsRaw, stage) {
111
+ function mutationFromArgs(name2, callId, argsRaw, stage, argumentsComplete) {
112
112
  let complete = parsedArgs(argsRaw);
113
113
  if (name2 === "write")
114
114
  return {
@@ -156,7 +156,7 @@ function mutationFromArgs(name2, callId, argsRaw, stage) {
156
156
  path,
157
157
  operation: "replace-text",
158
158
  oldText: completedString(argsRaw, "old_str"),
159
- newText: jsonStringPrefix(argsRaw, "new_str")?.value ?? (complete !== void 0 ? "" : void 0),
159
+ newText: jsonStringPrefix(argsRaw, "new_str")?.value ?? (argumentsComplete ?? complete !== void 0 ? "" : void 0),
160
160
  replaceAll: complete?.replace_all === !0
161
161
  } : command === "insert" ? {
162
162
  callId,
@@ -198,8 +198,20 @@ function sameUndispatchedCalls(left, right) {
198
198
  function fileMutations(runningCalls, partial = null, undispatched = []) {
199
199
  let values = [];
200
200
  visitRunning(runningCalls, (call) => {
201
- if (call.phase !== "start") return;
202
- let mutation = mutationFromArgs(call.name, call.callId, call.argsRaw, "running");
201
+ if (call.phase === "start") {
202
+ let mutation2 = mutationFromArgs(call.name, call.callId, call.argsRaw, "running");
203
+ mutation2 !== void 0 && values.push(mutation2);
204
+ return;
205
+ }
206
+ if (call.args === void 0 || !["write", "edit", "str_replace_editor"].includes(call.name)) return;
207
+ let fields = {};
208
+ for (let key of ["file_path", "path", "content", "file_text", "new_string", "new_str", "old_string", "old_str", "command", "insert_line", "replace_all"]) {
209
+ if (["old_string", "old_str", "command"].includes(key) && !call.args.complete(key)) continue;
210
+ let value = call.args.text(key) ?? call.args.value(key);
211
+ value !== void 0 && (fields[key] = value);
212
+ }
213
+ if (Object.keys(fields).length === 0) return;
214
+ let mutation = mutationFromArgs(call.name, call.callId, JSON.stringify(fields), "streaming", call.args.closed());
203
215
  mutation !== void 0 && values.push(mutation);
204
216
  });
205
217
  for (let call of undispatched) {
@@ -798,7 +810,7 @@ function creatorDocumentOrder(path) {
798
810
  }
799
811
 
800
812
  // src/client/drama-production-view.tsx
801
- var import_react = require("react");
813
+ var import_react2 = require("react");
802
814
 
803
815
  // src/client/workbench-ui.ts
804
816
  function handleTabKey(event, values, current, select) {
@@ -813,8 +825,232 @@ function endpoint(path, sessionId, file) {
813
825
  return url.searchParams.set("sessionId", sessionId), file !== void 0 && url.searchParams.set("path", file), url.toString();
814
826
  }
815
827
 
828
+ // src/client/production-canvas.tsx
829
+ var import_react = require("react");
830
+
831
+ // src/client/canvas-viewport.ts
832
+ var DEFAULT_CANVAS_VIEWPORT = { x: 0, y: 0, zoom: 0.65 }, FIT_PADDING = 40;
833
+ function clampZoom(zoom) {
834
+ return Math.min(3, Math.max(0.1, zoom));
835
+ }
836
+ function zoomAt(viewport, factor, anchor) {
837
+ let zoom = clampZoom(viewport.zoom * factor), scale = zoom / viewport.zoom;
838
+ return { x: anchor.x - (anchor.x - viewport.x) * scale, y: anchor.y - (anchor.y - viewport.y) * scale, zoom };
839
+ }
840
+ function wheelZoomFactor(deltaY, deltaMode) {
841
+ let pixels = deltaMode === 1 ? deltaY * 16 : deltaMode === 2 ? deltaY * 800 : deltaY;
842
+ return Math.exp(-pixels * 1e-3);
843
+ }
844
+ function centerOn(viewport, node, size) {
845
+ return {
846
+ x: size.width / 2 - (node.x + 180 / 2) * viewport.zoom,
847
+ y: size.height / 2 - (node.y + 76 / 2) * viewport.zoom,
848
+ zoom: viewport.zoom
849
+ };
850
+ }
851
+ function nodeVisible(viewport, node, size) {
852
+ let left = node.x * viewport.zoom + viewport.x, top = node.y * viewport.zoom + viewport.y;
853
+ return left >= 0 && top >= 0 && left + 180 * viewport.zoom <= size.width && top + 76 * viewport.zoom <= size.height;
854
+ }
855
+ function fitNodes(nodes, size, fallback = DEFAULT_CANVAS_VIEWPORT) {
856
+ if (nodes.length === 0 || size.width <= 0 || size.height <= 0) return fallback;
857
+ let left = Math.min(...nodes.map((node) => node.x)), top = Math.min(...nodes.map((node) => node.y)), right = Math.max(...nodes.map((node) => node.x + 180)), bottom = Math.max(...nodes.map((node) => node.y + 76)), widthZoom = (size.width - FIT_PADDING * 2) / Math.max(1, right - left), heightZoom = (size.height - FIT_PADDING * 2) / Math.max(1, bottom - top), zoom = clampZoom(Math.min(1, Math.max(Math.min(widthZoom, heightZoom), Math.min(widthZoom, 0.4)))), fitsHeight = (bottom - top) * zoom <= size.height - FIT_PADDING * 2;
858
+ return {
859
+ x: (size.width - (right - left) * zoom) / 2 - left * zoom,
860
+ y: fitsHeight ? (size.height - (bottom - top) * zoom) / 2 - top * zoom : FIT_PADDING - top * zoom,
861
+ zoom
862
+ };
863
+ }
864
+
865
+ // src/client/production-canvas.tsx
866
+ var import_jsx_runtime3 = require("react/jsx-runtime"), CLICK_SLOP = 4, BUTTON_ZOOM_STEP = 1.2, WHEEL_COMMIT_DELAY = 160;
867
+ function canvasNodes(production) {
868
+ let assets = [...production.assets, ...production.visualAssets].map((asset, index) => ({ id: asset.id, label: asset.title, type: "asset", initial: { x: 80, y: 80 + index * 150 } })), shots = production.shots.map((shot, index) => ({ id: shot.id, label: shot.title, type: "shot", initial: { x: 640, y: 80 + index * 180 } }));
869
+ return [...assets, ...shots];
870
+ }
871
+ function ProductionCanvas(props) {
872
+ let nodes = (0, import_react.useMemo)(() => canvasNodes(props.production), [props.production]), viewportRef = (0, import_react.useRef)(null), [size, setSize] = (0, import_react.useState)({ width: 0, height: 0 }), [liveViewport, setLiveViewport] = (0, import_react.useState)(), [liveNode, setLiveNode] = (0, import_react.useState)(), [panning, setPanning] = (0, import_react.useState)(!1), wheelCommit = (0, import_react.useRef)(void 0), selectedHere = (0, import_react.useRef)(void 0), followed = (0, import_react.useRef)(void 0), positions = Object.fromEntries(nodes.map((node) => [node.id, props.canvas[node.id] ?? node.initial]));
873
+ liveNode !== void 0 && (positions[liveNode.id] = liveNode.point);
874
+ let committedViewport = props.viewport ?? (size.width > 0 ? fitNodes(Object.values(positions), size) : DEFAULT_CANVAS_VIEWPORT), viewport = liveViewport ?? committedViewport, latest = (0, import_react.useRef)({ viewport, committedViewport, props, nodes, size });
875
+ latest.current = { viewport, committedViewport, props, nodes, size }, (0, import_react.useLayoutEffect)(() => {
876
+ let element = viewportRef.current;
877
+ if (element === null) return;
878
+ let measure = () => {
879
+ setSize({ width: element.clientWidth, height: element.clientHeight });
880
+ };
881
+ measure();
882
+ let observer = new ResizeObserver(measure);
883
+ return observer.observe(element), () => {
884
+ observer.disconnect();
885
+ };
886
+ }, []), (0, import_react.useEffect)(() => {
887
+ let element = viewportRef.current;
888
+ if (element === null) return;
889
+ let onWheel = (event) => {
890
+ event.preventDefault();
891
+ let bounds = element.getBoundingClientRect(), next = zoomAt(latest.current.viewport, wheelZoomFactor(event.deltaY, event.deltaMode), { x: event.clientX - bounds.left, y: event.clientY - bounds.top });
892
+ setLiveViewport(next), clearTimeout(wheelCommit.current), wheelCommit.current = setTimeout(() => {
893
+ wheelCommit.current = void 0, latest.current.props.onViewportChange(next), setLiveViewport(void 0);
894
+ }, WHEEL_COMMIT_DELAY);
895
+ };
896
+ return element.addEventListener("wheel", onWheel, { passive: !1 }), () => {
897
+ element.removeEventListener("wheel", onWheel), clearTimeout(wheelCommit.current);
898
+ };
899
+ }, []);
900
+ let measured = size.width > 0;
901
+ (0, import_react.useEffect)(() => {
902
+ let { committedViewport: initial, props: currentProps } = latest.current;
903
+ measured && currentProps.viewport === void 0 && currentProps.onViewportChange(initial);
904
+ }, [measured]), (0, import_react.useEffect)(() => {
905
+ let { viewport: current, props: currentProps, nodes: currentNodes, size: currentSize } = latest.current, id = currentProps.selectedId;
906
+ if (!measured || id === followed.current || (followed.current = id, id === void 0)) return;
907
+ if (id === selectedHere.current) {
908
+ selectedHere.current = void 0;
909
+ return;
910
+ }
911
+ let node = currentNodes.find((candidate) => candidate.id === id);
912
+ if (node === void 0) return;
913
+ let point = currentProps.canvas[id] ?? node.initial;
914
+ nodeVisible(current, point, currentSize) || currentProps.onViewportChange(centerOn(current, point, currentSize));
915
+ }, [measured, props.selectedId]);
916
+ let flushWheel = () => {
917
+ wheelCommit.current !== void 0 && (clearTimeout(wheelCommit.current), wheelCommit.current = void 0, props.onViewportChange(viewport), setLiveViewport(void 0));
918
+ }, commitViewport = (next) => {
919
+ clearTimeout(wheelCommit.current), wheelCommit.current = void 0, setLiveViewport(void 0), props.onViewportChange(next);
920
+ }, zoomAtCenter = (factor) => {
921
+ commitViewport(zoomAt(viewport, factor, { x: size.width / 2, y: size.height / 2 }));
922
+ }, startPan = (event) => {
923
+ if (event.target instanceof Element && event.target.closest("article") !== null || event.button !== 0 && event.button !== 1) return;
924
+ event.preventDefault(), flushWheel();
925
+ let element = event.currentTarget;
926
+ element.setPointerCapture(event.pointerId), element.focus({ preventScroll: !0 });
927
+ let origin = viewport, start = { x: event.clientX, y: event.clientY }, moved = !1, next = origin;
928
+ setPanning(!0);
929
+ let move = (moveEvent) => {
930
+ let dx = moveEvent.clientX - start.x, dy = moveEvent.clientY - start.y;
931
+ !moved && Math.hypot(dx, dy) < CLICK_SLOP || (moved = !0, next = { ...origin, x: origin.x + dx, y: origin.y + dy }, setLiveViewport(next));
932
+ }, end = () => {
933
+ element.removeEventListener("pointermove", move), element.removeEventListener("pointerup", end), element.removeEventListener("pointercancel", end), setPanning(!1), moved ? commitViewport(next) : (selectedHere.current = void 0, props.onSelect(void 0));
934
+ };
935
+ element.addEventListener("pointermove", move), element.addEventListener("pointerup", end), element.addEventListener("pointercancel", end);
936
+ }, startDrag = (event, id) => {
937
+ if (event.button !== 0) return;
938
+ event.stopPropagation();
939
+ let element = event.currentTarget;
940
+ element.setPointerCapture(event.pointerId);
941
+ let origin = positions[id] ?? { x: 0, y: 0 }, start = { x: event.clientX, y: event.clientY }, zoom = viewport.zoom, moved = !1, next = origin, move = (moveEvent) => {
942
+ let dx = moveEvent.clientX - start.x, dy = moveEvent.clientY - start.y;
943
+ !moved && Math.hypot(dx, dy) < CLICK_SLOP || (moved = !0, next = { x: origin.x + dx / zoom, y: origin.y + dy / zoom }, setLiveNode({ id, point: next }));
944
+ }, end = () => {
945
+ element.removeEventListener("pointermove", move), element.removeEventListener("pointerup", end), element.removeEventListener("pointercancel", end), setLiveNode(void 0), moved ? props.onCanvasChange({ ...props.canvas, [id]: next }) : (id !== props.selectedId && (selectedHere.current = id), props.onSelect(id));
946
+ };
947
+ element.addEventListener("pointermove", move), element.addEventListener("pointerup", end), element.addEventListener("pointercancel", end);
948
+ }, navigate = (id) => {
949
+ let target = props.production.targets.get(id);
950
+ target !== void 0 && props.onNavigate(target);
951
+ }, onNodeKeyDown = (event, id) => {
952
+ if (event.key === "Enter" || event.key === " ") {
953
+ event.preventDefault(), navigate(id);
954
+ return;
955
+ }
956
+ let step = event.shiftKey ? 40 : 10, delta = arrowDelta(event.key, step);
957
+ if (delta === void 0) return;
958
+ event.preventDefault(), event.stopPropagation();
959
+ let origin = positions[id] ?? { x: 0, y: 0 }, point = { x: origin.x + delta.x, y: origin.y + delta.y };
960
+ props.onCanvasChange({ ...props.canvas, [id]: point }), size.width > 0 && !nodeVisible(viewport, point, size) && commitViewport(centerOn(viewport, point, size));
961
+ }, onViewportKeyDown = (event) => {
962
+ if (event.target !== event.currentTarget) return;
963
+ let delta = arrowDelta(event.key, event.shiftKey ? 240 : 60);
964
+ delta !== void 0 ? (event.preventDefault(), commitViewport({ ...viewport, x: viewport.x - delta.x, y: viewport.y - delta.y })) : event.key === "+" || event.key === "=" ? (event.preventDefault(), zoomAtCenter(BUTTON_ZOOM_STEP)) : event.key === "-" || event.key === "_" ? (event.preventDefault(), zoomAtCenter(1 / BUTTON_ZOOM_STEP)) : event.key === "0" && (event.preventDefault(), commitViewport(fitNodes(Object.values(positions), size)));
965
+ }, connections = props.production.shots.flatMap((shot) => shot.references.map((reference) => [reference, shot.id])), gridSize = 20 * viewport.zoom;
966
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-canvas-shell", "aria-label": "\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03", children: [
967
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas-toolbar", children: [
968
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-canvas-help", id: "oh-story-canvas-help", children: "\u62D6\u52A8\u7A7A\u767D\u5904\u5E73\u79FB \xB7 \u6EDA\u8F6E\u7F29\u653E \xB7 \u65B9\u5411\u952E\u79FB\u52A8\u8282\u70B9 \xB7 Enter \u6253\u5F00\u539F\u6587 \xB7 \u5E03\u5C40\u53EA\u5728\u672C\u9875\u4FDD\u7559" }),
969
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas-controls", children: [
970
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u7F29\u5C0F\u753B\u5E03", onClick: () => {
971
+ zoomAtCenter(1 / BUTTON_ZOOM_STEP);
972
+ }, children: "\u2212" }),
973
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "aria-live": "polite", children: [
974
+ Math.round(viewport.zoom * 100),
975
+ "%"
976
+ ] }),
977
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u653E\u5927\u753B\u5E03", onClick: () => {
978
+ zoomAtCenter(BUTTON_ZOOM_STEP);
979
+ }, children: "\uFF0B" }),
980
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
981
+ commitViewport(fitNodes(Object.values(positions), size));
982
+ }, children: "\u9002\u5E94" }),
983
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
984
+ props.onCanvasChange({}), commitViewport(fitNodes(nodes.map((node) => node.initial), size));
985
+ }, children: "\u590D\u4F4D" })
986
+ ] })
987
+ ] }),
988
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
989
+ "div",
990
+ {
991
+ ref: viewportRef,
992
+ className: "oh-story-canvas-viewport",
993
+ role: "application",
994
+ "aria-roledescription": "\u65E0\u9650\u753B\u5E03",
995
+ "aria-label": "\u753B\u5E03\u89C6\u91CE",
996
+ "aria-describedby": "oh-story-canvas-help",
997
+ tabIndex: 0,
998
+ "data-panning": panning || void 0,
999
+ style: { backgroundPosition: `${String(viewport.x)}px ${String(viewport.y)}px`, backgroundSize: `${String(gridSize)}px ${String(gridSize)}px` },
1000
+ onPointerDown: startPan,
1001
+ onKeyDown: onViewportKeyDown,
1002
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas", style: { transform: `translate(${String(viewport.x)}px, ${String(viewport.y)}px) scale(${String(viewport.zoom)})` }, children: [
1003
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { "aria-hidden": "true", children: connections.map(([from, to]) => {
1004
+ let a = positions[from], b = positions[to];
1005
+ if (a === void 0 || b === void 0) return null;
1006
+ let y1 = a.y + 76 / 2, y2 = b.y + 76 / 2, x1 = a.x + 180, bend = Math.max(60, Math.abs(b.x - x1) / 2);
1007
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { "data-active": to === props.selectedId || from === props.selectedId || void 0, d: `M ${String(x1)} ${String(y1)} C ${String(x1 + bend)} ${String(y1)}, ${String(b.x - bend)} ${String(y2)}, ${String(b.x)} ${String(y2)}` }, `${from}:${to}`);
1008
+ }) }),
1009
+ nodes.map((node) => {
1010
+ let references = connections.filter(([from, to]) => from === node.id || to === node.id).length;
1011
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1012
+ "article",
1013
+ {
1014
+ tabIndex: 0,
1015
+ role: "button",
1016
+ "aria-label": `${node.type === "asset" ? "\u7D20\u6750" : "\u955C\u5934"} ${node.label}\uFF0C${String(references)} \u6761\u5173\u7CFB`,
1017
+ "aria-pressed": node.id === props.selectedId,
1018
+ "data-node-type": node.type,
1019
+ "data-selected": node.id === props.selectedId || void 0,
1020
+ "data-dragging": liveNode?.id === node.id || void 0,
1021
+ style: { left: positions[node.id]?.x, top: positions[node.id]?.y },
1022
+ onKeyDown: (event) => {
1023
+ onNodeKeyDown(event, node.id);
1024
+ },
1025
+ onPointerDown: (event) => {
1026
+ startDrag(event, node.id);
1027
+ },
1028
+ onDoubleClick: () => {
1029
+ navigate(node.id);
1030
+ },
1031
+ children: [
1032
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: node.type === "asset" ? "\u7D20\u6750" : "\u955C\u5934" }),
1033
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: node.label }),
1034
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: node.id })
1035
+ ]
1036
+ },
1037
+ node.id
1038
+ );
1039
+ })
1040
+ ] })
1041
+ }
1042
+ )
1043
+ ] });
1044
+ }
1045
+ function arrowDelta(key, step) {
1046
+ if (key === "ArrowLeft") return { x: -step, y: 0 };
1047
+ if (key === "ArrowRight") return { x: step, y: 0 };
1048
+ if (key === "ArrowUp") return { x: 0, y: -step };
1049
+ if (key === "ArrowDown") return { x: 0, y: step };
1050
+ }
1051
+
816
1052
  // src/client/production-prompts.ts
817
- var authorityBoundary = "\u53EA\u4F7F\u7528\u5F53\u524D DSH Preset \u53EF\u89C1\u7684\u5DE5\u5177\uFF1B\u6240\u6709\u6587\u4EF6\u3001\u7F51\u7EDC\u3001\u751F\u6210\u548C\u547D\u4EE4\u64CD\u4F5C\u7EE7\u7EED\u9075\u5B88 DSH \u6743\u9650\u4E0E\u5BA1\u6279\u3002", referenceRules = "\u53C2\u8003\u56FE\u4EE5\u6765\u6E90\u6761\u76EE\u81EA\u5DF1\u7684\u58F0\u660E\u4E3A\u51C6\uFF08IMG-* \u7684\u300C\u53C2\u8003\u300D\uFF0CSHOT-*\uFF0FMOTION-* \u7684\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\uFF09\uFF1Areference_bindings \u5FC5\u987B\u4E0E\u8BE5\u6761\u76EE\u9010\u69FD\u4E00\u81F4\uFF0C\u5DE5\u4F5C\u53F0\u5217\u51FA\u7684\u8865\u5145\u53C2\u8003\u53EA\u4F5C\u6838\u5BF9\uFF0C\u6761\u76EE\u91CC\u6CA1\u6709\u58F0\u660E\u7684\u4E0D\u8981\u76F4\u63A5\u52A0\u8FDB job\uFF0C\u786E\u9700\u4F7F\u7528\u65F6\u5148\u8BF7\u62E5\u6709\u8BE5\u6761\u76EE\u7684\u9636\u6BB5\u4FEE\u8BA2\u6587\u6863\u3002\u8D77\u59CB\u5E27\u4E0E\u7ED3\u675F\u5E27\u7684\u89D2\u8272\u53EA\u53D6\u81EA\u6765\u6E90\u6761\u76EE\u81EA\u5DF1\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u5404\u69FD\u4F4D\u8BB0\u5F55\u7684\u7528\u9014\uFF08\u8D77\u59CB\u5E27\uFF0F\u7ED3\u675F\u5E27\uFF09\uFF1ASHOT-* \u770B\u300A\u5206\u955C.md\u300B\uFF0CMOTION-* \u770B\u300A\u89C6\u9891\u63D0\u793A\u8BCD.md\u300B\uFF1B\u518D\u7531\u76EE\u6807\u6A21\u578B\u65B9\u8A00\u7FFB\u6210 adapter \u7684 role\uFF0C\u4E0D\u6309\u6587\u4EF6\u540D\u6216\u5DE5\u4F5C\u53F0\u6E05\u5355\u63A8\u65AD\u3002\u76EE\u6807\u65B9\u8A00\u7528 first_frame\uFF0Flast_frame \u4F4D\u7F6E\u627F\u63A5\u8FD9\u7EC4\u8F93\u5165\u65F6\uFF0C\u7ED3\u675F\u5E27\u53EA\u8FDB last_frame\uFF0C\u7EDD\u4E0D\u964D\u7EA7\u6210\u666E\u901A\u53C2\u8003\u56FE\uFF1B\u65B9\u8A00\u8981\u6C42\u6574\u7EC4\u8D70\u591A\u69FD\u53C2\u8003\u65F6\uFF08\u5982 MiniMax H3 \u7684 full-reference\uFF1A\u9996\u5C3E\u5E27\u8F93\u5165\u4E0E\u53C2\u8003\u8F93\u5165\u4E92\u65A5\uFF0C\u8D77\u59CB\u5E27\u3001\u7ED3\u675F\u5E27\u90FD\u968F\u6574\u7EC4\u4EE5 reference_image \u9001\u5165\uFF09\uFF0C\u6309\u65B9\u8A00\u7FFB\u8BD1\uFF0C\u5E76\u5728\u9884\u89C8\u91CC\u5199\u660E\u7ED3\u675F\u5E27\u5C06\u4F5C\u4E3A\u53C2\u8003\u56FE\u9001\u5165\uFF0C\u6216\u5148\u8BF7\u5206\u955C owner \u53D6\u820D\u3002", shotStartFrameNote = "\u5206\u955C.md \u7684 SHOT-* \u53EA\u4EA7\u51FA\u8D77\u59CB\u5E27\uFF1B\u8981\u4EA7\u51FA\u7ED3\u675F\u5E27\uFF0C\u5148\u7531\u56FE\u7247\u63D0\u793A\u8BCD\u9636\u6BB5\u5EFA\u7ACB\u72EC\u7ACB\u7684 IMG-* \u6761\u76EE\u518D\u6295\u4EA7\u3002";
1053
+ var authorityBoundary = "\u53EA\u4F7F\u7528\u5F53\u524D DSH Preset \u53EF\u89C1\u7684\u5DE5\u5177\uFF1B\u6240\u6709\u6587\u4EF6\u3001\u7F51\u7EDC\u3001\u751F\u6210\u548C\u547D\u4EE4\u64CD\u4F5C\u7EE7\u7EED\u9075\u5B88 DSH \u6743\u9650\u4E0E\u5BA1\u6279\u3002", referenceRules = "\u53C2\u8003\u8F93\u5165\u4EE5\u6765\u6E90\u6761\u76EE\u81EA\u5DF1\u7684\u58F0\u660E\u4E3A\u51C6\uFF08IMG-* \u7684\u300C\u53C2\u8003\u300D\uFF0CSHOT-*\uFF0FMOTION-* \u7684\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\uFF0C\u4EE5\u53CA MOTION-* \u72EC\u7ACB\u7684\u300C\u53C2\u8003\u97F3\u9891\u300D\uFF09\uFF1Areference_bindings \u5FC5\u987B\u4E0E\u8BE5\u6761\u76EE\u9010\u69FD\u4E00\u81F4\uFF0C\u5DE5\u4F5C\u53F0\u5217\u51FA\u7684\u8865\u5145\u53C2\u8003\u53EA\u4F5C\u6838\u5BF9\uFF0C\u6761\u76EE\u91CC\u6CA1\u6709\u58F0\u660E\u7684\u4E0D\u8981\u76F4\u63A5\u52A0\u8FDB job\uFF0C\u786E\u9700\u4F7F\u7528\u65F6\u5148\u8BF7\u62E5\u6709\u8BE5\u6761\u76EE\u7684\u9636\u6BB5\u4FEE\u8BA2\u6587\u6863\u3002\u8D77\u59CB\u5E27\u4E0E\u7ED3\u675F\u5E27\u7684\u89D2\u8272\u53EA\u53D6\u81EA\u6765\u6E90\u6761\u76EE\u81EA\u5DF1\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u5404\u69FD\u4F4D\u8BB0\u5F55\u7684\u7528\u9014\uFF08\u8D77\u59CB\u5E27\uFF0F\u7ED3\u675F\u5E27\uFF09\uFF1ASHOT-* \u770B\u300A\u5206\u955C.md\u300B\uFF0CMOTION-* \u770B\u300A\u89C6\u9891\u63D0\u793A\u8BCD.md\u300B\uFF1B\u518D\u7531\u76EE\u6807\u6A21\u578B\u65B9\u8A00\u7FFB\u6210 adapter \u7684 role\uFF0C\u4E0D\u6309\u6587\u4EF6\u540D\u6216\u5DE5\u4F5C\u53F0\u6E05\u5355\u63A8\u65AD\u3002\u76EE\u6807\u65B9\u8A00\u7528 first_frame\uFF0Flast_frame \u4F4D\u7F6E\u627F\u63A5\u8FD9\u7EC4\u8F93\u5165\u65F6\uFF0C\u7ED3\u675F\u5E27\u53EA\u8FDB last_frame\uFF0C\u7EDD\u4E0D\u964D\u7EA7\u6210\u666E\u901A\u53C2\u8003\u56FE\uFF1B\u65B9\u8A00\u8981\u6C42\u6574\u7EC4\u8D70\u591A\u69FD\u53C2\u8003\u65F6\uFF08\u5982 MiniMax H3 \u7684 full-reference\uFF1A\u9996\u5C3E\u5E27\u8F93\u5165\u4E0E\u53C2\u8003\u8F93\u5165\u4E92\u65A5\uFF0C\u8D77\u59CB\u5E27\u3001\u7ED3\u675F\u5E27\u90FD\u968F\u6574\u7EC4\u4EE5 reference_image \u9001\u5165\uFF09\uFF0C\u6309\u65B9\u8A00\u7FFB\u8BD1\uFF0C\u5E76\u5728\u9884\u89C8\u91CC\u5199\u660E\u7ED3\u675F\u5E27\u5C06\u4F5C\u4E3A\u53C2\u8003\u56FE\u9001\u5165\uFF0C\u6216\u5148\u8BF7\u5206\u955C owner \u53D6\u820D\u3002MOTION-* \u7684\u300C\u53C2\u8003\u97F3\u9891\u300D\u4E0D\u6DF7\u5165\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\uFF1A\u5B83\u6392\u5728\u56FE\u7247 binding \u4E4B\u540E\uFF0Crole \u56FA\u5B9A\u4E3A reference_audio\uFF0Ccharacter \u9010\u5B57\u7167\u6284\u8BE5\u884C\u300C\u89D2\u8272\u300D\uFF0C\u97F3\u9891\u987A\u5E8F\u4ECD\u72EC\u7ACB\u4ECE 1 \u7F16\u53F7\uFF1Badapter profile \u672A\u663E\u5F0F\u58F0\u660E\u652F\u6301 reference_audio \u65F6\u5FC5\u987B\u5728\u63D0\u4EA4\u524D\u5931\u8D25\uFF0C\u4E0D\u80FD\u9759\u9ED8\u4E22\u5F03\u6216\u628A\u97F3\u9891\u5F53\u56FE\u7247\u3002", shotStartFrameNote = "\u5206\u955C.md \u7684 SHOT-* \u53EA\u4EA7\u51FA\u8D77\u59CB\u5E27\uFF1B\u8981\u4EA7\u51FA\u7ED3\u675F\u5E27\uFF0C\u5148\u7531\u56FE\u7247\u63D0\u793A\u8BCD\u9636\u6BB5\u5EFA\u7ACB\u72EC\u7ACB\u7684 IMG-* \u6761\u76EE\u518D\u6295\u4EA7\u3002";
818
1054
  function referenceParagraph(kind) {
819
1055
  return kind === "image" ? `${referenceRules}${shotStartFrameNote}` : referenceRules;
820
1056
  }
@@ -861,25 +1097,25 @@ ${referenceParagraph(job.kind)}
861
1097
 
862
1098
  \u628A\u6570\u91CF\u3001\u9010\u9879\u8F93\u51FA\u548C\u6210\u672C\u8FB9\u754C\u5B8C\u6574\u5C55\u793A\u7ED9\u521B\u4F5C\u8005\u3002\u6B64\u6309\u94AE\u53EA\u8868\u8FBE\u201C\u51C6\u5907\u9884\u89C8\u201D\uFF0C\u4E0D\u6784\u6210\u770B\u5230\u9884\u89C8\u540E\u7684\u751F\u4EA7\u786E\u8BA4\uFF1B\u4E0D\u5F97 confirm \u6216 run\u3002\u7528\u6237\u5728\u540E\u7EED\u6D88\u606F\u660E\u786E\u786E\u8BA4\u8FD9\u4EFD\u9884\u89C8\u540E\uFF0C\u624D\u53EF\u8C03\u7528 oh_story_production track_job \u767B\u8BB0\u540C\u4E00\u4E2A\u6279\u6B21\u4EFB\u52A1 ID\uFF0C\u5E76\u8FD0\u884C Provider\u3002${authorityBoundary}`;
863
1099
  }
864
- function nativeCompositionPrompt(production, job, orderedPaths) {
1100
+ function nativeCompositionPrompt(production, job, orderedSources) {
865
1101
  return `/short-drama-edit
866
1102
 
867
1103
  \u6267\u884C\u521B\u4F5C\u8005\u5DF2\u660E\u786E\u786E\u8BA4\u7684\u6210\u7247\u88C5\u914D\u4EFB\u52A1\u3002
868
1104
  - \u4EFB\u52A1 ID\uFF1A${job.id}
869
1105
  - \u5267\u96C6\uFF1A${production.episodeDirectory}
870
- - \u521B\u4F5C\u8005\u5728\u6210\u7247\u89C6\u56FE\u6392\u5B9A\u7684\u955C\u5E8F\uFF0C\u4E0D\u5F97\u81EA\u884C\u6362\u5E8F\uFF1A
871
- ${orderedPaths.map((path, index) => `${String(index + 1)}. ${path}`).join(`
1106
+ - \u521B\u4F5C\u8005\u5728\u6210\u7247\u89C6\u56FE\u6392\u5B9A\u7684\u955C\u5E8F\u4E0E\u5B9E\u9645\u6765\u6E90\uFF08\u81EA\u52A8\u6A21\u5F0F\u5DF2\u6309\u89C6\u9891\u4F18\u5148\u89E3\u6790\uFF1B\u663E\u5F0F\u9009\u6E90\u4F18\u5148\u4E8E\u81EA\u52A8\u7ED3\u679C\uFF09\uFF0C\u4E0D\u5F97\u81EA\u884C\u6362\u5E8F\u6216\u66FF\u6362\uFF1A
1107
+ ${orderedSources.map((source, index) => `${String(index + 1)}. ${source.shotId} \u2192 ${source.sourceId} \xB7 ${source.kind === "video" ? "\u89C6\u9891" : "\u9759\u5E27"} \xB7 ${source.path}${source.kind === "image" ? ` \xB7 \u5206\u955C\u65F6\u957F ${source.durationSeconds === void 0 ? "\u672A\u586B\u5199" : `${String(source.durationSeconds)} \u79D2`}` : ""}`).join(`
872
1108
  `)}
873
1109
  - \u526A\u8F91\u5355\uFF1A${production.episodeDirectory}/\u526A\u8F91\u5355.md
874
1110
  - \u8F93\u51FA\uFF1A${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/\u6210\u7247/
875
1111
 
876
- \u5148\u5199\u526A\u8F91\u5355\u518D\u6E32\u67D3\u3002\u9010\u6BB5\u770B\u5B8C\u7D20\u6750\u540E\u5199\u4E0B\u771F\u5B9E\u7684\u5165\u51FA\u70B9\u3001\u53D6\u820D\u7406\u7531\u3001\u58F0\u97F3\u5904\u7406\u4E0E\u5B57\u5E55\uFF0C\u4E0D\u8981\u6309\u955C\u5E8F\u51ED\u7A7A\u586B\u65F6\u95F4\uFF1B\u5B57\u5E55\u9010\u5B57\u53D6\u81EA\u5267\u672C.md\u3002\u526A\u8F91\u5355\u8BB0\u5F55\u7D20\u6750\u53D6\u820D\u3001\u5165\u51FA\u70B9\u3001\u540E\u671F\u5904\u7406\u4E0E\u4EA4\u4ED8\u89C4\u683C\uFF0C\u4E0D\u6539\u5199\u5267\u672C\u3001\u5206\u955C\u6216\u89C6\u9891\u63D0\u793A\u8BCD\u7684\u8BED\u4E49\uFF1B\u4E0D\u8981\u9000\u56DE\u53BB\u751F\u6210\u65B0\u7D20\u6750\u3002
1112
+ \u5148\u5199\u526A\u8F91\u5355\u518D\u6E32\u67D3\u3002\u9010\u6BB5\u770B\u5B8C\u7D20\u6750\u540E\u5199\u4E0B\u771F\u5B9E\u7684\u5165\u51FA\u70B9\u3001\u53D6\u820D\u7406\u7531\u3001\u58F0\u97F3\u5904\u7406\u4E0E\u5B57\u5E55\uFF0C\u4E0D\u8981\u6309\u955C\u5E8F\u51ED\u7A7A\u586B\u65F6\u95F4\uFF1B\u5B57\u5E55\u9010\u5B57\u53D6\u81EA\u5267\u672C.md\u3002\u4E0A\u9762\u6807\u4E3A\u89C6\u9891\u7684\u6765\u6E90\u4F7F\u7528\u5BF9\u5E94 MOTION-*\uFF0C\u6807\u4E3A\u9759\u5E27\u7684\u6765\u6E90\u9010\u5B57\u4F7F\u7528\u7ED9\u51FA\u7684 SHOT-* \u6216 IMG-*\uFF1B\u9759\u5E27\u4EE5\u5217\u51FA\u7684\u5206\u955C\u65F6\u957F\u4E3A\u8D77\u70B9\uFF0C\u4F46\u82E5\u5DF2\u6709\u914D\u97F3\uFF0C\u987B\u5148\u91CF\u51FA\u771F\u5B9E\u6709\u58F0\u533A\u95F4\u5E76\u636E\u6B64\u6392\u65F6\u957F\uFF0C\u4E0D\u80FD\u622A\u65AD\u53F0\u8BCD\u3002\u526A\u8F91\u5355\u8BB0\u5F55\u7D20\u6750\u53D6\u820D\u3001\u5165\u51FA\u70B9\u3001\u540E\u671F\u5904\u7406\u4E0E\u4EA4\u4ED8\u89C4\u683C\uFF0C\u4E0D\u6539\u5199\u5267\u672C\u3001\u5206\u955C\u6216\u89C6\u9891\u63D0\u793A\u8BCD\u7684\u8BED\u4E49\uFF1B\u4E0D\u8981\u9000\u56DE\u53BB\u751F\u6210\u65B0\u7D20\u6750\u3002
877
1113
 
878
- \u89C6\u9891\u63D0\u793A\u8BCD.md \u91CC\u7684\u6BCF\u4E2A\u300C## MOTION-*\u300D\u90FD\u5FC5\u987B\u4F5C\u4E3A\u67D0\u4E2A CUT \u7684\u300C\u6765\u6E90\u300D\uFF0C\u5426\u5219\u5199\u8FDB\u526A\u8F91\u5355\u5F00\u5934\uFF08\u4EA4\u4ED8\u89C4\u683C\u6240\u5728\u5904\u3001\u7B2C\u4E00\u4E2A\u300C## CUT-\u300D\u4E4B\u524D\uFF09\u7684\u4E00\u884C\uFF1A\u300C- \u672A\u91C7\u7528\u955C\u5934\uFF1AMOTION-\u2026\uFF08\u7406\u7531\uFF1A\u6587\u4EF6\u7F3A\u5931\u2014\u2014\u2026\uFF09\uFF1BMOTION-\u2026\uFF08\u7406\u7531\uFF1A\u8D28\u91CF\u4E0D\u53EF\u7528\u2014\u2014\u2026\uFF09\u300D\u3002\u591A\u9879\u7528\u5168\u89D2\u300C\uFF1B\u300D\u8FDE\u63A5\uFF0C\u7406\u7531\u4E0D\u80FD\u4E3A\u7A7A\u3001\u81EA\u8EAB\u4E0D\u542B\u300C\uFF1B\u300D\uFF0C\u5E76\u5199\u660E\u5C5E\u4E8E\u6587\u4EF6\u7F3A\u5931\u3001\u8D28\u91CF\u4E0D\u53EF\u7528\u8FD8\u662F\u53D9\u4E8B\u53D6\u820D\uFF1B\u6F0F\u6389\u4EFB\u4F55\u4E00\u4E2A\uFF0Ccheck \u90FD\u4F1A\u963B\u65AD\u3002
1114
+ \u6309\u5F53\u524D\u5236\u4F5C\u5F62\u6001\u4E3A\u6BCF\u4E00\u955C\u4EA4\u4EE3\u4E0B\u843D\uFF1A\u89C6\u9891\u6BB5\u6765\u6E90\u5199 MOTION-*\uFF1B\u9759\u5E27\u6BB5\u6765\u6E90\u5199\u5206\u955C\u91CC\u7684 SHOT-* \u6216\u56FE\u7247\u63D0\u793A\u8BCD\u91CC\u7684 IMG-*\uFF0C\u4E0D\u5F97\u56E0\u4E3A\u7701\u94B1\u3001\u5931\u8D25\u6216\u6392\u961F\u81EA\u884C\u628A\u89C6\u9891\u6539\u6210\u9759\u5E27\u3002\u5B58\u5728 SHOT-* \u9759\u5E27\u65F6\uFF0C\u5206\u955C\u91CC\u7684\u6BCF\u955C\u5FC5\u987B\u5165\u7247\u6216\u5217\u5165\u300C\u672A\u91C7\u7528\u955C\u5934\u300D\uFF1B\u5B58\u5728\u89C6\u9891\u6BB5\u65F6\uFF0C\u89C6\u9891\u63D0\u793A\u8BCD\u91CC\u7684\u6BCF\u4E2A MOTION-* \u4E5F\u5FC5\u987B\u5165\u7247\u6216\u8BF4\u660E\u672A\u91C7\u7528\u3002\u89C6\u9891\u4E0E\u9759\u5E27\u6DF7\u526A\u65F6\uFF0C\u540C\u4E00\u955C\u7528\u4E86 SHOT-* \u53EF\u540C\u65F6\u8986\u76D6\u5BF9\u5E94 MOTION-*\uFF0C\u7528\u4E86 MOTION-* \u53EF\u540C\u65F6\u8986\u76D6\u5BF9\u5E94 SHOT-*\u3002\u672A\u91C7\u7528\u9879\u5199\u8FDB\u526A\u8F91\u5355\u5F00\u5934\uFF08\u4EA4\u4ED8\u89C4\u683C\u6240\u5728\u5904\u3001\u7B2C\u4E00\u4E2A\u300C## CUT-\u300D\u4E4B\u524D\uFF09\u7684\u4E00\u884C\uFF1A\u300C- \u672A\u91C7\u7528\u955C\u5934\uFF1AMOTION-\u2026\uFF08\u7406\u7531\uFF1A\u6587\u4EF6\u7F3A\u5931\u2014\u2014\u2026\uFF09\uFF1BSHOT-\u2026\uFF08\u7406\u7531\uFF1A\u8D28\u91CF\u4E0D\u53EF\u7528\u2014\u2014\u2026\uFF09\u300D\u3002\u591A\u9879\u7528\u5168\u89D2\u300C\uFF1B\u300D\u8FDE\u63A5\uFF0C\u7406\u7531\u4E0D\u80FD\u4E3A\u7A7A\u3001\u81EA\u8EAB\u4E0D\u542B\u300C\uFF1B\u300D\uFF0C\u5E76\u5199\u660E\u5C5E\u4E8E\u6587\u4EF6\u7F3A\u5931\u3001\u8D28\u91CF\u4E0D\u53EF\u7528\u8FD8\u662F\u53D9\u4E8B\u53D6\u820D\uFF1B\u6F0F\u6389\u4EFB\u4F55\u4E00\u4E2A\uFF0Ccheck \u90FD\u4F1A\u963B\u65AD\u3002
879
1115
 
880
- \u526A\u8F91\u5355\u843D\u76D8\u540E\u4F9D\u6B21\u8FD0\u884C edit_tool.py \u7684 check \u4E0E render\uFF0Ccheck \u62A5\u51FA\u7684\u95EE\u9898\u5148\u6539\u6587\u6863\u518D\u91CD\u8DD1\u3002\u6240\u6709 CUT \u7684\u7D20\u6750\u5FC5\u987B\u540C\u5BBD\u3001\u540C\u9AD8\u3001\u540C\u5E27\u7387\uFF1Arender \u53EA\u786C\u62FC\u63A5\uFF0C\u4E0D\u7F29\u653E\u4E5F\u4E0D\u6539\u5E27\u7387\u3002check \u62A5\u51FA\u753B\u5E45\u6216\u5E27\u7387\u4E0D\u4E00\u81F4\u65F6\uFF0C\u5728\u5F53\u524D DSH \u6267\u884C\u73AF\u5883\u91CC\u7ECF\u5BA1\u6279\u7528 ffmpeg \u6309\u4EA4\u4ED8\u89C4\u683C\u7EDF\u4E00\u3001\u4FDD\u7559\u6784\u56FE\uFF0C\u65B0\u6587\u4EF6\u5199\u5230 ${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/\u6210\u7247/\u89C4\u683C\u7EDF\u4E00/\u2014\u2014\u8FD9\u662F\u526A\u8F91\u9636\u6BB5\u81EA\u5DF1\u7684\u4E2D\u95F4\u6587\u4EF6\uFF0C\u4E0D\u653E\u5728\u751F\u4EA7\u9636\u6BB5\u7684\u539F\u7D20\u6750\u65C1\u8FB9\u3001\u4E0D\u8986\u76D6\u5DF2\u751F\u4EA7\u7684\u7D20\u6750\uFF0C\u6587\u4EF6\u540D\u4E5F\u4E0D\u6CBF\u7528\u539F\u6587\u4EF6\u91CC\u7684\u4EFB\u52A1 ID\uFF08\u53EF\u76F4\u63A5\u7528 MOTION ID\uFF09\uFF1B\u5728\u8BE5 CUT \u4E0B\u8BB0\u5F55\u88C1\u5207\u6216\u7559\u8FB9\uFF08\u4E0D\u8981\u5199\u8FDB\u300C\u753B\u9762\u300D\u884C\uFF0C\u5B83\u53EA\u8BA4\u4EAE\u5EA6\u3001\u9971\u548C\u3001\u8272\u6E29\u6216\u300C\u65E0\u300D\u300C\u4E0D\u6821\u300D\uFF09\uFF0C\u628A\u300C\u6765\u6E90\u300D\u6539\u6307\u65B0\u6587\u4EF6\uFF0C\u5165\u51FA\u70B9\u968F\u8F6C\u6362\u53D8\u5316\u65F6\u540C\u6B65\u4FEE\u6539\uFF0C\u518D\u91CD\u8DD1 check\u3002
1116
+ \u526A\u8F91\u5355\u843D\u76D8\u540E\u4F9D\u6B21\u8FD0\u884C edit_tool.py \u7684 check \u4E0E render\uFF0Ccheck \u62A5\u51FA\u7684\u95EE\u9898\u5148\u6539\u6587\u6863\u518D\u91CD\u8DD1\u3002\u89C6\u9891 CUT \u7684\u7D20\u6750\u5FC5\u987B\u540C\u5BBD\u3001\u540C\u9AD8\u3001\u540C\u5E27\u7387\uFF1Arender \u4E0D\u66FF\u89C6\u9891\u7F29\u653E\u6216\u6539\u5E27\u7387\uFF1B\u9759\u5E27\u5219\u6309\u4EA4\u4ED8\u89C4\u683C\u7B49\u6BD4\u94FA\u6EE1\u3001\u5C45\u4E2D\u88C1\u5207\u5E76\u6309\u8FD0\u955C\u51FA\u753B\uFF0C\u56E0\u6B64\u53EA\u8981\u6709\u9759\u5E27\u5C31\u5FC5\u987B\u586B\u5199\u300C\u753B\u5E45\u4E0E\u5E27\u7387\u300D\u3002\u89C6\u9891\u88AB check \u62A5\u51FA\u753B\u5E45\u6216\u5E27\u7387\u4E0D\u4E00\u81F4\u65F6\uFF0C\u5728\u5F53\u524D DSH \u6267\u884C\u73AF\u5883\u91CC\u7ECF\u5BA1\u6279\u7528 ffmpeg \u6309\u4EA4\u4ED8\u89C4\u683C\u7EDF\u4E00\u3001\u4FDD\u7559\u6784\u56FE\uFF0C\u65B0\u6587\u4EF6\u5199\u5230 ${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/\u6210\u7247/\u89C4\u683C\u7EDF\u4E00/\u2014\u2014\u8FD9\u662F\u526A\u8F91\u9636\u6BB5\u81EA\u5DF1\u7684\u4E2D\u95F4\u6587\u4EF6\uFF0C\u4E0D\u653E\u5728\u751F\u4EA7\u9636\u6BB5\u7684\u539F\u7D20\u6750\u65C1\u8FB9\u3001\u4E0D\u8986\u76D6\u5DF2\u751F\u4EA7\u7684\u7D20\u6750\uFF0C\u6587\u4EF6\u540D\u4E5F\u4E0D\u6CBF\u7528\u539F\u6587\u4EF6\u91CC\u7684\u4EFB\u52A1 ID\uFF08\u53EF\u76F4\u63A5\u7528 MOTION ID\uFF09\uFF1B\u5728\u8BE5 CUT \u4E0B\u8BB0\u5F55\u88C1\u5207\u6216\u7559\u8FB9\uFF08\u4E0D\u8981\u5199\u8FDB\u300C\u753B\u9762\u300D\u884C\uFF0C\u5B83\u53EA\u8BA4\u4EAE\u5EA6\u3001\u9971\u548C\u3001\u8272\u6E29\u6216\u300C\u65E0\u300D\u300C\u4E0D\u6821\u300D\uFF09\uFF0C\u628A\u300C\u6765\u6E90\u300D\u6539\u6307\u65B0\u6587\u4EF6\uFF0C\u5165\u51FA\u70B9\u968F\u8F6C\u6362\u53D8\u5316\u65F6\u540C\u6B65\u4FEE\u6539\uFF0C\u518D\u91CD\u8DD1 check\u3002\u9759\u5E27\u6765\u6E90\u5165\u70B9\u5199 0.00\u3001\u51FA\u70B9\u7B49\u4E8E\u65F6\u957F\u4E14\u81F3\u5C11 0.50 \u79D2\uFF1B\u9700\u8981\u8FD0\u52A8\u65F6\u53EA\u7528\u526A\u8F91\u5355\u652F\u6301\u7684\u56FA\u5B9A\u3001\u63A8\u8FD1\u3001\u62C9\u8FDC\u6216\u5E73\u79FB\u5199\u6CD5\u3002
881
1117
 
882
- \u9ED8\u8BA4\u7684\u786C\u5B57\u5E55\u8DEF\u7EBF\u9700\u8981\u5E26 libass \u7684 ffmpeg\uFF0C\u7F3A libass \u65F6\u5982\u5B9E\u62A5\u51FA\uFF0C\u4E0D\u8981\u6084\u6084\u53BB\u6389\u5B57\u5E55\u3002Remotion \u5728\u9879\u76EE\u5916\u7684 ~/.cache/short-drama-edit/remotion \u91CC\u88C5 Node \u4F9D\u8D56\u3001\u9010\u5E27\u8FC7\u65E0\u5934\u6D4F\u89C8\u5668\uFF1A\u53EF\u9009\u7684 Remotion \u5B57\u5E55\u8DEF\u7EBF\u8981\u5B83\uFF0C\u526A\u8F91\u5355\u91CC\u53EA\u8981\u6709\u300C\u753B\u9762\u6587\u5B57\u300D\u884C\u4E5F\u5FC5\u987B\u8981\u5B83\uFF1B\u53EA\u6709\u521B\u4F5C\u8005\u660E\u786E\u540C\u610F\u8FD9\u6B21\u5B89\u88C5\uFF08\u5728\u8BE5\u76EE\u5F55 npm install\uFF0C0.8 \u4E4B\u524D\u88C5\u8FC7\u7684\u8981\u91CD\u88C5\u4E00\u6B21\uFF09\u65F6\u624D\u8D70\uFF0C\u672A\u540C\u610F\u5C31\u4E0D\u5199\u300C\u753B\u9762\u6587\u5B57\u300D\u884C\uFF0C\u5E76\u544A\u8BC9\u521B\u4F5C\u8005\u753B\u9762\u91CC\u7559\u7ED9\u9762\u677F\u7684\u7A7A\u767D\u4F1A\u4FDD\u6301\u7A7A\u767D\u3002\u526A\u8F91\u5355\u7684\u300C\u58F0\u97F3\u300D\u884C\u53EA\u662F\u8BB0\u5F55\uFF0Crender \u4E0D\u6267\u884C\u5B83\uFF1Arender \u5207\u6BB5\u3001\u540C\u573A\u666F\u81EA\u52A8\u63A5\u955C\uFF08CUT \u5199\u4E86\u300C\u753B\u9762\u300D\u6821\u6B63\u5C31\u66FF\u4EE3\u5B83\uFF0C\u300C\u753B\u9762\uFF1A\u4E0D\u6821\u300D\u8DF3\u8FC7\u5B83\uFF0C\u4EA4\u4ED8\u89C4\u683C\u5199\u300C\u63A5\u955C\u5339\u914D\uFF1A\u65E0\u300D\u6574\u96C6\u5173\u95ED\uFF09\u3001\u786C\u62FC\u63A5\u3001\u6DF7\u5165\u300C\u97F3\u6548\u300D\u884C\u3001\u70E7\u5B57\u5E55\u4E0E\u753B\u9762\u6587\u5B57\u3001\u53EF\u9009\u9897\u7C92\u3001\u7EDF\u4E00\u54CD\u5EA6\u3002\u300C\u97F3\u6548\u300D\u884C\u4E4B\u5916\u7684\u6DF7\u97F3\u3001\u4EA4\u53C9\u6DE1\u5165\u3001\u914D\u4E50\u3001\u8F6C\u573A\u6216\u683C\u5F0F\u8F6C\u6362\u90FD\u662F\u53E6\u4E00\u6B65\u7ECF\u5BA1\u6279\u7684\u5916\u90E8 ffmpeg \u5904\u7406\uFF0C\u5148\u5199\u5230\u4E34\u65F6\u6587\u4EF6\uFF1B\u8FD9\u4E00\u6B65\u6700\u540E\u8981\u50CF render \u4E00\u6837\u6309\u526A\u8F91\u5355\u7684\u300C\u4EA4\u4ED8\u54CD\u5EA6\u300D\u5BF9\u6574\u7247\u505A\u4E24\u904D loudnorm\uFF08I=\u4EA4\u4ED8\u54CD\u5EA6\u3001TP=-1.5\u3001LRA=11\uFF0C\u7B2C\u4E8C\u904D\u4EE3\u5165\u7B2C\u4E00\u904D\u7684\u5B9E\u6D4B\u503C\u5E76\u7528 linear=true\uFF09\uFF0C\u97F3\u9891\u7F16\u7801\u4E3A AAC 192k\u300148 kHz\uFF0C\u7136\u540E\u624D\u66FF\u6362 ${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/\u6210\u7247/\u6210\u7247.mp4\uFF0C\u5E76\u628A\u547D\u4EE4\u8BB0\u8FDB\u526A\u8F91\u5355\uFF1B\u91CD\u65B0 render \u4F1A\u8986\u76D6\u6210\u7247\uFF0C\u8FD9\u4E9B\u6B65\u9AA4\u8981\u91CD\u505A\u3002\u6700\u540E\u5BF9\u4EA4\u4ED8\u7684\u8FD9\u4EFD\u6210\u7247.mp4 \u8FD0\u884C edit_tool.py verify \u5E76\u62A5\u544A\u5B9E\u6D4B\u6570\u5B57\uFF0C\u300C\u672A\u6D4B\u300D\u9879\u7167\u5B9E\u5199\u672A\u6D4B\u3002
1118
+ \u9ED8\u8BA4\u7684\u786C\u5B57\u5E55\u8DEF\u7EBF\u9700\u8981\u5E26 libass \u7684 ffmpeg\uFF0C\u7F3A libass \u65F6\u5982\u5B9E\u62A5\u51FA\uFF0C\u4E0D\u8981\u6084\u6084\u53BB\u6389\u5B57\u5E55\u3002Remotion \u5728\u9879\u76EE\u5916\u7684 ~/.cache/short-drama-edit/remotion \u91CC\u88C5 Node \u4F9D\u8D56\u3001\u9010\u5E27\u8FC7\u65E0\u5934\u6D4F\u89C8\u5668\uFF1A\u53EF\u9009\u7684 Remotion \u5B57\u5E55\u8DEF\u7EBF\u8981\u5B83\uFF0C\u526A\u8F91\u5355\u91CC\u53EA\u8981\u6709\u300C\u753B\u9762\u6587\u5B57\u300D\u884C\u4E5F\u5FC5\u987B\u8981\u5B83\uFF1B\u53EA\u6709\u521B\u4F5C\u8005\u660E\u786E\u540C\u610F\u8FD9\u6B21\u5B89\u88C5\uFF08\u5728\u8BE5\u76EE\u5F55 npm install\uFF0C0.8 \u4E4B\u524D\u88C5\u8FC7\u7684\u8981\u91CD\u88C5\u4E00\u6B21\uFF09\u65F6\u624D\u8D70\uFF0C\u672A\u540C\u610F\u5C31\u4E0D\u5199\u300C\u753B\u9762\u6587\u5B57\u300D\u884C\uFF0C\u5E76\u544A\u8BC9\u521B\u4F5C\u8005\u753B\u9762\u91CC\u7559\u7ED9\u9762\u677F\u7684\u7A7A\u767D\u4F1A\u4FDD\u6301\u7A7A\u767D\u3002\u526A\u8F91\u5355\u7684\u300C\u58F0\u97F3\u300D\u884C\u53EA\u662F\u8BB0\u5F55\uFF0Crender \u4E0D\u6267\u884C\u5B83\uFF1Arender \u5207\u6BB5\u3001\u9759\u5E27\u51FA\u753B\u4E0E\u8FD0\u955C\u3001\u540C\u573A\u666F\u81EA\u52A8\u63A5\u955C\uFF08CUT \u5199\u4E86\u300C\u753B\u9762\u300D\u6821\u6B63\u5C31\u66FF\u4EE3\u5B83\uFF0C\u300C\u753B\u9762\uFF1A\u4E0D\u6821\u300D\u8DF3\u8FC7\u5B83\uFF0C\u4EA4\u4ED8\u89C4\u683C\u5199\u300C\u63A5\u955C\u5339\u914D\uFF1A\u65E0\u300D\u6574\u96C6\u5173\u95ED\uFF09\u3001\u786C\u62FC\u63A5\u3001\u6DF7\u5165\u300C\u97F3\u6548\u300D\u300C\u914D\u97F3\u300D\u300C\u73AF\u5883\u58F0\u300D\u884C\u3001\u70E7\u5B57\u5E55\u4E0E\u753B\u9762\u6587\u5B57\u3001\u53EF\u9009\u9897\u7C92\u3001\u7EDF\u4E00\u54CD\u5EA6\u3002\u914D\u97F3\u53EF\u7528\u8D1F\u8D77\u70B9\u505A J-cut\uFF0C\u4E5F\u53EF\u8DE8\u5207\u70B9\u505A L-cut\uFF1B\u5B57\u5E55\u540C\u6837\u53EF\u8DE8\u5207\u70B9\uFF0C\u6309\u6574\u6761\u7247\u6838\u5BF9\u4E0D\u91CD\u53E0\u4E14\u4E0D\u8D8A\u8FC7\u7ED3\u5C3E\u3002\u300C\u97F3\u6548\u300D\u300C\u914D\u97F3\u300D\u300C\u73AF\u5883\u58F0\u300D\u4E4B\u5916\u7684\u6DF7\u97F3\u3001\u4EA4\u53C9\u6DE1\u5165\u3001\u914D\u4E50\u3001\u8F6C\u573A\u6216\u683C\u5F0F\u8F6C\u6362\u90FD\u662F\u53E6\u4E00\u6B65\u7ECF\u5BA1\u6279\u7684\u5916\u90E8 ffmpeg \u5904\u7406\uFF0C\u5148\u5199\u5230\u4E34\u65F6\u6587\u4EF6\uFF1B\u8FD9\u4E00\u6B65\u6700\u540E\u8981\u50CF render \u4E00\u6837\u6309\u526A\u8F91\u5355\u7684\u300C\u4EA4\u4ED8\u54CD\u5EA6\u300D\u5BF9\u6574\u7247\u505A\u4E24\u904D loudnorm\uFF08I=\u4EA4\u4ED8\u54CD\u5EA6\u3001TP=-1.5\u3001LRA=11\uFF0C\u7B2C\u4E8C\u904D\u4EE3\u5165\u7B2C\u4E00\u904D\u7684\u5B9E\u6D4B\u503C\u5E76\u7528 linear=true\uFF09\uFF0C\u97F3\u9891\u7F16\u7801\u4E3A AAC 192k\u300148 kHz\uFF0C\u7136\u540E\u624D\u66FF\u6362 ${production.episodeDirectory}/\u5236\u4F5C\u6210\u679C/\u6210\u7247/\u6210\u7247.mp4\uFF0C\u5E76\u628A\u547D\u4EE4\u8BB0\u8FDB\u526A\u8F91\u5355\uFF1B\u91CD\u65B0 render \u4F1A\u8986\u76D6\u6210\u7247\uFF0C\u8FD9\u4E9B\u6B65\u9AA4\u8981\u91CD\u505A\u3002\u6700\u540E\u5BF9\u4EA4\u4ED8\u7684\u8FD9\u4EFD\u6210\u7247.mp4 \u8FD0\u884C edit_tool.py verify \u5E76\u62A5\u544A\u5B9E\u6D4B\u6570\u5B57\uFF0C\u300C\u672A\u6D4B\u300D\u9879\u7167\u5B9E\u5199\u672A\u6D4B\u3002
883
1119
 
884
1120
  ffmpeg \u4E0E ffprobe \u901A\u8FC7\u5F53\u524D DSH \u6267\u884C\u73AF\u5883\u8C03\u7528\uFF0C\u4E0D\u53EF\u7528\u65F6\u5982\u5B9E\u62A5\u51FA\u6765\uFF0C\u4E0D\u8981\u628A\u300C\u6CA1\u6D4B\u300D\u5199\u6210\u300C\u901A\u8FC7\u300D\u3002\u6240\u6709\u547D\u4EE4\u548C\u5199\u5165\u7EE7\u7EED\u9075\u5B88 DSH \u6743\u9650\u4E0E\u5BA1\u6279\uFF0C\u4E0D\u5F97\u4F2A\u9020\u6210\u529F\u3002`;
885
1121
  }
@@ -956,6 +1192,14 @@ function referencesForTarget(targetId, production, versions, selections, library
956
1192
  });
957
1193
  return [...new Map([...declared, ...manual].map((version) => [version.id, version])).values()];
958
1194
  }
1195
+ function mediaBelongsToEpisode(path, episodeDirectory) {
1196
+ if (path === void 0 || path.startsWith(`${episodeDirectory}/`)) return !0;
1197
+ let episodeName = episodeDirectory.split("/").at(-1);
1198
+ return episodeName !== void 0 && path.startsWith(`\u4EA4\u4ED8/${episodeName}/`);
1199
+ }
1200
+ function sequenceSourceEligible(shotId, version) {
1201
+ return version.kind === "video" ? version.targetId === shotId : version.targetId === shotId || version.targetId.startsWith("IMG-");
1202
+ }
959
1203
  function queuedItemForJob(jobId, queue) {
960
1204
  if (jobId.trim() === "") return;
961
1205
  let escaped = jobId.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&"), labelled = new RegExp(`\u4EFB\u52A1\\s*ID\\s*[\uFF1A:]\\s*${escaped}(?:[\\s.,;\u3001\u3002]|$)`, "u");
@@ -995,18 +1239,22 @@ function reconcileProductionJobs(jobs, queue, sessionRunning, versions) {
995
1239
  });
996
1240
  return settleCompositions(reconciled);
997
1241
  }
998
- function reconcileSequence(shotIds, current, versions, selections) {
999
- let shotSet = new Set(shotIds), preserved = current.filter((item) => shotSet.has(item.shotId)), present = new Set(preserved.map((item) => item.shotId)), appended = shotIds.filter((shotId) => !present.has(shotId)).map((shotId) => ({ shotId }));
1000
- return [...preserved, ...appended].map((item) => ({
1001
- shotId: item.shotId,
1002
- versionId: selectedVersionForTarget(item.shotId, versions, selections, "video")?.id
1003
- }));
1242
+ function reconcileSequence(shotIds, current, versions, selections, episodeDirectory) {
1243
+ let scopedVersions = episodeDirectory === void 0 ? versions : versions.filter((version) => mediaBelongsToEpisode(version.path, episodeDirectory)), shotSet = new Set(shotIds), preserved = current.filter((item) => shotSet.has(item.shotId)), present = new Set(preserved.map((item) => item.shotId)), appended = shotIds.filter((shotId) => !present.has(shotId)).map((shotId) => ({ shotId }));
1244
+ return [...preserved, ...appended].map((item) => {
1245
+ if (item.sourceVersionId !== void 0) {
1246
+ let explicit = scopedVersions.find((version) => version.id === item.sourceVersionId && sequenceSourceEligible(item.shotId, version));
1247
+ return { ...item, versionId: explicit?.id };
1248
+ }
1249
+ let video = selectedVersionForTarget(item.shotId, scopedVersions, selections, "video"), selectedImageId = selections[item.shotId], selectedImage = selectedImageId === void 0 ? void 0 : scopedVersions.find((version) => version.id === selectedImageId && version.kind === "image" && (version.targetId === item.shotId || version.targetId.startsWith("IMG-"))), shotImage = selectedVersionForTarget(item.shotId, scopedVersions, selections, "image"), preservedImage = scopedVersions.find((version) => version.id === item.versionId && version.kind === "image" && version.targetId.startsWith("IMG-")), image = selectedImage ?? shotImage ?? preservedImage;
1250
+ return { shotId: item.shotId, versionId: video?.id ?? image?.id };
1251
+ });
1004
1252
  }
1005
- function sequenceIssues(sequence, versions) {
1006
- let versionById = new Map(versions.map((version) => [version.id, version])), issues = [];
1253
+ function sequenceIssues(sequence, versions, episodeDirectory) {
1254
+ let versionById = new Map(versions.filter((version) => episodeDirectory === void 0 || mediaBelongsToEpisode(version.path, episodeDirectory)).map((version) => [version.id, version])), issues = [];
1007
1255
  for (let item of sequence) {
1008
1256
  let version = item.versionId === void 0 ? void 0 : versionById.get(item.versionId);
1009
- version === void 0 || version.kind !== "video" ? issues.push(`${item.shotId} \u7F3A\u5C11\u5DF2\u9009\u89C6\u9891\u7248\u672C`) : version.path === void 0 && issues.push(`${item.shotId} \u7684\u89C6\u9891\u6CA1\u6709\u53EF\u4F9B DSH \u8BFB\u53D6\u7684\u5DE5\u4F5C\u533A\u8DEF\u5F84`);
1257
+ version === void 0 || version.kind !== "video" && version.kind !== "image" ? issues.push(item.sourceVersionId === void 0 ? `${item.shotId} \u7F3A\u5C11\u5DF2\u9009\u89C6\u9891\u6216\u5173\u952E\u5E27\u7D20\u6750` : `${item.shotId} \u663E\u5F0F\u9009\u62E9\u7684\u6210\u7247\u7D20\u6750\u5DF2\u4E0D\u53EF\u7528`) : version.path === void 0 && issues.push(`${item.shotId} \u7684${version.kind === "video" ? "\u89C6\u9891" : "\u5173\u952E\u5E27"}\u6CA1\u6709\u53EF\u4F9B DSH \u8BFB\u53D6\u7684\u5DE5\u4F5C\u533A\u8DEF\u5F84`);
1010
1258
  }
1011
1259
  return issues;
1012
1260
  }
@@ -1018,10 +1266,20 @@ function reorderSequence(sequence, source, target) {
1018
1266
  }
1019
1267
 
1020
1268
  // src/client/drama-production-view.tsx
1021
- var import_jsx_runtime3 = require("react/jsx-runtime"), SECTION_LABELS = { shots: "\u955C\u5934", assets: "\u7D20\u6750", tasks: "\u4EFB\u52A1", sequence: "\u6210\u7247", canvas: "\u753B\u5E03" }, SECTION_ORDER = Object.keys(SECTION_LABELS), STATUS_LABELS = { awaiting_confirmation: "\u7B49\u5F85\u786E\u8BA4", pending: "\u5DF2\u63D0\u4EA4", running: "DSH \u6267\u884C\u4E2D", dispatched_unknown: "\u5F85\u6838\u5BF9", succeeded: "\u5DF2\u5B8C\u6210", failed: "\u5931\u8D25", canceled: "\u5DF2\u53D6\u6D88" }, ASSET_KIND_LABEL = { character: "\u4EBA\u7269", scene: "\u573A\u666F", prop: "\u9053\u5177", state: "\u72B6\u6001", unknown: "\u8BBE\u5B9A" }, JOB_KIND_LABEL = { image: "\u56FE\u7247", video: "\u89C6\u9891", composition: "\u6210\u7247" }, ASSEMBLED_CUT_PATH = "\u5236\u4F5C\u6210\u679C/\u6210\u7247/\u6210\u7247.mp4", MODALITY_LABEL = { image: "\u56FE\u7247", video: "\u89C6\u9891", tts: "\u8BED\u97F3", music: "\u97F3\u4E50" };
1022
- function ProductionEnvironment({ sessionId }) {
1023
- let [preflight, setPreflight] = (0, import_react.useState)(), [attempt, setAttempt] = (0, import_react.useState)(0);
1024
- (0, import_react.useEffect)(() => {
1269
+ var import_jsx_runtime4 = require("react/jsx-runtime"), SECTION_LABELS = { shots: "\u955C\u5934", assets: "\u7D20\u6750", tasks: "\u4EFB\u52A1", sequence: "\u6210\u7247", canvas: "\u753B\u5E03" }, SECTION_ORDER = Object.keys(SECTION_LABELS), STATUS_LABELS = { awaiting_confirmation: "\u7B49\u5F85\u786E\u8BA4", pending: "\u5DF2\u63D0\u4EA4", running: "DSH \u6267\u884C\u4E2D", dispatched_unknown: "\u5F85\u6838\u5BF9", succeeded: "\u5DF2\u5B8C\u6210", failed: "\u5931\u8D25", canceled: "\u5DF2\u53D6\u6D88" }, ASSET_KIND_LABEL = { character: "\u4EBA\u7269", scene: "\u573A\u666F", prop: "\u9053\u5177", state: "\u72B6\u6001", unknown: "\u8BBE\u5B9A" }, JOB_KIND_LABEL = { image: "\u56FE\u7247", video: "\u89C6\u9891", composition: "\u6210\u7247" }, ASSEMBLED_CUT_PATH = "\u5236\u4F5C\u6210\u679C/\u6210\u7247/\u6210\u7247.mp4";
1270
+ function compositionSources(production, sequence, versions) {
1271
+ let versionById = new Map(versions.map((version) => [version.id, version])), shotById = new Map(production.shots.map((shot) => [shot.id, shot]));
1272
+ return sequence.flatMap((item) => {
1273
+ let version = item.versionId === void 0 ? void 0 : versionById.get(item.versionId), path = version?.path;
1274
+ if (version === void 0 || path === void 0) return [];
1275
+ let shot = shotById.get(item.shotId), sourceId = version.kind === "video" ? shot?.motion?.id ?? item.shotId : version.targetId.startsWith("IMG-") ? version.targetId : item.shotId;
1276
+ return [{ shotId: item.shotId, sourceId, kind: version.kind, path, durationSeconds: shot?.durationSeconds }];
1277
+ });
1278
+ }
1279
+ var MODALITY_LABEL = { image: "\u56FE\u7247", video: "\u89C6\u9891", tts: "\u8BED\u97F3", music: "\u97F3\u4E50" };
1280
+ function ProductionStatus({ sessionId, diagnostics, onNavigate }) {
1281
+ let [preflight, setPreflight] = (0, import_react2.useState)(), [attempt, setAttempt] = (0, import_react2.useState)(0), [open, setOpen] = (0, import_react2.useState)(), [copied, setCopied] = (0, import_react2.useState)(!1);
1282
+ (0, import_react2.useEffect)(() => {
1025
1283
  let controller = new AbortController();
1026
1284
  return fetch(endpoint("drama-preflight", sessionId), { signal: controller.signal }).then(async (response) => {
1027
1285
  if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);
@@ -1033,34 +1291,89 @@ function ProductionEnvironment({ sessionId }) {
1033
1291
  controller.abort();
1034
1292
  };
1035
1293
  }, [attempt, sessionId]);
1036
- let unconfigured = typeof preflight == "object" ? preflight.adapters.filter((adapter) => !adapter.configured) : [];
1037
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-environment", role: "status", "aria-label": "\u5A92\u4F53\u751F\u6210\u73AF\u5883", children: [
1038
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "\u751F\u6210\u73AF\u5883" }),
1039
- preflight === void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "data-pending": !0, children: "\u68C0\u67E5\u4E2D\u2026" }),
1040
- preflight === "failed" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1041
- setPreflight(void 0), setAttempt((value) => value + 1);
1042
- }, children: "\u73AF\u5883\u68C0\u67E5\u5931\u8D25 \xB7 \u91CD\u8BD5" }),
1043
- typeof preflight == "object" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1044
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "data-ready": preflight.python.ok || void 0, children: [
1045
- "Python ",
1046
- preflight.python.version ?? "\u672A\u627E\u5230"
1294
+ let toggle = (panel) => {
1295
+ setOpen((current) => current === panel ? void 0 : panel);
1296
+ }, configured = typeof preflight == "object" ? preflight.adapters.filter((adapter) => adapter.configured).length : 0, total = typeof preflight == "object" ? preflight.adapters.length : 0, environmentTone = typeof preflight != "object" ? "neutral" : !preflight.python.ok || !preflight.adapterConfig.ok ? "error" : configured === total ? "ready" : configured > 0 ? "partial" : "idle", protocolErrors = diagnostics.filter((item) => item.severity === "error").length, adapterFile = typeof preflight == "object" ? preflight.adapterConfig.path.split(/[\\/]/u).at(-1) : void 0;
1297
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-status", children: [
1298
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-status-pills", children: [
1299
+ preflight === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "oh-story-status-pill", "data-tone": "error", onClick: () => {
1300
+ setPreflight(void 0), setAttempt((value) => value + 1);
1301
+ }, children: [
1302
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1303
+ "\u73AF\u5883\u68C0\u67E5\u5931\u8D25",
1304
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("em", { children: "\u91CD\u8BD5" })
1305
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "oh-story-status-pill", "data-tone": environmentTone, "aria-expanded": open === "environment", "aria-controls": "oh-story-production-environment", "aria-label": "\u5A92\u4F53\u751F\u6210\u73AF\u5883", onClick: () => {
1306
+ toggle("environment");
1307
+ }, children: [
1308
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1309
+ "\u751F\u6210\u73AF\u5883",
1310
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("em", { children: typeof preflight != "object" ? "\u68C0\u67E5\u4E2D\u2026" : preflight.python.ok ? `${String(configured)}/${String(total)} \u4F9B\u5E94\u5546\u5DF2\u914D\u7F6E` : "\u9700\u8981 Python 3.10+" }),
1311
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { "aria-hidden": "true" })
1312
+ ] }),
1313
+ diagnostics.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "oh-story-status-pill", "data-tone": protocolErrors > 0 ? "error" : "warning", "aria-expanded": open === "diagnostics", "aria-controls": "oh-story-production-diagnostics", onClick: () => {
1314
+ toggle("diagnostics");
1315
+ }, children: [
1316
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1317
+ protocolErrors > 0 ? `${String(protocolErrors)} \u4E2A\u534F\u8BAE\u9519\u8BEF` : `${String(diagnostics.length)} \u4E2A\u683C\u5F0F\u63D0\u9192`,
1318
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { "aria-hidden": "true" })
1319
+ ] })
1320
+ ] }),
1321
+ open === "environment" && typeof preflight == "object" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-status-panel", id: "oh-story-production-environment", "aria-label": "\u5A92\u4F53\u751F\u6210\u73AF\u5883\u8BE6\u60C5", children: [
1322
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("ul", { className: "oh-story-provider-list", children: [
1323
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { "data-ready": preflight.python.ok || void 0, "data-error": !preflight.python.ok || void 0, children: [
1324
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1325
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u8FD0\u884C" }),
1326
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "Python" }),
1327
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: preflight.python.ok ? preflight.python.version : `${preflight.python.version ?? "\u672A\u627E\u5230"} \xB7 Skill \u811A\u672C\u9700\u8981 3.10+` })
1328
+ ] }),
1329
+ preflight.adapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { "data-ready": adapter.configured || void 0, children: [
1330
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true" }),
1331
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: MODALITY_LABEL[adapter.modality] }),
1332
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: adapter.label }),
1333
+ adapter.configured ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: "\u5DF2\u914D\u7F6E" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("small", { children: [
1334
+ "\u7F3A ",
1335
+ adapter.missing.map((name2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: name2 }, name2))
1336
+ ] })
1337
+ ] }, adapter.name))
1047
1338
  ] }),
1048
- preflight.adapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "data-ready": adapter.configured || void 0, title: adapter.configured ? `${adapter.name} \u5DF2\u914D\u7F6E` : `\u7F3A\u5C11\u73AF\u5883\u53D8\u91CF ${adapter.missing.join("\u3001")}`, children: [
1049
- MODALITY_LABEL[adapter.modality],
1050
- " ",
1051
- adapter.label,
1052
- adapter.configured ? "" : ` \xB7 \u7F3A ${adapter.missing.join("\u3001")}`
1053
- ] }, adapter.name)),
1054
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("em", { children: [
1055
- "DeepSeek \u53EA\u8D1F\u8D23\u5199\u63D0\u793A\u8BCD\uFF1B\u56FE\u7247\u3001\u89C6\u9891\u3001\u8BED\u97F3\u3001\u97F3\u4E50\u7531\u4E0A\u9762\u7684\u4F9B\u5E94\u5546 API \u751F\u6210\uFF0CKey \u5728\u542F\u52A8 DSH \u524D\u5199\u5165\u5BBF\u4E3B\u673A\u73AF\u5883\u53D8\u91CF\u3002",
1056
- unconfigured.length === preflight.adapters.length && " \u5F53\u524D\u4E00\u4E2A\u90FD\u6CA1\u914D\u7F6E\uFF0C\u751F\u4EA7\u4EFB\u52A1\u4F1A\u505C\u5728 adapter \u4E4B\u524D\u3002",
1057
- " ",
1058
- "Adapter \u914D\u7F6E",
1059
- preflight.adapterConfig.generated ? "\u5DF2\u81EA\u52A8\u767B\u8BB0" : "\u4F7F\u7528\u81EA\u5B9A\u4E49\u6587\u4EF6",
1060
- preflight.adapterConfig.ok ? "" : "\uFF08\u5199\u5165\u5931\u8D25\uFF09",
1061
- "\uFF1A",
1062
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("code", { children: preflight.adapterConfig.path }),
1339
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
1340
+ "DeepSeek \u53EA\u8D1F\u8D23\u5199\u63D0\u793A\u8BCD\uFF0C\u56FE\u7247\u3001\u89C6\u9891\u3001\u8BED\u97F3\u3001\u97F3\u4E50\u7531\u8FD9\u4E9B\u4F9B\u5E94\u5546 API \u751F\u6210\u3002Key \u5199\u5728\u542F\u52A8 DSH \u4E4B\u524D\u7684\u5BBF\u4E3B\u673A\u73AF\u5883\u53D8\u91CF\u91CC",
1341
+ configured === 0 ? "\uFF1B\u73B0\u5728\u4E00\u4E2A\u90FD\u6CA1\u914D\u7F6E\uFF0C\u751F\u4EA7\u4EFB\u52A1\u4F1A\u5728\u8C03\u7528\u4F9B\u5E94\u5546\u4E4B\u524D\u505C\u4E0B" : "",
1063
1342
  "\u3002\u8BE6\u89C1 README\u300C\u5A92\u4F53\u751F\u6210 API\u300D\u3002"
1343
+ ] }),
1344
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("footer", { children: [
1345
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1346
+ "Adapter \u914D\u7F6E",
1347
+ preflight.adapterConfig.generated ? "\uFF08\u81EA\u52A8\u767B\u8BB0\uFF09" : "\uFF08\u81EA\u5B9A\u4E49\uFF09",
1348
+ preflight.adapterConfig.ok ? "" : " \xB7 \u5199\u5165\u5931\u8D25"
1349
+ ] }),
1350
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { title: preflight.adapterConfig.path, children: adapterFile }),
1351
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1352
+ navigator.clipboard.writeText(preflight.adapterConfig.path).then(() => {
1353
+ setCopied(!0), setTimeout(() => {
1354
+ setCopied(!1);
1355
+ }, 1500);
1356
+ });
1357
+ }, children: copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236\u8DEF\u5F84" })
1358
+ ] })
1359
+ ] }),
1360
+ open === "diagnostics" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-status-panel oh-story-production-diagnostics", id: "oh-story-production-diagnostics", "aria-label": "\u6587\u6863\u683C\u5F0F\u63D0\u9192", children: [
1361
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: diagnostics.slice(0, 8).map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { "data-severity": item.severity, children: [
1362
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", onClick: () => {
1363
+ onNavigate({ path: item.path, offset: item.offset, id: item.targetId ?? item.code });
1364
+ }, children: [
1365
+ item.path.split("/").at(-1),
1366
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1367
+ ":",
1368
+ item.line
1369
+ ] })
1370
+ ] }),
1371
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: item.message })
1372
+ ] }, `${item.path}:${String(item.offset)}:${item.code}`)) }),
1373
+ diagnostics.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
1374
+ "\u53E6\u6709 ",
1375
+ diagnostics.length - 8,
1376
+ " \u9879\uFF0C\u8BF7\u6309\u6587\u6863\u4F4D\u7F6E\u4FEE\u590D\u3002"
1064
1377
  ] })
1065
1378
  ] })
1066
1379
  ] });
@@ -1070,15 +1383,15 @@ function handleSectionKey(event, current, onChange) {
1070
1383
  next !== void 0 && (event.preventDefault(), onChange(SECTION_ORDER[next]), event.currentTarget.parentElement?.querySelectorAll("[role='tab']")[next]?.focus());
1071
1384
  }
1072
1385
  function DramaProductionView(props) {
1073
- let [notice, setNotice] = (0, import_react.useState)(), protocolErrors = props.production.diagnostics.filter((item) => item.severity === "error").length, jobsRef = (0, import_react.useRef)(props.jobs), commitJobs = (0, import_react.useCallback)((next) => {
1386
+ let [notice, setNotice] = (0, import_react2.useState)(), jobsRef = (0, import_react2.useRef)(props.jobs), commitJobs = (0, import_react2.useCallback)((next) => {
1074
1387
  jobsRef.current = next, props.onJobsChange(next);
1075
1388
  }, [props.onJobsChange]);
1076
- (0, import_react.useEffect)(() => {
1389
+ (0, import_react2.useEffect)(() => {
1077
1390
  jobsRef.current = props.jobs;
1078
- }, [props.jobs]), (0, import_react.useEffect)(() => {
1079
- let next = reconcileSequence(props.production.shots.map((shot) => shot.id), props.sequence, props.versions, props.selections);
1391
+ }, [props.jobs]), (0, import_react2.useEffect)(() => {
1392
+ let next = reconcileSequence(props.production.shots.map((shot) => shot.id), props.sequence, props.versions, props.selections, props.production.episodeDirectory);
1080
1393
  JSON.stringify(next) !== JSON.stringify(props.sequence) && props.onSequenceChange(next);
1081
- }, [props.production.shots, props.selections, props.sequence, props.versions]), (0, import_react.useEffect)(() => {
1394
+ }, [props.production.shots, props.selections, props.sequence, props.versions]), (0, import_react2.useEffect)(() => {
1082
1395
  let next = reconcileProductionJobs(props.jobs, props.queue, props.sessionRunning, props.versions);
1083
1396
  JSON.stringify(next) !== JSON.stringify(props.jobs) && commitJobs(next);
1084
1397
  }, [commitJobs, props.jobs, props.queue, props.sessionRunning, props.versions]);
@@ -1116,10 +1429,7 @@ ${item.prompt}`).join(`
1116
1429
  commitJobs(jobsRef.current.map((item) => item.id === job.id ? { ...item, status: "failed", error: error instanceof Error ? error.message : String(error) } : item));
1117
1430
  }
1118
1431
  }, dispatchComposition = async (job) => {
1119
- let versionById = new Map(props.versions.map((version) => [version.id, version])), ordered = props.sequence.flatMap((item) => {
1120
- let version = item.versionId === void 0 ? void 0 : versionById.get(item.versionId);
1121
- return version === void 0 ? [] : [version.path ?? version.url];
1122
- });
1432
+ let ordered = compositionSources(props.production, props.sequence, props.versions);
1123
1433
  commitJobs([...jobsRef.current, job]), props.onSectionChange("tasks");
1124
1434
  try {
1125
1435
  await props.onDispatchPrompt(nativeCompositionPrompt(props.production, job, ordered)), setNotice("\u6210\u7247\u4EFB\u52A1\u5DF2\u8FDB\u5165 DSH \u539F\u751F\u961F\u5217\uFF1B\u6587\u4EF6\u3001FFmpeg \u548C\u5199\u5165\u7EE7\u7EED\u53D7 DSH \u6743\u9650\u4E0E\u5BA1\u6279\u63A7\u5236\u3002");
@@ -1139,7 +1449,7 @@ ${item.prompt}`).join(`
1139
1449
  setNotice(error instanceof Error ? error.message : String(error));
1140
1450
  }
1141
1451
  }, composeSequence = () => {
1142
- let issues = sequenceIssues(props.sequence, props.versions);
1452
+ let issues = sequenceIssues(props.sequence, props.versions, props.production.episodeDirectory);
1143
1453
  if (issues.length > 0) {
1144
1454
  setNotice(issues[0]);
1145
1455
  return;
@@ -1154,15 +1464,15 @@ ${item.prompt}`).join(`
1154
1464
  supersededOutputIds: props.libraryVersions.flatMap((version) => version.path === outputPath ? [version.id] : [])
1155
1465
  }));
1156
1466
  };
1157
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production", children: [
1158
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-bar", children: [
1159
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-production-tabs", role: "tablist", "aria-label": "\u77ED\u5267\u751F\u4EA7\u89C6\u56FE", children: SECTION_ORDER.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", role: "tab", tabIndex: props.section === item ? 0 : -1, "aria-selected": props.section === item, onKeyDown: (event) => {
1467
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production", children: [
1468
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-bar", children: [
1469
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-production-tabs", role: "tablist", "aria-label": "\u77ED\u5267\u751F\u4EA7\u89C6\u56FE", children: SECTION_ORDER.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", role: "tab", tabIndex: props.section === item ? 0 : -1, "aria-selected": props.section === item, onKeyDown: (event) => {
1160
1470
  handleSectionKey(event, item, props.onSectionChange);
1161
1471
  }, onClick: () => {
1162
1472
  props.onSectionChange(item);
1163
1473
  }, children: SECTION_LABELS[item] }, item)) }),
1164
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-meta", children: [
1165
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "oh-story-production-summary", children: [
1474
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-meta", children: [
1475
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "oh-story-production-summary", children: [
1166
1476
  props.production.shots.length,
1167
1477
  " \u955C \xB7 ",
1168
1478
  props.production.assets.length + props.production.visualAssets.length,
@@ -1170,167 +1480,151 @@ ${item.prompt}`).join(`
1170
1480
  props.jobs.filter((job) => job.status === "awaiting_confirmation" || job.status === "running" || job.status === "pending").length,
1171
1481
  " \u4EFB\u52A1"
1172
1482
  ] }),
1173
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: props.onRefresh, children: "\u5237\u65B0" })
1483
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: props.onRefresh, children: "\u5237\u65B0" })
1174
1484
  ] })
1175
1485
  ] }),
1176
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ProductionEnvironment, { sessionId: props.sessionId }),
1177
- notice !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-notice", role: "status", children: [
1178
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: notice }),
1179
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u5173\u95ED\u63D0\u793A", onClick: () => {
1486
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProductionStatus, { sessionId: props.sessionId, diagnostics: props.production.diagnostics, onNavigate: props.onNavigate }),
1487
+ notice !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-notice", role: "status", children: [
1488
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: notice }),
1489
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-label": "\u5173\u95ED\u63D0\u793A", onClick: () => {
1180
1490
  setNotice(void 0);
1181
1491
  }, children: "\xD7" })
1182
1492
  ] }),
1183
- props.production.diagnostics.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("details", { className: "oh-story-production-diagnostics", children: [
1184
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("summary", { children: protocolErrors > 0 ? `${String(protocolErrors)} \u4E2A\u534F\u8BAE\u9519\u8BEF` : `${String(props.production.diagnostics.length)} \u4E2A\u683C\u5F0F\u63D0\u9192` }),
1185
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { children: props.production.diagnostics.slice(0, 8).map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { "data-severity": item.severity, children: [
1186
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", onClick: () => {
1187
- props.onNavigate({ path: item.path, offset: item.offset, id: item.targetId ?? item.code });
1188
- }, children: [
1189
- item.path.split("/").at(-1),
1190
- ":",
1191
- item.line
1192
- ] }),
1193
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: item.message })
1194
- ] }, `${item.path}:${String(item.offset)}:${item.code}`)) }),
1195
- props.production.diagnostics.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
1196
- "\u53E6\u6709 ",
1197
- props.production.diagnostics.length - 8,
1198
- " \u9879\uFF0C\u8BF7\u6309\u6587\u6863\u4F4D\u7F6E\u4FEE\u590D\u3002"
1199
- ] })
1200
- ] }),
1201
- props.section === "shots" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ShotBoard, { ...props, onCreateJob: createJob, onBatch: createBatch }),
1202
- props.section === "assets" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AssetBoard, { ...props, onCreateJob: createJob }),
1203
- props.section === "tasks" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TaskBoard, { jobs: props.jobs, queue: props.queue, sessionRunning: props.sessionRunning, onCancel: cancelJob, onRemoveQueued: removeQueuedJob }),
1204
- props.section === "sequence" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SequenceBoard, { ...props, onCompose: composeSequence }),
1205
- props.section === "canvas" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ProductionCanvas, { ...props })
1493
+ props.section === "shots" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ShotBoard, { ...props, onCreateJob: createJob, onBatch: createBatch }),
1494
+ props.section === "assets" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AssetBoard, { ...props, onCreateJob: createJob }),
1495
+ props.section === "tasks" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TaskBoard, { jobs: props.jobs, queue: props.queue, sessionRunning: props.sessionRunning, onCancel: cancelJob, onRemoveQueued: removeQueuedJob }),
1496
+ props.section === "sequence" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SequenceBoard, { ...props, episodeDirectory: props.production.episodeDirectory, onCompose: composeSequence }),
1497
+ props.section === "canvas" && (props.production.shots.length + props.production.assets.length + props.production.visualAssets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: "oh-story-canvas-shell", "aria-label": "\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u5206\u955C.md`, documentPaths: props.production.documentPaths, what: "\u5173\u7CFB", skill: "/short-drama-storyboard", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ProductionCanvas, { production: props.production, selectedId: props.selectedId, canvas: props.canvas, viewport: props.viewport, onSelect: props.onSelect, onNavigate: props.onNavigate, onCanvasChange: props.onCanvasChange, onViewportChange: props.onViewportChange }))
1206
1498
  ] });
1207
1499
  }
1208
1500
  function ShotBoard(props) {
1209
1501
  let selectedRef = useScrollIntoView(props.selectedId);
1210
- return props.production.shots.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("section", { className: "oh-story-shot-board", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u5206\u955C.md`, documentPaths: props.production.documentPaths, what: "\u955C\u5934", skill: "/short-drama-storyboard", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-shot-board", children: [
1211
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-actions", children: [
1212
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1502
+ return props.production.shots.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: "oh-story-shot-board", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u5206\u955C.md`, documentPaths: props.production.documentPaths, what: "\u955C\u5934", skill: "/short-drama-storyboard", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-shot-board", children: [
1503
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-actions", children: [
1504
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1213
1505
  props.onBatch("image");
1214
1506
  }, children: "\u51C6\u5907\u6279\u91CF\u5173\u952E\u5E27" }),
1215
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1507
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1216
1508
  props.onBatch("video");
1217
1509
  }, children: "\u51C6\u5907\u6279\u91CF\u89C6\u9891" })
1218
1510
  ] }),
1219
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-shot-grid", children: props.production.shots.map((shot) => {
1511
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-shot-grid", children: props.production.shots.map((shot) => {
1220
1512
  let completeness = productionCompleteness(shot), versions = props.versions.filter((version) => version.targetId === shot.id), selected = selectedVersionForTarget(shot.id, props.versions, props.selections, "image") ?? selectedVersionForTarget(shot.id, props.versions, props.selections, "video");
1221
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { className: "oh-story-shot-card", role: "button", tabIndex: 0, "aria-pressed": props.selectedId === shot.id, "aria-label": `\u9009\u4E2D\u955C\u5934 ${shot.id} ${shot.title}`, ref: props.selectedId === shot.id ? selectedRef : void 0, "data-selected": props.selectedId === shot.id || void 0, onKeyDown: (event) => {
1513
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { className: "oh-story-shot-card", role: "button", tabIndex: 0, "aria-pressed": props.selectedId === shot.id, "aria-label": `\u9009\u4E2D\u955C\u5934 ${shot.id} ${shot.title}`, ref: props.selectedId === shot.id ? selectedRef : void 0, "data-selected": props.selectedId === shot.id || void 0, onKeyDown: (event) => {
1222
1514
  (event.key === "Enter" || event.key === " ") && (event.preventDefault(), props.onSelect(shot.id));
1223
1515
  }, onClick: () => {
1224
1516
  props.onSelect(shot.id);
1225
1517
  }, children: [
1226
- selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-shot-placeholder", children: [
1227
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: shot.id.split("-").at(-1) }),
1228
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u7B49\u5F85\u5173\u952E\u5E27\u6210\u679C" })
1229
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version: selected }),
1230
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { children: [
1231
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: (event) => {
1518
+ selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-shot-placeholder", children: [
1519
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: shot.id.split("-").at(-1) }),
1520
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u5F85\u751F\u6210\u5173\u952E\u5E27" })
1521
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version: selected }),
1522
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
1523
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: (event) => {
1232
1524
  event.stopPropagation(), props.onNavigate({ path: shot.path, offset: shot.offset, id: shot.id });
1233
1525
  }, children: shot.id }),
1234
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: shot.durationSeconds === void 0 ? "\u2014" : `${String(shot.durationSeconds)}s` })
1526
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: shot.durationSeconds === void 0 ? "\u2014" : `${String(shot.durationSeconds)}s` })
1235
1527
  ] }),
1236
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { children: shot.title }),
1237
- shot.shotSpec !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: shot.shotSpec }),
1238
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("dl", { children: [
1239
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { children: "\u8D77" }),
1240
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { children: shot.start ?? "\u672A\u586B\u5199" }),
1241
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { children: "\u7EC8" }),
1242
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { children: shot.end ?? "\u672A\u586B\u5199" })
1528
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: shot.title }),
1529
+ shot.shotSpec !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: shot.shotSpec }),
1530
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("dl", { children: [
1531
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { children: "\u8D77" }),
1532
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: shot.start ?? "\u672A\u586B\u5199" }),
1533
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { children: "\u7EC8" }),
1534
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: shot.end ?? "\u672A\u586B\u5199" })
1243
1535
  ] }),
1244
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-shot-status", children: [
1245
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReadinessBadge, { label: "\u5173\u952E\u5E27", ready: completeness.keyframe }),
1246
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReadinessBadge, { label: "\u8FD0\u52A8", ready: completeness.motion }),
1247
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReadinessBadge, { label: "\u53C2\u8003", ready: completeness.references }),
1248
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
1536
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-shot-status", children: [
1537
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReadinessBadge, { label: "\u5173\u952E\u5E27", ready: completeness.keyframe }),
1538
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReadinessBadge, { label: "\u8FD0\u52A8", ready: completeness.motion }),
1539
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReadinessBadge, { label: "\u53C2\u8003", ready: completeness.references }),
1540
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1249
1541
  versions.length,
1250
1542
  " \u7248\u672C"
1251
1543
  ] })
1252
1544
  ] }),
1253
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-reference-links", children: [
1254
- shot.sceneIds.length > 0 ? shot.sceneIds.map((sceneId) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReferenceButton, { id: sceneId, production: props.production, onNavigate: props.onNavigate }, sceneId)) : shot.source !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReferenceButton, { id: shot.source, production: props.production, onNavigate: props.onNavigate }),
1255
- shot.references.map((id) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReferenceButton, { id, production: props.production, onNavigate: props.onNavigate }, id))
1545
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-reference-links", children: [
1546
+ shot.sceneIds.length > 0 ? shot.sceneIds.map((sceneId) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReferenceButton, { id: sceneId, production: props.production, onNavigate: props.onNavigate }, sceneId)) : shot.source !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReferenceButton, { id: shot.source, production: props.production, onNavigate: props.onNavigate }),
1547
+ shot.references.map((id) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ReferenceButton, { id, production: props.production, onNavigate: props.onNavigate }, id))
1256
1548
  ] }),
1257
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-card-actions", children: [
1258
- shot.keyframePrompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: (event) => {
1549
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-card-actions", children: [
1550
+ shot.keyframePrompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: (event) => {
1259
1551
  event.stopPropagation(), props.onCreateJob(shot.id, "image", shot.keyframePrompt ?? "");
1260
1552
  }, children: "\u51C6\u5907\u5173\u952E\u5E27" }),
1261
- shot.motion?.prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: (event) => {
1553
+ shot.motion?.prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: (event) => {
1262
1554
  event.stopPropagation(), props.onCreateJob(shot.id, "video", shot.motion?.prompt ?? "");
1263
1555
  }, children: "\u51C6\u5907\u89C6\u9891" })
1264
1556
  ] }),
1265
- versions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VersionStrip, { targetId: shot.id, versions, selections: props.selections, onSelectionsChange: props.onSelectionsChange })
1557
+ versions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VersionStrip, { targetId: shot.id, versions, selections: props.selections, onSelectionsChange: props.onSelectionsChange })
1266
1558
  ] }, shot.id);
1267
1559
  }) })
1268
1560
  ] });
1269
1561
  }
1270
1562
  function AssetBoard(props) {
1271
- let [query, setQuery] = (0, import_react.useState)(""), [kind, setKind] = (0, import_react.useState)("all"), assets = [...props.production.assets, ...props.production.visualAssets.filter((visual) => !props.production.assets.some((asset) => asset.title === visual.title))], needle = query.trim().toLocaleLowerCase(), library = props.libraryVersions.filter((version) => (kind === "all" || version.kind === kind) && (needle === "" || `${version.targetId} ${version.path ?? ""}`.toLocaleLowerCase().includes(needle))), selectedRef = useScrollIntoView(props.selectedId), referenceTarget = props.selectedId?.startsWith("SHOT-") === !0 ? props.selectedId : void 0, toggleReference = (versionId) => {
1563
+ let [query, setQuery] = (0, import_react2.useState)(""), [kind, setKind] = (0, import_react2.useState)("all"), assets = [...props.production.assets, ...props.production.visualAssets.filter((visual) => !props.production.assets.some((asset) => asset.title === visual.title))], needle = query.trim().toLocaleLowerCase(), library = props.libraryVersions.filter((version) => (kind === "all" || version.kind === kind) && (needle === "" || `${version.targetId} ${version.path ?? ""}`.toLocaleLowerCase().includes(needle))), selectedRef = useScrollIntoView(props.selectedId), referenceTarget = props.selectedId?.startsWith("SHOT-") === !0 ? props.selectedId : void 0, toggleReference = (versionId) => {
1272
1564
  if (referenceTarget === void 0) return;
1273
1565
  let current = props.manualReferences[referenceTarget] ?? [], next = current.includes(versionId) ? current.filter((id) => id !== versionId) : [...current, versionId], mutable = Object.fromEntries(Object.entries(props.manualReferences).map(([target, ids]) => [target, [...ids]]));
1274
1566
  props.onManualReferencesChange({ ...mutable, [referenceTarget]: next });
1275
1567
  };
1276
- return assets.length === 0 && props.libraryVersions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("section", { className: "oh-story-assets", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u56FE\u7247\u63D0\u793A\u8BCD.md`, documentPaths: props.production.documentPaths, what: "\u7D20\u6750", skill: "/short-drama-image-prompts", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-assets", children: [
1277
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-asset-grid", children: assets.map((asset) => {
1568
+ return assets.length === 0 && props.libraryVersions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: "oh-story-assets", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u56FE\u7247\u63D0\u793A\u8BCD.md`, documentPaths: props.production.documentPaths, what: "\u7D20\u6750", skill: "/short-drama-image-prompts", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-assets", children: [
1569
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-asset-grid", children: assets.map((asset) => {
1278
1570
  let prompt = "prompt" in asset ? asset.prompt : asset.description, versions = props.versions.filter((version) => version.targetId === asset.id), selected = selectedVersionForTarget(asset.id, props.versions, props.selections, "image");
1279
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { className: "oh-story-asset-card", ref: props.selectedId === asset.id ? selectedRef : void 0, "data-selected": props.selectedId === asset.id || void 0, children: [
1280
- selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-asset-placeholder", children: asset.kind === "character" ? "\u4EBA" : asset.kind === "scene" ? "\u666F" : asset.kind === "prop" ? "\u7269" : "\u8BBE" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version: selected }),
1281
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1282
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: ASSET_KIND_LABEL[asset.kind] }),
1283
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { children: asset.title }),
1284
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1571
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { className: "oh-story-asset-card", ref: props.selectedId === asset.id ? selectedRef : void 0, "data-selected": props.selectedId === asset.id || void 0, children: [
1572
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-asset-media", "data-kind": asset.kind, children: [
1573
+ selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-asset-placeholder", "aria-hidden": "true", children: asset.kind === "character" ? "\u4EBA" : asset.kind === "scene" ? "\u666F" : asset.kind === "prop" ? "\u7269" : "\u8BBE" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version: selected }),
1574
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: ASSET_KIND_LABEL[asset.kind] })
1575
+ ] }),
1576
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-asset-head", children: [
1577
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: asset.title }),
1578
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1285
1579
  props.onNavigate({ path: asset.path, offset: asset.offset, id: asset.id });
1286
1580
  }, children: asset.id })
1287
1581
  ] }),
1288
- prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "oh-story-asset-description", children: prompt }),
1289
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-card-actions", children: prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1582
+ prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "oh-story-asset-description", children: prompt }),
1583
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-card-actions", children: prompt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1290
1584
  props.onCreateJob(asset.id, "image", prompt);
1291
1585
  }, children: "\u51C6\u5907\u7D20\u6750" }) }),
1292
- versions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VersionStrip, { targetId: asset.id, versions, selections: props.selections, onSelectionsChange: props.onSelectionsChange })
1586
+ versions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VersionStrip, { targetId: asset.id, versions, selections: props.selections, onSelectionsChange: props.onSelectionsChange })
1293
1587
  ] }, asset.id);
1294
1588
  }) }),
1295
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-media-library", children: [
1296
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { children: [
1297
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1298
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "\u9879\u76EE\u5A92\u4F53\u5E93" }),
1299
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
1589
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-media-library", children: [
1590
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
1591
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1592
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u9879\u76EE\u5A92\u4F53\u5E93" }),
1593
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1300
1594
  library.length,
1301
1595
  "/",
1302
1596
  props.libraryVersions.length,
1303
1597
  " \u9879 \xB7 \u53EF\u8DE8\u96C6\u590D\u7528"
1304
1598
  ] })
1305
1599
  ] }),
1306
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1307
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { "aria-label": "\u641C\u7D22\u9879\u76EE\u5A92\u4F53", value: query, placeholder: "\u641C\u7D22 ID \u6216\u8DEF\u5F84", onChange: (event) => {
1600
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1601
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { "aria-label": "\u641C\u7D22\u9879\u76EE\u5A92\u4F53", value: query, placeholder: "\u641C\u7D22 ID \u6216\u8DEF\u5F84", onChange: (event) => {
1308
1602
  setQuery(event.target.value);
1309
1603
  } }),
1310
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("select", { "aria-label": "\u7B5B\u9009\u5A92\u4F53\u7C7B\u578B", value: kind, onChange: (event) => {
1604
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { "aria-label": "\u7B5B\u9009\u5A92\u4F53\u7C7B\u578B", value: kind, onChange: (event) => {
1311
1605
  setKind(event.target.value);
1312
1606
  }, children: [
1313
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "all", children: "\u5168\u90E8" }),
1314
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "image", children: "\u56FE\u7247" }),
1315
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "video", children: "\u89C6\u9891" })
1607
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "all", children: "\u5168\u90E8" }),
1608
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "image", children: "\u56FE\u7247" }),
1609
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "video", children: "\u89C6\u9891" })
1316
1610
  ] })
1317
1611
  ] })
1318
1612
  ] }),
1319
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "oh-story-projection-note", children: [
1613
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "oh-story-projection-note", children: [
1320
1614
  referenceTarget === void 0 ? "\u5148\u5728\u955C\u5934\u9875\u9009\u4E2D\u4E00\u4E2A\u955C\u5934\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u628A\u5DF2\u6709\u56FE\u7247\u8BBE\u4E3A\u8BE5\u955C\u5934\u7684\u8865\u5145\u53C2\u8003\u3002" : `\u53EF\u628A\u4E0B\u9762\u7684\u56FE\u7247\u8BBE\u4E3A ${referenceTarget} \u7684\u8865\u5145\u53C2\u8003\u3002`,
1321
1615
  "\u8865\u5145\u53C2\u8003\u53EA\u63D0\u793A Agent \u6838\u5BF9\uFF1B\u5199\u8FDB\u6765\u6E90\u6761\u76EE\u7684\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u540E\u624D\u4F1A\u9001\u8FDB\u751F\u4EA7\u3002"
1322
1616
  ] }),
1323
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-media-library-grid", children: library.map((version) => {
1617
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-media-library-grid", children: library.map((version) => {
1324
1618
  let selected = referenceTarget !== void 0 && (props.manualReferences[referenceTarget] ?? []).includes(version.id);
1325
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { children: [
1326
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version }),
1327
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: version.targetId }),
1328
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { title: version.path, children: version.path }),
1329
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("footer", { children: [
1330
- version.path !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1619
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { children: [
1620
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version }),
1621
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: version.targetId }),
1622
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { title: version.path, children: version.path }),
1623
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("footer", { children: [
1624
+ version.path !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1331
1625
  props.onOpenMedia(version.path);
1332
1626
  }, children: "\u6253\u5F00\u6587\u4EF6" }),
1333
- referenceTarget !== void 0 && version.kind === "image" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-pressed": selected, "aria-label": `${selected ? "\u53D6\u6D88" : "\u8BBE\u4E3A"} ${referenceTarget} \u53C2\u8003 ${version.targetId}`, title: "\u63D0\u793A Agent \u6838\u5BF9\uFF1B\u5199\u8FDB\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u540E\u624D\u4F1A\u9001\u8FDB\u751F\u4EA7", onClick: () => {
1627
+ referenceTarget !== void 0 && version.kind === "image" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-pressed": selected, "aria-label": `${selected ? "\u53D6\u6D88" : "\u8BBE\u4E3A"} ${referenceTarget} \u53C2\u8003 ${version.targetId}`, title: "\u63D0\u793A Agent \u6838\u5BF9\uFF1B\u5199\u8FDB\u300C\u8F93\u5165\u53C2\u8003\u56FE\u300D\u540E\u624D\u4F1A\u9001\u8FDB\u751F\u4EA7", onClick: () => {
1334
1628
  toggleReference(version.id);
1335
1629
  }, children: selected ? "\u5DF2\u8BBE\u8865\u5145\u53C2\u8003" : "\u8BBE\u4E3A\u8865\u5145\u53C2\u8003" })
1336
1630
  ] })
@@ -1341,34 +1635,37 @@ function AssetBoard(props) {
1341
1635
  }
1342
1636
  function TaskBoard({ jobs, queue, sessionRunning, onCancel, onRemoveQueued }) {
1343
1637
  let activeJobId = activeProductionJobId(jobs, queue, sessionRunning);
1344
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-task-board", children: [
1345
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-projection-note", children: "\u56FE\u7247\u3001\u89C6\u9891\u3001\u8BED\u97F3\u3001\u97F3\u4E50\u90FD\u5148\u9884\u68C0\u3001\u540E\u786E\u8BA4\u3002\u8FD9\u91CC\u8DDF\u8E2A\u56FE\u7247\u3001\u89C6\u9891\u4E0E\u6210\u7247\u4EFB\u52A1\uFF1B\u8BED\u97F3\u548C\u97F3\u4E50\u5728 Chat \u91CC\u5B8C\u6210\uFF0C\u7ED3\u679C\u76F4\u63A5\u843D\u5728\u5236\u4F5C\u6210\u679C\u76EE\u5F55\u3002\u4F9B\u5E94\u5546\u89C1\u4E0A\u65B9\u300C\u751F\u6210\u73AF\u5883\u300D\uFF0C\u5B9E\u9645\u8D26\u53F7\u3001\u6A21\u578B\u4E0E\u53EF\u7528\u6027\u7531\u5F53\u524D DSH \u8FD0\u884C\u73AF\u5883\u51B3\u5B9A\u3002" }),
1346
- jobs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-production-empty", children: "\u8FD8\u6CA1\u6709\u751F\u4EA7\u4EFB\u52A1\u3002\u53EF\u4ECE\u955C\u5934\u6216\u7D20\u6750\u9875\u63D0\u4EA4\u5355\u4E2A\u6216\u6279\u91CF\u4EFB\u52A1\u3002" }) : [...jobs].reverse().map((job) => {
1638
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-task-board", children: [
1639
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "oh-story-board-hint", children: "\u8FD9\u91CC\u8DDF\u8E2A\u56FE\u7247\u3001\u89C6\u9891\u4E0E\u6210\u7247\u4EFB\u52A1\uFF0C\u6BCF\u9879\u90FD\u5148\u9884\u68C0\u3001\u518D\u7531\u4F60\u5728 Chat \u786E\u8BA4\u3002\u8BED\u97F3\u548C\u97F3\u4E50\u5728 Chat \u91CC\u5B8C\u6210\uFF0C\u7ED3\u679C\u76F4\u63A5\u5199\u8FDB\u5236\u4F5C\u6210\u679C\u76EE\u5F55\u3002" }),
1640
+ jobs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-empty", children: [
1641
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u751F\u4EA7\u4EFB\u52A1" }),
1642
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: "\u5728\u300C\u955C\u5934\u300D\u6216\u300C\u7D20\u6750\u300D\u9875\u51C6\u5907\u5173\u952E\u5E27\u3001\u89C6\u9891\u6216\u7D20\u6750\uFF0C\u786E\u8BA4\u540E\u7684\u4EFB\u52A1\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" })
1643
+ ] }) : [...jobs].reverse().map((job) => {
1347
1644
  let queued = queuedItemForJob(job.id, queue), displayStatus = queued === void 0 ? STATUS_LABELS[job.status] : "DSH Queue";
1348
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { "data-job-id": job.id, "data-status": job.status, children: [
1349
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { children: [
1350
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { title: job.targetId, children: job.targetId }),
1351
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: JOB_KIND_LABEL[job.kind] }),
1352
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: displayStatus })
1645
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { "data-job-id": job.id, "data-status": job.status, children: [
1646
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
1647
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { title: job.targetId, children: job.targetId }),
1648
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: JOB_KIND_LABEL[job.kind] }),
1649
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: displayStatus })
1353
1650
  ] }),
1354
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-task-progress", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { style: { width: `${String(job.progress)}%` } }) }),
1355
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("details", { children: [
1356
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("summary", { children: "\u67E5\u770B\u6295\u4EA7\u63D0\u793A\u8BCD" }),
1357
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: job.prompt })
1651
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-task-progress", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { style: { width: `${String(job.progress)}%` } }) }),
1652
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("details", { children: [
1653
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("summary", { children: "\u67E5\u770B\u6295\u4EA7\u63D0\u793A\u8BCD" }),
1654
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: job.prompt })
1358
1655
  ] }),
1359
- job.expectedOutputs > 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("small", { children: [
1656
+ job.expectedOutputs > 1 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("small", { children: [
1360
1657
  job.completedOutputs,
1361
1658
  "/",
1362
1659
  job.expectedOutputs,
1363
1660
  " \u9879\u6210\u679C"
1364
1661
  ] }),
1365
- job.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-error", children: job.error }),
1366
- job.output !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version: job.output }),
1367
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("footer", { children: [
1368
- queued !== void 0 && (job.status === "awaiting_confirmation" || job.status === "pending" || job.status === "running") && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1662
+ job.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-error", children: job.error }),
1663
+ job.output !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version: job.output }),
1664
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("footer", { children: [
1665
+ queued !== void 0 && (job.status === "awaiting_confirmation" || job.status === "pending" || job.status === "running") && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1369
1666
  onRemoveQueued(job, queued.id);
1370
1667
  }, children: "\u4ECE DSH Queue \u79FB\u9664" }),
1371
- activeJobId === job.id && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1668
+ activeJobId === job.id && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1372
1669
  onCancel(job);
1373
1670
  }, children: "\u505C\u6B62\u5F53\u524D DSH Turn" })
1374
1671
  ] })
@@ -1377,38 +1674,55 @@ function TaskBoard({ jobs, queue, sessionRunning, onCancel, onRemoveQueued }) {
1377
1674
  ] });
1378
1675
  }
1379
1676
  function SequenceBoard(props) {
1380
- let composing = compositionInFlight(props.jobs), issues = sequenceIssues(props.sequence, props.versions), versionById = new Map(props.versions.map((version) => [version.id, version])), move = (index, delta) => {
1677
+ let composing = compositionInFlight(props.jobs), scopedVersions = props.versions.filter((version) => props.episodeDirectory === void 0 || mediaBelongsToEpisode(version.path, props.episodeDirectory)), issues = sequenceIssues(props.sequence, scopedVersions, props.episodeDirectory), versionById = new Map(scopedVersions.map((version) => [version.id, version])), move = (index, delta) => {
1381
1678
  let source = props.sequence[index], target = props.sequence[index + delta];
1382
1679
  source !== void 0 && target !== void 0 && props.onSequenceChange(reorderSequence(props.sequence, index, index + delta));
1680
+ }, chooseSource = (shotId, sourceVersionId) => {
1681
+ props.onSequenceChange(props.sequence.map((item) => item.shotId !== shotId ? item : sourceVersionId === "" ? { shotId: item.shotId, versionId: item.versionId } : { ...item, sourceVersionId, versionId: sourceVersionId }));
1383
1682
  };
1384
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-sequence", children: [
1385
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-sequence-summary", children: [
1386
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("strong", { children: [
1683
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "oh-story-sequence", children: [
1684
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-sequence-summary", children: [
1685
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("strong", { children: [
1387
1686
  props.sequence.length,
1388
1687
  " \u4E2A\u955C\u5934"
1389
1688
  ] }),
1390
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: props.sequence.length === 0 ? "\u8FD8\u6CA1\u6709\u955C\u5934" : composing ? "\u6210\u7247\u4EFB\u52A1\u8FDB\u884C\u4E2D" : issues.length === 0 ? "\u5DF2\u53EF\u5408\u6210" : `${String(issues.length)} \u4E2A\u963B\u585E\u9879` }),
1391
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: composing || issues.length > 0 || props.sequence.length < 2, onClick: props.onCompose, children: "\u5408\u6210\u6210\u7247" })
1689
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: props.sequence.length === 0 ? "\u8FD8\u6CA1\u6709\u955C\u5934" : composing ? "\u6210\u7247\u4EFB\u52A1\u8FDB\u884C\u4E2D" : issues.length === 0 ? "\u5DF2\u53EF\u5408\u6210" : `${String(issues.length)} \u4E2A\u963B\u585E\u9879` }),
1690
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: composing || issues.length > 0 || props.sequence.length < 2, onClick: props.onCompose, children: "\u5408\u6210\u6210\u7247" })
1392
1691
  ] }),
1393
- issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("ul", { className: "oh-story-sequence-issues", children: [
1394
- issues.slice(0, 3).map((issue) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: issue }, issue)),
1395
- issues.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { children: [
1692
+ issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("ul", { className: "oh-story-sequence-issues", children: [
1693
+ issues.slice(0, 3).map((issue) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: issue }, issue)),
1694
+ issues.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
1396
1695
  "\u53E6\u6709 ",
1397
1696
  issues.length - 3,
1398
- " \u4E2A\u963B\u585E\u9879\uFF0C\u8BF7\u5728\u4E0B\u65B9\u955C\u5934\u884C\u8865\u9F50\u89C6\u9891\u3002"
1697
+ " \u4E2A\u963B\u585E\u9879\uFF0C\u8BF7\u5728\u4E0B\u65B9\u955C\u5934\u884C\u8865\u9F50\u7D20\u6750\u3002"
1399
1698
  ] })
1400
1699
  ] }),
1401
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ol", { children: props.sequence.map((item, index) => {
1402
- let version = item.versionId === void 0 ? void 0 : versionById.get(item.versionId);
1403
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { children: [
1404
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: String(index + 1).padStart(2, "0") }),
1405
- version === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-sequence-missing", children: "\u7F3A\u5C11\u89C6\u9891" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version, interactive: !1 }),
1406
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: item.shotId }),
1407
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
1408
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": `\u4E0A\u79FB ${item.shotId}`, disabled: index === 0, onClick: () => {
1700
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ol", { children: props.sequence.map((item, index) => {
1701
+ let version = item.versionId === void 0 ? void 0 : versionById.get(item.versionId), choices = scopedVersions.filter((candidate) => candidate.path !== void 0 && sequenceSourceEligible(item.shotId, candidate)), explicitMissing = item.sourceVersionId !== void 0 && !choices.some((choice) => choice.id === item.sourceVersionId);
1702
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
1703
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: String(index + 1).padStart(2, "0") }),
1704
+ version === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-sequence-missing", children: "\u7F3A\u5C11\u7D20\u6750" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version, interactive: !1 }),
1705
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-sequence-main", children: [
1706
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { title: item.shotId, children: item.shotId }),
1707
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { "aria-label": `\u9009\u62E9 ${item.shotId} \u6210\u7247\u7D20\u6750`, value: item.sourceVersionId ?? "", onChange: (event) => {
1708
+ chooseSource(item.shotId, event.target.value);
1709
+ }, children: [
1710
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: "\u81EA\u52A8\uFF08\u89C6\u9891\u4F18\u5148\uFF09" }),
1711
+ explicitMissing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: item.sourceVersionId, disabled: !0, children: "\u5DF2\u9009\u7D20\u6750\u4E0D\u53EF\u7528" }),
1712
+ choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("option", { value: choice.id, children: [
1713
+ choice.targetId,
1714
+ " \xB7 ",
1715
+ choice.kind === "video" ? "\u89C6\u9891" : "\u9759\u5E27",
1716
+ " \xB7 ",
1717
+ choice.path?.split("/").at(-1)
1718
+ ] }, choice.id))
1719
+ ] })
1720
+ ] }),
1721
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-sequence-move", children: [
1722
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-label": `\u4E0A\u79FB ${item.shotId}`, disabled: index === 0, onClick: () => {
1409
1723
  move(index, -1);
1410
1724
  }, children: "\u2191" }),
1411
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": `\u4E0B\u79FB ${item.shotId}`, disabled: index === props.sequence.length - 1, onClick: () => {
1725
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", "aria-label": `\u4E0B\u79FB ${item.shotId}`, disabled: index === props.sequence.length - 1, onClick: () => {
1412
1726
  move(index, 1);
1413
1727
  }, children: "\u2193" })
1414
1728
  ] })
@@ -1416,82 +1730,28 @@ function SequenceBoard(props) {
1416
1730
  }) })
1417
1731
  ] });
1418
1732
  }
1419
- function ProductionCanvas(props) {
1420
- let nodes = (0, import_react.useMemo)(() => {
1421
- let assets = [...props.production.assets, ...props.production.visualAssets].map((asset, index) => ({ id: asset.id, label: asset.title, type: "asset", initial: { x: 80, y: 80 + index * 150 } })), shots = props.production.shots.map((shot, index) => ({ id: shot.id, label: shot.title, type: "shot", initial: { x: 640, y: 80 + index * 180 } }));
1422
- return [...assets, ...shots];
1423
- }, [props.production.assets, props.production.shots, props.production.visualAssets]), positions = Object.fromEntries(nodes.map((node) => [node.id, props.canvas[node.id] ?? node.initial])), startDrag = (event, id) => {
1424
- event.currentTarget.setPointerCapture(event.pointerId);
1425
- let origin = positions[id] ?? { x: 0, y: 0 }, start = { x: event.clientX, y: event.clientY }, move = (moveEvent) => {
1426
- props.onCanvasChange({ ...props.canvas, [id]: { x: origin.x + (moveEvent.clientX - start.x) / props.zoom, y: origin.y + (moveEvent.clientY - start.y) / props.zoom } });
1427
- }, end = () => {
1428
- globalThis.removeEventListener("pointermove", move), globalThis.removeEventListener("pointerup", end);
1429
- };
1430
- globalThis.addEventListener("pointermove", move), globalThis.addEventListener("pointerup", end);
1431
- }, moveNode = (id, x, y) => {
1432
- let origin = positions[id] ?? { x: 0, y: 0 };
1433
- props.onCanvasChange({ ...props.canvas, [id]: { x: origin.x + x, y: origin.y + y } });
1434
- }, connections = props.production.shots.flatMap((shot) => shot.references.map((reference) => [reference, shot.id]));
1435
- return nodes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("section", { className: "oh-story-canvas-shell", "aria-label": "\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MissingDocument, { document: `${props.production.episodeDirectory}/\u5206\u955C.md`, documentPaths: props.production.documentPaths, what: "\u5173\u7CFB", skill: "/short-drama-storyboard", onNavigate: props.onNavigate }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "oh-story-canvas-shell", "aria-label": "\u77ED\u5267\u7D20\u6750\u4E0E\u955C\u5934\u5173\u7CFB\u753B\u5E03", children: [
1436
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-projection-note", children: "\u6587\u6863\u5173\u7CFB \xB7 \u5E03\u5C40\u4EC5\u4FDD\u5B58\u5728\u5F53\u524D DSH Session" }),
1437
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas-controls", children: [
1438
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u7F29\u5C0F\u753B\u5E03", onClick: () => {
1439
- props.onZoomChange(Math.max(0.5, props.zoom - 0.1));
1440
- }, children: "\u2212" }),
1441
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
1442
- Math.round(props.zoom * 100),
1443
- "%"
1444
- ] }),
1445
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", "aria-label": "\u653E\u5927\u753B\u5E03", onClick: () => {
1446
- props.onZoomChange(Math.min(1.8, props.zoom + 0.1));
1447
- }, children: "\uFF0B" }),
1448
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", onClick: () => {
1449
- props.onCanvasChange({}), props.onZoomChange(0.65);
1450
- }, children: "\u590D\u4F4D" })
1451
- ] }),
1452
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-canvas-viewport", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-canvas", style: { transform: `scale(${String(props.zoom)})` }, children: [
1453
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { "aria-hidden": "true", children: connections.map(([from, to]) => {
1454
- let a = positions[from], b = positions[to];
1455
- return a === void 0 || b === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { "data-active": to === props.selectedId || void 0, d: `M ${String(a.x + 180)} ${String(a.y + 50)} C ${String(a.x + 360)} ${String(a.y + 50)}, ${String(b.x - 180)} ${String(b.y + 50)}, ${String(b.x)} ${String(b.y + 50)}` }, `${from}:${to}`);
1456
- }) }),
1457
- nodes.map((node) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { tabIndex: 0, "aria-label": `${node.type === "asset" ? "\u7D20\u6750" : "\u955C\u5934"} ${node.label}`, "data-node-type": node.type, "data-selected": node.id === props.selectedId || void 0, style: { left: positions[node.id]?.x, top: positions[node.id]?.y }, onKeyDown: (event) => {
1458
- let step = event.shiftKey ? 40 : 10, delta = event.key === "ArrowLeft" ? [-step, 0] : event.key === "ArrowRight" ? [step, 0] : event.key === "ArrowUp" ? [0, -step] : event.key === "ArrowDown" ? [0, step] : void 0;
1459
- delta !== void 0 && (event.preventDefault(), moveNode(node.id, delta[0], delta[1]));
1460
- }, onPointerDown: (event) => {
1461
- startDrag(event, node.id);
1462
- }, onDoubleClick: () => {
1463
- let target = props.production.targets.get(node.id);
1464
- target !== void 0 && props.onNavigate(target);
1465
- }, children: [
1466
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: node.type === "asset" ? "\u7D20\u6750" : "\u955C\u5934" }),
1467
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: node.label }),
1468
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: node.id })
1469
- ] }, node.id))
1470
- ] }) })
1471
- ] });
1472
- }
1473
1733
  function useScrollIntoView(selectedId) {
1474
- let ref = (0, import_react.useRef)(null);
1475
- return (0, import_react.useEffect)(() => {
1734
+ let ref = (0, import_react2.useRef)(null);
1735
+ return (0, import_react2.useEffect)(() => {
1476
1736
  ref.current?.scrollIntoView({ block: "nearest" });
1477
1737
  }, [selectedId]), ref;
1478
1738
  }
1479
1739
  function ReadinessBadge({ label, ready }) {
1480
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { "data-ready": ready, "aria-label": `${label}${ready ? "\u5DF2\u5907" : "\u5F85\u8865"}`, children: [
1481
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { "aria-hidden": "true", children: ready ? "\u2713" : "\u2014" }),
1740
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": ready, "aria-label": `${label}${ready ? "\u5DF2\u5907" : "\u5F85\u8865"}`, children: [
1741
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": "true", children: ready ? "\u2713" : "\u2014" }),
1482
1742
  label
1483
1743
  ] });
1484
1744
  }
1485
1745
  function MissingDocument({ document, documentPaths, what, skill, onNavigate }) {
1486
1746
  let present = documentPaths.includes(document);
1487
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "oh-story-production-empty", children: [
1488
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("strong", { children: [
1747
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-story-production-empty", children: [
1748
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("strong", { children: [
1489
1749
  "\u8FD8\u6CA1\u6709\u53EF\u6295\u5F71\u7684",
1490
1750
  what,
1491
1751
  "\u3002"
1492
1752
  ] }),
1493
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: present ? `${document} \u5DF2\u5B58\u5728\uFF0C\u4F46\u6CA1\u6709\u89E3\u6790\u51FA\u6761\u76EE\u3002\u8BF7\u68C0\u67E5\u4E8C\u7EA7\u6807\u9898\u662F\u5426\u4E3A\u7A33\u5B9A\u7684 ID \u5F62\u5F0F\u3002` : `\u672C\u96C6\u8FD8\u6CA1\u6709 ${document}\u3002\u5728\u53F3\u4FA7 Chat \u7528 ${skill} \u5199\u597D\u8FD9\u4EFD\u6587\u6863\u540E\uFF0C\u8FD9\u91CC\u4F1A\u81EA\u52A8\u51FA\u73B0\u3002` }),
1494
- present && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", onClick: () => {
1753
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: present ? `${document} \u5DF2\u5B58\u5728\uFF0C\u4F46\u6CA1\u6709\u89E3\u6790\u51FA\u6761\u76EE\u3002\u8BF7\u68C0\u67E5\u4E8C\u7EA7\u6807\u9898\u662F\u5426\u4E3A\u7A33\u5B9A\u7684 ID \u5F62\u5F0F\u3002` : `\u672C\u96C6\u8FD8\u6CA1\u6709 ${document}\u3002\u5728\u53F3\u4FA7 Chat \u7528 ${skill} \u5199\u597D\u8FD9\u4EFD\u6587\u6863\u540E\uFF0C\u8FD9\u91CC\u4F1A\u81EA\u52A8\u51FA\u73B0\u3002` }),
1754
+ present && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", onClick: () => {
1495
1755
  onNavigate({ path: document, offset: 0, id: document });
1496
1756
  }, children: [
1497
1757
  "\u6253\u5F00 ",
@@ -1501,20 +1761,20 @@ function MissingDocument({ document, documentPaths, what, skill, onNavigate }) {
1501
1761
  }
1502
1762
  function ReferenceButton({ id, production, onNavigate }) {
1503
1763
  let target = production.targets.get(id);
1504
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: target === void 0, onClick: (event) => {
1764
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", disabled: target === void 0, onClick: (event) => {
1505
1765
  event.stopPropagation(), target !== void 0 && onNavigate(target);
1506
1766
  }, children: id });
1507
1767
  }
1508
1768
  function MediaPreview({ version, interactive = !0 }) {
1509
- return version.kind === "image" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("img", { className: "oh-story-media-preview", src: version.url, alt: version.targetId, loading: "lazy" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("video", { className: "oh-story-media-preview", src: version.url, controls: interactive, muted: !interactive, preload: "metadata" });
1769
+ return version.kind === "image" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("img", { className: "oh-story-media-preview", src: version.url, alt: version.targetId, loading: "lazy" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("video", { className: "oh-story-media-preview", src: version.url, controls: interactive, muted: !interactive, preload: "metadata" });
1510
1770
  }
1511
1771
  function VersionStrip({ targetId, versions, selections, onSelectionsChange }) {
1512
1772
  let selected = selectedVersionForTarget(targetId, versions, selections)?.id;
1513
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "oh-story-version-strip", "aria-label": `${targetId} \u6210\u679C\u7248\u672C`, children: versions.map((version, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", "aria-pressed": version.id === selected, "aria-label": `\u9009\u62E9 ${targetId} \u7248\u672C ${String(index + 1)}`, "data-selected": version.id === selected || void 0, onClick: (event) => {
1773
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-version-strip", "aria-label": `${targetId} \u6210\u679C\u7248\u672C`, children: versions.map((version, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", "aria-pressed": version.id === selected, "aria-label": `\u9009\u62E9 ${targetId} \u7248\u672C ${String(index + 1)}`, "data-selected": version.id === selected || void 0, onClick: (event) => {
1514
1774
  event.stopPropagation(), onSelectionsChange({ ...selections, [targetId]: version.id });
1515
1775
  }, children: [
1516
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MediaPreview, { version, interactive: !1 }),
1517
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
1776
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MediaPreview, { version, interactive: !1 }),
1777
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
1518
1778
  "V",
1519
1779
  String(index + 1)
1520
1780
  ] })
@@ -1589,8 +1849,8 @@ function settledProductionIntents(chat) {
1589
1849
  }
1590
1850
 
1591
1851
  // src/client/video-studio.tsx
1592
- var import_react2 = require("react");
1593
- var import_jsx_runtime4 = require("react/jsx-runtime");
1852
+ var import_react3 = require("react");
1853
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1594
1854
  function preferredPreview(project) {
1595
1855
  return project.previews.find((item) => item.role === "final") ?? project.previews.find((item) => item.role === "edited") ?? project.previews.find((item) => item.role === "source");
1596
1856
  }
@@ -1598,15 +1858,15 @@ function readableBytes(bytes) {
1598
1858
  return bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)} KB` : bytes < 1024 * 1024 * 1024 ? `${(bytes / (1024 * 1024)).toFixed(1)} MB` : `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
1599
1859
  }
1600
1860
  function ActionIcon({ name: name2 }) {
1601
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { "aria-hidden": !0, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: {
1602
- reload: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1603
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20 11a8 8 0 1 0-2.34 5.66" }),
1604
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M20 4v7h-7" })
1861
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { "aria-hidden": !0, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: {
1862
+ reload: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1863
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M20 11a8 8 0 1 0-2.34 5.66" }),
1864
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M20 4v7h-7" })
1605
1865
  ] }),
1606
- fullscreen: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5" }) }),
1607
- external: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1608
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M14 3h7v7M21 3l-9 9" }),
1609
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
1866
+ fullscreen: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5" }) }),
1867
+ external: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1868
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M14 3h7v7M21 3l-9 9" }),
1869
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
1610
1870
  ] })
1611
1871
  }[name2] });
1612
1872
  }
@@ -1617,28 +1877,28 @@ function artifactKindLabel(kind) {
1617
1877
  return { plan: "\u65B9\u6848", script: "\u6587\u7A3F", subtitle: "\u5B57\u5E55", quality: "\u8D28\u68C0", manifest: "\u6E05\u5355" }[kind];
1618
1878
  }
1619
1879
  function VideoPreview({ project, sessionId, running }) {
1620
- let shellRef = (0, import_react2.useRef)(null), initial = preferredPreview(project), [role, setRole] = (0, import_react2.useState)(initial?.role), selected = project.previews.find((item) => item.role === role) ?? preferredPreview(project), [loaded, setLoaded] = (0, import_react2.useState)(initial), [revision, setRevision] = (0, import_react2.useState)(0), [ready, setReady] = (0, import_react2.useState)(!1), [error, setError] = (0, import_react2.useState)(!1);
1621
- if (selected === void 0 || loaded === void 0) return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-preview-empty", children: [
1622
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": !0, children: "\u25B6" }),
1623
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u89C6\u9891" }),
1624
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
1880
+ let shellRef = (0, import_react3.useRef)(null), initial = preferredPreview(project), [role, setRole] = (0, import_react3.useState)(initial?.role), selected = project.previews.find((item) => item.role === role) ?? preferredPreview(project), [loaded, setLoaded] = (0, import_react3.useState)(initial), [revision, setRevision] = (0, import_react3.useState)(0), [ready, setReady] = (0, import_react3.useState)(!1), [error, setError] = (0, import_react3.useState)(!1);
1881
+ if (selected === void 0 || loaded === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-preview-empty", children: [
1882
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u25B6" }),
1883
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u89C6\u9891" }),
1884
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
1625
1885
  "\u628A\u539F\u7247\u5BFC\u5165 ",
1626
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "video-recaps/<\u9879\u76EE>/sources/" }),
1886
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "video-recaps/<\u9879\u76EE>/sources/" }),
1627
1887
  "\uFF0C\u7136\u540E\u5728\u53F3\u4FA7 Chat \u4F7F\u7528 ",
1628
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "/video-recap" }),
1888
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/video-recap" }),
1629
1889
  "\u3002\u526A\u540E\u7247\u548C\u6700\u7EC8\u6210\u7247\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002"
1630
1890
  ] }),
1631
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-prompt-example", children: [
1632
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u63CF\u8FF0\u793A\u4F8B" }),
1633
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("q", { children: "\u628A\u8FD9\u6BB5\u89C6\u9891\u505A\u6210 3 \u5206\u949F\u4E2D\u6587\u89E3\u8BF4\uFF0C\u4FDD\u7559\u5173\u952E\u539F\u58F0\uFF0C\u5B57\u5E55\u70E7\u8FDB\u753B\u9762\u3002" })
1891
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-prompt-example", children: [
1892
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u63CF\u8FF0\u793A\u4F8B" }),
1893
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("q", { children: "\u628A\u8FD9\u6BB5\u89C6\u9891\u505A\u6210 3 \u5206\u949F\u4E2D\u6587\u89E3\u8BF4\uFF0C\u4FDD\u7559\u5173\u952E\u539F\u58F0\uFF0C\u5B57\u5E55\u70E7\u8FDB\u753B\u9762\u3002" })
1634
1894
  ] })
1635
1895
  ] });
1636
1896
  let pending = selected.path !== loaded.path || selected.version !== loaded.version, load = (asset) => {
1637
1897
  setRole(asset.role), setLoaded(asset), setReady(!1), setError(!1), setRevision((value) => value + 1);
1638
1898
  }, runtimeState = error ? "\u89C6\u9891\u8F7D\u5165\u5931\u8D25 \xB7 \u53EF\u91CD\u65B0\u8F7D\u5165" : running ? "Agent \u6B63\u5728\u66F4\u65B0\u9879\u76EE \xB7 \u5F53\u524D\u64AD\u653E\u4FDD\u6301\u4E0D\u53D8" : pending ? "\u65B0\u7248\u672C\u5DF2\u5C31\u7EEA \xB7 \u7531\u4F60\u51B3\u5B9A\u4F55\u65F6\u8F7D\u5165" : ready ? `${loaded.label}\u5DF2\u8F7D\u5165 \xB7 ${readableBytes(loaded.bytes)}` : "\u6B63\u5728\u8BFB\u53D6\u89C6\u9891\u4FE1\u606F\u2026", mediaUrl = `${endpoint("media", sessionId, loaded.path)}&version=${encodeURIComponent(loaded.version)}&reload=${String(revision)}`;
1639
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ref: shellRef, className: "oh-video-preview-shell", "data-state": error ? "error" : running ? "building" : ready ? "ready" : "loading", children: [
1640
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-stagebar", children: [
1641
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-version-tabs", role: "tablist", "aria-label": "\u9884\u89C8\u7248\u672C", children: project.previews.map((asset) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1899
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: shellRef, className: "oh-video-preview-shell", "data-state": error ? "error" : running ? "building" : ready ? "ready" : "loading", children: [
1900
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-stagebar", children: [
1901
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-version-tabs", role: "tablist", "aria-label": "\u9884\u89C8\u7248\u672C", children: project.previews.map((asset) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1642
1902
  "button",
1643
1903
  {
1644
1904
  type: "button",
@@ -1658,24 +1918,24 @@ function VideoPreview({ project, sessionId, running }) {
1658
1918
  },
1659
1919
  asset.role
1660
1920
  )) }),
1661
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "oh-video-runtime-state", role: "status", "aria-live": "polite", children: [
1662
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": !0 }),
1663
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("em", { children: runtimeState })
1921
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-video-runtime-state", role: "status", "aria-live": "polite", children: [
1922
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { "aria-hidden": !0 }),
1923
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: runtimeState })
1664
1924
  ] }),
1665
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-preview-actions", children: [
1666
- pending && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
1925
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-preview-actions", children: [
1926
+ pending && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
1667
1927
  load(selected);
1668
1928
  }, children: "\u8F7D\u5165\u65B0\u7248\u672C" }),
1669
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", title: "\u91CD\u65B0\u8F7D\u5165", "aria-label": "\u91CD\u65B0\u8F7D\u5165\u89C6\u9891", onClick: () => {
1929
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", title: "\u91CD\u65B0\u8F7D\u5165", "aria-label": "\u91CD\u65B0\u8F7D\u5165\u89C6\u9891", onClick: () => {
1670
1930
  load(loaded);
1671
- }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ActionIcon, { name: "reload" }) }),
1672
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", title: "\u5168\u5C4F", "aria-label": "\u5168\u5C4F\u9884\u89C8", onClick: () => {
1931
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionIcon, { name: "reload" }) }),
1932
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", title: "\u5168\u5C4F", "aria-label": "\u5168\u5C4F\u9884\u89C8", onClick: () => {
1673
1933
  shellRef.current?.requestFullscreen();
1674
- }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ActionIcon, { name: "fullscreen" }) }),
1675
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { href: mediaUrl, target: "_blank", rel: "noreferrer", title: "\u5728\u65B0\u7A97\u53E3\u6253\u5F00", "aria-label": "\u5728\u65B0\u7A97\u53E3\u6253\u5F00\u89C6\u9891", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ActionIcon, { name: "external" }) })
1934
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionIcon, { name: "fullscreen" }) }),
1935
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: mediaUrl, target: "_blank", rel: "noreferrer", title: "\u5728\u65B0\u7A97\u53E3\u6253\u5F00", "aria-label": "\u5728\u65B0\u7A97\u53E3\u6253\u5F00\u89C6\u9891", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ActionIcon, { name: "external" }) })
1676
1936
  ] })
1677
1937
  ] }),
1678
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-player-stage", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1938
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-player-stage", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1679
1939
  "video",
1680
1940
  {
1681
1941
  src: mediaUrl,
@@ -1694,10 +1954,10 @@ function VideoPreview({ project, sessionId, running }) {
1694
1954
  ] });
1695
1955
  }
1696
1956
  function VideoArtifacts({ project, sessionId }) {
1697
- let [selected, setSelected] = (0, import_react2.useState)(preferredArtifact(project)?.path), [content, setContent] = (0, import_react2.useState)(), [error, setError] = (0, import_react2.useState)(), [preflight, setPreflight] = (0, import_react2.useState)();
1698
- (0, import_react2.useEffect)(() => {
1957
+ let [selected, setSelected] = (0, import_react3.useState)(preferredArtifact(project)?.path), [content, setContent] = (0, import_react3.useState)(), [error, setError] = (0, import_react3.useState)(), [preflight, setPreflight] = (0, import_react3.useState)();
1958
+ (0, import_react3.useEffect)(() => {
1699
1959
  setSelected(preferredArtifact(project)?.path);
1700
- }, [project.id]), (0, import_react2.useEffect)(() => {
1960
+ }, [project.id]), (0, import_react3.useEffect)(() => {
1701
1961
  if (selected === void 0) {
1702
1962
  setContent(void 0);
1703
1963
  return;
@@ -1714,45 +1974,45 @@ function VideoArtifacts({ project, sessionId }) {
1714
1974
  };
1715
1975
  }, [selected, sessionId]);
1716
1976
  let selectedArtifact = project.artifacts.find((item) => item.path === selected);
1717
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-artifacts", children: [
1718
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("aside", { "aria-label": "\u89C6\u9891\u9879\u76EE\u4EA7\u7269", children: [
1719
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-artifacts-heading", children: [
1720
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u9879\u76EE\u4EA7\u7269" }),
1721
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: project.artifacts.length })
1977
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-artifacts", children: [
1978
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("aside", { "aria-label": "\u89C6\u9891\u9879\u76EE\u4EA7\u7269", children: [
1979
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-artifacts-heading", children: [
1980
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u9879\u76EE\u4EA7\u7269" }),
1981
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: project.artifacts.length })
1722
1982
  ] }),
1723
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-environment", children: [
1724
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u8FD0\u884C\u73AF\u5883" }),
1725
- typeof preflight == "object" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1726
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.python.ok || void 0, children: [
1983
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-environment", children: [
1984
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FD0\u884C\u73AF\u5883" }),
1985
+ typeof preflight == "object" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1986
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.python.ok || void 0, children: [
1727
1987
  "Python ",
1728
1988
  preflight.python.version ?? "\u672A\u627E\u5230"
1729
1989
  ] }),
1730
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.ffmpeg.ok && preflight.ffmpeg.subtitles || void 0, children: [
1990
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.ffmpeg.ok && preflight.ffmpeg.subtitles || void 0, children: [
1731
1991
  "ffmpeg ",
1732
1992
  preflight.ffmpeg.subtitles ? "\xB7 libass" : "\xB7 \u7F3A\u5B57\u5E55\u6EE4\u955C"
1733
1993
  ] }),
1734
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.ffprobe.ok || void 0, children: [
1994
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.ffprobe.ok || void 0, children: [
1735
1995
  "ffprobe ",
1736
1996
  preflight.ffprobe.ok ? "\u53EF\u7528" : "\u672A\u627E\u5230"
1737
1997
  ] }),
1738
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.credentials.mimo || void 0, children: [
1998
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.credentials.mimo || void 0, children: [
1739
1999
  "MiMo Key ",
1740
2000
  preflight.credentials.mimo ? "\u5DF2\u914D\u7F6E" : "\u672A\u914D\u7F6E"
1741
2001
  ] }),
1742
- (preflight.credentials.ttsProvider === "fish-audio" || preflight.credentials.ttsProvider === "auto" && !preflight.credentials.mimo) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.credentials.fish || void 0, children: [
2002
+ (preflight.credentials.ttsProvider === "fish-audio" || preflight.credentials.ttsProvider === "auto" && !preflight.credentials.mimo) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.credentials.fish || void 0, children: [
1743
2003
  "Fish Key ",
1744
2004
  preflight.credentials.fish ? "\u5DF2\u914D\u7F6E" : "\u672A\u914D\u7F6E"
1745
2005
  ] }),
1746
- preflight.credentials.ttsProvider === "index-tts" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "data-ready": preflight.credentials.indexTts || void 0, children: [
2006
+ preflight.credentials.ttsProvider === "index-tts" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { "data-ready": preflight.credentials.indexTts || void 0, children: [
1747
2007
  "IndexTTS ",
1748
2008
  preflight.credentials.indexTts ? "\u5DF2\u914D\u7F6E" : "\u7F3A INDEX_TTS_ENDPOINT / INDEX_TTS_VOICE"
1749
2009
  ] }),
1750
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("em", { children: [
2010
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("em", { children: [
1751
2011
  "DSH Host \u8FDB\u7A0B\u73AF\u5883\uFF1BAgent \u6267\u884C\u4E16\u754C\u4EE5 ",
1752
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "video-recap --doctor" }),
2012
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "video-recap --doctor" }),
1753
2013
  " \u4E3A\u51C6\u3002"
1754
2014
  ] })
1755
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: () => {
2015
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
1756
2016
  fetch(endpoint("video-preflight", sessionId)).then(async (response) => {
1757
2017
  if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);
1758
2018
  setPreflight(await response.json());
@@ -1761,9 +2021,9 @@ function VideoArtifacts({ project, sessionId }) {
1761
2021
  });
1762
2022
  }, children: preflight === "failed" ? "\u73AF\u5883\u68C0\u67E5\u5931\u8D25 \xB7 \u91CD\u8BD5" : "\u68C0\u67E5\u73AF\u5883" })
1763
2023
  ] }),
1764
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("nav", { children: [
1765
- project.artifacts.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: "\u6D41\u6C34\u7EBF\u542F\u52A8\u540E\uFF0C\u5173\u952E\u4EA7\u7269\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" }),
1766
- project.artifacts.map((artifact) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2024
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("nav", { children: [
2025
+ project.artifacts.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\u6D41\u6C34\u7EBF\u542F\u52A8\u540E\uFF0C\u5173\u952E\u4EA7\u7269\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" }),
2026
+ project.artifacts.map((artifact) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1767
2027
  "button",
1768
2028
  {
1769
2029
  type: "button",
@@ -1772,23 +2032,23 @@ function VideoArtifacts({ project, sessionId }) {
1772
2032
  setSelected(artifact.path);
1773
2033
  },
1774
2034
  children: [
1775
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: artifact.label }),
1776
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: artifact.path.split("/").at(-1) })
2035
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: artifact.label }),
2036
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: artifact.path.split("/").at(-1) })
1777
2037
  ]
1778
2038
  },
1779
2039
  artifact.path
1780
2040
  ))
1781
2041
  ] })
1782
2042
  ] }),
1783
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { children: [
1784
- selectedArtifact !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "oh-video-artifact-header", children: [
1785
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1786
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: selectedArtifact.label }),
1787
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: selectedArtifact.path.split("/").at(-1) })
2043
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { children: [
2044
+ selectedArtifact !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "oh-video-artifact-header", children: [
2045
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
2046
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: selectedArtifact.label }),
2047
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: selectedArtifact.path.split("/").at(-1) })
1788
2048
  ] }),
1789
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("em", { children: artifactKindLabel(selectedArtifact.kind) })
2049
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: artifactKindLabel(selectedArtifact.kind) })
1790
2050
  ] }),
1791
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-artifact-content", children: project.artifacts.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-artifacts-empty", children: "\u6545\u4E8B\u65B9\u6848\u3001\u89E3\u8BF4\u8BCD\u3001\u5B57\u5E55\u548C\u8D28\u68C0\u62A5\u544A\u4F1A\u6309\u4E0A\u6E38\u6D41\u6C34\u7EBF\u5199\u5165\u8FD9\u91CC\u3002" }) : error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-story-error", children: error }) : content === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-artifacts-empty", children: "\u6B63\u5728\u8F7D\u5165\u4EA7\u7269\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { children: content }) })
2051
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-artifact-content", children: project.artifacts.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-artifacts-empty", children: "\u6545\u4E8B\u65B9\u6848\u3001\u89E3\u8BF4\u8BCD\u3001\u5B57\u5E55\u548C\u8D28\u68C0\u62A5\u544A\u4F1A\u6309\u4E0A\u6E38\u6D41\u6C34\u7EBF\u5199\u5165\u8FD9\u91CC\u3002" }) : error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-error", children: error }) : content === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-artifacts-empty", children: "\u6B63\u5728\u8F7D\u5165\u4EA7\u7269\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { children: content }) })
1792
2052
  ] })
1793
2053
  ] });
1794
2054
  }
@@ -1807,15 +2067,15 @@ function VideoStudio({
1807
2067
  onWorkbench,
1808
2068
  onCollapse
1809
2069
  }) {
1810
- let project = projects.find((item) => item.id === projectId) ?? projects[0], tabsId = (0, import_react2.useId)();
1811
- (0, import_react2.useEffect)(() => {
2070
+ let project = projects.find((item) => item.id === projectId) ?? projects[0], tabsId = (0, import_react3.useId)();
2071
+ (0, import_react3.useEffect)(() => {
1812
2072
  project !== void 0 && project.id !== projectId && onProject(project.id);
1813
2073
  }, [onProject, project, projectId]);
1814
2074
  let tabs = ["preview", "artifacts"];
1815
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("main", { id: paneId, className: "oh-video-studio", role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: [
1816
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "oh-video-toolbar", children: [
1817
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-workbench-cluster", children: [
1818
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: workbenches.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2075
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("main", { id: paneId, className: "oh-video-studio", role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: [
2076
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "oh-video-toolbar", children: [
2077
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-workbench-cluster", children: [
2078
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: workbenches.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1819
2079
  "button",
1820
2080
  {
1821
2081
  type: "button",
@@ -1832,19 +2092,19 @@ function VideoStudio({
1832
2092
  },
1833
2093
  mode
1834
2094
  )) }),
1835
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: "oh-workbench-collapse", type: "button", title: "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", "aria-label": "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", onClick: onCollapse, children: "\xD7" })
2095
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "oh-workbench-collapse", type: "button", title: "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", "aria-label": "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", onClick: onCollapse, children: "\xD7" })
1836
2096
  ] }),
1837
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "oh-video-project", children: [
1838
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u89C6\u9891\u9879\u76EE" }),
1839
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("select", { "aria-label": "\u89C6\u9891\u9879\u76EE", value: project?.id ?? "", disabled: project === void 0, onChange: (event) => {
2097
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "oh-video-project", children: [
2098
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u89C6\u9891\u9879\u76EE" }),
2099
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("select", { "aria-label": "\u89C6\u9891\u9879\u76EE", value: project?.id ?? "", disabled: project === void 0, onChange: (event) => {
1840
2100
  onProject(event.target.value);
1841
- }, children: projects.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: item.id, children: item.title }, item.id)) })
2101
+ }, children: projects.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: item.id, children: item.title }, item.id)) })
1842
2102
  ] }),
1843
- project !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "oh-video-stage", "data-state": project.state, children: [
1844
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { "aria-hidden": !0 }),
2103
+ project !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-video-stage", "data-state": project.state, children: [
2104
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { "aria-hidden": !0 }),
1845
2105
  project.stageLabel
1846
2106
  ] }),
1847
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "oh-video-tabs", role: "tablist", "aria-label": "\u89C6\u9891\u5DE5\u4F5C\u53F0", children: tabs.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2107
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-tabs", role: "tablist", "aria-label": "\u89C6\u9891\u5DE5\u4F5C\u53F0", children: tabs.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1848
2108
  "button",
1849
2109
  {
1850
2110
  type: "button",
@@ -1864,17 +2124,17 @@ function VideoStudio({
1864
2124
  item
1865
2125
  )) })
1866
2126
  ] }),
1867
- project === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-preview-empty", children: [
1868
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": !0, children: "\u25B6" }),
1869
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u89C6\u9891\u9879\u76EE" }),
1870
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { children: [
2127
+ project === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-preview-empty", children: [
2128
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u25B6" }),
2129
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u89C6\u9891\u9879\u76EE" }),
2130
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
1871
2131
  "\u5728\u53F3\u4FA7 Chat \u544A\u8BC9 Agent \u8981\u5904\u7406\u7684\u89C6\u9891\uFF1B\u9879\u76EE\u4F1A\u521B\u5EFA\u5728 ",
1872
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: "video-recaps/<\u9879\u76EE>/" }),
2132
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "video-recaps/<\u9879\u76EE>/" }),
1873
2133
  "\u3002"
1874
2134
  ] })
1875
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "oh-video-panels", children: [
1876
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "tabpanel", id: `${tabsId}-preview-panel`, "aria-labelledby": `${tabsId}-preview-tab`, hidden: tab !== "preview", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VideoPreview, { project, sessionId, running }, project.id) }),
1877
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { role: "tabpanel", id: `${tabsId}-artifacts-panel`, "aria-labelledby": `${tabsId}-artifacts-tab`, hidden: tab !== "artifacts", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(VideoArtifacts, { project, sessionId }) })
2135
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-video-panels", children: [
2136
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { role: "tabpanel", id: `${tabsId}-preview-panel`, "aria-labelledby": `${tabsId}-preview-tab`, hidden: tab !== "preview", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(VideoPreview, { project, sessionId, running }, project.id) }),
2137
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { role: "tabpanel", id: `${tabsId}-artifacts-panel`, "aria-labelledby": `${tabsId}-artifacts-tab`, hidden: tab !== "artifacts", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(VideoArtifacts, { project, sessionId }) })
1878
2138
  ] })
1879
2139
  ] });
1880
2140
  }
@@ -2579,62 +2839,14 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
2579
2839
  .oh-story-production-summary { color: var(--os-muted); white-space: nowrap; }
2580
2840
  .oh-story-production-notice { justify-content: space-between; margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); }
2581
2841
  .oh-story-production-notice button { border: 0; background: transparent; }
2582
- .oh-story-production-environment { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); font-size: 10px; }
2583
- /* Environment names such as MINIMAX_VIDEO_RESOLUTIONS and the temp-dir path are longer than the 500 px editor column; let them break rather than widen the view. */
2584
- .oh-story-production-environment > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
2585
- .oh-story-production-environment strong { color: var(--dsw-alias-label-secondary); font-size: 11px; }
2586
- .oh-story-production-environment span::before { content: "\u25CF"; margin-right: 4px; color: var(--video-danger, #d9534f); }
2587
- .oh-story-production-environment span[data-ready]::before { color: var(--dsw-alias-state-success-primary, #45b96f); }
2588
- .oh-story-production-environment span[data-pending]::before { color: var(--os-muted); }
2589
- .oh-story-production-environment em { flex-basis: 100%; font-style: normal; line-height: 1.5; }
2590
- .oh-story-production-environment code { font-size: 10px; overflow-wrap: anywhere; }
2591
- .oh-story-production-environment button { min-height: 24px; border: 1px solid var(--os-border); border-radius: 6px; padding: 0 8px; color: inherit; background: var(--dsw-alias-bg-base); cursor: pointer; font: inherit; }
2592
- .oh-story-production-diagnostics { margin: 8px 12px 0; padding: 7px 9px; border: 1px solid var(--dsw-alias-state-warn-label); border-radius: 7px; background: var(--dsw-specific-tip); }
2593
- .oh-story-production-diagnostics summary { color: var(--dsw-alias-state-warn-label); cursor: pointer; }
2594
- .oh-story-production-diagnostics ul { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
2595
- .oh-story-production-diagnostics li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px; color: var(--dsw-alias-label-secondary); }
2596
- .oh-story-production-diagnostics li[data-severity="error"] { color: var(--dsw-alias-state-error-primary); }
2597
- .oh-story-production-diagnostics li button { border: 0; padding: 0; color: inherit; background: transparent; text-align: left; }
2598
- .oh-story-production-diagnostics p { margin: 6px 0 0; color: var(--os-muted); }
2599
- .oh-story-production-actions { justify-content: flex-end; margin-bottom: 12px; }
2600
- .oh-story-production-actions button:last-child,
2601
- .oh-story-sequence-summary button { color: var(--dsw-alias-state-business-primary); border-color: var(--dsw-alias-state-business-primary); }
2602
- .oh-story-shot-board { padding: 16px 12px; }
2603
2842
  .oh-story-shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; gap: 12px; }
2604
2843
  .oh-story-shot-card,
2605
2844
  .oh-story-asset-card,
2606
2845
  .oh-story-task-board > article { min-width: 0; overflow: hidden; border: 1px solid var(--os-border); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }
2607
- .oh-story-shot-card { padding: 10px; cursor: default; transition: border-color .15s ease, background-color .15s ease; }
2608
- .oh-story-shot-card:hover { border-color: var(--dsw-alias-border-l2); }
2609
- .oh-story-shot-card { cursor: pointer; }
2610
2846
  .oh-story-shot-card:focus-visible,
2611
2847
  .oh-story-asset-card:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: 2px; }
2612
2848
  .oh-story-shot-card[data-selected],
2613
2849
  .oh-story-asset-card[data-selected] { border-color: var(--dsw-alias-state-business-primary); background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 4%, var(--dsw-alias-bg-layer-1)); }
2614
- .oh-story-shot-card > header,
2615
- .oh-story-task-board article > header { display: flex; min-height: 0; align-items: center; gap: 8px; padding: 0; border: 0; }
2616
- .oh-story-shot-card > header > button { overflow: hidden; min-width: 0; flex: 1; border: 0; padding: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
2617
- .oh-story-shot-card > header > span { color: var(--os-muted); font-variant-numeric: tabular-nums; }
2618
- .oh-story-shot-card h3,
2619
- .oh-story-asset-card h3 { margin: 7px 0 4px; font-size: 13px; font-weight: 600; }
2620
- .oh-story-shot-card > p,
2621
- .oh-story-asset-card > p,
2622
- .oh-story-task-board article > p { margin: 5px 0; color: var(--os-muted); }
2623
- .oh-story-shot-placeholder { display: grid; height: 132px; place-content: center; gap: 3px; margin-bottom: 8px; border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); text-align: center; }
2624
- .oh-story-shot-placeholder strong { color: var(--dsw-alias-label-secondary); font-size: 22px; font-variant-numeric: tabular-nums; }
2625
- .oh-story-shot-card dl { display: grid; grid-template-columns: 20px minmax(0, 1fr); margin: 7px 0; }
2626
- .oh-story-shot-card dt { color: var(--dsw-alias-state-business-primary); }
2627
- .oh-story-shot-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
2628
- .oh-story-shot-status,
2629
- .oh-story-reference-links,
2630
- .oh-story-card-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
2631
- .oh-story-shot-status span { padding: 1px 5px; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }
2632
- .oh-story-shot-status span[data-ready="true"] { color: var(--dsw-alias-state-business-primary); }
2633
- .oh-story-shot-status span > i { margin-right: 3px; font-style: normal; }
2634
- .oh-story-reference-links button { max-width: 100%; overflow: hidden; padding: 1px 5px; border: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-overflow: ellipsis; }
2635
- .oh-story-card-actions { padding-top: 8px; border-top: 1px solid var(--os-border); }
2636
- .oh-story-card-actions button { flex: 1; padding-block: 4px; }
2637
- .oh-story-card-actions button:last-child { color: var(--dsw-alias-state-business-primary); border-color: color-mix(in srgb, var(--dsw-alias-state-business-primary) 45%, var(--os-border)); }
2638
2850
  .oh-story-media-preview { display: block; width: 100%; height: 168px; border-radius: 7px; background: var(--dsw-alias-bg-base); object-fit: contain; }
2639
2851
  .oh-story-media-document { display: grid; min-height: 0; flex: 1; overflow: auto; place-items: center; padding: 24px; }
2640
2852
  .oh-story-media-document img,
@@ -2645,12 +2857,6 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
2645
2857
  .oh-story-version-strip > button[data-selected] { border-color: var(--dsw-alias-state-business-primary); }
2646
2858
  .oh-story-version-strip .oh-story-media-preview { height: 72px; }
2647
2859
  .oh-story-version-strip span { position: absolute; right: 3px; bottom: 3px; padding: 0 3px; border-radius: 3px; background: var(--dsw-alias-bg-base); font-size: 10px; }
2648
- .oh-story-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 16px 12px; }
2649
- .oh-story-asset-card { padding: 10px; }
2650
- .oh-story-asset-card > div:nth-child(2) > button { overflow: hidden; max-width: 100%; border: 0; padding: 0; color: var(--dsw-alias-state-business-primary); background: transparent; text-overflow: ellipsis; }
2651
- .oh-story-asset-card small { color: var(--os-muted); text-transform: uppercase; }
2652
- .oh-story-asset-placeholder { display: grid; height: 112px; place-items: center; border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); font-size: 28px; }
2653
- .oh-story-asset-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; }
2654
2860
  .oh-story-media-library { margin: 0 12px 14px; padding-top: 12px; border-top: 1px solid var(--os-border); }
2655
2861
  .oh-story-media-library > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
2656
2862
  .oh-story-media-library > header > div { display: flex; align-items: center; gap: 7px; }
@@ -2677,34 +2883,170 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
2677
2883
  .oh-story-task-board details p { max-height: 120px; overflow: auto; margin: 6px 0; padding: 8px; border-radius: 6px; background: var(--dsw-alias-bg-base); white-space: pre-wrap; }
2678
2884
  .oh-story-task-board footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-top: 8px; }
2679
2885
  .oh-story-projection-note { padding: 7px 10px; border: 1px solid var(--os-border); border-radius: 7px; color: var(--os-muted); background: var(--dsw-alias-bg-layer-1); }
2680
- .oh-story-task-board > .oh-story-projection-note { margin-bottom: 0; }
2681
- .oh-story-production-empty { padding: 48px 20px; color: var(--os-muted); text-align: center; }
2682
- .oh-story-production-empty strong { display: block; margin-bottom: 6px; color: var(--dsw-alias-text-1); font-size: 13px; }
2683
- .oh-story-production-empty p { margin: 0 auto; max-width: 44em; line-height: 1.6; }
2886
+ /* Shared rhythm for every production tab: 12px gutters, 10\u201312px radii, mono for IDs,
2887
+ one primary action per surface, status as quiet dots rather than red walls. */
2888
+ .oh-story-production { --os-mono: 10.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; --os-accent: var(--dsw-alias-state-business-primary); --os-accent-soft: color-mix(in srgb, var(--dsw-alias-state-business-primary) 9%, transparent); }
2889
+ .oh-story-production-tabs button:hover:not(:disabled) { color: var(--dsw-alias-label-primary); background: transparent; }
2890
+
2891
+ /* Status row: one pill per concern; the detail opens underneath on demand. */
2892
+ .oh-story-production-status { margin: 10px 12px 0; }
2893
+ .oh-story-status-pills { display: flex; flex-wrap: wrap; gap: 6px; }
2894
+ .oh-story-production .oh-story-status-pill { display: inline-flex; min-height: 26px; align-items: center; gap: 6px; padding: 0 10px 0 9px; border-radius: 999px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); white-space: nowrap; }
2895
+ .oh-story-production .oh-story-status-pill[aria-expanded="true"] { border-color: var(--dsw-alias-border-l2); color: var(--dsw-alias-label-primary); }
2896
+ .oh-story-status-pill > i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--os-muted); }
2897
+ .oh-story-status-pill[data-tone="ready"] > i { background: var(--dsw-alias-state-success-primary); }
2898
+ .oh-story-status-pill[data-tone="partial"] > i,
2899
+ .oh-story-status-pill[data-tone="warning"] > i { background: var(--dsw-alias-state-warn-label); }
2900
+ .oh-story-status-pill[data-tone="error"] > i { background: var(--dsw-alias-state-error-primary); }
2901
+ .oh-story-status-pill[data-tone="idle"] > i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--os-muted); }
2902
+ .oh-story-status-pill em { overflow: hidden; min-width: 0; color: var(--os-muted); font-style: normal; text-overflow: ellipsis; }
2903
+ .oh-story-production .oh-story-status-pill { max-width: 100%; overflow: hidden; }
2904
+ .oh-story-status-pill > b { width: 4px; height: 4px; margin-left: 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; opacity: .5; transform: translateY(-1px) rotate(45deg); transition: transform .15s ease; }
2905
+ .oh-story-status-pill[aria-expanded="true"] > b { transform: translateY(1px) rotate(-135deg); }
2906
+ .oh-story-status-panel { margin-top: 8px; padding: 8px 12px 10px; border: 1px solid var(--os-border); border-radius: 10px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-1); }
2907
+ .oh-story-provider-list { display: grid; margin: 0; padding: 0; list-style: none; }
2908
+ .oh-story-provider-list li { display: grid; grid-template-columns: 6px 30px minmax(84px, max-content) minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--os-border); }
2909
+ .oh-story-provider-list li:last-child { border-bottom: 0; }
2910
+ .oh-story-provider-list i { width: 6px; height: 6px; align-self: start; margin-top: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--os-muted); }
2911
+ .oh-story-provider-list li[data-ready] i { background: var(--dsw-alias-state-success-primary); box-shadow: none; }
2912
+ .oh-story-provider-list span { color: var(--os-muted); font-size: 11px; }
2913
+ .oh-story-provider-list strong { color: var(--dsw-alias-label-primary); font-weight: 500; white-space: nowrap; }
2914
+ .oh-story-provider-list small { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 4px; color: var(--os-muted); font-size: 11px; }
2915
+ .oh-story-provider-list li[data-ready] small { color: var(--dsw-alias-state-success-primary); }
2916
+ .oh-story-provider-list li[data-error] i { background: var(--dsw-alias-state-error-primary); box-shadow: none; }
2917
+ .oh-story-provider-list li[data-error] small { color: var(--dsw-alias-state-error-primary); }
2918
+ .oh-story-shot-card > .oh-story-media-preview,
2919
+ .oh-story-asset-media > .oh-story-media-preview { background: var(--dsw-alias-button-ghost-active-fill); }
2920
+ .oh-story-status-panel code { max-width: 100%; overflow: hidden; padding: 0 5px; border-radius: 4px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-button-ghost-active-fill); font: var(--os-mono); text-overflow: ellipsis; white-space: nowrap; }
2921
+ .oh-story-status-panel > p { margin: 8px 0 0; color: var(--os-muted); line-height: 1.6; }
2922
+ .oh-story-status-panel > footer { display: flex; min-width: 0; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--os-border); color: var(--os-muted); font-size: 11px; }
2923
+ .oh-story-status-panel > footer > span { flex: none; }
2924
+ .oh-story-status-panel > footer code { min-width: 0; flex: 1; }
2925
+ .oh-story-status-panel > footer button { flex: none; padding: 1px 8px; }
2926
+ .oh-story-production-diagnostics ul { display: grid; margin: 0; padding: 0; list-style: none; }
2927
+ .oh-story-production-diagnostics li { display: grid; grid-template-columns: minmax(92px, max-content) minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--os-border); }
2928
+ .oh-story-production-diagnostics li:last-child { border-bottom: 0; }
2929
+ .oh-story-production .oh-story-production-diagnostics li button { border: 0; padding: 0; color: var(--os-accent); background: transparent; font: var(--os-mono); text-align: left; white-space: nowrap; }
2930
+ .oh-story-production-diagnostics li button span { color: var(--os-muted); }
2931
+ .oh-story-production-diagnostics li[data-severity="error"] > span { color: var(--dsw-alias-state-error-primary); }
2932
+ .oh-story-production-diagnostics p { margin: 6px 0 0; color: var(--os-muted); }
2933
+
2934
+ /* Shot board */
2935
+ .oh-story-shot-board { padding: 12px; }
2936
+ .oh-story-production-actions { justify-content: flex-end; gap: 6px; margin-bottom: 10px; }
2937
+ .oh-story-production .oh-story-production-actions button:last-child { border-color: color-mix(in srgb, var(--os-accent) 40%, var(--os-border)); color: var(--os-accent); background: var(--os-accent-soft); }
2938
+ .oh-story-shot-card { padding: 8px 8px 10px; border-radius: 12px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
2939
+ .oh-story-shot-card:hover { border-color: var(--dsw-alias-border-l2); box-shadow: 0 2px 10px rgb(0 0 0 / 5%); }
2940
+ .oh-story-shot-card > .oh-story-media-preview,
2941
+ .oh-story-shot-placeholder { height: 156px; border-radius: 8px; }
2942
+ .oh-story-shot-placeholder { display: grid; box-sizing: border-box; place-content: center; gap: 2px; border: 1px dashed var(--os-border); color: var(--os-muted); background: repeating-linear-gradient(135deg, transparent 0 9px, color-mix(in srgb, var(--os-border) 35%, transparent) 9px 10px); text-align: center; }
2943
+ .oh-story-shot-placeholder strong { color: var(--dsw-alias-label-secondary); font: 600 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
2944
+ .oh-story-shot-placeholder span { font-size: 11px; }
2945
+ .oh-story-shot-card > header,
2946
+ .oh-story-task-board article > header { display: flex; min-height: 0; align-items: center; gap: 8px; padding: 0; border: 0; }
2947
+ .oh-story-shot-card > header { margin: 9px 2px 0; }
2948
+ .oh-story-production .oh-story-shot-card > header > button { overflow: hidden; min-width: 0; flex: 1; border: 0; padding: 0; color: var(--os-muted); background: transparent; font: var(--os-mono); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
2949
+ .oh-story-production .oh-story-shot-card > header > button:hover { color: var(--os-accent); background: transparent; }
2950
+ .oh-story-shot-card > header > span { padding: 0 6px; border-radius: 999px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-button-ghost-active-fill); font: var(--os-mono); }
2951
+ .oh-story-shot-card h3,
2952
+ .oh-story-asset-card h3 { margin: 4px 2px 2px; color: var(--dsw-alias-label-primary); font-size: 13.5px; font-weight: 600; line-height: 1.4; }
2953
+ .oh-story-shot-card > p,
2954
+ .oh-story-task-board article > p { margin: 0 2px; color: var(--os-muted); }
2955
+ .oh-story-shot-card dl { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px 6px; margin: 8px 2px; }
2956
+ .oh-story-shot-card dt { width: 16px; height: 16px; margin-top: 1px; border-radius: 4px; color: var(--os-accent); background: var(--os-accent-soft); font-size: 10px; line-height: 16px; text-align: center; }
2957
+ .oh-story-shot-card dd { min-width: 0; margin: 0; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }
2958
+ .oh-story-shot-status,
2959
+ .oh-story-reference-links { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 2px 0; }
2960
+ .oh-story-shot-status span { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: 999px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); font-size: 11px; line-height: 20px; }
2961
+ .oh-story-shot-status span[data-ready="true"] { color: var(--dsw-alias-state-success-primary); background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent); }
2962
+ .oh-story-shot-status span > i { font-size: 10px; font-style: normal; }
2963
+ .oh-story-shot-status > span:last-child:not([data-ready]) { margin-left: auto; padding: 0; background: transparent; font-variant-numeric: tabular-nums; }
2964
+ .oh-story-production .oh-story-reference-links button { max-width: 100%; overflow: hidden; padding: 0 6px; border-color: var(--os-border); border-radius: 5px; color: var(--dsw-alias-label-secondary); background: transparent; font: var(--os-mono); line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
2965
+ .oh-story-production .oh-story-reference-links button:hover:not(:disabled) { border-color: var(--os-accent); color: var(--os-accent); background: var(--os-accent-soft); }
2966
+ .oh-story-card-actions { display: flex; gap: 6px; margin: 10px 2px 0; padding-top: 10px; border-top: 1px solid var(--os-border); }
2967
+ .oh-story-card-actions button { min-width: 0; flex: 1; padding-block: 5px; }
2968
+ .oh-story-production .oh-story-card-actions button:last-child { border-color: color-mix(in srgb, var(--os-accent) 40%, var(--os-border)); color: var(--os-accent); background: var(--os-accent-soft); }
2969
+
2970
+ /* Asset board */
2971
+ .oh-story-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 12px; }
2972
+ .oh-story-asset-card { display: flex; flex-direction: column; padding: 8px 8px 10px; border-radius: 12px; }
2973
+ .oh-story-asset-media { position: relative; }
2974
+ .oh-story-asset-media > .oh-story-media-preview,
2975
+ .oh-story-asset-placeholder { height: 136px; border-radius: 8px; }
2976
+ .oh-story-asset-placeholder { display: grid; place-items: center; color: color-mix(in srgb, var(--os-accent) 55%, var(--os-muted)); background: linear-gradient(160deg, var(--os-accent-soft), var(--dsw-alias-button-ghost-active-fill)); font-size: 34px; font-weight: 300; }
2977
+ .oh-story-asset-media[data-kind="scene"] .oh-story-asset-placeholder { color: color-mix(in srgb, var(--dsw-alias-state-success-primary) 60%, var(--os-muted)); background: linear-gradient(160deg, color-mix(in srgb, var(--dsw-alias-state-success-primary) 9%, transparent), var(--dsw-alias-button-ghost-active-fill)); }
2978
+ .oh-story-asset-media[data-kind="prop"] .oh-story-asset-placeholder { color: color-mix(in srgb, var(--dsw-alias-state-warn-label) 65%, var(--os-muted)); background: linear-gradient(160deg, color-mix(in srgb, var(--dsw-alias-state-warn-label) 9%, transparent), var(--dsw-alias-button-ghost-active-fill)); }
2979
+ .oh-story-asset-media > small { position: absolute; top: 8px; left: 8px; padding: 0 8px; border: 1px solid var(--os-border); border-radius: 999px; color: var(--dsw-alias-label-secondary); background: color-mix(in srgb, var(--dsw-alias-bg-base) 86%, transparent); backdrop-filter: blur(6px); font-size: 10.5px; line-height: 18px; }
2980
+ .oh-story-asset-head { display: flex; min-width: 0; flex-direction: column; margin-top: 9px; }
2981
+ .oh-story-asset-head h3 { margin-top: 0; }
2982
+ .oh-story-production .oh-story-asset-head > button { overflow: hidden; max-width: 100%; align-self: flex-start; margin-left: 2px; border: 0; padding: 0; color: var(--os-muted); background: transparent; font: var(--os-mono); text-overflow: ellipsis; white-space: nowrap; }
2983
+ .oh-story-production .oh-story-asset-head > button:hover { color: var(--os-accent); background: transparent; }
2984
+ .oh-story-asset-description { display: -webkit-box; overflow: hidden; margin: 6px 2px 0; color: var(--os-muted); font-size: 11.5px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
2985
+ .oh-story-asset-card > .oh-story-card-actions { margin-top: auto; }
2986
+ .oh-story-asset-card > .oh-story-asset-description + .oh-story-card-actions { margin-top: 10px; }
2987
+
2988
+ /* Task board */
2989
+ .oh-story-board-hint { margin: 0; color: var(--os-muted); font-size: 11.5px; line-height: 1.6; }
2990
+ .oh-story-production-empty { margin: 4px 0; padding: 36px 20px; border: 1px dashed var(--os-border); border-radius: 12px; color: var(--os-muted); text-align: center; }
2991
+ .oh-story-production-empty strong { display: block; margin-bottom: 4px; color: var(--dsw-alias-label-primary); font-size: 13px; font-weight: 600; }
2992
+ .oh-story-production-empty p { max-width: 36em; margin: 0 auto; line-height: 1.6; }
2684
2993
  .oh-story-production-empty button { margin-top: 12px; }
2994
+ .oh-story-shot-board > .oh-story-production-empty,
2995
+ .oh-story-assets > .oh-story-production-empty,
2996
+ .oh-story-canvas-shell > .oh-story-production-empty { margin: 12px; }
2997
+
2998
+ /* Final-cut sequence */
2685
2999
  .oh-story-sequence { padding: 12px; }
2686
- .oh-story-sequence-summary { justify-content: space-between; margin-bottom: 10px; }
3000
+ .oh-story-sequence-summary { flex-wrap: wrap; margin-bottom: 10px; }
3001
+ .oh-story-sequence-summary strong { color: var(--dsw-alias-label-primary); font-size: 13px; }
2687
3002
  .oh-story-sequence-summary span { margin-left: auto; color: var(--os-muted); }
2688
- .oh-story-sequence-issues { margin: 0 0 10px; padding: 8px 8px 8px 28px; border-radius: 7px; color: var(--dsw-alias-state-warn-label); background: var(--dsw-specific-tip); }
2689
- .oh-story-sequence-issues li + li { margin-top: 2px; }
3003
+ .oh-story-production .oh-story-sequence-summary button { border-color: transparent; color: #fff; background: var(--os-accent); }
3004
+ .oh-story-production .oh-story-sequence-summary button:hover:not(:disabled) { background: color-mix(in srgb, var(--os-accent) 88%, #000); }
3005
+ .oh-story-sequence-issues { margin: 0 0 10px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--dsw-alias-state-warn-label) 35%, var(--os-border)); border-radius: 10px; color: var(--dsw-alias-label-secondary); background: var(--dsw-specific-tip); list-style: none; }
3006
+ .oh-story-sequence-issues li { position: relative; padding-left: 14px; line-height: 1.7; }
3007
+ .oh-story-sequence-issues li::before { position: absolute; top: .72em; left: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--dsw-alias-state-warn-label); content: ""; }
2690
3008
  .oh-story-sequence ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
2691
- .oh-story-sequence > ol > li { display: grid; min-height: 70px; grid-template-columns: 28px 96px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }
2692
- .oh-story-sequence > ol > li > span { color: var(--os-muted); font-variant-numeric: tabular-nums; }
3009
+ .oh-story-sequence > ol > li { display: grid; min-height: 60px; grid-template-columns: 22px 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--os-border); border-radius: 10px; background: var(--dsw-alias-bg-layer-1); }
3010
+ .oh-story-sequence > ol > li > span { color: var(--os-muted); font: var(--os-mono); text-align: right; }
2693
3011
  .oh-story-sequence > ol > li .oh-story-media-preview,
2694
- .oh-story-sequence-missing { width: 96px; height: 54px; }
2695
- .oh-story-sequence-missing { display: grid; place-items: center; border-radius: 5px; color: var(--os-muted); background: var(--dsw-alias-button-ghost-active-fill); }
2696
- .oh-story-sequence > ol > li > div:last-child { display: flex; gap: 3px; }
2697
- .oh-story-canvas-shell { position: relative; display: flex; height: max(580px, calc(100% - 84px)); min-height: 580px; flex-direction: column; overflow: hidden; }
2698
- .oh-story-canvas-shell > .oh-story-projection-note { z-index: 3; flex: none; margin: 8px 168px 8px 8px; }
2699
- .oh-story-canvas-controls { position: absolute; z-index: 4; top: 8px; right: 8px; display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-base); }
2700
- .oh-story-canvas-controls span { min-width: 44px; color: var(--os-muted); text-align: center; }
2701
- .oh-story-canvas-viewport { width: 100%; min-height: 0; flex: 1; overflow: auto; background-color: var(--dsw-alias-bg-base); background-image: radial-gradient(var(--os-border) 1px, transparent 1px); background-size: 20px 20px; }
2702
- .oh-story-canvas { position: relative; width: 1800px; height: 1800px; transform-origin: 0 0; }
2703
- .oh-story-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
2704
- .oh-story-canvas path { fill: none; opacity: .35; stroke: var(--dsw-alias-border-l2); stroke-width: 1.5; }
2705
- .oh-story-canvas path[data-active] { opacity: .8; stroke: var(--dsw-alias-state-business-primary); }
3012
+ .oh-story-sequence-missing { width: 64px; height: 48px; border-radius: 6px; }
3013
+ .oh-story-sequence > ol > li .oh-story-media-preview { object-fit: cover; }
3014
+ .oh-story-sequence-missing { display: grid; box-sizing: border-box; place-items: center; border: 1px dashed color-mix(in srgb, var(--dsw-alias-state-warn-label) 50%, var(--os-border)); color: var(--dsw-alias-state-warn-label); font-size: 10.5px; }
3015
+ .oh-story-sequence-main { display: grid; min-width: 0; gap: 4px; }
3016
+ .oh-story-sequence-main strong { overflow: hidden; color: var(--dsw-alias-label-primary); font: 500 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
3017
+ .oh-story-sequence-main select { width: 100%; min-width: 0; padding-block: 3px; }
3018
+ .oh-story-sequence-move { display: grid; gap: 3px; }
3019
+ .oh-story-production .oh-story-sequence-move button { width: 26px; height: 22px; padding: 0; line-height: 1; }
3020
+ /* Project media library: same card language as the asset board. */
3021
+ .oh-story-media-library { margin: 4px 12px 16px; padding-top: 14px; }
3022
+ .oh-story-media-library > header strong { color: var(--dsw-alias-label-primary); font-size: 13px; }
3023
+ .oh-story-media-library > .oh-story-projection-note { padding: 0; border: 0; background: transparent; font-size: 11.5px; line-height: 1.6; }
3024
+ .oh-story-media-library-grid > article { gap: 4px; padding: 8px; border-radius: 12px; }
3025
+ .oh-story-media-library-grid .oh-story-media-preview { border-radius: 8px; background: var(--dsw-alias-button-ghost-active-fill); }
3026
+ .oh-story-media-library-grid > article > strong { margin-top: 4px; overflow: hidden; color: var(--dsw-alias-label-primary); font: 500 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
3027
+ .oh-story-media-library-grid > article > span { font: var(--os-mono); font-size: 10px; }
3028
+ .oh-story-media-library-grid footer { margin-top: 6px; }
3029
+ .oh-story-production:has(> .oh-story-canvas-shell) { display: flex; flex-direction: column; }
3030
+ .oh-story-production:has(> .oh-story-canvas-shell) > :not(.oh-story-canvas-shell) { flex: none; }
3031
+ .oh-story-canvas-shell { position: relative; display: flex; min-height: 420px; flex: 1 0 420px; flex-direction: column; overflow: hidden; }
3032
+ .oh-story-canvas-toolbar { display: flex; flex: none; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--os-border); }
3033
+ .oh-story-canvas-help { overflow: hidden; min-width: 0; flex: 1; color: var(--os-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
3034
+ .oh-story-canvas-controls { display: flex; flex: none; align-items: center; overflow: hidden; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); }
3035
+ .oh-story-production .oh-story-canvas-controls button { min-width: 28px; height: 26px; border: 0; border-radius: 0; padding: 0 8px; background: transparent; }
3036
+ .oh-story-production .oh-story-canvas-controls button + button,
3037
+ .oh-story-production .oh-story-canvas-controls span + button { border-left: 1px solid var(--os-border); }
3038
+ .oh-story-canvas-controls span { min-width: 44px; border-left: 1px solid var(--os-border); color: var(--dsw-alias-label-secondary); font: var(--os-mono); line-height: 26px; text-align: center; font-variant-numeric: tabular-nums; }
3039
+ .oh-story-canvas-viewport { position: relative; width: 100%; min-height: 0; flex: 1; overflow: hidden; cursor: grab; touch-action: none; overscroll-behavior: contain; background-color: var(--dsw-alias-bg-base); background-image: radial-gradient(var(--os-border) 1px, transparent 1px); background-size: 20px 20px; }
3040
+ .oh-story-canvas-viewport[data-panning] { cursor: grabbing; }
3041
+ .oh-story-canvas-viewport:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }
3042
+ .oh-story-canvas { position: absolute; top: 0; left: 0; width: 0; height: 0; overflow: visible; transform-origin: 0 0; }
3043
+ .oh-story-canvas svg { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
3044
+ .oh-story-canvas path { fill: none; opacity: .6; stroke: var(--dsw-alias-border-l2); stroke-width: 1.5; }
3045
+ .oh-story-canvas path[data-active] { opacity: .9; stroke-width: 2.5; stroke: var(--dsw-alias-state-business-primary); }
2706
3046
  .oh-story-canvas article { position: absolute; display: flex; width: 180px; min-height: 76px; box-sizing: border-box; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--dsw-alias-bg-layer-1); box-shadow: 0 4px 14px rgb(0 0 0 / 8%); cursor: grab; user-select: none; touch-action: none; }
2707
- .oh-story-canvas article:active { cursor: grabbing; }
3047
+ .oh-story-canvas article:active,
3048
+ .oh-story-canvas article[data-dragging] { z-index: 2; cursor: grabbing; }
3049
+ .oh-story-canvas article[data-selected] { z-index: 1; }
2708
3050
  .oh-story-canvas article[data-node-type="shot"] { border-color: var(--dsw-alias-state-business-primary); }
2709
3051
  .oh-story-canvas article[data-selected] { box-shadow: 0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-business-primary) 28%, transparent), 0 4px 14px rgb(0 0 0 / 8%); }
2710
3052
  .oh-story-canvas article small { color: var(--os-muted); text-transform: uppercase; }
@@ -2871,15 +3213,24 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
2871
3213
  [data-oh-story-layout="compact"] .oh-story-media-library > header { align-items: stretch; flex-direction: column; }
2872
3214
  [data-oh-story-layout="compact"] .oh-story-media-library > header > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
2873
3215
  [data-oh-story-layout="compact"] .oh-story-media-library input { width: 100%; }
3216
+ [data-oh-story-layout="compact"] .oh-story-canvas-toolbar { flex-wrap: wrap; }
3217
+ [data-oh-story-layout="compact"] .oh-story-canvas-help { flex-basis: 100%; white-space: normal; }
3218
+ [data-oh-story-layout="compact"] .oh-story-canvas-controls { max-width: 100%; flex-wrap: wrap; }
3219
+ [data-oh-story-layout="compact"] .oh-story-production .oh-story-canvas-controls button { flex: 1; }
2874
3220
  [data-oh-story-layout="compact"] .oh-story-sequence { padding-inline: 6px; }
2875
- [data-oh-story-layout="compact"] .oh-story-sequence-summary { flex-wrap: wrap; }
2876
3221
  [data-oh-story-layout="compact"] .oh-story-sequence-summary span { display: none; }
2877
- [data-oh-story-layout="compact"] .oh-story-sequence > ol > li { grid-template-columns: 24px 64px minmax(0, 1fr); gap: 5px; }
3222
+ [data-oh-story-layout="compact"] .oh-story-sequence > ol > li { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px; padding: 6px; }
3223
+ [data-oh-story-layout="compact"] .oh-story-sequence > ol > li > span { display: none; }
2878
3224
  [data-oh-story-layout="compact"] .oh-story-sequence > ol > li .oh-story-media-preview,
2879
- [data-oh-story-layout="compact"] .oh-story-sequence-missing { width: 64px; height: 40px; }
2880
- [data-oh-story-layout="compact"] .oh-story-sequence > ol > li > div:last-child { grid-column: 2 / 4; justify-content: flex-end; }
2881
- [data-oh-story-layout="compact"] .oh-story-canvas-shell > .oh-story-projection-note { overflow: hidden; max-height: 48px; margin: 8px; }
2882
- [data-oh-story-layout="compact"] .oh-story-canvas-controls { position: static; flex: none; align-self: flex-end; margin: 0 8px 8px; }
3225
+ [data-oh-story-layout="compact"] .oh-story-sequence-missing { width: 44px; height: 44px; }
3226
+ [data-oh-story-layout="compact"] .oh-story-sequence-main { display: contents; }
3227
+ [data-oh-story-layout="compact"] .oh-story-sequence-main select { grid-column: 1 / -1; grid-row: 2; }
3228
+ [data-oh-story-layout="compact"] .oh-story-sequence-move { grid-row: 1; grid-column: 3; }
3229
+ [data-oh-story-layout="compact"] .oh-story-provider-list li { grid-template-columns: 6px minmax(0, 1fr); }
3230
+ [data-oh-story-layout="compact"] .oh-story-provider-list li > span { display: none; }
3231
+ [data-oh-story-layout="compact"] .oh-story-provider-list li > small { grid-column: 2; }
3232
+ [data-oh-story-layout="compact"] .oh-story-production-diagnostics li { grid-template-columns: minmax(0, 1fr); gap: 0; }
3233
+ [data-oh-story-layout="compact"] .oh-story-status-panel > footer { flex-wrap: wrap; }
2883
3234
 
2884
3235
  /* Video mode intentionally stays a preview surface: one player, a read-only artifact view,
2885
3236
  and the official DSH Conversation. It shares no nonlinear-editor or timeline runtime. */
@@ -3069,7 +3420,7 @@ var plugin_default = `.oh-story-bridge-marker { display: none; }
3069
3420
  `;
3070
3421
 
3071
3422
  // src/client/index.tsx
3072
- var import_jsx_runtime5 = require("react/jsx-runtime"), name = "oh-story", inject = ["slots", "sessions", "conversation"];
3423
+ var import_jsx_runtime6 = require("react/jsx-runtime"), name = "oh-story", inject = ["slots", "sessions", "conversation"];
3073
3424
  function applyUpdate(current, update) {
3074
3425
  return typeof update == "function" ? update(current) : update;
3075
3426
  }
@@ -3096,7 +3447,7 @@ function createWorkbenchStore() {
3096
3447
  productionReferences: {},
3097
3448
  productionSequence: {},
3098
3449
  productionCanvas: {},
3099
- productionZoom: {},
3450
+ productionViewport: {},
3100
3451
  productionIntentCalls: {},
3101
3452
  settledMutation: void 0,
3102
3453
  hydrated: !1
@@ -3165,8 +3516,8 @@ function createWorkbenchStore() {
3165
3516
  setProductionCanvas: (draft, update) => {
3166
3517
  draft.productionCanvas = applyUpdate(draft.productionCanvas, update);
3167
3518
  },
3168
- setProductionZoom: (draft, update) => {
3169
- draft.productionZoom = applyUpdate(draft.productionZoom, update);
3519
+ setProductionViewport: (draft, update) => {
3520
+ draft.productionViewport = applyUpdate(draft.productionViewport, update);
3170
3521
  },
3171
3522
  setProductionIntentCalls: (draft, update) => {
3172
3523
  draft.productionIntentCalls = applyUpdate(draft.productionIntentCalls, update);
@@ -3203,8 +3554,8 @@ function FileTreeNodes({
3203
3554
  onToggle,
3204
3555
  onSelect
3205
3556
  }) {
3206
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: nodes.map((node) => {
3207
- if (node.kind === "file") return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3557
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: nodes.map((node) => {
3558
+ if (node.kind === "file") return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3208
3559
  "button",
3209
3560
  {
3210
3561
  type: "button",
@@ -3222,14 +3573,14 @@ function FileTreeNodes({
3222
3573
  node.path
3223
3574
  );
3224
3575
  let open = selected?.startsWith(`${node.path}/`) === !0 || expanded[node.path] === !0;
3225
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "oh-story-file-folder", open, onToggle: (event) => {
3576
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "oh-story-file-folder", open, onToggle: (event) => {
3226
3577
  onToggle(node.path, event.currentTarget.open);
3227
3578
  }, children: [
3228
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { style: { "--oh-story-indent": `${String(depth * 14)}px` }, title: node.path, children: [
3579
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { style: { "--oh-story-indent": `${String(depth * 14)}px` }, title: node.path, children: [
3229
3580
  node.name,
3230
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: node.fileCount })
3581
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: node.fileCount })
3231
3582
  ] }),
3232
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3583
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3233
3584
  FileTreeNodes,
3234
3585
  {
3235
3586
  nodes: node.children,
@@ -3245,10 +3596,10 @@ function FileTreeNodes({
3245
3596
  }) });
3246
3597
  }
3247
3598
  function useWorkspace(sessionId) {
3248
- let [version, setVersion] = (0, import_react3.useState)(0), [workspace, setWorkspace] = (0, import_react3.useState)(), [error, setError] = (0, import_react3.useState)(), [loading, setLoading] = (0, import_react3.useState)(!0), reload = (0, import_react3.useCallback)(() => {
3599
+ let [version, setVersion] = (0, import_react4.useState)(0), [workspace, setWorkspace] = (0, import_react4.useState)(), [error, setError] = (0, import_react4.useState)(), [loading, setLoading] = (0, import_react4.useState)(!0), reload = (0, import_react4.useCallback)(() => {
3249
3600
  setLoading(!0), setVersion((value) => value + 1);
3250
3601
  }, []);
3251
- return (0, import_react3.useEffect)(() => {
3602
+ return (0, import_react4.useEffect)(() => {
3252
3603
  let controller = new AbortController();
3253
3604
  return setError(void 0), fetch(endpoint("workspace", sessionId), { signal: controller.signal }).then((response) => json(response)).then(setWorkspace).catch((reason) => {
3254
3605
  controller.signal.aborted || setError(reason instanceof Error ? reason.message : String(reason));
@@ -3264,10 +3615,10 @@ function isolatedPreviewUrl(path, version, revision) {
3264
3615
  return url.hostname === "127.0.0.1" ? url.hostname = "localhost" : url.hostname === "localhost" && (url.hostname = "127.0.0.1"), url.searchParams.set("build", version), url.searchParams.set("reload", String(revision)), { href: url.toString(), isolated: url.origin !== globalThis.location.origin };
3265
3616
  }
3266
3617
  function PreviewProbe({ href, onFailed }) {
3267
- let failedRef = (0, import_react3.useRef)(onFailed);
3268
- return (0, import_react3.useEffect)(() => {
3618
+ let failedRef = (0, import_react4.useRef)(onFailed);
3619
+ return (0, import_react4.useEffect)(() => {
3269
3620
  failedRef.current = onFailed;
3270
- }, [onFailed]), (0, import_react3.useEffect)(() => {
3621
+ }, [onFailed]), (0, import_react4.useEffect)(() => {
3271
3622
  let controller = new AbortController();
3272
3623
  return fetch(href, { signal: controller.signal }).then((response) => {
3273
3624
  if (controller.signal.aborted) return;
@@ -3281,8 +3632,8 @@ function PreviewProbe({ href, onFailed }) {
3281
3632
  }, [href]), null;
3282
3633
  }
3283
3634
  function GamePreview({ project, building }) {
3284
- let shellRef = (0, import_react3.useRef)(null), fullscreenButtonRef = (0, import_react3.useRef)(null), restoreFullscreenFocus = (0, import_react3.useRef)(!1), [focused, setFocused] = (0, import_react3.useState)(!1), [loaded, setLoaded] = (0, import_react3.useState)(!1), [loadError, setLoadError] = (0, import_react3.useState)(!1), [revision, setRevision] = (0, import_react3.useState)(0), [loadedVersion, setLoadedVersion] = (0, import_react3.useState)(project.previewVersion);
3285
- if ((0, import_react3.useEffect)(() => {
3635
+ let shellRef = (0, import_react4.useRef)(null), fullscreenButtonRef = (0, import_react4.useRef)(null), restoreFullscreenFocus = (0, import_react4.useRef)(!1), [focused, setFocused] = (0, import_react4.useState)(!1), [loaded, setLoaded] = (0, import_react4.useState)(!1), [loadError, setLoadError] = (0, import_react4.useState)(!1), [revision, setRevision] = (0, import_react4.useState)(0), [loadedVersion, setLoadedVersion] = (0, import_react4.useState)(project.previewVersion);
3636
+ if ((0, import_react4.useEffect)(() => {
3286
3637
  let document = shellRef.current?.ownerDocument;
3287
3638
  if (document === void 0) return;
3288
3639
  let restore = () => {
@@ -3291,19 +3642,19 @@ function GamePreview({ project, building }) {
3291
3642
  return document.addEventListener("fullscreenchange", restore), () => {
3292
3643
  document.removeEventListener("fullscreenchange", restore);
3293
3644
  };
3294
- }, []), !project.previewReady || project.previewUrl === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-preview-empty", children: [
3295
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u25EB" }),
3296
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u53EF\u8BD5\u73A9\u7248\u672C" }),
3297
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
3645
+ }, []), !project.previewReady || project.previewUrl === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-preview-empty", children: [
3646
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": !0, children: "\u25EB" }),
3647
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "\u8FD8\u6CA1\u6709\u53EF\u8BD5\u73A9\u7248\u672C" }),
3648
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { children: [
3298
3649
  "\u5728\u53F3\u4FA7 Chat \u4F7F\u7528 ",
3299
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/novel-to-game quick" }),
3650
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/novel-to-game quick" }),
3300
3651
  "\uFF0C\u4EA7\u7269\u5199\u5165 ",
3301
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "game-adaptations/<project>/build/app/" }),
3652
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "game-adaptations/<project>/build/app/" }),
3302
3653
  " \u540E\u4F1A\u81EA\u52A8\u51FA\u73B0\u5728\u8FD9\u91CC\u3002"
3303
3654
  ] }),
3304
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-prompt-example", children: [
3305
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u63CF\u8FF0\u793A\u4F8B" }),
3306
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("q", { children: "\u628A\u300A\u4F5C\u54C1\u540D\u300B\u6539\u7F16\u6210\u7F51\u9875\u4E92\u52A8\u6E38\u620F\uFF0C\u76EE\u6807\u73A9\u5BB6\u662F\u2026\u2026\uFF0C\u6838\u5FC3\u73A9\u6CD5\u662F\u2026\u2026\uFF0C\u5E0C\u671B\u6574\u4F53\u98CE\u683C\u2026\u2026" })
3655
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-prompt-example", children: [
3656
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u63CF\u8FF0\u793A\u4F8B" }),
3657
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("q", { children: "\u628A\u300A\u4F5C\u54C1\u540D\u300B\u6539\u7F16\u6210\u7F51\u9875\u4E92\u52A8\u6E38\u620F\uFF0C\u76EE\u6807\u73A9\u5BB6\u662F\u2026\u2026\uFF0C\u6838\u5FC3\u73A9\u6CD5\u662F\u2026\u2026\uFF0C\u5E0C\u671B\u6574\u4F53\u98CE\u683C\u2026\u2026" })
3307
3658
  ] })
3308
3659
  ] });
3309
3660
  let preview = isolatedPreviewUrl(project.previewUrl, loadedVersion, revision), pending = project.previewVersion !== loadedVersion, reload = () => {
@@ -3311,19 +3662,19 @@ function GamePreview({ project, building }) {
3311
3662
  }, refresh = () => {
3312
3663
  setLoaded(!1), setLoadError(!1), setRevision((value) => value + 1);
3313
3664
  }, runtimeState = loadError ? "\u9884\u89C8\u8F7D\u5165\u5931\u8D25 \xB7 \u53EF\u91CD\u65B0\u8F7D\u5165" : building ? "Agent \u6B63\u5728\u66F4\u65B0\u6E38\u620F\u6587\u4EF6 \xB7 \u5F53\u524D\u9884\u89C8\u4FDD\u6301\u4E0D\u53D8" : pending ? "\u65B0\u7248\u672C\u5DF2\u5C31\u7EEA \xB7 \u7531\u4F60\u51B3\u5B9A\u4F55\u65F6\u8F7D\u5165" : loaded ? preview.isolated ? "\u9884\u89C8\u5DF2\u8F7D\u5165" : "\u9884\u89C8\u5DF2\u8F7D\u5165 \xB7 \u5F53\u524D\u90E8\u7F72\u65E0\u6CD5\u9694\u79BB\u6765\u6E90\uFF0C\u5B58\u6863\u529F\u80FD\u4E0D\u53EF\u7528" : "\u6B63\u5728\u8F7D\u5165\u9884\u89C8\u2026";
3314
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: shellRef, className: "oh-game-preview-shell", "data-state": loadError ? "error" : building ? "building" : loaded ? "ready" : "loading", children: [
3315
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-preview-status", children: [
3316
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-game-runtime-state", role: "status", "aria-live": "polite", title: runtimeState, children: [
3317
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { "aria-hidden": !0 }),
3318
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: runtimeState })
3665
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: shellRef, className: "oh-game-preview-shell", "data-state": loadError ? "error" : building ? "building" : loaded ? "ready" : "loading", children: [
3666
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-preview-status", children: [
3667
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "oh-game-runtime-state", role: "status", "aria-live": "polite", title: runtimeState, children: [
3668
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", { "aria-hidden": !0 }),
3669
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { children: runtimeState })
3319
3670
  ] }),
3320
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
3321
- pending && !building && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: reload, children: "\u8F7D\u5165\u65B0\u7248\u672C" }),
3322
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { className: "oh-game-reload", type: "button", onClick: refresh, "aria-label": "\u91CD\u65B0\u8F7D\u5165\u6E38\u620F", children: [
3323
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u21BB" }),
3324
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: "\u5237\u65B0" })
3671
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
3672
+ pending && !building && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: reload, children: "\u8F7D\u5165\u65B0\u7248\u672C" }),
3673
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { className: "oh-game-reload", type: "button", onClick: refresh, "aria-label": "\u91CD\u65B0\u8F7D\u5165\u6E38\u620F", children: [
3674
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": !0, children: "\u21BB" }),
3675
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u5237\u65B0" })
3325
3676
  ] }),
3326
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { ref: fullscreenButtonRef, type: "button", onClick: () => {
3677
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { ref: fullscreenButtonRef, type: "button", onClick: () => {
3327
3678
  let shell = shellRef.current;
3328
3679
  shell !== null && (restoreFullscreenFocus.current = !0, shell.requestFullscreen().catch(() => {
3329
3680
  restoreFullscreenFocus.current = !1;
@@ -3331,10 +3682,10 @@ function GamePreview({ project, building }) {
3331
3682
  }, children: "\u5168\u5C4F\u8BD5\u73A9" })
3332
3683
  ] })
3333
3684
  ] }),
3334
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PreviewProbe, { href: preview.href, onFailed: () => {
3685
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PreviewProbe, { href: preview.href, onFailed: () => {
3335
3686
  setLoaded(!1), setLoadError(!0);
3336
3687
  } }),
3337
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3688
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3338
3689
  "iframe",
3339
3690
  {
3340
3691
  src: preview.href,
@@ -3358,7 +3709,7 @@ function GamePreview({ project, building }) {
3358
3709
  },
3359
3710
  `${project.id}:${loadedVersion}:${String(revision)}`
3360
3711
  ),
3361
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-focus-hint", "data-focused": focused || void 0, children: focused ? "\u6E38\u620F\u6B63\u5728\u63A5\u6536\u952E\u9F20\u8F93\u5165" : "\u70B9\u51FB\u753B\u9762\u8FDB\u5165\u8BD5\u73A9" })
3712
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-focus-hint", "data-focused": focused || void 0, children: focused ? "\u6E38\u620F\u6B63\u5728\u63A5\u6536\u952E\u9F20\u8F93\u5165" : "\u70B9\u51FB\u753B\u9762\u8FDB\u5165\u8BD5\u73A9" })
3362
3713
  ] });
3363
3714
  }
3364
3715
  function GameDesign({
@@ -3368,10 +3719,10 @@ function GameDesign({
3368
3719
  sessionId,
3369
3720
  onSelect
3370
3721
  }) {
3371
- let documents = (0, import_react3.useMemo)(() => files.filter((file) => file.path.startsWith(`${project.root}/`) && /\.(?:md|txt|json|jsonl|html|css|[cm]?js|tsx?|jsx)$/iu.test(file.path)), [files, project.root]), preferred = selected !== void 0 && documents.some((file) => file.path === selected) ? selected : documents.find((file) => file.path === `${project.root}/PRODUCT_BRIEF.md`)?.path ?? documents[0]?.path, [path, setPath] = (0, import_react3.useState)(preferred), [content, setContent] = (0, import_react3.useState)(), [error, setError] = (0, import_react3.useState)();
3372
- if ((0, import_react3.useEffect)(() => {
3722
+ let documents = (0, import_react4.useMemo)(() => files.filter((file) => file.path.startsWith(`${project.root}/`) && /\.(?:md|txt|json|jsonl|html|css|[cm]?js|tsx?|jsx)$/iu.test(file.path)), [files, project.root]), preferred = selected !== void 0 && documents.some((file) => file.path === selected) ? selected : documents.find((file) => file.path === `${project.root}/PRODUCT_BRIEF.md`)?.path ?? documents[0]?.path, [path, setPath] = (0, import_react4.useState)(preferred), [content, setContent] = (0, import_react4.useState)(), [error, setError] = (0, import_react4.useState)();
3723
+ if ((0, import_react4.useEffect)(() => {
3373
3724
  setPath(preferred);
3374
- }, [preferred, project.id]), (0, import_react3.useEffect)(() => {
3725
+ }, [preferred, project.id]), (0, import_react4.useEffect)(() => {
3375
3726
  if (path === void 0 || project.source === "example") {
3376
3727
  setContent(void 0);
3377
3728
  return;
@@ -3384,21 +3735,21 @@ function GameDesign({
3384
3735
  }), () => {
3385
3736
  controller.abort();
3386
3737
  };
3387
- }, [path, project.source, sessionId]), project.source === "example") return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-design-empty", children: [
3388
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u5185\u7F6E\u5B8C\u6574\u793A\u4F8B" }),
3389
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\u300A\u91D1\u74F6\u6885 \xB7 \u98CE\u6708\u603B\u8D26\u300B\u7684\u5B8C\u6574\u53EF\u73A9\u6784\u5EFA\u4E0E QA \u6821\u9A8C\u7ED3\u679C\u968F\u63D2\u4EF6\u6253\u5305\uFF0C\u53EF\u76F4\u63A5\u5728\u5DE6\u4FA7\u8BD5\u73A9\u3002\u4E0A\u6E38\u7684\u4EA7\u54C1\u7B80\u62A5\u3001\u5206\u6790\u3001\u6982\u5FF5\u3001\u8BBE\u8BA1\u4E0E\u6E90\u5C0F\u8BF4\u4E0D\u968F\u5305\u5206\u53D1\uFF0C\u53EF\u5728 novel-to-game \u4ED3\u5E93\u67E5\u770B\u5B8C\u6574\u521B\u4F5C\u8FC7\u7A0B\u3002" }),
3390
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "novel-to-game/examples/jin-ping-mei" })
3738
+ }, [path, project.source, sessionId]), project.source === "example") return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-design-empty", children: [
3739
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "\u5185\u7F6E\u5B8C\u6574\u793A\u4F8B" }),
3740
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "\u300A\u91D1\u74F6\u6885 \xB7 \u98CE\u6708\u603B\u8D26\u300B\u7684\u5B8C\u6574\u53EF\u73A9\u6784\u5EFA\u4E0E QA \u6821\u9A8C\u7ED3\u679C\u968F\u63D2\u4EF6\u6253\u5305\uFF0C\u53EF\u76F4\u63A5\u5728\u5DE6\u4FA7\u8BD5\u73A9\u3002\u4E0A\u6E38\u7684\u4EA7\u54C1\u7B80\u62A5\u3001\u5206\u6790\u3001\u6982\u5FF5\u3001\u8BBE\u8BA1\u4E0E\u6E90\u5C0F\u8BF4\u4E0D\u968F\u5305\u5206\u53D1\uFF0C\u53EF\u5728 novel-to-game \u4ED3\u5E93\u67E5\u770B\u5B8C\u6574\u521B\u4F5C\u8FC7\u7A0B\u3002" }),
3741
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "novel-to-game/examples/jin-ping-mei" })
3391
3742
  ] });
3392
- if (documents.length === 0 || path === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-design-empty", children: "\u5F53\u524D\u9879\u76EE\u8FD8\u6CA1\u6709\u53EF\u68C0\u67E5\u7684\u8BBE\u8BA1\u6216\u6E90\u6587\u4EF6\u3002" });
3743
+ if (documents.length === 0 || path === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-design-empty", children: "\u5F53\u524D\u9879\u76EE\u8FD8\u6CA1\u6709\u53EF\u68C0\u67E5\u7684\u8BBE\u8BA1\u6216\u6E90\u6587\u4EF6\u3002" });
3393
3744
  let markdown = path.toLocaleLowerCase().endsWith(".md");
3394
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-design", children: [
3395
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { children: [
3745
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-design", children: [
3746
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
3396
3747
  "\u9879\u76EE\u6587\u4EF6",
3397
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("select", { value: path, onChange: (event) => {
3748
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("select", { value: path, onChange: (event) => {
3398
3749
  setPath(event.target.value), onSelect(event.target.value);
3399
- }, children: documents.map((file) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: file.path, children: file.path.slice(project.root.length + 1) }, file.path)) })
3750
+ }, children: documents.map((file) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: file.path, children: file.path.slice(project.root.length + 1) }, file.path)) })
3400
3751
  ] }),
3401
- error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-error", children: error }) : content === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-design-empty", children: "\u6B63\u5728\u8F7D\u5165\u6587\u4EF6\u2026" }) : markdown ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MarkdownPreview, { content, label: path }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { className: "oh-game-source", "aria-label": `${path} \u6E90\u7801`, children: content })
3752
+ error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-error", children: error }) : content === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-design-empty", children: "\u6B63\u5728\u8F7D\u5165\u6587\u4EF6\u2026" }) : markdown ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MarkdownPreview, { content, label: path }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("pre", { className: "oh-game-source", "aria-label": `${path} \u6E90\u7801`, children: content })
3402
3753
  ] });
3403
3754
  }
3404
3755
  function GameStudio({
@@ -3418,8 +3769,8 @@ function GameStudio({
3418
3769
  onCollapse,
3419
3770
  onSelect
3420
3771
  }) {
3421
- let project = workspace.games.find((value) => value.id === gameProjectId) ?? workspace.games[0], studioRef = (0, import_react3.useRef)(null), tabsId = (0, import_react3.useId)();
3422
- if ((0, import_react3.useLayoutEffect)(() => {
3772
+ let project = workspace.games.find((value) => value.id === gameProjectId) ?? workspace.games[0], studioRef = (0, import_react4.useRef)(null), tabsId = (0, import_react4.useId)();
3773
+ if ((0, import_react4.useLayoutEffect)(() => {
3423
3774
  let studio = studioRef.current;
3424
3775
  if (studio === null) return;
3425
3776
  let publishWidth = () => {
@@ -3430,14 +3781,14 @@ function GameStudio({
3430
3781
  return observer.observe(studio), () => {
3431
3782
  observer.disconnect();
3432
3783
  };
3433
- }, []), (0, import_react3.useEffect)(() => {
3784
+ }, []), (0, import_react4.useEffect)(() => {
3434
3785
  project !== void 0 && project.id !== gameProjectId && onGameProject(project.id);
3435
- }, [gameProjectId, onGameProject, project]), project === void 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("main", { ref: studioRef, id: paneId, className: "oh-game-studio", role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-design-empty", children: "\u6E38\u620F\u80FD\u529B\u6B63\u5728\u8F7D\u5165\u2026" }) });
3786
+ }, [gameProjectId, onGameProject, project]), project === void 0) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("main", { ref: studioRef, id: paneId, className: "oh-game-studio", role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-design-empty", children: "\u6E38\u620F\u80FD\u529B\u6B63\u5728\u8F7D\u5165\u2026" }) });
3436
3787
  let tabs = ["preview", "design"];
3437
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("main", { ref: studioRef, id: paneId, className: "oh-game-studio", "data-source": project.source, role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: [
3438
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "oh-game-toolbar", children: [
3439
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-workbench-cluster", children: [
3440
- workbenches.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: workbenches.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3788
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("main", { ref: studioRef, id: paneId, className: "oh-game-studio", "data-source": project.source, role: "tabpanel", "aria-labelledby": labelledBy, hidden, children: [
3789
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "oh-game-toolbar", children: [
3790
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-workbench-cluster", children: [
3791
+ workbenches.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: workbenches.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3441
3792
  "button",
3442
3793
  {
3443
3794
  type: "button",
@@ -3454,18 +3805,18 @@ function GameStudio({
3454
3805
  },
3455
3806
  mode
3456
3807
  )) }),
3457
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "oh-workbench-collapse", type: "button", title: "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", "aria-label": "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", onClick: onCollapse, children: "\xD7" })
3808
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "oh-workbench-collapse", type: "button", title: "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", "aria-label": "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", onClick: onCollapse, children: "\xD7" })
3458
3809
  ] }),
3459
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "oh-game-project", title: "\u5207\u6362\u9879\u76EE\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9", children: [
3460
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u6E38\u620F\u9879\u76EE" }),
3461
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("select", { "aria-label": "\u6E38\u620F\u9879\u76EE\uFF1B\u5207\u6362\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9", value: project.id, onChange: (event) => {
3810
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "oh-game-project", title: "\u5207\u6362\u9879\u76EE\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9", children: [
3811
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u6E38\u620F\u9879\u76EE" }),
3812
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { "aria-label": "\u6E38\u620F\u9879\u76EE\uFF1B\u5207\u6362\u5C06\u91CD\u65B0\u8F7D\u5165\u8BD5\u73A9", value: project.id, onChange: (event) => {
3462
3813
  onGameProject(event.target.value);
3463
3814
  }, children: [
3464
- workspace.games.some((item) => item.source === "workspace") && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("optgroup", { label: "\u6211\u7684\u9879\u76EE", children: workspace.games.filter((item) => item.source === "workspace").map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: item.id, children: `\u6211\u7684\u9879\u76EE \xB7 ${item.title}` }, item.id)) }),
3465
- workspace.games.some((item) => item.source === "example") && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("optgroup", { label: "\u5185\u7F6E\u793A\u4F8B", children: workspace.games.filter((item) => item.source === "example").map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: item.id, children: `\u5185\u7F6E\u793A\u4F8B \xB7 ${item.title}` }, item.id)) })
3815
+ workspace.games.some((item) => item.source === "workspace") && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("optgroup", { label: "\u6211\u7684\u9879\u76EE", children: workspace.games.filter((item) => item.source === "workspace").map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: item.id, children: `\u6211\u7684\u9879\u76EE \xB7 ${item.title}` }, item.id)) }),
3816
+ workspace.games.some((item) => item.source === "example") && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("optgroup", { label: "\u5185\u7F6E\u793A\u4F8B", children: workspace.games.filter((item) => item.source === "example").map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: item.id, children: `\u5185\u7F6E\u793A\u4F8B \xB7 ${item.title}` }, item.id)) })
3466
3817
  ] })
3467
3818
  ] }),
3468
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-tabs", role: "tablist", "aria-label": "\u6E38\u620F\u5DE5\u4F5C\u53F0", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
3819
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-tabs", role: "tablist", "aria-label": "\u6E38\u620F\u5DE5\u4F5C\u53F0", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3469
3820
  "button",
3470
3821
  {
3471
3822
  type: "button",
@@ -3485,9 +3836,9 @@ function GameStudio({
3485
3836
  tab
3486
3837
  )) })
3487
3838
  ] }),
3488
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-game-panels", children: [
3489
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-panel", role: "tabpanel", id: `${tabsId}-preview-panel`, "aria-labelledby": `${tabsId}-preview-tab`, hidden: gameTab !== "preview", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GamePreview, { project, building }, `${project.id}:${String(project.previewReady)}`) }),
3490
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-panel", role: "tabpanel", id: `${tabsId}-design-panel`, "aria-labelledby": `${tabsId}-design-tab`, hidden: gameTab !== "design", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GameDesign, { project, files: workspace.files, selected, sessionId, onSelect }) })
3839
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-game-panels", children: [
3840
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-panel", role: "tabpanel", id: `${tabsId}-preview-panel`, "aria-labelledby": `${tabsId}-preview-tab`, hidden: gameTab !== "preview", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GamePreview, { project, building }, `${project.id}:${String(project.previewReady)}`) }),
3841
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-panel", role: "tabpanel", id: `${tabsId}-design-panel`, "aria-labelledby": `${tabsId}-design-tab`, hidden: gameTab !== "design", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GameDesign, { project, files: workspace.files, selected, sessionId, onSelect }) })
3491
3842
  ] })
3492
3843
  ] });
3493
3844
  }
@@ -3515,26 +3866,26 @@ function CreativeWorkbench({
3515
3866
  useStore,
3516
3867
  actions
3517
3868
  }) {
3518
- let activities = (0, import_react3.useMemo)(
3869
+ let activities = (0, import_react4.useMemo)(
3519
3870
  () => fileMutations(runningCalls, partial, undispatched),
3520
3871
  [partial, runningCalls, undispatched]
3521
- ), normalizedActivities = (0, import_react3.useMemo)(() => activities.flatMap((activity2) => {
3872
+ ), normalizedActivities = (0, import_react4.useMemo)(() => activities.flatMap((activity2) => {
3522
3873
  let path = creativeRelativePath(activity2.path, workspace?.cwd);
3523
3874
  return path === void 0 ? [] : [{ activity: activity2, path }];
3524
- }), [activities, workspace?.cwd]), primaryActivity = normalizedActivities.at(-1), activityPaths = (0, import_react3.useMemo)(() => new Set(normalizedActivities.map((value) => value.path)), [normalizedActivities]), settledPath = settledMutation === void 0 ? void 0 : creativeRelativePath(settledMutation.slice(settledMutation.indexOf("\0") + 1), workspace?.cwd), activity = primaryActivity?.activity, activityPath = primaryActivity?.path, workbench = useStore((memory) => memory.workbench), setWorkbench = actions.setWorkbench, gameTab = useStore((memory) => memory.gameTab), setGameTab = actions.setGameTab, gameProjectId = useStore((memory) => memory.gameProjectId), setGameProjectId = actions.setGameProjectId, gamePane = useStore((memory) => memory.gamePane), setGamePane = actions.setGamePane, videoTab = useStore((memory) => memory.videoTab), setVideoTab = actions.setVideoTab, videoProjectId = useStore((memory) => memory.videoProjectId), setVideoProjectId = actions.setVideoProjectId, videoPane = useStore((memory) => memory.videoPane), setVideoPane = actions.setVideoPane, selected = useStore((memory) => memory.selected), setSelected = actions.setSelected, buffers = useStore((memory) => memory.buffers), setBuffers = actions.setBuffers, buffersRef = (0, import_react3.useRef)({}), expanded = useStore((memory) => memory.expanded), setExpanded = actions.setExpanded, productionSection = useStore((memory) => memory.productionSection), setProductionSection = actions.setProductionSection, productionSelectedIds = useStore((memory) => memory.productionSelectedIds), productionJobsByEpisode = useStore((memory) => memory.productionJobs), productionSelectionsByEpisode = useStore((memory) => memory.productionSelections), productionReferencesByEpisode = useStore((memory) => memory.productionReferences), productionSequenceByEpisode = useStore((memory) => memory.productionSequence), productionCanvasByEpisode = useStore((memory) => memory.productionCanvas), productionZoomByEpisode = useStore((memory) => memory.productionZoom), productionIntentCalls = useStore((memory) => memory.productionIntentCalls), surfaceRef = (0, import_react3.useRef)(null), setWorkbenchPreference = actions.setWorkbenchPreference, applyWorkbenchPreference = (0, import_react3.useCallback)((preference) => {
3875
+ }), [activities, workspace?.cwd]), primaryActivity = normalizedActivities.at(-1), activityPaths = (0, import_react4.useMemo)(() => new Set(normalizedActivities.map((value) => value.path)), [normalizedActivities]), settledPath = settledMutation === void 0 ? void 0 : creativeRelativePath(settledMutation.slice(settledMutation.indexOf("\0") + 1), workspace?.cwd), activity = primaryActivity?.activity, activityPath = primaryActivity?.path, workbench = useStore((memory) => memory.workbench), setWorkbench = actions.setWorkbench, gameTab = useStore((memory) => memory.gameTab), setGameTab = actions.setGameTab, gameProjectId = useStore((memory) => memory.gameProjectId), setGameProjectId = actions.setGameProjectId, gamePane = useStore((memory) => memory.gamePane), setGamePane = actions.setGamePane, videoTab = useStore((memory) => memory.videoTab), setVideoTab = actions.setVideoTab, videoProjectId = useStore((memory) => memory.videoProjectId), setVideoProjectId = actions.setVideoProjectId, videoPane = useStore((memory) => memory.videoPane), setVideoPane = actions.setVideoPane, selected = useStore((memory) => memory.selected), setSelected = actions.setSelected, buffers = useStore((memory) => memory.buffers), setBuffers = actions.setBuffers, buffersRef = (0, import_react4.useRef)({}), expanded = useStore((memory) => memory.expanded), setExpanded = actions.setExpanded, productionSection = useStore((memory) => memory.productionSection), setProductionSection = actions.setProductionSection, productionSelectedIds = useStore((memory) => memory.productionSelectedIds), productionJobsByEpisode = useStore((memory) => memory.productionJobs), productionSelectionsByEpisode = useStore((memory) => memory.productionSelections), productionReferencesByEpisode = useStore((memory) => memory.productionReferences), productionSequenceByEpisode = useStore((memory) => memory.productionSequence), productionCanvasByEpisode = useStore((memory) => memory.productionCanvas), productionViewportByEpisode = useStore((memory) => memory.productionViewport), productionIntentCalls = useStore((memory) => memory.productionIntentCalls), surfaceRef = (0, import_react4.useRef)(null), setWorkbenchPreference = actions.setWorkbenchPreference, applyWorkbenchPreference = (0, import_react4.useCallback)((preference) => {
3525
3876
  setWorkbenchPreference(preference), writeWorkbenchPreference(workbenchPreferenceStorage(), workspace?.cwd, preference);
3526
- }, [setWorkbenchPreference, workspace?.cwd]), compactTabsId = (0, import_react3.useId)(), compactStudioId = `${compactTabsId}-studio-panel`, compactVideoStudioId = `${compactTabsId}-video-studio-panel`, compactChatId = `${compactTabsId}-chat-panel`, navRef = (0, import_react3.useRef)(null), activityBases = (0, import_react3.useRef)(/* @__PURE__ */ new Map()), previousSignals = (0, import_react3.useRef)(/* @__PURE__ */ new Set()), consumedSettledMutation = useStore((memory) => memory.settledMutation), liveTurns = (0, import_react3.useRef)(/* @__PURE__ */ new Set());
3877
+ }, [setWorkbenchPreference, workspace?.cwd]), compactTabsId = (0, import_react4.useId)(), compactStudioId = `${compactTabsId}-studio-panel`, compactVideoStudioId = `${compactTabsId}-video-studio-panel`, compactChatId = `${compactTabsId}-chat-panel`, navRef = (0, import_react4.useRef)(null), activityBases = (0, import_react4.useRef)(/* @__PURE__ */ new Map()), previousSignals = (0, import_react4.useRef)(/* @__PURE__ */ new Set()), consumedSettledMutation = useStore((memory) => memory.settledMutation), liveTurns = (0, import_react4.useRef)(/* @__PURE__ */ new Set());
3527
3878
  liveTurn !== void 0 && liveTurns.current.add(liveTurn);
3528
- let saveLocks = (0, import_react3.useRef)(/* @__PURE__ */ new Set()), buffer = selected === void 0 ? void 0 : buffers[selected], selectedFile = workspace?.files.find((file) => file.path === selected), selectedMedia = selectedFile?.kind === "media", dirty = buffer?.source === "human" && buffer.content !== buffer.saved, saving = buffer?.saving === !0, fileError = buffer?.error, conflict = buffer?.conflict, selectedLower = selected?.toLocaleLowerCase(), markdown = selectedLower?.endsWith(".md") === !0, jsonl = selectedLower?.endsWith(".jsonl") === !0, structured = jsonl || selectedLower?.endsWith(".json") === !0, previewable = markdown || jsonl, episodeDirectory = episodeDirectoryForPath(selected), productionAvailable = selected !== void 0 && isCreatorDocumentPath(selected) && episodeDirectory !== void 0, editorModes = productionAvailable ? EDITOR_MODES : EDITOR_MODES.filter((mode) => mode !== "production"), episodeDocumentPaths = (0, import_react3.useMemo)(
3879
+ let saveLocks = (0, import_react4.useRef)(/* @__PURE__ */ new Set()), buffer = selected === void 0 ? void 0 : buffers[selected], selectedFile = workspace?.files.find((file) => file.path === selected), selectedMedia = selectedFile?.kind === "media", dirty = buffer?.source === "human" && buffer.content !== buffer.saved, saving = buffer?.saving === !0, fileError = buffer?.error, conflict = buffer?.conflict, selectedLower = selected?.toLocaleLowerCase(), markdown = selectedLower?.endsWith(".md") === !0, jsonl = selectedLower?.endsWith(".jsonl") === !0, structured = jsonl || selectedLower?.endsWith(".json") === !0, previewable = markdown || jsonl, episodeDirectory = episodeDirectoryForPath(selected), productionAvailable = selected !== void 0 && isCreatorDocumentPath(selected) && episodeDirectory !== void 0, editorModes = productionAvailable ? EDITOR_MODES : EDITOR_MODES.filter((mode) => mode !== "production"), episodeDocumentPaths = (0, import_react4.useMemo)(
3529
3880
  () => episodeDirectory === void 0 ? [] : creatorDocumentPaths(workspace?.files.filter((file) => file.kind === "text") ?? [], episodeDirectory),
3530
3881
  [episodeDirectory, workspace?.files]
3531
- ), episodeDocuments = (0, import_react3.useMemo)(() => Object.fromEntries(episodeDocumentPaths.flatMap((path) => {
3882
+ ), episodeDocuments = (0, import_react4.useMemo)(() => Object.fromEntries(episodeDocumentPaths.flatMap((path) => {
3532
3883
  let current = buffers[path];
3533
3884
  return current === void 0 || current.missing === !0 ? [] : [[path, current.content]];
3534
- })), [buffers, episodeDocumentPaths]), episodeProduction = (0, import_react3.useMemo)(
3885
+ })), [buffers, episodeDocumentPaths]), episodeProduction = (0, import_react4.useMemo)(
3535
3886
  () => episodeDirectory === void 0 ? void 0 : parseEpisodeProduction(episodeDocuments, episodeDirectory),
3536
3887
  [episodeDirectory, episodeDocuments]
3537
- ), productionLibrary = (0, import_react3.useMemo)(() => (workspace?.files ?? []).flatMap((file) => {
3888
+ ), productionLibrary = (0, import_react4.useMemo)(() => (workspace?.files ?? []).flatMap((file) => {
3538
3889
  if (file.kind !== "media" || file.mimeType?.startsWith("audio/") === !0) return [];
3539
3890
  if (!file.path.startsWith("\u5267\u96C6/") && !file.path.startsWith("\u4EA4\u4ED8/")) return [];
3540
3891
  let targetId = file.path.toLocaleUpperCase().match(/(?:SHOT|IMG|MOTION|VISUAL)-[A-Z0-9-]+/u)?.[0] ?? file.path.split("/").at(-2) ?? "PROJECT-MEDIA";
@@ -3545,7 +3896,7 @@ function CreativeWorkbench({
3545
3896
  url: endpoint("media", sessionId, file.path),
3546
3897
  path: file.path
3547
3898
  }];
3548
- }), [sessionId, workspace?.files]), productionVersions = (0, import_react3.useMemo)(() => {
3899
+ }), [sessionId, workspace?.files]), productionVersions = (0, import_react4.useMemo)(() => {
3549
3900
  if (episodeProduction === void 0) return [];
3550
3901
  let episodeName = episodeProduction.episodeDirectory.split("/").at(-1) ?? "", knownTargets = [
3551
3902
  ...episodeProduction.shots.map((shot) => shot.id),
@@ -3561,25 +3912,25 @@ function CreativeWorkbench({
3561
3912
  }), byId = /* @__PURE__ */ new Map();
3562
3913
  for (let version of fromWorkspace) byId.set(version.id, version);
3563
3914
  return [...byId.values()];
3564
- }, [episodeProduction, productionLibrary]), productionSelectedId = episodeDirectory === void 0 ? void 0 : productionSelectedIds[episodeDirectory], productionJobs = episodeDirectory === void 0 ? [] : productionJobsByEpisode[episodeDirectory] ?? [], productionSelections = episodeDirectory === void 0 ? {} : productionSelectionsByEpisode[episodeDirectory] ?? {}, productionReferences = episodeDirectory === void 0 ? {} : productionReferencesByEpisode[episodeDirectory] ?? {}, productionSequence = episodeDirectory === void 0 ? [] : productionSequenceByEpisode[episodeDirectory] ?? [], productionCanvas = episodeDirectory === void 0 ? {} : productionCanvasByEpisode[episodeDirectory] ?? {}, productionZoom = episodeDirectory === void 0 ? 0.65 : productionZoomByEpisode[episodeDirectory] ?? 0.65, setProductionSelectedId = (0, import_react3.useCallback)((selectedId) => {
3915
+ }, [episodeProduction, productionLibrary]), productionSelectedId = episodeDirectory === void 0 ? void 0 : productionSelectedIds[episodeDirectory], productionJobs = episodeDirectory === void 0 ? [] : productionJobsByEpisode[episodeDirectory] ?? [], productionSelections = episodeDirectory === void 0 ? {} : productionSelectionsByEpisode[episodeDirectory] ?? {}, productionReferences = episodeDirectory === void 0 ? {} : productionReferencesByEpisode[episodeDirectory] ?? {}, productionSequence = episodeDirectory === void 0 ? [] : productionSequenceByEpisode[episodeDirectory] ?? [], productionCanvas = episodeDirectory === void 0 ? {} : productionCanvasByEpisode[episodeDirectory] ?? {}, productionViewport = episodeDirectory === void 0 ? void 0 : productionViewportByEpisode[episodeDirectory], setProductionSelectedId = (0, import_react4.useCallback)((selectedId) => {
3565
3916
  episodeDirectory !== void 0 && actions.setProductionSelectedIds((current) => ({ ...current, [episodeDirectory]: selectedId }));
3566
- }, [actions, episodeDirectory]), setProductionJobs = (0, import_react3.useCallback)((jobs) => {
3917
+ }, [actions, episodeDirectory]), setProductionJobs = (0, import_react4.useCallback)((jobs) => {
3567
3918
  episodeDirectory !== void 0 && actions.setProductionJobs((current) => ({ ...current, [episodeDirectory]: jobs }));
3568
- }, [actions, episodeDirectory]), setProductionSelections = (0, import_react3.useCallback)((selections) => {
3919
+ }, [actions, episodeDirectory]), setProductionSelections = (0, import_react4.useCallback)((selections) => {
3569
3920
  episodeDirectory !== void 0 && actions.setProductionSelections((current) => ({ ...current, [episodeDirectory]: selections }));
3570
- }, [actions, episodeDirectory]), setProductionReferences = (0, import_react3.useCallback)((references) => {
3921
+ }, [actions, episodeDirectory]), setProductionReferences = (0, import_react4.useCallback)((references) => {
3571
3922
  episodeDirectory !== void 0 && actions.setProductionReferences((current) => ({ ...current, [episodeDirectory]: references }));
3572
- }, [actions, episodeDirectory]), setProductionSequence = (0, import_react3.useCallback)((sequence) => {
3923
+ }, [actions, episodeDirectory]), setProductionSequence = (0, import_react4.useCallback)((sequence) => {
3573
3924
  episodeDirectory !== void 0 && actions.setProductionSequence((current) => ({ ...current, [episodeDirectory]: sequence }));
3574
- }, [actions, episodeDirectory]), setProductionCanvas = (0, import_react3.useCallback)((canvas) => {
3925
+ }, [actions, episodeDirectory]), setProductionCanvas = (0, import_react4.useCallback)((canvas) => {
3575
3926
  episodeDirectory !== void 0 && actions.setProductionCanvas((current) => ({ ...current, [episodeDirectory]: canvas }));
3576
- }, [actions, episodeDirectory]), setProductionZoom = (0, import_react3.useCallback)((zoom) => {
3577
- episodeDirectory !== void 0 && actions.setProductionZoom((current) => ({ ...current, [episodeDirectory]: zoom }));
3578
- }, [actions, episodeDirectory]), editorMode = useStore((memory) => memory.editorMode), setEditorMode = actions.setEditorMode, modeSelection = (0, import_react3.useRef)(selected), textareaRef = (0, import_react3.useRef)(null), editorPositions = (0, import_react3.useRef)(/* @__PURE__ */ new Map()), editorReady = buffer !== void 0 && buffer.missing !== !0, workspaceKind = workbench === "game" || workbench === "video" ? void 0 : workbench, gameBuilding = normalizedActivities.some(({ path }) => path.startsWith("game-adaptations/")), videoBuilding = normalizedActivities.some(({ path }) => path.startsWith("video-recaps/"));
3579
- (0, import_react3.useEffect)(() => {
3927
+ }, [actions, episodeDirectory]), setProductionViewport = (0, import_react4.useCallback)((viewport) => {
3928
+ episodeDirectory !== void 0 && actions.setProductionViewport((current) => ({ ...current, [episodeDirectory]: viewport }));
3929
+ }, [actions, episodeDirectory]), editorMode = useStore((memory) => memory.editorMode), setEditorMode = actions.setEditorMode, modeSelection = (0, import_react4.useRef)(selected), textareaRef = (0, import_react4.useRef)(null), editorPositions = (0, import_react4.useRef)(/* @__PURE__ */ new Map()), editorReady = buffer !== void 0 && buffer.missing !== !0, workspaceKind = workbench === "game" || workbench === "video" ? void 0 : workbench, gameBuilding = normalizedActivities.some(({ path }) => path.startsWith("game-adaptations/")), videoBuilding = normalizedActivities.some(({ path }) => path.startsWith("video-recaps/"));
3930
+ (0, import_react4.useEffect)(() => {
3580
3931
  buffersRef.current = buffers;
3581
3932
  }, [buffers]);
3582
- let rememberEditorPosition = (0, import_react3.useCallback)(() => {
3933
+ let rememberEditorPosition = (0, import_react4.useCallback)(() => {
3583
3934
  let element = textareaRef.current;
3584
3935
  element === null || selected === void 0 || element.getAttribute("aria-label") !== selected || editorPositions.current.set(selected, {
3585
3936
  scrollTop: element.scrollTop,
@@ -3587,13 +3938,13 @@ function CreativeWorkbench({
3587
3938
  selectionEnd: element.selectionEnd
3588
3939
  });
3589
3940
  }, [selected]);
3590
- (0, import_react3.useLayoutEffect)(() => {
3941
+ (0, import_react4.useLayoutEffect)(() => {
3591
3942
  if (editorMode !== "source" || selected === void 0 || !editorReady) return;
3592
3943
  let element = textareaRef.current, position = editorPositions.current.get(selected);
3593
3944
  if (element === null || position === void 0) return;
3594
3945
  let end = Math.min(position.selectionEnd, element.value.length);
3595
3946
  element.setSelectionRange(Math.min(position.selectionStart, end), end), element.scrollTop = position.scrollTop;
3596
- }, [editorMode, editorReady, selected]), (0, import_react3.useEffect)(() => {
3947
+ }, [editorMode, editorReady, selected]), (0, import_react4.useEffect)(() => {
3597
3948
  let warn = (event) => {
3598
3949
  Object.values(buffersRef.current).some((value) => value.source === "human" && value.content !== value.saved) && event.preventDefault();
3599
3950
  };
@@ -3601,7 +3952,7 @@ function CreativeWorkbench({
3601
3952
  globalThis.removeEventListener("beforeunload", warn);
3602
3953
  };
3603
3954
  }, []);
3604
- let expandPath = (0, import_react3.useCallback)((path) => {
3955
+ let expandPath = (0, import_react4.useCallback)((path) => {
3605
3956
  let segments = path.split("/"), ancestors = [groupForPath(path)];
3606
3957
  for (let index = 1; index < segments.length - 1; index += 1) ancestors.push(segments.slice(0, index + 1).join("/"));
3607
3958
  setExpanded((current) => {
@@ -3609,12 +3960,12 @@ function CreativeWorkbench({
3609
3960
  for (let ancestor of ancestors) next[ancestor] = !0;
3610
3961
  return next;
3611
3962
  });
3612
- }, []), revealPath = (0, import_react3.useCallback)((path) => {
3963
+ }, []), revealPath = (0, import_react4.useCallback)((path) => {
3613
3964
  rememberEditorPosition();
3614
3965
  let nextWorkbench = workbenchModeForPath(path) ?? "story";
3615
3966
  setWorkbench(nextWorkbench), nextWorkbench === "game" && !path.includes("/build/app/") && setGameTab("design"), setSelected(path), expandPath(path);
3616
3967
  }, [expandPath, rememberEditorPosition]);
3617
- (0, import_react3.useEffect)(() => {
3968
+ (0, import_react4.useEffect)(() => {
3618
3969
  if (workspace === void 0) return;
3619
3970
  let pending = productionIntents.filter(({ callId }) => productionIntentCalls[callId] !== !0);
3620
3971
  if (pending.length !== 0) {
@@ -3672,22 +4023,22 @@ function CreativeWorkbench({
3672
4023
  }));
3673
4024
  }
3674
4025
  }, [actions, expandPath, productionIntentCalls, productionIntents, setEditorMode, setProductionSection, setSelected, setWorkbench, workspace]);
3675
- let openedGame = (0, import_react3.useRef)(!1);
4026
+ let openedGame = (0, import_react4.useRef)(!1);
3676
4027
  workbench === "game" && (openedGame.current = !0);
3677
- let gameStudioMounted = openedGame.current, openedVideo = (0, import_react3.useRef)(!1);
4028
+ let gameStudioMounted = openedGame.current, openedVideo = (0, import_react4.useRef)(!1);
3678
4029
  workbench === "video" && (openedVideo.current = !0);
3679
- let videoStudioMounted = openedVideo.current, followAgentPath = (0, import_react3.useCallback)((path) => {
4030
+ let videoStudioMounted = openedVideo.current, followAgentPath = (0, import_react4.useCallback)((path) => {
3680
4031
  expandPath(path);
3681
4032
  let current = selected === void 0 ? void 0 : buffersRef.current[selected];
3682
4033
  path !== selected && current?.source === "human" && current.content !== current.saved && surfaceRef.current?.ownerDocument.activeElement === textareaRef.current || workbench === "game" && gameTab === "preview" || workbench === "video" && videoTab === "preview" || revealPath(path);
3683
4034
  }, [expandPath, gameTab, revealPath, selected, videoTab, workbench]);
3684
- (0, import_react3.useEffect)(() => {
4035
+ (0, import_react4.useEffect)(() => {
3685
4036
  activityPath !== void 0 && activityPath === selected && !selectedMedia && setEditorMode("source");
3686
- }, [activityPath, selected, selectedMedia]), (0, import_react3.useEffect)(() => {
4037
+ }, [activityPath, selected, selectedMedia]), (0, import_react4.useEffect)(() => {
3687
4038
  modeSelection.current !== selected && (modeSelection.current = selected, setEditorMode(selected !== void 0 && activityPaths.has(selected) ? "source" : selectedMedia || previewable ? "preview" : "source"));
3688
- }, [activityPaths, previewable, selected, selectedMedia]), (0, import_react3.useEffect)(() => {
4039
+ }, [activityPaths, previewable, selected, selectedMedia]), (0, import_react4.useEffect)(() => {
3689
4040
  workspaceLoading || activityPath === void 0 && (selected !== void 0 && ((workspace?.files.some((file) => file.path === selected) ?? !1) || buffers[selected] !== void 0) && workbenchModeForPath(selected) === workbench || setSelected(workspace === void 0 ? void 0 : preferredWorkbenchFile(workspace.files, workbench)));
3690
- }, [activityPath, buffers, selected, workbench, workspace, workspaceLoading]), (0, import_react3.useEffect)(() => {
4041
+ }, [activityPath, buffers, selected, workbench, workspace, workspaceLoading]), (0, import_react4.useEffect)(() => {
3691
4042
  if (workspace === void 0 || workspaceLoading) return;
3692
4043
  let paths = new Set(workspace.files.map((file) => file.path));
3693
4044
  setBuffers((current) => {
@@ -3696,7 +4047,7 @@ function CreativeWorkbench({
3696
4047
  paths.has(path) || activityPaths.has(path) || value.source === "agent" && sessionRunning && path === settledPath || (value.source === "human" && value.content !== value.saved ? value.missing !== !0 && (next[path] = { ...value, missing: !0, error: "\u6587\u4EF6\u5DF2\u4ECE workspace \u79FB\u9664\u3002\u672C\u5730\u8349\u7A3F\u4ECD\u4FDD\u7559\uFF0C\u53EF\u590D\u5236\u540E\u653E\u5F03\u8349\u7A3F\u3002" }, changed = !0) : (delete next[path], changed = !0));
3697
4048
  return changed ? next : current;
3698
4049
  });
3699
- }, [activityPaths, sessionRunning, settledPath, workspace, workspaceLoading]), (0, import_react3.useEffect)(() => {
4050
+ }, [activityPaths, sessionRunning, settledPath, workspace, workspaceLoading]), (0, import_react4.useEffect)(() => {
3700
4051
  if (selected === void 0 || selectedMedia || activityPaths.has(selected) || !(workspace?.files.some((file) => file.path === selected) ?? !1)) return;
3701
4052
  let controller = new AbortController();
3702
4053
  return setBuffers((current) => {
@@ -3733,7 +4084,7 @@ function CreativeWorkbench({
3733
4084
  }), () => {
3734
4085
  controller.abort();
3735
4086
  };
3736
- }, [activityPaths, selected, selectedMedia, sessionId, workspace?.files]), (0, import_react3.useEffect)(() => {
4087
+ }, [activityPaths, selected, selectedMedia, sessionId, workspace?.files]), (0, import_react4.useEffect)(() => {
3737
4088
  if (!productionAvailable) return;
3738
4089
  let missing = episodeDocumentPaths.filter((path) => buffersRef.current[path] === void 0 && !activityPaths.has(path));
3739
4090
  if (missing.length === 0) return;
@@ -3759,7 +4110,7 @@ function CreativeWorkbench({
3759
4110
  }), () => {
3760
4111
  controller.abort();
3761
4112
  };
3762
- }, [activityPaths, episodeDocumentPaths, productionAvailable, sessionId]), (0, import_react3.useEffect)(() => {
4113
+ }, [activityPaths, episodeDocumentPaths, productionAvailable, sessionId]), (0, import_react4.useEffect)(() => {
3763
4114
  if (normalizedActivities.length !== 0) {
3764
4115
  for (let { path } of normalizedActivities) expandPath(path);
3765
4116
  activityPath !== void 0 && followAgentPath(activityPath), setBuffers((current) => {
@@ -3792,14 +4143,14 @@ function CreativeWorkbench({
3792
4143
  return next;
3793
4144
  });
3794
4145
  }
3795
- }, [activityPath, expandPath, followAgentPath, normalizedActivities]), (0, import_react3.useEffect)(() => {
4146
+ }, [activityPath, expandPath, followAgentPath, normalizedActivities]), (0, import_react4.useEffect)(() => {
3796
4147
  let signals = new Set(mutatingCallIds(runningCalls));
3797
4148
  for (let { activity: currentActivity } of normalizedActivities) signals.add(currentActivity.callId.split(":", 1)[0] ?? currentActivity.callId);
3798
4149
  let settled = [...previousSignals.current].some((callId) => !signals.has(callId));
3799
4150
  for (let callId of activityBases.current.keys())
3800
4151
  signals.has(callId.split(":", 1)[0] ?? callId) || activityBases.current.delete(callId);
3801
4152
  previousSignals.current = signals, settled && reload();
3802
- }, [normalizedActivities, reload, runningCalls]), (0, import_react3.useEffect)(() => {
4153
+ }, [normalizedActivities, reload, runningCalls]), (0, import_react4.useEffect)(() => {
3803
4154
  if (settledMutation === void 0 || settledMutation === consumedSettledMutation) return;
3804
4155
  if (settledMutationTurn === void 0 || !liveTurns.current.has(settledMutationTurn)) {
3805
4156
  actions.setSettledMutation(settledMutation);
@@ -3809,7 +4160,7 @@ function CreativeWorkbench({
3809
4160
  actions.setSettledMutation(settledMutation);
3810
4161
  let path = creativeRelativePath(settledMutation.slice(settledMutation.indexOf("\0") + 1), workspace.cwd);
3811
4162
  path !== void 0 && followAgentPath(path), reload();
3812
- }, [actions, consumedSettledMutation, followAgentPath, reload, settledMutation, settledMutationTurn, workspace?.cwd]), (0, import_react3.useEffect)(() => {
4163
+ }, [actions, consumedSettledMutation, followAgentPath, reload, settledMutation, settledMutationTurn, workspace?.cwd]), (0, import_react4.useEffect)(() => {
3813
4164
  if (selected !== void 0) {
3814
4165
  for (let button of navRef.current?.querySelectorAll("button[data-file-path]") ?? [])
3815
4166
  if (button.dataset.filePath === selected) {
@@ -3817,7 +4168,7 @@ function CreativeWorkbench({
3817
4168
  break;
3818
4169
  }
3819
4170
  }
3820
- }, [selected]), (0, import_react3.useEffect)(() => {
4171
+ }, [selected]), (0, import_react4.useEffect)(() => {
3821
4172
  if (!open || normalizedActivities.length > 0 || workspace === void 0) return;
3822
4173
  let sessionSurface = surfaceRef.current?.parentElement;
3823
4174
  if (sessionSurface == null) return;
@@ -3838,7 +4189,7 @@ function CreativeWorkbench({
3838
4189
  return sessionSurface.addEventListener("click", followOfficialFileLink, !0), () => {
3839
4190
  sessionSurface.removeEventListener("click", followOfficialFileLink, !0);
3840
4191
  };
3841
- }, [normalizedActivities.length, open, revealPath, workspace]), (0, import_react3.useEffect)(() => {
4192
+ }, [normalizedActivities.length, open, revealPath, workspace]), (0, import_react4.useEffect)(() => {
3842
4193
  if (workbench !== "game" && workbench !== "video") return;
3843
4194
  let surface = surfaceRef.current, sessionSurface = surface?.parentElement, chat = Array.from(sessionSurface?.children ?? []).find((child) => child !== surface && child instanceof HTMLElement);
3844
4195
  if (!(chat instanceof HTMLElement)) return;
@@ -3851,7 +4202,7 @@ function CreativeWorkbench({
3851
4202
  chat.id = previous.id, previous.role === null ? chat.removeAttribute("role") : chat.setAttribute("role", previous.role), previous.labelledBy === null ? chat.removeAttribute("aria-labelledby") : chat.setAttribute("aria-labelledby", previous.labelledBy);
3852
4203
  };
3853
4204
  }, [compactChatId, compactTabsId, workbench]);
3854
- let savePath = (0, import_react3.useCallback)(async (path) => {
4205
+ let savePath = (0, import_react4.useCallback)(async (path) => {
3855
4206
  if (saveLocks.current.has(path)) return;
3856
4207
  let submitted = buffersRef.current[path];
3857
4208
  if (!(submitted === void 0 || submitted.missing === !0 || submitted.content === submitted.saved)) {
@@ -3921,7 +4272,7 @@ function CreativeWorkbench({
3921
4272
  }
3922
4273
  }
3923
4274
  }, [reload, sessionId]);
3924
- (0, import_react3.useEffect)(() => {
4275
+ (0, import_react4.useEffect)(() => {
3925
4276
  if (!open) return;
3926
4277
  let saveShortcut = (event) => {
3927
4278
  !(event.metaKey || event.ctrlKey) || event.key.toLocaleLowerCase() !== "s" || (event.preventDefault(), selected !== void 0 && savePath(selected));
@@ -3930,7 +4281,7 @@ function CreativeWorkbench({
3930
4281
  globalThis.removeEventListener("keydown", saveShortcut);
3931
4282
  };
3932
4283
  }, [open, savePath, selected]);
3933
- let groups = (0, import_react3.useMemo)(() => {
4284
+ let groups = (0, import_react4.useMemo)(() => {
3934
4285
  let value = /* @__PURE__ */ new Map(), all = [...workspace?.files ?? []].filter((file) => workbenchModeForPath(file.path) === workbench);
3935
4286
  activityPath !== void 0 && !all.some((file) => file.path === activityPath) && all.push({ path: activityPath, bytes: 0, version: "", kind: "text" }), all.sort((left, right) => left.path.localeCompare(right.path, "zh-Hans-CN"));
3936
4287
  for (let file of all) {
@@ -3967,9 +4318,9 @@ function CreativeWorkbench({
3967
4318
  };
3968
4319
  });
3969
4320
  };
3970
- return open ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: surfaceRef, className: "oh-story-split-surface", "data-open": "true", "data-workbench": workbench, children: [
3971
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
3972
- (workbench === "game" || workbench === "video") && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-mobile-switcher", role: "tablist", "aria-label": workbench === "game" ? "\u7A84\u5C4F\u6E38\u620F\u5DE5\u4F5C\u53F0" : "\u7A84\u5C4F\u89C6\u9891\u5DE5\u4F5C\u53F0", children: ["studio", "chat"].map((pane) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4321
+ return open ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: surfaceRef, className: "oh-story-split-surface", "data-open": "true", "data-workbench": workbench, children: [
4322
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4323
+ (workbench === "game" || workbench === "video") && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-mobile-switcher", role: "tablist", "aria-label": workbench === "game" ? "\u7A84\u5C4F\u6E38\u620F\u5DE5\u4F5C\u53F0" : "\u7A84\u5C4F\u89C6\u9891\u5DE5\u4F5C\u53F0", children: ["studio", "chat"].map((pane) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3973
4324
  "button",
3974
4325
  {
3975
4326
  type: "button",
@@ -3988,8 +4339,8 @@ function CreativeWorkbench({
3988
4339
  },
3989
4340
  pane
3990
4341
  )) }),
3991
- workbench === "game" && workspace === void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("main", { id: compactStudioId, className: "oh-game-studio", role: "tabpanel", "aria-labelledby": `${compactTabsId}-studio-tab`, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-game-design-empty", children: error ?? "\u6B63\u5728\u8FDE\u63A5\u6E38\u620F\u5DE5\u4F5C\u53F0\u2026" }) }),
3992
- workspace !== void 0 && gameStudioMounted && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4342
+ workbench === "game" && workspace === void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("main", { id: compactStudioId, className: "oh-game-studio", role: "tabpanel", "aria-labelledby": `${compactTabsId}-studio-tab`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-game-design-empty", children: error ?? "\u6B63\u5728\u8FDE\u63A5\u6E38\u620F\u5DE5\u4F5C\u53F0\u2026" }) }),
4343
+ workspace !== void 0 && gameStudioMounted && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
3993
4344
  GameStudio,
3994
4345
  {
3995
4346
  sessionId,
@@ -4011,8 +4362,8 @@ function CreativeWorkbench({
4011
4362
  onSelect: revealPath
4012
4363
  }
4013
4364
  ),
4014
- workbench === "video" && workspace === void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("main", { id: compactVideoStudioId, className: "oh-video-studio", role: "tabpanel", "aria-labelledby": `${compactTabsId}-studio-tab`, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-video-preview-empty", children: error ?? "\u6B63\u5728\u8FDE\u63A5\u89C6\u9891\u5DE5\u4F5C\u53F0\u2026" }) }),
4015
- workspace !== void 0 && videoStudioMounted && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4365
+ workbench === "video" && workspace === void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("main", { id: compactVideoStudioId, className: "oh-video-studio", role: "tabpanel", "aria-labelledby": `${compactTabsId}-studio-tab`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-video-preview-empty", children: error ?? "\u6B63\u5728\u8FDE\u63A5\u89C6\u9891\u5DE5\u4F5C\u53F0\u2026" }) }),
4366
+ workspace !== void 0 && videoStudioMounted && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4016
4367
  VideoStudio,
4017
4368
  {
4018
4369
  sessionId,
@@ -4032,24 +4383,24 @@ function CreativeWorkbench({
4032
4383
  }
4033
4384
  }
4034
4385
  ),
4035
- workbench !== "game" && workbench !== "video" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4036
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("aside", { className: "oh-story-tree", children: [
4037
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-brand", children: [
4038
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-story-brand-cluster", children: [
4039
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("strong", { children: [
4386
+ workbench !== "game" && workbench !== "video" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4387
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("aside", { className: "oh-story-tree", children: [
4388
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-brand", children: [
4389
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "oh-story-brand-cluster", children: [
4390
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("strong", { children: [
4040
4391
  "\u2726 ",
4041
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Oh Story" })
4392
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Oh Story" })
4042
4393
  ] }),
4043
- workspaceKind !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "oh-story-kind", children: workspaceKind === "story" ? "\u5C0F\u8BF4" : "\u77ED\u5267" })
4394
+ workspaceKind !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "oh-story-kind", children: workspaceKind === "story" ? "\u5C0F\u8BF4" : "\u77ED\u5267" })
4044
4395
  ] }),
4045
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-story-brand-actions", children: [
4046
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: reload, title: "\u5237\u65B0", "aria-label": "\u5237\u65B0\u9879\u76EE\u6587\u4EF6", children: "\u21BB" }),
4047
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
4396
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "oh-story-brand-actions", children: [
4397
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: reload, title: "\u5237\u65B0", "aria-label": "\u5237\u65B0\u9879\u76EE\u6587\u4EF6", children: "\u21BB" }),
4398
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
4048
4399
  applyWorkbenchPreference("closed");
4049
4400
  }, title: "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", "aria-label": "\u6536\u8D77\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: "\xD7" })
4050
4401
  ] })
4051
4402
  ] }),
4052
- workspace !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: WORKBENCH_MODES.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4403
+ workspace !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-mode-tabs", role: "tablist", "aria-label": "\u521B\u4F5C\u5DE5\u4F5C\u53F0", children: WORKBENCH_MODES.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4053
4404
  "button",
4054
4405
  {
4055
4406
  type: "button",
@@ -4066,18 +4417,18 @@ function CreativeWorkbench({
4066
4417
  },
4067
4418
  mode
4068
4419
  )) }),
4069
- error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-error", children: error }),
4070
- workspace?.metadataErrors.map((message) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-warning", children: message }, message)),
4071
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { ref: navRef, "aria-label": workbench === "story" ? "\u5C0F\u8BF4\u9879\u76EE\u6587\u4EF6" : "\u77ED\u5267\u9879\u76EE\u6587\u4EF6", children: groups.map(([directory2, files]) => {
4420
+ error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-error", children: error }),
4421
+ workspace?.metadataErrors.map((message) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-warning", children: message }, message)),
4422
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("nav", { ref: navRef, "aria-label": workbench === "story" ? "\u5C0F\u8BF4\u9879\u76EE\u6587\u4EF6" : "\u77ED\u5267\u9879\u76EE\u6587\u4EF6", children: groups.map(([directory2, files]) => {
4072
4423
  let groupOpen = selectedGroup === directory2 || expanded[directory2] === !0;
4073
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "oh-story-file-group", open: groupOpen, onToggle: (event) => {
4424
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "oh-story-file-group", open: groupOpen, onToggle: (event) => {
4074
4425
  toggleGroup(directory2, event.currentTarget.open);
4075
4426
  }, children: [
4076
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
4427
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
4077
4428
  directory2,
4078
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: files.length })
4429
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: files.length })
4079
4430
  ] }),
4080
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4431
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4081
4432
  FileTreeNodes,
4082
4433
  {
4083
4434
  nodes: buildFileTree(files, directory2),
@@ -4092,14 +4443,14 @@ function CreativeWorkbench({
4092
4443
  ] }, directory2);
4093
4444
  }) })
4094
4445
  ] }),
4095
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("main", { className: "oh-story-editor", children: [
4096
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { children: [
4097
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "oh-story-editor-path", title: selected, children: [
4098
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: selectedLabel }),
4099
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: selectedBasename })
4446
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("main", { className: "oh-story-editor", children: [
4447
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { children: [
4448
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "oh-story-editor-path", title: selected, children: [
4449
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: selectedLabel }),
4450
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: selectedBasename })
4100
4451
  ] }),
4101
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-editor-actions", children: [
4102
- (previewable || productionAvailable) && !selectedMedia && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-editor-tabs", role: "tablist", "aria-label": productionAvailable ? "\u77ED\u5267\u6587\u6863\u67E5\u770B\u65B9\u5F0F" : markdown ? "Markdown \u67E5\u770B\u65B9\u5F0F" : "JSONL \u67E5\u770B\u65B9\u5F0F", children: editorModes.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4452
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-editor-actions", children: [
4453
+ (previewable || productionAvailable) && !selectedMedia && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-editor-tabs", role: "tablist", "aria-label": productionAvailable ? "\u77ED\u5267\u6587\u6863\u67E5\u770B\u65B9\u5F0F" : markdown ? "Markdown \u67E5\u770B\u65B9\u5F0F" : "JSONL \u67E5\u770B\u65B9\u5F0F", children: editorModes.map((mode) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4103
4454
  "button",
4104
4455
  {
4105
4456
  type: "button",
@@ -4116,48 +4467,48 @@ function CreativeWorkbench({
4116
4467
  },
4117
4468
  mode
4118
4469
  )) }),
4119
- (dirty || saving) && selected !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { className: "oh-story-save", type: "button", disabled: saving || buffer?.missing === !0, onClick: () => {
4470
+ (dirty || saving) && selected !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "oh-story-save", type: "button", disabled: saving || buffer?.missing === !0, onClick: () => {
4120
4471
  savePath(selected);
4121
4472
  }, children: saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58" })
4122
4473
  ] })
4123
4474
  ] }),
4124
- activity !== void 0 && activityPath !== void 0 && activityPath === selected && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-stream", "data-stage": activity.stage, role: "status", "aria-live": "polite", children: [
4475
+ activity !== void 0 && activityPath !== void 0 && activityPath === selected && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-stream", "data-stage": activity.stage, role: "status", "aria-live": "polite", children: [
4125
4476
  "\u25CF ",
4126
4477
  activity.stage === "running" ? "Agent \u6B63\u5728\u5E94\u7528\u4FEE\u6539" : "Agent \u6B63\u5728\u751F\u6210\u6587\u4EF6\u5185\u5BB9"
4127
4478
  ] }),
4128
- conflict !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-conflict", role: "alert", children: [
4129
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: conflict.message }),
4130
- conflict.theirs !== void 0 && conflict.theirsVersion !== void 0 && selected !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
4131
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
4479
+ conflict !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-conflict", role: "alert", children: [
4480
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: conflict.message }),
4481
+ conflict.theirs !== void 0 && conflict.theirsVersion !== void 0 && selected !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
4482
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
4132
4483
  resolveConflict(!1);
4133
4484
  }, children: "\u8F7D\u5165\u78C1\u76D8\u7248\u672C" }),
4134
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
4485
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
4135
4486
  resolveConflict(!0);
4136
4487
  }, children: "\u4FDD\u7559\u672C\u5730\u8349\u7A3F" })
4137
4488
  ] })
4138
4489
  ] }),
4139
- fileError !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-error", children: fileError }),
4140
- selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-empty", children: workbench === "story" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4490
+ fileError !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-error", children: fileError }),
4491
+ selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-empty", children: workbench === "story" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4141
4492
  "\u5F53\u524D workspace \u8FD8\u6CA1\u6709\u5C0F\u8BF4\u6587\u4EF6\u3002\u53EF\u5728\u53F3\u4FA7 Chat \u4E2D\u8FD0\u884C ",
4142
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/story-setup" }),
4493
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/story-setup" }),
4143
4494
  "\u3002"
4144
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4495
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4145
4496
  "\u5F53\u524D workspace \u8FD8\u6CA1\u6709\u77ED\u5267\u9879\u76EE\u3002\u53EF\u5728\u53F3\u4FA7 Chat \u4E2D\u8FD0\u884C ",
4146
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/short-drama" }),
4497
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/short-drama" }),
4147
4498
  "\u3002"
4148
- ] }) }) : selectedMedia && selectedFile !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "oh-story-media-document", children: selectedFile.mimeType?.startsWith("image/") === !0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: endpoint("media", sessionId, selectedFile.path), alt: selectedFile.path }) : selectedFile.mimeType?.startsWith("audio/") === !0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("audio", { src: endpoint("media", sessionId, selectedFile.path), controls: !0 }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("video", { src: endpoint("media", sessionId, selectedFile.path), controls: !0, preload: "metadata" }) }) : buffer === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-empty", children: [
4499
+ ] }) }) : selectedMedia && selectedFile !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "oh-story-media-document", children: selectedFile.mimeType?.startsWith("image/") === !0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: endpoint("media", sessionId, selectedFile.path), alt: selectedFile.path }) : selectedFile.mimeType?.startsWith("audio/") === !0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("audio", { src: endpoint("media", sessionId, selectedFile.path), controls: !0 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("video", { src: endpoint("media", sessionId, selectedFile.path), controls: !0, preload: "metadata" }) }) : buffer === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-empty", children: [
4149
4500
  "\u6B63\u5728\u52A0\u8F7D ",
4150
4501
  selected,
4151
4502
  "\u2026"
4152
- ] }) : buffer.missing === !0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "oh-story-empty", children: [
4503
+ ] }) : buffer.missing === !0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "oh-story-empty", children: [
4153
4504
  "\u6587\u4EF6\u5DF2\u4ECE workspace \u79FB\u9664\uFF0C\u672C\u5730\u8349\u7A3F\u4ECD\u4FDD\u7559\u3002\u8BF7\u5148\u590D\u5236\u9700\u8981\u7684\u5185\u5BB9\uFF0C\u518D\u653E\u5F03\u8349\u7A3F\u3002",
4154
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
4505
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
4155
4506
  setBuffers((current) => {
4156
4507
  let next = { ...current };
4157
4508
  return delete next[selected], next;
4158
4509
  }), setSelected(workspace === void 0 ? void 0 : preferredWorkbenchFile(workspace.files, workbench));
4159
4510
  }, children: "\u653E\u5F03\u672C\u5730\u8349\u7A3F" })
4160
- ] }) : editorMode === "production" && productionAvailable && episodeProduction !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4511
+ ] }) : editorMode === "production" && productionAvailable && episodeProduction !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4161
4512
  DramaProductionView,
4162
4513
  {
4163
4514
  sessionId,
@@ -4173,7 +4524,7 @@ function CreativeWorkbench({
4173
4524
  manualReferences: productionReferences,
4174
4525
  sequence: productionSequence,
4175
4526
  canvas: productionCanvas,
4176
- zoom: productionZoom,
4527
+ viewport: productionViewport,
4177
4528
  onSectionChange: setProductionSection,
4178
4529
  onSelect: setProductionSelectedId,
4179
4530
  onNavigate: navigateProductionTarget,
@@ -4185,13 +4536,13 @@ function CreativeWorkbench({
4185
4536
  },
4186
4537
  onSequenceChange: setProductionSequence,
4187
4538
  onCanvasChange: setProductionCanvas,
4188
- onZoomChange: setProductionZoom,
4539
+ onViewportChange: setProductionViewport,
4189
4540
  onDispatchPrompt: sendProductionPrompt,
4190
4541
  onCancelTurn: cancelProduction,
4191
4542
  onRemoveQueued: removeQueuedProduction,
4192
4543
  onRefresh: reload
4193
4544
  }
4194
- ) : previewable && editorMode === "preview" ? markdown ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MarkdownPreview, { content: buffer.content, label: selected }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JsonlPreview, { content: buffer.content, label: selected }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4545
+ ) : previewable && editorMode === "preview" ? markdown ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MarkdownPreview, { content: buffer.content, label: selected }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(JsonlPreview, { content: buffer.content, label: selected }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4195
4546
  "textarea",
4196
4547
  {
4197
4548
  ref: textareaRef,
@@ -4220,43 +4571,43 @@ function CreativeWorkbench({
4220
4571
  )
4221
4572
  ] })
4222
4573
  ] })
4223
- ] }) : !creativeProject && error === void 0 ? welcome ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WelcomeGuide, {}) : null : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: surfaceRef, className: "oh-story-split-surface", "data-open": "false", children: [
4224
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4225
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { className: "oh-story-launcher", type: "button", title: error ?? "\u6253\u5F00\u521B\u4F5C\u5DE5\u4F5C\u53F0", "aria-label": "\u6253\u5F00\u521B\u4F5C\u5DE5\u4F5C\u53F0", onClick: () => {
4574
+ ] }) : !creativeProject && error === void 0 ? welcome ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WelcomeGuide, {}) : null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: surfaceRef, className: "oh-story-split-surface", "data-open": "false", children: [
4575
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4576
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { className: "oh-story-launcher", type: "button", title: error ?? "\u6253\u5F00\u521B\u4F5C\u5DE5\u4F5C\u53F0", "aria-label": "\u6253\u5F00\u521B\u4F5C\u5DE5\u4F5C\u53F0", onClick: () => {
4226
4577
  applyWorkbenchPreference("open");
4227
4578
  }, children: [
4228
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": !0, children: "\u2726" }),
4229
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: "\u521B\u4F5C\u5DE5\u4F5C\u53F0" })
4579
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": !0, children: "\u2726" }),
4580
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u521B\u4F5C\u5DE5\u4F5C\u53F0" })
4230
4581
  ] })
4231
4582
  ] });
4232
4583
  }
4233
4584
  function CreativeSplitBridge(props) {
4234
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SessionWorkbenchMemory, { ...props }, props.sessionId);
4585
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionWorkbenchMemory, { ...props }, props.sessionId);
4235
4586
  }
4236
4587
  function SessionWorkbenchMemory(props) {
4237
4588
  let { sessionId, useStore, actions } = props, hydrated = useStore((state) => state.hydrated);
4238
- return (0, import_react3.useLayoutEffect)(() => {
4589
+ return (0, import_react4.useLayoutEffect)(() => {
4239
4590
  hydrated || actions.restore(workbenchMemoryBySession.get(sessionId));
4240
- }, [actions, hydrated, sessionId]), hydrated ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4241
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkbenchMemoryMirror, { sessionId, useStore }),
4242
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SessionWorkbenchBridge, { ...props })
4591
+ }, [actions, hydrated, sessionId]), hydrated ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4592
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkbenchMemoryMirror, { sessionId, useStore }),
4593
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionWorkbenchBridge, { ...props })
4243
4594
  ] }) : null;
4244
4595
  }
4245
4596
  function WorkbenchMemoryMirror({ sessionId, useStore }) {
4246
4597
  let memory = useStore((state) => state);
4247
- return (0, import_react3.useEffect)(() => {
4598
+ return (0, import_react4.useEffect)(() => {
4248
4599
  workbenchMemoryBySession.set(sessionId, memory);
4249
4600
  }, [memory, sessionId]), null;
4250
4601
  }
4251
4602
  function SessionWorkbenchBridge({ sessionId, useSession, useSessions, useProjection, useChat, useStore, actions, sendProductionPrompt, cancelProduction, removeQueuedProduction }) {
4252
- let marker = (0, import_react3.useRef)(null), [target, setTarget] = (0, import_react3.useState)(), runningCalls = useChat((snapshot) => snapshot.legacy.runningCalls), partial = useChat((snapshot) => streamingAssistant(snapshot.timeline)), undispatched = useChat((snapshot) => undispatchedCalls(snapshot), sameUndispatchedCalls), settledMutation = useChat((snapshot) => latestSettledMutation(snapshot)), settledMutationTurn = useChat((snapshot) => latestSettledMutationTurn(snapshot)), liveTurn = useChat((snapshot) => openTurn(snapshot)), workbench = useStore((memory) => memory.workbench), gamePane = useStore((memory) => memory.gamePane), videoPane = useStore((memory) => memory.videoPane), sessionRunning = useSession((snapshot) => snapshot.running), inboxRows = useProjection("inbox", (inbox) => inbox?.["next-turn"]), pendingSubmissions = useSession((snapshot) => snapshot.pendingSubmissions), productionQueue = (0, import_react3.useMemo)(() => productionQueueFromInbox(
4603
+ let marker = (0, import_react4.useRef)(null), [target, setTarget] = (0, import_react4.useState)(), runningCalls = useChat((snapshot) => snapshot.legacy.runningCalls), partial = useChat((snapshot) => streamingAssistant(snapshot.timeline)), undispatched = useChat((snapshot) => undispatchedCalls(snapshot), sameUndispatchedCalls), settledMutation = useChat((snapshot) => latestSettledMutation(snapshot)), settledMutationTurn = useChat((snapshot) => latestSettledMutationTurn(snapshot)), liveTurn = useChat((snapshot) => openTurn(snapshot)), workbench = useStore((memory) => memory.workbench), gamePane = useStore((memory) => memory.gamePane), videoPane = useStore((memory) => memory.videoPane), sessionRunning = useSession((snapshot) => snapshot.running), inboxRows = useProjection("inbox", (inbox) => inbox?.["next-turn"]), pendingSubmissions = useSession((snapshot) => snapshot.pendingSubmissions), productionQueue = (0, import_react4.useMemo)(() => productionQueueFromInbox(
4253
4604
  inboxRows,
4254
4605
  new Set(pendingSubmissions.filter((item) => item.placement === "transcript").map((item) => item.requestId))
4255
- ), [inboxRows, pendingSubmissions]), chat = useChat((snapshot) => snapshot), productionIntents = (0, import_react3.useMemo)(() => settledProductionIntents(chat), [chat]), { workspace, error, loading: workspaceLoading, reload } = useWorkspace(sessionId), chosenPreference = useStore((memory) => memory.workbenchPreference), creativeProject = hasCreativeProject(workspace), welcome = useSessions((state) => state.byId[sessionId]?.blank === !0) && workspace !== void 0 && !workspaceLoading && !creativeProject, storedPreference = (0, import_react3.useMemo)(
4606
+ ), [inboxRows, pendingSubmissions]), chat = useChat((snapshot) => snapshot), productionIntents = (0, import_react4.useMemo)(() => settledProductionIntents(chat), [chat]), { workspace, error, loading: workspaceLoading, reload } = useWorkspace(sessionId), chosenPreference = useStore((memory) => memory.workbenchPreference), creativeProject = hasCreativeProject(workspace), welcome = useSessions((state) => state.byId[sessionId]?.blank === !0) && workspace !== void 0 && !workspaceLoading && !creativeProject, storedPreference = (0, import_react4.useMemo)(
4256
4607
  () => readWorkbenchPreference(workbenchPreferenceStorage(), workspace?.cwd),
4257
4608
  [workspace?.cwd]
4258
4609
  ), open = resolveWorkbenchOpen(chosenPreference ?? storedPreference, creativeProject);
4259
- return (0, import_react3.useLayoutEffect)(() => {
4610
+ return (0, import_react4.useLayoutEffect)(() => {
4260
4611
  let document = marker.current?.ownerDocument;
4261
4612
  if (document === void 0) return;
4262
4613
  let locate = () => {
@@ -4270,7 +4621,7 @@ function SessionWorkbenchBridge({ sessionId, useSession, useSessions, useProject
4270
4621
  return observer.observe(document.body, { childList: !0, subtree: !0 }), () => {
4271
4622
  observer.disconnect();
4272
4623
  };
4273
- }, [sessionId]), (0, import_react3.useLayoutEffect)(() => {
4624
+ }, [sessionId]), (0, import_react4.useLayoutEffect)(() => {
4274
4625
  let scroller = target?.parentElement;
4275
4626
  if (scroller == null) return;
4276
4627
  if (!open) {
@@ -4319,9 +4670,9 @@ function SessionWorkbenchBridge({ sessionId, useSession, useSessions, useProject
4319
4670
  scroller.removeEventListener(driven, markDriven);
4320
4671
  observer.disconnect(), seats.disconnect(), scroller.style.removeProperty("--oh-story-scroll-height"), scroller.style.removeProperty("--oh-story-composer-height"), delete scroller.dataset.ohStoryLayout, delete scroller.dataset.ohStoryWorkbench, delete scroller.dataset.ohStudioPane;
4321
4672
  };
4322
- }, [gamePane, open, target, videoPane, workbench]), /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4323
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { ref: marker, className: "oh-story-bridge-marker", "aria-hidden": !0 }),
4324
- target === void 0 ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4673
+ }, [gamePane, open, target, videoPane, workbench]), /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4674
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref: marker, className: "oh-story-bridge-marker", "aria-hidden": !0 }),
4675
+ target === void 0 ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
4325
4676
  CreativeWorkbench,
4326
4677
  {
4327
4678
  sessionId,
@@ -4351,31 +4702,31 @@ function SessionWorkbenchBridge({ sessionId, useSession, useSessions, useProject
4351
4702
  ] });
4352
4703
  }
4353
4704
  function WelcomeGuide() {
4354
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "oh-story-welcome", "aria-label": "Oh Story \u4F7F\u7528\u5F15\u5BFC", children: [
4355
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4356
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { children: "Oh Story \u5DF2\u52A0\u8F7D" }),
4357
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\u4F5C\u54C1\u76EE\u5F55\u4E2D\u6709\u521B\u4F5C\u6587\u4EF6\u65F6\uFF0C\u5C0F\u8BF4\u3001\u77ED\u5267\u3001\u6E38\u620F\u3001\u89C6\u9891\u5DE5\u4F5C\u53F0\u4F1A\u81EA\u52A8\u663E\u793A\u3002" }),
4358
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("ol", { children: [
4359
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: "\u70B9\u51FB\u5DE6\u4FA7\u300C\u5DE5\u4F5C\u533A / Workspaces\u300D\u65C1\u7684\u300C\u6DFB\u52A0\u5DE5\u4F5C\u533A / Add workspace\u300D\uFF0C\u9009\u62E9\u5B58\u653E\u4F5C\u54C1\u7684\u6587\u4EF6\u5939\u3002" }),
4360
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: "\u5728\u4E0B\u65B9\u300C\u9009\u62E9\u5DE5\u4F5C\u533A / Choose workspace\u300D\u4E2D\u9009\u4E2D\u8BE5\u76EE\u5F55\uFF0C\u6216\u6253\u5F00\u5DF2\u6709\u4F1A\u8BDD\u3002" }),
4361
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: "\u7A7A\u76EE\u5F55\uFF08\u5305\u62EC DSH \u81EA\u52A8\u5EFA\u7ACB\u7684\u300C\u9ED8\u8BA4\u5DE5\u4F5C\u533A / Default workspace\u300D\uFF09\u5148\u5728 Chat \u4E2D\u5F00\u59CB\u521B\u4F5C\uFF0C\u751F\u6210\u7B2C\u4E00\u4E2A\u521B\u4F5C\u6587\u4EF6\u540E\uFF0C\u5DE5\u4F5C\u53F0\u4F1A\u81EA\u52A8\u51FA\u73B0\u3002" })
4705
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "oh-story-welcome", "aria-label": "Oh Story \u4F7F\u7528\u5F15\u5BFC", children: [
4706
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4707
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { children: "Oh Story \u5DF2\u52A0\u8F7D" }),
4708
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "\u4F5C\u54C1\u76EE\u5F55\u4E2D\u6709\u521B\u4F5C\u6587\u4EF6\u65F6\uFF0C\u5C0F\u8BF4\u3001\u77ED\u5267\u3001\u6E38\u620F\u3001\u89C6\u9891\u5DE5\u4F5C\u53F0\u4F1A\u81EA\u52A8\u663E\u793A\u3002" }),
4709
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("ol", { children: [
4710
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: "\u70B9\u51FB\u5DE6\u4FA7\u300C\u5DE5\u4F5C\u533A / Workspaces\u300D\u65C1\u7684\u300C\u6DFB\u52A0\u5DE5\u4F5C\u533A / Add workspace\u300D\uFF0C\u9009\u62E9\u5B58\u653E\u4F5C\u54C1\u7684\u6587\u4EF6\u5939\u3002" }),
4711
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: "\u5728\u4E0B\u65B9\u300C\u9009\u62E9\u5DE5\u4F5C\u533A / Choose workspace\u300D\u4E2D\u9009\u4E2D\u8BE5\u76EE\u5F55\uFF0C\u6216\u6253\u5F00\u5DF2\u6709\u4F1A\u8BDD\u3002" }),
4712
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: "\u7A7A\u76EE\u5F55\uFF08\u5305\u62EC DSH \u81EA\u52A8\u5EFA\u7ACB\u7684\u300C\u9ED8\u8BA4\u5DE5\u4F5C\u533A / Default workspace\u300D\uFF09\u5148\u5728 Chat \u4E2D\u5F00\u59CB\u521B\u4F5C\uFF0C\u751F\u6210\u7B2C\u4E00\u4E2A\u521B\u4F5C\u6587\u4EF6\u540E\uFF0C\u5DE5\u4F5C\u53F0\u4F1A\u81EA\u52A8\u51FA\u73B0\u3002" })
4362
4713
  ] }),
4363
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
4714
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { children: [
4364
4715
  "\u67E5\u770B\u5DF2\u6709\u4F5C\u54C1\u65E0\u9700 API Key\u3002\u5F00\u59CB AI \u521B\u4F5C\u524D\uFF0C\u5728\u300C\u8BBE\u7F6E \u2192 \u6A21\u578B\u300D\u914D\u7F6E\u6A21\u578B\uFF0C\u518D\u8F93\u5165 ",
4365
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/story" }),
4716
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/story" }),
4366
4717
  "\u3001",
4367
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/short-drama" }),
4718
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/short-drama" }),
4368
4719
  "\u3001",
4369
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/novel-to-game quick" }),
4720
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/novel-to-game quick" }),
4370
4721
  " \u6216 ",
4371
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "/video-recap" }),
4722
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: "/video-recap" }),
4372
4723
  "\u3002"
4373
4724
  ] })
4374
4725
  ] });
4375
4726
  }
4376
4727
  function WorkbenchWelcome() {
4377
- let marker = (0, import_react3.useRef)(null), [target, setTarget] = (0, import_react3.useState)();
4378
- return (0, import_react3.useLayoutEffect)(() => {
4728
+ let marker = (0, import_react4.useRef)(null), [target, setTarget] = (0, import_react4.useState)();
4729
+ return (0, import_react4.useLayoutEffect)(() => {
4379
4730
  let document = marker.current?.ownerDocument;
4380
4731
  if (document === void 0) return;
4381
4732
  let locate = () => {
@@ -4387,13 +4738,13 @@ function WorkbenchWelcome() {
4387
4738
  return observer.observe(document.body, { childList: !0, subtree: !0 }), () => {
4388
4739
  observer.disconnect();
4389
4740
  };
4390
- }, []), /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
4391
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { ref: marker, className: "oh-story-bridge-marker", "aria-hidden": !0 }),
4392
- target === void 0 ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WelcomeGuide, {}), target)
4741
+ }, []), /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
4742
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref: marker, className: "oh-story-bridge-marker", "aria-hidden": !0 }),
4743
+ target === void 0 ? null : (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WelcomeGuide, {}), target)
4393
4744
  ] });
4394
4745
  }
4395
4746
  function WorkbenchSeat({ SessionProvider, renderSlot }) {
4396
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SessionProvider, { empty: () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkbenchWelcome, {}), children: renderSlot("oh-story.workspace", {}) });
4747
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionProvider, { empty: () => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkbenchWelcome, {}), children: renderSlot("oh-story.workspace", {}) });
4397
4748
  }
4398
4749
  function argsOf(block) {
4399
4750
  let raw = ("kind" in block ? block.call?.argsRaw : block.phase === "start" ? block.argsRaw : void 0) ?? "{}";
@@ -4411,32 +4762,32 @@ function resultOf(block) {
4411
4762
  }
4412
4763
  function RoleToolView({ block, inspect }) {
4413
4764
  let args = argsOf(block), role = typeof args.role == "string" ? args.role : "story-role", output = resultOf(block), state = "kind" in block ? block.isError ? "error" : "done" : "running";
4414
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "oh-story-role", "data-state": state, children: [
4415
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4416
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
4417
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u2726 Role" }),
4418
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: role }),
4419
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: state === "running" ? "\u8FD0\u884C\u4E2D" : state === "error" ? "\u5931\u8D25" : "\u5B8C\u6210" })
4765
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "oh-story-role", "data-state": state, children: [
4766
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4767
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
4768
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u2726 Role" }),
4769
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: role }),
4770
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { children: state === "running" ? "\u8FD0\u884C\u4E2D" : state === "error" ? "\u5931\u8D25" : "\u5B8C\u6210" })
4420
4771
  ] }),
4421
- output !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { children: output }),
4422
- inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: inspect, children: "\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5" })
4772
+ output !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("pre", { children: output }),
4773
+ inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: inspect, children: "\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5" })
4423
4774
  ] });
4424
4775
  }
4425
4776
  function ProductionToolView({ block, inspect }) {
4426
4777
  let args = argsOf(block), action = typeof args.action == "string" ? args.action : "production", episode = typeof args.episode == "string" ? args.episode : "\u77ED\u5267", state = "kind" in block ? block.isError ? "error" : "done" : "running";
4427
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "oh-story-role", "data-state": state, children: [
4428
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("style", { children: plugin_default }),
4429
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
4430
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u25A6 \u751F\u4EA7" }),
4431
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("strong", { children: [
4778
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "oh-story-role", "data-state": state, children: [
4779
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("style", { children: plugin_default }),
4780
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("summary", { children: [
4781
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u25A6 \u751F\u4EA7" }),
4782
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("strong", { children: [
4432
4783
  episode,
4433
4784
  " \xB7 ",
4434
4785
  action
4435
4786
  ] }),
4436
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("em", { children: state === "running" ? "\u6267\u884C\u4E2D" : state === "error" ? "\u5931\u8D25" : "\u5DF2\u5E94\u7528" })
4787
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { children: state === "running" ? "\u6267\u884C\u4E2D" : state === "error" ? "\u5931\u8D25" : "\u5DF2\u5E94\u7528" })
4437
4788
  ] }),
4438
- resultOf(block) !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pre", { children: resultOf(block) }),
4439
- inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: inspect, children: "\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5" })
4789
+ resultOf(block) !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("pre", { children: resultOf(block) }),
4790
+ inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: inspect, children: "\u5728\u8F68\u8FF9\u4E2D\u68C0\u67E5" })
4440
4791
  ] });
4441
4792
  }
4442
4793
  function apply(context) {