vidspotai-shared 1.0.69-dev.0 → 1.0.69
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 +6 -63
- package/lib/globals/aiModels/enums.d.ts.map +1 -1
- package/lib/globals/aiModels/enums.js +9 -78
- package/lib/globals/aiModels/index.d.ts +30 -2
- package/lib/globals/aiModels/index.d.ts.map +1 -1
- package/lib/globals/aiModels/index.js +35 -7
- package/lib/globals/aiModels/providers/bytedance.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/bytedance.js +0 -19
- package/lib/globals/aiModels/providers/google.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/google.js +2 -150
- package/lib/globals/aiModels/providers/kling.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/kling.js +37 -280
- package/lib/globals/aiModels/providers/minimax.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/minimax.js +11 -76
- package/lib/globals/aiModels/providers/openai.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/openai.js +6 -90
- package/lib/globals/aiModels/providers/pixverse.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/pixverse.js +29 -111
- package/lib/globals/aiModels/providers/runway.d.ts.map +1 -1
- package/lib/globals/aiModels/providers/runway.js +2 -64
- package/lib/globals/aiModels/types.d.ts +1 -20
- package/lib/globals/aiModels/types.d.ts.map +1 -1
- package/lib/globals/ttsModels/index.d.ts +0 -2
- package/lib/globals/ttsModels/index.d.ts.map +1 -1
- package/lib/globals/ttsModels/index.js +1 -9
- 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 +4 -39
- package/lib/globals/ttsModels/voices.d.ts.map +1 -1
- package/lib/globals/ttsModels/voices.js +26 -273
- package/lib/globals/types.d.ts +1 -59
- package/lib/globals/types.d.ts.map +1 -1
- package/lib/globals/types.js +2 -81
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/models/index.d.ts +0 -6
- package/lib/models/index.d.ts.map +1 -1
- package/lib/models/index.js +0 -6
- package/lib/models/user.model.d.ts +1 -12
- package/lib/models/user.model.d.ts.map +1 -1
- package/lib/models/video.model.d.ts +8 -120
- package/lib/models/video.model.d.ts.map +1 -1
- package/lib/models/video.model.js +0 -10
- package/lib/services/aiGen/aiGenFactory.service.d.ts +1 -21
- package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -1
- package/lib/services/aiGen/aiGenFactory.service.js +21 -84
- package/lib/services/aiGen/helpers.d.ts.map +1 -1
- package/lib/services/aiGen/helpers.js +0 -10
- package/lib/services/aiGen/providers/alibaba/alibaba.d.ts +3 -14
- package/lib/services/aiGen/providers/alibaba/alibaba.d.ts.map +1 -1
- package/lib/services/aiGen/providers/alibaba/alibaba.js +22 -155
- package/lib/services/aiGen/providers/azure/azure.service.d.ts +14 -0
- package/lib/services/aiGen/providers/azure/azure.service.d.ts.map +1 -0
- package/lib/services/aiGen/providers/azure/azure.service.js +108 -0
- package/lib/services/aiGen/providers/azure/index.d.ts +2 -0
- package/lib/services/aiGen/providers/azure/index.d.ts.map +1 -0
- package/lib/services/aiGen/providers/{pexels → azure}/index.js +1 -1
- package/lib/services/aiGen/providers/baseAiGenProvider.service.d.ts +4 -22
- package/lib/services/aiGen/providers/baseAiGenProvider.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/baseAiGenProvider.service.js +0 -32
- package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/bytedance/bytedance.service.js +25 -13
- package/lib/services/aiGen/providers/google/google.service.d.ts +2 -11
- package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/google/google.service.js +28 -245
- package/lib/services/aiGen/providers/index.d.ts +0 -3
- package/lib/services/aiGen/providers/index.d.ts.map +1 -1
- package/lib/services/aiGen/providers/index.js +0 -3
- package/lib/services/aiGen/providers/kling/index.d.ts +0 -1
- package/lib/services/aiGen/providers/kling/index.d.ts.map +1 -1
- package/lib/services/aiGen/providers/kling/index.js +0 -1
- package/lib/services/aiGen/providers/kling/kling.service.d.ts +1 -12
- package/lib/services/aiGen/providers/kling/kling.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/kling/kling.service.js +26 -357
- package/lib/services/aiGen/providers/kling/types.d.ts +0 -105
- package/lib/services/aiGen/providers/kling/types.d.ts.map +1 -1
- package/lib/services/aiGen/providers/minimax/minimax.service.d.ts +2 -15
- package/lib/services/aiGen/providers/minimax/minimax.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/minimax/minimax.service.js +5 -128
- package/lib/services/aiGen/providers/minimax/types.d.ts +1 -10
- package/lib/services/aiGen/providers/minimax/types.d.ts.map +1 -1
- package/lib/services/aiGen/providers/openai/openai.service.d.ts +2 -8
- package/lib/services/aiGen/providers/openai/openai.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/openai/openai.service.js +7 -184
- package/lib/services/aiGen/providers/pixverse/pixverse.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/pixverse/pixverse.service.js +2 -125
- package/lib/services/aiGen/providers/runway/runway.service.d.ts +2 -12
- package/lib/services/aiGen/providers/runway/runway.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/runway/runway.service.js +21 -224
- package/lib/services/aiGen/providers/types.d.ts +6 -263
- package/lib/services/aiGen/providers/types.d.ts.map +1 -1
- package/lib/services/analytics.service.js +4 -2
- package/lib/services/bullmq.service.d.ts +1 -6
- package/lib/services/bullmq.service.d.ts.map +1 -1
- package/lib/services/bullmq.service.js +14 -62
- package/lib/services/credit.service.d.ts.map +1 -1
- package/lib/services/credit.service.js +7 -45
- package/lib/services/firestore.service.d.ts +0 -17
- package/lib/services/firestore.service.d.ts.map +1 -1
- package/lib/services/firestore.service.js +0 -30
- package/lib/services/gcp/index.d.ts +0 -1
- package/lib/services/gcp/index.d.ts.map +1 -1
- package/lib/services/gcp/index.js +0 -1
- package/lib/services/index.d.ts +0 -13
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +0 -13
- package/lib/services/redis.service.d.ts +0 -9
- package/lib/services/redis.service.d.ts.map +1 -1
- package/lib/services/redis.service.js +11 -20
- package/lib/services/tts/index.d.ts +0 -2
- package/lib/services/tts/index.d.ts.map +1 -1
- package/lib/services/tts/index.js +0 -2
- package/lib/services/tts/providers/elevenlabs.service.d.ts.map +1 -1
- package/lib/services/tts/providers/elevenlabs.service.js +24 -91
- package/lib/services/tts/ttsFactory.service.d.ts.map +1 -1
- package/lib/services/tts/ttsFactory.service.js +0 -6
- package/lib/services/tts/types.d.ts +0 -33
- package/lib/services/tts/types.d.ts.map +1 -1
- package/lib/utils/errors.d.ts +0 -8
- package/lib/utils/errors.d.ts.map +1 -1
- package/lib/utils/errors.js +0 -8
- package/lib/utils/helpers.d.ts +0 -13
- package/lib/utils/helpers.d.ts.map +1 -1
- package/lib/utils/helpers.js +11 -48
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +1 -37
- package/package.json +1 -5
- package/lib/globals/aiModels/providers/alibaba.d.ts +0 -4
- package/lib/globals/aiModels/providers/alibaba.d.ts.map +0 -1
- package/lib/globals/aiModels/providers/alibaba.js +0 -194
- package/lib/globals/aiModels/providers/elevenlabs.d.ts +0 -14
- package/lib/globals/aiModels/providers/elevenlabs.d.ts.map +0 -1
- package/lib/globals/aiModels/providers/elevenlabs.js +0 -29
- package/lib/globals/aiModels/providers/pixverseTemplates.d.ts +0 -36
- package/lib/globals/aiModels/providers/pixverseTemplates.d.ts.map +0 -1
- package/lib/globals/aiModels/providers/pixverseTemplates.js +0 -42
- package/lib/globals/aiModels/tierHelpers.d.ts +0 -33
- package/lib/globals/aiModels/tierHelpers.d.ts.map +0 -1
- package/lib/globals/aiModels/tierHelpers.js +0 -109
- package/lib/globals/ttsModels/providers/minimax.d.ts +0 -8
- package/lib/globals/ttsModels/providers/minimax.d.ts.map +0 -1
- package/lib/globals/ttsModels/providers/minimax.js +0 -18
- package/lib/globals/ttsModels/providers/openai.d.ts +0 -12
- package/lib/globals/ttsModels/providers/openai.d.ts.map +0 -1
- package/lib/globals/ttsModels/providers/openai.js +0 -22
- package/lib/models/agent.model.d.ts +0 -357
- package/lib/models/agent.model.d.ts.map +0 -1
- package/lib/models/agent.model.js +0 -21
- package/lib/models/cachedAsset.model.d.ts +0 -18
- package/lib/models/cachedAsset.model.d.ts.map +0 -1
- package/lib/models/cachedAsset.model.js +0 -2
- package/lib/models/cachedRawAsset.model.d.ts +0 -20
- package/lib/models/cachedRawAsset.model.d.ts.map +0 -1
- package/lib/models/cachedRawAsset.model.js +0 -2
- package/lib/models/image.model.d.ts +0 -47
- package/lib/models/image.model.d.ts.map +0 -1
- package/lib/models/image.model.js +0 -2
- package/lib/models/notification.model.d.ts +0 -25
- package/lib/models/notification.model.d.ts.map +0 -1
- package/lib/models/notification.model.js +0 -2
- package/lib/models/ref.model.d.ts +0 -80
- package/lib/models/ref.model.d.ts.map +0 -1
- package/lib/models/ref.model.js +0 -13
- package/lib/models/share.model.d.ts +0 -29
- package/lib/models/share.model.d.ts.map +0 -1
- package/lib/models/share.model.js +0 -2
- package/lib/schemas/agentPersona.schema.d.ts +0 -10
- package/lib/schemas/agentPersona.schema.d.ts.map +0 -1
- package/lib/schemas/agentPersona.schema.js +0 -11
- package/lib/schemas/agentRunJob.schema.d.ts +0 -105
- package/lib/schemas/agentRunJob.schema.d.ts.map +0 -1
- package/lib/schemas/agentRunJob.schema.js +0 -88
- package/lib/schemas/brandKit.schema.d.ts +0 -113
- package/lib/schemas/brandKit.schema.d.ts.map +0 -1
- package/lib/schemas/brandKit.schema.js +0 -46
- package/lib/schemas/brief.schema.d.ts +0 -263
- package/lib/schemas/brief.schema.d.ts.map +0 -1
- package/lib/schemas/brief.schema.js +0 -157
- package/lib/schemas/index.d.ts +0 -7
- package/lib/schemas/index.d.ts.map +0 -1
- package/lib/schemas/index.js +0 -22
- package/lib/schemas/project.schema.d.ts +0 -1025
- package/lib/schemas/project.schema.d.ts.map +0 -1
- package/lib/schemas/project.schema.js +0 -256
- package/lib/schemas/videoPlan.schema.d.ts +0 -590
- package/lib/schemas/videoPlan.schema.d.ts.map +0 -1
- package/lib/schemas/videoPlan.schema.js +0 -412
- package/lib/services/agent/beatSnap.d.ts +0 -10
- package/lib/services/agent/beatSnap.d.ts.map +0 -1
- package/lib/services/agent/beatSnap.js +0 -128
- package/lib/services/agent/bibleBuilder.d.ts +0 -43
- package/lib/services/agent/bibleBuilder.d.ts.map +0 -1
- package/lib/services/agent/bibleBuilder.js +0 -102
- package/lib/services/agent/bibleImageVision.d.ts +0 -45
- package/lib/services/agent/bibleImageVision.d.ts.map +0 -1
- package/lib/services/agent/bibleImageVision.js +0 -169
- package/lib/services/agent/chatAgent.d.ts +0 -79
- package/lib/services/agent/chatAgent.d.ts.map +0 -1
- package/lib/services/agent/chatAgent.js +0 -136
- package/lib/services/agent/costPreflight.d.ts +0 -61
- package/lib/services/agent/costPreflight.d.ts.map +0 -1
- package/lib/services/agent/costPreflight.js +0 -143
- package/lib/services/agent/critic.d.ts +0 -103
- package/lib/services/agent/critic.d.ts.map +0 -1
- package/lib/services/agent/critic.js +0 -139
- package/lib/services/agent/editClassifier.d.ts +0 -262
- package/lib/services/agent/editClassifier.d.ts.map +0 -1
- package/lib/services/agent/editClassifier.js +0 -186
- package/lib/services/agent/eval/index.d.ts +0 -5
- package/lib/services/agent/eval/index.d.ts.map +0 -1
- package/lib/services/agent/eval/index.js +0 -20
- package/lib/services/agent/eval/judge.d.ts +0 -14
- package/lib/services/agent/eval/judge.d.ts.map +0 -1
- package/lib/services/agent/eval/judge.js +0 -96
- package/lib/services/agent/eval/recorder.d.ts +0 -28
- package/lib/services/agent/eval/recorder.d.ts.map +0 -1
- package/lib/services/agent/eval/recorder.js +0 -100
- package/lib/services/agent/eval/seedBriefs.d.ts +0 -16
- package/lib/services/agent/eval/seedBriefs.d.ts.map +0 -1
- package/lib/services/agent/eval/seedBriefs.js +0 -1188
- package/lib/services/agent/eval/types.d.ts +0 -230
- package/lib/services/agent/eval/types.d.ts.map +0 -1
- package/lib/services/agent/eval/types.js +0 -73
- package/lib/services/agent/executor.d.ts +0 -141
- package/lib/services/agent/executor.d.ts.map +0 -1
- package/lib/services/agent/executor.js +0 -561
- package/lib/services/agent/globalActions.d.ts +0 -49
- package/lib/services/agent/globalActions.d.ts.map +0 -1
- package/lib/services/agent/globalActions.js +0 -328
- package/lib/services/agent/index.d.ts +0 -38
- package/lib/services/agent/index.d.ts.map +0 -1
- package/lib/services/agent/index.js +0 -53
- package/lib/services/agent/llmCaller.d.ts +0 -144
- package/lib/services/agent/llmCaller.d.ts.map +0 -1
- package/lib/services/agent/llmCaller.js +0 -16
- package/lib/services/agent/llmCallerAnthropic.d.ts +0 -90
- package/lib/services/agent/llmCallerAnthropic.d.ts.map +0 -1
- package/lib/services/agent/llmCallerAnthropic.js +0 -255
- package/lib/services/agent/llmCallerGateway.d.ts +0 -61
- package/lib/services/agent/llmCallerGateway.d.ts.map +0 -1
- package/lib/services/agent/llmCallerGateway.js +0 -360
- package/lib/services/agent/llmCallerRegistry.d.ts +0 -6
- package/lib/services/agent/llmCallerRegistry.d.ts.map +0 -1
- package/lib/services/agent/llmCallerRegistry.js +0 -39
- package/lib/services/agent/modelQualityNotes.d.ts +0 -100
- package/lib/services/agent/modelQualityNotes.d.ts.map +0 -1
- package/lib/services/agent/modelQualityNotes.js +0 -248
- package/lib/services/agent/modelRouter.d.ts +0 -41
- package/lib/services/agent/modelRouter.d.ts.map +0 -1
- package/lib/services/agent/modelRouter.js +0 -65
- package/lib/services/agent/musicSelect.d.ts +0 -23
- package/lib/services/agent/musicSelect.d.ts.map +0 -1
- package/lib/services/agent/musicSelect.js +0 -109
- package/lib/services/agent/overlayRenderer.d.ts +0 -67
- package/lib/services/agent/overlayRenderer.d.ts.map +0 -1
- package/lib/services/agent/overlayRenderer.js +0 -253
- package/lib/services/agent/perSceneCritic.d.ts +0 -90
- package/lib/services/agent/perSceneCritic.d.ts.map +0 -1
- package/lib/services/agent/perSceneCritic.js +0 -125
- package/lib/services/agent/personas.d.ts +0 -78
- package/lib/services/agent/personas.d.ts.map +0 -1
- package/lib/services/agent/personas.js +0 -177
- package/lib/services/agent/planDiff.d.ts +0 -76
- package/lib/services/agent/planDiff.d.ts.map +0 -1
- package/lib/services/agent/planDiff.js +0 -182
- package/lib/services/agent/planMutations.d.ts +0 -46
- package/lib/services/agent/planMutations.d.ts.map +0 -1
- package/lib/services/agent/planMutations.js +0 -120
- package/lib/services/agent/planner/Planner.d.ts +0 -107
- package/lib/services/agent/planner/Planner.d.ts.map +0 -1
- package/lib/services/agent/planner/Planner.js +0 -591
- package/lib/services/agent/planner/overlaySanity.d.ts +0 -7
- package/lib/services/agent/planner/overlaySanity.d.ts.map +0 -1
- package/lib/services/agent/planner/overlaySanity.js +0 -86
- package/lib/services/agent/planner/promptSections.d.ts +0 -25
- package/lib/services/agent/planner/promptSections.d.ts.map +0 -1
- package/lib/services/agent/planner/promptSections.js +0 -174
- package/lib/services/agent/planner/repair.d.ts +0 -16
- package/lib/services/agent/planner/repair.d.ts.map +0 -1
- package/lib/services/agent/planner/repair.js +0 -51
- package/lib/services/agent/planner/structuralRules.d.ts +0 -10
- package/lib/services/agent/planner/structuralRules.d.ts.map +0 -1
- package/lib/services/agent/planner/structuralRules.js +0 -111
- package/lib/services/agent/planner/validators.d.ts +0 -65
- package/lib/services/agent/planner/validators.d.ts.map +0 -1
- package/lib/services/agent/planner/validators.js +0 -284
- package/lib/services/agent/planner.d.ts +0 -3
- package/lib/services/agent/planner.d.ts.map +0 -1
- package/lib/services/agent/planner.js +0 -14
- package/lib/services/agent/providerFallback/chains.d.ts +0 -100
- package/lib/services/agent/providerFallback/chains.d.ts.map +0 -1
- package/lib/services/agent/providerFallback/chains.js +0 -198
- package/lib/services/agent/providerFallback/classifier.d.ts +0 -36
- package/lib/services/agent/providerFallback/classifier.d.ts.map +0 -1
- package/lib/services/agent/providerFallback/classifier.js +0 -103
- package/lib/services/agent/providerFallback/index.d.ts +0 -4
- package/lib/services/agent/providerFallback/index.d.ts.map +0 -1
- package/lib/services/agent/providerFallback/index.js +0 -19
- package/lib/services/agent/providerFallback/withFallback.d.ts +0 -60
- package/lib/services/agent/providerFallback/withFallback.d.ts.map +0 -1
- package/lib/services/agent/providerFallback/withFallback.js +0 -93
- package/lib/services/agent/providerTaskCache.d.ts +0 -50
- package/lib/services/agent/providerTaskCache.d.ts.map +0 -1
- package/lib/services/agent/providerTaskCache.js +0 -98
- package/lib/services/agent/qualityGate.d.ts +0 -82
- package/lib/services/agent/qualityGate.d.ts.map +0 -1
- package/lib/services/agent/qualityGate.js +0 -232
- package/lib/services/agent/referenceImageRenderer.d.ts +0 -37
- package/lib/services/agent/referenceImageRenderer.d.ts.map +0 -1
- package/lib/services/agent/referenceImageRenderer.js +0 -92
- package/lib/services/agent/regenCore.d.ts +0 -60
- package/lib/services/agent/regenCore.d.ts.map +0 -1
- package/lib/services/agent/regenCore.js +0 -487
- package/lib/services/agent/runHelpers.d.ts +0 -44
- package/lib/services/agent/runHelpers.d.ts.map +0 -1
- package/lib/services/agent/runHelpers.js +0 -196
- package/lib/services/agent/sceneLayoutVision.d.ts +0 -90
- package/lib/services/agent/sceneLayoutVision.d.ts.map +0 -1
- package/lib/services/agent/sceneLayoutVision.js +0 -212
- package/lib/services/agent/stitchedVideoCritic.d.ts +0 -136
- package/lib/services/agent/stitchedVideoCritic.d.ts.map +0 -1
- package/lib/services/agent/stitchedVideoCritic.gemini.d.ts +0 -26
- package/lib/services/agent/stitchedVideoCritic.gemini.d.ts.map +0 -1
- package/lib/services/agent/stitchedVideoCritic.gemini.js +0 -198
- package/lib/services/agent/stitchedVideoCritic.js +0 -162
- package/lib/services/agent/taskPoller.d.ts +0 -65
- package/lib/services/agent/taskPoller.d.ts.map +0 -1
- package/lib/services/agent/taskPoller.js +0 -176
- package/lib/services/agent/textOverlayStyles.d.ts +0 -60
- package/lib/services/agent/textOverlayStyles.d.ts.map +0 -1
- package/lib/services/agent/textOverlayStyles.js +0 -174
- package/lib/services/agent/toolRegistry.d.ts +0 -73
- package/lib/services/agent/toolRegistry.d.ts.map +0 -1
- package/lib/services/agent/toolRegistry.js +0 -95
- package/lib/services/agent/tools/analyzeReference.tool.d.ts +0 -36
- package/lib/services/agent/tools/analyzeReference.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/analyzeReference.tool.js +0 -44
- package/lib/services/agent/tools/animateImage.tool.d.ts +0 -24
- package/lib/services/agent/tools/animateImage.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/animateImage.tool.js +0 -115
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.d.ts +0 -32
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/animateImageWithMotionBrush.tool.js +0 -135
- package/lib/services/agent/tools/composeScene.tool.d.ts +0 -978
- package/lib/services/agent/tools/composeScene.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/composeScene.tool.js +0 -90
- package/lib/services/agent/tools/estimateCost.tool.d.ts +0 -352
- package/lib/services/agent/tools/estimateCost.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/estimateCost.tool.js +0 -62
- package/lib/services/agent/tools/generateAvatarVideo.tool.d.ts +0 -32
- package/lib/services/agent/tools/generateAvatarVideo.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/generateAvatarVideo.tool.js +0 -143
- package/lib/services/agent/tools/generateCaptions.tool.d.ts +0 -42
- package/lib/services/agent/tools/generateCaptions.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/generateCaptions.tool.js +0 -196
- package/lib/services/agent/tools/generateImage.tool.d.ts +0 -74
- package/lib/services/agent/tools/generateImage.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/generateImage.tool.js +0 -206
- package/lib/services/agent/tools/generateVideo.tool.d.ts +0 -31
- package/lib/services/agent/tools/generateVideo.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/generateVideo.tool.js +0 -153
- package/lib/services/agent/tools/generateVoiceover.tool.d.ts +0 -44
- package/lib/services/agent/tools/generateVoiceover.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/generateVoiceover.tool.js +0 -206
- package/lib/services/agent/tools/index.d.ts +0 -20
- package/lib/services/agent/tools/index.d.ts.map +0 -1
- package/lib/services/agent/tools/index.js +0 -35
- package/lib/services/agent/tools/planVideo.tool.d.ts +0 -343
- package/lib/services/agent/tools/planVideo.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/planVideo.tool.js +0 -46
- package/lib/services/agent/tools/render.tool.d.ts +0 -367
- package/lib/services/agent/tools/render.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/render.tool.js +0 -48
- package/lib/services/agent/tools/searchMusic.tool.d.ts +0 -49
- package/lib/services/agent/tools/searchMusic.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/searchMusic.tool.js +0 -74
- package/lib/services/agent/tools/searchStock.tool.d.ts +0 -41
- package/lib/services/agent/tools/searchStock.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/searchStock.tool.js +0 -314
- package/lib/services/agent/tools/searchUserLibrary.tool.d.ts +0 -59
- package/lib/services/agent/tools/searchUserLibrary.tool.d.ts.map +0 -1
- package/lib/services/agent/tools/searchUserLibrary.tool.js +0 -58
- package/lib/services/agent/ttsDuration.d.ts +0 -29
- package/lib/services/agent/ttsDuration.d.ts.map +0 -1
- package/lib/services/agent/ttsDuration.js +0 -60
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts +0 -31
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.d.ts.map +0 -1
- package/lib/services/aiGen/canonicalAdapters/cameraControl.types.js +0 -2
- package/lib/services/aiGen/canonicalAdapters/index.d.ts +0 -3
- package/lib/services/aiGen/canonicalAdapters/index.d.ts.map +0 -1
- package/lib/services/aiGen/canonicalAdapters/index.js +0 -18
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts +0 -23
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.d.ts.map +0 -1
- package/lib/services/aiGen/canonicalAdapters/multiShot.types.js +0 -12
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.d.ts +0 -18
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.d.ts.map +0 -1
- package/lib/services/aiGen/providers/elevenlabs/elevenlabs.service.js +0 -102
- package/lib/services/aiGen/providers/fal/falImage.service.d.ts +0 -15
- package/lib/services/aiGen/providers/fal/falImage.service.d.ts.map +0 -1
- package/lib/services/aiGen/providers/fal/falImage.service.js +0 -141
- package/lib/services/aiGen/providers/fal/index.d.ts +0 -2
- package/lib/services/aiGen/providers/fal/index.d.ts.map +0 -1
- package/lib/services/aiGen/providers/fal/index.js +0 -17
- package/lib/services/aiGen/providers/kling/cameraAdapter.d.ts +0 -4
- package/lib/services/aiGen/providers/kling/cameraAdapter.d.ts.map +0 -1
- package/lib/services/aiGen/providers/kling/cameraAdapter.js +0 -53
- package/lib/services/aiGen/providers/kling/klingImage.service.d.ts +0 -21
- package/lib/services/aiGen/providers/kling/klingImage.service.d.ts.map +0 -1
- package/lib/services/aiGen/providers/kling/klingImage.service.js +0 -208
- package/lib/services/aiGen/providers/pexels/index.d.ts +0 -2
- package/lib/services/aiGen/providers/pexels/index.d.ts.map +0 -1
- package/lib/services/aiGen/providers/pexels/pexels.service.d.ts +0 -11
- package/lib/services/aiGen/providers/pexels/pexels.service.d.ts.map +0 -1
- package/lib/services/aiGen/providers/pexels/pexels.service.js +0 -150
- package/lib/services/aiGen/providers/pixabay/index.d.ts +0 -2
- package/lib/services/aiGen/providers/pixabay/index.d.ts.map +0 -1
- package/lib/services/aiGen/providers/pixabay/index.js +0 -17
- package/lib/services/aiGen/providers/pixabay/pixabay.service.d.ts +0 -12
- package/lib/services/aiGen/providers/pixabay/pixabay.service.d.ts.map +0 -1
- package/lib/services/aiGen/providers/pixabay/pixabay.service.js +0 -156
- package/lib/services/aiGen/providers/runway/cameraAdapter.d.ts +0 -3
- package/lib/services/aiGen/providers/runway/cameraAdapter.d.ts.map +0 -1
- package/lib/services/aiGen/providers/runway/cameraAdapter.js +0 -46
- package/lib/services/aiGen/providers/unsplash/index.d.ts +0 -2
- package/lib/services/aiGen/providers/unsplash/index.d.ts.map +0 -1
- package/lib/services/aiGen/providers/unsplash/index.js +0 -17
- package/lib/services/aiGen/providers/unsplash/unsplash.service.d.ts +0 -16
- package/lib/services/aiGen/providers/unsplash/unsplash.service.d.ts.map +0 -1
- package/lib/services/aiGen/providers/unsplash/unsplash.service.js +0 -131
- package/lib/services/apiUsageCounter.service.d.ts +0 -20
- package/lib/services/apiUsageCounter.service.d.ts.map +0 -1
- package/lib/services/apiUsageCounter.service.js +0 -84
- package/lib/services/asr/assemblyai.service.d.ts +0 -72
- package/lib/services/asr/assemblyai.service.d.ts.map +0 -1
- package/lib/services/asr/assemblyai.service.js +0 -89
- package/lib/services/asr/index.d.ts +0 -3
- package/lib/services/asr/index.d.ts.map +0 -1
- package/lib/services/asr/index.js +0 -18
- package/lib/services/asr/whisper.service.d.ts +0 -18
- package/lib/services/asr/whisper.service.d.ts.map +0 -1
- package/lib/services/asr/whisper.service.js +0 -151
- package/lib/services/assetCache.service.d.ts +0 -54
- package/lib/services/assetCache.service.d.ts.map +0 -1
- package/lib/services/assetCache.service.js +0 -109
- package/lib/services/audioAnalysis/index.d.ts +0 -2
- package/lib/services/audioAnalysis/index.d.ts.map +0 -1
- package/lib/services/audioAnalysis/index.js +0 -17
- package/lib/services/audioAnalysis/onsetDetection.service.d.ts +0 -50
- package/lib/services/audioAnalysis/onsetDetection.service.d.ts.map +0 -1
- package/lib/services/audioAnalysis/onsetDetection.service.js +0 -140
- package/lib/services/credits/pricing.d.ts +0 -58
- package/lib/services/credits/pricing.d.ts.map +0 -1
- package/lib/services/credits/pricing.js +0 -111
- package/lib/services/editor/designToProject.d.ts +0 -75
- package/lib/services/editor/designToProject.d.ts.map +0 -1
- package/lib/services/editor/designToProject.js +0 -295
- package/lib/services/editor/planToProject.d.ts +0 -84
- package/lib/services/editor/planToProject.d.ts.map +0 -1
- package/lib/services/editor/planToProject.js +0 -395
- package/lib/services/editor/projectToDesign.d.ts +0 -4
- package/lib/services/editor/projectToDesign.d.ts.map +0 -1
- package/lib/services/editor/projectToDesign.js +0 -186
- package/lib/services/gcp/uploadAudioBuffer.d.ts +0 -13
- package/lib/services/gcp/uploadAudioBuffer.d.ts.map +0 -1
- package/lib/services/gcp/uploadAudioBuffer.js +0 -28
- package/lib/services/musicGen/index.d.ts +0 -6
- package/lib/services/musicGen/index.d.ts.map +0 -1
- package/lib/services/musicGen/index.js +0 -26
- package/lib/services/musicGen/musicSearchFactory.service.d.ts +0 -14
- package/lib/services/musicGen/musicSearchFactory.service.d.ts.map +0 -1
- package/lib/services/musicGen/musicSearchFactory.service.js +0 -59
- package/lib/services/musicGen/providers/curated.service.d.ts +0 -24
- package/lib/services/musicGen/providers/curated.service.d.ts.map +0 -1
- package/lib/services/musicGen/providers/curated.service.js +0 -173
- package/lib/services/musicGen/providers/jamendo.service.d.ts +0 -8
- package/lib/services/musicGen/providers/jamendo.service.d.ts.map +0 -1
- package/lib/services/musicGen/providers/jamendo.service.js +0 -113
- package/lib/services/musicGen/providers/mubert.service.d.ts +0 -10
- package/lib/services/musicGen/providers/mubert.service.d.ts.map +0 -1
- package/lib/services/musicGen/providers/mubert.service.js +0 -128
- package/lib/services/musicGen/types.d.ts +0 -46
- package/lib/services/musicGen/types.d.ts.map +0 -1
- package/lib/services/musicGen/types.js +0 -10
- package/lib/services/notification.service.d.ts +0 -22
- package/lib/services/notification.service.d.ts.map +0 -1
- package/lib/services/notification.service.js +0 -76
- package/lib/services/rateLimiter/distributedRateLimiter.service.d.ts +0 -78
- package/lib/services/rateLimiter/distributedRateLimiter.service.d.ts.map +0 -1
- package/lib/services/rateLimiter/distributedRateLimiter.service.js +0 -269
- package/lib/services/rateLimiter/index.d.ts +0 -2
- package/lib/services/rateLimiter/index.d.ts.map +0 -1
- package/lib/services/rateLimiter/index.js +0 -17
- package/lib/services/redisOptions.d.ts +0 -22
- package/lib/services/redisOptions.d.ts.map +0 -1
- package/lib/services/redisOptions.js +0 -51
- package/lib/services/tts/providers/minimax.service.d.ts +0 -14
- package/lib/services/tts/providers/minimax.service.d.ts.map +0 -1
- package/lib/services/tts/providers/minimax.service.js +0 -78
- package/lib/services/tts/providers/openai.service.d.ts +0 -14
- package/lib/services/tts/providers/openai.service.d.ts.map +0 -1
- package/lib/services/tts/providers/openai.service.js +0 -73
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.outcomeToRenderOutcome = outcomeToRenderOutcome;
|
|
4
|
-
exports.resolveVoiceoverUrl = resolveVoiceoverUrl;
|
|
5
|
-
exports.writeAgentProjectShell = writeAgentProjectShell;
|
|
6
|
-
exports.writeAgentProjectIncremental = writeAgentProjectIncremental;
|
|
7
|
-
const node_child_process_1 = require("node:child_process");
|
|
8
|
-
const node_fs_1 = require("node:fs");
|
|
9
|
-
const node_os_1 = require("node:os");
|
|
10
|
-
const node_path_1 = require("node:path");
|
|
11
|
-
const planToProject_1 = require("../editor/planToProject");
|
|
12
|
-
const uploadAudioBuffer_1 = require("../gcp/uploadAudioBuffer");
|
|
13
|
-
const firestore_service_1 = require("../firestore.service");
|
|
14
|
-
const costPreflight_1 = require("./costPreflight");
|
|
15
|
-
const logger_1 = require("../../utils/logger");
|
|
16
|
-
/**
|
|
17
|
-
* Probe an audio buffer's actual playback duration via ffprobe. Writes the
|
|
18
|
-
* buffer to a temp file because ffprobe over stdin is finicky with mp3
|
|
19
|
-
* containers that lack a leading frame header. Returns ms (rounded), or
|
|
20
|
-
* undefined if ffprobe isn't available or the buffer is unreadable —
|
|
21
|
-
* callers fall back to the wpm estimate in that case.
|
|
22
|
-
*/
|
|
23
|
-
async function probeAudioBufferMs(buffer, extension) {
|
|
24
|
-
const dir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "vo-probe-"));
|
|
25
|
-
const file = (0, node_path_1.join)(dir, `vo.${extension.replace(/^\./, "") || "mp3"}`);
|
|
26
|
-
try {
|
|
27
|
-
(0, node_fs_1.writeFileSync)(file, buffer);
|
|
28
|
-
const seconds = await new Promise((resolve, reject) => {
|
|
29
|
-
const child = (0, node_child_process_1.spawn)("ffprobe", [
|
|
30
|
-
"-v", "error",
|
|
31
|
-
"-show_entries", "format=duration",
|
|
32
|
-
"-of", "csv=p=0",
|
|
33
|
-
file,
|
|
34
|
-
]);
|
|
35
|
-
let out = "";
|
|
36
|
-
let err = "";
|
|
37
|
-
child.stdout.on("data", (d) => (out += d.toString()));
|
|
38
|
-
child.stderr.on("data", (d) => (err += d.toString()));
|
|
39
|
-
child.on("error", reject);
|
|
40
|
-
child.on("exit", (code) => code === 0
|
|
41
|
-
? resolve(parseFloat(out.trim()))
|
|
42
|
-
: reject(new Error(`ffprobe exited ${code}: ${err.slice(0, 120)}`)));
|
|
43
|
-
});
|
|
44
|
-
if (!Number.isFinite(seconds) || seconds <= 0)
|
|
45
|
-
return undefined;
|
|
46
|
-
return Math.round(seconds * 1000);
|
|
47
|
-
}
|
|
48
|
-
finally {
|
|
49
|
-
(0, node_fs_1.rmSync)(dir, { recursive: true, force: true });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
const isoNow = () => new Date().toISOString();
|
|
53
|
-
/**
|
|
54
|
-
* Map an Executor SceneOutcome to the SceneRenderOutcome shape planToProject
|
|
55
|
-
* expects. Reads `voiceoverUrl` (set by resolveVoiceoverUrl before this
|
|
56
|
-
* runs) — not the base64, which would blow Firestore's 1 MiB doc cap.
|
|
57
|
-
*
|
|
58
|
-
* Lifted from agent.controller.ts so both the slimmed controller and the
|
|
59
|
-
* Stage 1 agentRunWorker can import it.
|
|
60
|
-
*/
|
|
61
|
-
function outcomeToRenderOutcome(outcome) {
|
|
62
|
-
if (!outcome.ok || !outcome.result)
|
|
63
|
-
return undefined;
|
|
64
|
-
return {
|
|
65
|
-
visualUrl: outcome.result.visualUrl,
|
|
66
|
-
voiceoverUrl: outcome.result.voiceoverUrl,
|
|
67
|
-
// Prefer probed actual ms (stamped in resolveVoiceoverUrl) over the
|
|
68
|
-
// wpm estimate — the estimate undershoots emotive/punctuated lines by
|
|
69
|
-
// 400–900ms and the editor's Remotion Audio hard-truncates at endAt.
|
|
70
|
-
voiceoverDurationMs: outcome.result.voiceoverActualMs ?? outcome.result.voiceoverEstimateMs,
|
|
71
|
-
modelKey: outcome.result.pendingModelKey ?? outcome.scene.preferredModel,
|
|
72
|
-
attemptedProviders: outcome.result.attemptedProviders,
|
|
73
|
-
generationId: outcome.result.idempotencyKey,
|
|
74
|
-
// Symmetric with plan-side `estimatePlanCost`: T0 scenes that emit
|
|
75
|
-
// estimatedCredits=0 from the planner fall back to the per-second
|
|
76
|
-
// tier curve so the editor's cost chip + agent reconciliation match.
|
|
77
|
-
creditsSpent: (0, costPreflight_1.estimateSceneCredits)(outcome.scene),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Stage 6.e — voiceover persistence. If the scene's executor outcome has
|
|
82
|
-
* base64 audio (ElevenLabs / generate_voiceover tool output), upload it to
|
|
83
|
-
* Firebase Storage and mutate the outcome in place so downstream
|
|
84
|
-
* planToProject calls see a real URL. Idempotent: a second call with the
|
|
85
|
-
* same outcome (already URL-resolved) is a no-op. Cleans the base64 off
|
|
86
|
-
* the outcome after upload so the Firestore write doesn't ship the buffer.
|
|
87
|
-
*
|
|
88
|
-
* C14: critical for keeping the agentRuns doc under the 1 MiB limit.
|
|
89
|
-
*/
|
|
90
|
-
async function resolveVoiceoverUrl(outcome, projectId) {
|
|
91
|
-
if (!outcome.ok || !outcome.result)
|
|
92
|
-
return;
|
|
93
|
-
const result = outcome.result;
|
|
94
|
-
if (!result.voiceoverAudioBase64 || result.voiceoverUrl)
|
|
95
|
-
return;
|
|
96
|
-
const buffer = Buffer.from(result.voiceoverAudioBase64, "base64");
|
|
97
|
-
// Probe BEFORE we discard the buffer. Soft-fails: if ffprobe isn't on the
|
|
98
|
-
// worker (shouldn't happen — stitcher needs it too) the wpm estimate is
|
|
99
|
-
// still on result.voiceoverEstimateMs and planToProject falls back to it.
|
|
100
|
-
try {
|
|
101
|
-
const actualMs = await probeAudioBufferMs(buffer, "mp3");
|
|
102
|
-
if (actualMs && actualMs > 0) {
|
|
103
|
-
result.voiceoverActualMs = actualMs;
|
|
104
|
-
const estimate = result.voiceoverEstimateMs ?? 0;
|
|
105
|
-
const drift = actualMs - estimate;
|
|
106
|
-
if (Math.abs(drift) > 250) {
|
|
107
|
-
logger_1.logger.info("agent.vo.durationDrift", {
|
|
108
|
-
projectId,
|
|
109
|
-
sceneIndex: outcome.scene.sceneIndex,
|
|
110
|
-
estimateMs: estimate,
|
|
111
|
-
actualMs,
|
|
112
|
-
driftMs: drift,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
catch (err) {
|
|
118
|
-
logger_1.logger.warn("agent.vo.probeFailed", {
|
|
119
|
-
projectId,
|
|
120
|
-
sceneIndex: outcome.scene.sceneIndex,
|
|
121
|
-
err: err.message,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
const destination = `agent-projects/${projectId}/vo/scene-${outcome.scene.sceneIndex}-${Date.now()}.mp3`;
|
|
125
|
-
const url = await (0, uploadAudioBuffer_1.uploadAudioBufferToGcs)(buffer, destination);
|
|
126
|
-
result.voiceoverUrl = url;
|
|
127
|
-
// Drop base64 once URL is stamped so the Firestore write stays small.
|
|
128
|
-
result.voiceoverAudioBase64 = undefined;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Stage 3 — write the initial Project shell after the planner approves a
|
|
132
|
-
* plan. All scene clips exist with placeholder URLs so editor + drawer
|
|
133
|
-
* surfaces light up immediately; the executor will fill in real URLs
|
|
134
|
-
* scene-by-scene via the incremental write below.
|
|
135
|
-
*
|
|
136
|
-
* C23: critical for keeping the editor / drawer from sitting on an empty
|
|
137
|
-
* timeline for 20+ minutes while the worker runs.
|
|
138
|
-
*/
|
|
139
|
-
async function writeAgentProjectShell(projectId, plan, agentRunId) {
|
|
140
|
-
try {
|
|
141
|
-
const shell = (0, planToProject_1.planToProject)({
|
|
142
|
-
plan,
|
|
143
|
-
outcomes: {},
|
|
144
|
-
projectId,
|
|
145
|
-
name: `Agent project ${projectId.slice(0, 8)}`,
|
|
146
|
-
agentRunId,
|
|
147
|
-
});
|
|
148
|
-
await firestore_service_1.FirestoreService.agentProjectsCol.doc(projectId).update({
|
|
149
|
-
projectJson: shell,
|
|
150
|
-
updatedAt: isoNow(),
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
catch (err) {
|
|
154
|
-
// C25: shell write is best-effort. If it fails, the final write at end
|
|
155
|
-
// of the worker still produces a valid Project; this just delays the
|
|
156
|
-
// UI lighting up.
|
|
157
|
-
logger_1.logger.warn("agent.run.shellWrite", {
|
|
158
|
-
projectId,
|
|
159
|
-
err: err.message,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Stage 3 — write a partially-completed Project after each scene
|
|
165
|
-
* finishes. Rebuilds the full Project from plan + accumulated outcomes
|
|
166
|
-
* so far (planToProject is pure + cheap), then writes once. Best-effort:
|
|
167
|
-
* errors logged but not propagated so a Firestore blip doesn't crash
|
|
168
|
-
* the worker mid-run.
|
|
169
|
-
*
|
|
170
|
-
* C24 / C25: per-scene incremental update + soft-fail behavior.
|
|
171
|
-
*/
|
|
172
|
-
async function writeAgentProjectIncremental(projectId, plan, outcomesSoFar, agentRunId) {
|
|
173
|
-
try {
|
|
174
|
-
const renderOutcomes = {};
|
|
175
|
-
for (const [k, o] of Object.entries(outcomesSoFar)) {
|
|
176
|
-
renderOutcomes[Number(k)] = outcomeToRenderOutcome(o);
|
|
177
|
-
}
|
|
178
|
-
const projectJson = (0, planToProject_1.planToProject)({
|
|
179
|
-
plan,
|
|
180
|
-
outcomes: renderOutcomes,
|
|
181
|
-
projectId,
|
|
182
|
-
name: `Agent project ${projectId.slice(0, 8)}`,
|
|
183
|
-
agentRunId,
|
|
184
|
-
});
|
|
185
|
-
await firestore_service_1.FirestoreService.agentProjectsCol.doc(projectId).update({
|
|
186
|
-
projectJson,
|
|
187
|
-
updatedAt: isoNow(),
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
catch (err) {
|
|
191
|
-
logger_1.logger.warn("agent.run.incrementalWrite", {
|
|
192
|
-
projectId,
|
|
193
|
-
err: err.message,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Text-layout v1 — per-scene asset vision pass.
|
|
3
|
-
*
|
|
4
|
-
* Background: text-layout-spike.md proposes per-scene composition decisions
|
|
5
|
-
* (full-bleed / blur-fill / split / pip) driven by what's actually in the
|
|
6
|
-
* scene asset — center-framed subject, talking head, b-roll, etc. The
|
|
7
|
-
* planner can guess from intent text, but the only way to know reliably is
|
|
8
|
-
* to look at the rendered first frame.
|
|
9
|
-
*
|
|
10
|
-
* This service classifies one image URL using Gemini-2.5-Flash and returns
|
|
11
|
-
* a structured signal the layout decision tree can consume:
|
|
12
|
-
* - contentType: "center" | "edges" | "face" | "broll"
|
|
13
|
-
* - focalPoint: normalized {x, y} pointing at the subject's center
|
|
14
|
-
*
|
|
15
|
-
* Cost: ~$0.002 per scene (1024×1024 image ≈ 258 tokens × $0.075/1M for
|
|
16
|
-
* Gemini Flash). Folded into the existing per-scene cost note in
|
|
17
|
-
* agent-billing.md.
|
|
18
|
-
*
|
|
19
|
-
* Mirrors the structure of bibleImageVision.ts — same auth, same MIME
|
|
20
|
-
* handling, same per-scene isolation: a failure leaves layout unset so the
|
|
21
|
-
* planner's text-based guess wins.
|
|
22
|
-
*/
|
|
23
|
-
export type SceneContentType = "center" | "edges" | "face" | "broll";
|
|
24
|
-
/**
|
|
25
|
-
* Luminance band per region of the frame. Drives the auto-contrast pass that
|
|
26
|
-
* picks a per-overlay bgStyle (shadow / pill / bar) based on where the
|
|
27
|
-
* overlay sits and how busy that region is.
|
|
28
|
-
*
|
|
29
|
-
* bright = mean luminance > 0.55 → dark text or solid bg needed
|
|
30
|
-
* dark = mean luminance < 0.4 → white text fine, light shadow optional
|
|
31
|
-
* mid = in between → solid bg recommended (pill or bar)
|
|
32
|
-
* busy = high variance → solid bg required regardless of luminance
|
|
33
|
-
*/
|
|
34
|
-
export type LuminanceBand = "bright" | "dark" | "mid" | "busy";
|
|
35
|
-
export interface SceneLayoutVisionResult {
|
|
36
|
-
contentType: SceneContentType;
|
|
37
|
-
focalPoint: {
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
};
|
|
41
|
-
/** Luminance per region; keys correspond to text-position families. */
|
|
42
|
-
regions: {
|
|
43
|
-
top: LuminanceBand;
|
|
44
|
-
center: LuminanceBand;
|
|
45
|
-
bottom: LuminanceBand;
|
|
46
|
-
};
|
|
47
|
-
/** Raw model text, retained for debugging. */
|
|
48
|
-
raw: string;
|
|
49
|
-
}
|
|
50
|
-
export interface SceneLayoutVisionConfig {
|
|
51
|
-
apiKey: string;
|
|
52
|
-
model?: string;
|
|
53
|
-
timeoutMs?: number;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Classify one scene asset. Returns null on any error — caller treats null
|
|
57
|
-
* as "no vision signal" and falls back to planner-emitted layout or default.
|
|
58
|
-
*/
|
|
59
|
-
export declare function classifySceneLayout(imageUrl: string, config: SceneLayoutVisionConfig): Promise<SceneLayoutVisionResult | null>;
|
|
60
|
-
/**
|
|
61
|
-
* Pick a `composition` value from a vision signal + source/target aspects.
|
|
62
|
-
* Mirrors the decision tree in text-layout-spike.md. The planner may have
|
|
63
|
-
* already set scene.layout.composition; treat that as the prior and only
|
|
64
|
-
* override here when (a) the planner left it unset, or (b) the vision
|
|
65
|
-
* classification clearly contradicts the planner choice.
|
|
66
|
-
*
|
|
67
|
-
* `sourceAspect` / `targetAspect` are width / height ratios (e.g. 16/9 = 1.78).
|
|
68
|
-
*/
|
|
69
|
-
export declare function pickCompositionFromVision(vision: SceneLayoutVisionResult, sourceAspectRatio: number, targetAspectRatio: number): "full-bleed" | "letterbox" | "blur-fill" | "split-top" | "split-bottom" | "pip-bottom-right";
|
|
70
|
-
/**
|
|
71
|
-
* Map a TextPosition to the luminance region that sits under it. Used by
|
|
72
|
-
* the auto-contrast pass to pick a per-overlay bgStyle / color.
|
|
73
|
-
*/
|
|
74
|
-
export declare function regionForPosition(position: string | undefined): "top" | "center" | "bottom";
|
|
75
|
-
/**
|
|
76
|
-
* Pick a (bgStyle, color) pair for an overlay sitting on a given luminance
|
|
77
|
-
* region. The four bands map to clear treatments:
|
|
78
|
-
* bright → dark text + pill bg (white text would vanish)
|
|
79
|
-
* dark → white text + shadow (cheap, doesn't fight content)
|
|
80
|
-
* mid → white text + pill bg (uniform tone reads fine with chrome)
|
|
81
|
-
* busy → white text + bar bg (only solid fill kills the noise)
|
|
82
|
-
*
|
|
83
|
-
* Returns `null` when the overlay already has an explicit bgStyle from the
|
|
84
|
-
* planner — auto-contrast is a fallback, never overrides intentional choices.
|
|
85
|
-
*/
|
|
86
|
-
export declare function autoContrastFor(band: LuminanceBand): {
|
|
87
|
-
bgStyle: "shadow" | "pill" | "bar";
|
|
88
|
-
color: string;
|
|
89
|
-
};
|
|
90
|
-
//# sourceMappingURL=sceneLayoutVision.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sceneLayoutVision.d.ts","sourceRoot":"","sources":["../../../src/services/agent/sceneLayoutVision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,UAAU,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,uEAAuE;IACvE,OAAO,EAAE;QACP,GAAG,EAAE,aAAa,CAAC;QACnB,MAAM,EAAE,aAAa,CAAC;QACtB,MAAM,EAAE,aAAa,CAAC;KACvB,CAAC;IACF,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgCD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAuDzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,uBAAuB,EAC/B,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,GACxB,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,kBAAkB,CAqB9F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAkB7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,aAAa,GAClB;IAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAWvD"}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Text-layout v1 — per-scene asset vision pass.
|
|
4
|
-
*
|
|
5
|
-
* Background: text-layout-spike.md proposes per-scene composition decisions
|
|
6
|
-
* (full-bleed / blur-fill / split / pip) driven by what's actually in the
|
|
7
|
-
* scene asset — center-framed subject, talking head, b-roll, etc. The
|
|
8
|
-
* planner can guess from intent text, but the only way to know reliably is
|
|
9
|
-
* to look at the rendered first frame.
|
|
10
|
-
*
|
|
11
|
-
* This service classifies one image URL using Gemini-2.5-Flash and returns
|
|
12
|
-
* a structured signal the layout decision tree can consume:
|
|
13
|
-
* - contentType: "center" | "edges" | "face" | "broll"
|
|
14
|
-
* - focalPoint: normalized {x, y} pointing at the subject's center
|
|
15
|
-
*
|
|
16
|
-
* Cost: ~$0.002 per scene (1024×1024 image ≈ 258 tokens × $0.075/1M for
|
|
17
|
-
* Gemini Flash). Folded into the existing per-scene cost note in
|
|
18
|
-
* agent-billing.md.
|
|
19
|
-
*
|
|
20
|
-
* Mirrors the structure of bibleImageVision.ts — same auth, same MIME
|
|
21
|
-
* handling, same per-scene isolation: a failure leaves layout unset so the
|
|
22
|
-
* planner's text-based guess wins.
|
|
23
|
-
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.classifySceneLayout = classifySceneLayout;
|
|
26
|
-
exports.pickCompositionFromVision = pickCompositionFromVision;
|
|
27
|
-
exports.regionForPosition = regionForPosition;
|
|
28
|
-
exports.autoContrastFor = autoContrastFor;
|
|
29
|
-
const genai_1 = require("@google/genai");
|
|
30
|
-
const logger_1 = require("../../utils/logger");
|
|
31
|
-
const DEFAULT_MODEL = "gemini-2.5-flash";
|
|
32
|
-
const CLASSIFY_PROMPT = [
|
|
33
|
-
"Classify this image for video composition.",
|
|
34
|
-
"Reply in this EXACT format on a single line, nothing else:",
|
|
35
|
-
"contentType=<center|edges|face|broll>; focal=<x>,<y>; lum=<top>,<center>,<bottom>",
|
|
36
|
-
"",
|
|
37
|
-
"Where contentType is:",
|
|
38
|
-
"- center: the main subject is centered and crop-safe",
|
|
39
|
-
"- edges: the key elements sit near the edges (wide scene, text/logos at margins)",
|
|
40
|
-
"- face: a person's face is the subject (talking head, portrait)",
|
|
41
|
-
"- broll: abstract / b-roll / no key subject (pattern, landscape, generic motion)",
|
|
42
|
-
"",
|
|
43
|
-
"focal is the (x,y) of the subject's center, normalized 0.0–1.0 where",
|
|
44
|
-
"(0,0)=top-left and (1,1)=bottom-right. For broll/no subject, use 0.5,0.5.",
|
|
45
|
-
"",
|
|
46
|
-
"lum reports the brightness/busyness of three horizontal bands (top third,",
|
|
47
|
-
"middle third, bottom third). Each band is ONE of: bright, dark, mid, busy.",
|
|
48
|
-
"- bright: predominantly light (white/pale)",
|
|
49
|
-
"- dark: predominantly dark",
|
|
50
|
-
"- mid: medium tone, fairly uniform",
|
|
51
|
-
"- busy: high contrast variation (a mix of light and dark with detail) —",
|
|
52
|
-
" text without a solid background would be unreadable here",
|
|
53
|
-
"",
|
|
54
|
-
'Example: "contentType=face; focal=0.5,0.35; lum=mid,bright,dark"',
|
|
55
|
-
].join("\n");
|
|
56
|
-
const RESPONSE_RE = /contentType\s*=\s*(center|edges|face|broll)\s*;\s*focal\s*=\s*([\d.]+)\s*,\s*([\d.]+)\s*;\s*lum\s*=\s*(bright|dark|mid|busy)\s*,\s*(bright|dark|mid|busy)\s*,\s*(bright|dark|mid|busy)/i;
|
|
57
|
-
/**
|
|
58
|
-
* Classify one scene asset. Returns null on any error — caller treats null
|
|
59
|
-
* as "no vision signal" and falls back to planner-emitted layout or default.
|
|
60
|
-
*/
|
|
61
|
-
async function classifySceneLayout(imageUrl, config) {
|
|
62
|
-
const model = config.model ?? DEFAULT_MODEL;
|
|
63
|
-
const timeoutMs = config.timeoutMs ?? 20000;
|
|
64
|
-
const ai = new genai_1.GoogleGenAI({ apiKey: config.apiKey });
|
|
65
|
-
try {
|
|
66
|
-
const controller = new AbortController();
|
|
67
|
-
const t = setTimeout(() => controller.abort(), timeoutMs);
|
|
68
|
-
let bytes;
|
|
69
|
-
let mimeType;
|
|
70
|
-
try {
|
|
71
|
-
const r = await fetch(imageUrl, { signal: controller.signal });
|
|
72
|
-
if (!r.ok)
|
|
73
|
-
throw new Error(`fetch ${r.status} ${r.statusText}`);
|
|
74
|
-
bytes = Buffer.from(await r.arrayBuffer());
|
|
75
|
-
mimeType = pickImageMimeType(r.headers.get("content-type"), imageUrl);
|
|
76
|
-
}
|
|
77
|
-
finally {
|
|
78
|
-
clearTimeout(t);
|
|
79
|
-
}
|
|
80
|
-
const resp = await ai.models.generateContent({
|
|
81
|
-
model,
|
|
82
|
-
contents: [
|
|
83
|
-
{
|
|
84
|
-
role: "user",
|
|
85
|
-
parts: [
|
|
86
|
-
{ text: CLASSIFY_PROMPT },
|
|
87
|
-
{ inlineData: { mimeType, data: bytes.toString("base64") } },
|
|
88
|
-
],
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
config: { temperature: 0 },
|
|
92
|
-
});
|
|
93
|
-
const raw = (resp.text ?? "").trim();
|
|
94
|
-
const m = RESPONSE_RE.exec(raw);
|
|
95
|
-
if (!m) {
|
|
96
|
-
logger_1.logger.warn("sceneLayoutVision: unparseable response", { raw, imageUrl });
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
const contentType = m[1].toLowerCase();
|
|
100
|
-
const fx = clamp01(Number(m[2]));
|
|
101
|
-
const fy = clamp01(Number(m[3]));
|
|
102
|
-
const regions = {
|
|
103
|
-
top: m[4].toLowerCase(),
|
|
104
|
-
center: m[5].toLowerCase(),
|
|
105
|
-
bottom: m[6].toLowerCase(),
|
|
106
|
-
};
|
|
107
|
-
return { contentType, focalPoint: { x: fx, y: fy }, regions, raw };
|
|
108
|
-
}
|
|
109
|
-
catch (err) {
|
|
110
|
-
logger_1.logger.warn("sceneLayoutVision: failed", {
|
|
111
|
-
imageUrl,
|
|
112
|
-
error: err instanceof Error ? err.message : String(err),
|
|
113
|
-
});
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Pick a `composition` value from a vision signal + source/target aspects.
|
|
119
|
-
* Mirrors the decision tree in text-layout-spike.md. The planner may have
|
|
120
|
-
* already set scene.layout.composition; treat that as the prior and only
|
|
121
|
-
* override here when (a) the planner left it unset, or (b) the vision
|
|
122
|
-
* classification clearly contradicts the planner choice.
|
|
123
|
-
*
|
|
124
|
-
* `sourceAspect` / `targetAspect` are width / height ratios (e.g. 16/9 = 1.78).
|
|
125
|
-
*/
|
|
126
|
-
function pickCompositionFromVision(vision, sourceAspectRatio, targetAspectRatio) {
|
|
127
|
-
const sameAspect = Math.abs(sourceAspectRatio - targetAspectRatio) < 0.05;
|
|
128
|
-
if (sameAspect)
|
|
129
|
-
return "full-bleed";
|
|
130
|
-
// Source is wider than target (e.g. 16:9 stock on 9:16 TikTok).
|
|
131
|
-
if (sourceAspectRatio > targetAspectRatio + 0.1) {
|
|
132
|
-
switch (vision.contentType) {
|
|
133
|
-
case "center":
|
|
134
|
-
return "full-bleed"; // safe to crop sides
|
|
135
|
-
case "face":
|
|
136
|
-
return "blur-fill"; // keep whole face in frame
|
|
137
|
-
case "edges":
|
|
138
|
-
return "blur-fill"; // crop would lose key elements
|
|
139
|
-
case "broll":
|
|
140
|
-
return "split-bottom"; // good for caption-strip overlays on bottom
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
// Source is taller than target (e.g. 9:16 on 16:9 desktop).
|
|
144
|
-
// Vertical assets on horizontal targets can't fill cleanly — PIP it.
|
|
145
|
-
return "pip-bottom-right";
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Map a TextPosition to the luminance region that sits under it. Used by
|
|
149
|
-
* the auto-contrast pass to pick a per-overlay bgStyle / color.
|
|
150
|
-
*/
|
|
151
|
-
function regionForPosition(position) {
|
|
152
|
-
switch (position) {
|
|
153
|
-
case "top":
|
|
154
|
-
case "top-left":
|
|
155
|
-
case "top-right":
|
|
156
|
-
case "top-banner":
|
|
157
|
-
return "top";
|
|
158
|
-
case "center":
|
|
159
|
-
case "left-rail":
|
|
160
|
-
return "center";
|
|
161
|
-
case "lower-third":
|
|
162
|
-
case "bottom":
|
|
163
|
-
case "bottom-left":
|
|
164
|
-
case "bottom-right":
|
|
165
|
-
case "caption-strip":
|
|
166
|
-
default:
|
|
167
|
-
return "bottom";
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Pick a (bgStyle, color) pair for an overlay sitting on a given luminance
|
|
172
|
-
* region. The four bands map to clear treatments:
|
|
173
|
-
* bright → dark text + pill bg (white text would vanish)
|
|
174
|
-
* dark → white text + shadow (cheap, doesn't fight content)
|
|
175
|
-
* mid → white text + pill bg (uniform tone reads fine with chrome)
|
|
176
|
-
* busy → white text + bar bg (only solid fill kills the noise)
|
|
177
|
-
*
|
|
178
|
-
* Returns `null` when the overlay already has an explicit bgStyle from the
|
|
179
|
-
* planner — auto-contrast is a fallback, never overrides intentional choices.
|
|
180
|
-
*/
|
|
181
|
-
function autoContrastFor(band) {
|
|
182
|
-
switch (band) {
|
|
183
|
-
case "bright":
|
|
184
|
-
return { bgStyle: "pill", color: "#0b1220" };
|
|
185
|
-
case "dark":
|
|
186
|
-
return { bgStyle: "shadow", color: "#ffffff" };
|
|
187
|
-
case "mid":
|
|
188
|
-
return { bgStyle: "pill", color: "#ffffff" };
|
|
189
|
-
case "busy":
|
|
190
|
-
return { bgStyle: "bar", color: "#ffffff" };
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
function clamp01(n) {
|
|
194
|
-
if (!Number.isFinite(n))
|
|
195
|
-
return 0.5;
|
|
196
|
-
return Math.max(0, Math.min(1, n));
|
|
197
|
-
}
|
|
198
|
-
function pickImageMimeType(headerType, url) {
|
|
199
|
-
const hdr = (headerType ?? "").split(";")[0]?.trim().toLowerCase() ?? "";
|
|
200
|
-
if (hdr.startsWith("image/"))
|
|
201
|
-
return hdr;
|
|
202
|
-
const lower = url.toLowerCase();
|
|
203
|
-
if (lower.includes(".png"))
|
|
204
|
-
return "image/png";
|
|
205
|
-
if (lower.includes(".webp"))
|
|
206
|
-
return "image/webp";
|
|
207
|
-
if (lower.includes(".gif"))
|
|
208
|
-
return "image/gif";
|
|
209
|
-
if (lower.includes(".heic"))
|
|
210
|
-
return "image/heic";
|
|
211
|
-
return "image/jpeg";
|
|
212
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { VideoPlan } from "../../schemas/videoPlan.schema";
|
|
2
|
-
/**
|
|
3
|
-
* AG-26: Stitched-video critic — the gate that catches everything the
|
|
4
|
-
* per-scene critic misses.
|
|
5
|
-
*
|
|
6
|
-
* The existing `Critic` operates on per-scene asset URLs + the plan. That
|
|
7
|
-
* misses anything that only becomes visible once the scenes are concatenated:
|
|
8
|
-
* - voiceover clipped / cut off / audibly truncated
|
|
9
|
-
* - jarring cuts (no rhythm, no music bed to disguise it)
|
|
10
|
-
* - character drift visible only when scenes play back-to-back
|
|
11
|
-
* - brand text degradation across cuts (the human eye notices "Hydropure
|
|
12
|
-
* → HydraPure → HydrraPure" instantly when watching; per-frame critique
|
|
13
|
-
* gives each scene a pass)
|
|
14
|
-
* - missing or 404 music track
|
|
15
|
-
* - overall pacing / hook → reveal → CTA arc as a viewer experiences it
|
|
16
|
-
*
|
|
17
|
-
* Implementation: call Gemini 2.5 Flash with the stitched MP4 file_uri.
|
|
18
|
-
* Gemini accepts video + audio natively, tokenizes ~258 tok/sec of video,
|
|
19
|
-
* so a 15s clip is ~4k input tokens → ~$0.0003 / critique. Essentially free.
|
|
20
|
-
*
|
|
21
|
-
* Returns structured findings in the same shape as the per-scene Critic so
|
|
22
|
-
* the orchestrator can merge both into a single review.
|
|
23
|
-
*/
|
|
24
|
-
import { z } from "zod";
|
|
25
|
-
export declare const StitchedVideoFindingSchema: z.ZodObject<{
|
|
26
|
-
severity: z.ZodEnum<{
|
|
27
|
-
fail: "fail";
|
|
28
|
-
warn: "warn";
|
|
29
|
-
pass: "pass";
|
|
30
|
-
}>;
|
|
31
|
-
dimension: z.ZodEnum<{
|
|
32
|
-
hookStrength: "hookStrength";
|
|
33
|
-
pacingFit: "pacingFit";
|
|
34
|
-
characterContinuity: "characterContinuity";
|
|
35
|
-
brandTextLegibility: "brandTextLegibility";
|
|
36
|
-
cutRhythm: "cutRhythm";
|
|
37
|
-
voiceoverClarity: "voiceoverClarity";
|
|
38
|
-
voiceoverEmotionMatch: "voiceoverEmotionMatch";
|
|
39
|
-
voiceoverPacing: "voiceoverPacing";
|
|
40
|
-
audioMixBalance: "audioMixBalance";
|
|
41
|
-
musicPresence: "musicPresence";
|
|
42
|
-
ctaPresence: "ctaPresence";
|
|
43
|
-
overallImpression: "overallImpression";
|
|
44
|
-
actionPlausibility: "actionPlausibility";
|
|
45
|
-
}>;
|
|
46
|
-
message: z.ZodString;
|
|
47
|
-
sceneIndexHint: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
export type StitchedVideoFinding = z.infer<typeof StitchedVideoFindingSchema>;
|
|
50
|
-
export declare const StitchedVideoReviewSchema: z.ZodObject<{
|
|
51
|
-
score: z.ZodNumber;
|
|
52
|
-
shippable: z.ZodBoolean;
|
|
53
|
-
summary: z.ZodString;
|
|
54
|
-
findings: z.ZodArray<z.ZodObject<{
|
|
55
|
-
severity: z.ZodEnum<{
|
|
56
|
-
fail: "fail";
|
|
57
|
-
warn: "warn";
|
|
58
|
-
pass: "pass";
|
|
59
|
-
}>;
|
|
60
|
-
dimension: z.ZodEnum<{
|
|
61
|
-
hookStrength: "hookStrength";
|
|
62
|
-
pacingFit: "pacingFit";
|
|
63
|
-
characterContinuity: "characterContinuity";
|
|
64
|
-
brandTextLegibility: "brandTextLegibility";
|
|
65
|
-
cutRhythm: "cutRhythm";
|
|
66
|
-
voiceoverClarity: "voiceoverClarity";
|
|
67
|
-
voiceoverEmotionMatch: "voiceoverEmotionMatch";
|
|
68
|
-
voiceoverPacing: "voiceoverPacing";
|
|
69
|
-
audioMixBalance: "audioMixBalance";
|
|
70
|
-
musicPresence: "musicPresence";
|
|
71
|
-
ctaPresence: "ctaPresence";
|
|
72
|
-
overallImpression: "overallImpression";
|
|
73
|
-
actionPlausibility: "actionPlausibility";
|
|
74
|
-
}>;
|
|
75
|
-
message: z.ZodString;
|
|
76
|
-
sceneIndexHint: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
}, z.core.$strip>>;
|
|
78
|
-
}, z.core.$strip>;
|
|
79
|
-
export type StitchedVideoReview = z.infer<typeof StitchedVideoReviewSchema>;
|
|
80
|
-
export interface StitchedVideoCriticInput {
|
|
81
|
-
/** Public/signed URL to the stitched MP4 (with audio). */
|
|
82
|
-
videoUrl: string;
|
|
83
|
-
/** Plan that produced the video — gives the critic the spec to grade against. */
|
|
84
|
-
plan: VideoPlan;
|
|
85
|
-
/**
|
|
86
|
-
* Optional Whisper transcript of the voiceover (audio-only diff against the
|
|
87
|
-
* planner's voiceoverLine values). When supplied, the critic uses it as
|
|
88
|
-
* ground truth instead of trying to lip-read.
|
|
89
|
-
*/
|
|
90
|
-
whisperTranscript?: string;
|
|
91
|
-
/**
|
|
92
|
-
* Optional ffmpeg-derived audio stats so the critic doesn't have to
|
|
93
|
-
* re-derive them: { meanDb, maxDb, longestSilenceMs }. Cheap pre-pass.
|
|
94
|
-
*/
|
|
95
|
-
audioStats?: {
|
|
96
|
-
meanDb?: number;
|
|
97
|
-
maxDb?: number;
|
|
98
|
-
longestSilenceMs?: number;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* AG-35: Ground-truth flags from the stitcher so the critic can't
|
|
102
|
-
* hallucinate audio elements that were never rendered. Gemini was
|
|
103
|
-
* confidently describing "calm piano music" on a track where the music
|
|
104
|
-
* URL 404'd and was dropped — feeding the actual stitch outcome in
|
|
105
|
-
* forces it to grade what was shipped, not what was planned.
|
|
106
|
-
*/
|
|
107
|
-
groundTruth?: {
|
|
108
|
-
hasVoiceover?: boolean;
|
|
109
|
-
hasMusic?: boolean;
|
|
110
|
-
/** Total audio track present on the muxed file (voice OR music). */
|
|
111
|
-
hasAudio?: boolean;
|
|
112
|
-
/** Notes about scenes that fell back, models that were skipped, etc. */
|
|
113
|
-
notes?: string[];
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Build the rubric prompt the Gemini call receives alongside the video. Kept
|
|
118
|
-
* outside the API caller so unit tests can snapshot it.
|
|
119
|
-
*/
|
|
120
|
-
export declare function buildStitchedCriticPrompt(input: StitchedVideoCriticInput): string;
|
|
121
|
-
/**
|
|
122
|
-
* Run the critic. Caller passes an `invokeGemini` function so this module
|
|
123
|
-
* stays decoupled from the LLM gateway. Real wiring lives in
|
|
124
|
-
* `agent/stitchedVideoCritic.gemini.ts` (added separately so tests can mock
|
|
125
|
-
* the boundary).
|
|
126
|
-
*
|
|
127
|
-
* Soft-fails: on any error returns a single warn finding with the error
|
|
128
|
-
* message so the orchestrator can still surface "we couldn't auto-review"
|
|
129
|
-
* to the user without crashing the run.
|
|
130
|
-
*/
|
|
131
|
-
export declare function runStitchedVideoCritic(input: StitchedVideoCriticInput, invokeGemini: (args: {
|
|
132
|
-
prompt: string;
|
|
133
|
-
videoUrl: string;
|
|
134
|
-
responseSchema: z.ZodType<StitchedVideoReview>;
|
|
135
|
-
}) => Promise<StitchedVideoReview>): Promise<StitchedVideoReview>;
|
|
136
|
-
//# sourceMappingURL=stitchedVideoCritic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stitchedVideoCritic.d.ts","sourceRoot":"","sources":["../../../src/services/agent/stitchedVideoCritic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;iBAqBrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,WAAW,wBAAwB;IACvC,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,IAAI,EAAE,SAAS,CAAC;IAChB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE;QACX,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF;;;;;;OAMG;IACH,WAAW,CAAC,EAAE;QACZ,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,oEAAoE;QACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,wEAAwE;QACxE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAmEjF;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,wBAAwB,EAC/B,YAAY,EAAE,CAAC,IAAI,EAAE;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAChD,KAAK,OAAO,CAAC,mBAAmB,CAAC,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAwB9B"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { StitchedVideoReview } from "./stitchedVideoCritic";
|
|
3
|
-
import { PerSceneReview } from "./perSceneCritic";
|
|
4
|
-
export interface GeminiCriticConfig {
|
|
5
|
-
apiKey: string;
|
|
6
|
-
model?: string;
|
|
7
|
-
/** Cap total wait for download + upload + analyse. */
|
|
8
|
-
timeoutMs?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function buildGeminiCriticInvoker(config: GeminiCriticConfig): (args: {
|
|
11
|
-
prompt: string;
|
|
12
|
-
videoUrl: string;
|
|
13
|
-
responseSchema: z.ZodType<StitchedVideoReview>;
|
|
14
|
-
}) => Promise<StitchedVideoReview>;
|
|
15
|
-
/**
|
|
16
|
-
* AG-43: Gemini invoker for the per-scene critic. Same upload/poll/generate
|
|
17
|
-
* flow as the stitched-critic invoker; differs only in the response schema
|
|
18
|
-
* (PerSceneReviewSchema). Kept as a separate factory so the typing stays
|
|
19
|
-
* tight at the call site.
|
|
20
|
-
*/
|
|
21
|
-
export declare function buildGeminiPerSceneCriticInvoker(config: GeminiCriticConfig): (args: {
|
|
22
|
-
prompt: string;
|
|
23
|
-
videoUrl: string;
|
|
24
|
-
responseSchema: z.ZodType<PerSceneReview>;
|
|
25
|
-
}) => Promise<PerSceneReview>;
|
|
26
|
-
//# sourceMappingURL=stitchedVideoCritic.gemini.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stitchedVideoCritic.gemini.d.ts","sourceRoot":"","sources":["../../../src/services/agent/stitchedVideoCritic.gemini.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAwB,MAAM,kBAAkB,CAAC;AAwBxE,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,IAKnD,MAAM;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAChD,KAAG,OAAO,CAAC,mBAAmB,CAAC,CA+FjC;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,kBAAkB,IAK3D,MAAM;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;CAC3C,KAAG,OAAO,CAAC,cAAc,CAAC,CAwD5B"}
|