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,198 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildGeminiCriticInvoker = buildGeminiCriticInvoker;
|
|
4
|
-
exports.buildGeminiPerSceneCriticInvoker = buildGeminiPerSceneCriticInvoker;
|
|
5
|
-
const genai_1 = require("@google/genai");
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
const logger_1 = require("../../utils/logger");
|
|
8
|
-
const stitchedVideoCritic_1 = require("./stitchedVideoCritic");
|
|
9
|
-
const perSceneCritic_1 = require("./perSceneCritic");
|
|
10
|
-
/**
|
|
11
|
-
* AG-26 / AG-34: Gemini invoker for the stitched-video critic.
|
|
12
|
-
*
|
|
13
|
-
* Earlier attempt tried to proxy through the Vercel AI Gateway with an
|
|
14
|
-
* `input_audio_video` content part — gateway returned 400 because that
|
|
15
|
-
* type doesn't exist. Switched to Gemini's official `@google/genai` SDK
|
|
16
|
-
* + Files API for clean video upload. Same dependency `aiGen/google/`
|
|
17
|
-
* providers already use.
|
|
18
|
-
*
|
|
19
|
-
* Video upload flow:
|
|
20
|
-
* 1. Download the stitched MP4 from the supplied URL.
|
|
21
|
-
* 2. Upload to Gemini File API (handles up to 2GB; we stay <20MB).
|
|
22
|
-
* 3. Wait for the file to reach ACTIVE state (~1-2s for short clips).
|
|
23
|
-
* 4. Generate content with the file ref + structured-output JSON schema.
|
|
24
|
-
*
|
|
25
|
-
* Cost: Gemini 2.5 Flash tokenizes ~258 tok/sec of video. A 15s clip ≈
|
|
26
|
-
* 3.9k input tokens → ~$0.0003 at $0.075/1M input. Output JSON ≈ 300 tok
|
|
27
|
-
* → ~$0.0001. Total ~$0.0004/critique.
|
|
28
|
-
*/
|
|
29
|
-
const DEFAULT_MODEL = "gemini-2.5-flash";
|
|
30
|
-
/** Sleep helper for the file-state poll loop. */
|
|
31
|
-
function sleep(ms) {
|
|
32
|
-
return new Promise((r) => setTimeout(r, ms));
|
|
33
|
-
}
|
|
34
|
-
function buildGeminiCriticInvoker(config) {
|
|
35
|
-
const model = config.model ?? DEFAULT_MODEL;
|
|
36
|
-
const timeoutMs = config.timeoutMs ?? 180000;
|
|
37
|
-
const ai = new genai_1.GoogleGenAI({ apiKey: config.apiKey });
|
|
38
|
-
return async (args) => {
|
|
39
|
-
const deadline = Date.now() + timeoutMs;
|
|
40
|
-
const remain = () => Math.max(1000, deadline - Date.now());
|
|
41
|
-
// 1. Download the MP4 into memory.
|
|
42
|
-
const controller = new AbortController();
|
|
43
|
-
const dlTimeout = setTimeout(() => controller.abort(), remain());
|
|
44
|
-
let buf;
|
|
45
|
-
try {
|
|
46
|
-
const r = await fetch(args.videoUrl, { signal: controller.signal });
|
|
47
|
-
if (!r.ok) {
|
|
48
|
-
throw new Error(`stitchedCritic.gemini: video fetch ${r.status} ${r.statusText}`);
|
|
49
|
-
}
|
|
50
|
-
buf = Buffer.from(await r.arrayBuffer());
|
|
51
|
-
}
|
|
52
|
-
finally {
|
|
53
|
-
clearTimeout(dlTimeout);
|
|
54
|
-
}
|
|
55
|
-
// 2. Upload to Gemini Files API. The SDK accepts a Blob.
|
|
56
|
-
const ab = new ArrayBuffer(buf.byteLength);
|
|
57
|
-
new Uint8Array(ab).set(buf);
|
|
58
|
-
const blob = new Blob([ab], { type: "video/mp4" });
|
|
59
|
-
const uploaded = await ai.files.upload({
|
|
60
|
-
file: blob,
|
|
61
|
-
config: { mimeType: "video/mp4" },
|
|
62
|
-
});
|
|
63
|
-
if (!uploaded.name) {
|
|
64
|
-
throw new Error("stitchedCritic.gemini: upload returned no file name");
|
|
65
|
-
}
|
|
66
|
-
// 3. Poll until the file becomes ACTIVE — Gemini processes the video
|
|
67
|
-
// (frame extraction etc.) before it's usable in a generateContent call.
|
|
68
|
-
// 1s poll cadence; bail when state is FAILED or we hit the deadline.
|
|
69
|
-
let file = uploaded;
|
|
70
|
-
while (file.state === "PROCESSING") {
|
|
71
|
-
if (Date.now() > deadline) {
|
|
72
|
-
throw new Error("stitchedCritic.gemini: file processing timed out");
|
|
73
|
-
}
|
|
74
|
-
await sleep(1000);
|
|
75
|
-
file = await ai.files.get({ name: uploaded.name });
|
|
76
|
-
}
|
|
77
|
-
if (file.state !== "ACTIVE") {
|
|
78
|
-
throw new Error(`stitchedCritic.gemini: file state=${file.state}, error=${JSON.stringify(file.error ?? {})}`);
|
|
79
|
-
}
|
|
80
|
-
// 4. generateContent with structured-output JSON. responseSchema as a
|
|
81
|
-
// JSON-schema dict drives Gemini's structured-output mode.
|
|
82
|
-
const jsonSchema = zod_1.z.toJSONSchema(args.responseSchema, { target: "draft-7" });
|
|
83
|
-
const resp = await ai.models.generateContent({
|
|
84
|
-
model,
|
|
85
|
-
contents: [
|
|
86
|
-
{
|
|
87
|
-
role: "user",
|
|
88
|
-
parts: [
|
|
89
|
-
{ text: args.prompt },
|
|
90
|
-
{ fileData: { fileUri: file.uri, mimeType: file.mimeType ?? "video/mp4" } },
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
config: {
|
|
95
|
-
responseMimeType: "application/json",
|
|
96
|
-
responseSchema: jsonSchema,
|
|
97
|
-
temperature: 0.2,
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
const text = resp.text;
|
|
101
|
-
if (!text) {
|
|
102
|
-
throw new Error("stitchedCritic.gemini: empty response");
|
|
103
|
-
}
|
|
104
|
-
let parsed;
|
|
105
|
-
try {
|
|
106
|
-
parsed = JSON.parse(text);
|
|
107
|
-
}
|
|
108
|
-
catch {
|
|
109
|
-
throw new Error(`stitchedCritic.gemini: non-JSON response: ${text.slice(0, 300)}`);
|
|
110
|
-
}
|
|
111
|
-
const reparsed = stitchedVideoCritic_1.StitchedVideoReviewSchema.safeParse(parsed);
|
|
112
|
-
if (!reparsed.success) {
|
|
113
|
-
throw new Error(`stitchedCritic.gemini: schema validation failed: ${reparsed.error.message}`);
|
|
114
|
-
}
|
|
115
|
-
logger_1.logger.info("stitchedCritic.gemini ok", {
|
|
116
|
-
score: reparsed.data.score,
|
|
117
|
-
shippable: reparsed.data.shippable,
|
|
118
|
-
findings: reparsed.data.findings.length,
|
|
119
|
-
});
|
|
120
|
-
return reparsed.data;
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* AG-43: Gemini invoker for the per-scene critic. Same upload/poll/generate
|
|
125
|
-
* flow as the stitched-critic invoker; differs only in the response schema
|
|
126
|
-
* (PerSceneReviewSchema). Kept as a separate factory so the typing stays
|
|
127
|
-
* tight at the call site.
|
|
128
|
-
*/
|
|
129
|
-
function buildGeminiPerSceneCriticInvoker(config) {
|
|
130
|
-
const model = config.model ?? DEFAULT_MODEL;
|
|
131
|
-
const timeoutMs = config.timeoutMs ?? 90000;
|
|
132
|
-
const ai = new genai_1.GoogleGenAI({ apiKey: config.apiKey });
|
|
133
|
-
return async (args) => {
|
|
134
|
-
const deadline = Date.now() + timeoutMs;
|
|
135
|
-
const controller = new AbortController();
|
|
136
|
-
const dlTimeout = setTimeout(() => controller.abort(), Math.max(1000, deadline - Date.now()));
|
|
137
|
-
let buf;
|
|
138
|
-
try {
|
|
139
|
-
const r = await fetch(args.videoUrl, { signal: controller.signal });
|
|
140
|
-
if (!r.ok)
|
|
141
|
-
throw new Error(`perSceneCritic.gemini: fetch ${r.status} ${r.statusText}`);
|
|
142
|
-
buf = Buffer.from(await r.arrayBuffer());
|
|
143
|
-
}
|
|
144
|
-
finally {
|
|
145
|
-
clearTimeout(dlTimeout);
|
|
146
|
-
}
|
|
147
|
-
const ab = new ArrayBuffer(buf.byteLength);
|
|
148
|
-
new Uint8Array(ab).set(buf);
|
|
149
|
-
const blob = new Blob([ab], { type: "video/mp4" });
|
|
150
|
-
const uploaded = await ai.files.upload({ file: blob, config: { mimeType: "video/mp4" } });
|
|
151
|
-
if (!uploaded.name)
|
|
152
|
-
throw new Error("perSceneCritic.gemini: upload returned no name");
|
|
153
|
-
let file = uploaded;
|
|
154
|
-
while (file.state === "PROCESSING") {
|
|
155
|
-
if (Date.now() > deadline)
|
|
156
|
-
throw new Error("perSceneCritic.gemini: file processing timed out");
|
|
157
|
-
await sleep(1000);
|
|
158
|
-
file = await ai.files.get({ name: uploaded.name });
|
|
159
|
-
}
|
|
160
|
-
if (file.state !== "ACTIVE") {
|
|
161
|
-
throw new Error(`perSceneCritic.gemini: file state=${file.state}, error=${JSON.stringify(file.error ?? {})}`);
|
|
162
|
-
}
|
|
163
|
-
const jsonSchema = zod_1.z.toJSONSchema(args.responseSchema, { target: "draft-7" });
|
|
164
|
-
const resp = await ai.models.generateContent({
|
|
165
|
-
model,
|
|
166
|
-
contents: [
|
|
167
|
-
{
|
|
168
|
-
role: "user",
|
|
169
|
-
parts: [
|
|
170
|
-
{ text: args.prompt },
|
|
171
|
-
{ fileData: { fileUri: file.uri, mimeType: file.mimeType ?? "video/mp4" } },
|
|
172
|
-
],
|
|
173
|
-
},
|
|
174
|
-
],
|
|
175
|
-
config: { responseMimeType: "application/json", responseSchema: jsonSchema, temperature: 0.2 },
|
|
176
|
-
});
|
|
177
|
-
const text = resp.text;
|
|
178
|
-
if (!text)
|
|
179
|
-
throw new Error("perSceneCritic.gemini: empty response");
|
|
180
|
-
let parsed;
|
|
181
|
-
try {
|
|
182
|
-
parsed = JSON.parse(text);
|
|
183
|
-
}
|
|
184
|
-
catch {
|
|
185
|
-
throw new Error(`perSceneCritic.gemini: non-JSON: ${text.slice(0, 300)}`);
|
|
186
|
-
}
|
|
187
|
-
const reparsed = perSceneCritic_1.PerSceneReviewSchema.safeParse(parsed);
|
|
188
|
-
if (!reparsed.success)
|
|
189
|
-
throw new Error(`perSceneCritic.gemini: schema validation: ${reparsed.error.message}`);
|
|
190
|
-
logger_1.logger.info("perSceneCritic.gemini ok", {
|
|
191
|
-
sceneIndex: reparsed.data.sceneIndex,
|
|
192
|
-
score: reparsed.data.score,
|
|
193
|
-
shippable: reparsed.data.shippable,
|
|
194
|
-
recommendRegenerate: reparsed.data.recommendRegenerate,
|
|
195
|
-
});
|
|
196
|
-
return reparsed.data;
|
|
197
|
-
};
|
|
198
|
-
}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StitchedVideoReviewSchema = exports.StitchedVideoFindingSchema = void 0;
|
|
4
|
-
exports.buildStitchedCriticPrompt = buildStitchedCriticPrompt;
|
|
5
|
-
exports.runStitchedVideoCritic = runStitchedVideoCritic;
|
|
6
|
-
const logger_1 = require("../../utils/logger");
|
|
7
|
-
/**
|
|
8
|
-
* AG-26: Stitched-video critic — the gate that catches everything the
|
|
9
|
-
* per-scene critic misses.
|
|
10
|
-
*
|
|
11
|
-
* The existing `Critic` operates on per-scene asset URLs + the plan. That
|
|
12
|
-
* misses anything that only becomes visible once the scenes are concatenated:
|
|
13
|
-
* - voiceover clipped / cut off / audibly truncated
|
|
14
|
-
* - jarring cuts (no rhythm, no music bed to disguise it)
|
|
15
|
-
* - character drift visible only when scenes play back-to-back
|
|
16
|
-
* - brand text degradation across cuts (the human eye notices "Hydropure
|
|
17
|
-
* → HydraPure → HydrraPure" instantly when watching; per-frame critique
|
|
18
|
-
* gives each scene a pass)
|
|
19
|
-
* - missing or 404 music track
|
|
20
|
-
* - overall pacing / hook → reveal → CTA arc as a viewer experiences it
|
|
21
|
-
*
|
|
22
|
-
* Implementation: call Gemini 2.5 Flash with the stitched MP4 file_uri.
|
|
23
|
-
* Gemini accepts video + audio natively, tokenizes ~258 tok/sec of video,
|
|
24
|
-
* so a 15s clip is ~4k input tokens → ~$0.0003 / critique. Essentially free.
|
|
25
|
-
*
|
|
26
|
-
* Returns structured findings in the same shape as the per-scene Critic so
|
|
27
|
-
* the orchestrator can merge both into a single review.
|
|
28
|
-
*/
|
|
29
|
-
const zod_1 = require("zod");
|
|
30
|
-
exports.StitchedVideoFindingSchema = zod_1.z.object({
|
|
31
|
-
severity: zod_1.z.enum(["pass", "warn", "fail"]),
|
|
32
|
-
dimension: zod_1.z.enum([
|
|
33
|
-
"hookStrength",
|
|
34
|
-
"voiceoverClarity",
|
|
35
|
-
"voiceoverEmotionMatch",
|
|
36
|
-
"voiceoverPacing",
|
|
37
|
-
"audioMixBalance",
|
|
38
|
-
"musicPresence",
|
|
39
|
-
"characterContinuity",
|
|
40
|
-
"brandTextLegibility",
|
|
41
|
-
"pacingFit",
|
|
42
|
-
"cutRhythm",
|
|
43
|
-
"ctaPresence",
|
|
44
|
-
// AG-43: physical action coherence — flagged sealed-bottle drinking miss
|
|
45
|
-
// on Test 1 fresh run. Checks state-of-object vs action compatibility.
|
|
46
|
-
"actionPlausibility",
|
|
47
|
-
"overallImpression",
|
|
48
|
-
]),
|
|
49
|
-
message: zod_1.z.string().min(4),
|
|
50
|
-
sceneIndexHint: zod_1.z.number().int().nonnegative().optional(),
|
|
51
|
-
});
|
|
52
|
-
exports.StitchedVideoReviewSchema = zod_1.z.object({
|
|
53
|
-
score: zod_1.z.number().min(0).max(10).describe("Overall production-readiness 0-10."),
|
|
54
|
-
shippable: zod_1.z.boolean().describe("Could this be sent to a paying customer as-is?"),
|
|
55
|
-
summary: zod_1.z.string().min(10).max(800),
|
|
56
|
-
findings: zod_1.z.array(exports.StitchedVideoFindingSchema),
|
|
57
|
-
});
|
|
58
|
-
/**
|
|
59
|
-
* Build the rubric prompt the Gemini call receives alongside the video. Kept
|
|
60
|
-
* outside the API caller so unit tests can snapshot it.
|
|
61
|
-
*/
|
|
62
|
-
function buildStitchedCriticPrompt(input) {
|
|
63
|
-
const { plan, whisperTranscript, audioStats, groundTruth } = input;
|
|
64
|
-
const planLines = plan.scenes
|
|
65
|
-
.map((s) => ` scene ${s.sceneIndex} (${s.durationMs}ms, ${s.strategy}, tier=${s.tier}): VO="${s.voiceoverLine ?? "(none)"}" OST="${s.onScreenText ?? "(none)"}"`)
|
|
66
|
-
.join("\n");
|
|
67
|
-
const audioSection = audioStats
|
|
68
|
-
? `Audio measurements (from ffmpeg):\n meanDb=${audioStats.meanDb ?? "?"} maxDb=${audioStats.maxDb ?? "?"} longestSilenceMs=${audioStats.longestSilenceMs ?? "?"}\n`
|
|
69
|
-
: "";
|
|
70
|
-
const truthLines = [];
|
|
71
|
-
if (groundTruth) {
|
|
72
|
-
truthLines.push("GROUND TRUTH about the file you're watching (from the stitcher — these are facts, not the plan):");
|
|
73
|
-
if (groundTruth.hasAudio !== undefined)
|
|
74
|
-
truthLines.push(` hasAudio = ${groundTruth.hasAudio}`);
|
|
75
|
-
if (groundTruth.hasVoiceover !== undefined)
|
|
76
|
-
truthLines.push(` hasVoiceover = ${groundTruth.hasVoiceover}`);
|
|
77
|
-
if (groundTruth.hasMusic !== undefined)
|
|
78
|
-
truthLines.push(` hasMusic = ${groundTruth.hasMusic} ${groundTruth.hasMusic === false ? "(music was planned but NOT rendered — flag musicPresence=fail)" : ""}`);
|
|
79
|
-
if (groundTruth.notes?.length)
|
|
80
|
-
truthLines.push(` stitcher notes : ${groundTruth.notes.join(" | ")}`);
|
|
81
|
-
truthLines.push("Do NOT describe audio elements that ground truth says are absent. If hasMusic=false you must score musicPresence=fail and not invent music descriptions.");
|
|
82
|
-
truthLines.push("");
|
|
83
|
-
}
|
|
84
|
-
const truthSection = truthLines.join("\n");
|
|
85
|
-
const transcriptSection = whisperTranscript
|
|
86
|
-
? `\nWhisper transcript of the audio (ground truth — diff against the planned VO lines above):\n"""\n${whisperTranscript}\n"""\n`
|
|
87
|
-
: "";
|
|
88
|
-
return [
|
|
89
|
-
"You are a senior creative reviewer for AI-generated short-form video ads.",
|
|
90
|
-
"You will WATCH the attached video (including audio) end to end, then score it",
|
|
91
|
-
"against the plan + rubric below. Be ruthless — a 9/10 means production-ready",
|
|
92
|
-
"for a paying customer; a 5/10 means major issues; a 2/10 means the executor",
|
|
93
|
-
"technically succeeded but the output is not usable.",
|
|
94
|
-
"",
|
|
95
|
-
`Plan: ${plan.scenes.length} scenes, total ${Math.round(plan.totalDurationMs / 1000)}s, aspect ${plan.aspect}, persona ${plan.persona}.`,
|
|
96
|
-
`Music: strategy=${plan.music?.strategy ?? "none"} url=${plan.music?.url ?? "(none)"}.`,
|
|
97
|
-
`Voice: id=${plan.voiceId ?? "(default)"} style=${plan.voiceStyle ?? "(default)"}.`,
|
|
98
|
-
"",
|
|
99
|
-
"Per-scene spec the executor was supposed to render:",
|
|
100
|
-
planLines,
|
|
101
|
-
"",
|
|
102
|
-
truthSection,
|
|
103
|
-
audioSection,
|
|
104
|
-
transcriptSection,
|
|
105
|
-
"Rubric — score each dimension pass / warn / fail:",
|
|
106
|
-
" - hookStrength : does the first 2-3s grab attention (pattern interrupt / problem statement)?",
|
|
107
|
-
" - voiceoverClarity : is every spoken word audibly clear, not clipped, no chop mid-sentence?",
|
|
108
|
-
" - voiceoverEmotionMatch : does the delivery match the brief's intent (excited UGC vs calm explainer)?",
|
|
109
|
-
" - voiceoverPacing : does the speech fit the cuts naturally, or is it racing / dragging?",
|
|
110
|
-
" - audioMixBalance : voice and music balanced; voice not buried, music not drowning?",
|
|
111
|
-
" - musicPresence : if plan called for music, is it actually there? (silent music = fail)",
|
|
112
|
-
" - characterContinuity: same person across scenes (when applicable) or jarring identity drift?",
|
|
113
|
-
" - brandTextLegibility: any brand/product text on screen rendered correctly (no misspellings, no mangled letters)?",
|
|
114
|
-
" - pacingFit : cuts feel like the persona (UGC=fast, talking-head=medium)?",
|
|
115
|
-
" - cutRhythm : transitions feel intentional vs choppy?",
|
|
116
|
-
" - ctaPresence : closing CTA combines brand + verb, viewer leaves with both?",
|
|
117
|
-
" - actionPlausibility : every visible action must be physically possible given the state of objects on screen. Examples that MUST be flagged FAIL: drinking from a bottle with the cap still on; pouring from a sealed container; using a phone with a blank/dark screen; walking through a closed door; lifting a heavy object with no hand contact; the brand label on the product becomes a different word or garbles between scenes. If the prior scene didn't establish the enabling state (cap twisted off, screen turned on), grade the action's scene FAIL with sceneIndexHint pointing to the violator. Pay specific attention to caps, lids, seals, buttons, doors, switches.",
|
|
118
|
-
" - overallImpression : would a marketing director ship this as-is?",
|
|
119
|
-
"",
|
|
120
|
-
"Output JSON exactly matching the response schema. score: weighted 0-10 over all",
|
|
121
|
-
"dimensions; shippable: boolean (would a paying customer accept this?); summary:",
|
|
122
|
-
"2-4 sentences; findings: array of {severity, dimension, message, sceneIndexHint?}.",
|
|
123
|
-
"Always include at least one finding per dimension that warns or fails. Use",
|
|
124
|
-
"sceneIndexHint when a finding maps to a specific scene.",
|
|
125
|
-
].join("\n");
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Run the critic. Caller passes an `invokeGemini` function so this module
|
|
129
|
-
* stays decoupled from the LLM gateway. Real wiring lives in
|
|
130
|
-
* `agent/stitchedVideoCritic.gemini.ts` (added separately so tests can mock
|
|
131
|
-
* the boundary).
|
|
132
|
-
*
|
|
133
|
-
* Soft-fails: on any error returns a single warn finding with the error
|
|
134
|
-
* message so the orchestrator can still surface "we couldn't auto-review"
|
|
135
|
-
* to the user without crashing the run.
|
|
136
|
-
*/
|
|
137
|
-
async function runStitchedVideoCritic(input, invokeGemini) {
|
|
138
|
-
try {
|
|
139
|
-
const prompt = buildStitchedCriticPrompt(input);
|
|
140
|
-
return await invokeGemini({
|
|
141
|
-
prompt,
|
|
142
|
-
videoUrl: input.videoUrl,
|
|
143
|
-
responseSchema: exports.StitchedVideoReviewSchema,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
catch (e) {
|
|
147
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
148
|
-
logger_1.logger.warn("stitchedVideoCritic failed; returning soft-fail review", { err: msg });
|
|
149
|
-
return {
|
|
150
|
-
score: 0,
|
|
151
|
-
shippable: false,
|
|
152
|
-
summary: `Stitched-video critic failed to run: ${msg}. Manual review required.`,
|
|
153
|
-
findings: [
|
|
154
|
-
{
|
|
155
|
-
severity: "warn",
|
|
156
|
-
dimension: "overallImpression",
|
|
157
|
-
message: `Critic call failed: ${msg}`,
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { TVideoJobTask } from "../../globals/types";
|
|
2
|
-
/**
|
|
3
|
-
* TaskPoller — shared async-task polling primitive.
|
|
4
|
-
*
|
|
5
|
-
* Used by the agent executor's host (executeProject) to drain pendingTaskIds
|
|
6
|
-
* emitted by animate_image / generate_video / generate_avatar_video. The
|
|
7
|
-
* legacy form-driven videoJobProcessor still uses its own sceneMonitor for
|
|
8
|
-
* now; both paths will converge here once sceneMonitor is refactored.
|
|
9
|
-
*
|
|
10
|
-
* Design notes:
|
|
11
|
-
* - Backoff: exponential 10s → 30s → 60s caps (provider rate-limit friendly).
|
|
12
|
-
* - Timeout: per-model (aiModelConfigs[*].pollTimeoutMs) with 15-min fallback.
|
|
13
|
-
* - Retry: per-task transient errors retried up to 3x before marking failed.
|
|
14
|
-
* - Partial success: returns one result per input task; never throws on
|
|
15
|
-
* per-task failure. Caller decides how to react.
|
|
16
|
-
*/
|
|
17
|
-
export interface PollableTask {
|
|
18
|
-
/** Stable id used in the result map. Caller supplies (e.g. scene index). */
|
|
19
|
-
ref: string;
|
|
20
|
-
/** Provider task handle (provider-shaped — string or struct). */
|
|
21
|
-
task: TVideoJobTask;
|
|
22
|
-
/** Model the task was triggered on. Drives provider routing + poll timing. */
|
|
23
|
-
modelKey: string;
|
|
24
|
-
/** Output filename hint forwarded to the provider's checkVideoStatus. */
|
|
25
|
-
outputFilename?: string;
|
|
26
|
-
}
|
|
27
|
-
export type PolledTaskStatus = "completed" | "failed" | "timed-out";
|
|
28
|
-
export interface PolledTaskResult {
|
|
29
|
-
ref: string;
|
|
30
|
-
status: PolledTaskStatus;
|
|
31
|
-
videoUrl?: string;
|
|
32
|
-
errorMessage?: string;
|
|
33
|
-
durationMs: number;
|
|
34
|
-
}
|
|
35
|
-
export interface TaskPollerOptions {
|
|
36
|
-
/** Initial poll interval. Doubles each cycle (capped at maxIntervalMs). */
|
|
37
|
-
initialIntervalMs?: number;
|
|
38
|
-
/** Maximum interval between cycles. */
|
|
39
|
-
maxIntervalMs?: number;
|
|
40
|
-
/** Per-task hard timeout. Falls back to aiModelConfigs[modelKey].pollTimeoutMs, then 15 min. */
|
|
41
|
-
timeoutMs?: number;
|
|
42
|
-
/** Per-task transient-error retry budget. */
|
|
43
|
-
maxRetriesPerTask?: number;
|
|
44
|
-
}
|
|
45
|
-
export declare class TaskPoller {
|
|
46
|
-
private readonly initialIntervalMs;
|
|
47
|
-
private readonly maxIntervalMs;
|
|
48
|
-
private readonly maxRetries;
|
|
49
|
-
private readonly timeoutOverrideMs?;
|
|
50
|
-
constructor(opts?: TaskPollerOptions);
|
|
51
|
-
/**
|
|
52
|
-
* Poll every task in `tasks` until each one settles (completed / failed /
|
|
53
|
-
* timed-out). Returns one PolledTaskResult per input in input order.
|
|
54
|
-
*
|
|
55
|
-
* Tasks share a single backoff loop — providers are polled together each
|
|
56
|
-
* cycle, parallelism is bounded by getAiGenProviderService rate limiters.
|
|
57
|
-
*/
|
|
58
|
-
pollAll(tasks: PollableTask[]): Promise<PolledTaskResult[]>;
|
|
59
|
-
private pollOne;
|
|
60
|
-
/** Idempotent release of the submit-time concurrent slot. Called from
|
|
61
|
-
* every settle branch (completed / failed / timed-out / retries-exhausted). */
|
|
62
|
-
private releaseSlot;
|
|
63
|
-
private resolveTimeout;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=taskPoller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taskPoller.d.ts","sourceRoot":"","sources":["../../../src/services/agent/taskPoller.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKvE;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,IAAI,EAAE,aAAa,CAAC;IACpB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAmBD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAS;gBAEhC,IAAI,GAAE,iBAAsB;IAOxC;;;;;;OAMG;IACG,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAwBnD,OAAO;IA0GrB;oFACgF;IAChF,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,cAAc;CAKvB"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskPoller = void 0;
|
|
4
|
-
const aiModels_1 = require("../../globals/aiModels");
|
|
5
|
-
const types_1 = require("../../globals/types");
|
|
6
|
-
const aiGenFactory_service_1 = require("../aiGen/aiGenFactory.service");
|
|
7
|
-
const rateLimiter_1 = require("../rateLimiter");
|
|
8
|
-
const logger_1 = require("../../utils/logger");
|
|
9
|
-
const DEFAULT_INITIAL_INTERVAL_MS = 10000;
|
|
10
|
-
const DEFAULT_MAX_INTERVAL_MS = 60000;
|
|
11
|
-
const DEFAULT_TIMEOUT_MS = 15 * 60 * 1000;
|
|
12
|
-
const DEFAULT_MAX_RETRIES = 3;
|
|
13
|
-
class TaskPoller {
|
|
14
|
-
constructor(opts = {}) {
|
|
15
|
-
this.initialIntervalMs = opts.initialIntervalMs ?? DEFAULT_INITIAL_INTERVAL_MS;
|
|
16
|
-
this.maxIntervalMs = opts.maxIntervalMs ?? DEFAULT_MAX_INTERVAL_MS;
|
|
17
|
-
this.maxRetries = opts.maxRetriesPerTask ?? DEFAULT_MAX_RETRIES;
|
|
18
|
-
this.timeoutOverrideMs = opts.timeoutMs;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Poll every task in `tasks` until each one settles (completed / failed /
|
|
22
|
-
* timed-out). Returns one PolledTaskResult per input in input order.
|
|
23
|
-
*
|
|
24
|
-
* Tasks share a single backoff loop — providers are polled together each
|
|
25
|
-
* cycle, parallelism is bounded by getAiGenProviderService rate limiters.
|
|
26
|
-
*/
|
|
27
|
-
async pollAll(tasks) {
|
|
28
|
-
if (tasks.length === 0)
|
|
29
|
-
return [];
|
|
30
|
-
const states = tasks.map((t) => ({
|
|
31
|
-
input: t,
|
|
32
|
-
startedAt: Date.now(),
|
|
33
|
-
retries: 0,
|
|
34
|
-
}));
|
|
35
|
-
let intervalMs = this.initialIntervalMs;
|
|
36
|
-
while (states.some((s) => !s.result)) {
|
|
37
|
-
await Promise.all(states.map((state) => (state.result ? Promise.resolve() : this.pollOne(state))));
|
|
38
|
-
if (states.every((s) => s.result))
|
|
39
|
-
break;
|
|
40
|
-
await sleep(intervalMs);
|
|
41
|
-
intervalMs = Math.min(intervalMs * 2, this.maxIntervalMs);
|
|
42
|
-
}
|
|
43
|
-
return states.map((s) => s.result);
|
|
44
|
-
}
|
|
45
|
-
async pollOne(state) {
|
|
46
|
-
const { input, startedAt } = state;
|
|
47
|
-
const elapsed = Date.now() - startedAt;
|
|
48
|
-
const timeoutMs = this.resolveTimeout(input.modelKey);
|
|
49
|
-
if (elapsed > timeoutMs) {
|
|
50
|
-
state.result = {
|
|
51
|
-
ref: input.ref,
|
|
52
|
-
status: "timed-out",
|
|
53
|
-
errorMessage: `Poll window expired after ${Math.floor(elapsed / 1000)}s — provider task may still be running`,
|
|
54
|
-
durationMs: elapsed,
|
|
55
|
-
};
|
|
56
|
-
this.releaseSlot(state);
|
|
57
|
-
logger_1.logger.warn("TaskPoller timed out", {
|
|
58
|
-
ref: input.ref,
|
|
59
|
-
modelKey: input.modelKey,
|
|
60
|
-
elapsedSec: Math.floor(elapsed / 1000),
|
|
61
|
-
});
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
try {
|
|
65
|
-
// Per-poll rate gate — counts against per-min / per-day quota but
|
|
66
|
-
// NOT the concurrent cap (the in-flight task already holds a slot
|
|
67
|
-
// from submit). Without this, N in-flight tasks polling every 10s
|
|
68
|
-
// can blow past providers' per-minute submit budgets (Veo 50/min
|
|
69
|
-
// with 10 tasks × 6 polls/min = 60 polls/min before any new submit).
|
|
70
|
-
const limiter = (0, rateLimiter_1.getAiGenModelRateLimiter)(input.modelKey);
|
|
71
|
-
await limiter.waitUntilAvailableForOneShot();
|
|
72
|
-
const provider = (0, aiGenFactory_service_1.getAiGenProviderService)(input.modelKey);
|
|
73
|
-
const result = await provider.checkVideoStatus({
|
|
74
|
-
task: input.task,
|
|
75
|
-
modelKey: input.modelKey,
|
|
76
|
-
outputFilename: input.outputFilename ?? `agent-${input.ref}`,
|
|
77
|
-
});
|
|
78
|
-
switch (result.status) {
|
|
79
|
-
case types_1.EVideoSceneStatus.COMPLETED:
|
|
80
|
-
state.result = {
|
|
81
|
-
ref: input.ref,
|
|
82
|
-
status: "completed",
|
|
83
|
-
videoUrl: result.videoUrl,
|
|
84
|
-
durationMs: Date.now() - startedAt,
|
|
85
|
-
};
|
|
86
|
-
this.releaseSlot(state);
|
|
87
|
-
return;
|
|
88
|
-
case types_1.EVideoSceneStatus.FAILED:
|
|
89
|
-
state.result = {
|
|
90
|
-
ref: input.ref,
|
|
91
|
-
status: "failed",
|
|
92
|
-
errorMessage: result.errorMessage ?? "Provider reported failure with no details",
|
|
93
|
-
durationMs: Date.now() - startedAt,
|
|
94
|
-
};
|
|
95
|
-
this.releaseSlot(state);
|
|
96
|
-
return;
|
|
97
|
-
default:
|
|
98
|
-
return; // still in progress; next cycle picks it back up
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
catch (err) {
|
|
102
|
-
state.retries++;
|
|
103
|
-
// Surface enough context to diagnose. Previously this logged only
|
|
104
|
-
// err.message; for bare `Error` instances that yields the useless
|
|
105
|
-
// string "Error" with no clue whether the failure is in the provider
|
|
106
|
-
// API, the CDN download, GCS upload, or signed-URL minting.
|
|
107
|
-
const isErr = err instanceof Error;
|
|
108
|
-
const msg = isErr ? err.message || err.toString() : String(err);
|
|
109
|
-
const errName = isErr ? err.name : typeof err;
|
|
110
|
-
const errCode = isErr ? err.code : undefined;
|
|
111
|
-
const httpStatus = isErr
|
|
112
|
-
? err.response?.status
|
|
113
|
-
: undefined;
|
|
114
|
-
const stackHead = isErr && err.stack
|
|
115
|
-
? err.stack.split("\n").slice(0, 4).join(" | ")
|
|
116
|
-
: undefined;
|
|
117
|
-
logger_1.logger.warn("TaskPoller transient error", {
|
|
118
|
-
ref: input.ref,
|
|
119
|
-
modelKey: input.modelKey,
|
|
120
|
-
attempt: state.retries,
|
|
121
|
-
errName,
|
|
122
|
-
errCode,
|
|
123
|
-
httpStatus,
|
|
124
|
-
err: msg,
|
|
125
|
-
stackHead,
|
|
126
|
-
});
|
|
127
|
-
if (state.retries >= this.maxRetries) {
|
|
128
|
-
logger_1.logger.error("TaskPoller: retries exhausted", {
|
|
129
|
-
ref: input.ref,
|
|
130
|
-
modelKey: input.modelKey,
|
|
131
|
-
attempts: state.retries,
|
|
132
|
-
errName,
|
|
133
|
-
errCode,
|
|
134
|
-
httpStatus,
|
|
135
|
-
lastErr: err instanceof Error ? err.stack ?? err.message : String(err),
|
|
136
|
-
});
|
|
137
|
-
state.result = {
|
|
138
|
-
ref: input.ref,
|
|
139
|
-
status: "failed",
|
|
140
|
-
errorMessage: `Status check failed after ${this.maxRetries} retries: ${errName}: ${msg}`,
|
|
141
|
-
durationMs: Date.now() - startedAt,
|
|
142
|
-
};
|
|
143
|
-
this.releaseSlot(state);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
/** Idempotent release of the submit-time concurrent slot. Called from
|
|
148
|
-
* every settle branch (completed / failed / timed-out / retries-exhausted). */
|
|
149
|
-
releaseSlot(state) {
|
|
150
|
-
if (state.slotReleased)
|
|
151
|
-
return;
|
|
152
|
-
state.slotReleased = true;
|
|
153
|
-
try {
|
|
154
|
-
(0, rateLimiter_1.getAiGenModelRateLimiter)(state.input.modelKey).releaseSlot();
|
|
155
|
-
}
|
|
156
|
-
catch (err) {
|
|
157
|
-
// Unknown modelKey — log and move on. Better to leak a slot than
|
|
158
|
-
// throw out of the poll loop.
|
|
159
|
-
logger_1.logger.warn("TaskPoller release slot failed", {
|
|
160
|
-
ref: state.input.ref,
|
|
161
|
-
modelKey: state.input.modelKey,
|
|
162
|
-
err: err instanceof Error ? err.message : String(err),
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
resolveTimeout(modelKey) {
|
|
167
|
-
if (this.timeoutOverrideMs)
|
|
168
|
-
return this.timeoutOverrideMs;
|
|
169
|
-
const cfg = aiModels_1.aiModelConfigs[modelKey];
|
|
170
|
-
return cfg?.pollTimeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
exports.TaskPoller = TaskPoller;
|
|
174
|
-
function sleep(ms) {
|
|
175
|
-
return new Promise((res) => setTimeout(res, ms));
|
|
176
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AG-40 — role-default style guide for text overlays.
|
|
3
|
-
*
|
|
4
|
-
* The planner picks a role per overlay (headline, cta, watermark, etc.). This
|
|
5
|
-
* file is the single source of truth for "what does role X look like". Each
|
|
6
|
-
* role's defaults are tuned for vertical 9:16 (1080×1920) but scale by
|
|
7
|
-
* fraction-of-frame so they work on 16:9 / 1:1 too. Per-overlay overrides
|
|
8
|
-
* still win at render time — this is "the polish default the planner can
|
|
9
|
-
* trust to look OK without thinking".
|
|
10
|
-
*
|
|
11
|
-
* Why a style guide vs. ad-hoc per-scene styling: the previous one-string
|
|
12
|
-
* `onScreenText` model produced overlays that ran off the side of the frame
|
|
13
|
-
* (see Test 1 closing scene — "HydraPure — Order" with the H cut off) and
|
|
14
|
-
* looked uniformly amateurish (every caption was the same bold-white-bottom
|
|
15
|
-
* block). Roles let the renderer treat a headline differently from a
|
|
16
|
-
* disclaimer differently from a watermark, automatically.
|
|
17
|
-
*/
|
|
18
|
-
import type { TextRole, TextPosition, TextOverlay } from "../../schemas/videoPlan.schema";
|
|
19
|
-
export interface ResolvedTextStyle {
|
|
20
|
-
position: TextPosition;
|
|
21
|
-
/** Fraction of frame height — multiplied by output H at render time. */
|
|
22
|
-
fontSizeFraction: number;
|
|
23
|
-
weight: "regular" | "medium" | "bold" | "black";
|
|
24
|
-
color: string;
|
|
25
|
-
/** Background color (CSS-ish) or undefined for transparent. */
|
|
26
|
-
bgColor?: string;
|
|
27
|
-
/** Background alpha 0-1; only used if bgColor set. */
|
|
28
|
-
bgAlpha?: number;
|
|
29
|
-
/** Stroke width in px at output resolution. */
|
|
30
|
-
strokeWidth: number;
|
|
31
|
-
strokeColor: string;
|
|
32
|
-
animation: "none" | "fade" | "pop" | "type" | "slide-up" | "word-pop" | "highlight-current";
|
|
33
|
-
/**
|
|
34
|
-
* Max horizontal fraction of frame for word-wrap. Lower = narrower column,
|
|
35
|
-
* forces wrapping sooner. Watermarks get a small fraction so they hug the
|
|
36
|
-
* corner; headlines get a wide one so single-line slogans fit.
|
|
37
|
-
*/
|
|
38
|
-
maxWidthFraction: number;
|
|
39
|
-
/** Padding from edge (fraction of min(W,H)). */
|
|
40
|
-
edgePaddingFraction: number;
|
|
41
|
-
/**
|
|
42
|
-
* If set, this is the default "persist across scenes" behavior for the role.
|
|
43
|
-
* Watermarks default to true (sticky brand mark); everything else false.
|
|
44
|
-
*/
|
|
45
|
-
persistAcrossScenesDefault?: boolean;
|
|
46
|
-
/** Caller hint: which font weights should be tried in order. */
|
|
47
|
-
preferredFonts: string[];
|
|
48
|
-
}
|
|
49
|
-
export declare const TEXT_ROLE_STYLES: Record<TextRole, ResolvedTextStyle>;
|
|
50
|
-
/**
|
|
51
|
-
* Merge per-overlay overrides with role defaults. Per-overlay wins for any
|
|
52
|
-
* field the LLM chose to set; role default fills the rest.
|
|
53
|
-
*/
|
|
54
|
-
export declare function resolveOverlayStyle(overlay: TextOverlay): ResolvedTextStyle;
|
|
55
|
-
/**
|
|
56
|
-
* Cheat sheet the planner gets in its system prompt so it knows when to use
|
|
57
|
-
* which role and the soft per-role word-count caps that keep frames clean.
|
|
58
|
-
*/
|
|
59
|
-
export declare const TEXT_ROLE_CHEAT_SHEET: string;
|
|
60
|
-
//# sourceMappingURL=textOverlayStyles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textOverlayStyles.d.ts","sourceRoot":"","sources":["../../../src/services/agent/textOverlayStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE1F,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAC;IACvB,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,GACN,UAAU,GACV,UAAU,GACV,mBAAmB,CAAC;IACxB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,gEAAgE;IAChE,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AASD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAyGhE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,iBAAiB,CAY3E;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAmB1B,CAAC"}
|