@lemoncat7/dsh-partner 2.8.1 → 2.8.3
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 +21 -0
- package/docs/pendant-loading.md +30 -0
- package/docs/releases/2.8.2.md +7 -0
- package/docs/releases/2.8.3.md +20 -0
- package/lib/agent-runtime.d.ts +7 -0
- package/lib/agent-runtime.d.ts.map +1 -1
- package/lib/agent-runtime.js +119 -35
- package/lib/agent-runtime.js.map +1 -1
- package/lib/api/features/pendant-api.d.ts.map +1 -1
- package/lib/api/features/pendant-api.js +11 -2
- package/lib/api/features/pendant-api.js.map +1 -1
- package/lib/api.d.ts +1 -0
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +41 -6
- package/lib/api.js.map +1 -1
- package/lib/autonomy.d.ts.map +1 -1
- package/lib/autonomy.js +9 -2
- 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 +17 -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 +2398 -1970
- package/lib/client.js.map +4 -4
- package/lib/client.pendant.js +4157 -0
- 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 +10 -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 +32 -0
- package/lib/concern-execution.d.ts.map +1 -0
- package/lib/concern-execution.js +112 -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 +10 -1
- package/lib/concern-store.d.ts.map +1 -1
- package/lib/concern-store.js +135 -36
- 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 +55 -26
- package/lib/heartbeat.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -1
- 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 +23 -1
- package/lib/observation-executor.js.map +1 -1
- package/lib/observation-loop.d.ts +7 -0
- package/lib/observation-loop.d.ts.map +1 -1
- package/lib/observation-loop.js +65 -4
- package/lib/observation-loop.js.map +1 -1
- package/lib/observation-progress.d.ts +18 -0
- package/lib/observation-progress.d.ts.map +1 -0
- package/lib/observation-progress.js +57 -0
- package/lib/observation-progress.js.map +1 -0
- 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/pendant/badge-art.d.ts +9 -0
- package/lib/pendant/badge-art.d.ts.map +1 -0
- package/lib/pendant/badge-art.js +68 -0
- package/lib/pendant/badge-art.js.map +1 -0
- package/lib/pendant/card-image.d.ts.map +1 -1
- package/lib/pendant/card-image.js +11 -9
- package/lib/pendant/card-image.js.map +1 -1
- package/lib/pendant/renderer-loader.d.ts +9 -0
- package/lib/pendant/renderer-loader.d.ts.map +1 -0
- package/lib/pendant/renderer-loader.js +12 -0
- package/lib/pendant/renderer-loader.js.map +1 -0
- package/lib/pendant/renderer.d.ts +2 -6
- package/lib/pendant/renderer.d.ts.map +1 -1
- package/lib/pendant/renderer.js +1 -67
- package/lib/pendant/renderer.js.map +1 -1
- package/lib/pendant/static-card.d.ts +20 -0
- package/lib/pendant/static-card.d.ts.map +1 -0
- package/lib/pendant/static-card.js +55 -0
- package/lib/pendant/static-card.js.map +1 -0
- package/lib/pendant/widget.d.ts.map +1 -1
- package/lib/pendant/widget.js +9 -5
- package/lib/pendant/widget.js.map +1 -1
- package/lib/pendant-renderer.js +14 -14
- 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 +14 -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-execution-status.d.ts +8 -0
- package/lib/ui/memory/concern-execution-status.d.ts.map +1 -0
- package/lib/ui/memory/concern-execution-status.js +31 -0
- package/lib/ui/memory/concern-execution-status.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 +7 -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
package/resources/skills/video-recap-production/upstream/skills/video-understanding/scripts/vlm.py
ADDED
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
import json
|
|
3
|
+
import mimetypes
|
|
4
|
+
import re
|
|
5
|
+
from collections import OrderedDict
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
8
|
+
from threading import Lock
|
|
9
|
+
|
|
10
|
+
from extract import (
|
|
11
|
+
FRAME_TIME_CONVENTION_VERSION,
|
|
12
|
+
frame_time,
|
|
13
|
+
parse_frame_number,
|
|
14
|
+
)
|
|
15
|
+
from lib import CONFIG
|
|
16
|
+
from lib import log, api_call, load_prompt, mimo_video_api_call, run_cmd, file_identity
|
|
17
|
+
|
|
18
|
+
# ── Step 4: VLM 视觉分析 ─────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
def _parse_vlm_depth_response(raw_text):
|
|
21
|
+
"""解析 VLM 深度分析响应,提取【描述】、【帧标签】和【深层分析】"""
|
|
22
|
+
if not raw_text or not raw_text.strip():
|
|
23
|
+
return "(VLM 无法识别此场景画面)", "", {}
|
|
24
|
+
|
|
25
|
+
# 提取【描述】
|
|
26
|
+
desc_match = re.search(r'【描述】\s*\n?(.*?)(?=【帧标签】|【深层分析】|$)', raw_text, re.DOTALL)
|
|
27
|
+
description = desc_match.group(1).strip() if desc_match else raw_text.strip()
|
|
28
|
+
|
|
29
|
+
# 提取【帧标签】
|
|
30
|
+
frame_facts = {}
|
|
31
|
+
facts_match = re.search(r'【帧标签】\s*\n?(.*?)(?=【深层分析】|$)', raw_text, re.DOTALL)
|
|
32
|
+
if facts_match:
|
|
33
|
+
for line in facts_match.group(1).strip().split("\n"):
|
|
34
|
+
line = line.strip()
|
|
35
|
+
if not line:
|
|
36
|
+
continue
|
|
37
|
+
# 格式: "12.0s | 男子拿起茶壶对嘴喝, 满脸疲惫"
|
|
38
|
+
m = re.match(r'([\d.]+)\s*s?\s*\|\s*(.+)', line)
|
|
39
|
+
if m:
|
|
40
|
+
ts = m.group(1)
|
|
41
|
+
actions = [a.strip() for a in re.split(r"[,,;;、]+", m.group(2)) if a.strip()]
|
|
42
|
+
if actions:
|
|
43
|
+
frame_facts[ts] = actions
|
|
44
|
+
|
|
45
|
+
# 提取【深层分析】
|
|
46
|
+
depth_match = re.search(r'【深层分析】\s*\n?(.*?)$', raw_text, re.DOTALL)
|
|
47
|
+
depth_analysis = depth_match.group(1).strip() if depth_match else ""
|
|
48
|
+
|
|
49
|
+
if not description:
|
|
50
|
+
description = "(VLM 无法识别此场景画面)"
|
|
51
|
+
|
|
52
|
+
return description, depth_analysis, frame_facts
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _max_frames_for_duration(duration):
|
|
56
|
+
"""Frames the VLM sees for one scene: ~1 per `vlm_seconds_per_frame`, floor 3, capped by
|
|
57
|
+
`vlm_max_frames`. Replaces the old hard cap of 6 that starved long/merged scenes."""
|
|
58
|
+
spf = float(CONFIG["vlm_seconds_per_frame"])
|
|
59
|
+
ceiling = int(CONFIG["vlm_max_frames"])
|
|
60
|
+
return max(3, min(ceiling, round(max(0.0, float(duration)) / spf)))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _vlm_scene_cache_path(work_dir):
|
|
64
|
+
return Path(work_dir) / "vlm_scene_cache.json"
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _load_vlm_scene_cache(work_dir, settings):
|
|
68
|
+
"""Per-scene VLM resume cache (scene_key -> analysis) written under `settings`.
|
|
69
|
+
|
|
70
|
+
Tolerant: {} if absent/corrupt, and {} when the stored request settings differ, so a
|
|
71
|
+
partial-failure cache is never resumed after an output-affecting setting changed."""
|
|
72
|
+
path = _vlm_scene_cache_path(work_dir)
|
|
73
|
+
if not path.exists():
|
|
74
|
+
return {}
|
|
75
|
+
try:
|
|
76
|
+
data = json.loads(path.read_text(encoding="utf-8"))
|
|
77
|
+
except (OSError, ValueError):
|
|
78
|
+
return {}
|
|
79
|
+
if not isinstance(data, dict) or data.get("settings") != settings:
|
|
80
|
+
return {}
|
|
81
|
+
scenes = data.get("scenes")
|
|
82
|
+
return scenes if isinstance(scenes, dict) else {}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _flush_vlm_scene_cache(work_dir, settings, cache):
|
|
86
|
+
"""Persist the resume cache atomically (temp + rename) so an abort/crash never corrupts it."""
|
|
87
|
+
path = _vlm_scene_cache_path(work_dir)
|
|
88
|
+
try:
|
|
89
|
+
tmp = path.with_name(path.name + ".tmp")
|
|
90
|
+
tmp.write_text(
|
|
91
|
+
json.dumps({"settings": settings, "scenes": cache}, ensure_ascii=False),
|
|
92
|
+
encoding="utf-8",
|
|
93
|
+
)
|
|
94
|
+
tmp.replace(path)
|
|
95
|
+
except OSError as exc:
|
|
96
|
+
log(f"VLM 场景缓存写入失败(忽略): {exc}")
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _looks_rate_limited(message):
|
|
100
|
+
"""Heuristic: was a scene failure a transient rate-limit (worth a low-concurrency retry) rather
|
|
101
|
+
than a persistent error (empty response / parse failure) that re-running would not fix?"""
|
|
102
|
+
m = str(message).lower()
|
|
103
|
+
return "429" in m or "too many requests" in m or "rate limit" in m or "限流" in m
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def analyze_scenes(scenes, frames, work_dir, *, resume=True):
|
|
107
|
+
"""对每个场景的关键帧调用 VLM 进行视觉分析(并行)"""
|
|
108
|
+
if not scenes:
|
|
109
|
+
analyses = []
|
|
110
|
+
vlm_file = work_dir / "vlm_analysis.json"
|
|
111
|
+
vlm_file.write_text(json.dumps(analyses, ensure_ascii=False, indent=2), encoding="utf-8")
|
|
112
|
+
log("VLM 分析完成: 0 个场景")
|
|
113
|
+
return analyses
|
|
114
|
+
|
|
115
|
+
if not frames:
|
|
116
|
+
raise RuntimeError("VLM 分析需要先提取至少一帧;frames 为空")
|
|
117
|
+
|
|
118
|
+
fps = CONFIG["fps"]
|
|
119
|
+
if fps <= 0:
|
|
120
|
+
raise ValueError("CONFIG['fps'] 必须大于 0;请先运行完整 pipeline 或指定 --fps")
|
|
121
|
+
|
|
122
|
+
vlm_prompt = load_prompt("VLM_DEPTH_PROMPT")
|
|
123
|
+
if not vlm_prompt:
|
|
124
|
+
vlm_prompt = "仔细观察这些视频帧。分两部分输出:\n【描述】不超过80字,描述画面中正在发生什么。\n【深层分析】不超过120字,分析角色情绪、关系动态、潜台词。"
|
|
125
|
+
|
|
126
|
+
ctx = CONFIG["context_info"]
|
|
127
|
+
if ctx:
|
|
128
|
+
vlm_prompt = f"已知信息:{ctx}\n\n{vlm_prompt}"
|
|
129
|
+
|
|
130
|
+
# 构建帧时间映射 (frame_NNNNN.jpg -> time in seconds)。换算规则由 extract.py 独家定义:
|
|
131
|
+
# ffmpeg 首帧在 t=0 而文件编号从 1 起,所以是 (n-1)/fps,不是 n/fps。
|
|
132
|
+
frame_times = {}
|
|
133
|
+
for f in frames:
|
|
134
|
+
num = parse_frame_number(f)
|
|
135
|
+
if num is None:
|
|
136
|
+
continue
|
|
137
|
+
frame_times[f] = frame_time(num, fps)
|
|
138
|
+
|
|
139
|
+
# base64 编码缓存(LRU)。原来是无上界的 dict:整个 VLM 阶段会把用到的每一帧的 base64
|
|
140
|
+
# 都常驻内存,而 base64 比原图还大 1/3。40 分钟视频 fps=1 约 2400 帧 → 数百 MB 常驻。
|
|
141
|
+
# 相邻场景才会复用同一帧,容量取「并发数 × 单场景最大帧数」就够,再多也命中不了。
|
|
142
|
+
b64_capacity = max(
|
|
143
|
+
8,
|
|
144
|
+
int(CONFIG["vlm_max_frames"]) * int(CONFIG["vlm_workers"]),
|
|
145
|
+
)
|
|
146
|
+
b64_cache = OrderedDict()
|
|
147
|
+
b64_lock = Lock()
|
|
148
|
+
|
|
149
|
+
def _get_b64(frame_path):
|
|
150
|
+
with b64_lock:
|
|
151
|
+
cached = b64_cache.get(frame_path)
|
|
152
|
+
if cached is not None:
|
|
153
|
+
b64_cache.move_to_end(frame_path)
|
|
154
|
+
return cached
|
|
155
|
+
encoded = base64.b64encode(frame_path.read_bytes()).decode()
|
|
156
|
+
with b64_lock:
|
|
157
|
+
b64_cache[frame_path] = encoded
|
|
158
|
+
b64_cache.move_to_end(frame_path)
|
|
159
|
+
while len(b64_cache) > b64_capacity:
|
|
160
|
+
b64_cache.popitem(last=False)
|
|
161
|
+
return encoded
|
|
162
|
+
|
|
163
|
+
def _analyze_single_scene(i, scene):
|
|
164
|
+
"""分析单个场景,返回 (scene_id, result_dict)"""
|
|
165
|
+
scene_frames = [f for f, t in frame_times.items()
|
|
166
|
+
if scene["start"] <= t <= scene["end"]]
|
|
167
|
+
if not scene_frames:
|
|
168
|
+
mid = (scene["start"] + scene["end"]) / 2
|
|
169
|
+
scene_frames = [min(frames, key=lambda f: abs(frame_times.get(f, 999) - mid))]
|
|
170
|
+
|
|
171
|
+
duration = scene["end"] - scene["start"]
|
|
172
|
+
max_frames = _max_frames_for_duration(duration)
|
|
173
|
+
|
|
174
|
+
if len(scene_frames) > max_frames:
|
|
175
|
+
step = len(scene_frames) / max_frames
|
|
176
|
+
scene_frames = [scene_frames[int(j * step)] for j in range(max_frames)]
|
|
177
|
+
else:
|
|
178
|
+
scene_frames = scene_frames[:max_frames]
|
|
179
|
+
|
|
180
|
+
content_parts = []
|
|
181
|
+
for f in scene_frames:
|
|
182
|
+
b64 = _get_b64(f)
|
|
183
|
+
content_parts.append({
|
|
184
|
+
"type": "image_url",
|
|
185
|
+
"image_url": {"url": f"data:image/jpeg;base64,{b64}"}
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
# 帧级事实标签:将帧时间注入prompt
|
|
189
|
+
frame_ts_list = [f"{frame_times[f]:.1f}s" for f in scene_frames]
|
|
190
|
+
frame_ts_text = "帧时间点: " + ", ".join(frame_ts_list)
|
|
191
|
+
content_parts.append({"type": "text", "text": frame_ts_text + "\n\n" + vlm_prompt})
|
|
192
|
+
|
|
193
|
+
payload = {
|
|
194
|
+
"model": CONFIG["vlm_model"],
|
|
195
|
+
"messages": [{"role": "user", "content": content_parts}],
|
|
196
|
+
"max_tokens": int(CONFIG["vlm_max_tokens"]),
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
log(f"VLM 分析场景 {i+1}/{len(scenes)} ({len(scene_frames)} 帧)...")
|
|
200
|
+
|
|
201
|
+
raw_response = ""
|
|
202
|
+
for attempt in range(3):
|
|
203
|
+
resp = api_call(payload)
|
|
204
|
+
try:
|
|
205
|
+
msg = resp["choices"][0]["message"]
|
|
206
|
+
raw_response = (msg.get("content") or msg.get("reasoning_content") or "")
|
|
207
|
+
except (KeyError, IndexError):
|
|
208
|
+
log(f"VLM 返回异常: {json.dumps(resp, ensure_ascii=False)[:200]}")
|
|
209
|
+
|
|
210
|
+
if raw_response.strip():
|
|
211
|
+
break
|
|
212
|
+
|
|
213
|
+
if attempt < 2:
|
|
214
|
+
log(f" 场景 {i+1} VLM 返回空,重试 ({attempt+2}/3)...")
|
|
215
|
+
retry_parts = content_parts[:-1]
|
|
216
|
+
retry_parts.append({"type": "text", "text": frame_ts_text + "\n\n" + vlm_prompt + "\n请务必按格式输出,不要留空。"})
|
|
217
|
+
payload = {
|
|
218
|
+
"model": CONFIG["vlm_model"],
|
|
219
|
+
"messages": [{"role": "user", "content": retry_parts}],
|
|
220
|
+
"max_tokens": int(CONFIG["vlm_max_tokens"]),
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if not raw_response.strip():
|
|
224
|
+
raise RuntimeError("VLM 连续 3 次返回空内容")
|
|
225
|
+
|
|
226
|
+
# 解析 【描述】、【帧标签】和【深层分析】
|
|
227
|
+
description, depth_analysis, frame_facts = _parse_vlm_depth_response(raw_response)
|
|
228
|
+
|
|
229
|
+
result = {
|
|
230
|
+
"scene_id": i,
|
|
231
|
+
"start": scene["start"],
|
|
232
|
+
"end": scene["end"],
|
|
233
|
+
"description": description,
|
|
234
|
+
"depth_analysis": depth_analysis,
|
|
235
|
+
}
|
|
236
|
+
if frame_facts:
|
|
237
|
+
result["frame_facts"] = frame_facts
|
|
238
|
+
|
|
239
|
+
return i, result
|
|
240
|
+
|
|
241
|
+
# 断点续传:逐场景持久化分析结果,避免少数场景失败(多为 429 限流)时整批画面理解全部作废。
|
|
242
|
+
# The resume cache is valid only under the SAME output-affecting settings the outer stage
|
|
243
|
+
# gate tracks (understanding_cache._vlm_cache_payload). vlm_prompt already folds in
|
|
244
|
+
# context_info (and background_research). The request/endpoint settings below are NOT in
|
|
245
|
+
# vlm_prompt, so they are stored explicitly — otherwise a partial-failure cache reused after
|
|
246
|
+
# flipping e.g. mimo_disable_thinking would yield a stale/mixed analysis.
|
|
247
|
+
cache_settings = {
|
|
248
|
+
"vlm_prompt": vlm_prompt,
|
|
249
|
+
"vlm_model": CONFIG.get("vlm_model"),
|
|
250
|
+
"vlm_max_tokens": CONFIG.get("vlm_max_tokens"),
|
|
251
|
+
"vlm_seconds_per_frame": CONFIG.get("vlm_seconds_per_frame"),
|
|
252
|
+
"vlm_max_frames": CONFIG.get("vlm_max_frames"),
|
|
253
|
+
"fps": round(float(fps), 3),
|
|
254
|
+
"frame_time_convention": FRAME_TIME_CONVENTION_VERSION,
|
|
255
|
+
"api_url": CONFIG.get("api_url"),
|
|
256
|
+
"mimo_disable_thinking": CONFIG.get("mimo_disable_thinking", True),
|
|
257
|
+
"mimo_media_resolution": CONFIG.get("mimo_media_resolution"),
|
|
258
|
+
}
|
|
259
|
+
cache = _load_vlm_scene_cache(work_dir, cache_settings) if resume else {}
|
|
260
|
+
|
|
261
|
+
def _scene_cache_key(i, scene):
|
|
262
|
+
return "|".join(str(x) for x in (
|
|
263
|
+
i, round(float(scene["start"]), 3), round(float(scene["end"]), 3),
|
|
264
|
+
))
|
|
265
|
+
|
|
266
|
+
analyses = [None] * len(scenes)
|
|
267
|
+
todo = []
|
|
268
|
+
for i, s in enumerate(scenes):
|
|
269
|
+
analyses[i] = cache.get(_scene_cache_key(i, s))
|
|
270
|
+
if analyses[i] is None:
|
|
271
|
+
todo.append(i)
|
|
272
|
+
if todo and len(todo) < len(scenes):
|
|
273
|
+
log(f"VLM 复用 {len(scenes) - len(todo)} 个已缓存场景,待分析 {len(todo)} 个")
|
|
274
|
+
|
|
275
|
+
def _run_pass(indices, workers):
|
|
276
|
+
"""分析给定场景索引;结果按批持久化到续传缓存(在主线程,无需加锁)。返回 (i, err) 失败列表。
|
|
277
|
+
|
|
278
|
+
续传缓存每次都是整份重写,原来每完成一个场景就刷一次 → 写入量随场景数平方增长
|
|
279
|
+
(300 个场景约 75MB 冗余写),而且序列化发生在收结果的主循环上。改成按批刷:
|
|
280
|
+
崩溃最多丢失不到一批的进度,而这些场景本来就会在重跑时被重新分析。
|
|
281
|
+
"""
|
|
282
|
+
if not indices:
|
|
283
|
+
return []
|
|
284
|
+
failures = []
|
|
285
|
+
pending = 0
|
|
286
|
+
# 与并发度对齐:一批大致就是「同时在飞的那几个场景」。
|
|
287
|
+
flush_every = max(1, min(16, workers))
|
|
288
|
+
with ThreadPoolExecutor(max_workers=max(1, workers)) as executor:
|
|
289
|
+
futures = {executor.submit(_analyze_single_scene, i, scenes[i]): i for i in indices}
|
|
290
|
+
try:
|
|
291
|
+
for future in as_completed(futures):
|
|
292
|
+
i = futures[future]
|
|
293
|
+
try:
|
|
294
|
+
idx, result = future.result()
|
|
295
|
+
analyses[idx] = result
|
|
296
|
+
cache[_scene_cache_key(idx, scenes[idx])] = result
|
|
297
|
+
pending += 1
|
|
298
|
+
if pending >= flush_every:
|
|
299
|
+
_flush_vlm_scene_cache(work_dir, cache_settings, cache)
|
|
300
|
+
pending = 0
|
|
301
|
+
except Exception as e: # noqa: BLE001 - 单个场景失败不能拖垮其余已完成的
|
|
302
|
+
log(f"VLM 场景 {i+1} 分析失败: {e}")
|
|
303
|
+
failures.append((i, str(e)))
|
|
304
|
+
finally:
|
|
305
|
+
# 无论正常结束、失败还是中断,都把这一轮已完成的场景落盘。
|
|
306
|
+
if pending:
|
|
307
|
+
_flush_vlm_scene_cache(work_dir, cache_settings, cache)
|
|
308
|
+
return failures
|
|
309
|
+
|
|
310
|
+
base_workers = min(len(todo) or 1, int(CONFIG["vlm_workers"]))
|
|
311
|
+
log(f"VLM 并行分析 {len(todo)} 个场景 (workers={base_workers})...")
|
|
312
|
+
failures = _run_pass(todo, base_workers)
|
|
313
|
+
if failures:
|
|
314
|
+
# 限流(429)多是并发瞬时拥塞,降并发重试一轮(已成功的从缓存跳过);其它错误(空响应/解析失败)
|
|
315
|
+
# 重试无益,直接保留为失败,不浪费一轮调用。
|
|
316
|
+
rate_limited = [i for i, msg in failures if _looks_rate_limited(msg)]
|
|
317
|
+
persistent = [(i, msg) for i, msg in failures if not _looks_rate_limited(msg)]
|
|
318
|
+
if rate_limited:
|
|
319
|
+
retry_workers = max(1, base_workers // 4)
|
|
320
|
+
log(f"VLM {len(rate_limited)} 个场景疑似限流(429),降并发到 {retry_workers} 重试...")
|
|
321
|
+
persistent += _run_pass(rate_limited, retry_workers)
|
|
322
|
+
failures = persistent
|
|
323
|
+
|
|
324
|
+
if failures:
|
|
325
|
+
sample = "; ".join(f"场景 {i+1}: {msg}" for i, msg in failures[:3])
|
|
326
|
+
raise RuntimeError(
|
|
327
|
+
f"VLM 分析失败 {len(failures)}/{len(scenes)} 个场景。其余已缓存到 vlm_scene_cache.json,"
|
|
328
|
+
f"重跑可断点续传(只重试失败场景)。示例: {sample}"
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
vlm_file = work_dir / "vlm_analysis.json"
|
|
332
|
+
vlm_file.write_text(json.dumps(analyses, ensure_ascii=False, indent=2), encoding="utf-8")
|
|
333
|
+
_vlm_scene_cache_path(work_dir).unlink(missing_ok=True) # 完整理解已生成,续传缓存可清理
|
|
334
|
+
log(f"VLM 分析完成: {len(analyses)} 个场景")
|
|
335
|
+
return analyses
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
def _video_data_url(video_path):
|
|
339
|
+
"""Return a MiMo-compatible data URL for a local video chunk, or None when too large."""
|
|
340
|
+
max_bytes = int(float(CONFIG["mimo_video_base64_max_mb"]) * 1024 * 1024)
|
|
341
|
+
encoded_size = int(video_path.stat().st_size * 4 / 3) + 128
|
|
342
|
+
if encoded_size > max_bytes:
|
|
343
|
+
log(
|
|
344
|
+
"MiMo 视频分片超过 base64 上限: "
|
|
345
|
+
f"编码后约 {encoded_size / 1024 / 1024:.1f}MB,超过限制 {max_bytes / 1024 / 1024:.1f}MB;"
|
|
346
|
+
"请降低 MIMO_VIDEO_CHUNK_MAX_SECONDS 或 MIMO_VIDEO_FPS"
|
|
347
|
+
)
|
|
348
|
+
return None
|
|
349
|
+
mime_type = mimetypes.guess_type(str(video_path))[0] or "video/mp4"
|
|
350
|
+
encoded = base64.b64encode(video_path.read_bytes()).decode("ascii")
|
|
351
|
+
return f"data:{mime_type};base64,{encoded}"
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def _mimo_video_chunks(scenes):
|
|
355
|
+
"""Build local MiMo video-understanding chunks from ffmpeg scene boundaries."""
|
|
356
|
+
if not scenes:
|
|
357
|
+
raise RuntimeError("MiMo 视频分片理解需要 scenes;请先运行 ffmpeg scene/scdet 场景检测")
|
|
358
|
+
|
|
359
|
+
max_seconds = float(CONFIG["mimo_video_chunk_max_seconds"])
|
|
360
|
+
min_seconds = float(CONFIG["mimo_video_chunk_min_seconds"])
|
|
361
|
+
chunks = []
|
|
362
|
+
for scene_index, scene in enumerate(scenes):
|
|
363
|
+
start = float(scene["start"])
|
|
364
|
+
end = float(scene["end"])
|
|
365
|
+
if end <= start:
|
|
366
|
+
continue
|
|
367
|
+
scene_id = scene.get("scene_id", scene_index)
|
|
368
|
+
cursor = start
|
|
369
|
+
while cursor < end:
|
|
370
|
+
chunk_end = min(end, cursor + max_seconds)
|
|
371
|
+
if end - chunk_end < min_seconds and chunk_end < end:
|
|
372
|
+
chunk_end = end
|
|
373
|
+
if chunk_end > cursor:
|
|
374
|
+
chunks.append({
|
|
375
|
+
"chunk_id": len(chunks),
|
|
376
|
+
"scene_id": scene_id,
|
|
377
|
+
"start": round(cursor, 3),
|
|
378
|
+
"end": round(chunk_end, 3),
|
|
379
|
+
})
|
|
380
|
+
cursor = chunk_end
|
|
381
|
+
if not chunks:
|
|
382
|
+
raise RuntimeError("MiMo 视频分片理解没有可用分片;请检查 scenes.json")
|
|
383
|
+
return chunks
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def _extract_video_chunk(video_path, chunk, output_path):
|
|
387
|
+
"""Cut one scene-based chunk into a compact local MP4 for MiMo video_url data URL."""
|
|
388
|
+
start = float(chunk["start"])
|
|
389
|
+
duration = max(0.1, float(chunk["end"]) - start)
|
|
390
|
+
fps = float(CONFIG["mimo_video_fps"])
|
|
391
|
+
cmd = [
|
|
392
|
+
"ffmpeg", "-y",
|
|
393
|
+
"-ss", f"{start:.3f}",
|
|
394
|
+
"-t", f"{duration:.3f}",
|
|
395
|
+
"-i", str(video_path),
|
|
396
|
+
"-map", "0:v:0",
|
|
397
|
+
"-an",
|
|
398
|
+
"-vf", f"fps={fps:g}",
|
|
399
|
+
"-c:v", "libx264",
|
|
400
|
+
"-preset", "veryfast",
|
|
401
|
+
"-crf", "30",
|
|
402
|
+
"-pix_fmt", "yuv420p",
|
|
403
|
+
"-movflags", "+faststart",
|
|
404
|
+
str(output_path),
|
|
405
|
+
]
|
|
406
|
+
result = run_cmd(cmd, timeout=CONFIG["mimo_video_chunk_timeout"])
|
|
407
|
+
if result.returncode != 0:
|
|
408
|
+
raise RuntimeError(f"MiMo 视频分片裁剪失败: {result.stderr[-500:]}")
|
|
409
|
+
return output_path
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
def _mimo_chunk_prompt(chunk):
|
|
413
|
+
return (
|
|
414
|
+
f"这是原视频 {chunk['start']:.1f}s-{chunk['end']:.1f}s 的场景分片,"
|
|
415
|
+
f"scene_id={chunk['scene_id']}。"
|
|
416
|
+
f"{CONFIG['mimo_video_prompt']}"
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
def _mimo_video_model():
|
|
421
|
+
"""MiMo 视频理解使用的模型:优先 mimo_video_model,回退 mimo_model,再回退 vlm_model。"""
|
|
422
|
+
return CONFIG.get("mimo_video_model") or CONFIG.get("mimo_model") or CONFIG["vlm_model"]
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
def mimo_video_settings():
|
|
426
|
+
"""Return non-secret MiMo video-overview settings that affect generated content."""
|
|
427
|
+
return {
|
|
428
|
+
"model": _mimo_video_model(),
|
|
429
|
+
"mimo_video_api_url": CONFIG.get("mimo_video_api_url"),
|
|
430
|
+
"mimo_video_fps": CONFIG.get("mimo_video_fps", 2.0),
|
|
431
|
+
"mimo_media_resolution": CONFIG.get("mimo_media_resolution", "default"),
|
|
432
|
+
"mimo_video_chunk_max_seconds": CONFIG.get("mimo_video_chunk_max_seconds", 20.0),
|
|
433
|
+
"mimo_video_chunk_min_seconds": CONFIG.get("mimo_video_chunk_min_seconds", 1.0),
|
|
434
|
+
"mimo_video_base64_max_mb": CONFIG.get("mimo_video_base64_max_mb", 45.0),
|
|
435
|
+
"mimo_video_prompt": CONFIG.get("mimo_video_prompt", ""),
|
|
436
|
+
"mimo_disable_thinking": CONFIG.get("mimo_disable_thinking", True),
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
def _mimo_chunk_cache_key(chunk):
|
|
441
|
+
"""Stable identifier for a MiMo chunk (index + scene span) for partial-cache reuse."""
|
|
442
|
+
return (
|
|
443
|
+
f"{chunk['chunk_id']}|{chunk['scene_id']}|"
|
|
444
|
+
f"{float(chunk['start']):.3f}-{float(chunk['end']):.3f}"
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
def _mimo_partial_provenance(video_path, scenes):
|
|
449
|
+
return {
|
|
450
|
+
"source_video_identity": file_identity(video_path),
|
|
451
|
+
"chunks": [_mimo_chunk_cache_key(chunk) for chunk in _mimo_video_chunks(scenes)],
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
def _load_mimo_partial(partial_path, video_path=None, scenes=None):
|
|
456
|
+
"""Load the internal partial chunk cache, keyed by chunk identifier.
|
|
457
|
+
|
|
458
|
+
Returns {} when missing/unreadable or when settings/source/chunk provenance differs,
|
|
459
|
+
so a changed source video or scene plan cannot reuse paid chunks from another run.
|
|
460
|
+
"""
|
|
461
|
+
if not partial_path.exists():
|
|
462
|
+
return {}
|
|
463
|
+
try:
|
|
464
|
+
partial = json.loads(partial_path.read_text(encoding="utf-8"))
|
|
465
|
+
except (json.JSONDecodeError, OSError):
|
|
466
|
+
return {}
|
|
467
|
+
if not isinstance(partial, dict):
|
|
468
|
+
return {}
|
|
469
|
+
if partial.get("settings") != mimo_video_settings():
|
|
470
|
+
return {}
|
|
471
|
+
if video_path is not None or scenes is not None:
|
|
472
|
+
try:
|
|
473
|
+
if partial.get("provenance") != _mimo_partial_provenance(video_path, scenes):
|
|
474
|
+
return {}
|
|
475
|
+
except (OSError, RuntimeError, TypeError, ValueError):
|
|
476
|
+
return {}
|
|
477
|
+
done = partial.get("chunks")
|
|
478
|
+
return done if isinstance(done, dict) else {}
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
def _save_mimo_partial(partial_path, done, video_path=None, scenes=None):
|
|
482
|
+
"""Persist completed chunk results incrementally so paid chunks survive a mid-loop failure."""
|
|
483
|
+
payload = {
|
|
484
|
+
"settings": mimo_video_settings(),
|
|
485
|
+
"chunks": done,
|
|
486
|
+
}
|
|
487
|
+
if video_path is not None or scenes is not None:
|
|
488
|
+
payload["provenance"] = _mimo_partial_provenance(video_path, scenes)
|
|
489
|
+
partial_path.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8")
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
def _mimo_chunks_match(cached_chunks, expected_chunks):
|
|
493
|
+
if not isinstance(cached_chunks, list) or len(cached_chunks) != len(expected_chunks):
|
|
494
|
+
return False
|
|
495
|
+
try:
|
|
496
|
+
cached_keys = [_mimo_chunk_cache_key(chunk) for chunk in cached_chunks]
|
|
497
|
+
expected_keys = [_mimo_chunk_cache_key(chunk) for chunk in expected_chunks]
|
|
498
|
+
except (KeyError, TypeError, ValueError):
|
|
499
|
+
return False
|
|
500
|
+
return cached_keys == expected_keys
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
def mimo_video_overview_cache_fresh(overview_path, video_path, scenes):
|
|
504
|
+
"""Return True only when the final MiMo overview matches current inputs/settings."""
|
|
505
|
+
overview_path = Path(overview_path)
|
|
506
|
+
if not overview_path.exists():
|
|
507
|
+
return False
|
|
508
|
+
try:
|
|
509
|
+
overview = json.loads(overview_path.read_text(encoding="utf-8"))
|
|
510
|
+
except (json.JSONDecodeError, OSError):
|
|
511
|
+
return False
|
|
512
|
+
if not isinstance(overview, dict) or overview.get("input") != "scene_chunks":
|
|
513
|
+
return False
|
|
514
|
+
if overview.get("settings") != mimo_video_settings():
|
|
515
|
+
return False
|
|
516
|
+
chunks = overview.get("chunks")
|
|
517
|
+
if not isinstance(chunks, list) or not all(
|
|
518
|
+
isinstance(chunk, dict) and _is_mimo_chunk_usable(chunk.get("content"))
|
|
519
|
+
for chunk in chunks
|
|
520
|
+
):
|
|
521
|
+
return False # a moderation-rejected chunk is retried, never served from cache
|
|
522
|
+
try:
|
|
523
|
+
if overview.get("source_video_identity") != file_identity(video_path):
|
|
524
|
+
return False
|
|
525
|
+
expected_chunks = _mimo_video_chunks(scenes)
|
|
526
|
+
except (OSError, RuntimeError, TypeError, ValueError):
|
|
527
|
+
return False
|
|
528
|
+
return _mimo_chunks_match(chunks, expected_chunks)
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
def _analyze_mimo_video_chunk(chunk_path, chunk):
|
|
532
|
+
video_url = _video_data_url(chunk_path)
|
|
533
|
+
if not video_url:
|
|
534
|
+
raise RuntimeError(f"MiMo 视频分片 {chunk['chunk_id'] + 1} 超过 data URL 上限")
|
|
535
|
+
|
|
536
|
+
content_parts = [
|
|
537
|
+
{
|
|
538
|
+
"type": "video_url",
|
|
539
|
+
"video_url": {"url": video_url},
|
|
540
|
+
"fps": CONFIG["mimo_video_fps"],
|
|
541
|
+
"media_resolution": CONFIG["mimo_media_resolution"],
|
|
542
|
+
},
|
|
543
|
+
{"type": "text", "text": _mimo_chunk_prompt(chunk)},
|
|
544
|
+
]
|
|
545
|
+
model = _mimo_video_model()
|
|
546
|
+
payload = {
|
|
547
|
+
"model": model,
|
|
548
|
+
"messages": [{"role": "user", "content": content_parts}],
|
|
549
|
+
"max_tokens": 1200,
|
|
550
|
+
}
|
|
551
|
+
resp = mimo_video_api_call(payload)
|
|
552
|
+
try:
|
|
553
|
+
msg = resp["choices"][0]["message"]
|
|
554
|
+
except (KeyError, IndexError, TypeError) as exc:
|
|
555
|
+
raise RuntimeError("MiMo 视频分片理解响应缺少 choices[0].message") from exc
|
|
556
|
+
return {
|
|
557
|
+
"chunk_id": chunk["chunk_id"],
|
|
558
|
+
"scene_id": chunk["scene_id"],
|
|
559
|
+
"start": chunk["start"],
|
|
560
|
+
"end": chunk["end"],
|
|
561
|
+
"model": resp.get("model", model),
|
|
562
|
+
"content": msg.get("content", ""),
|
|
563
|
+
"reasoning_content": msg.get("reasoning_content", ""),
|
|
564
|
+
"usage": resp.get("usage", {}),
|
|
565
|
+
"clip_path": f"mimo_video_chunks/{chunk_path.name}",
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
_MIMO_REJECTION_MARKERS = (
|
|
570
|
+
"request was rejected", "considered high risk", "high risk",
|
|
571
|
+
"content policy", "cannot process", "无法处理", "内容审核", "违规",
|
|
572
|
+
)
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
def _is_mimo_chunk_usable(content):
|
|
576
|
+
"""A chunk is usable only if MiMo returned real analysis (not empty / a moderation refusal)."""
|
|
577
|
+
text = str(content or "").strip()
|
|
578
|
+
if not text:
|
|
579
|
+
return False
|
|
580
|
+
low = text.lower()
|
|
581
|
+
return not any(marker in low for marker in _MIMO_REJECTION_MARKERS)
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
def analyze_video_overview(video_path, work_dir, scenes=None):
|
|
585
|
+
"""Use MiMo video understanding over local ffmpeg scene chunks."""
|
|
586
|
+
if not CONFIG["mimo_video_overview"]:
|
|
587
|
+
return None
|
|
588
|
+
if not CONFIG["mimo_video_api_key"]:
|
|
589
|
+
log("MiMo 视频概览已启用,但未设置 MIMO_VIDEO_API_KEY/MIMO_API_KEY,跳过")
|
|
590
|
+
return None
|
|
591
|
+
|
|
592
|
+
chunks = _mimo_video_chunks(scenes)
|
|
593
|
+
chunks_dir = work_dir / "mimo_video_chunks"
|
|
594
|
+
chunks_dir.mkdir(exist_ok=True)
|
|
595
|
+
|
|
596
|
+
# 增量缓存:已完成的分片先落盘,避免一段失败时丢弃所有已付费分片
|
|
597
|
+
partial_path = work_dir / "mimo_video_overview.partial.json"
|
|
598
|
+
done = _load_mimo_partial(partial_path, video_path, scenes)
|
|
599
|
+
|
|
600
|
+
log(f"MiMo 视频理解:按 ffmpeg scene 分片分析 {len(chunks)} 段...")
|
|
601
|
+
chunk_results = []
|
|
602
|
+
unusable_chunks = []
|
|
603
|
+
for chunk in chunks:
|
|
604
|
+
cache_key = _mimo_chunk_cache_key(chunk)
|
|
605
|
+
cached = done.get(cache_key)
|
|
606
|
+
if cached is not None: # the partial only ever stores usable chunks
|
|
607
|
+
log(
|
|
608
|
+
f" MiMo 分片 {chunk['chunk_id'] + 1}/{len(chunks)}: "
|
|
609
|
+
f"{chunk['start']:.1f}-{chunk['end']:.1f}s(命中增量缓存,跳过)"
|
|
610
|
+
)
|
|
611
|
+
chunk_results.append(cached)
|
|
612
|
+
continue
|
|
613
|
+
chunk_path = chunks_dir / (
|
|
614
|
+
f"chunk_{chunk['chunk_id']:03d}_scene_{chunk['scene_id']}_"
|
|
615
|
+
f"{chunk['start']:.2f}-{chunk['end']:.2f}.mp4"
|
|
616
|
+
)
|
|
617
|
+
_extract_video_chunk(video_path, chunk, chunk_path)
|
|
618
|
+
log(
|
|
619
|
+
f" MiMo 分片 {chunk['chunk_id'] + 1}/{len(chunks)}: "
|
|
620
|
+
f"{chunk['start']:.1f}-{chunk['end']:.1f}s"
|
|
621
|
+
)
|
|
622
|
+
chunk_result = _analyze_mimo_video_chunk(chunk_path, chunk)
|
|
623
|
+
if _is_mimo_chunk_usable(chunk_result["content"]):
|
|
624
|
+
chunk_results.append(chunk_result)
|
|
625
|
+
done[cache_key] = chunk_result
|
|
626
|
+
_save_mimo_partial(partial_path, done, video_path, scenes)
|
|
627
|
+
else:
|
|
628
|
+
unusable_chunks.append(chunk)
|
|
629
|
+
log(f" MiMo 分片 {chunk['chunk_id'] + 1}: 未返回有效内容,保留为待重试")
|
|
630
|
+
|
|
631
|
+
if not chunk_results:
|
|
632
|
+
log(f"MiMo 视频概览:{len(chunks)} 段均无有效内容(疑似被内容审核拦截),跳过概览")
|
|
633
|
+
partial_path.unlink(missing_ok=True)
|
|
634
|
+
return None
|
|
635
|
+
|
|
636
|
+
if unusable_chunks:
|
|
637
|
+
# Degrade gracefully instead of aborting the whole understanding: some chunks get
|
|
638
|
+
# moderation-rejected (e.g. a burned-in watermark / violent frames). Write the overview
|
|
639
|
+
# from the usable chunks; the scenes whose chunks were rejected simply fall back to the
|
|
640
|
+
# frame-VLM description downstream. (Aborting here would make overview unsafe to enable
|
|
641
|
+
# by default on any moderated source.)
|
|
642
|
+
sample = ", ".join(str(chunk["chunk_id"] + 1) for chunk in unusable_chunks[:5])
|
|
643
|
+
log(
|
|
644
|
+
f"MiMo 视频概览:{len(unusable_chunks)}/{len(chunks)} 段无有效内容(疑似内容审核),"
|
|
645
|
+
f"以可用分片降级产出,未覆盖场景回退到逐帧描述。样例分片: {sample}"
|
|
646
|
+
)
|
|
647
|
+
|
|
648
|
+
content = "\n\n".join(
|
|
649
|
+
f"### 分片 {item['chunk_id'] + 1} "
|
|
650
|
+
f"(scene {item['scene_id']}, {item['start']:.1f}-{item['end']:.1f}s)\n"
|
|
651
|
+
f"{item['content'].strip()}"
|
|
652
|
+
for item in chunk_results
|
|
653
|
+
)
|
|
654
|
+
|
|
655
|
+
overview = {
|
|
656
|
+
"model": _mimo_video_model(),
|
|
657
|
+
"content": content,
|
|
658
|
+
"chunks": chunk_results,
|
|
659
|
+
"chunk_count": len(chunk_results),
|
|
660
|
+
"fps": CONFIG["mimo_video_fps"],
|
|
661
|
+
"media_resolution": CONFIG["mimo_media_resolution"],
|
|
662
|
+
"input": "scene_chunks",
|
|
663
|
+
"partial": bool(unusable_chunks),
|
|
664
|
+
"unusable_chunk_count": len(unusable_chunks),
|
|
665
|
+
"source_video_identity": file_identity(video_path),
|
|
666
|
+
"chunk_max_seconds": CONFIG["mimo_video_chunk_max_seconds"],
|
|
667
|
+
"settings": mimo_video_settings(),
|
|
668
|
+
}
|
|
669
|
+
overview_path = work_dir / "mimo_video_overview.json"
|
|
670
|
+
overview_path.write_text(json.dumps(overview, ensure_ascii=False, indent=2), encoding="utf-8")
|
|
671
|
+
# 所有分片完成后清理增量缓存,保持 work_dir 仅有规范产物
|
|
672
|
+
partial_path.unlink(missing_ok=True)
|
|
673
|
+
log(f"MiMo 分片视频概览完成: {overview_path}")
|
|
674
|
+
return overview
|