@lemoncat7/dsh-partner 2.8.1 → 2.8.2
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/docs/THIRD_PARTY_LICENSES.md +10 -0
- package/docs/blocked-delivery-recovery.md +7 -0
- package/docs/concern-attention.md +19 -0
- package/docs/observation-contract.md +11 -0
- package/docs/releases/2.8.2.md +7 -0
- package/lib/agent-runtime.d.ts +7 -0
- package/lib/agent-runtime.d.ts.map +1 -1
- package/lib/agent-runtime.js +110 -32
- package/lib/agent-runtime.js.map +1 -1
- package/lib/api.js +28 -6
- package/lib/api.js.map +1 -1
- package/lib/autonomy.d.ts.map +1 -1
- package/lib/autonomy.js +5 -0
- package/lib/autonomy.js.map +1 -1
- package/lib/channel-message.d.ts +2 -0
- package/lib/channel-message.d.ts.map +1 -1
- package/lib/channel-message.js.map +1 -1
- package/lib/channels/direct/message-format.js +127 -127
- package/lib/channels/direct/message-format.js.map +1 -1
- package/lib/channels/manager.d.ts.map +1 -1
- package/lib/channels/manager.js +4 -3
- package/lib/channels/manager.js.map +1 -1
- package/lib/channels/notification-delivery.d.ts.map +1 -1
- package/lib/channels/notification-delivery.js +10 -0
- package/lib/channels/notification-delivery.js.map +1 -1
- package/lib/channels/weixin/connect.d.ts.map +1 -1
- package/lib/client-api.d.ts +7 -2
- package/lib/client-api.d.ts.map +1 -1
- package/lib/client-api.js +8 -1
- package/lib/client-api.js.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +2185 -1956
- package/lib/client.js.map +4 -4
- package/lib/collaboration/composition.js +1 -1
- package/lib/collaboration/composition.js.map +1 -1
- package/lib/concern-attention.d.ts +19 -0
- package/lib/concern-attention.d.ts.map +1 -0
- package/lib/concern-attention.js +36 -0
- package/lib/concern-attention.js.map +1 -0
- package/lib/concern-domain.d.ts +7 -1
- package/lib/concern-domain.d.ts.map +1 -1
- package/lib/concern-domain.js +4 -0
- package/lib/concern-domain.js.map +1 -1
- package/lib/concern-execution-notes.d.ts +18 -0
- package/lib/concern-execution-notes.d.ts.map +1 -0
- package/lib/concern-execution-notes.js +41 -0
- package/lib/concern-execution-notes.js.map +1 -0
- package/lib/concern-execution-receipt.d.ts +4 -0
- package/lib/concern-execution-receipt.d.ts.map +1 -0
- package/lib/concern-execution-receipt.js +28 -0
- package/lib/concern-execution-receipt.js.map +1 -0
- package/lib/concern-execution.d.ts +30 -0
- package/lib/concern-execution.d.ts.map +1 -0
- package/lib/concern-execution.js +86 -0
- package/lib/concern-execution.js.map +1 -0
- package/lib/concern-management-tool.d.ts.map +1 -1
- package/lib/concern-management-tool.js +21 -19
- package/lib/concern-management-tool.js.map +1 -1
- package/lib/concern-note-source.d.ts +7 -0
- package/lib/concern-note-source.d.ts.map +1 -0
- package/lib/concern-note-source.js +25 -0
- package/lib/concern-note-source.js.map +1 -0
- package/lib/concern-resources.d.ts +27 -0
- package/lib/concern-resources.d.ts.map +1 -0
- package/lib/concern-resources.js +36 -0
- package/lib/concern-resources.js.map +1 -0
- package/lib/concern-sources.d.ts +1 -1
- package/lib/concern-sources.d.ts.map +1 -1
- package/lib/concern-store.d.ts +9 -1
- package/lib/concern-store.d.ts.map +1 -1
- package/lib/concern-store.js +111 -34
- package/lib/concern-store.js.map +1 -1
- package/lib/concern-tool.d.ts +1 -0
- package/lib/concern-tool.d.ts.map +1 -1
- package/lib/concern-tool.js +8 -4
- package/lib/concern-tool.js.map +1 -1
- package/lib/decision/conversation.d.ts +11 -0
- package/lib/decision/conversation.d.ts.map +1 -0
- package/lib/decision/conversation.js +52 -0
- package/lib/decision/conversation.js.map +1 -0
- package/lib/decision/events.d.ts +16 -0
- package/lib/decision/events.d.ts.map +1 -0
- package/lib/decision/events.js +9 -0
- package/lib/decision/events.js.map +1 -0
- package/lib/domain.d.ts +2 -0
- package/lib/domain.d.ts.map +1 -1
- package/lib/domain.js.map +1 -1
- package/lib/heartbeat.d.ts +12 -10
- package/lib/heartbeat.d.ts.map +1 -1
- package/lib/heartbeat.js +54 -26
- package/lib/heartbeat.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/memory-prompt-context.js +1 -0
- package/lib/memory-prompt-context.js.map +1 -1
- package/lib/memory-reflection.js +1 -1
- package/lib/observation-contract.d.ts +9 -0
- package/lib/observation-contract.d.ts.map +1 -0
- package/lib/observation-contract.js +19 -0
- package/lib/observation-contract.js.map +1 -0
- package/lib/observation-executor.d.ts +5 -0
- package/lib/observation-executor.d.ts.map +1 -1
- package/lib/observation-executor.js +17 -1
- package/lib/observation-executor.js.map +1 -1
- package/lib/observation-loop.d.ts +5 -0
- package/lib/observation-loop.d.ts.map +1 -1
- package/lib/observation-loop.js +36 -3
- package/lib/observation-loop.js.map +1 -1
- package/lib/observation-sources.d.ts +14 -0
- package/lib/observation-sources.d.ts.map +1 -0
- package/lib/observation-sources.js +12 -0
- package/lib/observation-sources.js.map +1 -0
- package/lib/requirements/service.d.ts.map +1 -1
- package/lib/requirements/service.js +2 -0
- package/lib/requirements/service.js.map +1 -1
- package/lib/requirements/worker.d.ts.map +1 -1
- package/lib/requirements/worker.js +1 -0
- package/lib/requirements/worker.js.map +1 -1
- package/lib/scheduler/continuations.d.ts.map +1 -1
- package/lib/scheduler/continuations.js +17 -3
- package/lib/scheduler/continuations.js.map +1 -1
- package/lib/skills/builtin.d.ts.map +1 -1
- package/lib/skills/builtin.js +2 -0
- package/lib/skills/builtin.js.map +1 -1
- package/lib/skills/drama-builtin.d.ts.map +1 -1
- package/lib/skills/drama-builtin.js +13 -1
- package/lib/skills/drama-builtin.js.map +1 -1
- package/lib/skills/story-builtins.d.ts +3 -0
- package/lib/skills/story-builtins.d.ts.map +1 -0
- package/lib/skills/story-builtins.js +72 -0
- package/lib/skills/story-builtins.js.map +1 -0
- package/lib/skills/viora-canvas-builtin.d.ts.map +1 -1
- package/lib/skills/viora-canvas-builtin.js +12 -1
- package/lib/skills/viora-canvas-builtin.js.map +1 -1
- package/lib/snapshot-cache.d.ts +7 -0
- package/lib/snapshot-cache.d.ts.map +1 -0
- package/lib/snapshot-cache.js +26 -0
- package/lib/snapshot-cache.js.map +1 -0
- package/lib/tasks/result.js +1 -1
- package/lib/tasks/result.js.map +1 -1
- package/lib/ui/memory/concern-board.d.ts +1 -1
- package/lib/ui/memory/concern-board.d.ts.map +1 -1
- package/lib/ui/memory/concern-board.js +12 -6
- package/lib/ui/memory/concern-board.js.map +1 -1
- package/lib/ui/memory/concern-deletion.d.ts.map +1 -1
- package/lib/ui/memory/concern-deletion.js +2 -1
- package/lib/ui/memory/concern-deletion.js.map +1 -1
- package/lib/ui/memory/concern-editor.d.ts.map +1 -1
- package/lib/ui/memory/concern-editor.js +5 -3
- package/lib/ui/memory/concern-editor.js.map +1 -1
- package/lib/ui/memory/concern-execution-fields.d.ts +7 -0
- package/lib/ui/memory/concern-execution-fields.d.ts.map +1 -0
- package/lib/ui/memory/concern-execution-fields.js +8 -0
- package/lib/ui/memory/concern-execution-fields.js.map +1 -0
- package/lib/ui/memory/concern-feedback.d.ts +15 -0
- package/lib/ui/memory/concern-feedback.d.ts.map +1 -0
- package/lib/ui/memory/concern-feedback.js +13 -0
- package/lib/ui/memory/concern-feedback.js.map +1 -0
- package/lib/ui/memory/concern-panel.d.ts.map +1 -1
- package/lib/ui/memory/concern-panel.js +11 -3
- package/lib/ui/memory/concern-panel.js.map +1 -1
- package/package.json +5 -1
- package/resources/skills/novel-game-creation/manifest.json +393 -0
- package/resources/skills/novel-game-creation/upstream/LICENSE +21 -0
- package/resources/skills/novel-game-creation/upstream/README.md +420 -0
- package/resources/skills/novel-game-creation/upstream/README_ZH.md +421 -0
- package/resources/skills/novel-game-creation/upstream/VERSION +1 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/BUILD_BRIEF.md +219 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/.vercelignore +3 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/RUN.md +138 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/bg/compound_new_guofeng.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/fate_coda.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/meng.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/pan.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/pinger.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/xuee.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/yue.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_accord_five.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_afterglow_five.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_alliance.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day10.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day15.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day5.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/title_new_guofeng.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/pan_pinger.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/pan_xuee.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_meng.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_pan.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_pinger.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/meng/explicit.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/meng/prelude.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/meng.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/pan.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/pinger.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/xuee.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/yue.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pan/explicit.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pan/prelude.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pinger/explicit.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pinger/prelude.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/xuee/explicit.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/xuee/prelude.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/yue/explicit.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/yue/prelude.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/meng/night.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/pan/night.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/pinger/night.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/xuee/night.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/yue/night.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/household/li_jiaoer.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/scene/gate_collector.webp +0 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/css/new-guofeng.css +1494 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/css/style.css +2508 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/index.html +18 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/assets.js +147 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/audio.js +332 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/data.js +7470 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/engine.js +13066 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/main.js +3051 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/text.js +32 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/package.json +11 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/vercel.json +23 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/art/generated-art.json +161 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/example.json +12 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/README.md +26 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/playable-model.json +99 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/verification.json +41 -0
- package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/verify_playable_model.mjs +152 -0
- package/resources/skills/novel-game-creation/upstream/manifest.json +498 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-art-direction/SKILL.md +47 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-art-direction/agents/openai.yaml +4 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-art-direction/references/art-direction-method.md +40 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-build/SKILL.md +66 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-build/agents/openai.yaml +4 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-build/references/blender-asset-workflow.md +24 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-build/references/build-brief-contract.md +72 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-build/references/generative-media-pipeline.md +25 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-build/references/playable-model-contract.md +46 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-build/references/tts-production-contract.md +23 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-concept/SKILL.md +54 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-concept/agents/openai.yaml +4 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-concept/references/concept-method.md +47 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-qa/SKILL.md +39 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-qa/agents/openai.yaml +4 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-qa/references/qa-contract.md +66 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-qa/references/test-design-method.md +49 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-world-design/SKILL.md +50 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-world-design/agents/openai.yaml +4 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-world-design/references/narrative-design-method.md +35 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-world-design/references/numeric-design-method.md +22 -0
- package/resources/skills/novel-game-creation/upstream/skills/game-world-design/references/world-design-method.md +57 -0
- package/resources/skills/novel-game-creation/upstream/skills/novel-game-analyze/SKILL.md +68 -0
- package/resources/skills/novel-game-creation/upstream/skills/novel-game-analyze/agents/openai.yaml +4 -0
- package/resources/skills/novel-game-creation/upstream/skills/novel-game-analyze/references/gameability-protocol.md +65 -0
- package/resources/skills/novel-game-creation/upstream/skills/novel-to-game/SKILL.md +54 -0
- package/resources/skills/novel-game-creation/upstream/skills/novel-to-game/agents/openai.yaml +4 -0
- package/resources/skills/novel-game-creation/upstream/skills/novel-to-game/references/intake-method.md +50 -0
- package/resources/skills/novel-game-creation/upstream/skills/novel-to-game/references/pipeline-contract.md +60 -0
- package/resources/skills/story-creation/manifest.json +1477 -0
- package/resources/skills/story-creation/upstream/LICENSE.upstream +21 -0
- package/resources/skills/story-creation/upstream/manifest.json +1861 -0
- package/resources/skills/story-creation/upstream/roles/chapter-extractor.md +254 -0
- package/resources/skills/story-creation/upstream/roles/character-designer.md +168 -0
- package/resources/skills/story-creation/upstream/roles/consistency-checker.md +192 -0
- package/resources/skills/story-creation/upstream/roles/narrative-writer.md +105 -0
- package/resources/skills/story-creation/upstream/roles/story-architect.md +139 -0
- package/resources/skills/story-creation/upstream/roles/story-explorer.md +262 -0
- package/resources/skills/story-creation/upstream/roles/story-researcher.md +303 -0
- package/resources/skills/story-creation/upstream/skills/browser-cdp/SKILL.md +175 -0
- package/resources/skills/story-creation/upstream/skills/story/SKILL.md +129 -0
- package/resources/skills/story-creation/upstream/skills/story/VERSION +1 -0
- package/resources/skills/story-creation/upstream/skills/story/references/author-memory-maintenance.md +75 -0
- package/resources/skills/story-creation/upstream/skills/story/references/author-memory.md +117 -0
- package/resources/skills/story-creation/upstream/skills/story/scripts/author_memory_commit.py +1635 -0
- package/resources/skills/story-creation/upstream/skills/story-cover/SKILL.md +336 -0
- package/resources/skills/story-creation/upstream/skills/story-cover/references/cover-styles.md +210 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/SKILL.md +274 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/references/agent-calls.md +5 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/references/anti-ai-writing.md +556 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/references/author-memory-maintenance.md +75 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/references/author-memory.md +117 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/references/banned-words.md +151 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/references/deslop-gates.md +171 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/references/style-resolution.md +27 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/author_memory_commit.py +1635 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/check-ai-patterns.js +1586 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/check-degeneration.js +349 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/normalize-punctuation.js +415 -0
- package/resources/skills/story-creation/upstream/skills/story-deslop/scripts/style-whitelist.js +39 -0
- package/resources/skills/story-creation/upstream/skills/story-import/SKILL.md +127 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/character-state-reverse.md +82 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/deep-analysis.md +47 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/format-and-structure.md +168 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/import-report.md +64 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/import-special-cases.md +34 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/import-tracking.md +95 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/length-routing.md +134 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/outline-reverse-rules.md +79 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/outline-reverse.md +24 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/state-tracking.md +43 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/structure-mapping-long.md +448 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/structure-mapping-short.md +187 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/tracking-initialization.md +31 -0
- package/resources/skills/story-creation/upstream/skills/story-import/references/tracking-transaction.md +146 -0
- package/resources/skills/story-creation/upstream/skills/story-import/scripts/build_outline_brief.py +332 -0
- package/resources/skills/story-creation/upstream/skills/story-import/scripts/check-outline-contract.js +520 -0
- package/resources/skills/story-creation/upstream/skills/story-import/scripts/tracking_commit.py +1691 -0
- package/resources/skills/story-creation/upstream/skills/story-import/scripts/wordcount_core.py +405 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/SKILL.md +140 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/author-facing.md +252 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/deconstruction-notes.md +270 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/final-checks.md +19 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/index-rebuild.md +11 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/inspiration-library.md +105 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/pipeline-ops.md +154 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/semantic-acceptance-fixtures.md +84 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage1-golden-chapters.md +128 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage2-extraction.md +229 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage3-plot-rhythm.md +480 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage4-characters-settings.md +195 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/stage5-report.md +33 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/style-profile-generator.md +76 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/style-profile-protocol.md +133 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/references/synthesis-inputs.md +39 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/build_chapter_index.py +466 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/inspect_existing_assets.py +702 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/inspiration_index.py +864 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/manage_analysis_run.py +1145 -0
- package/resources/skills/story-creation/upstream/skills/story-long-analyze/scripts/render_relation_chart.py +425 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/SKILL.md +193 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/genre-trends.md +197 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-ciweimao.md +19 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-fanqie.md +45 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-jjwxc.md +28 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-qidian.md +35 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/platform-qimao.md +27 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/publishing-guide.md +114 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/reader-profiling.md +105 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/references/topic-decision.md +82 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/aggregate-rank.js +682 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/cdp-utils.js +242 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/ciweimao-rank-scraper.js +240 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/fanqie-rank-scraper.js +658 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/jjwxc-rank-scraper.js +400 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/qidian-rank-scraper.js +592 -0
- package/resources/skills/story-creation/upstream/skills/story-long-scan/scripts/qimao-rank-scraper.js +435 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/SKILL.md +136 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/agent-calls.md +47 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/anti-ai-writing.md +556 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/artifact-protocols.md +183 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/author-memory-maintenance.md +75 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/author-memory.md +117 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/banned-words.md +151 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/benchmark-recall.md +16 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/character-basics.md +445 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/character-design-methods.md +428 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/character-relations.md +433 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/commercial-core-methods.md +502 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/cross-book-recall.md +88 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/deslop-gates.md +171 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/dialogue-mastery.md +288 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/emotion-on-page.md +116 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/emotional-arc-design.md +313 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/emotional-methods.md +209 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/female-audience-writing.md +188 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//344/270/234/346/226/271/344/273/231/344/276/240.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//344/274/240/347/273/237/347/216/204/345/271/273.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/216/206/345/217/262/345/217/244/344/273/243.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/216/206/345/217/262/350/204/221/346/264/236.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/217/214/347/224/267/344/270/273.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/217/244/350/250/200/350/204/221/346/264/236.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/217/244/351/243/216/344/270/226/346/203/205.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/245/263/351/242/221/346/202/254/347/226/221.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/245/263/351/242/221/347/247/215/347/224/260.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/256/253/346/226/227/345/256/205/346/226/227.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/271/264/344/273/243.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//345/277/253/347/251/277.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/202/254/347/226/221/347/201/265/345/274/202.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/202/254/347/226/221/350/204/221/346/264/236.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/210/230/347/245/236/350/265/230/345/251/277.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/212/227/346/210/230/350/260/215/346/210/230.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/230/237/345/205/211/347/222/200/347/222/250.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/260/221/345/233/275/350/250/200/346/203/205.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//346/270/270/346/210/217/344/275/223/350/202/262.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//347/216/204/345/271/273/350/204/221/346/264/236.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//347/216/204/345/271/273/350/250/200/346/203/205.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//347/216/260/350/250/200/350/204/221/346/264/236.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//347/247/221/345/271/273/346/234/253/344/270/226.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//350/201/214/345/234/272/345/251/232/346/201/213.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//350/245/277/346/226/271/345/245/207/345/271/273.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//350/261/252/351/227/250/346/200/273/350/243/201.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/344/277/256/347/234/237.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/346/227/245/345/270/270.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/347/247/215/347/224/260.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/350/204/221/346/264/236.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/203/275/345/270/202/351/253/230/346/255/246.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards//351/235/222/346/230/245/347/224/234/345/256/240.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-prose-cards.md +91 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/genre-readers.md +235 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-chapter-hooks.md +225 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-chapter-quality.md +177 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-format.md +36 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-genre-catalog.md +394 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-genre-mechanics.md +415 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-reversal.md +335 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/long-suspense.md +352 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/opening-design.md +349 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/outline-conflict.md +457 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/outline-methods.md +287 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/outline-rhythm.md +389 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/outline-structure-theory.md +273 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/plot-core-methods.md +522 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/plot-emotion-system.md +354 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/plot-frameworks.md +711 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/plot-special-topics.md +622 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/project-files.md +114 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/reader-contract-and-progression.md +117 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/reference-index.md +86 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/stop-and-fix.md +9 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/style-combat-face.md +352 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/style-craft.md +327 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/style-genre-modules.md +510 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/style-resolution.md +27 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/tracking-initialization.md +31 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/tracking-transaction.md +146 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-chapter.md +104 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-daily.md +75 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-outline.md +157 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-revision.md +89 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-setup.md +170 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/workflow-volume.md +142 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/writer-prompt-fallback.md +24 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/references/writing-craft.md +442 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/author_memory_commit.py +1635 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/build_architect_brief.py +260 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/build_writer_prompt.py +611 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/check-ai-patterns.js +1586 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/check-degeneration.js +349 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/check-outline-contract.js +520 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/check-outline-copy.js +313 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/normalize-punctuation.js +415 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/outline_view.py +286 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/storyctl.py +561 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/style-whitelist.js +39 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/tracking_commit.py +1691 -0
- package/resources/skills/story-creation/upstream/skills/story-long-write/scripts/wordcount_core.py +405 -0
- package/resources/skills/story-creation/upstream/skills/story-review/SKILL.md +231 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/agent-prompts.md +184 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/anti-ai-writing.md +556 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/author-memory-maintenance.md +75 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/author-memory.md +117 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/banned-words.md +151 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/batch-review.md +19 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/character-relations.md +433 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/dialogue-mastery.md +288 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/plot-core-methods.md +522 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/quality-rubric.md +55 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/review-quality.md +246 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/review-tracking.md +10 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/rubrics/fanqie.md +18 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/rubrics/qidian.md +19 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/rubrics/zhihu.md +20 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/solo.md +52 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/style-resolution.md +27 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/tracking-initialization.md +31 -0
- package/resources/skills/story-creation/upstream/skills/story-review/references/tracking-transaction.md +146 -0
- package/resources/skills/story-creation/upstream/skills/story-review/scripts/author_memory_commit.py +1635 -0
- package/resources/skills/story-creation/upstream/skills/story-review/scripts/check-ai-patterns.js +1586 -0
- package/resources/skills/story-creation/upstream/skills/story-review/scripts/check-degeneration.js +349 -0
- package/resources/skills/story-creation/upstream/skills/story-review/scripts/normalize-punctuation.js +415 -0
- package/resources/skills/story-creation/upstream/skills/story-review/scripts/style-whitelist.js +39 -0
- package/resources/skills/story-creation/upstream/skills/story-review/scripts/tracking_commit.py +1691 -0
- package/resources/skills/story-creation/upstream/skills/story-review/scripts/wordcount_core.py +405 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/SKILL.md +165 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/agent-quality.md +72 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/agent-reference-profiles.md +55 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/anti-ai-writing.md +556 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/banned-words.md +151 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/benchmark-style-load.md +107 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/character-basics.md +445 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/character-design-methods.md +428 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/character-relations.md +433 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/deslop-gates.md +171 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/dialogue-mastery.md +288 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/emotion-on-page.md +116 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/emotional-arc-design.md +313 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/format-and-structure.md +168 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//344/270/234/346/226/271/344/273/231/344/276/240.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//344/274/240/347/273/237/347/216/204/345/271/273.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/216/206/345/217/262/345/217/244/344/273/243.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/216/206/345/217/262/350/204/221/346/264/236.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/217/214/347/224/267/344/270/273.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/217/244/350/250/200/350/204/221/346/264/236.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/217/244/351/243/216/344/270/226/346/203/205.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/245/263/351/242/221/346/202/254/347/226/221.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/245/263/351/242/221/347/247/215/347/224/260.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/256/253/346/226/227/345/256/205/346/226/227.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/271/264/344/273/243.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//345/277/253/347/251/277.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/202/254/347/226/221/347/201/265/345/274/202.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/202/254/347/226/221/350/204/221/346/264/236.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/210/230/347/245/236/350/265/230/345/251/277.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/212/227/346/210/230/350/260/215/346/210/230.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/230/237/345/205/211/347/222/200/347/222/250.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/260/221/345/233/275/350/250/200/346/203/205.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//346/270/270/346/210/217/344/275/223/350/202/262.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//347/216/204/345/271/273/350/204/221/346/264/236.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//347/216/204/345/271/273/350/250/200/346/203/205.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//347/216/260/350/250/200/350/204/221/346/264/236.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//347/247/221/345/271/273/346/234/253/344/270/226.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//350/201/214/345/234/272/345/251/232/346/201/213.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//350/245/277/346/226/271/345/245/207/345/271/273.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//350/261/252/351/227/250/346/200/273/350/243/201.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/344/277/256/347/234/237.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/346/227/245/345/270/270.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/347/247/215/347/224/260.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/350/204/221/346/264/236.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/203/275/345/270/202/351/253/230/346/255/246.md +53 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards//351/235/222/346/230/245/347/224/234/345/256/240.md +51 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-prose-cards.md +91 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/genre-readers.md +235 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-chapter-hooks.md +225 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-emotional-methods.md +209 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-genre-catalog.md +394 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-genre-mechanics.md +415 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-quality.md +42 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-reversal.md +335 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/long-suspense.md +352 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/opening-design.md +349 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/outline-conflict.md +457 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/outline-methods.md +287 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/outline-rhythm.md +389 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/plot-core-methods.md +522 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-chapter-hooks.md +225 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-emotional-methods.md +179 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-genre-formulas.md +417 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-paragraph-hooks.md +146 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-quality.md +39 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-reversal.md +355 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/short-suspense.md +352 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/style-combat-face.md +352 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/style-genre-modules.md +510 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/style-resolution.md +27 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/agent-references/writing-craft.md +442 -0
- package/resources/skills/story-creation/upstream/skills/story-setup/references/diagnostics.md +38 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/SKILL.md +224 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-character-basics.md +453 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-character-design.md +438 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-character-relations.md +395 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-method.md +42 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-paragraph-hooks.md +146 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-reader-profile.md +245 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-report-style.md +45 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-genres.md +65 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-hooks.md +77 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-mechanics.md +82 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-patterns.md +50 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-short-suspense.md +98 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/analysis-writing-techniques.md +477 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/deconstruction-examples.md +79 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/optional-modules.md +97 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/output-contract.md +127 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/quality-checklist.md +80 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/real-market-data.md +90 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/source-story-quality.md +221 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/stage2-3-structure-emotion.md +308 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/stage4-6-reversal-summary.md +611 -0
- package/resources/skills/story-creation/upstream/skills/story-short-analyze/references/zhihu-style.md +54 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/SKILL.md +182 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/references/manual-rank-input.md +36 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/references/platform-dianzhong.md +24 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/references/platform-heiyan.md +21 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/references/real-market-data.md +90 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/references/topic-match.md +38 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/scripts/aggregate-rank.js +682 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/scripts/cdp-utils.js +242 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/scripts/dz-browse-scraper.js +232 -0
- package/resources/skills/story-creation/upstream/skills/story-short-scan/scripts/heiyan-booklist-scraper.js +345 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/SKILL.md +136 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/agent-calls.md +13 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/author-memory-maintenance.md +75 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/author-memory.md +117 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/banned-words.md +151 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/benchmark-recall.md +40 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/cross-book-recall.md +62 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/dialogue-mastery.md +288 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/emotional-methods.md +179 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//344/270/226/346/203/205/346/211/223/350/204/270.md +159 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//345/217/214/347/224/267/344/270/273.md +156 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//345/244/215/344/273/207/346/211/223/350/204/270.md +163 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//345/256/205/346/226/227/345/256/253/346/226/227.md +167 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//346/200/273/350/243/201/350/261/252/351/227/250.md +178 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//346/202/254/347/226/221.md +166 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//346/260/221/344/277/227/346/200/252/350/260/210.md +159 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//346/262/231/351/233/225/350/204/221/346/264/236.md +151 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//347/224/234/345/256/240.md +153 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-styles//350/277/275/345/246/273/347/201/253/350/221/254/345/234/272.md +210 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-writing-formulas.md +417 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/genre-writing-techniques.md +490 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/hooks-chapter.md +225 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/hooks-paragraph.md +146 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/output-contract.md +127 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/reference-index.md +23 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/scene-craft.md +40 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-craft.md +147 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-deslop.md +133 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-format.md +199 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-prose-quality.md +224 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-reversal.md +355 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/short-suspense.md +352 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/style-resolution.md +27 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/submission-craft.md +35 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/villain-and-reveal.md +153 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/workflow-design.md +85 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/workflow-draft.md +116 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/workflow-revision.md +99 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/references/writing-workflow.md +50 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/author_memory_commit.py +1635 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-ai-patterns.js +1586 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-degeneration.js +349 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-delivery-contract.js +241 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-outline-copy.js +313 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/check-phase2-contract.js +363 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/normalize-punctuation.js +415 -0
- package/resources/skills/story-creation/upstream/skills/story-short-write/scripts/style-whitelist.js +39 -0
- package/resources/skills/video-recap-production/manifest.json +673 -0
- package/resources/skills/video-recap-production/upstream/CHANGELOG.md +371 -0
- package/resources/skills/video-recap-production/upstream/LICENSE +21 -0
- package/resources/skills/video-recap-production/upstream/README.en.md +468 -0
- package/resources/skills/video-recap-production/upstream/README.md +459 -0
- package/resources/skills/video-recap-production/upstream/manifest.json +839 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/SKILL.md +112 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/audio-modes.md +63 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/explicit-audio-mix.md +75 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/foreground-compose.md +118 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/LICENSE.duo-video +21 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/SOURCE.md +15 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_draft_meta_info.json +69 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_combination_segment.json +84 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_combination_video_material.json +98 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_draft.json +204 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_material_video.json +83 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_meta_material_value.json +23 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_project_info.json +133 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_segment.json +70 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_jy_text_styles.json +30 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_yj_material_audio.json +41 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/jianying/empty_yj_material_text.json +109 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/narration-adoption.md +103 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/packaging.md +45 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/pair-media.md +74 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/source-score.md +147 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/references/subtitle-track.md +202 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/__init__.py +1 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/audio_mix_binding.py +279 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/frozen_audio.py +187 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/narration_binding.py +323 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/strict_inputs.py +109 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/adoption/strict_publish.py +130 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/artifacts.py +47 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/assemble.py +591 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/assemble_constants.py +51 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/assembly_contract.py +318 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/assembly_settings.py +138 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/audio_automation.py +195 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/audio_mix.py +465 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/compose_foreground.py +293 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/export_jianying.py +254 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/__init__.py +1 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/builders.py +718 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/model.py +105 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/optional.py +23 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/schema.py +53 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/templates.py +37 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/timeline_contract.py +223 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/tracks.py +72 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/jianying/writer.py +383 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/lib.py +218 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/media.py +190 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/narration_audio.py +413 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/packaging.py +122 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/pair_media.py +216 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/render_preflight.py +33 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/source_score.py +469 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/source_subtitles.py +423 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/__init__.py +1 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/core.py +330 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/render.py +82 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/track.py +324 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/subtitles/track_binding.py +200 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/timeline.py +217 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/timeline_emit.py +167 -0
- package/resources/skills/video-recap-production/upstream/skills/video-assemble/scripts/visual_render.py +448 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/SKILL.md +108 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/references/shot-review.md +50 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/cut.py +41 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/cut_cli.py +308 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/cut_contract.py +424 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/cut_render.py +304 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/lib.py +114 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/media_geometry.py +238 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/narration_mapping.py +71 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/narrative_selection.py +244 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/sentence_boundaries.py +585 -0
- package/resources/skills/video-recap-production/upstream/skills/video-cut/scripts/shot_review.py +357 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/SKILL.md +260 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/references/audio-routing.md +126 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/references/config-playbook.md +65 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/references/data-schema.md +545 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/references/resource-library.md +151 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/references/shift-left-qc-schema.md +23 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/doctor.py +556 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/final_qc.py +527 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/lib.py +220 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/library.py +509 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/materials.py +406 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/mimo_qc.py +33 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/project_binding.py +286 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/__init__.py +1 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_client.py +13 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_contract.py +9 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_evidence.py +287 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_observations.py +175 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_payload.py +206 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_report.py +318 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc/mimo_runner.py +130 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/qc_contract.py +320 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap.py +9 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_cli.py +209 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_inspect.py +452 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_review.py +70 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_runner.py +696 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_runtime.py +260 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_source.py +278 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_stage_qc.py +160 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/recap_timeline.py +621 -0
- package/resources/skills/video-recap-production/upstream/skills/video-recap/scripts/resource_lock.py +162 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/SKILL.md +251 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/references/creative-editing-playbook.md +229 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/references/promotional-copy.md +68 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/references/research-guide.md +75 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/agent_text.py +301 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/deslop_qc.py +211 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/evidence_bundle.py +440 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/lib.py +254 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/narration_lint.py +707 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/review.py +40 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/review_grounding.py +238 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/review_response.py +669 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/review_runner.py +186 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/speech_ownership.py +143 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/timeline_fusion.py +108 -0
- package/resources/skills/video-recap-production/upstream/skills/video-script/scripts/validate.py +175 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/SKILL.md +77 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/references/data-schema.md +193 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/references/prompt-templates.md +37 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/references/research-guide.md +74 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/agent_text.py +301 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/asr.py +279 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/asr_timing_evidence.py +270 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/brief.py +9 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/__init__.py +1 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/builder.py +402 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/context.py +317 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/inputs.py +268 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/briefing/timeline.py +326 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/consolidate.py +596 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/deslop_qc.py +211 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/detect.py +504 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/extract.py +62 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/lib.py +419 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/narration_lint.py +707 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/speech_ownership.py +143 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/storyboard.py +445 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/timeline_fusion.py +108 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understand.py +9 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understanding_brief.py +190 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understanding_cache.py +345 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understanding_runner.py +387 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/understanding_storyboard.py +167 -0
- package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/vlm.py +674 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/SKILL.md +91 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/references/index-tts.md +31 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/approved_text_policy.py +123 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/dub.py +623 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/lib.py +352 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/providers/__init__.py +1 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/providers/fish_audio.py +91 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/providers/index_tts.py +184 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/tts_audio.py +102 -0
- package/resources/skills/video-recap-production/upstream/skills/video-voiceover/scripts/voiceover.py +771 -0
- package/resources/skills/viora-canvas-production/manifest.json +5 -1
- package/resources/skills/viora-canvas-production/references/story-handoff.md +49 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
"""Safe writer and portable media bundler for JianYing draft folders."""
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import shutil
|
|
7
|
+
import tempfile
|
|
8
|
+
import time
|
|
9
|
+
import uuid
|
|
10
|
+
import zipfile
|
|
11
|
+
|
|
12
|
+
from jianying.templates import template
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
DRAFT_PATH_PLACEHOLDER = "##_draftpath_placeholder_0E685133-18CE-45ED-8CB8-2904A212EC80_##"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def validate_draft_name(draft_name):
|
|
19
|
+
"""Reject draft names that could escape or alias the requested parent dir."""
|
|
20
|
+
if not isinstance(draft_name, str):
|
|
21
|
+
raise TypeError("draft_name must be a string")
|
|
22
|
+
if not draft_name or not draft_name.strip():
|
|
23
|
+
raise ValueError("draft_name must not be empty")
|
|
24
|
+
if os.path.isabs(draft_name):
|
|
25
|
+
raise ValueError("draft_name must be a plain folder name, not an absolute path")
|
|
26
|
+
if "/" in draft_name or "\\" in draft_name:
|
|
27
|
+
raise ValueError("draft_name must not contain path separators")
|
|
28
|
+
if draft_name in {".", ".."}:
|
|
29
|
+
raise ValueError("draft_name must not be '.' or '..'")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _resource_kind(material, materials_key):
|
|
33
|
+
if materials_key == "audios":
|
|
34
|
+
return "audio", "music"
|
|
35
|
+
if material.get("type") == "photo":
|
|
36
|
+
return "image", "photo"
|
|
37
|
+
return "video", "video"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
RESOURCE_DIRECTORY_BY_MATERIALS_KEY = {
|
|
41
|
+
"chromas": "effect",
|
|
42
|
+
"common_mask": "mask",
|
|
43
|
+
"effects": "effect",
|
|
44
|
+
"masks": "mask",
|
|
45
|
+
"stickers": "sticker",
|
|
46
|
+
"texts": "text",
|
|
47
|
+
"text_templates": "text_template",
|
|
48
|
+
"transitions": "transition",
|
|
49
|
+
"video_effects": "effect",
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _unused_name(directory, basename, used):
|
|
54
|
+
"""Return a collision-free filename within one resource directory."""
|
|
55
|
+
name = basename
|
|
56
|
+
stem, ext = os.path.splitext(basename)
|
|
57
|
+
suffix = 1
|
|
58
|
+
while name in used or os.path.exists(os.path.join(directory, name)):
|
|
59
|
+
name = f"{stem}_{suffix}{ext}"
|
|
60
|
+
suffix += 1
|
|
61
|
+
used.add(name)
|
|
62
|
+
return name
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _md5(path):
|
|
66
|
+
digest = hashlib.md5(usedforsecurity=False)
|
|
67
|
+
with open(path, "rb") as source:
|
|
68
|
+
for chunk in iter(lambda: source.read(1024 * 1024), b""):
|
|
69
|
+
digest.update(chunk)
|
|
70
|
+
return digest.hexdigest()
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _meta_value(material, relative_path, metetype, copied_path, timestamp_ms):
|
|
74
|
+
duration = int(material.get("duration") or 0)
|
|
75
|
+
timestamp_s = timestamp_ms // 1000
|
|
76
|
+
value = template("meta_material")
|
|
77
|
+
value.update({
|
|
78
|
+
"duration": duration,
|
|
79
|
+
"height": int(material.get("height") or 0),
|
|
80
|
+
# duo-video indexes imported local resources independently from the
|
|
81
|
+
# draft-content material IDs.
|
|
82
|
+
"id": str(uuid.uuid4()).upper(),
|
|
83
|
+
"md5": _md5(copied_path),
|
|
84
|
+
"metetype": metetype,
|
|
85
|
+
"type": 0,
|
|
86
|
+
"width": int(material.get("width") or 0),
|
|
87
|
+
"create_time": timestamp_s,
|
|
88
|
+
"extra_info": os.path.basename(relative_path),
|
|
89
|
+
"file_Path": f"./{relative_path}",
|
|
90
|
+
"import_time": timestamp_s,
|
|
91
|
+
"import_time_ms": timestamp_ms,
|
|
92
|
+
"item_source": 1,
|
|
93
|
+
"roughcut_time_range": {"duration": duration, "start": 0},
|
|
94
|
+
"sub_time_range": {"duration": -1, "start": -1},
|
|
95
|
+
})
|
|
96
|
+
return value
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _material_sets(content):
|
|
100
|
+
"""Yield root and nested compound-draft material dictionaries."""
|
|
101
|
+
materials = content["materials"]
|
|
102
|
+
yield materials
|
|
103
|
+
for draft in materials["drafts"]:
|
|
104
|
+
yield from _material_sets(draft["draft"])
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _replace_value(value, old, new):
|
|
108
|
+
if isinstance(value, dict):
|
|
109
|
+
for key, item in value.items():
|
|
110
|
+
value[key] = _replace_value(item, old, new)
|
|
111
|
+
elif isinstance(value, list):
|
|
112
|
+
for index, item in enumerate(value):
|
|
113
|
+
value[index] = _replace_value(item, old, new)
|
|
114
|
+
elif isinstance(value, str):
|
|
115
|
+
if value == old:
|
|
116
|
+
return new
|
|
117
|
+
return value
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def _replace_material_resource_path(material, materials_key, old, new):
|
|
121
|
+
"""Rewrite one declared resource, including the known rich-text JSON field."""
|
|
122
|
+
_replace_value(material, old, new)
|
|
123
|
+
if materials_key != "texts" or not isinstance(material.get("content"), str):
|
|
124
|
+
return
|
|
125
|
+
content = json.loads(material["content"])
|
|
126
|
+
_replace_value(content, old, new)
|
|
127
|
+
material["content"] = json.dumps(content, ensure_ascii=False, separators=(",", ":"))
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def _safe_resource_target(target_path):
|
|
131
|
+
normalized = os.path.normpath(str(target_path).replace("\\", "/"))
|
|
132
|
+
if normalized in {"", "."} or os.path.isabs(normalized):
|
|
133
|
+
raise ValueError(f"invalid JianYing resource target_path: {target_path}")
|
|
134
|
+
if normalized == ".." or normalized.startswith("../"):
|
|
135
|
+
raise ValueError(f"JianYing resource target_path escapes package: {target_path}")
|
|
136
|
+
return normalized
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def _extract_zip(source, destination):
|
|
140
|
+
os.makedirs(destination, exist_ok=False)
|
|
141
|
+
destination_real = os.path.realpath(destination)
|
|
142
|
+
with zipfile.ZipFile(source) as archive:
|
|
143
|
+
for member in archive.infolist():
|
|
144
|
+
member_path = os.path.realpath(os.path.join(destination, member.filename))
|
|
145
|
+
if os.path.commonpath((destination_real, member_path)) != destination_real:
|
|
146
|
+
raise ValueError(f"unsafe path in JianYing resource archive: {member.filename}")
|
|
147
|
+
archive.extractall(destination)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def _copy_resource(source, resource_kind, resources_root, used, target_path=None):
|
|
151
|
+
resource_dir = os.path.join(resources_root, resource_kind)
|
|
152
|
+
os.makedirs(resource_dir, exist_ok=True)
|
|
153
|
+
is_zip = os.path.isfile(source) and zipfile.is_zipfile(source)
|
|
154
|
+
if target_path is None:
|
|
155
|
+
basename = os.path.basename(source.rstrip(os.sep))
|
|
156
|
+
if is_zip:
|
|
157
|
+
basename = os.path.splitext(basename)[0]
|
|
158
|
+
relative_target = _unused_name(resource_dir, basename, used[resource_kind])
|
|
159
|
+
else:
|
|
160
|
+
relative_target = _safe_resource_target(target_path)
|
|
161
|
+
copied_path = os.path.join(resource_dir, relative_target)
|
|
162
|
+
copied_real = os.path.realpath(copied_path)
|
|
163
|
+
if os.path.commonpath((os.path.realpath(resource_dir), copied_real)) != os.path.realpath(resource_dir):
|
|
164
|
+
raise ValueError(f"JianYing resource target escapes package: {target_path}")
|
|
165
|
+
os.makedirs(os.path.dirname(copied_path), exist_ok=True)
|
|
166
|
+
if os.path.exists(copied_path):
|
|
167
|
+
raise FileExistsError(f"duplicate JianYing resource target: {relative_target}")
|
|
168
|
+
if is_zip:
|
|
169
|
+
_extract_zip(source, copied_path)
|
|
170
|
+
elif os.path.isdir(source):
|
|
171
|
+
shutil.copytree(source, copied_path)
|
|
172
|
+
else:
|
|
173
|
+
shutil.copy2(source, copied_path)
|
|
174
|
+
relative_path = f"Resources/local/{resource_kind}/{relative_target.replace(os.sep, '/')}"
|
|
175
|
+
return copied_path, relative_path, f"{DRAFT_PATH_PLACEHOLDER}/{relative_path}"
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def _is_packaged_path(value):
|
|
179
|
+
return str(value).startswith((DRAFT_PATH_PLACEHOLDER, "Resources/", "./Resources/"))
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _descriptor(raw, default_kind, *, required):
|
|
183
|
+
"""`raw` is a contract-validated resource entry: an object with a non-empty source_path."""
|
|
184
|
+
source = raw["source_path"]
|
|
185
|
+
resource_kind = raw.get("resource_kind", default_kind)
|
|
186
|
+
target_path = raw.get("target_path")
|
|
187
|
+
if not isinstance(resource_kind, str) or resource_kind not in {
|
|
188
|
+
"audio", "effect", "fonts", "image", "lut", "mask", "sticker",
|
|
189
|
+
"text", "text_template", "transition", "video",
|
|
190
|
+
}:
|
|
191
|
+
raise ValueError(f"invalid JianYing resource kind: {resource_kind}")
|
|
192
|
+
return {
|
|
193
|
+
"source_path": source,
|
|
194
|
+
"resource_kind": resource_kind,
|
|
195
|
+
"target_path": target_path,
|
|
196
|
+
"required": required,
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def _material_resource_descriptors(material, default_kind):
|
|
201
|
+
descriptors = [
|
|
202
|
+
_descriptor(raw, default_kind, required=True)
|
|
203
|
+
for raw in material.get("_bundle_resources", [])
|
|
204
|
+
]
|
|
205
|
+
path = material.get("path")
|
|
206
|
+
if isinstance(path, str) and path and not _is_packaged_path(path):
|
|
207
|
+
if not any(item["source_path"] == path for item in descriptors):
|
|
208
|
+
descriptors.append({
|
|
209
|
+
"source_path": path,
|
|
210
|
+
"resource_kind": default_kind,
|
|
211
|
+
"target_path": None,
|
|
212
|
+
"required": False,
|
|
213
|
+
})
|
|
214
|
+
return descriptors
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def bundle_media(content, meta, draft_dir):
|
|
218
|
+
"""Copy media into duo-video's Resources/local contract and index it.
|
|
219
|
+
|
|
220
|
+
Materials that reference the same source file and resource kind share one
|
|
221
|
+
copied file and one meta entry. Missing sources remain untouched and are
|
|
222
|
+
reported to the caller so a non-portable reference is never disguised as a
|
|
223
|
+
successfully bundled one.
|
|
224
|
+
"""
|
|
225
|
+
resources_root = os.path.join(draft_dir, "Resources", "local")
|
|
226
|
+
copied = {}
|
|
227
|
+
resource_kinds = {
|
|
228
|
+
"audio", "effect", "fonts", "image", "lut", "mask", "sticker",
|
|
229
|
+
"text", "text_template", "transition", "video",
|
|
230
|
+
}
|
|
231
|
+
used = {kind: set() for kind in resource_kinds}
|
|
232
|
+
meta_values = []
|
|
233
|
+
notes = []
|
|
234
|
+
timestamp_ms = int(time.time() * 1000)
|
|
235
|
+
|
|
236
|
+
material_sets = list(_material_sets(content))
|
|
237
|
+
for materials in material_sets:
|
|
238
|
+
for materials_key in ("videos", "audios"):
|
|
239
|
+
for material in materials.get(materials_key, []):
|
|
240
|
+
src = material.get("path")
|
|
241
|
+
if not src:
|
|
242
|
+
continue
|
|
243
|
+
resource_kind, metetype = _resource_kind(material, materials_key)
|
|
244
|
+
source_key = (resource_kind, os.path.realpath(src))
|
|
245
|
+
existing = copied.get(source_key)
|
|
246
|
+
if existing is not None:
|
|
247
|
+
material["path"] = existing["draft_path"]
|
|
248
|
+
continue
|
|
249
|
+
if not os.path.isfile(src):
|
|
250
|
+
if not _is_packaged_path(src):
|
|
251
|
+
notes.append(f"素材缺失,未打包: {src}")
|
|
252
|
+
continue
|
|
253
|
+
|
|
254
|
+
copied_path, relative_path, draft_path = _copy_resource(
|
|
255
|
+
src, resource_kind, resources_root, used
|
|
256
|
+
)
|
|
257
|
+
material["path"] = draft_path
|
|
258
|
+
copied[source_key] = {"draft_path": draft_path}
|
|
259
|
+
meta_values.append(
|
|
260
|
+
_meta_value(material, relative_path, metetype, copied_path, timestamp_ms)
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
for materials_key, resource_kind in RESOURCE_DIRECTORY_BY_MATERIALS_KEY.items():
|
|
264
|
+
for material in materials.get(materials_key, []):
|
|
265
|
+
descriptors = _material_resource_descriptors(
|
|
266
|
+
material, resource_kind
|
|
267
|
+
)
|
|
268
|
+
seen_descriptors = set()
|
|
269
|
+
for descriptor in descriptors:
|
|
270
|
+
src = descriptor["source_path"]
|
|
271
|
+
if _is_packaged_path(src):
|
|
272
|
+
continue
|
|
273
|
+
descriptor_key = (
|
|
274
|
+
descriptor["resource_kind"],
|
|
275
|
+
os.path.realpath(src),
|
|
276
|
+
descriptor["target_path"],
|
|
277
|
+
)
|
|
278
|
+
if descriptor_key in seen_descriptors:
|
|
279
|
+
continue
|
|
280
|
+
seen_descriptors.add(descriptor_key)
|
|
281
|
+
if not os.path.exists(src):
|
|
282
|
+
message = f"声明的剪映资源缺失: {src}"
|
|
283
|
+
if descriptor["required"]:
|
|
284
|
+
raise ValueError(message)
|
|
285
|
+
notes.append(message)
|
|
286
|
+
continue
|
|
287
|
+
kind = descriptor["resource_kind"]
|
|
288
|
+
source_key = (kind, os.path.realpath(src), descriptor["target_path"])
|
|
289
|
+
existing = copied.get(source_key)
|
|
290
|
+
if existing is None:
|
|
291
|
+
_copied_path, _relative_path, draft_path = _copy_resource(
|
|
292
|
+
src,
|
|
293
|
+
kind,
|
|
294
|
+
resources_root,
|
|
295
|
+
used,
|
|
296
|
+
target_path=descriptor["target_path"],
|
|
297
|
+
)
|
|
298
|
+
copied[source_key] = {"draft_path": draft_path}
|
|
299
|
+
else:
|
|
300
|
+
draft_path = existing["draft_path"]
|
|
301
|
+
_replace_material_resource_path(
|
|
302
|
+
material, materials_key, src, draft_path
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
material_group = next(group for group in meta["draft_materials"] if group["type"] == 0)
|
|
306
|
+
material_group["value"] = meta_values
|
|
307
|
+
meta["draft_timeline_materials_size_"] = sum(
|
|
308
|
+
os.path.getsize(os.path.join(draft_dir, value["file_Path"][2:]))
|
|
309
|
+
for value in meta_values
|
|
310
|
+
)
|
|
311
|
+
return notes
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def strip_internal_resource_fields(content):
|
|
315
|
+
for materials in _material_sets(content):
|
|
316
|
+
for entries in materials.values():
|
|
317
|
+
for material in entries:
|
|
318
|
+
material.pop("_bundle_resources", None)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def draft_dir_has_user_content(draft_dir):
|
|
322
|
+
"""Return True when writing here could overwrite an existing draft/material."""
|
|
323
|
+
if not os.path.exists(draft_dir):
|
|
324
|
+
return False
|
|
325
|
+
try:
|
|
326
|
+
return any(os.scandir(draft_dir))
|
|
327
|
+
except OSError:
|
|
328
|
+
return True
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def collision_safe_draft_dir(out_dir, draft_name):
|
|
332
|
+
"""Pick a fresh draft folder instead of overwriting an existing non-empty one."""
|
|
333
|
+
validate_draft_name(draft_name)
|
|
334
|
+
base = os.path.join(out_dir, draft_name)
|
|
335
|
+
if not draft_dir_has_user_content(base):
|
|
336
|
+
return base, draft_name
|
|
337
|
+
idx = 2
|
|
338
|
+
while True:
|
|
339
|
+
candidate_name = f"{draft_name}_{idx}"
|
|
340
|
+
candidate = os.path.join(out_dir, candidate_name)
|
|
341
|
+
if not draft_dir_has_user_content(candidate):
|
|
342
|
+
return candidate, candidate_name
|
|
343
|
+
idx += 1
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def write_draft(content, meta, notes, out_dir, draft_name, bundle_media_enabled=False):
|
|
347
|
+
"""Atomically write the three JianYing draft JSON files and optional bundle."""
|
|
348
|
+
validate_draft_name(draft_name)
|
|
349
|
+
out_dir = os.path.abspath(out_dir)
|
|
350
|
+
os.makedirs(out_dir, exist_ok=True)
|
|
351
|
+
draft_dir, actual_name = collision_safe_draft_dir(out_dir, draft_name)
|
|
352
|
+
notes = list(notes)
|
|
353
|
+
if actual_name != draft_name:
|
|
354
|
+
notes.append(f"草稿目录已存在,改写为 {actual_name} 以避免覆盖")
|
|
355
|
+
|
|
356
|
+
tmp_parent = tempfile.mkdtemp(prefix=f".{actual_name}.", dir=out_dir)
|
|
357
|
+
tmp_dir = os.path.join(tmp_parent, actual_name)
|
|
358
|
+
try:
|
|
359
|
+
os.makedirs(tmp_dir, exist_ok=False)
|
|
360
|
+
if bundle_media_enabled:
|
|
361
|
+
notes.extend(bundle_media(content, meta, tmp_dir))
|
|
362
|
+
strip_internal_resource_fields(content)
|
|
363
|
+
timestamp_ms = int(time.time() * 1000)
|
|
364
|
+
meta["draft_name"] = actual_name
|
|
365
|
+
meta["draft_fold_path"] = draft_dir
|
|
366
|
+
meta["tm_draft_create"] = timestamp_ms
|
|
367
|
+
meta["tm_draft_modified"] = timestamp_ms
|
|
368
|
+
content["name"] = actual_name
|
|
369
|
+
for fname in ("draft_content.json", "draft_info.json"):
|
|
370
|
+
with open(os.path.join(tmp_dir, fname), "w", encoding="utf-8") as f:
|
|
371
|
+
json.dump(content, f, ensure_ascii=False, indent=2)
|
|
372
|
+
with open(os.path.join(tmp_dir, "draft_meta_info.json"), "w", encoding="utf-8") as f:
|
|
373
|
+
json.dump(meta, f, ensure_ascii=False, indent=2)
|
|
374
|
+
if os.path.isdir(draft_dir) and not draft_dir_has_user_content(draft_dir):
|
|
375
|
+
os.rmdir(draft_dir)
|
|
376
|
+
os.replace(tmp_dir, draft_dir)
|
|
377
|
+
except Exception:
|
|
378
|
+
shutil.rmtree(tmp_parent, ignore_errors=True)
|
|
379
|
+
raise
|
|
380
|
+
finally:
|
|
381
|
+
if os.path.exists(tmp_parent):
|
|
382
|
+
shutil.rmtree(tmp_parent, ignore_errors=True)
|
|
383
|
+
return draft_dir, notes
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"""Self-contained config + utilities for this skill (no cross-skill imports)."""
|
|
2
|
+
import functools
|
|
3
|
+
import math
|
|
4
|
+
import os
|
|
5
|
+
import shutil
|
|
6
|
+
import subprocess
|
|
7
|
+
import tempfile
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# ── 配置 ──────────────────────────────────────────────────────────────
|
|
11
|
+
_EXISTING_CONFIG_REF = globals().get("CONFIG")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def env_int(name, default, *, minimum=None):
|
|
15
|
+
"""Read an integer env var; an unset/empty value yields `default`, a malformed one is an error."""
|
|
16
|
+
raw = os.environ.get(name, "")
|
|
17
|
+
if raw == "":
|
|
18
|
+
return default
|
|
19
|
+
try:
|
|
20
|
+
value = int(raw)
|
|
21
|
+
except ValueError as exc:
|
|
22
|
+
raise ValueError(f"环境变量 {name}={raw!r} 不是整数") from exc
|
|
23
|
+
return value if minimum is None else max(minimum, value)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def env_bool(name, default=False):
|
|
27
|
+
"""Read common boolean env var forms."""
|
|
28
|
+
raw = os.environ.get(name, "")
|
|
29
|
+
if raw == "":
|
|
30
|
+
return default
|
|
31
|
+
return raw.strip().lower() in {"1", "true", "yes", "y", "on"}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def env_float(name, default, *, minimum=None):
|
|
35
|
+
"""Read a float env var; an unset/empty value yields `default`, a malformed one is an error."""
|
|
36
|
+
raw = os.environ.get(name, "")
|
|
37
|
+
if raw == "":
|
|
38
|
+
return default
|
|
39
|
+
try:
|
|
40
|
+
value = float(raw)
|
|
41
|
+
except ValueError as exc:
|
|
42
|
+
raise ValueError(f"环境变量 {name}={raw!r} 不是数字") from exc
|
|
43
|
+
if not math.isfinite(value):
|
|
44
|
+
raise ValueError(f"环境变量 {name}={raw!r} 必须是有限数")
|
|
45
|
+
return value if minimum is None else max(minimum, value)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# Cross-language source: when the original audio is in a language the narration is NOT in
|
|
49
|
+
# (e.g. a Japanese drama recapped in Chinese), the original speech bleeding under the narration
|
|
50
|
+
# is just noise the viewer can't parse — it reads as 怪音. In that mode the original is ducked to
|
|
51
|
+
# near-silent UNDER narration; it still plays full-volume in the original-audio gap blocks, where
|
|
52
|
+
# a single language is fine. Explicit SPEECH_DUCKING_VOLUME / ZONE_DUCKING_VOLUME still override.
|
|
53
|
+
_foreign_source_audio = env_bool("FOREIGN_SOURCE_AUDIO", False)
|
|
54
|
+
_foreign_under_narration_volume = 0.05 # original volume under narration when source audio is foreign
|
|
55
|
+
|
|
56
|
+
CONFIG = {
|
|
57
|
+
"fade_ms": env_int("FADE_MS", 120, minimum=0), # 每段 TTS 淡入淡出(ms);过大会让紧凑的句子一顿一顿,120ms 防爆音又不发闷
|
|
58
|
+
"ducking_mode": "fixed", # fixed | sidechaincompress | none
|
|
59
|
+
"ducking_threshold": 0.15,
|
|
60
|
+
"ducking_ratio": 3,
|
|
61
|
+
"ducking_attack": 10,
|
|
62
|
+
"ducking_release": 300,
|
|
63
|
+
"ducking_level_sc": 2.0,
|
|
64
|
+
"ducking_makeup": 1.2,
|
|
65
|
+
"ducking_narr_weight": 1.5,
|
|
66
|
+
"ducking_orig_volume": env_float("DUCKING_ORIG_VOLUME", 0.3, minimum=0.0), # 解说时原声基准音量
|
|
67
|
+
# Derived report of the FOREIGN_SOURCE_AUDIO knob this skill implements: it selects the
|
|
68
|
+
# ducking volumes below. Declared so callers can see which policy is in effect.
|
|
69
|
+
"foreign_source_audio": _foreign_source_audio,
|
|
70
|
+
"zone_ducking_volume": env_float("ZONE_DUCKING_VOLUME",
|
|
71
|
+
_foreign_under_narration_volume if _foreign_source_audio else 0.12, minimum=0.0), # 解说时原声压低到的音量
|
|
72
|
+
"idle_orig_volume": env_float("IDLE_ORIG_VOLUME", 1.0, minimum=0.0), # 解说块之间的"原声块"音量:默认满音量(1.0),让精彩原声整段放出来,不被压低(用户要求解说成块、原声也成块)
|
|
73
|
+
"duck_fade_seconds": env_float("DUCK_FADE_SECONDS", 0.3, minimum=0.0), # 解说块/原声块切换的淡入淡出(秒),略放宽到 0.3 让满音量↔压低的过渡更顺
|
|
74
|
+
"duck_bridge_seconds": env_float("DUCK_BRIDGE_SECONDS", 1.5, minimum=0.0), # 仅把间隔小于此值的相邻解说窗口并成一段压低;超过则视为作者特意留的"原声块",原声放回满音量。默认 1.5s:解说块内部连续压低,块与块之间的留白放出满音量原声。该值只控制短间隔合并,不设定旁白/原声配额。调大→更连续铺底、原声块更少;调小→更碎
|
|
75
|
+
"bgm_path": os.environ.get("BGM_PATH", "").strip(), # 背景音乐文件(可选),留空则不加 BGM
|
|
76
|
+
"source_video": os.environ.get("SOURCE_VIDEO", "").strip(), # 剪辑模式下的原始视频(可选),用于时间线/剪映导出引用原片片段
|
|
77
|
+
"source_video_explicit": False, # 仅 assemble.py --source-video 显式传入时为 True;环境变量 SOURCE_VIDEO 不算显式
|
|
78
|
+
"export_jianying": env_bool("EXPORT_JIANYING", False), # 渲染后可选导出剪映草稿(默认关;与核心解耦)
|
|
79
|
+
"jianying_draft_dir": os.environ.get("JIANYING_DRAFT_DIR", "").strip(), # 剪映草稿输出父目录(留空=work_dir)
|
|
80
|
+
"jianying_bundle_media": env_bool("JIANYING_BUNDLE_MEDIA", True), # 默认开:macOS 剪映沙箱读不到外部路径,须把素材拷进草稿目录
|
|
81
|
+
"bgm_volume": env_float("BGM_VOLUME", 0.18, minimum=0.0), # BGM 铺底音量
|
|
82
|
+
"bgm_ducking_volume": env_float("BGM_DUCKING_VOLUME", 0.10, minimum=0.0), # 旁白时 BGM 压低到的音量
|
|
83
|
+
"narration_speed": env_float("NARRATION_SPEED", 1.15, minimum=0.5), # 解说整体提速(atempo),默认回到可懂区间;长片可设 1.0
|
|
84
|
+
"narration_cumulative_tempo_max": env_float("NARRATION_CUMULATIVE_TEMPO_MAX", 1.35, minimum=1.0), # TTS rate × 全局 atempo × 段内 atempo 的累计上限
|
|
85
|
+
"narration_cumulative_tempo_hard_max": env_float("NARRATION_CUMULATIVE_TEMPO_HARD_MAX", 1.40, minimum=1.0), # QC/阻断硬上限
|
|
86
|
+
"tts_segment_tempo_max": env_float("TTS_SEGMENT_TEMPO_MAX", 1.20, minimum=1.0), # 兼容旧段内 atempo 上限;实际会被累计预算收紧
|
|
87
|
+
"mask_source_subtitles": env_bool("MASK_SOURCE_SUBTITLES", False), # 遮挡原片烧录字幕;必须配合显式 SOURCE_SUBTITLE_MASK_POLICY
|
|
88
|
+
"source_subtitle_mask_policy_declared": bool(os.environ.get("SOURCE_SUBTITLE_MASK_POLICY", "").strip()),
|
|
89
|
+
"source_subtitle_mask_policy": (
|
|
90
|
+
os.environ.get("SOURCE_SUBTITLE_MASK_POLICY", "").strip().lower()
|
|
91
|
+
or "off"
|
|
92
|
+
), # off | opt_in | safe | forced;MASK_SOURCE_SUBTITLES alone is legacy implicit and QC-blocking
|
|
93
|
+
"source_subtitle_mask_ratio": env_float("SOURCE_SUBTITLE_MASK_RATIO", 0.14, minimum=0.0), # 底部遮挡比例
|
|
94
|
+
"source_subtitle_mask_timing": os.environ.get("SOURCE_SUBTITLE_MASK_TIMING", "narration").strip().lower(), # all | narration;增强版默认仅解说时遮罩
|
|
95
|
+
"subtitle_mask_opacity": min(1.0, env_float("SUBTITLE_MASK_OPACITY", 0.6, minimum=0.0)), # 0=透明,1=全黑;增强版默认半透明
|
|
96
|
+
"subtitle_mask_padding": env_int("SUBTITLE_MASK_PADDING", 4, minimum=0),
|
|
97
|
+
"subtitle_y_top": env_int("SUBTITLE_Y_TOP", -1, minimum=-1), # 自动旋转后的显示画布坐标;top/bot 同时有效时贴合原字幕带
|
|
98
|
+
"subtitle_y_bot": env_int("SUBTITLE_Y_BOT", -1, minimum=-1),
|
|
99
|
+
"narration_delay_seconds": env_float("NARRATION_DELAY_SECONDS", 0.0, minimum=0.0), # 默认严格采用 Agent 写入的 start;旧项目可显式恢复延迟
|
|
100
|
+
"narration_tighten": env_bool("NARRATION_TIGHTEN", True), # 段落内把句子紧贴上一句实际收尾播放,句间间隔稳定≤tight_pause,杜绝"一句解说一段空白"的卡顿
|
|
101
|
+
"narration_run_gap_seconds": env_float("NARRATION_RUN_GAP_SECONDS", 1.6, minimum=0.0), # 作者留白超过此值=新段落(让精彩原声透出);小于则视为同一连续段落
|
|
102
|
+
"narration_tight_pause_seconds": env_float("NARRATION_TIGHT_PAUSE_SECONDS", 0.35, minimum=0.0), # 段落内句间固定间隔(秒)
|
|
103
|
+
"narration_max_pull_seconds": env_float("NARRATION_MAX_PULL_SECONDS", 1.2, minimum=0.0), # 收紧时一句最多比作者标注提前的秒数(漂移上限,越小越贴画面)
|
|
104
|
+
"narration_tail_pad_seconds": 0.1, # 解说尾部最少留白;短 slot 会自动压低 delay 避免截断
|
|
105
|
+
"quiet_overlap_min_ratio": 0.8, # 解说段至少多少比例落在安静窗口内才标记为非对白重叠
|
|
106
|
+
"speech_ducking_volume": env_float("SPEECH_DUCKING_VOLUME",
|
|
107
|
+
_foreign_under_narration_volume if _foreign_source_audio else 0.2, minimum=0.0), # 解说与对白重叠时原声音量
|
|
108
|
+
"burn_subtitles": env_bool("BURN_SUBTITLES", True), # 烧录解说字幕(默认开;遮挡原字幕后需自带字幕,否则字幕区空白)
|
|
109
|
+
"subtitle_original_in_gaps": env_bool("SUBTITLE_ORIGINAL_IN_GAPS", True), # 原声留白处补烧原声台词字幕(来自 ASR)
|
|
110
|
+
"force_video_reencode": env_bool("FORCE_VIDEO_REENCODE", False), # 组装时重编码视频,修复部分容器时间戳问题
|
|
111
|
+
# 成片压制(仅在重编码时生效:烧字幕/遮罩/缩放/FORCE_VIDEO_REENCODE 任一触发重编码)。
|
|
112
|
+
"output_crf": env_int("OUTPUT_CRF", 18, minimum=0), # x264 CRF;越大文件越小、画质越低(18≈视觉无损,23~26 体积更小)
|
|
113
|
+
"output_preset": os.environ.get("OUTPUT_PRESET", "veryfast"), # x264 preset;slow/slower 同 CRF 下体积更小但更慢
|
|
114
|
+
"output_max_height": env_int("OUTPUT_MAX_HEIGHT", 0, minimum=0), # >0 时把成片高度上限缩到该值(保持宽高比、偶数宽);0=不缩放
|
|
115
|
+
# 成片末端整体响度归一(默认混音偏轻,归一后更接近常见短视频响度;样片约 -11.9,默认取更安全的 -14)
|
|
116
|
+
"final_loudnorm": env_bool("FINAL_LOUDNORM", True), # 组装末端做一次整体响度归一
|
|
117
|
+
"target_lufs": env_float("TARGET_LUFS", -14.0), # 目标综合响度 (LUFS)
|
|
118
|
+
"target_true_peak": env_float("TARGET_TRUE_PEAK", -1.0), # 目标真峰值 (dBTP)
|
|
119
|
+
"target_lra": env_float("TARGET_LRA", 11.0), # 目标响度范围 (LU)
|
|
120
|
+
"final_limiter_peak": env_float("FINAL_LIMITER_PEAK", 0.98, minimum=0.1), # loudnorm 后峰值保护 limiter
|
|
121
|
+
"subtitle_font_name": os.environ.get("SUBTITLE_FONT_NAME", "Arial"),
|
|
122
|
+
# 可选字体文件:ASS 烧录经 fontsdir 加载,画面文字经 drawtext fontfile 使用;family 名仍由 SUBTITLE_FONT_NAME 指定
|
|
123
|
+
"subtitle_font_file": os.environ.get("SUBTITLE_FONT_FILE", "").strip(),
|
|
124
|
+
"subtitle_font_size": env_int("SUBTITLE_FONT_SIZE", 42, minimum=8),
|
|
125
|
+
"subtitle_primary_color": os.environ.get("SUBTITLE_PRIMARY_COLOR", "&H00FFFFFF"),
|
|
126
|
+
"subtitle_outline_color": os.environ.get("SUBTITLE_OUTLINE_COLOR", "&H00000000"),
|
|
127
|
+
"subtitle_outline": env_float("SUBTITLE_OUTLINE", 2.0, minimum=0.0),
|
|
128
|
+
"subtitle_shadow": env_float("SUBTITLE_SHADOW", 1.0, minimum=0.0),
|
|
129
|
+
"subtitle_margin_v": env_int("SUBTITLE_MARGIN_V", 48, minimum=0),
|
|
130
|
+
"subtitle_margin_l": env_int("SUBTITLE_MARGIN_L", 40, minimum=0),
|
|
131
|
+
"subtitle_margin_r": env_int("SUBTITLE_MARGIN_R", 40, minimum=0),
|
|
132
|
+
"subtitle_alignment": env_int("SUBTITLE_ALIGNMENT", 2, minimum=1),
|
|
133
|
+
"subtitle_max_chars": env_int("SUBTITLE_MAX_CHARS", 20, minimum=6),
|
|
134
|
+
"subtitle_max_lines": env_int("SUBTITLE_MAX_LINES", 2, minimum=1),
|
|
135
|
+
"subtitle_play_res_x": env_int("SUBTITLE_PLAY_RES_X", 1280, minimum=1),
|
|
136
|
+
"subtitle_play_res_y": env_int("SUBTITLE_PLAY_RES_Y", 720, minimum=1),
|
|
137
|
+
}
|
|
138
|
+
if isinstance(_EXISTING_CONFIG_REF, dict):
|
|
139
|
+
_EXISTING_CONFIG_REF.clear()
|
|
140
|
+
_EXISTING_CONFIG_REF.update(CONFIG)
|
|
141
|
+
CONFIG = _EXISTING_CONFIG_REF
|
|
142
|
+
|
|
143
|
+
def narration_tempo_budget(tts_rate_offset=0.0):
|
|
144
|
+
"""Return the canonical tempo budget shared by voiceover and assemble.
|
|
145
|
+
|
|
146
|
+
`effective_tempo` is the user-perceived cumulative compression:
|
|
147
|
+
TTS rate × global narration atempo × per-segment atempo. The segment atempo
|
|
148
|
+
cap is therefore tightened by the configured global speed and TTS rate
|
|
149
|
+
offset; callers must fail/shorten instead of time-trimming speech when the
|
|
150
|
+
needed ratio exceeds `segment_tempo_max`.
|
|
151
|
+
"""
|
|
152
|
+
global_speed = CONFIG["narration_speed"]
|
|
153
|
+
rate_factor = max(0.01, 1.0 + float(tts_rate_offset))
|
|
154
|
+
cumulative_max = CONFIG["narration_cumulative_tempo_max"]
|
|
155
|
+
hard_max = max(cumulative_max, CONFIG["narration_cumulative_tempo_hard_max"])
|
|
156
|
+
segment_tempo_max = max(1.0, min(
|
|
157
|
+
CONFIG["tts_segment_tempo_max"], cumulative_max / (global_speed * rate_factor)
|
|
158
|
+
))
|
|
159
|
+
return {
|
|
160
|
+
"global_narration_speed": global_speed,
|
|
161
|
+
"tts_rate_factor": rate_factor,
|
|
162
|
+
"cumulative_tempo_max": cumulative_max,
|
|
163
|
+
"cumulative_tempo_hard_max": hard_max,
|
|
164
|
+
"segment_tempo_max": segment_tempo_max,
|
|
165
|
+
"max_raw_duration_factor": global_speed * segment_tempo_max,
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
def log(msg):
|
|
169
|
+
print(f"[video-recap] {msg}", flush=True)
|
|
170
|
+
|
|
171
|
+
def run_cmd(cmd, **kwargs):
|
|
172
|
+
"""运行命令,返回 CompletedProcess"""
|
|
173
|
+
display = " ".join(
|
|
174
|
+
text if len(text) <= 240 else text[:237] + "..."
|
|
175
|
+
for text in map(str, cmd)
|
|
176
|
+
)
|
|
177
|
+
log(f"运行: {display}")
|
|
178
|
+
return subprocess.run(cmd, capture_output=True, text=True, **kwargs)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
# ffmpeg 7 added `-/option path` to read any option's value from a file; ffmpeg 9 removed the
|
|
182
|
+
# older `-filter_complex_script` / `-filter_script` spellings, which are all ffmpeg <= 6 knows.
|
|
183
|
+
_LEGACY_FILTER_FILE_OPTIONS = {
|
|
184
|
+
"filter_complex": "-filter_complex_script",
|
|
185
|
+
"filter:v:0": "-filter_script:v:0",
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
@functools.lru_cache(maxsize=None)
|
|
190
|
+
def _ffmpeg_reads_option_files():
|
|
191
|
+
"""Whether the ffmpeg on PATH accepts `-/option path` (asked once per process)."""
|
|
192
|
+
if shutil.which("ffmpeg") is None:
|
|
193
|
+
return False
|
|
194
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
195
|
+
graph = os.path.join(tmp, "probe_filter.txt")
|
|
196
|
+
with open(graph, "w", encoding="utf-8") as fh:
|
|
197
|
+
fh.write("null")
|
|
198
|
+
result = subprocess.run(["ffmpeg", "-hide_banner", "-/filter_complex", graph],
|
|
199
|
+
stdin=subprocess.DEVNULL, capture_output=True, text=True,
|
|
200
|
+
timeout=20)
|
|
201
|
+
return "Unrecognized option" not in result.stderr
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def filter_file_args(option, path):
|
|
205
|
+
"""ffmpeg arguments that load `option`'s filtergraph from `path`, spelled for this ffmpeg."""
|
|
206
|
+
if _ffmpeg_reads_option_files():
|
|
207
|
+
return [f"-/{option}", str(path)]
|
|
208
|
+
return [_LEGACY_FILTER_FILE_OPTIONS[option], str(path)]
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def get_video_duration(video_path):
|
|
212
|
+
"""获取视频时长(秒)"""
|
|
213
|
+
cmd = ["ffprobe", "-v", "quiet", "-show_entries", "format=duration",
|
|
214
|
+
"-of", "csv=p=0", str(video_path)]
|
|
215
|
+
result = run_cmd(cmd)
|
|
216
|
+
if result.returncode != 0:
|
|
217
|
+
raise RuntimeError(f"ffprobe 无法读取时长 {video_path}: {result.stderr}")
|
|
218
|
+
return float(result.stdout.strip())
|