vidspotai-shared 1.0.67 → 1.0.69-dev.0
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/lib/globals/aiModels/enums.d.ts +63 -6
- package/lib/globals/aiModels/enums.d.ts.map +1 -1
- package/lib/globals/aiModels/enums.js +78 -9
- package/lib/globals/aiModels/index.d.ts +2 -0
- package/lib/globals/aiModels/index.d.ts.map +1 -1
- package/lib/globals/aiModels/index.js +6 -0
- package/lib/globals/aiModels/providers/alibaba.d.ts +4 -0
- package/lib/globals/aiModels/providers/alibaba.d.ts.map +1 -0
- package/lib/globals/aiModels/providers/alibaba.js +194 -0
- package/lib/globals/aiModels/providers/bytedance.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/bytedance.js +19 -0
- package/lib/globals/aiModels/providers/elevenlabs.d.ts +14 -0
- package/lib/globals/aiModels/providers/elevenlabs.d.ts.map +1 -0
- package/lib/globals/aiModels/providers/elevenlabs.js +29 -0
- package/lib/globals/aiModels/providers/google.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/google.js +150 -2
- package/lib/globals/aiModels/providers/kling.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/kling.js +280 -37
- package/lib/globals/aiModels/providers/minimax.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/minimax.js +73 -2
- package/lib/globals/aiModels/providers/openai.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/openai.js +90 -6
- package/lib/globals/aiModels/providers/pixverse.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/pixverse.js +111 -29
- package/lib/globals/aiModels/providers/pixverseTemplates.d.ts +36 -0
- package/lib/globals/aiModels/providers/pixverseTemplates.d.ts.map +1 -0
- package/lib/globals/aiModels/providers/pixverseTemplates.js +42 -0
- package/lib/globals/aiModels/providers/runway.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/runway.js +64 -2
- package/lib/globals/aiModels/tierHelpers.d.ts +33 -0
- package/lib/globals/aiModels/tierHelpers.d.ts.map +1 -0
- package/lib/globals/aiModels/tierHelpers.js +109 -0
- package/lib/globals/aiModels/types.d.ts +20 -1
- package/lib/globals/aiModels/types.d.ts.map +1 -1
- package/lib/globals/ttsModels/index.d.ts +2 -0
- package/lib/globals/ttsModels/index.d.ts.map +1 -1
- package/lib/globals/ttsModels/index.js +9 -1
- package/lib/globals/ttsModels/providers/minimax.d.ts +8 -0
- package/lib/globals/ttsModels/providers/minimax.d.ts.map +1 -0
- package/lib/globals/ttsModels/providers/minimax.js +18 -0
- package/lib/globals/ttsModels/providers/openai.d.ts +12 -0
- package/lib/globals/ttsModels/providers/openai.d.ts.map +1 -0
- package/lib/globals/ttsModels/providers/openai.js +22 -0
- package/lib/globals/ttsModels/types.d.ts +1 -1
- package/lib/globals/ttsModels/types.d.ts.map +1 -1
- package/lib/globals/ttsModels/voices.d.ts +39 -4
- package/lib/globals/ttsModels/voices.d.ts.map +1 -1
- package/lib/globals/ttsModels/voices.js +273 -26
- package/lib/globals/types.d.ts +59 -1
- package/lib/globals/types.d.ts.map +1 -1
- package/lib/globals/types.js +81 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/models/agent.model.d.ts +357 -0
- package/lib/models/agent.model.d.ts.map +1 -0
- package/lib/models/agent.model.js +21 -0
- package/lib/models/cachedAsset.model.d.ts +18 -0
- package/lib/models/cachedAsset.model.d.ts.map +1 -0
- package/lib/models/cachedAsset.model.js +2 -0
- package/lib/models/cachedRawAsset.model.d.ts +20 -0
- package/lib/models/cachedRawAsset.model.d.ts.map +1 -0
- package/lib/models/cachedRawAsset.model.js +2 -0
- package/lib/models/image.model.d.ts +47 -0
- package/lib/models/image.model.d.ts.map +1 -0
- package/lib/models/image.model.js +2 -0
- package/lib/models/index.d.ts +6 -0
- package/lib/models/index.d.ts.map +1 -1
- package/lib/models/index.js +6 -0
- package/lib/models/notification.model.d.ts +25 -0
- package/lib/models/notification.model.d.ts.map +1 -0
- package/lib/models/notification.model.js +2 -0
- package/lib/models/ref.model.d.ts +80 -0
- package/lib/models/ref.model.d.ts.map +1 -0
- package/lib/models/ref.model.js +13 -0
- package/lib/models/share.model.d.ts +29 -0
- package/lib/models/share.model.d.ts.map +1 -0
- package/lib/models/share.model.js +2 -0
- package/lib/models/user.model.d.ts +12 -1
- package/lib/models/user.model.d.ts.map +1 -1
- package/lib/models/video.model.d.ts +120 -0
- package/lib/models/video.model.d.ts.map +1 -1
- package/lib/models/video.model.js +10 -0
- package/lib/schemas/agentPersona.schema.d.ts +10 -0
- package/lib/schemas/agentPersona.schema.d.ts.map +1 -0
- package/lib/schemas/agentPersona.schema.js +11 -0
- package/lib/schemas/agentRunJob.schema.d.ts +105 -0
- package/lib/schemas/agentRunJob.schema.d.ts.map +1 -0
- package/lib/schemas/agentRunJob.schema.js +88 -0
- package/lib/schemas/brandKit.schema.d.ts +113 -0
- package/lib/schemas/brandKit.schema.d.ts.map +1 -0
- package/lib/schemas/brandKit.schema.js +46 -0
- package/lib/schemas/brief.schema.d.ts +263 -0
- package/lib/schemas/brief.schema.d.ts.map +1 -0
- package/lib/schemas/brief.schema.js +157 -0
- package/lib/schemas/index.d.ts +7 -0
- package/lib/schemas/index.d.ts.map +1 -0
- package/lib/schemas/index.js +22 -0
- package/lib/schemas/project.schema.d.ts +1025 -0
- package/lib/schemas/project.schema.d.ts.map +1 -0
- package/lib/schemas/project.schema.js +256 -0
- package/lib/schemas/videoPlan.schema.d.ts +590 -0
- package/lib/schemas/videoPlan.schema.d.ts.map +1 -0
- package/lib/schemas/videoPlan.schema.js +412 -0
- package/lib/services/agent/beatSnap.d.ts +10 -0
- package/lib/services/agent/beatSnap.d.ts.map +1 -0
- package/lib/services/agent/beatSnap.js +128 -0
- package/lib/services/agent/bibleBuilder.d.ts +43 -0
- package/lib/services/agent/bibleBuilder.d.ts.map +1 -0
- package/lib/services/agent/bibleBuilder.js +102 -0
- package/lib/services/agent/bibleImageVision.d.ts +45 -0
- package/lib/services/agent/bibleImageVision.d.ts.map +1 -0
- package/lib/services/agent/bibleImageVision.js +169 -0
- package/lib/services/agent/chatAgent.d.ts +79 -0
- package/lib/services/agent/chatAgent.d.ts.map +1 -0
- package/lib/services/agent/chatAgent.js +136 -0
- package/lib/services/agent/costPreflight.d.ts +61 -0
- package/lib/services/agent/costPreflight.d.ts.map +1 -0
- package/lib/services/agent/costPreflight.js +143 -0
- package/lib/services/agent/critic.d.ts +103 -0
- package/lib/services/agent/critic.d.ts.map +1 -0
- package/lib/services/agent/critic.js +139 -0
- package/lib/services/agent/editClassifier.d.ts +262 -0
- package/lib/services/agent/editClassifier.d.ts.map +1 -0
- package/lib/services/agent/editClassifier.js +186 -0
- package/lib/services/agent/eval/index.d.ts +5 -0
- package/lib/services/agent/eval/index.d.ts.map +1 -0
- package/lib/services/agent/eval/index.js +20 -0
- package/lib/services/agent/eval/judge.d.ts +14 -0
- package/lib/services/agent/eval/judge.d.ts.map +1 -0
- package/lib/services/agent/eval/judge.js +96 -0
- package/lib/services/agent/eval/recorder.d.ts +28 -0
- package/lib/services/agent/eval/recorder.d.ts.map +1 -0
- package/lib/services/agent/eval/recorder.js +100 -0
- package/lib/services/agent/eval/seedBriefs.d.ts +16 -0
- package/lib/services/agent/eval/seedBriefs.d.ts.map +1 -0
- package/lib/services/agent/eval/seedBriefs.js +1188 -0
- package/lib/services/agent/eval/types.d.ts +230 -0
- package/lib/services/agent/eval/types.d.ts.map +1 -0
- package/lib/services/agent/eval/types.js +73 -0
- package/lib/services/agent/executor.d.ts +141 -0
- package/lib/services/agent/executor.d.ts.map +1 -0
- package/lib/services/agent/executor.js +561 -0
- package/lib/services/agent/globalActions.d.ts +49 -0
- package/lib/services/agent/globalActions.d.ts.map +1 -0
- package/lib/services/agent/globalActions.js +328 -0
- package/lib/services/agent/index.d.ts +38 -0
- package/lib/services/agent/index.d.ts.map +1 -0
- package/lib/services/agent/index.js +53 -0
- package/lib/services/agent/llmCaller.d.ts +144 -0
- package/lib/services/agent/llmCaller.d.ts.map +1 -0
- package/lib/services/agent/llmCaller.js +16 -0
- package/lib/services/agent/llmCallerAnthropic.d.ts +90 -0
- package/lib/services/agent/llmCallerAnthropic.d.ts.map +1 -0
- package/lib/services/agent/llmCallerAnthropic.js +255 -0
- package/lib/services/agent/llmCallerGateway.d.ts +61 -0
- package/lib/services/agent/llmCallerGateway.d.ts.map +1 -0
- package/lib/services/agent/llmCallerGateway.js +360 -0
- package/lib/services/agent/llmCallerRegistry.d.ts +6 -0
- package/lib/services/agent/llmCallerRegistry.d.ts.map +1 -0
- package/lib/services/agent/llmCallerRegistry.js +39 -0
- package/lib/services/agent/modelQualityNotes.d.ts +100 -0
- package/lib/services/agent/modelQualityNotes.d.ts.map +1 -0
- package/lib/services/agent/modelQualityNotes.js +248 -0
- package/lib/services/agent/modelRouter.d.ts +41 -0
- package/lib/services/agent/modelRouter.d.ts.map +1 -0
- package/lib/services/agent/modelRouter.js +65 -0
- package/lib/services/agent/musicSelect.d.ts +23 -0
- package/lib/services/agent/musicSelect.d.ts.map +1 -0
- package/lib/services/agent/musicSelect.js +109 -0
- package/lib/services/agent/overlayRenderer.d.ts +67 -0
- package/lib/services/agent/overlayRenderer.d.ts.map +1 -0
- package/lib/services/agent/overlayRenderer.js +253 -0
- package/lib/services/agent/perSceneCritic.d.ts +90 -0
- package/lib/services/agent/perSceneCritic.d.ts.map +1 -0
- package/lib/services/agent/perSceneCritic.js +125 -0
- package/lib/services/agent/personas.d.ts +78 -0
- package/lib/services/agent/personas.d.ts.map +1 -0
- package/lib/services/agent/personas.js +177 -0
- package/lib/services/agent/planDiff.d.ts +76 -0
- package/lib/services/agent/planDiff.d.ts.map +1 -0
- package/lib/services/agent/planDiff.js +182 -0
- package/lib/services/agent/planMutations.d.ts +46 -0
- package/lib/services/agent/planMutations.d.ts.map +1 -0
- package/lib/services/agent/planMutations.js +120 -0
- package/lib/services/agent/planner/Planner.d.ts +107 -0
- package/lib/services/agent/planner/Planner.d.ts.map +1 -0
- package/lib/services/agent/planner/Planner.js +591 -0
- package/lib/services/agent/planner/overlaySanity.d.ts +7 -0
- package/lib/services/agent/planner/overlaySanity.d.ts.map +1 -0
- package/lib/services/agent/planner/overlaySanity.js +86 -0
- package/lib/services/agent/planner/promptSections.d.ts +25 -0
- package/lib/services/agent/planner/promptSections.d.ts.map +1 -0
- package/lib/services/agent/planner/promptSections.js +174 -0
- package/lib/services/agent/planner/repair.d.ts +16 -0
- package/lib/services/agent/planner/repair.d.ts.map +1 -0
- package/lib/services/agent/planner/repair.js +51 -0
- package/lib/services/agent/planner/structuralRules.d.ts +10 -0
- package/lib/services/agent/planner/structuralRules.d.ts.map +1 -0
- package/lib/services/agent/planner/structuralRules.js +111 -0
- package/lib/services/agent/planner/validators.d.ts +65 -0
- package/lib/services/agent/planner/validators.d.ts.map +1 -0
- package/lib/services/agent/planner/validators.js +284 -0
- package/lib/services/agent/planner.d.ts +3 -0
- package/lib/services/agent/planner.d.ts.map +1 -0
- package/lib/services/agent/planner.js +14 -0
- package/lib/services/agent/providerFallback/chains.d.ts +100 -0
- package/lib/services/agent/providerFallback/chains.d.ts.map +1 -0
- package/lib/services/agent/providerFallback/chains.js +198 -0
- package/lib/services/agent/providerFallback/classifier.d.ts +36 -0
- package/lib/services/agent/providerFallback/classifier.d.ts.map +1 -0
- package/lib/services/agent/providerFallback/classifier.js +103 -0
- package/lib/services/agent/providerFallback/index.d.ts +4 -0
- package/lib/services/agent/providerFallback/index.d.ts.map +1 -0
- package/lib/services/agent/providerFallback/index.js +19 -0
- package/lib/services/agent/providerFallback/withFallback.d.ts +60 -0
- package/lib/services/agent/providerFallback/withFallback.d.ts.map +1 -0
- package/lib/services/agent/providerFallback/withFallback.js +93 -0
- package/lib/services/agent/providerTaskCache.d.ts +50 -0
- package/lib/services/agent/providerTaskCache.d.ts.map +1 -0
- package/lib/services/agent/providerTaskCache.js +98 -0
- package/lib/services/agent/qualityGate.d.ts +82 -0
- package/lib/services/agent/qualityGate.d.ts.map +1 -0
- package/lib/services/agent/qualityGate.js +232 -0
- package/lib/services/agent/referenceImageRenderer.d.ts +37 -0
- package/lib/services/agent/referenceImageRenderer.d.ts.map +1 -0
- package/lib/services/agent/referenceImageRenderer.js +92 -0
- package/lib/services/agent/regenCore.d.ts +60 -0
- package/lib/services/agent/regenCore.d.ts.map +1 -0
- package/lib/services/agent/regenCore.js +487 -0
- package/lib/services/agent/runHelpers.d.ts +44 -0
- package/lib/services/agent/runHelpers.d.ts.map +1 -0
- package/lib/services/agent/runHelpers.js +196 -0
- package/lib/services/agent/sceneLayoutVision.d.ts +90 -0
- package/lib/services/agent/sceneLayoutVision.d.ts.map +1 -0
- package/lib/services/agent/sceneLayoutVision.js +212 -0
- package/lib/services/agent/stitchedVideoCritic.d.ts +136 -0
- package/lib/services/agent/stitchedVideoCritic.d.ts.map +1 -0
- package/lib/services/agent/stitchedVideoCritic.gemini.d.ts +26 -0
- package/lib/services/agent/stitchedVideoCritic.gemini.d.ts.map +1 -0
- package/lib/services/agent/stitchedVideoCritic.gemini.js +198 -0
- package/lib/services/agent/stitchedVideoCritic.js +162 -0
- package/lib/services/agent/taskPoller.d.ts +65 -0
- package/lib/services/agent/taskPoller.d.ts.map +1 -0
- package/lib/services/agent/taskPoller.js +176 -0
- package/lib/services/agent/textOverlayStyles.d.ts +60 -0
- package/lib/services/agent/textOverlayStyles.d.ts.map +1 -0
- package/lib/services/agent/textOverlayStyles.js +174 -0
- package/lib/services/agent/toolRegistry.d.ts +73 -0
- package/lib/services/agent/toolRegistry.d.ts.map +1 -0
- package/lib/services/agent/toolRegistry.js +95 -0
- package/lib/services/agent/tools/analyzeReference.tool.d.ts +36 -0
- package/lib/services/agent/tools/analyzeReference.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/analyzeReference.tool.js +44 -0
- package/lib/services/agent/tools/animateImage.tool.d.ts +24 -0
- package/lib/services/agent/tools/animateImage.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/animateImage.tool.js +115 -0
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.d.ts +32 -0
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.js +135 -0
- package/lib/services/agent/tools/composeScene.tool.d.ts +978 -0
- package/lib/services/agent/tools/composeScene.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/composeScene.tool.js +90 -0
- package/lib/services/agent/tools/estimateCost.tool.d.ts +352 -0
- package/lib/services/agent/tools/estimateCost.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/estimateCost.tool.js +62 -0
- package/lib/services/agent/tools/generateAvatarVideo.tool.d.ts +32 -0
- package/lib/services/agent/tools/generateAvatarVideo.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateAvatarVideo.tool.js +143 -0
- package/lib/services/agent/tools/generateCaptions.tool.d.ts +42 -0
- package/lib/services/agent/tools/generateCaptions.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateCaptions.tool.js +196 -0
- package/lib/services/agent/tools/generateImage.tool.d.ts +74 -0
- package/lib/services/agent/tools/generateImage.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateImage.tool.js +206 -0
- package/lib/services/agent/tools/generateVideo.tool.d.ts +31 -0
- package/lib/services/agent/tools/generateVideo.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateVideo.tool.js +153 -0
- package/lib/services/agent/tools/generateVoiceover.tool.d.ts +44 -0
- package/lib/services/agent/tools/generateVoiceover.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/generateVoiceover.tool.js +206 -0
- package/lib/services/agent/tools/index.d.ts +20 -0
- package/lib/services/agent/tools/index.d.ts.map +1 -0
- package/lib/services/agent/tools/index.js +35 -0
- package/lib/services/agent/tools/planVideo.tool.d.ts +343 -0
- package/lib/services/agent/tools/planVideo.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/planVideo.tool.js +46 -0
- package/lib/services/agent/tools/render.tool.d.ts +367 -0
- package/lib/services/agent/tools/render.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/render.tool.js +48 -0
- package/lib/services/agent/tools/searchMusic.tool.d.ts +49 -0
- package/lib/services/agent/tools/searchMusic.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/searchMusic.tool.js +74 -0
- package/lib/services/agent/tools/searchStock.tool.d.ts +41 -0
- package/lib/services/agent/tools/searchStock.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/searchStock.tool.js +314 -0
- package/lib/services/agent/tools/searchUserLibrary.tool.d.ts +59 -0
- package/lib/services/agent/tools/searchUserLibrary.tool.d.ts.map +1 -0
- package/lib/services/agent/tools/searchUserLibrary.tool.js +58 -0
- package/lib/services/agent/ttsDuration.d.ts +29 -0
- package/lib/services/agent/ttsDuration.d.ts.map +1 -0
- package/lib/services/agent/ttsDuration.js +60 -0
- package/lib/services/aiGen/aiGenFactory.service.d.ts +21 -1
- package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -1
- package/lib/services/aiGen/aiGenFactory.service.js +84 -21
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts +31 -0
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts.map +1 -0
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.js +2 -0
- package/lib/services/aiGen/canonicalAdapters/index.d.ts +3 -0
- package/lib/services/aiGen/canonicalAdapters/index.d.ts.map +1 -0
- package/lib/services/aiGen/canonicalAdapters/index.js +18 -0
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts +23 -0
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts.map +1 -0
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.js +12 -0
- package/lib/services/aiGen/helpers.d.ts.map +1 -1
- package/lib/services/aiGen/helpers.js +10 -0
- package/lib/services/aiGen/providers/alibaba/alibaba.d.ts +14 -3
- package/lib/services/aiGen/providers/alibaba/alibaba.d.ts.map +1 -1
- package/lib/services/aiGen/providers/alibaba/alibaba.js +155 -22
- package/lib/services/aiGen/providers/baseAiGenProvider.service.d.ts +22 -4
- package/lib/services/aiGen/providers/baseAiGenProvider.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/baseAiGenProvider.service.js +32 -0
- package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/bytedance/bytedance.service.js +13 -13
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.d.ts +18 -0
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.js +102 -0
- package/lib/services/aiGen/providers/fal/falImage.service.d.ts +15 -0
- package/lib/services/aiGen/providers/fal/falImage.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/fal/falImage.service.js +141 -0
- package/lib/services/aiGen/providers/fal/index.d.ts +2 -0
- package/lib/services/aiGen/providers/fal/index.d.ts.map +1 -0
- package/lib/services/aiGen/providers/fal/index.js +17 -0
- package/lib/services/aiGen/providers/google/google.service.d.ts +11 -2
- package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/google/google.service.js +245 -28
- package/lib/services/aiGen/providers/index.d.ts +3 -0
- package/lib/services/aiGen/providers/index.d.ts.map +1 -1
- package/lib/services/aiGen/providers/index.js +3 -0
- package/lib/services/aiGen/providers/kling/cameraAdapter.d.ts +4 -0
- package/lib/services/aiGen/providers/kling/cameraAdapter.d.ts.map +1 -0
- package/lib/services/aiGen/providers/kling/cameraAdapter.js +53 -0
- package/lib/services/aiGen/providers/kling/index.d.ts +1 -0
- package/lib/services/aiGen/providers/kling/index.d.ts.map +1 -1
- package/lib/services/aiGen/providers/kling/index.js +1 -0
- package/lib/services/aiGen/providers/kling/kling.service.d.ts +12 -1
- package/lib/services/aiGen/providers/kling/kling.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/kling/kling.service.js +357 -26
- package/lib/services/aiGen/providers/kling/klingImage.service.d.ts +21 -0
- package/lib/services/aiGen/providers/kling/klingImage.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/kling/klingImage.service.js +208 -0
- package/lib/services/aiGen/providers/kling/types.d.ts +105 -0
- package/lib/services/aiGen/providers/kling/types.d.ts.map +1 -1
- package/lib/services/aiGen/providers/minimax/minimax.service.d.ts +15 -2
- package/lib/services/aiGen/providers/minimax/minimax.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/minimax/minimax.service.js +127 -1
- package/lib/services/aiGen/providers/minimax/types.d.ts +10 -1
- package/lib/services/aiGen/providers/minimax/types.d.ts.map +1 -1
- package/lib/services/aiGen/providers/openai/openai.service.d.ts +8 -2
- package/lib/services/aiGen/providers/openai/openai.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/openai/openai.service.js +184 -7
- package/lib/services/aiGen/providers/pexels/index.d.ts +2 -0
- package/lib/services/aiGen/providers/pexels/index.d.ts.map +1 -0
- package/lib/services/aiGen/providers/{azure → pexels}/index.js +1 -1
- package/lib/services/aiGen/providers/pexels/pexels.service.d.ts +11 -0
- package/lib/services/aiGen/providers/pexels/pexels.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/pexels/pexels.service.js +150 -0
- package/lib/services/aiGen/providers/pixabay/index.d.ts +2 -0
- package/lib/services/aiGen/providers/pixabay/index.d.ts.map +1 -0
- package/lib/services/aiGen/providers/pixabay/index.js +17 -0
- package/lib/services/aiGen/providers/pixabay/pixabay.service.d.ts +12 -0
- package/lib/services/aiGen/providers/pixabay/pixabay.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/pixabay/pixabay.service.js +156 -0
- package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/pixverse/pixverse.service.js +125 -2
- package/lib/services/aiGen/providers/runway/cameraAdapter.d.ts +3 -0
- package/lib/services/aiGen/providers/runway/cameraAdapter.d.ts.map +1 -0
- package/lib/services/aiGen/providers/runway/cameraAdapter.js +46 -0
- package/lib/services/aiGen/providers/runway/runway.service.d.ts +12 -2
- package/lib/services/aiGen/providers/runway/runway.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/runway/runway.service.js +224 -21
- package/lib/services/aiGen/providers/types.d.ts +263 -6
- package/lib/services/aiGen/providers/types.d.ts.map +1 -1
- package/lib/services/aiGen/providers/unsplash/index.d.ts +2 -0
- package/lib/services/aiGen/providers/unsplash/index.d.ts.map +1 -0
- package/lib/services/aiGen/providers/unsplash/index.js +17 -0
- package/lib/services/aiGen/providers/unsplash/unsplash.service.d.ts +16 -0
- package/lib/services/aiGen/providers/unsplash/unsplash.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/unsplash/unsplash.service.js +131 -0
- package/lib/services/analytics.service.js +2 -4
- package/lib/services/apiUsageCounter.service.d.ts +20 -0
- package/lib/services/apiUsageCounter.service.d.ts.map +1 -0
- package/lib/services/apiUsageCounter.service.js +84 -0
- package/lib/services/asr/assemblyai.service.d.ts +72 -0
- package/lib/services/asr/assemblyai.service.d.ts.map +1 -0
- package/lib/services/asr/assemblyai.service.js +89 -0
- package/lib/services/asr/index.d.ts +3 -0
- package/lib/services/asr/index.d.ts.map +1 -0
- package/lib/services/asr/index.js +18 -0
- package/lib/services/asr/whisper.service.d.ts +18 -0
- package/lib/services/asr/whisper.service.d.ts.map +1 -0
- package/lib/services/asr/whisper.service.js +151 -0
- package/lib/services/assetCache.service.d.ts +54 -0
- package/lib/services/assetCache.service.d.ts.map +1 -0
- package/lib/services/assetCache.service.js +109 -0
- package/lib/services/audioAnalysis/index.d.ts +2 -0
- package/lib/services/audioAnalysis/index.d.ts.map +1 -0
- package/lib/services/audioAnalysis/index.js +17 -0
- package/lib/services/audioAnalysis/onsetDetection.service.d.ts +50 -0
- package/lib/services/audioAnalysis/onsetDetection.service.d.ts.map +1 -0
- package/lib/services/audioAnalysis/onsetDetection.service.js +140 -0
- package/lib/services/bullmq.service.d.ts +6 -1
- package/lib/services/bullmq.service.d.ts.map +1 -1
- package/lib/services/bullmq.service.js +62 -14
- package/lib/services/credit.service.d.ts.map +1 -1
- package/lib/services/credit.service.js +45 -7
- package/lib/services/credits/pricing.d.ts +58 -0
- package/lib/services/credits/pricing.d.ts.map +1 -0
- package/lib/services/credits/pricing.js +111 -0
- package/lib/services/editor/designToProject.d.ts +75 -0
- package/lib/services/editor/designToProject.d.ts.map +1 -0
- package/lib/services/editor/designToProject.js +295 -0
- package/lib/services/editor/planToProject.d.ts +84 -0
- package/lib/services/editor/planToProject.d.ts.map +1 -0
- package/lib/services/editor/planToProject.js +395 -0
- package/lib/services/editor/projectToDesign.d.ts +4 -0
- package/lib/services/editor/projectToDesign.d.ts.map +1 -0
- package/lib/services/editor/projectToDesign.js +186 -0
- package/lib/services/firestore.service.d.ts +17 -0
- package/lib/services/firestore.service.d.ts.map +1 -1
- package/lib/services/firestore.service.js +30 -0
- package/lib/services/gcp/index.d.ts +1 -0
- package/lib/services/gcp/index.d.ts.map +1 -1
- package/lib/services/gcp/index.js +1 -0
- package/lib/services/gcp/uploadAudioBuffer.d.ts +13 -0
- package/lib/services/gcp/uploadAudioBuffer.d.ts.map +1 -0
- package/lib/services/gcp/uploadAudioBuffer.js +28 -0
- package/lib/services/index.d.ts +13 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +13 -0
- package/lib/services/musicGen/index.d.ts +6 -0
- package/lib/services/musicGen/index.d.ts.map +1 -0
- package/lib/services/musicGen/index.js +26 -0
- package/lib/services/musicGen/musicSearchFactory.service.d.ts +14 -0
- package/lib/services/musicGen/musicSearchFactory.service.d.ts.map +1 -0
- package/lib/services/musicGen/musicSearchFactory.service.js +59 -0
- package/lib/services/musicGen/providers/curated.service.d.ts +24 -0
- package/lib/services/musicGen/providers/curated.service.d.ts.map +1 -0
- package/lib/services/musicGen/providers/curated.service.js +173 -0
- package/lib/services/musicGen/providers/jamendo.service.d.ts +8 -0
- package/lib/services/musicGen/providers/jamendo.service.d.ts.map +1 -0
- package/lib/services/musicGen/providers/jamendo.service.js +113 -0
- package/lib/services/musicGen/providers/mubert.service.d.ts +10 -0
- package/lib/services/musicGen/providers/mubert.service.d.ts.map +1 -0
- package/lib/services/musicGen/providers/mubert.service.js +128 -0
- package/lib/services/musicGen/types.d.ts +46 -0
- package/lib/services/musicGen/types.d.ts.map +1 -0
- package/lib/services/musicGen/types.js +10 -0
- package/lib/services/notification.service.d.ts +22 -0
- package/lib/services/notification.service.d.ts.map +1 -0
- package/lib/services/notification.service.js +76 -0
- package/lib/services/rateLimiter/distributedRateLimiter.service.d.ts +78 -0
- package/lib/services/rateLimiter/distributedRateLimiter.service.d.ts.map +1 -0
- package/lib/services/rateLimiter/distributedRateLimiter.service.js +269 -0
- package/lib/services/rateLimiter/index.d.ts +2 -0
- package/lib/services/rateLimiter/index.d.ts.map +1 -0
- package/lib/services/rateLimiter/index.js +17 -0
- package/lib/services/redis.service.d.ts +9 -0
- package/lib/services/redis.service.d.ts.map +1 -1
- package/lib/services/redis.service.js +20 -11
- package/lib/services/redisOptions.d.ts +22 -0
- package/lib/services/redisOptions.d.ts.map +1 -0
- package/lib/services/redisOptions.js +51 -0
- package/lib/services/tts/index.d.ts +2 -0
- package/lib/services/tts/index.d.ts.map +1 -1
- package/lib/services/tts/index.js +2 -0
- package/lib/services/tts/providers/elevenlabs.service.d.ts.map +1 -1
- package/lib/services/tts/providers/elevenlabs.service.js +91 -24
- package/lib/services/tts/providers/minimax.service.d.ts +14 -0
- package/lib/services/tts/providers/minimax.service.d.ts.map +1 -0
- package/lib/services/tts/providers/minimax.service.js +78 -0
- package/lib/services/tts/providers/openai.service.d.ts +14 -0
- package/lib/services/tts/providers/openai.service.d.ts.map +1 -0
- package/lib/services/tts/providers/openai.service.js +73 -0
- package/lib/services/tts/ttsFactory.service.d.ts.map +1 -1
- package/lib/services/tts/ttsFactory.service.js +6 -0
- package/lib/services/tts/types.d.ts +33 -0
- package/lib/services/tts/types.d.ts.map +1 -1
- package/lib/utils/errors.d.ts +8 -0
- package/lib/utils/errors.d.ts.map +1 -1
- package/lib/utils/errors.js +8 -0
- package/lib/utils/helpers.d.ts +13 -0
- package/lib/utils/helpers.d.ts.map +1 -1
- package/lib/utils/helpers.js +48 -11
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +37 -1
- package/package.json +5 -1
- package/lib/services/aiGen/providers/azure/azure.service.d.ts +0 -14
- package/lib/services/aiGen/providers/azure/azure.service.d.ts.map +0 -1
- package/lib/services/aiGen/providers/azure/azure.service.js +0 -108
- package/lib/services/aiGen/providers/azure/index.d.ts +0 -2
- package/lib/services/aiGen/providers/azure/index.d.ts.map +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isStyleLeakText = isStyleLeakText;
|
|
4
|
+
exports.checkOverlayContentSanity = checkOverlayContentSanity;
|
|
5
|
+
/**
|
|
6
|
+
* Overlay-content sanity. The planner sometimes leaks the prompt's typography
|
|
7
|
+
* instructions into overlay.text — emitting strings like "Bold white sans-serif
|
|
8
|
+
* subtitle text with a soft drop-shadow, centered in the lower third of a 9:16
|
|
9
|
+
* frame" as the literal on-screen text. The renderer then burns that styling
|
|
10
|
+
* description onto the screen instead of the intended copy.
|
|
11
|
+
*
|
|
12
|
+
* This validator rejects overlays whose text reads like a typography / layout /
|
|
13
|
+
* color directive rather than actual copy. Detection is conservative: each
|
|
14
|
+
* single signal alone (e.g. the word "bold") is fine ("Bold moves win"), but
|
|
15
|
+
* combining a font/weight token with a position or color token in the same
|
|
16
|
+
* string is a near-certain leak.
|
|
17
|
+
*/
|
|
18
|
+
const FONT_WEIGHT_PATTERN = /\b(sans-?serif|serif|monospace|font-?(?:family|weight|size)|typeface|italics?|regular weight|bold(?:face)?|semi-?bold|extra-?bold|light weight|medium weight|heavy weight)\b/i;
|
|
19
|
+
const POSITION_PATTERN = /\b(lower\s+third|upper\s+third|centered\s+(?:horizontally|vertically)|9\s*[:x/]\s*16(?:\s+(?:frame|aspect|ratio))?|16\s*[:x/]\s*9(?:\s+(?:frame|aspect|ratio))?|top-aligned|bottom-aligned|left-aligned|right-aligned|center-aligned|safe area)\b/i;
|
|
20
|
+
const COLOR_PATTERN = /\b(white|black|gray|grey|red|blue|green|yellow|orange|purple|magenta|cyan|drop[- ]shadow|stroke|outline|#[0-9a-f]{3,8})\b/i;
|
|
21
|
+
const TEXT_NOUN_PATTERN = /\b(text|font|caption|subtitle|overlay|copy|type|glyph|letters?)\b/i;
|
|
22
|
+
function isStyleLeakText(text) {
|
|
23
|
+
const reasons = [];
|
|
24
|
+
const hasFontWeight = FONT_WEIGHT_PATTERN.test(text);
|
|
25
|
+
const hasPosition = POSITION_PATTERN.test(text);
|
|
26
|
+
const hasColor = COLOR_PATTERN.test(text);
|
|
27
|
+
const hasTextNoun = TEXT_NOUN_PATTERN.test(text);
|
|
28
|
+
// Position phrases (e.g. "lower third", "9:16 frame") are essentially never
|
|
29
|
+
// valid on-screen copy — flag on their own.
|
|
30
|
+
if (hasPosition)
|
|
31
|
+
reasons.push("technical position/aspect phrase");
|
|
32
|
+
// Font-family/weight + a text noun = the model is describing typography of
|
|
33
|
+
// the overlay rather than writing copy. ("Bold moves win" → no text noun,
|
|
34
|
+
// passes. "Bold sans-serif text" → font + text noun, fails.)
|
|
35
|
+
if (hasFontWeight && hasTextNoun)
|
|
36
|
+
reasons.push("font-family/weight + text noun");
|
|
37
|
+
// Color + text/font in the same string = describing how the text looks.
|
|
38
|
+
if (hasColor && hasTextNoun)
|
|
39
|
+
reasons.push("color + text/font noun");
|
|
40
|
+
return { leak: reasons.length > 0, reasons };
|
|
41
|
+
}
|
|
42
|
+
function checkOverlayContentSanity(plan) {
|
|
43
|
+
const offenders = [];
|
|
44
|
+
for (const s of plan.scenes) {
|
|
45
|
+
if (!s.overlays?.length)
|
|
46
|
+
continue;
|
|
47
|
+
for (const o of s.overlays) {
|
|
48
|
+
const text = (o.text ?? "").trim();
|
|
49
|
+
if (!text)
|
|
50
|
+
continue;
|
|
51
|
+
const { leak, reasons } = isStyleLeakText(text);
|
|
52
|
+
if (leak) {
|
|
53
|
+
offenders.push({
|
|
54
|
+
sceneIndex: s.sceneIndex,
|
|
55
|
+
role: o.role,
|
|
56
|
+
text,
|
|
57
|
+
reasons,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (offenders.length === 0)
|
|
63
|
+
return null;
|
|
64
|
+
const roleHint = (role) => {
|
|
65
|
+
switch (role) {
|
|
66
|
+
case "headline":
|
|
67
|
+
return "max 6 words, the hook phrase";
|
|
68
|
+
case "subheadline":
|
|
69
|
+
return "max 8 words, the supporting phrase";
|
|
70
|
+
case "body":
|
|
71
|
+
return "a 6-12 word supporting line";
|
|
72
|
+
case "cta":
|
|
73
|
+
return "max 5 words combining brand + verb (e.g. 'Get HydraPure Today')";
|
|
74
|
+
case "watermark":
|
|
75
|
+
return "max 2 words, just the brand name";
|
|
76
|
+
case "disclaimer":
|
|
77
|
+
return "tiny legal copy";
|
|
78
|
+
case "label":
|
|
79
|
+
return "max 3 words naming the in-frame object/person";
|
|
80
|
+
default:
|
|
81
|
+
return "actual on-screen copy";
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const messages = offenders.map((o) => `Overlay text for scene ${o.sceneIndex} role=${o.role} is a styling description, not actual on-screen content (matched: ${o.reasons.join("; ")}). The text field is what users will read; styling is applied automatically. Replace with the actual short phrase (for role=${o.role}: ${roleHint(o.role)}). NEVER describe fonts/colors/positions in the text field. Offending value: ${JSON.stringify(o.text)}`);
|
|
85
|
+
return messages.join("\n");
|
|
86
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VideoBrief } from "../../../schemas/brief.schema";
|
|
2
|
+
import { AgentVisualBible } from "../../../schemas/videoPlan.schema";
|
|
3
|
+
import { IBrandKitModel, IStyleMemoryModel } from "../../../models/agent.model";
|
|
4
|
+
export declare function briefMentionsBrandText(brief: VideoBrief): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Render the per-brief video-strategy bias into a planner-readable rule.
|
|
7
|
+
* "indirect" is the new default — ai-image-to-video is usually cheaper AND
|
|
8
|
+
* higher quality than ai-text-to-video because we can iterate on the image
|
|
9
|
+
* cheap (~$0.03/re-roll) and let the I2V model preserve that composition.
|
|
10
|
+
* "direct" is the escape hatch for shots that genuinely need T2V (continuous
|
|
11
|
+
* camera motion an image can't seed). "auto" keeps the legacy free-choice.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildVideoStrategySection(strategy: "direct" | "indirect" | "auto" | undefined): string;
|
|
14
|
+
export declare function buildModelCatalogSection(): string;
|
|
15
|
+
export declare function buildBrandKitSection(brandKit: IBrandKitModel | null): string;
|
|
16
|
+
/**
|
|
17
|
+
* AG-12 — render the Visual Bible into the planner system prompt. When a
|
|
18
|
+
* bible is present, the planner MUST tag scene.bibleEntityIds with the ids
|
|
19
|
+
* of any entity appearing in the scene AND re-state each tagged entity's
|
|
20
|
+
* verbatim description in scene.prompt. This is what keeps the SAME character
|
|
21
|
+
* looking like the same character across cuts.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildBibleSection(bible: AgentVisualBible | null): string;
|
|
24
|
+
export declare function buildStyleMemorySection(memory: IStyleMemoryModel | null): string;
|
|
25
|
+
//# sourceMappingURL=promptSections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptSections.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/planner/promptSections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAQhF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAGjE;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GACnD,MAAM,CAkCR;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAWjD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,MAAM,CAgC5E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,MAAM,CAqCxE;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAsBhF"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.briefMentionsBrandText = briefMentionsBrandText;
|
|
4
|
+
exports.buildVideoStrategySection = buildVideoStrategySection;
|
|
5
|
+
exports.buildModelCatalogSection = buildModelCatalogSection;
|
|
6
|
+
exports.buildBrandKitSection = buildBrandKitSection;
|
|
7
|
+
exports.buildBibleSection = buildBibleSection;
|
|
8
|
+
exports.buildStyleMemorySection = buildStyleMemorySection;
|
|
9
|
+
const tierHelpers_1 = require("../../../globals/aiModels/tierHelpers");
|
|
10
|
+
// AG-39: heuristic — does the brief signal that the planner should care
|
|
11
|
+
// about on-screen brand text (so scenes get steered away from models
|
|
12
|
+
// known to mangle text)? Looks at brief.brandName, brief.productName,
|
|
13
|
+
// and any string field that mentions "label", "logo", "brand", "CTA",
|
|
14
|
+
// "watermark", or "product name".
|
|
15
|
+
function briefMentionsBrandText(brief) {
|
|
16
|
+
const blob = JSON.stringify(brief).toLowerCase();
|
|
17
|
+
return /(brand\s*name|product\s*name|brand\s*kit|logo|label|watermark|cta|on[- ]screen text|on[- ]product text)/.test(blob);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Render the per-brief video-strategy bias into a planner-readable rule.
|
|
21
|
+
* "indirect" is the new default — ai-image-to-video is usually cheaper AND
|
|
22
|
+
* higher quality than ai-text-to-video because we can iterate on the image
|
|
23
|
+
* cheap (~$0.03/re-roll) and let the I2V model preserve that composition.
|
|
24
|
+
* "direct" is the escape hatch for shots that genuinely need T2V (continuous
|
|
25
|
+
* camera motion an image can't seed). "auto" keeps the legacy free-choice.
|
|
26
|
+
*/
|
|
27
|
+
function buildVideoStrategySection(strategy) {
|
|
28
|
+
switch (strategy) {
|
|
29
|
+
case "direct":
|
|
30
|
+
return [
|
|
31
|
+
"Video-strategy bias: DIRECT (text-to-video).",
|
|
32
|
+
" - Default video scenes to strategy=ai-text-to-video (T3).",
|
|
33
|
+
" - Use ai-image-to-video (T2) only when the chosen T2V model lacks the",
|
|
34
|
+
" capability needed (e.g. an aspect ratio it doesn't support).",
|
|
35
|
+
].join("\n");
|
|
36
|
+
case "auto":
|
|
37
|
+
return [
|
|
38
|
+
"Video-strategy bias: AUTO.",
|
|
39
|
+
" - Pick ai-text-to-video vs ai-image-to-video per scene based on cost,",
|
|
40
|
+
" quality, and motion needs — no enforced default.",
|
|
41
|
+
].join("\n");
|
|
42
|
+
case "indirect":
|
|
43
|
+
default:
|
|
44
|
+
return [
|
|
45
|
+
"Video-strategy bias: INDIRECT (image-to-video) — DEFAULT.",
|
|
46
|
+
" - Default every video scene to strategy=ai-image-to-video (T2).",
|
|
47
|
+
" Generate a still first, then animate it. Cheaper AND usually higher",
|
|
48
|
+
" quality than direct text-to-video because:",
|
|
49
|
+
" (a) iteration is ~$0.03 per re-rolled image vs ~$0.65 per re-rolled",
|
|
50
|
+
" text-to-video clip, so we can vet composition before paying for",
|
|
51
|
+
" motion.",
|
|
52
|
+
" (b) image-to-video models preserve identity / framing / brand subject",
|
|
53
|
+
" we already approved, instead of letting a text-to-video model",
|
|
54
|
+
" drift mid-shot.",
|
|
55
|
+
" - Use ai-text-to-video (T3) ONLY when the scene demands camera motion",
|
|
56
|
+
" a static image can't seed — continuous orbit / parallax dolly /",
|
|
57
|
+
" dynamic crowd action / something the I2V model can't synthesise from",
|
|
58
|
+
" one keyframe. Flag this in scene.intent so reviewers know why.",
|
|
59
|
+
].join("\n");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function buildModelCatalogSection() {
|
|
63
|
+
// Today the agent ships text-to-video and image-to-video providers; both
|
|
64
|
+
// share the same per-tier shape, and t2v is the most common executor path.
|
|
65
|
+
// Image-gen models live under a separate tool (generate_image) so they
|
|
66
|
+
// don't belong in this catalog.
|
|
67
|
+
const t2v = (0, tierHelpers_1.summarizeModelsForPlanner)("text-to-video");
|
|
68
|
+
const i2v = (0, tierHelpers_1.summarizeModelsForPlanner)("image-to-video");
|
|
69
|
+
const sections = [];
|
|
70
|
+
if (t2v)
|
|
71
|
+
sections.push("", "Text-to-video models by tier (cheapest first):", t2v);
|
|
72
|
+
if (i2v)
|
|
73
|
+
sections.push("", "Image-to-video models by tier (cheapest first):", i2v);
|
|
74
|
+
return sections.join("\n");
|
|
75
|
+
}
|
|
76
|
+
function buildBrandKitSection(brandKit) {
|
|
77
|
+
if (!brandKit)
|
|
78
|
+
return "";
|
|
79
|
+
const lines = [];
|
|
80
|
+
if (brandKit.brandName)
|
|
81
|
+
lines.push(` Brand: ${brandKit.brandName}`);
|
|
82
|
+
if (brandKit.primaryColorHex || brandKit.secondaryColorHex) {
|
|
83
|
+
const palette = [brandKit.primaryColorHex, brandKit.secondaryColorHex]
|
|
84
|
+
.filter(Boolean)
|
|
85
|
+
.join(" / ");
|
|
86
|
+
lines.push(` Palette: ${palette}`);
|
|
87
|
+
}
|
|
88
|
+
if (brandKit.fontFamily)
|
|
89
|
+
lines.push(` Font: ${brandKit.fontFamily}`);
|
|
90
|
+
if (brandKit.voiceId)
|
|
91
|
+
lines.push(` Preferred TTS voice id: ${brandKit.voiceId}`);
|
|
92
|
+
if (brandKit.presenterFaceUrl) {
|
|
93
|
+
lines.push(` Presenter face URL (use as scene.avatarFaceUrl on talking-head-avatar scenes): ${brandKit.presenterFaceUrl}`);
|
|
94
|
+
}
|
|
95
|
+
if (brandKit.musicMoods?.length) {
|
|
96
|
+
lines.push(` Music moods: ${brandKit.musicMoods.join(", ")}`);
|
|
97
|
+
}
|
|
98
|
+
if (brandKit.preferredClaims?.length) {
|
|
99
|
+
lines.push(` Preferred phrasing: ${brandKit.preferredClaims.join("; ")}`);
|
|
100
|
+
}
|
|
101
|
+
if (brandKit.bannedClaims?.length) {
|
|
102
|
+
lines.push(` NEVER produce these phrases: ${brandKit.bannedClaims.join("; ")}`);
|
|
103
|
+
}
|
|
104
|
+
if (!lines.length)
|
|
105
|
+
return "";
|
|
106
|
+
return [
|
|
107
|
+
"",
|
|
108
|
+
"Brand kit (set once by the user — apply on every scene):",
|
|
109
|
+
...lines,
|
|
110
|
+
].join("\n");
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* AG-12 — render the Visual Bible into the planner system prompt. When a
|
|
114
|
+
* bible is present, the planner MUST tag scene.bibleEntityIds with the ids
|
|
115
|
+
* of any entity appearing in the scene AND re-state each tagged entity's
|
|
116
|
+
* verbatim description in scene.prompt. This is what keeps the SAME character
|
|
117
|
+
* looking like the same character across cuts.
|
|
118
|
+
*/
|
|
119
|
+
function buildBibleSection(bible) {
|
|
120
|
+
if (!bible)
|
|
121
|
+
return "";
|
|
122
|
+
const characters = bible.characters ?? [];
|
|
123
|
+
const objects = bible.objects ?? [];
|
|
124
|
+
const environments = bible.environments ?? [];
|
|
125
|
+
if (!characters.length && !objects.length && !environments.length)
|
|
126
|
+
return "";
|
|
127
|
+
const formatEntity = (e) => ` ${e.id} — ${e.name}: ${e.description}`;
|
|
128
|
+
const lines = [
|
|
129
|
+
"",
|
|
130
|
+
`Visual Bible (consistency tier ${bible.consistencyTier}) — recurring entities you MUST keep visually constant across scenes:`,
|
|
131
|
+
];
|
|
132
|
+
if (characters.length) {
|
|
133
|
+
lines.push(" Characters:");
|
|
134
|
+
characters.forEach((c) => lines.push(formatEntity(c)));
|
|
135
|
+
}
|
|
136
|
+
if (objects.length) {
|
|
137
|
+
lines.push(" Objects:");
|
|
138
|
+
objects.forEach((o) => lines.push(formatEntity(o)));
|
|
139
|
+
}
|
|
140
|
+
if (environments.length) {
|
|
141
|
+
lines.push(" Environments:");
|
|
142
|
+
environments.forEach((e) => lines.push(formatEntity(e)));
|
|
143
|
+
}
|
|
144
|
+
lines.push("", "Bible usage contract (hard rule):", " - For every scene, set scene.bibleEntityIds to the list of entity ids that appear in that scene (e.g. [\"CHAR_1\", \"OBJ_1\"]).", " - For every entity in scene.bibleEntityIds, re-state its description verbatim in scene.prompt. Do NOT paraphrase — copy the exact words from the bible. Different scenes referencing the same entity must use IDENTICAL description text.", " - characterAnchorSceneIndex (AG-11) is still useful as a backup signal but the bible is primary. If both are set, both should agree.", bible.consistencyTier === "C2"
|
|
145
|
+
? " - C2 note: entities will additionally get pre-rendered reference images (executor threads them as inputImageUrls on image-gen calls). Your descriptions seed those reference images, so be visually specific."
|
|
146
|
+
: " - C1 note: descriptions are the ONLY consistency signal — no reference images. Be as visually specific as possible.");
|
|
147
|
+
return lines.join("\n");
|
|
148
|
+
}
|
|
149
|
+
function buildStyleMemorySection(memory) {
|
|
150
|
+
if (!memory)
|
|
151
|
+
return "";
|
|
152
|
+
const accepted = (memory.acceptedScenes ?? []).slice(-3);
|
|
153
|
+
const rejected = (memory.rejectedScenes ?? []).slice(-3);
|
|
154
|
+
if (!accepted.length && !rejected.length)
|
|
155
|
+
return "";
|
|
156
|
+
const fmt = (entry) => {
|
|
157
|
+
try {
|
|
158
|
+
return JSON.stringify(entry.scene);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
return "[unserializable scene]";
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const sections = ["", "Style memory (recent decisions by this user):"];
|
|
165
|
+
if (accepted.length) {
|
|
166
|
+
sections.push(" Bias toward shapes like these (accepted):");
|
|
167
|
+
accepted.forEach((s) => sections.push(` - ${fmt(s)}`));
|
|
168
|
+
}
|
|
169
|
+
if (rejected.length) {
|
|
170
|
+
sections.push(" Avoid shapes like these (rejected):");
|
|
171
|
+
rejected.forEach((s) => sections.push(` - ${fmt(s)}`));
|
|
172
|
+
}
|
|
173
|
+
return sections.join("\n");
|
|
174
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VideoPlan } from "../../../schemas/videoPlan.schema";
|
|
2
|
+
/**
|
|
3
|
+
* AG-33: mechanical preferredModel auto-correct. If a scene picks a model that
|
|
4
|
+
* structurally cannot serve its duration, swap to the cheapest model in the
|
|
5
|
+
* same tier whose allowed-durations list includes the scene's duration. Runs
|
|
6
|
+
* BEFORE checkSceneDurationCapability so the validator only fires for genuinely
|
|
7
|
+
* unfixable cases. Test 1 hit a 3-retry crash because the planner kept picking
|
|
8
|
+
* runway-gen4-turbo (5/8/10s only) for 2s scenes despite the system prompt
|
|
9
|
+
* + retry directive — auto-correct cuts that loop short.
|
|
10
|
+
*
|
|
11
|
+
* Selection order for a sub-5s scene: bytedance-seedance-1.0-pro-fast (T2,
|
|
12
|
+
* 2-12s, cheap) → bytedance-seedance-1.0-pro (T2) → runway-gen4.5 (T3, 2-10s)
|
|
13
|
+
* → kling-v3.0 (T3, 3-15s). Returns the count of swaps so the trace can log.
|
|
14
|
+
*/
|
|
15
|
+
export declare function autoCorrectPreferredModels(plan: VideoPlan): number;
|
|
16
|
+
//# sourceMappingURL=repair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repair.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/planner/repair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAG9D;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CA6BlE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.autoCorrectPreferredModels = autoCorrectPreferredModels;
|
|
4
|
+
const tierHelpers_1 = require("../../../globals/aiModels/tierHelpers");
|
|
5
|
+
/**
|
|
6
|
+
* AG-33: mechanical preferredModel auto-correct. If a scene picks a model that
|
|
7
|
+
* structurally cannot serve its duration, swap to the cheapest model in the
|
|
8
|
+
* same tier whose allowed-durations list includes the scene's duration. Runs
|
|
9
|
+
* BEFORE checkSceneDurationCapability so the validator only fires for genuinely
|
|
10
|
+
* unfixable cases. Test 1 hit a 3-retry crash because the planner kept picking
|
|
11
|
+
* runway-gen4-turbo (5/8/10s only) for 2s scenes despite the system prompt
|
|
12
|
+
* + retry directive — auto-correct cuts that loop short.
|
|
13
|
+
*
|
|
14
|
+
* Selection order for a sub-5s scene: bytedance-seedance-1.0-pro-fast (T2,
|
|
15
|
+
* 2-12s, cheap) → bytedance-seedance-1.0-pro (T2) → runway-gen4.5 (T3, 2-10s)
|
|
16
|
+
* → kling-v3.0 (T3, 3-15s). Returns the count of swaps so the trace can log.
|
|
17
|
+
*/
|
|
18
|
+
function autoCorrectPreferredModels(plan) {
|
|
19
|
+
// Short-duration capable models in priority order (cheap+fast first).
|
|
20
|
+
const SHORT_DURATION_FALLBACKS = [
|
|
21
|
+
"bytedance-seedance-1.0-pro-fast",
|
|
22
|
+
"bytedance-seedance-1.0-pro",
|
|
23
|
+
"runway-gen4.5",
|
|
24
|
+
"kling-v3.0",
|
|
25
|
+
];
|
|
26
|
+
const aiVideoStrategies = new Set(["ai-image-to-video", "ai-text-to-video"]);
|
|
27
|
+
let swaps = 0;
|
|
28
|
+
for (const s of plan.scenes) {
|
|
29
|
+
if (!aiVideoStrategies.has(s.strategy))
|
|
30
|
+
continue;
|
|
31
|
+
if (!s.preferredModel)
|
|
32
|
+
continue;
|
|
33
|
+
const allowed = (0, tierHelpers_1.getModelAllowedDurations)(s.preferredModel);
|
|
34
|
+
if (!allowed)
|
|
35
|
+
continue;
|
|
36
|
+
const seconds = s.durationMs / 1000;
|
|
37
|
+
const matches = allowed.some((v) => Math.abs(v - seconds) < 0.25);
|
|
38
|
+
if (matches)
|
|
39
|
+
continue;
|
|
40
|
+
// Find the first fallback whose allowed durations include `seconds`.
|
|
41
|
+
const swapTo = SHORT_DURATION_FALLBACKS.find((m) => {
|
|
42
|
+
const a = (0, tierHelpers_1.getModelAllowedDurations)(m);
|
|
43
|
+
return a?.some((v) => Math.abs(v - seconds) < 0.25);
|
|
44
|
+
});
|
|
45
|
+
if (swapTo) {
|
|
46
|
+
s.preferredModel = swapTo;
|
|
47
|
+
swaps++;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return swaps;
|
|
51
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VideoBrief } from "../../../schemas/brief.schema";
|
|
2
|
+
/**
|
|
3
|
+
* Strict structural rules surfaced by Phase 1 dry-run (AG-8/9/10). These three
|
|
4
|
+
* gaps consistently capped UGC eval scores at 0.887 — pacing ignored, duration
|
|
5
|
+
* under-delivered, CTA caption order wrong. Spelled out as hard contracts in
|
|
6
|
+
* the planner prompt rather than soft hints, plus AG-9 also has a post-plan
|
|
7
|
+
* validator (checkDurationContract) so the planner can't silently miss it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildStructuralRulesSection(brief: VideoBrief): string;
|
|
10
|
+
//# sourceMappingURL=structuralRules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structuralRules.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/planner/structuralRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAkJrE"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildStructuralRulesSection = buildStructuralRulesSection;
|
|
4
|
+
/**
|
|
5
|
+
* Strict structural rules surfaced by Phase 1 dry-run (AG-8/9/10). These three
|
|
6
|
+
* gaps consistently capped UGC eval scores at 0.887 — pacing ignored, duration
|
|
7
|
+
* under-delivered, CTA caption order wrong. Spelled out as hard contracts in
|
|
8
|
+
* the planner prompt rather than soft hints, plus AG-9 also has a post-plan
|
|
9
|
+
* validator (checkDurationContract) so the planner can't silently miss it.
|
|
10
|
+
*/
|
|
11
|
+
function buildStructuralRulesSection(brief) {
|
|
12
|
+
const lines = ["", "Strict structural rules (hard contracts):"];
|
|
13
|
+
const targetMs = brief.durationSec ? Math.round(brief.durationSec * 1000) : null;
|
|
14
|
+
if (targetMs) {
|
|
15
|
+
const minMs = Math.round(targetMs * 0.95);
|
|
16
|
+
const maxMs = Math.round(targetMs * 1.05);
|
|
17
|
+
lines.push(` - Duration: sum of scene.durationMs MUST be within [${minMs}, ${maxMs}] ms (target ${targetMs} ms, ±5%). If short, add a B-roll scene or extend filler scenes — do NOT under-deliver on the brief's requested duration.`);
|
|
18
|
+
}
|
|
19
|
+
// Pacing → per-scene duration band. ALL pacing modes get an explicit band
|
|
20
|
+
// (not just fast-cut), because without one the planner defaults to its own
|
|
21
|
+
// bias and ships 15×2s scenes for a 30s "medium pacing / informational"
|
|
22
|
+
// brief. The band is derived from pacing, then clamped against the 2000ms
|
|
23
|
+
// provider floor. Scene count is derived from totalDurationMs / avg band.
|
|
24
|
+
//
|
|
25
|
+
// very-fast → 2.0-3.0s (TikTok / Reels listicle, beat-cut energy)
|
|
26
|
+
// fast → 3.0-4.0s (UGC ad, social recap)
|
|
27
|
+
// medium → 4.0-6.0s (narration-driven explainers, faceless-YT)
|
|
28
|
+
// slow → 6.0-10.0s (cinematic / ambient)
|
|
29
|
+
//
|
|
30
|
+
// Hook (sceneIndex 0) may run up to the upper band of the next-faster mode
|
|
31
|
+
// to set up the problem statement. Provider floor 2000ms always wins.
|
|
32
|
+
const PACING_BANDS_MS = {
|
|
33
|
+
"very-fast": { minMs: 2000, maxMs: 3000 },
|
|
34
|
+
fast: { minMs: 3000, maxMs: 4000 },
|
|
35
|
+
medium: { minMs: 4000, maxMs: 6000 },
|
|
36
|
+
slow: { minMs: 6000, maxMs: 10000 },
|
|
37
|
+
};
|
|
38
|
+
// faceless-yt removed from fastCutNiches: it covers calm educational
|
|
39
|
+
// explainers (1-2 sentences per cut on 4-6s scenes) as often as listicles.
|
|
40
|
+
// Brief.pacing="fast"/"very-fast" is the listicle signal now.
|
|
41
|
+
const fastCutNiches = ["ugc-ad", "social-recap", "fitness"];
|
|
42
|
+
const effectivePacing = brief.pacing ??
|
|
43
|
+
((brief.niche && fastCutNiches.includes(brief.niche)) ? "fast" : "medium");
|
|
44
|
+
const band = PACING_BANDS_MS[effectivePacing];
|
|
45
|
+
const minMsScene = Math.max(band.minMs, 2000); // provider floor wins
|
|
46
|
+
const maxMsScene = Math.max(band.maxMs, minMsScene);
|
|
47
|
+
// Hook gets a little extra headroom (one band step faster) so the opener
|
|
48
|
+
// can set up the topic without forcing the rest of the video to match.
|
|
49
|
+
const hookMaxMs = Math.max(maxMsScene, 3000);
|
|
50
|
+
const flooredNote = minMsScene > band.minMs
|
|
51
|
+
? ` (provider floor 2000ms overrides pacing min ${band.minMs}ms — no model accepts sub-2s clips)`
|
|
52
|
+
: "";
|
|
53
|
+
lines.push(` - Pacing: brief.pacing="${effectivePacing}" → per-scene durationMs in [${minMsScene}, ${maxMsScene}]${flooredNote}. The hook (sceneIndex 0) may run up to ${hookMaxMs}ms.`);
|
|
54
|
+
if (targetMs) {
|
|
55
|
+
// Derive scene count from target duration / avg band (round to nearest).
|
|
56
|
+
const avgMs = Math.round((minMsScene + maxMsScene) / 2);
|
|
57
|
+
const idealCount = Math.max(1, Math.round(targetMs / avgMs));
|
|
58
|
+
const minCount = Math.max(1, Math.floor(targetMs / maxMsScene));
|
|
59
|
+
const maxCount = Math.max(minCount, Math.floor(targetMs / minMsScene));
|
|
60
|
+
lines.push(` - Scene count: with target ${targetMs}ms and per-scene band [${minMsScene}, ${maxMsScene}]ms, plan ${minCount}-${maxCount} scenes (target ~${idealCount} scenes of ~${avgMs}ms each). For pacing="${effectivePacing}" do NOT ship more than ${maxCount} scenes — telegraphic micro-cuts are the wrong feel. Pick scene durations from the preferredModel's allowed-durations list (e.g. seedance-1.0-pro-fast supports any integer 2-12s; pixverse supports [5,8,10]).`);
|
|
61
|
+
}
|
|
62
|
+
// AG-15: provider duration capability. Every AI-video scene's durationMs/1000
|
|
63
|
+
// MUST be in the picked model's allowed durations. Hard floor: 2s — no model
|
|
64
|
+
// in the catalog accepts sub-2s clips. If pacing wants tighter cuts, REDUCE
|
|
65
|
+
// scene count (combine two micro-cuts into one ≥2s clip) rather than
|
|
66
|
+
// shipping a scene the executor can't render. Short-duration capable models:
|
|
67
|
+
// • 2s floor: bytedance-seedance-1.0-pro / -pro-fast (T2), runway-gen4.5 (T3)
|
|
68
|
+
// • 3s floor: kling-v3.0 (T3)
|
|
69
|
+
// • 4s floor: google-veo-3.1 / -fast / -lite, bytedance-seedance-1.5-pro,
|
|
70
|
+
// bytedance-seedance-2.0 / -2.0-fast
|
|
71
|
+
// • 5s floor: kling 2.x family, pixverse all, alibaba-wan, runway-gen4-turbo
|
|
72
|
+
// • 6s floor: minimax-hailuo-02 / 2.3 / 2.3-fast ← do NOT pick for <6s scenes.
|
|
73
|
+
// The catalog above lists each model's "dur:..." constraint — match scene
|
|
74
|
+
// durations to it. Pacing target can still be honoured by varying scene COUNT
|
|
75
|
+
// (e.g. a 10s UGC at fast pacing = 2 scenes × 5s on pixverse, NOT 6 × 1.7s).
|
|
76
|
+
lines.push(" - Provider duration floor: every scene with strategy=ai-image-to-video or ai-text-to-video MUST have durationMs/1000 in its preferredModel's allowed durations (shown as `dur:` in the catalog). Hard universal floor is 2s — no provider accepts sub-2s clips. If a desired scene is shorter than the floor, MERGE it with the next scene instead of generating a too-short clip. For sub-5s scenes, pick from: bytedance-seedance-1.0-pro / -pro-fast (2-12s), runway-gen4.5 (2-10s), kling-v3.0 (3-15s), google-veo-3.1* (4-8s). Picking minimax-hailuo for a <6s scene is a HARD ERROR.");
|
|
77
|
+
// AG-28: voiceover-vs-scene duration budget. Without this, the planner
|
|
78
|
+
// picks scene.durationMs based on visual pacing and the TTS that comes
|
|
79
|
+
// out is consistently 1-2s longer per scene → voice clipped mid-sentence.
|
|
80
|
+
lines.push(" - Voiceover budget: every scene.voiceoverLine MUST fit inside scene.durationMs at TTS speed ~150 wpm. Rule of thumb: max words ≈ (durationMs - 250) / 400. Examples: 2000ms → ≤4 words; 2500ms → ≤5 words; 3000ms → ≤7 words; 4000ms → ≤9 words. Commas/em-dashes add ~150ms each. If your line is longer than the scene can carry, either (a) shorten the line, (b) merge with adjacent scene + extend duration, or (c) leave voiceoverLine undefined and let onScreenText carry the message. Do NOT write a 12-word line for a 2000ms scene — the stitcher will clip it.");
|
|
81
|
+
// AG-10 + AG-40: text overlay structure. Each scene gets `overlays[]` (preferred
|
|
82
|
+
// over the legacy single `onScreenText` string). Each overlay has a role that
|
|
83
|
+
// drives styling. The closing scene must include a role:'cta' overlay that
|
|
84
|
+
// combines brand + verb so the viewer leaves with both pieces of information.
|
|
85
|
+
lines.push(" - Text overlays: prefer `scene.overlays[]` (array of TextOverlay) over `onScreenText` (single string, legacy). Each overlay = { text, role, position?, animation?, bgStyle?, sizePct?, persistAcrossScenes? }. CRITICAL: `text` is the LITERAL COPY USERS WILL READ on screen — the exact words rendered. It is NOT a description of how the overlay should look. Styling is applied automatically from the role; do NOT describe it. GOOD: text:\"Your eyes lie to you\". BAD: text:\"Bold white sans-serif subtitle text in the lower third of a 9:16 frame\" (that is a styling description and will be REJECTED). Roles available: 'headline' (top, big-bold, max 6 words, the hook), 'subheadline' (lower-third, medium, max 8 words), 'body' (lower-third, small, max 14 words — a supporting line of actual copy), 'cta' (bottom, bold pill, max 5 words, MUST be on LAST scene, MUST combine brand + verb like 'Get HydraPure Today'), 'watermark' (bottom-right tiny — emit ONCE on scene 0 with persistAcrossScenes:true, just the brand name, max 2 words; the renderer auto-carries it across every subsequent scene), 'disclaimer' (tiny bottom legal), 'label' (in-frame object/person label, max 3 words). Max 4 overlays per scene. Don't put two headlines on the same scene. Don't repeat a watermark scene-by-scene — emit once and it persists. Emojis OK.");
|
|
86
|
+
// text-layout v1 — extended position vocabulary + animation/bgStyle/sizePct
|
|
87
|
+
// recommendations. Planner picks per-scene based on scene.intent / role.
|
|
88
|
+
lines.push(" - Overlay position vocabulary (set `position` explicitly to override role default): 'top', 'top-banner' (full-width strip across the top — good for category labels / counter chips), 'top-left' / 'top-right' (corner badges), 'center' (single-line emphasis), 'left-rail' (vertically-centered left 33% — product-shot copy beside the asset), 'lower-third' (default for subheadline/body), 'bottom', 'bottom-left' / 'bottom-right', 'caption-strip' (bottom-pinned word-by-word captions — TikTok-style on voiceover-driven scenes). Pick the position that matches the scene intent: hook → 'center' or 'top-banner'; product-reveal → 'left-rail' or 'lower-third'; voiceover-narration → 'caption-strip'; cta → 'lower-third' or bottom band.");
|
|
89
|
+
lines.push(" - Overlay animation (set `animation` to override role default): 'fade' (default neutral), 'slide-up' (cta / lower-third — feels intentional), 'pop' (headline / label — punchy), 'type' (typewriter — sparingly, on hook moments only), 'word-pop' (each word pops in sequentially — for hooks where you want to land the message word by word), 'highlight-current' (for caption-strip — active word brightens while others dim, mimics karaoke captions; ONLY use with position='caption-strip'). Default to 'fade' if unsure. Don't stack 'word-pop' on every scene — once or twice per video.");
|
|
90
|
+
lines.push(" - Overlay bgStyle (background decoration for legibility — set `bgStyle` to override the auto-default): 'none' (text only, no chrome), 'shadow' (drop shadow — safe default on any background), 'pill' (rounded-rect fill hugging the text — great for cta / counter chips), 'bar' (full-width edge-to-edge band — pairs with 'top-banner' or 'caption-strip'), 'outline' (glyph stroke for high contrast on busy footage). The renderer applies a smart default when omitted, so only set this when you specifically want a different treatment.");
|
|
91
|
+
lines.push(" - Overlay sizePct (optional alternative to fontSize, expressed as % of frame height, range 2–20): use for resolution-independent sizing. Typical: hook headline ~10–14, subheadline ~6–8, body ~4–6, caption-strip ~5–7, watermark ~2–3. The role default is fine 90% of the time; only set sizePct when you want emphasis bigger or smaller than the role suggests.");
|
|
92
|
+
lines.push(" - Overlay font (optional, picks from the curated pack): one of 'Inter', 'Anton', 'Bebas Neue', 'Playfair Display', 'Caveat', 'Permanent Marker', 'IBM Plex Sans', 'Space Grotesk', 'Archivo Black', 'Outfit', 'Fraunces', 'DM Serif Display'. Persona-driven pick: friendly/casual → Caveat or Outfit; bold/urgent (sales hook) → Anton, Archivo Black, or Bebas Neue; editorial/premium → Playfair Display, Fraunces, or DM Serif Display; tech/modern → Inter, Space Grotesk, or IBM Plex Sans; handmade/artisanal → Permanent Marker or Caveat. Omit `font` to use the role default (Poppins) when no persona signal is strong.");
|
|
93
|
+
// AG-37: voiceId must come from brief (real ElevenLabs ID), never invented
|
|
94
|
+
// by the LLM. Earlier runs saw the planner hallucinating descriptive labels
|
|
95
|
+
// like "female-young-adult-excited" which then got stripped by the executor.
|
|
96
|
+
lines.push(" - voiceId: leave UNDEFINED at BOTH plan level AND every scene. ElevenLabs voice IDs are 20-char opaque strings (e.g. 'EXAVITQu4vr4xnSDxMaL'). You do NOT know any of them and MUST NOT invent them. Descriptive labels like 'female-young-adult-excited' are invalid and get stripped. The orchestrator overwrites plan.voiceId post-parse from the brief; per-scene voiceId is a hallucination — never emit it. Use voiceStyle (adjective like 'excited', 'calm', 'authoritative') to convey delivery; that's what the executor maps to voice settings.");
|
|
97
|
+
// AG-44: per-scene voiceStyle. A single global tone is too coarse for an
|
|
98
|
+
// emotional arc (e.g. UGC ads that open frustrated and close excited).
|
|
99
|
+
lines.push(" - Per-scene voiceStyle: set scene.voiceStyle (adjective: 'frustrated', 'curious', 'excited', 'whispered', 'authoritative', 'calm') when the emotional beat of that scene differs from the global tone. Common pattern for UGC: scene 0 frustrated/skeptical (the problem), middle scenes curious/intrigued (the reveal), final scene excited/confident (the CTA). If a scene has no special emotional shift, omit voiceStyle and the executor uses plan.voiceStyle.");
|
|
100
|
+
// AG-11: character consistency across scenes. When the same person appears
|
|
101
|
+
// in multiple scenes, the planner must (a) describe identity verbatim each
|
|
102
|
+
// time, (b) set characterAnchorSceneIndex on later scenes pointing to the
|
|
103
|
+
// first scene the character appeared in.
|
|
104
|
+
lines.push(" - Character consistency: when the SAME person (presenter, customer, mascot) appears in multiple scenes, you MUST: (1) in the FIRST scene the character appears, write a complete identity description in scene.prompt — age range, ethnicity, hair color/length/style, build, distinctive features, exact wardrobe (color + garment type). (2) in every LATER scene with the same character, RE-STATE those identity descriptors verbatim AND set scene.characterAnchorSceneIndex to the sceneIndex of the first appearance. Do NOT write generic phrases like \"a woman doing X\" in later scenes — that produces a different face every time. If the brief implies recurring presenter (UGC ads, talking-head), assume ONE character throughout unless explicitly multi-cast.");
|
|
105
|
+
// text-layout v1 — per-scene composition decision. Optional but strongly
|
|
106
|
+
// recommended when source aspect ≠ target aspect (i.e. most stock video
|
|
107
|
+
// and avatar shots on 9:16 vertical, or vertical UGC on 16:9 horizontal).
|
|
108
|
+
// Driven by source aspect × target aspect × what's in the asset.
|
|
109
|
+
lines.push(` - Per-scene layout: set scene.layout = { composition, focalPoint?, backgroundFill? } when the scene asset's native aspect differs from the target (${brief.aspect ?? "9:16"}), or when the scene needs a deliberate compositional choice. composition options: 'full-bleed' (asset fills frame, crop excess — use when subject is center-framed and crop won't lose it), 'letterbox' (asset native ratio centered, solid bars top/bottom — preserves composition but feels static), 'blur-fill' (asset native ratio centered with blurred copy filling the bars — modern social default, usually the right call), 'split-top' (asset top 60%, solid area bottom 40% — text panel below), 'split-bottom' (asset bottom 60%, solid area top 40% — header panel above), 'pip-bottom-right' (asset 35% size in the corner, bg fills — use when the asset's aspect can't fit cleanly, e.g. vertical clip on 16:9 target). focalPoint = { x, y } normalized 0–1 anchors the crop or composition center (defaults to {0.5, 0.5} = center). backgroundFill applies to letterbox/split/pip ('blur-extend' = blurred asset copy, 'black'/'white', 'brand-primary'/'brand-secondary', 'gradient'). Decision rule: 16:9 source on 9:16 target → 'blur-fill' if the subject sits anywhere off-center, 'full-bleed' only if center-framed; 9:16 source on 16:9 target → 'pip-bottom-right'; matching aspects → omit layout (default full-bleed).`);
|
|
110
|
+
return lines.length > 1 ? lines.join("\n") : "";
|
|
111
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { VideoBrief } from "../../../schemas/brief.schema";
|
|
2
|
+
import { PlannerWarning, VideoPlan } from "../../../schemas/videoPlan.schema";
|
|
3
|
+
/**
|
|
4
|
+
* AG-9: hard duration contract. Returns null if the plan honours the brief's
|
|
5
|
+
* requested duration within 10%, otherwise returns a correction message to
|
|
6
|
+
* feed back to the planner on retry.
|
|
7
|
+
*/
|
|
8
|
+
export declare function checkDurationContract(plan: VideoPlan, brief: VideoBrief): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Captions contract. Faceless-YT explainers / TikTok shorts / any brief that
|
|
11
|
+
* mentions "captions" or "subtitles" MUST ship with at least one overlay per
|
|
12
|
+
* scene (the audience is sound-off by default). Returns a correction directive
|
|
13
|
+
* when the contract is broken; null when satisfied or N/A.
|
|
14
|
+
*
|
|
15
|
+
* Talking-head-avatar scenes are exempt — the avatar IS the on-screen text
|
|
16
|
+
* substitute and burned-in captions on top of a presenter feel cluttered.
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkCaptionsContract(plan: VideoPlan, brief: VideoBrief): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Narration-density contract. When a plan is narration-driven (>50% of scenes
|
|
21
|
+
* carry a voiceoverLine) AND brief.pacing is "medium" or "slow", every scene
|
|
22
|
+
* MUST be >= 3500ms. Sub-3.5s narration scenes produce telegraphic 3-4 word
|
|
23
|
+
* lines that read like a TikTok listicle instead of an informational explainer
|
|
24
|
+
* — the failure mode the user hit with 15×2s scenes for a 30s faceless-yt
|
|
25
|
+
* brief at medium pacing. Returns null when the plan satisfies the contract
|
|
26
|
+
* or the contract doesn't apply (fast/very-fast pacing, or VO-light plans).
|
|
27
|
+
*/
|
|
28
|
+
export declare function checkNarrationDensityContract(plan: VideoPlan, brief: VideoBrief): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* AG-28: per-scene voiceover-budget validator. Estimates TTS duration from the
|
|
31
|
+
* VO line's word count + punctuation. If the estimate exceeds the scene's
|
|
32
|
+
* durationMs by >10%, return a correction directive listing the offending
|
|
33
|
+
* scenes + the max word count that would fit. The planner can either shorten
|
|
34
|
+
* the line or merge with the next scene on retry.
|
|
35
|
+
*/
|
|
36
|
+
export declare function checkSceneTtsBudget(plan: VideoPlan): string | null;
|
|
37
|
+
/**
|
|
38
|
+
* AG-15: per-scene duration-capability validator. For each scene using an AI
|
|
39
|
+
* video provider (ai-image-to-video / ai-text-to-video), confirm that
|
|
40
|
+
* scene.durationMs/1000 is in the preferredModel's allowed-durations list. On
|
|
41
|
+
* mismatch, build a directive correction the planner can act on: name the
|
|
42
|
+
* offending scenes + suggest a model whose `dur:` range actually accepts the
|
|
43
|
+
* requested duration. Root cause for Test-1 burning $0 of useful work: planner
|
|
44
|
+
* picked minimax-hailuo-02 (6s / 10s only) for 1.7s scenes — fallback chain
|
|
45
|
+
* exhausted because every fallback was also a ≥6s model.
|
|
46
|
+
*/
|
|
47
|
+
export declare function checkSceneDurationCapability(plan: VideoPlan): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Warning-channel siblings of the rejection validators above. These run on
|
|
50
|
+
* an already-approved plan (or after a sceneEdit patch) and produce
|
|
51
|
+
* PlannerWarning entries the UI can surface — never rejection strings.
|
|
52
|
+
*/
|
|
53
|
+
/** Demote vo-clip rejections to warnings after the planner has exhausted retries. */
|
|
54
|
+
export declare function collectSceneVoClipWarnings(plan: VideoPlan): PlannerWarning[];
|
|
55
|
+
/**
|
|
56
|
+
* Warn when a scene's VO ends notably before the scene itself ends — that
|
|
57
|
+
* extra time renders as silence over a continuing visual, which reads as
|
|
58
|
+
* dead air on most formats. Suppressed when `scene.allowTrailingSilence`
|
|
59
|
+
* is set (visual-led moments). Scenes without VO are exempt (silence by
|
|
60
|
+
* design — handled by music / ambience tracks).
|
|
61
|
+
*/
|
|
62
|
+
export declare function collectSceneTrailingSilenceWarnings(plan: VideoPlan): PlannerWarning[];
|
|
63
|
+
/** One-shot helper: returns the full warning set for a plan + scene overrides. */
|
|
64
|
+
export declare function collectPlanWarnings(plan: VideoPlan): PlannerWarning[];
|
|
65
|
+
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/planner/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAe9E;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CA4BvF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CA6BvF;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,UAAU,GAChB,MAAM,GAAG,IAAI,CAuBf;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAgClE;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAyC3E;AAED;;;;GAIG;AAEH,qFAAqF;AACrF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,EAAE,CA2B5E;AAED;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,SAAS,GACd,cAAc,EAAE,CAyBlB;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,EAAE,CAKrE"}
|