@oh-story/dsh 0.1.4 → 0.1.5
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.
- package/README.md +56 -12
- package/lib/client.js +2692 -268
- package/lib/client.js.map +4 -4
- package/lib/drama/manifest.json +136 -101
- package/lib/drama/skills/short-drama/SKILL.md +61 -1
- package/lib/drama/skills/short-drama/references/contract-and-ownership.md +7 -4
- package/lib/drama/skills/short-drama/references/creator-documents.md +133 -8
- package/lib/drama/skills/short-drama/references/creator-workflow.md +38 -2
- package/lib/drama/skills/short-drama/references/knowhow-index.md +3 -0
- package/lib/drama/skills/short-drama/references/reference-roles.md +10 -7
- package/lib/drama/skills/short-drama/references/runtime-preflight.md +3 -0
- package/lib/drama/skills/short-drama/scripts/creator_markdown_check.py +1002 -0
- package/lib/drama/skills/short-drama/scripts/project_tool.py +485 -5
- package/lib/drama/skills/short-drama-assets/SKILL.md +13 -3
- package/lib/drama/skills/short-drama-assets/references/continuity-lock.md +116 -0
- package/lib/drama/skills/short-drama-assets/references/identity-vs-variant.md +2 -1
- package/lib/drama/skills/short-drama-assets/references/prop-and-state.md +19 -0
- package/lib/drama/skills/short-drama-assets/references/stage-contract.md +2 -0
- package/lib/drama/skills/short-drama-assets/scripts/asset_check.py +1 -1
- package/lib/drama/skills/short-drama-image-prompts/SKILL.md +6 -2
- package/lib/drama/skills/short-drama-image-prompts/references/common-recipe.md +4 -3
- package/lib/drama/skills/short-drama-image-prompts/references/lookdev-frame.md +1 -1
- package/lib/drama/skills/short-drama-image-prompts/references/review-and-fixtures.md +1 -1
- package/lib/drama/skills/short-drama-image-prompts/references/stage-contract.md +3 -1
- package/lib/drama/skills/short-drama-image-prompts/scripts/image_prompt_check.py +8 -8
- package/lib/drama/skills/short-drama-image-prompts/scripts/selftest.py +4 -2
- package/lib/drama/skills/short-drama-produce/SKILL.md +46 -10
- package/lib/drama/skills/short-drama-produce/references/adapter-contract.md +65 -8
- package/lib/drama/skills/short-drama-produce/references/providers/minimax-h3-video.md +85 -0
- package/lib/drama/skills/short-drama-produce/references/providers/seedance.md +27 -10
- package/lib/drama/skills/short-drama-produce/scripts/production_tool.py +362 -3
- package/lib/drama/skills/short-drama-produce/scripts/provider_adapters.py +627 -40
- package/lib/drama/skills/short-drama-produce/scripts/selftest.py +5 -4
- package/lib/drama/skills/short-drama-review/references/rubric-visual-motion.md +12 -0
- package/lib/drama/skills/short-drama-review/scripts/review_check.py +1 -1
- package/lib/drama/skills/short-drama-storyboard/SKILL.md +76 -7
- package/lib/drama/skills/short-drama-storyboard/assets/shot-template.jsonl +1 -1
- package/lib/drama/skills/short-drama-storyboard/references/keyframe-craft.md +6 -2
- package/lib/drama/skills/short-drama-storyboard/references/production-shot-grammar.md +19 -4
- package/lib/drama/skills/short-drama-storyboard/references/review-and-fixtures.md +5 -2
- package/lib/drama/skills/short-drama-storyboard/references/screenplay-to-keyframe-example.md +16 -0
- package/lib/drama/skills/short-drama-storyboard/references/stage-contract.md +8 -3
- package/lib/drama/skills/short-drama-storyboard/scripts/storyboard_check.py +1 -1
- package/lib/drama/skills/short-drama-video-prompts/SKILL.md +81 -13
- package/lib/drama/skills/short-drama-video-prompts/assets/motion-spec.jsonl.md +6 -1
- package/lib/drama/skills/short-drama-video-prompts/assets/video-prompts.md +17 -1
- package/lib/drama/skills/short-drama-video-prompts/references/delivery-profile.md +21 -1
- package/lib/drama/skills/short-drama-video-prompts/references/minimax-h3.md +154 -0
- package/lib/drama/skills/short-drama-video-prompts/references/motion-recipe.md +24 -6
- package/lib/drama/skills/short-drama-video-prompts/references/production-prompt-grammar.md +11 -7
- package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.0.md +41 -0
- package/lib/drama/skills/short-drama-video-prompts/references/seedance-2.5.md +66 -0
- package/lib/drama/skills/short-drama-video-prompts/references/stage-contract.md +5 -2
- package/lib/drama/skills/short-drama-video-prompts/references/target-model-profile.md +115 -0
- package/lib/drama/skills/short-drama-video-prompts/scripts/container_check.py +1 -1
- package/lib/drama/skills/short-drama-video-prompts/scripts/music_spec_check.py +1 -1
- package/lib/drama/skills/short-drama-write/SKILL.md +3 -2
- package/lib/drama/skills/short-drama-write/scripts/duration_estimate.py +1 -1
- package/lib/drama/skills/short-drama-write/scripts/screenplay_index.py +2 -2
- package/lib/drama/skills/short-drama-write/scripts/voice_sheet_check.py +1 -1
- package/lib/index.js +865 -33
- package/lib/index.js.map +4 -4
- package/lib/novel-to-game/LICENSE +21 -0
- package/lib/novel-to-game/README.md +180 -0
- package/lib/novel-to-game/README_ZH.md +178 -0
- package/lib/novel-to-game/VERSION +1 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/BUILD_BRIEF.md +217 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/.vercelignore +3 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/RUN.md +130 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/bg/compound_new_guofeng.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/finale/fate_coda.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/finale/meng.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/finale/pan.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/finale/pinger.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/finale/xuee.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/finale/yue.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_accord_five.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_afterglow_five.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_alliance.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/public_day10.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/public_day15.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/public_day5.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/group/title_new_guofeng.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/joint/pan_pinger.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/joint/pan_xuee.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/joint/yue_meng.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/joint/yue_pan.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/joint/yue_pinger.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/meng/explicit.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/meng/prelude.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/milestone/meng.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/milestone/pan.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/milestone/pinger.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/milestone/xuee.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/milestone/yue.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/pan/explicit.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/pan/prelude.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/pinger/explicit.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/pinger/prelude.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/xuee/explicit.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/xuee/prelude.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/yue/explicit.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/cg/yue/prelude.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/heroine/meng/night.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/heroine/pan/night.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/heroine/pinger/night.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/heroine/xuee/night.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/heroine/yue/night.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/household/li_jiaoer.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/assets/scene/gate_collector.webp +0 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/new-guofeng.css +1105 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/css/style.css +2539 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/index.html +18 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/assets.js +147 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/audio.js +332 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/data.js +7472 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/engine.js +13077 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/main.js +3028 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/js/text.js +32 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/package.json +10 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/app/vercel.json +23 -0
- package/lib/novel-to-game/examples/jin-ping-mei/build/art/generated-art.json +161 -0
- package/lib/novel-to-game/examples/jin-ping-mei/example.json +12 -0
- package/lib/novel-to-game/examples/jin-ping-mei/qa/README.md +31 -0
- package/lib/novel-to-game/examples/jin-ping-mei/qa/playable-model.json +99 -0
- package/lib/novel-to-game/examples/jin-ping-mei/qa/verification.json +41 -0
- package/lib/novel-to-game/examples/jin-ping-mei/qa/verify_playable_model.mjs +129 -0
- package/lib/novel-to-game/manifest.json +508 -0
- package/lib/novel-to-game/skills/game-art-direction/SKILL.md +73 -0
- package/lib/novel-to-game/skills/game-art-direction/agents/openai.yaml +4 -0
- package/lib/novel-to-game/skills/game-art-direction/references/art-direction-method.md +119 -0
- package/lib/novel-to-game/skills/game-build/SKILL.md +84 -0
- package/lib/novel-to-game/skills/game-build/agents/openai.yaml +4 -0
- package/lib/novel-to-game/skills/game-build/references/build-brief-contract.md +109 -0
- package/lib/novel-to-game/skills/game-build/references/generative-media-pipeline.md +56 -0
- package/lib/novel-to-game/skills/game-build/references/playable-model-contract.md +81 -0
- package/lib/novel-to-game/skills/game-build/references/tts-production-contract.md +37 -0
- package/lib/novel-to-game/skills/game-concept/SKILL.md +72 -0
- package/lib/novel-to-game/skills/game-concept/agents/openai.yaml +4 -0
- package/lib/novel-to-game/skills/game-concept/references/concept-method.md +94 -0
- package/lib/novel-to-game/skills/game-qa/SKILL.md +50 -0
- package/lib/novel-to-game/skills/game-qa/agents/openai.yaml +4 -0
- package/lib/novel-to-game/skills/game-qa/references/qa-contract.md +66 -0
- package/lib/novel-to-game/skills/game-qa/references/test-design-method.md +45 -0
- package/lib/novel-to-game/skills/game-world-design/SKILL.md +63 -0
- package/lib/novel-to-game/skills/game-world-design/agents/openai.yaml +4 -0
- package/lib/novel-to-game/skills/game-world-design/references/dialogue-design-method.md +59 -0
- package/lib/novel-to-game/skills/game-world-design/references/game-writing-craft.md +53 -0
- package/lib/novel-to-game/skills/game-world-design/references/narrative-design-method.md +84 -0
- package/lib/novel-to-game/skills/game-world-design/references/numeric-design-method.md +56 -0
- package/lib/novel-to-game/skills/game-world-design/references/world-design-method.md +124 -0
- package/lib/novel-to-game/skills/novel-game-analyze/SKILL.md +77 -0
- package/lib/novel-to-game/skills/novel-game-analyze/agents/openai.yaml +4 -0
- package/lib/novel-to-game/skills/novel-game-analyze/references/gameability-protocol.md +65 -0
- package/lib/novel-to-game/skills/novel-to-game/SKILL.md +71 -0
- package/lib/novel-to-game/skills/novel-to-game/agents/openai.yaml +4 -0
- package/lib/novel-to-game/skills/novel-to-game/references/intake-benchmark-reference.md +42 -0
- package/lib/novel-to-game/skills/novel-to-game/references/intake-method.md +51 -0
- package/lib/novel-to-game/skills/novel-to-game/references/pipeline-contract.md +65 -0
- package/lib/oh-story/manifest.json +415 -305
- package/lib/oh-story/roles/consistency-checker.md +1 -1
- package/lib/oh-story/roles/narrative-writer.md +32 -33
- package/lib/oh-story/roles/story-architect.md +16 -26
- package/lib/oh-story/skills/browser-cdp/SKILL.md +1 -1
- package/lib/oh-story/skills/story/SKILL.md +16 -9
- package/lib/oh-story/skills/story/VERSION +1 -1
- package/lib/oh-story/skills/story/references/author-memory.md +163 -0
- package/lib/oh-story/skills/story/scripts/author_memory_commit.py +871 -0
- package/lib/oh-story/skills/story-cover/SKILL.md +1 -1
- package/lib/oh-story/skills/story-deslop/SKILL.md +10 -5
- package/lib/oh-story/skills/story-deslop/references/anti-ai-writing.md +2 -1
- package/lib/oh-story/skills/story-deslop/references/author-memory.md +163 -0
- package/lib/oh-story/skills/story-deslop/references/banned-words.md +6 -4
- package/lib/oh-story/skills/story-deslop/scripts/author_memory_commit.py +871 -0
- package/lib/oh-story/skills/story-deslop/scripts/check-ai-patterns.js +64 -1
- package/lib/oh-story/skills/story-import/SKILL.md +19 -10
- package/lib/oh-story/skills/story-import/references/format-and-structure.md +9 -10
- package/lib/oh-story/skills/story-import/references/structure-mapping-long.md +2 -2
- package/lib/oh-story/skills/story-import/references/structure-mapping-short.md +1 -1
- package/lib/oh-story/skills/story-import/references/tracking-transaction.md +14 -6
- package/lib/oh-story/skills/story-import/scripts/check-outline-contract.js +251 -0
- package/lib/oh-story/skills/story-import/scripts/tracking_commit.py +98 -9
- package/lib/oh-story/skills/story-import/scripts/wordcount_core.py +246 -0
- package/lib/oh-story/skills/story-long-analyze/SKILL.md +4 -4
- package/lib/oh-story/skills/story-long-scan/SKILL.md +1 -1
- package/lib/oh-story/skills/story-long-write/SKILL.md +35 -21
- package/lib/oh-story/skills/story-long-write/references/anti-ai-writing.md +2 -1
- package/lib/oh-story/skills/story-long-write/references/artifact-protocols.md +7 -3
- package/lib/oh-story/skills/story-long-write/references/author-memory.md +163 -0
- package/lib/oh-story/skills/story-long-write/references/banned-words.md +6 -4
- package/lib/oh-story/skills/story-long-write/references/cross-book-recall.md +6 -6
- package/lib/oh-story/skills/story-long-write/references/genre-prose-cards.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/genre-readers.md +1 -1
- package/lib/oh-story/skills/{story-setup/references/agent-references/hooks-chapter.md → story-long-write/references/long-chapter-hooks.md} +5 -5
- package/lib/oh-story/skills/story-long-write/references/{quality-checklist.md → long-chapter-quality.md} +2 -1
- package/lib/oh-story/skills/story-long-write/references/long-format.md +42 -0
- package/lib/oh-story/skills/{story-setup/references/agent-references/genre-catalog.md → story-long-write/references/long-genre-catalog.md} +11 -97
- package/lib/oh-story/skills/{story-setup/references/agent-references/genre-core-mechanics.md → story-long-write/references/long-genre-mechanics.md} +1 -1
- package/lib/oh-story/skills/{story-short-write/references/reversal-toolkit.md → story-long-write/references/long-reversal.md} +18 -32
- package/lib/oh-story/skills/story-long-write/references/{hooks-suspense.md → long-suspense.md} +6 -6
- package/lib/oh-story/skills/story-long-write/references/opening-design.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/outline-structure-theory.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/style-genre-modules.md +1 -1
- package/lib/oh-story/skills/story-long-write/references/tracking-transaction.md +14 -6
- package/lib/oh-story/skills/story-long-write/references/workflow-chapter.md +32 -27
- package/lib/oh-story/skills/story-long-write/references/workflow-daily.md +4 -4
- package/lib/oh-story/skills/story-long-write/references/workflow-revision.md +2 -2
- package/lib/oh-story/skills/story-long-write/references/workflow-setup.md +14 -14
- package/lib/oh-story/skills/story-long-write/references/writing-craft.md +54 -54
- package/lib/oh-story/skills/story-long-write/scripts/author_memory_commit.py +871 -0
- package/lib/oh-story/skills/story-long-write/scripts/check-ai-patterns.js +64 -1
- package/lib/oh-story/skills/story-long-write/scripts/check-outline-contract.js +251 -0
- package/lib/oh-story/skills/story-long-write/scripts/storyctl.py +303 -0
- package/lib/oh-story/skills/story-long-write/scripts/tracking_commit.py +98 -9
- package/lib/oh-story/skills/story-long-write/scripts/wordcount_core.py +246 -0
- package/lib/oh-story/skills/story-review/SKILL.md +26 -17
- package/lib/oh-story/skills/story-review/references/anti-ai-writing.md +2 -1
- package/lib/oh-story/skills/story-review/references/author-memory.md +163 -0
- package/lib/oh-story/skills/story-review/references/banned-words.md +6 -4
- package/lib/oh-story/skills/story-review/references/{quality-checklist.md → review-quality.md} +22 -21
- package/lib/oh-story/skills/story-review/references/tracking-transaction.md +14 -6
- package/lib/oh-story/skills/story-review/scripts/author_memory_commit.py +871 -0
- package/lib/oh-story/skills/story-review/scripts/check-ai-patterns.js +64 -1
- package/lib/oh-story/skills/story-review/scripts/tracking_commit.py +98 -9
- package/lib/oh-story/skills/story-review/scripts/wordcount_core.py +246 -0
- package/lib/oh-story/skills/story-setup/SKILL.md +74 -33
- package/lib/oh-story/skills/story-setup/references/agent-references/agent-quality.md +72 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/agent-reference-profiles.md +55 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/anti-ai-writing.md +2 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/banned-words.md +6 -4
- package/lib/oh-story/skills/story-setup/references/agent-references/format-and-structure.md +9 -10
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-prose-cards.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-readers.md +1 -1
- package/lib/oh-story/skills/{story-short-analyze/references/hooks-chapter.md → story-setup/references/agent-references/long-chapter-hooks.md} +5 -5
- package/lib/oh-story/skills/story-setup/references/agent-references/long-emotional-methods.md +209 -0
- package/lib/oh-story/skills/{story-long-write/references/genre-catalog.md → story-setup/references/agent-references/long-genre-catalog.md} +11 -97
- package/lib/oh-story/skills/{story-long-write/references/genre-core-mechanics.md → story-setup/references/agent-references/long-genre-mechanics.md} +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/long-quality.md +40 -0
- package/lib/oh-story/skills/story-setup/references/agent-references/{reversal-toolkit.md → long-reversal.md} +18 -32
- package/lib/oh-story/skills/{story-short-write/references/hooks-suspense.md → story-setup/references/agent-references/long-suspense.md} +6 -6
- package/lib/oh-story/skills/story-setup/references/agent-references/opening-design.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/{emotional-methods.md → short-emotional-methods.md} +4 -4
- package/lib/oh-story/skills/{story-long-write/references/genre-writing-formulas.md → story-setup/references/agent-references/short-genre-formulas.md} +32 -44
- package/lib/oh-story/skills/story-setup/references/agent-references/short-quality.md +39 -0
- package/lib/oh-story/skills/{story-long-write/references/reversal-toolkit.md → story-setup/references/agent-references/short-reversal.md} +29 -23
- package/lib/oh-story/skills/story-setup/references/agent-references/{hooks-suspense.md → short-suspense.md} +31 -31
- package/lib/oh-story/skills/story-setup/references/agent-references/style-genre-modules.md +1 -1
- package/lib/oh-story/skills/story-setup/references/agent-references/writing-craft.md +55 -55
- package/lib/oh-story/skills/story-short-analyze/SKILL.md +28 -28
- package/lib/oh-story/skills/story-short-analyze/references/{character-basics.md → analysis-character-basics.md} +1 -1
- package/lib/oh-story/skills/story-short-analyze/references/{character-design-methods.md → analysis-character-design.md} +1 -1
- package/lib/oh-story/skills/story-short-analyze/references/{character-relations.md → analysis-character-relations.md} +1 -1
- package/lib/oh-story/skills/story-short-analyze/references/{hooks-paragraph.md → analysis-paragraph-hooks.md} +1 -1
- package/lib/oh-story/skills/story-short-analyze/references/{genre-readers.md → analysis-reader-profile.md} +2 -2
- package/lib/oh-story/skills/story-short-analyze/references/analysis-report-style.md +45 -0
- package/lib/oh-story/skills/story-short-analyze/references/analysis-short-genres.md +65 -0
- package/lib/oh-story/skills/story-short-analyze/references/analysis-short-hooks.md +77 -0
- package/lib/oh-story/skills/story-short-analyze/references/analysis-short-mechanics.md +82 -0
- package/lib/oh-story/skills/story-short-analyze/references/analysis-short-patterns.md +50 -0
- package/lib/oh-story/skills/story-short-analyze/references/analysis-short-suspense.md +98 -0
- package/lib/oh-story/skills/story-short-analyze/references/{genre-writing-techniques.md → analysis-writing-techniques.md} +21 -19
- package/lib/oh-story/skills/story-short-analyze/references/deconstruction-examples.md +1 -1
- package/lib/oh-story/skills/story-short-analyze/references/material-decomposition.md +21 -28
- package/lib/oh-story/skills/story-short-analyze/references/output-contract.md +1 -1
- package/lib/oh-story/skills/story-short-analyze/references/output-templates.md +17 -17
- package/lib/oh-story/skills/story-short-analyze/references/{quality-checklist.md → source-story-quality.md} +28 -49
- package/lib/oh-story/skills/story-short-analyze/references/zhihu-style.md +2 -2
- package/lib/oh-story/skills/story-short-scan/SKILL.md +1 -1
- package/lib/oh-story/skills/story-short-write/SKILL.md +78 -55
- package/lib/oh-story/skills/story-short-write/references/author-memory.md +163 -0
- package/lib/oh-story/skills/story-short-write/references/banned-words.md +6 -4
- package/lib/oh-story/skills/story-short-write/references/cross-book-recall.md +3 -3
- package/lib/oh-story/skills/story-short-write/references/emotional-methods.md +4 -4
- package/lib/oh-story/skills/story-short-write/references/genre-styles//344/270/226/346/203/205/346/211/223/350/204/270.md +3 -3
- package/lib/oh-story/skills/story-short-write/references/genre-styles//345/217/214/347/224/267/344/270/273.md +2 -2
- package/lib/oh-story/skills/story-short-write/references/genre-styles//345/244/215/344/273/207/346/211/223/350/204/270.md +3 -3
- package/lib/oh-story/skills/story-short-write/references/genre-styles//345/256/205/346/226/227/345/256/253/346/226/227.md +6 -6
- package/lib/oh-story/skills/story-short-write/references/genre-styles//346/200/273/350/243/201/350/261/252/351/227/250.md +3 -3
- package/lib/oh-story/skills/story-short-write/references/genre-styles//346/202/254/347/226/221.md +4 -4
- package/lib/oh-story/skills/story-short-write/references/genre-styles//346/260/221/344/277/227/346/200/252/350/260/210.md +7 -7
- package/lib/oh-story/skills/story-short-write/references/genre-styles//346/262/231/351/233/225/350/204/221/346/264/236.md +5 -5
- package/lib/oh-story/skills/story-short-write/references/genre-styles//347/224/234/345/256/240.md +4 -4
- package/lib/oh-story/skills/story-short-write/references/genre-styles//350/277/275/345/246/273/347/201/253/350/221/254/345/234/272.md +3 -3
- package/lib/oh-story/skills/story-short-write/references/genre-writing-formulas.md +32 -44
- package/lib/oh-story/skills/story-short-write/references/genre-writing-techniques.md +20 -18
- package/lib/oh-story/skills/story-short-write/references/output-contract.md +1 -1
- package/lib/oh-story/skills/story-short-write/references/short-craft.md +18 -18
- package/lib/oh-story/skills/story-short-write/references/short-deslop.md +1 -1
- package/lib/oh-story/skills/story-short-write/references/short-format.md +38 -8
- package/lib/oh-story/skills/story-short-write/references/{quality-checklist.md → short-prose-quality.md} +22 -21
- package/lib/oh-story/skills/story-short-write/references/short-reversal.md +355 -0
- package/lib/oh-story/skills/{story-short-analyze/references/hooks-suspense.md → story-short-write/references/short-suspense.md} +31 -31
- package/lib/oh-story/skills/story-short-write/references/submission-craft.md +2 -2
- package/lib/oh-story/skills/story-short-write/references/writing-workflow.md +31 -22
- package/lib/oh-story/skills/story-short-write/scripts/author_memory_commit.py +871 -0
- package/lib/oh-story/skills/story-short-write/scripts/check-ai-patterns.js +64 -1
- package/lib/oh-story/skills/story-short-write/scripts/check-delivery-contract.js +212 -0
- package/lib/oh-story/skills/story-short-write/scripts/check-phase2-contract.js +363 -0
- package/lib/types/client/drama-production-view.d.ts +34 -0
- package/lib/types/client/drama-production-view.d.ts.map +1 -0
- package/lib/types/client/drama-production.d.ts +92 -0
- package/lib/types/client/drama-production.d.ts.map +1 -0
- package/lib/types/client/file-activity.d.ts +4 -2
- package/lib/types/client/file-activity.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/production-intents.d.ts +9 -0
- package/lib/types/client/production-intents.d.ts.map +1 -0
- package/lib/types/client/production-prompts.d.ts +9 -0
- package/lib/types/client/production-prompts.d.ts.map +1 -0
- package/lib/types/client/production-runtime.d.ts +58 -0
- package/lib/types/client/production-runtime.d.ts.map +1 -0
- package/lib/types/client/video-studio.d.ts +41 -0
- package/lib/types/client/video-studio.d.ts.map +1 -0
- package/lib/types/client/workbench-ui.d.ts +5 -0
- package/lib/types/client/workbench-ui.d.ts.map +1 -0
- package/lib/types/game-verification.d.ts +16 -0
- package/lib/types/game-verification.d.ts.map +1 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/production-intent.d.ts +21 -0
- package/lib/types/production-intent.d.ts.map +1 -0
- package/lib/types/production-tool.d.ts +5 -0
- package/lib/types/production-tool.d.ts.map +1 -0
- package/lib/types/role-tool.d.ts.map +1 -1
- package/lib/types/skill-provider.d.ts +7 -0
- package/lib/types/skill-provider.d.ts.map +1 -1
- package/lib/types/video-project.d.ts +42 -0
- package/lib/types/video-project.d.ts.map +1 -0
- package/lib/types/workspace-request-trust.d.ts +6 -0
- package/lib/types/workspace-request-trust.d.ts.map +1 -1
- package/lib/types/workspace-route.d.ts +20 -0
- package/lib/types/workspace-route.d.ts.map +1 -1
- package/lib/video-recap/CHANGELOG.md +282 -0
- package/lib/video-recap/LICENSE +21 -0
- package/lib/video-recap/README.en.md +257 -0
- package/lib/video-recap/README.md +255 -0
- package/lib/video-recap/manifest.json +684 -0
- package/lib/video-recap/skills/video-assemble/SKILL.md +97 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/LICENSE.duo-video +21 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/SOURCE.md +15 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_draft_meta_info.json +69 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_combination_segment.json +84 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_combination_video_material.json +98 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_draft.json +204 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_material_video.json +83 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_meta_material_value.json +23 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_project_info.json +133 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_segment.json +70 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_jy_text_styles.json +30 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_yj_material_audio.json +41 -0
- package/lib/video-recap/skills/video-assemble/references/jianying/empty_yj_material_text.json +109 -0
- package/lib/video-recap/skills/video-assemble/scripts/artifacts.py +88 -0
- package/lib/video-recap/skills/video-assemble/scripts/assemble.py +345 -0
- package/lib/video-recap/skills/video-assemble/scripts/assemble_constants.py +34 -0
- package/lib/video-recap/skills/video-assemble/scripts/assembly_contract.py +305 -0
- package/lib/video-recap/skills/video-assemble/scripts/assembly_settings.py +94 -0
- package/lib/video-recap/skills/video-assemble/scripts/audio_automation.py +205 -0
- package/lib/video-recap/skills/video-assemble/scripts/audio_mix.py +555 -0
- package/lib/video-recap/skills/video-assemble/scripts/export_jianying.py +261 -0
- package/lib/video-recap/skills/video-assemble/scripts/jianying_builders.py +767 -0
- package/lib/video-recap/skills/video-assemble/scripts/jianying_model.py +111 -0
- package/lib/video-recap/skills/video-assemble/scripts/jianying_optional.py +24 -0
- package/lib/video-recap/skills/video-assemble/scripts/jianying_schema.py +109 -0
- package/lib/video-recap/skills/video-assemble/scripts/jianying_templates.py +37 -0
- package/lib/video-recap/skills/video-assemble/scripts/jianying_timeline_contract.py +191 -0
- package/lib/video-recap/skills/video-assemble/scripts/jianying_tracks.py +75 -0
- package/lib/video-recap/skills/video-assemble/scripts/jianying_writer.py +394 -0
- package/lib/video-recap/skills/video-assemble/scripts/lib.py +239 -0
- package/lib/video-recap/skills/video-assemble/scripts/media.py +243 -0
- package/lib/video-recap/skills/video-assemble/scripts/narration_audio.py +477 -0
- package/lib/video-recap/skills/video-assemble/scripts/render_preflight.py +46 -0
- package/lib/video-recap/skills/video-assemble/scripts/source_subtitles.py +486 -0
- package/lib/video-recap/skills/video-assemble/scripts/subtitle_core.py +376 -0
- package/lib/video-recap/skills/video-assemble/scripts/subtitle_render.py +88 -0
- package/lib/video-recap/skills/video-assemble/scripts/timeline.py +248 -0
- package/lib/video-recap/skills/video-assemble/scripts/timeline_emit.py +89 -0
- package/lib/video-recap/skills/video-assemble/scripts/visual_render.py +512 -0
- package/lib/video-recap/skills/video-cut/SKILL.md +90 -0
- package/lib/video-recap/skills/video-cut/scripts/cut.py +67 -0
- package/lib/video-recap/skills/video-cut/scripts/cut_cli.py +320 -0
- package/lib/video-recap/skills/video-cut/scripts/cut_contract.py +545 -0
- package/lib/video-recap/skills/video-cut/scripts/cut_render.py +348 -0
- package/lib/video-recap/skills/video-cut/scripts/lib.py +77 -0
- package/lib/video-recap/skills/video-cut/scripts/media_geometry.py +341 -0
- package/lib/video-recap/skills/video-cut/scripts/narration_mapping.py +249 -0
- package/lib/video-recap/skills/video-cut/scripts/sentence_boundaries.py +745 -0
- package/lib/video-recap/skills/video-recap/SKILL.md +216 -0
- package/lib/video-recap/skills/video-recap/references/config-playbook.md +61 -0
- package/lib/video-recap/skills/video-recap/references/creative-editing-playbook.md +225 -0
- package/lib/video-recap/skills/video-recap/references/data-schema.md +534 -0
- package/lib/video-recap/skills/video-recap/references/research-guide.md +74 -0
- package/lib/video-recap/skills/video-recap/references/shift-left-qc-schema.md +23 -0
- package/lib/video-recap/skills/video-recap/references/timeline-and-jianying.md +251 -0
- package/lib/video-recap/skills/video-recap/scripts/doctor.py +483 -0
- package/lib/video-recap/skills/video-recap/scripts/final_qc.py +737 -0
- package/lib/video-recap/skills/video-recap/scripts/lib.py +242 -0
- package/lib/video-recap/skills/video-recap/scripts/materials.py +457 -0
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc.py +95 -0
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc_client.py +18 -0
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc_contract.py +9 -0
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc_evidence.py +371 -0
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc_observations.py +201 -0
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc_payload.py +227 -0
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc_report.py +362 -0
- package/lib/video-recap/skills/video-recap/scripts/mimo_qc_runner.py +129 -0
- package/lib/video-recap/skills/video-recap/scripts/qc_contract.py +338 -0
- package/lib/video-recap/skills/video-recap/scripts/recap.py +9 -0
- package/lib/video-recap/skills/video-recap/scripts/recap_cli.py +140 -0
- package/lib/video-recap/skills/video-recap/scripts/recap_inspect.py +550 -0
- package/lib/video-recap/skills/video-recap/scripts/recap_review.py +77 -0
- package/lib/video-recap/skills/video-recap/scripts/recap_runner.py +654 -0
- package/lib/video-recap/skills/video-recap/scripts/recap_runtime.py +335 -0
- package/lib/video-recap/skills/video-recap/scripts/recap_stage_qc.py +217 -0
- package/lib/video-recap/skills/video-recap/scripts/recap_timeline.py +795 -0
- package/lib/video-recap/skills/video-script/SKILL.md +248 -0
- package/lib/video-recap/skills/video-script/references/creative-editing-playbook.md +225 -0
- package/lib/video-recap/skills/video-script/references/research-guide.md +75 -0
- package/lib/video-recap/skills/video-script/scripts/agent_brief.py +399 -0
- package/lib/video-recap/skills/video-script/scripts/agent_text.py +410 -0
- package/lib/video-recap/skills/video-script/scripts/brief_context.py +403 -0
- package/lib/video-recap/skills/video-script/scripts/brief_inputs.py +332 -0
- package/lib/video-recap/skills/video-script/scripts/brief_timeline.py +442 -0
- package/lib/video-recap/skills/video-script/scripts/deslop_qc.py +237 -0
- package/lib/video-recap/skills/video-script/scripts/evidence_bundle.py +492 -0
- package/lib/video-recap/skills/video-script/scripts/lib.py +327 -0
- package/lib/video-recap/skills/video-script/scripts/narration.py +12 -0
- package/lib/video-recap/skills/video-script/scripts/narration_lint.py +678 -0
- package/lib/video-recap/skills/video-script/scripts/review.py +42 -0
- package/lib/video-recap/skills/video-script/scripts/review_grounding.py +262 -0
- package/lib/video-recap/skills/video-script/scripts/review_response.py +761 -0
- package/lib/video-recap/skills/video-script/scripts/review_runner.py +200 -0
- package/lib/video-recap/skills/video-script/scripts/speech_ownership.py +204 -0
- package/lib/video-recap/skills/video-script/scripts/timeline_fusion.py +199 -0
- package/lib/video-recap/skills/video-script/scripts/validate.py +164 -0
- package/lib/video-recap/skills/video-understanding/SKILL.md +75 -0
- package/lib/video-recap/skills/video-understanding/references/data-schema.md +299 -0
- package/lib/video-recap/skills/video-understanding/references/prompt-templates.md +37 -0
- package/lib/video-recap/skills/video-understanding/references/research-guide.md +74 -0
- package/lib/video-recap/skills/video-understanding/scripts/agent_brief.py +399 -0
- package/lib/video-recap/skills/video-understanding/scripts/agent_text.py +410 -0
- package/lib/video-recap/skills/video-understanding/scripts/asr.py +260 -0
- package/lib/video-recap/skills/video-understanding/scripts/brief.py +12 -0
- package/lib/video-recap/skills/video-understanding/scripts/brief_context.py +403 -0
- package/lib/video-recap/skills/video-understanding/scripts/brief_inputs.py +332 -0
- package/lib/video-recap/skills/video-understanding/scripts/brief_timeline.py +442 -0
- package/lib/video-recap/skills/video-understanding/scripts/consolidate.py +647 -0
- package/lib/video-recap/skills/video-understanding/scripts/deslop_qc.py +237 -0
- package/lib/video-recap/skills/video-understanding/scripts/detect.py +513 -0
- package/lib/video-recap/skills/video-understanding/scripts/extract.py +62 -0
- package/lib/video-recap/skills/video-understanding/scripts/lib.py +470 -0
- package/lib/video-recap/skills/video-understanding/scripts/narration_lint.py +678 -0
- package/lib/video-recap/skills/video-understanding/scripts/speech_ownership.py +204 -0
- package/lib/video-recap/skills/video-understanding/scripts/storyboard.py +507 -0
- package/lib/video-recap/skills/video-understanding/scripts/timeline_fusion.py +199 -0
- package/lib/video-recap/skills/video-understanding/scripts/understand.py +9 -0
- package/lib/video-recap/skills/video-understanding/scripts/understanding_brief.py +216 -0
- package/lib/video-recap/skills/video-understanding/scripts/understanding_cache.py +327 -0
- package/lib/video-recap/skills/video-understanding/scripts/understanding_runner.py +367 -0
- package/lib/video-recap/skills/video-understanding/scripts/understanding_storyboard.py +162 -0
- package/lib/video-recap/skills/video-understanding/scripts/vlm.py +705 -0
- package/lib/video-recap/skills/video-voiceover/SKILL.md +81 -0
- package/lib/video-recap/skills/video-voiceover/scripts/dub.py +637 -0
- package/lib/video-recap/skills/video-voiceover/scripts/fish_audio.py +109 -0
- package/lib/video-recap/skills/video-voiceover/scripts/lib.py +421 -0
- package/lib/video-recap/skills/video-voiceover/scripts/tts_audio.py +113 -0
- package/lib/video-recap/skills/video-voiceover/scripts/voiceover.py +782 -0
- package/package.json +55 -40
- package/lib/oh-story/skills/story-deslop/scripts/check-outline-copy.js +0 -241
- package/lib/oh-story/skills/story-long-write/references/format-and-structure.md +0 -169
- package/lib/oh-story/skills/story-setup/references/agent-references/genre-writing-formulas.md +0 -444
- package/lib/oh-story/skills/story-setup/references/agent-references/quality-checklist.md +0 -247
- package/lib/oh-story/skills/story-short-analyze/references/anti-ai-writing.md +0 -582
- package/lib/oh-story/skills/story-short-analyze/references/banned-words.md +0 -147
- package/lib/oh-story/skills/story-short-analyze/references/genre-catalog.md +0 -490
- package/lib/oh-story/skills/story-short-analyze/references/genre-core-mechanics.md +0 -425
- package/lib/oh-story/skills/story-short-analyze/references/genre-writing-formulas.md +0 -453
- /package/lib/oh-story/skills/{story-long-write/references/hooks-chapter.md → story-setup/references/agent-references/short-chapter-hooks.md} +0 -0
- /package/lib/oh-story/skills/{story-long-write/references/hooks-paragraph.md → story-setup/references/agent-references/short-paragraph-hooks.md} +0 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"""Multi-track timeline model for the recap (backend-neutral, stdlib only).
|
|
2
|
+
|
|
3
|
+
A `Timeline` is a small, serializable representation of the finished recap as a
|
|
4
|
+
set of tracks — exactly like a cut-tool project:
|
|
5
|
+
|
|
6
|
+
- one **video** track: the source clip(s), each carrying its own *original
|
|
7
|
+
audio* with a per-clip volume automation (the ducking: a continuous low bed
|
|
8
|
+
under narration, held across short inter-sentence gaps, back up only at the
|
|
9
|
+
lead-in/out and genuine long gaps);
|
|
10
|
+
- one **narration** audio track: the placed TTS beats;
|
|
11
|
+
- an optional **bgm** audio track: a looped music bed with its own ducking;
|
|
12
|
+
- one **subtitle** (text) track: the narration lines.
|
|
13
|
+
- optional **image** tracks: local photo overlays with normalized center-origin,
|
|
14
|
+
Y-up transforms for editable JianYing export.
|
|
15
|
+
|
|
16
|
+
The canonical ducking semantics live in `audio_automation.py`; ffmpeg
|
|
17
|
+
(`assemble.py`) and this timeline model both derive their automation from that
|
|
18
|
+
shared source. This model is emitted as `timeline.json` and consumed by the
|
|
19
|
+
*optional* 剪映 exporter. The model itself knows nothing about ffmpeg or 剪映 —
|
|
20
|
+
times are plain seconds and volumes are plain gains, so any backend can read it.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
import json
|
|
24
|
+
import math
|
|
25
|
+
from copy import deepcopy
|
|
26
|
+
|
|
27
|
+
from audio_automation import fixed_ducking_keyframes as ducking_keyframes
|
|
28
|
+
from audio_automation import release_ducking_keyframes
|
|
29
|
+
|
|
30
|
+
SCHEMA_VERSION = 2
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _ceil_time(value, digits=4):
|
|
34
|
+
"""Round an interval end outward so serialization can never shorten media."""
|
|
35
|
+
scale = 10 ** digits
|
|
36
|
+
return math.ceil((float(value) * scale) - 1e-9) / scale
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def build_timeline(canvas, duration_s, video_clips, narration_segments,
|
|
40
|
+
bgm=None, ducking=None, subtitle_segments=None,
|
|
41
|
+
image_segments=None, resource_packages=None,
|
|
42
|
+
style_presets=None, extra_tracks=None):
|
|
43
|
+
"""Assemble a Timeline dict from resolved placement data.
|
|
44
|
+
|
|
45
|
+
canvas: {"width", "height", "fps"}
|
|
46
|
+
duration_s: total output length (seconds)
|
|
47
|
+
video_clips: ordered [{"source_path", "source_start", "source_end",
|
|
48
|
+
"timeline_start", "timeline_end"}] (cut mode: one per clip;
|
|
49
|
+
full mode: a single clip spanning the whole video).
|
|
50
|
+
narration_segments: placed beats [{"source_path", "timeline_start",
|
|
51
|
+
"timeline_end", "text", "overlaps_speech", "gain"?}].
|
|
52
|
+
subtitle_segments: optional display-ready text cues [{"text", "timeline_start",
|
|
53
|
+
"timeline_end"}]. When present, this is authoritative for the
|
|
54
|
+
subtitle/text track; narration segment text remains raw editor metadata.
|
|
55
|
+
bgm: optional {"source_path", "volume", "ducking_volume"}.
|
|
56
|
+
ducking: {"idle", "speech", "quiet", "fade", "bridge"?} for the original-audio
|
|
57
|
+
automation; None disables original ducking (flat original). `bridge` holds
|
|
58
|
+
the duck across inter-beat gaps shorter than it (defaults to 2*fade).
|
|
59
|
+
"""
|
|
60
|
+
windows = [(float(s["timeline_start"]), float(s["timeline_end"]))
|
|
61
|
+
for s in narration_segments
|
|
62
|
+
if s.get("timeline_end", 0) > s.get("timeline_start", 0)]
|
|
63
|
+
duck_windows = [
|
|
64
|
+
(
|
|
65
|
+
float(s["timeline_start"]),
|
|
66
|
+
max(float(s["timeline_end"]), float(s.get("source_duck_end", s["timeline_end"]))),
|
|
67
|
+
float((ducking or {}).get("speech" if s.get("overlaps_speech", True) else "quiet", 1.0)),
|
|
68
|
+
max(
|
|
69
|
+
float(s["timeline_end"]),
|
|
70
|
+
float(s.get("source_duck_end", s["timeline_end"])),
|
|
71
|
+
float(s.get(
|
|
72
|
+
"source_restore_at",
|
|
73
|
+
max(float(s["timeline_end"]), float(s.get("source_duck_end", s["timeline_end"])))
|
|
74
|
+
+ float((ducking or {}).get("fade", 0.0)),
|
|
75
|
+
)),
|
|
76
|
+
),
|
|
77
|
+
)
|
|
78
|
+
for s in narration_segments
|
|
79
|
+
if s.get("timeline_end", 0) > s.get("timeline_start", 0)
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
# --- video track: each clip carries its original audio + ducking automation
|
|
83
|
+
video_clip_objs = []
|
|
84
|
+
for c in video_clips:
|
|
85
|
+
ts, te = float(c["timeline_start"]), float(c["timeline_end"])
|
|
86
|
+
audio = {"role": "original", "volume_keyframes": []}
|
|
87
|
+
if ducking is not None:
|
|
88
|
+
audio["volume_keyframes"] = release_ducking_keyframes(
|
|
89
|
+
duck_windows, ducking["idle"], ducking["fade"], ts, te,
|
|
90
|
+
bridge=ducking.get("bridge"))
|
|
91
|
+
audio["base_gain"] = round(float(ducking["idle"]), 4)
|
|
92
|
+
else:
|
|
93
|
+
audio["base_gain"] = 1.0
|
|
94
|
+
video_clip = {
|
|
95
|
+
"source_path": c["source_path"],
|
|
96
|
+
"source_start": round(float(c["source_start"]), 4),
|
|
97
|
+
"source_end": round(float(c["source_end"]), 4),
|
|
98
|
+
"timeline_start": round(ts, 4),
|
|
99
|
+
"timeline_end": round(te, 4),
|
|
100
|
+
"audio": audio,
|
|
101
|
+
}
|
|
102
|
+
for key in (
|
|
103
|
+
"chroma", "compound", "flip", "green_background", "lut", "mask",
|
|
104
|
+
"opacity", "position", "reverse", "reverse_path", "rotation_degrees",
|
|
105
|
+
"scale", "speed", "transition",
|
|
106
|
+
):
|
|
107
|
+
if key in c:
|
|
108
|
+
video_clip[key] = deepcopy(c[key])
|
|
109
|
+
video_clip_objs.append(video_clip)
|
|
110
|
+
|
|
111
|
+
tracks = [{"kind": "video", "name": "video", "clips": video_clip_objs}]
|
|
112
|
+
|
|
113
|
+
# --- narration track
|
|
114
|
+
narr_segs = []
|
|
115
|
+
for s in narration_segments:
|
|
116
|
+
ts, te = float(s["timeline_start"]), float(s["timeline_end"])
|
|
117
|
+
if te <= ts:
|
|
118
|
+
continue
|
|
119
|
+
narration = {
|
|
120
|
+
"source_path": s["source_path"],
|
|
121
|
+
"timeline_start": round(ts, 4),
|
|
122
|
+
"timeline_end": _ceil_time(te, 4),
|
|
123
|
+
"gain": round(float(s.get("gain", 1.0)), 4),
|
|
124
|
+
"text": s.get("text", ""),
|
|
125
|
+
"overlaps_speech": bool(s.get("overlaps_speech", True)),
|
|
126
|
+
}
|
|
127
|
+
for key in ("source_duck_end", "source_restore_at", "source_handoff_status", "source_entry_status"):
|
|
128
|
+
if key in s:
|
|
129
|
+
narration[key] = deepcopy(s[key])
|
|
130
|
+
if "speed" in s:
|
|
131
|
+
narration["speed"] = float(s["speed"])
|
|
132
|
+
narr_segs.append(narration)
|
|
133
|
+
if narr_segs:
|
|
134
|
+
tracks.append({"kind": "audio", "name": "narration", "role": "narration",
|
|
135
|
+
"segments": narr_segs})
|
|
136
|
+
|
|
137
|
+
# --- bgm track (optional, looped, ducked under narration)
|
|
138
|
+
if bgm and bgm.get("source_path"):
|
|
139
|
+
base = float(bgm.get("volume", 0.18))
|
|
140
|
+
duck = float(bgm.get("ducking_volume", 0.10))
|
|
141
|
+
fade = float(bgm.get("fade") or (ducking or {}).get("fade", 0.25))
|
|
142
|
+
kfs = ducking_keyframes(windows, base, duck, fade, 0.0, duration_s,
|
|
143
|
+
bridge=(ducking or {}).get("bridge"))
|
|
144
|
+
tracks.append({
|
|
145
|
+
"kind": "audio", "name": "bgm", "role": "bgm", "loop": True,
|
|
146
|
+
"segments": [{
|
|
147
|
+
"source_path": bgm["source_path"],
|
|
148
|
+
"timeline_start": 0.0,
|
|
149
|
+
"timeline_end": round(float(duration_s), 4),
|
|
150
|
+
"gain": round(base, 4),
|
|
151
|
+
"volume_keyframes": kfs,
|
|
152
|
+
}],
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
# --- subtitle (text) track
|
|
156
|
+
text_source = subtitle_segments if subtitle_segments is not None else narration_segments
|
|
157
|
+
text_segs = []
|
|
158
|
+
for s in text_source or []:
|
|
159
|
+
if not isinstance(s, dict) or not s.get("text"):
|
|
160
|
+
continue
|
|
161
|
+
try:
|
|
162
|
+
ts = float(s["timeline_start"])
|
|
163
|
+
te = float(s["timeline_end"])
|
|
164
|
+
except (KeyError, TypeError, ValueError):
|
|
165
|
+
continue
|
|
166
|
+
if te <= ts:
|
|
167
|
+
continue
|
|
168
|
+
text_segment = {
|
|
169
|
+
"text": s.get("text", ""),
|
|
170
|
+
"timeline_start": round(ts, 4),
|
|
171
|
+
"timeline_end": round(te, 4),
|
|
172
|
+
}
|
|
173
|
+
for key in ("flip", "opacity", "position", "rotation_degrees", "scale", "style", "style_id", "words"):
|
|
174
|
+
if key in s:
|
|
175
|
+
text_segment[key] = deepcopy(s[key])
|
|
176
|
+
text_segs.append(text_segment)
|
|
177
|
+
if text_segs:
|
|
178
|
+
tracks.append({"kind": "text", "name": "subtitle", "segments": text_segs})
|
|
179
|
+
|
|
180
|
+
# --- local image overlays (optional, timeline schema v2)
|
|
181
|
+
images = []
|
|
182
|
+
for segment in image_segments or []:
|
|
183
|
+
if not isinstance(segment, dict) or not segment.get("source_path"):
|
|
184
|
+
continue
|
|
185
|
+
try:
|
|
186
|
+
ts = float(segment["timeline_start"])
|
|
187
|
+
te = float(segment["timeline_end"])
|
|
188
|
+
except (KeyError, TypeError, ValueError):
|
|
189
|
+
continue
|
|
190
|
+
if te <= ts:
|
|
191
|
+
continue
|
|
192
|
+
scale = segment.get("scale") if isinstance(segment.get("scale"), dict) else {}
|
|
193
|
+
position = segment.get("position") if isinstance(segment.get("position"), dict) else {}
|
|
194
|
+
flip = segment.get("flip") if isinstance(segment.get("flip"), dict) else {}
|
|
195
|
+
image = {
|
|
196
|
+
"source_path": str(segment["source_path"]),
|
|
197
|
+
"timeline_start": round(ts, 4),
|
|
198
|
+
"timeline_end": round(te, 4),
|
|
199
|
+
"opacity": round(max(0.0, min(1.0, float(segment.get("opacity", 1.0)))), 4),
|
|
200
|
+
"rotation_degrees": round(float(segment.get("rotation_degrees", 0.0)), 4),
|
|
201
|
+
"scale": {
|
|
202
|
+
"x": round(float(scale.get("x", 1.0)), 4),
|
|
203
|
+
"y": round(float(scale.get("y", 1.0)), 4),
|
|
204
|
+
},
|
|
205
|
+
"position": {
|
|
206
|
+
"x": round(float(position.get("x", 0.0)), 4),
|
|
207
|
+
"y": round(float(position.get("y", 0.0)), 4),
|
|
208
|
+
},
|
|
209
|
+
"flip": {
|
|
210
|
+
"horizontal": bool(flip.get("horizontal", False)),
|
|
211
|
+
"vertical": bool(flip.get("vertical", False)),
|
|
212
|
+
},
|
|
213
|
+
}
|
|
214
|
+
for key in ("lut", "mask", "speed", "transition"):
|
|
215
|
+
if key in segment:
|
|
216
|
+
image[key] = deepcopy(segment[key])
|
|
217
|
+
images.append(image)
|
|
218
|
+
if images:
|
|
219
|
+
tracks.append({"kind": "image", "name": "image", "segments": images})
|
|
220
|
+
|
|
221
|
+
for track in extra_tracks or []:
|
|
222
|
+
if not isinstance(track, dict):
|
|
223
|
+
raise TypeError("extra_tracks entries must be objects")
|
|
224
|
+
tracks.append(deepcopy(track))
|
|
225
|
+
|
|
226
|
+
timeline = {
|
|
227
|
+
"schema_version": SCHEMA_VERSION,
|
|
228
|
+
"canvas": {"width": int(canvas["width"]), "height": int(canvas["height"]),
|
|
229
|
+
"fps": float(canvas.get("fps", 30))},
|
|
230
|
+
"duration": round(float(duration_s), 4),
|
|
231
|
+
"tracks": tracks,
|
|
232
|
+
}
|
|
233
|
+
if resource_packages:
|
|
234
|
+
timeline["resource_packages"] = deepcopy(resource_packages)
|
|
235
|
+
if style_presets:
|
|
236
|
+
timeline["style_presets"] = deepcopy(style_presets)
|
|
237
|
+
return timeline
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def save_timeline(timeline, path):
|
|
241
|
+
with open(path, "w", encoding="utf-8") as f:
|
|
242
|
+
json.dump(timeline, f, ensure_ascii=False, indent=2)
|
|
243
|
+
return path
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
def load_timeline(path):
|
|
247
|
+
with open(path, encoding="utf-8") as f:
|
|
248
|
+
return json.load(f)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""Backend-neutral timeline emission for the video-assemble skill."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from audio_mix import _seg_place_window
|
|
6
|
+
from lib import CONFIG, log
|
|
7
|
+
from media import _build_video_clips, _probe_canvas
|
|
8
|
+
from source_subtitles import _combined_subtitle_entries
|
|
9
|
+
from timeline import build_timeline, save_timeline
|
|
10
|
+
|
|
11
|
+
def _timeline_subtitle_segments(tts_segments, work_dir, duration_s):
|
|
12
|
+
"""Display-ready subtitle cues for timeline/export text tracks.
|
|
13
|
+
|
|
14
|
+
The narration audio track keeps raw semantic text for editor reference; this
|
|
15
|
+
payload mirrors SRT/ASS display policy, including terminal-punctuation cleanup
|
|
16
|
+
and original-dialogue gap subtitles when configured.
|
|
17
|
+
"""
|
|
18
|
+
return [
|
|
19
|
+
{
|
|
20
|
+
"text": entry["text"],
|
|
21
|
+
"timeline_start": float(entry["start"]),
|
|
22
|
+
"timeline_end": float(entry["end"]),
|
|
23
|
+
}
|
|
24
|
+
for entry in _combined_subtitle_entries(tts_segments, work_dir, duration_s)
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _emit_timeline(input_video, tts_segments, work_dir, duration_s, has_bgm):
|
|
29
|
+
"""Build and persist the backend-neutral multi-track timeline.json."""
|
|
30
|
+
canvas = _probe_canvas(input_video)
|
|
31
|
+
video_clips = _build_video_clips(input_video, work_dir, duration_s)
|
|
32
|
+
narration_segments = []
|
|
33
|
+
for seg in tts_segments:
|
|
34
|
+
if not isinstance(seg, dict):
|
|
35
|
+
continue
|
|
36
|
+
s, e = _seg_place_window(seg)
|
|
37
|
+
if e <= s:
|
|
38
|
+
continue
|
|
39
|
+
narration_item = {
|
|
40
|
+
# JianYing must consume the exact WAV written into narration.wav. In
|
|
41
|
+
# particular, a tempo-adjusted beat cannot reference its longer pre-fit
|
|
42
|
+
# source or the editor will trim its final words at timeline_end.
|
|
43
|
+
"source_path": seg.get("placed_audio_path") or seg.get("audio_path", ""),
|
|
44
|
+
"timeline_start": s, "timeline_end": e,
|
|
45
|
+
"text": seg.get("narration", ""),
|
|
46
|
+
"overlaps_speech": seg.get("overlaps_speech", True),
|
|
47
|
+
"gain": 1.0,
|
|
48
|
+
}
|
|
49
|
+
for key in ("source_duck_end", "source_restore_at", "source_handoff_status", "source_entry_status"):
|
|
50
|
+
if key in seg:
|
|
51
|
+
narration_item[key] = seg[key]
|
|
52
|
+
narration_segments.append(narration_item)
|
|
53
|
+
fade = CONFIG.get("duck_fade_seconds", 0.3)
|
|
54
|
+
bgm = None
|
|
55
|
+
if has_bgm:
|
|
56
|
+
bgm = {"source_path": CONFIG.get("bgm_path", ""),
|
|
57
|
+
"volume": CONFIG.get("bgm_volume", 0.18),
|
|
58
|
+
"ducking_volume": CONFIG.get("bgm_ducking_volume", 0.10),
|
|
59
|
+
"fade": fade}
|
|
60
|
+
# carry ducking automation whenever ducking is on at all; even under sidechain
|
|
61
|
+
# mode the draft gets editable volume keyframes (ffmpeg stays the canonical mix)
|
|
62
|
+
ducking = None
|
|
63
|
+
if CONFIG.get("ducking_mode", "fixed") != "none":
|
|
64
|
+
ducking = {"idle": CONFIG.get("idle_orig_volume", 1.0),
|
|
65
|
+
"speech": CONFIG.get("speech_ducking_volume", 0.2),
|
|
66
|
+
"quiet": CONFIG.get("zone_ducking_volume", 0.12),
|
|
67
|
+
"fade": fade,
|
|
68
|
+
"bridge": CONFIG.get("duck_bridge_seconds", 1.5)}
|
|
69
|
+
subtitle_segments = _timeline_subtitle_segments(tts_segments, work_dir, duration_s)
|
|
70
|
+
timeline = build_timeline(canvas, duration_s, video_clips,
|
|
71
|
+
narration_segments, bgm=bgm, ducking=ducking,
|
|
72
|
+
subtitle_segments=subtitle_segments)
|
|
73
|
+
degraded = [
|
|
74
|
+
{
|
|
75
|
+
"source_path": clip.get("source_path"),
|
|
76
|
+
"reason": clip.get("provenance_reason") or "unknown",
|
|
77
|
+
}
|
|
78
|
+
for clip in video_clips
|
|
79
|
+
if clip.get("provenance_degraded")
|
|
80
|
+
]
|
|
81
|
+
if degraded:
|
|
82
|
+
timeline["provenance"] = {"degraded": True, "degraded_clips": degraded}
|
|
83
|
+
log(f" ⚠️ 时间线 provenance 降级: {degraded[0]['reason']} ({len(degraded)} clip)")
|
|
84
|
+
else:
|
|
85
|
+
timeline["provenance"] = {"degraded": False}
|
|
86
|
+
out = Path(work_dir) / "timeline.json"
|
|
87
|
+
save_timeline(timeline, out)
|
|
88
|
+
log(f"时间线模型: {out} ({len(timeline['tracks'])} 轨)")
|
|
89
|
+
return timeline
|