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,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* AG-40 — role-default style guide for text overlays.
|
|
4
|
-
*
|
|
5
|
-
* The planner picks a role per overlay (headline, cta, watermark, etc.). This
|
|
6
|
-
* file is the single source of truth for "what does role X look like". Each
|
|
7
|
-
* role's defaults are tuned for vertical 9:16 (1080×1920) but scale by
|
|
8
|
-
* fraction-of-frame so they work on 16:9 / 1:1 too. Per-overlay overrides
|
|
9
|
-
* still win at render time — this is "the polish default the planner can
|
|
10
|
-
* trust to look OK without thinking".
|
|
11
|
-
*
|
|
12
|
-
* Why a style guide vs. ad-hoc per-scene styling: the previous one-string
|
|
13
|
-
* `onScreenText` model produced overlays that ran off the side of the frame
|
|
14
|
-
* (see Test 1 closing scene — "HydraPure — Order" with the H cut off) and
|
|
15
|
-
* looked uniformly amateurish (every caption was the same bold-white-bottom
|
|
16
|
-
* block). Roles let the renderer treat a headline differently from a
|
|
17
|
-
* disclaimer differently from a watermark, automatically.
|
|
18
|
-
*/
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.TEXT_ROLE_CHEAT_SHEET = exports.TEXT_ROLE_STYLES = void 0;
|
|
21
|
-
exports.resolveOverlayStyle = resolveOverlayStyle;
|
|
22
|
-
// Inter is bundled with the express-server worker (apps/node-express-server/
|
|
23
|
-
// assets/fonts/). Listed first so the skia FontLibrary picks it up before any
|
|
24
|
-
// host-system fallback. ExtraBold / Black give the marketing weight; Medium is
|
|
25
|
-
// used for supporting copy. All host fallbacks are last-resort.
|
|
26
|
-
const SANS_DISPLAY = ["Inter", "Helvetica Neue", "Arial Bold", "DejaVuSans-Bold"];
|
|
27
|
-
const SANS_TEXT = ["Inter", "Helvetica", "Arial", "DejaVuSans"];
|
|
28
|
-
exports.TEXT_ROLE_STYLES = {
|
|
29
|
-
headline: {
|
|
30
|
-
position: "top",
|
|
31
|
-
// Was 1/14 (~137px @ 1920) — too big, crashed into subject's face zone on
|
|
32
|
-
// Test 1. 1/22 (~87px) reads as a modern editorial banner and leaves
|
|
33
|
-
// breathing room. The skia layoutBlock safe-zone enforcer will still
|
|
34
|
-
// auto-shrink if a long copy edge case overflows top 22%.
|
|
35
|
-
fontSizeFraction: 1 / 22,
|
|
36
|
-
weight: "black",
|
|
37
|
-
color: "white",
|
|
38
|
-
// Translucent dark pill matching the CTA — gives a consistent visual
|
|
39
|
-
// language across roles (was a bare stroked headline, looked inconsistent
|
|
40
|
-
// with the CTA pill on the closing scene).
|
|
41
|
-
bgColor: "black",
|
|
42
|
-
bgAlpha: 0.5,
|
|
43
|
-
strokeWidth: 0,
|
|
44
|
-
strokeColor: "black",
|
|
45
|
-
animation: "fade",
|
|
46
|
-
maxWidthFraction: 0.82,
|
|
47
|
-
edgePaddingFraction: 0.05,
|
|
48
|
-
preferredFonts: SANS_DISPLAY,
|
|
49
|
-
},
|
|
50
|
-
subheadline: {
|
|
51
|
-
position: "lower-third",
|
|
52
|
-
fontSizeFraction: 1 / 26,
|
|
53
|
-
weight: "medium",
|
|
54
|
-
color: "white",
|
|
55
|
-
bgColor: "black",
|
|
56
|
-
bgAlpha: 0.45,
|
|
57
|
-
strokeWidth: 0,
|
|
58
|
-
strokeColor: "black",
|
|
59
|
-
animation: "fade",
|
|
60
|
-
maxWidthFraction: 0.8,
|
|
61
|
-
edgePaddingFraction: 0.05,
|
|
62
|
-
preferredFonts: SANS_TEXT,
|
|
63
|
-
},
|
|
64
|
-
body: {
|
|
65
|
-
position: "lower-third",
|
|
66
|
-
fontSizeFraction: 1 / 32,
|
|
67
|
-
weight: "regular",
|
|
68
|
-
color: "white",
|
|
69
|
-
bgColor: "black",
|
|
70
|
-
bgAlpha: 0.45,
|
|
71
|
-
strokeWidth: 0,
|
|
72
|
-
strokeColor: "black",
|
|
73
|
-
animation: "fade",
|
|
74
|
-
maxWidthFraction: 0.8,
|
|
75
|
-
edgePaddingFraction: 0.05,
|
|
76
|
-
preferredFonts: SANS_TEXT,
|
|
77
|
-
},
|
|
78
|
-
cta: {
|
|
79
|
-
position: "bottom",
|
|
80
|
-
fontSizeFraction: 1 / 20,
|
|
81
|
-
weight: "bold",
|
|
82
|
-
color: "white",
|
|
83
|
-
// Slightly more opaque than headline so the closing CTA reads as the
|
|
84
|
-
// strongest call in the frame.
|
|
85
|
-
bgColor: "black",
|
|
86
|
-
bgAlpha: 0.7,
|
|
87
|
-
strokeWidth: 0,
|
|
88
|
-
strokeColor: "black",
|
|
89
|
-
animation: "pop",
|
|
90
|
-
maxWidthFraction: 0.8,
|
|
91
|
-
edgePaddingFraction: 0.07,
|
|
92
|
-
preferredFonts: SANS_DISPLAY,
|
|
93
|
-
},
|
|
94
|
-
watermark: {
|
|
95
|
-
position: "bottom-right",
|
|
96
|
-
fontSizeFraction: 1 / 40,
|
|
97
|
-
weight: "medium",
|
|
98
|
-
color: "white@0.78",
|
|
99
|
-
strokeWidth: 0,
|
|
100
|
-
strokeColor: "black",
|
|
101
|
-
animation: "none",
|
|
102
|
-
maxWidthFraction: 0.32,
|
|
103
|
-
edgePaddingFraction: 0.03,
|
|
104
|
-
persistAcrossScenesDefault: true,
|
|
105
|
-
preferredFonts: SANS_TEXT,
|
|
106
|
-
},
|
|
107
|
-
disclaimer: {
|
|
108
|
-
position: "bottom",
|
|
109
|
-
fontSizeFraction: 1 / 52,
|
|
110
|
-
weight: "regular",
|
|
111
|
-
color: "white@0.72",
|
|
112
|
-
strokeWidth: 0,
|
|
113
|
-
strokeColor: "black",
|
|
114
|
-
animation: "fade",
|
|
115
|
-
maxWidthFraction: 0.88,
|
|
116
|
-
edgePaddingFraction: 0.025,
|
|
117
|
-
preferredFonts: SANS_TEXT,
|
|
118
|
-
},
|
|
119
|
-
label: {
|
|
120
|
-
position: "lower-third",
|
|
121
|
-
fontSizeFraction: 1 / 34,
|
|
122
|
-
weight: "medium",
|
|
123
|
-
color: "white",
|
|
124
|
-
bgColor: "black",
|
|
125
|
-
bgAlpha: 0.65,
|
|
126
|
-
strokeWidth: 0,
|
|
127
|
-
strokeColor: "black",
|
|
128
|
-
animation: "fade",
|
|
129
|
-
maxWidthFraction: 0.5,
|
|
130
|
-
edgePaddingFraction: 0.05,
|
|
131
|
-
preferredFonts: SANS_TEXT,
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Merge per-overlay overrides with role defaults. Per-overlay wins for any
|
|
136
|
-
* field the LLM chose to set; role default fills the rest.
|
|
137
|
-
*/
|
|
138
|
-
function resolveOverlayStyle(overlay) {
|
|
139
|
-
const base = exports.TEXT_ROLE_STYLES[overlay.role];
|
|
140
|
-
return {
|
|
141
|
-
...base,
|
|
142
|
-
position: overlay.position ?? base.position,
|
|
143
|
-
weight: overlay.weight ?? base.weight,
|
|
144
|
-
color: overlay.color ?? base.color,
|
|
145
|
-
bgColor: overlay.bgColor ?? base.bgColor,
|
|
146
|
-
animation: overlay.animation ?? base.animation,
|
|
147
|
-
// fontSize overrides aren't a fraction; if explicit px supplied we use it
|
|
148
|
-
// directly in the renderer (see overlayRenderer). Otherwise fraction wins.
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Cheat sheet the planner gets in its system prompt so it knows when to use
|
|
153
|
-
* which role and the soft per-role word-count caps that keep frames clean.
|
|
154
|
-
*/
|
|
155
|
-
exports.TEXT_ROLE_CHEAT_SHEET = `
|
|
156
|
-
Text overlay roles & limits:
|
|
157
|
-
- headline (top, big-bold): max 6 words. The hook / problem statement.
|
|
158
|
-
- subheadline (lower-third, medium): max 8 words. Supports a headline.
|
|
159
|
-
- body (lower-third, small): max ~14 words across 2 lines. Explainer/features.
|
|
160
|
-
- cta (bottom, bold pill): max 5 words. "Stay HydraPure — Order Today" stays.
|
|
161
|
-
Use on the FINAL scene only, MUST combine brand + verb.
|
|
162
|
-
- watermark (bottom-right corner, thin): brand name only, max 2 words.
|
|
163
|
-
Emit ONCE on scene 0 with persistAcrossScenes=true — the stitcher
|
|
164
|
-
carries it forward to every subsequent scene automatically.
|
|
165
|
-
- disclaimer (bottom, tiny): legal fine-print. "Results may vary." Use sparingly.
|
|
166
|
-
- label (lower-third pill): in-frame labels for objects/people, max 3 words.
|
|
167
|
-
|
|
168
|
-
Rules:
|
|
169
|
-
- Don't put two headlines on the same scene. One is the show-stopper, two is noise.
|
|
170
|
-
- Watermark + headline + CTA on the closing scene is fine (3 overlays).
|
|
171
|
-
- If a line is longer than the per-role word cap, the renderer will wrap it,
|
|
172
|
-
but the result looks better if you write tight copy than if you lean on word-wrap.
|
|
173
|
-
- Don't use legacy onScreenText: string when you can express it as overlays[].
|
|
174
|
-
`.trim();
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* MCP-shaped tool registry.
|
|
4
|
-
*
|
|
5
|
-
* Tools are defined once here and consumed in two ways:
|
|
6
|
-
* 1. Internally by the agent (planner/executor/critic) via `getTool(name)`
|
|
7
|
-
* and `runTool(name, input)` — no network hop.
|
|
8
|
-
* 2. Externally as an MCP server endpoint, by reading `listTools()` and
|
|
9
|
-
* JSON-RPC dispatching to `runTool` (wired in a later commit).
|
|
10
|
-
*
|
|
11
|
-
* Each tool ships with:
|
|
12
|
-
* - name: stable identifier the LLM uses
|
|
13
|
-
* - description: written for LLMs (when to use, when NOT to use, examples)
|
|
14
|
-
* - inputSchema / outputSchema: Zod, validated on every call
|
|
15
|
-
* - handler: pure async function over validated input → validated output
|
|
16
|
-
*
|
|
17
|
-
* Idempotency, cost preflight, and rate limiting are implemented as wrappers
|
|
18
|
-
* around `runTool` rather than per-tool, so we don't repeat ourselves.
|
|
19
|
-
*/
|
|
20
|
-
export interface ToolDefinition<I extends z.ZodTypeAny, O extends z.ZodTypeAny> {
|
|
21
|
-
name: string;
|
|
22
|
-
description: string;
|
|
23
|
-
inputSchema: I;
|
|
24
|
-
outputSchema: O;
|
|
25
|
-
handler: (input: z.infer<I>, ctx: ToolContext) => Promise<z.infer<O>>;
|
|
26
|
-
/** If true, identical (name, idempotencyKey) calls return cached result. */
|
|
27
|
-
idempotent?: boolean;
|
|
28
|
-
/** Tier-aware cost estimate; called when input.dry_run is true. */
|
|
29
|
-
estimateCost?: (input: z.infer<I>) => Promise<number>;
|
|
30
|
-
}
|
|
31
|
-
export interface ToolContext {
|
|
32
|
-
/** User the agent is acting on behalf of. */
|
|
33
|
-
userId: string;
|
|
34
|
-
/** Agent run id, for tracing and replay. */
|
|
35
|
-
agentRunId: string;
|
|
36
|
-
/** Project the tool is operating on, if applicable. */
|
|
37
|
-
projectId?: string;
|
|
38
|
-
/** Idempotency key for generation tools. */
|
|
39
|
-
idempotencyKey?: string;
|
|
40
|
-
/** Trace logger; replaced with structured logger by the host. */
|
|
41
|
-
log?: (event: string, data?: Record<string, unknown>) => void;
|
|
42
|
-
}
|
|
43
|
-
export interface ToolResult<O = unknown> {
|
|
44
|
-
ok: true;
|
|
45
|
-
output: O;
|
|
46
|
-
durationMs: number;
|
|
47
|
-
}
|
|
48
|
-
export interface ToolError {
|
|
49
|
-
ok: false;
|
|
50
|
-
error: {
|
|
51
|
-
code: string;
|
|
52
|
-
message: string;
|
|
53
|
-
/**
|
|
54
|
-
* Optional failure-class hints set by tools that wrap provider calls
|
|
55
|
-
* with `withProviderFallback`. Lets the executor decide whether to
|
|
56
|
-
* escalate to the agent for re-plan (safety / input) vs. fail the
|
|
57
|
-
* scene hard (auth / chain exhausted).
|
|
58
|
-
*/
|
|
59
|
-
classification?: "transient" | "rate_limit" | "capability" | "safety" | "auth" | "quota" | "input" | "unknown";
|
|
60
|
-
needsReplan?: boolean;
|
|
61
|
-
attemptedProviders?: string[];
|
|
62
|
-
};
|
|
63
|
-
durationMs: number;
|
|
64
|
-
}
|
|
65
|
-
export type ToolOutcome<O = unknown> = ToolResult<O> | ToolError;
|
|
66
|
-
export declare function registerTool<I extends z.ZodTypeAny, O extends z.ZodTypeAny>(def: ToolDefinition<I, O>): void;
|
|
67
|
-
export declare function getTool(name: string): ToolDefinition<z.ZodTypeAny, z.ZodTypeAny> | undefined;
|
|
68
|
-
export declare function listTools(): ToolDefinition<z.ZodTypeAny, z.ZodTypeAny>[];
|
|
69
|
-
/** Execute a tool by name with structured validation + error wrapping. */
|
|
70
|
-
export declare function runTool<O = unknown>(name: string, rawInput: unknown, ctx: ToolContext): Promise<ToolOutcome<O>>;
|
|
71
|
-
/** Test-only: drop all registered tools. */
|
|
72
|
-
export declare function _clearToolsForTesting(): void;
|
|
73
|
-
//# sourceMappingURL=toolRegistry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolRegistry.d.ts","sourceRoot":"","sources":["../../../src/services/agent/toolRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC,UAAU;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,CAAC;IACf,YAAY,EAAE,CAAC,CAAC;IAChB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC/D;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO;IACrC,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,EAAE,CAAC,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB;;;;;WAKG;QACH,cAAc,CAAC,EACX,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,QAAQ,GACR,MAAM,GACN,OAAO,GACP,OAAO,GACP,SAAS,CAAC;QACd,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC/B,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAIjE,wBAAgB,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC,UAAU,EACzE,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GACxB,IAAI,CAKN;AAED,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,GACX,cAAc,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,SAAS,CAExD;AAED,wBAAgB,SAAS,IAAI,cAAc,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE,CAExE;AAED,0EAA0E;AAC1E,wBAAsB,OAAO,CAAC,CAAC,GAAG,OAAO,EACvC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CA4EzB;AAED,4CAA4C;AAC5C,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerTool = registerTool;
|
|
4
|
-
exports.getTool = getTool;
|
|
5
|
-
exports.listTools = listTools;
|
|
6
|
-
exports.runTool = runTool;
|
|
7
|
-
exports._clearToolsForTesting = _clearToolsForTesting;
|
|
8
|
-
const tools = new Map();
|
|
9
|
-
function registerTool(def) {
|
|
10
|
-
if (tools.has(def.name)) {
|
|
11
|
-
throw new Error(`Tool already registered: ${def.name}`);
|
|
12
|
-
}
|
|
13
|
-
tools.set(def.name, def);
|
|
14
|
-
}
|
|
15
|
-
function getTool(name) {
|
|
16
|
-
return tools.get(name);
|
|
17
|
-
}
|
|
18
|
-
function listTools() {
|
|
19
|
-
return Array.from(tools.values());
|
|
20
|
-
}
|
|
21
|
-
/** Execute a tool by name with structured validation + error wrapping. */
|
|
22
|
-
async function runTool(name, rawInput, ctx) {
|
|
23
|
-
const start = Date.now();
|
|
24
|
-
const tool = tools.get(name);
|
|
25
|
-
if (!tool) {
|
|
26
|
-
return {
|
|
27
|
-
ok: false,
|
|
28
|
-
error: { code: "TOOL_NOT_FOUND", message: `Unknown tool: ${name}` },
|
|
29
|
-
durationMs: Date.now() - start,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const parsed = tool.inputSchema.safeParse(rawInput);
|
|
33
|
-
if (!parsed.success) {
|
|
34
|
-
return {
|
|
35
|
-
ok: false,
|
|
36
|
-
error: {
|
|
37
|
-
code: "INPUT_INVALID",
|
|
38
|
-
message: parsed.error.issues
|
|
39
|
-
.map((i) => `${i.path.join(".")}: ${i.message}`)
|
|
40
|
-
.join("; "),
|
|
41
|
-
},
|
|
42
|
-
durationMs: Date.now() - start,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
try {
|
|
46
|
-
const output = await tool.handler(parsed.data, ctx);
|
|
47
|
-
const validatedOutput = tool.outputSchema.safeParse(output);
|
|
48
|
-
if (!validatedOutput.success) {
|
|
49
|
-
return {
|
|
50
|
-
ok: false,
|
|
51
|
-
error: {
|
|
52
|
-
code: "OUTPUT_INVALID",
|
|
53
|
-
message: `Tool ${name} returned malformed output: ${validatedOutput.error.message}`,
|
|
54
|
-
},
|
|
55
|
-
durationMs: Date.now() - start,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
ok: true,
|
|
60
|
-
output: validatedOutput.data,
|
|
61
|
-
durationMs: Date.now() - start,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
catch (err) {
|
|
65
|
-
// Tools that wrap provider calls with `withProviderFallback` rethrow a
|
|
66
|
-
// ProviderFallbackExhaustedError carrying the failure class — surface it
|
|
67
|
-
// so the executor can decide between re-plan / degrade / fail.
|
|
68
|
-
const fe = err;
|
|
69
|
-
if (fe?.isProviderFallbackExhaustedError) {
|
|
70
|
-
return {
|
|
71
|
-
ok: false,
|
|
72
|
-
error: {
|
|
73
|
-
code: `PROVIDER_FALLBACK_${(fe.classification ?? "unknown").toUpperCase()}`,
|
|
74
|
-
message: fe.message ?? "provider fallback exhausted",
|
|
75
|
-
classification: fe.classification,
|
|
76
|
-
needsReplan: fe.needsReplan,
|
|
77
|
-
attemptedProviders: fe.attemptedProviders,
|
|
78
|
-
},
|
|
79
|
-
durationMs: Date.now() - start,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
ok: false,
|
|
84
|
-
error: {
|
|
85
|
-
code: "TOOL_THREW",
|
|
86
|
-
message: err instanceof Error ? err.message : String(err),
|
|
87
|
-
},
|
|
88
|
-
durationMs: Date.now() - start,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/** Test-only: drop all registered tools. */
|
|
93
|
-
function _clearToolsForTesting() {
|
|
94
|
-
tools.clear();
|
|
95
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ToolDefinition } from "../toolRegistry";
|
|
3
|
-
/**
|
|
4
|
-
* Reference grounding — single highest-leverage accuracy multiplier.
|
|
5
|
-
*
|
|
6
|
-
* Pulls a TikTok / IG / YT video URL, runs scene detection + transcript +
|
|
7
|
-
* beat detection, returns structural features the planner can use as priors:
|
|
8
|
-
* pacing (cuts/sec), hook structure (where the first cut lands), shot count,
|
|
9
|
-
* music tempo, transcript excerpt.
|
|
10
|
-
*
|
|
11
|
-
* Heavy lifting (download, ffmpeg, scene detection) is host-side. Tool layer
|
|
12
|
-
* is host-agnostic, so the host wires the analyzer fn at boot.
|
|
13
|
-
*/
|
|
14
|
-
export type ReferenceAnalyzerFn = (url: string) => Promise<{
|
|
15
|
-
durationMs: number;
|
|
16
|
-
sceneCount: number;
|
|
17
|
-
hookMs: number;
|
|
18
|
-
cutsPerSecond: number;
|
|
19
|
-
bpm?: number;
|
|
20
|
-
transcriptExcerpt?: string;
|
|
21
|
-
}>;
|
|
22
|
-
export declare function setReferenceAnalyzer(fn: ReferenceAnalyzerFn): void;
|
|
23
|
-
declare const InputSchema: z.ZodObject<{
|
|
24
|
-
url: z.ZodString;
|
|
25
|
-
}, z.core.$strip>;
|
|
26
|
-
declare const OutputSchema: z.ZodObject<{
|
|
27
|
-
durationMs: z.ZodNumber;
|
|
28
|
-
sceneCount: z.ZodNumber;
|
|
29
|
-
hookMs: z.ZodNumber;
|
|
30
|
-
cutsPerSecond: z.ZodNumber;
|
|
31
|
-
bpm: z.ZodOptional<z.ZodNumber>;
|
|
32
|
-
transcriptExcerpt: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
export declare const analyzeReferenceTool: ToolDefinition<typeof InputSchema, typeof OutputSchema>;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=analyzeReference.tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeReference.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/analyzeReference.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC,CAAC;AAGH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,mBAAmB,GAAG,IAAI,CAElE;AAED,QAAA,MAAM,WAAW;;iBAKf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;iBAOhB,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAC/C,OAAO,WAAW,EAClB,OAAO,YAAY,CAqBpB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.analyzeReferenceTool = void 0;
|
|
4
|
-
exports.setReferenceAnalyzer = setReferenceAnalyzer;
|
|
5
|
-
const zod_1 = require("zod");
|
|
6
|
-
const toolRegistry_1 = require("../toolRegistry");
|
|
7
|
-
let injectedAnalyzer = null;
|
|
8
|
-
function setReferenceAnalyzer(fn) {
|
|
9
|
-
injectedAnalyzer = fn;
|
|
10
|
-
}
|
|
11
|
-
const InputSchema = zod_1.z.object({
|
|
12
|
-
url: zod_1.z
|
|
13
|
-
.string()
|
|
14
|
-
.url()
|
|
15
|
-
.describe("Public TikTok / IG / YouTube URL the user dropped as a 'make it like this'."),
|
|
16
|
-
});
|
|
17
|
-
const OutputSchema = zod_1.z.object({
|
|
18
|
-
durationMs: zod_1.z.number().positive(),
|
|
19
|
-
sceneCount: zod_1.z.number().int().nonnegative(),
|
|
20
|
-
hookMs: zod_1.z.number().nonnegative(),
|
|
21
|
-
cutsPerSecond: zod_1.z.number().nonnegative(),
|
|
22
|
-
bpm: zod_1.z.number().positive().optional(),
|
|
23
|
-
transcriptExcerpt: zod_1.z.string().optional(),
|
|
24
|
-
});
|
|
25
|
-
exports.analyzeReferenceTool = {
|
|
26
|
-
name: "analyze_reference",
|
|
27
|
-
description: [
|
|
28
|
-
"Extract structural features from a reference video URL. Use ONCE at the",
|
|
29
|
-
"start of intent capture if the user provided a 'make it like this' link;",
|
|
30
|
-
"feed the result into the planner so it inherits pacing/hook structure.",
|
|
31
|
-
"Do NOT call this multiple times for the same url — cache the result on",
|
|
32
|
-
"the brief.references[].analyzed field instead.",
|
|
33
|
-
].join(" "),
|
|
34
|
-
inputSchema: InputSchema,
|
|
35
|
-
outputSchema: OutputSchema,
|
|
36
|
-
idempotent: true,
|
|
37
|
-
handler: async (input) => {
|
|
38
|
-
if (!injectedAnalyzer) {
|
|
39
|
-
throw new Error("analyze_reference: no analyzer wired. Host must call setReferenceAnalyzer() at boot.");
|
|
40
|
-
}
|
|
41
|
-
return injectedAnalyzer(input.url);
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
(0, toolRegistry_1.registerTool)(exports.analyzeReferenceTool);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { EVideoGenModels } from "../../../globals/aiModels";
|
|
3
|
-
import { ToolDefinition } from "../toolRegistry";
|
|
4
|
-
declare const InputSchema: z.ZodObject<{
|
|
5
|
-
imageUrl: z.ZodString;
|
|
6
|
-
motionHint: z.ZodString;
|
|
7
|
-
modelKey: z.ZodDefault<z.ZodEnum<typeof EVideoGenModels>>;
|
|
8
|
-
durationSec: z.ZodDefault<z.ZodNumber>;
|
|
9
|
-
aspectRatio: z.ZodDefault<z.ZodEnum<{
|
|
10
|
-
"9:16": "9:16";
|
|
11
|
-
"1:1": "1:1";
|
|
12
|
-
"16:9": "16:9";
|
|
13
|
-
}>>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
declare const OutputSchema: z.ZodObject<{
|
|
16
|
-
status: z.ZodLiteral<"triggered">;
|
|
17
|
-
taskId: z.ZodString;
|
|
18
|
-
raw: z.ZodUnknown;
|
|
19
|
-
modelKeyUsed: z.ZodOptional<z.ZodString>;
|
|
20
|
-
attemptedProviders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
export declare const animateImageTool: ToolDefinition<typeof InputSchema, typeof OutputSchema>;
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=animateImage.tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animateImage.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/animateImage.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI5D,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAW/D,QAAA,MAAM,WAAW;;;;;;;;;;iBAkBf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;iBAMhB,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAC3C,OAAO,WAAW,EAClB,OAAO,YAAY,CAwFpB,CAAC"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.animateImageTool = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const aiModels_1 = require("../../../globals/aiModels");
|
|
6
|
-
const logger_1 = require("../../../utils/logger");
|
|
7
|
-
const aiGenFactory_service_1 = require("../../aiGen/aiGenFactory.service");
|
|
8
|
-
const rateLimiter_1 = require("../../rateLimiter");
|
|
9
|
-
const toolRegistry_1 = require("../toolRegistry");
|
|
10
|
-
const chains_1 = require("../providerFallback/chains");
|
|
11
|
-
const withFallback_1 = require("../providerFallback/withFallback");
|
|
12
|
-
const InputSchema = zod_1.z.object({
|
|
13
|
-
imageUrl: zod_1.z.string().url().describe("Source still — output of generate_image or stock pull."),
|
|
14
|
-
motionHint: zod_1.z
|
|
15
|
-
.string()
|
|
16
|
-
.min(1)
|
|
17
|
-
.describe('Plain-language motion direction, e.g. "slow zoom-in, subtle parallax", "subject turns left then smiles".'),
|
|
18
|
-
modelKey: zod_1.z
|
|
19
|
-
.nativeEnum(aiModels_1.EVideoGenModels)
|
|
20
|
-
.default(aiModels_1.EVideoGenModels.KLING_V2_5_TURBO)
|
|
21
|
-
.describe("I2V-capable model. Defaults to kling-v2.5-turbo (good cost/quality). runway-gen4-turbo for stronger motion control."),
|
|
22
|
-
durationSec: zod_1.z.number().int().min(2).max(10).default(5),
|
|
23
|
-
// AG-16: 4:5 removed — no video provider supports it (Instagram-feed aspect
|
|
24
|
-
// is image-only). If the planner asked for 4:5 it'd dead-end the chain.
|
|
25
|
-
aspectRatio: zod_1.z.enum(["9:16", "16:9", "1:1"]).default("9:16"),
|
|
26
|
-
});
|
|
27
|
-
const OutputSchema = zod_1.z.object({
|
|
28
|
-
status: zod_1.z.literal("triggered"),
|
|
29
|
-
taskId: zod_1.z.string(),
|
|
30
|
-
raw: zod_1.z.unknown(),
|
|
31
|
-
modelKeyUsed: zod_1.z.string().optional(),
|
|
32
|
-
attemptedProviders: zod_1.z.array(zod_1.z.string()).optional(),
|
|
33
|
-
});
|
|
34
|
-
exports.animateImageTool = {
|
|
35
|
-
name: "animate_image",
|
|
36
|
-
description: [
|
|
37
|
-
"Animate a still image into a short clip (T2 image-to-video). Use after",
|
|
38
|
-
"generate_image or search_stock when you need camera/subject motion but a",
|
|
39
|
-
"full T3 text-to-video would be overkill. Always cheaper than generate_video",
|
|
40
|
-
"for the same length because the still locks composition and saves the model",
|
|
41
|
-
"from inventing the frame.",
|
|
42
|
-
"Examples:",
|
|
43
|
-
' { imageUrl: "https://...", motionHint: "slow dolly-in, parallax foreground" }',
|
|
44
|
-
' { imageUrl: "https://...", motionHint: "subject turns to camera and nods", modelKey: "runway-gen4-turbo" }',
|
|
45
|
-
].join(" "),
|
|
46
|
-
inputSchema: InputSchema,
|
|
47
|
-
outputSchema: OutputSchema,
|
|
48
|
-
idempotent: false,
|
|
49
|
-
estimateCost: async (input) => Math.ceil(input.durationSec * 4),
|
|
50
|
-
handler: async (input) => {
|
|
51
|
-
const chain = (0, chains_1.buildVideoChain)(input.modelKey, chains_1.T2_IMAGE_TO_VIDEO_CHAIN);
|
|
52
|
-
const outcome = await (0, withFallback_1.withProviderFallback)({
|
|
53
|
-
providers: chain,
|
|
54
|
-
capable: (m) => (0, chains_1.isVideoModelCapable)(m, {
|
|
55
|
-
aspect: input.aspectRatio,
|
|
56
|
-
durationSec: input.durationSec,
|
|
57
|
-
type: "image-to-video",
|
|
58
|
-
}),
|
|
59
|
-
onAttempt: (a) => {
|
|
60
|
-
if (a.classification) {
|
|
61
|
-
logger_1.logger.warn("animate_image provider attempt failed", {
|
|
62
|
-
provider: String(a.provider),
|
|
63
|
-
classification: a.classification.classification,
|
|
64
|
-
needsReplan: a.classification.needsReplan,
|
|
65
|
-
err: a.classification.message,
|
|
66
|
-
durationMs: a.durationMs,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
call: async (modelKey) => {
|
|
71
|
-
// See generate_video.tool — slot is held through return; TaskPoller
|
|
72
|
-
// releases on settle. Release here on submit error so the fallback
|
|
73
|
-
// chain can try the next provider without leaking concurrency.
|
|
74
|
-
const limiter = (0, rateLimiter_1.getAiGenModelRateLimiter)(modelKey);
|
|
75
|
-
await limiter.waitUntilAvailable();
|
|
76
|
-
let heldSlot = true;
|
|
77
|
-
try {
|
|
78
|
-
const provider = (0, aiGenFactory_service_1.getAiGenProviderService)(modelKey);
|
|
79
|
-
const result = await provider.generateVideo({
|
|
80
|
-
prompt: input.motionHint,
|
|
81
|
-
modelKey,
|
|
82
|
-
duration: input.durationSec,
|
|
83
|
-
aspectRatio: input.aspectRatio,
|
|
84
|
-
inputImageUrl: input.imageUrl,
|
|
85
|
-
type: "image-to-video",
|
|
86
|
-
});
|
|
87
|
-
const taskId = result.task?.taskId ??
|
|
88
|
-
result.task?.id ??
|
|
89
|
-
(typeof result.task === "string" ? result.task : "unknown");
|
|
90
|
-
if (taskId === "unknown") {
|
|
91
|
-
limiter.releaseSlot();
|
|
92
|
-
heldSlot = false;
|
|
93
|
-
}
|
|
94
|
-
return { taskId, raw: result.task, modelKey };
|
|
95
|
-
}
|
|
96
|
-
catch (err) {
|
|
97
|
-
if (heldSlot)
|
|
98
|
-
limiter.releaseSlot();
|
|
99
|
-
throw err;
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
if (!outcome.ok) {
|
|
104
|
-
throw new withFallback_1.ProviderFallbackExhaustedError(outcome.classification.classification, outcome.needsReplan, outcome.attempts.map((a) => String(a.provider)), `animate_image: chain exhausted (${outcome.classification.classification}): ${outcome.classification.message}`);
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
status: "triggered",
|
|
108
|
-
taskId: outcome.value.taskId,
|
|
109
|
-
raw: outcome.value.raw,
|
|
110
|
-
modelKeyUsed: outcome.value.modelKey,
|
|
111
|
-
attemptedProviders: outcome.attempts.map((a) => String(a.provider)),
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
(0, toolRegistry_1.registerTool)(exports.animateImageTool);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { EVideoGenModels } from "../../../globals/aiModels";
|
|
3
|
-
import { ToolDefinition } from "../toolRegistry";
|
|
4
|
-
declare const InputSchema: z.ZodObject<{
|
|
5
|
-
imageUrl: z.ZodString;
|
|
6
|
-
motionHint: z.ZodString;
|
|
7
|
-
staticMaskUrl: z.ZodOptional<z.ZodString>;
|
|
8
|
-
dynamicMasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9
|
-
maskUrl: z.ZodString;
|
|
10
|
-
trajectories: z.ZodArray<z.ZodObject<{
|
|
11
|
-
x: z.ZodNumber;
|
|
12
|
-
y: z.ZodNumber;
|
|
13
|
-
}, z.core.$strip>>;
|
|
14
|
-
}, z.core.$strip>>>;
|
|
15
|
-
modelKey: z.ZodDefault<z.ZodEnum<typeof EVideoGenModels>>;
|
|
16
|
-
durationSec: z.ZodDefault<z.ZodNumber>;
|
|
17
|
-
aspectRatio: z.ZodDefault<z.ZodEnum<{
|
|
18
|
-
"9:16": "9:16";
|
|
19
|
-
"1:1": "1:1";
|
|
20
|
-
"16:9": "16:9";
|
|
21
|
-
}>>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
declare const OutputSchema: z.ZodObject<{
|
|
24
|
-
status: z.ZodLiteral<"triggered">;
|
|
25
|
-
taskId: z.ZodString;
|
|
26
|
-
raw: z.ZodUnknown;
|
|
27
|
-
modelKeyUsed: z.ZodOptional<z.ZodString>;
|
|
28
|
-
attemptedProviders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
export declare const animateImageWithMotionBrushTool: ToolDefinition<typeof InputSchema, typeof OutputSchema>;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=animateImageWithMotionBrush.tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animateImageWithMotionBrush.tool.d.ts","sourceRoot":"","sources":["../../../../src/services/agent/tools/animateImageWithMotionBrush.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,EAAgB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAiC/D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;iBAiCf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;iBAMhB,CAAC;AAEH,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAC1D,OAAO,WAAW,EAClB,OAAO,YAAY,CA+EpB,CAAC"}
|