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,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BibleBuilder = void 0;
|
|
4
|
-
const videoPlan_schema_1 = require("../../schemas/videoPlan.schema");
|
|
5
|
-
const modelRouter_1 = require("./modelRouter");
|
|
6
|
-
class BibleBuilder {
|
|
7
|
-
constructor(opts) {
|
|
8
|
-
this.opts = opts;
|
|
9
|
-
this.router = opts.router ?? new modelRouter_1.ModelRouter();
|
|
10
|
-
}
|
|
11
|
-
async build({ brief, persona, brandKit, consistencyTier = "C1", }) {
|
|
12
|
-
const model = this.router.pickFor("planner");
|
|
13
|
-
const fallbackModel = this.router.fallbackFor("planner");
|
|
14
|
-
const system = [
|
|
15
|
-
"You are a visual continuity director for short-form video.",
|
|
16
|
-
"Given a video brief, extract the RECURRING visual entities that will",
|
|
17
|
-
"appear in more than one scene. The goal is identity consistency — so",
|
|
18
|
-
"the same character, the same product, and the same environment look",
|
|
19
|
-
"visually constant across cuts when the video is assembled.",
|
|
20
|
-
"",
|
|
21
|
-
"Output three arrays — characters / objects / environments — using",
|
|
22
|
-
"stable ids: CHAR_1, CHAR_2... OBJ_1, OBJ_2... ENV_1, ENV_2...",
|
|
23
|
-
"",
|
|
24
|
-
"Per-entity description rules:",
|
|
25
|
-
" - Characters: age range, ethnicity, hair color/length/style, build,",
|
|
26
|
-
" skin tone, distinctive features, exact wardrobe (color + garment).",
|
|
27
|
-
" One paragraph max. NO actions, NO scene-specific verbs — only",
|
|
28
|
-
" enduring identity traits.",
|
|
29
|
-
" - Objects: shape, material, color, surface finish, distinctive",
|
|
30
|
-
" branding/labels (text VERBATIM if shown), approximate scale.",
|
|
31
|
-
" - Environments: dominant palette, lighting style (warm/cool/contrast),",
|
|
32
|
-
" era/style, recurring background elements. Usually 0 or 1 entry.",
|
|
33
|
-
"",
|
|
34
|
-
"Inclusion rules:",
|
|
35
|
-
" - Include a character/object/environment ONLY if it likely appears in",
|
|
36
|
-
" >= 2 scenes. One-off props or extras do NOT belong in the bible.",
|
|
37
|
-
" - If the brief implies a single presenter / spokesperson (UGC ads,",
|
|
38
|
-
" talking-head), output one character entry even if the brief doesn't",
|
|
39
|
-
" name them — assume one consistent presenter throughout.",
|
|
40
|
-
" - For product-focused briefs, the product is OBJ_1 with verbatim",
|
|
41
|
-
" label text if shown.",
|
|
42
|
-
" - For brand kits with presenterFaceUrl, that presenter is CHAR_1 and",
|
|
43
|
-
" the description should match their look in that face image.",
|
|
44
|
-
"",
|
|
45
|
-
`Consistency tier: ${consistencyTier}.`,
|
|
46
|
-
consistencyTier === "C2"
|
|
47
|
-
? " - C2: be MORE explicit on identity — these descriptions will both seed reference-image generation AND get re-stated in every scene prompt. Mention concrete visual anchors (e.g. 'shoulder-length black bob with blunt fringe', not 'short hair'). Aim for ~50–80 words per entity."
|
|
48
|
-
: " - C1: descriptions are text-only and re-stated verbatim into every scene prompt that references the entity. Aim for ~30–50 words per entity.",
|
|
49
|
-
"",
|
|
50
|
-
"If the brief is too sparse or describes a one-off scene with no",
|
|
51
|
-
"recurring subjects, return empty arrays — that is a valid bible.",
|
|
52
|
-
].join("\n");
|
|
53
|
-
const personaSection = persona ? `\nPersona: ${persona}.` : "";
|
|
54
|
-
const brandKitSection = brandKit
|
|
55
|
-
? [
|
|
56
|
-
"\nBrand kit:",
|
|
57
|
-
brandKit.brandName ? ` Brand: ${brandKit.brandName}` : "",
|
|
58
|
-
brandKit.presenterFaceUrl
|
|
59
|
-
? ` Presenter face URL: ${brandKit.presenterFaceUrl} (CHAR_1 should match this presenter's look)`
|
|
60
|
-
: "",
|
|
61
|
-
brandKit.primaryColorHex || brandKit.secondaryColorHex
|
|
62
|
-
? ` Palette: ${[brandKit.primaryColorHex, brandKit.secondaryColorHex].filter(Boolean).join(" / ")}`
|
|
63
|
-
: "",
|
|
64
|
-
]
|
|
65
|
-
.filter(Boolean)
|
|
66
|
-
.join("\n")
|
|
67
|
-
: "";
|
|
68
|
-
const user = [
|
|
69
|
-
`Brief:\n${JSON.stringify(brief, null, 2)}`,
|
|
70
|
-
personaSection,
|
|
71
|
-
brandKitSection,
|
|
72
|
-
]
|
|
73
|
-
.filter(Boolean)
|
|
74
|
-
.join("\n");
|
|
75
|
-
const result = await this.opts.llm.structured({
|
|
76
|
-
model,
|
|
77
|
-
fallbackModel,
|
|
78
|
-
messages: [
|
|
79
|
-
{ role: "system", content: system },
|
|
80
|
-
{ role: "user", content: user },
|
|
81
|
-
],
|
|
82
|
-
schema: videoPlan_schema_1.AgentVisualBibleSchema,
|
|
83
|
-
schemaName: "AgentVisualBible",
|
|
84
|
-
temperature: 0.3,
|
|
85
|
-
});
|
|
86
|
-
const parsed = videoPlan_schema_1.AgentVisualBibleSchema.safeParse(result.data);
|
|
87
|
-
if (!parsed.success) {
|
|
88
|
-
// Soft-fail: an unparseable bible should not block planning. Return
|
|
89
|
-
// an empty bible with the requested tier so the planner degrades to
|
|
90
|
-
// AG-11's per-scene-prompt re-state.
|
|
91
|
-
return {
|
|
92
|
-
characters: [],
|
|
93
|
-
objects: [],
|
|
94
|
-
environments: [],
|
|
95
|
-
consistencyTier,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
// Ensure tier flag reflects caller intent even if the LLM omitted it.
|
|
99
|
-
return { ...parsed.data, consistencyTier };
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.BibleBuilder = BibleBuilder;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OD-T6 — bible image-vision pass.
|
|
3
|
-
*
|
|
4
|
-
* Background: BibleBuilder writes each entity's `description` from the brief
|
|
5
|
-
* text alone. When the brief and the user-supplied (or freshly-rendered)
|
|
6
|
-
* `referenceImageUrl` disagree on physical details — e.g. brief says
|
|
7
|
-
* "frosted clear plastic with subtle green accents", image is a matte green
|
|
8
|
-
* stainless steel bottle — every downstream scene prompt the planner emits
|
|
9
|
-
* inherits the *brief-derived* description, and the per-scene critic flags
|
|
10
|
-
* `promptAdherence` FAIL on every scene it touched.
|
|
11
|
-
*
|
|
12
|
-
* Fix: after bible entities have a referenceImageUrl in place, run a single
|
|
13
|
-
* Gemini-2.5-Flash vision pass per entity asking for a literal physical
|
|
14
|
-
* description (color, material, finish, label, proportions). Merge the
|
|
15
|
-
* vision string into entity.description. The planner then composes scene
|
|
16
|
-
* prompts that describe what the *image* actually shows, so I2V / reference
|
|
17
|
-
* scenes match the brand visually instead of fighting the source asset.
|
|
18
|
-
*
|
|
19
|
-
* Scope: only entities WITH a referenceImageUrl get rewritten. Entities
|
|
20
|
-
* relying on text description alone are untouched (no image → nothing to
|
|
21
|
-
* extract). Brief intent (claims, vibe, audience) is preserved as a prefix
|
|
22
|
-
* "Per brief: …" in the merged description so the planner doesn't lose
|
|
23
|
-
* marketing context.
|
|
24
|
-
*
|
|
25
|
-
* Cost: Gemini Flash with one 1024×1024 image ≈ 258 tokens × $0.075/1M ≈
|
|
26
|
-
* $0.00002 per entity. A typical bible (1 char + 1 obj + 1 env) = ~$0.0001.
|
|
27
|
-
*
|
|
28
|
-
* Failure mode: per-entity isolated. A vision call that fails or returns
|
|
29
|
-
* empty leaves the original description intact — never block the run.
|
|
30
|
-
*/
|
|
31
|
-
import type { AgentVisualBible } from "../../schemas/videoPlan.schema";
|
|
32
|
-
export interface BibleImageVisionConfig {
|
|
33
|
-
apiKey: string;
|
|
34
|
-
model?: string;
|
|
35
|
-
/** Per-entity request timeout. */
|
|
36
|
-
timeoutMs?: number;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Run the image-vision pass. Returns a new bible with descriptions rewritten
|
|
40
|
-
* for any entity that had a referenceImageUrl. Entities without one are
|
|
41
|
-
* untouched. The original brief-derived description is preserved as a
|
|
42
|
-
* "Per brief:" suffix so the planner keeps the marketing intent.
|
|
43
|
-
*/
|
|
44
|
-
export declare function runBibleImageVision(bible: AgentVisualBible, config: BibleImageVisionConfig): Promise<AgentVisualBible>;
|
|
45
|
-
//# sourceMappingURL=bibleImageVision.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bibleImageVision.d.ts","sourceRoot":"","sources":["../../../src/services/agent/bibleImageVision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA4BD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,gBAAgB,CAAC,CA2C3B"}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* OD-T6 — bible image-vision pass.
|
|
4
|
-
*
|
|
5
|
-
* Background: BibleBuilder writes each entity's `description` from the brief
|
|
6
|
-
* text alone. When the brief and the user-supplied (or freshly-rendered)
|
|
7
|
-
* `referenceImageUrl` disagree on physical details — e.g. brief says
|
|
8
|
-
* "frosted clear plastic with subtle green accents", image is a matte green
|
|
9
|
-
* stainless steel bottle — every downstream scene prompt the planner emits
|
|
10
|
-
* inherits the *brief-derived* description, and the per-scene critic flags
|
|
11
|
-
* `promptAdherence` FAIL on every scene it touched.
|
|
12
|
-
*
|
|
13
|
-
* Fix: after bible entities have a referenceImageUrl in place, run a single
|
|
14
|
-
* Gemini-2.5-Flash vision pass per entity asking for a literal physical
|
|
15
|
-
* description (color, material, finish, label, proportions). Merge the
|
|
16
|
-
* vision string into entity.description. The planner then composes scene
|
|
17
|
-
* prompts that describe what the *image* actually shows, so I2V / reference
|
|
18
|
-
* scenes match the brand visually instead of fighting the source asset.
|
|
19
|
-
*
|
|
20
|
-
* Scope: only entities WITH a referenceImageUrl get rewritten. Entities
|
|
21
|
-
* relying on text description alone are untouched (no image → nothing to
|
|
22
|
-
* extract). Brief intent (claims, vibe, audience) is preserved as a prefix
|
|
23
|
-
* "Per brief: …" in the merged description so the planner doesn't lose
|
|
24
|
-
* marketing context.
|
|
25
|
-
*
|
|
26
|
-
* Cost: Gemini Flash with one 1024×1024 image ≈ 258 tokens × $0.075/1M ≈
|
|
27
|
-
* $0.00002 per entity. A typical bible (1 char + 1 obj + 1 env) = ~$0.0001.
|
|
28
|
-
*
|
|
29
|
-
* Failure mode: per-entity isolated. A vision call that fails or returns
|
|
30
|
-
* empty leaves the original description intact — never block the run.
|
|
31
|
-
*/
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.runBibleImageVision = runBibleImageVision;
|
|
34
|
-
const genai_1 = require("@google/genai");
|
|
35
|
-
const logger_1 = require("../../utils/logger");
|
|
36
|
-
const DEFAULT_MODEL = "gemini-2.5-flash";
|
|
37
|
-
/**
|
|
38
|
-
* Per-entity-kind extraction prompts. Each asks for image-literal physical
|
|
39
|
-
* properties only — the planner re-introduces brief intent on top.
|
|
40
|
-
*/
|
|
41
|
-
const PROMPT_BY_KIND = {
|
|
42
|
-
character: [
|
|
43
|
-
"Describe this person literally and only from what is visible in the image.",
|
|
44
|
-
"Cover: approximate age range, build, skin tone, hair (color + style), eye color if visible,",
|
|
45
|
-
"facial features (face shape, brows, lips), wardrobe (color, fabric, fit), and any accessories.",
|
|
46
|
-
"Use 2-3 plain sentences. No interpretation, no marketing language, no assumptions about personality.",
|
|
47
|
-
].join(" "),
|
|
48
|
-
object: [
|
|
49
|
-
"Describe this product literally and only from what is visible in the image.",
|
|
50
|
-
"Cover: color(s), material, finish (matte/glossy/textured), shape and proportions,",
|
|
51
|
-
"any labels or brand text (transcribe exactly, including font weight), lid/cap style, size cues.",
|
|
52
|
-
"Use 2-3 plain sentences. No marketing claims, no interpretation — just the physical object.",
|
|
53
|
-
].join(" "),
|
|
54
|
-
environment: [
|
|
55
|
-
"Describe this environment literally and only from what is visible in the image.",
|
|
56
|
-
"Cover: setting type (indoor/outdoor/studio), dominant palette, lighting direction and quality,",
|
|
57
|
-
"surfaces and major props, depth/scale. Use 2-3 plain sentences. No interpretation, no narrative.",
|
|
58
|
-
].join(" "),
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Run the image-vision pass. Returns a new bible with descriptions rewritten
|
|
62
|
-
* for any entity that had a referenceImageUrl. Entities without one are
|
|
63
|
-
* untouched. The original brief-derived description is preserved as a
|
|
64
|
-
* "Per brief:" suffix so the planner keeps the marketing intent.
|
|
65
|
-
*/
|
|
66
|
-
async function runBibleImageVision(bible, config) {
|
|
67
|
-
const model = config.model ?? DEFAULT_MODEL;
|
|
68
|
-
const timeoutMs = config.timeoutMs ?? 30000;
|
|
69
|
-
const ai = new genai_1.GoogleGenAI({ apiKey: config.apiKey });
|
|
70
|
-
const rewriteOne = async (entity, kind) => {
|
|
71
|
-
if (!entity.referenceImageUrl)
|
|
72
|
-
return entity;
|
|
73
|
-
try {
|
|
74
|
-
const visionText = await describeImage(ai, model, entity.referenceImageUrl, PROMPT_BY_KIND[kind], timeoutMs);
|
|
75
|
-
if (!visionText)
|
|
76
|
-
return entity;
|
|
77
|
-
const merged = mergeDescription(visionText, entity.description);
|
|
78
|
-
logger_1.logger.info(`bibleImageVision: rewrote ${entity.id} (${kind})`, {
|
|
79
|
-
entityId: entity.id,
|
|
80
|
-
originalLen: entity.description.length,
|
|
81
|
-
visionLen: visionText.length,
|
|
82
|
-
mergedLen: merged.length,
|
|
83
|
-
});
|
|
84
|
-
return { ...entity, description: merged };
|
|
85
|
-
}
|
|
86
|
-
catch (err) {
|
|
87
|
-
logger_1.logger.warn(`bibleImageVision: ${entity.id} failed — keeping text description`, {
|
|
88
|
-
entityId: entity.id,
|
|
89
|
-
error: err instanceof Error ? err.message : String(err),
|
|
90
|
-
});
|
|
91
|
-
return entity;
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const [characters, objects, environments] = await Promise.all([
|
|
95
|
-
Promise.all(bible.characters.map((c) => rewriteOne(c, "character"))),
|
|
96
|
-
Promise.all(bible.objects.map((o) => rewriteOne(o, "object"))),
|
|
97
|
-
Promise.all(bible.environments.map((e) => rewriteOne(e, "environment"))),
|
|
98
|
-
]);
|
|
99
|
-
return { ...bible, characters, objects, environments };
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Compose the final description. Image-literal sentence(s) lead — that's
|
|
103
|
-
* what the planner needs for visually-faithful scene prompts. The original
|
|
104
|
-
* brief-derived text is appended as "Per brief: …" so brand voice / claims /
|
|
105
|
-
* positioning (which the image can't convey) still reach the planner.
|
|
106
|
-
*/
|
|
107
|
-
function mergeDescription(visionText, originalDescription) {
|
|
108
|
-
const cleanVision = visionText.trim().replace(/\s+/g, " ");
|
|
109
|
-
const cleanOriginal = originalDescription.trim().replace(/\s+/g, " ");
|
|
110
|
-
if (!cleanOriginal)
|
|
111
|
-
return cleanVision;
|
|
112
|
-
return `${cleanVision} Per brief: ${cleanOriginal}`;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Download the image as bytes and send it to Gemini Flash with the supplied
|
|
116
|
-
* prompt. Returns the model's text response (trimmed). Throws on network /
|
|
117
|
-
* upload / model error so the caller can isolate the failure per-entity.
|
|
118
|
-
*/
|
|
119
|
-
async function describeImage(ai, model, imageUrl, prompt, timeoutMs) {
|
|
120
|
-
const controller = new AbortController();
|
|
121
|
-
const t = setTimeout(() => controller.abort(), timeoutMs);
|
|
122
|
-
let bytes;
|
|
123
|
-
let mimeType;
|
|
124
|
-
try {
|
|
125
|
-
const r = await fetch(imageUrl, { signal: controller.signal });
|
|
126
|
-
if (!r.ok) {
|
|
127
|
-
throw new Error(`fetch ${r.status} ${r.statusText}`);
|
|
128
|
-
}
|
|
129
|
-
bytes = Buffer.from(await r.arrayBuffer());
|
|
130
|
-
mimeType = pickImageMimeType(r.headers.get("content-type"), imageUrl);
|
|
131
|
-
}
|
|
132
|
-
finally {
|
|
133
|
-
clearTimeout(t);
|
|
134
|
-
}
|
|
135
|
-
const resp = await ai.models.generateContent({
|
|
136
|
-
model,
|
|
137
|
-
contents: [
|
|
138
|
-
{
|
|
139
|
-
role: "user",
|
|
140
|
-
parts: [
|
|
141
|
-
{ text: prompt },
|
|
142
|
-
{
|
|
143
|
-
inlineData: {
|
|
144
|
-
mimeType,
|
|
145
|
-
data: bytes.toString("base64"),
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
config: { temperature: 0.1 },
|
|
152
|
-
});
|
|
153
|
-
return (resp.text ?? "").trim();
|
|
154
|
-
}
|
|
155
|
-
function pickImageMimeType(headerType, url) {
|
|
156
|
-
const hdr = (headerType ?? "").split(";")[0]?.trim().toLowerCase() ?? "";
|
|
157
|
-
if (hdr.startsWith("image/"))
|
|
158
|
-
return hdr;
|
|
159
|
-
const lower = url.toLowerCase();
|
|
160
|
-
if (lower.includes(".png"))
|
|
161
|
-
return "image/png";
|
|
162
|
-
if (lower.includes(".webp"))
|
|
163
|
-
return "image/webp";
|
|
164
|
-
if (lower.includes(".gif"))
|
|
165
|
-
return "image/gif";
|
|
166
|
-
if (lower.includes(".heic"))
|
|
167
|
-
return "image/heic";
|
|
168
|
-
return "image/jpeg";
|
|
169
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slice 2 — in-editor chat agent.
|
|
3
|
-
*
|
|
4
|
-
* Streams a single user turn through Anthropic's tool-use loop and emits
|
|
5
|
-
* normalized events so the SSE controller and any future surface (CLI
|
|
6
|
-
* eval, automated regression harness) can consume the same shape.
|
|
7
|
-
*
|
|
8
|
-
* Slice 2 is read-only — the only tool wired is `get_project_state`.
|
|
9
|
-
* Write tools (regenerate, replan, update-scene) land in Slice 3 behind
|
|
10
|
-
* a confirmation flow. The system prompt explicitly tells the model it
|
|
11
|
-
* cannot mutate the project in this slice so it doesn't fabricate write
|
|
12
|
-
* intents; instead it explains what change it WOULD make and points the
|
|
13
|
-
* user to the existing UI control.
|
|
14
|
-
*
|
|
15
|
-
* Architecture choice: this lives in shared (not in firebase-functions)
|
|
16
|
-
* so the Express worker can reuse the loop when Slice 3 moves write
|
|
17
|
-
* tool execution onto BullMQ. The host wires the Anthropic client via
|
|
18
|
-
* `apiKey` from env; the loop itself is provider-agnostic in spirit
|
|
19
|
-
* (one Anthropic SDK call per round) but does not abstract behind
|
|
20
|
-
* LlmCaller because we need raw streaming + tool blocks that the
|
|
21
|
-
* structured-output caller hides.
|
|
22
|
-
*/
|
|
23
|
-
export type ChatTurnEvent = {
|
|
24
|
-
kind: "status";
|
|
25
|
-
phase: "thinking" | "tool_call" | "writing" | "done";
|
|
26
|
-
} | {
|
|
27
|
-
kind: "tool_call";
|
|
28
|
-
id: string;
|
|
29
|
-
tool: string;
|
|
30
|
-
input: unknown;
|
|
31
|
-
} | {
|
|
32
|
-
kind: "tool_result";
|
|
33
|
-
id: string;
|
|
34
|
-
result: unknown;
|
|
35
|
-
} | {
|
|
36
|
-
kind: "token";
|
|
37
|
-
delta: string;
|
|
38
|
-
} | {
|
|
39
|
-
kind: "final";
|
|
40
|
-
text: string;
|
|
41
|
-
} | {
|
|
42
|
-
kind: "error";
|
|
43
|
-
message: string;
|
|
44
|
-
};
|
|
45
|
-
export interface ChatTurnTool {
|
|
46
|
-
name: string;
|
|
47
|
-
description: string;
|
|
48
|
-
/** JSON Schema (draft-07) for tool input. Must be an object schema. */
|
|
49
|
-
inputSchema: Record<string, unknown>;
|
|
50
|
-
/** Execute the tool against its parsed input. Return value is JSON-serialized
|
|
51
|
-
* back to the model as the tool_result content. */
|
|
52
|
-
run: (input: unknown) => Promise<unknown> | unknown;
|
|
53
|
-
}
|
|
54
|
-
export interface ChatTurnRequest {
|
|
55
|
-
apiKey: string;
|
|
56
|
-
model: string;
|
|
57
|
-
systemPrompt: string;
|
|
58
|
-
/** Prior conversation (last N messages already pruned by caller). */
|
|
59
|
-
history: Array<{
|
|
60
|
-
role: "user" | "assistant";
|
|
61
|
-
text: string;
|
|
62
|
-
}>;
|
|
63
|
-
/** The fresh user message for this turn. */
|
|
64
|
-
userMessage: string;
|
|
65
|
-
tools: ChatTurnTool[];
|
|
66
|
-
/** Hard ceiling on tool-call rounds before we bail. Default 6. */
|
|
67
|
-
maxRounds?: number;
|
|
68
|
-
/** Optional AbortSignal so the SSE controller can cancel on client disconnect. */
|
|
69
|
-
signal?: AbortSignal;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Drive one chat turn. Yields events as they happen so the caller can
|
|
73
|
-
* forward straight to SSE; the final event is always `final` (success)
|
|
74
|
-
* or `error` (failure). Tool execution is awaited inline between rounds
|
|
75
|
-
* — Anthropic's streaming API gives us tool_use blocks fully assembled
|
|
76
|
-
* at the end of each stream, so we don't need partial-input handling.
|
|
77
|
-
*/
|
|
78
|
-
export declare function runChatTurn(req: ChatTurnRequest): AsyncGenerator<ChatTurnEvent, void, void>;
|
|
79
|
-
//# sourceMappingURL=chatAgent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatAgent.d.ts","sourceRoot":"","sources":["../../../src/services/agent/chatAgent.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAA;CAAE,GACxE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC;wDACoD;IACpD,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CACrD;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAKD;;;;;;GAMG;AACH,wBAAuB,WAAW,CAChC,GAAG,EAAE,eAAe,GACnB,cAAc,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAkI3C"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.runChatTurn = runChatTurn;
|
|
7
|
-
const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
|
|
8
|
-
const logger_1 = require("../../utils/logger");
|
|
9
|
-
const DEFAULT_MAX_ROUNDS = 6;
|
|
10
|
-
const DEFAULT_MAX_TOKENS = 4096;
|
|
11
|
-
/**
|
|
12
|
-
* Drive one chat turn. Yields events as they happen so the caller can
|
|
13
|
-
* forward straight to SSE; the final event is always `final` (success)
|
|
14
|
-
* or `error` (failure). Tool execution is awaited inline between rounds
|
|
15
|
-
* — Anthropic's streaming API gives us tool_use blocks fully assembled
|
|
16
|
-
* at the end of each stream, so we don't need partial-input handling.
|
|
17
|
-
*/
|
|
18
|
-
async function* runChatTurn(req) {
|
|
19
|
-
const client = new sdk_1.default({ apiKey: req.apiKey });
|
|
20
|
-
const toolsByName = new Map(req.tools.map((t) => [t.name, t]));
|
|
21
|
-
const anthropicTools = req.tools.map((t) => ({
|
|
22
|
-
name: t.name,
|
|
23
|
-
description: t.description,
|
|
24
|
-
input_schema: t.inputSchema,
|
|
25
|
-
}));
|
|
26
|
-
// Anthropic wants user/assistant turns only; system goes top-level.
|
|
27
|
-
const convo = [
|
|
28
|
-
...req.history.map((m) => ({ role: m.role, content: m.text })),
|
|
29
|
-
{ role: "user", content: req.userMessage },
|
|
30
|
-
];
|
|
31
|
-
const maxRounds = req.maxRounds ?? DEFAULT_MAX_ROUNDS;
|
|
32
|
-
for (let round = 0; round < maxRounds; round++) {
|
|
33
|
-
yield { kind: "status", phase: "thinking" };
|
|
34
|
-
// Per-round stream. We accumulate text and tool_use blocks; if the
|
|
35
|
-
// stop_reason is tool_use we execute and loop, else we yield the
|
|
36
|
-
// final text and exit.
|
|
37
|
-
let stop = null;
|
|
38
|
-
let assistantText = "";
|
|
39
|
-
const assistantBlocks = [];
|
|
40
|
-
const toolUses = [];
|
|
41
|
-
try {
|
|
42
|
-
const stream = client.messages.stream({
|
|
43
|
-
model: req.model,
|
|
44
|
-
max_tokens: DEFAULT_MAX_TOKENS,
|
|
45
|
-
system: req.systemPrompt,
|
|
46
|
-
tools: anthropicTools,
|
|
47
|
-
messages: convo,
|
|
48
|
-
}, req.signal ? { signal: req.signal } : undefined);
|
|
49
|
-
// Stream raw text deltas live so the UI can render as the model
|
|
50
|
-
// writes. tool_use deltas accumulate but aren't surfaced until the
|
|
51
|
-
// block finalizes (we send a single tool_call event then).
|
|
52
|
-
for await (const event of stream) {
|
|
53
|
-
if (event.type === "content_block_delta") {
|
|
54
|
-
if (event.delta.type === "text_delta") {
|
|
55
|
-
const delta = event.delta.text;
|
|
56
|
-
assistantText += delta;
|
|
57
|
-
yield { kind: "token", delta };
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const final = await stream.finalMessage();
|
|
62
|
-
stop = final.stop_reason;
|
|
63
|
-
for (const block of final.content) {
|
|
64
|
-
if (block.type === "text") {
|
|
65
|
-
assistantBlocks.push({ type: "text", text: block.text });
|
|
66
|
-
}
|
|
67
|
-
else if (block.type === "tool_use") {
|
|
68
|
-
assistantBlocks.push({
|
|
69
|
-
type: "tool_use",
|
|
70
|
-
id: block.id,
|
|
71
|
-
name: block.name,
|
|
72
|
-
input: block.input,
|
|
73
|
-
});
|
|
74
|
-
toolUses.push(block);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
if (req.signal?.aborted) {
|
|
80
|
-
yield { kind: "error", message: "aborted" };
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
yield {
|
|
84
|
-
kind: "error",
|
|
85
|
-
message: `chat turn failed: ${err.message}`,
|
|
86
|
-
};
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
// No tools requested → we're done. Emit final and exit.
|
|
90
|
-
if (stop !== "tool_use" || toolUses.length === 0) {
|
|
91
|
-
yield { kind: "status", phase: "done" };
|
|
92
|
-
yield { kind: "final", text: assistantText };
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
// Echo the assistant turn (including tool_use blocks) into the convo
|
|
96
|
-
// so the next round has the right shape.
|
|
97
|
-
convo.push({ role: "assistant", content: assistantBlocks });
|
|
98
|
-
// Execute each tool sequentially. Anthropic accepts multiple
|
|
99
|
-
// tool_use blocks per assistant turn; we mirror with matching
|
|
100
|
-
// tool_result blocks in a single user message.
|
|
101
|
-
yield { kind: "status", phase: "tool_call" };
|
|
102
|
-
const toolResultBlocks = [];
|
|
103
|
-
for (const use of toolUses) {
|
|
104
|
-
yield { kind: "tool_call", id: use.id, tool: use.name, input: use.input };
|
|
105
|
-
const tool = toolsByName.get(use.name);
|
|
106
|
-
let result;
|
|
107
|
-
if (!tool) {
|
|
108
|
-
result = { error: `unknown tool: ${use.name}` };
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
try {
|
|
112
|
-
result = await tool.run(use.input);
|
|
113
|
-
}
|
|
114
|
-
catch (err) {
|
|
115
|
-
logger_1.logger.error("chatAgent: tool execution failed", {
|
|
116
|
-
tool: use.name,
|
|
117
|
-
toolUseId: use.id,
|
|
118
|
-
err: err instanceof Error ? err.stack ?? err.message : String(err),
|
|
119
|
-
});
|
|
120
|
-
result = { error: err.message };
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
yield { kind: "tool_result", id: use.id, result };
|
|
124
|
-
toolResultBlocks.push({
|
|
125
|
-
type: "tool_result",
|
|
126
|
-
tool_use_id: use.id,
|
|
127
|
-
content: JSON.stringify(result ?? null),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
convo.push({ role: "user", content: toolResultBlocks });
|
|
131
|
-
}
|
|
132
|
-
yield {
|
|
133
|
-
kind: "error",
|
|
134
|
-
message: `chat turn exceeded ${maxRounds} tool rounds without finishing`,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Project, Tier } from "../../schemas/project.schema";
|
|
2
|
-
import { VideoPlan } from "../../schemas/videoPlan.schema";
|
|
3
|
-
/**
|
|
4
|
-
* Per-scene credit estimate that matches `estimatePlanCost` exactly. Use
|
|
5
|
-
* this anywhere the worker needs to stamp `creditsActual` for a completed
|
|
6
|
-
* scene so the actual-side reconciliation stays symmetric with the
|
|
7
|
-
* plan-side charge. Without this helper, the worker would read
|
|
8
|
-
* `scene.estimatedCredits` directly — but the LLM frequently emits 0 (or
|
|
9
|
-
* omits the field) for T0 scenes, while `estimatePlanCost` substitutes
|
|
10
|
-
* the per-second tier curve for those, producing the classic
|
|
11
|
-
* "charged 19 cr / actual 0.42 cr → refund 18 cr" asymmetry on faceless
|
|
12
|
-
* personas where most scenes are T0.
|
|
13
|
-
*
|
|
14
|
-
* Also folds in TTS cost based on `voiceoverLine.length` — this was an
|
|
15
|
-
* un-billed leak before: ElevenLabs/OpenAI/MiniMax TTS are real $/char and
|
|
16
|
-
* the per-scene rollup never charged for them. Symmetric because the
|
|
17
|
-
* voiceover string is fixed at plan time.
|
|
18
|
-
*/
|
|
19
|
-
export declare function estimateSceneCredits(scene: {
|
|
20
|
-
tier: Tier;
|
|
21
|
-
durationMs: number;
|
|
22
|
-
estimatedCredits?: number;
|
|
23
|
-
voiceoverLine?: string;
|
|
24
|
-
}): number;
|
|
25
|
-
/**
|
|
26
|
-
* Plan-level overhead credits — the LLM/vision calls that happen around the
|
|
27
|
-
* scene generations themselves: the planner call, bible build (only on
|
|
28
|
-
* fresh builds, not cache hits), Anthropic web_search grounding (only when
|
|
29
|
-
* the planner actually invoked it), and the finalize-stage critic. These
|
|
30
|
-
* are flat per-plan rather than per-scene; the worker treats them as fully
|
|
31
|
-
* spent (no refund delta), so we don't have to track per-call actuals.
|
|
32
|
-
*
|
|
33
|
-
* Pass `bibleBuilt: false` for cache hits to skip the bible charge. Pass
|
|
34
|
-
* `usedWebResearch: false` when the planner ran the gateway path (no
|
|
35
|
-
* Anthropic web_search). `usedThinking` mirrors T3 premium briefs.
|
|
36
|
-
*/
|
|
37
|
-
export declare function estimatePlanOverheadCredits(opts: {
|
|
38
|
-
bibleBuilt?: boolean;
|
|
39
|
-
usedWebResearch?: boolean;
|
|
40
|
-
usedThinking?: boolean;
|
|
41
|
-
}): number;
|
|
42
|
-
export interface CostBreakdown {
|
|
43
|
-
totalCredits: number;
|
|
44
|
-
byTier: Record<Tier, number>;
|
|
45
|
-
perClip: Array<{
|
|
46
|
-
clipId: string;
|
|
47
|
-
tier?: Tier;
|
|
48
|
-
credits: number;
|
|
49
|
-
estimated: boolean;
|
|
50
|
-
}>;
|
|
51
|
-
}
|
|
52
|
-
export declare function estimateProjectCost(project: Project): CostBreakdown;
|
|
53
|
-
/**
|
|
54
|
-
* Plan-side estimate (pre-execution). The planner already writes
|
|
55
|
-
* `estimatedCredits` per scene + a `totalEstimatedCredits` rollup, so this
|
|
56
|
-
* mostly trusts those values and re-aggregates by tier for the UI chip.
|
|
57
|
-
* Falls back to the same per-second tier curve as `estimateProjectCost`
|
|
58
|
-
* when a scene omits its own estimate.
|
|
59
|
-
*/
|
|
60
|
-
export declare function estimatePlanCost(plan: VideoPlan): CostBreakdown;
|
|
61
|
-
//# sourceMappingURL=costPreflight.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"costPreflight.d.ts","sourceRoot":"","sources":["../../../src/services/agent/costPreflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAmD3D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAOT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,MAAM,CAQT;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,EAAE,KAAK,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,IAAI,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;CACJ;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAuBnE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa,CAoB/D"}
|